WebKit Bugzilla
Attachment 340072 Details for
Bug 182868
: [iOS] Handle update of scroll layer positions for subframes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch (applies on top of bugs 182785, 173833 and 183040)
0004-Bug-182868-iOS-Handle-update-of-scroll-layer-positio.patch (text/plain), 24.70 KB, created by
Frédéric Wang (:fredw)
on 2018-05-09 23:35:31 PDT
(
hide
)
Description:
Patch (applies on top of bugs 182785, 173833 and 183040)
Filename:
MIME Type:
Creator:
Frédéric Wang (:fredw)
Created:
2018-05-09 23:35:31 PDT
Size:
24.70 KB
patch
obsolete
>From 0e8ada5ee43ee39dac9fd18132930ff35731f234 Mon Sep 17 00:00:00 2001 >From: Frederic Wang <fwang@igalia.com> >Date: Fri, 16 Feb 2018 13:29:35 +0100 >Subject: [PATCH xserver 4/4] Bug 182868 - [iOS] Handle update of scroll layer > positions for subframes > >--- > ...user-and-programmatic-scroll-expected.html | 11 ++ > .../mixing-user-and-programmatic-scroll.html | 136 ++++++++++++++++++ > .../programmatic-scroll-iframe-expected.html | 12 ++ > .../ios/programmatic-scroll-iframe.html | 123 ++++++++++++++++ > .../iframes/scrolling-iframe-expected.txt | 3 +- > .../scrolling/AsyncScrollingCoordinator.cpp | 18 ++- > .../ScrollingTreeScrollingNodeDelegate.cpp | 10 ++ > .../ScrollingTreeScrollingNodeDelegate.h | 2 + > .../rendering/RenderLayerCompositor.cpp | 15 ++ > .../ScrollingTreeScrollingNodeDelegateIOS.mm | 8 ++ > 10 files changed, 335 insertions(+), 3 deletions(-) > create mode 100644 LayoutTests/fast/scrolling/ios/mixing-user-and-programmatic-scroll-expected.html > create mode 100644 LayoutTests/fast/scrolling/ios/mixing-user-and-programmatic-scroll.html > create mode 100644 LayoutTests/fast/scrolling/ios/programmatic-scroll-iframe-expected.html > create mode 100644 LayoutTests/fast/scrolling/ios/programmatic-scroll-iframe.html > >diff --git a/LayoutTests/fast/scrolling/ios/mixing-user-and-programmatic-scroll-expected.html b/LayoutTests/fast/scrolling/ios/mixing-user-and-programmatic-scroll-expected.html >new file mode 100644 >index 00000000000..f1c8b80e838 >--- /dev/null >+++ b/LayoutTests/fast/scrolling/ios/mixing-user-and-programmatic-scroll-expected.html >@@ -0,0 +1,11 @@ >+<!DOCTYPE html> >+<html> >+ <head> >+ <title>Mixing user and programmatic scroll of iframe</title> >+ <meta name="viewport" content="width=device-width, initial-scale=1"> >+ </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/mixing-user-and-programmatic-scroll.html b/LayoutTests/fast/scrolling/ios/mixing-user-and-programmatic-scroll.html >new file mode 100644 >index 00000000000..83711545728 >--- /dev/null >+++ b/LayoutTests/fast/scrolling/ios/mixing-user-and-programmatic-scroll.html >@@ -0,0 +1,136 @@ >+<!DOCTYPE html> >+<html> >+ <head> >+ <title>Mixing user and programmatic scroll 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 getFrameData(id) >+ { >+ var result = {}; >+ var f = document.getElementById(id); >+ result.w = f.contentWindow.window; >+ var frameBox = f.getBoundingClientRect(); >+ result.x = frameBox.left + frameBox.width / 2; >+ result.y = frameBox.top + frameBox.height / 2; >+ return result; >+ } >+ >+ function waitPromise(delay) >+ { >+ return new Promise((resolve) => { setTimeout(resolve, delay); }); >+ } >+ >+ async function runTest() { >+ if (!window.testRunner || !testRunner.runUIScript) >+ return; >+ >+ // This verifies user scroll followed by orthogonal programmatic scroll. >+ var d = getFrameData("userYAndProgrammaticX"); >+ await touchAndDragFromPointToPoint(d.x, d.y, d.x, d.y - 150); >+ await liftUpAtPoint(d.x, d.y - 150); >+ await waitPromise(1000); // Wait for scrolling to stabilize. >+ d.w.scrollBy(100, 0); >+ >+ // This verifies programmatic scroll followed by orthogonal user scroll. >+ d = getFrameData("programmaticXAndUserY"); >+ d.w.scrollBy(100, 0); >+ await touchAndDragFromPointToPoint(d.x, d.y, d.x, d.y - 150); >+ await liftUpAtPoint(d.x, d.y - 150); >+ await waitPromise(1000); // Wait for scrolling to stabilize. >+ >+ // This verifies programmatic scroll followed by user scroll in the same direction. >+ d = getFrameData("programmaticXAndUserX"); >+ d.w.scrollBy(150, 0); >+ await touchAndDragFromPointToPoint(d.x, d.y, d.x - 100, d.y); >+ await liftUpAtPoint(d.x - 100, d.y); >+ await waitPromise(1000); // Wait for scrolling to stabilize. >+ >+ // This verifies user scroll followed by programmatic scroll in the same direction. >+ d = getFrameData("userXAndProgrammaticX"); >+ await touchAndDragFromPointToPoint(d.x, d.y, d.x - 100, d.y); >+ await liftUpAtPoint(d.x - 100, d.y); >+ await waitPromise(1000); // Wait for scrolling to stabilize. >+ d.w.scrollBy(150, 0); >+ >+ // This verifies mixing several user/programmatic scrolls in various directions. >+ d = getFrameData("programmaticYAndUserXAndProgrammaticXAndUserY"); >+ await touchAndDragFromPointToPoint(d.x, d.y, d.x, d.y - 100); >+ await liftUpAtPoint(d.x, d.y - 100); >+ await waitPromise(1000); // Wait for scrolling to stabilize. >+ d.w.scrollBy(150, 0); >+ await touchAndDragFromPointToPoint(d.x, d.y, d.x - 100, d.y); >+ await liftUpAtPoint(d.x - 100, d.y); >+ await waitPromise(1000); // Wait for scrolling to stabilize. >+ d.w.scrollBy(0, 150); >+ >+ // This verifies hit testing after user and programmatic scroll. >+ d = getFrameData("programmaticYAndUserXAndHitTesting"); >+ d.w.scrollBy(0, 100); >+ await touchAndDragFromPointToPoint(d.x, d.y, d.x - 150, d.y); >+ await liftUpAtPoint(d.x - 150, d.y); >+ await waitPromise(1500); // Wait for scrolling to stabilize and for scrollbar to disappear. >+ await tapAtPoint(d.x, d.y); >+ >+ testRunner.notifyDone(); >+ } >+ >+ var frameToLoadCount = 1; >+ 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="userYAndProgrammaticX" style="left: 0px; 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="programmaticXAndUserY" style="left: 100px; 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="programmaticXAndUserX" style="left: 200px; top: 0px;" scrolling="yes" srcdoc=" >+ <body style='margin: 0; width: 300px; height: 200px'> >+ <div style='left: 200px; top: 0px; position: absolute; width: 100px; height: 100px; background: green;'></div> >+ </body>" onload="newFrameLoaded()"> >+ </iframe> >+ <iframe id="userXAndProgrammaticX" style="left: 0px; top: 100px;" scrolling="yes" srcdoc=" >+ <body style='margin: 0; width: 300px; height: 200px'> >+ <div style='left: 200px; top: 0px; position: absolute; width: 100px; height: 100px; background: green;'></div> >+ </body>" onload="newFrameLoaded()"> >+ </iframe> >+ <iframe id="programmaticYAndUserXAndProgrammaticXAndUserY" style="left: 100px; top: 100px;" scrolling="yes" srcdoc=" >+ <body style='margin: 0; width: 300px; height: 300px'> >+ <div style='left: 200px; top: 200px; position: absolute; width: 100px; height: 100px; background: green;'></div> >+ </body>" onload="newFrameLoaded()"> >+ </iframe> >+ <iframe id="programmaticYAndUserXAndHitTesting" style="left: 200px; top: 100px;" scrolling="yes" srcdoc=" >+ <body style='margin: 0; width: 200px; height: 200px'> >+ <div style='left: 100px; top: 100px; position: absolute; width: 100px; height: 100px; background: red;' onclick='this.style.background="green"'></div> >+ </body>" onload="newFrameLoaded()"> >+ </iframe> >+ </div> >+</body> >+</html> >diff --git a/LayoutTests/fast/scrolling/ios/programmatic-scroll-iframe-expected.html b/LayoutTests/fast/scrolling/ios/programmatic-scroll-iframe-expected.html >new file mode 100644 >index 00000000000..5ed9ae29cf6 >--- /dev/null >+++ b/LayoutTests/fast/scrolling/ios/programmatic-scroll-iframe-expected.html >@@ -0,0 +1,12 @@ >+<!DOCTYPE html> >+<html> >+ <head> >+ <title>Programmatic scrolling of iframe</title> >+ <meta name="viewport" content="width=device-width, initial-scale=1"> >+ </head> >+ <body> >+ <p>This test passes if you see a green rectangle.</p> >+ <div style="position: absolute; top: 3em; width: 300px; height: 400px; background: green;"> >+ </div> >+ </body> >+</html> >diff --git a/LayoutTests/fast/scrolling/ios/programmatic-scroll-iframe.html b/LayoutTests/fast/scrolling/ios/programmatic-scroll-iframe.html >new file mode 100644 >index 00000000000..d4c181cae00 >--- /dev/null >+++ b/LayoutTests/fast/scrolling/ios/programmatic-scroll-iframe.html >@@ -0,0 +1,123 @@ >+<!DOCTYPE html> >+<html> >+ <head> >+ <title>Programmatic scrolling of iframe</title> >+ <meta name="viewport" content="width=device-width, initial-scale=1"> >+ <script> >+ if (window.testRunner) >+ testRunner.waitUntilDone(); >+ if (window.internals) >+ internals.settings.setAsyncFrameScrollingEnabled(true); >+ >+ function runTest() { >+ if (!window.testRunner || !testRunner.runUIScript) >+ return; >+ >+ // This checks scrolling to the location of the green square. >+ document.getElementById("doNotScroll").contentWindow.window.scrollTo(0, 0); >+ document.getElementById("maxScrollX").contentWindow.window.scrollTo(100, 0); >+ document.getElementById("maxScrollY").contentWindow.window.scrollTo(0, 100); >+ document.getElementById("maxScrollXY").contentWindow.window.scrollTo(100, 100); >+ document.getElementById("scrollMiddle").contentWindow.window.scrollTo(50, 50); >+ >+ // This checks scrolling outside the limit of the frame. >+ document.getElementById("scrollBelowXLimit").contentWindow.window.scrollBy(-100, 0); >+ document.getElementById("scrollAboveXLimit").contentWindow.window.scrollBy(200, 0); >+ document.getElementById("scrollBelowYLimit").contentWindow.window.scrollBy(0, -100); >+ document.getElementById("scrollAboveYLimit").contentWindow.window.scrollBy(0, 200); >+ >+ // This checks scrolling behavior for position "fixed" and "sticky". >+ document.getElementById("positionFixed").contentWindow.window.scrollTo(100, 100); >+ document.getElementById("positionStickyBegin").contentWindow.window.scrollTo(0, 50); >+ document.getElementById("positionStickyEnd").contentWindow.window.scrollTo(0, 150); >+ >+ testRunner.notifyDone(); >+ } >+ >+ var frameToLoadCount = 12; >+ 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: 400px; background: green;"> >+ <iframe id="doNotScroll" style="left: 0px; top: 0px;" scrolling="yes" srcdoc=" >+ <body style='margin: 0; width: 200px; height: 200px'> >+ <div style='position: absolute; width: 100px; height: 100px; background: green;'></div> >+ </body>" onload="newFrameLoaded()"> >+ </iframe> >+ <iframe id="maxScrollX" style="left: 100px; 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: 200px; 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: 0px; top: 100px" 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="scrollMiddle" style="left: 100px; top: 100px;" scrolling="yes" srcdoc=" >+ <body style='margin: 0; width: 200px; height: 200px'> >+ <div style='left: 50px; top: 50px; position: absolute; width: 100px; height: 100px; background: green;'></div> >+ </body>" onload="newFrameLoaded()"> >+ </iframe> >+ <iframe id="scrollBelowXLimit" style="left: 200px; top: 100px;" scrolling="yes" srcdoc=" >+ <body style='margin: 0; width: 200px; height: 200px'> >+ <div style='position: absolute; width: 200px; height: 200px; background: green;'></div> >+ </body>" onload="newFrameLoaded()"> >+ </iframe> >+ <iframe id="scrollAboveXLimit" style="left: 0px; top: 200px;" scrolling="yes" srcdoc=" >+ <body style='margin: 0; width: 200px; height: 200px'> >+ <div style='position: absolute; width: 200px; height: 200px; background: green;'></div> >+ </body>" onload="newFrameLoaded()"> >+ </iframe> >+ <iframe id="scrollBelowYLimit" style="left: 100px; top: 200px;" scrolling="yes" srcdoc=" >+ <body style='margin: 0; width: 200px; height: 200px'> >+ <div style='position: absolute; width: 200px; height: 200px; background: green;'></div> >+ </body>" onload="newFrameLoaded()"> >+ </iframe> >+ <iframe id="scrollAboveYLimit" style="left: 200px; top: 200px;" scrolling="yes" srcdoc=" >+ <body style='margin: 0; width: 200px; height: 200px'> >+ <div style='position: absolute; width: 200px; height: 200px; background: green;'></div> >+ </body>" onload="newFrameLoaded()"> >+ </iframe> >+ <iframe id="positionFixed" style="left: 0px; top: 300px;" 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="positionStickyBegin" style="left: 100px; top: 300px;" scrolling="yes" srcdoc=" >+ <body style='margin: 0; width: 200px; height: 300px'> >+ <div style='height: 50px'></div> >+ <div style='width: 100px; height: 50px; background: green;'></div> >+ <div style='position: -webkit-sticky; position: sticky; left: 0px; top: 0px; width: 100px; height: 50px; background: green;'></div> >+ </body>" onload="newFrameLoaded()"> >+ </iframe> >+ <iframe id="positionStickyEnd" style="left: 200px; top: 300px;" 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> >+ </div> >+ </body> >+</html> >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 683a373cb55..e28fdfac0da 100644 >--- a/LayoutTests/platform/ios-wk2/compositing/iframes/scrolling-iframe-expected.txt >+++ b/LayoutTests/platform/ios-wk2/compositing/iframes/scrolling-iframe-expected.txt >@@ -20,10 +20,11 @@ > (bounds 300.00 150.00) > (children 1 > (GraphicsLayer >- (position -80.00 -80.00) >+ (bounds origin 80.00 80.00) > (bounds 300.00 150.00) > (children 1 > (GraphicsLayer >+ (scrollOffset (80,80)) > (anchor 0.00 0.00) > (bounds 508.00 608.00) > (children 1 >diff --git a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp b/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp >index 0bf3197e17f..34752a6597a 100644 >--- a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp >+++ b/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp >@@ -427,8 +427,16 @@ void AsyncScrollingCoordinator::reconcileScrollingState(FrameView& frameView, co > FloatPoint positionForFooterLayer = FloatPoint(scrollPositionForFixed.x(), > FrameView::yPositionForFooterLayer(scrollPosition, topContentInset, frameView.totalContentsSize().height(), frameView.footerHeight())); > >+#if PLATFORM(IOS) >+ // On iOS the scroll layer update is performed in RenderLayerCompositor::frameViewDidScroll() >+ // using bounds origin rather than layer position. >+ ScrollPosition positionForScrollLayer; >+#else >+ ScrollPosition positionForScrollLayer = -frameView.scrollPosition(); >+#endif >+ > if (programmaticScroll || scrollingLayerPositionAction == ScrollingLayerPositionAction::Set) { >- scrollLayer->setPosition(-frameView.scrollPosition()); >+ scrollLayer->setPosition(positionForScrollLayer); > if (counterScrollingLayer) > counterScrollingLayer->setPosition(scrollPositionForFixed); > if (insetClipLayer) >@@ -442,7 +450,7 @@ void AsyncScrollingCoordinator::reconcileScrollingState(FrameView& frameView, co > if (footerLayer) > footerLayer->setPosition(positionForFooterLayer); > } else { >- scrollLayer->syncPosition(-frameView.scrollPosition()); >+ scrollLayer->syncPosition(positionForScrollLayer); > if (counterScrollingLayer) > counterScrollingLayer->syncPosition(scrollPositionForFixed); > if (insetClipLayer) >@@ -601,8 +609,14 @@ void AsyncScrollingCoordinator::setSynchronousScrollingReasons(FrameView& frameV > void AsyncScrollingCoordinator::updateScrollLayerPosition(FrameView& frameView) > { > ASSERT(isMainThread()); >+#if PLATFORM(IOS) >+ // On iOS the scroll layer update is performed in RenderLayerCompositor::frameViewDidScroll() >+ // using bounds origin rather than layer position. >+ UNUSED_PARAM(frameView); >+#else > if (auto* scrollLayer = scrollLayerForFrameView(frameView)) > scrollLayer->setPosition(-frameView.scrollPosition()); >+#endif > } > > bool AsyncScrollingCoordinator::isRubberBandInProgress() const >diff --git a/Source/WebCore/page/scrolling/ScrollingTreeScrollingNodeDelegate.cpp b/Source/WebCore/page/scrolling/ScrollingTreeScrollingNodeDelegate.cpp >index f14b79de7b7..66da8bae50f 100644 >--- a/Source/WebCore/page/scrolling/ScrollingTreeScrollingNodeDelegate.cpp >+++ b/Source/WebCore/page/scrolling/ScrollingTreeScrollingNodeDelegate.cpp >@@ -64,6 +64,16 @@ const IntPoint& ScrollingTreeScrollingNodeDelegate::scrollOrigin() const > return m_scrollingNode.scrollOrigin(); > } > >+FloatPoint ScrollingTreeScrollingNodeDelegate::minimumScrollPosition() const >+{ >+ return m_scrollingNode.minimumScrollPosition(); >+} >+ >+FloatPoint ScrollingTreeScrollingNodeDelegate::maximumScrollPosition() const >+{ >+ return m_scrollingNode.maximumScrollPosition(); >+} >+ > } // namespace WebCore > > #endif // PLATFORM(IOS) && ENABLE(ASYNC_SCROLLING) >diff --git a/Source/WebCore/page/scrolling/ScrollingTreeScrollingNodeDelegate.h b/Source/WebCore/page/scrolling/ScrollingTreeScrollingNodeDelegate.h >index beaa527529d..39b90b8b3c8 100644 >--- a/Source/WebCore/page/scrolling/ScrollingTreeScrollingNodeDelegate.h >+++ b/Source/WebCore/page/scrolling/ScrollingTreeScrollingNodeDelegate.h >@@ -43,6 +43,8 @@ public: > const ScrollingTreeScrollingNode& scrollingNode() const { return m_scrollingNode; } > > protected: >+ WEBCORE_EXPORT FloatPoint minimumScrollPosition() const; >+ WEBCORE_EXPORT FloatPoint maximumScrollPosition() const; > WEBCORE_EXPORT ScrollingTree& scrollingTree() const; > WEBCORE_EXPORT FloatPoint lastCommittedScrollPosition() const; > WEBCORE_EXPORT const FloatSize& totalContentsSize(); >diff --git a/Source/WebCore/rendering/RenderLayerCompositor.cpp b/Source/WebCore/rendering/RenderLayerCompositor.cpp >index db1214e057e..6b16dae945c 100644 >--- a/Source/WebCore/rendering/RenderLayerCompositor.cpp >+++ b/Source/WebCore/rendering/RenderLayerCompositor.cpp >@@ -1679,6 +1679,21 @@ void RenderLayerCompositor::frameViewDidScroll() > // If there's a scrolling coordinator that manages scrolling for this frame view, > // it will also manage updating the scroll layer position. > if (hasCoordinatedScrolling()) { >+#if PLATFORM(IOS) >+ auto& frameView = m_renderView.frameView(); >+ IntPoint scrollPosition = frameView.scrollPosition(); >+ // Note that we implement the contents offset via the bounds origin rather than a position. >+ m_scrollLayer->setBoundsOrigin(scrollPosition); >+ ASSERT(m_rootContentLayer); >+ IntSize scrollSize = frameView.contentsSize(); >+ if (m_rootContentLayer->size() != scrollSize) { >+ m_rootContentLayer->setSize(scrollSize); >+ m_rootContentLayer->setNeedsDisplay(); >+ } >+ m_rootContentLayer->setPosition(FloatPoint::zero()); >+ // Scrolling the content layer does not need to trigger a repaint. The offset will be compensated away during painting. >+ m_rootContentLayer->setScrollOffset(scrollPosition, GraphicsLayer::DontSetNeedsDisplay); >+#endif > // We have to schedule a flush in order for the main TiledBacking to update its tile coverage. > scheduleLayerFlushNow(); > return; >diff --git a/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm b/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm >index 4a2e29b5609..26de85d4b6e 100644 >--- a/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm >+++ b/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm >@@ -167,6 +167,7 @@ void ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren(const Scrol > || scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::TotalContentsSize) > || scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ReachableContentsSize) > || scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrollPosition) >+ || scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::RequestedScrollPosition) > || scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrollOrigin)) { > BEGIN_BLOCK_OBJC_EXCEPTIONS > UIScrollView *scrollView = (UIScrollView *)[scrollLayer() delegate]; >@@ -193,6 +194,13 @@ void ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren(const Scrol > recomputeInsets = true; > } > >+ if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::RequestedScrollPosition)) { >+ FloatPoint constrainedPosition = scrollingStateNode.requestedScrollPosition().constrainedBetween(minimumScrollPosition(), maximumScrollPosition()); >+ scrollView.contentOffset = constrainedPosition + scrollOrigin(); >+ recomputeInsets = true; >+ scrollingTree().scrollingTreeNodeDidScroll(scrollingStateNode.scrollingNodeID(), constrainedPosition, std::nullopt, ScrollingLayerPositionAction::Set); >+ } >+ > if (recomputeInsets) { > UIEdgeInsets insets = UIEdgeInsetsMake(0, 0, 0, 0); > // With RTL or bottom-to-top scrolling (non-zero origin), we need extra space on the left or top. >-- >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 182868
:
334032
|
334033
|
334271
|
334272
|
334349
|
334359
|
336850
|
340072
|
348913
|
354930
|
359723
|
359727