tor-browser

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

block-in-inline-insert-018.html (911B)


      1 <!DOCTYPE html>
      2 <meta name="assert" content="Test inserting a block-in-inline in the middle of existing block-in-inline">
      3 <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#anonymous-block-level" />
      4 <link rel="author" title="Koji Ishii" href="mailto:kojii@chromium.org" />
      5 <script src="/resources/testharness.js"></script>
      6 <script src="/resources/testharnessreport.js"></script>
      7 <body>
      8  <div>1</div>
      9  <span>
     10    <div id="b2">2</div>
     11    <div id="b4">4</div>
     12  </span>
     13 <script>
     14 document.body.offsetTop;
     15 
     16 // Both "2" and "4" are block-in-inline children.
     17 // Insert a block child "3" between them.
     18 const b3 = document.createElement('div');
     19 b3.appendChild(document.createTextNode('3'));
     20 b4.parentElement.insertBefore(b3, b4);
     21 
     22 // Check if "3" is between "2" and "4".
     23 test(() => {
     24  assert_greater_than(b3.offsetTop, b2.offsetTop);
     25  assert_less_than(b3.offsetTop, b4.offsetTop);
     26 });
     27 </script>
     28 </body>