tor-browser

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

test_frame_reconstruction_body_table.html (1412B)


      1 <!DOCTYPE html>
      2 <html>
      3  <meta charset="utf-8">
      4  <title>
      5    Test for Bug 1630819: Test we don't reframe the html element when
      6    inserting a block element into a display:table body element.
      7  </title>
      8  <link rel="author" title="Ting-Yu Lin" href="mailto:tlin@mozilla.com">
      9  <link rel="author" title="Mozilla" href="http://www.mozilla.org/">
     10  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     11  <script src="/tests/SimpleTest/SimpleTest.js"></script>
     12 
     13  <script>
     14  SimpleTest.waitForExplicitFinish();
     15 
     16  const utils = SpecialPowers.getDOMWindowUtils(window);
     17 
     18  function runTest() {
     19    document.documentElement.offsetTop;
     20 
     21    const frameCountBeforeReframe = utils.framesConstructed;
     22 
     23    // We expect to construct one newly appended block, and the relevant pseudo
     24    // parents: TableRowGroup, TableRow, TableColGroup, TableCol, TableCell, and
     25    // TableCell's inner block.
     26    const expectedFrameConstructionCount = 1 + 6;
     27 
     28    let div = document.createElement("div");
     29    document.body.appendChild(div);
     30    document.documentElement.offsetTop;
     31 
     32    is(utils.framesConstructed - frameCountBeforeReframe,
     33       expectedFrameConstructionCount,
     34       "We shouldn't reframe <html> when appending a <div> into a display:table <body>!");
     35 
     36    SimpleTest.finish();
     37  }
     38  </script>
     39 
     40  <style>
     41  body {
     42    display: table;
     43  }
     44  </style>
     45 
     46  <body onload="runTest();"></body>
     47 </html>