will-change-stacking-context-z-index-2.html (906B)
1 <!DOCTYPE html> 2 <title>CSS Test: `will-change: z-index`</title> 3 <link rel="author" title="Oriol Brufau" href="obrufau@igalia.com"> 4 <link rel="help" href="https://www.w3.org/TR/css-will-change/#valdef-will-change-custom-ident"> 5 <link rel="help" href="https://www.w3.org/TR/css-flexbox-1/#painting"> 6 <link rel="help" href="https://github.com/w3c/csswg-drafts/issues/11827"> 7 <link rel="match" href="../reference/ref-filled-green-100px-square.xht"> 8 <meta name="assert" content=" 9 `will-change: z-index` establishes a stacking context on a flex item. 10 "> 11 <style> 12 .test { 13 will-change: z-index; 14 width: 100px; 15 background: red; 16 } 17 .test::before { 18 content: ""; 19 display: block; 20 position: relative; 21 z-index: -1; 22 height: 100px; 23 background: green; 24 } 25 </style> 26 <p>Test passes if there is a filled green square and <strong>no red</strong>.</p> 27 <div style="display: flex"> 28 <div class="test"></div> 29 </div>