WebKit Bugzilla
Attachment 340070 Details for
Bug 173833
: [iOS] Adjust layer hierarchy to handle frame scrolling
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch (applies on top of bug 182785)
0002-Bug-173833-iOS-Adjust-layer-hierarchy-to-handle-fram.patch (text/plain), 102.26 KB, created by
Frédéric Wang (:fredw)
on 2018-05-09 23:32:30 PDT
(
hide
)
Description:
Patch (applies on top of bug 182785)
Filename:
MIME Type:
Creator:
Frédéric Wang (:fredw)
Created:
2018-05-09 23:32:30 PDT
Size:
102.26 KB
patch
obsolete
>From bb661633bcd28e76202b662e8930b2e64e0cd7f2 Mon Sep 17 00:00:00 2001 >From: Frederic Wang <fwang@igalia.com> >Date: Fri, 16 Feb 2018 10:36:17 +0100 >Subject: [PATCH xserver 2/4] Bug 173833 - [iOS] Adjust layer hierarchy to > handle frame scrolling > >--- > LayoutTests/ChangeLog | 67 ++++++++++ > ...ome-composited-nested-iframes-expected.txt | 4 + > .../become-overlapped-iframe-expected.txt | 1 + > .../composited-parent-iframe-expected.txt | 1 + > ...ct-compositing-iframe-delayed-expected.txt | 1 + > .../connect-compositing-iframe-expected.txt | 1 + > .../connect-compositing-iframe2-expected.txt | 1 + > .../connect-compositing-iframe3-expected.txt | 1 + > .../enter-compositing-iframe-expected.txt | 1 + > .../iframes/iframe-resize-expected.txt | 1 + > .../iframes/overlapped-iframe-expected.txt | 1 + > .../overlapped-iframe-iframe-expected.txt | 1 + > .../overlapped-nested-iframes-expected.txt | 4 + > .../page-cache-layer-tree-expected.txt | 2 + > .../iframes/scrolling-iframe-expected.txt | 1 + > ...ositing-iframe-scroll-repaint-expected.txt | 1 + > ...-fixed-background-doc-repaint-expected.txt | 1 + > ...-with-layers-outside-viewport-expected.txt | 1 + > .../ios/hit-testing-iframe-expected.html | 11 ++ > .../scrolling/ios/hit-testing-iframe.html | 119 ++++++++++++++++++ > .../scrolling/ios/scroll-iframe-expected.html | 11 ++ > .../fast/scrolling/ios/scroll-iframe.html | 109 ++++++++++++++++ > .../composited-parent-iframe-expected.txt | 1 + > ...ct-compositing-iframe-delayed-expected.txt | 1 + > .../connect-compositing-iframe-expected.txt | 1 + > .../connect-compositing-iframe2-expected.txt | 1 + > .../connect-compositing-iframe3-expected.txt | 1 + > .../enter-compositing-iframe-expected.txt | 1 + > .../iframes/iframe-resize-expected.txt | 1 + > .../leave-compositing-iframe-expected.txt | 1 + > .../iframes/overlapped-iframe-expected.txt | 1 + > .../page-cache-layer-tree-expected.txt | 2 + > .../iframes/scrolling-iframe-expected.txt | 1 + > .../rtl/rtl-iframe-absolute-expected.txt | 1 + > .../rtl-iframe-absolute-overflow-expected.txt | 1 + > .../rtl/rtl-iframe-fixed-expected.txt | 1 + > .../rtl/rtl-iframe-relative-expected.txt | 1 + > ...drawing-async-frame-scrolling-expected.txt | 21 ++-- > .../iframe-and-layers-expected.txt | 5 +- > ...ome-composited-nested-iframes-expected.txt | 4 + > .../become-overlapped-iframe-expected.txt | 1 + > .../invisible-nested-iframe-show-expected.txt | 2 + > .../overlapped-iframe-iframe-expected.txt | 57 +++++++++ > .../overlapped-nested-iframes-expected.txt | 4 + > .../compositing/iframes/resizer-expected.txt | 1 + > ...-with-layers-outside-viewport-expected.txt | 1 + > ...ositing-iframe-scroll-repaint-expected.txt | 1 + > ...-fixed-background-doc-repaint-expected.txt | 1 + > ...drawing-async-frame-scrolling-expected.txt | 21 ++-- > .../invisible-nested-iframe-show-expected.txt | 2 + > .../compositing/iframes/resizer-expected.txt | 1 + > .../iframe-and-layers-expected.txt | 5 +- > .../frames/fixed-inside-frame-expected.txt | 1 + > ...erage-iframe-to-zero-coverage-expected.txt | 1 + > Source/WebCore/ChangeLog | 52 ++++++++ > Source/WebCore/page/EventHandler.cpp | 2 +- > Source/WebCore/page/FrameView.cpp | 5 + > Source/WebCore/page/FrameView.h | 2 + > .../ScrollingTreeFrameScrollingNode.h | 4 +- > .../ios/ScrollingTreeFrameScrollingNodeIOS.h | 22 ++-- > .../scrolling/mac/ScrollingTreeStickyNode.mm | 6 +- > Source/WebCore/platform/ScrollView.cpp | 8 ++ > Source/WebCore/platform/ScrollView.h | 3 + > .../platform/graphics/ca/GraphicsLayerCA.cpp | 3 +- > .../rendering/RenderLayerCompositor.cpp | 21 +++- > Source/WebKit/ChangeLog | 41 ++++++ > .../RemoteLayerTree/RemoteScrollingTree.cpp | 14 ++- > .../ios/RemoteScrollingCoordinatorProxyIOS.mm | 3 + > .../ScrollingTreeSubframeScrollingNodeIOS.h | 60 +++++++++ > .../ScrollingTreeSubframeScrollingNodeIOS.mm | 94 ++++++++++++++ > .../WebKit/WebKit.xcodeproj/project.pbxproj | 8 ++ > 71 files changed, 786 insertions(+), 48 deletions(-) > create mode 100644 LayoutTests/fast/scrolling/ios/hit-testing-iframe-expected.html > create mode 100644 LayoutTests/fast/scrolling/ios/hit-testing-iframe.html > create mode 100644 LayoutTests/fast/scrolling/ios/scroll-iframe-expected.html > create mode 100644 LayoutTests/fast/scrolling/ios/scroll-iframe.html > create mode 100644 LayoutTests/platform/ios/compositing/iframes/overlapped-iframe-iframe-expected.txt > create mode 100644 Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeSubframeScrollingNodeIOS.h > create mode 100644 Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeSubframeScrollingNodeIOS.mm > >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 834d5f7a207..abfa0c26b69 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,70 @@ >+2018-02-16 Frederic Wang <fwang@igalia.com> >+ >+ [iOS] Adjust layer hierarchy to handle frame scrolling >+ https://bugs.webkit.org/show_bug.cgi?id=173833 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ New tests are added to verify iOS frame scrolling in different scenarios. >+ Other test expectations are updated now that the size is set for subframes. >+ >+ * fast/scrolling/ios/hit-testing-iframe.html: Added. This test verifies hit testing for >+ a frame taking into account cases like overlapping element or user/programmatic scroll. >+ * fast/scrolling/ios/hit-testing-iframe-expected.html: Added. >+ * fast/scrolling/ios/scroll-iframe.html: Added. This test relies on >+ uiController.dragFromPointToPoint to simulate user scrolling. It also has a test with very >+ large content to verify the fix in GraphicsLayerCA. >+ * fast/scrolling/ios/scroll-iframe-expected.html: Added. >+ * compositing/iframes/become-composited-nested-iframes-expected.txt: >+ * compositing/iframes/become-overlapped-iframe-expected.txt: >+ * compositing/iframes/composited-parent-iframe-expected.txt: >+ * compositing/iframes/connect-compositing-iframe-delayed-expected.txt: >+ * compositing/iframes/connect-compositing-iframe-expected.txt: >+ * compositing/iframes/connect-compositing-iframe2-expected.txt: >+ * compositing/iframes/connect-compositing-iframe3-expected.txt: >+ * compositing/iframes/enter-compositing-iframe-expected.txt: >+ * compositing/iframes/iframe-resize-expected.txt: >+ * compositing/iframes/overlapped-iframe-expected.txt: >+ * compositing/iframes/overlapped-iframe-iframe-expected.txt: >+ * compositing/iframes/overlapped-nested-iframes-expected.txt: >+ * compositing/iframes/page-cache-layer-tree-expected.txt: >+ * compositing/iframes/scrolling-iframe-expected.txt: >+ * compositing/repaint/iframes/compositing-iframe-scroll-repaint-expected.txt: >+ * compositing/repaint/iframes/compositing-iframe-with-fixed-background-doc-repaint-expected.txt: >+ * compositing/visible-rect/iframe-with-layers-outside-viewport-expected.txt: >+ * platform/ios-wk2/compositing/iframes/composited-parent-iframe-expected.txt: >+ * platform/ios-wk2/compositing/iframes/connect-compositing-iframe-delayed-expected.txt: >+ * platform/ios-wk2/compositing/iframes/connect-compositing-iframe-expected.txt: >+ * platform/ios-wk2/compositing/iframes/connect-compositing-iframe2-expected.txt: >+ * platform/ios-wk2/compositing/iframes/connect-compositing-iframe3-expected.txt: >+ * platform/ios-wk2/compositing/iframes/enter-compositing-iframe-expected.txt: >+ * platform/ios-wk2/compositing/iframes/iframe-resize-expected.txt: >+ * platform/ios-wk2/compositing/iframes/leave-compositing-iframe-expected.txt: >+ * platform/ios-wk2/compositing/iframes/overlapped-iframe-expected.txt: >+ * platform/ios-wk2/compositing/iframes/page-cache-layer-tree-expected.txt: >+ * platform/ios-wk2/compositing/iframes/scrolling-iframe-expected.txt: >+ * platform/ios-wk2/compositing/rtl/rtl-iframe-absolute-expected.txt: >+ * platform/ios-wk2/compositing/rtl/rtl-iframe-absolute-overflow-expected.txt: >+ * platform/ios-wk2/compositing/rtl/rtl-iframe-fixed-expected.txt: >+ * platform/ios-wk2/compositing/rtl/rtl-iframe-relative-expected.txt: >+ * platform/ios-wk2/compositing/tiling/tiled-drawing-async-frame-scrolling-expected.txt: >+ * platform/ios-wk2/compositing/visible-rect/iframe-and-layers-expected.txt: >+ * platform/ios/compositing/iframes/become-composited-nested-iframes-expected.txt: >+ * platform/ios/compositing/iframes/become-overlapped-iframe-expected.txt: >+ * platform/ios/compositing/iframes/invisible-nested-iframe-show-expected.txt: >+ * platform/ios/compositing/iframes/overlapped-iframe-iframe-expected.txt: Copied from LayoutTests/compositing/iframes/overlapped-iframe-iframe-expected.txt. >+ * platform/ios/compositing/iframes/overlapped-nested-iframes-expected.txt: >+ * platform/ios/compositing/iframes/resizer-expected.txt: >+ * platform/ios/compositing/visible-rect/iframe-with-layers-outside-viewport-expected.txt: >+ * platform/mac-wk1/compositing/repaint/iframes/compositing-iframe-scroll-repaint-expected.txt: >+ * platform/mac-wk1/compositing/repaint/iframes/compositing-iframe-with-fixed-background-doc-repaint-expected.txt: >+ * platform/mac-wk2/compositing/tiling/tiled-drawing-async-frame-scrolling-expected.txt: >+ * platform/mac/compositing/iframes/invisible-nested-iframe-show-expected.txt: >+ * platform/mac/compositing/iframes/resizer-expected.txt: >+ * platform/mac/compositing/visible-rect/iframe-and-layers-expected.txt: >+ * tiled-drawing/scrolling/frames/fixed-inside-frame-expected.txt: >+ * tiled-drawing/tile-coverage-iframe-to-zero-coverage-expected.txt: >+ > 2018-05-09 Dominik Infuehr <dinfuehr@igalia.com> > > [ARM] Disable test on Linux due to lack of executable memory >diff --git a/LayoutTests/compositing/iframes/become-composited-nested-iframes-expected.txt b/LayoutTests/compositing/iframes/become-composited-nested-iframes-expected.txt >index 338dccb9dd9..1d2ea27922d 100644 >--- a/LayoutTests/compositing/iframes/become-composited-nested-iframes-expected.txt >+++ b/LayoutTests/compositing/iframes/become-composited-nested-iframes-expected.txt >@@ -20,6 +20,7 @@ > (bounds 280.00 200.00) > (children 1 > (GraphicsLayer >+ (bounds 280.00 200.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >@@ -42,6 +43,7 @@ > (bounds 250.00 170.00) > (children 1 > (GraphicsLayer >+ (bounds 250.00 170.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >@@ -93,6 +95,7 @@ > (bounds 280.00 200.00) > (children 1 > (GraphicsLayer >+ (bounds 280.00 200.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >@@ -115,6 +118,7 @@ > (bounds 250.00 170.00) > (children 1 > (GraphicsLayer >+ (bounds 250.00 170.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >diff --git a/LayoutTests/compositing/iframes/become-overlapped-iframe-expected.txt b/LayoutTests/compositing/iframes/become-overlapped-iframe-expected.txt >index a59398dc76b..ed4cb1aca45 100644 >--- a/LayoutTests/compositing/iframes/become-overlapped-iframe-expected.txt >+++ b/LayoutTests/compositing/iframes/become-overlapped-iframe-expected.txt >@@ -20,6 +20,7 @@ > (bounds 305.00 170.00) > (children 1 > (GraphicsLayer >+ (bounds 305.00 170.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >diff --git a/LayoutTests/compositing/iframes/composited-parent-iframe-expected.txt b/LayoutTests/compositing/iframes/composited-parent-iframe-expected.txt >index 228568f1c5b..5e6dda89f42 100644 >--- a/LayoutTests/compositing/iframes/composited-parent-iframe-expected.txt >+++ b/LayoutTests/compositing/iframes/composited-parent-iframe-expected.txt >@@ -21,6 +21,7 @@ > (bounds 285.00 150.00) > (children 1 > (GraphicsLayer >+ (bounds 285.00 150.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >diff --git a/LayoutTests/compositing/iframes/connect-compositing-iframe-delayed-expected.txt b/LayoutTests/compositing/iframes/connect-compositing-iframe-delayed-expected.txt >index a0beac1fb12..e4bab53a4a1 100644 >--- a/LayoutTests/compositing/iframes/connect-compositing-iframe-delayed-expected.txt >+++ b/LayoutTests/compositing/iframes/connect-compositing-iframe-delayed-expected.txt >@@ -23,6 +23,7 @@ When the parent document becomes composited, the layer trees should get connecte > (bounds 285.00 150.00) > (children 1 > (GraphicsLayer >+ (bounds 285.00 150.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >diff --git a/LayoutTests/compositing/iframes/connect-compositing-iframe-expected.txt b/LayoutTests/compositing/iframes/connect-compositing-iframe-expected.txt >index 91c07f064e9..396a0bfaafa 100644 >--- a/LayoutTests/compositing/iframes/connect-compositing-iframe-expected.txt >+++ b/LayoutTests/compositing/iframes/connect-compositing-iframe-expected.txt >@@ -20,6 +20,7 @@ > (bounds 285.00 150.00) > (children 1 > (GraphicsLayer >+ (bounds 285.00 150.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >diff --git a/LayoutTests/compositing/iframes/connect-compositing-iframe2-expected.txt b/LayoutTests/compositing/iframes/connect-compositing-iframe2-expected.txt >index 91c07f064e9..396a0bfaafa 100644 >--- a/LayoutTests/compositing/iframes/connect-compositing-iframe2-expected.txt >+++ b/LayoutTests/compositing/iframes/connect-compositing-iframe2-expected.txt >@@ -20,6 +20,7 @@ > (bounds 285.00 150.00) > (children 1 > (GraphicsLayer >+ (bounds 285.00 150.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >diff --git a/LayoutTests/compositing/iframes/connect-compositing-iframe3-expected.txt b/LayoutTests/compositing/iframes/connect-compositing-iframe3-expected.txt >index b563cbf3ac5..69afe7a7977 100644 >--- a/LayoutTests/compositing/iframes/connect-compositing-iframe3-expected.txt >+++ b/LayoutTests/compositing/iframes/connect-compositing-iframe3-expected.txt >@@ -20,6 +20,7 @@ > (bounds 285.00 150.00) > (children 1 > (GraphicsLayer >+ (bounds 285.00 150.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >diff --git a/LayoutTests/compositing/iframes/enter-compositing-iframe-expected.txt b/LayoutTests/compositing/iframes/enter-compositing-iframe-expected.txt >index 91c07f064e9..396a0bfaafa 100644 >--- a/LayoutTests/compositing/iframes/enter-compositing-iframe-expected.txt >+++ b/LayoutTests/compositing/iframes/enter-compositing-iframe-expected.txt >@@ -20,6 +20,7 @@ > (bounds 285.00 150.00) > (children 1 > (GraphicsLayer >+ (bounds 285.00 150.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >diff --git a/LayoutTests/compositing/iframes/iframe-resize-expected.txt b/LayoutTests/compositing/iframes/iframe-resize-expected.txt >index d4b0fe3ca6b..8fcf7a810a8 100644 >--- a/LayoutTests/compositing/iframes/iframe-resize-expected.txt >+++ b/LayoutTests/compositing/iframes/iframe-resize-expected.txt >@@ -20,6 +20,7 @@ > (bounds 385.00 120.00) > (children 1 > (GraphicsLayer >+ (bounds 385.00 120.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >diff --git a/LayoutTests/compositing/iframes/overlapped-iframe-expected.txt b/LayoutTests/compositing/iframes/overlapped-iframe-expected.txt >index 91c07f064e9..396a0bfaafa 100644 >--- a/LayoutTests/compositing/iframes/overlapped-iframe-expected.txt >+++ b/LayoutTests/compositing/iframes/overlapped-iframe-expected.txt >@@ -20,6 +20,7 @@ > (bounds 285.00 150.00) > (children 1 > (GraphicsLayer >+ (bounds 285.00 150.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >diff --git a/LayoutTests/compositing/iframes/overlapped-iframe-iframe-expected.txt b/LayoutTests/compositing/iframes/overlapped-iframe-iframe-expected.txt >index 3c42904f0aa..83c04417d42 100644 >--- a/LayoutTests/compositing/iframes/overlapped-iframe-iframe-expected.txt >+++ b/LayoutTests/compositing/iframes/overlapped-iframe-iframe-expected.txt >@@ -18,6 +18,7 @@ > (bounds 300.00 300.00) > (children 1 > (GraphicsLayer >+ (bounds 300.00 300.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >diff --git a/LayoutTests/compositing/iframes/overlapped-nested-iframes-expected.txt b/LayoutTests/compositing/iframes/overlapped-nested-iframes-expected.txt >index d17941672cb..8c883630147 100644 >--- a/LayoutTests/compositing/iframes/overlapped-nested-iframes-expected.txt >+++ b/LayoutTests/compositing/iframes/overlapped-nested-iframes-expected.txt >@@ -20,6 +20,7 @@ > (bounds 280.00 200.00) > (children 1 > (GraphicsLayer >+ (bounds 280.00 200.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >@@ -42,6 +43,7 @@ > (bounds 250.00 170.00) > (children 1 > (GraphicsLayer >+ (bounds 250.00 170.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >@@ -93,6 +95,7 @@ > (bounds 280.00 200.00) > (children 1 > (GraphicsLayer >+ (bounds 280.00 200.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >@@ -115,6 +118,7 @@ > (bounds 250.00 170.00) > (children 1 > (GraphicsLayer >+ (bounds 250.00 170.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >diff --git a/LayoutTests/compositing/iframes/page-cache-layer-tree-expected.txt b/LayoutTests/compositing/iframes/page-cache-layer-tree-expected.txt >index ce4775d015d..a4df710c48b 100644 >--- a/LayoutTests/compositing/iframes/page-cache-layer-tree-expected.txt >+++ b/LayoutTests/compositing/iframes/page-cache-layer-tree-expected.txt >@@ -27,6 +27,7 @@ This tests that layers are rebuilt properly after the page is restored from the > (bounds 285.00 135.00) > (children 1 > (GraphicsLayer >+ (bounds 285.00 135.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >@@ -77,6 +78,7 @@ This tests that layers are rebuilt properly after the page is restored from the > (bounds 285.00 135.00) > (children 1 > (GraphicsLayer >+ (bounds 285.00 135.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >diff --git a/LayoutTests/compositing/iframes/scrolling-iframe-expected.txt b/LayoutTests/compositing/iframes/scrolling-iframe-expected.txt >index c45b27e0ad0..b478a80d73c 100644 >--- a/LayoutTests/compositing/iframes/scrolling-iframe-expected.txt >+++ b/LayoutTests/compositing/iframes/scrolling-iframe-expected.txt >@@ -21,6 +21,7 @@ > (children 1 > (GraphicsLayer > (position -80.00 -80.00) >+ (bounds 285.00 135.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >diff --git a/LayoutTests/compositing/repaint/iframes/compositing-iframe-scroll-repaint-expected.txt b/LayoutTests/compositing/repaint/iframes/compositing-iframe-scroll-repaint-expected.txt >index 7f8c590e19a..169449e7fcc 100644 >--- a/LayoutTests/compositing/repaint/iframes/compositing-iframe-scroll-repaint-expected.txt >+++ b/LayoutTests/compositing/repaint/iframes/compositing-iframe-scroll-repaint-expected.txt >@@ -22,6 +22,7 @@ > (children 1 > (GraphicsLayer > (position 0.00 -100.00) >+ (bounds 400.00 300.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >diff --git a/LayoutTests/compositing/repaint/iframes/compositing-iframe-with-fixed-background-doc-repaint-expected.txt b/LayoutTests/compositing/repaint/iframes/compositing-iframe-with-fixed-background-doc-repaint-expected.txt >index 9a015caacab..5dab6cb6b68 100644 >--- a/LayoutTests/compositing/repaint/iframes/compositing-iframe-with-fixed-background-doc-repaint-expected.txt >+++ b/LayoutTests/compositing/repaint/iframes/compositing-iframe-with-fixed-background-doc-repaint-expected.txt >@@ -22,6 +22,7 @@ > (children 1 > (GraphicsLayer > (position 0.00 -100.00) >+ (bounds 400.00 300.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >diff --git a/LayoutTests/compositing/visible-rect/iframe-with-layers-outside-viewport-expected.txt b/LayoutTests/compositing/visible-rect/iframe-with-layers-outside-viewport-expected.txt >index afee5f08dbc..01e3730d2e0 100644 >--- a/LayoutTests/compositing/visible-rect/iframe-with-layers-outside-viewport-expected.txt >+++ b/LayoutTests/compositing/visible-rect/iframe-with-layers-outside-viewport-expected.txt >@@ -40,6 +40,7 @@ > (contentsScale 1.00) > (children 1 > (GraphicsLayer >+ (bounds 285.00 135.00) > (visible rect 0.00, 0.00 0.00 x 0.00) > (coverage rect 0.00, 0.00 0.00 x 0.00) > (intersects coverage rect 0) >diff --git a/LayoutTests/fast/scrolling/ios/hit-testing-iframe-expected.html b/LayoutTests/fast/scrolling/ios/hit-testing-iframe-expected.html >new file mode 100644 >index 00000000000..5eeaf9e22a2 >--- /dev/null >+++ b/LayoutTests/fast/scrolling/ios/hit-testing-iframe-expected.html >@@ -0,0 +1,11 @@ >+<!DOCTYPE html> >+<html >+ <head> >+ <title>Hit testing of iframe</title> >+ </head> >+ <body> >+ <p>This test passes if you see a green rectangle.</p> >+ <div style="position: absolute; top: 3em; width: 300px; height: 200px; background: green;"> >+ </div> >+</body> >+</html> >diff --git a/LayoutTests/fast/scrolling/ios/hit-testing-iframe.html b/LayoutTests/fast/scrolling/ios/hit-testing-iframe.html >new file mode 100644 >index 00000000000..aa457020d04 >--- /dev/null >+++ b/LayoutTests/fast/scrolling/ios/hit-testing-iframe.html >@@ -0,0 +1,119 @@ >+<!DOCTYPE html> >+<html> >+ <head> >+ <title>Hit testing of iframe</title> >+ <meta name="viewport" content="width=device-width, initial-scale=1"> >+ <script src="../../../resources/basic-gestures.js"></script> >+ <script type="text/javascript"> >+ if (window.testRunner) >+ testRunner.waitUntilDone(); >+ if (window.internals) >+ internals.settings.setAsyncFrameScrollingEnabled(true); >+ >+ function frameBox(id) >+ { >+ return document.getElementById(id).getBoundingClientRect(); >+ } >+ >+ function waitPromise(delay) >+ { >+ return new Promise((resolve) => { setTimeout(resolve, delay); }); >+ } >+ >+ async function runTest() { >+ if (!window.testRunner || !testRunner.runUIScript) >+ return; >+ >+ // This verifies whether the iframe handles clicks inside or ouside its content box. >+ var p = frameBox("clickInContentBox"); >+ await tapAtPoint(p.left + 7, p.top + 7); >+ p = frameBox("clickInPaddingBoxOutOfContentBox"); >+ await tapAtPoint(p.left + 3, p.top + 3); >+ >+ // This verifies that a click event is consumed by the element on top the frame. >+ p = frameBox("clickElementAboveFrame"); >+ await tapAtPoint(p.left + 50, p.top + 50); >+ >+ // This verifies that a click event is consumed by an element inside the frame. >+ p = frameBox("clickElementInsideFrame"); >+ await tapAtPoint(p.left + 7 + 10, p.top + 7 + 10); >+ >+ // This verifies that a click event is consumed by an element inside the frame, after a programmatic scroll. >+ document.getElementById("clickElementInsideFrameAfterProgrammaticScroll").contentWindow.window.scrollTo(100, 100); >+ p = frameBox("clickElementInsideFrameAfterProgrammaticScroll"); >+ await tapAtPoint(p.left + 7 + 10, p.top + 7 + 10); >+ >+ // This verifies that a click event is consumed by an element inside the frame, after a user scroll. >+ p = frameBox("clickElementInsideFrameAfterUserScroll"); >+ await touchAndDragFromPointToPoint(p.left + 7, p.top + 7, p.left + 7, p.top - 150); >+ await liftUpAtPoint(p.left + 7, p.top - 150); >+ await waitPromise(1500); // Wait for scrolling to stabilize and for scrollbars to disappear. >+ await tapAtPoint(p.left + 7 + 10, p.bottom - 7); >+ >+ testRunner.notifyDone(); >+ } >+ >+ var frameToLoadCount = 6; >+ function newFrameLoaded() { >+ frameToLoadCount--; >+ if (frameToLoadCount == 0) >+ runTest(); >+ } >+ </script> >+ <style> >+ iframe { >+ position: absolute; >+ height: 90px; >+ width: 90px; >+ overflow: none; >+ margin: 0; >+ border: 0; >+ padding: 5px; >+ } >+ </style> >+ </head> >+ <body> >+ <p>This test passes if you see a green rectangle.</p> >+ <div style="position: absolute; top: 3em; width: 300px; height: 200px; background: green;"> >+ <iframe id="clickInContentBox" style="left: 0px; top: 0px;" scrolling="yes" onclick="this.style.background='red'" srcdoc=" >+ <body style='margin: 0; width: 200px; height: 200px'> >+ <div style='position: absolute; width: 100px; height: 100px; background: red;' >+ onclick='this.style.background="green"'></div> >+ </body>" onload="newFrameLoaded()"> >+ </iframe> >+ <iframe id="clickInPaddingBoxOutOfContentBox" style="left: 100px; top: 0px; background: red;" onclick="this.style.background='green'" scrolling="yes" srcdoc=" >+ <body style='margin: 0; width: 200px; height: 200px'> >+ <div style='position: absolute; width: 100px; height: 100px; background: green;' >+ onclick='this.style.background="red"'></div> >+ </body>" onload="newFrameLoaded()"> >+ </iframe> >+ <iframe id="clickElementAboveFrame" style="left: 200px; top: 0px;" scrolling="yes" onclick="this.style.background='red'" srcdoc=" >+ <body style='margin: 0; width: 200px; height: 200px; background: green;'> >+ <div style='position: absolute; width: 100px; height: 100px; background: green;' >+ onclick='this.style.background="red"'></div> >+ </body>" onload="newFrameLoaded()"> >+ </iframe> >+ <div style="position: absolute; width: 50px; height: 50px; left: 225px; top: 25px; background: red" onclick="this.style.background='green';"></div> >+ <iframe id="clickElementInsideFrame" style="left: 0px; top: 100px;" scrolling="yes" onclick="this.style.background='red'" srcdoc=" >+ <body style='margin: 0; width: 200px; height: 200px; background: green;'> >+ <div style='position: absolute; left: 10px; top: 10px; width: 50px; height: 50px; background: red;' >+ onclick='this.style.background="green"'></div> >+ </body>" onload="newFrameLoaded()"> >+ </iframe> >+ <iframe id="clickElementInsideFrameAfterProgrammaticScroll" style="left: 100px; top: 100px;" scrolling="yes" onclick="this.style.background='red'" srcdoc=" >+ <body style='margin: 0; width: 200px; height: 200px; background: green;'> >+ <div style='position: absolute; width: 75px; height: 75px; background: red;'></div> >+ <div style='position: absolute; left: 110px; top: 110px; width: 50px; height: 50px; background: red;' >+ onclick='this.style.background="green"'></div> >+ </body>" onload="newFrameLoaded()"> >+ </iframe> >+ <iframe id="clickElementInsideFrameAfterUserScroll" style="left: 200px; top: 100px;" scrolling="yes" onclick="this.style.background='red'" srcdoc=" >+ <body style='margin: 0; width: 200px; height: 200px; background: green;'> >+ <div style='position: absolute; width: 75px; height: 75px; background: red;'></div> >+ <div style='position: absolute; left: 0px; top: 150px; width: 50px; height: 50px; background: red;' >+ onclick='this.style.background="green"'></div> >+ </body>" onload="newFrameLoaded()"> >+ </iframe> >+ </div> >+</body> >+</html> >diff --git a/LayoutTests/fast/scrolling/ios/scroll-iframe-expected.html b/LayoutTests/fast/scrolling/ios/scroll-iframe-expected.html >new file mode 100644 >index 00000000000..6ea9a08e7ff >--- /dev/null >+++ b/LayoutTests/fast/scrolling/ios/scroll-iframe-expected.html >@@ -0,0 +1,11 @@ >+<!DOCTYPE html> >+<html >+ <head> >+ <title>Scrolling of iframe</title> >+ </head> >+ <body> >+ <p>This test passes if you see a green rectangle.</p> >+ <div style="position: absolute; top: 3em; width: 300px; height: 200px; background: green;"> >+ </div> >+</body> >+</html> >diff --git a/LayoutTests/fast/scrolling/ios/scroll-iframe.html b/LayoutTests/fast/scrolling/ios/scroll-iframe.html >new file mode 100644 >index 00000000000..d6eeab04c78 >--- /dev/null >+++ b/LayoutTests/fast/scrolling/ios/scroll-iframe.html >@@ -0,0 +1,109 @@ >+<!DOCTYPE html> >+<html> >+ <head> >+ <title>Scrolling of iframe</title> >+ <meta name="viewport" content="width=device-width, initial-scale=1"> >+ <script src="../../../resources/basic-gestures.js"></script> >+ <script type="text/javascript"> >+ if (window.testRunner) >+ testRunner.waitUntilDone(); >+ if (window.internals) >+ internals.settings.setAsyncFrameScrollingEnabled(true); >+ >+ function centerOf(id) >+ { >+ var frameBox = document.getElementById(id).getBoundingClientRect(); >+ return { x: frameBox.left + frameBox.width / 2, y: frameBox.top + frameBox.height / 2 }; >+ } >+ >+ async function runTest() { >+ if (!window.testRunner || !testRunner.runUIScript) >+ return; >+ >+ // This checks scrolling to the location of the green square. >+ var c = centerOf("maxScrollX"); >+ await touchAndDragFromPointToPoint(c.x, c.y, c.x - 150, c.y); >+ await liftUpAtPoint(c.x - 150, c.y); >+ c = centerOf("maxScrollY"); >+ await touchAndDragFromPointToPoint(c.x, c.y, c.x, c.y - 150); >+ await liftUpAtPoint(c.x, c.y - 150); >+ c = centerOf("maxScrollXY"); >+ await touchAndDragFromPointToPoint(c.x, c.y, c.x - 150, c.y - 150); >+ await liftUpAtPoint(c.x - 150, c.y - 150); >+ >+ // This checks scrolling behavior for position "fixed" and "sticky". >+ c = centerOf("positionFixed"); >+ await touchAndDragFromPointToPoint(c.x, c.y, c.x - 150, c.y - 150); >+ await liftUpAtPoint(c.x - 150, c.y - 150); >+ c = centerOf("positionStickyEnd"); >+ await touchAndDragFromPointToPoint(c.x, c.y, c.x, c.y - 150); >+ await liftUpAtPoint(c.x, c.y - 150); >+ >+ // This checks that the content is correctly rendered for large page (see bug 173833 comment #31). >+ c = centerOf("veryLargeContent"); >+ await touchAndDragFromPointToPoint(c.x, c.y, c.x, c.y - 2550); >+ await liftUpAtPoint(c.x, c.y - 2550); >+ >+ // Wait for scrolling to stabilize and for scrollbars to disappear. >+ setTimeout(() => {testRunner.notifyDone(); }, 2000); >+ } >+ >+ var frameToLoadCount = 6; >+ function newFrameLoaded() { >+ frameToLoadCount--; >+ if (frameToLoadCount == 0) >+ runTest(); >+ } >+ </script> >+ <style> >+ iframe { >+ position: absolute; >+ background: linear-gradient(135deg, red, orange); >+ border: 0; >+ height: 100px; >+ width: 100px; >+ overflow: none; >+ } >+ </style> >+ </head> >+ <body> >+ <p>This test passes if you see a green rectangle.</p> >+ <div style="position: absolute; top: 3em; width: 300px; height: 200px; background: green;"> >+ <iframe id="maxScrollX" style="left: 0px; top: 0px;" scrolling="yes" srcdoc=" >+ <body style='margin: 0; width: 200px; height: 200px'> >+ <div style='left: 100px; position: absolute; width: 100px; height: 100px; background: green;'></div> >+ </body>" onload="newFrameLoaded()"> >+ </iframe> >+ <iframe id="maxScrollY" style="left: 100px; top: 0px;" scrolling="yes" srcdoc=" >+ <body style='margin: 0; width: 200px; height: 200px'> >+ <div style='top: 100px; position: absolute; width: 100px; height: 100px; background: green;'></div> >+ </body>" onload="newFrameLoaded()"> >+ </iframe> >+ <iframe id="maxScrollXY" style="left: 200px; top: 0px" scrolling="yes" srcdoc=" >+ <body style='margin: 0; width: 200px; height: 200px'> >+ <div style='left: 100px; top: 100px; position: absolute; width: 100px; height: 100px; background: green;'></div> >+ </body>" onload="newFrameLoaded()"> >+ </iframe> >+ <iframe id="positionFixed" style="left: 0px; top: 100px;" scrolling="yes" srcdoc=" >+ <body style='margin: 0; width: 200px; height: 200px'> >+ <div style='position: fixed; width: 100px; height: 100px; background: green;'></div> >+ </body>" onload="newFrameLoaded()"> >+ </iframe> >+ <iframe id="positionStickyEnd" style="left: 100px; top: 100px;" scrolling="yes" srcdoc=" >+ <body style='margin: 0; width: 200px; height: 300px'> >+ <div style='height: 100px'></div> >+ <div style='position: -webkit-sticky; position: sticky; left: 0px; top: 0px; width: 100px; height: 100px; background: green;'></div> >+ </body>" onload="newFrameLoaded()"> >+ </iframe> >+ <iframe id="veryLargeContent" style="left: 200px; top: 100px;" scrolling="yes" srcdoc=" >+ <body style='margin: 0;'> >+ <div style='width: 100px; height: 500px; background: green;'></div> >+ <div style='width: 100px; height: 500px; background: green;'></div> >+ <div style='width: 100px; height: 500px; background: green;'></div> >+ <div style='width: 100px; height: 500px; background: green;'></div> >+ <div style='width: 100px; height: 500px; background: green;'></div> >+ </body>" onload="newFrameLoaded()"> >+ </iframe> >+ </div> >+</body> >+</html> >diff --git a/LayoutTests/platform/ios-wk2/compositing/iframes/composited-parent-iframe-expected.txt b/LayoutTests/platform/ios-wk2/compositing/iframes/composited-parent-iframe-expected.txt >index b9955213cd8..d5c28d129e2 100644 >--- a/LayoutTests/platform/ios-wk2/compositing/iframes/composited-parent-iframe-expected.txt >+++ b/LayoutTests/platform/ios-wk2/compositing/iframes/composited-parent-iframe-expected.txt >@@ -21,6 +21,7 @@ > (bounds 300.00 150.00) > (children 1 > (GraphicsLayer >+ (bounds 300.00 150.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >diff --git a/LayoutTests/platform/ios-wk2/compositing/iframes/connect-compositing-iframe-delayed-expected.txt b/LayoutTests/platform/ios-wk2/compositing/iframes/connect-compositing-iframe-delayed-expected.txt >index 1958942aeb9..6f7d1edf3c8 100644 >--- a/LayoutTests/platform/ios-wk2/compositing/iframes/connect-compositing-iframe-delayed-expected.txt >+++ b/LayoutTests/platform/ios-wk2/compositing/iframes/connect-compositing-iframe-delayed-expected.txt >@@ -23,6 +23,7 @@ When the parent document becomes composited, the layer trees should get connecte > (bounds 300.00 150.00) > (children 1 > (GraphicsLayer >+ (bounds 300.00 150.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >diff --git a/LayoutTests/platform/ios-wk2/compositing/iframes/connect-compositing-iframe-expected.txt b/LayoutTests/platform/ios-wk2/compositing/iframes/connect-compositing-iframe-expected.txt >index d7271348848..18a00f37e44 100644 >--- a/LayoutTests/platform/ios-wk2/compositing/iframes/connect-compositing-iframe-expected.txt >+++ b/LayoutTests/platform/ios-wk2/compositing/iframes/connect-compositing-iframe-expected.txt >@@ -20,6 +20,7 @@ > (bounds 300.00 150.00) > (children 1 > (GraphicsLayer >+ (bounds 300.00 150.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >diff --git a/LayoutTests/platform/ios-wk2/compositing/iframes/connect-compositing-iframe2-expected.txt b/LayoutTests/platform/ios-wk2/compositing/iframes/connect-compositing-iframe2-expected.txt >index d7271348848..18a00f37e44 100644 >--- a/LayoutTests/platform/ios-wk2/compositing/iframes/connect-compositing-iframe2-expected.txt >+++ b/LayoutTests/platform/ios-wk2/compositing/iframes/connect-compositing-iframe2-expected.txt >@@ -20,6 +20,7 @@ > (bounds 300.00 150.00) > (children 1 > (GraphicsLayer >+ (bounds 300.00 150.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >diff --git a/LayoutTests/platform/ios-wk2/compositing/iframes/connect-compositing-iframe3-expected.txt b/LayoutTests/platform/ios-wk2/compositing/iframes/connect-compositing-iframe3-expected.txt >index ff63b5fb4a4..b4fc96c6862 100644 >--- a/LayoutTests/platform/ios-wk2/compositing/iframes/connect-compositing-iframe3-expected.txt >+++ b/LayoutTests/platform/ios-wk2/compositing/iframes/connect-compositing-iframe3-expected.txt >@@ -20,6 +20,7 @@ > (bounds 300.00 150.00) > (children 1 > (GraphicsLayer >+ (bounds 300.00 150.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >diff --git a/LayoutTests/platform/ios-wk2/compositing/iframes/enter-compositing-iframe-expected.txt b/LayoutTests/platform/ios-wk2/compositing/iframes/enter-compositing-iframe-expected.txt >index d7271348848..18a00f37e44 100644 >--- a/LayoutTests/platform/ios-wk2/compositing/iframes/enter-compositing-iframe-expected.txt >+++ b/LayoutTests/platform/ios-wk2/compositing/iframes/enter-compositing-iframe-expected.txt >@@ -20,6 +20,7 @@ > (bounds 300.00 150.00) > (children 1 > (GraphicsLayer >+ (bounds 300.00 150.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >diff --git a/LayoutTests/platform/ios-wk2/compositing/iframes/iframe-resize-expected.txt b/LayoutTests/platform/ios-wk2/compositing/iframes/iframe-resize-expected.txt >index 941db364983..2557d48dce0 100644 >--- a/LayoutTests/platform/ios-wk2/compositing/iframes/iframe-resize-expected.txt >+++ b/LayoutTests/platform/ios-wk2/compositing/iframes/iframe-resize-expected.txt >@@ -20,6 +20,7 @@ > (bounds 400.00 120.00) > (children 1 > (GraphicsLayer >+ (bounds 400.00 120.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >diff --git a/LayoutTests/platform/ios-wk2/compositing/iframes/leave-compositing-iframe-expected.txt b/LayoutTests/platform/ios-wk2/compositing/iframes/leave-compositing-iframe-expected.txt >index ba75a92c242..a97982f85c2 100644 >--- a/LayoutTests/platform/ios-wk2/compositing/iframes/leave-compositing-iframe-expected.txt >+++ b/LayoutTests/platform/ios-wk2/compositing/iframes/leave-compositing-iframe-expected.txt >@@ -20,6 +20,7 @@ > (bounds 300.00 150.00) > (children 1 > (GraphicsLayer >+ (bounds 300.00 150.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >diff --git a/LayoutTests/platform/ios-wk2/compositing/iframes/overlapped-iframe-expected.txt b/LayoutTests/platform/ios-wk2/compositing/iframes/overlapped-iframe-expected.txt >index d7271348848..18a00f37e44 100644 >--- a/LayoutTests/platform/ios-wk2/compositing/iframes/overlapped-iframe-expected.txt >+++ b/LayoutTests/platform/ios-wk2/compositing/iframes/overlapped-iframe-expected.txt >@@ -20,6 +20,7 @@ > (bounds 300.00 150.00) > (children 1 > (GraphicsLayer >+ (bounds 300.00 150.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >diff --git a/LayoutTests/platform/ios-wk2/compositing/iframes/page-cache-layer-tree-expected.txt b/LayoutTests/platform/ios-wk2/compositing/iframes/page-cache-layer-tree-expected.txt >index acd52afff0b..51d3dd73d02 100644 >--- a/LayoutTests/platform/ios-wk2/compositing/iframes/page-cache-layer-tree-expected.txt >+++ b/LayoutTests/platform/ios-wk2/compositing/iframes/page-cache-layer-tree-expected.txt >@@ -27,6 +27,7 @@ This tests that layers are rebuilt properly after the page is restored from the > (bounds 300.00 150.00) > (children 1 > (GraphicsLayer >+ (bounds 300.00 150.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >@@ -77,6 +78,7 @@ This tests that layers are rebuilt properly after the page is restored from the > (bounds 300.00 150.00) > (children 1 > (GraphicsLayer >+ (bounds 300.00 150.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >diff --git a/LayoutTests/platform/ios-wk2/compositing/iframes/scrolling-iframe-expected.txt b/LayoutTests/platform/ios-wk2/compositing/iframes/scrolling-iframe-expected.txt >index 95ef5ccb345..683a373cb55 100644 >--- a/LayoutTests/platform/ios-wk2/compositing/iframes/scrolling-iframe-expected.txt >+++ b/LayoutTests/platform/ios-wk2/compositing/iframes/scrolling-iframe-expected.txt >@@ -21,6 +21,7 @@ > (children 1 > (GraphicsLayer > (position -80.00 -80.00) >+ (bounds 300.00 150.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >diff --git a/LayoutTests/platform/ios-wk2/compositing/rtl/rtl-iframe-absolute-expected.txt b/LayoutTests/platform/ios-wk2/compositing/rtl/rtl-iframe-absolute-expected.txt >index 77d4e035a86..8c0bd1f3e9c 100644 >--- a/LayoutTests/platform/ios-wk2/compositing/rtl/rtl-iframe-absolute-expected.txt >+++ b/LayoutTests/platform/ios-wk2/compositing/rtl/rtl-iframe-absolute-expected.txt >@@ -17,6 +17,7 @@ > (bounds 400.00 400.00) > (children 1 > (GraphicsLayer >+ (bounds 400.00 400.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >diff --git a/LayoutTests/platform/ios-wk2/compositing/rtl/rtl-iframe-absolute-overflow-expected.txt b/LayoutTests/platform/ios-wk2/compositing/rtl/rtl-iframe-absolute-overflow-expected.txt >index 8d768930d03..9f26bc9d191 100644 >--- a/LayoutTests/platform/ios-wk2/compositing/rtl/rtl-iframe-absolute-overflow-expected.txt >+++ b/LayoutTests/platform/ios-wk2/compositing/rtl/rtl-iframe-absolute-overflow-expected.txt >@@ -17,6 +17,7 @@ > (bounds 400.00 400.00) > (children 1 > (GraphicsLayer >+ (bounds 400.00 400.00) > (children 1 > (GraphicsLayer > (position -600.00 0.00) >diff --git a/LayoutTests/platform/ios-wk2/compositing/rtl/rtl-iframe-fixed-expected.txt b/LayoutTests/platform/ios-wk2/compositing/rtl/rtl-iframe-fixed-expected.txt >index 834e0182f05..8c28dca9c28 100644 >--- a/LayoutTests/platform/ios-wk2/compositing/rtl/rtl-iframe-fixed-expected.txt >+++ b/LayoutTests/platform/ios-wk2/compositing/rtl/rtl-iframe-fixed-expected.txt >@@ -17,6 +17,7 @@ > (bounds 400.00 400.00) > (children 1 > (GraphicsLayer >+ (bounds 400.00 400.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >diff --git a/LayoutTests/platform/ios-wk2/compositing/rtl/rtl-iframe-relative-expected.txt b/LayoutTests/platform/ios-wk2/compositing/rtl/rtl-iframe-relative-expected.txt >index 30ba6d9189b..ac0188ebe62 100644 >--- a/LayoutTests/platform/ios-wk2/compositing/rtl/rtl-iframe-relative-expected.txt >+++ b/LayoutTests/platform/ios-wk2/compositing/rtl/rtl-iframe-relative-expected.txt >@@ -17,6 +17,7 @@ > (bounds 400.00 400.00) > (children 1 > (GraphicsLayer >+ (bounds 400.00 400.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >diff --git a/LayoutTests/platform/ios-wk2/compositing/tiling/tiled-drawing-async-frame-scrolling-expected.txt b/LayoutTests/platform/ios-wk2/compositing/tiling/tiled-drawing-async-frame-scrolling-expected.txt >index 6eb430dd5a9..dddc94bf0cd 100644 >--- a/LayoutTests/platform/ios-wk2/compositing/tiling/tiled-drawing-async-frame-scrolling-expected.txt >+++ b/LayoutTests/platform/ios-wk2/compositing/tiling/tiled-drawing-async-frame-scrolling-expected.txt >@@ -49,10 +49,11 @@ > (contentsScale 2.00) > (children 1 > (GraphicsLayer >- (backingStoreAttached 0) >- (visible rect 0.00, 0.00 0.00 x 0.00) >+ (bounds 300.00 150.00) >+ (backingStoreAttached 1) >+ (visible rect 0.00, 0.00 300.00 x 150.00) > (coverage rect 0.00, 0.00 300.00 x 150.00) >- (intersects coverage rect 0) >+ (intersects coverage rect 1) > (contentsScale 2.00) > (children 1 > (GraphicsLayer >@@ -124,10 +125,11 @@ > (contentsScale 2.00) > (children 1 > (GraphicsLayer >- (backingStoreAttached 0) >- (visible rect 0.00, 0.00 0.00 x 0.00) >+ (bounds 300.00 150.00) >+ (backingStoreAttached 1) >+ (visible rect 0.00, 0.00 300.00 x 150.00) > (coverage rect 0.00, 0.00 300.00 x 150.00) >- (intersects coverage rect 0) >+ (intersects coverage rect 1) > (contentsScale 2.00) > (children 1 > (GraphicsLayer >@@ -199,10 +201,11 @@ > (contentsScale 2.00) > (children 1 > (GraphicsLayer >- (backingStoreAttached 0) >- (visible rect 0.00, 0.00 0.00 x 0.00) >+ (bounds 300.00 150.00) >+ (backingStoreAttached 1) >+ (visible rect 0.00, 0.00 300.00 x 150.00) > (coverage rect 0.00, 0.00 300.00 x 150.00) >- (intersects coverage rect 0) >+ (intersects coverage rect 1) > (contentsScale 2.00) > (children 1 > (GraphicsLayer >diff --git a/LayoutTests/platform/ios-wk2/compositing/visible-rect/iframe-and-layers-expected.txt b/LayoutTests/platform/ios-wk2/compositing/visible-rect/iframe-and-layers-expected.txt >index 19ea3fd1d1a..545fcc5c06b 100644 >--- a/LayoutTests/platform/ios-wk2/compositing/visible-rect/iframe-and-layers-expected.txt >+++ b/LayoutTests/platform/ios-wk2/compositing/visible-rect/iframe-and-layers-expected.txt >@@ -41,9 +41,10 @@ > (contentsScale 2.00) > (children 1 > (GraphicsLayer >- (visible rect 0.00, 0.00 0.00 x 0.00) >+ (bounds 300.00 150.00) >+ (visible rect 0.00, 0.00 300.00 x 150.00) > (coverage rect 0.00, 0.00 300.00 x 150.00) >- (intersects coverage rect 0) >+ (intersects coverage rect 1) > (contentsScale 2.00) > (children 1 > (GraphicsLayer >diff --git a/LayoutTests/platform/ios/compositing/iframes/become-composited-nested-iframes-expected.txt b/LayoutTests/platform/ios/compositing/iframes/become-composited-nested-iframes-expected.txt >index 47175128175..19bf62db68a 100644 >--- a/LayoutTests/platform/ios/compositing/iframes/become-composited-nested-iframes-expected.txt >+++ b/LayoutTests/platform/ios/compositing/iframes/become-composited-nested-iframes-expected.txt >@@ -20,6 +20,7 @@ > (bounds 280.00 200.00) > (children 1 > (GraphicsLayer >+ (bounds 280.00 200.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >@@ -42,6 +43,7 @@ > (bounds 250.00 170.00) > (children 1 > (GraphicsLayer >+ (bounds 250.00 170.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >@@ -93,6 +95,7 @@ > (bounds 280.00 200.00) > (children 1 > (GraphicsLayer >+ (bounds 280.00 200.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >@@ -115,6 +118,7 @@ > (bounds 250.00 170.00) > (children 1 > (GraphicsLayer >+ (bounds 250.00 170.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >diff --git a/LayoutTests/platform/ios/compositing/iframes/become-overlapped-iframe-expected.txt b/LayoutTests/platform/ios/compositing/iframes/become-overlapped-iframe-expected.txt >index 24efaac3994..7cc16ff2726 100644 >--- a/LayoutTests/platform/ios/compositing/iframes/become-overlapped-iframe-expected.txt >+++ b/LayoutTests/platform/ios/compositing/iframes/become-overlapped-iframe-expected.txt >@@ -20,6 +20,7 @@ > (bounds 320.00 170.00) > (children 1 > (GraphicsLayer >+ (bounds 320.00 170.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >diff --git a/LayoutTests/platform/ios/compositing/iframes/invisible-nested-iframe-show-expected.txt b/LayoutTests/platform/ios/compositing/iframes/invisible-nested-iframe-show-expected.txt >index 08060b7f04b..2979b638368 100644 >--- a/LayoutTests/platform/ios/compositing/iframes/invisible-nested-iframe-show-expected.txt >+++ b/LayoutTests/platform/ios/compositing/iframes/invisible-nested-iframe-show-expected.txt >@@ -20,6 +20,7 @@ > (bounds 300.00 150.00) > (children 1 > (GraphicsLayer >+ (bounds 300.00 150.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >@@ -42,6 +43,7 @@ > (bounds 250.00 170.00) > (children 1 > (GraphicsLayer >+ (bounds 250.00 170.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >diff --git a/LayoutTests/platform/ios/compositing/iframes/overlapped-iframe-iframe-expected.txt b/LayoutTests/platform/ios/compositing/iframes/overlapped-iframe-iframe-expected.txt >new file mode 100644 >index 00000000000..83c04417d42 >--- /dev/null >+++ b/LayoutTests/platform/ios/compositing/iframes/overlapped-iframe-iframe-expected.txt >@@ -0,0 +1,57 @@ >+(GraphicsLayer >+ (anchor 0.00 0.00) >+ (bounds 800.00 600.00) >+ (children 1 >+ (GraphicsLayer >+ (bounds 800.00 600.00) >+ (contentsOpaque 1) >+ (children 2 >+ (GraphicsLayer >+ (bounds 304.00 304.00) >+ (drawsContent 1) >+ (children 1 >+ (GraphicsLayer >+ (position 2.00 2.00) >+ (children 1 >+ (GraphicsLayer >+ (anchor 0.00 0.00) >+ (bounds 300.00 300.00) >+ (children 1 >+ (GraphicsLayer >+ (bounds 300.00 300.00) >+ (children 1 >+ (GraphicsLayer >+ (anchor 0.00 0.00) >+ (bounds 300.00 300.00) >+ (children 1 >+ (GraphicsLayer >+ (bounds 300.00 300.00) >+ (drawsContent 1) >+ (children 1 >+ (GraphicsLayer >+ (position 18.00 10.00) >+ (bounds 210.00 210.00) >+ (contentsOpaque 1) >+ ) >+ ) >+ ) >+ ) >+ ) >+ ) >+ ) >+ ) >+ ) >+ ) >+ ) >+ ) >+ ) >+ (GraphicsLayer >+ (position 250.00 0.00) >+ (bounds 304.00 304.00) >+ (drawsContent 1) >+ ) >+ ) >+ ) >+ ) >+) >+ >diff --git a/LayoutTests/platform/ios/compositing/iframes/overlapped-nested-iframes-expected.txt b/LayoutTests/platform/ios/compositing/iframes/overlapped-nested-iframes-expected.txt >index e9c275db941..c3785182aef 100644 >--- a/LayoutTests/platform/ios/compositing/iframes/overlapped-nested-iframes-expected.txt >+++ b/LayoutTests/platform/ios/compositing/iframes/overlapped-nested-iframes-expected.txt >@@ -20,6 +20,7 @@ > (bounds 280.00 200.00) > (children 1 > (GraphicsLayer >+ (bounds 280.00 200.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >@@ -42,6 +43,7 @@ > (bounds 250.00 170.00) > (children 1 > (GraphicsLayer >+ (bounds 250.00 170.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >@@ -93,6 +95,7 @@ > (bounds 280.00 200.00) > (children 1 > (GraphicsLayer >+ (bounds 280.00 200.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >@@ -115,6 +118,7 @@ > (bounds 250.00 170.00) > (children 1 > (GraphicsLayer >+ (bounds 250.00 170.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >diff --git a/LayoutTests/platform/ios/compositing/iframes/resizer-expected.txt b/LayoutTests/platform/ios/compositing/iframes/resizer-expected.txt >index 8e24df9d498..588cc57f1fb 100644 >--- a/LayoutTests/platform/ios/compositing/iframes/resizer-expected.txt >+++ b/LayoutTests/platform/ios/compositing/iframes/resizer-expected.txt >@@ -20,6 +20,7 @@ > (bounds 300.00 150.00) > (children 1 > (GraphicsLayer >+ (bounds 300.00 150.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >diff --git a/LayoutTests/platform/ios/compositing/visible-rect/iframe-with-layers-outside-viewport-expected.txt b/LayoutTests/platform/ios/compositing/visible-rect/iframe-with-layers-outside-viewport-expected.txt >index bfbfa2b4da5..f382eee786e 100644 >--- a/LayoutTests/platform/ios/compositing/visible-rect/iframe-with-layers-outside-viewport-expected.txt >+++ b/LayoutTests/platform/ios/compositing/visible-rect/iframe-with-layers-outside-viewport-expected.txt >@@ -40,6 +40,7 @@ > (contentsScale 2.00) > (children 1 > (GraphicsLayer >+ (bounds 300.00 150.00) > (visible rect 0.00, 0.00 0.00 x 0.00) > (coverage rect 0.00, 0.00 0.00 x 0.00) > (intersects coverage rect 0) >diff --git a/LayoutTests/platform/mac-wk1/compositing/repaint/iframes/compositing-iframe-scroll-repaint-expected.txt b/LayoutTests/platform/mac-wk1/compositing/repaint/iframes/compositing-iframe-scroll-repaint-expected.txt >index 6a2086b6032..4a5c25ddcb1 100644 >--- a/LayoutTests/platform/mac-wk1/compositing/repaint/iframes/compositing-iframe-scroll-repaint-expected.txt >+++ b/LayoutTests/platform/mac-wk1/compositing/repaint/iframes/compositing-iframe-scroll-repaint-expected.txt >@@ -25,6 +25,7 @@ > (children 1 > (GraphicsLayer > (position 0.00 -100.00) >+ (bounds 400.00 300.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >diff --git a/LayoutTests/platform/mac-wk1/compositing/repaint/iframes/compositing-iframe-with-fixed-background-doc-repaint-expected.txt b/LayoutTests/platform/mac-wk1/compositing/repaint/iframes/compositing-iframe-with-fixed-background-doc-repaint-expected.txt >index c9047fdc059..da890c8296b 100644 >--- a/LayoutTests/platform/mac-wk1/compositing/repaint/iframes/compositing-iframe-with-fixed-background-doc-repaint-expected.txt >+++ b/LayoutTests/platform/mac-wk1/compositing/repaint/iframes/compositing-iframe-with-fixed-background-doc-repaint-expected.txt >@@ -25,6 +25,7 @@ > (children 1 > (GraphicsLayer > (position 0.00 -100.00) >+ (bounds 400.00 300.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >diff --git a/LayoutTests/platform/mac-wk2/compositing/tiling/tiled-drawing-async-frame-scrolling-expected.txt b/LayoutTests/platform/mac-wk2/compositing/tiling/tiled-drawing-async-frame-scrolling-expected.txt >index 13a3ecd0686..cfca3426330 100644 >--- a/LayoutTests/platform/mac-wk2/compositing/tiling/tiled-drawing-async-frame-scrolling-expected.txt >+++ b/LayoutTests/platform/mac-wk2/compositing/tiling/tiled-drawing-async-frame-scrolling-expected.txt >@@ -49,10 +49,11 @@ > (contentsScale 1.00) > (children 1 > (GraphicsLayer >- (backingStoreAttached 0) >- (visible rect 0.00, 0.00 0.00 x 0.00) >+ (bounds 285.00 135.00) >+ (backingStoreAttached 1) >+ (visible rect 0.00, 0.00 285.00 x 135.00) > (coverage rect 0.00, 0.00 285.00 x 135.00) >- (intersects coverage rect 0) >+ (intersects coverage rect 1) > (contentsScale 1.00) > (children 1 > (GraphicsLayer >@@ -154,10 +155,11 @@ > (contentsScale 1.00) > (children 1 > (GraphicsLayer >- (backingStoreAttached 0) >- (visible rect 0.00, 0.00 0.00 x 0.00) >+ (bounds 285.00 135.00) >+ (backingStoreAttached 1) >+ (visible rect 0.00, 0.00 285.00 x 135.00) > (coverage rect 0.00, 0.00 285.00 x 135.00) >- (intersects coverage rect 0) >+ (intersects coverage rect 1) > (contentsScale 1.00) > (children 1 > (GraphicsLayer >@@ -259,10 +261,11 @@ > (contentsScale 1.00) > (children 1 > (GraphicsLayer >- (backingStoreAttached 0) >- (visible rect 0.00, 0.00 0.00 x 0.00) >+ (bounds 285.00 135.00) >+ (backingStoreAttached 1) >+ (visible rect 0.00, 0.00 285.00 x 135.00) > (coverage rect 0.00, 0.00 285.00 x 135.00) >- (intersects coverage rect 0) >+ (intersects coverage rect 1) > (contentsScale 1.00) > (children 1 > (GraphicsLayer >diff --git a/LayoutTests/platform/mac/compositing/iframes/invisible-nested-iframe-show-expected.txt b/LayoutTests/platform/mac/compositing/iframes/invisible-nested-iframe-show-expected.txt >index ac3af225a61..f1dc74a22ac 100644 >--- a/LayoutTests/platform/mac/compositing/iframes/invisible-nested-iframe-show-expected.txt >+++ b/LayoutTests/platform/mac/compositing/iframes/invisible-nested-iframe-show-expected.txt >@@ -20,6 +20,7 @@ > (bounds 285.00 150.00) > (children 1 > (GraphicsLayer >+ (bounds 285.00 150.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >@@ -42,6 +43,7 @@ > (bounds 250.00 170.00) > (children 1 > (GraphicsLayer >+ (bounds 250.00 170.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >diff --git a/LayoutTests/platform/mac/compositing/iframes/resizer-expected.txt b/LayoutTests/platform/mac/compositing/iframes/resizer-expected.txt >index 895d9dfdf0e..99b51d65e3a 100644 >--- a/LayoutTests/platform/mac/compositing/iframes/resizer-expected.txt >+++ b/LayoutTests/platform/mac/compositing/iframes/resizer-expected.txt >@@ -20,6 +20,7 @@ > (bounds 285.00 150.00) > (children 1 > (GraphicsLayer >+ (bounds 285.00 150.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >diff --git a/LayoutTests/platform/mac/compositing/visible-rect/iframe-and-layers-expected.txt b/LayoutTests/platform/mac/compositing/visible-rect/iframe-and-layers-expected.txt >index 77bb76073a1..3d7d440172e 100644 >--- a/LayoutTests/platform/mac/compositing/visible-rect/iframe-and-layers-expected.txt >+++ b/LayoutTests/platform/mac/compositing/visible-rect/iframe-and-layers-expected.txt >@@ -41,9 +41,10 @@ > (contentsScale 1.00) > (children 1 > (GraphicsLayer >- (visible rect 0.00, 0.00 0.00 x 0.00) >+ (bounds 285.00 135.00) >+ (visible rect 0.00, 0.00 285.00 x 135.00) > (coverage rect 0.00, 0.00 285.00 x 135.00) >- (intersects coverage rect 0) >+ (intersects coverage rect 1) > (contentsScale 1.00) > (children 1 > (GraphicsLayer >diff --git a/LayoutTests/tiled-drawing/scrolling/frames/fixed-inside-frame-expected.txt b/LayoutTests/tiled-drawing/scrolling/frames/fixed-inside-frame-expected.txt >index 74da075953c..4fce0b3ebf1 100644 >--- a/LayoutTests/tiled-drawing/scrolling/frames/fixed-inside-frame-expected.txt >+++ b/LayoutTests/tiled-drawing/scrolling/frames/fixed-inside-frame-expected.txt >@@ -64,6 +64,7 @@ > (children 1 > (GraphicsLayer > (position 0.00 -120.00) >+ (bounds 465.00 400.00) > (children 1 > (GraphicsLayer > (anchor 0.00 0.00) >diff --git a/LayoutTests/tiled-drawing/tile-coverage-iframe-to-zero-coverage-expected.txt b/LayoutTests/tiled-drawing/tile-coverage-iframe-to-zero-coverage-expected.txt >index dae7588fea1..9211a58d189 100644 >--- a/LayoutTests/tiled-drawing/tile-coverage-iframe-to-zero-coverage-expected.txt >+++ b/LayoutTests/tiled-drawing/tile-coverage-iframe-to-zero-coverage-expected.txt >@@ -45,6 +45,7 @@ > (contentsScale 1.00) > (children 1 > (GraphicsLayer >+ (bounds 800.00 400.00) > (visible rect 0.00, 0.00 0.00 x 0.00) > (coverage rect 0.00, 0.00 0.00 x 0.00) > (intersects coverage rect 0) >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 9b3867646cf..a00b151974f 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,55 @@ >+2018-02-16 Frederic Wang <fwang@igalia.com> >+ >+ [iOS] Adjust layer hierarchy to handle frame scrolling >+ https://bugs.webkit.org/show_bug.cgi?id=173833 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This patch adds scrolling layers to subframes so that they create the corresponding >+ UIScrollViews on iOS. A new ScrollingTreeRemoteFrameScrollingNodeIOS class is also introduced >+ to handle the case of subframes in the same way as position: overflow nodes. This class now >+ has different behavior for the main frame (already implemented) and subframes (using >+ ScrollingTreeScrollingNodeDelegate) so helper functions are added to distinguish the two >+ cases more easily. For now, this patch provides only basic scrolling support for subframes. >+ In order to properly implement hit testing, we introduce a new version of windowToContents, >+ currently only used by documentPointForWindowPoint. More tests and improvements will happen >+ in follow-up patches. >+ >+ Tests: fast/scrolling/ios/hit-testing-iframe.html >+ fast/scrolling/ios/scroll-iframe.html >+ >+ * page/EventHandler.cpp: >+ (WebCore::documentPointForWindowPoint): Use new version of windowToContents, so that the >+ scroll position of subframes is taken into account for hit testing. >+ * page/FrameView.cpp: >+ (WebCore::FrameView::coordinateChangeShouldIgnoreScrollPosition const): Now also take into >+ account scroll position of subframes in WebKit2. >+ * page/FrameView.h: Override coordinateChangeShouldIgnoreScrollPosition to make it more >+ restrictive. >+ * page/scrolling/ScrollingTreeFrameScrollingNode.h: Expose more functions to the UI library >+ for ScrollingTreeRemoteFrameScrollingNodeIOS. >+ * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h: Expose more functions to the UI >+ library for ScrollingTreeRemoteFrameScrollingNodeIOS. >+ * page/scrolling/mac/ScrollingTreeStickyNode.mm: >+ (WebCore::ScrollingTreeStickyNode::updateLayersAfterAncestorChange): Calculate the proper >+ constrained rectangle for subframes. >+ * platform/ScrollView.cpp: >+ (WebCore::ScrollView::windowToContents const): Implement new version, same as the deprecated >+ one but using coordinateChangeShouldIgnoreScrollPosition() instead of delegatesScrolling(). >+ * platform/ScrollView.h: >+ (WebCore::ScrollView::coordinateChangeShouldIgnoreScrollPosition const): For ScrollView make >+ windowToContents behave the same as deprecatedWindowToContents. >+ * platform/graphics/ca/GraphicsLayerCA.cpp: >+ (WebCore::GraphicsLayerCA::computeVisibleAndCoverageRect const): Ensure that boundsOrigin is >+ also taken into account when the layer does not maskToBounds. >+ * rendering/RenderLayerCompositor.cpp: >+ (WebCore::RenderLayerCompositor::frameViewDidChangeSize): Set the size for scrolling layer. >+ The call to frameViewDidScroll() can be moved, since it's a no-op when !m_scrollLayer. >+ (WebCore::RenderLayerCompositor::updateRootLayerPosition): Set the size for scrolling layer. >+ (WebCore::RenderLayerCompositor::ensureRootLayer): Change the type of m_scrollLayer to >+ GraphicsLayer::Type::Scrolling for subframes (this only affects iOS). Set the size for >+ such scrolling layer. >+ > 2018-02-16 Frederic Wang <fwang@igalia.com> > > Bug 182785 - Deprecate ScrollView::windowToContents(const IntPoint&) >diff --git a/Source/WebCore/page/EventHandler.cpp b/Source/WebCore/page/EventHandler.cpp >index 4c498da4dd8..ab1c2a57f40 100644 >--- a/Source/WebCore/page/EventHandler.cpp >+++ b/Source/WebCore/page/EventHandler.cpp >@@ -1606,7 +1606,7 @@ static LayoutPoint documentPointForWindowPoint(Frame& frame, const IntPoint& win > FrameView* view = frame.view(); > // FIXME: Is it really OK to use the wrong coordinates here when view is 0? > // Historically the code would just crash; this is clearly no worse than that. >- return view ? view->deprecatedWindowToContents(windowPoint) : windowPoint; >+ return view ? view->windowToContents(windowPoint) : windowPoint; > } > > static Scrollbar* scrollbarForMouseEvent(const MouseEventWithHitTestResults& mouseEvent, FrameView* view) >diff --git a/Source/WebCore/page/FrameView.cpp b/Source/WebCore/page/FrameView.cpp >index 013dd459f2c..611ac5cb520 100644 >--- a/Source/WebCore/page/FrameView.cpp >+++ b/Source/WebCore/page/FrameView.cpp >@@ -1383,6 +1383,11 @@ void FrameView::adjustMediaTypeForPrinting(bool printing) > } > } > >+bool FrameView::coordinateChangeShouldIgnoreScrollPosition() const >+{ >+ return delegatesScrolling() && (platformWidget() || frame().isMainFrame()); >+} >+ > bool FrameView::useSlowRepaints(bool considerOverlap) const > { > bool mustBeSlow = hasSlowRepaintObjects() || (platformWidget() && hasViewportConstrainedObjects()); >diff --git a/Source/WebCore/page/FrameView.h b/Source/WebCore/page/FrameView.h >index 70e0674b6d6..c7e8957d618 100644 >--- a/Source/WebCore/page/FrameView.h >+++ b/Source/WebCore/page/FrameView.h >@@ -663,6 +663,8 @@ private: > > bool isFrameView() const final { return true; } > >+ bool coordinateChangeShouldIgnoreScrollPosition() const final; >+ > friend class RenderWidget; > bool useSlowRepaints(bool considerOverlap = true) const; > bool useSlowRepaintsIfNotOverlapped() const; >diff --git a/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.h b/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.h >index 95395b2a05e..f25fe4f3671 100644 >--- a/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.h >+++ b/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.h >@@ -45,7 +45,7 @@ public: > void updateLayersAfterAncestorChange(const ScrollingTreeNode& /*changedNode*/, const FloatRect& /*fixedPositionRect*/, const FloatSize& /*cumulativeDelta*/) override { } > > void handleWheelEvent(const PlatformWheelEvent&) override = 0; >- void setScrollPosition(const FloatPoint&) override; >+ WEBCORE_EXPORT void setScrollPosition(const FloatPoint&) override; > void setScrollPositionWithoutContentEdgeConstraints(const FloatPoint&) override = 0; > > void updateLayersAfterViewportChange(const FloatRect& fixedPositionRect, double scale) override = 0; >@@ -80,7 +80,7 @@ protected: > ScrollBehaviorForFixedElements scrollBehaviorForFixedElements() const { return m_behaviorForFixed; } > > private: >- void dumpProperties(WTF::TextStream&, ScrollingStateTreeAsTextBehavior) const override; >+ WEBCORE_EXPORT void dumpProperties(WTF::TextStream&, ScrollingStateTreeAsTextBehavior) const override; > > FloatRect m_layoutViewport; > FloatPoint m_minLayoutViewportOrigin; >diff --git a/Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h b/Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h >index bfaa0f1da08..81be739f891 100644 >--- a/Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h >+++ b/Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h >@@ -37,27 +37,27 @@ namespace WebCore { > class ScrollingTreeFrameScrollingNodeIOS : public ScrollingTreeFrameScrollingNode { > public: > WEBCORE_EXPORT static Ref<ScrollingTreeFrameScrollingNodeIOS> create(ScrollingTree&, ScrollingNodeType, ScrollingNodeID); >- virtual ~ScrollingTreeFrameScrollingNodeIOS(); >+ WEBCORE_EXPORT virtual ~ScrollingTreeFrameScrollingNodeIOS(); > > protected: >- ScrollingTreeFrameScrollingNodeIOS(ScrollingTree&, ScrollingNodeType, ScrollingNodeID); >+ WEBCORE_EXPORT ScrollingTreeFrameScrollingNodeIOS(ScrollingTree&, ScrollingNodeType, ScrollingNodeID); > > // ScrollingTreeNode member functions. >- void commitStateBeforeChildren(const ScrollingStateNode&) override; >- void commitStateAfterChildren(const ScrollingStateNode&) override; >+ WEBCORE_EXPORT void commitStateBeforeChildren(const ScrollingStateNode&) override; >+ WEBCORE_EXPORT void commitStateAfterChildren(const ScrollingStateNode&) override; > > void handleWheelEvent(const PlatformWheelEvent&) override { } > >- FloatPoint scrollPosition() const override; >- void setScrollPositionWithoutContentEdgeConstraints(const FloatPoint&) override; >+ WEBCORE_EXPORT FloatPoint scrollPosition() const override; >+ WEBCORE_EXPORT void setScrollPositionWithoutContentEdgeConstraints(const FloatPoint&) override; > >- void updateLayersAfterViewportChange(const FloatRect& fixedPositionRect, double scale) override; >- void updateLayersAfterDelegatedScroll(const FloatPoint&) override; >+ WEBCORE_EXPORT void updateLayersAfterViewportChange(const FloatRect& fixedPositionRect, double scale) override; >+ WEBCORE_EXPORT void updateLayersAfterDelegatedScroll(const FloatPoint&) override; > >- void setScrollLayerPosition(const FloatPoint&, const FloatRect& layoutViewport) override; >+ WEBCORE_EXPORT void setScrollLayerPosition(const FloatPoint&, const FloatRect& layoutViewport) override; > >- FloatPoint minimumScrollPosition() const override; >- FloatPoint maximumScrollPosition() const override; >+ WEBCORE_EXPORT FloatPoint minimumScrollPosition() const override; >+ WEBCORE_EXPORT FloatPoint maximumScrollPosition() const override; > > private: > void updateChildNodesAfterScroll(const FloatPoint&); >diff --git a/Source/WebCore/page/scrolling/mac/ScrollingTreeStickyNode.mm b/Source/WebCore/page/scrolling/mac/ScrollingTreeStickyNode.mm >index c8a82af8901..7c36bb750c9 100644 >--- a/Source/WebCore/page/scrolling/mac/ScrollingTreeStickyNode.mm >+++ b/Source/WebCore/page/scrolling/mac/ScrollingTreeStickyNode.mm >@@ -82,7 +82,11 @@ void ScrollingTreeStickyNode::updateLayersAfterAncestorChange(const ScrollingTre > constrainingRect = FloatRect(downcast<ScrollingTreeOverflowScrollingNode>(*parent()).scrollPosition(), m_constraints.constrainingRectAtLastLayout().size()); > adjustStickyLayer = true; > } else if (is<ScrollingTreeFrameScrollingNode>(*parent())) { >- constrainingRect = fixedPositionRect; >+ auto& frameNode = downcast<ScrollingTreeFrameScrollingNode>(*parent()); >+ if (frameNode.nodeType() == MainFrameScrollingNode) >+ constrainingRect = fixedPositionRect; >+ else >+ constrainingRect = FloatRect(frameNode.scrollPosition(), fixedPositionRect.size()); > adjustStickyLayer = true; > } > >diff --git a/Source/WebCore/platform/ScrollView.cpp b/Source/WebCore/platform/ScrollView.cpp >index 90f9e2df93a..06ff6fbacce 100644 >--- a/Source/WebCore/platform/ScrollView.cpp >+++ b/Source/WebCore/platform/ScrollView.cpp >@@ -905,6 +905,14 @@ IntPoint ScrollView::deprecatedWindowToContents(const IntPoint& windowPoint) con > return viewToContents(convertFromContainingWindow(windowPoint)); > } > >+IntPoint ScrollView::windowToContents(const IntPoint& windowPoint) const >+{ >+ if (coordinateChangeShouldIgnoreScrollPosition()) >+ return convertFromContainingWindow(windowPoint); >+ >+ return viewToContents(convertFromContainingWindow(windowPoint)); >+} >+ > IntPoint ScrollView::contentsToWindow(const IntPoint& contentsPoint) const > { > if (delegatesScrolling()) >diff --git a/Source/WebCore/platform/ScrollView.h b/Source/WebCore/platform/ScrollView.h >index 75b2620d085..5260bc24598 100644 >--- a/Source/WebCore/platform/ScrollView.h >+++ b/Source/WebCore/platform/ScrollView.h >@@ -297,6 +297,7 @@ public: > // the entire widget hierarchy. It is up to the platform to decide what the precise definition > // of containing window is. (For example on Mac it is the containing NSWindow.) > WEBCORE_EXPORT IntPoint deprecatedWindowToContents(const IntPoint&) const; >+ WEBCORE_EXPORT IntPoint windowToContents(const IntPoint&) const; > WEBCORE_EXPORT IntPoint contentsToWindow(const IntPoint&) const; > WEBCORE_EXPORT IntRect windowToContents(const IntRect&) const; > WEBCORE_EXPORT IntRect contentsToWindow(const IntRect&) const; >@@ -377,6 +378,8 @@ public: > protected: > ScrollView(); > >+ virtual bool coordinateChangeShouldIgnoreScrollPosition() const { return delegatesScrolling(); } >+ > virtual void repaintContentRectangle(const IntRect&); > virtual void paintContents(GraphicsContext&, const IntRect& damageRect, SecurityOriginPaintPolicy = SecurityOriginPaintPolicy::AnyOrigin) = 0; > >diff --git a/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp b/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp >index 2b35a97ddca..8fc6ed56dfa 100644 >--- a/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp >+++ b/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp >@@ -1393,7 +1393,8 @@ GraphicsLayerCA::VisibleAndCoverageRects GraphicsLayerCA::computeVisibleAndCover > FloatQuad secondaryQuad(clipRectForSelf); > state.setSecondaryQuad(&secondaryQuad); > } >- } >+ } else if (boundsOrigin != FloatPoint::zero()) >+ state.move(-boundsOrigin.x(), -boundsOrigin.y()); > > FloatRect coverageRect = clipRectForSelf; > std::optional<FloatQuad> quad = state.mappedSecondaryQuad(&mapWasClamped); >diff --git a/Source/WebCore/rendering/RenderLayerCompositor.cpp b/Source/WebCore/rendering/RenderLayerCompositor.cpp >index 2fb72bdafc9..db1214e057e 100644 >--- a/Source/WebCore/rendering/RenderLayerCompositor.cpp >+++ b/Source/WebCore/rendering/RenderLayerCompositor.cpp >@@ -1622,12 +1622,16 @@ void RenderLayerCompositor::frameViewDidChangeLocation(const IntPoint& contentsO > > void RenderLayerCompositor::frameViewDidChangeSize() > { >+ const FrameView& frameView = m_renderView.frameView(); >+ if (m_scrollLayer) { >+ if (m_scrollLayer->type() == GraphicsLayer::Type::Scrolling) >+ m_scrollLayer->setSize(frameView.sizeForVisibleContent()); >+ frameViewDidScroll(); >+ } > if (m_clipLayer) { >- const FrameView& frameView = m_renderView.frameView(); > m_clipLayer->setSize(frameView.sizeForVisibleContent()); > m_clipLayer->setPosition(positionForClipLayer()); > >- frameViewDidScroll(); > updateOverflowControlsLayers(); > > #if ENABLE(RUBBER_BANDING) >@@ -1989,6 +1993,8 @@ void RenderLayerCompositor::updateRootLayerPosition() > m_rootContentLayer->setPosition(m_renderView.frameView().positionForRootContentLayer()); > m_rootContentLayer->setAnchorPoint(FloatPoint3D()); > } >+ if (m_scrollLayer && m_scrollLayer->type() == GraphicsLayer::Type::Scrolling) >+ m_scrollLayer->setSize(m_renderView.frameView().sizeForVisibleContent()); > if (m_clipLayer) { > m_clipLayer->setSize(m_renderView.frameView().sizeForVisibleContent()); > m_clipLayer->setPosition(positionForClipLayer()); >@@ -3298,8 +3304,12 @@ void RenderLayerCompositor::ensureRootLayer() > m_clipLayer = GraphicsLayer::create(graphicsLayerFactory(), *this); > m_clipLayer->setName("frame clipping"); > m_clipLayer->setMasksToBounds(true); >- >- m_scrollLayer = GraphicsLayer::create(graphicsLayerFactory(), *this); >+ >+ GraphicsLayer::Type scrollLayerType = isMainFrameCompositor() >+ ? GraphicsLayer::Type::Normal >+ : GraphicsLayer::Type::Scrolling; >+ m_scrollLayer = GraphicsLayer::create(graphicsLayerFactory(), *this, scrollLayerType); >+ > m_scrollLayer->setName("frame scrolling"); > > // Hook them up >@@ -3311,6 +3321,9 @@ void RenderLayerCompositor::ensureRootLayer() > m_clipLayer->setPosition(positionForClipLayer()); > m_clipLayer->setAnchorPoint(FloatPoint3D()); > >+ if (m_scrollLayer->type() == GraphicsLayer::Type::Scrolling) >+ m_scrollLayer->setSize(m_renderView.frameView().sizeForVisibleContent()); >+ > updateOverflowControlsLayers(); > > if (hasCoordinatedScrolling()) >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 87fce91bf2a..d01f7659628 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,44 @@ >+2018-02-16 Frederic Wang <fwang@igalia.com> >+ >+ [iOS] Adjust layer hierarchy to handle frame scrolling >+ https://bugs.webkit.org/show_bug.cgi?id=173833 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This patch adds scrolling layers to subframes so that they create the corresponding >+ UIScrollViews on iOS. A new ScrollingTreeRemoteFrameScrollingNodeIOS class is also introduced >+ to handle the case of subframes in the same way as position: overflow nodes. This class now >+ has different behavior for the main frame (already implemented) and subframes (using >+ ScrollingTreeScrollingNodeDelegate) so helper functions are added to distinguish the two >+ cases more easily. For now, this patch provides only basic scrolling support for subframes. >+ In order to properly implement hit testing, we introduce a new version of windowToContents, >+ currently only used by documentPointForWindowPoint. More tests and improvements will happen >+ in follow-up patches. >+ >+ * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp: >+ (WebKit::RemoteScrollingTree::createScrollingTreeNode): Use the new >+ ScrollingTreeRemoteFrameScrollingNodeIOS class to handle subframes. Also re-order the cases >+ to improve readability. >+ * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm: >+ (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers): Consider the >+ scrolledContentsLayer property since it is now used by subframes. >+ * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm: >+ (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren): >+ * UIProcess/RemoteLayerTree/ios/ScrollingTreeSubframeScrollingNodeIOS.h: Added. New >+ derived class to handle subframes. >+ * UIProcess/RemoteLayerTree/ios/ScrollingTreeSubframeScrollingNodeIOS.mm: Added. >+ (WebKit::ScrollingTreeSubframeScrollingNodeIOS::create): >+ (WebKit::ScrollingTreeSubframeScrollingNodeIOS::ScrollingTreeSubframeScrollingNodeIOS): >+ (WebKit::ScrollingTreeSubframeScrollingNodeIOS::~ScrollingTreeSubframeScrollingNodeIOS): >+ (WebKit::ScrollingTreeSubframeScrollingNodeIOS::commitStateBeforeChildren): Reuse the >+ implementation of the delegate. >+ (WebKit::ScrollingTreeSubframeScrollingNodeIOS::commitStateAfterChildren): Ditto. >+ (WebKit::ScrollingTreeSubframeScrollingNodeIOS::updateLayersAfterDelegatedScroll): Ditto. >+ (WebKit::ScrollingTreeSubframeScrollingNodeIOS::updateLayersAfterAncestorChange): Ditto. >+ (WebKit::ScrollingTreeSubframeScrollingNodeIOS::scrollPosition const): Ditto. >+ (WebKit::ScrollingTreeSubframeScrollingNodeIOS::setScrollLayerPosition): Ditto. >+ * WebKit.xcodeproj/project.pbxproj: Add ScrollingTreeSubframeScrollingNodeIOS files. >+ > 2018-02-16 Frederic Wang <fwang@igalia.com> > > Bug 182785 - Deprecate ScrollView::windowToContents(const IntPoint&) >diff --git a/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp b/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp >index b9d55f815de..143079785f9 100644 >--- a/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp >+++ b/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp >@@ -35,6 +35,7 @@ > > #if PLATFORM(IOS) > #include "ScrollingTreeOverflowScrollingNodeIOS.h" >+#include "ScrollingTreeSubframeScrollingNodeIOS.h" > #include <WebCore/ScrollingTreeFrameScrollingNodeIOS.h> > #else > #include <WebCore/ScrollingTreeFrameScrollingNodeMac.h> >@@ -113,17 +114,18 @@ void RemoteScrollingTree::scrollingTreeNodeRequestsScroll(ScrollingNodeID nodeID > Ref<ScrollingTreeNode> RemoteScrollingTree::createScrollingTreeNode(ScrollingNodeType nodeType, ScrollingNodeID nodeID) > { > switch (nodeType) { >- case MainFrameScrollingNode: >- case SubframeScrollingNode: > #if PLATFORM(IOS) >+ case MainFrameScrollingNode: > return ScrollingTreeFrameScrollingNodeIOS::create(*this, nodeType, nodeID); >-#else >- return ScrollingTreeFrameScrollingNodeMac::create(*this, nodeType, nodeID); >-#endif >+ case SubframeScrollingNode: >+ return ScrollingTreeSubframeScrollingNodeIOS::create(*this, nodeID); > case OverflowScrollingNode: >-#if PLATFORM(IOS) > return ScrollingTreeOverflowScrollingNodeIOS::create(*this, nodeID); > #else >+ case MainFrameScrollingNode: >+ case SubframeScrollingNode: >+ return ScrollingTreeFrameScrollingNodeMac::create(*this, nodeType, nodeID); >+ case OverflowScrollingNode: > ASSERT_NOT_REACHED(); > break; > #endif >diff --git a/Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm b/Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm >index e2b81414cdd..c6cf828ae0b 100644 >--- a/Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm >+++ b/Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm >@@ -74,6 +74,9 @@ void RemoteScrollingCoordinatorProxy::connectStateNodeLayers(ScrollingStateTree& > if (scrollingStateNode.hasChangedProperty(ScrollingStateNode::ScrollLayer)) > scrollingStateNode.setLayer(layerRepresentationFromLayerOrView(layerTreeHost.getLayer(scrollingStateNode.layer()))); > >+ if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrolledContentsLayer)) >+ scrollingStateNode.setScrolledContentsLayer(layerRepresentationFromLayerOrView(layerTreeHost.getLayer(scrollingStateNode.scrolledContentsLayer()))); >+ > if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::CounterScrollingLayer)) > scrollingStateNode.setCounterScrollingLayer(layerRepresentationFromLayerOrView(layerTreeHost.getLayer(scrollingStateNode.counterScrollingLayer()))); > >diff --git a/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeSubframeScrollingNodeIOS.h b/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeSubframeScrollingNodeIOS.h >new file mode 100644 >index 00000000000..b7e0764127d >--- /dev/null >+++ b/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeSubframeScrollingNodeIOS.h >@@ -0,0 +1,60 @@ >+/* >+ * Copyright (C) 2018 Igalia S.L. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#if ENABLE(ASYNC_SCROLLING) && PLATFORM(IOS) >+ >+#include <WebCore/ScrollingTreeFrameScrollingNodeIOS.h> >+ >+namespace WebKit { >+ >+class ScrollingTreeScrollingNodeDelegateIOS; >+ >+class ScrollingTreeSubframeScrollingNodeIOS : public WebCore::ScrollingTreeFrameScrollingNodeIOS { >+public: >+ static Ref<ScrollingTreeSubframeScrollingNodeIOS> create(WebCore::ScrollingTree&, WebCore::ScrollingNodeID); >+ virtual ~ScrollingTreeSubframeScrollingNodeIOS(); >+ >+private: >+ ScrollingTreeSubframeScrollingNodeIOS(WebCore::ScrollingTree&, WebCore::ScrollingNodeID); >+ >+ void commitStateBeforeChildren(const WebCore::ScrollingStateNode&) override; >+ void commitStateAfterChildren(const WebCore::ScrollingStateNode&) override; >+ >+ WebCore::FloatPoint scrollPosition() const override; >+ >+ void setScrollLayerPosition(const WebCore::FloatPoint&, const WebCore::FloatRect& layoutViewport) override; >+ >+ void updateLayersAfterDelegatedScroll(const WebCore::FloatPoint& scrollPosition) override; >+ >+ void updateLayersAfterAncestorChange(const WebCore::ScrollingTreeNode& changedNode, const WebCore::FloatRect& fixedPositionRect, const WebCore::FloatSize& cumulativeDelta) override; >+ >+ std::unique_ptr<ScrollingTreeScrollingNodeDelegateIOS> m_scrollingNodeDelegate; >+}; >+ >+} // namespace WebKit >+ >+#endif // ENABLE(ASYNC_SCROLLING) && PLATFORM(IOS) >diff --git a/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeSubframeScrollingNodeIOS.mm b/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeSubframeScrollingNodeIOS.mm >new file mode 100644 >index 00000000000..8f49c3193ba >--- /dev/null >+++ b/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeSubframeScrollingNodeIOS.mm >@@ -0,0 +1,94 @@ >+/* >+ * Copyright (C) 2018 Igalia S.L. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#import "config.h" >+#import "ScrollingTreeSubframeScrollingNodeIOS.h" >+ >+#if PLATFORM(IOS) >+#if ENABLE(ASYNC_SCROLLING) >+ >+#import "ScrollingTreeScrollingNodeDelegateIOS.h" >+ >+#import <WebCore/ScrollingStateFrameScrollingNode.h> >+ >+using namespace WebCore; >+ >+namespace WebKit { >+ >+Ref<ScrollingTreeSubframeScrollingNodeIOS> ScrollingTreeSubframeScrollingNodeIOS::create(WebCore::ScrollingTree& scrollingTree, WebCore::ScrollingNodeID nodeID) >+{ >+ return adoptRef(*new ScrollingTreeSubframeScrollingNodeIOS(scrollingTree, nodeID)); >+} >+ >+ScrollingTreeSubframeScrollingNodeIOS::ScrollingTreeSubframeScrollingNodeIOS(WebCore::ScrollingTree& scrollingTree, WebCore::ScrollingNodeID nodeID) >+ : ScrollingTreeFrameScrollingNodeIOS(scrollingTree, SubframeScrollingNode, nodeID) >+ , m_scrollingNodeDelegate(std::make_unique<ScrollingTreeScrollingNodeDelegateIOS>(*this)) >+{ >+} >+ >+ScrollingTreeSubframeScrollingNodeIOS::~ScrollingTreeSubframeScrollingNodeIOS() >+{ >+} >+ >+void ScrollingTreeSubframeScrollingNodeIOS::commitStateBeforeChildren(const WebCore::ScrollingStateNode& stateNode) >+{ >+ const auto& scrollingStateNode = downcast<ScrollingStateScrollingNode>(stateNode); >+ if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrollLayer)) >+ m_scrollingNodeDelegate->resetScrollViewDelegate(); >+ >+ ScrollingTreeFrameScrollingNodeIOS::commitStateBeforeChildren(stateNode); >+ >+ m_scrollingNodeDelegate->commitStateBeforeChildren(scrollingStateNode); >+} >+ >+void ScrollingTreeSubframeScrollingNodeIOS::commitStateAfterChildren(const ScrollingStateNode& stateNode) >+{ >+ m_scrollingNodeDelegate->commitStateAfterChildren(downcast<ScrollingStateScrollingNode>(stateNode)); >+} >+ >+void ScrollingTreeSubframeScrollingNodeIOS::updateLayersAfterDelegatedScroll(const FloatPoint& scrollPosition) >+{ >+ m_scrollingNodeDelegate->updateChildNodesAfterScroll(scrollPosition); >+} >+ >+void ScrollingTreeSubframeScrollingNodeIOS::updateLayersAfterAncestorChange(const ScrollingTreeNode& changedNode, const FloatRect& fixedPositionRect, const FloatSize& cumulativeDelta) >+{ >+ m_scrollingNodeDelegate->updateLayersAfterAncestorChange(changedNode, this->fixedPositionRect(), cumulativeDelta); >+} >+ >+FloatPoint ScrollingTreeSubframeScrollingNodeIOS::scrollPosition() const >+{ >+ return m_scrollingNodeDelegate->scrollPosition(); >+} >+ >+void ScrollingTreeSubframeScrollingNodeIOS::setScrollLayerPosition(const FloatPoint& scrollPosition, const FloatRect& layoutViewport) >+{ >+ m_scrollingNodeDelegate->setScrollLayerPosition(scrollPosition); >+} >+ >+} // namespace WebKit >+ >+#endif // ENABLE(ASYNC_SCROLLING) >+#endif // PLATFORM(IOS) >diff --git a/Source/WebKit/WebKit.xcodeproj/project.pbxproj b/Source/WebKit/WebKit.xcodeproj/project.pbxproj >index 9fd2227f417..76e3d51f99d 100644 >--- a/Source/WebKit/WebKit.xcodeproj/project.pbxproj >+++ b/Source/WebKit/WebKit.xcodeproj/project.pbxproj >@@ -91,6 +91,8 @@ > 0F5E200418E77051003EC3E5 /* PlatformCAAnimationRemote.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F5E200218E77051003EC3E5 /* PlatformCAAnimationRemote.h */; }; > 0F850FE61ED7C39F00FB77A7 /* WebPerformanceLoggingClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F850FE41ED7C39F00FB77A7 /* WebPerformanceLoggingClient.cpp */; }; > 0F850FE71ED7C39F00FB77A7 /* WebPerformanceLoggingClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F850FE51ED7C39F00FB77A7 /* WebPerformanceLoggingClient.h */; }; >+ 0F931C1C18C5711900DBA82F /* ScrollingTreeSubframeScrollingNodeIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F931C1A18C5711900DBA82F /* ScrollingTreeSubframeScrollingNodeIOS.h */; }; >+ 0F931C1D18C5711900DBA82F /* ScrollingTreeSubframeScrollingNodeIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0F931C1B18C5711900DBA82F /* ScrollingTreeSubframeScrollingNodeIOS.mm */; }; > 0F931C1C18C5711900DBA7C3 /* ScrollingTreeOverflowScrollingNodeIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F931C1A18C5711900DBA7C3 /* ScrollingTreeOverflowScrollingNodeIOS.h */; }; > 0F931C1C18C5711900DBB8D4 /* ScrollingTreeScrollingNodeDelegateIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F931C1A18C5711900DBB8D4 /* ScrollingTreeScrollingNodeDelegateIOS.h */; }; > 0F931C1D18C5711900DBA7C3 /* ScrollingTreeOverflowScrollingNodeIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0F931C1B18C5711900DBA7C3 /* ScrollingTreeOverflowScrollingNodeIOS.mm */; }; >@@ -2400,6 +2402,8 @@ > 0F707C791A1FEEA300DA7A45 /* RemoteLayerTreeScrollingPerformanceData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteLayerTreeScrollingPerformanceData.h; sourceTree = "<group>"; }; > 0F850FE41ED7C39F00FB77A7 /* WebPerformanceLoggingClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebPerformanceLoggingClient.cpp; sourceTree = "<group>"; }; > 0F850FE51ED7C39F00FB77A7 /* WebPerformanceLoggingClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPerformanceLoggingClient.h; sourceTree = "<group>"; }; >+ 0F931C1A18C5711900DBA82F /* ScrollingTreeSubframeScrollingNodeIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollingTreeSubframeScrollingNodeIOS.h; sourceTree = "<group>"; }; >+ 0F931C1B18C5711900DBA82F /* ScrollingTreeSubframeScrollingNodeIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ScrollingTreeSubframeScrollingNodeIOS.mm; sourceTree = "<group>"; }; > 0F931C1A18C5711900DBA7C3 /* ScrollingTreeOverflowScrollingNodeIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollingTreeOverflowScrollingNodeIOS.h; sourceTree = "<group>"; }; > 0F931C1A18C5711900DBB8D4 /* ScrollingTreeScrollingNodeDelegateIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollingTreeScrollingNodeDelegateIOS.h; sourceTree = "<group>"; }; > 0F931C1B18C5711900DBA7C3 /* ScrollingTreeOverflowScrollingNodeIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ScrollingTreeOverflowScrollingNodeIOS.mm; sourceTree = "<group>"; }; >@@ -5722,6 +5726,8 @@ > 0F0C365B18C05CA100F607D7 /* RemoteScrollingCoordinatorProxyIOS.mm */, > 0F931C1A18C5711900DBA7C3 /* ScrollingTreeOverflowScrollingNodeIOS.h */, > 0F931C1B18C5711900DBA7C3 /* ScrollingTreeOverflowScrollingNodeIOS.mm */, >+ 0F931C1A18C5711900DBA82F /* ScrollingTreeSubframeScrollingNodeIOS.h */, >+ 0F931C1B18C5711900DBA82F /* ScrollingTreeSubframeScrollingNodeIOS.mm */, > 0F931C1A18C5711900DBB8D4 /* ScrollingTreeScrollingNodeDelegateIOS.h */, > 0F931C1B18C5711900DBB8D4 /* ScrollingTreeScrollingNodeDelegateIOS.mm */, > ); >@@ -9154,6 +9160,7 @@ > 1AAB4A8D1296F0A20023952F /* SandboxExtension.h in Headers */, > E1E552C516AE065F004ED653 /* SandboxInitializationParameters.h in Headers */, > 0F931C1C18C5711900DBA7C3 /* ScrollingTreeOverflowScrollingNodeIOS.h in Headers */, >+ 0F931C1C18C5711900DBA82F /* ScrollingTreeSubframeScrollingNodeIOS.h in Headers */, > 0F931C1C18C5711900DBB8D4 /* ScrollingTreeScrollingNodeDelegateIOS.h in Headers */, > 51D130541382EAC000351EDD /* SecItemRequestData.h in Headers */, > 51D130561382EAC000351EDD /* SecItemResponseData.h in Headers */, >@@ -10835,6 +10842,7 @@ > E1E552C416AE065F004ED653 /* SandboxInitialiationParametersMac.mm in Sources */, > E19BDA8B19368D4600B97F57 /* SandboxUtilities.mm in Sources */, > 0F931C1D18C5711900DBA7C3 /* ScrollingTreeOverflowScrollingNodeIOS.mm in Sources */, >+ 0F931C1D18C5711900DBA82F /* ScrollingTreeSubframeScrollingNodeIOS.mm in Sources */, > 0F931C1D18C5711900DBB8D4 /* ScrollingTreeScrollingNodeDelegateIOS.mm in Sources */, > 51D130531382EAC000351EDD /* SecItemRequestData.cpp in Sources */, > 51D130551382EAC000351EDD /* SecItemResponseData.cpp in Sources */, >-- >2.17.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 173833
:
313912
|
314603
|
314820
|
316540
|
316636
|
316960
|
317250
|
319857
|
323531
|
323670
|
323891
|
325355
|
326991
|
327009
|
327851
|
328092
|
328094
|
328099
|
328573
|
328574
|
328575
|
329652
|
329761
|
330895
|
330896
|
330904
|
330905
|
330912
|
330984
|
331053
|
331249
|
331278
|
331280
|
331322
|
331618
|
331743
|
333179
|
333378
|
333488
|
333489
|
333498
|
333586
|
333906
|
333914
|
333915
|
333920
|
333932
|
333955
|
333965
|
333971
|
333972
|
334027
|
334030
|
340070
|
348911
|
349305
|
354928
|
354936
|
354941
|
355334
|
355335
|
355337
|
355340
|
355345
|
356154
|
356155
|
356214
|
356216
|
358318