tor-browser

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

dynamic-root-element.html (1254B)


      1 <!doctype html>
      2 <meta charset="utf-8">
      3 <link rel="help" href="https://drafts.csswg.org/css-transitions/#starting">
      4 <link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1816672">
      5 <link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
      6 <link rel="author" title="Mozilla" href="https://mozilla.org">
      7 <script src="/resources/testharness.js"></script>
      8 <script src="/resources/testharnessreport.js"></script>
      9 <iframe></iframe>
     10 <script>
     11  let t = async_test("Transitions don't incorrectly start on dynamic document element insertion");
     12  window.onload = t.step_func_done(function() {
     13    let frame = document.querySelector("iframe");
     14    let doc = frame.contentDocument;
     15    doc.open();
     16    doc.write("<!doctype html>");
     17    let root = doc.createElement("html");
     18    root.innerHTML = `
     19      <style>
     20        div {
     21          width: 100px;
     22          height: 100px;
     23          background-color: blue;
     24          transition: margin-left 10s ease;
     25          margin-left: 100px;
     26        }
     27      </style>
     28      <div></div>
     29    `;
     30    doc.appendChild(root);
     31    doc.close();
     32    assert_equals(frame.contentWindow.getComputedStyle(doc.querySelector("div")).marginLeft, "100px", "Transition shouldn't have started");
     33  });
     34 </script>