Modify more tests to use document.scrollingElement to access viewport scroll properties
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Sep 2018 12:47:54 +0000 (12:47 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Sep 2018 12:47:54 +0000 (12:47 +0000)
https://bugs.webkit.org/show_bug.cgi?id=189495

After r235806, it is wrong to use document.body to access scroll properties of the viewport
in standard mode. New tests added since r227781 are modified to use
document.scrollingElement instead and avoid flaky behavior. For consistency, we do the same
for old tests in quirks mode. Note that WPT tests as well as the following tests using
document.body on purpose are not modified:
- fast/dom/Element/*
- events/scroll-in-scaled-page-with-overflow-hidden.html
- compositing/ios/overflow-scroll-update-overlap.html
- body-stuck-with-dirty-bit-with-columns.html

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

* compositing/rtl/rtl-absolute-overflow-scrolled.html:
* compositing/rtl/rtl-fixed-overflow-scrolled.html:
* editing/caret/ios/absolute-caret-position-after-scroll.html:
* editing/caret/ios/fixed-caret-position-after-scroll.html:
* editing/execCommand/delete-no-scroll.html:
* editing/input/resources/reveal-utilities.js:
(performJumpAtTheEdgeTest):
* editing/pasteboard/copy-crash.html:
* editing/selection/ios/absolute-selection-after-scroll.html:
* editing/selection/ios/fixed-selection-after-scroll.html:
* fast/autoresize/autoresize-with-iframe-expected.txt:
* fast/autoresize/autoresize-with-iframe.html:
* fast/autoresize/basic-expected.txt:
* fast/autoresize/basic.html:
* fast/autoresize/turn-off-autoresize-expected.txt:
* fast/autoresize/turn-off-autoresize.html:
* fast/css/element-scrollByLines-scrollByPages-obsolete.html:
* fast/dom/non-numeric-values-numeric-parameters-expected.txt:
* fast/dom/non-numeric-values-numeric-parameters.html:
* fast/dom/resources/check-scroll-position-onload.html:
* fast/dom/scroll-position-for-new-loads.html:
* fast/events/attempt-scroll-with-no-scrollbars.html:
* fast/events/fire-scroll-event.html:
* fast/events/frame-scroll-fake-mouse-move.html:
* fast/events/ios/no-touch-events-when-stopping-momentum-scroll-in-mainframe-expected.txt:
* fast/events/ios/no-touch-events-when-stopping-momentum-scroll-in-mainframe.html:
* fast/events/ios/touch-events-during-scroll-deceleration-in-overflow.html:
* fast/events/mouse-cursor-image-set.html:
* fast/events/mouse-cursor-multiframecur.html:
* fast/events/mouse-cursor.html:
* fast/events/no-scroll-on-input-text-selection-expected.txt:
* fast/events/no-scroll-on-input-text-selection.html:
* fast/events/platform-wheelevent-paging-x-in-non-scrolling-page-expected.txt:
* fast/events/platform-wheelevent-paging-x-in-non-scrolling-page.html:
* fast/events/platform-wheelevent-paging-x-in-scrolling-page-expected.txt:
* fast/events/platform-wheelevent-paging-x-in-scrolling-page.html:
* fast/events/platform-wheelevent-paging-xy-in-scrolling-page-expected.txt:
* fast/events/platform-wheelevent-paging-xy-in-scrolling-page.html:
* fast/events/platform-wheelevent-paging-y-in-non-scrolling-page-expected.txt:
* fast/events/platform-wheelevent-paging-y-in-non-scrolling-page.html:
* fast/events/platform-wheelevent-paging-y-in-scrolling-page-expected.txt:
* fast/events/platform-wheelevent-paging-y-in-scrolling-page.html:
* fast/events/scale-and-scroll-body-expected.txt:
* fast/events/scale-and-scroll-body.html:
* fast/events/scale-and-scroll-window-expected.txt:
* fast/events/scale-and-scroll-window.html:
* fast/events/scroll-after-click-on-tab-index.html:
* fast/events/scroll-to-anchor-in-overflow-hidden.html:
* fast/events/touch/ios/touchmove-cancelable-after-touchstart-expected.txt:
* fast/events/touch/ios/touchmove-cancelable-after-touchstart.html:
* fast/forms/autofocus-opera-003.html:
* fast/forms/input-readonly-autoscroll.html:
* fast/forms/resources/common.js:
(getAbsoluteRect):
* fast/frames/iframe-scroll-page-up-down.html:
* fast/frames/transparent-scrollbar.html:
* fast/harness/results.html:
* fast/html/empty-fragment-id-goto-top-expected.txt:
* fast/html/empty-fragment-id-goto-top.html:
* fast/images/imagemap-scroll.html:
* fast/loader/scroll-position-restored-on-back-non-cached.html:
* fast/loader/scroll-position-restored-on-back.html:
* fast/multicol/body-stuck-with-dirty-bit-with-columns.html:
* fast/repaint/resources/iframe-scroll-repaint-iframe.html:
* fast/scrolling/ios/iframe-scroll-into-view.html:
* fast/scrolling/latching/scroll-div-latched-div.html:
* fast/scrolling/latching/scroll-div-latched-mainframe.html:
* fast/scrolling/latching/scroll-div-with-nested-nonscrollable-iframe.html:
* fast/scrolling/latching/scroll-iframe-fragment.html:
* fast/scrolling/latching/scroll-iframe-latched-iframe.html:
* fast/scrolling/latching/scroll-iframe-latched-mainframe.html:
* fast/scrolling/latching/scroll-iframe-webkit1-latching-bug.html:
* fast/scrolling/latching/scroll-select-bottom-test.html:
* fast/scrolling/latching/scroll-select-latched-mainframe.html:
* fast/scrolling/latching/scroll-select-latched-select.html:
* fast/scrolling/rtl-point-in-iframe.html:
* fast/spatial-navigation/snav-unit-overflow-and-scroll-in-direction.html:
* fast/table/assert-when-visual-overflow-is-cleared.html:
* fast/transforms/selection-bounds-in-transformed-view.html:
* http/tests/navigation/anchor-frames-cross-origin-expected.txt:
* http/tests/navigation/resources/frame-with-anchor-cross-origin.html:
* jquery/resources/test/unit/offset.js:
* legacy-animation-engine/fast/harness/results.html:
* media/video-controls-to-not-scroll-page-on-load.html:
* media/video-main-content-allow-then-scroll-expected.txt:
* media/video-main-content-allow-then-scroll.html:
* scrollbars/scrollbar-large-overflow-rectangle.html:
* tiled-drawing/scrolling/fast-scroll-div-latched-div-with-handler.html:
* tiled-drawing/scrolling/fast-scroll-div-latched-div.html:
* tiled-drawing/scrolling/fast-scroll-div-latched-mainframe-with-handler.html:
* tiled-drawing/scrolling/fast-scroll-iframe-latched-iframe-with-handler.html:
* tiled-drawing/scrolling/fast-scroll-iframe-latched-iframe.html:
* tiled-drawing/scrolling/fast-scroll-iframe-latched-mainframe-with-handler.html:
* tiled-drawing/scrolling/fast-scroll-iframe-latched-select.html:
* tiled-drawing/scrolling/fast-scroll-select-latched-mainframe-with-handler.html:
* tiled-drawing/scrolling/fast-scroll-select-latched-mainframe.html:
* tiled-drawing/scrolling/fast-scroll-select-latched-select-with-handler.html:
* tiled-drawing/scrolling/fast-scroll-select-latched-select.html:
* tiled-drawing/scrolling/latched-to-deleted-node.html:
* tiled-drawing/scrolling/non-fast-region/top-content-inset-header.html:
* tiled-drawing/scrolling/non-fast-region/top-content-inset.html:
* tiled-drawing/scrolling/non-fast-region/wheel-event-plugin.html:
* tiled-drawing/scrolling/root-overflow-with-mousewheel.html:
* tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-mainframe-horizontal.html:
* tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-mainframe-slow-horizontal.html:
* tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-mainframe-slow-vertical.html:
* tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-mainframe-vertical-then-horizontal.html:
* tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-mainframe-vertical.html:
* tiled-drawing/scrolling/scroll-snap/scroll-snap-proximity-mainframe.html:

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

107 files changed:
LayoutTests/ChangeLog
LayoutTests/compositing/rtl/rtl-absolute-overflow-scrolled.html
LayoutTests/compositing/rtl/rtl-fixed-overflow-scrolled.html
LayoutTests/editing/caret/ios/absolute-caret-position-after-scroll.html
LayoutTests/editing/caret/ios/fixed-caret-position-after-scroll.html
LayoutTests/editing/execCommand/delete-no-scroll.html
LayoutTests/editing/input/resources/reveal-utilities.js
LayoutTests/editing/pasteboard/copy-crash.html
LayoutTests/editing/selection/ios/absolute-selection-after-scroll.html
LayoutTests/editing/selection/ios/fixed-selection-after-scroll.html
LayoutTests/fast/autoresize/autoresize-with-iframe-expected.txt
LayoutTests/fast/autoresize/autoresize-with-iframe.html
LayoutTests/fast/autoresize/basic-expected.txt
LayoutTests/fast/autoresize/basic.html
LayoutTests/fast/autoresize/turn-off-autoresize-expected.txt
LayoutTests/fast/autoresize/turn-off-autoresize.html
LayoutTests/fast/css/element-scrollByLines-scrollByPages-obsolete.html
LayoutTests/fast/dom/non-numeric-values-numeric-parameters-expected.txt
LayoutTests/fast/dom/non-numeric-values-numeric-parameters.html
LayoutTests/fast/dom/resources/check-scroll-position-onload.html
LayoutTests/fast/dom/scroll-position-for-new-loads.html
LayoutTests/fast/events/attempt-scroll-with-no-scrollbars.html
LayoutTests/fast/events/fire-scroll-event.html
LayoutTests/fast/events/frame-scroll-fake-mouse-move.html
LayoutTests/fast/events/ios/no-touch-events-when-stopping-momentum-scroll-in-mainframe-expected.txt
LayoutTests/fast/events/ios/no-touch-events-when-stopping-momentum-scroll-in-mainframe.html
LayoutTests/fast/events/ios/touch-events-during-scroll-deceleration-in-overflow.html
LayoutTests/fast/events/mouse-cursor-image-set.html
LayoutTests/fast/events/mouse-cursor-multiframecur.html
LayoutTests/fast/events/mouse-cursor.html
LayoutTests/fast/events/no-scroll-on-input-text-selection-expected.txt
LayoutTests/fast/events/no-scroll-on-input-text-selection.html
LayoutTests/fast/events/platform-wheelevent-paging-x-in-non-scrolling-page-expected.txt
LayoutTests/fast/events/platform-wheelevent-paging-x-in-non-scrolling-page.html
LayoutTests/fast/events/platform-wheelevent-paging-x-in-scrolling-page-expected.txt
LayoutTests/fast/events/platform-wheelevent-paging-x-in-scrolling-page.html
LayoutTests/fast/events/platform-wheelevent-paging-xy-in-scrolling-page-expected.txt
LayoutTests/fast/events/platform-wheelevent-paging-xy-in-scrolling-page.html
LayoutTests/fast/events/platform-wheelevent-paging-y-in-non-scrolling-page-expected.txt
LayoutTests/fast/events/platform-wheelevent-paging-y-in-non-scrolling-page.html
LayoutTests/fast/events/platform-wheelevent-paging-y-in-scrolling-page-expected.txt
LayoutTests/fast/events/platform-wheelevent-paging-y-in-scrolling-page.html
LayoutTests/fast/events/scale-and-scroll-body-expected.txt
LayoutTests/fast/events/scale-and-scroll-body.html
LayoutTests/fast/events/scale-and-scroll-window-expected.txt
LayoutTests/fast/events/scale-and-scroll-window.html
LayoutTests/fast/events/scroll-after-click-on-tab-index.html
LayoutTests/fast/events/scroll-to-anchor-in-overflow-hidden.html
LayoutTests/fast/events/touch/ios/touchmove-cancelable-after-touchstart-expected.txt
LayoutTests/fast/events/touch/ios/touchmove-cancelable-after-touchstart.html
LayoutTests/fast/forms/autofocus-opera-003.html
LayoutTests/fast/forms/input-readonly-autoscroll.html
LayoutTests/fast/forms/resources/common.js
LayoutTests/fast/frames/iframe-scroll-page-up-down.html
LayoutTests/fast/frames/transparent-scrollbar.html
LayoutTests/fast/harness/results.html
LayoutTests/fast/html/empty-fragment-id-goto-top-expected.txt
LayoutTests/fast/html/empty-fragment-id-goto-top.html
LayoutTests/fast/images/imagemap-scroll.html
LayoutTests/fast/loader/scroll-position-restored-on-back-non-cached.html
LayoutTests/fast/loader/scroll-position-restored-on-back.html
LayoutTests/fast/repaint/resources/iframe-scroll-repaint-iframe.html
LayoutTests/fast/scrolling/ios/iframe-scroll-into-view.html
LayoutTests/fast/scrolling/latching/scroll-div-latched-div.html
LayoutTests/fast/scrolling/latching/scroll-div-latched-mainframe.html
LayoutTests/fast/scrolling/latching/scroll-div-with-nested-nonscrollable-iframe.html
LayoutTests/fast/scrolling/latching/scroll-iframe-fragment.html
LayoutTests/fast/scrolling/latching/scroll-iframe-latched-iframe.html
LayoutTests/fast/scrolling/latching/scroll-iframe-latched-mainframe.html
LayoutTests/fast/scrolling/latching/scroll-iframe-webkit1-latching-bug.html
LayoutTests/fast/scrolling/latching/scroll-select-bottom-test.html
LayoutTests/fast/scrolling/latching/scroll-select-latched-mainframe.html
LayoutTests/fast/scrolling/latching/scroll-select-latched-select.html
LayoutTests/fast/scrolling/rtl-point-in-iframe.html
LayoutTests/fast/spatial-navigation/snav-unit-overflow-and-scroll-in-direction.html
LayoutTests/fast/table/assert-when-visual-overflow-is-cleared.html
LayoutTests/fast/transforms/selection-bounds-in-transformed-view.html
LayoutTests/http/tests/navigation/anchor-frames-cross-origin-expected.txt
LayoutTests/http/tests/navigation/resources/frame-with-anchor-cross-origin.html
LayoutTests/jquery/resources/test/unit/offset.js
LayoutTests/legacy-animation-engine/fast/harness/results.html
LayoutTests/media/video-controls-to-not-scroll-page-on-load.html
LayoutTests/media/video-main-content-allow-then-scroll-expected.txt
LayoutTests/media/video-main-content-allow-then-scroll.html
LayoutTests/scrollbars/scrollbar-large-overflow-rectangle.html
LayoutTests/tiled-drawing/scrolling/fast-scroll-div-latched-div-with-handler.html
LayoutTests/tiled-drawing/scrolling/fast-scroll-div-latched-div.html
LayoutTests/tiled-drawing/scrolling/fast-scroll-div-latched-mainframe-with-handler.html
LayoutTests/tiled-drawing/scrolling/fast-scroll-iframe-latched-iframe-with-handler.html
LayoutTests/tiled-drawing/scrolling/fast-scroll-iframe-latched-iframe.html
LayoutTests/tiled-drawing/scrolling/fast-scroll-iframe-latched-mainframe-with-handler.html
LayoutTests/tiled-drawing/scrolling/fast-scroll-iframe-latched-select.html
LayoutTests/tiled-drawing/scrolling/fast-scroll-select-latched-mainframe-with-handler.html
LayoutTests/tiled-drawing/scrolling/fast-scroll-select-latched-mainframe.html
LayoutTests/tiled-drawing/scrolling/fast-scroll-select-latched-select-with-handler.html
LayoutTests/tiled-drawing/scrolling/fast-scroll-select-latched-select.html
LayoutTests/tiled-drawing/scrolling/latched-to-deleted-node.html
LayoutTests/tiled-drawing/scrolling/non-fast-region/top-content-inset-header.html
LayoutTests/tiled-drawing/scrolling/non-fast-region/top-content-inset.html
LayoutTests/tiled-drawing/scrolling/non-fast-region/wheel-event-plugin.html
LayoutTests/tiled-drawing/scrolling/root-overflow-with-mousewheel.html
LayoutTests/tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-mainframe-horizontal.html
LayoutTests/tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-mainframe-slow-horizontal.html
LayoutTests/tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-mainframe-slow-vertical.html
LayoutTests/tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-mainframe-vertical-then-horizontal.html
LayoutTests/tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-mainframe-vertical.html
LayoutTests/tiled-drawing/scrolling/scroll-snap/scroll-snap-proximity-mainframe.html

index e60abee..d252412 100644 (file)
@@ -1 +1,128 @@
+2018-09-11  Frederic Wang  <fwang@igalia.com>
+
+        Modify more tests to use document.scrollingElement to access viewport scroll properties
+        https://bugs.webkit.org/show_bug.cgi?id=189495
+
+        After r235806, it is wrong to use document.body to access scroll properties of the viewport
+        in standard mode. New tests added since r227781 are modified to use
+        document.scrollingElement instead and avoid flaky behavior. For consistency, we do the same
+        for old tests in quirks mode. Note that WPT tests as well as the following tests using
+        document.body on purpose are not modified:
+        - fast/dom/Element/*
+        - events/scroll-in-scaled-page-with-overflow-hidden.html
+        - compositing/ios/overflow-scroll-update-overlap.html
+        - body-stuck-with-dirty-bit-with-columns.html
+
+        Reviewed by Antonio Gomes.
+
+        * compositing/rtl/rtl-absolute-overflow-scrolled.html:
+        * compositing/rtl/rtl-fixed-overflow-scrolled.html:
+        * editing/caret/ios/absolute-caret-position-after-scroll.html:
+        * editing/caret/ios/fixed-caret-position-after-scroll.html:
+        * editing/execCommand/delete-no-scroll.html:
+        * editing/input/resources/reveal-utilities.js:
+        (performJumpAtTheEdgeTest):
+        * editing/pasteboard/copy-crash.html:
+        * editing/selection/ios/absolute-selection-after-scroll.html:
+        * editing/selection/ios/fixed-selection-after-scroll.html:
+        * fast/autoresize/autoresize-with-iframe-expected.txt:
+        * fast/autoresize/autoresize-with-iframe.html:
+        * fast/autoresize/basic-expected.txt:
+        * fast/autoresize/basic.html:
+        * fast/autoresize/turn-off-autoresize-expected.txt:
+        * fast/autoresize/turn-off-autoresize.html:
+        * fast/css/element-scrollByLines-scrollByPages-obsolete.html:
+        * fast/dom/non-numeric-values-numeric-parameters-expected.txt:
+        * fast/dom/non-numeric-values-numeric-parameters.html:
+        * fast/dom/resources/check-scroll-position-onload.html:
+        * fast/dom/scroll-position-for-new-loads.html:
+        * fast/events/attempt-scroll-with-no-scrollbars.html:
+        * fast/events/fire-scroll-event.html:
+        * fast/events/frame-scroll-fake-mouse-move.html:
+        * fast/events/ios/no-touch-events-when-stopping-momentum-scroll-in-mainframe-expected.txt:
+        * fast/events/ios/no-touch-events-when-stopping-momentum-scroll-in-mainframe.html:
+        * fast/events/ios/touch-events-during-scroll-deceleration-in-overflow.html:
+        * fast/events/mouse-cursor-image-set.html:
+        * fast/events/mouse-cursor-multiframecur.html:
+        * fast/events/mouse-cursor.html:
+        * fast/events/no-scroll-on-input-text-selection-expected.txt:
+        * fast/events/no-scroll-on-input-text-selection.html:
+        * fast/events/platform-wheelevent-paging-x-in-non-scrolling-page-expected.txt:
+        * fast/events/platform-wheelevent-paging-x-in-non-scrolling-page.html:
+        * fast/events/platform-wheelevent-paging-x-in-scrolling-page-expected.txt:
+        * fast/events/platform-wheelevent-paging-x-in-scrolling-page.html:
+        * fast/events/platform-wheelevent-paging-xy-in-scrolling-page-expected.txt:
+        * fast/events/platform-wheelevent-paging-xy-in-scrolling-page.html:
+        * fast/events/platform-wheelevent-paging-y-in-non-scrolling-page-expected.txt:
+        * fast/events/platform-wheelevent-paging-y-in-non-scrolling-page.html:
+        * fast/events/platform-wheelevent-paging-y-in-scrolling-page-expected.txt:
+        * fast/events/platform-wheelevent-paging-y-in-scrolling-page.html:
+        * fast/events/scale-and-scroll-body-expected.txt:
+        * fast/events/scale-and-scroll-body.html:
+        * fast/events/scale-and-scroll-window-expected.txt:
+        * fast/events/scale-and-scroll-window.html:
+        * fast/events/scroll-after-click-on-tab-index.html:
+        * fast/events/scroll-to-anchor-in-overflow-hidden.html:
+        * fast/events/touch/ios/touchmove-cancelable-after-touchstart-expected.txt:
+        * fast/events/touch/ios/touchmove-cancelable-after-touchstart.html:
+        * fast/forms/autofocus-opera-003.html:
+        * fast/forms/input-readonly-autoscroll.html:
+        * fast/forms/resources/common.js:
+        (getAbsoluteRect):
+        * fast/frames/iframe-scroll-page-up-down.html:
+        * fast/frames/transparent-scrollbar.html:
+        * fast/harness/results.html:
+        * fast/html/empty-fragment-id-goto-top-expected.txt:
+        * fast/html/empty-fragment-id-goto-top.html:
+        * fast/images/imagemap-scroll.html:
+        * fast/loader/scroll-position-restored-on-back-non-cached.html:
+        * fast/loader/scroll-position-restored-on-back.html:
+        * fast/multicol/body-stuck-with-dirty-bit-with-columns.html:
+        * fast/repaint/resources/iframe-scroll-repaint-iframe.html:
+        * fast/scrolling/ios/iframe-scroll-into-view.html:
+        * fast/scrolling/latching/scroll-div-latched-div.html:
+        * fast/scrolling/latching/scroll-div-latched-mainframe.html:
+        * fast/scrolling/latching/scroll-div-with-nested-nonscrollable-iframe.html:
+        * fast/scrolling/latching/scroll-iframe-fragment.html:
+        * fast/scrolling/latching/scroll-iframe-latched-iframe.html:
+        * fast/scrolling/latching/scroll-iframe-latched-mainframe.html:
+        * fast/scrolling/latching/scroll-iframe-webkit1-latching-bug.html:
+        * fast/scrolling/latching/scroll-select-bottom-test.html:
+        * fast/scrolling/latching/scroll-select-latched-mainframe.html:
+        * fast/scrolling/latching/scroll-select-latched-select.html:
+        * fast/scrolling/rtl-point-in-iframe.html:
+        * fast/spatial-navigation/snav-unit-overflow-and-scroll-in-direction.html:
+        * fast/table/assert-when-visual-overflow-is-cleared.html:
+        * fast/transforms/selection-bounds-in-transformed-view.html:
+        * http/tests/navigation/anchor-frames-cross-origin-expected.txt:
+        * http/tests/navigation/resources/frame-with-anchor-cross-origin.html:
+        * jquery/resources/test/unit/offset.js:
+        * legacy-animation-engine/fast/harness/results.html:
+        * media/video-controls-to-not-scroll-page-on-load.html:
+        * media/video-main-content-allow-then-scroll-expected.txt:
+        * media/video-main-content-allow-then-scroll.html:
+        * scrollbars/scrollbar-large-overflow-rectangle.html:
+        * tiled-drawing/scrolling/fast-scroll-div-latched-div-with-handler.html:
+        * tiled-drawing/scrolling/fast-scroll-div-latched-div.html:
+        * tiled-drawing/scrolling/fast-scroll-div-latched-mainframe-with-handler.html:
+        * tiled-drawing/scrolling/fast-scroll-iframe-latched-iframe-with-handler.html:
+        * tiled-drawing/scrolling/fast-scroll-iframe-latched-iframe.html:
+        * tiled-drawing/scrolling/fast-scroll-iframe-latched-mainframe-with-handler.html:
+        * tiled-drawing/scrolling/fast-scroll-iframe-latched-select.html:
+        * tiled-drawing/scrolling/fast-scroll-select-latched-mainframe-with-handler.html:
+        * tiled-drawing/scrolling/fast-scroll-select-latched-mainframe.html:
+        * tiled-drawing/scrolling/fast-scroll-select-latched-select-with-handler.html:
+        * tiled-drawing/scrolling/fast-scroll-select-latched-select.html:
+        * tiled-drawing/scrolling/latched-to-deleted-node.html:
+        * tiled-drawing/scrolling/non-fast-region/top-content-inset-header.html:
+        * tiled-drawing/scrolling/non-fast-region/top-content-inset.html:
+        * tiled-drawing/scrolling/non-fast-region/wheel-event-plugin.html:
+        * tiled-drawing/scrolling/root-overflow-with-mousewheel.html:
+        * tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-mainframe-horizontal.html:
+        * tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-mainframe-slow-horizontal.html:
+        * tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-mainframe-slow-vertical.html:
+        * tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-mainframe-vertical-then-horizontal.html:
+        * tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-mainframe-vertical.html:
+        * tiled-drawing/scrolling/scroll-snap/scroll-snap-proximity-mainframe.html:
+
 == Rolled over to ChangeLog-2018-09-11 ==
index 0a70c0a..7b21d35 100644 (file)
@@ -44,7 +44,7 @@
         }
 
         // The far left coordinate of the document varies by window width.
-        var offset = document.body.clientWidth - document.body.scrollWidth + 1;
+        var offset = document.body.clientWidth - document.scrollingElement.scrollWidth + 1;
         document.getElementById('layer').style.left = offset + 50;
         document.getElementById('indicator').style.left = offset + 50;
 
index 0607e44..107615d 100644 (file)
@@ -45,7 +45,7 @@
         }
 
         // The far left coordinate of the document varies by window width.
-        var offset = document.body.clientWidth - document.body.scrollWidth + 1;
+        var offset = document.body.clientWidth - document.scrollingElement.scrollWidth + 1;
 
         window.setTimeout(function() {
             window.scrollTo(offset, 0);
index a0ec9d0..3474e02 100644 (file)
@@ -45,7 +45,7 @@ jsTestIsAsync = true;
         shouldBe("initialCaretRect.top", "21");
         shouldBe("initialCaretRect.width", "3");
         shouldBe("initialCaretRect.height", "15");
-        document.body.scrollTop += 5000;
+        document.scrollingElement.scrollTop += 5000;
         return UIHelper.getUICaretRect();
     })
     .then((rect) => {
index 80ae21c..fa5b27a 100644 (file)
@@ -45,7 +45,7 @@ jsTestIsAsync = true;
         shouldBe("initialCaretRect.top", "21");
         shouldBe("initialCaretRect.width", "3");
         shouldBe("initialCaretRect.height", "15");
-        document.body.scrollTop += 5000;
+        document.scrollingElement.scrollTop += 5000;
         return UIHelper.getUICaretRect();
     })
     .then((rect) => {
index 456ba4a..28a0e10 100644 (file)
@@ -24,7 +24,7 @@
     window.scrollTo(0, 1000);
     document.execCommand("Delete");
 
-    var result = (document.body.scrollTop == 1000) ? "SUCCESS" : "FAILURE";
+    var result = (document.scrollingElement.scrollTop == 1000) ? "SUCCESS" : "FAILURE";
     if (window.testRunner) {
       testRunner.notifyDone();
       document.write(result);
index a2ef366..53f2f15 100644 (file)
@@ -73,9 +73,9 @@ function performJumpAtTheEdgeTest(useCtrlKeyModifier)
         var previousScrollTop = 0, currentScrollTop = 0;
         var jumpDetected = false;
         for (var i = 0; i < 120; ++i) {
-            previousScrollTop = document.body.scrollTop;
+            previousScrollTop = document.scrollingElement.scrollTop;
             eventSender.keyDown("\r", useCtrlKeyModifier ? ["ctrlKey"] : []);
-            currentScrollTop = document.body.scrollTop;
+            currentScrollTop = document.scrollingElement.scrollTop;
             // Smooth scrolls are allowed.
             if (Math.abs(previousScrollTop - currentScrollTop) > 24) {
                 jumpDetected = true;
index 0670d05..d3d506e 100644 (file)
         if (e.pageX) {
           x = e.pageX;
         } else if (e.clientX) {
-          x = e.clientX + document.body.scrollLeft;
+          x = e.clientX + document.scrollingElement.scrollLeft;
         } else {
           x = 0;
         }
         if (e.pageY) {
           y = e.pageY;
         } else if (e.clientY) {
-          y = e.clientY + document.body.scrollTop;
+          y = e.clientY + document.scrollingElement.scrollTop;
         } else {
           y = 0;
         }
index a7c2bba..bd52ecf 100644 (file)
@@ -54,7 +54,7 @@
             shouldBe("initialSelectionRects[0].top", "0");
             shouldBe("initialSelectionRects[0].width", "309");
             shouldBe("initialSelectionRects[0].height", "114");
-            document.body.scrollTop += 5000;
+            document.scrollingElement.scrollTop += 5000;
             return UIHelper.getUISelectionRects();
         })
         .then((rects) => {
index 8da8b39..5076f52 100644 (file)
@@ -54,7 +54,7 @@
             shouldBe("initialSelectionRects[0].top", "0");
             shouldBe("initialSelectionRects[0].width", "309");
             shouldBe("initialSelectionRects[0].height", "114");
-            document.body.scrollTop += 5000;
+            document.scrollingElement.scrollTop += 5000;
             return UIHelper.getUISelectionRects();
         })
         .then((rects) => {
index 84cfad4..834adc1 100644 (file)
@@ -4,7 +4,7 @@
 Frame: 'frame'
 --------
 This test only works in DumpRenderTree since it relies on setting up autoresize from javascript. It verifies that iframes are sized correctly when the main window is autoresized. On success, you should see a series of PASS messages followed by a DONE.
-PASS: document.body.scrollWidth equaled 400
-PASS: document.body.scrollHeight equaled 200
+PASS: document.scrollingElement.scrollWidth equaled 400
+PASS: document.scrollingElement.scrollHeight equaled 200
 DONE
 
index c1abe07..4f5e195 100644 (file)
@@ -12,8 +12,8 @@ if (window.testRunner) {
 function run()
 {
     var frameWindow = document.getElementById("frame").contentWindow;
-    frameWindow.postMessage("shouldBe('document.body.scrollWidth', 400)", "*");
-    frameWindow.postMessage("shouldBe('document.body.scrollHeight', 200)", "*");
+    frameWindow.postMessage("shouldBe('document.scrollingElement.scrollWidth', 400)", "*");
+    frameWindow.postMessage("shouldBe('document.scrollingElement.scrollHeight', 200)", "*");
     frameWindow.postMessage("log('DONE'); if (window.testRunner) testRunner.notifyDone();", "*");
 }
 </script>
index b9d436e..78f674c 100644 (file)
@@ -4,8 +4,8 @@ When it succeeds, there should be a series of PASS messages followed by a DONE m
 
 PASS: document.body.clientWidth equaled window.innerWidth
 PASS: document.body.clientHeight equaled window.innerHeight
-PASS: document.body.scrollWidth equaled window.innerWidth
-PASS: document.body.scrollHeight equaled window.innerHeight
+PASS: document.scrollingElement.scrollWidth equaled window.innerWidth
+PASS: document.scrollingElement.scrollHeight equaled window.innerHeight
 PASS: window.innerWidth equaled window.outerWidth
 PASS: window.innerHeight equaled window.outerHeight
 DONE
index 6e3771a..2eaf32d 100644 (file)
@@ -10,8 +10,8 @@ function runTest()
     }
     shouldBe('document.body.clientWidth', 'window.innerWidth');
     shouldBe('document.body.clientHeight', 'window.innerHeight');
-    shouldBe('document.body.scrollWidth', 'window.innerWidth');
-    shouldBe('document.body.scrollHeight', 'window.innerHeight');
+    shouldBe('document.scrollingElement.scrollWidth', 'window.innerWidth');
+    shouldBe('document.scrollingElement.scrollHeight', 'window.innerHeight');
     shouldBe('window.innerWidth', 'window.outerWidth');
     shouldBe('window.innerHeight', 'window.outerHeight');
     log('DONE');
index 33d71a7..66227ea 100644 (file)
@@ -4,8 +4,8 @@ When it succeeds, there should be a series of PASS messages followed by a DONE m
 
 PASS: document.body.clientWidth equaled window.innerWidth
 PASS: document.body.clientHeight equaled window.innerHeight
-PASS: document.body.scrollWidth equaled window.innerWidth
-PASS: document.body.scrollHeight equaled window.innerHeight
+PASS: document.scrollingElement.scrollWidth equaled window.innerWidth
+PASS: document.scrollingElement.scrollHeight equaled window.innerHeight
 PASS: window.innerWidth equaled window.outerWidth
 PASS: window.innerHeight equaled window.outerHeight
 PASS: window.outerWidth equaled 200
index 27a419a..5a7eed6 100644 (file)
@@ -10,8 +10,8 @@ function runTest()
     }
     shouldBe('document.body.clientWidth', 'window.innerWidth');
     shouldBe('document.body.clientHeight', 'window.innerHeight');
-    shouldBe('document.body.scrollWidth', 'window.innerWidth');
-    shouldBe('document.body.scrollHeight', 'window.innerHeight');
+    shouldBe('document.scrollingElement.scrollWidth', 'window.innerWidth');
+    shouldBe('document.scrollingElement.scrollHeight', 'window.innerHeight');
     shouldBe('window.innerWidth', 'window.outerWidth');
     shouldBe('window.innerHeight', 'window.outerHeight');
     if (window.testRunner)
index aafd737..504ac6a 100644 (file)
@@ -5,12 +5,12 @@
 <script src="../../resources/testharnessreport.js"></script>
 <script>
 test(function() {
-    assert_equals(document.body.scrollByLines, undefined);
+    assert_equals(document.scrollingElement.scrollByLines, undefined);
     assert_equals(Element.prototype.scrollByLines, undefined);
 }, "Element.scrollByLines");
 
 test(function() {
-    assert_equals(document.body.scrollByPages, undefined);
+    assert_equals(document.scrollingElement.scrollByPages, undefined);
     assert_equals(Element.prototype.scrollByPages, undefined);
 }, "Element.scrollByPages");
 </script>
index 67b2fc0..6da81e2 100644 (file)
@@ -21,8 +21,8 @@ PASS nonNumericPolicy('createCSSStyleSheet().removeRule(x)') is 'any type allowe
 PASS nonNumericPolicy('createCSSValueList().item(x)') is 'any type allowed (but not omitted)'
 PASS nonNumericPolicy('document.elementFromPoint(x, 0)') is 'mixed'
 PASS nonNumericPolicy('document.elementFromPoint(0, x)') is 'mixed'
-PASS nonNumericPolicy('document.body.scrollLeft = x') is 'any type allowed'
-PASS nonNumericPolicy('document.body.scrollTop = x') is 'any type allowed'
+PASS nonNumericPolicy('document.scrollingElement.scrollLeft = x') is 'any type allowed'
+PASS nonNumericPolicy('document.scrollingElement.scrollTop = x') is 'any type allowed'
 PASS nonNumericPolicy('document.images.item(x)') is 'any type allowed (but not omitted)'
 PASS nonNumericPolicy('document.createElement("input").setSelectionRange(x, 0)') is 'any type allowed'
 PASS nonNumericPolicy('document.createElement("input").setSelectionRange(0, x)') is 'any type allowed (but not omitted)'
index 49b8394..8e037a0 100644 (file)
@@ -231,8 +231,8 @@ shouldBe("nonNumericPolicy('document.elementFromPoint(0, x)')", "'mixed'");
 
 // Element
 
-shouldBe("nonNumericPolicy('document.body.scrollLeft = x')", "'any type allowed'");
-shouldBe("nonNumericPolicy('document.body.scrollTop = x')", "'any type allowed'");
+shouldBe("nonNumericPolicy('document.scrollingElement.scrollLeft = x')", "'any type allowed'");
+shouldBe("nonNumericPolicy('document.scrollingElement.scrollTop = x')", "'any type allowed'");
 
 // History
 
index f45bcf7..074d6f6 100644 (file)
@@ -7,7 +7,7 @@
     <script type="text/javascript">
         function load() {
             var result = document.getElementById("result");
-            result.innerHTML = (document.body.scrollTop == 0) ? "PASS" : "FAIL";
+            result.innerHTML = (document.scrollingElement.scrollTop == 0) ? "PASS" : "FAIL";
             if (window.testRunner) {
                 testRunner.notifyDone();
             }
index a87c800..b1fdba4 100644 (file)
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html>
 <head>
-    <title>Check that document.body.scrollTop is equal to '0' for newly loaded pages</title>
+    <title>Check that document.scrollingElement.scrollTop is equal to '0' for newly loaded pages</title>
     <link rel="author" title="Mikhail Pozdnyakov" href="mailto:mikhail.pozdnyakov@intel.com" />
     <style type="text/css">
         div { min-height: 3000px; }
index 0177d52..e33e924 100644 (file)
@@ -25,10 +25,10 @@ function doNewWindow()
 
 function printResult()
 {
-    if (theWinref.document.body.scrollTop == 0)
+    if (theWinref.document.scrollingElement.scrollTop == 0)
         document.getElementById("console").innerHTML = "PASSED";
     else
-        document.getElementById("console").innerHTML = "FAILED - window should not have been scrolled but was scrolled to " + theWinref.document.body.scrollTop;
+        document.getElementById("console").innerHTML = "FAILED - window should not have been scrolled but was scrolled to " + theWinref.document.scrollingElement.scrollTop;
     theWinref.close();
     endTest();
 }
index c382507..7d5ef88 100644 (file)
@@ -12,8 +12,8 @@ onscroll = function(event)
     eventCount++;
     if (eventCount == 1) {
         debug('Scroll event bubbles: ' + event.bubbles);
-        var scrollX = document.body.scrollLeft;
-        var scrollY = document.body.scrollTop;
+        var scrollX = document.scrollingElement.scrollLeft;
+        var scrollY = document.scrollingElement.scrollTop;
         testPassed('Scroll position: (' + scrollX + ', ' + scrollY + ')');
         // Don't call notifyDone straight away, in case there's another scroll event coming.
         doneTimeout = setTimeout(finishJSTest, 100);
index d600a9d..1198d87 100644 (file)
@@ -27,7 +27,7 @@
         setTimeout(function()
         {
             eventSender.mouseMoveTo(50, 100);
-            document.body.scrollTop = 250;
+            document.scrollingElement.scrollTop = 250;
             timeoutID = setTimeout(finish, 20000);
         }, 200);
     }
index 169e3e8..16a32fb 100644 (file)
@@ -1,4 +1,4 @@
-PASS document.body.scrollTop became different from 0
+PASS document.scrollingElement.scrollTop became different from 0
 PASS document.getElementById('touches').textContent is "1"
 PASS document.getElementById('touches').textContent is "1"
 PASS document.getElementById('touches').textContent is "2"
index 02d297f..bb3a8ab 100644 (file)
@@ -28,7 +28,7 @@
 <script>
 touchstartEventCount = 0;
 
-document.body.scrollTop = 0;
+document.scrollingElement.scrollTop = 0;
 document.body.addEventListener("touchstart", () => {
     document.body.style.backgroundColor = (++touchstartEventCount == 2) ? "green" : "red";
     touches.textContent = `${touchstartEventCount}`;
@@ -52,11 +52,11 @@ if (window.testRunner && testRunner.runUIScript) {
     testRunner.dumpAsText();
     jsTestIsAsync = true;
     testRunner.runUIScript(getSwipeUIScript(100, 0.75 * innerHeight, 100, 0.25 * innerHeight, 0.1), () => {
-        shouldBecomeDifferent("document.body.scrollTop", "0", () => {
+        shouldBecomeDifferent("document.scrollingElement.scrollTop", "0", () => {
             expectTouchCountToBe(1);
-            UIHelper.tapAt(100, document.body.scrollTop + 0.75 * innerHeight).then(() => {
+            UIHelper.tapAt(100, document.scrollingElement.scrollTop + 0.75 * innerHeight).then(() => {
                 expectTouchCountToBe(1);
-                UIHelper.tapAt(100, document.body.scrollTop + 0.25 * innerHeight).then(() => {
+                UIHelper.tapAt(100, document.scrollingElement.scrollTop + 0.25 * innerHeight).then(() => {
                     expectTouchCountToBe(2);
                     finishJSTest();
                 });
index 1382414..70ee5ba 100644 (file)
@@ -48,7 +48,7 @@
 containerTouchstartEventCount = 0;
 documentTouchstartEventCount = 0;
 container.scrollTop = 0;
-document.body.scrollTop = 0;
+document.scrollingElement.scrollTop = 0;
 container.addEventListener("touchstart", () => {
     container.style.backgroundColor = (++containerTouchstartEventCount == 1) ? "green" : "red";
     containerTouches.textContent = `${containerTouchstartEventCount}`;
index cb09687..fb189df 100644 (file)
@@ -37,8 +37,8 @@ function checkCursors() {
         var node = nodesToTest[i];
         debug('TEST CASE: ' + node.textContent);
         // Make sure the node is visible and move the mouse over top of it.
-        document.body.scrollTop = node.offsetTop - 50;
-        eventSender.mouseMoveTo(node.offsetLeft + 3, node.offsetTop - document.body.scrollTop + 3);
+        document.scrollingElement.scrollTop = node.offsetTop - 50;
+        eventSender.mouseMoveTo(node.offsetLeft + 3, node.offsetTop - document.scrollingElement.scrollTop + 3);
 
         // Get details of the current mouse cursor.
         // Note that we could return structured data which we then validate, but that's a lot more
index 89b142f..fc5ae6f 100644 (file)
@@ -28,8 +28,8 @@ function runTests() {
             debug('TEST CASE: ' + node.textContent);
 
             // Make sure the node is visible and move the mouse over top of it.
-            document.body.scrollTop = node.offsetTop - 50;
-            eventSender.mouseMoveTo(node.offsetLeft + 3, node.offsetTop - document.body.scrollTop + 3);
+            document.scrollingElement.scrollTop = node.offsetTop - 50;
+            eventSender.mouseMoveTo(node.offsetLeft + 3, node.offsetTop - document.scrollingElement.scrollTop + 3);
 
             // Get details of the current mouse cursor.
             // Note that we could return structured data which we then validate, but that's a lot more
index 2e5259b..ceb4b69 100644 (file)
@@ -55,8 +55,8 @@ function runTests() {
             debug('TEST CASE: ' + node.textContent);
 
             // Make sure the node is visible and move the mouse over top of it.
-            document.body.scrollTop = node.offsetTop - 50;
-            eventSender.mouseMoveTo(node.offsetLeft + 3, node.offsetTop - document.body.scrollTop + 3);
+            document.scrollingElement.scrollTop = node.offsetTop - 50;
+            eventSender.mouseMoveTo(node.offsetLeft + 3, node.offsetTop - document.scrollingElement.scrollTop + 3);
 
             // Get details of the current mouse cursor.
             // Note that we could return structured data which we then validate, but that's a lot more
index 2b14746..feb232d 100644 (file)
@@ -6,9 +6,9 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
 PASS document.getSelection().toString().length > 1 is true
 PASS pageXOffset is 0
 PASS pageYOffset is originalPageYOffset
-PASS document.body.scrollLeft is 0
-PASS document.body.scrollTop is originalBodyScrollTop
-PASS pageYOffset is document.body.scrollTop
+PASS document.scrollingElement.scrollLeft is 0
+PASS document.scrollingElement.scrollTop is originalBodyScrollTop
+PASS pageYOffset is document.scrollingElement.scrollTop
 PASS pageYOffset > 2000 is true
 PASS successfullyParsed is true
 
index 8667e22..15f665d 100644 (file)
                 ta.scrollIntoView();
 
                 originalPageYOffset = pageYOffset;
-                originalBodyScrollTop = document.body.scrollTop;
+                originalBodyScrollTop = document.scrollingElement.scrollTop;
 
                 if (window.eventSender) {
                     var taClientRect = ta.getBoundingClientRect();
                     var verticalOffset = taClientRect.top + (taClientRect.height / 2);
-                    var h = ta.offsetTop - document.body.scrollTop + 10;
+                    var h = ta.offsetTop - document.scrollingElement.scrollTop + 10;
                     eventSender.dragMode = false;
                     eventSender.mouseMoveTo(20, verticalOffset);
                     eventSender.mouseDown();
@@ -40,9 +40,9 @@
                 shouldBeTrue('document.getSelection().toString().length > 1');
                 shouldBe('pageXOffset', '0');
                 shouldBe('pageYOffset', 'originalPageYOffset');
-                shouldBe('document.body.scrollLeft', '0');
-                shouldBe('document.body.scrollTop', 'originalBodyScrollTop');
-                shouldBe('pageYOffset', 'document.body.scrollTop');
+                shouldBe('document.scrollingElement.scrollLeft', '0');
+                shouldBe('document.scrollingElement.scrollTop', 'originalBodyScrollTop');
+                shouldBe('pageYOffset', 'document.scrollingElement.scrollTop');
                 shouldBeTrue('pageYOffset > 2000');
 
                 finishJSTest();
index 5bb97a4..5e256a9 100644 (file)
@@ -1,6 +1,6 @@
 PASS event.wheelDeltaY is 0
 PASS event.wheelDeltaX is window.givenScrollLeft * -3
 PASS event.wheelDelta is window.givenScrollLeft * -3
-PASS document.body.scrollTop is window.expectedScrollTop
-PASS document.body.scrollLeft is window.expectedScrollLeft
+PASS document.scrollingElement.scrollTop is window.expectedScrollTop
+PASS document.scrollingElement.scrollLeft is window.expectedScrollLeft
 
index 5f42c91..ec436ae 100644 (file)
@@ -26,8 +26,8 @@
 
             function checkOffsets()
             {
-                shouldBe("document.body.scrollTop", "window.expectedScrollTop");
-                shouldBe("document.body.scrollLeft", "window.expectedScrollLeft");
+                shouldBe("document.scrollingElement.scrollTop", "window.expectedScrollTop");
+                shouldBe("document.scrollingElement.scrollLeft", "window.expectedScrollLeft");
 
                 if (window.testRunner)
                     window.testRunner.notifyDone();
index 5bb97a4..5e256a9 100644 (file)
@@ -1,6 +1,6 @@
 PASS event.wheelDeltaY is 0
 PASS event.wheelDeltaX is window.givenScrollLeft * -3
 PASS event.wheelDelta is window.givenScrollLeft * -3
-PASS document.body.scrollTop is window.expectedScrollTop
-PASS document.body.scrollLeft is window.expectedScrollLeft
+PASS document.scrollingElement.scrollTop is window.expectedScrollTop
+PASS document.scrollingElement.scrollLeft is window.expectedScrollLeft
 
index 3d8ea45..613b983 100644 (file)
@@ -26,8 +26,8 @@
 
             function checkOffsets()
             {
-                shouldBe("document.body.scrollTop", "window.expectedScrollTop");
-                shouldBe("document.body.scrollLeft", "window.expectedScrollLeft");
+                shouldBe("document.scrollingElement.scrollTop", "window.expectedScrollTop");
+                shouldBe("document.scrollingElement.scrollLeft", "window.expectedScrollLeft");
 
                 if (window.testRunner)
                     window.testRunner.notifyDone();
index 0e891cc..e25def0 100644 (file)
@@ -1,6 +1,6 @@
 PASS event.wheelDeltaY is window.givenScrollTop * -3
 PASS event.wheelDeltaX is window.givenScrollLeft * -3
 PASS event.wheelDelta is window.givenScrollTop * -3
-PASS document.body.scrollTop is window.expectedScrollTop
-PASS document.body.scrollLeft is window.expectedScrollLeft
+PASS document.scrollingElement.scrollTop is window.expectedScrollTop
+PASS document.scrollingElement.scrollLeft is window.expectedScrollLeft
 
index 63bc616..3a95964 100644 (file)
@@ -26,8 +26,8 @@
 
             function checkOffsets()
             {
-                shouldBe("document.body.scrollTop", "window.expectedScrollTop");
-                shouldBe("document.body.scrollLeft", "window.expectedScrollLeft");
+                shouldBe("document.scrollingElement.scrollTop", "window.expectedScrollTop");
+                shouldBe("document.scrollingElement.scrollLeft", "window.expectedScrollLeft");
 
                 if (window.testRunner)
                     window.testRunner.notifyDone();
index 530e911..0075f12 100644 (file)
@@ -1,6 +1,6 @@
 PASS event.wheelDeltaY is window.givenScrollTop * -3
 PASS event.wheelDeltaX is 0
 PASS event.wheelDelta is window.givenScrollTop * -3
-PASS document.body.scrollTop is window.expectedScrollTop
-PASS document.body.scrollLeft is window.expectedScrollLeft
+PASS document.scrollingElement.scrollTop is window.expectedScrollTop
+PASS document.scrollingElement.scrollLeft is window.expectedScrollLeft
 
index d2c9cf7..20614a9 100644 (file)
@@ -26,8 +26,8 @@
 
             function checkOffsets()
             {
-                shouldBe("document.body.scrollTop", "window.expectedScrollTop");
-                shouldBe("document.body.scrollLeft", "window.expectedScrollLeft");
+                shouldBe("document.scrollingElement.scrollTop", "window.expectedScrollTop");
+                shouldBe("document.scrollingElement.scrollLeft", "window.expectedScrollLeft");
 
                 if (window.testRunner)
                     window.testRunner.notifyDone();
index 530e911..0075f12 100644 (file)
@@ -1,6 +1,6 @@
 PASS event.wheelDeltaY is window.givenScrollTop * -3
 PASS event.wheelDeltaX is 0
 PASS event.wheelDelta is window.givenScrollTop * -3
-PASS document.body.scrollTop is window.expectedScrollTop
-PASS document.body.scrollLeft is window.expectedScrollLeft
+PASS document.scrollingElement.scrollTop is window.expectedScrollTop
+PASS document.scrollingElement.scrollLeft is window.expectedScrollLeft
 
index 715ac68..ba8868b 100644 (file)
@@ -26,8 +26,8 @@
 
             function checkOffsets()
             {
-                shouldBe("document.body.scrollTop", "window.expectedScrollTop");
-                shouldBe("document.body.scrollLeft", "window.expectedScrollLeft");
+                shouldBe("document.scrollingElement.scrollTop", "window.expectedScrollTop");
+                shouldBe("document.scrollingElement.scrollLeft", "window.expectedScrollLeft");
 
                 if (window.testRunner)
                     window.testRunner.notifyDone();
index 2d7c5e1..3cf396c 100644 (file)
@@ -1,7 +1,7 @@
-PASS window.document.body.scrollTop is 30
-PASS window.document.body.scrollLeft is 30
-PASS window.document.body.scrollTop is 100
-PASS window.document.body.scrollLeft is 100
+PASS window.document.scrollingElement.scrollTop is 30
+PASS window.document.scrollingElement.scrollLeft is 30
+PASS window.document.scrollingElement.scrollTop is 100
+PASS window.document.scrollingElement.scrollLeft is 100
 PASS window.scrollX is 100
 PASS window.scrollY is 100
 
index e47ceac..23e9408 100644 (file)
           // The page scale, as set by window.internals.setPageScaleFactor should not be apparent
           // to javascript. So, we expect scrolling to (100,100) to be page coordinates, rather
           // than device pixels.
-          document.body.scrollLeft = 100;
-          document.body.scrollTop = 100;
+          document.scrollingElement.scrollLeft = 100;
+          document.scrollingElement.scrollTop = 100;
 
-          shouldBe("window.document.body.scrollTop", "100");
-          shouldBe("window.document.body.scrollLeft", "100");
+          shouldBe("window.document.scrollingElement.scrollTop", "100");
+          shouldBe("window.document.scrollingElement.scrollLeft", "100");
           shouldBe("window.scrollX", "100");
           shouldBe("window.scrollY", "100");
       }
@@ -32,8 +32,8 @@
               // Test that the scroll offset changes even if scaleFactor remains
               // the same.
               window.internals.setPageScaleFactor(1, 30, 30);
-              shouldBe("window.document.body.scrollTop", "30");
-              shouldBe("window.document.body.scrollLeft", "30");
+              shouldBe("window.document.scrollingElement.scrollTop", "30");
+              shouldBe("window.document.scrollingElement.scrollLeft", "30");
           }
       }
 
index c1b847d..05942cb 100644 (file)
@@ -1,5 +1,5 @@
-PASS window.document.body.scrollTop is 100
-PASS window.document.body.scrollLeft is 100
+PASS window.document.scrollingElement.scrollTop is 100
+PASS window.document.scrollingElement.scrollLeft is 100
 PASS window.scrollX is 100
 PASS window.scrollY is 100
 
index afb5236..df4f4dc 100644 (file)
@@ -15,8 +15,8 @@
           // than device pixels.
           window.scrollTo(100,100);
 
-          shouldBe("window.document.body.scrollTop", "100");
-          shouldBe("window.document.body.scrollLeft", "100");
+          shouldBe("window.document.scrollingElement.scrollTop", "100");
+          shouldBe("window.document.scrollingElement.scrollLeft", "100");
           shouldBe("window.scrollX", "100");
           shouldBe("window.scrollY", "100");
       }
index 4cbf154..c7c22cc 100644 (file)
@@ -16,14 +16,14 @@ function runTest()
 
   jsTestIsAsync = true;
 
-  alert("Scroll position " + document.body.scrollTop);
+  alert("Scroll position " + document.scrollingElement.scrollTop);
   center = getCenterFor(document.getElementById("sp"));
   eventSender.mouseMoveTo(center.x, center.y);
   eventSender.mouseDown();
   eventSender.mouseUp();
   eventSender.keyDown("downArrow");
   intervalID = setInterval(function() {
-    if (document.body.scrollTop > 0) {
+    if (document.scrollingElement.scrollTop > 0) {
       testPassed("Scroll position is more than 0");
       done();
     }
index f051871..d9ad7d9 100644 (file)
@@ -35,7 +35,7 @@
                eventSender.mouseUp();
            }
 
-           if (document.body.scrollTop == 0)
+           if (document.scrollingElement.scrollTop == 0)
                log("Automated test : FAILED  : no scroll has occured ");
            else
                log("Automated test : PASSED");
index bdc35c1..31cf38b 100644 (file)
@@ -5,7 +5,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
 
 PASS event.cancelable is true
 PASS event.defaultPrevented is true
-PASS document.body.scrollTop is 0
+PASS document.scrollingElement.scrollTop is 0
 PASS successfullyParsed is true
 
 TEST COMPLETE
index c84a16d..5030269 100644 (file)
@@ -83,7 +83,7 @@ function runTest()
     if (window.testRunner) {
         let clientRect = square.getBoundingClientRect();
         testRunner.runUIScript(getUIScript(clientRect.left + 50, clientRect.top + 200, clientRect.left + 50, clientRect.top + 10), () => {
-            shouldBe("document.body.scrollTop", "0");
+            shouldBe("document.scrollingElement.scrollTop", "0");
             finishJSTest();
         });
     }
index b5d213f..9aea23e 100644 (file)
@@ -16,7 +16,7 @@
             testRunner.dumpAsText();
 
         if (document.activeElement == document.getElementsByTagName("input")[0] &&
-            document.body.scrollTop != 0)
+            document.scrollingElement.scrollTop != 0)
             log("SUCCESS");
         else
             log("FAILURE");
@@ -28,4 +28,4 @@
 <hr>
 <ol id="console"></ol>
 </body>
-</html>
\ No newline at end of file
+</html>
index 9ba499d..00ee056 100644 (file)
@@ -13,7 +13,7 @@
                 var tf = document.getElementById('tf');
                 if (window.eventSender) {
                     tf.scrollIntoView();
-                    var h = tf.offsetTop - document.body.scrollTop + 10;
+                    var h = tf.offsetTop - document.scrollingElement.scrollTop + 10;
                     eventSender.dragMode = false;
                     eventSender.mouseMoveTo(20, h);
                     eventSender.mouseDown();
index 56fe26e..dec9198 100644 (file)
@@ -93,10 +93,10 @@ function getValidationMessageBubbleNode(host) {
 
 function getAbsoluteRect(element) {
     var rect = element.getBoundingClientRect();
-    rect.top += document.body.scrollTop;
-    rect.bottom += document.body.scrollTop;
-    rect.left += document.body.scrollLeft;
-    rect.right += document.body.scrollLeft;
+    rect.top += document.scrollingElement.scrollTop;
+    rect.bottom += document.scrollingElement.scrollTop;
+    rect.left += document.scrollingElement.scrollLeft;
+    rect.right += document.scrollingElement.scrollLeft;
     return rect;
 }
 
index c3fd2c6..b0743ee 100644 (file)
@@ -14,12 +14,12 @@ function test()
     window[0][0].scrollTo(0,0);\r
     window[0].scrollTo(0,0);\r
     window.scrollTo(0, document.body.offsetHeight);\r
-    var oldScrollTop = document.body.scrollTop;\r
+    var oldScrollTop = document.scrollingElement.scrollTop;\r
     var focus1 = window[0][0].document.getElementById("focus1");\r
     focus1.focus();    \r
     eventSender.keyDown("pageUp");\r
     var test1Passed = false;\r
-    if (document.body.scrollTop < oldScrollTop)\r
+    if (document.scrollingElement.scrollTop < oldScrollTop)\r
         test1Passed = true;\r
 \r
     // 2nd test: iframes scrolled to bottom, top level document scrolled to top\r
@@ -27,12 +27,12 @@ function test()
     window[0][0].scrollTo(0,window[0][0].document.body.offsetHeight);\r
     window[0].scrollTo(0,window[0].document.body.offsetHeight);\r
     window.scrollTo(0, 0);\r
-    oldScrollTop = document.body.scrollTop\r
+    oldScrollTop = document.scrollingElement.scrollTop\r
     var focus2 = window[0][0].document.getElementById("focus2");\r
     focus2.focus();\r
     eventSender.keyDown("pageDown");\r
     var test2Passed = false;\r
-    if (document.body.scrollTop > oldScrollTop)\r
+    if (document.scrollingElement.scrollTop > oldScrollTop)\r
         test2Passed = true;\r
 \r
     printResults(test1Passed, test2Passed);\r
index 0fe38d3..2af125a 100644 (file)
@@ -27,7 +27,7 @@ function test()
     }
 
     window.setTimeout(function() {
-        document.body.scrollTop = 2000;
+        document.scrollingElement.scrollTop = 2000;
         if (window.testRunner) {
             testRunner.displayAndTrackRepaints();
             testRunner.notifyDone();
index be2b7c4..e41e76e 100644 (file)
@@ -1996,7 +1996,7 @@ class TestNavigator
 
         let rowRect = targetLink.getBoundingClientRect();
         // rowRect is in client coords (i.e. relative to viewport), so we just want to add its top to the current scroll position.
-        document.body.scrollTop += rowRect.top;
+        document.scrollingElement.scrollTop += rowRect.top;
     }
 
     onlyShowUnexpectedFailuresChanged()
index bd31139..fbb7d7b 100644 (file)
@@ -13,7 +13,7 @@
                 var gotoTop = document.getElementById("gotoTop");
                 gotoTop.dispatchEvent(clickEvent);
                               
-                document.write("<div>document.body.scrollTop: " + document.body.scrollTop +"</div>");
+                document.write("<div>document.scrollingElement.scrollTop: " + document.scrollingElement.scrollTop +"</div>");
             }
          }
     </script>
index 9cb5f73..a201f5c 100644 (file)
@@ -14,28 +14,28 @@ function runTest()
         testRunner.waitUntilDone();
     }
 
-    if (document.body.scrollTop == 0)
+    if (document.scrollingElement.scrollTop == 0)
         log("PASS: Document is starting scrolled to top.");
     else
-        log("FAIL: Document is starting scrolled to " + document.body.scrollTop + ".");
+        log("FAIL: Document is starting scrolled to " + document.scrollingElement.scrollTop + ".");
     document.getElementById("area").focus();
 
     setTimeout(() => {
-        if (document.body.scrollTop > 4000 && document.body.scrollTop < 6000)
+        if (document.scrollingElement.scrollTop > 4000 && document.scrollingElement.scrollTop < 6000)
             log("PASS: Focusing area element caused the image to scroll into view.");
         else
-            log("FAIL: Document is scrolled to " + document.body.scrollTop + " after focusing area element.");
-        document.body.scrollTop = 0;
-        if (document.body.scrollTop == 0)
+            log("FAIL: Document is scrolled to " + document.scrollingElement.scrollTop + " after focusing area element.");
+        document.scrollingElement.scrollTop = 0;
+        if (document.scrollingElement.scrollTop == 0)
             log("PASS: Document is scrolled to top once again.");
         else
-            log("FAIL: Document should be scrolled to top but is scrolled to " + document.body.scrollTop + ".");
+            log("FAIL: Document should be scrolled to top but is scrolled to " + document.scrollingElement.scrollTop + ".");
         document.getElementById("area").blur();
-        if (document.body.scrollTop == 0)
+        if (document.scrollingElement.scrollTop == 0)
             log("PASS: Document is still scrolled to top after removing focus from area element.");
         else
-            log("FAIL: Document is scrolled to " + document.body.scrollTop + " after removing focus from area element.");
-        document.body.scrollTop = 0;
+            log("FAIL: Document is scrolled to " + document.scrollingElement.scrollTop + " after removing focus from area element.");
+        document.scrollingElement.scrollTop = 0;
         document.body.removeChild(document.getElementById("test"));
         log("TEST COMPLETE");
 
index a92d67e..b06b097 100644 (file)
@@ -17,7 +17,7 @@ function navigate()
     }
 
     setTimeout(function () { 
-        var scrollPosition = document.body.scrollTop;
+        var scrollPosition = document.scrollingElement.scrollTop;
         var result = document.getElementById("result");
         if (scrollPosition == 100)
             result.innerHTML = "Success! The scroll position was restored after navigation."
index 54858a2..73f58df 100644 (file)
@@ -18,7 +18,7 @@ function navigate()
     }
 
     setTimeout(function () { 
-        var scrollPosition = document.body.scrollTop;
+        var scrollPosition = document.scrollingElement.scrollTop;
         var result = document.getElementById("result");
         if (scrollPosition == 100)
             result.innerHTML = "Success! The scroll position was restored after navigation."
index c05cdf1..ded8324 100644 (file)
@@ -9,7 +9,7 @@ window.setTimeout(function() {
   if (window.testRunner)
     testRunner.displayAndTrackRepaints();
 
-  document.body.scrollTop = 20;
+  document.scrollingElement.scrollTop = 20;
   if (window.testRunner)
     testRunner.notifyDone();
 }, 50);
index 412e1f6..2f736f6 100644 (file)
@@ -26,9 +26,9 @@ iframe {
 
     function runTest() {
         window.scrollTo(0, 200);
-        window.frames[0].document.body.scrollIntoView();
+        window.frames[0].document.scrollingElement.scrollIntoView();
         if (window.testRunner)
             testRunner.notifyDone();
     }
      </script>
-</html>
\ No newline at end of file
+</html>
index 890b063..619e090 100644 (file)
@@ -43,7 +43,7 @@ var continueCount = 5;
 function checkForScroll()
 {
     // The div should not have scrolled at all.
-    var pageScrollPositionAfter = document.body.scrollTop;
+    var pageScrollPositionAfter = document.scrollingElement.scrollTop;
     var divScrollPositionAfter = divTarget.scrollTop;
 
     if (pageScrollPositionBefore != pageScrollPositionAfter)
@@ -56,7 +56,7 @@ function checkForScroll()
 
 function scrollTest()
 {
-    pageScrollPositionBefore = document.body.scrollTop;
+    pageScrollPositionBefore = document.scrollingElement.scrollTop;
 
     divTarget = document.getElementById('target');
     divTarget.scrollTop = divTarget.scrollHeight - divTarget.clientHeight - 100;
index e72e8d7..40c1af3 100644 (file)
@@ -43,7 +43,7 @@ var continueCount = 5;
 function checkForScroll() {
 
     // The div should not have scrolled at all.
-    var pageScrollPositionAfter = document.body.scrollTop;
+    var pageScrollPositionAfter = document.scrollingElement.scrollTop;
     var divScrollPositionAfter = divTarget.scrollTop;
 
     //debug("Page before: " + pageScrollPositionBefore + ", div before: " + divScrollPositionBefore);
@@ -59,7 +59,7 @@ function checkForScroll() {
 
 function scrollTest() {
     // See where our IFrame lives:
-    pageScrollPositionBefore = document.body.scrollTop;
+    pageScrollPositionBefore = document.scrollingElement.scrollTop;
 
     divTarget = document.getElementById('target');
 
index d9a9df5..4810649 100644 (file)
@@ -37,7 +37,7 @@ function finishTest()
 
 function checkForScroll()
 {
-    var pageScrollPositionAfter = document.body.scrollTop;
+    var pageScrollPositionAfter = document.scrollingElement.scrollTop;
     var divScrollPositionAfter = divTarget.scrollTop;
 
     if (divScrollPositionBefore != divScrollPositionAfter)
@@ -55,7 +55,7 @@ function checkForScroll()
 
 function scrollTest()
 {
-    pageScrollPositionBefore = document.body.scrollTop;
+    pageScrollPositionBefore = document.scrollingElement.scrollTop;
 
     divTarget = document.getElementById('scrollable_div');
 
index f626d5c..ca00861 100644 (file)
@@ -14,8 +14,8 @@
         function checkForScroll() {
 
             // The IFrame should have scrolled, but not the main page.
-            var pageScrollPositionAfter = document.body.scrollTop;
-            var iFrameScrollPositionAfter = window.frames['target'].document.body.scrollTop;
+            var pageScrollPositionAfter = document.scrollingElement.scrollTop;
+            var iFrameScrollPositionAfter = window.frames['target'].document.scrollingElement.scrollTop;
 
             if (iFrameScrollPositionBefore != iFrameScrollPositionAfter)
                 testPassed("IFrame received wheel events.");
@@ -27,7 +27,7 @@
 
         function scrollTest() {
             // See where our IFrame lives:
-            pageScrollPositionBefore = document.body.scrollTop;
+            pageScrollPositionBefore = document.scrollingElement.scrollTop;
 
             iframeTarget = document.getElementById('target');
 
index c03a0b5..17b35d5 100644 (file)
@@ -15,8 +15,8 @@ var continueCount = 5;
 function checkForScroll() {
 
     // The IFrame should not have scrolled at all.
-    var pageScrollPositionAfter = document.body.scrollTop;
-    var iFrameScrollPositionAfter = window.frames['target'].document.body.scrollTop;
+    var pageScrollPositionAfter = document.scrollingElement.scrollTop;
+    var iFrameScrollPositionAfter = window.frames['target'].document.scrollingElement.scrollTop;
 
     //debug("Page before: " + pageScrollPositionBefore + ", IFrame before: " + iFrameScrollPositionBefore);
     //debug("Page after:  " + pageScrollPositionAfter + ", IFrame after: " + iFrameScrollPositionAfter);
@@ -31,7 +31,7 @@ function checkForScroll() {
 
 function scrollTest() {
     // See where our IFrame lives:
-    pageScrollPositionBefore = document.body.scrollTop;
+    pageScrollPositionBefore = document.scrollingElement.scrollTop;
 
     iframeTarget = document.getElementById('target');
 
index 46f038c..22b221f 100644 (file)
@@ -15,8 +15,8 @@ var continueCount = 5;
 function checkForScroll() {
 
     // The IFrame should not have scrolled at all.
-    var pageScrollPositionAfter = document.body.scrollTop;
-    var iFrameScrollPositionAfter = window.frames['target'].document.body.scrollTop;
+    var pageScrollPositionAfter = document.scrollingElement.scrollTop;
+    var iFrameScrollPositionAfter = window.frames['target'].document.scrollingElement.scrollTop;
 
     //debug("Page before: " + pageScrollPositionBefore + ", IFrame before: " + iFrameScrollPositionBefore);
     //debug("Page after:  " + pageScrollPositionAfter + ", IFrame after: " + iFrameScrollPositionAfter);
@@ -31,8 +31,8 @@ function checkForScroll() {
 
 function scrollTest() {
     // See where our IFrame lives:
-    pageScrollPositionBefore = document.body.scrollTop;
-    iFrameScrollPositionBefore = window.frames['target'].document.body.scrollTop;
+    pageScrollPositionBefore = document.scrollingElement.scrollTop;
+    iFrameScrollPositionBefore = window.frames['target'].document.scrollingElement.scrollTop;
 
     iframeTarget = document.getElementById('target');
 
index eb87139..b6d501c 100644 (file)
@@ -14,8 +14,8 @@
         function checkForScroll() {
 
             // The iframe should have scrolled, but not the main page.
-            var pageScrollPositionAfter = document.body.scrollTop;
-            var iframeScrollPositionAfter = window.frames['target'].document.body.scrollTop;
+            var pageScrollPositionAfter = document.scrollingElement.scrollTop;
+            var iframeScrollPositionAfter = window.frames['target'].document.scrollingElement.scrollTop;
 
             if (iframeScrollPositionBefore != iframeScrollPositionAfter)
                 testPassed("iframe received wheel events.");
@@ -27,7 +27,7 @@
 
         function scrollTest() {
             // See where our iframe lives:
-            pageScrollPositionBefore = document.body.scrollTop;
+            pageScrollPositionBefore = document.scrollingElement.scrollTop;
 
             iframeTarget = document.getElementById('target');
 
index 83ad0d9..6e0f206 100644 (file)
@@ -45,7 +45,7 @@ var continueCount = 5;
 function checkForScroll() {
 
     // The page should not have scrolled at all.
-    var pageScrollPositionAfter = document.body.scrollTop;
+    var pageScrollPositionAfter = document.scrollingElement.scrollTop;
     var selectScrollPositionAfter = selectTarget.scrollTop;
 
     //debug("Page before: " + pageScrollPositionBefore + ", select before: " + selectScrollPositionBefore);
@@ -61,7 +61,7 @@ function checkForScroll() {
 
 function scrollTest() {
     // See where our IFrame lives:
-    pageScrollPositionBefore = document.body.scrollTop;
+    pageScrollPositionBefore = document.scrollingElement.scrollTop;
 
     selectTarget = document.getElementById('target');
     selectTarget.scrollTop = selectTarget.scrollHeight - selectTarget.clientHeight - 100;
index 58771b5..2c02c7f 100644 (file)
@@ -43,7 +43,7 @@ var continueCount = 5;
 function checkForScroll() {
 
     // The select should not have scrolled at all.
-    var pageScrollPositionAfter = document.body.scrollTop;
+    var pageScrollPositionAfter = document.scrollingElement.scrollTop;
     var selectScrollPositionAfter = selectTarget.scrollTop;
 
     //debug("Page before: " + pageScrollPositionBefore + ", select before: " + selectScrollPositionBefore);
@@ -59,7 +59,7 @@ function checkForScroll() {
 
 function scrollTest() {
     // See where our IFrame lives:
-    pageScrollPositionBefore = document.body.scrollTop;
+    pageScrollPositionBefore = document.scrollingElement.scrollTop;
 
     selectTarget = document.getElementById('target');
 
index c85e300..02d2f80 100644 (file)
@@ -43,7 +43,7 @@ var continueCount = 5;
 function checkForScroll() {
 
     // The page should not have scrolled at all.
-    var pageScrollPositionAfter = document.body.scrollTop;
+    var pageScrollPositionAfter = document.scrollingElement.scrollTop;
     var selectScrollPositionAfter = selectTarget.scrollTop;
 
     //debug("Page before: " + pageScrollPositionBefore + ", select before: " + selectScrollPositionBefore);
@@ -59,7 +59,7 @@ function checkForScroll() {
 
 function scrollTest() {
     // See where our IFrame lives:
-    pageScrollPositionBefore = document.body.scrollTop;
+    pageScrollPositionBefore = document.scrollingElement.scrollTop;
 
     selectTarget = document.getElementById('target');
     selectTarget.scrollTop = selectTarget.scrollHeight - selectTarget.clientHeight - 100;
index acd6ca9..f4e0e51 100644 (file)
@@ -29,7 +29,7 @@
     function checkForScroll()
     {
         // The iframe should have scrolled, but not the main page.
-        var iframeScrollPositionAfter = window.frames['target'].document.body.scrollTop;
+        var iframeScrollPositionAfter = window.frames['target'].document.scrollingElement.scrollTop;
 
         if (iframeScrollPositionBefore != iframeScrollPositionAfter)
             testPassed("iframe received wheel events.");
 
     function scrollTest()
     {
-        pageScrollPositionBefore = document.body.scrollTop;
+        pageScrollPositionBefore = document.scrollingElement.scrollTop;
 
         var iframeTarget = document.getElementById('target');
-        iframeScrollPositionBefore = iframeTarget.contentDocument.body.scrollTop;
+        iframeScrollPositionBefore = iframeTarget.contentDocument.scrollingElement.scrollTop;
 
         var startPosX = iframeTarget.offsetLeft + 20;
         var startPosY = iframeTarget.offsetTop + 20;
index 9467d84..22681e9 100644 (file)
@@ -65,7 +65,7 @@
 
     function step2()
     {
-      shouldBeTrue(String(document.body.scrollTop != 0));
+      shouldBeTrue(String(document.scrollingElement.scrollTop != 0));
 
       // Then it scrolls down to the end of the page ...
       if (window.eventSender)
index 244305e..368401e 100644 (file)
@@ -7,7 +7,7 @@ if (window.testRunner)
     testRunner.dumpAsText();
 
 window.onload = function() {
-       window.scrollTo(0, document.body.scrollHeight);
+       window.scrollTo(0, document.scrollingElement.scrollHeight);
        document.designMode = 'on';
 }
 </script>
@@ -26,4 +26,4 @@ span {
 <body>
 PASS if no assert in debug.
 <table><tr><th><span><div><pre><a>a<pre><span><details></details></span></pre></a></pre></div></span></tr></th></table>
-</body>
\ No newline at end of file
+</body>
index 64d2520..e29386d 100644 (file)
@@ -10,8 +10,8 @@
         }
 
         document.execCommand("FindString", false, "target");
-        var scrollTop = document.body.scrollTop;
+        var scrollTop = document.scrollingElement.scrollTop;
         var expectedScrollTop = 864;
-        document.getElementById("result").innerText = scrollTop === expectedScrollTop ? "PASS" : "FAIL: document.body.scrollTop was " + scrollTop + ", should be " + expectedScrollTop;
+        document.getElementById("result").innerText = scrollTop === expectedScrollTop ? "PASS" : "FAIL: document.scrollingElement.scrollTop was " + scrollTop + ", should be " + expectedScrollTop;
     </script>
 </body>
index 1c2ba1d..a566210 100644 (file)
@@ -8,8 +8,8 @@ This prevents a cross-origin information leak sometimes know as framesniffing.
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PASS document.body.scrollTop == 0 is true
-PASS document.body.scrollLeft == 0 is true
+PASS document.scrollingElement.scrollTop == 0 is true
+PASS document.scrollingElement.scrollLeft == 0 is true
 PASS successfullyParsed is true
 
 TEST COMPLETE
index 6dfe45f..65beb17 100644 (file)
@@ -8,8 +8,8 @@
       description('This prevents a cross-origin information leak sometimes know as framesniffing.');
       // Check scroll position in a timeout to make sure that the anchor has not been scrolled to.
       setTimeout(function() {
-          shouldBeTrue('document.body.scrollTop == 0');
-          shouldBeTrue('document.body.scrollLeft == 0');
+          shouldBeTrue('document.scrollingElement.scrollTop == 0');
+          shouldBeTrue('document.scrollingElement.scrollLeft == 0');
           finishJSTest();          
       }, 0);
     }
index 329d69f..e2f6344 100644 (file)
@@ -23,7 +23,7 @@ testoffset("absolute"/* in iframe */, function($, iframe) {
        var forceScroll = jQuery('<div>', { width: 2000, height: 2000 }).appendTo('body');
        window.scrollTo(200, 200);
 
-       if ( document.documentElement.scrollTop || document.body.scrollTop ) {
+       if ( document.documentElement.scrollTop || document.scrollingElement.scrollTop ) {
                supportsScroll = true;
        }
 
index 1077bd0..759de5e 100644 (file)
@@ -1243,7 +1243,7 @@ TestNavigator._scrollToCurrentTest = function()
 
     var rowRect = targetLink.getBoundingClientRect();
     // rowRect is in client coords (i.e. relative to viewport), so we just want to add its top to the current scroll position.
-    document.body.scrollTop += rowRect.top;
+    document.scrollingElement.scrollTop += rowRect.top;
 }
 
 TestNavigator.onlyShowUnexpectedFailuresChanged = function()
index f32d5cf..ce2f5c4 100644 (file)
@@ -20,10 +20,10 @@ var result = document.getElementById("result");
 result.innerHTML = "";
 
 function testScroll () {
-       result.innerHTML += (document.body.scrollTop <= 0)? `PASS`: `FAILED: ${document.body.scrollTop} > 0, the page scrolled automatically.`;
+       result.innerHTML += (document.scrollingElement.scrollTop <= 0)? `PASS`: `FAILED: ${document.scrollingElement.scrollTop} > 0, the page scrolled automatically.`;
 
        testRunner.notifyDone();
 }
 </script>
 </body>
-</html>
\ No newline at end of file
+</html>
index 8ac79c8..f75a136 100644 (file)
@@ -1,7 +1,7 @@
 RUN(internals.setMediaElementRestrictions(video, "RequireUserGestureForVideoRateChange,OverrideUserGestureRequirementForMainContent"))
 EVENT(canplaythrough)
 EVENT(playing)
-RUN(document.body.scrollTop = document.body.clientHeight)
+RUN(document.scrollingElement.scrollTop = document.body.clientHeight)
 EXPECTED (video.paused == 'false') OK
 END OF TEST
 
index 22d8933..1facb11 100644 (file)
@@ -22,7 +22,7 @@
     }
 
     function playing() {
-        run('document.body.scrollTop = document.body.clientHeight');
+        run('document.scrollingElement.scrollTop = document.body.clientHeight');
         waitForEventAndFail('pause');
         setTimeout(afterPlaying, 100);
     }
@@ -44,4 +44,4 @@
 </head>
 <body onload="go()">
 </body>
-</html>
\ No newline at end of file
+</html>
index 067c5b6..a84fb92 100644 (file)
             }
             
             function test() {
-              var height = document.body.scrollHeight;
+              var height = document.scrollingElement.scrollHeight;
               if (height == 3000)
                 document.getElementById("result").innerHTML = "PASS";
               else
-                document.getElementById("result").innerHTML = "<p style='color:red'>FAIL document.body.scrollHeight = " + height +"</p>";
+                document.getElementById("result").innerHTML = "<p style='color:red'>FAIL document.scrollingElement.scrollHeight = " + height +"</p>";
               }
         </script> 
     </head>
