Title: [245560] branches/safari-608.1.24.40-branch
Revision
245560
Author
[email protected]
Date
2019-05-20 20:40:12 -0700 (Mon, 20 May 2019)

Log Message

Cherry-pick r245465. rdar://problem/50252398

    [iOS] Respect scrolling="no" on composited frames
    https://bugs.webkit.org/show_bug.cgi?id=197972
    <rdar://problem/50252398>

    Reviewed by Simon Fraser.

    Source/WebKit:

    * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
    * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
    (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren):

    Disallow scrolling based on canHaveScrollbars, similar to main frame.

    (WebKit::ScrollingTreeScrollingNodeDelegateIOS::repositionScrollingLayers):
    (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollView const):

    Factor into a function.

    LayoutTests:

    * fast/scrolling/ios/body-overflow-hidden-frame-expected.html:
    * fast/scrolling/ios/body-overflow-hidden-frame.html:

    Also fix overflow:hidden test so that the frame content forces composition.

    * fast/scrolling/ios/frame-scrolling-no-expected.html: Added.
    * fast/scrolling/ios/frame-scrolling-no.html: Added.

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

Modified Paths

Added Paths

Diff

Modified: branches/safari-608.1.24.40-branch/LayoutTests/ChangeLog (245559 => 245560)


--- branches/safari-608.1.24.40-branch/LayoutTests/ChangeLog	2019-05-21 03:21:39 UTC (rev 245559)
+++ branches/safari-608.1.24.40-branch/LayoutTests/ChangeLog	2019-05-21 03:40:12 UTC (rev 245560)
@@ -1,3 +1,55 @@
+2019-05-20  Kocsen Chung  <[email protected]>
+
+        Cherry-pick r245465. rdar://problem/50252398
+
+    [iOS] Respect scrolling="no" on composited frames
+    https://bugs.webkit.org/show_bug.cgi?id=197972
+    <rdar://problem/50252398>
+    
+    Reviewed by Simon Fraser.
+    
+    Source/WebKit:
+    
+    * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
+    * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
+    (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren):
+    
+    Disallow scrolling based on canHaveScrollbars, similar to main frame.
+    
+    (WebKit::ScrollingTreeScrollingNodeDelegateIOS::repositionScrollingLayers):
+    (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollView const):
+    
+    Factor into a function.
+    
+    LayoutTests:
+    
+    * fast/scrolling/ios/body-overflow-hidden-frame-expected.html:
+    * fast/scrolling/ios/body-overflow-hidden-frame.html:
+    
+    Also fix overflow:hidden test so that the frame content forces composition.
+    
+    * fast/scrolling/ios/frame-scrolling-no-expected.html: Added.
+    * fast/scrolling/ios/frame-scrolling-no.html: Added.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245465 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-05-17  Antti Koivisto  <[email protected]>
+
+            [iOS] Respect scrolling="no" on composited frames
+            https://bugs.webkit.org/show_bug.cgi?id=197972
+            <rdar://problem/50252398>
+
+            Reviewed by Simon Fraser.
+
+            * fast/scrolling/ios/body-overflow-hidden-frame-expected.html:
+            * fast/scrolling/ios/body-overflow-hidden-frame.html:
+
+            Also fix overflow:hidden test so that the frame content forces composition.
+
+            * fast/scrolling/ios/frame-scrolling-no-expected.html: Added.
+            * fast/scrolling/ios/frame-scrolling-no.html: Added.
+
 2019-05-16  Kocsen Chung  <[email protected]>
 
         Revert r245170. rdar://problem/50445998

Modified: branches/safari-608.1.24.40-branch/LayoutTests/fast/scrolling/ios/body-overflow-hidden-frame-expected.html (245559 => 245560)


--- branches/safari-608.1.24.40-branch/LayoutTests/fast/scrolling/ios/body-overflow-hidden-frame-expected.html	2019-05-21 03:21:39 UTC (rev 245559)
+++ branches/safari-608.1.24.40-branch/LayoutTests/fast/scrolling/ios/body-overflow-hidden-frame-expected.html	2019-05-21 03:40:12 UTC (rev 245560)
@@ -11,7 +11,7 @@
     <html>
     <style>
     body { overflow: hidden }
