Changeset 283871 in webkit
- Timestamp:
- Oct 9, 2021 3:01:37 PM (9 months ago)
- Location:
- trunk
- Files:
-
- 10 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/TestExpectations (modified) (3 diffs)
-
LayoutTests/platform/ios/TestExpectations (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/page/DOMWindow.cpp (modified) (1 diff)
-
Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp (modified) (2 diffs)
-
Source/WebCore/page/scrolling/ScrollingCoordinatorTypes.h (modified) (3 diffs)
-
Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp (modified) (1 diff)
-
Source/WebKit/ChangeLog (modified) (2 diffs)
-
Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r283868 r283871 1 2021-10-09 Simon Fraser <simon.fraser@apple.com> 2 3 Run smooth scroll animations on the scrolling thread 4 https://bugs.webkit.org/show_bug.cgi?id=231481 5 6 Reviewed by Tim Horton. 7 8 imported/w3c/web-platform-tests/css/cssom-view/idlharness.html seems to pass just fine. 9 imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-smooth.html has some problems 10 indicated by the github issue. 11 12 Three tests pass now on iOS (but they are not yet scrolling in the UI process). 13 14 * TestExpectations: 15 * platform/ios/TestExpectations: 16 1 17 2021-10-09 Rob Buis <rbuis@igalia.com> 2 18 -
trunk/LayoutTests/TestExpectations
r283864 r283871 1000 1000 webkit.org/b/184066 imported/w3c/web-platform-tests/IndexedDB/nested-cloning-large.html [ Skip ] 1001 1001 webkit.org/b/184066 imported/w3c/web-platform-tests/IndexedDB/nested-cloning-small.html [ Skip ] 1002 [ Debug ] imported/w3c/web-platform-tests/css/cssom-view/idlharness.html [ Skip ]1003 1002 webkit.org/b/182292 imported/w3c/web-platform-tests/css/cssom-view/scrollingElement-quirks-dynamic-001.html [ ImageOnlyFailure ] 1004 1003 webkit.org/b/182292 imported/w3c/web-platform-tests/css/cssom-view/scrollingElement-quirks-dynamic-002.html [ ImageOnlyFailure ] … … 3003 3002 imported/w3c/web-platform-tests/css/css-ui/text-overflow-028.html [ ImageOnlyFailure ] 3004 3003 imported/w3c/web-platform-tests/css/css-ui/text-overflow-029.html [ ImageOnlyFailure ] 3005 imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-smooth.html [ Skip ] 3004 3006 3005 imported/w3c/web-platform-tests/css/mediaqueries/viewport-script-dynamic.html [ ImageOnlyFailure ] 3007 3006 imported/w3c/web-platform-tests/css/selectors/selection-image-001.html [ ImageOnlyFailure ] … … 3010 3009 imported/w3c/web-platform-tests/WebCryptoAPI/generateKey/successes_RSA-OAEP.https.any.html [ Pass Failure ] 3011 3010 imported/w3c/web-platform-tests/WebCryptoAPI/generateKey/successes_RSA-OAEP.https.any.worker.html [ Pass Failure ] 3011 3012 # https://github.com/web-platform-tests/wpt/issues/31174 3013 imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-smooth.html [ Skip ] 3012 3014 3013 3015 webkit.org/b/224104 imported/w3c/web-platform-tests/css/css-logical/logical-values-float-clear-reftest.html [ ImageOnlyFailure ] -
trunk/LayoutTests/platform/ios/TestExpectations
r283864 r283871 2443 2443 webkit.org/b/163755 imported/w3c/web-platform-tests/css/css-shapes/shape-outside/shape-image/shape-image-025.html [ ImageOnlyFailure ] 2444 2444 2445 webkit.org/b/5991 imported/w3c/web-platform-tests/css/cssom-view/scrolling-quirks-vs-nonquirks.html [ Failure ]2446 2447 webkit.org/b/149264 imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-root.html [ Failure ]2448 webkit.org/b/149264 imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-window.html [ Failure ]2449 2450 2445 # Variation fonts are not implemented earlier than iOS 11. 2451 2446 fast/text/variations [ Pass Failure ImageOnlyFailure ] -
trunk/Source/WebCore/ChangeLog
r283868 r283871 1 2021-10-09 Simon Fraser <simon.fraser@apple.com> 2 3 Run smooth scroll animations on the scrolling thread 4 https://bugs.webkit.org/show_bug.cgi?id=231481 5 6 Reviewed by Tim Horton. 7 8 Implement AsyncScrollingCoordinator::requestAnimatedScrollToPosition() and stopAnimatedScroll() 9 so that smooth scroll animations are dispatched to the scrolling thread. 10 11 RequestedScrollData gains a requestType field so that we can indicate the need 12 to cancel a running animation on the scrolling thread. 13 14 Tested by tests in imported/w3c/web-platform-tests/css/cssom-view. 15 16 * page/scrolling/AsyncScrollingCoordinator.cpp: 17 (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate): 18 (WebCore::AsyncScrollingCoordinator::requestAnimatedScrollToPosition): 19 (WebCore::AsyncScrollingCoordinator::stopAnimatedScroll): 20 * page/scrolling/ScrollingCoordinatorTypes.h: 21 (WebCore::RequestedScrollData::operator== const): 22 * page/scrolling/ScrollingTreeScrollingNode.cpp: 23 (WebCore::ScrollingTreeScrollingNode::handleScrollPositionRequest): We already cancel 24 the animation each time. If this is a ScrollRequestType::CancelAnimatedScroll, there is no 25 more to do. 26 1 27 2021-10-09 Rob Buis <rbuis@igalia.com> 2 28 -
trunk/Source/WebCore/page/DOMWindow.cpp
r283716 r283871 1713 1713 // This is an optimization for the common case of scrolling to (0, 0) when the scroller is already at the origin. 1714 1714 // If an animated scroll is in progress, this optimization is skipped to ensure that the animated scroll is really stopped. 1715 if (view->scrollAnimationStatus() == ScrollAnimationStatus::NotAnimating && !scrollToOptions.left.value() && !scrollToOptions.top.value() && view->contentsScrollPosition().isZero()) 1716 return; 1715 if (view->scrollAnimationStatus() == ScrollAnimationStatus::NotAnimating && !scrollToOptions.left.value() && !scrollToOptions.top.value() && view->contentsScrollPosition().isZero()) { 1716 LOG_WITH_STREAM(Scrolling, stream << "DOMWindow::scrollTo bailing because going to 0,0"); 1717 return; 1718 } 1717 1719 1718 1720 document()->updateLayoutIgnorePendingStylesheets(); -
trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp
r283793 r283871 276 276 return false; 277 277 278 stateNode->setRequestedScrollData({ scrollPosition, scrollType, clamping, ScrollIsAnimated::No });278 stateNode->setRequestedScrollData({ ScrollRequestType::PositionUpdate, scrollPosition, scrollType, clamping, ScrollIsAnimated::No }); 279 279 // FIXME: This should schedule a rendering update 280 280 commitTreeStateIfNeeded(); … … 282 282 } 283 283 284 bool AsyncScrollingCoordinator::requestAnimatedScrollToPosition(ScrollableArea&, const ScrollPosition&, ScrollClamping) 285 { 286 // FIXME: Implement. 287 return false; 288 } 289 290 void AsyncScrollingCoordinator::stopAnimatedScroll(ScrollableArea&) 291 { 292 // FIXME: Implement. 284 bool AsyncScrollingCoordinator::requestAnimatedScrollToPosition(ScrollableArea& scrollableArea, const ScrollPosition& scrollPosition, ScrollClamping clamping) 285 { 286 ASSERT(isMainThread()); 287 ASSERT(m_page); 288 auto scrollingNodeID = scrollableArea.scrollingNodeID(); 289 if (!scrollingNodeID) 290 return false; 291 292 auto* frameView = frameViewForScrollingNode(scrollingNodeID); 293 if (!frameView || !coordinatesScrollingForFrameView(*frameView)) 294 return false; 295 296 auto* stateNode = downcast<ScrollingStateScrollingNode>(m_scrollingStateTree->stateNodeForID(scrollingNodeID)); 297 if (!stateNode) 298 return false; 299 300 // Animated scrolls are always programmatic. 301 stateNode->setRequestedScrollData({ ScrollRequestType::PositionUpdate, scrollPosition, ScrollType::Programmatic, clamping, ScrollIsAnimated::Yes }); 302 // FIXME: This should schedule a rendering update 303 commitTreeStateIfNeeded(); 304 return true; 305 } 306 307 void AsyncScrollingCoordinator::stopAnimatedScroll(ScrollableArea& scrollableArea) 308 { 309 ASSERT(isMainThread()); 310 ASSERT(m_page); 311 auto scrollingNodeID = scrollableArea.scrollingNodeID(); 312 if (!scrollingNodeID) 313 return; 314 315 auto* frameView = frameViewForScrollingNode(scrollingNodeID); 316 if (!frameView || !coordinatesScrollingForFrameView(*frameView)) 317 return; 318 319 auto* stateNode = downcast<ScrollingStateScrollingNode>(m_scrollingStateTree->stateNodeForID(scrollingNodeID)); 320 if (!stateNode) 321 return; 322 323 // Animated scrolls are always programmatic. 324 stateNode->setRequestedScrollData({ ScrollRequestType::CancelAnimatedScroll, { } }); 325 // FIXME: This should schedule a rendering update 326 commitTreeStateIfNeeded(); 293 327 } 294 328 -
trunk/Source/WebCore/page/scrolling/ScrollingCoordinatorTypes.h
r283793 r283871 103 103 }; 104 104 105 enum class ScrollRequestType : uint8_t { 106 PositionUpdate, 107 CancelAnimatedScroll 108 }; 109 105 110 struct RequestedScrollData { 111 ScrollRequestType requestType { ScrollRequestType::PositionUpdate }; 106 112 FloatPoint scrollPosition; 107 113 ScrollType scrollType { ScrollType::User }; … … 111 117 bool operator==(const RequestedScrollData& other) const 112 118 { 113 return scrollPosition == other.scrollPosition 119 return requestType == other.requestType 120 && scrollPosition == other.scrollPosition 114 121 && scrollType == other.scrollType 115 && clamping == other.clamping; 122 && clamping == other.clamping 123 && animated == other.animated; 116 124 } 117 125 }; 118 126 119 enum ScrollUpdateType : uint8_t {127 enum class ScrollUpdateType : uint8_t { 120 128 PositionUpdate, 121 129 AnimatedScrollDidEnd … … 145 153 namespace WTF { 146 154 155 template<> struct EnumTraits<WebCore::ScrollRequestType> { 156 using values = EnumValues< 157 WebCore::ScrollRequestType, 158 WebCore::ScrollRequestType::PositionUpdate, 159 WebCore::ScrollRequestType::CancelAnimatedScroll 160 >; 161 }; 162 147 163 template<> struct EnumTraits<WebCore::ScrollingNodeType> { 148 164 using values = EnumValues< -
trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp
r283849 r283871 238 238 stopAnimatedScroll(); 239 239 240 if (requestedScrollData.requestType == ScrollRequestType::CancelAnimatedScroll) 241 return; 242 240 243 if (scrollingTree().scrollingTreeNodeRequestsScroll(scrollingNodeID(), requestedScrollData)) 241 244 return; -
trunk/Source/WebKit/ChangeLog
r283857 r283871 1 2021-10-09 Simon Fraser <simon.fraser@apple.com> 2 3 Run smooth scroll animations on the scrolling thread 4 https://bugs.webkit.org/show_bug.cgi?id=231481 5 6 Reviewed by Tim Horton. 7 8 Implement AsyncScrollingCoordinator::requestAnimatedScrollToPosition() and stopAnimatedScroll() 9 so that smooth scroll animations are dispatched to the scrolling thread. 10 11 RequestedScrollData gains a requestType field so that we can indicate the need 12 to cancel a running animation on the scrolling thread. 13 14 Tested by tests in imported/w3c/web-platform-tests/css/cssom-view. 15 16 * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp: 17 (ArgumentCoder<RequestedScrollData>::encode): 18 (ArgumentCoder<RequestedScrollData>::decode): 19 (WebKit::dump): 20 1 21 2021-10-08 BJ Burg <bburg@apple.com> 2 22 … … 43246 43266 43247 43267 == Rolled over to ChangeLog-2021-03-18 == 43268 -
trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp
r283792 r283871 505 505 void ArgumentCoder<RequestedScrollData>::encode(Encoder& encoder, const RequestedScrollData& scrollData) 506 506 { 507 encoder << scrollData.requestType; 507 508 encoder << scrollData.scrollPosition; 508 509 encoder << scrollData.scrollType; … … 513 514 bool ArgumentCoder<RequestedScrollData>::decode(Decoder& decoder, RequestedScrollData& scrollData) 514 515 { 516 if (!decoder.decode(scrollData.requestType)) 517 return false; 518 515 519 if (!decoder.decode(scrollData.scrollPosition)) 516 520 return false; … … 729 733 if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateNode::Property::RequestedScrollPosition)) { 730 734 const auto& requestedScrollData = node.requestedScrollData(); 731 ts.dumpProperty("requested-scroll-position", requestedScrollData.scrollPosition); 732 ts.dumpProperty("requested-scroll-position-is-programatic", requestedScrollData.scrollType); 733 ts.dumpProperty("requested-scroll-position-clamping", requestedScrollData.clamping); 735 if (requestedScrollData.requestType == ScrollRequestType::CancelAnimatedScroll) 736 ts.dumpProperty("requested-type", "cancel animated scroll"); 737 else { 738 ts.dumpProperty("requested-scroll-position", requestedScrollData.scrollPosition); 739 ts.dumpProperty("requested-scroll-position-is-programatic", requestedScrollData.scrollType); 740 ts.dumpProperty("requested-scroll-position-clamping", requestedScrollData.clamping); 741 } 734 742 } 735 743
Note: See TracChangeset
for help on using the changeset viewer.