tor-browser

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

getComputedStyle-layout-dependent-removed-ib-sibling.html (1177B)


      1 <!doctype html>
      2 <title>getComputedStyle() returns the right style for layout-dependent properties for nodes that have had an IB sibling removed</title>
      3 <link rel="help" href="https://drafts.csswg.org/cssom/#dom-window-getcomputedstyle">
      4 <link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1585882">
      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 <style>
     10  div {
     11    width: 100%;
     12  }
     13 </style>
     14 <span>
     15  <div></div>
     16  <div></div>
     17 </span>
     18 <script>
     19 test(() => {
     20  let first = document.querySelector("div");
     21  let second = document.querySelector("div + div");
     22 
     23  let oldWidth = getComputedStyle(second).width;
     24  assert_true(oldWidth.indexOf("px") !== -1, "Should return the used value for width");
     25 
     26  first.remove();
     27 
     28  assert_equals(getComputedStyle(second).width, oldWidth, "Should return the used value for width (after sibling removal)");
     29 }, "getComputedStyle() should return the correct used value for nodes that have had an IB-split sibling removed");
     30 </script>