getComputedStyle-width-scroll.tentative.html (1094B)
1 <!doctype html> 2 <title>getComputedStyle() round-trips in presence of scrollbars.</title> 3 <link rel="author" href="mailto:emilio@crisal.io" title="Emilio Cobos Álvarez"> 4 <link rel="author" href="https://mozilla.org" title="Mozilla"> 5 <link rel="help" href="https://drafts.csswg.org/cssom/#resolved-value"> 6 <script src=/resources/testharness.js></script> 7 <script src=/resources/testharnessreport.js></script> 8 <div style="width: 100px; height: 100px; overflow: scroll"></div> 9 <script> 10 // NOTE(emilio): This is a .tentative.html because the spec is not clear on 11 // what the used value of `width` or `height` is, but I think this behavior 12 // should be uncontroversial. 13 test(function() { 14 let e = document.querySelector("div"); 15 let cs = getComputedStyle(e); 16 17 let originalWidth = cs.width; 18 let originalHeight = cs.height; 19 20 e.style.width = originalWidth; 21 e.style.height = originalHeight; 22 23 assert_equals(cs.width, originalWidth, "width round-trips"); 24 assert_equals(cs.height, originalHeight, "height round-trips"); 25 }, "getComputedStyle() round-trips in presence of scrollbars") 26 </script>