tor-browser

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

mapped-attribute-adopt-001.html (938B)


      1 <!doctype html>
      2 <title>Adoption doesn't mess with mapped attributes</title>
      3 <link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
      4 <link rel="author" title="Mozilla" href="https://mozilla.org">
      5 <link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1636516">
      6 <script src="/resources/testharness.js"></script>
      7 <script src="/resources/testharnessreport.js"></script>
      8 <div hidden="unlikely">Should be hidden</div>
      9 <script>
     10 test(function() {
     11  var tmpl = document.createElement("template");
     12  var fragment = tmpl.content;
     13  var newEl = document.createElement("div");
     14  newEl.setAttribute("hidden", "unlikely");
     15  fragment.append(newEl);
     16  document.adoptNode(newEl);
     17  assert_equals(
     18    getComputedStyle(document.querySelector("div")).display,
     19    "none",
     20    "hidden attribute should have an effect"
     21  );
     22 }, "Adoption of an unrelated node shouldn't prevent mapped attributes from applying");
     23 </script>