Diff
Modified: branches/safari-611-branch/LayoutTests/ChangeLog (272288 => 272289)
--- branches/safari-611-branch/LayoutTests/ChangeLog 2021-02-03 01:41:53 UTC (rev 272288)
+++ branches/safari-611-branch/LayoutTests/ChangeLog 2021-02-03 01:41:58 UTC (rev 272289)
@@ -1,5 +1,68 @@
2021-02-02 Alan Coon <[email protected]>
+ Cherry-pick r271701. rdar://problem/73889964
+
+ Source/WebCore:
+ REGRESSION (Async overflow): Scroll stutters/blocked with nested scrolling
+ https://bugs.webkit.org/show_bug.cgi?id=219923
+ <rdar://72390196>
+
+ Reviewed by Sam Weinig.
+
+ When handling wheel events in overflow:scroll areas which are only scrollable on
+ one axis, particularly when nested, we need to account for the different
+ scrollability on each axis in a couple of places.
+
+ First, address the FIXME in ScrollingTreeScrollingNodeDelegateMac::shouldRubberBandInDirection()
+ by consulting node scrollability; this prevents attempts to rubberband on a non-scrollable
+ axis.
+
+ Second, ScrollController should only allow stretching on a scrollable axis.
+
+ The effects of these changes are that we no longer keep sending events to a node which
+ ends up not handling them; this resulted in latching "timing out", re-hit-testing
+ in the middle of a gesture and causing stuttery position changes on a different
+ scroller.
+
+ Tests: fast/scrolling/latching/nested-cross-axis-latch-expiration.html
+ fast/scrolling/latching/overflow-hidden-on-one-axis.html
+
+ * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
+ (WebCore::ScrollingTreeScrollingNodeDelegateMac::shouldRubberBandInDirection const):
+ * platform/cocoa/ScrollController.mm:
+ (WebCore::ScrollController::handleWheelEvent):
+ * rendering/RenderLayerScrollableArea.cpp:
+ (WebCore::RenderLayerScrollableArea::scrollTo): Add the scrollingNodeID to the logging.
+
+ LayoutTests:
+ REGRESSION (?): Scroll stutters/blocked with nested scrolling
+ https://bugs.webkit.org/show_bug.cgi?id=219923
+ <rdar://72390196>
+
+ Reviewed by Sam Weinig.
+
+ * fast/scrolling/latching/nested-cross-axis-latch-expiration-expected.txt: Added.
+ * fast/scrolling/latching/nested-cross-axis-latch-expiration.html: Added.
+ * fast/scrolling/latching/overflow-hidden-on-one-axis-expected.txt: Added.
+ * fast/scrolling/latching/overflow-hidden-on-one-axis.html: Added.
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271701 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2021-01-21 Simon Fraser <[email protected]>
+
+ REGRESSION (?): Scroll stutters/blocked with nested scrolling
+ https://bugs.webkit.org/show_bug.cgi?id=219923
+ <rdar://72390196>
+
+ Reviewed by Sam Weinig.
+
+ * fast/scrolling/latching/nested-cross-axis-latch-expiration-expected.txt: Added.
+ * fast/scrolling/latching/nested-cross-axis-latch-expiration.html: Added.
+ * fast/scrolling/latching/overflow-hidden-on-one-axis-expected.txt: Added.
+ * fast/scrolling/latching/overflow-hidden-on-one-axis.html: Added.
+
+2021-02-02 Alan Coon <[email protected]>
+
Cherry-pick r272073. rdar://problem/73847891
font-stretch is not applied to system-ui
Added: branches/safari-611-branch/LayoutTests/fast/scrolling/latching/nested-cross-axis-latch-expiration-expected.txt (0 => 272289)
--- branches/safari-611-branch/LayoutTests/fast/scrolling/latching/nested-cross-axis-latch-expiration-expected.txt (rev 0)
+++ branches/safari-611-branch/LayoutTests/fast/scrolling/latching/nested-cross-axis-latch-expiration-expected.txt 2021-02-03 01:41:58 UTC (rev 272289)
@@ -0,0 +1,7 @@
+PASS innerOverflowScrollEventCount > 0 is true
+PASS outerOverflowScrollEventCount is 0
+PASS windowScrollEventCount is 0
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: branches/safari-611-branch/LayoutTests/fast/scrolling/latching/nested-cross-axis-latch-expiration.html (0 => 272289)
--- branches/safari-611-branch/LayoutTests/fast/scrolling/latching/nested-cross-axis-latch-expiration.html (rev 0)
+++ branches/safari-611-branch/LayoutTests/fast/scrolling/latching/nested-cross-axis-latch-expiration.html 2021-02-03 01:41:58 UTC (rev 272289)
@@ -0,0 +1,144 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ AsyncOverflowScrollingEnabled=true ] -->
+<html>
+<head>
+ <style>
+ body {
+ height: 1000px;
+ }
+
+ .scroller {
+ margin: 20px;
+ height: 500px;
+ width: 500px;
+ border: 2px solid gray;
+ padding: 5px;
+ overflow-y: hidden;
+ overflow-x: scroll;
+ }
+
+ .inner-scroller {
+ margin-top: 50px;
+ overflow-x: hidden;
+ overflow-y: scroll;
+ border: 2px solid blue;
+ height: 500px;
+ width: 300px;
+ }
+
+ .wide {
+ width: 300%;
+ height: 10px;
+ background-color: silver;
+ }
+
+ .filler {
+ width: 10px;
+ height: 200%;
+ background-color: silver;
+ }
+
+ </style>
+ <script src=""
+ <script src=""
+ <script>
+ var jsTestIsAsync = true;
+
+ var scroller;
+ var outerOverflowScrollEventCount = 0;
+ var innerOverflowScrollEventCount = 0;
+ var windowScrollEventCount = 0;
+
+ async function scrollTest()
+ {
+ await UIHelper.delayFor(100);
+
+ eventSender.mouseMoveTo(150, 150);
+
+ eventSender.monitorWheelEvents();
+ // Latch to the inner vertical scroller.
+ eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none');
+ await UIHelper.renderingUpdate();
+ eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -10, 'changed', 'none');
+ await UIHelper.renderingUpdate();
+ eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
+ await UIHelper.renderingUpdate();
+ eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -10, 'none', 'begin');
+ await UIHelper.renderingUpdate();
+ eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -10, 'none', 'continue');
+ await UIHelper.renderingUpdate();
+ eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end');
+ await UIHelper.waitForScrollCompletion();
+
+ // Now try to scroll on the other axis while still latched.
+ eventSender.monitorWheelEvents({ resetLatching: false });
+ await UIHelper.renderingUpdate();
+ eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'began', 'none');
+ await UIHelper.renderingUpdate();
+ eventSender.mouseScrollByWithWheelAndMomentumPhases(-10, 0, 'changed', 'none');
+ await UIHelper.renderingUpdate();
+ eventSender.mouseScrollByWithWheelAndMomentumPhases(-10, 0, 'changed', 'none');
+ await UIHelper.renderingUpdate();
+ eventSender.mouseScrollByWithWheelAndMomentumPhases(-10, 0, 'changed', 'none');
+ await UIHelper.renderingUpdate();
+ eventSender.mouseScrollByWithWheelAndMomentumPhases(-10, 0, 'changed', 'none');
+ await UIHelper.renderingUpdate();
+ eventSender.mouseScrollByWithWheelAndMomentumPhases(-10, 0, 'changed', 'none');
+ await UIHelper.renderingUpdate();
+ eventSender.mouseScrollByWithWheelAndMomentumPhases(-10, 0, 'changed', 'none');
+ await UIHelper.renderingUpdate();
+ eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
+ await UIHelper.renderingUpdate();
+ eventSender.mouseScrollByWithWheelAndMomentumPhases(-10, 0, 'none', 'begin');
+ await UIHelper.renderingUpdate();
+ eventSender.mouseScrollByWithWheelAndMomentumPhases(-10, 0, 'none', 'continue');
+ await UIHelper.renderingUpdate();
+ eventSender.mouseScrollByWithWheelAndMomentumPhases(-10, 0, 'none', 'continue');
+ await UIHelper.renderingUpdate();
+ eventSender.mouseScrollByWithWheelAndMomentumPhases(-10, 0, 'none', 'continue');
+ await UIHelper.renderingUpdate();
+ eventSender.mouseScrollByWithWheelAndMomentumPhases(-10, 0, 'none', 'continue');
+ await UIHelper.renderingUpdate();
+ eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end');
+ await UIHelper.waitForScrollCompletion();
+
+ checkForScroll();
+ }
+
+ function checkForScroll()
+ {
+ shouldBeTrue('innerOverflowScrollEventCount > 0');
+ shouldBe('outerOverflowScrollEventCount', '0');
+ shouldBe('windowScrollEventCount', '0');
+ finishJSTest();
+ }
+
+ window.addEventListener('load', () => {
+ scroller = document.querySelector('.scroller');
+ scroller.addEventListener('scroll', () => {
+ ++outerOverflowScrollEventCount;
+ }, false);
+
+ innerScroller = document.querySelector('.inner-scroller');
+ innerScroller.addEventListener('scroll', () => {
+ ++innerOverflowScrollEventCount;
+ }, false);
+
+ window.addEventListener('scroll', () => {
+ ++windowScrollEventCount;
+ }, false);
+
+ setTimeout(scrollTest, 0);
+ }, false);
+ </script>
+</head>
+<body>
+ <div class="scroller">
+ <div class="wide"></div>
+ <div class="inner-scroller">
+ <div class="filler"></div>
+ </div>
+ </div>
+ <div id="console"></div>
+ <script src=""
+</body>
+</html>
Added: branches/safari-611-branch/LayoutTests/fast/scrolling/latching/overflow-hidden-on-one-axis-expected.txt (0 => 272289)
--- branches/safari-611-branch/LayoutTests/fast/scrolling/latching/overflow-hidden-on-one-axis-expected.txt (rev 0)
+++ branches/safari-611-branch/LayoutTests/fast/scrolling/latching/overflow-hidden-on-one-axis-expected.txt 2021-02-03 01:41:58 UTC (rev 272289)
@@ -0,0 +1,11 @@
+Tests that scroll events of type 'none' work properly.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS scroller.scrollLeft is 0
+PASS scroller.scrollTop > 0 is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: branches/safari-611-branch/LayoutTests/fast/scrolling/latching/overflow-hidden-on-one-axis.html (0 => 272289)
--- branches/safari-611-branch/LayoutTests/fast/scrolling/latching/overflow-hidden-on-one-axis.html (rev 0)
+++ branches/safari-611-branch/LayoutTests/fast/scrolling/latching/overflow-hidden-on-one-axis.html 2021-02-03 01:41:58 UTC (rev 272289)
@@ -0,0 +1,86 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ AsyncOverflowScrollingEnabled=true ] -->
+<html>
+<head>
+<style>
+ body {
+ height: 2500px;
+ }
+
+ .scroller {
+ width: 500px;
+ height: 300px;
+ overflow-x: hidden;
+ overflow-y: auto;
+ border: 1px solid black;
+ }
+
+ .contents {
+ height: 300%;
+ width: 300%;
+ }
+ </style>
+<script src=""
+<script src=""
+<script>
+ jsTestIsAsync = true;
+
+ let scroller;
+ function checkForScroll()
+ {
+ scroller = document.querySelector('.scroller');
+ shouldBe('scroller.scrollLeft', '0');
+ shouldBeTrue('scroller.scrollTop > 0');
+ finishJSTest();
+ }
+
+ async function scrollTest()
+ {
+ eventSender.mouseMoveTo(100, 100);
+
+ eventSender.monitorWheelEvents();
+ // Latch to the scroller.
+ eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none');
+ eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -10, 'changed', 'none');
+ eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
+ eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -10, 'none', 'begin');
+ eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -10, 'none', 'continue');
+ eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end');
+ await UIHelper.waitForScrollCompletion();
+
+ // Now scroll on the other axis.
+ eventSender.monitorWheelEvents({ resetLatching: false });
+ eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'began', 'none');
+ eventSender.mouseScrollByWithWheelAndMomentumPhases(-10, 0, 'changed', 'none');
+ eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
+ eventSender.mouseScrollByWithWheelAndMomentumPhases(-10, 0, 'none', 'begin');
+ eventSender.mouseScrollByWithWheelAndMomentumPhases(-10, 0, 'none', 'continue');
+ eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end');
+ await UIHelper.waitForScrollCompletion();
+
+ checkForScroll();
+ }
+
+ function setupTopLevel()
+ {
+ description("Tests that scroll events of type 'none' work properly.");
+ if (window.eventSender) {
+ setTimeout(scrollTest, 0);
+ return;
+ }
+
+ finishJSTest();
+ }
+
+ window.addEventListener('load', () => {
+ setupTopLevel();
+ }, false);
+</script>
+</head>
+<body>
+ <div class="scroller">
+ <div class="contents"></div>
+ </div>
+<div id="console"></div>
+<script src=""
+</body>
+</html>
Added: branches/safari-611-branch/LayoutTests/platform/mac-wk1/fast/scrolling/latching/nested-cross-axis-latch-expiration-expected.txt (0 => 272289)
--- branches/safari-611-branch/LayoutTests/platform/mac-wk1/fast/scrolling/latching/nested-cross-axis-latch-expiration-expected.txt (rev 0)
+++ branches/safari-611-branch/LayoutTests/platform/mac-wk1/fast/scrolling/latching/nested-cross-axis-latch-expiration-expected.txt 2021-02-03 01:41:58 UTC (rev 272289)
@@ -0,0 +1,7 @@
+PASS innerOverflowScrollEventCount > 0 is true
+FAIL outerOverflowScrollEventCount should be 0. Was 11.
+PASS windowScrollEventCount is 0
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Modified: branches/safari-611-branch/Source/WebCore/ChangeLog (272288 => 272289)
--- branches/safari-611-branch/Source/WebCore/ChangeLog 2021-02-03 01:41:53 UTC (rev 272288)
+++ branches/safari-611-branch/Source/WebCore/ChangeLog 2021-02-03 01:41:58 UTC (rev 272289)
@@ -1,5 +1,88 @@
2021-02-02 Alan Coon <[email protected]>
+ Cherry-pick r271701. rdar://problem/73889964
+
+ Source/WebCore:
+ REGRESSION (Async overflow): Scroll stutters/blocked with nested scrolling
+ https://bugs.webkit.org/show_bug.cgi?id=219923
+ <rdar://72390196>
+
+ Reviewed by Sam Weinig.
+
+ When handling wheel events in overflow:scroll areas which are only scrollable on
+ one axis, particularly when nested, we need to account for the different
+ scrollability on each axis in a couple of places.
+
+ First, address the FIXME in ScrollingTreeScrollingNodeDelegateMac::shouldRubberBandInDirection()
+ by consulting node scrollability; this prevents attempts to rubberband on a non-scrollable
+ axis.
+
+ Second, ScrollController should only allow stretching on a scrollable axis.
+
+ The effects of these changes are that we no longer keep sending events to a node which
+ ends up not handling them; this resulted in latching "timing out", re-hit-testing
+ in the middle of a gesture and causing stuttery position changes on a different
+ scroller.
+
+ Tests: fast/scrolling/latching/nested-cross-axis-latch-expiration.html
+ fast/scrolling/latching/overflow-hidden-on-one-axis.html
+
+ * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
+ (WebCore::ScrollingTreeScrollingNodeDelegateMac::shouldRubberBandInDirection const):
+ * platform/cocoa/ScrollController.mm:
+ (WebCore::ScrollController::handleWheelEvent):
+ * rendering/RenderLayerScrollableArea.cpp:
+ (WebCore::RenderLayerScrollableArea::scrollTo): Add the scrollingNodeID to the logging.
+
+ LayoutTests:
+ REGRESSION (?): Scroll stutters/blocked with nested scrolling
+ https://bugs.webkit.org/show_bug.cgi?id=219923
+ <rdar://72390196>
+
+ Reviewed by Sam Weinig.
+
+ * fast/scrolling/latching/nested-cross-axis-latch-expiration-expected.txt: Added.
+ * fast/scrolling/latching/nested-cross-axis-latch-expiration.html: Added.
+ * fast/scrolling/latching/overflow-hidden-on-one-axis-expected.txt: Added.
+ * fast/scrolling/latching/overflow-hidden-on-one-axis.html: Added.
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271701 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2021-01-21 Simon Fraser <[email protected]>
+
+ REGRESSION (Async overflow): Scroll stutters/blocked with nested scrolling
+ https://bugs.webkit.org/show_bug.cgi?id=219923
+ <rdar://72390196>
+
+ Reviewed by Sam Weinig.
+
+ When handling wheel events in overflow:scroll areas which are only scrollable on
+ one axis, particularly when nested, we need to account for the different
+ scrollability on each axis in a couple of places.
+
+ First, address the FIXME in ScrollingTreeScrollingNodeDelegateMac::shouldRubberBandInDirection()
+ by consulting node scrollability; this prevents attempts to rubberband on a non-scrollable
+ axis.
+
+ Second, ScrollController should only allow stretching on a scrollable axis.
+
+ The effects of these changes are that we no longer keep sending events to a node which
+ ends up not handling them; this resulted in latching "timing out", re-hit-testing
+ in the middle of a gesture and causing stuttery position changes on a different
+ scroller.
+
+ Tests: fast/scrolling/latching/nested-cross-axis-latch-expiration.html
+ fast/scrolling/latching/overflow-hidden-on-one-axis.html
+
+ * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
+ (WebCore::ScrollingTreeScrollingNodeDelegateMac::shouldRubberBandInDirection const):
+ * platform/cocoa/ScrollController.mm:
+ (WebCore::ScrollController::handleWheelEvent):
+ * rendering/RenderLayerScrollableArea.cpp:
+ (WebCore::RenderLayerScrollableArea::scrollTo): Add the scrollingNodeID to the logging.
+
+2021-02-02 Alan Coon <[email protected]>
+
Cherry-pick r272073. rdar://problem/73847891
font-stretch is not applied to system-ui
Modified: branches/safari-611-branch/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm (272288 => 272289)
--- branches/safari-611-branch/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm 2021-02-03 01:41:53 UTC (rev 272288)
+++ branches/safari-611-branch/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm 2021-02-03 01:41:58 UTC (rev 272289)
@@ -356,7 +356,14 @@
if (scrollingNode().isRootNode())
return scrollingTree().mainFrameCanRubberBandInDirection(direction);
- // FIXME: Consult the node.
+ switch (direction) {
+ case ScrollDirection::ScrollUp:
+ case ScrollDirection::ScrollDown:
+ return allowsVerticalScrolling();
+ case ScrollDirection::ScrollLeft:
+ case ScrollDirection::ScrollRight:
+ return allowsHorizontalScrolling();
+ }
return true;
}
Modified: branches/safari-611-branch/Source/WebCore/platform/cocoa/ScrollController.mm (272288 => 272289)
--- branches/safari-611-branch/Source/WebCore/platform/cocoa/ScrollController.mm 2021-02-03 01:41:53 UTC (rev 272288)
+++ branches/safari-611-branch/Source/WebCore/platform/cocoa/ScrollController.mm 2021-02-03 01:41:58 UTC (rev 272289)
@@ -252,7 +252,14 @@
} else
m_overflowScrollDelta.setWidth(m_overflowScrollDelta.width() + deltaX);
}
- shouldStretch = true;
+
+ if (!m_client.allowsHorizontalStretching(wheelEvent))
+ deltaX = 0;
+
+ if (!m_client.allowsVerticalStretching(wheelEvent))
+ deltaY = 0;
+
+ shouldStretch = deltaX || deltaY;
}
}