Synchronize CSSOM View test suite against upstream WPT
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Sep 2018 19:31:29 +0000 (19:31 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Sep 2018 19:31:29 +0000 (19:31 +0000)
https://bugs.webkit.org/show_bug.cgi?id=189787

Patch by Frederic Wang <fwang@igalia.com> on 2018-09-20
Reviewed by Antonio Gomes.

LayoutTests/imported/w3c:

* web-platform-tests/css/cssom-view/META.yml: Added.
* web-platform-tests/css/cssom-view/OWNERS: Removed.
* web-platform-tests/css/cssom-view/cssom-getBoundingClientRect-vertical-rl-expected.html: Added.
* web-platform-tests/css/cssom-view/cssom-getBoundingClientRect-vertical-rl.html: Added.
* web-platform-tests/css/cssom-view/cssom-view-window-screen-interface-expected.txt:
* web-platform-tests/css/cssom-view/cssom-view-window-screen-interface.html:
* web-platform-tests/css/cssom-view/dom-element-scroll-expected.txt: Added.
* web-platform-tests/css/cssom-view/dom-element-scroll.html: Added.
* web-platform-tests/css/cssom-view/elementFromPoint-mixed-font-sizes-expected.txt: Added.
* web-platform-tests/css/cssom-view/elementFromPoint-mixed-font-sizes.html: Added.
* web-platform-tests/css/cssom-view/interfaces-expected.txt:
* web-platform-tests/css/cssom-view/interfaces.html:
* web-platform-tests/css/cssom-view/media-query-list-interface-expected.txt: Removed.
* web-platform-tests/css/cssom-view/media-query-list-interface.xht: Removed.
* web-platform-tests/css/cssom-view/resources/w3c-import.log:
* web-platform-tests/css/cssom-view/scroll-behavior-default-css-expected.txt: Added.
* web-platform-tests/css/cssom-view/scroll-behavior-default-css.html: Added.
* web-platform-tests/css/cssom-view/scroll-behavior-element-expected.txt: Added.
* web-platform-tests/css/cssom-view/scroll-behavior-element.html: Added.
* web-platform-tests/css/cssom-view/scroll-behavior-main-frame-root-expected.txt: Added.
* web-platform-tests/css/cssom-view/scroll-behavior-main-frame-root.html: Added.
* web-platform-tests/css/cssom-view/scroll-behavior-main-frame-window-expected.txt: Added.
* web-platform-tests/css/cssom-view/scroll-behavior-main-frame-window.html: Added.
* web-platform-tests/css/cssom-view/scroll-behavior-scrollintoview-nested-expected.txt: Added.
* web-platform-tests/css/cssom-view/scroll-behavior-scrollintoview-nested.html: Added.
* web-platform-tests/css/cssom-view/scroll-behavior-smooth-positions-expected.txt: Added.
* web-platform-tests/css/cssom-view/scroll-behavior-smooth-positions.html: Added.
* web-platform-tests/css/cssom-view/scroll-behavior-subframe-root-expected.txt: Added.
* web-platform-tests/css/cssom-view/scroll-behavior-subframe-root.html: Added.
* web-platform-tests/css/cssom-view/scroll-behavior-subframe-window-expected.txt: Added.
* web-platform-tests/css/cssom-view/scroll-behavior-subframe-window.html: Added.
* web-platform-tests/css/cssom-view/scrollIntoView-vertical-rl-writing-mode-expected.txt: Added.
* web-platform-tests/css/cssom-view/scrollIntoView-vertical-rl-writing-mode.html: Added.
* web-platform-tests/css/cssom-view/support/scroll-behavior.js: Added.
(observeScrolling):
(waitForScrollEnd):
(scrollNode):
(scrollWindow):
* web-platform-tests/css/cssom-view/support/support/w3c-import.log:
* web-platform-tests/css/cssom-view/support/w3c-import.log:
* web-platform-tests/css/cssom-view/table-client-props-expected.txt: Added.
* web-platform-tests/css/cssom-view/table-client-props.html: Added.
* web-platform-tests/css/cssom-view/table-offset-props-expected.txt: Added.
* web-platform-tests/css/cssom-view/table-offset-props.html: Added.
* web-platform-tests/css/cssom-view/table-scroll-props-expected.txt: Added.
* web-platform-tests/css/cssom-view/table-scroll-props.html: Added.
* web-platform-tests/css/cssom-view/w3c-import.log:
* web-platform-tests/css/cssom-view/window-interface-expected.txt: Removed.
* web-platform-tests/css/cssom-view/window-interface.xht: Removed.

LayoutTests:

* tests-options.json: Mark smooth scrolling tests as slow.
* ios/TestExpectations: Mark as failing since frames are not scrollable on iOS.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236274 268f45cc-cd09-0410-ab3c-d52691b4dbfc

49 files changed:
LayoutTests/ChangeLog
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/META.yml [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/OWNERS [deleted file]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/cssom-getBoundingClientRect-vertical-rl-expected.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/cssom-getBoundingClientRect-vertical-rl.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/cssom-view-window-screen-interface-expected.txt
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/cssom-view-window-screen-interface.html
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/dom-element-scroll-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/dom-element-scroll.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/elementFromPoint-mixed-font-sizes-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/elementFromPoint-mixed-font-sizes.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/interfaces-expected.txt
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/interfaces.html
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/media-query-list-interface-expected.txt [deleted file]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/media-query-list-interface.xht [deleted file]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/resources/w3c-import.log
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-default-css-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-default-css.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-element-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-element.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-main-frame-root-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-main-frame-root.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-main-frame-window-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-main-frame-window.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-scrollintoview-nested-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-scrollintoview-nested.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-smooth-positions-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-smooth-positions.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-root-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-root.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-window-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-window.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-vertical-rl-writing-mode-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-vertical-rl-writing-mode.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/support/scroll-behavior.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/support/support/w3c-import.log
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/support/w3c-import.log
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/table-client-props-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/table-client-props.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/table-offset-props-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/table-offset-props.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/table-scroll-props-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/table-scroll-props.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/w3c-import.log
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/window-interface-expected.txt [deleted file]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/window-interface.xht [deleted file]
LayoutTests/platform/ios/TestExpectations
LayoutTests/tests-options.json

index aaff346..032c316 100644 (file)
@@ -1,3 +1,13 @@
+2018-09-20  Frederic Wang  <fwang@igalia.com>
+
+        Synchronize CSSOM View test suite against upstream WPT
+        https://bugs.webkit.org/show_bug.cgi?id=189787
+
+        Reviewed by Antonio Gomes.
+
+        * tests-options.json: Mark smooth scrolling tests as slow.
+        * ios/TestExpectations: Mark as failing since frames are not scrollable on iOS.
+
 2018-09-20  Justin Michaud  <justin_michaud@apple.com>
 
         Implement CSS Custom Properties and Values Skeleton
index bed9f05..da42047 100644 (file)
@@ -1,3 +1,60 @@
+2018-09-20  Frederic Wang  <fwang@igalia.com>
+
+        Synchronize CSSOM View test suite against upstream WPT
+        https://bugs.webkit.org/show_bug.cgi?id=189787
+
+        Reviewed by Antonio Gomes.
+
+        * web-platform-tests/css/cssom-view/META.yml: Added.
+        * web-platform-tests/css/cssom-view/OWNERS: Removed.
+        * web-platform-tests/css/cssom-view/cssom-getBoundingClientRect-vertical-rl-expected.html: Added.
+        * web-platform-tests/css/cssom-view/cssom-getBoundingClientRect-vertical-rl.html: Added.
+        * web-platform-tests/css/cssom-view/cssom-view-window-screen-interface-expected.txt:
+        * web-platform-tests/css/cssom-view/cssom-view-window-screen-interface.html:
+        * web-platform-tests/css/cssom-view/dom-element-scroll-expected.txt: Added.
+        * web-platform-tests/css/cssom-view/dom-element-scroll.html: Added.
+        * web-platform-tests/css/cssom-view/elementFromPoint-mixed-font-sizes-expected.txt: Added.
+        * web-platform-tests/css/cssom-view/elementFromPoint-mixed-font-sizes.html: Added.
+        * web-platform-tests/css/cssom-view/interfaces-expected.txt:
+        * web-platform-tests/css/cssom-view/interfaces.html:
+        * web-platform-tests/css/cssom-view/media-query-list-interface-expected.txt: Removed.
+        * web-platform-tests/css/cssom-view/media-query-list-interface.xht: Removed.
+        * web-platform-tests/css/cssom-view/resources/w3c-import.log:
+        * web-platform-tests/css/cssom-view/scroll-behavior-default-css-expected.txt: Added.
+        * web-platform-tests/css/cssom-view/scroll-behavior-default-css.html: Added.
+        * web-platform-tests/css/cssom-view/scroll-behavior-element-expected.txt: Added.
+        * web-platform-tests/css/cssom-view/scroll-behavior-element.html: Added.
+        * web-platform-tests/css/cssom-view/scroll-behavior-main-frame-root-expected.txt: Added.
+        * web-platform-tests/css/cssom-view/scroll-behavior-main-frame-root.html: Added.
+        * web-platform-tests/css/cssom-view/scroll-behavior-main-frame-window-expected.txt: Added.
+        * web-platform-tests/css/cssom-view/scroll-behavior-main-frame-window.html: Added.
+        * web-platform-tests/css/cssom-view/scroll-behavior-scrollintoview-nested-expected.txt: Added.
+        * web-platform-tests/css/cssom-view/scroll-behavior-scrollintoview-nested.html: Added.
+        * web-platform-tests/css/cssom-view/scroll-behavior-smooth-positions-expected.txt: Added.
+        * web-platform-tests/css/cssom-view/scroll-behavior-smooth-positions.html: Added.
+        * web-platform-tests/css/cssom-view/scroll-behavior-subframe-root-expected.txt: Added.
+        * web-platform-tests/css/cssom-view/scroll-behavior-subframe-root.html: Added.
+        * web-platform-tests/css/cssom-view/scroll-behavior-subframe-window-expected.txt: Added.
+        * web-platform-tests/css/cssom-view/scroll-behavior-subframe-window.html: Added.
+        * web-platform-tests/css/cssom-view/scrollIntoView-vertical-rl-writing-mode-expected.txt: Added.
+        * web-platform-tests/css/cssom-view/scrollIntoView-vertical-rl-writing-mode.html: Added.
+        * web-platform-tests/css/cssom-view/support/scroll-behavior.js: Added.
+        (observeScrolling):
+        (waitForScrollEnd):
+        (scrollNode):
+        (scrollWindow):
+        * web-platform-tests/css/cssom-view/support/support/w3c-import.log:
+        * web-platform-tests/css/cssom-view/support/w3c-import.log:
+        * web-platform-tests/css/cssom-view/table-client-props-expected.txt: Added.
+        * web-platform-tests/css/cssom-view/table-client-props.html: Added.
+        * web-platform-tests/css/cssom-view/table-offset-props-expected.txt: Added.
+        * web-platform-tests/css/cssom-view/table-offset-props.html: Added.
+        * web-platform-tests/css/cssom-view/table-scroll-props-expected.txt: Added.
+        * web-platform-tests/css/cssom-view/table-scroll-props.html: Added.
+        * web-platform-tests/css/cssom-view/w3c-import.log:
+        * web-platform-tests/css/cssom-view/window-interface-expected.txt: Removed.
+        * web-platform-tests/css/cssom-view/window-interface.xht: Removed.
+
 2018-09-19  YUHAN WU  <yuhan_wu@apple.com>
 
         MediaStream-MediaElement-srcObject.https.html expects video duration for a MediaStream to be Infinity and is currently NaN
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/META.yml b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/META.yml
new file mode 100644 (file)
index 0000000..a664494
--- /dev/null
@@ -0,0 +1,4 @@
+spec: https://drafts.csswg.org/cssom-view/
+suggested_reviewers:
+  - AutomatedTester
+  - plinss
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/OWNERS b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/OWNERS
deleted file mode 100644 (file)
index 5e0cb23..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-@AutomatedTester
-@plinss
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/cssom-getBoundingClientRect-vertical-rl-expected.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/cssom-getBoundingClientRect-vertical-rl-expected.html
new file mode 100644 (file)
index 0000000..1ee4fe2
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE html>
+<body style="overflow: scroll">
+  <div style="position: absolute; top: 50px; left: 50px; width: 200px; height: 200px; background: green"></div>
+</body>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/cssom-getBoundingClientRect-vertical-rl.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/cssom-getBoundingClientRect-vertical-rl.html
new file mode 100644 (file)
index 0000000..85ac2a9
--- /dev/null
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<title>CSSOM View - 6.1 - getBoundingClientRect tests</title>
+<link rel="help" href="http://www.w3.org/TR/cssom-view/#dom-element-getboundingclientrect">
+<link rel=match href="cssom-getBoundingClientRect-vertical-rl-ref.html">
+<meta name="flags" content="dom">
+<body style="writing-mode: vertical-rl; overflow: scroll">
+  <div id="target" style="position: absolute; top: 50px; left: 50px; width: 200px; height: 200px; background: red"></div>
+  <div id="overlay" style="position: absolute; background: green"></div>
+  <script>
+    var r = document.getElementById('target').getBoundingClientRect();
+    var overlay = document.getElementById('overlay');
+    overlay.style.top = r.top + 'px';
+    overlay.style.left = r.left + 'px';
+    overlay.style.width = r.width + 'px';
+    overlay.style.height = r.height + 'px';
+  </script>
+</body>
index eb395f5..2ca9ec7 100644 (file)
@@ -1,10 +1,4 @@
 
-PASS Screen.availWidth is readonly 
-PASS Screen.availHeight is readonly 
-PASS Screen.width is readonly 
-PASS Screen.height is readonly 
-PASS Screen.colorDepth is readonly 
-PASS Screen.pixelDepth is readonly 
 PASS window.screen.width >= 0 && window.screen.width < 6000000 
 PASS window.screen.height >= 0 && window.screen.height < 6000000 
 PASS window.screen.availWidth >= 0 && window.screen.availWidth <= window.screen.width 
index 7abd2e5..29802ac 100644 (file)
         <div id="myDiv"></div>
         <div id="log"></div>
         <script>
-        /*test readonly*/
-        test(function(){assert_readonly(window.screen, "availWidth");}, "Screen.availWidth is readonly");
-        test(function(){assert_readonly(window.screen, "availHeight");}, "Screen.availHeight is readonly");
-        test(function(){assert_readonly(window.screen, "width");}, "Screen.width is readonly");
-        test(function(){assert_readonly(window.screen, "height");}, "Screen.height is readonly");
-        test(function(){assert_readonly(window.screen, "colorDepth");}, "Screen.colorDepth is readonly");
-        test(function(){assert_readonly(window.screen, "pixelDepth");}, "Screen.pixelDepth is readonly");
-
-
         test(function(){assert_true(window.screen.width >= 0 && window.screen.width < 6000000);},
             "window.screen.width >= 0 && window.screen.width < 6000000");
         test(function(){assert_true(window.screen.height >= 0 && window.screen.height < 6000000);},
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/dom-element-scroll-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/dom-element-scroll-expected.txt
new file mode 100644 (file)
index 0000000..9c09a53
--- /dev/null
@@ -0,0 +1,6 @@
+
+PASS Element test for having scrolling box 
+PASS Element test for having overflow 
+PASS Element test for not having scrolling box 
+PASS Element test for not having overflow 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/dom-element-scroll.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/dom-element-scroll.html
new file mode 100644 (file)
index 0000000..3f3e27a
--- /dev/null
@@ -0,0 +1,100 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>dom-element-scroll tests</title>
+<link rel="help" href="https://drafts.csswg.org/cssom-view/#dom-element-scrolltop">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<style>
+    #section1 {
+        width: 300px;
+        height: 500px;
+        top: 16px;
+        left: 16px;
+        border: inset gray 3px;
+        background: white;
+    }
+
+    #scrollable {
+        width: 400px;
+        height: 700px;
+        background: linear-gradient(135deg, red, blue);
+    }
+
+    #section2 {
+        width: 300px;
+        height: 500px;
+        top: 16px;
+        left: 16px;
+        border: inset gray 3px;
+        background: white;
+    }
+
+    #unscrollable {
+        width: 200px;
+        height: 300px;
+        background: linear-gradient(135deg, red, blue);
+    }
+</style>
+<section id="section1">
+    <div id="scrollable"></div>
+</section>
+<section id="section2">
+    <div id="unscrollable"></div>
+</section>
+<script>
+    var section1 = document.getElementById("section1");
+    var section2 = document.getElementById("section2");
+
+    test(function () {
+        // let it be "hidden" to have scrolling box
+        section1.style.overflow = "hidden";
+
+        section1.scroll(50, 60);
+        assert_equals(section1.scrollLeft, 50, "changed scrollLeft should be 50");
+        assert_equals(section1.scrollTop, 60, "changed scrollTop should be 60");
+
+        section1.scroll(0, 0); // back to the origin
+    }, "Element test for having scrolling box");
+
+    test(function () {
+        section1.scroll(10, 20);
+        assert_equals(section1.scrollLeft, 10, "changed scrollLeft should be 10");
+        assert_equals(section1.scrollTop, 20, "changed scrollTop should be 20");
+
+        section1.scroll(0, 0); // back to the origin
+    }, "Element test for having overflow");
+
+    test(function () {
+        // make it not "hidden" to not have scrolling box
+        section1.style.overflow = "visible";
+
+        section1.scroll(50, 0);
+        assert_equals(section1.scrollLeft, 0, "changed scrollLeft should be 0");
+        assert_equals(section1.scrollTop, 0, "changed scrollTop should be 0");
+
+        section1.scroll(0, 60);
+        assert_equals(section1.scrollLeft, 0, "changed scrollLeft should be 0");
+        assert_equals(section1.scrollTop, 0, "changed scrollTop should be 0");
+
+        section1.scroll(50, 60);
+        assert_equals(section1.scrollLeft, 0, "changed scrollLeft should be 0");
+        assert_equals(section1.scrollTop, 0, "changed scrollTop should be 0");
+
+        section1.scroll(0, 0); // back to the origin
+    }, "Element test for not having scrolling box");
+
+    test(function () {
+        section2.scroll(0, 20);
+        assert_equals(section2.scrollLeft, 0, "changed scrollLeft should be 0");
+        assert_equals(section2.scrollTop, 0, "changed scrollTop should be 0");
+
+        section2.scroll(10, 0);
+        assert_equals(section2.scrollLeft, 0, "changed scrollLeft should be 0");
+        assert_equals(section2.scrollTop, 0, "changed scrollTop should be 0");
+
+        section2.scroll(10, 20);
+        assert_equals(section2.scrollLeft, 0, "changed scrollLeft should be 0");
+        assert_equals(section2.scrollTop, 0, "changed scrollTop should be 0");
+    }, "Element test for not having overflow");
+
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/elementFromPoint-mixed-font-sizes-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/elementFromPoint-mixed-font-sizes-expected.txt
new file mode 100644 (file)
index 0000000..632cda2
--- /dev/null
@@ -0,0 +1,7 @@
+XXX small YYY
+
+FAIL document.elementFromPoint finds container SPAN in the empty region above a child SPAN with a smaller font size assert_equals: expected Element node <span id="target">
+    XXX <span id="small" style="font-s... but got Element node <div style="font-size: 40px">
+  <span id="target">
+    XX...
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/elementFromPoint-mixed-font-sizes.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/elementFromPoint-mixed-font-sizes.html
new file mode 100644 (file)
index 0000000..e2bac90
--- /dev/null
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<link rel="help" href="http://www.w3.org/TR/cssom-view/#extensions-to-the-document-interface">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div style="font-size: 40px">
+  <span id="target">
+    XXX <span id="small" style="font-size:10px">small</span> YYY
+  </span>
+</div>
+<script>
+test(() => {
+  // Find a point in the empty region above the "small" span, but still inside
+  // the "target" span.
+  const small = document.getElementById('small');
+  const rect = small.getBoundingClientRect();
+  const x = rect.left + rect.width / 2;
+  const y = rect.top - 5;
+
+  const actual = document.elementFromPoint(x, y);
+  const target = document.getElementById('target');
+  assert_equals(actual, target);
+}, 'document.elementFromPoint finds container SPAN in the empty region above a child SPAN with a smaller font size');
+</script>
index 0a69075..b55c1ec 100644 (file)
-CONSOLE MESSAGE: line 482: callback not yet supported
-CONSOLE MESSAGE: line 482: callback not yet supported
-CONSOLE MESSAGE: line 482: callback not yet supported
-CONSOLE MESSAGE: line 482: callback not yet supported
-CONSOLE MESSAGE: line 482: callback not yet supported
-CONSOLE MESSAGE: line 482: callback not yet supported
-CONSOLE MESSAGE: line 482: callback not yet supported
 
 CSSOM View IDL tests
 
 
