tor-browser

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

test_text_update.html (967B)


      1 <!DOCTYPE html>
      2 <title>Test for Bug 876831</title>
      3 <script src="/tests/SimpleTest/SimpleTest.js"></script>
      4 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css">
      5 <body>
      6 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=876831">Mozilla Bug 876831</a>
      7 <p id="display"</p>
      8 
      9 <!--
     10  Test that the frame tree will be reflowed after a DOM mutation
     11  and just before an SVG DOM method does its work.
     12  -->
     13 
     14 <svg>
     15  <text>ab</text>
     16 </svg>
     17 
     18 <pre id="test">
     19 <script class="testbody" type="application/javascript">
     20 var text = document.querySelector("text");
     21 
     22 var length = text.getComputedTextLength();
     23 ok(length > 0, "text.getComputedTextLength() > 0");
     24 
     25 text.firstChild.nodeValue += "cd";
     26 ok(text.getComputedTextLength() > length, "text.getComputedTextLength() changes directly after DOM mutation");
     27 
     28 text.firstChild.remove();
     29 is(text.getComputedTextLength(), 0, "text.getComputedTextLength() == 0 after removing child");
     30 </script>
     31 </pre>