descend-into-container-with-overflow.html (790B)
1 <!DOCTYPE html> 2 <script src="/resources/testharness.js"></script> 3 <script src="/resources/testharnessreport.js"></script> 4 <style> 5 6 body { height: 4000px; } 7 #outer { width: 300px; } 8 #zeroheight { height: 0px; } 9 #changer { height: 100px; background-color: red; } 10 #bottom { margin-top: 600px; } 11 12 </style> 13 <div id="outer"> 14 <div id="zeroheight"> 15 <div id="changer"></div> 16 <div id="bottom">bottom</div> 17 </div> 18 </div> 19 <script> 20 21 // Tests that the anchor selection algorithm descends into zero-height 22 // containers that have overflowing content. 23 24 test(() => { 25 document.scrollingElement.scrollTop = 200; 26 document.querySelector("#changer").style.height = "200px"; 27 assert_equals(document.scrollingElement.scrollTop, 300); 28 }, "Zero-height container with visible overflow."); 29 30 </script>