Title: [260686] branches/safari-610.1.11-branch
Revision
260686
Author
[email protected]
Date
2020-04-24 17:52:28 -0700 (Fri, 24 Apr 2020)

Log Message

Cherry-pick r260450. rdar://problem/62350884

    [Async overflow scroll] Overflow that's hidden on one axis is scrollable on that axis
    https://bugs.webkit.org/show_bug.cgi?id=210771
    <rdar://problem/62080331>

    Reviewed by Tim Horton.

    Source/WebCore:

    eventCanScrollContents() should check the presence of enabled scrollbars, like
    ScrollAnimator::handleWheelEvent() does.

    Test: fast/scrolling/mac/async-scroll-overflow-hidden-on-one-axis.html

    * page/scrolling/ScrollingTreeScrollingNode.cpp:
    (WebCore::ScrollingTreeScrollingNode::eventCanScrollContents const):

    LayoutTests:

    * fast/scrolling/mac/async-scroll-overflow-hidden-on-one-axis-expected.txt: Added.
    * fast/scrolling/mac/async-scroll-overflow-hidden-on-one-axis.html: Added.

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

Modified Paths

Added Paths

Diff

Modified: branches/safari-610.1.11-branch/LayoutTests/ChangeLog (260685 => 260686)


--- branches/safari-610.1.11-branch/LayoutTests/ChangeLog	2020-04-25 00:52:24 UTC (rev 260685)
+++ branches/safari-610.1.11-branch/LayoutTests/ChangeLog	2020-04-25 00:52:28 UTC (rev 260686)
@@ -1,3 +1,41 @@
+2020-04-24  Alan Coon  <[email protected]>
+
+        Cherry-pick r260450. rdar://problem/62350884
+
+    [Async overflow scroll] Overflow that's hidden on one axis is scrollable on that axis
+    https://bugs.webkit.org/show_bug.cgi?id=210771
+    <rdar://problem/62080331>
+    
+    Reviewed by Tim Horton.
+    
+    Source/WebCore:
+    
+    eventCanScrollContents() should check the presence of enabled scrollbars, like
+    ScrollAnimator::handleWheelEvent() does.
+    
+    Test: fast/scrolling/mac/async-scroll-overflow-hidden-on-one-axis.html
+    
+    * page/scrolling/ScrollingTreeScrollingNode.cpp:
+    (WebCore::ScrollingTreeScrollingNode::eventCanScrollContents const):
+    
+    LayoutTests:
+    
+    * fast/scrolling/mac/async-scroll-overflow-hidden-on-one-axis-expected.txt: Added.
+    * fast/scrolling/mac/async-scroll-overflow-hidden-on-one-axis.html: Added.
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@260450 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-04-21  Simon Fraser  <[email protected]>
+
+            [Async overflow scroll] Overflow that's hidden on one axis is scrollable on that axis
+            https://bugs.webkit.org/show_bug.cgi?id=210771
+            <rdar://problem/62080331>
+
+            Reviewed by Tim Horton.
+
+            * fast/scrolling/mac/async-scroll-overflow-hidden-on-one-axis-expected.txt: Added.
+            * fast/scrolling/mac/async-scroll-overflow-hidden-on-one-axis.html: Added.
+
 2020-04-19  Simon Fraser  <[email protected]>
 
         Content disappears on CSS parallax example

Added: branches/safari-610.1.11-branch/LayoutTests/fast/scrolling/mac/async-scroll-overflow-hidden-on-one-axis-expected.txt (0 => 260686)


--- branches/safari-610.1.11-branch/LayoutTests/fast/scrolling/mac/async-scroll-overflow-hidden-on-one-axis-expected.txt	                        (rev 0)
+++ branches/safari-610.1.11-branch/LayoutTests/fast/scrolling/mac/async-scroll-overflow-hidden-on-one-axis-expected.txt	2020-04-25 00:52:28 UTC (rev 260686)
@@ -0,0 +1,24 @@
+
+Test horizontal scroll in horizontal scroller
+PASS horizontalScrollerEventCount > 0 is true
+PASS verticalScrollerEventCount is 0
+PASS windowScrollEventCount is 0
+
+Test horizontal scroll in horizontal scroller
+PASS horizontalScrollerEventCount is 0
+PASS verticalScrollerEventCount is 0
+PASS windowScrollEventCount > 0 is true
+
+Test horizontal scroll in vertical scroller
+PASS horizontalScrollerEventCount is 0
+PASS verticalScrollerEventCount is 0
+PASS windowScrollEventCount > 0 is true
+
+Test vertical scroll in vertical scroller
+PASS horizontalScrollerEventCount is 0
+PASS verticalScrollerEventCount > 0 is true
+PASS windowScrollEventCount is 0
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: branches/safari-610.1.11-branch/LayoutTests/fast/scrolling/mac/async-scroll-overflow-hidden-on-one-axis.html (0 => 260686)