index 6e64da2..745fb05 100644 (file)
@@ -49,7 +49,7 @@ var continueCount = 5;
 function checkForScroll()
 {
     // The div should not have scrolled at all.
-    var pageScrollPositionAfter = document.body.scrollTop;
+    var pageScrollPositionAfter = document.scrollingElement.scrollTop;
     var divScrollPositionAfter = divTarget.scrollTop;
 
     if (pageScrollPositionBefore != pageScrollPositionAfter)
@@ -67,7 +67,7 @@ function checkForScroll()
 
 function scrollTest()
 {
-    pageScrollPositionBefore = document.body.scrollTop;
+    pageScrollPositionBefore = document.scrollingElement.scrollTop;
 
     divTarget = document.getElementById('target');
     divTarget.scrollTop = divTarget.scrollHeight - divTarget.clientHeight - 100;
index 76eed21..3a2261b 100644 (file)
@@ -43,7 +43,7 @@ var continueCount = 5;
 function checkForScroll()
 {
     // The div should not have scrolled at all.
-    var pageScrollPositionAfter = document.body.scrollTop;
+    var pageScrollPositionAfter = document.scrollingElement.scrollTop;
     var divScrollPositionAfter = divTarget.scrollTop;
 
     if (pageScrollPositionBefore != pageScrollPositionAfter)
@@ -61,7 +61,7 @@ function checkForScroll()
 
 function scrollTest()
 {
-    pageScrollPositionBefore = document.body.scrollTop;
+    pageScrollPositionBefore = document.scrollingElement.scrollTop;
 
     divTarget = document.getElementById('target');
     divTarget.scrollTop = divTarget.scrollHeight - divTarget.clientHeight - 100;
index 6ea2d84..939651c 100644 (file)
@@ -49,14 +49,14 @@ var continueCount = 5;
 
 function onPageScroll()
 {
-    if (document.body.scrollTop >= 70)
+    if (document.scrollingElement.scrollTop >= 70)
         checkForScroll();
 }
 
 function checkForScroll()
 {
     // The div should not have scrolled at all.
-    var pageScrollPositionAfter = document.body.scrollTop;
+    var pageScrollPositionAfter = document.scrollingElement.scrollTop;
     var divScrollPositionAfter = divTarget.scrollTop;
 
     if (divScrollPositionBefore != divScrollPositionAfter)
@@ -74,7 +74,7 @@ function checkForScroll()
 
 function scrollTest()
 {
-    pageScrollPositionBefore = document.body.scrollTop;
+    pageScrollPositionBefore = document.scrollingElement.scrollTop;
 
     divTarget = document.getElementById('target');
 
index 1f59571..93843c3 100644 (file)
@@ -25,8 +25,8 @@ var continueCount = 5;
 function checkForScroll()
 {
     // The IFrame should not have scrolled at all.
-    var pageScrollPositionAfter = document.body.scrollTop;
-    var iFrameScrollPositionAfter = window.frames['target'].document.body.scrollTop;
+    var pageScrollPositionAfter = document.scrollingElement.scrollTop;
+    var iFrameScrollPositionAfter = window.frames['target'].document.scrollingElement.scrollTop;
 
     if (pageScrollPositionBefore != pageScrollPositionAfter)
         testFailed("Page received wheel events.");
@@ -43,7 +43,7 @@ function checkForScroll()
 
 function scrollTest()
 {
-    pageScrollPositionBefore = document.body.scrollTop;
+    pageScrollPositionBefore = document.scrollingElement.scrollTop;
 
     iframeTarget = document.getElementById('target');
 
index 342b316..0d0f30e 100644 (file)
@@ -15,8 +15,8 @@ var continueCount = 5;
 function checkForScroll()
 {
     // The IFrame should not have scrolled at all.
-    var pageScrollPositionAfter = document.body.scrollTop;
-    var iFrameScrollPositionAfter = window.frames['target'].document.body.scrollTop;
+    var pageScrollPositionAfter = document.scrollingElement.scrollTop;
+    var iFrameScrollPositionAfter = window.frames['target'].document.scrollingElement.scrollTop;
 
     if (pageScrollPositionBefore != pageScrollPositionAfter)
         testFailed("Page received wheel events.");
@@ -33,7 +33,7 @@ function checkForScroll()
 
 function scrollTest()
 {
-    pageScrollPositionBefore = document.body.scrollTop;
+    pageScrollPositionBefore = document.scrollingElement.scrollTop;
 
     iframeTarget = document.getElementById('target');
 
index 29ff3c1..17d26b4 100644 (file)
@@ -25,15 +25,15 @@ var continueCount = 5;
 
 function onPageScroll()
 {
-    if (document.body.scrollTop >= 70)
+    if (document.scrollingElement.scrollTop >= 70)
         checkForScroll();
 }
 
 function checkForScroll()
 {
     // The IFrame should not have scrolled at all.
-    var pageScrollPositionAfter = document.body.scrollTop;
-    var iFrameScrollPositionAfter = window.frames['target'].document.body.scrollTop;
+    var pageScrollPositionAfter = document.scrollingElement.scrollTop;
+    var iFrameScrollPositionAfter = window.frames['target'].document.scrollingElement.scrollTop;
 
     if (iFrameScrollPositionBefore != iFrameScrollPositionAfter)
         testFailed("IFrame consumed wheel events.");
@@ -50,8 +50,8 @@ function checkForScroll()
 
 function scrollTest()
 {
-    pageScrollPositionBefore = document.body.scrollTop;
-    iFrameScrollPositionBefore = window.frames['target'].document.body.scrollTop;
+    pageScrollPositionBefore = document.scrollingElement.scrollTop;
+    iFrameScrollPositionBefore = window.frames['target'].document.scrollingElement.scrollTop;
 
     iframeTarget = document.getElementById('target');
 
index 1915b2b..b457d59 100644 (file)
@@ -15,13 +15,13 @@ var selectTargetScrollPositionBefore;
 function checkForScroll()
 {
     // The IFrame should not have scrolled at all.
-    var pageScrollPositionAfter = document.body.scrollTop;
+    var pageScrollPositionAfter = document.scrollingElement.scrollTop;
     if (pageScrollPositionAfter != pageScrollPositionAfter)
         testFailed("Page consumed wheel events.");
     else
         testPassed("Page did not receive wheel events.");
 
-    var iFrameScrollPositionAfter = window.frames['target'].document.body.scrollTop;
+    var iFrameScrollPositionAfter = window.frames['target'].document.scrollingElement.scrollTop;
     if (iFrameScrollPositionBefore != iFrameScrollPositionAfter)
         testFailed("IFrame consumed wheel events.");
     else
@@ -39,8 +39,8 @@ function checkForScroll()
 
 function scrollTest()
 {
-    pageScrollPositionBefore = document.body.scrollTop;
-    iFrameScrollPositionBefore = window.frames['target'].document.body.scrollTop;
+    pageScrollPositionBefore = document.scrollingElement.scrollTop;
+    iFrameScrollPositionBefore = window.frames['target'].document.scrollingElement.scrollTop;
 
     iframeTarget = document.getElementById('target');
 
index 60210f7..ebed5a9 100644 (file)
@@ -49,14 +49,14 @@ var continueCount = 5;
 
 function onPageScroll()
 {
-    if (document.body.scrollTop >= 70)
+    if (document.scrollingElement.scrollTop >= 70)
         checkForScroll();
 }
 
 function checkForScroll()
 {
     // The select should not have scrolled at all.
-    var pageScrollPositionAfter = document.body.scrollTop;
+    var pageScrollPositionAfter = document.scrollingElement.scrollTop;
     var selectScrollPositionAfter = selectTarget.scrollTop;
 
     if (selectScrollPositionBefore != selectScrollPositionAfter)
@@ -74,7 +74,7 @@ function checkForScroll()
 
 function scrollTest()
 {
-    pageScrollPositionBefore = document.body.scrollTop;
+    pageScrollPositionBefore = document.scrollingElement.scrollTop;
 
     selectTarget = document.getElementById('target');
 
index f732715..63d951e 100644 (file)
@@ -43,14 +43,14 @@ var continueCount = 5;
 
 function onPageScroll()
 {
-    if (document.body.scrollTop >= 70)
+    if (document.scrollingElement.scrollTop >= 70)
         checkForScroll();
 }
 
 function checkForScroll()
 {
     // The select should not have scrolled at all.
-    var pageScrollPositionAfter = document.body.scrollTop;
+    var pageScrollPositionAfter = document.scrollingElement.scrollTop;
     var selectScrollPositionAfter = selectTarget.scrollTop;
 
     if (selectScrollPositionBefore != selectScrollPositionAfter)
@@ -68,7 +68,7 @@ function checkForScroll()
 
 function scrollTest()
 {
-    pageScrollPositionBefore = document.body.scrollTop;
+    pageScrollPositionBefore = document.scrollingElement.scrollTop;
 
     selectTarget = document.getElementById('target');
 
index fa3434b..5072da4 100644 (file)
@@ -49,7 +49,7 @@ var continueCount = 5;
 function checkForScroll()
 {
     // The page should not have scrolled at all.
-    var pageScrollPositionAfter = document.body.scrollTop;
+    var pageScrollPositionAfter = document.scrollingElement.scrollTop;
     var selectScrollPositionAfter = selectTarget.scrollTop;
 
     if (pageScrollPositionBefore != pageScrollPositionAfter)
@@ -67,7 +67,7 @@ function checkForScroll()
 
 function scrollTest()
 {
-    pageScrollPositionBefore = document.body.scrollTop;
+    pageScrollPositionBefore = document.scrollingElement.scrollTop;
 
     selectTarget = document.getElementById('target');
     selectTarget.scrollTop = selectTarget.scrollHeight - selectTarget.clientHeight - 100;
index 9391544..d297e68 100644 (file)
@@ -43,7 +43,7 @@ var continueCount = 5;
 function checkForScroll()
 {
     // The page should not have scrolled at all.
-    var pageScrollPositionAfter = document.body.scrollTop;
+    var pageScrollPositionAfter = document.scrollingElement.scrollTop;
     var selectScrollPositionAfter = selectTarget.scrollTop;
 
     if (pageScrollPositionBefore != pageScrollPositionAfter)
@@ -61,7 +61,7 @@ function checkForScroll()
 
 function scrollTest()
 {
-    pageScrollPositionBefore = document.body.scrollTop;
+    pageScrollPositionBefore = document.scrollingElement.scrollTop;
 
     selectTarget = document.getElementById('target');
     selectTarget.scrollTop = selectTarget.scrollHeight - selectTarget.clientHeight - 100;
index f45c1b9..fc9f4fd 100644 (file)
@@ -99,7 +99,7 @@ document.addEventListener("DOMContentLoaded", function() {
 
 function checkForScroll()
 {
-    var pageScrollPositionAfterGesture = document.body.scrollTop;
+    var pageScrollPositionAfterGesture = document.scrollingElement.scrollTop;
 
     // The page should not have scrolled
     if (pageScrollPositionBeforeGesture != pageScrollPositionAfterGesture)
@@ -120,7 +120,7 @@ function checkForScroll()
 
 function scrollTest()
 {
-    pageScrollPositionBeforeGesture = document.body.scrollTop;
+    pageScrollPositionBeforeGesture = document.scrollingElement.scrollTop;
 
     divElement = document.getElementById('objectBack');
 
@@ -178,4 +178,4 @@ description("Tests that iframe doesn't consume wheel events when scrolling a sel
 </script>
 <script src="../../resources/js-test-post.js"></script>
 </body>
-</html>
\ No newline at end of file
+</html>
index 0013973..f30a0f3 100644 (file)
@@ -26,7 +26,7 @@
         {
             window.setTimeout(function() {
                 // Scroll to test the mapping from document to view coords.
-                document.body.scrollTop = 195;
+                document.scrollingElement.scrollTop = 195;
                 dumpRegion();
                 if (window.testRunner)
                     testRunner.notifyDone();
index a30a265..958df29 100644 (file)
@@ -24,7 +24,7 @@
         {
             window.setTimeout(function() {
                 // Scroll to test the mapping from document to view coords.
-                document.body.scrollTop = 195;
+                document.scrollingElement.scrollTop = 195;
                 dumpRegion();
                 if (window.testRunner)
                     testRunner.notifyDone();
index 63cbaac..8d20a03 100644 (file)
@@ -32,7 +32,7 @@
                 internals.updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks();
 
             // Scroll to test the mapping from document to view coords.
-            document.body.scrollTop = 197;
+            document.scrollingElement.scrollTop = 197;
             dumpRegion();
             if (window.testRunner)
                 testRunner.notifyDone();
index 90435ec..fc0eb40 100644 (file)
@@ -10,7 +10,7 @@ html {
 <script>
 function checkForScroll()
 {
-    var pageScrollPositionAfter = document.body.scrollTop;
+    var pageScrollPositionAfter = document.scrollingElement.scrollTop;
     var finishLog = document.getElementById("finishLog");
     if (pageScrollPositionAfter > 50)
         finishLog.innerHTML = "Success!";
index f9d7278..7fd6488 100644 (file)
@@ -42,7 +42,7 @@
 
         function scrollSnapTest() {
             // See where our div lives:
-            pageScrollPositionBefore = document.body.scrollLeft;
+            pageScrollPositionBefore = document.scrollingElement.scrollLeft;
 
             divTarget = document.getElementById('target');
  
         <div id="item4" class="colorBox"></div>
         <div id="item5" class="colorBox"></div>
     </body>
-</html>
\ No newline at end of file
+</html>
index dfdde85..e6a76fd 100644 (file)
@@ -42,7 +42,7 @@
 
         function scrollSnapTest() {
             // See where our div lives:
-            pageScrollPositionBefore = document.body.scrollLeft;
+            pageScrollPositionBefore = document.scrollingElement.scrollLeft;
 
             divTarget = document.getElementById('target');
  
         <div id="item4" class="colorBox"></div>
         <div id="item5" class="colorBox"></div>
     </body>
-</html>
\ No newline at end of file
+</html>
index 6268244..e0be132 100644 (file)
@@ -42,7 +42,7 @@
 
         function scrollSnapTest() {
             // See where our div lives:
-            pageScrollPositionBefore = document.body.scrollTop;
+            pageScrollPositionBefore = document.scrollingElement.scrollTop;
 
             divTarget = document.getElementById('target');
  
         <div id="item4" class="colorBox"></div>
         <div id="item5" class="colorBox"></div>
     </body>
-</html>
\ No newline at end of file
+</html>
index 8538581..1d40844 100644 (file)
             eventSender.mouseScrollByWithWheelAndMomentumPhases(-4, 0, 'none', 'continue');
             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end');
             eventSender.callAfterScrollingCompletes(() => {
-                if (document.body.scrollTop == 0)
+                if (document.scrollingElement.scrollTop == 0)
                     testPassed("scroll offset snapped back to top.");
                 else
-                    testFailed(`did not honor snap points (expected 0, observed ${document.body.scrollTop}).`);
+                    testFailed(`did not honor snap points (expected 0, observed ${document.scrollingElement.scrollTop}).`);
 
                 finishJSTest();
             });
@@ -73,4 +73,4 @@
         <div id="item4" class="colorBox"></div>
         <div id="item5" class="colorBox"></div>
     </body>
-</html>
\ No newline at end of file
+</html>
index 9fd289c..2b7da7d 100644 (file)
@@ -42,7 +42,7 @@
 
         function scrollSnapTest() {
             // See where our div lives:
-            pageScrollPositionBefore = document.body.scrollTop;
+            pageScrollPositionBefore = document.scrollingElement.scrollTop;
 
             divTarget = document.getElementById('target');
  
         <div id="item4" class="colorBox"></div>
         <div id="item5" class="colorBox"></div>
     </body>
-</html>
\ No newline at end of file
+</html>
index 679971b..008b11c 100644 (file)
@@ -46,9 +46,9 @@
                 eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, "ended", "none");
                 eventSender.callAfterScrollingCompletes(() => {
                     let areaHeight = document.querySelector(".area").clientHeight;
-                    write(`- Did the scrolling snap to the top? ${document.body.scrollTop == 0 ? "YES" : "NO"}`);
-                    write(`- Did scrolling snap to the second box? ${document.body.scrollTop == areaHeight ? "YES" : "NO"}`);
-                    document.body.scrollTop = 0;
+                    write(`- Did the scrolling snap to the top? ${document.scrollingElement.scrollTop == 0 ? "YES" : "NO"}`);
+                    write(`- Did scrolling snap to the second box? ${document.scrollingElement.scrollTop == areaHeight ? "YES" : "NO"}`);
+                    document.scrollingElement.scrollTop = 0;
                     setTimeout(resolve, 0);
                 });
             });