Re-sync web-platform-tests/css/cssom-view from upstream
authorshvaikalesh@gmail.com <shvaikalesh@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Jan 2020 16:43:47 +0000 (16:43 +0000)
committershvaikalesh@gmail.com <shvaikalesh@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Jan 2020 16:43:47 +0000 (16:43 +0000)
https://bugs.webkit.org/show_bug.cgi?id=204649

Reviewed by Chris Dumez.

Re-sync web-platform-tests/css/cssom-view from upstream 106e0bdf02a1.

LayoutTests/imported/w3c:

* web-platform-tests/css/cssom-view/*: Updated.

LayoutTests:

* TestExpectations:
* tests-options.json:

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

165 files changed:
LayoutTests/ChangeLog
LayoutTests/TestExpectations
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/CaretPosition-001.html
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/MediaQueryList-001-expected.txt [deleted file]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/MediaQueryList-001.html [deleted file]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/MediaQueryList-addListener-handleEvent-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/MediaQueryList-addListener-handleEvent.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/MediaQueryList-addListener-removeListener-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/MediaQueryList-addListener-removeListener.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/MediaQueryList-extends-EventTarget-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/MediaQueryList-extends-EventTarget-interop-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/MediaQueryList-extends-EventTarget-interop.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/MediaQueryList-extends-EventTarget.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/MediaQueryList-with-empty-string-expected.txt [deleted file]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/MediaQueryList-with-empty-string.html [deleted file]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/MediaQueryListEvent-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/MediaQueryListEvent.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/Screen-pixelDepth-Screen-colorDepth001.html
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/client-props-inline-list-item-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/client-props-inline-list-item.html [new file with mode: 0644]
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-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-list-001-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/elementFromPoint-list-001.html [new file with mode: 0644]
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-subpixel.html
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/elementFromPoint.html
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/elementFromPosition.html
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/elementScroll-002.html
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/elementScroll.html
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/elementsFromPoint-iframes.html
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/elementsFromPoint-inline-htb-ltr.html
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/elementsFromPoint-inline-htb-rtl.html
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/elementsFromPoint-inline-vlr-ltr.html
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/elementsFromPoint-inline-vlr-rtl.html
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/elementsFromPoint-inline-vrl-ltr.html
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/elementsFromPoint-inline-vrl-rtl.html
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/elementsFromPoint-invalid-cases.html
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/elementsFromPoint-shadowroot.html
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/elementsFromPoint-simple.html
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/elementsFromPoint-svg-text.html
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/elementsFromPoint-svg.html
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/elementsFromPoint-table.html
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/elementsFromPoint.html
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/getBoundingClientRect-empty-inline-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/getBoundingClientRect-empty-inline.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/getClientRects-br-htb-ltr.html
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/getClientRects-br-htb-rtl.html
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/getClientRects-br-vlr-ltr.html
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/getClientRects-br-vlr-rtl.html
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/getClientRects-br-vrl-ltr.html
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/getClientRects-br-vrl-rtl.html
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/getClientRects-inline-atomic-child-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/getClientRects-inline-atomic-child.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/getClientRects-inline-inline-child-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/getClientRects-inline-inline-child.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/historical.html
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/htmlelement-offset-width-001.html
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/idlharness-expected.txt [moved from LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/interfaces-expected.txt with 97% similarity]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/idlharness.html [moved from LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/interfaces.html with 83% similarity]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/inheritance.html
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/matchMedia-display-none-iframe.html
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/matchMedia-expected.txt
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/matchMedia.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/matchMedia.xht [deleted file]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/matchMediaAddListener-expected.txt [deleted file]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/matchMediaAddListener.html [deleted file]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/mouseEvent-expected.txt
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/offsetTopLeft-border-box-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/offsetTopLeft-border-box.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/offsetTopLeft-empty-inline-offset.html
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/offsetTopLeft-empty-inline.html
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/offsetTopLeft-leading-space-inline.html
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/offsetTopLeft-trailing-space-inline.html
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/offsetTopLeftInScrollableParent.html
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/outer-svg.html
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/parsing/scroll-behavior-computed-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/parsing/scroll-behavior-computed.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/parsing/scroll-behavior-invalid-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/parsing/scroll-behavior-invalid.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/parsing/scroll-behavior-valid-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/parsing/scroll-behavior-valid.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/parsing/w3c-import.log [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/position-sticky-root-scroller-with-scroll-behavior-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/position-sticky-root-scroller-with-scroll-behavior.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/resize-event-on-initial-layout.html
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/resources/matchMedia.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/resources/w3c-import.log
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/screenLeftTop.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-expected.txt
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-expected.txt
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-expected.txt
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-expected.txt
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-horizontal-partially-visible-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-horizontal-partially-visible.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-horizontal-tb-writing-mode-and-rtl-direction.html
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-horizontal-tb-writing-mode.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-sideways-lr-writing-mode-and-rtl-direction-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-sideways-lr-writing-mode-and-rtl-direction.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-sideways-lr-writing-mode-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-sideways-lr-writing-mode.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-sideways-rl-writing-mode-and-rtl-direction-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-sideways-rl-writing-mode-and-rtl-direction.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-sideways-rl-writing-mode-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-sideways-rl-writing-mode.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-smooth.html
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-svg-shape.html
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-vertical-lr-writing-mode-and-rtl-direction.html
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-vertical-lr-writing-mode.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/scrollLeft-of-scroller-with-wider-scrollbar-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollLeft-of-scroller-with-wider-scrollbar.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollLeftTop-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollLeftTop.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollWidthHeight.xht
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollWidthHeightWhenNotScrollable.xht
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrolling-no-browsing-context.html
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrolling-quirks-vs-nonquirks.html
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollingElement-quirks-dynamic-001-expected.html
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollingElement-quirks-dynamic-001.html
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollingElement-quirks-dynamic-002-expected.html
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/w3c-import.log
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
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/window-screen-width.html
LayoutTests/tests-options.json

index 60605a5..08a7909 100644 (file)
@@ -1,3 +1,15 @@
+2020-01-07  Alexey Shvayka  <shvaikalesh@gmail.com>
+
+        Re-sync web-platform-tests/css/cssom-view from upstream
+        https://bugs.webkit.org/show_bug.cgi?id=204649
+
+        Reviewed by Chris Dumez.
+
+        Re-sync web-platform-tests/css/cssom-view from upstream 106e0bdf02a1.
+
+        * TestExpectations:
+        * tests-options.json:
+
 2020-01-07  Per Arne Vollan  <pvollan@apple.com>
 
         Layout Test storage/indexeddb/IDBTransaction-page-cache.html is flaky
index 32ba420..47b07f1 100644 (file)
@@ -746,7 +746,7 @@ webkit.org/b/184066 imported/w3c/web-platform-tests/IndexedDB/nested-cloning-lar
 webkit.org/b/184066 imported/w3c/web-platform-tests/IndexedDB/nested-cloning-large.html [ Skip ]
 webkit.org/b/184066 imported/w3c/web-platform-tests/IndexedDB/nested-cloning-small.html [ Skip ]
 imported/w3c/web-platform-tests/css/cssom/interfaces.html [ Pass Timeout ]
-[ Debug ] imported/w3c/web-platform-tests/css/cssom-view/interfaces.html [ Skip ]
+[ Debug ] imported/w3c/web-platform-tests/css/cssom-view/idlharness.html [ Skip ]
 webkit.org/b/182292 imported/w3c/web-platform-tests/css/cssom-view/scrollingElement-quirks-dynamic-001.html [ ImageOnlyFailure ]
 webkit.org/b/182292 imported/w3c/web-platform-tests/css/cssom-view/scrollingElement-quirks-dynamic-002.html [ ImageOnlyFailure ]
 imported/w3c/web-platform-tests/css/css-ui/text-overflow-010.html [ ImageOnlyFailure ]
index a73d866..cd1ec58 100644 (file)
@@ -1,3 +1,14 @@
+2020-01-07  Alexey Shvayka  <shvaikalesh@gmail.com>
+
+        Re-sync web-platform-tests/css/cssom-view from upstream
+        https://bugs.webkit.org/show_bug.cgi?id=204649
+
+        Reviewed by Chris Dumez.
+
+        Re-sync web-platform-tests/css/cssom-view from upstream 106e0bdf02a1.
+
+        * web-platform-tests/css/cssom-view/*: Updated.
+
 2020-01-07  Pablo Saavedra  <psaavedra@igalia.com>
 
         Re-sync web-platform-tests/domparsing from upstream
index 98bb1f2..d8e97a9 100644 (file)
@@ -4,8 +4,8 @@
 <title>CSSOM View Module test:CaretPosition</title>
 <link rel="author" title="unbug" href="mailto:tidelgl@gmail.com" />
 <link rel="help" href="https://drafts.csswg.org/cssom-view-1/#dom-document-elementfrompoint">
-<script src="../../../../../resources/testharness.js"></script>
-<script src="../../../../../resources/testharnessreport.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <style type="text/css">
 .box{
   position: absolute;
index 9de0adb..dafced9 100644 (file)
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <title>CSSOM View APIs that return a DOMRectList</title>
-<script src=../../../../../resources/testharness.js></script>
-<script src=../../../../../resources/testharnessreport.js></script>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
 <div id=x>x</div>
 <script>
 setup(() => {
index 2ff8948..7286bd0 100644 (file)
@@ -4,8 +4,8 @@
     <meta charset="utf-8">
     <title>getBoundingClientRect</title>
     <link rel="help" href="https://drafts.csswg.org/cssom-view/#dom-element-getboundingclientrect">
-    <script src="../../../../../resources/testharness.js"></script>
-    <script src="../../../../../resources/testharnessreport.js"></script>
+    <script src="/resources/testharness.js"></script>
+    <script src="/resources/testharnessreport.js"></script>
 
     <style>
       #foo {
index 2991247..8255d13 100644 (file)
@@ -1,6 +1,6 @@
 <html>
-<script src="../../../../../resources/testharness.js" type="text/javascript"></script>
-<script src="../../../../../resources/testharnessreport.js" type="text/javascript"></script>
+<script src="/resources/testharness.js" type="text/javascript"></script>
+<script src="/resources/testharnessreport.js" type="text/javascript"></script>
 <style type="text/css">
     body {
         border:1px solid black;
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/MediaQueryList-001-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/MediaQueryList-001-expected.txt
deleted file mode 100644 (file)
index 477d0a9..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-This case tests the MediaQueryList
-
-
-PASS matchMedia 
-
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/MediaQueryList-001.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/MediaQueryList-001.html
deleted file mode 100644 (file)
index 6b3610f..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-    <title>CSSOM View Module test:MediaQueryList</title>
-    <link rel="author" title="unbug" href="mailto:tidelgl@gmail.com" />
-    <link rel="help" href="http://www.w3.org/TR/cssom-view/#the-mediaquerylist-interface">
-    <script src="../../../../../resources/testharness.js"></script>
-    <script src="../../../../../resources/testharnessreport.js"></script>
-    <style type="text/css">
-    </style>
-</head>
-<body>
-  <p>This case tests the MediaQueryList</p>
-    <div id="log"></div>
-    <script>
-        test(function(){
-            assert_equals(window.matchMedia('(min-width: 1px)').matches, true, "Expected any device to match min-width: 1px");
-        },'matchMedia');
-    </script>
-</body>
-</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/MediaQueryList-addListener-handleEvent-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/MediaQueryList-addListener-handleEvent-expected.txt
new file mode 100644 (file)
index 0000000..8721066
--- /dev/null
@@ -0,0 +1,8 @@
+
+FAIL calls handleEvent method of event listener promise_test: Unhandled rejection with value: object "TypeError: Argument 1 ('listener') to MediaQueryList.addListener must be a function"
+FAIL looks up handleEvent method on every event dispatch promise_test: Unhandled rejection with value: object "TypeError: Argument 1 ('listener') to MediaQueryList.addListener must be a function"
+PASS doesn't look up handleEvent method on callable event listeners 
+FAIL rethrows errors when getting handleEvent promise_rejects_exactly: function "function () { throw e }" threw object "TypeError: Argument 1 ('listener') to MediaQueryList.addListener must be a function" but we expected it to throw object "[object Object]"
+PASS throws if handleEvent is falsy and not callable 
+PASS throws if handleEvent is thruthy and not callable 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/MediaQueryList-addListener-handleEvent.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/MediaQueryList-addListener-handleEvent.html
new file mode 100644 (file)
index 0000000..5bdd9df
--- /dev/null
@@ -0,0 +1,106 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<meta name="flags" content="dom">
+<title>CSS Test: CSSOM View MediaQueryList::addListener with handleEvent</title>
+<link rel="help" href="https://dom.spec.whatwg.org/#callbackdef-eventlistener">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="resources/matchMedia.js"></script>
+<div id="log"></div>
+<script>
+"use strict";
+setup({ allow_uncaught_exception: true });
+
+promise_test(async t => {
+    const mql = await createMQL(t);
+
+    let _this;
+    let _event;
+    const listener = {
+        handleEvent(event) {
+            _this = this;
+            _event = event;
+        },
+    };
+
+    mql.addListener(listener);
+    triggerMQLEvent(mql);
+    await waitForChangesReported();
+
+    assert_equals(_this, listener);
+    assert_equals(_event.media, mql.media);
+    assert_equals(_event.matches, mql.matches);
+}, "calls handleEvent method of event listener");
+
+promise_test(async t => {
+    const mql = await createMQL(t);
+
+    let calls = 0;
+    mql.addListener({
+        get handleEvent() {
+            calls++;
+            return function() {};
+        },
+    });
+    assert_equals(calls, 0);
+
+    triggerMQLEvent(mql);
+    await waitForChangesReported();
+    assert_equals(calls, 1);
+
+    triggerMQLEvent(mql);
+    await waitForChangesReported();
+    assert_equals(calls, 2);
+}, "looks up handleEvent method on every event dispatch");
+
+promise_test(async t => {
+    const mql = await createMQL(t);
+
+    let calls = 0;
+    const listener = () => {
+        calls++;
+    };
+
+    Object.defineProperty(listener, "handleEvent", {
+        get: t.unreached_func("handleEvent method should not be looked up on functions"),
+    });
+    mql.addListener(listener);
+
+    triggerMQLEvent(mql);
+    await waitForChangesReported();
+    assert_equals(calls, 1);
+}, "doesn't look up handleEvent method on callable event listeners");
+
+const uncaught_error_test = async (t, listener) => {
+    const mql = await createMQL(t);
+    mql.addListener(listener);
+
+    const eventWatcher = new EventWatcher(t, window, "error");
+    const errorPromise = eventWatcher.wait_for("error");
+    triggerMQLEvent(mql);
+
+    const event = await errorPromise;
+    throw event.error;
+};
+
+promise_test(t => {
+    const error = { name: "test" };
+    const listener = {
+        get handleEvent() {
+            throw error;
+        },
+    };
+
+    return promise_rejects_exactly(t, error, uncaught_error_test(t, listener));
+}, "rethrows errors when getting handleEvent");
+
+promise_test(t => {
+    const listener = { handleEvent: null };
+    return promise_rejects(t, new TypeError(), uncaught_error_test(t, listener));
+}, "throws if handleEvent is falsy and not callable");
+
+promise_test(t => {
+    const listener = { handleEvent: "str" };
+    return promise_rejects(t, new TypeError(), uncaught_error_test(t, listener));
+}, "throws if handleEvent is thruthy and not callable");
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/MediaQueryList-addListener-removeListener-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/MediaQueryList-addListener-removeListener-expected.txt
new file mode 100644 (file)
index 0000000..5d49fce
--- /dev/null
@@ -0,0 +1,9 @@
+
+PASS listeners are called when <iframe> is resized 
+PASS listeners are called correct number of times 
+PASS listeners are called in order they were added 
+PASS listener that was added twice is called only once 
+FAIL listeners are called in order their MQLs were created assert_array_equals: property 0, expected "mql1" but got "mql2"
+PASS removing listener from one MQL doesn't remove it from all MQLs 
+PASS MediaQueryList::removeListener removes added listener 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/MediaQueryList-addListener-removeListener.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/MediaQueryList-addListener-removeListener.html
new file mode 100644 (file)
index 0000000..1144e3a
--- /dev/null
@@ -0,0 +1,151 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<meta name="flags" content="dom">
+<title>CSS Test: CSSOM View MediaQueryList::{add,remove}Listener</title>
+<link rel="author" title="Rune Lillesveen" href="mailto:rune@opera.com">
+<link rel="help" href="https://www.w3.org/TR/cssom-view-1/#the-mediaquerylist-interface">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="resources/matchMedia.js"></script>
+<div id="log"></div>
+<script>
+"use strict";
+
+promise_test(async t => {
+    const iframe = await createIFrame(t, 200, 100);
+    const heightMQL = iframe.contentWindow.matchMedia("(max-height: 50px)");
+    const widthMQL = iframe.contentWindow.matchMedia("(min-width: 150px)");
+
+    let heightEvent;
+    let widthEvent;
+
+    heightMQL.addListener(event => {
+        heightEvent = event;
+    });
+    widthMQL.addListener(event => {
+        widthEvent = event;
+    });
+
+    assert_false(heightMQL.matches);
+    assert_true(widthMQL.matches);
+
+    iframe.height = "50"; // 200x100 => 200x50
+    await waitForChangesReported();
+
+    assert_equals(heightEvent.media, heightMQL.media);
+    assert_true(heightEvent.matches);
+    assert_true(heightMQL.matches);
+    assert_true(widthMQL.matches);
+
+    iframe.width = "100"; // 200x50 => 100x50
+    await waitForChangesReported();
+
+    assert_equals(widthEvent.media, widthMQL.media);
+    assert_false(widthEvent.matches);
+    assert_false(widthMQL.matches);
+    assert_true(heightMQL.matches);
+}, "listeners are called when <iframe> is resized");
+
+promise_test(async t => {
+    const mql = await createMQL(t);
+
+    let eventsCount = 0;
+    mql.addListener(() => {
+        eventsCount++;
+    });
+
+    for (let i = 1; i <= 10; i++) {
+        triggerMQLEvent(mql);
+        await waitForChangesReported();
+        assert_equals(eventsCount, i);
+    }
+}, "listeners are called correct number of times");
+
+promise_test(async t => {
+    const mql = await createMQL(t);
+    const calls = [];
+
+    mql.addListener(() => {
+        calls.push("1st");
+    });
+    mql.addListener(() => {
+        calls.push("2nd");
+    });
+
+    triggerMQLEvent(mql);
+    await waitForChangesReported();
+
+    assert_array_equals(calls, ["1st", "2nd"]);
+}, "listeners are called in order they were added");
+
+promise_test(async t => {
+    const mql = await createMQL(t);
+
+    let called = 0;
+    const listener = () => {
+        called++;
+    };
+
+    mql.addListener(listener);
+    mql.addListener(listener);
+
+    triggerMQLEvent(mql);
+    await waitForChangesReported();
+
+    assert_equals(called, 1);
+}, "listener that was added twice is called only once");
+
+promise_test(async t => {
+    const iframe = await createIFrame(t, 100);
+    const media = `(min-width: 200px)`;
+
+    const mql1 = iframe.contentWindow.matchMedia(media);
+    const mql2 = iframe.contentWindow.matchMedia(media);
+    const calls = [];
+
+    mql2.addListener(() => {
+        calls.push("mql2");
+    });
+
+    mql1.addListener(() => {
+        calls.push("mql1");
+    });
+
+    iframe.width = "200"; // 100x100 => 200x100
+    await waitForChangesReported();
+
+    assert_array_equals(calls, ["mql1", "mql2"]);
+}, "listeners are called in order their MQLs were created");
+
+promise_test(async t => {
+    const iframe = await createIFrame(t, 200);
+    const media = `(max-height: 150px)`;
+
+    const mql1 = iframe.contentWindow.matchMedia(media);
+    const mql2 = iframe.contentWindow.matchMedia(media);
+
+    let calls = 0;
+    const listener = () => {
+        calls++;
+    };
+
+    mql1.addListener(listener);
+    mql2.removeListener(listener);
+
+    iframe.height = "50"; // 200x200 => 200x50
+    await waitForChangesReported();
+
+    assert_equals(calls, 1);
+}, "removing listener from one MQL doesn't remove it from all MQLs");
+
+promise_test(async t => {
+    const mql = await createMQL(t);
+    const listener = t.unreached_func("should not be called");
+
+    mql.addListener(listener);
+    mql.removeListener(listener);
+
+    triggerMQLEvent(mql);
+    await waitForChangesReported();
+}, "MediaQueryList::removeListener removes added listener");
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/MediaQueryList-extends-EventTarget-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/MediaQueryList-extends-EventTarget-expected.txt
new file mode 100644 (file)
index 0000000..97351e3
--- /dev/null
@@ -0,0 +1,20 @@
+
+FAIL onchange adds listener promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating '_event.media')"
+FAIL onchange removes listener assert_equals: expected 1 but got 0
+FAIL listeners for "change" type are called promise_test: Unhandled rejection with value: object "TypeError: mql.addEventListener is not a function. (In 'mql.addEventListener("change", {
+        handleEvent() {
+            calls++;
+        },
+    })', 'mql.addEventListener' is undefined)"
+FAIL listeners with different type are not called promise_test: Unhandled rejection with value: object "TypeError: mql.addEventListener is not a function. (In 'mql.addEventListener("matches", t.unreached_func("should not be called"))', 'mql.addEventListener' is undefined)"
+FAIL addEventListener "once" option is respected promise_test: Unhandled rejection with value: object "TypeError: mql.addEventListener is not a function. (In 'mql.addEventListener("change", {
+        handleEvent() {
+            calls++;
+        },
+    }, {once: true})', 'mql.addEventListener' is undefined)"
+FAIL removeEventListener removes listener promise_test: Unhandled rejection with value: object "TypeError: mql.addEventListener is not a function. (In 'mql.addEventListener("change", listener)', 'mql.addEventListener' is undefined)"
+FAIL dispatchEvent works as expected mql.addEventListener is not a function. (In 'mql.addEventListener("custom", event => {
+        receivedEvent = event;
+        event.preventDefault();
+    }, true)', 'mql.addEventListener' is undefined)
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/MediaQueryList-extends-EventTarget-interop-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/MediaQueryList-extends-EventTarget-interop-expected.txt
new file mode 100644 (file)
index 0000000..2f29436
--- /dev/null
@@ -0,0 +1,14 @@
+
+FAIL dispatchEvent triggers listener added with addListener mql.dispatchEvent is not a function. (In 'mql.dispatchEvent(dispatchedEvent)', 'mql.dispatchEvent' is undefined)
+FAIL listener added with addListener and addEventListener is called once promise_test: Unhandled rejection with value: object "TypeError: Argument 1 ('listener') to MediaQueryList.addListener must be a function"
+FAIL listener added with addListener and addEventListener (capture) is called twice promise_test: Unhandled rejection with value: object "TypeError: mql.addEventListener is not a function. (In 'mql.addEventListener("change", listener, true)', 'mql.addEventListener' is undefined)"
+FAIL removeEventListener removes listener added with addListener promise_test: Unhandled rejection with value: object "TypeError: Argument 1 ('listener') to MediaQueryList.addListener must be a function"
+FAIL removeEventListener (capture) doesn't remove listener added with addListener promise_test: Unhandled rejection with value: object "TypeError: mql.removeEventListener is not a function. (In 'mql.removeEventListener("change", listener, true)', 'mql.removeEventListener' is undefined)"
+FAIL removeListener removes listener added with addEventListener promise_test: Unhandled rejection with value: object "TypeError: mql.addEventListener is not a function. (In 'mql.addEventListener("change", listener)', 'mql.addEventListener' is undefined)"
+FAIL removeListener doesn't remove listener added with addEventListener (capture) promise_test: Unhandled rejection with value: object "TypeError: mql.addEventListener is not a function. (In 'mql.addEventListener("change", listener, true)', 'mql.addEventListener' is undefined)"
+FAIL capturing event listener fires before non-capturing listener at target promise_test: Unhandled rejection with value: object "TypeError: mql.addEventListener is not a function. (In 'mql.addEventListener("change", {
+        handleEvent() {
+            calls.push("addEventListener");
+        },
+    }, true)', 'mql.addEventListener' is undefined)"
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/MediaQueryList-extends-EventTarget-interop.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/MediaQueryList-extends-EventTarget-interop.html
new file mode 100644 (file)
index 0000000..2ac4b46
--- /dev/null
@@ -0,0 +1,172 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<meta name="flags" content="dom">
+<title>CSS Test: CSSOM View MediaQueryList extends EventTarget (interop)</title>
+<link rel="help" href="https://www.w3.org/TR/cssom-view-1/#the-mediaquerylist-interface">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="resources/matchMedia.js"></script>
+<div id="log"></div>
+<script>
+"use strict";
+
+test(() => {
+    const mql = window.matchMedia("all");
+
+    let receivedEvent;
+    mql.addListener(event => {
+        receivedEvent = event;
+    });
+
+    const dispatchedEvent = new Event("change");
+    mql.dispatchEvent(dispatchedEvent);
+
+    assert_equals(receivedEvent, dispatchedEvent);
+}, "dispatchEvent triggers listener added with addListener");
+
+promise_test(async t => {
+    const mql = await createMQL(t);
+
+    let calls = 0;
+    const listener = {
+        handleEvent() {
+            calls++;
+        },
+    };
+
+    mql.addListener(listener);
+    mql.addEventListener("change", listener);
+
+    triggerMQLEvent(mql);
+    await waitForChangesReported();
+    assert_equals(calls, 1, "triggerMQLEvent");
+
+    mql.dispatchEvent(new Event("change"));
+    assert_equals(calls, 2, "dispatchEvent");
+}, "listener added with addListener and addEventListener is called once");
+
+promise_test(async t => {
+    const mql = await createMQL(t);
+
+    let calls = 0;
+    const listener = () => {
+        calls++;
+    };
+
+    mql.addListener(listener);
+    mql.addEventListener("change", listener, true);
+
+    triggerMQLEvent(mql);
+    await waitForChangesReported();
+    assert_equals(calls, 2, "triggerMQLEvent");
+
+    mql.dispatchEvent(new Event("change"));
+    assert_equals(calls, 4, "dispatchEvent");
+}, "listener added with addListener and addEventListener (capture) is called twice");
+
+promise_test(async t => {
+    const mql = await createMQL(t);
+
+    let calls = 0;
+    const listener = {
+        handleEvent() {
+            calls++;
+        },
+    };
+
+    mql.addListener(listener);
+    mql.removeEventListener("change", listener);
+
+    triggerMQLEvent(mql);
+    await waitForChangesReported();
+    assert_equals(calls, 0, "triggerMQLEvent");
+
+    mql.dispatchEvent(new Event("change"));
+    assert_equals(calls, 0, "dispatchEvent");
+}, "removeEventListener removes listener added with addListener");
+
+promise_test(async t => {
+    const mql = await createMQL(t);
+
+    let calls = 0;
+    const listener = () => {
+        calls++;
+    };
+
+    mql.addListener(listener);
+    mql.removeEventListener("change", listener, true);
+
+    triggerMQLEvent(mql);
+    await waitForChangesReported();
+    assert_equals(calls, 1, "triggerMQLEvent");
+
+    mql.dispatchEvent(new Event("change"));
+    assert_equals(calls, 2, "dispatchEvent");
+}, "removeEventListener (capture) doesn't remove listener added with addListener");
+
+promise_test(async t => {
+    const mql = await createMQL(t);
+
+    let calls = 0;
+    const listener = {
+        handleEvent() {
+            calls++;
+        },
+    };
+
+    mql.addEventListener("change", listener);
+    mql.removeListener(listener);
+
+    triggerMQLEvent(mql);
+    await waitForChangesReported();
+    assert_equals(calls, 0, "triggerMQLEvent");
+
+    mql.dispatchEvent(new Event("change"));
+    assert_equals(calls, 0, "dispatchEvent");
+}, "removeListener removes listener added with addEventListener");
+
+promise_test(async t => {
+    const mql = await createMQL(t);
+
+    let calls = 0;
+    const listener = () => {
+        calls++;
+    };
+
+    mql.addEventListener("change", listener, true);
+    mql.removeListener(listener);
+
+    triggerMQLEvent(mql);
+    await waitForChangesReported();
+    assert_equals(calls, 1, "triggerMQLEvent");
+
+    mql.dispatchEvent(new Event("change"));
+    assert_equals(calls, 2, "dispatchEvent");
+}, "removeListener doesn't remove listener added with addEventListener (capture)");
+
+// See:
+//   * https://github.com/whatwg/dom/issues/746
+//   * https://bugzilla.mozilla.org/show_bug.cgi?id=1492446
+//   * https://bugs.chromium.org/p/chromium/issues/detail?id=949432
+promise_test(async t => {
+    const mql = await createMQL(t);
+
+    let calls = [];
+    mql.addListener(() => {
+        calls.push("addListener");
+    });
+    mql.addEventListener("change", {
+        handleEvent() {
+            calls.push("addEventListener");
+        },
+    }, true);
+
+    triggerMQLEvent(mql);
+    await waitForChangesReported();
+    assert_array_equals(calls, ["addEventListener", "addListener"], "triggerMQLEvent");
+
+    calls = [];
+    mql.dispatchEvent(new Event("change"));
+    assert_array_equals(calls, ["addEventListener", "addListener"], "dispatchEvent");
+}, "capturing event listener fires before non-capturing listener at target");
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/MediaQueryList-extends-EventTarget.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/MediaQueryList-extends-EventTarget.html
new file mode 100644 (file)
index 0000000..34b6ef1
--- /dev/null
@@ -0,0 +1,118 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<meta name="flags" content="dom">
+<title>CSS Test: CSSOM View MediaQueryList extends EventTarget</title>
+<link rel="help" href="https://www.w3.org/TR/cssom-view-1/#the-mediaquerylist-interface">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="resources/matchMedia.js"></script>
+<div id="log"></div>
+<script>
+"use strict";
+
+promise_test(async t => {
+    const mql = await createMQL(t);
+
+    let _event;
+    mql.onchange = event => {
+        _event = event;
+    };
+
+    triggerMQLEvent(mql);
+    await waitForChangesReported();
+    assert_equals(_event.media, mql.media);
+    assert_equals(_event.matches, mql.matches);
+}, "onchange adds listener");
+
+promise_test(async t => {
+    const mql = await createMQL(t);
+
+    let calls = 0;
+    mql.onchange = () => {
+        calls++;
+    };
+
+    triggerMQLEvent(mql);
+    await waitForChangesReported();
+    assert_equals(calls, 1);
+
+    mql.onchange = null;
+
+    triggerMQLEvent(mql);
+    await waitForChangesReported();
+    assert_equals(calls, 1);
+}, "onchange removes listener");
+
+promise_test(async t => {
+    const mql = await createMQL(t);
+
+    let calls = 0;
+    mql.addEventListener("change", {
+        handleEvent() {
+            calls++;
+        },
+    });
+
+    triggerMQLEvent(mql);
+    await waitForChangesReported();
+    assert_equals(calls, 1);
+}, 'listeners for "change" type are called');
+
+promise_test(async t => {
+    const mql = await createMQL(t);
+    mql.addEventListener("matches", t.unreached_func("should not be called"));
+
+    triggerMQLEvent(mql);
+    await waitForChangesReported();
+}, 'listeners with different type are not called');
+
+promise_test(async t => {
+    const mql = await createMQL(t);
+
+    let calls = 0;
+    mql.addEventListener("change", {
+        handleEvent() {
+            calls++;
+        },
+    }, {once: true});
+
+    triggerMQLEvent(mql);
+    await waitForChangesReported();
+    assert_equals(calls, 1);
+
+    triggerMQLEvent(mql);
+    await waitForChangesReported();
+    assert_equals(calls, 1);
+}, 'addEventListener "once" option is respected');
+
+promise_test(async t => {
+    const mql = await createMQL(t);
+    const listener = t.unreached_func("should not be called");
+
+    mql.addEventListener("change", listener);
+    mql.removeEventListener("change", listener);
+
+    triggerMQLEvent(mql);
+    await waitForChangesReported();
+}, "removeEventListener removes listener");
+
+test(() => {
+    const mql = window.matchMedia("all");
+
+    let receivedEvent;
+    mql.addEventListener("custom", event => {
+        receivedEvent = event;
+        event.preventDefault();
+    }, true);
+
+    const dispatchedEvent = new CustomEvent("custom", {
+        cancelable: true,
+        detail: {},
+    });
+
+    const defaultAction = mql.dispatchEvent(dispatchedEvent);
+
+    assert_equals(receivedEvent, dispatchedEvent);
+    assert_false(defaultAction);
+}, "dispatchEvent works as expected");
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/MediaQueryList-with-empty-string-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/MediaQueryList-with-empty-string-expected.txt
deleted file mode 100644 (file)
index 8c504d3..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-
-PASS cssom-view - MediaQueryList with empty string 
-
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/MediaQueryList-with-empty-string.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/MediaQueryList-with-empty-string.html
deleted file mode 100644 (file)
index 8b90d23..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<!doctype html>
-<meta charset="utf-8">
-<title>cssom-view - MediaQueryList with empty string</title>
-<script src="../../../../../resources/testharness.js"></script>
-<script src="../../../../../resources/testharnessreport.js"></script>
-<script>
-test(function () {
-    var mql = window.matchMedia('');
-    assert_equals(mql.media, '', "This should be an empty media query list");
-    assert_equals(mql.matches, true, "Empty media query list should evaluate to true");
-});
-</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/MediaQueryListEvent-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/MediaQueryListEvent-expected.txt
new file mode 100644 (file)
index 0000000..3e1b479
--- /dev/null
@@ -0,0 +1,10 @@
+
+FAIL type can be different from "change" Can't find variable: MediaQueryListEvent
+FAIL init dictionary default values Can't find variable: MediaQueryListEvent
+FAIL init dictionary overrides Can't find variable: MediaQueryListEvent
+FAIL argument of addListener promise_test: Unhandled rejection with value: object "TypeError: Right hand side of instanceof is not an object"
+FAIL argument of onchange promise_test: Unhandled rejection with value: object "TypeError: Right hand side of instanceof is not an object"
+FAIL constructor of "change" event promise_test: Unhandled rejection with value: object "TypeError: mql.addEventListener is not a function. (In 'mql.addEventListener("change", event => {
+        _event = event;
+    })', 'mql.addEventListener' is undefined)"
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/MediaQueryListEvent.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/MediaQueryListEvent.html
new file mode 100644 (file)
index 0000000..0afa09f
--- /dev/null
@@ -0,0 +1,90 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<meta name="flags" content="dom">
+<title>CSS Test: CSSOM View MediaQueryListEvent</title>
+<link rel="help" href="https://www.w3.org/TR/cssom-view-1/#mediaquerylistevent">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="resources/matchMedia.js"></script>
+<div id="log"></div>
+<script>
+"use strict";
+
+test(() => {
+    assert_equals(new MediaQueryListEvent("test").type, "test");
+}, 'type can be different from "change"');
+
+test(() => {
+    const event = new MediaQueryListEvent("change");
+
+    assert_equals(event.media, "");
+    assert_false(event.matches);
+    assert_false(event.bubbles);
+    assert_false(event.cancelable);
+}, "init dictionary default values");
+
+test(() => {
+    const event = new MediaQueryListEvent("change", {
+        media: "test",
+        matches: true,
+        bubbles: true,
+        cancelable: true,
+    });
+
+    assert_equals(event.media, "test");
+    assert_true(event.matches);
+    assert_true(event.bubbles);
+    assert_true(event.cancelable);
+}, "init dictionary overrides");
+
+promise_test(async t => {
+    const mql = await createMQL(t);
+
+    let _event;
+    mql.addListener(event => {
+        _event = event;
+    });
+
+    triggerMQLEvent(mql);
+    await waitForChangesReported();
+
+    assert_true(_event instanceof getWindow(mql).MediaQueryListEvent);
+    assert_equals(_event.type, "change");
+    assert_false(_event.bubbles);
+    assert_false(_event.cancelable);
+}, "argument of addListener");
+
+promise_test(async t => {
+    const mql = await createMQL(t);
+
+    let _event;
+    mql.onchange = event => {
+        _event = event;
+    };
+
+    triggerMQLEvent(mql);
+    await waitForChangesReported();
+
+    assert_true(_event instanceof getWindow(mql).MediaQueryListEvent);
+    assert_equals(_event.type, "change");
+    assert_false(_event.bubbles);
+    assert_false(_event.cancelable);
+}, "argument of onchange");
+
+promise_test(async t => {
+    const mql = await createMQL(t);
+
+    let _event;
+    mql.addEventListener("change", event => {
+        _event = event;
+    });
+
+    triggerMQLEvent(mql);
+    await waitForChangesReported();
+
+    assert_true(_event instanceof getWindow(mql).MediaQueryListEvent);
+    assert_equals(_event.type, "change");
+    assert_false(_event.bubbles);
+    assert_false(_event.cancelable);
+}, 'constructor of "change" event');
+</script>
index 82688d2..2a8d5b5 100644 (file)
@@ -4,8 +4,8 @@
     <title>CSSOM View Module test:Screen-pixelDepth,Screen-colorDepth</title>
     <link rel="author" title="unbug" href="mailto:tidelgl@gmail.com" />
     <link rel="help" href="http://www.w3.org/TR/cssom-view/#the-screen-interface">
-    <script src="../../../../../resources/testharness.js"></script>
-    <script src="../../../../../resources/testharnessreport.js"></script>
+    <script src="/resources/testharness.js"></script>
+    <script src="/resources/testharnessreport.js"></script>
     <style type="text/css">
     </style>
 </head>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/client-props-inline-list-item-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/client-props-inline-list-item-expected.txt
new file mode 100644 (file)
index 0000000..6ddf731
--- /dev/null
@@ -0,0 +1,4 @@
+FooFoo
+
+PASS client* returns the same for non-replaced inlines regardless of list-item-ness 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/client-props-inline-list-item.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/client-props-inline-list-item.html
new file mode 100644 (file)
index 0000000..725bb78
--- /dev/null
@@ -0,0 +1,26 @@
+<!doctype html>
+<title>client* returns the same for non-replaced inlines regardless of list-item-ness</title>
+<link rel="help" href="https://drafts.csswg.org/cssom-view/#extension-to-the-element-interface">
+<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1581467">
+<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
+<link rel="author" title="Mozilla" href="https://mozilla.org">
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<style>
+  .li {
+    display: inline list-item;
+  }
+</style>
+<div style="position: absolute"><span>Foo</span></div>
+<div style="position: absolute"><span class="li">Foo</span></div>
+<script>
+test(() => {
+  let first = document.querySelector("span");
+  let second = document.querySelector(".li");
+
+  assert_equals(first.clientWidth, second.clientWidth, "clientWidth should match");
+  assert_equals(first.clientHeight, second.clientHeight, "clientHeight should match");
+  assert_equals(first.clientTop, second.clientTop, "clientTop should match");
+  assert_equals(first.clientLeft, second.clientLeft, "clientLeft should match");
+}, "client* returns the same for non-replaced inlines regardless of list-item-ness");
+</script>
index f343066..7d96540 100644 (file)
@@ -6,8 +6,8 @@
     <link rel="author" title="Chris Wu" href="mailto:pwx.frontend@gmail.com">
     <link rel="help" href="http://www.w3.org/TR/cssom-view/#dom-element-getboundingclientrect">
     <meta name="flags" content="dom">
-    <script src="../../../../../resources/testharness.js"></script>
-    <script src="../../../../../resources/testharnessreport.js"></script>
+    <script src="/resources/testharness.js"></script>
+    <script src="/resources/testharnessreport.js"></script>
     <style type="text/css">
         #testItem {
             width: 279px;
index 76952f1..a7c3568 100644 (file)
@@ -8,8 +8,8 @@
     <link rel="help" href="http://www.w3.org/TR/cssom-view/#dom-element-getboundingclientrect">
     <meta name="flags" content="dom">
     <meta name="assert" content="Calling getBoundingClientRect on an element that is outside of the DOM (and therefore does not have an associated layout box) should result in an all-zeroes DOMRect and should definitely not throw an error.">
-    <script src="../../../../../resources/testharness.js"></script>
-    <script src="../../../../../resources/testharnessreport.js"></script>
+    <script src="/resources/testharness.js"></script>
+    <script src="/resources/testharnessreport.js"></script>
     <script>
         test(
             function () {
index ae62294..25c3e93 100644 (file)
@@ -3,8 +3,8 @@
  <head>
   <title>CSSOM View - getBoxQuads() returns proper border and margin boxes for block and flex</title>
   <link rel="help" href="https://drafts.csswg.org/cssom-view/#the-geometryutils-interface">
-  <script src="../../../../../resources/testharness.js"></script>
-  <script src="../../../../../resources/testharnessreport.js"></script>
+  <script src="/resources/testharness.js"></script>
+  <script src="/resources/testharnessreport.js"></script>
 
   <style>
     .container {
   <script>
     test(function() {
       let bb = document.getElementById("block-block");
-      assert_equals(bb.getBoxQuads({box: "border"})[0].bounds.width,  20, "Block layout border box is expected width.");
-      assert_equals(bb.getBoxQuads({box: "margin"})[0].bounds.width, 100, "Block layout margin box is expected width.");
+      assert_equals(bb.getBoxQuads({box: "border"})[0].getBounds().width,  20, "Block layout border box is expected width.");
+      assert_equals(bb.getBoxQuads({box: "margin"})[0].getBounds().width, 100, "Block layout margin box is expected width.");
 
       // For containers that expand items to fill block-axis space, measure the box heights also.
       let fb = document.getElementById("flex-block");
-      assert_equals(fb.getBoxQuads({box: "border"})[0].bounds.width,  20, "Flex layout border box is expected width.");
-      assert_equals(fb.getBoxQuads({box: "margin"})[0].bounds.width, 100, "Flex layout margin box is expected width.");
+      assert_equals(fb.getBoxQuads({box: "border"})[0].getBounds().width,  20, "Flex layout border box is expected width.");
+      assert_equals(fb.getBoxQuads({box: "margin"})[0].getBounds().width, 100, "Flex layout margin box is expected width.");
 
-      assert_equals(fb.getBoxQuads({box: "border"})[0].bounds.height, 10, "Flex layout border box is expected height.");
-      assert_equals(fb.getBoxQuads({box: "margin"})[0].bounds.height, 50, "Flex layout margin box is expected height.");
+      assert_equals(fb.getBoxQuads({box: "border"})[0].getBounds().height, 10, "Flex layout border box is expected height.");
+      assert_equals(fb.getBoxQuads({box: "margin"})[0].getBounds().height, 50, "Flex layout margin box is expected height.");
     });
   </script>
  </body>
index bb7b8c6..9fd791d 100644 (file)
@@ -3,8 +3,8 @@
  <head>
   <title>CSSOM View - GetClientRects().length is the same regardless source new lines</title>
   <link rel="help" href="https://drafts.csswg.org/cssom-view-1/#dom-element-getclientrects">
-  <script src="../../../../../resources/testharness.js"></script>
-  <script src="../../../../../resources/testharnessreport.js"></script>
+  <script src="/resources/testharness.js"></script>
+  <script src="/resources/testharnessreport.js"></script>
  </head>
  <body>
   <span id="single">
index 556bbd2..36559eb 100644 (file)
@@ -7,8 +7,8 @@
     <link rel="help" href="http://www.w3.org/TR/cssom-view/#dom-element-getclientrects">
     <meta name="flags" content="dom">
     <meta name="assert" content="Calling getClientRects on an element that is outside of the DOM (and therefore does not have an associated layout box) should result in an empty DOMRectList and should definitely not throw an error.">
-    <script src="../../../../../resources/testharness.js"></script>
-    <script src="../../../../../resources/testharnessreport.js"></script>
+    <script src="/resources/testharness.js"></script>
+    <script src="/resources/testharnessreport.js"></script>
     <script>
         test(
             function () {
index 2f596c7..2f42288 100644 (file)
@@ -8,8 +8,8 @@
         <link rel="help" href="https://drafts.csswg.org/cssom-view/#excensions-to-the-htmlimageelement-interface">
         <meta name="assert" content="HTMLImageElement attributes give x and y position of CSS layout box">
         <meta name="flags" content="dom">
-        <script src="../../../../../resources/testharness.js"></script>
-        <script src="../../../../../resources/testharnessreport.js"></script>
+        <script src="/resources/testharness.js"></script>
+        <script src="/resources/testharnessreport.js"></script>
     </head>
     <body>
         <div id="log"></div>
index 0116253..29802ac 100644 (file)
@@ -6,8 +6,8 @@
     <link rel="help" href="http://www.w3.org/TR/cssom-view/#the-screen-interface">
     <meta name="flags" content="dom">
     <meta name="assert" content="window screen interface">
-    <script src="../../../../../resources/testharness.js"></script>
-    <script src="../../../../../resources/testharnessreport.js"></script>
+    <script src="/resources/testharness.js"></script>
+    <script src="/resources/testharnessreport.js"></script>
     </head>
     <body>
         <div id="myDiv"></div>
index 30497b2..3f3e27a 100644 (file)
@@ -2,8 +2,8 @@
 <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>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <style>
     #section1 {
         width: 300px;
index 19a0f7a..c2fcc42 100644 (file)
@@ -6,8 +6,8 @@
     <link rel="help" href="http://www.w3.org/TR/cssom-view/#extensions-to-the-document-interface">
     <meta name="flags" content="dom">
     <meta name="assert" content="elementFromPoint returns correct element">
-    <script src="../../../../../resources/testharness.js"></script>
-    <script src="../../../../../resources/testharnessreport.js"></script>
+    <script src="/resources/testharness.js"></script>
+    <script src="/resources/testharnessreport.js"></script>
     <style>
     #targetDiv {
         position: absolute;
index eaee6ca..ebab52f 100644 (file)
@@ -2,8 +2,8 @@
 <meta charset=utf-8>
 <title>Checking whether dynamic changes to visibility interact correctly with
   table anonymous boxes</title>
-<script src=../../../../../resources/testharness.js></script>
-<script src=../../../../../resources/testharnessreport.js></script>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
 <style>
 #overlay {
   display: table;
index 95423b9..0a1ac40 100644 (file)
@@ -2,8 +2,8 @@
 <meta charset=utf-8>
 <title>Checking whether dynamic changes to visibility interact correctly with
   table anonymous boxes</title>
-<script src=../../../../../resources/testharness.js></script>
-<script src=../../../../../resources/testharnessreport.js></script>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
 <style>
 #overlay {
   display: table;
index 64d15e6..e0acb90 100644 (file)
@@ -3,8 +3,8 @@
 <title>CSS Test: Hit testing on element previously hidden by an anonymous scroll box</title>
 <link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
 <link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1433591">
-<script src="../../../../../resources/testharness.js"></script>
-<script src="../../../../../resources/testharnessreport.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <style>
 html, body {
   margin: 0;
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/elementFromPoint-list-001-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/elementFromPoint-list-001-expected.txt
new file mode 100644 (file)
index 0000000..d38103d
--- /dev/null
@@ -0,0 +1,22 @@
+Outside 1
+Outside 2
+Outside 3
+Image Outside 1
+Image Outside 2
+Inside 1
+Inside 2
+Inside 3
+Image Inside 1
+Image Inside 2
+
+PASS <li>Outside 1</li> 
+PASS <li>Outside 2</li> 
+PASS <li>Outside 3</li> 
+PASS <li>Image Outside 1</li> 
+PASS <li>Image Outside 2</li> 
+PASS <li>Inside 1</li> 
+PASS <li>Inside 2</li> 
+PASS <li>Inside 3</li> 
+PASS <li>Image Inside 1</li> 
+PASS <li>Image Inside 2</li> 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/elementFromPoint-list-001.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/elementFromPoint-list-001.html
new file mode 100644 (file)
index 0000000..b31453d
--- /dev/null
@@ -0,0 +1,83 @@
+<!DOCTYPE html>
+<title>Test elementFromPoint for list-item</title>
+<link rel="help" href="https://drafts.csswg.org/cssom-view/#dom-document-elementfrompoint">
+<link rel="author" title="Koji Ishii" href="mailto:kojii@chromium.org">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<style>
+ul {
+  font-size: 10px;
+}
+ul.inside {
+  list-style-position: inside;
+}
+.image {
+  list-style-image: url(../../images/green-16x16.png);
+}
+.debug-marker {
+  position: absolute;
+  width: 0;
+  height: 0;
+  outline: 2px solid red;
+}
+</style>
+<body>
+  <ul>
+    <li>Outside 1</li>
+    <li>Outside 2</li>
+    <li>Outside 3</li>
+    <li class="image">Image Outside 1</li>
+    <li class="image">Image Outside 2</li>
+  </ul>
+  <ul class="inside">
+    <li>Inside 1</li>
+    <li>Inside 2</li>
+    <li>Inside 3</li>
+    <li class="image">Image Inside 1</li>
+    <li class="image">Image Inside 2</li>
+  </ul>
+<script>
+setup({explicit_done:true});
+window.onload = function() {
+  for (let li of document.getElementsByTagName('li')) {
+    test(() => {
+      let bounds = li.getBoundingClientRect();
+      let style = window.getComputedStyle(li);
+      let y = (bounds.top + bounds.bottom) / 2;
+      if (style.listStylePosition === 'inside') {
+        // Inside markers are normal inline boxes.
+        // It is safe to assume "left + 1" is in the box.
+        let x = bounds.left + 1;
+        addDebugMarker(x, y);
+        let result = document.elementFromPoint(x, y);
+        assert_equals(result, li);
+      } else {
+        // The spec does not define outside marker position.
+        // This code assumes that the marker is within "left - 40" to "left - 1".
+        // This is heuristic, but all browsers seem to pass with this method.
+        let result = null;
+        for (let x = bounds.left - 40; x < bounds.left; x++) {
+          result = document.elementFromPoint(x, y);
+          if (result === li) {
+            addDebugMarker(x, y);
+            break;
+          }
+        }
+        assert_equals(result, li);
+      }
+    }, `<li>${li.textContent}</li>`);
+  }
+  done();
+};
+
+// Show a marker for the debugging purposes, in case the heuristic doesn't apply.
+function addDebugMarker(x, y) {
+  let div = document.createElement('div');
+  div.className = 'debug-marker';
+  let style = div.style;
+  style.left = x + 'px';
+  style.top = y + 'px';
+  document.body.appendChild(div);
+}
+</script>
+</body>
index 9f8d7d8..e2bac90 100644 (file)
@@ -1,7 +1,7 @@
 <!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>
+<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
index b14b081..899e411 100644 (file)
@@ -2,8 +2,8 @@
 <title>Tests that the parameters to document.elementFromPoint() and
 document.elementsFromPoint() are mandatory and of type double.</title>
 <link rel="help" href="https://drafts.csswg.org/cssom-view/#extensions-to-the-document-interface">
-<script src="../../../../../resources/testharness.js"></script>
-<script src="../../../../../resources/testharnessreport.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <script>
 function validate_function_parameter_count(testFunc, funcName) {
     test(function() {
index 2e2488f..ff67aa2 100644 (file)
@@ -4,8 +4,8 @@
   <title>CSSOM View - extensions to the Document interface</title>
   <link rel="author" title="Xiaocheng Hu" href="mailto:xiaochengh@chromium.org">
   <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>
+  <script src="/resources/testharness.js"></script>
+  <script src="/resources/testharnessreport.js"></script>
   <style>
     .container {
       display: flex;
index ceeb21c..466fb5c 100644 (file)
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <title>cssom-view - elementFromPoint</title>
-<script src="../../../../../resources/testharness.js"></script>
-<script src="../../../../../resources/testharnessreport.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <style>
   .size {
     width:60px;
@@ -40,7 +40,7 @@
   xmlns="http://www.w3.org/2000/svg"
   xmlns:xlink="http://www.w3.org/1999/xlink">
 
-  <!--  Now we add a text element and apply rotate and translate to both  -->
+  <!-- Now we add a text element and apply rotate and translate to both -->
   <rect x="50" y="50" height="60" width="60" style="stroke:#000; fill: #0086B2" transform="translate(30) rotate(45 50 50)"></rect>
   <text x="60" y="105" transform="translate(30) rotate(45 50 50)"> Hello! </text>
 
@@ -53,9 +53,9 @@
     <area id="circleO" shape="circle" coords="120,60,30" href="#" alt="area 2"/>
     <area id="polyLE" shape="poly" coords="280,0,310,0,360,30,360,90,280,90" href="#" alt="area 3"/>
   </map>
-  <!--  Test for fieldsets not doing weird things.  Use a 200x200 div to hold
+  <!-- Test for fieldsets not doing weird things.  Use a 200x200 div to hold
        all the bits for this test. Also, place it top/right, so it is not below
-       the bottom edge of the viewport.  -->
+       the bottom edge of the viewport. -->
   <div style="position: absolute; width: 200px; height: 200px; right: 0; top: 0">
     <div id="fieldset-div"
          class="size" style="position: absolute; top: 0; left: 0">
@@ -63,8 +63,8 @@
     <fieldset id="fieldset"
               class="size"
               style="position: absolute; top: 100px; left: 100px; border-radius: 100px">
-      <!--  Place the child span so the overflow area of the fieldset overlaps
-           the div  -->
+      <!-- Place the child span so the overflow area of the fieldset overlaps
+           the div -->
       <span style="position: absolute; top: -100px; left: -100px; height: 1px; width: 1px"></span>
     </fieldset>
   </div>
index 6d2b686..ed86d16 100644 (file)
@@ -6,8 +6,8 @@
     <link rel="author" title="Chris" href="mailto:pwx.frontend@gmail.com" />
     <link rel="help" href="https://www.w3.org/TR/cssom-view/#dom-document-elementfrompoint" />
     <meta name="flags" content="dom" />
-    <script src="../../../../../resources/testharness.js" type="text/javascript"></script>
-    <script src="../../../../../resources/testharnessreport.js" type="text/javascript"></script>
+    <script src="/resources/testharness.js" type="text/javascript"></script>
+    <script src="/resources/testharnessreport.js" type="text/javascript"></script>
 </head>
 <body>
     <noscript>Test not run - JavaScript required!</noscript>
index a4b5e6e..a1a28aa 100644 (file)
@@ -3,8 +3,8 @@
 <title>cssom-view - elementScroll - 002</title>
 <link rel="help" href="https://drafts.csswg.org/cssom-view/#dom-element-scrolltop">
 <link rel="help" href="https://drafts.csswg.org/cssom-view/#dom-element-scrollleft">
-<script src="../../../../../resources/testharness.js"></script>
-<script src="../../../../../resources/testharnessreport.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <div id="scroller1" style="height: 100px; width: 100px; overflow: scroll; background: red;">
     <div style="background: green; margin-top: 100px; margin-left: 100px; width: 100px; height: 100px;"></div>
 </div>
index e352cd0..2ef76e9 100644 (file)
@@ -1,8 +1,8 @@
 <!DOCTYPE html>
 <meta charset=utf-8>
 <title>cssom-view - elementScroll</title>
-<script src="../../../../../resources/testharness.js"></script>
-<script src="../../../../../resources/testharnessreport.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <style>
     #section {
         width: 300px;
index 330f4fb..3bba161 100644 (file)
@@ -1,6 +1,6 @@
 <!DOCTYPE HTML>
-<script src="../../../../../resources/testharness.js"></script>
-<script src="../../../../../resources/testharnessreport.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <script src="resources/elementsFromPoint.js"></script>
 <script>
 var loadedFrameCount = 0;
index facb529..5d6f92f 100644 (file)
@@ -4,8 +4,8 @@
 <div id="container" style="width:200px; height:200px; writing-mode:horizontal-tb; direction:ltr;">
   <span id="target">target</span>
 </div>
-<script src="../../../../../resources/testharness.js"></script>
-<script src="../../../../../resources/testharnessreport.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <script>
   test(()=> {
       var elements = document.elementsFromPoint(15, 15);
index 7956880..3ff7f01 100644 (file)
@@ -4,8 +4,8 @@
 <div id="container" style="width:200px; height:200px; writing-mode:horizontal-tb; direction:rtl;">
   <span id="target">target</span>
 </div>
-<script src="../../../../../resources/testharness.js"></script>
-<script src="../../../../../resources/testharnessreport.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <script>
   test(()=> {
       var elements = document.elementsFromPoint(200, 15);
index 47e4ad3..c22c005 100644 (file)
@@ -4,8 +4,8 @@
 <div id="container" style="width:200px; height:200px; writing-mode:vertical-lr; direction:ltr;">
   <span id="target">target</span>
 </div>
-<script src="../../../../../resources/testharness.js"></script>
-<script src="../../../../../resources/testharnessreport.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <script>
   test(()=> {
       var elements = document.elementsFromPoint(15, 15);
index aec0e17..e8e600a 100644 (file)
@@ -4,8 +4,8 @@
 <div id="container" style="width:200px; height:200px; writing-mode:vertical-lr; direction:rtl;">
   <span id="target">target</span>
 </div>
-<script src="../../../../../resources/testharness.js"></script>
-<script src="../../../../../resources/testharnessreport.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <script>
   test(()=> {
       var elements = document.elementsFromPoint(15, 200);
index 735ff2c..598d41e 100644 (file)
@@ -4,8 +4,8 @@
 <div id="container" style="width:200px; height:200px; writing-mode:vertical-rl; direction:ltr;">
   <span id="target">target</span>
 </div>
-<script src="../../../../../resources/testharness.js"></script>
-<script src="../../../../../resources/testharnessreport.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <script>
   test(()=> {
       var elements = document.elementsFromPoint(200, 15);
index f962800..4d93bf5 100644 (file)
@@ -4,8 +4,8 @@
 <div id="container" style="width:200px; height:200px; writing-mode:vertical-rl; direction:rtl;">
   <span id="target">target</span>
 </div>
-<script src="../../../../../resources/testharness.js"></script>
-<script src="../../../../../resources/testharnessreport.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <script>
   test(()=> {
       var elements = document.elementsFromPoint(200, 200);
index c649fb5..369cffc 100644 (file)
@@ -1,6 +1,6 @@
 <!DOCTYPE HTML>
-<script src="../../../../../resources/testharness.js"></script>
-<script src="../../../../../resources/testharnessreport.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <script src="resources/elementsFromPoint.js"></script>
 <style>
 html {
index b5f7f19..b3e0c6d 100644 (file)
@@ -1,6 +1,6 @@
 <!DOCTYPE HTML>
-<script src="../../../../../resources/testharness.js"></script>
-<script src="../../../../../resources/testharnessreport.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <script src="resources/elementsFromPoint.js"></script>
 <style>
 html, body {
index f1228d7..4973121 100644 (file)
@@ -1,6 +1,6 @@
 <!DOCTYPE HTML>
-<script src="../../../../../resources/testharness.js"></script>
-<script src="../../../../../resources/testharnessreport.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <script src="resources/elementsFromPoint.js"></script>
 <style>
 html, body {
index 176fa87..8bbc23e 100644 (file)
@@ -1,8 +1,8 @@
 <!DOCTYPE HTML>
 <title>Document.prototype.elementsFromPoint on SVG text content elements</title>
 <link rel="help" href="https://drafts.csswg.org/cssom-view/#dom-document-elementsfrompoint">
-<script src="../../../../../resources/testharness.js"></script>
-<script src="../../../../../resources/testharnessreport.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <script src="resources/elementsFromPoint.js"></script>
 <style>
 html, body {
index a5dc339..8535228 100644 (file)
@@ -1,6 +1,6 @@
 <!DOCTYPE HTML>
-<script src="../../../../../resources/testharness.js"></script>
-<script src="../../../../../resources/testharnessreport.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <script src="resources/elementsFromPoint.js"></script>
 <style>
 html, body {
index 6d50ec9..9ecb614 100644 (file)
@@ -1,6 +1,6 @@
 <!DOCTYPE HTML>
-<script src="../../../../../resources/testharness.js"></script>
-<script src="../../../../../resources/testharnessreport.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <script src="resources/elementsFromPoint.js"></script>
 <style>
 html, body {
index a6d2358..bf883a1 100644 (file)
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <title>cssom-view - elementsFromPoint</title>
-<script src="../../../../../resources/testharness.js"></script>
-<script src="../../../../../resources/testharnessreport.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <style>
   .size {
     width:60px;
@@ -40,7 +40,7 @@
   xmlns="http://www.w3.org/2000/svg"
   xmlns:xlink="http://www.w3.org/1999/xlink">
 
-  <!--  Now we add a text element and apply rotate and translate to both  -->
+  <!-- Now we add a text element and apply rotate and translate to both -->
   <rect x="50" y="50" height="60" width="60" style="stroke:#000; fill: #0086B2" transform="translate(30) rotate(45 50 50)"></rect>
   <text x="60" y="105" transform="translate(30) rotate(45 50 50)"> Hello! </text>
 
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/getBoundingClientRect-empty-inline-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/getBoundingClientRect-empty-inline-expected.txt
new file mode 100644 (file)
index 0000000..eb8f8b4
--- /dev/null
@@ -0,0 +1,3 @@
+
+FAIL getBoundingClientRect-empty-inline assert_equals: y expected 92 but got 0
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/getBoundingClientRect-empty-inline.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/getBoundingClientRect-empty-inline.html
new file mode 100644 (file)
index 0000000..f5c6bee
--- /dev/null
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<link rel="help" href="https://drafts.csswg.org/cssom-view/#dom-element-getboundingclientrect">
+<link rel="author" title="Koji Ishii" href="mailto:kojii@chromium.org">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+<style>
+div {
+  font: 10px/1 Ahem;
+}
+.inline-block {
+  display: inline-block;
+  height: 100px;
+}
+</style>
+<body>
+  <div>
+    <span id="empty"></span>
+    <span class="inline-block"></span>
+  </div>
+<script>
+document.fonts.ready.then(() => {
+run(document.getElementById('empty'));
+function run(element) {
+  test(() => {
+    let rect = element.getBoundingClientRect();
+    let cb = element.parentElement;
+    let cb_rect = cb.getBoundingClientRect();
+    assert_equals(rect.y - cb_rect.y, 92, "y");
+    assert_equals(rect.height, 10, "height");
+  });
+}
+});
+</script>
+</body>
index cf2f468..e952d61 100644 (file)
@@ -4,8 +4,8 @@
 <div style="position:absolute; top:0; left:0; width:200px; height:100px; writing-mode:horizontal-tb; direction:ltr;">
   <br id="child">
 </div>
-<script src="../../../../../resources/testharness.js"></script>
-<script src="../../../../../resources/testharnessreport.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <script>
   test(()=>{
       let r = document.getElementById("child").getClientRects()[0];
index 2113254..24dbc92 100644 (file)
@@ -4,8 +4,8 @@
 <div style="position:absolute; top:0; left:0; width:200px; height:100px; writing-mode:horizontal-tb; direction:rtl;">
   <br id="child">
 </div>
-<script src="../../../../../resources/testharness.js"></script>
-<script src="../../../../../resources/testharnessreport.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <script>
   test(()=>{
       let r = document.getElementById("child").getClientRects()[0];
index 2a4c2e2..b324342 100644 (file)
@@ -4,8 +4,8 @@
 <div style="position:absolute; top:0; left:0; width:200px; height:100px; writing-mode:vertical-lr; direction:ltr;">
   <br id="child">
 </div>
-<script src="../../../../../resources/testharness.js"></script>
-<script src="../../../../../resources/testharnessreport.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <script>
   test(()=>{
       let r = document.getElementById("child").getClientRects()[0];
index dfb49cb..3a36f97 100644 (file)
@@ -4,8 +4,8 @@
 <div style="position:absolute; top:0; left:0; width:200px; height:100px; writing-mode:vertical-lr; direction:rtl;">
   <br id="child">
 </div>
-<script src="../../../../../resources/testharness.js"></script>
-<script src="../../../../../resources/testharnessreport.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <script>
   test(()=>{
       let r = document.getElementById("child").getClientRects()[0];
index ed19ab5..c0be872 100644 (file)
@@ -4,8 +4,8 @@
 <div style="position:absolute; top:0; left:0; width:200px; height:100px; writing-mode:vertical-rl; direction:ltr;">
   <br id="child">
 </div>
-<script src="../../../../../resources/testharness.js"></script>
-<script src="../../../../../resources/testharnessreport.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <script>
   test(()=>{
       let r = document.getElementById("child").getClientRects()[0];
index bfebc8b..c5a3062 100644 (file)
@@ -4,8 +4,8 @@
 <div style="position:absolute; top:0; left:0; width:200px; height:100px; writing-mode:vertical-rl; direction:rtl;">
   <br id="child">
 </div>
-<script src="../../../../../resources/testharness.js"></script>
-<script src="../../../../../resources/testharnessreport.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <script>
   test(()=>{
       let r = document.getElementById("child").getClientRects()[0];
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/getClientRects-inline-atomic-child-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/getClientRects-inline-atomic-child-expected.txt
new file mode 100644 (file)
index 0000000..c68c70d
--- /dev/null
@@ -0,0 +1,5 @@
+
+PASS getClientRects-inline-atomic-child 
+PASS getClientRects-inline-atomic-child 1 
+PASS getClientRects-inline-atomic-child 2 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/getClientRects-inline-atomic-child.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/getClientRects-inline-atomic-child.html
new file mode 100644 (file)
index 0000000..f1f6fc5
--- /dev/null
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<link rel="help" href="https://drafts.csswg.org/cssom-view-1/#dom-element-getclientrects">
+<link rel="author" title="Koji Ishii" href="mailto:kojii@chromium.org">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<style>
+inline-block {
+  display: inline-block;
+  height: 100px;
+}
+</style>
+<body>
+  <div>
+    <span class="target">
+      <inline-block></inline-block>
+    </span>
+  </div>
+  <div>
+    <span class="target">
+      <span>
+        <inline-block></inline-block>
+      </span>
+    </span>
+  </div>
+  <div>
+    <span class="target">
+      <span>
+        <span>
+          <inline-block></inline-block>
+        </span>
+      </span>
+    </span>
+  </div>
+<script>
+for (let element of document.getElementsByClassName('target')) {
+  let rects = element.getClientRects();
+  test(() => {
+    assert_equals(rects.length, 1);
+    for (let rect of rects)
+      assert_not_equals(rect.height, 100);
+  });
+}
+</script>
+</body>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/getClientRects-inline-inline-child-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/getClientRects-inline-inline-child-expected.txt
new file mode 100644 (file)
index 0000000..d71f784
--- /dev/null
@@ -0,0 +1,4 @@
+test subscript test
+
+PASS sub element in a child inline box should not be included 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/getClientRects-inline-inline-child.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/getClientRects-inline-inline-child.html
new file mode 100644 (file)
index 0000000..9a03ccd
--- /dev/null
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<link rel="help" href="https://drafts.csswg.org/cssom-view-1/#dom-element-getclientrects">
+<link rel="author" title="Koji Ishii" href="mailto:kojii@chromium.org">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<body>
+  <div>
+    <span>test</span>
+    <span id="vertical-align-sub-as-grand-child"
+          title="sub element in a child inline box should not be included">
+      <span>
+        <sub class="not-include" style="vertical-align: sub">subscript</sub>
+      </span>
+    </span>
+    <span>test</span>
+  </div>
+<script>
+testTargetDoesNotInclude('vertical-align-sub-as-grand-child');
+
+function testTargetDoesNotInclude(target) {
+  target = document.getElementById(target);
+  test(() => {
+    let target_rects = target.getClientRects();
+
+    let not_include_rects = [];
+    for (let element of target.querySelectorAll('.not-include')) {
+      for (let rect of element.getClientRects())
+        not_include_rects.push(rect);
+    }
+    for (let rect of target_rects) {
+      for (let not_include_rect of not_include_rects) {
+        assert_rect_not_equals(rect, not_include_rect);
+      }
+    }
+  }, target.title);
+}
+
+function assert_rect_not_equals(rect1, rect2) {
+  assert_false(rectEquals(rect1, rect2),
+               `${rectToString(rect1)} and ${rectToString(rect2)} are not equal`);
+}
+
+function rectEquals(rect1, rect2) {
+  return rect1.x === rect2.x && rect1.y === rect2.y &&
+         rect1.width === rect2.width && rect1.height === rect2.height;
+}
+
+function rectToString(rect) {
+  return `{${rect.x}, ${rect.y} ${rect.width}x${rect.height}}`;
+}
+</script>
+</body>
index 56cedf4..bf82eac 100644 (file)
@@ -1,8 +1,8 @@
 <!doctype html>
 <meta charset="utf-8">
 <title>Historical features</title>
-<script src="../../../../../resources/testharness.js"></script>
-<script src="../../../../../resources/testharnessreport.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <div id="log"></div>
 <script>
 test(function() {
index 08f0d24..9171997 100644 (file)
@@ -6,8 +6,8 @@
     <link rel="help" href="https://drafts.csswg.org/cssom-view-1/#dom-htmlelement-offsetwidth">
     <meta name="flags" content="dom">
     <meta name="assert" content="element.offsetWidth returns 0 when there is no documentElement.">
-    <script src="../../../../../resources/testharness.js"></script>
-    <script src="../../../../../resources/testharnessreport.js"></script>
+    <script src="/resources/testharness.js"></script>
+    <script src="/resources/testharnessreport.js"></script>
 </head>
 <body>
     <div id="myDiv">...</div>
@@ -139,6 +139,16 @@ PASS MouseEvent interface: attribute x
 PASS MouseEvent interface: attribute y 
 PASS MouseEvent interface: attribute offsetX 
 PASS MouseEvent interface: attribute offsetY 
+PASS MouseEvent interface: new MouseEvent("foo") must inherit property "screenX" with the proper type 
+PASS MouseEvent interface: new MouseEvent("foo") must inherit property "screenY" with the proper type 
+PASS MouseEvent interface: new MouseEvent("foo") must inherit property "pageX" with the proper type 
+PASS MouseEvent interface: new MouseEvent("foo") must inherit property "pageY" with the proper type 
+PASS MouseEvent interface: new MouseEvent("foo") must inherit property "clientX" with the proper type 
+PASS MouseEvent interface: new MouseEvent("foo") must inherit property "clientY" with the proper type 
+PASS MouseEvent interface: new MouseEvent("foo") must inherit property "x" with the proper type 
+PASS MouseEvent interface: new MouseEvent("foo") must inherit property "y" with the proper type 
+PASS MouseEvent interface: new MouseEvent("foo") must inherit property "offsetX" with the proper type 
+PASS MouseEvent interface: new MouseEvent("foo") must inherit property "offsetY" with the proper type 
 PASS HTMLElement interface: attribute offsetParent 
 PASS HTMLElement interface: attribute offsetTop 
 PASS HTMLElement interface: attribute offsetLeft 
@@ -1,11 +1,11 @@
 <!doctype html>
 <meta charset=utf-8>
-<!--  WARNING: These tests are preliminary and probably partly incorrect.   -->
+<!-- WARNING: These tests are preliminary and probably partly incorrect.  -->
 <title>CSSOM View automated IDL tests</title>
 <link rel="author" title="Ms2ger" href="mailto:Ms2ger@gmail.com">
 <link rel="help" href="https://drafts.csswg.org/cssom-view-1/#idl-index">
-<script src=../../../../../resources/testharness.js></script>
-<script src=../../../../../resources/testharnessreport.js></script>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
 <script src=/resources/WebIDLParser.js></script>
 <script src=/resources/idlharness.js></script>
 
@@ -34,7 +34,7 @@ idl_test(
       HTMLElement: ['document.createElement("div")'],
       HTMLImageElement: ['document.createElement("img")'],
       Range: ['new Range()'],
-      // MouseEvent: ['new MouseEvent("foo")'],
+      MouseEvent: ['new MouseEvent("foo")'],
       Text: ['document.createTextNode("x")'],
       // CSSPseudoElement: [],
     });
index 2abbda8..8c381e7 100644 (file)
@@ -6,8 +6,8 @@
 <link rel="help" href="https://drafts.csswg.org/cssom-view/#property-index">
 <meta name="assert" content="Properties inherit or not according to the spec.">
 <meta name="assert" content="Properties have initial values according to the spec.">
-<script src="../../../../../resources/testharness.js"></script>
-<script src="../../../../../resources/testharnessreport.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <script src="/css/support/inheritance-testcommon.js"></script>
 </head>
 <body>
index 8c598e1..08fcb3c 100644 (file)
@@ -3,8 +3,8 @@
 <link rel="help" href="https://drafts.csswg.org/cssom-view/#dom-window-matchmedia">
 <link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
 <link rel="author" title="Mozilla" href="https://mozilla.org">
-<script src="../../../../../resources/testharness.js"></script>
-<script src="../../../../../resources/testharnessreport.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <script>
   function frameLoaded(frame) {
     test(function() {
index 1fd6c0a..67efcea 100644 (file)
@@ -1,25 +1,12 @@
 
-FAIL window.matchMedia exists assert_inherits: property "matchMedia" found on object expected in prototype chain
-PASS window.matchMedia is a Function 
-FAIL window.matchMedia("all") Can't find variable: MediaQueryList
-PASS MediaQueryList.media exists 
-PASS MediaQueryList.media is readonly 
-PASS MediaQueryList.media for "all" 
-PASS MediaQueryList.matches exists 
-PASS MediaQueryList.matches is readonly 
-PASS MediaQueryList.matches for "all" 
-PASS MediaQueryList.addListener exists 
-PASS MediaQueryList.addListener is a Function 
-PASS MediaQueryList.removeListener exists 
-PASS MediaQueryList.removeListener is a Function 
-FAIL MediaQueryList.media syntax error Can't find variable: MediaQueryList
-PASS MediaQueryList.matches for "not all" 
-PASS MediaQueryList.matches for "(max-width: 199px), all and (min-width: 200px)" 
-PASS MediaQueryList.matches for "(min-aspect-ratio: 1/1)" 
-PASS MediaQueryList.matches for "(width: 200px)" 
-PASS MediaQueryList.matches for "(max-height: 50px)" 
-PASS MediaQueryList.matches for "(min-width: 150px)" 
-PASS Resize iframe from 200x100 to 200x50, then to 100x50 
-PASS Listeners are called in the order which they have been added 
-PASS Listener added twice is only called once. 
+PASS window.matchMedia is a function 
+PASS window.matchMedia("all") matches 
+PASS window.matchMedia("") matches 
+PASS window.matchMedia("(min-width: 1px)") matches 
+FAIL media query with syntax error is serialized as "not all" Can't find variable: MediaQueryList
+PASS iframe.matchMedia("(max-width: 199px), all and (min-width: 200px)") is serialized w/o "all" 
+PASS iframe.matchMedia("(min-aspect-ratio: 1/1)") matches 
+PASS iframe.matchMedia("(width: 200px)") matches 
+PASS iframe.matchMedia("(max-height: 50px)") matches 
+PASS iframe.matchMedia("(min-width: 150px)") matches 
 
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/matchMedia.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/matchMedia.html
new file mode 100644 (file)
index 0000000..0a94c98
--- /dev/null
@@ -0,0 +1,79 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<meta name="flags" content="dom">
+<title>CSS Test: CSSOM View matchMedia and MediaQueryList</title>
+<link rel="author" title="Rune Lillesveen" href="mailto:rune@opera.com">
+<link rel="help" href="https://www.w3.org/TR/cssom-view-1/#dom-window-matchmedia">
+<link rel="help" href="https://www.w3.org/TR/cssom-view-1/#the-mediaquerylist-interface">
+<link rel="help" href="https://www.w3.org/TR/cssom-1/#serializing-media-queries">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="resources/matchMedia.js"></script>
+<div id="log"></div>
+<script>
+"use strict";
+
+test(() => {
+    assert_equals(
+        typeof window.matchMedia,
+        "function",
+        "FATAL ERROR: The window.matchMedia function is not present. The rest of the testsuite will fail to run."
+    );
+}, "window.matchMedia is a function");
+
+test(() => {
+    const mql = window.matchMedia("all");
+    assert_equals(mql.media, "all");
+    assert_true(mql.matches);
+}, 'window.matchMedia("all") matches');
+
+test(() => {
+    const mql = window.matchMedia("");
+    assert_equals(mql.media, "");
+    assert_true(mql.matches);
+}, 'window.matchMedia("") matches');
+
+test(() => {
+    const mql = window.matchMedia("(min-width: 1px)");
+    assert_equals(mql.media, "(min-width: 1px)");
+    assert_true(mql.matches);
+}, 'window.matchMedia("(min-width: 1px)") matches');
+
+test(() => {
+    const mql = window.matchMedia("::");
+    assert_true(mql instanceof MediaQueryList);
+    assert_equals(mql.media, "not all");
+    assert_false(mql.matches);
+}, 'media query with syntax error is serialized as "not all"');
+
+promise_test(async t => {
+    const iframe = await createIFrame(t, 200);
+    const mql = iframe.contentWindow.matchMedia("(max-width: 199px), all and (min-width: 200px)");
+    assert_equals(mql.media, "(max-width: 199px), (min-width: 200px)");
+    assert_true(mql.matches);
+}, 'iframe.matchMedia("(max-width: 199px), all and (min-width: 200px)") is serialized w/o "all"');
+
+promise_test(async t => {
+    const iframe = await createIFrame(t);
+    const mql = iframe.contentWindow.matchMedia("(min-aspect-ratio: 1/1)");
+    assert_true(mql.matches);
+}, 'iframe.matchMedia("(min-aspect-ratio: 1/1)") matches');
+
+promise_test(async t => {
+    const iframe = await createIFrame(t, 200);
+    const mql = iframe.contentWindow.matchMedia("(width: 200px)");
+    assert_true(mql.matches);
+}, 'iframe.matchMedia("(width: 200px)") matches');
+
+promise_test(async t => {
+    const iframe = await createIFrame(t, 200, 100);
+    const mql = iframe.contentWindow.matchMedia("(max-height: 50px)");
+    assert_false(mql.matches);
+}, 'iframe.matchMedia("(max-height: 50px)") matches');
+
+promise_test(async t => {
+    const iframe = await createIFrame(t, 200, 100);
+    const mql = iframe.contentWindow.matchMedia("(min-width: 150px)");
+    assert_true(mql.matches);
+}, 'iframe.matchMedia("(min-width: 150px)") matches');
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/matchMedia.xht b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/matchMedia.xht
deleted file mode 100644 (file)
index 1dfde7f..0000000
+++ /dev/null
@@ -1,188 +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>CSS Test: CSSOM View matchMedia and MediaQueryList</title>
-        <meta name="timeout" content="long"/>
-        <link rel="author" title="Rune Lillesveen" href="mailto:rune@opera.com" />
-        <link rel="help" href="http://www.w3.org/TR/cssom-view/#dom-window-matchmedia" />
-        <link rel="help" href="http://www.w3.org/TR/cssom-view/#the-mediaquerylist-interface" />
-        <link rel="help" href="http://www.w3.org/TR/cssom-1/#serializing-media-queries" />
-        <meta name="flags" content="dom" />
-        <script src="../../../../../resources/testharness.js" type="text/javascript" />
-        <script src="../../../../../resources/testharnessreport.js" type="text/javascript" />
-        <style type="text/css"><![CDATA[
-            iframe { border: none; }
-        ]]></style>
-    </head>
-    <body>
-        <noscript>Test not run - javascript required.</noscript>
-        <div id="log" />
-        <iframe width="200" height="100" />
-        <script type="text/javascript"><![CDATA[
-            function reflow(doc) {
-                doc.body.offsetWidth;
-            }
-
-            var iframe = document.querySelector("iframe");
-            var iframe_window = window.frames[0];
-
-            reflow(iframe_window.document);
-
-            test(function(){
-                assert_inherits(window, "matchMedia");
-            }, "window.matchMedia exists");
-
-            test(function(){
-                assert_true(window.matchMedia instanceof Function, "FATAL ERROR: The window.matchMedia function is not present. The rest of the testsuite will fail to run.");
-            }, "window.matchMedia is a Function");
-
-            var mql, mql1, mql2, mql3;
-
-            test(function(){
-                mql = window.matchMedia("all");
-                assert_true(mql instanceof MediaQueryList, "matchMedia(\"all\") returned MediaQueryList object.");
-            }, "window.matchMedia(\"all\")");
-
-            test(function(){
-                assert_idl_attribute(mql, "media", "Check that MediaQueryList.media exists.");
-            }, "MediaQueryList.media exists");
-
-            test(function(){
-                assert_readonly(mql, "media", "Check that MediaQueryList.media is readonly.");
-            }, "MediaQueryList.media is readonly");
-
-            test(function(){
-                assert_equals(mql.media, "all");
-            }, "MediaQueryList.media for \"all\"");
-
-            test(function(){
-                assert_idl_attribute(mql, "matches", "Check that MediaQueryList.matches exists.");
-            }, "MediaQueryList.matches exists");
-
-            test(function(){
-                assert_readonly(mql, "matches", "Check that MediaQueryList.matches is readonly.");
-            }, "MediaQueryList.matches is readonly");
-
-            test(function(){
-                assert_true(mql.matches);
-            }, "MediaQueryList.matches for \"all\"");
-
-            test(function(){
-                assert_inherits(mql, "addListener");
-            }, "MediaQueryList.addListener exists");
-
-            test(function(){
-                assert_true(mql.addListener instanceof Function);
-            }, "MediaQueryList.addListener is a Function");
-
-            test(function(){
-                assert_inherits(mql, "removeListener");
-            }, "MediaQueryList.removeListener exists");
-
-            test(function(){
-                assert_true(mql.removeListener instanceof Function);
-            }, "MediaQueryList.removeListener is a Function");
-
-            test(function(){
-                mql = window.matchMedia("::");
-                assert_true(mql instanceof MediaQueryList, "window.matchMedia(\"::\") returned MediaQueryList object.");
-                assert_equals(mql.media, "not all", "MediaQueryList.media serialized as \"not all\" from original string with syntax error.");
-            }, "MediaQueryList.media syntax error");
-
-            test(function(){
-                assert_false(mql.matches);
-            }, "MediaQueryList.matches for \"not all\"");
-
-            test(function(){
-                mql = iframe_window.matchMedia("(max-width: 199px), all and (min-width: 200px)");
-                assert_equals(mql.media, "(max-width: 199px), (min-width: 200px)");
-                assert_true(mql.matches);
-            }, "MediaQueryList.matches for \"(max-width: 199px), all and (min-width: 200px)\"")
-
-            test(function(){
-                mql = iframe_window.matchMedia("(min-aspect-ratio: 1/1)");
-                assert_true(mql.matches);
-            }, "MediaQueryList.matches for \"(min-aspect-ratio: 1/1)\"");
-
-            test(function(){
-                mql = iframe_window.matchMedia("(width: 200px)");
-                assert_true(mql.matches);
-            }, "MediaQueryList.matches for \"(width: 200px)\"");
-
-            test(function(){
-                mql1 = iframe_window.matchMedia("(max-height: 50px)");
-                assert_false(mql1.matches);
-            }, "MediaQueryList.matches for \"(max-height: 50px)\"");
-
-            test(function(){
-                mql2 = iframe_window.matchMedia("(min-width: 150px)");
-                assert_true(mql2.matches);
-            }, "MediaQueryList.matches for \"(min-width: 150px)\"");
-
-            var resizeTest = async_test("Resize iframe from 200x100 to 200x50, then to 100x50");
-            var listenerOrderTest = async_test("Listeners are called in the order which they have been added");
-            var duplicateListenerTest = async_test("Listener added twice is only called once.");
-
-            window.onload = function(){
-
-                var rmListener = function(x){
-                    resizeTest.step(function(){
-                        assert_unreached("removeListener was not successful.");
-                    });
-                };
-
-                var dupListener = function(x){
-                    duplicateListenerTest.step(function(){
-                        assert_false(mql1.dupListenerCalled, "Check that this listener has not been called before.");
-                        mql1.dupListenerCalled = true;
-                    });
-                };
-
-                mql1.firstListenerCalled = false;
-                mql1.dupListenerCalled = false;
-                // Add listener twice and remove it below. Should not be called.
-                mql1.addListener(rmListener);
-                mql1.addListener(rmListener);
-                // Add listener twice. Should only be called once.
-                mql1.addListener(dupListener);
-                mql1.addListener(dupListener);
-
-                mql1.addListener(function(x){
-                    resizeTest.step(function(){
-                        assert_equals(x, mql1, "Check that the MediaQueryList passed to the handler is the same that addListener was invoked on.");
-                        assert_true(x.matches, "(max-height: 50px) should now pass.");
-                        assert_true(mql2.matches, "(min-width: 150px) should still pass.");
-                        iframe.width = "100";
-                    });
-
-                    listenerOrderTest.step(function(){
-                        assert_false(mql1.firstListenerCalled, "Check that this listener is only called once.");
-                        mql1.firstListenerCalled = true;
-                    });
-                });
-
-                mql1.addListener(function(x){
-                    listenerOrderTest.step(function(){
-                        assert_true(mql1.firstListenerCalled, "Check that the listener added last is called last.");
-                    });
-                    listenerOrderTest.done();
-                });
-
-                mql1.removeListener(rmListener);
-
-                mql2.addListener(function(x){
-                    duplicateListenerTest.done();
-                    resizeTest.step(function(){
-                        assert_equals(x, mql2, "Check that the MediaQueryList passed to the handler is the same that addListener was invoked on.");
-                        assert_true(mql1.matches, "(max-height: 50px) should still pass.");
-                        assert_false(x.matches, "(min-width: 150px) should now fail.");
-                    });
-                    resizeTest.done();
-                });
-
-                iframe.height = "50";
-            };]]>
-        </script>
-    </body>
-</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/matchMediaAddListener-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/matchMediaAddListener-expected.txt
deleted file mode 100644 (file)
index f27a3d0..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-
-PASS Check for the correct number of event triggers 
-
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/matchMediaAddListener.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/matchMediaAddListener.html
deleted file mode 100644 (file)
index f794e6e..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-<!DOCTYPE html>
-<html>
-    <head>
-        <title>CSS Test: CSSOM View matchMedia addListener</title>
-        <link rel="author" title="Chris Wu" href="mailto:pwx.frontend@gmail.com" />
-        <link rel="help" href="http://www.w3.org/TR/cssom-view/#the-mediaquerylist-interface" />
-        <meta name="flags" content="dom" />
-        <script src="../../../../../resources/testharness.js" type="text/javascript"></script>
-        <script src="../../../../../resources/testharnessreport.js" type="text/javascript"></script>
-        <style type="text/css">
-            iframe { border: none; }
-        </style>
-    </head>
-    <body>
-        <div id="log"></div>
-        <iframe width="200" height="100" id="iframe1"></iframe>
-        <script>
-            function reflow(doc) {
-                doc.body.offsetWidth;
-            }
-
-            var iframe = document.querySelector("iframe");
-            var iframe_window = window.frames[0];
-            var iframe1 = document.getElementById("iframe1");
-            reflow(iframe_window.document);
-
-            var i = 0;
-            var totalCount = 10;
-            var count = 0;
-            var divineCount = 10;
-            var width_list = [201,199];
-            var mq1 = iframe_window.matchMedia("(max-width:200px)");
-            mq1.addListener(function(mql){
-
-                count = count + 1;
-
-            });
-
-            var equalAssert = async_test("Check for the correct number of event triggers");
-
-            var changeFrameWidth = function(iWidth) {
-                iframe1.style.width = iWidth + "px";
-                i = (i === 0) ? 1 : 0;
-                totalCount = totalCount - 1;
-                if(totalCount > 0)
-                {
-                    step_timeout(function(){
-                        changeFrameWidth(width_list[i]);
-                    }, 100);
-                }
-                else
-                {
-                    step_timeout(function(){
-                        equalAssert.step(function(){
-                            assert_equals(divineCount, count, "this will be 10 times of event triggers by change width");
-                        });
-                        equalAssert.done();
-                    }, 100);
-                }
-            };
-
-            changeFrameWidth(width_list[0]);
-        </script>
-    </body>
-</html>
index 0f43300..eabfe42 100644 (file)
@@ -1,3 +1,6 @@
+Hello
 
 PASS MouseEvent's x and y must be equal to clientX and clientY. 
+FAIL MouseEvent's pageX and pageY attributes should be the sum of the scroll offset and clientX/clientY assert_equals: expected 5020 but got 20
+PASS MouseEvent's offsetX/offsetY attributes should be the same value as its pageX/pageY attributes. 
 
index 4d4b912..d509597 100644 (file)
@@ -2,8 +2,11 @@
 <meta charset=utf-8>
 <head>
 <title>CSSOM MouseEvent tests</title>
-<script src=../../../../../resources/testharness.js></script>
-<script src=../../../../../resources/testharnessreport.js></script>
+<div style="background:lightblue; height:10000px">
+  Hello
+</div>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
 <script>
 test(function () {
     var mouseEvent = new MouseEvent('mousedown', {clientX: 10, clientY: 20});
@@ -13,5 +16,27 @@ test(function () {
     assert_equals(mouseEvent.x, 30);
     assert_equals(mouseEvent.y, 40);
 }, 'MouseEvent\'s x and y must be equal to clientX and clientY.');
+
+test(function () {
+    var mouseEvent1 = new MouseEvent('mousedown', {clientX: 10, clientY: 20});
+    assert_equals(mouseEvent1.pageX, 10);
+    assert_equals(mouseEvent1.pageY, 20);
+    scrollBy(0, 5000);
+    assert_equals(mouseEvent1.pageX, 10);
+    assert_equals(mouseEvent1.pageY, 5020);
+
+    var mouseEvent2 = new MouseEvent('mousedown', {clientX: 10, clientY: 20});
+    assert_equals(mouseEvent2.pageX, 10);
+    assert_equals(mouseEvent2.pageY, 5020);
+}, 'MouseEvent\'s pageX and pageY attributes should be the sum of the scroll offset and clientX/clientY');
+
+test(function () {
+    var mouseEvent = new MouseEvent('mousedown', {clientX: 10, clientY: 20});
+    assert_equals(mouseEvent.offsetX, mouseEvent.pageX);
+    assert_equals(mouseEvent.offsetY, mouseEvent.pageY);
+    scrollBy(0, 5000);
+    assert_equals(mouseEvent.offsetX, mouseEvent.pageX);
+    assert_equals(mouseEvent.offsetY, mouseEvent.pageY);
+}, 'MouseEvent\'s offsetX/offsetY attributes should be the same value as its pageX/pageY attributes.');
 </script>
 </head>
index 2749944..0616e8b 100644 (file)
@@ -1,8 +1,8 @@
 <!DOCTYPE html>
 <meta charset=utf-8>
 <title>cssom-view - elementFromPoint and elementsFromPoint dealing with negative margins</title>
-<script src="../../../../../resources/testharness.js"></script>
-<script src="../../../../../resources/testharnessreport.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <body>
 <div id="outer" style="background:yellow">
   <div id="inner" style="width:100px; height:100px; margin-bottom:-100px; background:lime;"></div>
index 1090ffb..c88b616 100644 (file)
@@ -6,8 +6,8 @@
 <link rel="author" title="neo_and_rayi" href="mailto:1988wangxiao@gmail.com">
 <link rel="help" href="http://www.w3.org/TR/cssom-view/#extensions-to-the-htmlelement-interface">
 <link rel="help" href="http://www.w3.org/TR/cssom-view/#dom-htmlelement-offsetparent">
-<script src="../../../../../resources/testharness.js"></script>
-<script src="../../../../../resources/testharnessreport.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <style>
 #fixed {
     position: fixed;
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/offsetTopLeft-border-box-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/offsetTopLeft-border-box-expected.txt
new file mode 100644 (file)
index 0000000..2c5952c
--- /dev/null
@@ -0,0 +1,64 @@
+x
+x
+x
+x
+x  x  
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+
+PASS container: 0 
+PASS container: 1 
+PASS container: 2 
+PASS container: 3 
+PASS container: 4 
+PASS container: 5 
+PASS container: 6 
+PASS container: 7 
+PASS container: 8 
+PASS container: 9 
+PASS container: 10 
+PASS container: 11 
+PASS container: 12 
+PASS container: 13 
+PASS container: 14 
+PASS container: 15 
+PASS container: 16 
+PASS container: 17 
+PASS container: 18 
+PASS container: 19 
+PASS container: 20 
+PASS container: 21 
+PASS container: 22 
+PASS container: 23 
+PASS container: 24 
+PASS container: 25 
+PASS container: 26 
+PASS container: 27 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/offsetTopLeft-border-box.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/offsetTopLeft-border-box.html
new file mode 100644 (file)
index 0000000..8cabf64
--- /dev/null
@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<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>
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+<style>
+
+.container {
+  position: relative;
+  font: 20px/1 Ahem;
+  width: 150px;
+  height: 100px;
+  padding: 2px 10px;
+  border-width: 3px 6px;
+  border-style: solid;
+  box-sizing: border-box;
+}
+
+.target { background: grey; }
+.hl { writing-mode:horizontal-tb; }
+.vlr { writing-mode:vertical-lr; }
+</style>
+<div id=tests>
+<div class="container hl">
+  <span class="target">x</span>
+</div>
+<div class="container vlr">
+  <span class="target">x</span>
+</div>
+<div class="container hl">
+  <div class="target">x</div>
+</div>
+<div class="container vlr">
+  <div class="target">x</div>
+</div>
+</div>
+<script>
+setup({explicit_done: true});
+onload = () => {
+  // Clone the above tests for the following 'display' types:
+  let display = ['inline-block', 'grid', 'inline-grid', 'flex', 'inline-flex', 'flow-root' ];
+  let tests = document.querySelector('#tests');
+  display.forEach((display) => {
+    let t = tests.cloneNode(true);
+    [...t.children].forEach((child) => {
+      child.setAttribute("style", "display:"+display);
+    });
+    document.body.appendChild(t);
+  });
+  // Check that all of them return an offset relative the padding edge.
+  var i = 0;
+  document.querySelectorAll('.target').forEach((target) => {
+    test(() => {
+      assert_equals(target.offsetLeft, 10, 'offsetLeft');
+      assert_equals(target.offsetTop, 2, 'offsetTop');
+    }, 'container: ' + i);
+    i++;
+  });
+  done();
+};
+</script>
index f60e7d9..85abbb7 100644 (file)
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <link rel="help" href="https://drafts.csswg.org/cssom-view-1/#extensions-to-the-htmlelement-interface">
-<script src=../../../../../resources/testharness.js></script>
-<script src=../../../../../resources/testharnessreport.js></script>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
 <style>
   .container {
     position: relative;
index b3954ef..d553cb1 100644 (file)
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <link rel="help" href="https://drafts.csswg.org/cssom-view-1/#extensions-to-the-htmlelement-interface">
-<script src=../../../../../resources/testharness.js></script>
-<script src=../../../../../resources/testharnessreport.js></script>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
 <style>
   .container {
     position: relative;
index f3c2c06..a121cdf 100644 (file)
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <link rel="help" href="https://drafts.csswg.org/cssom-view-1/#extensions-to-the-htmlelement-interface">
-<script src=../../../../../resources/testharness.js></script>
-<script src=../../../../../resources/testharnessreport.js></script>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
 <style>
   .container {
     position: relative;
index ebec51c..3e50b78 100644 (file)
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <link rel="help" href="https://drafts.csswg.org/cssom-view-1/#extensions-to-the-htmlelement-interface">
-<script src=../../../../../resources/testharness.js></script>
-<script src=../../../../../resources/testharnessreport.js></script>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
 <style>
   .container {
     position: relative;
index f38c2b1..8f44337 100644 (file)
@@ -1,8 +1,8 @@
 <!doctype html>
 <meta charset=utf-8>
 <title></title>
-<script src=../../../../../resources/testharness.js></script>
-<script src=../../../../../resources/testharnessreport.js></script>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
 <div id=log></div>
 <div id="parent" style="overflow:scroll; height: 100px; position: relative">
   <div id="spacer" style="height: 200px"></div>
index 6ed8ccc..3b062c7 100644 (file)
@@ -5,8 +5,8 @@
 <link rel="author" title="violet" href="mailto:violet.bugreport@gmail.com">
 <link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
 <link rel="author" title="Mozilla" href="https://mozilla.org">
-<script src="../../../../../resources/testharness.js"></script>
-<script src="../../../../../resources/testharnessreport.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <style>
 #u {
   padding: 30px;
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/parsing/scroll-behavior-computed-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/parsing/scroll-behavior-computed-expected.txt
new file mode 100644 (file)
index 0000000..a225224
--- /dev/null
@@ -0,0 +1,4 @@
+
+FAIL Property scroll-behavior value 'auto' computes to 'auto' assert_true: scroll-behavior doesn't seem to be supported in the computed style expected true got false
+FAIL Property scroll-behavior value 'smooth' computes to 'smooth' assert_true: scroll-behavior doesn't seem to be supported in the computed style expected true got false
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/parsing/scroll-behavior-computed.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/parsing/scroll-behavior-computed.html
new file mode 100644 (file)
index 0000000..ffea289
--- /dev/null
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSSOM View: getComputedStyle().scrollBehavior</title>
+<link rel="help" href="https://drafts.csswg.org/cssom-view/#propdef-scroll-behavior">
+<meta name="assert" content="scroll-behavior computed value is as specified.">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/css/support/computed-testcommon.js"></script>
+</head>
+<body>
+<div id="target"></div>
+<script>
+test_computed_value("scroll-behavior", 'auto');
+test_computed_value("scroll-behavior", 'smooth');
+</script>
+</body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/parsing/scroll-behavior-invalid-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/parsing/scroll-behavior-invalid-expected.txt
new file mode 100644 (file)
index 0000000..df1475a
--- /dev/null
@@ -0,0 +1,5 @@
+
+PASS e.style['scroll-behavior'] = "normal" should not set the property value 
+PASS e.style['scroll-behavior'] = "auto smooth" should not set the property value 
+PASS e.style['scroll-behavior'] = "auto, smooth" should not set the property value 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/parsing/scroll-behavior-invalid.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/parsing/scroll-behavior-invalid.html
new file mode 100644 (file)
index 0000000..6dfe36e
--- /dev/null
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSSOM View: parsing scroll-behavior with invalid values</title>
+<link rel="help" href="https://drafts.csswg.org/cssom-view/#propdef-scroll-behavior">
+<meta name="assert" content="scroll-behavior supports only the grammar 'auto | smooth'.">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/css/support/parsing-testcommon.js"></script>
+</head>
+<body>
+<script>
+test_invalid_value("scroll-behavior", 'normal');
+test_invalid_value("scroll-behavior", 'auto smooth');
+test_invalid_value("scroll-behavior", 'auto, smooth');
+</script>
+</body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/parsing/scroll-behavior-valid-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/parsing/scroll-behavior-valid-expected.txt
new file mode 100644 (file)
index 0000000..80fdd2c
--- /dev/null
@@ -0,0 +1,4 @@
+
+FAIL e.style['scroll-behavior'] = "auto" should set the property value assert_not_equals: property should be set got disallowed value ""
+FAIL e.style['scroll-behavior'] = "smooth" should set the property value assert_not_equals: property should be set got disallowed value ""
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/parsing/scroll-behavior-valid.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/parsing/scroll-behavior-valid.html
new file mode 100644 (file)
index 0000000..6e708b9
--- /dev/null
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSSOM View: parsing scroll-behavior with valid values</title>
+<link rel="help" href="https://drafts.csswg.org/cssom-view/#propdef-scroll-behavior">
+<meta name="assert" content="scroll-behavior supports the full grammar 'auto | smooth'.">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/css/support/parsing-testcommon.js"></script>
+</head>
+<body>
+<script>
+test_valid_value("scroll-behavior", 'auto');
+test_valid_value("scroll-behavior", 'smooth');
+</script>
+</body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/parsing/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/parsing/w3c-import.log
new file mode 100644 (file)
index 0000000..810bffe
--- /dev/null
@@ -0,0 +1,19 @@
+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/web-platform-tests/wpt
+
+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
+
+Do NOT modify or remove this file.
+
+------------------------------------------------------------------------
+Properties requiring vendor prefixes:
+None
+Property values requiring vendor prefixes:
+None
+------------------------------------------------------------------------
+List of files:
+/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/parsing/scroll-behavior-computed.html
+/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/parsing/scroll-behavior-invalid.html
+/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/parsing/scroll-behavior-valid.html
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/position-sticky-root-scroller-with-scroll-behavior-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/position-sticky-root-scroller-with-scroll-behavior-expected.txt
new file mode 100644 (file)
index 0000000..79acd02
--- /dev/null
@@ -0,0 +1,3 @@
+
+PASS Sticky elements work with the root (document) scroller 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/position-sticky-root-scroller-with-scroll-behavior.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/position-sticky-root-scroller-with-scroll-behavior.html
new file mode 100644 (file)
index 0000000..ec1f6e2
--- /dev/null
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>position:sticky should operate correctly for the root scroller</title>
+<link rel="help" href="https://drafts.csswg.org/css-position-3/#valdef-position-sticky">
+<link rel="help" href="https://drafts.csswg.org/cssom-view/#propdef-scroll-behavior">
+<meta name="assert" content="This test checks that position:sticky elements work when using the root (document) scroller which has `scroll-behavior` property" />
+
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="support/scroll-behavior.js"></script>
+
+<style>
+html {
+  scroll-behavior: smooth;
+}
+
+body {
+  /* Assumption: 3000px is taller than any user agents test window size. */
+  height: 3000px;
+  /* A property which propagates for <html>. */
+  overflow-x: hidden;
+}
+
+#sticky {
+  position: sticky;
+  top: 50px;
+  width: 200px;
+  height: 200px;
+  background-color: green;
+}
+</style>
+
+<div id="sticky"></div>
+
+<script>
+promise_test(async () => {
+  window.scrollTo(0, 700);
+
+  await waitForScrollEnd(document.scrollingElement);
+
+  assert_equals(sticky.offsetTop, 700 + 50);
+}, 'Sticky elements work with the root (document) scroller');
+</script>
index 7638536..dc2f04b 100644 (file)
@@ -2,8 +2,8 @@
 <meta charset=utf-8>
 <meta name="viewport" content="width=device-width">
 <link rel="help" href="https://drafts.csswg.org/cssom-view/#run-the-resize-steps"/>
