tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

scrollIntoView-scrolling-box-with-large-border.html (965B)


      1 <!DOCTYPE html>
      2 
      3 <title>CSSOM View - scrollIntoView should account for the border of scrollable elements.</title>
      4 <link rel="help" href="https://drafts.csswg.org/cssom-view/#dom-element-scrollintoview">
      5 <link rel="author" title="Martin Robinson" href="mailto:mrobinson@igalia.com">
      6 <link rel="author" title="Oriol Brufau" href="mailto:obrufau@igalia.com">
      7 
      8 <script src="/resources/testharness.js"></script>
      9 <script src="/resources/testharnessreport.js"></script>
     10 
     11 <div id="scroller" style="overflow: scroll; border: solid 100px; width: 100px; height: 100px;">
     12    <div style="height: 1000px;"></div>
     13    <div id="target" style="background: green; width: 100px; height: 100px"></div>
     14    <div style="height: 1000px;"></div>
     15 </div>
     16 
     17 <script>
     18    test(function() {
     19        target.scrollIntoView();
     20        assert_equals(1000, scroller.scrollTop, "Should scroll the target into view.");
     21    }, "scrollIntoView takes into account the border of the scroller");
     22 </script>