tor-browser

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

target-pseudo-after-reinsertion.html (935B)


      1 <!DOCTYPE html>
      2 <link rel=author href="mailto:jarhar@chromium.org">
      3 <link rel=help href="https://bugs.chromium.org/p/chromium/issues/detail?id=1252507">
      4 <link rel=help href="https://html.spec.whatwg.org/multipage/browsing-the-web.html#target-element">
      5 <link rel=help href="https://github.com/whatwg/html/issues/10029">
      6 <script src="/resources/testharness.js"></script>
      7 <script src="/resources/testharnessreport.js"></script>
      8 
      9 <div id=target>target</div>
     10 
     11 <script>
     12 test(() => {
     13  const target = document.getElementById('target');
     14  window.location.href = '#target';
     15  assert_equals(document.querySelector(':target'), target,
     16    ':target should match before reinsertion.');
     17 
     18  target.remove();
     19  document.body.appendChild(target);
     20  assert_equals(document.querySelector(':target'), target,
     21    ':target should match after reinsertion.');
     22 }, ':target should match the target element even after it is removed and reinserted.');
     23 </script>