Title: [248554] branches/safari-608-branch/Source
Revision
248554
Author
[email protected]
Date
2019-08-12 16:41:29 -0700 (Mon, 12 Aug 2019)

Log Message

Cherry-pick r248447. rdar://problem/54218162

    Add to InteractionInformationAtPosition information about whether the element is in a subscrollable region
    https://bugs.webkit.org/show_bug.cgi?id=200374
    rdar://problem/54095519

    Reviewed by Tim Horton.
    Source/WebCore:

    Add to InteractionInformationAtPosition a ScrollingNodeID which represents the enclosing scrolling
    node that affects the targeted element's position. We use this to find a UIScrollView in the UI process.

    The entrypoint to finding the enclosing scrolling node is ScrollingCoordinator::scrollableContainerNodeID(),
    which calls RenderLayerCompositor::asyncScrollableContainerNodeID() to look for a scrolling ancestor in
    the current frame, and then looks for an enclosing scrollable frame, or a scrolling ancestor in
    the enclosing frame.

    There's a bit of subtlety in RenderLayerCompositor::asyncScrollableContainerNodeID() because if you're asking
    for the node that scrolls the renderer, if the renderer itself has a layer and is scrollable, you want
    its enclosing scroller.

    * page/scrolling/AsyncScrollingCoordinator.cpp:
    (WebCore::AsyncScrollingCoordinator::scrollableContainerNodeID const):
    * page/scrolling/AsyncScrollingCoordinator.h:
    * page/scrolling/ScrollingCoordinator.cpp:
    (WebCore::scrollableContainerNodeID const):
    * page/scrolling/ScrollingCoordinator.h:
    * rendering/RenderLayer.h:
    * rendering/RenderLayerCompositor.cpp:
    (WebCore::RenderLayerCompositor::asyncScrollableContainerNodeID):
    * rendering/RenderLayerCompositor.h:

    Source/WebKit:

    Add InteractionInformationAtPosition.containerScrollingNodeID and initialize it in elementPositionInformation()
    by asking the scrolling coordinator.

    Also add a way to get from a ScrollingNodeID to a UIScrollView to RemoteScrollingCoordinatorProxy,
    which gets the scrolling node and asks the delegate for the UIView.

    * Shared/ios/InteractionInformationAtPosition.h:
    * Shared/ios/InteractionInformationAtPosition.mm:
    (WebKit::InteractionInformationAtPosition::encode const):
    (WebKit::InteractionInformationAtPosition::decode):
    * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
    * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
    (WebKit::RemoteScrollingCoordinatorProxy::scrollViewForScrollingNodeID const):
    * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
    * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
    (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollView const):
    * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
    * WebProcess/WebPage/ios/WebPageIOS.mm:
    (WebKit::elementPositionInformation):

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

Modified Paths

Diff

Modified: branches/safari-608-branch/Source/WebCore/ChangeLog (248553 => 248554)


--- branches/safari-608-branch/Source/WebCore/ChangeLog	2019-08-12 23:30:06 UTC (rev 248553)
+++ branches/safari-608-branch/Source/WebCore/ChangeLog	2019-08-12 23:41:29 UTC (rev 248554)
@@ -1,19 +1,77 @@
-2019-08-06  Alan Coon  <[email protected]>
+2019-08-12  Alan Coon  <[email protected]>
 
-        Apply patch. rdar://problem/53992160
+        Cherry-pick r248447. rdar://problem/54218162
 
