Changeset 285992 in webkit
- Timestamp:
- Nov 18, 2021, 2:06:53 AM (5 years ago)
- Location:
- trunk/Source
- Files:
-
- 8 edited
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/page/scrolling/ScrollingTree.cpp (modified) (1 diff)
-
WebCore/page/scrolling/ScrollingTree.h (modified) (1 diff)
-
WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp (modified) (1 diff)
-
WebCore/page/scrolling/ScrollingTreeScrollingNode.h (modified) (1 diff)
-
WebCore/page/scrolling/nicosia/ScrollingTreeScrollingNodeDelegateNicosia.cpp (modified) (1 diff)
-
WebKit/ChangeLog (modified) (1 diff)
-
WebKit/WebProcess/WebPage/EventDispatcher.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r285991 r285992 1 2021-11-18 Chris Lord <clord@igalia.com> 2 3 [GLIB] twitch.tv forces synchronous scrolling 4 https://bugs.webkit.org/show_bug.cgi?id=232376 5 <rdar://problem/85247010> 6 7 Reviewed by Simon Fraser. 8 9 Make sure to keep the userScrollInProgress flag in sync for scrolling 10 nodes in the nicosia backend and add a utility function to determine 11 if user scroll is in progress for a given wheel event. This lets 12 EventDispatcher dispatch events asynchronously in that case. 13 14 No new tests, exercised by existing tests. 15 16 * page/scrolling/ScrollingTree.cpp: 17 (WebCore::ScrollingTree::isUserScrollInProgressAtEventLocation): 18 * page/scrolling/ScrollingTree.h: 19 * page/scrolling/ScrollingTreeScrollingNode.cpp: 20 (WebCore::ScrollingTreeScrollingNode::isUserScrollInProgress const): 21 (WebCore::ScrollingTreeScrollingNode::isUserScrollProgress const): Deleted. 22 * page/scrolling/ScrollingTreeScrollingNode.h: 23 * page/scrolling/nicosia/ScrollingTreeScrollingNodeDelegateNicosia.cpp: 24 (WebCore::ScrollingTreeScrollingNodeDelegateNicosia::handleWheelEvent): 25 1 26 2021-11-18 Carlos Garcia Campos <cgarcia@igalia.com> 2 27 -
trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp
r285526 r285992 64 64 ScrollingTree::~ScrollingTree() = default; 65 65 66 bool ScrollingTree::isUserScrollInProgressAtEventLocation(const PlatformWheelEvent& wheelEvent) 67 { 68 if (!m_rootNode) 69 return false; 70 71 // This method is invoked by the event handling thread 72 Locker locker { m_treeStateLock }; 73 74 if (m_treeState.nodesWithActiveUserScrolls.isEmpty()) 75 return false; 76 77 FloatPoint position = wheelEvent.position(); 78 position.move(m_rootNode->viewToContentsOffset(m_treeState.mainFrameScrollPosition)); 79 if (auto node = scrollingNodeForPoint(position)) 80 return m_treeState.nodesWithActiveUserScrolls.contains(node->scrollingNodeID()); 81 82 return false; 83 } 84 66 85 OptionSet<WheelEventProcessingSteps> ScrollingTree::computeWheelProcessingSteps(const PlatformWheelEvent& wheelEvent) 67 86 { -
trunk/Source/WebCore/page/scrolling/ScrollingTree.h
r285669 r285992 104 104 void setMomentumScrollingAnimatorEnabled(bool value) { m_momentumScrollingAnimatorEnabled = value; } 105 105 106 WEBCORE_EXPORT bool isUserScrollInProgressAtEventLocation(const PlatformWheelEvent&); 106 107 WEBCORE_EXPORT OptionSet<WheelEventProcessingSteps> determineWheelEventProcessing(const PlatformWheelEvent&); 107 108 WEBCORE_EXPORT virtual WheelEventHandlingResult handleWheelEvent(const PlatformWheelEvent&, OptionSet<WheelEventProcessingSteps> = { }); -
trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp
r285669 r285992 206 206 } 207 207 208 bool ScrollingTreeScrollingNode::isUserScroll Progress() const208 bool ScrollingTreeScrollingNode::isUserScrollInProgress() const 209 209 { 210 210 return scrollingTree().isUserScrollInProgressForNode(scrollingNodeID()); -
trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h
r285526 r285992 70 70 RectEdges<bool> edgePinnedState() const; 71 71 72 bool isUserScroll Progress() const;72 bool isUserScrollInProgress() const; 73 73 void setUserScrollInProgress(bool); 74 74 -
trunk/Source/WebCore/page/scrolling/nicosia/ScrollingTreeScrollingNodeDelegateNicosia.cpp
r285161 r285992 81 81 WheelEventHandlingResult ScrollingTreeScrollingNodeDelegateNicosia::handleWheelEvent(const PlatformWheelEvent& wheelEvent, EventTargeting eventTargeting) 82 82 { 83 if (!scrollingNode().canHandleWheelEvent(wheelEvent, eventTargeting)84 || !m_scrollController.handleWheelEvent(wheelEvent))85 return WheelEventHandlingResult::unhandled();83 bool wasInUserScroll = m_scrollController.isUserScrollInProgress(); 84 bool handled = scrollingNode().canHandleWheelEvent(wheelEvent, eventTargeting) && m_scrollController.handleWheelEvent(wheelEvent); 85 bool isInUserScroll = m_scrollController.isUserScrollInProgress(); 86 86 87 return WheelEventHandlingResult::handled(); 87 if (isInUserScroll != wasInUserScroll) 88 scrollingNode().setUserScrollInProgress(isInUserScroll); 89 90 return handled ? WheelEventHandlingResult::handled() : WheelEventHandlingResult::unhandled(); 88 91 } 89 92 -
trunk/Source/WebKit/ChangeLog
r285990 r285992 1 2021-11-18 Chris Lord <clord@igalia.com> 2 3 [GLIB] twitch.tv forces synchronous scrolling 4 https://bugs.webkit.org/show_bug.cgi?id=232376 5 <rdar://problem/85247010> 6 7 Reviewed by Simon Fraser. 8 9 Don't force synchronous wheel event delivery for scroll events when 10 a user scroll is in progress. 11 12 * WebProcess/WebPage/EventDispatcher.cpp: 13 (WebKit::EventDispatcher::wheelEvent): 14 1 15 2021-11-18 Kimmo Kinnunen <kkinnunen@apple.com> 2 16 -
trunk/Source/WebKit/WebProcess/WebPage/EventDispatcher.cpp
r285953 r285992 49 49 #if ENABLE(SCROLLING_THREAD) 50 50 #include <WebCore/ScrollingThread.h> 51 #include <WebCore/ScrollingTreeNode.h> 51 52 #include <WebCore/ThreadedScrollingTree.h> 52 53 #endif … … 126 127 127 128 auto processingSteps = scrollingTree->determineWheelEventProcessing(platformWheelEvent); 129 bool useMainThreadForScrolling = processingSteps.contains(WheelEventProcessingSteps::MainThreadForScrolling); 130 131 #if !PLATFORM(COCOA) 132 // Deliver continuing scroll gestures directly to the scrolling thread. 133 if (platformWheelEvent.phase() == PlatformWheelEventPhase::Changed && scrollingTree->isUserScrollInProgressAtEventLocation(platformWheelEvent)) 134 useMainThreadForScrolling = false; 135 #endif 128 136 129 137 scrollingTree->willProcessWheelEvent(); 130 138 131 ScrollingThread::dispatch([scrollingTree, wheelEvent, platformWheelEvent, processingSteps, pageID, protectedThis = Ref { *this }] {132 if ( processingSteps.contains(WheelEventProcessingSteps::MainThreadForScrolling)) {139 ScrollingThread::dispatch([scrollingTree, wheelEvent, platformWheelEvent, processingSteps, useMainThreadForScrolling, pageID, protectedThis = Ref { *this }] { 140 if (useMainThreadForScrolling) { 133 141 scrollingTree->willSendEventToMainThread(platformWheelEvent); 134 142 protectedThis->dispatchWheelEventViaMainThread(pageID, wheelEvent, processingSteps); … … 136 144 return; 137 145 } 138 146 139 147 auto result = scrollingTree->handleWheelEvent(platformWheelEvent, processingSteps); 140 148
Note:
See TracChangeset
for help on using the changeset viewer.