File tree Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Original file line number Diff line number Diff line change 371
371
assert_equals ( getComputedStyle ( c ) . zIndex , 'auto' ) ;
372
372
} , 'Implicit rule within nested @scope (proximity)' ) ;
373
373
</ script >
374
+
375
+ < template id =test_nested_scope_inside_an_is >
376
+ < div >
377
+ < style >
378
+ @scope (.a) {
379
+ .b {
380
+ /* When nesting, because we’re inside a defined scope,
381
+ the `:scope` should reference the scoping root node properly, and
382
+ check for the presence of an extra class on it, essentially
383
+ being equal to `:scope.x .b { z-index: 1 }`. */
384
+ & : is (: scope .x * ) {
385
+ z-index : 1 ;
386
+ }
387
+ /* This should not match, as we have a defined scope, and should
388
+ not skip to the root. */
389
+ & : is (: root : scope * ) {
390
+ z-index : 2 ;
391
+ }
392
+ }
393
+ /* The nested case can be though of the following when expanded: */
394
+ .c : is (: scope .x * ) {
395
+ z-index : 3 ;
396
+ }
397
+ }
398
+ </ style >
399
+ < div class ="b ">
400
+ </ div >
401
+ < div class ="a x ">
402
+ < div class ="b ">
403
+ </ div >
404
+ < div class ="c ">
405
+ </ div >
406
+ </ div >
407
+ </ div >
408
+ </ template >
409
+ < script >
410
+ test ( ( t ) => {
411
+ t . add_cleanup ( ( ) => main . replaceChildren ( ) ) ;
412
+ main . append ( test_nested_scope_inside_an_is . content . cloneNode ( true ) ) ;
413
+
414
+ let b_outside = document . querySelector ( '.b' ) ;
415
+ let b_inside = document . querySelector ( '.a .b' ) ;
416
+ let c = document . querySelector ( '.c' ) ;
417
+ assert_equals ( getComputedStyle ( b_outside ) . zIndex , 'auto' ) ;
418
+ assert_equals ( getComputedStyle ( b_inside ) . zIndex , '1' ) ;
419
+ assert_equals ( getComputedStyle ( c ) . zIndex , '3' ) ;
420
+ } , 'Nested :scope inside an :is' ) ;
421
+ </ script >
You can’t perform that action at this time.
0 commit comments