auto-004.html (1038B)
1 <!DOCTYPE html> 2 <link rel="help" href="https://drafts.csswg.org/css-sizing-4/#last-remembered"> 3 <title>Tests that contain-intrinsic-size: auto only works with content-visibility: auto, not just size containment</title> 4 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharnessreport.js"></script> 6 7 <div id="log"></div> 8 9 <div style="height: 2000px;"></div> 10 11 <div style="contain-intrinsic-size: auto 1px;" id="test"> 12 <div style="height: 50px;"></div> <!-- make 'test' have a 50px height --> 13 </div> 14 15 <script> 16 function finalize() { 17 el.style.contain = "size"; 18 log.innerText = el.offsetHeight; 19 // No content-visibility: auto, so this should remain 1. 20 assert_equals(el.offsetHeight, 1); 21 } 22 23 var t = async_test("contain-intrinsic-size: auto"); 24 25 var log = document.getElementById("log"); 26 var el = document.getElementById("test"); 27 var observer = new ResizeObserver(function() { 28 requestAnimationFrame(t.step_func_done(finalize)); 29 observer.unobserve(el); 30 }); 31 32 observer.observe(el); 33 el.offsetWidth; 34 35 </script>