Bug 1835529 [wpt PR 40276] - WebKit export of https://bugs.webkit.org/show_bug.cgi...
[gecko.git] / testing / web-platform / tests / css / css-scrollbars / scrollbar-width-011.html
bloba5f60dc28b0cf9d09953b714e56bab8cbf7f8b67
1 <!doctype html>
2 <meta charset="utf-8">
3 <title>CSS Scrollbars: scrollbar-width thin on the root overrides ::-webkit-scrollbar on the root</title>
4 <link rel="author" title="Luke Warlow" href="mailto:luke@warlow.dev" />
5 <link rel="help" href="https://drafts.csswg.org/css-scrollbars-1/" />
6 <script src="/resources/testharness.js"></script>
7 <script src="/resources/testharnessreport.js"></script>
8 <script src="/css/support/parsing-testcommon.js"></script>
9 <style>
10 :root {
11 scrollbar-width: thin;
14 :root::-webkit-scrollbar {
15 display: none;
18 :root,
19 body {
20 margin: 0;
21 padding: 0;
24 #content {
25 height: 10vh;
26 width: 100%;
27 background: lightsalmon;
30 #expander {
31 /* force vertical scroll */
32 height: 200vh;
33 width: 300px;
34 background: gray;
36 </style>
38 <body>
40 <div id="content"></div>
42 <div id="expander"></div>
44 <script>
45 test(function () {
46 let root = document.documentElement;
47 let body = document.body;
48 let content = document.getElementById('content');
50 assert_less_than(root.offsetWidth, window.innerWidth, "viewport has a scrollbar");
51 assert_equals(body.offsetWidth, root.offsetWidth, "body matches root");
52 assert_equals(content.offsetWidth, body.offsetWidth, "content matches body");
53 }, "scrollbar-width thin on the root overrides ::-webkit-scrollbar");
54 </script>
55 </body>