-    2019-08-06  Per Arne Vollan  <[email protected]>
+    Add to InteractionInformationAtPosition information about whether the element is in a subscrollable region
+    https://bugs.webkit.org/show_bug.cgi?id=200374
+    rdar://problem/54095519
+    
+    Reviewed by Tim Horton.
+    Source/WebCore:
+    
+    Add to InteractionInformationAtPosition a ScrollingNodeID which represents the enclosing scrolling
+    node that affects the targeted element's position. We use this to find a UIScrollView in the UI process.
+    
+    The entrypoint to finding the enclosing scrolling node is ScrollingCoordinator::scrollableContainerNodeID(),
+    which calls RenderLayerCompositor::asyncScrollableContainerNodeID() to look for a scrolling ancestor in
+    the current frame, and then looks for an enclosing scrollable frame, or a scrolling ancestor in
+    the enclosing frame.
+    
+    There's a bit of subtlety in RenderLayerCompositor::asyncScrollableContainerNodeID() because if you're asking
+    for the node that scrolls the renderer, if the renderer itself has a layer and is scrollable, you want
+    its enclosing scroller.
+    
+    * page/scrolling/AsyncScrollingCoordinator.cpp:
+    (WebCore::AsyncScrollingCoordinator::scrollableContainerNodeID const):
+    * page/scrolling/AsyncScrollingCoordinator.h:
+    * page/scrolling/ScrollingCoordinator.cpp:
+    (WebCore::scrollableContainerNodeID const):
+    * page/scrolling/ScrollingCoordinator.h:
+    * rendering/RenderLayer.h:
+    * rendering/RenderLayerCompositor.cpp:
+    (WebCore::RenderLayerCompositor::asyncScrollableContainerNodeID):
+    * rendering/RenderLayerCompositor.h:
+    
+    Source/WebKit:
+    
+    Add InteractionInformationAtPosition.containerScrollingNodeID and initialize it in elementPositionInformation()
+    by asking the scrolling coordinator.
+    
+    Also add a way to get from a ScrollingNodeID to a UIScrollView to RemoteScrollingCoordinatorProxy,
+    which gets the scrolling node and asks the delegate for the UIView.
+    
+    * Shared/ios/InteractionInformationAtPosition.h:
+    * Shared/ios/InteractionInformationAtPosition.mm:
+    (WebKit::InteractionInformationAtPosition::encode const):
+    (WebKit::InteractionInformationAtPosition::decode):
+    * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
+    * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
+    (WebKit::RemoteScrollingCoordinatorProxy::scrollViewForScrollingNodeID const):
+    * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
+    * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
+    (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollView const):
+    * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
+    * WebProcess/WebPage/ios/WebPageIOS.mm:
+    (WebKit::elementPositionInformation):
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248447 268f45cc-cd09-0410-ab3c-d52691b4dbfc
 
-            [Win] Fix AppleWin build
-            https://bugs.webkit.org/show_bug.cgi?id=200414
+    2019-08-06  Alan Coon  <[email protected]>
 
-            Reviewed by Brent Fulgham.
+            Apply patch. rdar://problem/53992160
 
-            * CMakeLists.txt:
-            * PlatformPlayStation.cmake:
-            * PlatformWPE.cmake:
-            * PlatformWin.cmake:
+        2019-08-06  Per Arne Vollan  <[email protected]>
 
+                [Win] Fix AppleWin build
+                https://bugs.webkit.org/show_bug.cgi?id=200414
+
+                Reviewed by Brent Fulgham.
+
+                * CMakeLists.txt:
+                * PlatformPlayStation.cmake:
+                * PlatformWPE.cmake:
+                * PlatformWin.cmake:
+
 2019-08-01  Alan Coon  <[email protected]>
 
         Apply patch. rdar://problem/53764238
@@ -378,6 +436,37 @@
             Unfortunately no new tests since there is no reproducible test case, and this crash is highly racy.
 
             * workers/WorkerGlobalScope.cpp:
+2019-08-08  Simon Fraser  <[email protected]>
+
+        Add to InteractionInformationAtPosition information about whether the element is in a subscrollable region
+        https://bugs.webkit.org/show_bug.cgi?id=200374
+        rdar://problem/54095519
+
+        Reviewed by Tim Horton.
+
+        Add to InteractionInformationAtPosition a ScrollingNodeID which represents the enclosing scrolling
+        node that affects the targeted element's position. We use this to find a UIScrollView in the UI process.
+        
+        The entrypoint to finding the enclosing scrolling node is ScrollingCoordinator::scrollableContainerNodeID(),
+        which calls RenderLayerCompositor::asyncScrollableContainerNodeID() to look for a scrolling ancestor in
+        the current frame, and then looks for an enclosing scrollable frame, or a scrolling ancestor in
+        the enclosing frame.
+        
+        There's a bit of subtlety in RenderLayerCompositor::asyncScrollableContainerNodeID() because if you're asking
+        for the node that scrolls the renderer, if the renderer itself has a layer and is scrollable, you want
+        its enclosing scroller.
+
+        * page/scrolling/AsyncScrollingCoordinator.cpp:
+        (WebCore::AsyncScrollingCoordinator::scrollableContainerNodeID const):
+        * page/scrolling/AsyncScrollingCoordinator.h:
+        * page/scrolling/ScrollingCoordinator.cpp:
+        (WebCore::scrollableContainerNodeID const):
+        * page/scrolling/ScrollingCoordinator.h:
+        * rendering/RenderLayer.h:
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::asyncScrollableContainerNodeID):
+        * rendering/RenderLayerCompositor.h:
+
             (WebCore::CryptoBufferContainer): Added.
             (WebCore::CryptoBufferContainer::create): Added.
             (WebCore::CryptoBufferContainer::buffer): Added.

