Status: FAIL | Duration: 11ms | Subtests: 0/1 | Open test on wpt.live | Open ref on wpt.live | wpt.fyi
/css/css-overflow/scrollbar-gutter-root-both-edges.html
<!doctype html> <meta charset="utf-8"> <title>CSS Overflow: scrollbar-gutter on the root element</title> <link rel="help" href="https://drafts.csswg.org/css-overflow-4/#scrollbar-gutter-property"> <link rel="match" href="scrollbar-gutter-root-both-edges-ref.html"> <style> body,html { background-color: blue; margin: 10px; padding: 10px; border: 5px solid black; } body{ border: 5px solid green; } :root { scrollbar-gutter: stable both-edges; } p { background-color: purple; color: white; } div { position:absolute; left:-20px; top:150px; background-color: green; width: 100px; height: 100px; transform: translateZ(0); } </style> <p id="content">Should not have space around me in the inline axis.</p> <div></div>
/css/css-overflow/scrollbar-gutter-root-both-edges-ref.html
<!doctype html> <meta charset="utf-8"> <title>CSS Overflow: scrollbar-gutter on the root element</title> <link rel="help" href="https://drafts.csswg.org/css-overflow-4/#scrollbar-gutter-property"> <style> html { background-color: blue; margin: 10px; padding: 10px; border: 5px solid black; } body { margin: 10px; padding: 10px; border: 5px solid green; } #abspos { position:absolute; top: 150px; left: 15px; background-color: green; width: 80px; height: 100px; transform: translateZ(0); } p { background-color: purple; color: white; } </style> <div id="outer" style="width: 100px; height: 100px; overflow: scroll; left: -200px; position: absolute;"> <div id="inner" style="width: 100%; height: 200%;"></div> </div> <script> var outer = document.getElementById("outer"); var inner = document.getElementById("inner"); // Compute scrollbar gutter size and add it as margin to the root element var scrollbarWidthPlusMargin = String((outer.offsetWidth - inner.offsetWidth) + 10) + "px"; document.documentElement.style.marginRight = scrollbarWidthPlusMargin; document.documentElement.style.marginLeft = scrollbarWidthPlusMargin; </script> <p id="content">Should not have space around me in the inline axis.</p> <div id="abspos"></div>