tor-browser

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

empty-root-margin.html (953B)


      1 <!DOCTYPE html>
      2 <meta name="viewport" content="width=device-width,initial-scale=1">
      3 <script src="/resources/testharness.js"></script>
      4 <script src="/resources/testharnessreport.js"></script>
      5 
      6 <style>
      7 #target {
      8  width: 100px;
      9  height: 100px;
     10  background-color: green;
     11 }
     12 </style>
     13 
     14 <div id="target"></div>
     15 
     16 <script>
     17 var target = document.getElementById("target");
     18 async_test((t) => {
     19    var observer = new IntersectionObserver(t.step_func_done((entries) => {
     20        var rootBounds = entries[0].rootBounds;
     21        assert_equals(rootBounds.left, 0);
     22        assert_equals(rootBounds.right, document.documentElement.clientWidth);
     23        assert_equals(rootBounds.top, 0);
     24        assert_equals(rootBounds.bottom, document.documentElement.clientHeight);
     25        observer.disconnect();
     26    }), { rootMargin: "" });
     27    observer.observe(document.getElementById("target"));
     28 }, "An empty rootMargin string is interpreted as a margin of size zero");
     29 </script>