contain-paint-stacking-context-001b.html (963B)
1 <!DOCTYPE HTML> 2 <title>'will-change: contain' establishes stacking context.</title> 3 <link rel="author" title="Psychpsyo" href="mailto:psychpsyo@gmail.com"> 4 <link rel="help" href="https://drafts.csswg.org/css2/visuren.html#x43"> 5 <link rel="help" href="https://drafts.csswg.org/css-contain/#containment-paint"> 6 <link rel="match" href="contain-paint-stacking-context-001-ref.html"> 7 <style> 8 div { 9 width: 100px; 10 height: 100px; 11 } 12 #front { 13 background-color: green; 14 /* makes a stacking context and puts this on top */ 15 position: absolute; 16 z-index: 10; 17 } 18 #back { 19 will-change: contain; 20 } 21 #notOnTop { 22 background-color: red; 23 /* z-index is higher than on #front, but this should still be covered up because it is inside #back, which has 'will-change: contain' */ 24 position: absolute; 25 z-index: 1000; 26 } 27 </style> 28 <div id="front"></div> 29 <div id="back"> 30 <div id="notOnTop"></div> 31 </div> 32 Test succeeds if there is no red.