will-change-fixpos-cb-translate-1.html (1158B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS will-change: 'will-change: translate' creates a containing block for fixed positioned elements</title> 4 <link rel="author" title="Mozilla" href="http://www.mozilla.org/"> 5 <link rel="help" href="https://drafts.csswg.org/css-will-change-1/#will-change"> 6 <link rel="help" href="https://drafts.csswg.org/css-transforms-2/#propdef-translate"> 7 <link rel="match" href="green-square-100-by-100-offset-ref.html"> 8 <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."> 9 <style> 10 html, body { margin: 0; padding: 0; } 11 div { width: 100px; height: 100px } 12 #wc { will-change: translate; margin: 100px 0 0 100px; background: red } 13 .child { top: 0; left: 0; width: 50px; background: green } 14 #fixpos { position: fixed } 15 #abspos { position: absolute; left: 50px } 16 </style> 17 <body> 18 <div id="wc"> 19 <div class="child" id="fixpos"> 20 </div> 21 <div class="child" id="abspos"> 22 </div> 23 </div> 24 </body>