summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/cssom-view/scrollWidthHeight.xht
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /testing/web-platform/tests/css/cssom-view/scrollWidthHeight.xht
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/css/cssom-view/scrollWidthHeight.xht')
-rw-r--r--testing/web-platform/tests/css/cssom-view/scrollWidthHeight.xht111
1 files changed, 111 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/cssom-view/scrollWidthHeight.xht b/testing/web-platform/tests/css/cssom-view/scrollWidthHeight.xht
new file mode 100644
index 0000000000..1893051767
--- /dev/null
+++ b/testing/web-platform/tests/css/cssom-view/scrollWidthHeight.xht
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: CSSOM View scrollWidth and scrollHeight</title>
+ <link rel="author" title="Robert O'Callahan" href="mailto:robert@ocallahan.org" />
+ <link rel="help" href="http://www.w3.org/TR/cssom-view/#dom-element-scrollwidth" />
+ <meta name="flags" content="dom" />
+ <script src="/resources/testharness.js" type="text/javascript" />
+ <script src="/resources/testharnessreport.js" type="text/javascript" />
+ <style type="text/css"><![CDATA[
+ #elemSimple, #elemOverflow, #elemNestedOverflow {
+ border:1px solid black;
+ overflow:hidden;
+ width:200px;
+ height:40px;
+ padding-bottom:50px;
+ padding-right:40px;
+ }
+ #elemSimple > div {
+ background:yellow;
+ width:60px;
+ height:30px;
+ }
+ #elemOverflow > div {
+ background:yellow;
+ width:250px;
+ height:150px;
+ }
+ #elemNestedOverflow > div {
+ background:yellow;
+ width:60px;
+ height:30px;
+ }
+ #elemNestedOverflow > div > div {
+ background:blue;
+ width:250px;
+ height:150px;
+ }
+ ]]></style>
+ </head>
+ <body>
+ <noscript>Test not run - javascript required.</noscript>
+ <div id="log" />
+ <div id="elemSimple">
+ <div />
+ </div>
+ <div id="elemOverflow">
+ <div />
+ </div>
+ <div id="elemNestedOverflow">
+ <div>
+ <div />
+ </div>
+ </div>
+ <script type="text/javascript"><![CDATA[
+ var elemSimple = document.getElementById("elemSimple");
+ var elemOverflow = document.getElementById("elemOverflow");
+ var elemNestedOverflow = document.getElementById("elemNestedOverflow");
+
+ test(function(){
+ assert_equals(elemSimple.clientHeight, 90);
+ }, "elemSimple.clientHeight is the height of the padding edge");
+
+ test(function(){
+ assert_equals(elemSimple.scrollHeight, 90);
+ }, "elemSimple.scrollHeight is its clientHeight");
+
+ test(function(){
+ assert_equals(elemSimple.clientWidth, 240);
+ }, "elemSimple.clientWidth is the width of the padding edge");
+
+ test(function(){
+ assert_equals(elemSimple.scrollWidth, 240);
+ }, "elemSimple.scrollWidth is its clientWidth");
+
+ test(function(){
+ assert_equals(elemOverflow.clientHeight, 90);
+ }, "elemOverflow.clientHeight is the height of the padding edge");
+
+ test(function(){
+ assert_equals(elemOverflow.scrollHeight, 200);
+ }, "elemOverflow.scrollHeight is the height of its scrolled contents (including padding)");
+
+ test(function(){
+ assert_equals(elemOverflow.clientWidth, 240);
+ }, "elemOverflow.clientWidth is the width of the padding edge");
+
+ test(function(){
+ assert_equals(elemOverflow.scrollWidth, 290);
+ }, "elemOverflow.scrollHeight is the width of its scrolled contents (including padding)");
+
+ test(function(){
+ assert_equals(elemNestedOverflow.clientHeight, 90);
+ }, "elemNestedOverflow.clientHeight is the height of the padding edge");
+
+ test(function(){
+ assert_equals(elemNestedOverflow.scrollHeight, 150);
+ }, "elemNestedOverflow.scrollHeight is the height of its scrolled contents (ignoring padding)");
+
+ test(function(){
+ assert_equals(elemNestedOverflow.clientWidth, 240);
+ }, "elemNestedOverflow.clientWidth is the height of the padding edge");
+
+ test(function(){
+ assert_equals(elemNestedOverflow.scrollWidth, 250);
+ }, "elemNestedOverflow.scrollWidth is the width of its scrolled contents (ignoring padding)");
+
+ ]]></script>
+ </body>
+</html>