will-change-fixpos-cb-transform-1.html (1224B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS will-change: 'will-change: transform' creates a containing block for fixed positioned elements</title> 4 <link rel="author" title="L. David Baron" href="https://dbaron.org/"> 5 <link rel="author" title="Mozilla" href="http://www.mozilla.org/"> 6 <link rel="help" href="https://drafts.csswg.org/css-will-change-1/#will-change"> 7 <link rel="help" href="http://www.w3.org/TR/css3-transforms/#transform-property"> 8 <link rel="match" href="green-square-100-by-100-offset-ref.html"> 9 <meta name="assert" content="If any non-initial value of a property would cause the element to generate a containing block for fixed-position elements, specifying that property in will-change must cause the element to generate a containing block for fixed-position elements."> 10 <style> 11 html, body { margin: 0; padding: 0; } 12 div { width: 100px; height: 100px } 13 #wc { will-change: transform; margin: 100px 0 0 100px; background: red } 14 .child { top: 0; left: 0; width: 50px; background: green } 15 #fixpos { position: fixed } 16 #abspos { position: absolute; left: 50px } 17 </style> 18 <body> 19 <div id="wc"> 20 <div class="child" id="fixpos"> 21 </div> 22 <div class="child" id="abspos"> 23 </div> 24 </div> 25 </body>