Modified: branches/safari-608-branch/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp (248553 => 248554)


--- branches/safari-608-branch/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp	2019-08-12 23:30:06 UTC (rev 248553)
+++ branches/safari-608-branch/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp	2019-08-12 23:41:29 UTC (rev 248554)
@@ -37,6 +37,8 @@
 #include "Logging.h"
 #include "Page.h"
 #include "PerformanceLoggingClient.h"
+#include "RenderLayerCompositor.h"
+#include "RenderView.h"
 #include "ScrollAnimator.h"
 #include "ScrollingConstraints.h"
 #include "ScrollingStateFixedNode.h"
@@ -789,6 +791,28 @@
     return settings.asyncFrameScrollingEnabled() || settings.asyncOverflowScrollingEnabled();
 }
 
+ScrollingNodeID AsyncScrollingCoordinator::scrollableContainerNodeID(const RenderObject& renderer) const
+{
+    if (auto overflowScrollingNodeID = renderer.view().compositor().asyncScrollableContainerNodeID(renderer))
+        return overflowScrollingNodeID;
+
+    // If we're in a scrollable frame, return that.
+    auto* frameView = renderer.frame().view();
+    if (!frameView)
+        return 0;
+
+    if (auto scrollingNodeID = frameView->scrollingNodeID())
+        return scrollingNodeID;
+
+    // Otherwise, look for a scrollable element in the containing frame.
+    if (auto* ownerElement = renderer.document().ownerElement()) {
+        if (auto* frameRenderer = ownerElement->renderer())
+            return scrollableContainerNodeID(*frameRenderer);
+    }
+
+    return 0;
+}
+
 String AsyncScrollingCoordinator::scrollingStateTreeAsText(ScrollingStateTreeAsTextBehavior behavior) const
 {
     if (m_scrollingStateTree->rootStateNode()) {

Modified: branches/safari-608-branch/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h (248553 => 248554)


--- branches/safari-608-branch/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h	2019-08-12 23:30:06 UTC (rev 248553)
+++ branches/safari-608-branch/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h	2019-08-12 23:41:29 UTC (rev 248554)
@@ -91,6 +91,8 @@
     
     bool asyncFrameOrOverflowScrollingEnabled() const;
 
+    WEBCORE_EXPORT ScrollingNodeID scrollableContainerNodeID(const RenderObject&) const override;
+
     WEBCORE_EXPORT void frameViewLayoutUpdated(FrameView&) override;
     WEBCORE_EXPORT void frameViewRootLayerDidChange(FrameView&) override;
     WEBCORE_EXPORT void frameViewVisualViewportChanged(FrameView&) override;

Modified: branches/safari-608-branch/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp (248553 => 248554)


--- branches/safari-608-branch/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp	2019-08-12 23:30:06 UTC (rev 248553)
+++ branches/safari-608-branch/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp	2019-08-12 23:41:29 UTC (rev 248554)
@@ -96,6 +96,11 @@
     return layer.hasCompositedScrollableOverflow();
 }
 
+ScrollingNodeID ScrollingCoordinator::scrollableContainerNodeID(const RenderObject&) const
+{
+    return 0;
+}
+
 EventTrackingRegions ScrollingCoordinator::absoluteEventTrackingRegionsForFrame(const Frame& frame) const
 {
     auto* renderView = frame.contentRenderer();

Modified: branches/safari-608-branch/Source/WebCore/page/scrolling/ScrollingCoordinator.h (248553 => 248554)


--- branches/safari-608-branch/Source/WebCore/page/scrolling/ScrollingCoordinator.h	2019-08-12 23:30:06 UTC (rev 248553)
+++ branches/safari-608-branch/Source/WebCore/page/scrolling/ScrollingCoordinator.h	2019-08-12 23:41:29 UTC (rev 248554)
@@ -59,6 +59,7 @@
 class GraphicsLayer;
 class Page;
 class Region;
+class RenderObject;
 class RenderLayer;
 class ScrollableArea;
 class ViewportConstraints;
@@ -83,6 +84,9 @@
     // Return whether this scrolling coordinator handles scrolling for the given overflow scroll layer.
     WEBCORE_EXPORT virtual bool coordinatesScrollingForOverflowLayer(const RenderLayer&) const;
 
+    // Returns the ScrollingNodeID of the innermost scrolling node that scrolls the renderer.
+    WEBCORE_EXPORT virtual ScrollingNodeID scrollableContainerNodeID(const RenderObject&) const;
+
     // Should be called whenever the given frame view has been laid out.
     virtual void frameViewLayoutUpdated(FrameView&) { }
 

Modified: branches/safari-608-branch/Source/WebCore/rendering/RenderLayerCompositor.cpp (248553 => 248554)


--- branches/safari-608-branch/Source/WebCore/rendering/RenderLayerCompositor.cpp	2019-08-12 23:30:06 UTC (rev 248553)
+++ branches/safari-608-branch/Source/WebCore/rendering/RenderLayerCompositor.cpp	2019-08-12 23:41:29 UTC (rev 248554)
@@ -2709,6 +2709,37 @@
     return newStack;
 }
 
+// Note that this returns the ScrollingNodeID of the scroller this layer is embedded in, not the layer's own ScrollingNodeID if it has one.
+ScrollingNodeID RenderLayerCompositor::asyncScrollableContainerNodeID(const RenderObject& renderer)
+{
+    auto* enclosingLayer = renderer.enclosingLayer();
+    if (!enclosingLayer)
+        return 0;
+    
+    auto layerScrollingNodeID = [](const RenderLayer& layer) -> ScrollingNodeID {
+        if (layer.isComposited())
+            return layer.backing()->scrollingNodeIDForRole(ScrollCoordinationRole::Scrolling);
+        return 0;
+    };
+
+    // If the renderer is inside the layer, we care about the layer's scrollability. Otherwise, we let traverseAncestorLayers look at ancestors.
+    if (!renderer.hasLayer()) {
+        if (auto scrollingNodeID = layerScrollingNodeID(*enclosingLayer))
+            return scrollingNodeID;
+    }
+
+    ScrollingNodeID containerScrollingNodeID = 0;
+    traverseAncestorLayers(*enclosingLayer, [&](const RenderLayer& ancestorLayer, bool isContainingBlockChain, bool /*isPaintOrderAncestor*/) {
+        if (isContainingBlockChain && ancestorLayer.hasCompositedScrollableOverflow()) {
+            containerScrollingNodeID = layerScrollingNodeID(ancestorLayer);
+            return AncestorTraversal::Stop;
+        }
+        return AncestorTraversal::Continue;
+    });
+
+    return containerScrollingNodeID;
+}
+
 // Return true if the given layer is a stacking context and has compositing child
 // layers that it needs to clip. In this case we insert a clipping GraphicsLayer
 // into the hierarchy between this layer and its children in the z-order hierarchy.

Modified: branches/safari-608-branch/Source/WebCore/rendering/RenderLayerCompositor.h (248553 => 248554)


--- branches/safari-608-branch/Source/WebCore/rendering/RenderLayerCompositor.h	2019-08-12 23:30:06 UTC (rev 248553)
+++ branches/safari-608-branch/Source/WebCore/rendering/RenderLayerCompositor.h	2019-08-12 23:41:29 UTC (rev 248554)
@@ -214,6 +214,10 @@
 
     bool updateAncestorClippingStack(const RenderLayer&, const RenderLayer* compositingAncestor) const;
 
+    // Returns the ScrollingNodeID for the containing async-scrollable layer that scrolls this renderer's border box.
+    // May return 0 for position-fixed content.
+    static ScrollingNodeID asyncScrollableContainerNodeID(const RenderObject&);
+
     // Whether layer's backing needs a graphics layer to clip z-order children of the given layer.
     static bool clipsCompositingDescendants(const RenderLayer&);
 

Modified: branches/safari-608-branch/Source/WebKit/ChangeLog (248553 => 248554)


--- branches/safari-608-branch/Source/WebKit/ChangeLog	2019-08-12 23:30:06 UTC (rev 248553)
+++ branches/safari-608-branch/Source/WebKit/ChangeLog	2019-08-12 23:41:29 UTC (rev 248554)
@@ -1,16 +1,74 @@
-2019-08-06  Alan Coon  <[email protected]>
+2019-08-12  Alan Coon  <[email protected]>
 
-        Apply patch. rdar://problem/53992160
+        Cherry-pick r248447. rdar://problem/54218162
 
-    2019-08-06  Per Arne Vollan  <[email protected]>
+    Add to InteractionInformationAtPosition information about whether the element is in a subscrollable region
+    https://bugs.webkit.org/show_bug.cgi?id=200374
+    rdar://problem/54095519
+    
+    Reviewed by Tim Horton.
+    Source/WebCore:
+    
+    Add to InteractionInformationAtPosition a ScrollingNodeID which represents the enclosing scrolling
+    node that affects the targeted element's position. We use this to find a UIScrollView in the UI process.
+    
+    The entrypoint to finding the enclosing scrolling node is ScrollingCoordinator::scrollableContainerNodeID(),
+    which calls RenderLayerCompositor::asyncScrollableContainerNodeID() to look for a scrolling ancestor in
+    the current frame, and then looks for an enclosing scrollable frame, or a scrolling ancestor in
+    the enclosing frame.
+    
+    There's a bit of subtlety in RenderLayerCompositor::asyncScrollableContainerNodeID() because if you're asking
+    for the node that scrolls the renderer, if the renderer itself has a layer and is scrollable, you want
+    its enclosing scroller.
+    
+    * page/scrolling/AsyncScrollingCoordinator.cpp:
+    (WebCore::AsyncScrollingCoordinator::scrollableContainerNodeID const):
+    * page/scrolling/AsyncScrollingCoordinator.h:
+    * page/scrolling/ScrollingCoordinator.cpp:
+    (WebCore::scrollableContainerNodeID const):
+    * page/scrolling/ScrollingCoordinator.h:
+    * rendering/RenderLayer.h:
+    * rendering/RenderLayerCompositor.cpp:
+    (WebCore::RenderLayerCompositor::asyncScrollableContainerNodeID):
+    * rendering/RenderLayerCompositor.h:
+    
+    Source/WebKit:
+    
+    Add InteractionInformationAtPosition.containerScrollingNodeID and initialize it in elementPositionInformation()
+    by asking the scrolling coordinator.
+    
+    Also add a way to get from a ScrollingNodeID to a UIScrollView to RemoteScrollingCoordinatorProxy,
+    which gets the scrolling node and asks the delegate for the UIView.
+    
+    * Shared/ios/InteractionInformationAtPosition.h:
+    * Shared/ios/InteractionInformationAtPosition.mm:
+    (WebKit::InteractionInformationAtPosition::encode const):
+    (WebKit::InteractionInformationAtPosition::decode):
+    * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
+    * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
+    (WebKit::RemoteScrollingCoordinatorProxy::scrollViewForScrollingNodeID const):
+    * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
+    * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
+    (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollView const):
+    * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
+    * WebProcess/WebPage/ios/WebPageIOS.mm:
+    (WebKit::elementPositionInformation):
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248447 268f45cc-cd09-0410-ab3c-d52691b4dbfc
 
-            [Win] Fix AppleWin build
-            https://bugs.webkit.org/show_bug.cgi?id=200414
+    2019-08-06  Alan Coon  <[email protected]>
 
-            Reviewed by Brent Fulgham.
+            Apply patch. rdar://problem/53992160
 
-            * CMakeLists.txt:
+        2019-08-06  Per Arne Vollan  <[email protected]>
 
+                [Win] Fix AppleWin build
+                https://bugs.webkit.org/show_bug.cgi?id=200414
+
+                Reviewed by Brent Fulgham.
+
+                * CMakeLists.txt:
+
 2019-08-01  Alan Coon  <[email protected]>
 
         Cherry-pick r248085. rdar://problem/53825741
@@ -310,6 +368,34 @@
     
     LayoutTests:
     
+2019-08-08  Simon Fraser  <[email protected]>
+
+        Add to InteractionInformationAtPosition information about whether the element is in a subscrollable region
+        https://bugs.webkit.org/show_bug.cgi?id=200374
+        rdar://problem/54095519
+
+        Reviewed by Tim Horton.
+        
+        Add InteractionInformationAtPosition.containerScrollingNodeID and initialize it in elementPositionInformation()
+        by asking the scrolling coordinator.
+        
+        Also add a way to get from a ScrollingNodeID to a UIScrollView to RemoteScrollingCoordinatorProxy,
+        which gets the scrolling node and asks the delegate for the UIView.
+
+        * Shared/ios/InteractionInformationAtPosition.h:
+        * Shared/ios/InteractionInformationAtPosition.mm:
+        (WebKit::InteractionInformationAtPosition::encode const):
+        (WebKit::InteractionInformationAtPosition::decode):
+        * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
+        * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
+        (WebKit::RemoteScrollingCoordinatorProxy::scrollViewForScrollingNodeID const):
+        * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
+        * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
+        (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollView const):
+        * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::elementPositionInformation):
+
     Fix test and make sure messages are exchanged for the test to succeed.
     
     * http/tests/workers/service/resources/serviceworker-websocket-worker.js:

Modified: branches/safari-608-branch/Source/WebKit/Shared/ios/InteractionInformationAtPosition.h (248553 => 248554)


--- branches/safari-608-branch/Source/WebKit/Shared/ios/InteractionInformationAtPosition.h	2019-08-12 23:30:06 UTC (rev 248553)
+++ branches/safari-608-branch/Source/WebKit/Shared/ios/InteractionInformationAtPosition.h	2019-08-12 23:41:29 UTC (rev 248554)
@@ -31,6 +31,7 @@
 #include "InteractionInformationRequest.h"
 #include "ShareableBitmap.h"
 #include <WebCore/IntPoint.h>
+#include <WebCore/ScrollTypes.h>
 #include <WebCore/SelectionRect.h>
 #include <WebCore/TextIndicator.h>
 #include <wtf/URL.h>
@@ -61,6 +62,7 @@
     bool isAttachment { false };
     bool isAnimatedImage { false };
     bool isElement { false };
+    WebCore::ScrollingNodeID containerScrollingNodeID { 0 };
 #if ENABLE(DATA_DETECTION)
     bool isDataDetectorLink { false };
 #endif

Modified: branches/safari-608-branch/Source/WebKit/Shared/ios/InteractionInformationAtPosition.mm (248553 => 248554)


--- branches/safari-608-branch/Source/WebKit/Shared/ios/InteractionInformationAtPosition.mm	2019-08-12 23:30:06 UTC (rev 248553)
+++ branches/safari-608-branch/Source/WebKit/Shared/ios/InteractionInformationAtPosition.mm	2019-08-12 23:41:29 UTC (rev 248554)
@@ -56,6 +56,7 @@
     encoder << isAttachment;
     encoder << isAnimatedImage;
     encoder << isElement;