-<script src=../../../../../resources/testharness.js></script>
-<script src=../../../../../resources/testharnessreport.js></script>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
 <script>
 promise_test(async t => {
   let gotResizeEvent = false;
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/resources/matchMedia.js b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/resources/matchMedia.js
new file mode 100644 (file)
index 0000000..f8947e0
--- /dev/null
@@ -0,0 +1,60 @@
+"use strict";
+
+{
+// private variables are defined with `const` so they don't leak outside this block statement
+const IFRAME_DEFAULT_SIZE = "200";
+const iframes = new WeakMap();
+
+// helpers are defined with `var` so they are globally accessible
+var createMQL = async t => {
+    const iframe = await createIFrame(t);
+    const mql = iframe.contentWindow.matchMedia(`(max-width: ${IFRAME_DEFAULT_SIZE}px)`);
+    assert_true(mql.matches, "MQL should match on newly created <iframe>");
+    iframes.set(mql, iframe);
+    return mql;
+};
+
+var createIFrame = (t, width = IFRAME_DEFAULT_SIZE, height = width) => {
+    assert_not_equals(document.body, null, "<body> element is missing");
+
+    const iframe = document.createElement("iframe");
+    iframe.srcdoc = "";
+    iframe.width = String(width);
+    iframe.height = String(height);
+    iframe.style.border = "none";
+
+    t.add_cleanup(() => {
+        document.body.removeChild(iframe);
+    });
+
+    return new Promise(resolve => {
+        iframe.addEventListener("load", () => {
+            iframe.contentDocument.body.offsetWidth; // reflow
+            resolve(iframe);
+        });
+
+        document.body.appendChild(iframe);
+    });
+};
+
+var triggerMQLEvent = mql => {
+    const iframe = iframes.get(mql);
+    assert_not_equals(iframe, undefined, "Passed MQL instance was not created with createMQL");
+    iframe.width = iframe.width === IFRAME_DEFAULT_SIZE ? "250" : IFRAME_DEFAULT_SIZE;
+};
+
+var getWindow = mql => {
+    const iframe = iframes.get(mql);
+    assert_not_equals(iframe, undefined, "Passed MQL instance was not created with createMQL");
+    return iframe.contentWindow;
+};
+
+var waitForChangesReported = () => {
+    return new Promise(resolve => {
+        requestAnimationFrame(() => {
+            requestAnimationFrame(resolve);
+        });
+    });
+};
+
+}
index f1c0633..23ad14d 100644 (file)
@@ -17,3 +17,4 @@ List of files:
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/resources/elementsFromPoint.js
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/resources/iframe1.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/resources/iframe2.html
+/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/resources/matchMedia.js
index b87fde8..58d8688 100644 (file)
@@ -1,8 +1,8 @@
 <!DOCTYPE html>
 <link rel="help" href="https://drafts.csswg.org/cssom-view/#dom-window-screenleft">
 <link rel="help" href="https://drafts.csswg.org/cssom-view/#dom-window-screentop">
-<script src="../../../../../resources/testharness.js"></script>
-<script src="../../../../../resources/testharnessreport.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <script>
 test(() => {
   assert_equals(typeof window.screenLeft, "number", "screenLeft type");
index 6925cf0..8606b1f 100644 (file)
@@ -4,8 +4,8 @@
 <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="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <script src="support/scroll-behavior.js"></script>
 <style>
   .scrollable {
index 2b9129c..85c489c 100644 (file)
@@ -31,6 +31,10 @@ FAIL Element with smooth scroll-behavior ; scrollIntoView() with default behavio
 FAIL Element with smooth scroll-behavior ; scrollIntoView() with auto behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
 PASS Element with smooth scroll-behavior ; scrollIntoView() with instant behavior 
 FAIL Element with smooth scroll-behavior ; scrollIntoView() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
+PASS Set scrollLeft to element with auto scroll-behavior 
+FAIL Set scrollLeft to element with smooth scroll-behavior assert_less_than: Shouldn't set scroll attribute immediately expected a number less than 500 but got 500
+PASS Set scrollTop to element with auto scroll-behavior 
+FAIL Set scrollTop to element with smooth scroll-behavior assert_less_than: Shouldn't set scroll attribute immediately expected a number less than 250 but got 250
 PASS Aborting an ongoing smooth scrolling on an element with another smooth scrolling 
 PASS Aborting an ongoing smooth scrolling on an element with an instant scrolling 
 
index 3cbd722..c598d97 100644 (file)
@@ -4,8 +4,8 @@
 <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="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <script src="support/scroll-behavior.js"></script>
 <style>
   .scrollable {
    }, `Element with smooth scroll-behavior ; ${scrollFunction}() with smooth behavior`);
   });
 
+  [{scrollAttribute: "scrollLeft", scrollValue: elementToRevealLeft}, {scrollAttribute: "scrollTop", scrollValue: elementToRevealTop}].forEach((attributeTest) => {
+    promise_test(() => {
+      resetScroll(scrollingElement);
+      setScrollBehavior(styledElement, "autoBehavior");
+      assert_equals(scrollingElement.scrollLeft, 0);
+      assert_equals(scrollingElement.scrollTop, 0);
+      var expectedValue = Number(attributeTest.scrollValue);
+      scrollingElement[attributeTest.scrollAttribute] = expectedValue;
+      assert_equals( scrollingElement[attributeTest.scrollAttribute], expectedValue, "Should set scroll attribute immediately");
+      return new Promise((resolve) => { resolve(); });
+    }, `Set ${attributeTest.scrollAttribute} to element with auto scroll-behavior`);
+
+    promise_test(() => {
+      resetScroll(scrollingElement);
+      setScrollBehavior(styledElement, "smoothBehavior");
+      assert_equals(scrollingElement.scrollLeft, 0);
+      assert_equals(scrollingElement.scrollTop, 0);
+      var expectedValue = Number(attributeTest.scrollValue);
+      scrollingElement[attributeTest.scrollAttribute] = expectedValue;
+      assert_less_than(scrollingElement[attributeTest.scrollAttribute], expectedValue, "Shouldn't set scroll attribute immediately");
+      return waitForScrollEnd(scrollingElement).then(() => {
+        assert_equals(scrollingElement[attributeTest.scrollAttribute], expectedValue, "Final value of scroll attribute");
+      });
+    }, `Set ${attributeTest.scrollAttribute} to element with smooth scroll-behavior`);
+  });
+
   promise_test(() => {
     resetScroll(scrollingElement);
     setScrollBehavior(styledElement, "smoothBehavior");
index d922258..c3333d5 100644 (file)
@@ -32,6 +32,10 @@ FAIL Main frame with smooth scroll-behavior ; scrollIntoView() with default beha
 FAIL Main frame with smooth scroll-behavior ; scrollIntoView() with auto behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
 PASS Main frame with smooth scroll-behavior ; scrollIntoView() with instant behavior 
 FAIL Main frame with smooth scroll-behavior ; scrollIntoView() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
+PASS Set scrollLeft to frame with auto scroll-behavior 
+FAIL Set scrollLeft to frame with smooth scroll-behavior assert_less_than: Shouldn't set scroll attribute immediately expected a number less than 2430 but got 2430
+PASS Set scrollTop to frame with auto scroll-behavior 
+FAIL Set scrollTop to frame with smooth scroll-behavior assert_less_than: Shouldn't set scroll attribute immediately expected a number less than 2480 but got 2480
 PASS Aborting an ongoing smooth scrolling on the main frame with another smooth scrolling 
 PASS Aborting an ongoing smooth scrolling on the main frame with an instant scrolling 
 
index fcf75aa..8aef869 100644 (file)
@@ -4,8 +4,8 @@
 <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="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <script src="support/scroll-behavior.js"></script>
 <style>
   body {
      }, `Main frame with smooth scroll-behavior ; ${scrollFunction}() with smooth behavior`);
     });
 
+    [{scrollAttribute: "scrollLeft", scrollValue: elementToRevealLeft}, {scrollAttribute: "scrollTop", scrollValue: elementToRevealTop}].forEach((attributeTest) => {
+      promise_test(() => {
+        resetScroll(scrollingElement);
+        setScrollBehavior(styledElement, "autoBehavior");
+        assert_equals(scrollingElement.scrollLeft, 0);
+        assert_equals(scrollingElement.scrollTop, 0);
+        var expectedValue = Number(attributeTest.scrollValue);
+        scrollingElement[attributeTest.scrollAttribute] = expectedValue;
+        assert_equals( scrollingElement[attributeTest.scrollAttribute], expectedValue, "Should set scroll attribute immediately");
+        return new Promise((resolve) => { resolve(); });
+      }, `Set ${attributeTest.scrollAttribute} to frame with auto scroll-behavior`);
+
+      promise_test(() => {
+        resetScroll(scrollingElement);
+        setScrollBehavior(styledElement, "smoothBehavior");
+        assert_equals(scrollingElement.scrollLeft, 0);
+        assert_equals(scrollingElement.scrollTop, 0);
+        var expectedValue = Number(attributeTest.scrollValue);
+        scrollingElement[attributeTest.scrollAttribute] = expectedValue;
+        assert_less_than(scrollingElement[attributeTest.scrollAttribute], expectedValue, "Shouldn't set scroll attribute immediately");
+        return waitForScrollEnd(scrollingElement).then(() => {
+          assert_equals(scrollingElement[attributeTest.scrollAttribute], expectedValue, "Final value of scroll attribute");
+        });
+      }, `Set ${attributeTest.scrollAttribute} to frame with smooth scroll-behavior`);
+    });
+
     promise_test(() => {
       resetScroll(scrollingElement);
       setScrollBehavior(styledElement, "smoothBehavior");
index 8c88ec6..8024d53 100644 (file)
@@ -5,8 +5,8 @@
 <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="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <script src="support/scroll-behavior.js"></script>
 <style>
   body {
index 3a89065..2a97e06 100644 (file)
@@ -4,8 +4,8 @@
 <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="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <script src="support/scroll-behavior.js"></script>
 <style>
   .scrollable {
index 855a6a6..79b8846 100644 (file)
@@ -15,6 +15,10 @@ PASS Scroll positions when performing smooth scrolling from (0, 0) to (500, 250)
 PASS Scroll positions when performing smooth scrolling from (1000, 0) to (500, 250) using scrollIntoView()  
 PASS Scroll positions when performing smooth scrolling from (0, 500) to (500, 250) using scrollIntoView()  
 PASS Scroll positions when performing smooth scrolling from (1000, 500) to (500, 250) using scrollIntoView()  
+PASS Scroll positions when performing smooth scrolling from 0 to 500 by setting scrollLeft  
+PASS Scroll positions when performing smooth scrolling from 1000 to 500 by setting scrollLeft  
+PASS Scroll positions when performing smooth scrolling from 0 to 250 by setting scrollTop  
+PASS Scroll positions when performing smooth scrolling from 500 to 250 by setting scrollTop  
 PASS Scroll positions when aborting a smooth scrolling with another smooth scrolling 
 PASS Scroll positions when aborting a smooth scrolling with an instant scrolling 
 
index 005d2b6..97905bb 100644 (file)
@@ -4,8 +4,8 @@
 <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="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <script src="support/scroll-behavior.js"></script>
 <style>
   .scrollable {
     });
   });
 
+  [{scrollAttribute: "scrollLeft", scrollValue: 500}, {scrollAttribute: "scrollTop", scrollValue: 250}].forEach(function(scrollTest) {
+    var initialPosition = Number(scrollTest.scrollValue) * 2;
+    [0, initialPosition].forEach((initial) => {
+      promise_test(() => {
+        return new Promise(function(resolve, reject) {
+          scrollNode(overflowNode, "scroll", "instant", initial, initial);
+          var oldValue = overflowNode[scrollTest.scrollAttribute];
+          assert_equals(oldValue, initial, `${scrollTest.scrollAttribute} should be at initial position`);
+          var expectedValue = Number(scrollTest.scrollValue);
+          overflowNode[scrollTest.scrollAttribute] = expectedValue;
+          observeScrolling(overflowNode, function(done) {
+            try {
+              var newValue = overflowNode[scrollTest.scrollAttribute];
+              assert_less_than_equal(Math.abs(expectedValue - newValue), Math.abs(expectedValue - oldValue), "Scroll position should move towards the final position");
+              if (done)
+                assert_equals(newValue, expectedValue, `${scrollTest.scrollAttribute} should reach final position`);
+              oldValue = newValue;
+            } catch(e) {
+              reject(e);
+            }
+            if (done)
+              resolve();
+          });
+        });
+      }, `Scroll positions when performing smooth scrolling from ${initial} to ${scrollTest.scrollValue} by setting ${scrollTest.scrollAttribute} `);
+    });
+  });
+
   promise_test(() => {
     return new Promise(function(resolve, reject) {
       resetScroll(overflowNode);
index 394638d..3e15199 100644 (file)
@@ -3,8 +3,8 @@
 <meta name="timeout" content="long">
 <link rel="author" title="Rune Lillesveen" href="mailto:futhark@chromium.org">
 <link rel="help" href="https://drafts.csswg.org/cssom-view/#smooth-scrolling">
-<script src="../../../../../resources/testharness.js"></script>
-<script src="../../../../../resources/testharnessreport.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <style>
   .filler { height: 10000px }
 
index b6fa1c2..88a7362 100644 (file)
@@ -32,6 +32,10 @@ FAIL Subframe with smooth scroll-behavior ; scrollIntoView() with default behavi
 FAIL Subframe with smooth scroll-behavior ; scrollIntoView() with auto behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
 PASS Subframe with smooth scroll-behavior ; scrollIntoView() with instant behavior 
 FAIL Subframe with smooth scroll-behavior ; scrollIntoView() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
+PASS Subframe setting scrollLeft with auto scroll-behavior 
+FAIL Subframe setting scrollLeft with smooth scroll-behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
+PASS Subframe setting scrollTop with auto scroll-behavior 
+FAIL Subframe setting scrollTop with smooth scroll-behavior assert_less_than: Should not set scrollTop immediately expected a number less than 250 but got 250
 PASS Aborting an ongoing smooth scrolling on a subframe with another smooth scrolling 
 PASS Aborting an ongoing smooth scrolling on a subframe with an instant scrolling 
 
index e641e53..050817d 100644 (file)
@@ -4,8 +4,8 @@
 <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="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <script src="support/scroll-behavior.js"></script>
 <div id="log">
 </div>
      }, `Subframe with smooth scroll-behavior ; ${scrollFunction}() with smooth behavior`);
     });
 
+    [{scrollAttribute: "scrollLeft", scrollValue: elementToRevealLeft}, {scrollAttribute: "scrollTop", scrollValue: elementToRevealTop}].forEach((attributeTest) => {
+      promise_test(() => {
+        resetScroll(scrollingElement);
+        setScrollBehavior(styledElement, "autoBehavior");
+        assert_equals(scrollingElement.scrollLeft, 0);
+        assert_equals(scrollingElement.scrollTop, 0);
+        var expectedValue = Number(attributeTest.scrollValue);
+        scrollingElement[attributeTest.scrollAttribute] = expectedValue;
+        assert_equals(scrollingElement[attributeTest.scrollAttribute], expectedValue, `Should set ${attributeTest.scrollAttribute} immediately`);
+        return new Promise((resolve) => { resolve(); });
+      }, `Subframe setting ${attributeTest.scrollAttribute} with auto scroll-behavior`);
+
+      promise_test(() => {
+        resetScroll(scrollingElement);
+        setScrollBehavior(styledElement, "smoothBehavior");
+        assert_equals(scrollingElement.scrollLeft, 0);
+        assert_equals(scrollingElement.scrollTop, 0);
+        var expectedValue = Number(attributeTest.scrollValue);
+        scrollingElement[attributeTest.scrollAttribute] = expectedValue;
+        assert_less_than(scrollingElement[attributeTest.scrollAttribute], expectedValue, `Should not set ${attributeTest.scrollAttribute} immediately`);
+        return waitForScrollEnd(scrollingElement).then(() => {
+          assert_equals(scrollingElement[attributeTest.scrollAttribute], expectedValue, `Final value of ${attributeTest.scrollAttribute}`);
+        });
+     }, `Subframe setting ${attributeTest.scrollAttribute} with smooth scroll-behavior`);
+    });
+
     promise_test(() => {
       resetScroll(scrollingElement);
       setScrollBehavior(styledElement, "smoothBehavior");
       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");
+      });
+    }, "Aborting an ongoing smooth scrolling on a subframe with an instant scrolling");
   }));
 </script>