-    .scroll-content { width: 500px; height: 5000px; border: 2px solid green; }
+    .scroll-content { width: 500px; height: 5000px; border: 2px solid green; transform:translateZ(0) }
     </style>
     <body>
     <div class='scroll-content'>

Modified: branches/safari-608.1.24.40-branch/LayoutTests/fast/scrolling/ios/body-overflow-hidden-frame.html (245559 => 245560)


--- branches/safari-608.1.24.40-branch/LayoutTests/fast/scrolling/ios/body-overflow-hidden-frame.html	2019-05-21 03:21:39 UTC (rev 245559)
+++ branches/safari-608.1.24.40-branch/LayoutTests/fast/scrolling/ios/body-overflow-hidden-frame.html	2019-05-21 03:40:12 UTC (rev 245560)
@@ -32,7 +32,7 @@
     <html>
     <style>
     body { overflow: hidden }
-    .scroll-content { width: 500px; height: 5000px; border: 2px solid green; }
+    .scroll-content { width: 500px; height: 5000px; border: 2px solid green; transform:translateZ(0) }
     </style>
     <body>
     <div class='scroll-content'>

Copied: branches/safari-608.1.24.40-branch/LayoutTests/fast/scrolling/ios/frame-scrolling-no-expected.html (from rev 245532, branches/safari-608.1.24.40-branch/LayoutTests/fast/scrolling/ios/body-overflow-hidden-frame-expected.html) (0 => 245560)


--- branches/safari-608.1.24.40-branch/LayoutTests/fast/scrolling/ios/frame-scrolling-no-expected.html	                        (rev 0)
+++ branches/safari-608.1.24.40-branch/LayoutTests/fast/scrolling/ios/frame-scrolling-no-expected.html	2019-05-21 03:40:12 UTC (rev 245560)
@@ -0,0 +1,24 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ internal:AsyncOverflowScrollingEnabled=true internal:AsyncFrameScrollingEnabled=true ] -->
+<html>
+<head>
+<meta name="viewport" content="width=device-width, initial-scale=1">
+<style>
+body { overflow: hidden }
+.scroll-content { width: 500px; height: 5000px; border: 2px solid green; }
+</style>
+<body>
+<iframe scrolling="no" srcdoc="
+    <html>
+    <style>
+    .scroll-content { width: 500px; height: 5000px; border: 2px solid green; transform:translateZ(0) }
+    </style>
+    <body>
+    <div class='scroll-content'>
+    This document shouldn't be scrollable.
+    </div>
+    </body>
+    </html>
+" width=500 height=500>
+</iframe>
+</body>
+</html>

Copied: branches/safari-608.1.24.40-branch/LayoutTests/fast/scrolling/ios/frame-scrolling-no.html (from rev 245532, branches/safari-608.1.24.40-branch/LayoutTests/fast/scrolling/ios/body-overflow-hidden-frame.html) (0 => 245560)


--- branches/safari-608.1.24.40-branch/LayoutTests/fast/scrolling/ios/frame-scrolling-no.html	                        (rev 0)
+++ branches/safari-608.1.24.40-branch/LayoutTests/fast/scrolling/ios/frame-scrolling-no.html	2019-05-21 03:40:12 UTC (rev 245560)
@@ -0,0 +1,45 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ internal:AsyncOverflowScrollingEnabled=true internal:AsyncFrameScrollingEnabled=true ] -->
+<html>
+<head>
+<meta name="viewport" content="width=device-width, initial-scale=1">
+<script src=""
+<style>
+body { overflow: hidden }
+.scroll-content { width: 500px; height: 5000px; border: 2px solid green; }
+</style>
+<script>
+if (window.testRunner)
+    testRunner.waitUntilDone();
+
+function waitPromise(delay)
+{
+    return new Promise(resolve => setTimeout(resolve, delay));
+}
+
+async function runTest() {
+    if (!window.testRunner)
+        return;
+
+    await touchAndDragFromPointToPoint(150, 300, 150, 150);
+    await liftUpAtPoint(150, 150);
+    await waitPromise(50);
+
+    testRunner.notifyDone();
+}
+</script>
+<body _onload_="runTest()">
+<iframe scrolling="no" srcdoc="
+    <html>
+    <style>
+    .scroll-content { width: 500px; height: 5000px; border: 2px solid green; transform:translateZ(0) }
+    </style>
+    <body>
+    <div class='scroll-content'>
+    This document shouldn't be scrollable.
+    </div>
+    </body>
+    </html>
+" width=500 height=500>
+</iframe>
+</body>
+</html>

