summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-scrollbars/scrollbar-width-004.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /testing/web-platform/tests/css/css-scrollbars/scrollbar-width-004.html
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/css/css-scrollbars/scrollbar-width-004.html')
-rw-r--r--testing/web-platform/tests/css/css-scrollbars/scrollbar-width-004.html154
1 files changed, 154 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-scrollbars/scrollbar-width-004.html b/testing/web-platform/tests/css/css-scrollbars/scrollbar-width-004.html
new file mode 100644
index 0000000000..bdd1cd61db
--- /dev/null
+++ b/testing/web-platform/tests/css/css-scrollbars/scrollbar-width-004.html
@@ -0,0 +1,154 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>CSS Scrollbars: scrollbar-width with vertical text, and vertical and horizontal scrollbars</title>
+<link rel="author" title="Felipe Erias Morandeira" href="mailto:felipeerias@gmail.com" />
+<link rel="help" href="https://www.w3.org/TR/css-scrollbars-1/" />
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/css/support/parsing-testcommon.js"></script>
+<style>
+ /* Use scrollbar-gutter to reserve space for the scrollbar. */
+ .container {
+ scrollbar-gutter: stable;
+ writing-mode: horizontal-tb;
+ overflow: auto;
+ height: 200px;
+ width: 200px;
+ margin: 1px;
+ padding: 0px;
+ border: none;
+ background: deepskyblue;
+ }
+
+ .content {
+ height: 300px;
+ width: 300px;
+ background: lightsalmon;
+ }
+
+ /* writing directions */
+ .vertical-lr {
+ writing-mode: vertical-lr;
+ }
+
+ .vertical-rl {
+ writing-mode: vertical-rl;
+ }
+
+ .container.auto {
+ scrollbar-width: auto;
+ }
+
+ .container.thin {
+ scrollbar-width: thin;
+ }
+
+ .container.none {
+ scrollbar-width: none;
+ }
+</style>
+<script type="text/javascript">
+
+ function performTest() {
+ setup({ explicit_done: true });
+
+ // vertical-lr
+
+ test(function () {
+ let container = document.getElementById('container_vlr_auto');
+ let content = document.getElementById('content_vlr_auto');
+ assert_less_than(container.offsetWidth, container.scrollWidth, "ltr auto scrollWidth");
+ assert_less_than(container.offsetHeight, container.scrollHeight, "ltr auto scrollHeight");
+ assert_less_than(container.clientWidth, container.offsetWidth, "ltr auto clientWidth");
+ assert_less_than(container.clientHeight, container.offsetHeight, "ltr auto clientHeight");
+ assert_equals(content.offsetLeft, container.offsetLeft, "ltr auto offsetLeft");
+ }, "vertical-lr, scrollbar-width auto");
+
+ test(function () {
+ let container = document.getElementById('container_vlr_thin');
+ let content = document.getElementById('content_vlr_thin');
+ assert_less_than(container.offsetWidth, container.scrollWidth, "ltr auto scrollWidth");
+ assert_less_than(container.offsetHeight, container.scrollHeight, "ltr auto scrollHeight");
+ assert_less_than(container.clientWidth, container.offsetWidth, "ltr auto clientWidth");
+ assert_less_than(container.clientHeight, container.offsetHeight, "ltr auto clientHeight");
+ assert_equals(content.offsetLeft, container.offsetLeft, "ltr auto offsetLeft");
+ }, "vertical-lr, scrollbar-width thin");
+
+ test(function () {
+ let container = document.getElementById('container_vlr_none');
+ let content = document.getElementById('content_vlr_none');
+ assert_less_than(container.offsetWidth, container.scrollWidth, "ltr auto scrollWidth");
+ assert_less_than(container.offsetHeight, container.scrollHeight, "ltr auto scrollHeight");
+ assert_equals(container.clientWidth, container.offsetWidth, "ltr auto clientWidth");
+ assert_equals(container.clientHeight, container.offsetHeight, "ltr auto clientHeight");
+ assert_equals(content.offsetLeft, container.offsetLeft, "ltr auto offsetLeft");
+ }, "vertical-lr, scrollbar-width none");
+
+ // vertical-rl
+
+ test(function () {
+ let container = document.getElementById('container_vrl_auto');
+ let content = document.getElementById('content_vrl_auto');
+ assert_less_than(container.offsetWidth, container.scrollWidth, "rtl auto scrollWidth");
+ assert_less_than(container.offsetHeight, container.scrollHeight, "rtl auto scrollHeight");
+ assert_less_than(container.clientWidth, container.offsetWidth, "rtl auto clientWidth");
+ assert_less_than(container.clientHeight, container.offsetHeight, "rtl auto clientHeight");
+ assert_less_than(content.offsetLeft, container.offsetLeft, "rtl auto offsetLeft");
+ }, "vertical-rl, scrollbar-width auto");
+
+ test(function () {
+ let container = document.getElementById('container_vrl_thin');
+ let content = document.getElementById('content_vrl_thin');
+ assert_less_than(container.offsetWidth, container.scrollWidth, "rtl auto scrollWidth");
+ assert_less_than(container.offsetHeight, container.scrollHeight, "rtl auto scrollHeight");
+ assert_less_than(container.clientWidth, container.offsetWidth, "rtl auto clientWidth");
+ assert_less_than(container.clientHeight, container.offsetHeight, "rtl auto clientHeight");
+ assert_less_than(content.offsetLeft, container.offsetLeft, "rtl auto offsetLeft");
+ }, "vertical-rl, scrollbar-width thin");
+
+ test(function () {
+ let container = document.getElementById('container_vrl_none');
+ let content = document.getElementById('content_vrl_none');
+ assert_less_than(container.offsetWidth, container.scrollWidth, "rtl auto scrollWidth");
+ assert_less_than(container.offsetHeight, container.scrollHeight, "rtl auto scrollHeight");
+ assert_equals(container.clientWidth, container.offsetWidth, "rtl auto clientWidth");
+ assert_equals(container.clientHeight, container.offsetHeight, "rtl auto clientHeight");
+ assert_less_than(content.offsetLeft, container.offsetLeft, "rtl auto offsetLeft");
+ }, "vertical-rl, scrollbar-width none");
+
+ done();
+ }
+
+</script>
+
+<body onload="performTest()">
+
+ Test scrollbar-width: both scrollbars, vertical-lr
+
+ <div class="container vertical-lr auto" id="container_vlr_auto">
+ <div class="content" id="content_vlr_auto">auto</div>
+ </div>
+
+ <div class="container vertical-lr thin" id="container_vlr_thin">
+ <div class="content" id="content_vlr_thin">thin</div>
+ </div>
+
+ <div class="container vertical-lr none" id="container_vlr_none">
+ <div class="content" id="content_vlr_none">none</div>
+ </div>
+
+ Test scrollbar-width: both scrollbars, vertical-rl
+
+ <div class="container vertical-rl auto" id="container_vrl_auto">
+ <div class="content" id="content_vrl_auto">auto</div>
+ </div>
+
+ <div class="container vertical-rl thin" id="container_vrl_thin">
+ <div class="content" id="content_vrl_thin">thin</div>
+ </div>
+
+ <div class="container vertical-rl none" id="container_vrl_none">
+ <div class="content" id="content_vrl_none">none</div>
+ </div>
+
+</body>