-PASS Test driver 
-PASS Partial interface Window: original interface defined 
-PASS Partial interface Document: original interface defined 
-PASS Partial interface Element: original interface defined 
-PASS Partial interface HTMLElement: original interface defined 
-PASS Partial interface HTMLImageElement: original interface defined 
-PASS Partial interface Range: original interface defined 
-PASS HTMLElement interface: attribute offsetParent 
-PASS HTMLElement interface: attribute offsetTop 
-PASS HTMLElement interface: attribute offsetLeft 
-PASS HTMLElement interface: attribute offsetWidth 
-PASS HTMLElement interface: attribute offsetHeight 
-PASS HTMLElement interface: document.createElement('div') must inherit property "offsetParent" with the proper type 
-PASS HTMLElement interface: document.createElement('div') must inherit property "offsetTop" with the proper type 
-PASS HTMLElement interface: document.createElement('div') must inherit property "offsetLeft" with the proper type 
-PASS HTMLElement interface: document.createElement('div') must inherit property "offsetWidth" with the proper type 
-PASS HTMLElement interface: document.createElement('div') must inherit property "offsetHeight" with the proper type 
-PASS Element interface: document.createElement('div') must inherit property "getClientRects()" with the proper type 
-PASS Element interface: document.createElement('div') must inherit property "getBoundingClientRect()" with the proper type 
-PASS Element interface: document.createElement('div') must inherit property "scrollIntoView([object Object],[object Object])" with the proper type 
-PASS Element interface: calling scrollIntoView([object Object],[object Object]) on document.createElement('div') with too few arguments must throw TypeError 
-PASS Element interface: document.createElement('div') must inherit property "scroll(ScrollToOptions)" with the proper type 
-PASS Element interface: calling scroll(ScrollToOptions) on document.createElement('div') with too few arguments must throw TypeError 
-PASS Element interface: document.createElement('div') must inherit property "scroll(unrestricted double, unrestricted double)" with the proper type 
-PASS Element interface: calling scroll(unrestricted double, unrestricted double) on document.createElement('div') with too few arguments must throw TypeError 
-PASS Element interface: document.createElement('div') must inherit property "scrollTo(ScrollToOptions)" with the proper type 
-PASS Element interface: calling scrollTo(ScrollToOptions) on document.createElement('div') with too few arguments must throw TypeError 
-PASS Element interface: document.createElement('div') must inherit property "scrollTo(unrestricted double, unrestricted double)" with the proper type 
-PASS Element interface: calling scrollTo(unrestricted double, unrestricted double) on document.createElement('div') with too few arguments must throw TypeError 
-PASS Element interface: document.createElement('div') must inherit property "scrollBy(ScrollToOptions)" with the proper type 
-PASS Element interface: calling scrollBy(ScrollToOptions) on document.createElement('div') with too few arguments must throw TypeError 
-PASS Element interface: document.createElement('div') must inherit property "scrollBy(unrestricted double, unrestricted double)" with the proper type 
-PASS Element interface: calling scrollBy(unrestricted double, unrestricted double) on document.createElement('div') with too few arguments must throw TypeError 
-PASS Element interface: document.createElement('div') must inherit property "scrollTop" with the proper type 
-PASS Element interface: document.createElement('div') must inherit property "scrollLeft" with the proper type 
-PASS Element interface: document.createElement('div') must inherit property "scrollWidth" with the proper type 
-PASS Element interface: document.createElement('div') must inherit property "scrollHeight" with the proper type 
-PASS Element interface: document.createElement('div') must inherit property "clientTop" with the proper type 
-PASS Element interface: document.createElement('div') must inherit property "clientLeft" with the proper type 
-PASS Element interface: document.createElement('div') must inherit property "clientWidth" with the proper type 
-PASS Element interface: document.createElement('div') must inherit property "clientHeight" with the proper type 
-FAIL Element interface: document.createElement('div') must inherit property "getBoxQuads(BoxQuadOptions)" with the proper type assert_inherits: property "getBoxQuads" not found in prototype chain
-FAIL Element interface: calling getBoxQuads(BoxQuadOptions) on document.createElement('div') with too few arguments must throw TypeError assert_inherits: property "getBoxQuads" not found in prototype chain
-FAIL Element interface: document.createElement('div') must inherit property "convertQuadFromNode(DOMQuadInit, GeometryNode, ConvertCoordinateOptions)" with the proper type assert_inherits: property "convertQuadFromNode" not found in prototype chain
-FAIL Element interface: calling convertQuadFromNode(DOMQuadInit, GeometryNode, ConvertCoordinateOptions) on document.createElement('div') with too few arguments must throw TypeError assert_inherits: property "convertQuadFromNode" not found in prototype chain
-FAIL Element interface: document.createElement('div') must inherit property "convertRectFromNode(DOMRectReadOnly, GeometryNode, ConvertCoordinateOptions)" with the proper type assert_inherits: property "convertRectFromNode" not found in prototype chain
-FAIL Element interface: calling convertRectFromNode(DOMRectReadOnly, GeometryNode, ConvertCoordinateOptions) on document.createElement('div') with too few arguments must throw TypeError assert_inherits: property "convertRectFromNode" not found in prototype chain
-FAIL Element interface: document.createElement('div') must inherit property "convertPointFromNode(DOMPointInit, GeometryNode, ConvertCoordinateOptions)" with the proper type assert_inherits: property "convertPointFromNode" not found in prototype chain
-FAIL Element interface: calling convertPointFromNode(DOMPointInit, GeometryNode, ConvertCoordinateOptions) on document.createElement('div') with too few arguments must throw TypeError assert_inherits: property "convertPointFromNode" not found in prototype chain
-PASS HTMLImageElement interface: attribute x 
-PASS HTMLImageElement interface: attribute y 
-PASS HTMLImageElement interface: document.createElement('img') must inherit property "x" with the proper type 
-PASS HTMLImageElement interface: document.createElement('img') must inherit property "y" with the proper type 
-PASS HTMLElement interface: document.createElement('img') must inherit property "offsetParent" with the proper type 
-PASS HTMLElement interface: document.createElement('img') must inherit property "offsetTop" with the proper type 
-PASS HTMLElement interface: document.createElement('img') must inherit property "offsetLeft" with the proper type 
-PASS HTMLElement interface: document.createElement('img') must inherit property "offsetWidth" with the proper type 
-PASS HTMLElement interface: document.createElement('img') must inherit property "offsetHeight" with the proper type 
-PASS Element interface: document.createElement('img') must inherit property "getClientRects()" with the proper type 
-PASS Element interface: document.createElement('img') must inherit property "getBoundingClientRect()" with the proper type 
-PASS Element interface: document.createElement('img') must inherit property "scrollIntoView([object Object],[object Object])" with the proper type 
-PASS Element interface: calling scrollIntoView([object Object],[object Object]) on document.createElement('img') with too few arguments must throw TypeError 
-PASS Element interface: document.createElement('img') must inherit property "scroll(ScrollToOptions)" with the proper type 
-PASS Element interface: calling scroll(ScrollToOptions) on document.createElement('img') with too few arguments must throw TypeError 
-PASS Element interface: document.createElement('img') must inherit property "scroll(unrestricted double, unrestricted double)" with the proper type 
-PASS Element interface: calling scroll(unrestricted double, unrestricted double) on document.createElement('img') with too few arguments must throw TypeError 
-PASS Element interface: document.createElement('img') must inherit property "scrollTo(ScrollToOptions)" with the proper type 
-PASS Element interface: calling scrollTo(ScrollToOptions) on document.createElement('img') with too few arguments must throw TypeError 
-PASS Element interface: document.createElement('img') must inherit property "scrollTo(unrestricted double, unrestricted double)" with the proper type 
-PASS Element interface: calling scrollTo(unrestricted double, unrestricted double) on document.createElement('img') with too few arguments must throw TypeError 
-PASS Element interface: document.createElement('img') must inherit property "scrollBy(ScrollToOptions)" with the proper type 
-PASS Element interface: calling scrollBy(ScrollToOptions) on document.createElement('img') with too few arguments must throw TypeError 
-PASS Element interface: document.createElement('img') must inherit property "scrollBy(unrestricted double, unrestricted double)" with the proper type 
-PASS Element interface: calling scrollBy(unrestricted double, unrestricted double) on document.createElement('img') with too few arguments must throw TypeError 
-PASS Element interface: document.createElement('img') must inherit property "scrollTop" with the proper type 
-PASS Element interface: document.createElement('img') must inherit property "scrollLeft" with the proper type 
-PASS Element interface: document.createElement('img') must inherit property "scrollWidth" with the proper type 
-PASS Element interface: document.createElement('img') must inherit property "scrollHeight" with the proper type 
-PASS Element interface: document.createElement('img') must inherit property "clientTop" with the proper type 
-PASS Element interface: document.createElement('img') must inherit property "clientLeft" with the proper type 
-PASS Element interface: document.createElement('img') must inherit property "clientWidth" with the proper type 
-PASS Element interface: document.createElement('img') must inherit property "clientHeight" with the proper type 
-FAIL Element interface: document.createElement('img') must inherit property "getBoxQuads(BoxQuadOptions)" with the proper type assert_inherits: property "getBoxQuads" not found in prototype chain
-FAIL Element interface: calling getBoxQuads(BoxQuadOptions) on document.createElement('img') with too few arguments must throw TypeError assert_inherits: property "getBoxQuads" not found in prototype chain
-FAIL Element interface: document.createElement('img') must inherit property "convertQuadFromNode(DOMQuadInit, GeometryNode, ConvertCoordinateOptions)" with the proper type assert_inherits: property "convertQuadFromNode" not found in prototype chain
-FAIL Element interface: calling convertQuadFromNode(DOMQuadInit, GeometryNode, ConvertCoordinateOptions) on document.createElement('img') with too few arguments must throw TypeError assert_inherits: property "convertQuadFromNode" not found in prototype chain
-FAIL Element interface: document.createElement('img') must inherit property "convertRectFromNode(DOMRectReadOnly, GeometryNode, ConvertCoordinateOptions)" with the proper type assert_inherits: property "convertRectFromNode" not found in prototype chain
-FAIL Element interface: calling convertRectFromNode(DOMRectReadOnly, GeometryNode, ConvertCoordinateOptions) on document.createElement('img') with too few arguments must throw TypeError assert_inherits: property "convertRectFromNode" not found in prototype chain
-FAIL Element interface: document.createElement('img') must inherit property "convertPointFromNode(DOMPointInit, GeometryNode, ConvertCoordinateOptions)" with the proper type assert_inherits: property "convertPointFromNode" not found in prototype chain
-FAIL Element interface: calling convertPointFromNode(DOMPointInit, GeometryNode, ConvertCoordinateOptions) on document.createElement('img') with too few arguments must throw TypeError assert_inherits: property "convertPointFromNode" not found in prototype chain
-PASS Window interface: operation matchMedia(CSSOMString) 
-PASS Window interface: attribute screen 
-FAIL Window interface: operation moveTo(long, long) assert_equals: property has wrong .length expected 2 but got 0
-FAIL Window interface: operation moveBy(long, long) assert_equals: property has wrong .length expected 2 but got 0
-FAIL Window interface: operation resizeTo(long, long) assert_equals: property has wrong .length expected 2 but got 0
-FAIL Window interface: operation resizeBy(long, long) assert_equals: property has wrong .length expected 2 but got 0
-PASS Window interface: attribute innerWidth 
-PASS Window interface: attribute innerHeight 
-PASS Window interface: attribute scrollX 
-PASS Window interface: attribute pageXOffset 
-PASS Window interface: attribute scrollY 
-PASS Window interface: attribute pageYOffset 
-PASS Window interface: operation scroll(ScrollToOptions) 
-PASS Window interface: operation scroll(unrestricted double, unrestricted double) 
-PASS Window interface: operation scrollTo(ScrollToOptions) 
-PASS Window interface: operation scrollTo(unrestricted double, unrestricted double) 
-PASS Window interface: operation scrollBy(ScrollToOptions) 
-PASS Window interface: operation scrollBy(unrestricted double, unrestricted double) 
-PASS Window interface: attribute screenX 
-PASS Window interface: attribute screenY 
-PASS Window interface: attribute outerWidth 
-PASS Window interface: attribute outerHeight 
-PASS Window interface: attribute devicePixelRatio 
-PASS Window interface: window must inherit property "matchMedia(CSSOMString)" with the proper type 
-PASS Window interface: calling matchMedia(CSSOMString) on window with too few arguments must throw TypeError 
-PASS Window interface: window must inherit property "screen" with the proper type 
-PASS Window interface: window must inherit property "moveTo(long, long)" with the proper type 
-FAIL Window interface: calling moveTo(long, long) on window with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
-            fn.apply(obj, args);
-        }" did not throw
-PASS Window interface: window must inherit property "moveBy(long, long)" with the proper type 
-FAIL Window interface: calling moveBy(long, long) on window with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
-            fn.apply(obj, args);
-        }" did not throw
-PASS Window interface: window must inherit property "resizeTo(long, long)" with the proper type 
-FAIL Window interface: calling resizeTo(long, long) on window with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
-            fn.apply(obj, args);
-        }" did not throw
-PASS Window interface: window must inherit property "resizeBy(long, long)" with the proper type 
-FAIL Window interface: calling resizeBy(long, long) on window with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
-            fn.apply(obj, args);
-        }" did not throw
-PASS Window interface: window must inherit property "innerWidth" with the proper type 
-PASS Window interface: window must inherit property "innerHeight" with the proper type 
-PASS Window interface: window must inherit property "scrollX" with the proper type 
-PASS Window interface: window must inherit property "pageXOffset" with the proper type 
-PASS Window interface: window must inherit property "scrollY" with the proper type 
-PASS Window interface: window must inherit property "pageYOffset" with the proper type 
-PASS Window interface: window must inherit property "scroll(ScrollToOptions)" with the proper type 
-PASS Window interface: calling scroll(ScrollToOptions) on window with too few arguments must throw TypeError 
-PASS Window interface: window must inherit property "scroll(unrestricted double, unrestricted double)" with the proper type 
-PASS Window interface: calling scroll(unrestricted double, unrestricted double) on window with too few arguments must throw TypeError 
-PASS Window interface: window must inherit property "scrollTo(ScrollToOptions)" with the proper type 
-PASS Window interface: calling scrollTo(ScrollToOptions) on window with too few arguments must throw TypeError 
-PASS Window interface: window must inherit property "scrollTo(unrestricted double, unrestricted double)" with the proper type 
-PASS Window interface: calling scrollTo(unrestricted double, unrestricted double) on window with too few arguments must throw TypeError 
-PASS Window interface: window must inherit property "scrollBy(ScrollToOptions)" with the proper type 
-PASS Window interface: calling scrollBy(ScrollToOptions) on window with too few arguments must throw TypeError 
-PASS Window interface: window must inherit property "scrollBy(unrestricted double, unrestricted double)" with the proper type 
-PASS Window interface: calling scrollBy(unrestricted double, unrestricted double) on window with too few arguments must throw TypeError 
-PASS Window interface: window must inherit property "screenX" with the proper type 
-PASS Window interface: window must inherit property "screenY" with the proper type 
-PASS Window interface: window must inherit property "outerWidth" with the proper type 
-PASS Window interface: window must inherit property "outerHeight" with the proper type 
-PASS Window interface: window must inherit property "devicePixelRatio" with the proper type 
-PASS WorkerGlobalScope interface: existence and properties of interface object 
-PASS DedicatedWorkerGlobalScope interface: existence and properties of interface object 
-PASS SharedWorkerGlobalScope interface: existence and properties of interface object 
-PASS WorkerNavigator interface: existence and properties of interface object 
-PASS WorkerLocation interface: existence and properties of interface object 
-PASS Document interface: operation elementFromPoint(double, double) 
-PASS Document interface: operation elementsFromPoint(double, double) 
-FAIL Document interface: operation caretPositionFromPoint(double, double) assert_own_property: interface prototype object missing non-static operation expected property "caretPositionFromPoint" missing
-PASS Document interface: attribute scrollingElement 
-FAIL Document interface: operation getBoxQuads(BoxQuadOptions) assert_own_property: interface prototype object missing non-static operation expected property "getBoxQuads" missing
-FAIL Document interface: operation convertQuadFromNode(DOMQuadInit, GeometryNode, ConvertCoordinateOptions) assert_own_property: interface prototype object missing non-static operation expected property "convertQuadFromNode" missing
-FAIL Document interface: operation convertRectFromNode(DOMRectReadOnly, GeometryNode, ConvertCoordinateOptions) assert_own_property: interface prototype object missing non-static operation expected property "convertRectFromNode" missing
-FAIL Document interface: operation convertPointFromNode(DOMPointInit, GeometryNode, ConvertCoordinateOptions) assert_own_property: interface prototype object missing non-static operation expected property "convertPointFromNode" missing
-PASS Document interface: document must inherit property "elementFromPoint(double, double)" with the proper type 
-PASS Document interface: calling elementFromPoint(double, double) on document with too few arguments must throw TypeError 
-PASS Document interface: document must inherit property "elementsFromPoint(double, double)" with the proper type 
-PASS Document interface: calling elementsFromPoint(double, double) on document with too few arguments must throw TypeError 
-FAIL Document interface: document must inherit property "caretPositionFromPoint(double, double)" with the proper type assert_inherits: property "caretPositionFromPoint" not found in prototype chain
-FAIL Document interface: calling caretPositionFromPoint(double, double) on document with too few arguments must throw TypeError assert_inherits: property "caretPositionFromPoint" not found in prototype chain
-PASS Document interface: document must inherit property "scrollingElement" with the proper type 
-FAIL Document interface: document must inherit property "getBoxQuads(BoxQuadOptions)" with the proper type assert_inherits: property "getBoxQuads" not found in prototype chain
-FAIL Document interface: calling getBoxQuads(BoxQuadOptions) on document with too few arguments must throw TypeError assert_inherits: property "getBoxQuads" not found in prototype chain
-FAIL Document interface: document must inherit property "convertQuadFromNode(DOMQuadInit, GeometryNode, ConvertCoordinateOptions)" with the proper type assert_inherits: property "convertQuadFromNode" not found in prototype chain
-FAIL Document interface: calling convertQuadFromNode(DOMQuadInit, GeometryNode, ConvertCoordinateOptions) on document with too few arguments must throw TypeError assert_inherits: property "convertQuadFromNode" not found in prototype chain
-FAIL Document interface: document must inherit property "convertRectFromNode(DOMRectReadOnly, GeometryNode, ConvertCoordinateOptions)" with the proper type assert_inherits: property "convertRectFromNode" not found in prototype chain
-FAIL Document interface: calling convertRectFromNode(DOMRectReadOnly, GeometryNode, ConvertCoordinateOptions) on document with too few arguments must throw TypeError assert_inherits: property "convertRectFromNode" not found in prototype chain
-FAIL Document interface: document must inherit property "convertPointFromNode(DOMPointInit, GeometryNode, ConvertCoordinateOptions)" with the proper type assert_inherits: property "convertPointFromNode" not found in prototype chain
-FAIL Document interface: calling convertPointFromNode(DOMPointInit, GeometryNode, ConvertCoordinateOptions) on document with too few arguments must throw TypeError assert_inherits: property "convertPointFromNode" not found in prototype chain
-PASS Element interface: operation getClientRects() 
-PASS Element interface: operation getBoundingClientRect() 
-PASS Element interface: operation scrollIntoView([object Object],[object Object]) 
-PASS Element interface: operation scroll(ScrollToOptions) 
-PASS Element interface: operation scroll(unrestricted double, unrestricted double) 
-PASS Element interface: operation scrollTo(ScrollToOptions) 
-PASS Element interface: operation scrollTo(unrestricted double, unrestricted double) 
-PASS Element interface: operation scrollBy(ScrollToOptions) 
-PASS Element interface: operation scrollBy(unrestricted double, unrestricted double) 
-PASS Element interface: attribute scrollTop 
-PASS Element interface: attribute scrollLeft 
-PASS Element interface: attribute scrollWidth 
-PASS Element interface: attribute scrollHeight 
-PASS Element interface: attribute clientTop 
-PASS Element interface: attribute clientLeft 
-PASS Element interface: attribute clientWidth 
-PASS Element interface: attribute clientHeight 
-FAIL Element interface: operation getBoxQuads(BoxQuadOptions) assert_own_property: interface prototype object missing non-static operation expected property "getBoxQuads" missing
-FAIL Element interface: operation convertQuadFromNode(DOMQuadInit, GeometryNode, ConvertCoordinateOptions) assert_own_property: interface prototype object missing non-static operation expected property "convertQuadFromNode" missing
-FAIL Element interface: operation convertRectFromNode(DOMRectReadOnly, GeometryNode, ConvertCoordinateOptions) assert_own_property: interface prototype object missing non-static operation expected property "convertRectFromNode" missing
-FAIL Element interface: operation convertPointFromNode(DOMPointInit, GeometryNode, ConvertCoordinateOptions) assert_own_property: interface prototype object missing non-static operation expected property "convertPointFromNode" missing
-PASS Element interface: document.createElementNS('x', 'y') must inherit property "getClientRects()" with the proper type 
-PASS Element interface: document.createElementNS('x', 'y') must inherit property "getBoundingClientRect()" with the proper type 
-PASS Element interface: document.createElementNS('x', 'y') must inherit property "scrollIntoView([object Object],[object Object])" with the proper type 
-PASS Element interface: calling scrollIntoView([object Object],[object Object]) on document.createElementNS('x', 'y') with too few arguments must throw TypeError 
-PASS Element interface: document.createElementNS('x', 'y') must inherit property "scroll(ScrollToOptions)" with the proper type 
-PASS Element interface: calling scroll(ScrollToOptions) on document.createElementNS('x', 'y') with too few arguments must throw TypeError 
-PASS Element interface: document.createElementNS('x', 'y') must inherit property "scroll(unrestricted double, unrestricted double)" with the proper type 
-PASS Element interface: calling scroll(unrestricted double, unrestricted double) on document.createElementNS('x', 'y') with too few arguments must throw TypeError 
-PASS Element interface: document.createElementNS('x', 'y') must inherit property "scrollTo(ScrollToOptions)" with the proper type 
-PASS Element interface: calling scrollTo(ScrollToOptions) on document.createElementNS('x', 'y') with too few arguments must throw TypeError 
-PASS Element interface: document.createElementNS('x', 'y') must inherit property "scrollTo(unrestricted double, unrestricted double)" with the proper type 
-PASS Element interface: calling scrollTo(unrestricted double, unrestricted double) on document.createElementNS('x', 'y') with too few arguments must throw TypeError 
-PASS Element interface: document.createElementNS('x', 'y') must inherit property "scrollBy(ScrollToOptions)" with the proper type 
-PASS Element interface: calling scrollBy(ScrollToOptions) on document.createElementNS('x', 'y') with too few arguments must throw TypeError 
-PASS Element interface: document.createElementNS('x', 'y') must inherit property "scrollBy(unrestricted double, unrestricted double)" with the proper type 
-PASS Element interface: calling scrollBy(unrestricted double, unrestricted double) on document.createElementNS('x', 'y') with too few arguments must throw TypeError 
-PASS Element interface: document.createElementNS('x', 'y') must inherit property "scrollTop" with the proper type 
-PASS Element interface: document.createElementNS('x', 'y') must inherit property "scrollLeft" with the proper type 
-PASS Element interface: document.createElementNS('x', 'y') must inherit property "scrollWidth" with the proper type 
-PASS Element interface: document.createElementNS('x', 'y') must inherit property "scrollHeight" with the proper type 
-PASS Element interface: document.createElementNS('x', 'y') must inherit property "clientTop" with the proper type 
-PASS Element interface: document.createElementNS('x', 'y') must inherit property "clientLeft" with the proper type 
-PASS Element interface: document.createElementNS('x', 'y') must inherit property "clientWidth" with the proper type 
-PASS Element interface: document.createElementNS('x', 'y') must inherit property "clientHeight" with the proper type 
-FAIL Element interface: document.createElementNS('x', 'y') must inherit property "getBoxQuads(BoxQuadOptions)" with the proper type assert_inherits: property "getBoxQuads" not found in prototype chain
-FAIL Element interface: calling getBoxQuads(BoxQuadOptions) on document.createElementNS('x', 'y') with too few arguments must throw TypeError assert_inherits: property "getBoxQuads" not found in prototype chain
-FAIL Element interface: document.createElementNS('x', 'y') must inherit property "convertQuadFromNode(DOMQuadInit, GeometryNode, ConvertCoordinateOptions)" with the proper type assert_inherits: property "convertQuadFromNode" not found in prototype chain
-FAIL Element interface: calling convertQuadFromNode(DOMQuadInit, GeometryNode, ConvertCoordinateOptions) on document.createElementNS('x', 'y') with too few arguments must throw TypeError assert_inherits: property "convertQuadFromNode" not found in prototype chain
-FAIL Element interface: document.createElementNS('x', 'y') must inherit property "convertRectFromNode(DOMRectReadOnly, GeometryNode, ConvertCoordinateOptions)" with the proper type assert_inherits: property "convertRectFromNode" not found in prototype chain
-FAIL Element interface: calling convertRectFromNode(DOMRectReadOnly, GeometryNode, ConvertCoordinateOptions) on document.createElementNS('x', 'y') with too few arguments must throw TypeError assert_inherits: property "convertRectFromNode" not found in prototype chain
-FAIL Element interface: document.createElementNS('x', 'y') must inherit property "convertPointFromNode(DOMPointInit, GeometryNode, ConvertCoordinateOptions)" with the proper type assert_inherits: property "convertPointFromNode" not found in prototype chain
-FAIL Element interface: calling convertPointFromNode(DOMPointInit, GeometryNode, ConvertCoordinateOptions) on document.createElementNS('x', 'y') with too few arguments must throw TypeError assert_inherits: property "convertPointFromNode" not found in prototype chain
-FAIL Text interface: operation getBoxQuads(BoxQuadOptions) assert_own_property: interface prototype object missing non-static operation expected property "getBoxQuads" missing
-FAIL Text interface: operation convertQuadFromNode(DOMQuadInit, GeometryNode, ConvertCoordinateOptions) assert_own_property: interface prototype object missing non-static operation expected property "convertQuadFromNode" missing
-FAIL Text interface: operation convertRectFromNode(DOMRectReadOnly, GeometryNode, ConvertCoordinateOptions) assert_own_property: interface prototype object missing non-static operation expected property "convertRectFromNode" missing
-FAIL Text interface: operation convertPointFromNode(DOMPointInit, GeometryNode, ConvertCoordinateOptions) assert_own_property: interface prototype object missing non-static operation expected property "convertPointFromNode" missing
-FAIL Text interface: document.createTextNode('x') must inherit property "getBoxQuads(BoxQuadOptions)" with the proper type assert_inherits: property "getBoxQuads" not found in prototype chain
-FAIL Text interface: calling getBoxQuads(BoxQuadOptions) on document.createTextNode('x') with too few arguments must throw TypeError assert_inherits: property "getBoxQuads" not found in prototype chain
-FAIL Text interface: document.createTextNode('x') must inherit property "convertQuadFromNode(DOMQuadInit, GeometryNode, ConvertCoordinateOptions)" with the proper type assert_inherits: property "convertQuadFromNode" not found in prototype chain
-FAIL Text interface: calling convertQuadFromNode(DOMQuadInit, GeometryNode, ConvertCoordinateOptions) on document.createTextNode('x') with too few arguments must throw TypeError assert_inherits: property "convertQuadFromNode" not found in prototype chain
-FAIL Text interface: document.createTextNode('x') must inherit property "convertRectFromNode(DOMRectReadOnly, GeometryNode, ConvertCoordinateOptions)" with the proper type assert_inherits: property "convertRectFromNode" not found in prototype chain
-FAIL Text interface: calling convertRectFromNode(DOMRectReadOnly, GeometryNode, ConvertCoordinateOptions) on document.createTextNode('x') with too few arguments must throw TypeError assert_inherits: property "convertRectFromNode" not found in prototype chain
-FAIL Text interface: document.createTextNode('x') must inherit property "convertPointFromNode(DOMPointInit, GeometryNode, ConvertCoordinateOptions)" with the proper type assert_inherits: property "convertPointFromNode" not found in prototype chain
-FAIL Text interface: calling convertPointFromNode(DOMPointInit, GeometryNode, ConvertCoordinateOptions) on document.createTextNode('x') with too few arguments must throw TypeError assert_inherits: property "convertPointFromNode" not found in prototype chain
-PASS Range interface: operation getClientRects() 
-PASS Range interface: operation getBoundingClientRect() 
-PASS Range interface: new Range() must inherit property "getClientRects()" with the proper type 
-PASS Range interface: new Range() must inherit property "getBoundingClientRect()" with the proper type 
-FAIL MediaQueryList interface: existence and properties of interface object assert_own_property: self does not have own property "MediaQueryList" expected property "MediaQueryList" missing
-FAIL MediaQueryList interface object length assert_own_property: self does not have own property "MediaQueryList" expected property "MediaQueryList" missing
-FAIL MediaQueryList interface object name assert_own_property: self does not have own property "MediaQueryList" expected property "MediaQueryList" missing
-FAIL MediaQueryList interface: existence and properties of interface prototype object assert_own_property: self does not have own property "MediaQueryList" expected property "MediaQueryList" missing
-FAIL MediaQueryList interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "MediaQueryList" expected property "MediaQueryList" missing
-FAIL MediaQueryList interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "MediaQueryList" expected property "MediaQueryList" missing
-FAIL MediaQueryList interface: attribute media assert_own_property: self does not have own property "MediaQueryList" expected property "MediaQueryList" missing
-FAIL MediaQueryList interface: attribute matches assert_own_property: self does not have own property "MediaQueryList" expected property "MediaQueryList" missing
-FAIL MediaQueryList interface: operation addListener(EventListener) assert_own_property: self does not have own property "MediaQueryList" expected property "MediaQueryList" missing
-FAIL MediaQueryList interface: operation removeListener(EventListener) assert_own_property: self does not have own property "MediaQueryList" expected property "MediaQueryList" missing
-FAIL MediaQueryList interface: attribute onchange assert_own_property: self does not have own property "MediaQueryList" expected property "MediaQueryList" missing
-FAIL MediaQueryList must be primary interface of matchMedia('all') assert_own_property: self does not have own property "MediaQueryList" expected property "MediaQueryList" missing
-PASS Stringification of matchMedia('all') 
-PASS MediaQueryList interface: matchMedia('all') must inherit property "media" with the proper type 
-PASS MediaQueryList interface: matchMedia('all') must inherit property "matches" with the proper type 
-PASS MediaQueryList interface: matchMedia('all') must inherit property "addListener(EventListener)" with the proper type 
-FAIL MediaQueryList interface: calling addListener(EventListener) on matchMedia('all') with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
-            fn.apply(obj, args);
-        }" did not throw
-PASS MediaQueryList interface: matchMedia('all') must inherit property "removeListener(EventListener)" with the proper type 
-FAIL MediaQueryList interface: calling removeListener(EventListener) on matchMedia('all') with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
-            fn.apply(obj, args);
-        }" did not throw
-FAIL MediaQueryList interface: matchMedia('all') must inherit property "onchange" with the proper type assert_inherits: property "onchange" not found in prototype chain
-FAIL MediaQueryListEvent interface: existence and properties of interface object assert_own_property: self does not have own property "MediaQueryListEvent" expected property "MediaQueryListEvent" missing
-FAIL MediaQueryListEvent interface object length assert_own_property: self does not have own property "MediaQueryListEvent" expected property "MediaQueryListEvent" missing
-FAIL MediaQueryListEvent interface object name assert_own_property: self does not have own property "MediaQueryListEvent" expected property "MediaQueryListEvent" missing
-FAIL MediaQueryListEvent interface: existence and properties of interface prototype object assert_own_property: self does not have own property "MediaQueryListEvent" expected property "MediaQueryListEvent" missing
-FAIL MediaQueryListEvent interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "MediaQueryListEvent" expected property "MediaQueryListEvent" missing
-FAIL MediaQueryListEvent interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "MediaQueryListEvent" expected property "MediaQueryListEvent" missing
-FAIL MediaQueryListEvent interface: attribute media assert_own_property: self does not have own property "MediaQueryListEvent" expected property "MediaQueryListEvent" missing
-FAIL MediaQueryListEvent interface: attribute matches assert_own_property: self does not have own property "MediaQueryListEvent" expected property "MediaQueryListEvent" missing
-FAIL MediaQueryListEvent must be primary interface of new MediaQueryListEvent('change') assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: MediaQueryListEvent"
-FAIL Stringification of new MediaQueryListEvent('change') assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: MediaQueryListEvent"
-FAIL MediaQueryListEvent interface: new MediaQueryListEvent('change') must inherit property "media" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: MediaQueryListEvent"
-FAIL MediaQueryListEvent interface: new MediaQueryListEvent('change') must inherit property "matches" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: MediaQueryListEvent"
-PASS Screen interface: existence and properties of interface object 
-PASS Screen interface object length 
-PASS Screen interface object name 
-PASS Screen interface: existence and properties of interface prototype object 
-PASS Screen interface: existence and properties of interface prototype object's "constructor" property 
-PASS Screen interface: existence and properties of interface prototype object's @@unscopables property 
-PASS Screen interface: attribute availWidth 
-PASS Screen interface: attribute availHeight 
-PASS Screen interface: attribute width 
-PASS Screen interface: attribute height 
-PASS Screen interface: attribute colorDepth 
-PASS Screen interface: attribute pixelDepth 
-PASS Screen must be primary interface of screen 
-PASS Stringification of screen 
-PASS Screen interface: screen must inherit property "availWidth" with the proper type 
-PASS Screen interface: screen must inherit property "availHeight" with the proper type 
-PASS Screen interface: screen must inherit property "width" with the proper type 
-PASS Screen interface: screen must inherit property "height" with the proper type 
-PASS Screen interface: screen must inherit property "colorDepth" with the proper type 
-PASS Screen interface: screen must inherit property "pixelDepth" with the proper type 
-FAIL CaretPosition interface: existence and properties of interface object assert_own_property: self does not have own property "CaretPosition" expected property "CaretPosition" missing
-FAIL CaretPosition interface object length assert_own_property: self does not have own property "CaretPosition" expected property "CaretPosition" missing
-FAIL CaretPosition interface object name assert_own_property: self does not have own property "CaretPosition" expected property "CaretPosition" missing
-FAIL CaretPosition interface: existence and properties of interface prototype object assert_own_property: self does not have own property "CaretPosition" expected property "CaretPosition" missing
-FAIL CaretPosition interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "CaretPosition" expected property "CaretPosition" missing
-FAIL CaretPosition interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "CaretPosition" expected property "CaretPosition" missing
-FAIL CaretPosition interface: attribute offsetNode assert_own_property: self does not have own property "CaretPosition" expected property "CaretPosition" missing
-FAIL CaretPosition interface: attribute offset assert_own_property: self does not have own property "CaretPosition" expected property "CaretPosition" missing
-FAIL CaretPosition interface: operation getClientRect() assert_own_property: self does not have own property "CaretPosition" expected property "CaretPosition" missing
-FAIL CaretPosition must be primary interface of document.caretPositionFromPoint(5, 5) assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: document.caretPositionFromPoint is not a function. (In 'document.caretPositionFromPoint(5, 5)', 'document.caretPositionFromPoint' is undefined)"
-FAIL Stringification of document.caretPositionFromPoint(5, 5) assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: document.caretPositionFromPoint is not a function. (In 'document.caretPositionFromPoint(5, 5)', 'document.caretPositionFromPoint' is undefined)"
-FAIL CaretPosition interface: document.caretPositionFromPoint(5, 5) must inherit property "offsetNode" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: document.caretPositionFromPoint is not a function. (In 'document.caretPositionFromPoint(5, 5)', 'document.caretPositionFromPoint' is undefined)"
-FAIL CaretPosition interface: document.caretPositionFromPoint(5, 5) must inherit property "offset" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: document.caretPositionFromPoint is not a function. (In 'document.caretPositionFromPoint(5, 5)', 'document.caretPositionFromPoint' is undefined)"
-FAIL CaretPosition interface: document.caretPositionFromPoint(5, 5) must inherit property "getClientRect()" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: document.caretPositionFromPoint is not a function. (In 'document.caretPositionFromPoint(5, 5)', 'document.caretPositionFromPoint' is undefined)"
+FAIL idl_test setup promise_test: Unhandled rejection with value: object "Got an error before parsing any named definition: Unrecognised tokens, line 1 (tokens: "{\"error\": {\"message\"")
+[
+    {
+        "type": "{",
+        "value": "{",
+        "trivia": ""
+    },
+    {
+        "type": "string",
+        "value": "\"error\"",
+        "trivia": ""
+    },
+    {
+        "type": ":",
+        "value": ":",
+        "trivia": ""
+    },
+    {
+        "type": "{",
+        "value": "{",
+        "trivia": " "
+    },
+    {
+        "type": "string",
+        "value": "\"message\"",
+        "trivia": ""
+    }
+]"
+FAIL Partial interface Window: original interface defined assert_true: Original interface should be defined expected true got false
+FAIL Partial interface Document: original interface defined assert_true: Original interface should be defined expected true got false
+FAIL Partial interface Element: original interface defined assert_true: Original interface should be defined expected true got false
+FAIL Partial interface HTMLElement: original interface defined assert_true: Original interface should be defined expected true got false
+FAIL Partial interface HTMLImageElement: original interface defined assert_true: Original interface should be defined expected true got false
+FAIL Partial interface Range: original interface defined assert_true: Original interface should be defined expected true got false
 