Modified: branches/safari-608.1.24.40-branch/Source/WebKit/ChangeLog (245559 => 245560)


--- branches/safari-608.1.24.40-branch/Source/WebKit/ChangeLog	2019-05-21 03:21:39 UTC (rev 245559)
+++ branches/safari-608.1.24.40-branch/Source/WebKit/ChangeLog	2019-05-21 03:40:12 UTC (rev 245560)
@@ -1,3 +1,58 @@
+2019-05-20  Kocsen Chung  <[email protected]>
+
+        Cherry-pick r245465. rdar://problem/50252398
+
+    [iOS] Respect scrolling="no" on composited frames
+    https://bugs.webkit.org/show_bug.cgi?id=197972
+    <rdar://problem/50252398>
+    
+    Reviewed by Simon Fraser.
+    
+    Source/WebKit:
+    
+    * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
+    * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
+    (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren):
+    
+    Disallow scrolling based on canHaveScrollbars, similar to main frame.
+    
+    (WebKit::ScrollingTreeScrollingNodeDelegateIOS::repositionScrollingLayers):
+    (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollView const):
+    
+    Factor into a function.
+    
+    LayoutTests:
+    
+    * fast/scrolling/ios/body-overflow-hidden-frame-expected.html:
+    * fast/scrolling/ios/body-overflow-hidden-frame.html:
+    
+    Also fix overflow:hidden test so that the frame content forces composition.
+    
+    * fast/scrolling/ios/frame-scrolling-no-expected.html: Added.
+    * fast/scrolling/ios/frame-scrolling-no.html: Added.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245465 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-05-17  Antti Koivisto  <[email protected]>
+
+            [iOS] Respect scrolling="no" on composited frames
+            https://bugs.webkit.org/show_bug.cgi?id=197972
+            <rdar://problem/50252398>
+
+            Reviewed by Simon Fraser.
+
+            * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
+            * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
+            (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren):
+
+            Disallow scrolling based on canHaveScrollbars, similar to main frame.
+
+            (WebKit::ScrollingTreeScrollingNodeDelegateIOS::repositionScrollingLayers):
+            (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollView const):
+
+            Factor into a function.
+
 2019-05-15  Kocsen Chung  <[email protected]>
 
         Cherry-pick r245360. rdar://problem/50823976

Modified: branches/safari-608.1.24.40-branch/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h (245559 => 245560)


--- branches/safari-608.1.24.40-branch/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h	2019-05-21 03:21:39 UTC (rev 245559)
+++ branches/safari-608.1.24.40-branch/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h	2019-05-21 03:40:12 UTC (rev 245560)
@@ -33,6 +33,7 @@
 #include <WebCore/ScrollingTreeScrollingNodeDelegate.h>
 
 OBJC_CLASS CALayer;
