OLD | NEW |
---|---|
1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
2 <html> | 2 <script src="../../resources/testharness.js"></script> |
3 <head> | 3 <script src="../../resources/testharnessreport.js"></script> |
4 | |
4 <style> | 5 <style> |
5 div { | 6 div { |
6 width: 10px; | 7 width: 10px; |
7 height: 10px; | 8 height: 10px; |
8 background: green; | 9 background: green; |
9 isolation:isolate; | 10 isolation: isolate; |
10 } | 11 } |
11 </style> | 12 </style> |
12 <!-- Isolation should create a stacking context. Test if "isolation:isolate" set s the zIndex to 0, instead of the default "auto" value. --> | |
13 <body> | |
14 <div id="isolator"></div> | |
15 <div id="isolator_accelerated" style="transform: translateZ(0)"></div> | |
16 | 13 |
17 <script src="../../resources/js-test.js"></script> | 14 <div id="isolator"></div> |
18 <script> | 15 <div id="isolator_accelerated" style="transform: translateZ(0)"></div> |
19 // Software path. | |
20 var zIndex = getComputedStyle(document.getElementById("isolator")).zInde x; | |
21 shouldBeZero(zIndex); | |
22 | 16 |
23 // Hardware path. | 17 <script> |
24 zIndex = getComputedStyle(document.getElementById("isolator_accelerated" )).zIndex; | 18 test(() => { |
25 shouldBeZero(zIndex); | 19 // Force style recalc. |
26 </script> | 20 getComputedStyle(isolator).zIndex; |
27 </body> | 21 getComputedStyle(isolator_accelerated).zIndex; |
28 </html> | 22 |
23 assert_true(internals.isStackingContext(isolator), 'software path'); | |
24 assert_true(internals.isStackingContext(isolator_accelerated), 'hardware path' ); | |
rune
2016/06/09 09:10:25
I think we should avoid adding new internals APIs.
alancutter (OOO until 2018)
2016/06/10 04:59:30
Done.
Removed the stacking context check from the
| |
25 }, 'CSS isolation should create a stacking context'); | |
26 </script> | |
OLD | NEW |