Changeset 162736 in webkit
- Timestamp:
- Jan 24, 2014 4:04:18 PM (10 years ago)
- Location:
- trunk/Source
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r162735 r162736 1 2014-01-24 Simon Fraser <simon.fraser@apple.com> 2 3 Prepare scrolling tree to handle > 1 scrolling node 4 https://bugs.webkit.org/show_bug.cgi?id=127590 5 6 Reviewed by Tim Horton. 7 8 Clean up the code path called after the ScrollingTree has scrolled a node, 9 to prepare for multiple scrolling nodes. 10 11 Change "updateMainFrameScrollPosition" terminology to "updateScrollPositionAfterAsyncScroll", 12 and pass along the ScrollingNodeID that scrolled. 13 14 Move updateMainFrameScrollPosition-related code from ScrollingCoordinator to 15 AsyncScrollingCoordinator, since this sync-up is only necessary when doing 16 async scrolling. 17 18 * WebCore.exp.in: 19 * page/scrolling/AsyncScrollingCoordinator.cpp: 20 (WebCore::AsyncScrollingCoordinator::AsyncScrollingCoordinator): 21 (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate): 22 (WebCore::AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll): 23 (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScrollTimerFired): 24 (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll): 25 * page/scrolling/AsyncScrollingCoordinator.h: 26 (WebCore::AsyncScrollingCoordinator::ScheduledScrollUpdate::ScheduledScrollUpdate): 27 (WebCore::AsyncScrollingCoordinator::ScheduledScrollUpdate::matchesUpdateType): 28 Package up the data related to a scheduled scroll into a ScheduledScrollUpdate struct, 29 for easier comparison and cleaner code. 30 * page/scrolling/ScrollingCoordinator.cpp: 31 (WebCore::ScrollingCoordinator::ScrollingCoordinator): 32 * page/scrolling/ScrollingCoordinator.h: 33 * page/scrolling/ScrollingTree.h: 34 * page/scrolling/ThreadedScrollingTree.cpp: 35 (WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll): 36 * page/scrolling/ThreadedScrollingTree.h: 37 * page/scrolling/ios/ScrollingTreeIOS.cpp: 38 (WebCore::ScrollingTreeIOS::scrollingTreeNodeDidScroll): 39 * page/scrolling/ios/ScrollingTreeIOS.h: 40 * page/scrolling/ios/ScrollingTreeScrollingNodeIOS.mm: 41 (WebCore::ScrollingTreeScrollingNodeIOS::setScrollPositionWithoutContentEdgeConstraints): 42 * page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm: 43 (WebCore::ScrollingTreeScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints): 44 1 45 2014-01-24 Mark Lam <mark.lam@apple.com> 2 46 -
trunk/Source/WebCore/WebCore.exp.in
r162725 r162736 2993 2993 __ZN7WebCore23ScrollingTreeStickyNode6createERNS_13ScrollingTreeEy 2994 2994 __ZN7WebCore24ScrollingStateStickyNode17updateConstraintsERKNS_33StickyPositionViewportConstraintsE 2995 __ZN7WebCore20ScrollingCoordinator35scheduleUpdateScrollPositionForNodeEyRKNS_8IntPointEbNS_31SetOrSyncScrollingLayerPositionE2996 2995 __ZN7WebCore25AsyncScrollingCoordinator14clearStateTreeEv 2997 2996 __ZN7WebCore25AsyncScrollingCoordinator17attachToStateTreeENS_17ScrollingNodeTypeEyy … … 3007 3006 __ZN7WebCore25AsyncScrollingCoordinator37scrollableAreaScrollbarLayerDidChangeEPNS_14ScrollableAreaENS_20ScrollbarOrientationE 3008 3007 __ZN7WebCore25AsyncScrollingCoordinator43recomputeWheelEventHandlerCountForFrameViewEPNS_9FrameViewE 3008 __ZN7WebCore25AsyncScrollingCoordinator44scheduleUpdateScrollPositionAfterAsyncScrollEyRKNS_8IntPointEbNS_31SetOrSyncScrollingLayerPositionE 3009 3009 __ZN7WebCore25AsyncScrollingCoordinatorC2EPNS_4PageE 3010 3010 __ZN7WebCore25AsyncScrollingCoordinatorD2Ev -
trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp
r161306 r162736 44 44 AsyncScrollingCoordinator::AsyncScrollingCoordinator(Page* page) 45 45 : ScrollingCoordinator(page) 46 , m_updateNodeScrollPositionTimer(this, &AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScrollTimerFired) 46 47 , m_scrollingStateTree(ScrollingStateTree::create(this)) 47 48 { … … 136 137 137 138 if (frameView->inProgrammaticScroll() || frameView->frame().document()->inPageCache()) 138 update MainFrameScrollPosition(scrollPosition, frameView->inProgrammaticScroll(), SetScrollingLayerPosition);139 updateScrollPositionAfterAsyncScroll(frameView->scrollLayerID(), scrollPosition, frameView->inProgrammaticScroll(), SetScrollingLayerPosition); 139 140 140 141 // If this frame view's document is being put into the page cache, we don't want to update our … … 149 150 stateNode->setRequestedScrollPosition(scrollPosition, frameView->inProgrammaticScroll()); 150 151 return true; 152 } 153 154 void AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll(ScrollingNodeID nodeID, const IntPoint& scrollPosition, bool programmaticScroll, SetOrSyncScrollingLayerPosition scrollingLayerPositionAction) 155 { 156 ScheduledScrollUpdate scrollUpdate(nodeID, scrollPosition, programmaticScroll, scrollingLayerPositionAction); 157 158 if (m_updateNodeScrollPositionTimer.isActive()) { 159 if (m_scheduledScrollUpdate.matchesUpdateType(scrollUpdate)) { 160 m_scheduledScrollUpdate.scrollPosition = scrollPosition; 161 return; 162 } 163 164 // If the parameters don't match what was previosly scheduled, dispatch immediately. 165 m_updateNodeScrollPositionTimer.stop(); 166 updateScrollPositionAfterAsyncScroll(m_scheduledScrollUpdate.nodeID, m_scheduledScrollUpdate.scrollPosition, m_scheduledScrollUpdate.isProgrammaticScroll, m_scheduledScrollUpdate.updateLayerPositionAction); 167 updateScrollPositionAfterAsyncScroll(nodeID, scrollPosition, programmaticScroll, scrollingLayerPositionAction); 168 return; 169 } 170 171 m_scheduledScrollUpdate = scrollUpdate; 172 m_updateNodeScrollPositionTimer.startOneShot(0); 173 } 174 175 void AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScrollTimerFired(Timer<AsyncScrollingCoordinator>*) 176 { 177 updateScrollPositionAfterAsyncScroll(m_scheduledScrollUpdate.nodeID, m_scheduledScrollUpdate.scrollPosition, m_scheduledScrollUpdate.isProgrammaticScroll, m_scheduledScrollUpdate.updateLayerPositionAction); 178 } 179 180 void AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll(ScrollingNodeID scrollingNodeID, const IntPoint& scrollPosition, bool programmaticScroll, SetOrSyncScrollingLayerPosition scrollingLayerPositionAction) 181 { 182 ASSERT(isMainThread()); 183 184 if (!m_page) 185 return; 186 187 FrameView* frameView = m_page->mainFrame().view(); 188 if (!frameView) 189 return; 190 191 bool oldProgrammaticScroll = frameView->inProgrammaticScroll(); 192 frameView->setInProgrammaticScroll(programmaticScroll); 193 194 frameView->setConstrainsScrollingToContentEdge(false); 195 frameView->notifyScrollPositionChanged(scrollPosition); 196 frameView->setConstrainsScrollingToContentEdge(true); 197 198 frameView->setInProgrammaticScroll(oldProgrammaticScroll); 199 200 #if USE(ACCELERATED_COMPOSITING) 201 if (scrollingNodeID == frameView->scrollLayerID()) { 202 if (GraphicsLayer* scrollLayer = scrollLayerForFrameView(frameView)) { 203 GraphicsLayer* counterScrollingLayer = counterScrollingLayerForFrameView(frameView); 204 GraphicsLayer* headerLayer = headerLayerForFrameView(frameView); 205 GraphicsLayer* footerLayer = footerLayerForFrameView(frameView); 206 IntSize scrollOffsetForFixed = frameView->scrollOffsetForFixedPosition(); 207 208 if (programmaticScroll || scrollingLayerPositionAction == SetScrollingLayerPosition) { 209 scrollLayer->setPosition(-frameView->scrollPosition()); 210 if (counterScrollingLayer) 211 counterScrollingLayer->setPosition(IntPoint(scrollOffsetForFixed)); 212 if (headerLayer) 213 headerLayer->setPosition(FloatPoint(scrollOffsetForFixed.width(), 0)); 214 if (footerLayer) 215 footerLayer->setPosition(FloatPoint(scrollOffsetForFixed.width(), frameView->totalContentsSize().height() - frameView->footerHeight())); 216 } else { 217 scrollLayer->syncPosition(-frameView->scrollPosition()); 218 if (counterScrollingLayer) 219 counterScrollingLayer->syncPosition(IntPoint(scrollOffsetForFixed)); 220 if (headerLayer) 221 headerLayer->syncPosition(FloatPoint(scrollOffsetForFixed.width(), 0)); 222 if (footerLayer) 223 footerLayer->syncPosition(FloatPoint(scrollOffsetForFixed.width(), frameView->totalContentsSize().height() - frameView->footerHeight())); 224 225 LayoutRect viewportRect = frameView->viewportConstrainedVisibleContentRect(); 226 syncChildPositions(viewportRect); 227 } 228 } 229 } 230 // FIXME: handle non-main scrolling nodes. 231 #else 232 UNUSED_PARAM(scrollingLayerPositionAction); 233 #endif 151 234 } 152 235 -
trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h
r162139 r162736 32 32 33 33 #include "ScrollingTree.h" 34 #include "Timer.h" 34 35 #include <wtf/OwnPtr.h> 35 36 #include <wtf/PassRefPtr.h> … … 57 58 void scrollingStateTreePropertiesChanged(); 58 59 60 void scheduleUpdateScrollPositionAfterAsyncScroll(ScrollingNodeID, const IntPoint&, bool programmaticScroll, SetOrSyncScrollingLayerPosition); 61 59 62 protected: 60 63 AsyncScrollingCoordinator(Page*); … … 65 68 66 69 PassRefPtr<ScrollingTree> releaseScrollingTree() { return m_scrollingTree.release(); } 70 71 void updateScrollPositionAfterAsyncScroll(ScrollingNodeID, const IntPoint&, bool programmaticScroll, SetOrSyncScrollingLayerPosition); 67 72 68 73 private: … … 108 113 void setScrollbarPaintersFromScrollbarsForNode(Scrollbar* verticalScrollbar, Scrollbar* horizontalScrollbar, ScrollingStateScrollingNode*); 109 114 115 void updateScrollPositionAfterAsyncScrollTimerFired(Timer<AsyncScrollingCoordinator>*); 116 117 Timer<AsyncScrollingCoordinator> m_updateNodeScrollPositionTimer; 118 119 struct ScheduledScrollUpdate { 120 ScheduledScrollUpdate() 121 : nodeID(0) 122 , isProgrammaticScroll(false) 123 , updateLayerPositionAction(SyncScrollingLayerPosition) 124 { } 125 126 ScheduledScrollUpdate(ScrollingNodeID scrollingNodeID, IntPoint point, bool isProgrammatic, SetOrSyncScrollingLayerPosition udpateAction) 127 : nodeID(scrollingNodeID) 128 , scrollPosition(point) 129 , isProgrammaticScroll(isProgrammatic) 130 , updateLayerPositionAction(udpateAction) 131 { } 132 133 ScrollingNodeID nodeID; 134 IntPoint scrollPosition; 135 bool isProgrammaticScroll; 136 SetOrSyncScrollingLayerPosition updateLayerPositionAction; 137 138 bool matchesUpdateType(const ScheduledScrollUpdate& other) const 139 { 140 return nodeID == other.nodeID 141 && isProgrammaticScroll == other.isProgrammaticScroll 142 && updateLayerPositionAction == other.updateLayerPositionAction; 143 } 144 }; 145 146 ScheduledScrollUpdate m_scheduledScrollUpdate; 147 110 148 OwnPtr<ScrollingStateTree> m_scrollingStateTree; 111 149 RefPtr<ScrollingTree> m_scrollingTree; -
trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp
r161662 r162736 65 65 ScrollingCoordinator::ScrollingCoordinator(Page* page) 66 66 : m_page(page) 67 , m_updateMainFrameScrollPositionTimer(this, &ScrollingCoordinator::updateMainFrameScrollPositionTimerFired)68 , m_scheduledUpdateIsProgrammaticScroll(false)69 , m_scheduledScrollingLayerPositionAction(SyncScrollingLayerPosition)70 67 , m_forceSynchronousScrollLayerPositionUpdates(false) 71 68 { … … 259 256 recomputeWheelEventHandlerCountForFrameView(frameView); 260 257 updateSynchronousScrollingReasons(); 261 }262 263 void ScrollingCoordinator::scheduleUpdateScrollPositionForNode(ScrollingNodeID, const IntPoint& scrollPosition, bool programmaticScroll, SetOrSyncScrollingLayerPosition scrollingLayerPositionAction)264 {265 // FIXME: need to handle non-main nodes.266 scheduleUpdateMainFrameScrollPosition(scrollPosition, programmaticScroll, scrollingLayerPositionAction);267 }268 269 void ScrollingCoordinator::scheduleUpdateMainFrameScrollPosition(const IntPoint& scrollPosition, bool programmaticScroll, SetOrSyncScrollingLayerPosition scrollingLayerPositionAction)270 {271 if (m_updateMainFrameScrollPositionTimer.isActive()) {272 if (m_scheduledUpdateIsProgrammaticScroll == programmaticScroll273 && m_scheduledScrollingLayerPositionAction == scrollingLayerPositionAction) {274 m_scheduledUpdateScrollPosition = scrollPosition;275 return;276 }277 278 // If the parameters don't match what was previosly scheduled, dispatch immediately.279 m_updateMainFrameScrollPositionTimer.stop();280 updateMainFrameScrollPosition(m_scheduledUpdateScrollPosition, m_scheduledUpdateIsProgrammaticScroll, m_scheduledScrollingLayerPositionAction);281 updateMainFrameScrollPosition(scrollPosition, programmaticScroll, scrollingLayerPositionAction);282 return;283 }284 285 m_scheduledUpdateScrollPosition = scrollPosition;286 m_scheduledUpdateIsProgrammaticScroll = programmaticScroll;287 m_scheduledScrollingLayerPositionAction = scrollingLayerPositionAction;288 m_updateMainFrameScrollPositionTimer.startOneShot(0);289 }290 291 void ScrollingCoordinator::updateMainFrameScrollPositionTimerFired(Timer<ScrollingCoordinator>*)292 {293 updateMainFrameScrollPosition(m_scheduledUpdateScrollPosition, m_scheduledUpdateIsProgrammaticScroll, m_scheduledScrollingLayerPositionAction);294 }295 296 void ScrollingCoordinator::updateMainFrameScrollPosition(const IntPoint& scrollPosition, bool programmaticScroll, SetOrSyncScrollingLayerPosition scrollingLayerPositionAction)297 {298 ASSERT(isMainThread());299 300 if (!m_page)301 return;302 303 FrameView* frameView = m_page->mainFrame().view();304 if (!frameView)305 return;306 307 bool oldProgrammaticScroll = frameView->inProgrammaticScroll();308 frameView->setInProgrammaticScroll(programmaticScroll);309 310 frameView->setConstrainsScrollingToContentEdge(false);311 frameView->notifyScrollPositionChanged(scrollPosition);312 frameView->setConstrainsScrollingToContentEdge(true);313 314 frameView->setInProgrammaticScroll(oldProgrammaticScroll);315 316 #if USE(ACCELERATED_COMPOSITING)317 if (GraphicsLayer* scrollLayer = scrollLayerForFrameView(frameView)) {318 GraphicsLayer* counterScrollingLayer = counterScrollingLayerForFrameView(frameView);319 GraphicsLayer* headerLayer = headerLayerForFrameView(frameView);320 GraphicsLayer* footerLayer = footerLayerForFrameView(frameView);321 IntSize scrollOffsetForFixed = frameView->scrollOffsetForFixedPosition();322 323 if (programmaticScroll || scrollingLayerPositionAction == SetScrollingLayerPosition) {324 scrollLayer->setPosition(-frameView->scrollPosition());325 if (counterScrollingLayer)326 counterScrollingLayer->setPosition(IntPoint(scrollOffsetForFixed));327 if (headerLayer)328 headerLayer->setPosition(FloatPoint(scrollOffsetForFixed.width(), 0));329 if (footerLayer)330 footerLayer->setPosition(FloatPoint(scrollOffsetForFixed.width(), frameView->totalContentsSize().height() - frameView->footerHeight()));331 } else {332 scrollLayer->syncPosition(-frameView->scrollPosition());333 if (counterScrollingLayer)334 counterScrollingLayer->syncPosition(IntPoint(scrollOffsetForFixed));335 if (headerLayer)336 headerLayer->syncPosition(FloatPoint(scrollOffsetForFixed.width(), 0));337 if (footerLayer)338 footerLayer->syncPosition(FloatPoint(scrollOffsetForFixed.width(), frameView->totalContentsSize().height() - frameView->footerHeight()));339 340 LayoutRect viewportRect = frameView->viewportConstrainedVisibleContentRect();341 syncChildPositions(viewportRect);342 }343 }344 #else345 UNUSED_PARAM(scrollingLayerPositionAction);346 #endif347 258 } 348 259 -
trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h
r161373 r162736 32 32 #include "RenderObject.h" 33 33 #include "ScrollTypes.h" 34 #include "Timer.h"35 34 #include <wtf/Forward.h> 36 35 … … 160 159 ScrollingNodeID uniqueScrollLayerID(); 161 160 162 void scheduleUpdateScrollPositionForNode(ScrollingNodeID, const IntPoint&, bool programmaticScroll, SetOrSyncScrollingLayerPosition);163 164 // Dispatched by the scrolling tree whenever the main frame scroll position changes.165 void scheduleUpdateMainFrameScrollPosition(const IntPoint&, bool programmaticScroll, SetOrSyncScrollingLayerPosition);166 void updateMainFrameScrollPosition(const IntPoint&, bool programmaticScroll, SetOrSyncScrollingLayerPosition);167 168 161 enum MainThreadScrollingReasonFlags { 169 162 ForcedOnMainThread = 1 << 0, … … 211 204 void updateSynchronousScrollingReasons(); 212 205 213 void updateMainFrameScrollPositionTimerFired(Timer<ScrollingCoordinator>*);214 215 Timer<ScrollingCoordinator> m_updateMainFrameScrollPositionTimer;216 IntPoint m_scheduledUpdateScrollPosition;217 bool m_scheduledUpdateIsProgrammaticScroll;218 SetOrSyncScrollingLayerPosition m_scheduledScrollingLayerPositionAction;219 220 206 bool m_forceSynchronousScrollLayerPositionUpdates; 221 207 }; -
trunk/Source/WebCore/page/scrolling/ScrollingTree.h
r162731 r162736 72 72 void setMainFramePinState(bool pinnedToTheLeft, bool pinnedToTheRight, bool pinnedToTheTop, bool pinnedToTheBottom); 73 73 74 virtual void updateMainFrameScrollPosition(const IntPoint& scrollPosition, SetOrSyncScrollingLayerPosition = SyncScrollingLayerPosition) = 0;74 virtual void scrollingTreeNodeDidScroll(ScrollingNodeID, const IntPoint& scrollPosition, SetOrSyncScrollingLayerPosition = SyncScrollingLayerPosition) = 0; 75 75 IntPoint mainFrameScrollPosition(); 76 76 -
trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp
r162731 r162736 101 101 } 102 102 103 void ThreadedScrollingTree:: updateMainFrameScrollPosition(const IntPoint& scrollPosition, SetOrSyncScrollingLayerPosition scrollingLayerPositionAction)103 void ThreadedScrollingTree::scrollingTreeNodeDidScroll(ScrollingNodeID nodeID, const IntPoint& scrollPosition, SetOrSyncScrollingLayerPosition scrollingLayerPositionAction) 104 104 { 105 105 if (!m_scrollingCoordinator) 106 106 return; 107 107 108 setMainFrameScrollPosition(scrollPosition); 108 if (nodeID == rootNode()->scrollingNodeID()) 109 setMainFrameScrollPosition(scrollPosition); 109 110 110 callOnMainThread(bind(& ScrollingCoordinator::scheduleUpdateMainFrameScrollPosition, m_scrollingCoordinator.get(), scrollPosition, isHandlingProgrammaticScroll(), scrollingLayerPositionAction));111 callOnMainThread(bind(&AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll, m_scrollingCoordinator.get(), nodeID, scrollPosition, isHandlingProgrammaticScroll(), scrollingLayerPositionAction)); 111 112 } 112 113 -
trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.h
r162731 r162736 65 65 virtual PassOwnPtr<ScrollingTreeNode> createNode(ScrollingNodeType, ScrollingNodeID) override; 66 66 67 virtual void updateMainFrameScrollPosition(const IntPoint& scrollPosition, SetOrSyncScrollingLayerPosition = SyncScrollingLayerPosition) override;67 virtual void scrollingTreeNodeDidScroll(ScrollingNodeID, const IntPoint& scrollPosition, SetOrSyncScrollingLayerPosition = SyncScrollingLayerPosition) override; 68 68 #if PLATFORM(MAC) && !PLATFORM(IOS) 69 69 virtual void handleWheelEventPhase(PlatformWheelEventPhase) override; -
trunk/Source/WebCore/page/scrolling/ios/ScrollingTreeIOS.cpp
r161610 r162736 82 82 } 83 83 84 void ScrollingTreeIOS:: updateMainFrameScrollPosition(const IntPoint& scrollPosition, SetOrSyncScrollingLayerPosition scrollingLayerPositionAction)84 void ScrollingTreeIOS::scrollingTreeNodeDidScroll(ScrollingNodeID nodeID, const IntPoint& scrollPosition, SetOrSyncScrollingLayerPosition scrollingLayerPositionAction) 85 85 { 86 86 if (!m_scrollingCoordinator) 87 87 return; 88 88 89 setMainFrameScrollPosition(scrollPosition); 89 if (nodeID == rootNode()->scrollingNodeID()) 90 setMainFrameScrollPosition(scrollPosition); 90 91 91 callOnMainThread(bind(& ScrollingCoordinator::scheduleUpdateMainFrameScrollPosition, m_scrollingCoordinator.get(), scrollPosition, isHandlingProgrammaticScroll(), scrollingLayerPositionAction));92 callOnMainThread(bind(&AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll, m_scrollingCoordinator.get(), nodeID, scrollPosition, isHandlingProgrammaticScroll(), scrollingLayerPositionAction)); 92 93 } 93 94 -
trunk/Source/WebCore/page/scrolling/ios/ScrollingTreeIOS.h
r162731 r162736 57 57 virtual PassOwnPtr<ScrollingTreeNode> createNode(ScrollingNodeType, ScrollingNodeID) override; 58 58 59 virtual void updateMainFrameScrollPosition(const IntPoint& scrollPosition, SetOrSyncScrollingLayerPosition = SyncScrollingLayerPosition) override;59 virtual void scrollingTreeNodeDidScroll(ScrollingNodeID, const IntPoint& scrollPosition, SetOrSyncScrollingLayerPosition = SyncScrollingLayerPosition) override; 60 60 61 61 RefPtr<AsyncScrollingCoordinator> m_scrollingCoordinator; -
trunk/Source/WebCore/page/scrolling/ios/ScrollingTreeScrollingNodeIOS.mm
r161610 r162736 119 119 if (shouldUpdateScrollLayerPositionSynchronously()) { 120 120 m_probableMainThreadScrollPosition = scrollPosition; 121 scrollingTree(). updateMainFrameScrollPosition(scrollPosition, SetScrollingLayerPosition);121 scrollingTree().scrollingTreeNodeDidScroll(scrollingNodeID(), scrollPosition, SetScrollingLayerPosition); 122 122 return; 123 123 } 124 124 125 125 setScrollLayerPosition(scrollPosition); 126 scrollingTree(). updateMainFrameScrollPosition(scrollPosition);126 scrollingTree().scrollingTreeNodeDidScroll(scrollingNodeID(), scrollPosition); 127 127 } 128 128 -
trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm
r161303 r162736 316 316 if (shouldUpdateScrollLayerPositionSynchronously()) { 317 317 m_probableMainThreadScrollPosition = scrollPosition; 318 scrollingTree(). updateMainFrameScrollPosition(scrollPosition, SetScrollingLayerPosition);318 scrollingTree().scrollingTreeNodeDidScroll(scrollingNodeID(), scrollPosition, SetScrollingLayerPosition); 319 319 return; 320 320 } 321 321 322 322 setScrollLayerPosition(scrollPosition); 323 scrollingTree(). updateMainFrameScrollPosition(scrollPosition);323 scrollingTree().scrollingTreeNodeDidScroll(scrollingNodeID(), scrollPosition); 324 324 } 325 325 -
trunk/Source/WebKit2/ChangeLog
r162731 r162736 1 2014-01-24 Simon Fraser <simon.fraser@apple.com> 2 3 Prepare scrolling tree to handle > 1 scrolling node 4 https://bugs.webkit.org/show_bug.cgi?id=127590 5 6 Reviewed by Tim Horton. 7 8 Clean up the code path called after the ScrollingTree has scrolled a node, 9 to prepare for multiple scrolling nodes. 10 11 Change "updateMainFrameScrollPosition" terminology to "updateScrollPositionAfterAsyncScroll", 12 and pass along the ScrollingNodeID that scrolled. 13 14 * UIProcess/Scrolling/RemoteScrollingTree.cpp: 15 (WebKit::RemoteScrollingTree::scrollingTreeNodeDidScroll): 16 * UIProcess/Scrolling/RemoteScrollingTree.h: 17 * WebProcess/Scrolling/RemoteScrollingCoordinator.mm: 18 (WebKit::RemoteScrollingCoordinator::scrollPositionChangedForNode): 19 1 20 2014-01-24 Simon Fraser <simon.fraser@apple.com> 2 21 -
trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingTree.cpp
r162731 r162736 77 77 #endif 78 78 79 void RemoteScrollingTree:: updateMainFrameScrollPosition(const IntPoint& scrollPosition, SetOrSyncScrollingLayerPosition)79 void RemoteScrollingTree::scrollingTreeNodeDidScroll(ScrollingNodeID nodeID, const IntPoint& scrollPosition, SetOrSyncScrollingLayerPosition) 80 80 { 81 // FIXME: fix for all scrolling nodes. 82 m_scrollingCoordinatorProxy.scrollPositionChanged(rootNode()->scrollingNodeID(), scrollPosition); 81 m_scrollingCoordinatorProxy.scrollPositionChanged(nodeID, scrollPosition); 83 82 } 84 83 -
trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingTree.h
r162731 r162736 53 53 virtual void handleWheelEventPhase(WebCore::PlatformWheelEventPhase) override; 54 54 #endif 55 virtual void updateMainFrameScrollPosition(const WebCore::IntPoint& scrollPosition, WebCore::SetOrSyncScrollingLayerPosition = WebCore::SyncScrollingLayerPosition) override;55 virtual void scrollingTreeNodeDidScroll(WebCore::ScrollingNodeID, const WebCore::IntPoint& scrollPosition, WebCore::SetOrSyncScrollingLayerPosition = WebCore::SyncScrollingLayerPosition) override; 56 56 57 57 virtual PassOwnPtr<WebCore::ScrollingTreeNode> createNode(WebCore::ScrollingNodeType, WebCore::ScrollingNodeID); -
trunk/Source/WebKit2/WebProcess/Scrolling/RemoteScrollingCoordinator.mm
r161529 r162736 94 94 void RemoteScrollingCoordinator::scrollPositionChangedForNode(ScrollingNodeID nodeID, const FloatPoint& scrollPosition) 95 95 { 96 scheduleUpdateScrollPosition ForNode(nodeID, roundedIntPoint(scrollPosition), false /* FIXME */, SyncScrollingLayerPosition);96 scheduleUpdateScrollPositionAfterAsyncScroll(nodeID, roundedIntPoint(scrollPosition), false /* FIXME */, SyncScrollingLayerPosition); 97 97 } 98 98
Note: See TracChangeset
for help on using the changeset viewer.