inline-size-containment.html (1129B)
1 <!doctype html> 2 <title>CSS Container Queries Test: query of inline-size container is affected by min-width property</title> 3 <link rel="help" href="https://drafts.csswg.org/css-conditional-5/#size-container"> 4 <link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org"> 5 <style> 6 #keg { container-type: inline-size; } 7 @container (max-width: 200px) { 8 #target { height: 400px; } 9 } 10 @container (min-width: 400px) { 11 #target { height: 20px; } 12 } 13 </style> 14 <div id="ancestry"> 15 <div id="keg"> 16 <div id="target"> 17 <div style="height:50px;"></div> 18 </div> 19 </div> 20 </div> 21 <script src="/resources/testharness.js"></script> 22 <script src="/resources/testharnessreport.js"></script> 23 <script src="support/cq-testcommon.js"></script> 24 <script> 25 setup(() => assert_implements_size_container_queries()); 26 27 test(()=> { 28 ancestry.style.width = "100px"; 29 assert_equals(keg.offsetHeight, 400); 30 31 ancestry.style.width = "300px"; 32 assert_equals(keg.offsetHeight, 50); 33 34 ancestry.style.width = "500px"; 35 assert_equals(keg.offsetHeight, 20); 36 }, "inline-size containment only"); 37 </script>