Title: [285669] trunk
Revision
285669
Author
[email protected]
Date
2021-11-11 14:41:39 -0800 (Thu, 11 Nov 2021)

Log Message

REGRESSION: (r283871) [ macOS wk2 Release ] 2 css/cssom-view/scroll-behavior-main-frame tests are failing
https://bugs.webkit.org/show_bug.cgi?id=231600

Reviewed by Simon Fraser.

Source/WebCore:

Fix for issue where a scroll animation is not properly cancelled by a second scroll request.
This occurs when the first scroll animation has not been fully started by the time the second
request has been received by the scrolling thread (first animation still in
m_nodesWithPendingScrollAnimations). For the scenario where the second scroll request is animated,
we change ThreadedScrollingTree::scrollingTreeNodeRequestsScroll to use set (add is ignored if
key exists in the hash map which caused the second request to be ignored). For the scenario
where the second scroll request is not animated, we clear the pending request for that
scrolling node (if one exists).

* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::removePendingScrollAnimationForNode):
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::handleScrollPositionRequest):
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::scrollingTreeNodeRequestsScroll):
(WebCore::ThreadedScrollingTree::removePendingScrollAnimationForNode):
* page/scrolling/ThreadedScrollingTree.h:

LayoutTests:

* platform/mac-wk2/TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (285668 => 285669)


--- trunk/LayoutTests/ChangeLog	2021-11-11 22:40:57 UTC (rev 285668)
+++ trunk/LayoutTests/ChangeLog	2021-11-11 22:41:39 UTC (rev 285669)
@@ -1,3 +1,12 @@
+2021-11-11  Nikolaos Mouchtaris  <[email protected]>
+
+        REGRESSION: (r283871) [ macOS wk2 Release ] 2 css/cssom-view/scroll-behavior-main-frame tests are failing
+        https://bugs.webkit.org/show_bug.cgi?id=231600
+
+        Reviewed by Simon Fraser.
+
+        * platform/mac-wk2/TestExpectations:
+
 2021-11-11  Ryan Haddad  <[email protected]>
 
         REGRESSION (r285618): [mac-wk1] ASSERTION FAILED: cgContext == [currentContext CGContext]

Modified: trunk/LayoutTests/platform/mac-wk2/TestExpectations (285668 => 285669)


--- trunk/LayoutTests/platform/mac-wk2/TestExpectations	2021-11-11 22:40:57 UTC (rev 285668)
+++ trunk/LayoutTests/platform/mac-wk2/TestExpectations	2021-11-11 22:41:39 UTC (rev 285669)
@@ -1679,9 +1679,6 @@
 
 webkit.org/b/231386 [ BigSur ] http/tests/resourceLoadStatistics/website-data-removal-for-site-with-user-interaction.html [ Pass Timeout ]
 
-webkit.org/b/231600 [ Release ] imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-main-frame-window.html [ Pass Failure ]
-webkit.org/b/231600 [ Release ] imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-main-frame-root.html [ Failure ]
-
 webkit.org/b/231765 [ Release ] http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration.html [ Pass Timeout ]
 
 webkit.org/b/231780 [ Debug ] imported/w3c/web-platform-tests/webrtc/simulcast/basic.https.html [ Pass Failure ]

Modified: trunk/Source/WebCore/ChangeLog (285668 => 285669)