+OBJC_CLASS UIScrollView;
 OBJC_CLASS WKScrollingNodeScrollViewDelegate;
 
 namespace WebCore {
@@ -71,6 +72,8 @@
 #endif
 
 private:
+    UIScrollView *scrollView() const;
+
     RetainPtr<CALayer> m_scrollLayer;
     RetainPtr<CALayer> m_scrolledContentsLayer;
     RetainPtr<WKScrollingNodeScrollViewDelegate> m_scrollViewDelegate;

Modified: branches/safari-608.1.24.40-branch/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm (245559 => 245560)


--- branches/safari-608.1.24.40-branch/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm	2019-05-21 03:21:39 UTC (rev 245559)
+++ branches/safari-608.1.24.40-branch/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm	2019-05-21 03:40:12 UTC (rev 245560)
@@ -230,9 +230,7 @@
         || scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrollPosition)
         || scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrollOrigin)) {
         BEGIN_BLOCK_OBJC_EXCEPTIONS
-        UIScrollView *scrollView = (UIScrollView *)[scrollLayer() delegate];
-        ASSERT([scrollView isKindOfClass:[UIScrollView self]]);
-
+        UIScrollView *scrollView = this->scrollView();
         if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrollContainerLayer)) {
             if (!m_scrollViewDelegate)
                 m_scrollViewDelegate = adoptNS([[WKScrollingNodeScrollViewDelegate alloc] initWithScrollingTreeNodeDelegate:this]);
@@ -268,21 +266,18 @@
     // FIXME: If only one axis snaps in 2D scrolling, the other axis will decelerate fast as well. Is this what we want?
     if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::HorizontalSnapOffsets) || scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::VerticalSnapOffsets)) {
         BEGIN_BLOCK_OBJC_EXCEPTIONS
-        UIScrollView *scrollView = (UIScrollView *)[scrollLayer() delegate];
-        ASSERT([scrollView isKindOfClass:[UIScrollView self]]);
-
-        scrollView.decelerationRate = scrollingNode().horizontalSnapOffsets().size() || scrollingNode().verticalSnapOffsets().size() ? UIScrollViewDecelerationRateFast : UIScrollViewDecelerationRateNormal;
-#endif
+        scrollView().decelerationRate = scrollingNode().horizontalSnapOffsets().size() || scrollingNode().verticalSnapOffsets().size() ? UIScrollViewDecelerationRateFast : UIScrollViewDecelerationRateNormal;
         END_BLOCK_OBJC_EXCEPTIONS
     }
+#endif
 
     if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrollableAreaParams)) {
         BEGIN_BLOCK_OBJC_EXCEPTIONS
-        UIScrollView *scrollView = (UIScrollView *)[scrollLayer() delegate];
-        ASSERT([scrollView isKindOfClass:[UIScrollView self]]);
+        UIScrollView *scrollView = this->scrollView();
 
         [scrollView setShowsHorizontalScrollIndicator:!scrollingNode().horizontalScrollbarHiddenByStyle()];
         [scrollView setShowsVerticalScrollIndicator:!scrollingNode().verticalScrollbarHiddenByStyle()];
+        [scrollView setScrollEnabled:scrollingNode().canHaveScrollbars()];
 
         END_BLOCK_OBJC_EXCEPTIONS
     }
@@ -298,9 +293,7 @@
     auto scrollPosition = scrollingNode().currentScrollPosition();
 
     BEGIN_BLOCK_OBJC_EXCEPTIONS
-    UIScrollView *scrollView = (UIScrollView *)[scrollLayer() delegate];
-    ASSERT([scrollView isKindOfClass:[UIScrollView self]]);
-    [scrollView setContentOffset:scrollPosition];
+    [scrollView() setContentOffset:scrollPosition];
     END_BLOCK_OBJC_EXCEPTIONS
 }
 
@@ -335,6 +328,13 @@
     scrollingTree().currentSnapPointIndicesDidChange(scrollingNode().scrollingNodeID(), horizontal, vertical);
 }
 
+UIScrollView *ScrollingTreeScrollingNodeDelegateIOS::scrollView() const
+{
+    UIScrollView *scrollView = (UIScrollView *)[scrollLayer() delegate];
+    ASSERT([scrollView isKindOfClass:[UIScrollView self]]);
+    return scrollView;
+}
+
 #if ENABLE(POINTER_EVENTS)
 OptionSet<TouchAction> ScrollingTreeScrollingNodeDelegateIOS::activeTouchActionsForGestureRecognizer(UIGestureRecognizer* gestureRecognizer) const
 {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to