index fa1739d..c5e83b8 100644 (file)
 <div id=log></div>
 
 <script>
-"use strict";
-
-function doTest([html, dom, uievents, cssom, cssom_view]) {
-
-  var idlArray = new IdlArray();
-  var svg = "interface SVGElement : Element {};";
-  idlArray.add_untested_idls(html + dom + svg + cssom);
-  idlArray.add_untested_idls(uievents, { only: [
-    'UIEvent',
-    'UIEventInit',
-    'MouseEvent',
-    'MouseEventInit',
-    'EventModifierInit']
-  });
-  idlArray.add_idls(cssom_view);
-
-  idlArray.add_objects({
-    "Window": ["window"],
-    "MediaQueryList": ["matchMedia('all')"],
-    "MediaQueryListEvent": ["new MediaQueryListEvent('change')"],
-    "Screen": ["screen"],
-    "Document": ["document"],
-    "CaretPosition": ["document.caretPositionFromPoint(5, 5)"],
-    "Element": ["document.createElementNS('x', 'y')"],
-    "HTMLElement": ["document.createElement('div')"],
-    "HTMLImageElement": ["document.createElement('img')"],
-    "Range": ["new Range()"],
-    // "MouseEvent": ["new MouseEvent('foo')"],
-    "Text": ["document.createTextNode('x')"],
-    // "CSSPseudoElement": [],
-  });
-  idlArray.test();
-};
-
-function fetchData(url) {
-  return fetch(url).then((response) => response.text());
-}
-
-function waitForLoad() {
-  return new Promise(function(resolve) {
-    addEventListener("load", resolve);
-  });
-}
-
-promise_test(function() {
-  // Have to wait for onload
-  return Promise.all([fetchData("/interfaces/html.idl"),
-                      fetchData("/interfaces/dom.idl"),
-                      fetchData("/interfaces/uievents.idl"),
-                      fetchData("/interfaces/cssom.idl"),
-                      fetchData("/interfaces/cssom-view.idl"),
-                      waitForLoad()])
-                .then(doTest);
-}, "Test driver");
-
+'use strict';
+
+const waitForLoad = new Promise(resolve => { addEventListener('load', resolve); });
+
+idl_test(
+  ['cssom-view'],
+  ['css-pseudo', 'cssom', 'uievents', 'SVG', 'html', 'dom'],
+  async idlArray => {
+    idlArray.add_objects({
+      Window: ['window'],
+      MediaQueryList: ['matchMedia("all")'],
+      MediaQueryListEvent: ['new MediaQueryListEvent("change")'],
+      Screen: ['screen'],
+      Document: ['document'],
+      CaretPosition: ['document.caretPositionFromPoint(5, 5)'],
+      Element: ['document.createElementNS("x", "y")'],
+      HTMLElement: ['document.createElement("div")'],
+      HTMLImageElement: ['document.createElement("img")'],
+      Range: ['new Range()'],
+      // MouseEvent: ['new MouseEvent("foo")'],
+      Text: ['document.createTextNode("x")'],
+      // CSSPseudoElement: [],
+    });
+
+    await waitForLoad;
+  }
+);
 </script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/media-query-list-interface-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/media-query-list-interface-expected.txt
deleted file mode 100644 (file)
index 6e04162..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-
-PASS window_exposes_matchmedia 
-PASS mediaquerylist_inherited_functions 
-PASS mediaquerylist_functions 
-PASS mediaquerylist_properties 
-PASS mediaquerylist_properties_readonly 
-
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/media-query-list-interface.xht b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/media-query-list-interface.xht
deleted file mode 100644 (file)
index 98bdaae..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-<?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>CSSOM MediaQueryList Test: Properties and Functions</title>
-        <link rel="author" title="Joe Balancio" href="mailto:jlbalancio@gmail.com" />
-        <link rel="help" href="http://www.w3.org/TR/cssom-view/#extensions-to-the-window-interface" />
-        <link rel="help" href="http://www.w3.org/TR/cssom-view/#the-mediaquerylist-interface" />
-        <meta name="flags" content="dom" />
-        <meta name="assert" content="All properties exist and are readonly. All functions exist and are instances of Function" />
-        <script src="/resources/testharness.js" type="text/javascript" />
-        <script src="/resources/testharnessreport.js" type="text/javascript" />
-    </head>
-    <body>
-        <noscript>Test not run - javascript required.</noscript>
-        <div id="log" />
-        <script type="text/javascript"><![CDATA[
-            var mediaQueryList;
-            test(
-                function(){
-                    assert_own_property(window, "matchMedia");
-                    mediaQueryList = window.matchMedia('foo');
-                }, 'window_exposes_matchmedia', {
-                  assert: ['window.matchMedia is exposed by window. If this fails, the rest of the test fails.']
-                }
-            );
-            /*
-               MediaQueryList Functions
-             */
-            test(
-                function(){
-                    assert_inherits(mediaQueryList, "addListener");
-                    assert_inherits(mediaQueryList, "removeListener");
-                }, 'mediaquerylist_inherited_functions', {
-                  assert: ['MediaQueryList functions are inherited']
-                }
-            );
-
-            test(
-                function(){
-                    assert_true(mediaQueryList.addListener instanceof Function);
-                    assert_true(mediaQueryList.removeListener instanceof Function);
-                }, 'mediaquerylist_functions', {
-                  assert: ['MediaQueryList functions are instances of Function']
-                }
-            );
-
-            /*
-               MediaQueryList  Properties
-             */
-            test(
-                function() {
-                    assert_inherits(mediaQueryList, 'media');
-                    assert_inherits(mediaQueryList, 'matches');
-                }, 'mediaquerylist_properties', {
-                  assert: ['MediaQueryList properties are inherited']
-                }
-            );
-            test(
-                function() {
-                    assert_readonly(mediaQueryList, 'media');
-                    assert_readonly(mediaQueryList, 'matches');
-                }, 'mediaquerylist_properties_readonly', {
-                    assert: ['MediaQueryList properties are readonly']
-                }
-            );
-                ]]>
-        </script>
-    </body>
-</html>
index a358109..f1c0633 100644 (file)
@@ -1,7 +1,7 @@
 The tests in this directory were imported from the W3C repository.
 Do NOT modify these tests directly in WebKit.
 Instead, create a pull request on the WPT github:
-       https://github.com/w3c/web-platform-tests
+       https://github.com/web-platform-tests/wpt
 
 Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
 
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-default-css-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-default-css-expected.txt
new file mode 100644 (file)
index 0000000..9068b79
--- /dev/null
@@ -0,0 +1,4 @@
+
+PASS Instant scrolling of an element with default scroll-behavior 
+FAIL Smooth scrolling of an element with default scroll-behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-default-css.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-default-css.html
new file mode 100644 (file)
index 0000000..8606b1f
--- /dev/null
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<title>Testing default value of scroll-behavior</title>
+<meta name="timeout" content="long"/>
+<link rel="author" title="Frédéric Wang" href="mailto:fwang@igalia.com">
+<link rel="help" href="https://drafts.csswg.org/cssom-view/#propdef-scroll-behavior">
+<link rel="help" href="https://drafts.csswg.org/cssom-view/#scrolling-box">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="support/scroll-behavior.js"></script>
+<style>
+  .scrollable {
+    overflow: auto;
+    width: 400px;
+    height: 200px;
+  }
+</style>
+<div id="log">
+</div>
+<div id="overflowNode" class="scrollable">
+  <div style="width: 2000px; height: 1000px; background: linear-gradient(135deg, red, green);">
+    <span style="display: inline-block; width: 500px; height: 250px;"></span><span id="elementToReveal" style="display: inline-block; vertical-align: -15px; width: 10px; height: 15px; background: black;"></span>
+  </div>
+</div>
+<script>
+  var scrollingElement = overflowNode;
+  var elementToRevealLeft = 500;
+  var elementToRevealTop = 250;
+  var scrollFunction = "scroll";
+
+  promise_test(() => {
+    resetScroll(scrollingElement);
+    assert_equals(scrollingElement.scrollLeft, 0);
+    assert_equals(scrollingElement.scrollTop, 0);
+    scrollNode(scrollingElement, "scroll", "instant", elementToRevealLeft, elementToRevealTop);
+    assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Should set scrollLeft immediately");
+    assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Should set scrollTop immediately");
+    return new Promise((resolve) => { resolve(); });
+  }, "Instant scrolling of an element with default scroll-behavior");
+
+  promise_test(() => {
+    resetScroll(scrollingElement);
+    assert_equals(scrollingElement.scrollLeft, 0);
+    assert_equals(scrollingElement.scrollTop, 0);
+    scrollNode(scrollingElement, "scroll", "smooth", elementToRevealLeft, elementToRevealTop);
+    assert_less_than(scrollingElement.scrollLeft, elementToRevealLeft, "Should not set scrollLeft immediately");
+    assert_less_than(scrollingElement.scrollTop, elementToRevealTop, "Should not set scrollTop immediately");
+    return waitForScrollEnd(scrollingElement).then(() => {
+      assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Final value of scrollLeft");
+      assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Final value of scrollTop");
+    });
+  }, "Smooth scrolling of an element with default scroll-behavior");
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-element-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-element-expected.txt
new file mode 100644 (file)
index 0000000..2b9129c
--- /dev/null
@@ -0,0 +1,36 @@
+
+PASS Element with auto scroll-behavior ; scroll() with default behavior 
+PASS Element with auto scroll-behavior ; scroll() with auto behavior 
+PASS Element with auto scroll-behavior ; scroll() with instant behavior 
+FAIL Element with auto scroll-behavior ; scroll() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
+FAIL Element with smooth scroll-behavior ; scroll() with default behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
+FAIL Element with smooth scroll-behavior ; scroll() with auto behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
+PASS Element with smooth scroll-behavior ; scroll() with instant behavior 
+FAIL Element with smooth scroll-behavior ; scroll() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
+PASS Element with auto scroll-behavior ; scrollTo() with default behavior 
+PASS Element with auto scroll-behavior ; scrollTo() with auto behavior 
+PASS Element with auto scroll-behavior ; scrollTo() with instant behavior 
+FAIL Element with auto scroll-behavior ; scrollTo() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
+FAIL Element with smooth scroll-behavior ; scrollTo() with default behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
+FAIL Element with smooth scroll-behavior ; scrollTo() with auto behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
+PASS Element with smooth scroll-behavior ; scrollTo() with instant behavior 
+FAIL Element with smooth scroll-behavior ; scrollTo() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
+PASS Element with auto scroll-behavior ; scrollBy() with default behavior 
+PASS Element with auto scroll-behavior ; scrollBy() with auto behavior 
+PASS Element with auto scroll-behavior ; scrollBy() with instant behavior 
+FAIL Element with auto scroll-behavior ; scrollBy() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
+FAIL Element with smooth scroll-behavior ; scrollBy() with default behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
+FAIL Element with smooth scroll-behavior ; scrollBy() with auto behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
+PASS Element with smooth scroll-behavior ; scrollBy() with instant behavior 
+FAIL Element with smooth scroll-behavior ; scrollBy() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
+PASS Element with auto scroll-behavior ; scrollIntoView() with default behavior 
+PASS Element with auto scroll-behavior ; scrollIntoView() with auto behavior 
+PASS Element with auto scroll-behavior ; scrollIntoView() with instant behavior 
+FAIL Element with auto scroll-behavior ; scrollIntoView() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
+FAIL Element with smooth scroll-behavior ; scrollIntoView() with default behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
+FAIL Element with smooth scroll-behavior ; scrollIntoView() with auto behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
+PASS Element with smooth scroll-behavior ; scrollIntoView() with instant behavior 
+FAIL Element with smooth scroll-behavior ; scrollIntoView() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
+PASS Aborting an ongoing smooth scrolling on an element with another smooth scrolling 
+PASS Aborting an ongoing smooth scrolling on an element with an instant scrolling 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-element.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-element.html
new file mode 100644 (file)
index 0000000..9f60ca7
--- /dev/null
@@ -0,0 +1,163 @@
+<!DOCTYPE html>
+<title>Testing scrollOptions' behavior for Element.scroll* and scroll-behavior on an element</title>
+<meta name="timeout" content="long"/>
+<link rel="author" title="Frédéric Wang" href="mailto:fwang@igalia.com">
+<link rel="help" href="https://drafts.csswg.org/cssom-view/#propdef-scroll-behavior">
+<link rel="help" href="https://drafts.csswg.org/cssom-view/#scrolling-box">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="support/scroll-behavior.js"></script>
+<style>
+  .scrollable {
+    overflow: auto;
+    width: 400px;
+    height: 200px;
+  }
+  .autoBehavior {
+    scroll-behavior: auto;
+  }
+  .smoothBehavior {
+    scroll-behavior: smooth;
+  }
+</style>
+<div id="log">
+</div>
+<div id="overflowNode" class="scrollable">
+  <div style="width: 2000px; height: 1000px; background: linear-gradient(135deg, red, green);">
+    <span style="display: inline-block; width: 500px; height: 250px;"></span><span id="elementToReveal" style="display: inline-block; vertical-align: -15px; width: 10px; height: 15px; background: black;"></span>
+  </div>
+</div>
+<script>
+  var scrollingElement = overflowNode;
+  var styledElement = overflowNode;
+  var elementToRevealLeft = 500;
+  var elementToRevealTop = 250;
+
+  ["scroll", "scrollTo", "scrollBy", "scrollIntoView"].forEach((scrollFunction) => {
+    promise_test(() => {
+      resetScroll(scrollingElement);
+      setScrollBehavior(styledElement, "autoBehavior");
+      assert_equals(scrollingElement.scrollLeft, 0);
+      assert_equals(scrollingElement.scrollTop, 0);
+      scrollNode(scrollingElement, scrollFunction, null, elementToRevealLeft, elementToRevealTop);
+      assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Should set scrollLeft immediately");
+      assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Should set scrollTop immediately");
+      return new Promise((resolve) => { resolve(); });
+    }, `Element with auto scroll-behavior ; ${scrollFunction}() with default behavior`);
+
+    promise_test(() => {
+      resetScroll(scrollingElement);
+      setScrollBehavior(styledElement, "autoBehavior");
+      assert_equals(scrollingElement.scrollLeft, 0);
+      assert_equals(scrollingElement.scrollTop, 0);
+      scrollNode(scrollingElement, scrollFunction, "auto", elementToRevealLeft, elementToRevealTop);
+      assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Should set scrollLeft immediately");
+      assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Should set scrollTop immediately");
+      return new Promise((resolve) => { resolve(); });
+    }, `Element with auto scroll-behavior ; ${scrollFunction}() with auto behavior`);
+
+    promise_test(() => {
+      resetScroll(scrollingElement);
+      setScrollBehavior(styledElement, "autoBehavior");
+      assert_equals(scrollingElement.scrollLeft, 0);
+      assert_equals(scrollingElement.scrollTop, 0);
+      scrollNode(scrollingElement, scrollFunction, "instant", elementToRevealLeft, elementToRevealTop);
+      assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Should set scrollLeft immediately");
+      assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Should set scrollTop immediately");
+      return new Promise((resolve) => { resolve(); });
+    }, `Element with auto scroll-behavior ; ${scrollFunction}() with instant behavior`);
+
+    promise_test(() => {
+      resetScroll(scrollingElement);
+      setScrollBehavior(styledElement, "autoBehavior");
+      assert_equals(scrollingElement.scrollLeft, 0);
+      assert_equals(scrollingElement.scrollTop, 0);
+      scrollNode(scrollingElement, scrollFunction, "smooth", elementToRevealLeft, elementToRevealTop);
+      assert_less_than(scrollingElement.scrollLeft, elementToRevealLeft, "Should not set scrollLeft immediately");
+      assert_less_than(scrollingElement.scrollTop, elementToRevealTop, "Should not set scrollTop immediately");
+      return waitForScrollEnd(scrollingElement).then(() => {
+        assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Final value of scrollLeft");
+        assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Final value of scrollTop");
+      });
+    }, `Element with auto scroll-behavior ; ${scrollFunction}() with smooth behavior`);
+
+    promise_test(() => {
+      resetScroll(scrollingElement);
+      setScrollBehavior(styledElement, "smoothBehavior");
+      assert_equals(scrollingElement.scrollLeft, 0);
+      assert_equals(scrollingElement.scrollTop, 0);
+      scrollNode(scrollingElement, scrollFunction, null, elementToRevealLeft, elementToRevealTop);
+      assert_less_than(scrollingElement.scrollLeft, elementToRevealLeft, "Should not set scrollLeft immediately");
+      assert_less_than(scrollingElement.scrollTop, elementToRevealTop, "Should not set scrollTop immediately");
+      return waitForScrollEnd(scrollingElement).then(() => {
+        assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Final value of scrollLeft");
+        assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Final value of scrollTop");
+      });
+    }, `Element with smooth scroll-behavior ; ${scrollFunction}() with default behavior`);
+
+    promise_test(() => {
+      resetScroll(scrollingElement);
+      setScrollBehavior(styledElement, "smoothBehavior");
+      assert_equals(scrollingElement.scrollLeft, 0);
+      assert_equals(scrollingElement.scrollTop, 0);
+      scrollNode(scrollingElement, scrollFunction, "auto", elementToRevealLeft, elementToRevealTop);
+      assert_less_than(scrollingElement.scrollLeft, elementToRevealLeft, "Should not set scrollLeft immediately");
+      assert_less_than(scrollingElement.scrollTop, elementToRevealTop, "Should not set scrollTop immediately");
+      return waitForScrollEnd(scrollingElement).then(() => {
+        assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Final value of scrollLeft");
+        assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Final value of scrollTop");
+      });
+    }, `Element with smooth scroll-behavior ; ${scrollFunction}() with auto behavior`);
+
+    promise_test(() => {
+      resetScroll(scrollingElement);
+      setScrollBehavior(styledElement, "smoothBehavior");
+      assert_equals(scrollingElement.scrollLeft, 0);
+      assert_equals(scrollingElement.scrollTop, 0);
+      scrollNode(scrollingElement, scrollFunction, "instant", elementToRevealLeft, elementToRevealTop);
+      assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Should set scrollLeft immediately");
+      assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Should set scrollTop immediately");
+      return new Promise((resolve) => { resolve(); });
+    }, `Element with smooth scroll-behavior ; ${scrollFunction}() with instant behavior`);
+
+    promise_test(() => {
+      resetScroll(scrollingElement);
+      setScrollBehavior(styledElement, "smoothBehavior");
+      assert_equals(scrollingElement.scrollLeft, 0);
+      assert_equals(scrollingElement.scrollTop, 0);
+      scrollNode(scrollingElement, scrollFunction, "smooth", elementToRevealLeft, elementToRevealTop);
+      assert_less_than(scrollingElement.scrollLeft, elementToRevealLeft, "Should not set scrollLeft immediately");
+      assert_less_than(scrollingElement.scrollTop, elementToRevealTop, "Should not set scrollTop immediately");
+      return waitForScrollEnd(scrollingElement).then(() => {
+        assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Final value of scrollLeft");
+        assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Final value of scrollTop");
+      });
+   }, `Element with smooth scroll-behavior ; ${scrollFunction}() with smooth behavior`);
+  });
+
+  promise_test(() => {
+    resetScroll(scrollingElement);
+    setScrollBehavior(styledElement, "smoothBehavior");
+    assert_equals(scrollingElement.scrollLeft, 0);
+    assert_equals(scrollingElement.scrollTop, 0);
+    scrollNode(scrollingElement, "scroll", "smooth", elementToRevealLeft, elementToRevealTop);
+    scrollNode(scrollingElement, "scroll", "smooth", elementToRevealLeft / 2, elementToRevealTop / 2);
+    return waitForScrollEnd(scrollingElement).then(() => {
+      assert_equals(scrollingElement.scrollLeft, elementToRevealLeft / 2, "Final value of scrollLeft");
+      assert_equals(scrollingElement.scrollTop, elementToRevealTop / 2, "Final value of scrollTop");
+    });
+  }, "Aborting an ongoing smooth scrolling on an element with another smooth scrolling");
+
+  promise_test(() => {
+    resetScroll(scrollingElement);
+    setScrollBehavior(styledElement, "smoothBehavior");
+    assert_equals(scrollingElement.scrollLeft, 0);
+    assert_equals(scrollingElement.scrollTop, 0);
+    scrollNode(scrollingElement, "scroll", "smooth", elementToRevealLeft, elementToRevealTop);
+    scrollNode(scrollingElement, "scroll", "instant", 0, 0);
+    return waitForScrollEnd(scrollingElement).then(() => {
+      assert_equals(scrollingElement.scrollLeft, 0, "Final value of scrollLeft");
+      assert_equals(scrollingElement.scrollTop, 0, "Final value of scrollTop");
+    });
+  }, "Aborting an ongoing smooth scrolling on an element with an instant scrolling");
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-main-frame-root-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-main-frame-root-expected.txt
new file mode 100644 (file)
index 0000000..d922258
--- /dev/null
@@ -0,0 +1,37 @@
+
+PASS Page loaded 
+PASS Main frame with auto scroll-behavior ; scroll() with default behavior 
+PASS Main frame with auto scroll-behavior ; scroll() with auto behavior 
+PASS Main frame with auto scroll-behavior ; scroll() with instant behavior 
+FAIL Main frame with auto scroll-behavior ; scroll() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
+FAIL Main frame with smooth scroll-behavior ; scroll() with default behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
+FAIL Main frame with smooth scroll-behavior ; scroll() with auto behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
+PASS Main frame with smooth scroll-behavior ; scroll() with instant behavior 
+FAIL Main frame with smooth scroll-behavior ; scroll() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
+PASS Main frame with auto scroll-behavior ; scrollTo() with default behavior 
+PASS Main frame with auto scroll-behavior ; scrollTo() with auto behavior 
+PASS Main frame with auto scroll-behavior ; scrollTo() with instant behavior 
+FAIL Main frame with auto scroll-behavior ; scrollTo() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
+FAIL Main frame with smooth scroll-behavior ; scrollTo() with default behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
+FAIL Main frame with smooth scroll-behavior ; scrollTo() with auto behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
+PASS Main frame with smooth scroll-behavior ; scrollTo() with instant behavior 
+FAIL Main frame with smooth scroll-behavior ; scrollTo() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
+PASS Main frame with auto scroll-behavior ; scrollBy() with default behavior 
+PASS Main frame with auto scroll-behavior ; scrollBy() with auto behavior 
+PASS Main frame with auto scroll-behavior ; scrollBy() with instant behavior 
+FAIL Main frame with auto scroll-behavior ; scrollBy() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
+FAIL Main frame with smooth scroll-behavior ; scrollBy() with default behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
+FAIL Main frame with smooth scroll-behavior ; scrollBy() with auto behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
+PASS Main frame with smooth scroll-behavior ; scrollBy() with instant behavior 
+FAIL Main frame with smooth scroll-behavior ; scrollBy() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
+PASS Main frame with auto scroll-behavior ; scrollIntoView() with default behavior 
+PASS Main frame with auto scroll-behavior ; scrollIntoView() with auto behavior 
+PASS Main frame with auto scroll-behavior ; scrollIntoView() with instant behavior 
+FAIL Main frame with auto scroll-behavior ; scrollIntoView() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
+FAIL Main frame with smooth scroll-behavior ; scrollIntoView() with default behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
+FAIL Main frame with smooth scroll-behavior ; scrollIntoView() with auto behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
+PASS Main frame with smooth scroll-behavior ; scrollIntoView() with instant behavior 
+FAIL Main frame with smooth scroll-behavior ; scrollIntoView() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
+PASS Aborting an ongoing smooth scrolling on the main frame with another smooth scrolling 
+PASS Aborting an ongoing smooth scrolling on the main frame with an instant scrolling 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-main-frame-root.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-main-frame-root.html
new file mode 100644 (file)
index 0000000..7ef0a4a
--- /dev/null
@@ -0,0 +1,169 @@
+<!DOCTYPE html>
+<title>Testing scrollOptions' behavior for Element.scroll* and scroll-behavior on the root of the main frame</title>
+<meta name="timeout" content="long"/>
+<link rel="author" title="Frédéric Wang" href="mailto:fwang@igalia.com">
+<link rel="help" href="https://drafts.csswg.org/cssom-view/#propdef-scroll-behavior">
+<link rel="help" href="https://drafts.csswg.org/cssom-view/#scrolling-box">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="support/scroll-behavior.js"></script>
+<style>
+  body {
+    margin: 0;
+  }
+  .autoBehavior {
+    scroll-behavior: auto;
+  }
+  .smoothBehavior {
+    scroll-behavior: smooth;
+  }
+</style>
+<div id="log">
+</div>
+<div id="pageContent" style="position: absolute; left: 0; top: 0;">
+  <div id="elementToReveal" style="position: absolute; display: inline-block; width: 10px; height: 15px; background: black;"></div>
+</div>
+<script>
+  var pageLoaded = async_test("Page loaded");
+  var scrollingElement, styledElement, elementToRevealLeft, elementToRevealTop;
+  window.addEventListener("load", pageLoaded.step_func_done(function() {
+    scrollingElement = document.scrollingElement;
+    styledElement = document.documentElement;
+    pageContent.style.width = (10 + window.innerWidth) * 5 + "px";
+    pageContent.style.height = (20 + window.innerHeight) * 6 + "px";
+    elementToRevealLeft = (10 + window.innerWidth) * 3;
+    elementToRevealTop = (20 + window.innerHeight) * 4;
+    elementToReveal.style.left = elementToRevealLeft + "px";
+    elementToReveal.style.top = elementToRevealTop + "px";
+
+    add_completion_callback(() => { resetScroll(scrollingElement); });
+
+    ["scroll", "scrollTo", "scrollBy", "scrollIntoView"].forEach((scrollFunction) => {
+      promise_test(() => {
+        resetScroll(scrollingElement);
+        setScrollBehavior(styledElement, "autoBehavior");
+        assert_equals(scrollingElement.scrollLeft, 0);
+        assert_equals(scrollingElement.scrollTop, 0);
+        scrollNode(scrollingElement, scrollFunction, null, elementToRevealLeft, elementToRevealTop);
+        assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Should set scrollLeft immediately");
+        assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Should set scrollTop immediately");
+        return new Promise((resolve) => { resolve(); });
+      }, `Main frame with auto scroll-behavior ; ${scrollFunction}() with default behavior`);
+
+      promise_test(() => {
+        resetScroll(scrollingElement);
+        setScrollBehavior(styledElement, "autoBehavior");
+        assert_equals(scrollingElement.scrollLeft, 0);
+        assert_equals(scrollingElement.scrollTop, 0);
+        scrollNode(scrollingElement, scrollFunction, "auto", elementToRevealLeft, elementToRevealTop);
+        assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Should set scrollLeft immediately");
+        assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Should set scrollTop immediately");
+        return new Promise((resolve) => { resolve(); });
+      }, `Main frame with auto scroll-behavior ; ${scrollFunction}() with auto behavior`);
+
+      promise_test(() => {
+        resetScroll(scrollingElement);
+        setScrollBehavior(styledElement, "autoBehavior");
+        assert_equals(scrollingElement.scrollLeft, 0);
+        assert_equals(scrollingElement.scrollTop, 0);
+        scrollNode(scrollingElement, scrollFunction, "instant", elementToRevealLeft, elementToRevealTop);
+        assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Should set scrollLeft immediately");
+        assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Should set scrollTop immediately");
+        return new Promise((resolve) => { resolve(); });
+      }, `Main frame with auto scroll-behavior ; ${scrollFunction}() with instant behavior`);
+
+      promise_test(() => {
+        resetScroll(scrollingElement);
+        setScrollBehavior(styledElement, "autoBehavior");
+        assert_equals(scrollingElement.scrollLeft, 0);
+        assert_equals(scrollingElement.scrollTop, 0);
+        scrollNode(scrollingElement, scrollFunction, "smooth", elementToRevealLeft, elementToRevealTop);
+        assert_less_than(scrollingElement.scrollLeft, elementToRevealLeft, "Should not set scrollLeft immediately");
+        assert_less_than(scrollingElement.scrollTop, elementToRevealTop, "Should not set scrollTop immediately");
+        return waitForScrollEnd(scrollingElement).then(() => {
+          assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Final value of scrollLeft");
+          assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Final value of scrollTop");
+        });
+      }, `Main frame with auto scroll-behavior ; ${scrollFunction}() with smooth behavior`);
+
+      promise_test(() => {
+        resetScroll(scrollingElement);
+        setScrollBehavior(styledElement, "smoothBehavior");
+        assert_equals(scrollingElement.scrollLeft, 0);
+        assert_equals(scrollingElement.scrollTop, 0);
+        scrollNode(scrollingElement, scrollFunction, null, elementToRevealLeft, elementToRevealTop);
+        assert_less_than(scrollingElement.scrollLeft, elementToRevealLeft, "Should not set scrollLeft immediately");
+        assert_less_than(scrollingElement.scrollTop, elementToRevealTop, "Should not set scrollTop immediately");
+        return waitForScrollEnd(scrollingElement).then(() => {
+          assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Final value of scrollLeft");
+          assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Final value of scrollTop");
+        });
+      }, `Main frame with smooth scroll-behavior ; ${scrollFunction}() with default behavior`);
+
+      promise_test(() => {
+        resetScroll(scrollingElement);
+        setScrollBehavior(styledElement, "smoothBehavior");
+        assert_equals(scrollingElement.scrollLeft, 0);
+        assert_equals(scrollingElement.scrollTop, 0);
+        scrollNode(scrollingElement, scrollFunction, "auto", elementToRevealLeft, elementToRevealTop);
+        assert_less_than(scrollingElement.scrollLeft, elementToRevealLeft, "Should not set scrollLeft immediately");
+        assert_less_than(scrollingElement.scrollTop, elementToRevealTop, "Should not set scrollTop immediately");
+        return waitForScrollEnd(scrollingElement).then(() => {
+          assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Final value of scrollLeft");
+          assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Final value of scrollTop");
+        });
+      }, `Main frame with smooth scroll-behavior ; ${scrollFunction}() with auto behavior`);
+
+      promise_test(() => {
+        resetScroll(scrollingElement);
+        setScrollBehavior(styledElement, "smoothBehavior");
+        assert_equals(scrollingElement.scrollLeft, 0);
+        assert_equals(scrollingElement.scrollTop, 0);
+        scrollNode(scrollingElement, scrollFunction, "instant", elementToRevealLeft, elementToRevealTop);
+        assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Should set scrollLeft immediately");
+        assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Should set scrollTop immediately");
+        return new Promise((resolve) => { resolve(); });
+      }, `Main frame with smooth scroll-behavior ; ${scrollFunction}() with instant behavior`);
+
+      promise_test(() => {
+        resetScroll(scrollingElement);
+        setScrollBehavior(styledElement, "smoothBehavior");
+        assert_equals(scrollingElement.scrollLeft, 0);
+        assert_equals(scrollingElement.scrollTop, 0);
+        scrollNode(scrollingElement, scrollFunction, "smooth", elementToRevealLeft, elementToRevealTop);
+        assert_less_than(scrollingElement.scrollLeft, elementToRevealLeft, "Should not set scrollLeft immediately");
+        assert_less_than(scrollingElement.scrollTop, elementToRevealTop, "Should not set scrollTop immediately");
+        return waitForScrollEnd(scrollingElement).then(() => {
+          assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Final value of scrollLeft");
+          assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Final value of scrollTop");
+        });
+     }, `Main frame with smooth scroll-behavior ; ${scrollFunction}() with smooth behavior`);
+    });
+
+    promise_test(() => {
+      resetScroll(scrollingElement);
+      setScrollBehavior(styledElement, "smoothBehavior");
+      assert_equals(scrollingElement.scrollLeft, 0);
+      assert_equals(scrollingElement.scrollTop, 0);
+      scrollNode(scrollingElement, "scroll", "smooth", elementToRevealLeft, elementToRevealTop);
+      scrollNode(scrollingElement, "scroll", "smooth", elementToRevealLeft / 2, elementToRevealTop / 2);
+      return waitForScrollEnd(scrollingElement).then(() => {
+        assert_equals(scrollingElement.scrollLeft, elementToRevealLeft / 2, "Final value of scrollLeft");
+        assert_equals(scrollingElement.scrollTop, elementToRevealTop / 2, "Final value of scrollTop");
+      });
+    }, "Aborting an ongoing smooth scrolling on the main frame with another smooth scrolling");
+
+    promise_test(() => {
+      resetScroll(scrollingElement);
+      setScrollBehavior(styledElement, "smoothBehavior");
+      assert_equals(scrollingElement.scrollLeft, 0);
+      assert_equals(scrollingElement.scrollTop, 0);
+      scrollNode(scrollingElement, "scroll", "smooth", elementToRevealLeft, elementToRevealTop);
+      scrollNode(scrollingElement, "scroll", "instant", 0, 0);
+      return waitForScrollEnd(scrollingElement).then(() => {
+        assert_equals(scrollingElement.scrollLeft, 0, "Final value of scrollLeft");
+        assert_equals(scrollingElement.scrollTop, 0, "Final value of scrollTop");
+    });
+  }, "Aborting an ongoing smooth scrolling on the main frame with an instant scrolling");
+  }));
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-main-frame-window-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-main-frame-window-expected.txt
new file mode 100644 (file)
index 0000000..c6be966
--- /dev/null
@@ -0,0 +1,29 @@
+
+PASS Page loaded 
+PASS Main frame with auto scroll-behavior ; scroll() with default behavior 
+PASS Main frame with auto scroll-behavior ; scroll() with auto behavior 
+PASS Main frame with auto scroll-behavior ; scroll() with instant behavior 
+FAIL Main frame with auto scroll-behavior ; scroll() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
+FAIL Main frame with smooth scroll-behavior ; scroll() with default behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
+FAIL Main frame with smooth scroll-behavior ; scroll() with auto behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
+PASS Main frame with smooth scroll-behavior ; scroll() with instant behavior 
+FAIL Main frame with smooth scroll-behavior ; scroll() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
+PASS Main frame with auto scroll-behavior ; scrollTo() with default behavior 
+PASS Main frame with auto scroll-behavior ; scrollTo() with auto behavior 
+PASS Main frame with auto scroll-behavior ; scrollTo() with instant behavior 
+FAIL Main frame with auto scroll-behavior ; scrollTo() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
+FAIL Main frame with smooth scroll-behavior ; scrollTo() with default behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
+FAIL Main frame with smooth scroll-behavior ; scrollTo() with auto behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
+PASS Main frame with smooth scroll-behavior ; scrollTo() with instant behavior 
+FAIL Main frame with smooth scroll-behavior ; scrollTo() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
+PASS Main frame with auto scroll-behavior ; scrollBy() with default behavior 
+PASS Main frame with auto scroll-behavior ; scrollBy() with auto behavior 
+PASS Main frame with auto scroll-behavior ; scrollBy() with instant behavior 
+FAIL Main frame with auto scroll-behavior ; scrollBy() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
+FAIL Main frame with smooth scroll-behavior ; scrollBy() with default behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
+FAIL Main frame with smooth scroll-behavior ; scrollBy() with auto behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
+PASS Main frame with smooth scroll-behavior ; scrollBy() with instant behavior 
+FAIL Main frame with smooth scroll-behavior ; scrollBy() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
+PASS Aborting an ongoing smooth scrolling on the main frame with another smooth scrolling 
+PASS Aborting an ongoing smooth scrolling on the main frame with an instant scrolling 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-main-frame-window.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-main-frame-window.html
new file mode 100644 (file)
index 0000000..57b0d91
--- /dev/null
@@ -0,0 +1,169 @@
+<!DOCTYPE html>
+<title>Testing scrollOptions' behavior for Element.scroll* on the window of the main frame</title>
+<meta name="timeout" content="long"/>
+<link rel="author" title="Frédéric Wang" href="mailto:fwang@igalia.com">
+<link rel="help" href="https://drafts.csswg.org/cssom-view/#propdef-scroll-behavior">
+<link rel="help" href="https://drafts.csswg.org/cssom-view/#scrolling-box">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="support/scroll-behavior.js"></script>
+<style>
+  body {
+    margin: 0;
+  }
+  .autoBehavior {
+    scroll-behavior: auto;
+  }
+  .smoothBehavior {
+    scroll-behavior: smooth;
+  }
+</style>
+<div id="log">
+</div>
+<div id="pageContent" style="position: absolute; left: 0; top: 0;">
+  <div id="elementToReveal" style="position: absolute; display: inline-block; width: 10px; height: 15px; background: black;"></div>
+</div>
+<script>
+  var pageLoaded = async_test("Page loaded");
+  var scrollingWindow, styledElement, elementToRevealLeft, elementToRevealTop;
+  window.addEventListener("load", pageLoaded.step_func_done(function() {
+    scrollingWindow = window;
+    styledElement = document.documentElement;
+    pageContent.style.width = (10 + window.innerWidth) * 5 + "px";
+    pageContent.style.height = (20 + window.innerHeight) * 6 + "px";
+    elementToRevealLeft = (10 + window.innerWidth) * 3;
+    elementToRevealTop = (20 + window.innerHeight) * 4;
+    elementToReveal.style.left = elementToRevealLeft + "px";
+    elementToReveal.style.top = elementToRevealTop + "px";
+
+    add_completion_callback(() => { resetScrollForWindow(window); });
+
+    ["scroll", "scrollTo", "scrollBy"].forEach((scrollFunction) => {
+      promise_test(() => {
+        resetScrollForWindow(scrollingWindow);
+        setScrollBehavior(styledElement, "autoBehavior");
+        assert_equals(scrollingWindow.scrollX, 0);
+        assert_equals(scrollingWindow.scrollY, 0);
+        scrollWindow(scrollingWindow, scrollFunction, null, elementToRevealLeft, elementToRevealTop);
+        assert_equals(scrollingWindow.scrollX, elementToRevealLeft, "Should set scrollLeft immediately");
+        assert_equals(scrollingWindow.scrollY, elementToRevealTop, "Should set scrollTop immediately");
+        return new Promise((resolve) => { resolve(); });
+      }, `Main frame with auto scroll-behavior ; ${scrollFunction}() with default behavior`);
+
+      promise_test(() => {
+        resetScrollForWindow(scrollingWindow);
+        setScrollBehavior(styledElement, "autoBehavior");
+        assert_equals(scrollingWindow.scrollX, 0);
+        assert_equals(scrollingWindow.scrollY, 0);
+        scrollWindow(scrollingWindow, scrollFunction, "auto", elementToRevealLeft, elementToRevealTop);
+        assert_equals(scrollingWindow.scrollX, elementToRevealLeft, "Should set scrollLeft immediately");
+        assert_equals(scrollingWindow.scrollY, elementToRevealTop, "Should set scrollTop immediately");
+        return new Promise((resolve) => { resolve(); });
+      }, `Main frame with auto scroll-behavior ; ${scrollFunction}() with auto behavior`);
+
+      promise_test(() => {
+        resetScrollForWindow(scrollingWindow);
+        setScrollBehavior(styledElement, "autoBehavior");
+        assert_equals(scrollingWindow.scrollX, 0);
+        assert_equals(scrollingWindow.scrollY, 0);
+        scrollWindow(scrollingWindow, scrollFunction, "instant", elementToRevealLeft, elementToRevealTop);
+        assert_equals(scrollingWindow.scrollX, elementToRevealLeft, "Should set scrollLeft immediately");
+        assert_equals(scrollingWindow.scrollY, elementToRevealTop, "Should set scrollTop immediately");
+        return new Promise((resolve) => { resolve(); });
+      }, `Main frame with auto scroll-behavior ; ${scrollFunction}() with instant behavior`);
+
+      promise_test(() => {
+        resetScrollForWindow(scrollingWindow);
+        setScrollBehavior(styledElement, "autoBehavior");
+        assert_equals(scrollingWindow.scrollX, 0);
+        assert_equals(scrollingWindow.scrollY, 0);
+        scrollWindow(scrollingWindow, scrollFunction, "smooth", elementToRevealLeft, elementToRevealTop);
+        assert_less_than(scrollingWindow.scrollX, elementToRevealLeft, "Should not set scrollLeft immediately");
+        assert_less_than(scrollingWindow.scrollY, elementToRevealTop, "Should not set scrollTop immediately");
+        return waitForScrollEnd(scrollingWindow.document.scrollingElement).then(() => {
+          assert_equals(scrollingWindow.scrollX, elementToRevealLeft, "Final value of scrollLeft");
+          assert_equals(scrollingWindow.scrollY, elementToRevealTop, "Final value of scrollTop");
+        });
+      }, `Main frame with auto scroll-behavior ; ${scrollFunction}() with smooth behavior`);
+
+      promise_test(() => {
+        resetScrollForWindow(scrollingWindow);
+        setScrollBehavior(styledElement, "smoothBehavior");
+        assert_equals(scrollingWindow.scrollX, 0);
+        assert_equals(scrollingWindow.scrollY, 0);
+        scrollWindow(scrollingWindow, scrollFunction, null, elementToRevealLeft, elementToRevealTop);
+        assert_less_than(scrollingWindow.scrollX, elementToRevealLeft, "Should not set scrollLeft immediately");
+        assert_less_than(scrollingWindow.scrollY, elementToRevealTop, "Should not set scrollTop immediately");
+        return waitForScrollEnd(scrollingWindow.document.scrollingElement).then(() => {
+          assert_equals(scrollingWindow.scrollX, elementToRevealLeft, "Final value of scrollLeft");
+          assert_equals(scrollingWindow.scrollY, elementToRevealTop, "Final value of scrollTop");
+        });
+      }, `Main frame with smooth scroll-behavior ; ${scrollFunction}() with default behavior`);
+
+      promise_test(() => {
+        resetScrollForWindow(scrollingWindow);
+        setScrollBehavior(styledElement, "smoothBehavior");
+        assert_equals(scrollingWindow.scrollX, 0);
+        assert_equals(scrollingWindow.scrollY, 0);
+        scrollWindow(scrollingWindow, scrollFunction, "auto", elementToRevealLeft, elementToRevealTop);
+        assert_less_than(scrollingWindow.scrollX, elementToRevealLeft, "Should not set scrollLeft immediately");
+        assert_less_than(scrollingWindow.scrollY, elementToRevealTop, "Should not set scrollTop immediately");
+        return waitForScrollEnd(scrollingWindow.document.scrollingElement).then(() => {
+          assert_equals(scrollingWindow.scrollX, elementToRevealLeft, "Final value of scrollLeft");
+          assert_equals(scrollingWindow.scrollY, elementToRevealTop, "Final value of scrollTop");
+        });
+      }, `Main frame with smooth scroll-behavior ; ${scrollFunction}() with auto behavior`);
+
+      promise_test(() => {
+        resetScrollForWindow(scrollingWindow);
+        setScrollBehavior(styledElement, "smoothBehavior");
+        assert_equals(scrollingWindow.scrollX, 0);
+        assert_equals(scrollingWindow.scrollY, 0);
+        scrollWindow(scrollingWindow, scrollFunction, "instant", elementToRevealLeft, elementToRevealTop);
+        assert_equals(scrollingWindow.scrollX, elementToRevealLeft, "Should set scrollLeft immediately");
+        assert_equals(scrollingWindow.scrollY, elementToRevealTop, "Should set scrollTop immediately");
+        return new Promise((resolve) => { resolve(); });
+      }, `Main frame with smooth scroll-behavior ; ${scrollFunction}() with instant behavior`);
+
+      promise_test(() => {
+        resetScrollForWindow(scrollingWindow);
+        setScrollBehavior(styledElement, "smoothBehavior");
+        assert_equals(scrollingWindow.scrollX, 0);
+        assert_equals(scrollingWindow.scrollY, 0);
+        scrollWindow(scrollingWindow, scrollFunction, "smooth", elementToRevealLeft, elementToRevealTop);
+        assert_less_than(scrollingWindow.scrollX, elementToRevealLeft, "Should not set scrollLeft immediately");
+        assert_less_than(scrollingWindow.scrollY, elementToRevealTop, "Should not set scrollTop immediately");
+        return waitForScrollEnd(scrollingWindow.document.scrollingElement).then(() => {
+          assert_equals(scrollingWindow.scrollX, elementToRevealLeft, "Final value of scrollLeft");
+          assert_equals(scrollingWindow.scrollY, elementToRevealTop, "Final value of scrollTop");
+        });
+     }, `Main frame with smooth scroll-behavior ; ${scrollFunction}() with smooth behavior`);
+    });
+
+    promise_test(() => {
+      resetScrollForWindow(scrollingWindow);
+      setScrollBehavior(styledElement, "smoothBehavior");
+      assert_equals(scrollingWindow.scrollX, 0);
+      assert_equals(scrollingWindow.scrollY, 0);
+      scrollWindow(scrollingWindow, "scroll", "smooth", elementToRevealLeft, elementToRevealTop);
+      scrollWindow(scrollingWindow, "scroll", "smooth", elementToRevealLeft / 2, elementToRevealTop / 2);
+      return waitForScrollEnd(scrollingWindow.document.scrollingElement).then(() => {
+        assert_equals(scrollingWindow.scrollX, elementToRevealLeft / 2, "Final value of scrollLeft");
+        assert_equals(scrollingWindow.scrollY, elementToRevealTop / 2, "Final value of scrollTop");
+      });
+    }, "Aborting an ongoing smooth scrolling on the main frame with another smooth scrolling");
+
+    promise_test(() => {
+      resetScrollForWindow(scrollingWindow);
+      setScrollBehavior(styledElement, "smoothBehavior");
+      assert_equals(scrollingWindow.scrollX, 0);
+      assert_equals(scrollingWindow.scrollY, 0);
+      scrollWindow(scrollingWindow, "scroll", "smooth", elementToRevealLeft, elementToRevealTop);
+      scrollWindow(scrollingWindow, "scroll", "instant", 0, 0);
+      return waitForScrollEnd(scrollingWindow.document.scrollingElement).then(() => {
+        assert_equals(scrollingWindow.scrollX, 0, "Final value of scrollLeft");
+        assert_equals(scrollingWindow.scrollY, 0, "Final value of scrollTop");
+    });
+  }, "Aborting an ongoing smooth scrolling on the main frame with an instant scrolling");
+  }));
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-scrollintoview-nested-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-scrollintoview-nested-expected.txt
new file mode 100644 (file)
index 0000000..7ce10c0
--- /dev/null
@@ -0,0 +1,3 @@
+
+FAIL scrollIntoView with nested elements with different scroll-behavior assert_less_than: Element with smooth behavior should not scroll immediately expected a number less than 500 but got 500
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-scrollintoview-nested.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-scrollintoview-nested.html
new file mode 100644 (file)
index 0000000..2a97e06
--- /dev/null
@@ -0,0 +1,88 @@
+<!DOCTYPE html>
+<title>Testing scrollOptions' behavior with scrollIntoView for nested scrolling nodes</title>
+<meta name="timeout" content="long"/>
+<link rel="author" title="Frédéric Wang" href="mailto:fwang@igalia.com">
+<link rel="help" href="https://drafts.csswg.org/cssom-view/#propdef-scroll-behavior">
+<link rel="help" href="https://drafts.csswg.org/cssom-view/#scrolling-box">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="support/scroll-behavior.js"></script>
+<style>
+  .scrollable {
+    overflow: auto;
+    height: 200px;
+  }
+  .smoothBehavior {
+    scroll-behavior: smooth;
+  }
+  .gradient {
+    background: linear-gradient(135deg, red, green);
+  }
+</style>
+<div id="log">
+</div>
+<div>
+  <div class="scrollable smoothBehavior" style="width: 450px">
+    <div class="gradient" style="width: 100px; height: 500px;"></div>
+    <div class="scrollable smoothBehavior" style="width: 400px">
+      <div class="gradient" style="width: 100px; height: 500px;"></div>
+      <div class="scrollable" style="width: 350px">
+        <div class="gradient" style="width: 100px; height: 500px;"></div>
+        <div class="scrollable" style="width: 300px">
+          <div class="gradient" style="width: 100px; height: 500px;"></div>
+          <div class="scrollable smoothBehavior" style="width: 250px">
+            <div class="gradient" style="width: 100px; height: 500px;"></div>
+            <div class="scrollable" style="width: 200px">
+              <div class="gradient" style="width: 100px; height: 500px;"></div>
+              <div id="elementToReveal" style="width: 10px; height: 10px; background: black;"></div>
+              <div class="gradient" style="width: 100px; height: 500px;"></div>
+            </div>
+            <div class="gradient" style="width: 100px; height: 500px;"></div>
+          </div>
+          <div class="gradient" style="width: 100px; height: 500px;"></div>
+        </div>
+      <div class="gradient" style="width: 100px; height: 500px;"></div>
+      </div>
+      <div class="gradient" style="width: 100px; height: 500px;"></div>
+    </div>
+  </div>
+</div>
+<script>
+  // The CSSOM-View spec and implementations follow different algorithms (scrolls performed in parallel, as inner-to-outer sequence or as outer-to-inner sequence).
+  // See https://github.com/w3c/csswg-drafts/issues/3127
+  promise_test(() => {
+    return new Promise(function(resolve, reject) {
+      var divs = document.querySelectorAll(".scrollable");
+      divs.forEach((scrollableDiv) => {
+        resetScroll(scrollableDiv);
+      });
+      elementToReveal.scrollIntoView({inline: "start", block: "start", behavior: "auto"});
+      var scrollTop = new Map();
+      var isSmooth = new Map();
+      divs.forEach((scrollableDiv) => {
+        scrollTop.set(scrollableDiv, scrollableDiv.scrollTop);
+        isSmooth.set(scrollableDiv, scrollableDiv.classList.contains("smoothBehavior"));
+        // If scroll operations are not performed in parallel, scroll boxes with instant behavior might also need to wait for their predecessors.
+        if (isSmooth.get(scrollableDiv))
+          assert_less_than(scrollTop.get(scrollableDiv), 500, "Element with smooth behavior should not scroll immediately");
+      });
+
+      observeScrolling(Array.from(divs), function(done) {
+        try {
+          divs.forEach((scrollableDiv) => {
+            assert_less_than_equal(scrollTop.get(scrollableDiv), scrollableDiv.scrollTop, "ScrollTop keeps increasing");
+            if (!isSmooth.get(scrollableDiv))
+              assert_any(assert_equals, scrollableDiv.scrollTop, [0, 500], "Element with instant behavior should jump to the final position");
+            if (done)
+              assert_equals(scrollableDiv.scrollTop, 500, "Final value of scrollTop");
+            scrollTop.set(scrollableDiv, scrollableDiv.scrollTop);
+          });
+        } catch(e) {
+          reject(e);
+        }
+        if (done)
+          resolve();
+      });
+    });
+  }, "scrollIntoView with nested elements with different scroll-behavior");
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-smooth-positions-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-smooth-positions-expected.txt
new file mode 100644 (file)
index 0000000..855a6a6
--- /dev/null
@@ -0,0 +1,20 @@
+
+PASS Scroll positions when performing smooth scrolling from (0, 0) to (500, 250) using scroll()  
+PASS Scroll positions when performing smooth scrolling from (1000, 0) to (500, 250) using scroll()  
+PASS Scroll positions when performing smooth scrolling from (0, 500) to (500, 250) using scroll()  
+PASS Scroll positions when performing smooth scrolling from (1000, 500) to (500, 250) using scroll()  
+PASS Scroll positions when performing smooth scrolling from (0, 0) to (500, 250) using scrollTo()  
+PASS Scroll positions when performing smooth scrolling from (1000, 0) to (500, 250) using scrollTo()  
+PASS Scroll positions when performing smooth scrolling from (0, 500) to (500, 250) using scrollTo()  
+PASS Scroll positions when performing smooth scrolling from (1000, 500) to (500, 250) using scrollTo()  
+PASS Scroll positions when performing smooth scrolling from (0, 0) to (500, 250) using scrollBy()  
+PASS Scroll positions when performing smooth scrolling from (1000, 0) to (500, 250) using scrollBy()  
+PASS Scroll positions when performing smooth scrolling from (0, 500) to (500, 250) using scrollBy()  
+PASS Scroll positions when performing smooth scrolling from (1000, 500) to (500, 250) using scrollBy()  
+PASS Scroll positions when performing smooth scrolling from (0, 0) to (500, 250) using scrollIntoView()  
+PASS Scroll positions when performing smooth scrolling from (1000, 0) to (500, 250) using scrollIntoView()  
+PASS Scroll positions when performing smooth scrolling from (0, 500) to (500, 250) using scrollIntoView()  
+PASS Scroll positions when performing smooth scrolling from (1000, 500) to (500, 250) using scrollIntoView()  
+PASS Scroll positions when aborting a smooth scrolling with another smooth scrolling 
+PASS Scroll positions when aborting a smooth scrolling with an instant scrolling 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-smooth-positions.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-smooth-positions.html
new file mode 100644 (file)
index 0000000..19e317d
--- /dev/null
@@ -0,0 +1,151 @@
+<!DOCTYPE html>
+<title>Testing scroll positions when scrolling an element with smooth behavior</title>
+<meta name="timeout" content="long"/>
+<link rel="author" title="Frédéric Wang" href="mailto:fwang@igalia.com">
+<link rel="help" href="https://drafts.csswg.org/cssom-view/#propdef-scroll-behavior">
+<link rel="help" href="https://drafts.csswg.org/cssom-view/#scrolling-box">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="support/scroll-behavior.js"></script>
+<style>
+  .scrollable {
+    overflow: auto;
+    width: 400px;
+    height: 200px;
+    scroll-behavior: smooth;
+  }
+</style>
+<div id="log">
+</div>
+<div id="overflowNode" class="scrollable">
+  <div style="width: 2000px; height: 1000px; background: linear-gradient(135deg, red, green);">
+    <span style="display: inline-block; width: 500px; height: 250px;"></span><span id="elementToReveal" style="display: inline-block; vertical-align: -15px; width: 10px; height: 15px; background: black;"></span>
+  </div>
+</div>
+<script>
+  // For smooth behavior, evolution of scroll positions over time is not specified by CSSOM View.
+  // This test relies on the minimal assumption that scroll position functions are monotonic.
+  ["scroll", "scrollTo", "scrollBy", "scrollIntoView"].forEach(function(scrollFunction) {
+    [{left:0, top:0}, {left:1000, top:0}, {left:0, top:500}, {left:1000, top:500}].forEach((initial) => {
+      var finalLeft = 500;
+      var finalTop = 250;
+      promise_test(() => {
+        return new Promise(function(resolve, reject) {
+          scrollNode(overflowNode, "scroll", "instant", initial.left, initial.top);
+          var oldLeft = overflowNode.scrollLeft;
+          var oldTop = overflowNode.scrollTop;
+          assert_equals(oldLeft, initial.left, "ScrollLeft should be at initial position");
+          assert_equals(oldTop, initial.top, "ScrollTop should be at initial position");
+          if (scrollFunction === "scrollBy")
+            scrollNode(overflowNode, scrollFunction, "smooth", finalLeft - initial.left, finalTop - initial.top);
+          else
+            scrollNode(overflowNode, scrollFunction, "smooth", finalLeft, finalTop);
+          observeScrolling(overflowNode, function(done) {
+            try {
+              var newLeft = overflowNode.scrollLeft;
+              var newTop = overflowNode.scrollTop;
+              assert_less_than_equal(Math.hypot(finalLeft - newLeft, finalTop - newTop), Math.hypot(finalLeft - oldLeft, finalTop - oldTop), "Scroll position should move towards the final position");
+              if (done) {
+                assert_equals(newLeft, finalLeft, "ScrollLeft should reach final position");
+                assert_equals(newTop, finalTop, "ScrollTop should reach final position");
+              }
+              oldLeft = newLeft;
+              oldTop = newTop;
+            } catch(e) {
+              reject(e);
+            }
+            if (done)
+              resolve();
+          });
+        });
+      }, `Scroll positions when performing smooth scrolling from (${initial.left}, ${initial.top}) to (${finalLeft}, ${finalTop}) using ${scrollFunction}() `);
+    });
+  });
+
+  promise_test(() => {
+    return new Promise(function(resolve, reject) {
+      resetScroll(overflowNode);
+      var initialScrollAborted = false;
+      var scrollDirectionChanged = false;
+      var oldLeft = overflowNode.scrollLeft;
+      var oldTop = overflowNode.scrollTop;
+      assert_equals(oldLeft, 0);
+      assert_equals(oldTop, 0);
+      scrollNode(overflowNode, "scroll", "smooth", 1500, 750);
+      observeScrolling(overflowNode, function(done) {
+        try {
+          var newLeft = overflowNode.scrollLeft;
+          var newTop = overflowNode.scrollTop;
+          if (initialScrollAborted) {
+            if (scrollDirectionChanged) {
+              assert_greater_than_equal(oldLeft, newLeft, "ScrollLeft keeps decreasing");
+              assert_greater_than_equal(oldTop, newTop, "ScrollTop keeps decreasing");
+            } else
+              scrollDirectionChanged = newLeft <= oldLeft && newTop <= oldTop;
+          } else {
+              assert_less_than_equal(oldLeft, newLeft, "ScrollLeft keeps increasing");
+              assert_less_than_equal(oldTop, newTop, "ScrollTop keeps increasing");
+              if (newLeft > 1000 && newTop > 500) {
+                // Abort the initial scroll.
+                initialScrollAborted = true;
+                scrollNode(overflowNode, "scroll", "smooth", 500, 250);
+                newLeft = overflowNode.scrollLeft;
+                newTop = overflowNode.scrollTop;
+              }
+          }
+          if (done) {
+            assert_equals(newLeft, 500, "ScrollLeft should reach final position");
+            assert_equals(newTop, 250, "ScrollTop should reach final position");
+          }
+          oldLeft = newLeft;
+          oldTop = newTop;
+        } catch(e) {
+          reject(e);
+        }
+        if (done)
+          resolve();
+      });
+    });
+  }, "Scroll positions when aborting a smooth scrolling with another smooth scrolling");
+
+  promise_test(() => {
+    return new Promise(function(resolve) {
+      resetScroll(overflowNode);
+      var initialScrollAborted = false;
+      var oldLeft = overflowNode.scrollLeft;
+      var oldTop = overflowNode.scrollTop;
+      assert_equals(oldLeft, 0);
+      assert_equals(oldTop, 0);
+      scrollNode(overflowNode, "scroll", "smooth", 1500, 750);
+      observeScrolling(overflowNode, function(done) {
+        try {
+          var newLeft = overflowNode.scrollLeft;
+          var newTop = overflowNode.scrollTop;
+          if (!initialScrollAborted) {
+              assert_less_than_equal(oldLeft, newLeft, "ScrollLeft keeps increasing");
+              assert_less_than_equal(oldTop, newTop, "ScrollTop keeps increasing");
+              if (newLeft > 1000 && newTop > 500) {
+                // Abort the initial scroll.
+                initialScrollAborted = true;
+                scrollNode(overflowNode, "scroll", "instant", 500, 250);
+                newLeft = overflowNode.scrollLeft;
+                newTop = overflowNode.scrollTop;
+                assert_equals(newLeft, 500, "ScrollLeft should reach final position");
+                assert_equals(newTop, 250, "ScrollTop should reach final position");
+              }
+          }
+          if (done) {
+            assert_equals(newLeft, 500, "ScrollLeft should stay at final position");
+            assert_equals(newTop, 250, "ScrollTop should stay at final position");
+          }
+          oldLeft = newLeft;
+          oldTop = newTop;
+        } catch(e) {
+          reject(e);
+        }
+        if (done)
+          resolve();
+      });
+    });
+  }, "Scroll positions when aborting a smooth scrolling with an instant scrolling");
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-root-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-root-expected.txt
new file mode 100644 (file)
index 0000000..b6fa1c2
--- /dev/null
@@ -0,0 +1,37 @@
+
+PASS iframe loaded 
+PASS Subframe with auto scroll-behavior ; scroll() with default behavior 
+PASS Subframe with auto scroll-behavior ; scroll() with auto behavior 
+PASS Subframe with auto scroll-behavior ; scroll() with instant behavior 
+FAIL Subframe with auto scroll-behavior ; scroll() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
+FAIL Subframe with smooth scroll-behavior ; scroll() with default behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
+FAIL Subframe with smooth scroll-behavior ; scroll() with auto behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
+PASS Subframe with smooth scroll-behavior ; scroll() with instant behavior 
+FAIL Subframe with smooth scroll-behavior ; scroll() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
+PASS Subframe with auto scroll-behavior ; scrollTo() with default behavior 
+PASS Subframe with auto scroll-behavior ; scrollTo() with auto behavior 
+PASS Subframe with auto scroll-behavior ; scrollTo() with instant behavior 
+FAIL Subframe with auto scroll-behavior ; scrollTo() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
+FAIL Subframe with smooth scroll-behavior ; scrollTo() with default behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
+FAIL Subframe with smooth scroll-behavior ; scrollTo() with auto behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
+PASS Subframe with smooth scroll-behavior ; scrollTo() with instant behavior 
+FAIL Subframe with smooth scroll-behavior ; scrollTo() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
+PASS Subframe with auto scroll-behavior ; scrollBy() with default behavior 
+PASS Subframe with auto scroll-behavior ; scrollBy() with auto behavior 
+PASS Subframe with auto scroll-behavior ; scrollBy() with instant behavior 
+FAIL Subframe with auto scroll-behavior ; scrollBy() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
+FAIL Subframe with smooth scroll-behavior ; scrollBy() with default behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
+FAIL Subframe with smooth scroll-behavior ; scrollBy() with auto behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
+PASS Subframe with smooth scroll-behavior ; scrollBy() with instant behavior 
+FAIL Subframe with smooth scroll-behavior ; scrollBy() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
+PASS Subframe with auto scroll-behavior ; scrollIntoView() with default behavior 
+PASS Subframe with auto scroll-behavior ; scrollIntoView() with auto behavior 
+PASS Subframe with auto scroll-behavior ; scrollIntoView() with instant behavior 
+FAIL Subframe with auto scroll-behavior ; scrollIntoView() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
+FAIL Subframe with smooth scroll-behavior ; scrollIntoView() with default behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
+FAIL Subframe with smooth scroll-behavior ; scrollIntoView() with auto behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
+PASS Subframe with smooth scroll-behavior ; scrollIntoView() with instant behavior 
+FAIL Subframe with smooth scroll-behavior ; scrollIntoView() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
+PASS Aborting an ongoing smooth scrolling on a subframe with another smooth scrolling 
+PASS Aborting an ongoing smooth scrolling on a subframe with an instant scrolling 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-root.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-root.html
new file mode 100644 (file)
index 0000000..32de1b6
--- /dev/null
@@ -0,0 +1,170 @@
+<!DOCTYPE html>
+<title>Testing scrollOptions' behavior for Element.scroll* and scroll-behavior on the root of a subframe</title>
+<meta name="timeout" content="long"/>
+<link rel="author" title="Frédéric Wang" href="mailto:fwang@igalia.com">
+<link rel="help" href="https://drafts.csswg.org/cssom-view/#propdef-scroll-behavior">
+<link rel="help" href="https://drafts.csswg.org/cssom-view/#scrolling-box">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="support/scroll-behavior.js"></script>
+<div id="log">
+</div>
+<iframe id="iframeNode" width="400px" height="200px" srcdoc="<!DOCTYPE>
+<html>
+  <style>
+    body {
+      margin: 0;
+    }
+    .autoBehavior {
+      scroll-behavior: auto;
+    }
+    .smoothBehavior {
+      scroll-behavior: smooth;
+    }
+  </style>
+  <body>
+    <div style='width: 2000px; height: 1000px; background: linear-gradient(135deg, red, green);'>
+      <span style='display: inline-block; width: 500px; height: 250px;'></span><span id='elementToReveal' style='display: inline-block; vertical-align: -15px; width: 10px; height: 15px; background: black;'></span>
+    </div>
+  </body>
+</html>">
+</iframe>
+<script>
+  var iframeLoadTest = async_test("iframe loaded");
+  var scrollingElement, styledElement, elementToReveal;
+  var elementToRevealLeft = 500;
+  var elementToRevealTop = 250;
+  iframeNode.addEventListener("load", iframeLoadTest.step_func_done(() => {
+    scrollingElement = iframeNode.contentDocument.scrollingElement;
+    styledElement = iframeNode.contentDocument.documentElement;
+    elementToReveal = iframeNode.contentDocument.getElementById("elementToReveal");
+
+    ["scroll", "scrollTo", "scrollBy", "scrollIntoView"].forEach((scrollFunction) => {
+      promise_test(() => {
+        resetScroll(scrollingElement);
+        setScrollBehavior(styledElement, "autoBehavior");
+        assert_equals(scrollingElement.scrollLeft, 0);
+        assert_equals(scrollingElement.scrollTop, 0);
+        scrollNode(scrollingElement, scrollFunction, null, elementToRevealLeft, elementToRevealTop);
+        assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Should set scrollLeft immediately");
+        assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Should set scrollTop immediately");
+        return new Promise((resolve) => { resolve(); });
+      }, `Subframe with auto scroll-behavior ; ${scrollFunction}() with default behavior`);
+
+      promise_test(() => {
+        resetScroll(scrollingElement);
+        setScrollBehavior(styledElement, "autoBehavior");
+        assert_equals(scrollingElement.scrollLeft, 0);
+        assert_equals(scrollingElement.scrollTop, 0);
+        scrollNode(scrollingElement, scrollFunction, "auto", elementToRevealLeft, elementToRevealTop);
+        assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Should set scrollLeft immediately");
+        assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Should set scrollTop immediately");
+        return new Promise((resolve) => { resolve(); });
+      }, `Subframe with auto scroll-behavior ; ${scrollFunction}() with auto behavior`);
+
+      promise_test(() => {
+        resetScroll(scrollingElement);
+        setScrollBehavior(styledElement, "autoBehavior");
+        assert_equals(scrollingElement.scrollLeft, 0);
+        assert_equals(scrollingElement.scrollTop, 0);
+        scrollNode(scrollingElement, scrollFunction, "instant", elementToRevealLeft, elementToRevealTop);
+        assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Should set scrollLeft immediately");
+        assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Should set scrollTop immediately");
+        return new Promise((resolve) => { resolve(); });
+      }, `Subframe with auto scroll-behavior ; ${scrollFunction}() with instant behavior`);
+
+      promise_test(() => {
+        resetScroll(scrollingElement);
+        setScrollBehavior(styledElement, "autoBehavior");
+        assert_equals(scrollingElement.scrollLeft, 0);
+        assert_equals(scrollingElement.scrollTop, 0);
+        scrollNode(scrollingElement, scrollFunction, "smooth", elementToRevealLeft, elementToRevealTop);
+        assert_less_than(scrollingElement.scrollLeft, elementToRevealLeft, "Should not set scrollLeft immediately");
+        assert_less_than(scrollingElement.scrollTop, elementToRevealTop, "Should not set scrollTop immediately");
+        return waitForScrollEnd(scrollingElement).then(() => {
+          assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Final value of scrollLeft");
+          assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Final value of scrollTop");
+        });
+      }, `Subframe with auto scroll-behavior ; ${scrollFunction}() with smooth behavior`);
+
+      promise_test(() => {
+        resetScroll(scrollingElement);
+        setScrollBehavior(styledElement, "smoothBehavior");
+        assert_equals(scrollingElement.scrollLeft, 0);
+        assert_equals(scrollingElement.scrollTop, 0);
+        scrollNode(scrollingElement, scrollFunction, null, elementToRevealLeft, elementToRevealTop);
+        assert_less_than(scrollingElement.scrollLeft, elementToRevealLeft, "Should not set scrollLeft immediately");
+        assert_less_than(scrollingElement.scrollTop, elementToRevealTop, "Should not set scrollTop immediately");
+        return waitForScrollEnd(scrollingElement).then(() => {
+          assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Final value of scrollLeft");
+          assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Final value of scrollTop");
+        });
+      }, `Subframe with smooth scroll-behavior ; ${scrollFunction}() with default behavior`);
+
+      promise_test(() => {
+        resetScroll(scrollingElement);
+        setScrollBehavior(styledElement, "smoothBehavior");
+        assert_equals(scrollingElement.scrollLeft, 0);
+        assert_equals(scrollingElement.scrollTop, 0);
+        scrollNode(scrollingElement, scrollFunction, "auto", elementToRevealLeft, elementToRevealTop);
+        assert_less_than(scrollingElement.scrollLeft, elementToRevealLeft, "Should not set scrollLeft immediately");
+        assert_less_than(scrollingElement.scrollTop, elementToRevealTop, "Should not set scrollTop immediately");
+        return waitForScrollEnd(scrollingElement).then(() => {
+          assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Final value of scrollLeft");
+          assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Final value of scrollTop");
+        });
+      }, `Subframe with smooth scroll-behavior ; ${scrollFunction}() with auto behavior`);
+
+      promise_test(() => {
+        resetScroll(scrollingElement);
+        setScrollBehavior(styledElement, "smoothBehavior");
+        assert_equals(scrollingElement.scrollLeft, 0);
+        assert_equals(scrollingElement.scrollTop, 0);
+        scrollNode(scrollingElement, scrollFunction, "instant", elementToRevealLeft, elementToRevealTop);
+        assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Should set scrollLeft immediately");
+        assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Should set scrollTop immediately");
+        return new Promise((resolve) => { resolve(); });
+      }, `Subframe with smooth scroll-behavior ; ${scrollFunction}() with instant behavior`);
+
+      promise_test(() => {
+        resetScroll(scrollingElement);
+        setScrollBehavior(styledElement, "smoothBehavior");
+        assert_equals(scrollingElement.scrollLeft, 0);
+        assert_equals(scrollingElement.scrollTop, 0);
+        scrollNode(scrollingElement, scrollFunction, "smooth", elementToRevealLeft, elementToRevealTop);
+        assert_less_than(scrollingElement.scrollLeft, elementToRevealLeft, "Should not set scrollLeft immediately");
+        assert_less_than(scrollingElement.scrollTop, elementToRevealTop, "Should not set scrollTop immediately");
+        return waitForScrollEnd(scrollingElement).then(() => {
+          assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Final value of scrollLeft");
+          assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Final value of scrollTop");
+        });
+     }, `Subframe with smooth scroll-behavior ; ${scrollFunction}() with smooth behavior`);
+    });
+
+    promise_test(() => {
+      resetScroll(scrollingElement);
+      setScrollBehavior(styledElement, "smoothBehavior");
+      assert_equals(scrollingElement.scrollLeft, 0);
+      assert_equals(scrollingElement.scrollTop, 0);
+      scrollNode(scrollingElement, "scroll", "smooth", elementToRevealLeft, elementToRevealTop);
+      scrollNode(scrollingElement, "scroll", "smooth", elementToRevealLeft / 2, elementToRevealTop / 2);
+      return waitForScrollEnd(scrollingElement).then(() => {
+        assert_equals(scrollingElement.scrollLeft, elementToRevealLeft / 2, "Final value of scrollLeft");
+        assert_equals(scrollingElement.scrollTop, elementToRevealTop / 2, "Final value of scrollTop");
+      });
+    }, "Aborting an ongoing smooth scrolling on a subframe with another smooth scrolling");
+
+    promise_test(() => {
+      resetScroll(scrollingElement);
+      setScrollBehavior(styledElement, "smoothBehavior");
+      assert_equals(scrollingElement.scrollLeft, 0);
+      assert_equals(scrollingElement.scrollTop, 0);
+      scrollNode(scrollingElement, "scroll", "smooth", elementToRevealLeft, elementToRevealTop);
+      scrollNode(scrollingElement, "scroll", "instant", 0, 0);
+      return waitForScrollEnd(scrollingElement).then(() => {
+        assert_equals(scrollingElement.scrollLeft, 0, "Final value of scrollLeft");
+        assert_equals(scrollingElement.scrollTop, 0, "Final value of scrollTop");
+    });
+  }, "Aborting an ongoing smooth scrolling on a subframe with an instant scrolling");
+  }));
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-window-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-window-expected.txt
new file mode 100644 (file)
index 0000000..cc665eb
--- /dev/null
@@ -0,0 +1,29 @@
+
+PASS iframe loaded 
+PASS Main frame with auto scroll-behavior ; scroll() with default behavior 
+PASS Main frame with auto scroll-behavior ; scroll() with auto behavior 
+PASS Main frame with auto scroll-behavior ; scroll() with instant behavior 
+FAIL Main frame with auto scroll-behavior ; scroll() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
+FAIL Main frame with smooth scroll-behavior ; scroll() with default behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
+FAIL Main frame with smooth scroll-behavior ; scroll() with auto behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
+PASS Main frame with smooth scroll-behavior ; scroll() with instant behavior 
+FAIL Main frame with smooth scroll-behavior ; scroll() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
+PASS Main frame with auto scroll-behavior ; scrollTo() with default behavior 
+PASS Main frame with auto scroll-behavior ; scrollTo() with auto behavior 
+PASS Main frame with auto scroll-behavior ; scrollTo() with instant behavior 
+FAIL Main frame with auto scroll-behavior ; scrollTo() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
+FAIL Main frame with smooth scroll-behavior ; scrollTo() with default behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
+FAIL Main frame with smooth scroll-behavior ; scrollTo() with auto behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
+PASS Main frame with smooth scroll-behavior ; scrollTo() with instant behavior 
+FAIL Main frame with smooth scroll-behavior ; scrollTo() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
+PASS Main frame with auto scroll-behavior ; scrollBy() with default behavior 
+PASS Main frame with auto scroll-behavior ; scrollBy() with auto behavior 
+PASS Main frame with auto scroll-behavior ; scrollBy() with instant behavior 
+FAIL Main frame with auto scroll-behavior ; scrollBy() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
+FAIL Main frame with smooth scroll-behavior ; scrollBy() with default behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
+FAIL Main frame with smooth scroll-behavior ; scrollBy() with auto behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
+PASS Main frame with smooth scroll-behavior ; scrollBy() with instant behavior 
+FAIL Main frame with smooth scroll-behavior ; scrollBy() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
+PASS Aborting an ongoing smooth scrolling on the main frame with another smooth scrolling 
+PASS Aborting an ongoing smooth scrolling on the main frame with an instant scrolling 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-window.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-window.html
new file mode 100644 (file)
index 0000000..0a8ed39
--- /dev/null
@@ -0,0 +1,171 @@
+<!DOCTYPE html>
+<title>Testing scrollOptions' behavior for Element.scroll* and scroll-behavior on the root of a subframe</title>
+<meta name="timeout" content="long"/>
+<link rel="author" title="Frédéric Wang" href="mailto:fwang@igalia.com">
+<link rel="help" href="https://drafts.csswg.org/cssom-view/#propdef-scroll-behavior">
+<link rel="help" href="https://drafts.csswg.org/cssom-view/#scrolling-box">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="support/scroll-behavior.js"></script>
+<div id="log">
+</div>
+<iframe id="iframeNode" width="400px" height="200px" srcdoc="<!DOCTYPE>
+<html>
+  <style>
+    body {
+      margin: 0;
+    }
+    .autoBehavior {
+      scroll-behavior: auto;
+    }
+    .smoothBehavior {
+      scroll-behavior: smooth;
+    }
+  </style>
+  <body>
+    <div style='width: 2000px; height: 1000px; background: linear-gradient(135deg, red, green);'>
+      <span style='display: inline-block; width: 500px; height: 250px;'></span><span id='elementToReveal' style='display: inline-block; vertical-align: -15px; width: 10px; height: 15px; background: black;'></span>
+    </div>
+  </body>
+</html>">
+</iframe>
+<script>
+  var iframeLoadTest = async_test("iframe loaded");
+  var scrollingWindow, styledElement, elementToReveal;
+  var elementToRevealLeft = 500;
+  var elementToRevealTop = 250;
+  iframeNode.addEventListener("load", iframeLoadTest.step_func_done(() => {
+    scrollingWindow = iframeNode.contentWindow;
+    styledElement = iframeNode.contentDocument.documentElement;
+    elementToReveal = iframeNode.contentDocument.getElementById("elementToReveal");
+
+    ["scroll", "scrollTo", "scrollBy"].forEach((scrollFunction) => {
+      promise_test(() => {
+        resetScrollForWindow(scrollingWindow);
+        setScrollBehavior(styledElement, "autoBehavior");
+        assert_equals(scrollingWindow.scrollX, 0);
+        assert_equals(scrollingWindow.scrollY, 0);
+        scrollWindow(scrollingWindow, scrollFunction, null, elementToRevealLeft, elementToRevealTop);
+        assert_equals(scrollingWindow.scrollX, elementToRevealLeft, "Should set scrollLeft immediately");
+        assert_equals(scrollingWindow.scrollY, elementToRevealTop, "Should set scrollTop immediately");
+        return new Promise((resolve) => { resolve(); });
+      }, `Main frame with auto scroll-behavior ; ${scrollFunction}() with default behavior`);
+
+      promise_test(() => {
+        resetScrollForWindow(scrollingWindow);
+        setScrollBehavior(styledElement, "autoBehavior");
+        assert_equals(scrollingWindow.scrollX, 0);
+        assert_equals(scrollingWindow.scrollY, 0);
+        scrollWindow(scrollingWindow, scrollFunction, "auto", elementToRevealLeft, elementToRevealTop);
+        assert_equals(scrollingWindow.scrollX, elementToRevealLeft, "Should set scrollLeft immediately");
+        assert_equals(scrollingWindow.scrollY, elementToRevealTop, "Should set scrollTop immediately");
+        return new Promise((resolve) => { resolve(); });
+      }, `Main frame with auto scroll-behavior ; ${scrollFunction}() with auto behavior`);
+
+      promise_test(() => {
+        resetScrollForWindow(scrollingWindow);
+        setScrollBehavior(styledElement, "autoBehavior");
+        assert_equals(scrollingWindow.scrollX, 0);
+        assert_equals(scrollingWindow.scrollY, 0);
+        scrollWindow(scrollingWindow, scrollFunction, "instant", elementToRevealLeft, elementToRevealTop);
+        assert_equals(scrollingWindow.scrollX, elementToRevealLeft, "Should set scrollLeft immediately");
+        assert_equals(scrollingWindow.scrollY, elementToRevealTop, "Should set scrollTop immediately");
+        return new Promise((resolve) => { resolve(); });
+      }, `Main frame with auto scroll-behavior ; ${scrollFunction}() with instant behavior`);
+
+      promise_test(() => {
+        resetScrollForWindow(scrollingWindow);
+        setScrollBehavior(styledElement, "autoBehavior");
+        assert_equals(scrollingWindow.scrollX, 0);
+        assert_equals(scrollingWindow.scrollY, 0);
+        scrollWindow(scrollingWindow, scrollFunction, "smooth", elementToRevealLeft, elementToRevealTop);
+        assert_less_than(scrollingWindow.scrollX, elementToRevealLeft, "Should not set scrollLeft immediately");
+        assert_less_than(scrollingWindow.scrollY, elementToRevealTop, "Should not set scrollTop immediately");
+        return waitForScrollEnd(scrollingWindow.document.scrollingElement).then(() => {
+          assert_equals(scrollingWindow.scrollX, elementToRevealLeft, "Final value of scrollLeft");
+          assert_equals(scrollingWindow.scrollY, elementToRevealTop, "Final value of scrollTop");
+        });
+      }, `Main frame with auto scroll-behavior ; ${scrollFunction}() with smooth behavior`);
+
+      promise_test(() => {
+        resetScrollForWindow(scrollingWindow);
+        setScrollBehavior(styledElement, "smoothBehavior");
+        assert_equals(scrollingWindow.scrollX, 0);
+        assert_equals(scrollingWindow.scrollY, 0);
+        scrollWindow(scrollingWindow, scrollFunction, null, elementToRevealLeft, elementToRevealTop);
+        assert_less_than(scrollingWindow.scrollX, elementToRevealLeft, "Should not set scrollLeft immediately");
+        assert_less_than(scrollingWindow.scrollY, elementToRevealTop, "Should not set scrollTop immediately");
+        return waitForScrollEnd(scrollingWindow.document.scrollingElement).then(() => {
+          assert_equals(scrollingWindow.scrollX, elementToRevealLeft, "Final value of scrollLeft");
+          assert_equals(scrollingWindow.scrollY, elementToRevealTop, "Final value of scrollTop");
+        });
+      }, `Main frame with smooth scroll-behavior ; ${scrollFunction}() with default behavior`);
+
+      promise_test(() => {
+        resetScrollForWindow(scrollingWindow);
+        setScrollBehavior(styledElement, "smoothBehavior");
+        assert_equals(scrollingWindow.scrollX, 0);
+        assert_equals(scrollingWindow.scrollY, 0);
+        scrollWindow(scrollingWindow, scrollFunction, "auto", elementToRevealLeft, elementToRevealTop);
+        assert_less_than(scrollingWindow.scrollX, elementToRevealLeft, "Should not set scrollLeft immediately");
+        assert_less_than(scrollingWindow.scrollY, elementToRevealTop, "Should not set scrollTop immediately");
+        return waitForScrollEnd(scrollingWindow.document.scrollingElement).then(() => {
+          assert_equals(scrollingWindow.scrollX, elementToRevealLeft, "Final value of scrollLeft");
+          assert_equals(scrollingWindow.scrollY, elementToRevealTop, "Final value of scrollTop");
+        });
+      }, `Main frame with smooth scroll-behavior ; ${scrollFunction}() with auto behavior`);
+
+      promise_test(() => {
+        resetScrollForWindow(scrollingWindow);
+        setScrollBehavior(styledElement, "smoothBehavior");
+        assert_equals(scrollingWindow.scrollX, 0);
+        assert_equals(scrollingWindow.scrollY, 0);
+        scrollWindow(scrollingWindow, scrollFunction, "instant", elementToRevealLeft, elementToRevealTop);
+        assert_equals(scrollingWindow.scrollX, elementToRevealLeft, "Should set scrollLeft immediately");
+        assert_equals(scrollingWindow.scrollY, elementToRevealTop, "Should set scrollTop immediately");
+        return new Promise((resolve) => { resolve(); });
+      }, `Main frame with smooth scroll-behavior ; ${scrollFunction}() with instant behavior`);
+
+      promise_test(() => {
+        resetScrollForWindow(scrollingWindow);
+        setScrollBehavior(styledElement, "smoothBehavior");
+        assert_equals(scrollingWindow.scrollX, 0);
+        assert_equals(scrollingWindow.scrollY, 0);
+        scrollWindow(scrollingWindow, scrollFunction, "smooth", elementToRevealLeft, elementToRevealTop);
+        assert_less_than(scrollingWindow.scrollX, elementToRevealLeft, "Should not set scrollLeft immediately");
+        assert_less_than(scrollingWindow.scrollY, elementToRevealTop, "Should not set scrollTop immediately");
+        return waitForScrollEnd(scrollingWindow.document.scrollingElement).then(() => {
+          assert_equals(scrollingWindow.scrollX, elementToRevealLeft, "Final value of scrollLeft");
+          assert_equals(scrollingWindow.scrollY, elementToRevealTop, "Final value of scrollTop");
+        });
+     }, `Main frame with smooth scroll-behavior ; ${scrollFunction}() with smooth behavior`);
+    });
+
+    promise_test(() => {
+      resetScrollForWindow(scrollingWindow);
+      setScrollBehavior(styledElement, "smoothBehavior");
+      assert_equals(scrollingWindow.scrollX, 0);
+      assert_equals(scrollingWindow.scrollY, 0);
+      scrollWindow(scrollingWindow, "scroll", "smooth", elementToRevealLeft, elementToRevealTop);
+      scrollWindow(scrollingWindow, "scroll", "smooth", elementToRevealLeft / 2, elementToRevealTop / 2);
+      return waitForScrollEnd(scrollingWindow.document.scrollingElement).then(() => {
+        assert_equals(scrollingWindow.scrollX, elementToRevealLeft / 2, "Final value of scrollLeft");
+        assert_equals(scrollingWindow.scrollY, elementToRevealTop / 2, "Final value of scrollTop");
+      });
+    }, "Aborting an ongoing smooth scrolling on the main frame with another smooth scrolling");
+
+    promise_test(() => {
+      resetScrollForWindow(scrollingWindow);
+      setScrollBehavior(styledElement, "smoothBehavior");
+      assert_equals(scrollingWindow.scrollX, 0);
+      assert_equals(scrollingWindow.scrollY, 0);
+      scrollWindow(scrollingWindow, "scroll", "smooth", elementToRevealLeft, elementToRevealTop);
+      scrollWindow(scrollingWindow, "scroll", "instant", 0, 0);
+      return waitForScrollEnd(scrollingWindow.document.scrollingElement).then(() => {
+        assert_equals(scrollingWindow.scrollX, 0, "Final value of scrollLeft");
+        assert_equals(scrollingWindow.scrollY, 0, "Final value of scrollTop");
+    });
+  }, "Aborting an ongoing smooth scrolling on the main frame with an instant scrolling");
+
+  }));
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-vertical-rl-writing-mode-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-vertical-rl-writing-mode-expected.txt
new file mode 100644 (file)
index 0000000..b605c84
--- /dev/null
@@ -0,0 +1,11 @@
+
+FAIL scrollIntoView({block: "start", inline: "start"}) assert_approx_equals: scrollX expected -200 +/- 0.5 but got -100
+FAIL scrollIntoView({block: "start", inline: "center"}) assert_approx_equals: scrollX expected -200 +/- 0.5 but got -143
+FAIL scrollIntoView({block: "start", inline: "end"}) assert_approx_equals: scrollX expected -200 +/- 0.5 but got -185
+FAIL scrollIntoView({block: "center", inline: "start"}) assert_approx_equals: scrollX expected -157.5 +/- 0.5 but got -100
+FAIL scrollIntoView({block: "center", inline: "center"}) assert_approx_equals: scrollX expected -157.5 +/- 0.5 but got -143
+FAIL scrollIntoView({block: "center", inline: "end"}) assert_approx_equals: scrollX expected -157.5 +/- 0.5 but got -185
+FAIL scrollIntoView({block: "end", inline: "start"}) assert_approx_equals: scrollX expected -115 +/- 0.5 but got -100
+FAIL scrollIntoView({block: "end", inline: "center"}) assert_approx_equals: scrollX expected -115 +/- 0.5 but got -143
+FAIL scrollIntoView({block: "end", inline: "end"}) assert_approx_equals: scrollX expected -115 +/- 0.5 but got -185
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-vertical-rl-writing-mode.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-vertical-rl-writing-mode.html
new file mode 100644 (file)
index 0000000..c404931
--- /dev/null
@@ -0,0 +1,107 @@
+<!DOCTYPE html>
+<title>CSSOM View - scrollIntoView considers vertical-rl writing mode</title>
+<meta charset="utf-8">
+<link rel="author" title="Suneel Kota" href="mailto:suneel.kota@samsung.com">
+<link rel="help" href="https://drafts.csswg.org/cssom-view/#dom-element-scrollintoview">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<style>
+.box {
+  float: left;
+  width: 200px;
+  height: 200px;
+}
+#scroller {
+  writing-mode: vertical-rl;
+  overflow: scroll;
+  width: 300px;
+  height: 300px;
+}
+#container{
+  width: 600px;
+  height: 600px;
+}
+#target {
+  background-color: #ff0;
+}
+</style>
+<body>
+<div id="scroller">
+  <div id="container">
+    <!--  ROW-1  -->
+    <div class="row">
+      <div class="box"></div>
+      <div class="box"></div>
+      <div class="box"></div>
+    </div>
+
+    <!--  ROW-2  -->
+    <div class="row">
+      <div class="box"></div>
+      <div class="box" id="target"></div>
+      <div class="box"></div>
+    </div>
+
+    <!--  ROW-3  -->
+    <div class="row">
+      <div class="box"></div>
+      <div class="box"></div>
+      <div class="box"></div>
+    </div>
+  </div>
+</div>
+
+<script>
+var target = document.getElementById("target");
+var scroller = document.getElementById("scroller");
+var scrollbar_width = scroller.offsetWidth - scroller.clientWidth;
+
+var scroller_width = scroller.offsetWidth;
+var scroller_height = scroller.offsetHeight;
+var box_width = target.offsetWidth;
+var box_height = target.offsetHeight;
+
+var expectedX = [ ((2*box_width)-scroller_width)+scrollbar_width, ((3*box_width - scroller_width)/2)+ (scrollbar_width/2), box_width ];
+var expectedY = [ box_height, ((3*box_height - scroller_height)/2) + (scrollbar_width/2), ((2*box_height)-scroller_height) + scrollbar_width ];
+
+// As browsers differ in the meaning of scrollLeft when
+// in a right-to-left mode, we adjust the expectation
+// to match the semantics of scrollLeft.
+if(scroller.scrollLeft === 0)
+  expectedX = [ -box_width, -(((3*box_width - scroller_width)/2)+ (scrollbar_width/2)), -(((2*box_width)-scroller_width)+scrollbar_width)];
+
+// This formats dict as a string suitable as test name.
+// format_value() is provided by testharness.js,
+// which also preserves sign for -0.
+function format_dict(dict) {
+  const props = [];
+  for (let prop in dict) {
+    props.push(`${prop}: ${format_value(dict[prop])}`);
+  }
+  return `{${props.join(", ")}}`;
+}
+
+[
+  [{block: "start", inline: "start"}, expectedX[0], expectedY[0]],
+  [{block: "start", inline: "center"}, expectedX[0], expectedY[1]],
+  [{block: "start", inline: "end"}, expectedX[0], expectedY[2]],
+  [{block: "center", inline: "start"}, expectedX[1], expectedY[0]],
+  [{block: "center", inline: "center"}, expectedX[1], expectedY[1]],
+  [{block: "center", inline: "end"}, expectedX[1], expectedY[2]],
+  [{block: "end", inline: "start"}, expectedX[2], expectedY[0]],
+  [{block: "end", inline: "center"}, expectedX[2], expectedY[1]],
+  [{block: "end", inline: "end"}, expectedX[2], expectedY[2]],
+].forEach(([input, expectedX, expectedY]) => {
+  test(() => {
+    scroller.scrollTo(0, 0);
+    target.scrollIntoView(input);
+    assert_approx_equals(scroller.scrollLeft, expectedX, 0.5, "scrollX");
+    assert_approx_equals(scroller.scrollTop, expectedY, 0.5, "scrollY");
+  }, `scrollIntoView(${format_dict(input)})`);
+})
+
+</script>
+
+</body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/support/scroll-behavior.js b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/support/scroll-behavior.js
new file mode 100644 (file)
index 0000000..0a0968e
--- /dev/null
@@ -0,0 +1,87 @@
+function observeScrolling(elements, callback) {
+  if (!Array.isArray(elements))
+      elements = [elements];
+  var lastChangedFrame = 0;
+  var lastLeft = new Map();
+  var lastTop = new Map();
+  elements.forEach((element) => {
+    lastLeft.set(element, element.scrollLeft);
+    lastTop.set(element, element.scrollTop);
+  });
+  function tick(frames) {
+    // We requestAnimationFrame either for 500 frames or until 20 frames with
+    // no change have been observed.
+    if (frames >= 500 || frames - lastChangedFrame > 20) {
+      callback(true);
+    } else {
+      var scrollHappened = elements.some((element) => {
+        return element.scrollLeft != lastLeft.get(element) || element.scrollTop != lastTop.get(element);
+      });
+      if (scrollHappened) {
+        lastChangedFrame = frames;
+        elements.forEach((element) => {
+          lastLeft.set(element, element.scrollLeft);
+          lastTop.set(element, element.scrollTop);
+        });
+        callback(false);
+      }
+      requestAnimationFrame(tick.bind(null, frames + 1));
+    }
+  }
+  tick(0);
+}
+
+function waitForScrollEnd(elements) {
+  return new Promise((resolve) => {
+    observeScrolling(elements, (done) => {
+      if (done)
+        resolve();
+    });
+  });
+}
+
+function resetScroll(scrollingElement) {
+  // Try various methods to ensure the element position is reset immediately.
+  scrollingElement.scrollLeft = 0;
+  scrollingElement.scrollTop = 0;
+  scrollingElement.scroll({left: 0, top: 0, behavior: "instant"});
+}
+
+function resetScrollForWindow(scrollingWindow) {
+  // Try various methods to ensure the element position is reset immediately.
+  scrollingWindow.document.scrollingElement.scrollLeft = 0;
+  scrollingWindow.document.scrollingElement.scrollTop = 0;
+  scrollingWindow.scroll({left: 0, top: 0, behavior: "instant"});
+}
+
+function setScrollBehavior(styledElement, className) {
+  styledElement.classList.remove("autoBehavior", "smoothBehavior");
+  styledElement.classList.add(className);
+}
+
+function scrollNode(scrollingElement, scrollFunction, behavior, elementToRevealLeft, elementToRevealTop) {
+  var args = {};
+  if (behavior)
+    args.behavior = behavior;
+  switch (scrollFunction) {
+    case "scrollIntoView":
+      args.inline = "start";
+      args.block = "start";
+      elementToReveal.scrollIntoView(args);
+      break;
+    default:
+      args.left = elementToRevealLeft;
+      args.top = elementToRevealTop;
+      scrollingElement[scrollFunction](args);
+      break;
+  }
+}
+
+function scrollWindow(scrollingWindow, scrollFunction, behavior, elementToRevealLeft, elementToRevealTop) {
+  var args = {};
+  if (behavior)
+    args.behavior = behavior;
+  args.left = elementToRevealLeft;
+  args.top = elementToRevealTop;
+  scrollingWindow[scrollFunction](args);
+}
index 744d866..239764d 100644 (file)
@@ -1,7 +1,7 @@
 The tests in this directory were imported from the W3C repository.
 Do NOT modify these tests directly in WebKit.
 Instead, create a pull request on the WPT github:
