Title: [245568] trunk
Revision
245568
Author
an...@apple.com
Date
2019-05-21 08:53:40 -0700 (Tue, 21 May 2019)

Log Message

RTL/overflow scroll tests fail with async overflow enabled
https://bugs.webkit.org/show_bug.cgi?id=196013
<rdar://problem/49066649>

Reviewed by Simon Fraser.

Source/WebCore:

Test: compositing/ios/rtl-overflow-scrolling-2.html

This patch makes the basic RTL cases work in the scrolling tree.

* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::minimumScrollPosition const):
(WebCore::ScrollingTreeScrollingNode::maximumScrollPosition const):

Add missing scroll offset <-> scroll position conversions.

Source/WebKit:

Add missing scroll offset <-> scroll position conversions.

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

LayoutTests:

* compositing/ios/rtl-overflow-scrolling-2-expected.html: Added.
* compositing/ios/rtl-overflow-scrolling-2.html: Added.

Add a reftest version for better coverage.

* compositing/rtl/rtl-overflow-scrolling.html:
* platform/ios-wk1/TestExpectations:
* platform/ios-wk2/TestExpectations:
* platform/ios-wk2/compositing/rtl/rtl-overflow-scrolling-expected.txt: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (245567 => 245568)


--- trunk/LayoutTests/ChangeLog	2019-05-21 13:10:52 UTC (rev 245567)
+++ trunk/LayoutTests/ChangeLog	2019-05-21 15:53:40 UTC (rev 245568)
@@ -1,3 +1,21 @@
+2019-05-21  Antti Koivisto  <an...@apple.com>
+
+        RTL/overflow scroll tests fail with async overflow enabled
+        https://bugs.webkit.org/show_bug.cgi?id=196013
+        <rdar://problem/49066649>
+
+        Reviewed by Simon Fraser.
+
+        * compositing/ios/rtl-overflow-scrolling-2-expected.html: Added.
+        * compositing/ios/rtl-overflow-scrolling-2.html: Added.
+
+        Add a reftest version for better coverage.
+
+        * compositing/rtl/rtl-overflow-scrolling.html:
+        * platform/ios-wk1/TestExpectations:
+        * platform/ios-wk2/TestExpectations:
+        * platform/ios-wk2/compositing/rtl/rtl-overflow-scrolling-expected.txt: Added.
+
 2019-05-21  Carlos Garcia Campos  <cgar...@igalia.com>
 
         [WPE] Add initial accessibility support using ATK

Added: trunk/LayoutTests/compositing/ios/rtl-overflow-scrolling-2-expected.html (0 => 245568)


--- trunk/LayoutTests/compositing/ios/rtl-overflow-scrolling-2-expected.html	                        (rev 0)
+++ trunk/LayoutTests/compositing/ios/rtl-overflow-scrolling-2-expected.html	2019-05-21 15:53:40 UTC (rev 245568)
@@ -0,0 +1,9 @@
+<style>
+#container {
+    width: 300px;
+    height: 300px;
+    background-color: green;
+}
+</style>
+<div id="container">
+</div>

Copied: trunk/LayoutTests/compositing/ios/rtl-overflow-scrolling-2.html (from rev 245567, trunk/LayoutTests/compositing/rtl/rtl-overflow-scrolling.html) (0 => 245568)


--- trunk/LayoutTests/compositing/ios/rtl-overflow-scrolling-2.html	                        (rev 0)
+++ trunk/LayoutTests/compositing/ios/rtl-overflow-scrolling-2.html	2019-05-21 15:53:40 UTC (rev 245568)
@@ -0,0 +1,38 @@
+<!-- webkit-test-runner [ internal:AsyncOverflowScrollingEnabled=true ] -->
+<html>
+<head>
+<script type="text/_javascript_">
+    function runTest() {
+        document.getElementById("container").scrollLeft = -500;
+    }
+</script>
+<style>
+#container {
+    direction: rtl;
+    overflow: scroll;
+    width: 300px;
+    height: 300px;
+}
+#overflow {
+    width: 1000px;
+    height: 1000px;
+    background-color: red;
+}
+#inner {
+    margin-left: 200px;
+    margin-right: 500px;
+    width: 300px;
+    height: 1000px;
+    background-color: green;
+}
+</style>
+</head>
+<body _onload_="runTest();">
+<div id="container">
+<div id="overflow">
+<div id="inner">
+</div>
+</div>
+</div>
+</body>
+</html>

Modified: trunk/LayoutTests/compositing/rtl/rtl-overflow-scrolling.html (245567 => 245568)


--- trunk/LayoutTests/compositing/rtl/rtl-overflow-scrolling.html	2019-05-21 13:10:52 UTC (rev 245567)
+++ trunk/LayoutTests/compositing/rtl/rtl-overflow-scrolling.html	2019-05-21 15:53:40 UTC (rev 245568)
@@ -1,4 +1,4 @@
-<!-- webkit-test-runner [ useThreadedScrolling=false ] -->
+<!-- webkit-test-runner [ useThreadedScrolling=false internal:AsyncOverflowScrollingEnabled=true ] -->
 <html>
 <head>
 <script type="text/_javascript_">