--- trunk/Source/WebCore/ChangeLog	2021-11-11 22:40:57 UTC (rev 285668)
+++ trunk/Source/WebCore/ChangeLog	2021-11-11 22:41:39 UTC (rev 285669)
@@ -1,3 +1,28 @@
+2021-11-11  Nikolaos Mouchtaris  <[email protected]>
+
+        REGRESSION: (r283871) [ macOS wk2 Release ] 2 css/cssom-view/scroll-behavior-main-frame tests are failing
+        https://bugs.webkit.org/show_bug.cgi?id=231600
+
+        Reviewed by Simon Fraser.
+
+        Fix for issue where a scroll animation is not properly cancelled by a second scroll request.
+        This occurs when the first scroll animation has not been fully started by the time the second
+        request has been received by the scrolling thread (first animation still in 
+        m_nodesWithPendingScrollAnimations). For the scenario where the second scroll request is animated, 
+        we change ThreadedScrollingTree::scrollingTreeNodeRequestsScroll to use set (add is ignored if
+        key exists in the hash map which caused the second request to be ignored). For the scenario 
+        where the second scroll request is not animated, we clear the pending request for that 
+        scrolling node (if one exists).
+
+        * page/scrolling/ScrollingTree.h:
+        (WebCore::ScrollingTree::removePendingScrollAnimationForNode):
+        * page/scrolling/ScrollingTreeScrollingNode.cpp:
+        (WebCore::ScrollingTreeScrollingNode::handleScrollPositionRequest):
+        * page/scrolling/ThreadedScrollingTree.cpp:
+        (WebCore::ThreadedScrollingTree::scrollingTreeNodeRequestsScroll):
+        (WebCore::ThreadedScrollingTree::removePendingScrollAnimationForNode):
+        * page/scrolling/ThreadedScrollingTree.h:
+
 2021-11-11  Wenson Hsieh  <[email protected]>
 
         Move image overlay code out of HTMLElement and into a separate helper file

Modified: trunk/Source/WebCore/page/scrolling/ScrollingTree.h (285668 => 285669)


--- trunk/Source/WebCore/page/scrolling/ScrollingTree.h	2021-11-11 22:40:57 UTC (rev 285668)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTree.h	2021-11-11 22:41:39 UTC (rev 285669)
@@ -234,6 +234,7 @@
 
     void addPendingScrollUpdate(ScrollUpdate&&);
     Vector<ScrollUpdate> takePendingScrollUpdates();
+    virtual void removePendingScrollAnimationForNode(ScrollingNodeID) { }
 
 protected:
     WheelEventHandlingResult handleWheelEventWithNode(const PlatformWheelEvent&, OptionSet<WheelEventProcessingSteps>, ScrollingTreeNode*, EventTargeting = EventTargeting::Propagate);

Modified: trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp (285668 => 285669)


--- trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp	2021-11-11 22:40:57 UTC (rev 285668)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp	2021-11-11 22:41:39 UTC (rev 285669)
@@ -251,8 +251,10 @@
 
     stopAnimatedScroll();
 
-    if (requestedScrollData.requestType == ScrollRequestType::CancelAnimatedScroll)
+    if (requestedScrollData.requestType == ScrollRequestType::CancelAnimatedScroll) {
+        scrollingTree().removePendingScrollAnimationForNode(scrollingNodeID());
         return;
+    }
 
     if (scrollingTree().scrollingTreeNodeRequestsScroll(scrollingNodeID(), requestedScrollData))
         return;

Modified: trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp (285668 => 285669)


--- trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp	2021-11-11 22:40:57 UTC (rev 285668)
+++ trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp	2021-11-11 22:41:39 UTC (rev 285669)
@@ -179,7 +179,7 @@
 bool ThreadedScrollingTree::scrollingTreeNodeRequestsScroll(ScrollingNodeID nodeID, const RequestedScrollData& request)
 {
     if (request.animated == ScrollIsAnimated::Yes) {
-        m_nodesWithPendingScrollAnimations.add(nodeID, request);
+        m_nodesWithPendingScrollAnimations.set(nodeID, request);
         return true;
     }
     return false;
@@ -498,6 +498,11 @@
     });
 }
 
+void ThreadedScrollingTree::removePendingScrollAnimationForNode(ScrollingNodeID nodeID)
+{
+    m_nodesWithPendingScrollAnimations.remove(nodeID);
+}
+
 } // namespace WebCore
 
 #endif // ENABLE(ASYNC_SCROLLING) && ENABLE(SCROLLING_THREAD)

Modified: trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.h (285668 => 285669)


--- trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.h	2021-11-11 22:40:57 UTC (rev 285668)
+++ trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.h	2021-11-11 22:41:39 UTC (rev 285669)
@@ -64,6 +64,7 @@
     Lock& treeLock() WTF_RETURNS_LOCK(m_treeLock) { return m_treeLock; }
 
     bool scrollAnimatorEnabled() const { return m_scrollAnimatorEnabled; }
+    void removePendingScrollAnimationForNode(ScrollingNodeID) WTF_REQUIRES_LOCK(m_treeLock) final;
 
 protected:
     explicit ThreadedScrollingTree(AsyncScrollingCoordinator&);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to