OLD | NEW |
1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
2 <html> | |
3 <head> | |
4 <style> | 2 <style> |
5 div { | 3 .red { |
6 width: 10px; | 4 position: absolute; |
7 height: 10px; | 5 width: 100px; |
8 background: green; | 6 height: 200px; |
9 isolation:isolate; | 7 background-color: red; |
10 } | 8 z-index: 0; |
| 9 } |
| 10 .green { |
| 11 width: 100px; |
| 12 height: 100px; |
| 13 background-color: green; |
| 14 z-index: -1; |
| 15 } |
| 16 .isolate { |
| 17 width: 100px; |
| 18 height: 100px; |
| 19 isolation: isolate; |
| 20 } |
| 21 .layer { |
| 22 transform: translateZ(0); |
| 23 } |
11 </style> | 24 </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 | 25 |
17 <script src="../../resources/js-test.js"></script> | 26 <div class="red"></div> |
18 <script> | 27 <div class="isolate"> |
19 // Software path. | 28 <div class="green"></div> |
20 var zIndex = getComputedStyle(document.getElementById("isolator")).zInde
x; | 29 </div> |
21 shouldBeZero(zIndex); | 30 <div class="isolate layer"> |
22 | 31 <div class="green"></div> |
23 // Hardware path. | 32 </div> |
24 zIndex = getComputedStyle(document.getElementById("isolator_accelerated"
)).zIndex; | |
25 shouldBeZero(zIndex); | |
26 </script> | |
27 </body> | |
28 </html> | |
OLD | NEW |