Modified: trunk/LayoutTests/platform/ios-wk1/TestExpectations (245567 => 245568)


--- trunk/LayoutTests/platform/ios-wk1/TestExpectations	2019-05-21 13:10:52 UTC (rev 245567)
+++ trunk/LayoutTests/platform/ios-wk1/TestExpectations	2019-05-21 15:53:40 UTC (rev 245568)
@@ -629,6 +629,7 @@
 compositing/overlap-blending/reflection-opacity-huge.html [ ImageOnlyFailure ]
 compositing/text-on-scaled-layer.html [ ImageOnlyFailure ]
 compositing/text-on-scaled-surface.html [ ImageOnlyFailure ]
+compositing/ios/rtl-overflow-scrolling-2.html [ ImageOnlyFailure ]
 
 # Compositing tests that are flaky:
 compositing/cliprect-and-position-change-on-compositing-layer.html [ ImageOnlyFailure Pass ]

Modified: trunk/LayoutTests/platform/ios-wk2/TestExpectations (245567 => 245568)


--- trunk/LayoutTests/platform/ios-wk2/TestExpectations	2019-05-21 13:10:52 UTC (rev 245567)
+++ trunk/LayoutTests/platform/ios-wk2/TestExpectations	2019-05-21 15:53:40 UTC (rev 245568)
@@ -1312,7 +1312,6 @@
 webkit.org/b/195341 fast/viewport/ios/device-width-viewport-after-changing-view-scale.html [ Pass Failure ]
 webkit.org/b/195341 compositing/ios/overflow-scroll-update-overlap.html [ ImageOnlyFailure ]
 
-webkit.org/b/196013 compositing/rtl/rtl-overflow-scrolling.html [ Failure ]
 webkit.org/b/196013 fast/scrolling/rtl-scrollbars-sticky-overflow-scroll-2.html [ ImageOnlyFailure ]
 webkit.org/b/196013 fast/scrolling/rtl-scrollbars-sticky-overflow-scroll.html [ ImageOnlyFailure ]
 webkit.org/b/196013 fast/scrolling/rubber-band-shows-background.html [ ImageOnlyFailure ]

Added: trunk/LayoutTests/platform/ios-wk2/compositing/rtl/rtl-overflow-scrolling-expected.txt (0 => 245568)


