WebKit Bugzilla
Attachment 350200 Details for
Bug 189787
: Synchronize CSSOM View test suite against upstream WPT
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-189787-20180920170836.patch (text/plain), 119.35 KB, created by
Frédéric Wang (:fredw)
on 2018-09-20 08:08:38 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Frédéric Wang (:fredw)
Created:
2018-09-20 08:08:38 PDT
Size:
119.35 KB
patch
obsolete
>Subversion Revision: 236258 >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 460d3adf96b9faa4ce0d9a56d489a4b32d3d5245..f750daca34df33df7114bf51af37b55b5abd344a 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,12 @@ >+2018-09-20 Frederic Wang <fred.wang@free.fr> >+ >+ Synchronize CSSOM View test suite against upstream WPT >+ https://bugs.webkit.org/show_bug.cgi?id=189787 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * tests-options.json: >+ > 2018-09-19 Yacine Bandou <yacine.bandou@softathome.com> > > [EME][WPE] Add WebM initData in the expected result of clearkey-generate-request-disallowed-input test >diff --git a/LayoutTests/imported/w3c/ChangeLog b/LayoutTests/imported/w3c/ChangeLog >index bed9f05c9e80f6ab15e4362958cb381381b7f332..b1d8c21f8d986f72e0e75f5f6974eca9cd9ebe80 100644 >--- a/LayoutTests/imported/w3c/ChangeLog >+++ b/LayoutTests/imported/w3c/ChangeLog >@@ -1,3 +1,44 @@ >+2018-09-20 Frederic Wang <fred.wang@free.fr> >+ >+ Synchronize CSSOM View test suite against upstream WPT >+ https://bugs.webkit.org/show_bug.cgi?id=189787 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * 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.html: >+ * web-platform-tests/css/cssom-view/dom-element-scroll.html: Added. >+ * web-platform-tests/css/cssom-view/elementFromPoint-mixed-font-sizes.html: Added. >+ * 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.html: Added. >+ * web-platform-tests/css/cssom-view/scroll-behavior-element.html: 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.html: Added. >+ * web-platform-tests/css/cssom-view/scroll-behavior-scrollintoview-nested.html: Added. >+ * web-platform-tests/css/cssom-view/scroll-behavior-smooth-positions.html: Added. >+ * web-platform-tests/css/cssom-view/scroll-behavior-subframe-root.html: Added. >+ * web-platform-tests/css/cssom-view/scroll-behavior-subframe-window.html: 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.html: Added. >+ * web-platform-tests/css/cssom-view/table-offset-props.html: 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 >index 0000000000000000000000000000000000000000..a6644945910fc83ca079c93507b21117b91de9c3 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/META.yml >@@ -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 >index 5e0cb233944bd24a5ce9c39d983c70ed601e2261..0000000000000000000000000000000000000000 >--- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/OWNERS >+++ /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 >index 0000000000000000000000000000000000000000..1ee4fe2652ff56655c20963f90810de6a979462f >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/cssom-getBoundingClientRect-vertical-rl-expected.html >@@ -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 >index 0000000000000000000000000000000000000000..85ac2a9665953aeb961f12a30dd4d82082d8273a >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/cssom-getBoundingClientRect-vertical-rl.html >@@ -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> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/cssom-view-window-screen-interface.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/cssom-view-window-screen-interface.html >index 7abd2e591e98940e2ac26df7e89c0bd18b94decc..29802ac7129a95c8d20091b279d3a32bbf58943e 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/cssom-view-window-screen-interface.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/cssom-view-window-screen-interface.html >@@ -13,15 +13,6 @@ > <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.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/dom-element-scroll.html >new file mode 100644 >index 0000000000000000000000000000000000000000..3f3e27aaf671bd38231fc64e3a5165c388b1bc30 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/dom-element-scroll.html >@@ -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.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/elementFromPoint-mixed-font-sizes.html >new file mode 100644 >index 0000000000000000000000000000000000000000..e2bac90afdfb226aa8e44d40dc36d98423181cc3 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/elementFromPoint-mixed-font-sizes.html >@@ -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> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/interfaces.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/interfaces.html >index fa1739d557962d4a90942c40c5f72d2a3bb87edf..c5e83b826196dbc595b38b05a6d5ffa3578a1b6f 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/interfaces.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/interfaces.html >@@ -15,59 +15,31 @@ > <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 >index 6e041627b3ed90e61091285409804e2066afa499..0000000000000000000000000000000000000000 >--- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/media-query-list-interface-expected.txt >+++ /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 >index 98bdaae6ec40bdf1c32f131f6a7dfbf730effc73..0000000000000000000000000000000000000000 >--- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/media-query-list-interface.xht >+++ /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> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/resources/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/resources/w3c-import.log >index a3581097350faa7e063f7e2a2258c9b09094dcd5..f1c063327ecef6c4b20d0830dc12ddae86ac4101 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/resources/w3c-import.log >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/resources/w3c-import.log >@@ -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.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-default-css.html >new file mode 100644 >index 0000000000000000000000000000000000000000..8606b1f3ed40b49c693213e02df69d088d93b979 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-default-css.html >@@ -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.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-element.html >new file mode 100644 >index 0000000000000000000000000000000000000000..9f60ca771121c82237f2be2097d089f582918fe5 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-element.html >@@ -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.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-main-frame-root.html >new file mode 100644 >index 0000000000000000000000000000000000000000..7ef0a4aa0da74a724a851cb1b2f16305712f7b7f >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-main-frame-root.html >@@ -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.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-main-frame-window.html >new file mode 100644 >index 0000000000000000000000000000000000000000..57b0d913461a3d374afeb204ed164b97e7d82b38 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-main-frame-window.html >@@ -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.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-scrollintoview-nested.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2a97e0656637d12a2451fecd2985cd3370bb75cf >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-scrollintoview-nested.html >@@ -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.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-smooth-positions.html >new file mode 100644 >index 0000000000000000000000000000000000000000..19e317d5e4b9e65aca7df6becb35481ad8125bac >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-smooth-positions.html >@@ -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.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-root.html >new file mode 100644 >index 0000000000000000000000000000000000000000..32de1b62038e0db017b7416554fbf5e92485d3ea >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-root.html >@@ -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.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-window.html >new file mode 100644 >index 0000000000000000000000000000000000000000..0a8ed39d1b97d493e9f8ffe0710e711afa491f43 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-window.html >@@ -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.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-vertical-rl-writing-mode.html >new file mode 100644 >index 0000000000000000000000000000000000000000..c404931f79b43a3060eaaa8a1fbc235ee16e5169 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-vertical-rl-writing-mode.html >@@ -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 >index 0000000000000000000000000000000000000000..0a0968e025bd8604c0765352d3a2e8b3cc1233aa >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/support/scroll-behavior.js >@@ -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); >+} >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/support/support/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/support/support/w3c-import.log >index 744d86683598a578501a95a9472ca4970700a6b3..239764d470f6c996585a330b58ed1d3a9c3b8943 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/support/support/w3c-import.log >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/support/support/w3c-import.log >@@ -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/support/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/support/w3c-import.log >index 15da8626cf655c5b0bf53f4e27c1bdd08237b57c..8cd627670bd59520b5cd6693452f7ac5e47e08d2 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/support/w3c-import.log >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/support/w3c-import.log >@@ -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.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/table-client-props.html >new file mode 100644 >index 0000000000000000000000000000000000000000..4af06d6bf71f0df75d3710ec0906445e943d340d >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/table-client-props.html >@@ -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.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/table-offset-props.html >new file mode 100644 >index 0000000000000000000000000000000000000000..43aac248f0eecb574b44e14d0867aa3d59179b85 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/table-offset-props.html >@@ -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.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/table-scroll-props.html >new file mode 100644 >index 0000000000000000000000000000000000000000..fd7f0d347b5ae9f5ddd2a2735759bc32cac595cd >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/table-scroll-props.html >@@ -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> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/w3c-import.log >index 48c55423a228991bd0887350d8ab278846353586..44e286bcb5978081817959995264b909d22150ae 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/w3c-import.log >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/w3c-import.log >@@ -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 >index f2304e08c57e022d6e6e8e8b1948fe1d7ba38a59..0000000000000000000000000000000000000000 >--- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/window-interface-expected.txt >+++ /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 >index 163124b6e789fb41271f93902b49c17f688797b8..0000000000000000000000000000000000000000 >--- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/window-interface.xht >+++ /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> >diff --git a/LayoutTests/tests-options.json b/LayoutTests/tests-options.json >index cdb22d392abd72afe509e1c198a5a4b8d3d4372d..335ece354cff6801d779ac361aca415c4f28149c 100644 >--- a/LayoutTests/tests-options.json >+++ b/LayoutTests/tests-options.json >@@ -422,6 +422,30 @@ > "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" > ],
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 189787
:
350200
|
350214
|
350216
|
350221
|
350223
|
350225
|
350238
|
350241