scroll-margin-editable.html (1118B)
1 <!DOCTYPE html> 2 <html> 3 <link rel="help" href="https://drafts.csswg.org/css-scroll-snap-1/#scroll-margin" /> 4 <script src="/resources/testdriver.js"></script> 5 <script src="/resources/testdriver-actions.js"></script> 6 <script src="/resources/testdriver-vendor.js"></script> 7 <script src="/resources/testharness.js"></script> 8 <script src="/resources/testharnessreport.js"></script> 9 <script src="/dom/events/scrolling/scroll_support.js"></script> 10 <body> 11 <style> 12 html { 13 padding: 10rem; 14 border-bottom: solid silver 150vh; 15 } 16 .target { 17 scroll-margin-top: 8rem; 18 font-size: 2rem; 19 border: solid grey 1px; 20 } 21 </style> 22 <div contenteditable class="target" id="target"></div> 23 <script> 24 promise_test(async (t) => { 25 document.addEventListener("scroll", t.unreached_func( 26 "document scrolled for already-in-view target.")); 27 document.getElementById("target").focus(); 28 await test_driver.send_keys(target, "a"); 29 await waitForCompositorCommit(); 30 }, "already-in-view div should not cause a scroll upon focus."); 31 </script> 32 </body> 33 34 </html>