index d931e00..0a8ed39 100644 (file)
@@ -4,8 +4,8 @@
 <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="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <script src="support/scroll-behavior.js"></script>
 <div id="log">
 </div>
index 061df1b..cc67ce7 100644 (file)
@@ -3,8 +3,8 @@
 <title>cssom-view - Scrolling element with no layout box</title>
 <link rel="help" href="https://drafts.csswg.org/cssom-view/#dom-element-scroll">
 <link rel="help" href="https://drafts.csswg.org/cssom-view/#css-layout-box">
-<script src="../../../../../resources/testharness.js"></script>
-<script src="../../../../../resources/testharnessreport.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 
 <div style="display: none">
   <div id="elem"></div>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-horizontal-partially-visible-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-horizontal-partially-visible-expected.txt
new file mode 100644 (file)
index 0000000..88229d6
--- /dev/null
@@ -0,0 +1,3 @@
+
+FAIL scrollIntoView scrolls partially-visible child in both axes assert_equals: Should have scrolled in the inline direction expected 200 but got 0
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-horizontal-partially-visible.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-horizontal-partially-visible.html
new file mode 100644 (file)
index 0000000..1e8bc50
--- /dev/null
@@ -0,0 +1,47 @@
+<!doctype html>
+<title>CSSOM View - scrollIntoView scrolls partially-visible element in both inline and block directions.</title>
+<meta charset="utf-8">
+<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
+<link rel="author" title="Mozilla" href="https://mozilla.org">
+<link rel="help" href="https://drafts.csswg.org/cssom-view/#dom-element-scrollintoview">
+<link rel="help" href="https://bugs.webkit.org/show_bug.cgi?id=203497">
+<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=916631">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<style>
+  #scroller {
+    width: 200px;
+    height: 200px;
+    padding-top: 200px;
+    padding-left: 200px;
+    background: purple;
+    overflow: hidden;
+  }
+  #child {
+    width: 400px;
+    height: 400px;
+    background: green;
+  }
+</style>
+<div id="scroller">
+  <div id="child"></div>
+</div>
+<script>
+  test(function() {
+    let scroller = document.getElementById("scroller");
+    let child = document.getElementById("child");
+
+    scroller.scrollTop = 0;
+    scroller.scrollLeft = 0;
+
+    assert_equals(scroller.scrollTop, 0, "Precondition");
+    assert_equals(scroller.scrollLeft, 0, "Precondition");
+    assert_not_equals(scroller.scrollTopMax, 0, "Precondition")
+    assert_not_equals(scroller.scrollLeftMax, 0, "Precondition")
+
+    child.scrollIntoView();
+
+    assert_equals(scroller.scrollTop, 200, "Should have scrolled in the block direction");
+    assert_equals(scroller.scrollLeft, 200, "Should have scrolled in the inline direction");
+  }, "scrollIntoView scrolls partially-visible child in both axes");
+</script>
index 8f528cc..3ef9d62 100644 (file)
@@ -4,8 +4,8 @@
 <link rel="author" title="Cathie Chen" href="mailto:cathiechen@igalia.com">
 <link rel="help" href="https://drafts.csswg.org/cssom-view/#dom-element-scrollintoview">
 <link rel="help" href="https://drafts.csswg.org/cssom-view/#scroll-an-element">