+    encoder << containerScrollingNodeID;
     encoder << adjustedPointForNodeRespondingToClickEvents;
     encoder << url;
     encoder << imageURL;
@@ -125,6 +126,9 @@
     if (!decoder.decode(result.isElement))
         return false;
 
+    if (!decoder.decode(result.containerScrollingNodeID))
+        return false;
+
     if (!decoder.decode(result.adjustedPointForNodeRespondingToClickEvents))
         return false;
 

Modified: branches/safari-608-branch/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h (248553 => 248554)


--- branches/safari-608-branch/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h	2019-08-12 23:30:06 UTC (rev 248553)
+++ branches/safari-608-branch/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h	2019-08-12 23:41:29 UTC (rev 248554)
@@ -34,6 +34,8 @@
 #include <wtf/Noncopyable.h>
 #include <wtf/RefPtr.h>
 
+OBJC_CLASS UIScrollView;
+
 namespace WebCore {
 class FloatPoint;
 class PlatformWheelEvent;
@@ -87,6 +89,8 @@
     bool hasScrollableMainFrame() const;
 
 #if PLATFORM(IOS_FAMILY)
+    UIScrollView *scrollViewForScrollingNodeID(WebCore::ScrollingNodeID) const;
+
     WebCore::FloatRect currentLayoutViewport() const;
     void scrollingTreeNodeWillStartPanGesture();
     void scrollingTreeNodeWillStartScroll();

Modified: branches/safari-608-branch/Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm (248553 => 248554)


--- branches/safari-608-branch/Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm	2019-08-12 23:30:06 UTC (rev 248553)
+++ branches/safari-608-branch/Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm	2019-08-12 23:41:29 UTC (rev 248554)
@@ -31,6 +31,7 @@
 
 #import "RemoteLayerTreeHost.h"
 #import "RemoteLayerTreeNode.h"
+#import "ScrollingTreeOverflowScrollingNodeIOS.h"
 #import "WebPageProxy.h"
 #import <UIKit/UIView.h>
 #import <WebCore/ScrollingStateFrameScrollingNode.h>
@@ -52,6 +53,17 @@
 namespace WebKit {
 using namespace WebCore;
 
+UIScrollView *RemoteScrollingCoordinatorProxy::scrollViewForScrollingNodeID(WebCore::ScrollingNodeID nodeID) const
+{
+    auto* treeNode = m_scrollingTree->nodeForID(nodeID);
+    if (!is<ScrollingTreeOverflowScrollingNode>(treeNode))
+        return nil;
+
+    auto* scrollingNode = downcast<ScrollingTreeOverflowScrollingNode>(treeNode);
+    // All ScrollingTreeOverflowScrollingNodes are ScrollingTreeOverflowScrollingNodeIOS on iOS.
+    return static_cast<ScrollingTreeOverflowScrollingNodeIOS*>(scrollingNode)->scrollView();
+}
+
 void RemoteScrollingCoordinatorProxy::connectStateNodeLayers(ScrollingStateTree& stateTree, const RemoteLayerTreeHost& layerTreeHost)
 {
     for (auto& currNode : stateTree.nodeMap().values()) {

Modified: branches/safari-608-branch/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h (248553 => 248554)


--- branches/safari-608-branch/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h	2019-08-12 23:30:06 UTC (rev 248553)
+++ branches/safari-608-branch/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h	2019-08-12 23:41:29 UTC (rev 248554)
@@ -29,6 +29,8 @@
 
 #include <WebCore/ScrollingTreeOverflowScrollingNode.h>
 
+OBJC_CLASS UIScrollView;
+
 namespace WebKit {
 
 class ScrollingTreeScrollingNodeDelegateIOS;
@@ -38,6 +40,8 @@
     static Ref<ScrollingTreeOverflowScrollingNodeIOS> create(WebCore::ScrollingTree&, WebCore::ScrollingNodeID);
     virtual ~ScrollingTreeOverflowScrollingNodeIOS();
 
+    UIScrollView* scrollView() const;
+
 private:
     ScrollingTreeOverflowScrollingNodeIOS(WebCore::ScrollingTree&, WebCore::ScrollingNodeID);
 

Modified: branches/safari-608-branch/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm (248553 => 248554)


--- branches/safari-608-branch/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm	2019-08-12 23:30:06 UTC (rev 248553)
+++ branches/safari-608-branch/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm	2019-08-12 23:41:29 UTC (rev 248554)
@@ -51,6 +51,11 @@
 {
 }
 
+UIScrollView* ScrollingTreeOverflowScrollingNodeIOS::scrollView() const
+{
+    return m_scrollingNodeDelegate->scrollView();
+}
+
 void ScrollingTreeOverflowScrollingNodeIOS::commitStateBeforeChildren(const WebCore::ScrollingStateNode& stateNode)
 {
     if (stateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrollContainerLayer))

Modified: branches/safari-608-branch/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h (248553 => 248554)


--- branches/safari-608-branch/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h	2019-08-12 23:30:06 UTC (rev 248553)
+++ branches/safari-608-branch/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h	2019-08-12 23:41:29 UTC (rev 248554)
@@ -74,10 +74,9 @@
 #endif
 
     UIScrollView *findActingScrollParent(UIScrollView *);
+    UIScrollView *scrollView() const;
 
 private:
-    UIScrollView *scrollView() const;
-
     RetainPtr<CALayer> m_scrollLayer;
     RetainPtr<CALayer> m_scrolledContentsLayer;
     RetainPtr<WKScrollingNodeScrollViewDelegate> m_scrollViewDelegate;

Modified: branches/safari-608-branch/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (248553 => 248554)


--- branches/safari-608-branch/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2019-08-12 23:30:06 UTC (rev 248553)
+++ branches/safari-608-branch/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2019-08-12 23:41:29 UTC (rev 248554)
@@ -2680,6 +2680,14 @@
 #endif
     }
 
+    auto* elementForScrollTesting = linkElement ? linkElement : &element;
+    if (auto* renderer = elementForScrollTesting->renderer()) {
+#if ENABLE(ASYNC_SCROLLING)
+        if (auto* scrollingCoordinator = page.scrollingCoordinator())
+            info.containerScrollingNodeID = scrollingCoordinator->scrollableContainerNodeID(*renderer);
+#endif
+    }
+
     if (auto* renderer = element.renderer()) {
         if (renderer->isRenderImage())
             imagePositionInformation(page, element, request, info);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to