-       https://github.com/w3c/web-platform-tests
+       https://github.com/web-platform-tests/wpt
 
 Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
 
index 15da862..8cd6276 100644 (file)
@@ -1,7 +1,7 @@
 The tests in this directory were imported from the W3C repository.
 Do NOT modify these tests directly in WebKit.
 Instead, create a pull request on the WPT github:
-       https://github.com/w3c/web-platform-tests
+       https://github.com/web-platform-tests/wpt
 
 Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
 
@@ -38,6 +38,7 @@ List of files:
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/support/ruler-h-50px.png
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/support/ruler-v-100px.png
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/support/ruler-v-50px.png
+/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/support/scroll-behavior.js
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/support/square-purple.png
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/support/square-teal.png
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/support/square-white.png
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/table-client-props-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/table-client-props-expected.txt
new file mode 100644 (file)
index 0000000..94a3b77
--- /dev/null
@@ -0,0 +1,15 @@
+
+PASS Overall test to make sure there are no exceptions 
+PASS Basic table 
+PASS Basic caption 
+PASS Table and narrower caption 
+PASS Table and wider caption 
+PASS Table with padding 
+FAIL Table with padding and content-box sizing assert_equals: Table with padding and content-box sizing clientWidth expected 26 but got 20
+FAIL Table with separated border assert_equals: Table with separated border clientWidth expected 26 but got 14
+FAIL Table with collapsed border assert_equals: Table with collapsed border clientWidth expected 26 but got 14
+PASS Caption with padding 
+PASS Caption with border 
+FAIL Caption with margin assert_equals: Caption with margin clientWidth expected 46 but got 40
+PASS Bottom caption 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/table-client-props.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/table-client-props.html
new file mode 100644 (file)
index 0000000..4af06d6
--- /dev/null
@@ -0,0 +1,83 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>client* properties on tables</title>
+<link rel="help" href="https://drafts.csswg.org/cssom-view/#extension-to-the-element-interface">
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id="test-target" style="position: absolute"></div>
+<script>
+  test(function() {
+    // Each test consists of four elements: the markup to use, the expected
+    // value of offsetWidth on the table, the expected value of offsetHeight
+    // on the table, and the description string.
+    var tests = [
+      [ `<table style="width: 20px; height: 30px">`,
+        20, 30,
+        "Basic table" ],
+      [ `<table><caption style="width: 40px; height: 50px">`,
+        40, 50,
+        "Basic caption" ],
+      [ `<table style="width: 20px; height: 30px">
+           <caption style="width: 10px; height: 20px">`,
+        20, 50,
+        "Table and narrower caption" ],
+      [ `<table style="width: 20px; height: 30px">
+           <caption style="width: 40px; height: 20px">`,
+        40, 50,
+        "Table and wider caption" ],
+      [ `<table style="width: 20px; height: 30px; padding: 1px 2px 3px 4px">`,
+        20, 30,
+        "Table with padding" ],
+      [ `<table style="width: 20px; height: 30px; padding: 1px 2px 3px 4px;
+                       box-sizing: content-box">`,
+        26, 34,
+        "Table with padding and content-box sizing" ],
+      [ `<table style="width: 20px; height: 30px;
+                       border-width: 1px 2px 3px 4px; border-style: solid;
+                       border-collapse: separate; box-sizing: content-box">`,
+        26, 34,
+        "Table with separated border" ],
+      [ `<table style="width: 20px; height: 30px;
+                       border-width: 2px 4px 6px 8px; border-style: solid;
+                       border-collapse: collapse; box-sizing: content-box">
+           <tr><td>`,
+        26, 34,
+        "Table with collapsed border" ],
+      [ `<table>
+           <caption style="width: 40px; height: 50px; padding: 1px 2px 3px 4px">`,
+        46, 54,
+        "Caption with padding" ],
+      [ `<table>
+           <caption style="width: 40px; height: 50px;
+                           border-width: 1px 2px 3px 4px; border-style: solid">`,
+        46, 54,
+        "Caption with border" ],
+      [ `<table>
+           <caption style="width: 40px; height: 50px; margin: 1px 2px 3px 4px;">`,
+        46, 54,
+        "Caption with margin" ],
+      [ `<table style="caption-side: bottom">
+           <caption style="width: 40px; height: 50px;">`,
+        40, 50,
+        "Bottom caption" ],
+    ];
+
+    function target() {
+      return document.getElementById("test-target");
+    }
+
+    function table() {
+      return target().querySelector("table");
+    }
+
+    for (var t of tests) {
+      test(function() {
+        target().innerHTML = t[0];
+        assert_equals(table().clientWidth, t[1], t[3] + " clientWidth");
+        assert_equals(table().clientHeight, t[2], t[3] + " clientHeight");
+        assert_equals(table().clientLeft, 0, t[3] + " clientLeft");
+        assert_equals(table().clientTop, 0, t[3] + " clientTop");
+      }, t[3]);
+    }
+  }, "Overall test to make sure there are no exceptions");
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/table-offset-props-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/table-offset-props-expected.txt
new file mode 100644 (file)
index 0000000..3a5dfca
--- /dev/null
@@ -0,0 +1,15 @@
+
+PASS Overall test to make sure there are no exceptions 
+PASS Basic table 
+PASS Basic caption 
+PASS Table and narrower caption 
+PASS Table and wider caption 
+PASS Table with padding 
+FAIL Table with padding and content-box sizing assert_equals: Table with padding and content-box sizing offsetWidth expected 26 but got 20
+FAIL Table with separated border assert_equals: Table with separated border offsetWidth expected 26 but got 20
+FAIL Table with collapsed border assert_equals: Table with collapsed border offsetWidth expected 26 but got 20
+PASS Caption with padding 
+PASS Caption with border 
+FAIL Caption with margin assert_equals: Caption with margin offsetWidth expected 46 but got 40
+PASS Bottom caption 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/table-offset-props.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/table-offset-props.html
new file mode 100644 (file)
index 0000000..43aac24
--- /dev/null
@@ -0,0 +1,83 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>offset* properties on tables</title>
+<link rel="help" href="https://drafts.csswg.org/cssom-view/#extensions-to-the-htmlelement-interface">
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id="test-target" style="position: absolute"></div>
+<script>
+  test(function() {
+    // Each test consists of four elements: the markup to use, the expected
+    // value of offsetWidth on the table, the expected value of offsetHeight
+    // on the table, and the description string.
+    var tests = [
+      [ `<table style="width: 20px; height: 30px">`,
+        20, 30,
+        "Basic table" ],
+      [ `<table><caption style="width: 40px; height: 50px">`,
+        40, 50,
+        "Basic caption" ],
+      [ `<table style="width: 20px; height: 30px">
+           <caption style="width: 10px; height: 20px">`,
+        20, 50,
+        "Table and narrower caption" ],
+      [ `<table style="width: 20px; height: 30px">
+           <caption style="width: 40px; height: 20px">`,
+        40, 50,
+        "Table and wider caption" ],
+      [ `<table style="width: 20px; height: 30px; padding: 1px 2px 3px 4px">`,
+        20, 30,
+        "Table with padding" ],
+      [ `<table style="width: 20px; height: 30px; padding: 1px 2px 3px 4px;
+                       box-sizing: content-box">`,
+        26, 34,
+        "Table with padding and content-box sizing" ],
+      [ `<table style="width: 20px; height: 30px;
+                       border-width: 1px 2px 3px 4px; border-style: solid;
+                       border-collapse: separate; box-sizing: content-box">`,
+        26, 34,
+        "Table with separated border" ],
+      [ `<table style="width: 20px; height: 30px;
+                       border-width: 2px 4px 6px 8px; border-style: solid;
+                       border-collapse: collapse; box-sizing: content-box">
+           <tr><td>`,
+        26, 34,
+        "Table with collapsed border" ],
+      [ `<table>
+           <caption style="width: 40px; height: 50px; padding: 1px 2px 3px 4px">`,
+        46, 54,
+        "Caption with padding" ],
+      [ `<table>
+           <caption style="width: 40px; height: 50px;
+                           border-width: 1px 2px 3px 4px; border-style: solid">`,
+        46, 54,
+        "Caption with border" ],
+      [ `<table>
+           <caption style="width: 40px; height: 50px; margin: 1px 2px 3px 4px;">`,
+        46, 54,
+        "Caption with margin" ],
+      [ `<table style="caption-side: bottom">
+           <caption style="width: 40px; height: 50px;">`,
+        40, 50,
+        "Bottom caption" ],
+    ];
+
+    function target() {
+      return document.getElementById("test-target");
+    }
+
+    function table() {
+      return target().querySelector("table");
+    }
+
+    for (var t of tests) {
+      test(function() {
+        target().innerHTML = t[0];
+        assert_equals(table().offsetWidth, t[1], t[3] + " offsetWidth");
+        assert_equals(table().offsetHeight, t[2], t[3] + " offsetHeight");
+        assert_equals(table().offsetLeft, 0, t[3] + " offsetLeft");
+        assert_equals(table().offsetTop, 0, t[3] + " offsetTop");
+      }, t[3]);
+    }
+  }, "Overall test to make sure there are no exceptions");
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/table-scroll-props-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/table-scroll-props-expected.txt
new file mode 100644 (file)
index 0000000..05d7bb3
--- /dev/null
@@ -0,0 +1,15 @@
+
+PASS Overall test to make sure there are no exceptions 
+PASS Basic table 
+PASS Basic caption 
+PASS Table and narrower caption 
+PASS Table and wider caption 
+PASS Table with padding 
+FAIL Table with padding and content-box sizing assert_equals: Table with padding and content-box sizing scrollWidth expected 26 but got 20
+FAIL Table with separated border assert_equals: Table with separated border scrollWidth expected 26 but got 14
+FAIL Table with collapsed border assert_equals: Table with collapsed border scrollWidth expected 26 but got 14
+PASS Caption with padding 
+PASS Caption with border 
+FAIL Caption with margin assert_equals: Caption with margin scrollWidth expected 46 but got 44
+PASS Bottom caption 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/table-scroll-props.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/table-scroll-props.html
new file mode 100644 (file)
index 0000000..fd7f0d3
--- /dev/null
@@ -0,0 +1,83 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>scroll* properties on tables</title>
+<link rel="help" href="https://drafts.csswg.org/cssom-view/#extension-to-the-element-interface">
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id="test-target" style="position: absolute"></div>
+<script>
+  test(function() {
+    // Each test consists of four elements: the markup to use, the expected
+    // value of offsetWidth on the table, the expected value of offsetHeight
+    // on the table, and the description string.
+    var tests = [
+      [ `<table style="width: 20px; height: 30px">`,
+        20, 30,
+        "Basic table" ],
+      [ `<table><caption style="width: 40px; height: 50px">`,
+        40, 50,
+        "Basic caption" ],
+      [ `<table style="width: 20px; height: 30px">
+           <caption style="width: 10px; height: 20px">`,
+        20, 50,
+        "Table and narrower caption" ],
+      [ `<table style="width: 20px; height: 30px">
+           <caption style="width: 40px; height: 20px">`,
+        40, 50,
+        "Table and wider caption" ],
+      [ `<table style="width: 20px; height: 30px; padding: 1px 2px 3px 4px">`,
+        20, 30,
+        "Table with padding" ],
+      [ `<table style="width: 20px; height: 30px; padding: 1px 2px 3px 4px;
+                       box-sizing: content-box">`,
+        26, 34,
+        "Table with padding and content-box sizing" ],
+      [ `<table style="width: 20px; height: 30px;
+                       border-width: 1px 2px 3px 4px; border-style: solid;
+                       border-collapse: separate; box-sizing: content-box">`,
+        26, 34,
+        "Table with separated border" ],
+      [ `<table style="width: 20px; height: 30px;
+                       border-width: 2px 4px 6px 8px; border-style: solid;
+                       border-collapse: collapse; box-sizing: content-box">
+           <tr><td>`,
+        26, 34,
+        "Table with collapsed border" ],
+      [ `<table>
+           <caption style="width: 40px; height: 50px; padding: 1px 2px 3px 4px">`,
+        46, 54,
+        "Caption with padding" ],
+      [ `<table>
+           <caption style="width: 40px; height: 50px;
+                           border-width: 1px 2px 3px 4px; border-style: solid">`,
+        46, 54,
+        "Caption with border" ],
+      [ `<table>
+           <caption style="width: 40px; height: 50px; margin: 1px 2px 3px 4px;">`,
+        46, 54,
+        "Caption with margin" ],
+      [ `<table style="caption-side: bottom">
+           <caption style="width: 40px; height: 50px;">`,
+        40, 50,
+        "Bottom caption" ],
+    ];
+
+    function target() {
+      return document.getElementById("test-target");
+    }
+
+    function table() {
+      return target().querySelector("table");
+    }
+
+    for (var t of tests) {
+      test(function() {
+        target().innerHTML = t[0];
+        assert_equals(table().scrollWidth, t[1], t[3] + " scrollWidth");
+        assert_equals(table().scrollHeight, t[2], t[3] + " scrollHeight");
+        assert_equals(table().scrollLeft, 0, t[3] + " scrollLeft");
+        assert_equals(table().scrollTop, 0, t[3] + " scrollTop");
+      }, t[3]);
+    }
+  }, "Overall test to make sure there are no exceptions");
+</script>
index 48c5542..44e286b 100644 (file)
@@ -1,7 +1,7 @@
 The tests in this directory were imported from the W3C repository.
 Do NOT modify these tests directly in WebKit.
 Instead, create a pull request on the WPT github:
-       https://github.com/w3c/web-platform-tests
+       https://github.com/web-platform-tests/wpt
 
 Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
 
@@ -18,21 +18,25 @@ List of files:
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/DOMRectList.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/GetBoundingRect.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/HTMLBody-ScrollArea_quirksmode.html
+/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/META.yml
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/MediaQueryList-001.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/MediaQueryList-with-empty-string.html
-/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/OWNERS
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/Screen-pixelDepth-Screen-colorDepth001.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/cssom-getBoundingClientRect-001.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/cssom-getBoundingClientRect-002.html
+/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/cssom-getBoundingClientRect-vertical-rl-expected.html
+/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/cssom-getBoundingClientRect-vertical-rl.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/cssom-getBoxQuads-001.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/cssom-getClientRects-002.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/cssom-getClientRects.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/cssom-view-img-attributes-001.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/cssom-view-window-screen-interface.html
+/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/dom-element-scroll.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/elementFromPoint-001.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/elementFromPoint-002.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/elementFromPoint-003.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/elementFromPoint-dynamic-anon-box.html
+/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/elementFromPoint-mixed-font-sizes.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/elementFromPoint-parameters.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/elementFromPoint.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/elementFromPosition.html
@@ -52,17 +56,25 @@ List of files:
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/interfaces.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/matchMedia.xht
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/matchMediaAddListener.html
-/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/media-query-list-interface.xht
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/mouseEvent.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/negativeMargins.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/offsetParent_element_test.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/offsetTopLeftInScrollableParent.html
+/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-default-css.html
+/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-element.html
+/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-main-frame-root.html
+/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-main-frame-window.html
+/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-scrollintoview-nested.html
+/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-smooth-positions.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-smooth.html
+/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-root.html
+/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-window.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-no-layout-box.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-scrollMargin.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-scrollPadding.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-shadow.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-smooth.html
+/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-vertical-rl-writing-mode.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollTop-display-change-expected.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollTop-display-change.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollWidthHeight.xht
@@ -75,8 +87,10 @@ List of files:
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollingElement-quirks-dynamic-002.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollingElement.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollintoview.html
+/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/table-client-props.html
+/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/table-offset-props.html
+/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/table-scroll-props.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/ttwf-js-cssomview-getclientrects-length.html
-/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/window-interface.xht
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/window-screen-height-immutable.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/window-screen-height.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/window-screen-width-immutable.html
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/window-interface-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/window-interface-expected.txt
deleted file mode 100644 (file)
index f2304e0..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-
-PASS window_exposed_functions 
-PASS window_functions 
-PASS window_properties 
-FAIL window_properties_readonly assert_readonly: changing property "screen" succeeded
-
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/window-interface.xht b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/window-interface.xht
deleted file mode 100644 (file)
index 163124b..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-<?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>CSSOM Window Test: Properties and Functions</title>
-        <link rel="author" title="Joe Balancio" href="mailto:jlbalancio@gmail.com" />
-        <link rel="help" href="http://www.w3.org/TR/cssom-view/#extensions-to-the-window-interface" />
-        <meta name="flags" content="dom" />
-        <meta name="assert" content="All properties exist and are readonly. All functions exist and are instances of Function" />
-        <script src="/resources/testharness.js" type="text/javascript" />
-        <script src="/resources/testharnessreport.js" type="text/javascript" />
-    </head>
-    <body>
-        <noscript>Test not run - javascript required.</noscript>
-        <div id="log" />
-        <script type="text/javascript"><![CDATA[
-            /*
-               Window Functions
-             */
-            test(
-                function(){
-                    assert_own_property(window, "matchMedia");
-                    assert_own_property(window, "scroll");
-                    assert_own_property(window, "scrollTo");
-                    assert_own_property(window, "scrollBy");
-                }, 'window_exposed_functions', {
-                  assert: ['window functions are exposed']
-                }
-            );
-
-            test(
-                function(){
-                    assert_true(window.matchMedia instanceof Function);
-                    assert_true(window.scroll instanceof Function);
-                    assert_true(window.scrollTo instanceof Function);
-                    assert_true(window.scrollBy instanceof Function);
-                }, 'window_functions', {
-                  assert: ['window functions are instances of Function']
-                }
-            );
-
-            /*
-               Window Properties
-             */
-            test(
-                function() {
-                    assert_own_property(window, 'screen');
-                    assert_own_property(window, 'innerWidth');
-                    assert_own_property(window, 'innerHeight');
-                    assert_own_property(window, 'scrollX');
-                    assert_own_property(window, 'pageXOffset');
-                    assert_own_property(window, 'scrollY');
-                    assert_own_property(window, 'pageYOffset');
-                    assert_own_property(window, 'screenX');
-                    assert_own_property(window, 'screenY');
-                    assert_own_property(window, 'outerWidth');
-                    assert_own_property(window, 'outerHeight');
-                }, 'window_properties', {
-                  assert: ['window properties are owned by window']
-                }
-            );
-            test(
-                function() {
-                    assert_readonly(window, 'screen');
-                    assert_readonly(window, 'innerWidth');
-                    assert_readonly(window, 'innerHeight');
-                    assert_readonly(window, 'scrollX');
-                    assert_readonly(window, 'pageXOffset');
-                    assert_readonly(window, 'scrollY');
-                    assert_readonly(window, 'pageYOffset');
-                    assert_readonly(window, 'screenX');
-                    assert_readonly(window, 'screenY');
-                    assert_readonly(window, 'outerWidth');
-                    assert_readonly(window, 'outerHeight');
-                }, 'window_properties_readonly', {
-                    assert: ['window properties are readonly']
-                }
-            );
-                ]]>
-        </script>
-    </body>
-</html>
index 8866684..b638201 100644 (file)
@@ -2657,6 +2657,9 @@ webkit.org/b/163755 imported/w3c/web-platform-tests/css/css-shapes [ Skip ]
 
 webkit.org/b/5991 imported/w3c/web-platform-tests/css/cssom-view/scrolling-quirks-vs-nonquirks.html [ Failure ]
 
+webkit.org/b/149264 imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-root.html [ Failure ]
+webkit.org/b/149264 imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-window.html [ Failure ]
+
 # Variation fonts are not implemented earlier than iOS 11.
 fast/text/variations [ Pass Failure ImageOnlyFailure ]
 animations/font-variations [ Pass Failure ImageOnlyFailure Timeout ]
index cdb22d3..335ece3 100644 (file)
     "imported/w3c/web-platform-tests/css/css-color/color-resolving-hsl.html": [
         "slow"
     ],
+    "imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-default-css.html": [
+        "slow"
+    ],
+    "imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-element.html": [
+        "slow"
+    ],
+    "imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-main-frame-root.html": [
+        "slow"
+    ],
+    "imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-main-frame-window.html": [
+        "slow"
+    ],
+    "imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-scrollintoview-nested.html": [
+        "slow"
+    ],
+    "imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-smooth-positions.html": [
+        "slow"
+    ],
+    "imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-root.html": [
+        "slow"
+    ],
+    "imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-window.html": [
+        "slow"
+    ],
     "imported/w3c/web-platform-tests/dom/nodes/Document-characterSet-normalization.html": [
         "slow"
     ],