--- branches/safari-610.1.11-branch/LayoutTests/fast/scrolling/mac/async-scroll-overflow-hidden-on-one-axis.html	                        (rev 0)
+++ branches/safari-610.1.11-branch/LayoutTests/fast/scrolling/mac/async-scroll-overflow-hidden-on-one-axis.html	2020-04-25 00:52:28 UTC (rev 260686)
@@ -0,0 +1,145 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ internal:AsyncOverflowScrollingEnabled=true ] -->
+<html>
+<head>
+    <style>
+        body {
+            height: 1000px;
+        }
+        .scroller {
+            margin: 20px;
+            height: 200px;
+            width: 200px;
+            border: 20px solid gray;
+            padding: 5px;
+            overflow: scroll;
+        }
+        .horizontal {
+            overflow-y: hidden;
+        }
+        .vertical {
+            overflow-x: hidden;
+        }
+        .content {
+            width: 300%;
+            height: 300%;
+        }
+        
+    </style>
+    <script src=""
+    <script src=""
+    <script>
+        var jsTestIsAsync = true;
+
+        var horizontalScroller;
+        var verticalScroller;
+        var horizontalScrollerEventCount = 0;
+        var verticalScrollerEventCount = 0;
+        var windowScrollEventCount = 0;
+        
+        const horizontalScrollerMouseX = 100;
+        const horizontalScrollerMouseY = 100;
+
+        const verticalScrollerMouseX = 100;
+        const verticalScrollerMouseY = 400;
+
+        async function resetScrollPositions()
+        {
+            window.scrollTo(0, 0);
+            horizontalScroller.scrollTop = 0;
+            verticalScroller.scrollTop = 0;
+            
+            // Wait for scroll events to fire.
+            await UIHelper.animationFrame();
+
+            horizontalScrollerEventCount = 0;
+            verticalScrollerEventCount = 0;
+            windowScrollEventCount = 0;
+        }
+
+        async function testScrollInScroller(debugMessage, x, y, beginXDelta, beginYDelta, deltaX, deltaY, expectationsFunction)
+        {
+            debug('');
+            debug(debugMessage);
+            await resetScrollPositions();
+            await UIHelper.mouseWheelScrollAt(x, y, beginXDelta, beginYDelta, deltaX, deltaY);
+            expectationsFunction();
+        }
+
+        async function testHorizontalScrollInHorizontalScroller()
+        {
+            await testScrollInScroller('Test horizontal scroll in horizontal scroller', horizontalScrollerMouseX, horizontalScrollerMouseY, -1, 0, -10, 0, () => {
+                shouldBe('horizontalScrollerEventCount > 0', 'true');
+                shouldBe('verticalScrollerEventCount', '0');
+                shouldBe('windowScrollEventCount', '0');
+            });
+        }
+
+        async function testVerticalScrollInHorizontalScroller()
+        {
+            await testScrollInScroller('Test horizontal scroll in horizontal scroller', horizontalScrollerMouseX, horizontalScrollerMouseY, 0, -1, 0, -10, () => {
+                shouldBe('horizontalScrollerEventCount', '0');
+                shouldBe('verticalScrollerEventCount', '0');
+                shouldBe('windowScrollEventCount > 0', 'true');
+            });
+        }
+
+        async function testHorizontalScrollInVerticalScroller()
+        {
+            await testScrollInScroller('Test horizontal scroll in vertical scroller', verticalScrollerMouseX, verticalScrollerMouseY, -1, 0, -10, 0, () => {
+                shouldBe('horizontalScrollerEventCount', '0');
+                shouldBe('verticalScrollerEventCount', '0');
+                shouldBe('windowScrollEventCount > 0', 'true'); // Rubberbanding
+            });
+        }
+
+        async function testVerticalScrollInVerticalScroller()
+        {
+            await testScrollInScroller('Test vertical scroll in vertical scroller', verticalScrollerMouseX, verticalScrollerMouseY, 0, -1, 0, -10, () => {
+                shouldBe('horizontalScrollerEventCount', '0');
+                shouldBe('verticalScrollerEventCount > 0', 'true');
+                shouldBe('windowScrollEventCount', '0');
+            });
+        }
+
+        async function scrollTest()
+        {
+            await testHorizontalScrollInHorizontalScroller();
+            await testVerticalScrollInHorizontalScroller();
+            await testHorizontalScrollInVerticalScroller();
+            await testVerticalScrollInVerticalScroller();
+
+            finishJSTest();
+        }
+
+        window.addEventListener('load', () => {
+            horizontalScroller = document.querySelector('.horizontal.scroller');
+            horizontalScroller.addEventListener('scroll', () => {
+                ++horizontalScrollerEventCount;
+            }, false);
+
+            verticalScroller = document.querySelector('.vertical.scroller');
+            verticalScroller.addEventListener('scroll', () => {
+                ++verticalScrollerEventCount;
+            }, false);
+
+            window.addEventListener('scroll', () => {
+                ++windowScrollEventCount;
+            }, false);
+
+            setTimeout(scrollTest, 0);
+        }, false);
+
+        var successfullyParsed = true;
+    </script>
+</head>
+<body>
+    <div class="scroller horizontal">
+        <div class="content"></div>
+    </div>
+    <div class="scroller vertical">
+        <div class="content"></div>
+    </div>
+    <div id="console"></div>
+    <script src=""
+</body>
+</html>

