Title: [249999] branches/safari-608-branch/Source
Revision
249999
Author
[email protected]
Date
2019-09-17 15:29:48 -0700 (Tue, 17 Sep 2019)

Log Message

Cherry-pick r249815. rdar://problem/55427483

    REGRESSION (iOS 13): Top fixed element on apple.com flickers in size while pinching in
    https://bugs.webkit.org/show_bug.cgi?id=201668
    rdar://problem/51934041

    Reviewed by Frédéric Wang.

    Source/WebCore:

    When computing the new layout viewport rect in ScrollingTreeFrameScrollingNode, use
    "StickToDocumentBounds" mode, not "StickToViewportBounds", because otherwise we'll compute
    a layout viewport that has negative top/left offsets which causes fixed elements to jump outside
    the viewport. The only code that should be moving things outside the viewport (a temporary effect
    that happens when pinching) is the 'isBelowMinimumScale' path in WebPageProxy::computeCustomFixedPositionRect().

    With this change ScrollingTreeFrameScrollingNode no longer needs m_behaviorForFixed; it can be removed later.

    Not currently testable, since it involves pinching in past minimum zoom and transients state.

    * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
    (WebCore::ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition const):

    Source/WebKit:

    The UI process can have transient state that pushes scrolling-tree-managed layers into custom
    locations while pinch-zooming. We have to apply this state both when the visible rects
    in the UI process change (existing code in -[WKContentView didUpdateVisibleRect:...]) and when
    we get new layers from the web process (added in RemoteLayerTreeDrawingAreaProxy::commitLayerTree()
    in this patch).

    Move some code into WebPageProxy to create functions that we can call from both places.

    For manual testing, visit a page with fixed banners, pinch in slightly, then pinch out and,
    while keeping your fingers down, move the contents around.

    * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
    (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
    * UIProcess/WebPageProxy.h:
    * UIProcess/ios/WKContentView.mm:
    (-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
    * UIProcess/ios/WebPageProxyIOS.mm:
    (WebKit::WebPageProxy::unconstrainedLayoutViewportRect const):
    (WebKit::WebPageProxy::adjustLayersForLayoutViewport):

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

Modified Paths

Diff

Modified: branches/safari-608-branch/Source/WebCore/ChangeLog (249998 => 249999)


--- branches/safari-608-branch/Source/WebCore/ChangeLog	2019-09-17 22:29:44 UTC (rev 249998)
+++ branches/safari-608-branch/Source/WebCore/ChangeLog	2019-09-17 22:29:48 UTC (rev 249999)
@@ -1,83 +1,132 @@
 2019-09-17  Kocsen Chung  <[email protected]>
 
-        Cherry-pick r249813. rdar://problem/55427490
+        Cherry-pick r249815. rdar://problem/55427483
 
-    [Cocoa] Text indicator for an image link on the front page of apple.com looks wrong
-    https://bugs.webkit.org/show_bug.cgi?id=201724
-    <rdar://problem/54622894>
+    REGRESSION (iOS 13): Top fixed element on apple.com flickers in size while pinching in
+    https://bugs.webkit.org/show_bug.cgi?id=201668
+    rdar://problem/51934041
     
-    Reviewed by Tim Horton.
+    Reviewed by Frédéric Wang.
     
     Source/WebCore:
     
-    When computing the bounds of the range (<a>, 0) to (<a>, 1) for a text indicator snapshot where <a> is a link
-    with a single non-breaking whitespace character, we currently use the text rect of the single space. This leads
-    to a confusing text indicator, as the resulting snapshot is a tiny blank square in the top left corner of the
-    link. This problem manifests when starting a drag or showing the system context menu on iOS, or force clicking
-    or three-finger tapping to show a preview on macOS.
+    When computing the new layout viewport rect in ScrollingTreeFrameScrollingNode, use
+    "StickToDocumentBounds" mode, not "StickToViewportBounds", because otherwise we'll compute
+    a layout viewport that has negative top/left offsets which causes fixed elements to jump outside
+    the viewport. The only code that should be moving things outside the viewport (a temporary effect
+    that happens when pinching) is the 'isBelowMinimumScale' path in WebPageProxy::computeCustomFixedPositionRect().
     
-    To address this scenario, tweak the heuristic in the case where the text indicator option
-    TextIndicatorOptionUseBoundingRectAndPaintAllContentForComplexRanges is specified, such that we consider a range
-    containing only text with whitespaces to be "complex"; additionally, instead of falling back to the range's
-    bounding rect (which in this case is still tiny), fall back to the common ancestor container's bounding rect,
-    which encompasses not only the text inside the range but also the element containing the range (in this case,
-    the anchor element).
+    With this change ScrollingTreeFrameScrollingNode no longer needs m_behaviorForFixed; it can be removed later.
     
-    Test: fast/text-indicator/text-indicator-empty-link.html
+    Not currently testable, since it involves pinching in past minimum zoom and transients state.
     
-    * page/TextIndicator.cpp:
-    (WebCore::containsOnlyWhiteSpaceText):
+    * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
+    (WebCore::ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition const):
     
-    Add a helper to determine whether a Range is comprised only of rendered text that only contains whitespace
-    characters.
+    Source/WebKit:
     
-    (WebCore::initializeIndicator):
+    The UI process can have transient state that pushes scrolling-tree-managed layers into custom
+    locations while pinch-zooming. We have to apply this state both when the visible rects
+    in the UI process change (existing code in -[WKContentView didUpdateVisibleRect:...]) and when
+    we get new layers from the web process (added in RemoteLayerTreeDrawingAreaProxy::commitLayerTree()
+    in this patch).
     
-    See ChangeLog entry above for more detail.
+    Move some code into WebPageProxy to create functions that we can call from both places.
     
-    LayoutTests:
+    For manual testing, visit a page with fixed banners, pinch in slightly, then pinch out and,
+    while keeping your fingers down, move the contents around.
     
-    Add a new layout test to exercise this scenario.
+    * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
+    (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
+    * UIProcess/WebPageProxy.h:
+    * UIProcess/ios/WKContentView.mm:
+    (-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
+    * UIProcess/ios/WebPageProxyIOS.mm:
+    (WebKit::WebPageProxy::unconstrainedLayoutViewportRect const):
+    (WebKit::WebPageProxy::adjustLayersForLayoutViewport):
     
-    * fast/text-indicator/text-indicator-empty-link-expected.txt: Added.
-    * fast/text-indicator/text-indicator-empty-link.html: Added.
-    
-    
-    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@249813 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@249815 268f45cc-cd09-0410-ab3c-d52691b4dbfc
 
-    2019-09-12  Wenson Hsieh  <[email protected]>
+    2019-09-17  Kocsen Chung  <[email protected]>
 
-            [Cocoa] Text indicator for an image link on the front page of apple.com looks wrong
-            https://bugs.webkit.org/show_bug.cgi?id=201724
-            <rdar://problem/54622894>
+            Cherry-pick r249813. rdar://problem/55427490
 
-            Reviewed by Tim Horton.
+        [Cocoa] Text indicator for an image link on the front page of apple.com looks wrong
+        https://bugs.webkit.org/show_bug.cgi?id=201724
+        <rdar://problem/54622894>
 
-            When computing the bounds of the range (<a>, 0) to (<a>, 1) for a text indicator snapshot where <a> is a link
-            with a single non-breaking whitespace character, we currently use the text rect of the single space. This leads
-            to a confusing text indicator, as the resulting snapshot is a tiny blank square in the top left corner of the
-            link. This problem manifests when starting a drag or showing the system context menu on iOS, or force clicking
-            or three-finger tapping to show a preview on macOS.
+        Reviewed by Tim Horton.
 
-            To address this scenario, tweak the heuristic in the case where the text indicator option
-            TextIndicatorOptionUseBoundingRectAndPaintAllContentForComplexRanges is specified, such that we consider a range
-            containing only text with whitespaces to be "complex"; additionally, instead of falling back to the range's
-            bounding rect (which in this case is still tiny), fall back to the common ancestor container's bounding rect,
-            which encompasses not only the text inside the range but also the element containing the range (in this case,
-            the anchor element).
+        Source/WebCore:
 
-            Test: fast/text-indicator/text-indicator-empty-link.html
+        When computing the bounds of the range (<a>, 0) to (<a>, 1) for a text indicator snapshot where <a> is a link
+        with a single non-breaking whitespace character, we currently use the text rect of the single space. This leads
+        to a confusing text indicator, as the resulting snapshot is a tiny blank square in the top left corner of the
+        link. This problem manifests when starting a drag or showing the system context menu on iOS, or force clicking
+        or three-finger tapping to show a preview on macOS.
 
-            * page/TextIndicator.cpp:
-            (WebCore::containsOnlyWhiteSpaceText):
+        To address this scenario, tweak the heuristic in the case where the text indicator option
+        TextIndicatorOptionUseBoundingRectAndPaintAllContentForComplexRanges is specified, such that we consider a range
+        containing only text with whitespaces to be "complex"; additionally, instead of falling back to the range's
+        bounding rect (which in this case is still tiny), fall back to the common ancestor container's bounding rect,
+        which encompasses not only the text inside the range but also the element containing the range (in this case,
+        the anchor element).
 
-            Add a helper to determine whether a Range is comprised only of rendered text that only contains whitespace
-            characters.
+        Test: fast/text-indicator/text-indicator-empty-link.html
 
-            (WebCore::initializeIndicator):
+        * page/TextIndicator.cpp:
+        (WebCore::containsOnlyWhiteSpaceText):
 
-            See ChangeLog entry above for more detail.
+        Add a helper to determine whether a Range is comprised only of rendered text that only contains whitespace
+        characters.
 
+        (WebCore::initializeIndicator):
+
+        See ChangeLog entry above for more detail.
+
+        LayoutTests:
+
+        Add a new layout test to exercise this scenario.
+
+        * fast/text-indicator/text-indicator-empty-link-expected.txt: Added.
+        * fast/text-indicator/text-indicator-empty-link.html: Added.
+
+
+        git-svn-id: https://svn.webkit.org/repository/webkit/trunk@249813 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+        2019-09-12  Wenson Hsieh  <[email protected]>
+
+                [Cocoa] Text indicator for an image link on the front page of apple.com looks wrong
+                https://bugs.webkit.org/show_bug.cgi?id=201724
+                <rdar://problem/54622894>
+
+                Reviewed by Tim Horton.
+
+                When computing the bounds of the range (<a>, 0) to (<a>, 1) for a text indicator snapshot where <a> is a link
+                with a single non-breaking whitespace character, we currently use the text rect of the single space. This leads
+                to a confusing text indicator, as the resulting snapshot is a tiny blank square in the top left corner of the
+                link. This problem manifests when starting a drag or showing the system context menu on iOS, or force clicking
+                or three-finger tapping to show a preview on macOS.
+
+                To address this scenario, tweak the heuristic in the case where the text indicator option
+                TextIndicatorOptionUseBoundingRectAndPaintAllContentForComplexRanges is specified, such that we consider a range
+                containing only text with whitespaces to be "complex"; additionally, instead of falling back to the range's
+                bounding rect (which in this case is still tiny), fall back to the common ancestor container's bounding rect,
+                which encompasses not only the text inside the range but also the element containing the range (in this case,
+                the anchor element).
+
+                Test: fast/text-indicator/text-indicator-empty-link.html
+
+                * page/TextIndicator.cpp:
+                (WebCore::containsOnlyWhiteSpaceText):
+
+                Add a helper to determine whether a Range is comprised only of rendered text that only contains whitespace
+                characters.
+
+                (WebCore::initializeIndicator):
+
+                See ChangeLog entry above for more detail.
+
 2019-09-17  Kocsen Chung  <[email protected]>
 
         Cherry-pick r249770. rdar://problem/55427487
@@ -408,6 +457,27 @@
 
             Crash under WebCore::firstPositionInNode()
             https://bugs.webkit.org/show_bug.cgi?id=201764
+2019-09-11  Simon Fraser  <[email protected]>
+
+        REGRESSION (iOS 13): Top fixed element on apple.com flickers in size while pinching in
+        https://bugs.webkit.org/show_bug.cgi?id=201668
+        rdar://problem/51934041
+
+        Reviewed by Frédéric Wang.
+
+        When computing the new layout viewport rect in ScrollingTreeFrameScrollingNode, use
+        "StickToDocumentBounds" mode, not "StickToViewportBounds", because otherwise we'll compute
+        a layout viewport that has negative top/left offsets which causes fixed elements to jump outside
+        the viewport. The only code that should be moving things outside the viewport (a temporary effect
+        that happens when pinching) is the 'isBelowMinimumScale' path in WebPageProxy::computeCustomFixedPositionRect().
+
+        With this change ScrollingTreeFrameScrollingNode no longer needs m_behaviorForFixed; it can be removed later.
+
+        Not currently testable, since it involves pinching in past minimum zoom and transients state.
+
+        * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
+        (WebCore::ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition const):
+
             <rdar://problem/54823754>
 
             Reviewed by Wenson Hsieh and Geoff Garen.

Modified: branches/safari-608-branch/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.cpp (249998 => 249999)


--- branches/safari-608-branch/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.cpp	2019-09-17 22:29:44 UTC (rev 249998)
+++ branches/safari-608-branch/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.cpp	2019-09-17 22:29:48 UTC (rev 249999)
@@ -102,12 +102,12 @@
     LayoutRect visualViewport(FrameView::visibleDocumentRect(visibleContentRect, headerHeight(), footerHeight(), totalContentsSize(), scale));
     LayoutRect layoutViewport(m_layoutViewport);
 
-    LOG_WITH_STREAM(Scrolling, stream << "\nScrolling thread: " << "(visibleContentOrigin " << visibleContentOrigin << ", visualViewportSize " << visualViewportSize << ") fixed behavior " << m_behaviorForFixed);
+    LOG_WITH_STREAM(Scrolling, stream << "ScrollingTreeFrameScrollingNode " << scrollingNodeID() << " layoutViewportForScrollPosition: " << "(visibleContentOrigin " << visibleContentOrigin << ", visualViewportSize " << visualViewportSize << ") fixed behavior " << m_behaviorForFixed);
     LOG_WITH_STREAM(Scrolling, stream << "  layoutViewport: " << layoutViewport);
     LOG_WITH_STREAM(Scrolling, stream << "  visualViewport: " << visualViewport);
     LOG_WITH_STREAM(Scrolling, stream << "  scroll positions: min: " << minLayoutViewportOrigin() << " max: "<< maxLayoutViewportOrigin());
 
-    LayoutPoint newLocation = FrameView::computeLayoutViewportOrigin(LayoutRect(visualViewport), LayoutPoint(minLayoutViewportOrigin()), LayoutPoint(maxLayoutViewportOrigin()), layoutViewport, m_behaviorForFixed);
+    LayoutPoint newLocation = FrameView::computeLayoutViewportOrigin(LayoutRect(visualViewport), LayoutPoint(minLayoutViewportOrigin()), LayoutPoint(maxLayoutViewportOrigin()), layoutViewport, StickToDocumentBounds);
 
     if (layoutViewport.location() != newLocation) {
         layoutViewport.setLocation(newLocation);

Modified: branches/safari-608-branch/Source/WebKit/ChangeLog (249998 => 249999)


--- branches/safari-608-branch/Source/WebKit/ChangeLog	2019-09-17 22:29:44 UTC (rev 249998)
+++ branches/safari-608-branch/Source/WebKit/ChangeLog	2019-09-17 22:29:48 UTC (rev 249999)
@@ -1,48 +1,97 @@
 2019-09-17  Kocsen Chung  <[email protected]>
 
-        Cherry-pick r249770. rdar://problem/55427487
+        Cherry-pick r249815. rdar://problem/55427483
 
-    REGRESSION (245006): can't scroll in "read more" view in Eventbrite app
-    https://bugs.webkit.org/show_bug.cgi?id=201683
-    <rdar://problem/54582602>
+    REGRESSION (iOS 13): Top fixed element on apple.com flickers in size while pinching in
+    https://bugs.webkit.org/show_bug.cgi?id=201668
+    rdar://problem/51934041
     
-    Reviewed by Simon Fraser.
+    Reviewed by Frédéric Wang.
     
     Source/WebCore:
     
-    * platform/RuntimeApplicationChecks.h:
-    * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
-    (WebCore::IOSApplication::isEventbrite):
+    When computing the new layout viewport rect in ScrollingTreeFrameScrollingNode, use
+    "StickToDocumentBounds" mode, not "StickToViewportBounds", because otherwise we'll compute
+    a layout viewport that has negative top/left offsets which causes fixed elements to jump outside
+    the viewport. The only code that should be moving things outside the viewport (a temporary effect
+    that happens when pinching) is the 'isBelowMinimumScale' path in WebPageProxy::computeCustomFixedPositionRect().
     
+    With this change ScrollingTreeFrameScrollingNode no longer needs m_behaviorForFixed; it can be removed later.
+    
+    Not currently testable, since it involves pinching in past minimum zoom and transients state.
+    
+    * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
+    (WebCore::ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition const):
+    
     Source/WebKit:
     
-    Content <body> has 'overflow:hidden'.
+    The UI process can have transient state that pushes scrolling-tree-managed layers into custom
+    locations while pinch-zooming. We have to apply this state both when the visible rects
+    in the UI process change (existing code in -[WKContentView didUpdateVisibleRect:...]) and when
+    we get new layers from the web process (added in RemoteLayerTreeDrawingAreaProxy::commitLayerTree()
+    in this patch).
     
-    * UIProcess/Cocoa/VersionChecks.h:
-    * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
-    (WebKit::RemoteScrollingCoordinatorProxy::hasScrollableMainFrame const):
+    Move some code into WebPageProxy to create functions that we can call from both places.
     
-    Fix by adding an app specific LinkedOnOrAfter quirk that always allows main frame scrolling.
+    For manual testing, visit a page with fixed banners, pinch in slightly, then pinch out and,
+    while keeping your fingers down, move the contents around.
     
+    * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
+    (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
+    * UIProcess/WebPageProxy.h:
+    * UIProcess/ios/WKContentView.mm:
+    (-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
+    * UIProcess/ios/WebPageProxyIOS.mm:
+    (WebKit::WebPageProxy::unconstrainedLayoutViewportRect const):
+    (WebKit::WebPageProxy::adjustLayersForLayoutViewport):
     
-    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@249770 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@249815 268f45cc-cd09-0410-ab3c-d52691b4dbfc
 
-    2019-09-11  Antti Koivisto  <[email protected]>
+    2019-09-17  Kocsen Chung  <[email protected]>
 
-            REGRESSION (245006): can't scroll in "read more" view in Eventbrite app
-            https://bugs.webkit.org/show_bug.cgi?id=201683
-            <rdar://problem/54582602>
+            Cherry-pick r249770. rdar://problem/55427487
 
-            Reviewed by Simon Fraser.
+        REGRESSION (245006): can't scroll in "read more" view in Eventbrite app
+        https://bugs.webkit.org/show_bug.cgi?id=201683
+        <rdar://problem/54582602>
 
-            Content <body> has 'overflow:hidden'.
+        Reviewed by Simon Fraser.
 
-            * UIProcess/Cocoa/VersionChecks.h:
-            * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
-            (WebKit::RemoteScrollingCoordinatorProxy::hasScrollableMainFrame const):
+        Source/WebCore:
 
-            Fix by adding an app specific LinkedOnOrAfter quirk that always allows main frame scrolling.
+        * platform/RuntimeApplicationChecks.h:
+        * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
+        (WebCore::IOSApplication::isEventbrite):
 
+        Source/WebKit:
+
+        Content <body> has 'overflow:hidden'.
+
+        * UIProcess/Cocoa/VersionChecks.h:
+        * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
+        (WebKit::RemoteScrollingCoordinatorProxy::hasScrollableMainFrame const):
+
+        Fix by adding an app specific LinkedOnOrAfter quirk that always allows main frame scrolling.
+
+
+        git-svn-id: https://svn.webkit.org/repository/webkit/trunk@249770 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+        2019-09-11  Antti Koivisto  <[email protected]>
+
+                REGRESSION (245006): can't scroll in "read more" view in Eventbrite app
+                https://bugs.webkit.org/show_bug.cgi?id=201683
+                <rdar://problem/54582602>
+
+                Reviewed by Simon Fraser.
+
+                Content <body> has 'overflow:hidden'.
+
+                * UIProcess/Cocoa/VersionChecks.h:
+                * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
+                (WebKit::RemoteScrollingCoordinatorProxy::hasScrollableMainFrame const):
+
+                Fix by adding an app specific LinkedOnOrAfter quirk that always allows main frame scrolling.
+
 2019-09-17  Kocsen Chung  <[email protected]>
 
         Cherry-pick r249757. rdar://problem/55427273
@@ -257,7 +306,35 @@
     
     
     git-svn-id: https://svn.webkit.org/repository/webkit/trunk@249703 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+2019-09-11  Simon Fraser  <[email protected]>
 
+        REGRESSION (iOS 13): Top fixed element on apple.com flickers in size while pinching in
+        https://bugs.webkit.org/show_bug.cgi?id=201668
+        rdar://problem/51934041
+
+        Reviewed by Frédéric Wang.
+
+        The UI process can have transient state that pushes scrolling-tree-managed layers into custom
+        locations while pinch-zooming. We have to apply this state both when the visible rects
+        in the UI process change (existing code in -[WKContentView didUpdateVisibleRect:...]) and when
+        we get new layers from the web process (added in RemoteLayerTreeDrawingAreaProxy::commitLayerTree()
+        in this patch).
+
+        Move some code into WebPageProxy to create functions that we can call from both places.
+
+        For manual testing, visit a page with fixed banners, pinch in slightly, then pinch out and,
+        while keeping your fingers down, move the contents around.
+
+        * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
+        (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/ios/WKContentView.mm:
+        (-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
+        * UIProcess/ios/WebPageProxyIOS.mm:
+        (WebKit::WebPageProxy::unconstrainedLayoutViewportRect const):
+        (WebKit::WebPageProxy::adjustLayersForLayoutViewport):
+
+
     2019-09-09  Chris Dumez  <[email protected]>
 
             [iOS] We sometimes attempt to use a terminated prewarmed WebContent process

Modified: branches/safari-608-branch/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm (249998 => 249999)


--- branches/safari-608-branch/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm	2019-09-17 22:29:44 UTC (rev 249998)
+++ branches/safari-608-branch/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm	2019-09-17 22:29:48 UTC (rev 249999)
@@ -218,6 +218,9 @@
 
 #if ENABLE(ASYNC_SCROLLING)
     m_webPageProxy.scrollingCoordinatorProxy()->applyScrollingTreeLayerPositionsAfterCommit();
+#if PLATFORM(IOS_FAMILY)
+    m_webPageProxy.adjustLayersForLayoutViewport(m_webPageProxy.unconstrainedLayoutViewportRect());
+#endif
 
     // Handle requested scroll position updates from the scrolling tree transaction after didCommitLayerTree()
     // has updated the view size based on the content size.

Modified: branches/safari-608-branch/Source/WebKit/UIProcess/WebPageProxy.h (249998 => 249999)


--- branches/safari-608-branch/Source/WebKit/UIProcess/WebPageProxy.h	2019-09-17 22:29:44 UTC (rev 249998)
+++ branches/safari-608-branch/Source/WebKit/UIProcess/WebPageProxy.h	2019-09-17 22:29:48 UTC (rev 249999)
@@ -652,6 +652,9 @@
 
     WebCore::FloatRect computeCustomFixedPositionRect(const WebCore::FloatRect& unobscuredContentRect, const WebCore::FloatRect& unobscuredContentRectRespectingInputViewBounds, const WebCore::FloatRect& currentCustomFixedPositionRect, double displayedContentScale, WebCore::FrameView::LayoutViewportConstraint = WebCore::FrameView::LayoutViewportConstraint::Unconstrained) const;
 
+    WebCore::FloatRect unconstrainedLayoutViewportRect() const;
+    void adjustLayersForLayoutViewport(const WebCore::FloatRect& layoutViewport);
+
     void scrollingNodeScrollViewWillStartPanGesture();
     void scrollingNodeScrollViewDidScroll();
     void scrollingNodeScrollWillStartScroll();

Modified: branches/safari-608-branch/Source/WebKit/UIProcess/ios/WKContentView.mm (249998 => 249999)


--- branches/safari-608-branch/Source/WebKit/UIProcess/ios/WKContentView.mm	2019-09-17 22:29:44 UTC (rev 249998)
+++ branches/safari-608-branch/Source/WebKit/UIProcess/ios/WKContentView.mm	2019-09-17 22:29:48 UTC (rev 249999)
@@ -36,7 +36,6 @@
 #import "PageClientImplIOS.h"
 #import "PrintInfo.h"
 #import "RemoteLayerTreeDrawingAreaProxy.h"
-#import "RemoteScrollingCoordinatorProxy.h"
 #import "SmartMagnificationController.h"
 #import "UIKitSPI.h"
 #import "VersionChecks.h"
@@ -407,8 +406,6 @@
         velocityData = { 0, 0, 0, timestamp };
     }
 
-    WebKit::RemoteScrollingCoordinatorProxy* scrollingCoordinator = _page->scrollingCoordinatorProxy();
-
     CGRect unobscuredContentRectRespectingInputViewBounds = [self _computeUnobscuredContentRectRespectingInputViewBounds:unobscuredContentRect inputViewBounds:inputViewBounds];
     WebCore::FloatRect fixedPositionRectForLayout = _page->computeCustomFixedPositionRect(unobscuredContentRect, unobscuredContentRectRespectingInputViewBounds, _page->customFixedPositionRect(), zoomScale, WebCore::FrameView::LayoutViewportConstraint::ConstrainedToDocumentRect);
 
@@ -433,13 +430,14 @@
     LOG_WITH_STREAM(VisibleRects, stream << "-[WKContentView didUpdateVisibleRect]" << visibleContentRectUpdateInfo.dump());
 
     bool wasStableState = _page->inStableState();
+
     _page->updateVisibleContentRects(visibleContentRectUpdateInfo);
 
+    auto layoutViewport = _page->unconstrainedLayoutViewportRect();
+    _page->adjustLayersForLayoutViewport(layoutViewport);
+
     _sizeChangedSinceLastVisibleContentRectUpdate = NO;
 
-    WebCore::FloatRect layoutViewport = _page->computeCustomFixedPositionRect(_page->unobscuredContentRect(), _page->unobscuredContentRectRespectingInputViewBounds(), _page->customFixedPositionRect(), zoomScale, WebCore::FrameView::LayoutViewportConstraint::Unconstrained);
-    scrollingCoordinator->viewportChangedViaDelegatedScrolling(_page->unobscuredContentRect().location(), layoutViewport, zoomScale);
-
     drawingArea->updateDebugIndicator();
     
     [self updateFixedClippingView:layoutViewport];

Modified: branches/safari-608-branch/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm (249998 => 249999)


--- branches/safari-608-branch/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm	2019-09-17 22:29:44 UTC (rev 249998)
+++ branches/safari-608-branch/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm	2019-09-17 22:29:48 UTC (rev 249999)
@@ -47,6 +47,7 @@
 #import "RemoteLayerTreeDrawingAreaProxy.h"
 #import "RemoteLayerTreeDrawingAreaProxyMessages.h"
 #import "RemoteLayerTreeTransaction.h"
+#import "RemoteScrollingCoordinatorProxy.h"
 #import "UIKitSPI.h"
 #import "UserData.h"
 #import "VideoFullscreenManagerProxy.h"
@@ -274,6 +275,19 @@
     return layoutViewportRect;
 }
 
+FloatRect WebPageProxy::unconstrainedLayoutViewportRect() const
+{
+    return computeCustomFixedPositionRect(unobscuredContentRect(), unobscuredContentRectRespectingInputViewBounds(), customFixedPositionRect(), displayedContentScale(), FrameView::LayoutViewportConstraint::Unconstrained);
+}
+
+void WebPageProxy::adjustLayersForLayoutViewport(const FloatRect& layoutViewport)
+{
+    if (!m_scrollingCoordinatorProxy)
+        return;
+
+    m_scrollingCoordinatorProxy->viewportChangedViaDelegatedScrolling(unobscuredContentRect().location(), layoutViewport, displayedContentScale());
+}
+
 void WebPageProxy::scrollingNodeScrollViewWillStartPanGesture()
 {
     pageClient().scrollingNodeScrollViewWillStartPanGesture();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to