-<script src="../../../../../resources/testharness.js"></script>
-<script src="../../../../../resources/testharnessreport.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 
 <style>
 .box {
 <body>
 <div id="scroller">
   <div id="container">
-    <!--   ROW-1   -->
+    <!--  ROW-1  -->
     <div class="row">
       <div class="box"></div>
       <div class="box"></div>
       <div class="box"></div>
     </div>
 
-    <!--   ROW-2   -->
+    <!--  ROW-2  -->
     <div class="row">
       <div class="box"></div>
       <div class="box" id="target"></div>
       <div class="box"></div>
     </div>
 
-    <!--   ROW-3   -->
+    <!--  ROW-3  -->
     <div class="row">
       <div class="box"></div>
       <div class="box"></div>
index 70d19f3..49d5f5d 100644 (file)
@@ -3,8 +3,8 @@
 <meta charset="utf-8">
 <link rel="author" title="Cathie Chen" href="mailto:cathiechen@igalia.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>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 
 <style>
 .box {
 <body>
 <div id="scroller">
   <div id="container">
-    <!--   ROW-1   -->
+    <!--  ROW-1  -->
     <div class="row">
       <div class="box"></div>
       <div class="box"></div>
       <div class="box"></div>
     </div>
 
-    <!--   ROW-2   -->
+    <!--  ROW-2  -->
     <div class="row">
       <div class="box"></div>
       <div class="box" id="target"></div>
       <div class="box"></div>
     </div>
 
-    <!--   ROW-3   -->
+    <!--  ROW-3  -->
     <div class="row">
       <div class="box"></div>
       <div class="box"></div>
index 99854d8..930702a 100644 (file)
@@ -4,8 +4,8 @@
 <link rel="author" title="Sandra Sun" href="mailto:sunyunjia@chromium.org">
 <link rel="help" href="https://drafts.csswg.org/cssom-view/#dom-element-scrollintoview">
 <link rel="help" href="https://drafts.csswg.org/css-scroll-snap-1/#scroll-margin">
-<script src="../../../../../resources/testharness.js"></script>
-<script src="../../../../../resources/testharnessreport.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 
 <style>
 #scroller {
index 947daba..5fdedf7 100644 (file)
@@ -4,8 +4,8 @@
 <link rel="author" title="Sandra Sun" href="mailto:sunyunjia@chromium.org">
 <link rel="help" href="https://drafts.csswg.org/cssom-view/#dom-element-scrollintoview">
 <link rel="help" href="https://drafts.csswg.org/css-scroll-snap-1/#scroll-padding">
-<script src="../../../../../resources/testharness.js"></script>
-<script src="../../../../../resources/testharnessreport.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 
 <style>
 #scroller {
index 3a2821a..eb1bce3 100644 (file)
@@ -1,6 +1,6 @@
 <!DOCTYPE HTML>
-<script src="../../../../../resources/testharness.js"></script>
-<script src="../../../../../resources/testharnessreport.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <title>Check End Position of scrollIntoView of shadow elements</title>
 <div id="container">
   <div id="space1" style="height: 2000px; width: 2000px;background-color: yellow">
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-sideways-lr-writing-mode-and-rtl-direction-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-sideways-lr-writing-mode-and-rtl-direction-expected.txt
new file mode 100644 (file)
index 0000000..bf76182
--- /dev/null
@@ -0,0 +1,11 @@
+
+FAIL scrollIntoView({"block":"start","inline":"start"}) assert_approx_equals: scrollX expected 200 +/- 0.5 but got -200
+FAIL scrollIntoView({"block":"start","inline":"center"}) assert_approx_equals: scrollX expected 200 +/- 0.5 but got -158
+FAIL scrollIntoView({"block":"start","inline":"end"}) assert_approx_equals: scrollX expected 200 +/- 0.5 but got -115
+FAIL scrollIntoView({"block":"center","inline":"start"}) assert_approx_equals: scrollX expected 157.5 +/- 0.5 but got -200
+FAIL scrollIntoView({"block":"center","inline":"center"}) assert_approx_equals: scrollX expected 157.5 +/- 0.5 but got -158
+FAIL scrollIntoView({"block":"center","inline":"end"}) assert_approx_equals: scrollX expected 157.5 +/- 0.5 but got -115
+FAIL scrollIntoView({"block":"end","inline":"start"}) assert_approx_equals: scrollX expected 115 +/- 0.5 but got -200
+FAIL scrollIntoView({"block":"end","inline":"center"}) assert_approx_equals: scrollX expected 115 +/- 0.5 but got -158
+FAIL scrollIntoView({"block":"end","inline":"end"}) assert_approx_equals: scrollX expected 115 +/- 0.5 but got -115
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-sideways-lr-writing-mode-and-rtl-direction.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-sideways-lr-writing-mode-and-rtl-direction.html
new file mode 100644 (file)
index 0000000..8d43540
--- /dev/null
@@ -0,0 +1,106 @@
+<!DOCTYPE html>
+<title>CSSOM View - scrollIntoView considers sideways-lr writing mode and rtl direction</title>
+<meta charset="utf-8">
+<link rel="author" title="Cathie Chen" href="mailto:cathiechen@igalia.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: sideways-lr;
+  direction: rtl;
+  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>
+// In sideways-lr mode and rtl direction, X corresponds to the block axis and is oriented rightward.
+// Y corresponds to the inline axis and is oriented downward.
+// So the beginning edges are the top and left edges and the ending edges are the bottom and right edges.
+
+// This assumes that the horizontal scrollbar is on the bottom side and the vertical scrollbar is on the right side.
+
+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 = {
+  blockStart: box_width,
+  blockCenter: (3*box_width - scroller_width)/2 + scrollbar_width/2,
+  blockEnd: 2*box_width - scroller_width + scrollbar_width,
+};
+
+var expectedY = {
+  inlineStart: box_height,
+  inlineCenter: (3*box_height - scroller_height)/2 + scrollbar_width/2,
+  inlineEnd: 2*box_height - scroller_height + scrollbar_width,
+};
+
+[
+  [{block: "start", inline: "start"}, expectedX.blockStart, expectedY.inlineStart],
+  [{block: "start", inline: "center"}, expectedX.blockStart, expectedY.inlineCenter],
+  [{block: "start", inline: "end"}, expectedX.blockStart, expectedY.inlineEnd],
+  [{block: "center", inline: "start"}, expectedX.blockCenter, expectedY.inlineStart],
+  [{block: "center", inline: "center"}, expectedX.blockCenter, expectedY.inlineCenter],
+  [{block: "center", inline: "end"}, expectedX.blockCenter, expectedY.inlineEnd],
+  [{block: "end", inline: "start"}, expectedX.blockEnd, expectedY.inlineStart],
+  [{block: "end", inline: "center"}, expectedX.blockEnd, expectedY.inlineCenter],
+  [{block: "end", inline: "end"}, expectedX.blockEnd, expectedY.inlineEnd],
+].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(${JSON.stringify(input)})`);
+})
+
+</script>
+
+</body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-sideways-lr-writing-mode-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-sideways-lr-writing-mode-expected.txt
new file mode 100644 (file)
index 0000000..e88840c
--- /dev/null
@@ -0,0 +1,11 @@
+
+FAIL scrollIntoView({"block":"start","inline":"start"}) assert_approx_equals: scrollY expected -200 +/- 0.5 but got 200
+FAIL scrollIntoView({"block":"start","inline":"center"}) assert_approx_equals: scrollX expected 200 +/- 0.5 but got 158
+FAIL scrollIntoView({"block":"start","inline":"end"}) assert_approx_equals: scrollX expected 200 +/- 0.5 but got 115
+FAIL scrollIntoView({"block":"center","inline":"start"}) assert_approx_equals: scrollX expected 157.5 +/- 0.5 but got 200
+FAIL scrollIntoView({"block":"center","inline":"center"}) assert_approx_equals: scrollY expected -157.5 +/- 0.5 but got 158
+FAIL scrollIntoView({"block":"center","inline":"end"}) assert_approx_equals: scrollX expected 157.5 +/- 0.5 but got 115
+FAIL scrollIntoView({"block":"end","inline":"start"}) assert_approx_equals: scrollX expected 115 +/- 0.5 but got 200
+FAIL scrollIntoView({"block":"end","inline":"center"}) assert_approx_equals: scrollX expected 115 +/- 0.5 but got 158
+FAIL scrollIntoView({"block":"end","inline":"end"}) assert_approx_equals: scrollY expected -115 +/- 0.5 but got 115
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-sideways-lr-writing-mode.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-sideways-lr-writing-mode.html
new file mode 100644 (file)
index 0000000..0659dec
--- /dev/null
@@ -0,0 +1,108 @@
+<!DOCTYPE html>
+<title>CSSOM View - scrollIntoView considers sideways-rl writing mode</title>
+<meta charset="utf-8">
+<link rel="author" title="Cathie Chen" href="mailto:cathiechen@igalia.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: sideways-lr;
+  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>
+// In sideways-lr mode, X corresponds to the block axis and is oriented rightward.
+// Y corresponds to the inline axis and is oriented upward.
+// So the beginning edges are the bottom and left edges and the ending edges are the top and right edges.
+
+// According to the spec, y be min(0, max(y, element padding edge height - element scrolling area height)).
+// So y is nonpositive and decreases upward.
+
+// This assumes that the horizontal scrollbar is on the bottom side and the vertical scrollbar is on the right side.
+
+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 = {
+  blockStart: box_width,
+  blockCenter: (3*box_width - scroller_width)/2 + scrollbar_width/2,
+  blockEnd: 2*box_width - scroller_width + scrollbar_width,
+};
+
+var expectedY = {
+  inlineStart: -box_height,
+  inlineCenter: -((3*box_height - scroller_height)/2) - scrollbar_width/2,
+  inlineEnd: -(2*box_height - scroller_height) - scrollbar_width,
+};
+
+[
+  [{block: "start", inline: "start"}, expectedX.blockStart, expectedY.inlineStart],
+  [{block: "start", inline: "center"}, expectedX.blockStart, expectedY.inlineCenter],
+  [{block: "start", inline: "end"}, expectedX.blockStart, expectedY.inlineEnd],
+  [{block: "center", inline: "start"}, expectedX.blockCenter, expectedY.inlineStart],
+  [{block: "center", inline: "center"}, expectedX.blockCenter, expectedY.inlineCenter],
+  [{block: "center", inline: "end"}, expectedX.blockCenter, expectedY.inlineEnd],
+  [{block: "end", inline: "start"}, expectedX.blockEnd, expectedY.inlineStart],
+  [{block: "end", inline: "center"}, expectedX.blockEnd, expectedY.inlineCenter],
+  [{block: "end", inline: "end"}, expectedX.blockEnd, expectedY.inlineEnd],
+].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(${JSON.stringify(input)})`);
+})
+
+</script>
+
+</body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-sideways-rl-writing-mode-and-rtl-direction-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-sideways-rl-writing-mode-and-rtl-direction-expected.txt
new file mode 100644 (file)
index 0000000..279c35e
--- /dev/null
@@ -0,0 +1,11 @@
+
+FAIL scrollIntoView({"block":"start","inline":"start"}) assert_approx_equals: scrollY expected -200 +/- 0.5 but got 200
+FAIL scrollIntoView({"block":"start","inline":"center"}) assert_approx_equals: scrollX expected -200 +/- 0.5 but got -158
+FAIL scrollIntoView({"block":"start","inline":"end"}) assert_approx_equals: scrollX expected -200 +/- 0.5 but got -115
+FAIL scrollIntoView({"block":"center","inline":"start"}) assert_approx_equals: scrollX expected -157.5 +/- 0.5 but got -200
+FAIL scrollIntoView({"block":"center","inline":"center"}) assert_approx_equals: scrollY expected -157.5 +/- 0.5 but got 158
+FAIL scrollIntoView({"block":"center","inline":"end"}) assert_approx_equals: scrollX expected -157.5 +/- 0.5 but got -115
+FAIL scrollIntoView({"block":"end","inline":"start"}) assert_approx_equals: scrollX expected -115 +/- 0.5 but got -200
+FAIL scrollIntoView({"block":"end","inline":"center"}) assert_approx_equals: scrollX expected -115 +/- 0.5 but got -158
+FAIL scrollIntoView({"block":"end","inline":"end"}) assert_approx_equals: scrollY expected -115 +/- 0.5 but got 115
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-sideways-rl-writing-mode-and-rtl-direction.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-sideways-rl-writing-mode-and-rtl-direction.html
new file mode 100644 (file)
index 0000000..82e43eb
--- /dev/null
@@ -0,0 +1,111 @@
+<!DOCTYPE html>
+<title>CSSOM View - scrollIntoView considers sideways-rl writing mode and rtl direction</title>
+<meta charset="utf-8">
+<link rel="author" title="Cathie Chen" href="mailto:cathiechen@igalia.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: sideways-rl;
+  direction: rtl;
+  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>
+// In sideways-rl mode and rtl direction, X corresponds to the block axis and is oriented leftward.
+// Y corresponds to the inline axis and is oriented upward.
+// So the beginning edges are the bottom and right edges and the ending edges are the top and left edges.
+
+// According to the spec, x be min(0, max(x, element padding edge width - element scrolling area width)).
+// So x is nonpositive and decreases leftward.
+// According to the spec, y be min(0, max(y, element padding edge height - element scrolling area height)).
+// So y is nonpositive and decreases upward.
+
+// This assumes that the horizontal scrollbar is on the bottom side and the vertical scrollbar is on the left side.
+
+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 = {
+  blockStart: -box_width,
+  blockCenter: -((3*box_width - scroller_width)/2) - scrollbar_width/2,
+  blockEnd: -(2*box_width - scroller_width) - scrollbar_width,
+};
+
+var expectedY = {
+  inlineStart: -box_height,
+  inlineCenter: -((3*box_height - scroller_height)/2) - scrollbar_width/2,
+  inlineEnd: -(2*box_height - scroller_height) - scrollbar_width,
+};
+
+[
+  [{block: "start", inline: "start"}, expectedX.blockStart, expectedY.inlineStart],
+  [{block: "start", inline: "center"}, expectedX.blockStart, expectedY.inlineCenter],
+  [{block: "start", inline: "end"}, expectedX.blockStart, expectedY.inlineEnd],
+  [{block: "center", inline: "start"}, expectedX.blockCenter, expectedY.inlineStart],
+  [{block: "center", inline: "center"}, expectedX.blockCenter, expectedY.inlineCenter],
+  [{block: "center", inline: "end"}, expectedX.blockCenter, expectedY.inlineEnd],
+  [{block: "end", inline: "start"}, expectedX.blockEnd, expectedY.inlineStart],
+  [{block: "end", inline: "center"}, expectedX.blockEnd, expectedY.inlineCenter],
+  [{block: "end", inline: "end"}, expectedX.blockEnd, expectedY.inlineEnd],
+].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(${JSON.stringify(input)})`);
+})
+
+</script>
+
+</body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-sideways-rl-writing-mode-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-sideways-rl-writing-mode-expected.txt
new file mode 100644 (file)
index 0000000..c7778bb
--- /dev/null
@@ -0,0 +1,11 @@
+
+FAIL scrollIntoView({"block":"start","inline":"start"}) assert_approx_equals: scrollX expected -200 +/- 0.5 but got 200
+FAIL scrollIntoView({"block":"start","inline":"center"}) assert_approx_equals: scrollX expected -200 +/- 0.5 but got 158
+FAIL scrollIntoView({"block":"start","inline":"end"}) assert_approx_equals: scrollX expected -200 +/- 0.5 but got 115
+FAIL scrollIntoView({"block":"center","inline":"start"}) assert_approx_equals: scrollX expected -157.5 +/- 0.5 but got 200
+FAIL scrollIntoView({"block":"center","inline":"center"}) assert_approx_equals: scrollX expected -157.5 +/- 0.5 but got 158
+FAIL scrollIntoView({"block":"center","inline":"end"}) assert_approx_equals: scrollX expected -157.5 +/- 0.5 but got 115
+FAIL scrollIntoView({"block":"end","inline":"start"}) assert_approx_equals: scrollX expected -115 +/- 0.5 but got 200
+FAIL scrollIntoView({"block":"end","inline":"center"}) assert_approx_equals: scrollX expected -115 +/- 0.5 but got 158
+FAIL scrollIntoView({"block":"end","inline":"end"}) assert_approx_equals: scrollX expected -115 +/- 0.5 but got 115
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-sideways-rl-writing-mode.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-sideways-rl-writing-mode.html
new file mode 100644 (file)
index 0000000..9d7fda6
--- /dev/null
@@ -0,0 +1,108 @@
+<!DOCTYPE html>
+<title>CSSOM View - scrollIntoView considers sideways-rl writing mode</title>
+<meta charset="utf-8">
+<link rel="author" title="Cathie Chen" href="mailto:cathiechen@igalia.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: sideways-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>
+// In sideways-rl mode, X corresponds to the block axis and is oriented leftward.
+// Y corresponds to the inline axis and is oriented downward.
+// So the beginning edges are the top and right edges and the ending edges are the bottom and left edges.
+
+// According to the spec, x be min(0, max(x, element padding edge width - element scrolling area width)).
+// So x is nonpositive and decreases leftward.
+
+// This assumes that the horizontal scrollbar is on the bottom side and the vertical scrollbar is on the left side.
+
+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 = {
+  blockStart: -box_width,
+  blockCenter: -((3*box_width - scroller_width)/2) - scrollbar_width/2,
+  blockEnd: -(2*box_width - scroller_width) - scrollbar_width,
+};
+
+var expectedY = {
+  inlineStart: box_height,
+  inlineCenter: ((3*box_height - scroller_height)/2) + (scrollbar_width/2),
+  inlineEnd: ((2*box_height) - scroller_height) + scrollbar_width,
+};
+
+[
+  [{block: "start", inline: "start"}, expectedX.blockStart, expectedY.inlineStart],
+  [{block: "start", inline: "center"}, expectedX.blockStart, expectedY.inlineCenter],
+  [{block: "start", inline: "end"}, expectedX.blockStart, expectedY.inlineEnd],
+  [{block: "center", inline: "start"}, expectedX.blockCenter, expectedY.inlineStart],
+  [{block: "center", inline: "center"}, expectedX.blockCenter, expectedY.inlineCenter],
+  [{block: "center", inline: "end"}, expectedX.blockCenter, expectedY.inlineEnd],
+  [{block: "end", inline: "start"}, expectedX.blockEnd, expectedY.inlineStart],
+  [{block: "end", inline: "center"}, expectedX.blockEnd, expectedY.inlineCenter],
+  [{block: "end", inline: "end"}, expectedX.blockEnd, expectedY.inlineEnd],
+].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(${JSON.stringify(input)})`);
+})
+
+</script>
+
+</body>
+</html>
index d94ff88..70343cb 100644 (file)
@@ -1,6 +1,6 @@
 <!DOCTYPE HTML>