--- trunk/LayoutTests/platform/ios-wk2/compositing/rtl/rtl-overflow-scrolling-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/ios-wk2/compositing/rtl/rtl-overflow-scrolling-expected.txt	2019-05-21 15:53:40 UTC (rev 245568)
@@ -0,0 +1,8 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+layer at (8,8) size 300x300 scrollX -15 scrollWidth 1000 scrollHeight 1000
+  RenderBlock {DIV} at (0,0) size 300x300
+    RenderBlock {DIV} at (-700,0) size 1000x1000 [bgcolor=#008000]

Modified: trunk/Source/WebCore/ChangeLog (245567 => 245568)


--- trunk/Source/WebCore/ChangeLog	2019-05-21 13:10:52 UTC (rev 245567)
+++ trunk/Source/WebCore/ChangeLog	2019-05-21 15:53:40 UTC (rev 245568)
@@ -1,3 +1,23 @@
+2019-05-21  Antti Koivisto  <an...@apple.com>
+
+        RTL/overflow scroll tests fail with async overflow enabled
+        https://bugs.webkit.org/show_bug.cgi?id=196013
+        <rdar://problem/49066649>
+
+        Reviewed by Simon Fraser.
+
+        Test: compositing/ios/rtl-overflow-scrolling-2.html
+
+        This patch makes the basic RTL cases work in the scrolling tree.
+
+        * page/scrolling/AsyncScrollingCoordinator.cpp:
+        (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
+        * page/scrolling/ScrollingTreeScrollingNode.cpp:
+        (WebCore::ScrollingTreeScrollingNode::minimumScrollPosition const):
+        (WebCore::ScrollingTreeScrollingNode::maximumScrollPosition const):
+
+        Add missing scroll offset <-> scroll position conversions.
+
 2019-05-21  Carlos Garcia Campos  <cgar...@igalia.com>
 
         [WPE] Add initial accessibility support using ATK

Modified: trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp (245567 => 245568)


--- trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp	2019-05-21 13:10:52 UTC (rev 245567)
+++ trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp	2019-05-21 15:53:40 UTC (rev 245568)
@@ -335,7 +335,7 @@
     if (auto* scrollableArea = frameView.scrollableAreaForScrollLayerID(scrollingNodeID)) {
         auto previousScrollType = scrollableArea->currentScrollType();
         scrollableArea->setCurrentScrollType(scrollType);
-        scrollableArea->scrollToOffsetWithoutAnimation(scrollPosition);
+        scrollableArea->scrollToOffsetWithoutAnimation(ScrollableArea::scrollOffsetFromPosition(scrollPosition, toFloatSize(scrollableArea->scrollOrigin())));
         scrollableArea->setCurrentScrollType(previousScrollType);
 
         if (scrollingLayerPositionAction == ScrollingLayerPositionAction::Set)

Modified: trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp (245567 => 245568)


--- trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp	2019-05-21 13:10:52 UTC (rev 245567)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp	2019-05-21 15:53:40 UTC (rev 245568)
@@ -125,13 +125,15 @@
 
 FloatPoint ScrollingTreeScrollingNode::minimumScrollPosition() const
 {
-    return { };
+    auto minimumScrollOffset = FloatPoint { };
+    return ScrollableArea::scrollPositionFromOffset(minimumScrollOffset, toFloatSize(scrollOrigin()));
 }
 
 FloatPoint ScrollingTreeScrollingNode::maximumScrollPosition() const
 {
     FloatPoint contentSizePoint(totalContentsSize());
-    return FloatPoint(contentSizePoint - scrollableAreaSize()).expandedTo(FloatPoint());
+    auto maximumScrollOffset = FloatPoint(contentSizePoint - scrollableAreaSize()).expandedTo(FloatPoint());
+    return ScrollableArea::scrollPositionFromOffset(maximumScrollOffset, toFloatSize(scrollOrigin()));
 }
 
 bool ScrollingTreeScrollingNode::scrollLimitReached(const PlatformWheelEvent& wheelEvent) const

Modified: trunk/Source/WebKit/ChangeLog (245567 => 245568)


--- trunk/Source/WebKit/ChangeLog	2019-05-21 13:10:52 UTC (rev 245567)
+++ trunk/Source/WebKit/ChangeLog	2019-05-21 15:53:40 UTC (rev 245568)
@@ -1,3 +1,18 @@
+2019-05-21  Antti Koivisto  <an...@apple.com>
+
+        RTL/overflow scroll tests fail with async overflow enabled
+        https://bugs.webkit.org/show_bug.cgi?id=196013
+        <rdar://problem/49066649>
+
+        Reviewed by Simon Fraser.
+
+        Add missing scroll offset <-> scroll position conversions.
+
+        * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
+        * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
+        (WebKit::ScrollingTreeScrollingNodeDelegateIOS::repositionScrollingLayers):
+        (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollViewDidScroll):
+
 2019-05-21  Carlos Garcia Campos  <cgar...@igalia.com>
 
         [WPE] Add initial accessibility support using ATK

Modified: trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h (245567 => 245568)


--- trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h	2019-05-21 13:10:52 UTC (rev 245567)
+++ trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h	2019-05-21 15:53:40 UTC (rev 245568)
@@ -55,7 +55,7 @@
     void scrollWillStart() const;
     void scrollDidEnd() const;
     void scrollViewWillStartPanGesture() const;
-    void scrollViewDidScroll(const WebCore::FloatPoint& scrollPosition, bool inUserInteraction);
+    void scrollViewDidScroll(const WebCore::FloatPoint& scrollOffset, bool inUserInteraction);
 
     void currentSnapPointIndicesDidChange(unsigned horizontal, unsigned vertical) const;
     CALayer *scrollLayer() const { return m_scrollLayer.get(); }

Modified: trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm (245567 => 245568)


--- trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm	2019-05-21 13:10:52 UTC (rev 245567)
+++ trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm	2019-05-21 15:53:40 UTC (rev 245568)
@@ -294,10 +294,9 @@
 
 void ScrollingTreeScrollingNodeDelegateIOS::repositionScrollingLayers()
 {
-    auto scrollPosition = scrollingNode().currentScrollPosition();
-
     BEGIN_BLOCK_OBJC_EXCEPTIONS
-    [scrollView() setContentOffset:scrollPosition];
+    auto scrollOffset = ScrollableArea::scrollOffsetFromPosition(scrollingNode().currentScrollPosition(), toFloatSize(scrollOrigin()));
+    [scrollView() setContentOffset:scrollOffset];
     END_BLOCK_OBJC_EXCEPTIONS
 }
 
@@ -316,11 +315,12 @@
     scrollingTree().scrollingTreeNodeWillStartPanGesture();
 }
 
-void ScrollingTreeScrollingNodeDelegateIOS::scrollViewDidScroll(const FloatPoint& scrollPosition, bool inUserInteraction)
+void ScrollingTreeScrollingNodeDelegateIOS::scrollViewDidScroll(const FloatPoint& scrollOffset, bool inUserInteraction)
 {
     if (m_updatingFromStateNode)
         return;
 
+    auto scrollPosition = ScrollableArea::scrollPositionFromOffset(scrollOffset, toFloatSize(scrollOrigin()));
     scrollingNode().wasScrolledByDelegatedScrolling(scrollPosition);
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to