transform-007.html (1507B)
1 <!DOCTYPE html> 2 <html class="reftest-wait"> 3 <title>Anchor with changing transform</title> 4 <link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org"> 5 <link rel="help" href="https://drafts.csswg.org/css-anchor-position-1/#determining-position"> 6 <style> 7 .anchored { 8 position: absolute; 9 position-anchor: --a; 10 background: green; 11 } 12 #anchor { 13 width: 20px; 14 height: 20px; 15 margin-left: 20px; 16 transform: scale(3); 17 transform-origin: top left; 18 anchor-name: --a; 19 background: green; 20 } 21 </style> 22 <link rel="match" href="../reference/ref-filled-green-100px-square.xht"> 23 <p>Test passes if there is a filled green square and <strong>no red</strong>.</p> 24 <div style="position:relative; width:100px; height:100px; background:red;"> 25 <div style="height:30px;"></div> 26 <div id="anchor"></div> 27 <div class="anchored" style="position-area:left span-all; width:100%; height:100px;"></div> 28 <div class="anchored" style="position-area:right span-all; width:40px; height:100%;"></div> 29 <div class="anchored" style="position-area:top center; width:40px; height:100%;"></div> 30 <div class="anchored" style="position-area:bottom center; width:100%; height:100%;"></div> 31 </div> 32 <script> 33 requestAnimationFrame(()=> { 34 requestAnimationFrame(()=> { 35 anchor.style.transform = "scale(2)"; 36 document.documentElement.classList.remove("reftest-wait"); 37 }); 38 }); 39 </script> 40 </html>