-<script src="../../../../../resources/testharness.js"></script>
-<script src="../../../../../resources/testharnessreport.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <title>Check End Position of smooth scrollIntoView</title>
 <div id="container" style="height: 2500px; width: 2500px;">
   <div id="content" style="height: 500px; width: 500px;margin-left: 1000px; margin-right: 1000px; margin-top: 1000px;margin-bottom: 1000px;background-color: red">
index f5c734d..7af5de5 100644 (file)
@@ -1,8 +1,8 @@
 <!DOCTYPE HTML>
 <title>scrollIntoView on an SVG shape element</title>
 <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>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <svg width="8000" height="8000">
   <rect width="100" height="100" fill="blue" y="1950" id="geometry"/>
   <rect width="100" height="100" fill="blue" transform="translate(0, 2950)"
index 1fe470f..3301141 100644 (file)
@@ -4,8 +4,8 @@
 <link rel="author" title="Cathie Chen" href="mailto:cathiechen@igalia.com">
 <link rel="help" href="https://drafts.csswg.org/cssom-view/#dom-element-scrollintoview">
 <link rel="help" href="https://drafts.csswg.org/cssom-view/#scroll-an-element">
-<script src="../../../../../resources/testharness.js"></script>
-<script src="../../../../../resources/testharnessreport.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 
 <style>
 .box {
 <body>
 <div id="scroller">
   <div id="container">
-    <!--   ROW-1   -->
+    <!--  ROW-1  -->
     <div class="row">
       <div class="box"></div>
       <div class="box"></div>
       <div class="box"></div>
     </div>
 
-    <!--   ROW-2   -->
+    <!--  ROW-2  -->
     <div class="row">
       <div class="box"></div>
       <div class="box" id="target"></div>
       <div class="box"></div>
     </div>
 
-    <!--   ROW-3   -->
+    <!--  ROW-3  -->
     <div class="row">
       <div class="box"></div>
       <div class="box"></div>
index 8ccfde6..9242a49 100644 (file)
@@ -3,8 +3,8 @@
 <meta charset="utf-8">
 <link rel="author" title="Cathie Chen" href="mailto:cathiechen@igalia.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>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 
 <style>
 .box {
 <body>
 <div id="scroller">
   <div id="container">
-    <!--   ROW-1   -->
+    <!--  ROW-1  -->
     <div class="row">
       <div class="box"></div>
       <div class="box"></div>
       <div class="box"></div>
     </div>
 
-    <!--   ROW-2   -->
+    <!--  ROW-2  -->
     <div class="row">
       <div class="box"></div>
       <div class="box" id="target"></div>
       <div class="box"></div>
     </div>
 
-    <!--   ROW-3   -->
+    <!--  ROW-3  -->
     <div class="row">
       <div class="box"></div>
       <div class="box"></div>
index 6a20e2f..dc5f3e2 100644 (file)
@@ -3,8 +3,8 @@
 <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>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 
 <style>
 .box {
 <body>
 <div id="scroller">
   <div id="container">
-    <!--  ROW-1  -->
+    <!-- ROW-1 -->
     <div class="row">
       <div class="box"></div>
       <div class="box"></div>
       <div class="box"></div>
     </div>
 
-    <!--  ROW-2  -->
+    <!-- ROW-2 -->
     <div class="row">
       <div class="box"></div>
       <div class="box" id="target"></div>
       <div class="box"></div>
     </div>
 
-    <!--  ROW-3  -->
+    <!-- ROW-3 -->
     <div class="row">
       <div class="box"></div>
       <div class="box"></div>
@@ -92,20 +92,6 @@ var expectedY = {
   inlineEnd: ((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.
-// In vertical-rl mode, the scroll x coordinate should be nonpositive per the the spec.
-// But some browsers is nonnegative, so we adjust the expectation.
-scroller.scrollLeft = -1000;
-if(scroller.scrollLeft === 0) {
-  expectedX = {
-    blockStart: ((2*box_width) - scroller_width) + scrollbar_width,
-    blockCenter: ((3*box_width - scroller_width)/2) + (scrollbar_width/2),
-    blockEnd: box_width,
-  };
-}
-
 [
   [{block: "start", inline: "start"}, expectedX.blockStart, expectedY.inlineStart],
   [{block: "start", inline: "center"}, expectedX.blockStart, expectedY.inlineCenter],
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollLeft-of-scroller-with-wider-scrollbar-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollLeft-of-scroller-with-wider-scrollbar-expected.txt
new file mode 100644 (file)
index 0000000..3200cf7
--- /dev/null
@@ -0,0 +1,3 @@
+
+FAIL Test the maxmium value of scrollLeft assert_equals: expected 100 but got 110
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollLeft-of-scroller-with-wider-scrollbar.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollLeft-of-scroller-with-wider-scrollbar.html
new file mode 100644 (file)
index 0000000..e308c7c
--- /dev/null
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<title>The maximum value of scrollLeft shouldn't be affected by scrollbar even if it's wider than scroller</title>
+<meta charset="utf-8">
+<link rel="help" href="https://drafts.csswg.org/cssom-view/#dom-element-scrollleft">
+
+<div id="scroller" style="overflow: scroll; width: 5px;height: 300px;">
+    <div style="width:100px; height: 1px"></div>
+</div>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+    test(function() {
+        scroller.scrollLeft = 1000;
+        assert_equals(scroller.scrollLeft, 100);
+    }, "Test the maxmium value of scrollLeft");
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollLeftTop-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollLeftTop-expected.txt
new file mode 100644 (file)
index 0000000..afc8b62
--- /dev/null
@@ -0,0 +1,16 @@
+scrollLeft/scrollTop
+
+writing-mode: horizontal-tb;
+
+writing-mode: vertical-lr;
+
+writing-mode: vertical-rl;
+
+
+PASS writing-mode:horizontal-tb; direction:ltr 
+PASS writing-mode:horizontal-tb; direction:rtl 
+PASS writing-mode:vertical-lr; direction:ltr 
+PASS writing-mode:vertical-lr; direction:rtl 
+FAIL writing-mode:vertical-rl; direction:ltr assert_approx_equals: ending scrollLeft expected -165 +/- 0.5 but got -150
+FAIL writing-mode:vertical-rl; direction:rtl assert_approx_equals: ending scrollLeft expected -165 +/- 0.5 but got -150
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollLeftTop.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollLeftTop.html
new file mode 100644 (file)
index 0000000..55b4013
--- /dev/null
@@ -0,0 +1,136 @@
+<!DOCTYPE html>
+<title>CSSOM View - scrollLeft/scrollTop considers writing-mode and css direction</title>
+<meta charset="utf-8">
+<link rel="author" title="Cathie Chen" href="mailto:cathiechen@igalia.com">
+<link rel="help" href="https://drafts.csswg.org/cssom-view/#scrolling-area-origin">
+<link rel="help" href="https://drafts.csswg.org/cssom-view/#scroll-an-element">
+<meta name="assert" content="This test verifies the assigned and extreme values of the scroll positions of an element.">
+
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<head>
+  <style>
+    .scroller {
+        overflow: scroll;
+        width: 150px;
+        height: 100px;
+    }
+    .content {
+        width: 300px;
+        height: 400px;
+    }
+    .horizontal-tb {
+      writing-mode: horizontal-tb;
+    }
+    .vertical-lr {
+      writing-mode: vertical-lr;
+    }
+    .vertical-rl {
+      writing-mode: vertical-rl;
+    }
+    .rtl {
+      direction: rtl;
+    }
+  </style>
+</head>
+
+<body>
+  <h1>scrollLeft/scrollTop</h1>
+  <h2>writing-mode: horizontal-tb;</h2>
+  <div id="target_scroller" class="scroller horizontal-tb ltr">
+    <div id="target_content" class="content"></div>
+  </div>
+  <div class="scroller horizontal-tb rtl">
+    <div class="content"></div>
+  </div>
+  <h2>writing-mode: vertical-lr;</h2>
+  <div class="scroller vertical-lr ltr">
+    <div class="content"></div>
+  </div>
+  <div class="scroller vertical-lr rtl">
+    <div class="content"></div>
+  </div>
+  <h2>writing-mode: vertical-rl;</h2>
+  <div class="scroller vertical-rl ltr">
+    <div class="content"></div>
+  </div>
+  <div class="scroller vertical-rl rtl">
+    <div class="content"></div>
+  </div>
+
+  <script>
+  var scroller = document.querySelector("#target_scroller");
+  var content = document.querySelector("#target_content");
+  var scrollbar_width = scroller.offsetWidth - scroller.clientWidth;
+  var scroller_width = scroller.offsetWidth;
+  var scroller_height = scroller.offsetHeight;
+  var content_width = content.offsetWidth;
+  var content_height = content.offsetHeight;
+
+  expectedScrollTop = content_height - scroller_height + scrollbar_width;
+  expectedScrollLeft = content_width - scroller_width + scrollbar_width;
+
+  const epsilon = 0.5;
+  test(() => {
+    var scroller = document.querySelector(".horizontal-tb.ltr");
+    assert_approx_equals(scroller.scrollLeft, 0, epsilon, "initial scrollLeft");
+    assert_approx_equals(scroller.scrollTop, 0, epsilon, "initial scrollTop");
+    scroller.scrollLeft = 2*content_width;
+    scroller.scrollTop = 2*content_height;
+    assert_approx_equals(scroller.scrollLeft, expectedScrollLeft, epsilon, "ending scrollLeft");
+    assert_approx_equals(scroller.scrollTop, expectedScrollTop, epsilon, "ending scrollTop");
+  }, `writing-mode:horizontal-tb; direction:ltr`);
+
+  test(() => {
+    var scroller = document.querySelector(".horizontal-tb.rtl");
+    assert_approx_equals(scroller.scrollLeft, 0, epsilon, "initial scrollLeft");
+    assert_approx_equals(scroller.scrollTop, 0, epsilon, "initial scrollTop");
+    scroller.scrollLeft = -2*content_width;
+    scroller.scrollTop = 2*content_height;
+    assert_approx_equals(scroller.scrollLeft, -expectedScrollLeft, epsilon, "ending scrollLeft");
+    assert_approx_equals(scroller.scrollTop, expectedScrollTop, epsilon, "ending scrollTop");
+  }, `writing-mode:horizontal-tb; direction:rtl`);
+
+  test(() => {
+    var scroller = document.querySelector(".vertical-lr.ltr");
+    assert_approx_equals(scroller.scrollLeft, 0, epsilon, "initial scrollLeft");
+    assert_approx_equals(scroller.scrollTop, 0, epsilon, "initial scrollTop");
+    scroller.scrollLeft = 2*content_width;
+    scroller.scrollTop = 2*content_height;
+    assert_approx_equals(scroller.scrollLeft, expectedScrollLeft, epsilon, "ending scrollLeft");
+    assert_approx_equals(scroller.scrollTop, expectedScrollTop, epsilon, "ending scrollTop");
+  }, `writing-mode:vertical-lr; direction:ltr`);
+
+  test(() => {
+    var scroller = document.querySelector(".vertical-lr.rtl");
+    assert_approx_equals(scroller.scrollLeft, 0, epsilon, "initial scrollLeft");
+    assert_approx_equals(scroller.scrollTop, 0, epsilon, "initial scrollTop");
+    scroller.scrollLeft = 2*content_width;
+    scroller.scrollTop = -2*content_height;
+    assert_approx_equals(scroller.scrollLeft, expectedScrollLeft, epsilon, "ending scrollLeft");
+    assert_approx_equals(scroller.scrollTop, -expectedScrollTop, epsilon, "ending scrollTop");
+  }, `writing-mode:vertical-lr; direction:rtl`);
+
+  test(() => {
+    var scroller = document.querySelector(".vertical-rl.ltr");
+    assert_approx_equals(scroller.scrollLeft, 0, epsilon, "initial scrollLeft");
+    assert_approx_equals(scroller.scrollTop, 0, epsilon, "initial scrollTop");
+    scroller.scrollLeft = -2*content_width;
+    scroller.scrollTop = 2*content_height;
+    assert_approx_equals(scroller.scrollLeft, -expectedScrollLeft, epsilon, "ending scrollLeft");
+    assert_approx_equals(scroller.scrollTop, expectedScrollTop, epsilon, "ending scrollTop");
+  }, `writing-mode:vertical-rl; direction:ltr`);
+
+  test(() => {
+    var scroller = document.querySelector(".vertical-rl.rtl");
+    assert_approx_equals(scroller.scrollLeft, 0, epsilon, "initial scrollLeft");
+    assert_approx_equals(scroller.scrollTop, 0, epsilon, "initial scrollTop");
+    scroller.scrollLeft = -2*content_width;
+    scroller.scrollTop = -2*content_height;
+    assert_approx_equals(scroller.scrollLeft, -expectedScrollLeft, epsilon, "ending scrollLeft");
+    assert_approx_equals(scroller.scrollTop, -expectedScrollTop, epsilon, "ending scrollTop");
+  }, `writing-mode:vertical-rl; direction:rtl`);
+  </script>
+</body>
+</html>
index fcceacd..77b01db 100644 (file)
@@ -6,8 +6,8 @@
         <link rel="author" title="Robert O'Callahan" href="mailto:robert@ocallahan.org" />
         <link rel="help" href="http://www.w3.org/TR/cssom-view/#dom-element-scrollwidth" />
         <meta name="flags" content="dom" />
-        <script src="../../../../../resources/testharness.js" type="text/javascript" />
-        <script src="../../../../../resources/testharnessreport.js" type="text/javascript" />
+        <script src="/resources/testharness.js" type="text/javascript" />
+        <script src="/resources/testharnessreport.js" type="text/javascript" />
         <style type="text/css"><![CDATA[
             #elemSimple, #elemOverflow, #elemNestedOverflow {
                 border:1px solid black;
index 2517e7e..f0fd373 100644 (file)
@@ -6,8 +6,8 @@
         <link rel="author" title="Robert O'Callahan" href="mailto:robert@ocallahan.org" />
         <link rel="help" href="http://www.w3.org/TR/cssom-view/#dom-element-scrollwidth" />
         <meta name="flags" content="dom" />
-        <script src="../../../../../resources/testharness.js" type="text/javascript" />
-        <script src="../../../../../resources/testharnessreport.js" type="text/javascript" />
+        <script src="/resources/testharness.js" type="text/javascript" />
+        <script src="/resources/testharnessreport.js" type="text/javascript" />
         <style type="text/css"><![CDATA[
             #elemSimple, #elemOverflow, #elemNestedOverflow {
                 border:1px solid black;
index ae5fa84..9435760 100644 (file)
@@ -1,8 +1,8 @@
 <!doctype html>
 <meta charset="utf-8">
 <title>cssom-view scrolling-no-browsing-context</title>
-<script src="../../../../../resources/testharness.js"></script>
-<script src="../../../../../resources/testharnessreport.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <script>
 setup({explicit_done:true});
 window.onload = function () {
index 08e7b12..568f572 100644 (file)
@@ -1,8 +1,8 @@
 <!DOCTYPE html>
 <meta charset=utf-8>
 <title>cssom-view - scrolling quirks VS nonquirks mode</title>
-<script src="../../../../../resources/testharness.js"></script>
-<script src="../../../../../resources/testharnessreport.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <style>
   iframe {
     width: 300px;
index 718d8f8..a438541 100644 (file)
@@ -1,8 +1,8 @@
 <!DOCTYPE html>
 <meta charset=utf-8>
 <title>cssom-view - scrollingElement</title>
-<script src="../../../../../resources/testharness.js"></script>
-<script src="../../../../../resources/testharnessreport.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <iframe id="quirksframe"></iframe>
 <iframe id="nonquirksframe"></iframe>
 <div id="log"></div>
index 26724c9..584ab4b 100644 (file)
@@ -7,8 +7,8 @@
 <link rel="help" href="https://heycam.github.io/webidl/#es-operations">
 <link rel="help" href="https://heycam.github.io/webidl/#es-overloads">
 <meta name="flags" content="dom">
-<script src="../../../../../resources/testharness.js"></script>
-<script src="../../../../../resources/testharnessreport.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <style>
 body.running { margin: 0; padding: 4000px; overflow: hidden }
 body.running #testDiv {
index aa7ccf5..4af06d6 100644 (file)
@@ -2,8 +2,8 @@
 <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>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
 <div id="test-target" style="position: absolute"></div>
 <script>
   test(function() {
index fbb30a7..43aac24 100644 (file)
@@ -2,8 +2,8 @@
 <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>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
 <div id="test-target" style="position: absolute"></div>
 <script>
   test(function() {
index 72bc9a9..fd7f0d3 100644 (file)
@@ -2,8 +2,8 @@
 <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>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
 <div id="test-target" style="position: absolute"></div>
 <script>
   test(function() {
index e42d73a..bc87317 100644 (file)
@@ -6,8 +6,8 @@
     <link rel="help" href="https://www.w3.org/TR/cssom-view/#dom-element-getclientrects">
     <meta name="flags" content="dom">
     <meta name="assert" content="getClientRects will return rects of the correct number">
-    <script src="../../../../../resources/testharness.js"></script>
-    <script src="../../../../../resources/testharnessreport.js"></script>
+    <script src="/resources/testharness.js"></script>
+    <script src="/resources/testharnessreport.js"></script>
 
 </head>
 <body>
index ae9ba42..b77c9f7 100644 (file)
@@ -19,9 +19,13 @@ List of files:
 /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/MediaQueryList-addListener-handleEvent.html
+/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/MediaQueryList-addListener-removeListener.html
+/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/MediaQueryList-extends-EventTarget-interop.html
+/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/MediaQueryList-extends-EventTarget.html
+/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/MediaQueryListEvent.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/Screen-pixelDepth-Screen-colorDepth001.html
+/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/client-props-inline-list-item.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
@@ -36,6 +40,7 @@ List of files:
 /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-list-001.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-subpixel.html
@@ -57,27 +62,30 @@ List of files:
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/elementsFromPoint-svg.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/elementsFromPoint-table.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/elementsFromPoint.html
+/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/getBoundingClientRect-empty-inline.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/getClientRects-br-htb-ltr.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/getClientRects-br-htb-rtl.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/getClientRects-br-vlr-ltr.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/getClientRects-br-vlr-rtl.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/getClientRects-br-vrl-ltr.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/getClientRects-br-vrl-rtl.html
+/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/getClientRects-inline-atomic-child.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/getClientRects-inline-expected.html
+/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/getClientRects-inline-inline-child.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/getClientRects-inline.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/historical.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/htmlelement-offset-width-001.html
+/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/idlharness.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/iframe.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/inheritance.html
-/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/interfaces.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/long_scroll_composited-expected.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/long_scroll_composited.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/matchMedia-display-none-iframe.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/matchMedia.html
 /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/offsetTopLeft-border-box.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/offsetTopLeft-empty-inline-offset.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/offsetTopLeft-empty-inline.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/offsetTopLeft-inline-expected.html
@@ -86,6 +94,7 @@ List of files:
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/offsetTopLeft-trailing-space-inline.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/offsetTopLeftInScrollableParent.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/outer-svg.html
+/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/position-sticky-root-scroller-with-scroll-behavior.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/resize-event-on-initial-layout.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/screenLeftTop.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-default-css.html
@@ -98,16 +107,23 @@ List of files:
 /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-horizontal-partially-visible.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-horizontal-tb-writing-mode-and-rtl-direction.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-horizontal-tb-writing-mode.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-sideways-lr-writing-mode-and-rtl-direction.html
+/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-sideways-lr-writing-mode.html
+/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-sideways-rl-writing-mode-and-rtl-direction.html
+/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-sideways-rl-writing-mode.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-smooth.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-svg-shape.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-vertical-lr-writing-mode-and-rtl-direction.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-vertical-lr-writing-mode.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/scrollLeft-of-scroller-with-wider-scrollbar.html
+/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollLeftTop.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
@@ -120,9 +136,12 @@ 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-border-collapse-client-width-height.html
+/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/table-border-separate-client-width-height.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/table-with-border-client-width-height.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-screen-height-immutable.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/window-screen-height.html
index 56a2f39..88dd068 100644 (file)
@@ -6,8 +6,8 @@
     <link rel="help" href="http://www.w3.org/TR/cssom-view/#the-screen-interface">
     <meta name="flags" content="dom">
     <meta name="assert" content="screen.height is immutable">
-    <script src="../../../../../resources/testharness.js"></script>
-    <script src="../../../../../resources/testharnessreport.js"></script>
+    <script src="/resources/testharness.js"></script>
+    <script src="/resources/testharnessreport.js"></script>
 </head>
 <body>
     <div id="myDiv"></div>
index 06bd459..9bb7e52 100644 (file)
@@ -6,8 +6,8 @@
     <link rel="help" href="http://www.w3.org/TR/cssom-view/#the-screen-interface">
     <meta name="flags" content="dom">
     <meta name="assert" content="window.screen.height has sensible values">
-    <script src="../../../../../resources/testharness.js"></script>
-    <script src="../../../../../resources/testharnessreport.js"></script>
+    <script src="/resources/testharness.js"></script>
+    <script src="/resources/testharnessreport.js"></script>
 </head>
 <body>
     <div id="myDiv"></div>
index fab616e..1415bfa 100644 (file)
@@ -6,8 +6,8 @@
     <link rel="help" href="http://www.w3.org/TR/cssom-view/#the-screen-interface">
     <meta name="flags" content="dom">
     <meta name="assert" content="screen.width is immutable">
-    <script src="../../../../../resources/testharness.js"></script>
-    <script src="../../../../../resources/testharnessreport.js"></script>
+    <script src="/resources/testharness.js"></script>
+    <script src="/resources/testharnessreport.js"></script>
 </head>
 <body>
     <div id="myDiv"></div>
index 9393a07..fdae2bc 100644 (file)
@@ -6,8 +6,8 @@
     <link rel="help" href="http://www.w3.org/TR/cssom-view/#the-screen-interface">
     <meta name="flags" content="dom">
     <meta name="assert" content="window.screen.width has sensible values">
-    <script src="../../../../../resources/testharness.js"></script>
-    <script src="../../../../../resources/testharnessreport.js"></script>
+    <script src="/resources/testharness.js"></script>
+    <script src="/resources/testharnessreport.js"></script>
 </head>
 <body>
     <div id="myDiv"></div>
index 749038b..3bfa80a 100644 (file)
     "imported/w3c/web-platform-tests/css/css-transitions/transitioncancel-001.html": [
         "slow"
     ],
-    "imported/w3c/web-platform-tests/css/cssom-view/matchMedia.xht": [
-        "slow"
-    ],
     "imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-default-css.html": [
         "slow"
     ],