wrapped-text.html (633B)
1 <!DOCTYPE html> 2 <script src="/resources/testharness.js"></script> 3 <script src="/resources/testharnessreport.js"></script> 4 <style> 5 6 body { 7 position: absolute; 8 font-size: 100px; 9 width: 200px; 10 height: 4000px; 11 line-height: 100px; 12 } 13 14 </style> 15 abc <b id=b>def</b> ghi 16 <script> 17 18 // Tests anchoring to a text node that is moved by preceding text. 19 20 test(() => { 21 var b = document.querySelector("#b"); 22 var preText = b.previousSibling; 23 document.scrollingElement.scrollTop = 150; 24 preText.nodeValue = "abcd efg "; 25 assert_equals(document.scrollingElement.scrollTop, 250); 26 }, "Anchoring with text wrapping changes."); 27 28 </script>