Modified: branches/safari-610.1.11-branch/Source/WebCore/ChangeLog (260685 => 260686)


--- branches/safari-610.1.11-branch/Source/WebCore/ChangeLog	2020-04-25 00:52:24 UTC (rev 260685)
+++ branches/safari-610.1.11-branch/Source/WebCore/ChangeLog	2020-04-25 00:52:28 UTC (rev 260686)
@@ -1,3 +1,46 @@
+2020-04-24  Alan Coon  <[email protected]>
+
+        Cherry-pick r260450. rdar://problem/62350884
+
+    [Async overflow scroll] Overflow that's hidden on one axis is scrollable on that axis
+    https://bugs.webkit.org/show_bug.cgi?id=210771
+    <rdar://problem/62080331>
+    
+    Reviewed by Tim Horton.
+    
+    Source/WebCore:
+    
+    eventCanScrollContents() should check the presence of enabled scrollbars, like
+    ScrollAnimator::handleWheelEvent() does.
+    
+    Test: fast/scrolling/mac/async-scroll-overflow-hidden-on-one-axis.html
+    
+    * page/scrolling/ScrollingTreeScrollingNode.cpp:
+    (WebCore::ScrollingTreeScrollingNode::eventCanScrollContents const):
+    
+    LayoutTests:
+    
+    * fast/scrolling/mac/async-scroll-overflow-hidden-on-one-axis-expected.txt: Added.
+    * fast/scrolling/mac/async-scroll-overflow-hidden-on-one-axis.html: Added.
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@260450 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-04-21  Simon Fraser  <[email protected]>
+
+            [Async overflow scroll] Overflow that's hidden on one axis is scrollable on that axis
+            https://bugs.webkit.org/show_bug.cgi?id=210771
+            <rdar://problem/62080331>
+
+            Reviewed by Tim Horton.
+
+            eventCanScrollContents() should check the presence of enabled scrollbars, like
+            ScrollAnimator::handleWheelEvent() does.
+
+            Test: fast/scrolling/mac/async-scroll-overflow-hidden-on-one-axis.html
+
+            * page/scrolling/ScrollingTreeScrollingNode.cpp:
+            (WebCore::ScrollingTreeScrollingNode::eventCanScrollContents const):
+
 2020-04-19  Simon Fraser  <[email protected]>
 
         Content disappears on CSS parallax example

Modified: branches/safari-610.1.11-branch/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp (260685 => 260686)


--- branches/safari-610.1.11-branch/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp	2020-04-25 00:52:24 UTC (rev 260685)
+++ branches/safari-610.1.11-branch/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp	2020-04-25 00:52:28 UTC (rev 260686)
@@ -169,8 +169,16 @@
     if (wheelEvent.delta().isZero())
         return false;
 
-    FloatPoint oldScrollPosition = currentScrollPosition();
-    FloatPoint newScrollPosition = oldScrollPosition + FloatSize(-wheelEvent.deltaX(), -wheelEvent.deltaY());
+    auto wheelDelta = wheelEvent.delta();
+
+    if (!m_scrollableAreaParameters.hasEnabledHorizontalScrollbar)
+        wheelDelta.setWidth(0);
+
+    if (!m_scrollableAreaParameters.hasEnabledVerticalScrollbar)
+        wheelDelta.setHeight(0);
+
+    auto oldScrollPosition = currentScrollPosition();
+    auto newScrollPosition = oldScrollPosition - wheelDelta;
     newScrollPosition = newScrollPosition.constrainedBetween(minimumScrollPosition(), maximumScrollPosition());
     return newScrollPosition != oldScrollPosition;
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to