Changeset 182132 in webkit
- Timestamp:
- Mar 29, 2015, 9:13:45 PM (10 years ago)
- Location:
- trunk/Source
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r182131 r182132 1 2015-03-29 Simon Fraser <simon.fraser@apple.com> 2 3 Convert arguments to ScrollingCoordinator functions to references 4 https://bugs.webkit.org/show_bug.cgi?id=143198 5 6 Reviewed by Darin Adler. 7 8 Convert all the FrameView* and ScrollableArea* arguments to ScrollingCoordinator functions to 9 references, and use references in a few other places. 10 11 * dom/Document.cpp: 12 (WebCore::wheelEventHandlerCountChanged): 13 * loader/HistoryController.cpp: 14 (WebCore::HistoryController::restoreScrollPositionAndViewState): 15 * page/DebugPageOverlays.cpp: 16 (WebCore::NonFastScrollableRegionOverlay::updateRegion): 17 * page/Frame.cpp: 18 (WebCore::Frame::willDetachPage): 19 * page/FrameView.cpp: 20 (WebCore::FrameView::prepareForDetach): 21 (WebCore::FrameView::addSlowRepaintObject): 22 (WebCore::FrameView::removeSlowRepaintObject): 23 (WebCore::FrameView::addViewportConstrainedObject): 24 (WebCore::FrameView::removeViewportConstrainedObject): 25 (WebCore::FrameView::requestScrollPositionUpdate): 26 (WebCore::FrameView::performPostLayoutTasks): 27 (WebCore::FrameView::scrollableAreaSetChanged): 28 (WebCore::FrameView::wheelEvent): 29 * page/Page.cpp: 30 (WebCore::Page::nonFastScrollableRects): 31 * page/Page.h: 32 * page/scrolling/AsyncScrollingCoordinator.cpp: 33 (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated): 34 (WebCore::AsyncScrollingCoordinator::frameViewNonFastScrollableRegionChanged): 35 (WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange): 36 (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate): 37 (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll): 38 (WebCore::AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange): 39 (WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView): 40 (WebCore::AsyncScrollingCoordinator::updateMainFrameScrollLayerPosition): 41 (WebCore::AsyncScrollingCoordinator::recomputeWheelEventHandlerCountForFrameView): 42 * page/scrolling/AsyncScrollingCoordinator.h: 43 * page/scrolling/ScrollingCoordinator.cpp: 44 (WebCore::ScrollingCoordinator::pageDestroyed): 45 (WebCore::ScrollingCoordinator::coordinatesScrollingForFrameView): 46 (WebCore::ScrollingCoordinator::computeNonFastScrollableRegion): 47 (WebCore::ScrollingCoordinator::frameViewWheelEventHandlerCountChanged): 48 (WebCore::ScrollingCoordinator::frameViewHasSlowRepaintObjectsDidChange): 49 (WebCore::ScrollingCoordinator::frameViewFixedObjectsDidChange): 50 (WebCore::ScrollingCoordinator::scrollLayerForScrollableArea): 51 (WebCore::ScrollingCoordinator::scrollLayerForFrameView): 52 (WebCore::ScrollingCoordinator::headerLayerForFrameView): 53 (WebCore::ScrollingCoordinator::footerLayerForFrameView): 54 (WebCore::ScrollingCoordinator::counterScrollingLayerForFrameView): 55 (WebCore::ScrollingCoordinator::insetClipLayerForFrameView): 56 (WebCore::ScrollingCoordinator::contentShadowLayerForFrameView): 57 (WebCore::ScrollingCoordinator::rootContentLayerForFrameView): 58 (WebCore::ScrollingCoordinator::frameViewRootLayerDidChange): 59 (WebCore::ScrollingCoordinator::hasVisibleSlowRepaintViewportConstrainedObjects): 60 (WebCore::ScrollingCoordinator::synchronousScrollingReasons): 61 (WebCore::ScrollingCoordinator::updateSynchronousScrollingReasons): 62 (WebCore::ScrollingCoordinator::setForceSynchronousScrollLayerPositionUpdates): 63 (WebCore::ScrollingCoordinator::shouldUpdateScrollLayerPositionSynchronously): 64 (WebCore::ScrollingCoordinator::replaySessionStateDidChange): 65 (WebCore::ScrollingCoordinator::synchronousScrollingReasonsAsText): 66 * page/scrolling/ScrollingCoordinator.h: Align the bitmask enums to make mistakes easier to spot. 67 (WebCore::ScrollingCoordinator::frameViewLayoutUpdated): 68 (WebCore::ScrollingCoordinator::frameViewNonFastScrollableRegionChanged): 69 (WebCore::ScrollingCoordinator::requestScrollPositionUpdate): 70 (WebCore::ScrollingCoordinator::handleWheelEvent): 71 (WebCore::ScrollingCoordinator::willDestroyScrollableArea): 72 (WebCore::ScrollingCoordinator::scrollableAreaScrollLayerDidChange): 73 (WebCore::ScrollingCoordinator::scrollableAreaScrollbarLayerDidChange): 74 (WebCore::ScrollingCoordinator::recomputeWheelEventHandlerCountForFrameView): 75 * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp: 76 (WebCore::ScrollingCoordinatorCoordinatedGraphics::scrollableAreaScrollLayerDidChange): 77 (WebCore::ScrollingCoordinatorCoordinatedGraphics::willDestroyScrollableArea): 78 (WebCore::ScrollingCoordinatorCoordinatedGraphics::requestScrollPositionUpdate): 79 * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h: 80 * page/scrolling/ios/ScrollingCoordinatorIOS.h: 81 * page/scrolling/mac/ScrollingCoordinatorMac.h: 82 * page/scrolling/mac/ScrollingCoordinatorMac.mm: 83 (WebCore::ScrollingCoordinatorMac::handleWheelEvent): 84 * rendering/RenderLayer.cpp: 85 (WebCore::RenderLayer::~RenderLayer): 86 * rendering/RenderLayerBacking.cpp: 87 (WebCore::RenderLayerBacking::updateOverflowControlsLayers): 88 * rendering/RenderLayerCompositor.cpp: 89 (WebCore::RenderLayerCompositor::updateBacking): 90 (WebCore::RenderLayerCompositor::hasCoordinatedScrolling): 91 (WebCore::RenderLayerCompositor::scrollingLayerDidChange): 92 (WebCore::RenderLayerCompositor::updateLayerForHeader): 93 (WebCore::RenderLayerCompositor::updateLayerForFooter): 94 (WebCore::RenderLayerCompositor::updateOverflowControlsLayers): 95 (WebCore::RenderLayerCompositor::destroyRootLayer): 96 (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame): 97 (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): 98 (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking): 99 (WebCore::RenderLayerCompositor::didAddScrollingLayer): 100 * testing/Internals.cpp: 101 (WebCore::Internals::nonFastScrollableRects): 102 1 103 2015-03-29 Benjamin Poulain <benjamin@webkit.org> 2 104 -
trunk/Source/WebCore/dom/Document.cpp
r182022 r182132 5996 5996 5997 5997 // FIXME: Why doesn't this need to be called in didBecomeCurrentDocumentInFrame? 5998 scrollingCoordinator->frameViewWheelEventHandlerCountChanged( frameView);5998 scrollingCoordinator->frameViewWheelEventHandlerCountChanged(*frameView); 5999 5999 } 6000 6000 -
trunk/Source/WebCore/loader/HistoryController.cpp
r179472 r182132 139 139 if (page && m_frame.isMainFrame()) { 140 140 if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator()) 141 scrollingCoordinator->frameViewRootLayerDidChange( view);141 scrollingCoordinator->frameViewRootLayerDidChange(*view); 142 142 } 143 143 } -
trunk/Source/WebCore/page/DebugPageOverlays.cpp
r181617 r182132 128 128 if (Page* page = m_frame.page()) { 129 129 if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator()) 130 *region = scrollingCoordinator->computeNonFastScrollableRegion( &m_frame, IntPoint());130 *region = scrollingCoordinator->computeNonFastScrollableRegion(m_frame, IntPoint()); 131 131 } 132 132 -
trunk/Source/WebCore/page/Frame.cpp
r180291 r182132 792 792 793 793 if (page() && page()->scrollingCoordinator() && m_view) 794 page()->scrollingCoordinator()->willDestroyScrollableArea( m_view.get());794 page()->scrollingCoordinator()->willDestroyScrollableArea(*m_view); 795 795 796 796 #if PLATFORM(IOS) -
trunk/Source/WebCore/page/FrameView.cpp
r182033 r182132 359 359 if (frame().page()) { 360 360 if (ScrollingCoordinator* scrollingCoordinator = frame().page()->scrollingCoordinator()) 361 scrollingCoordinator->willDestroyScrollableArea( this);361 scrollingCoordinator->willDestroyScrollableArea(*this); 362 362 } 363 363 } … … 1549 1549 if (Page* page = frame().page()) { 1550 1550 if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator()) 1551 scrollingCoordinator->frameViewHasSlowRepaintObjectsDidChange( this);1551 scrollingCoordinator->frameViewHasSlowRepaintObjectsDidChange(*this); 1552 1552 } 1553 1553 } … … 1566 1566 if (Page* page = frame().page()) { 1567 1567 if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator()) 1568 scrollingCoordinator->frameViewHasSlowRepaintObjectsDidChange( this);1568 scrollingCoordinator->frameViewHasSlowRepaintObjectsDidChange(*this); 1569 1569 } 1570 1570 } … … 1583 1583 if (Page* page = frame().page()) { 1584 1584 if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator()) 1585 scrollingCoordinator->frameViewFixedObjectsDidChange( this);1585 scrollingCoordinator->frameViewFixedObjectsDidChange(*this); 1586 1586 } 1587 1587 } … … 1593 1593 if (Page* page = frame().page()) { 1594 1594 if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator()) 1595 scrollingCoordinator->frameViewFixedObjectsDidChange( this);1595 scrollingCoordinator->frameViewFixedObjectsDidChange(*this); 1596 1596 } 1597 1597 … … 2231 2231 if (Page* page = frame().page()) { 2232 2232 if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator()) 2233 return scrollingCoordinator->requestScrollPositionUpdate( this, position);2233 return scrollingCoordinator->requestScrollPositionUpdate(*this, position); 2234 2234 } 2235 2235 #else … … 2964 2964 if (auto* page = frame().page()) { 2965 2965 if (auto* scrollingCoordinator = page->scrollingCoordinator()) 2966 scrollingCoordinator->frameViewLayoutUpdated( this);2966 scrollingCoordinator->frameViewLayoutUpdated(*this); 2967 2967 } 2968 2968 … … 4378 4378 if (auto* page = frame().page()) { 4379 4379 if (auto* scrollingCoordinator = page->scrollingCoordinator()) 4380 scrollingCoordinator->frameViewNonFastScrollableRegionChanged( this);4380 scrollingCoordinator->frameViewNonFastScrollableRegionChanged(*this); 4381 4381 } 4382 4382 } … … 4430 4430 if (Page* page = frame().page()) { 4431 4431 if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator()) { 4432 if (scrollingCoordinator->coordinatesScrollingForFrameView( this))4433 return scrollingCoordinator->handleWheelEvent( this, wheelEvent);4432 if (scrollingCoordinator->coordinatesScrollingForFrameView(*this)) 4433 return scrollingCoordinator->handleWheelEvent(*this, wheelEvent); 4434 4434 } 4435 4435 } -
trunk/Source/WebCore/page/Page.cpp
r181838 r182132 370 370 } 371 371 372 Ref<ClientRectList> Page::nonFastScrollableRects(const Frame *frame)372 Ref<ClientRectList> Page::nonFastScrollableRects(const Frame& frame) 373 373 { 374 374 if (Document* document = m_mainFrame->document()) -
trunk/Source/WebCore/page/Page.h
r182033 r182132 194 194 WEBCORE_EXPORT String scrollingStateTreeAsText(); 195 195 WEBCORE_EXPORT String synchronousScrollingReasonsAsText(); 196 WEBCORE_EXPORT Ref<ClientRectList> nonFastScrollableRects(const Frame *);196 WEBCORE_EXPORT Ref<ClientRectList> nonFastScrollableRects(const Frame&); 197 197 198 198 Settings& settings() const { return *m_settings; } -
trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp
r178597 r182132 74 74 } 75 75 76 void AsyncScrollingCoordinator::frameViewLayoutUpdated(FrameView *frameView)76 void AsyncScrollingCoordinator::frameViewLayoutUpdated(FrameView& frameView) 77 77 { 78 78 ASSERT(isMainThread()); … … 88 88 // In the future, we may want to have the ability to set non-fast scrolling regions for more than 89 89 // just the root node. But right now, this concept only applies to the root. 90 m_scrollingStateTree->rootStateNode()->setNonFastScrollableRegion(computeNonFastScrollableRegion( &m_page->mainFrame(), IntPoint()));90 m_scrollingStateTree->rootStateNode()->setNonFastScrollableRegion(computeNonFastScrollableRegion(m_page->mainFrame(), IntPoint())); 91 91 92 92 if (!coordinatesScrollingForFrameView(frameView)) 93 93 return; 94 94 95 ScrollingStateFrameScrollingNode* node = downcast<ScrollingStateFrameScrollingNode>(m_scrollingStateTree->stateNodeForID(frameView ->scrollLayerID()));95 ScrollingStateFrameScrollingNode* node = downcast<ScrollingStateFrameScrollingNode>(m_scrollingStateTree->stateNodeForID(frameView.scrollLayerID())); 96 96 if (!node) 97 97 return; 98 98 99 Scrollbar* verticalScrollbar = frameView ->verticalScrollbar();100 Scrollbar* horizontalScrollbar = frameView ->horizontalScrollbar();99 Scrollbar* verticalScrollbar = frameView.verticalScrollbar(); 100 Scrollbar* horizontalScrollbar = frameView.horizontalScrollbar(); 101 101 node->setScrollbarPaintersFromScrollbars(verticalScrollbar, horizontalScrollbar); 102 102 103 node->setFrameScaleFactor(frameView ->frame().frameScaleFactor());104 node->setHeaderHeight(frameView ->headerHeight());105 node->setFooterHeight(frameView ->footerHeight());106 node->setTopContentInset(frameView ->topContentInset());107 108 node->setScrollOrigin(frameView ->scrollOrigin());109 node->setScrollableAreaSize(frameView ->visibleContentRect().size());110 node->setTotalContentsSize(frameView ->totalContentsSize());111 node->setReachableContentsSize(frameView ->totalContentsSize());103 node->setFrameScaleFactor(frameView.frame().frameScaleFactor()); 104 node->setHeaderHeight(frameView.headerHeight()); 105 node->setFooterHeight(frameView.footerHeight()); 106 node->setTopContentInset(frameView.topContentInset()); 107 108 node->setScrollOrigin(frameView.scrollOrigin()); 109 node->setScrollableAreaSize(frameView.visibleContentRect().size()); 110 node->setTotalContentsSize(frameView.totalContentsSize()); 111 node->setReachableContentsSize(frameView.totalContentsSize()); 112 112 113 113 #if ENABLE(CSS_SCROLL_SNAP) 114 frameView ->updateSnapOffsets();115 if (const Vector<LayoutUnit>* horizontalSnapOffsets = frameView ->horizontalSnapOffsets())114 frameView.updateSnapOffsets(); 115 if (const Vector<LayoutUnit>* horizontalSnapOffsets = frameView.horizontalSnapOffsets()) 116 116 setStateScrollingNodeSnapOffsetsAsFloat(*node, ScrollEventAxis::Horizontal, *horizontalSnapOffsets, m_page->deviceScaleFactor()); 117 117 118 if (const Vector<LayoutUnit>* verticalSnapOffsets = frameView ->verticalSnapOffsets())118 if (const Vector<LayoutUnit>* verticalSnapOffsets = frameView.verticalSnapOffsets()) 119 119 setStateScrollingNodeSnapOffsetsAsFloat(*node, ScrollEventAxis::Vertical, *verticalSnapOffsets, m_page->deviceScaleFactor()); 120 120 #endif 121 121 122 122 ScrollableAreaParameters scrollParameters; 123 scrollParameters.horizontalScrollElasticity = frameView ->horizontalScrollElasticity();124 scrollParameters.verticalScrollElasticity = frameView ->verticalScrollElasticity();123 scrollParameters.horizontalScrollElasticity = frameView.horizontalScrollElasticity(); 124 scrollParameters.verticalScrollElasticity = frameView.verticalScrollElasticity(); 125 125 scrollParameters.hasEnabledHorizontalScrollbar = horizontalScrollbar && horizontalScrollbar->enabled(); 126 126 scrollParameters.hasEnabledVerticalScrollbar = verticalScrollbar && verticalScrollbar->enabled(); 127 scrollParameters.horizontalScrollbarMode = frameView ->horizontalScrollbarMode();128 scrollParameters.verticalScrollbarMode = frameView ->verticalScrollbarMode();127 scrollParameters.horizontalScrollbarMode = frameView.horizontalScrollbarMode(); 128 scrollParameters.verticalScrollbarMode = frameView.verticalScrollbarMode(); 129 129 130 130 node->setScrollableAreaParameters(scrollParameters); 131 131 } 132 132 133 void AsyncScrollingCoordinator::frameViewNonFastScrollableRegionChanged(FrameView *)133 void AsyncScrollingCoordinator::frameViewNonFastScrollableRegionChanged(FrameView&) 134 134 { 135 135 if (!m_scrollingStateTree->rootStateNode()) 136 136 return; 137 137 138 m_scrollingStateTree->rootStateNode()->setNonFastScrollableRegion(computeNonFastScrollableRegion( &m_page->mainFrame(), IntPoint()));139 } 140 141 void AsyncScrollingCoordinator::frameViewRootLayerDidChange(FrameView *frameView)138 m_scrollingStateTree->rootStateNode()->setNonFastScrollableRegion(computeNonFastScrollableRegion(m_page->mainFrame(), IntPoint())); 139 } 140 141 void AsyncScrollingCoordinator::frameViewRootLayerDidChange(FrameView& frameView) 142 142 { 143 143 ASSERT(isMainThread()); … … 149 149 // FIXME: In some navigation scenarios, the FrameView has no RenderView or that RenderView has not been composited. 150 150 // This needs cleaning up: https://bugs.webkit.org/show_bug.cgi?id=132724 151 if (!frameView ->scrollLayerID())151 if (!frameView.scrollLayerID()) 152 152 return; 153 153 … … 158 158 ScrollingCoordinator::frameViewRootLayerDidChange(frameView); 159 159 160 ScrollingStateFrameScrollingNode* node = downcast<ScrollingStateFrameScrollingNode>(m_scrollingStateTree->stateNodeForID(frameView ->scrollLayerID()));160 ScrollingStateFrameScrollingNode* node = downcast<ScrollingStateFrameScrollingNode>(m_scrollingStateTree->stateNodeForID(frameView.scrollLayerID())); 161 161 node->setLayer(scrollLayerForFrameView(frameView)); 162 162 node->setScrolledContentsLayer(rootContentLayerForFrameView(frameView)); … … 166 166 node->setHeaderLayer(headerLayerForFrameView(frameView)); 167 167 node->setFooterLayer(footerLayerForFrameView(frameView)); 168 node->setScrollBehaviorForFixedElements(frameView ->scrollBehaviorForFixedElements());169 } 170 171 bool AsyncScrollingCoordinator::requestScrollPositionUpdate(FrameView *frameView, const IntPoint& scrollPosition)168 node->setScrollBehaviorForFixedElements(frameView.scrollBehaviorForFixedElements()); 169 } 170 171 bool AsyncScrollingCoordinator::requestScrollPositionUpdate(FrameView& frameView, const IntPoint& scrollPosition) 172 172 { 173 173 ASSERT(isMainThread()); … … 177 177 return false; 178 178 179 bool isProgrammaticScroll = frameView ->inProgrammaticScroll();180 if (isProgrammaticScroll || frameView ->frame().document()->inPageCache())181 updateScrollPositionAfterAsyncScroll(frameView ->scrollLayerID(), scrollPosition, isProgrammaticScroll, SetScrollingLayerPosition);179 bool isProgrammaticScroll = frameView.inProgrammaticScroll(); 180 if (isProgrammaticScroll || frameView.frame().document()->inPageCache()) 181 updateScrollPositionAfterAsyncScroll(frameView.scrollLayerID(), scrollPosition, isProgrammaticScroll, SetScrollingLayerPosition); 182 182 183 183 // If this frame view's document is being put into the page cache, we don't want to update our 184 184 // main frame scroll position. Just let the FrameView think that we did. 185 if (frameView ->frame().document()->inPageCache())185 if (frameView.frame().document()->inPageCache()) 186 186 return true; 187 187 188 ScrollingStateScrollingNode* stateNode = downcast<ScrollingStateScrollingNode>(m_scrollingStateTree->stateNodeForID(frameView ->scrollLayerID()));188 ScrollingStateScrollingNode* stateNode = downcast<ScrollingStateScrollingNode>(m_scrollingStateTree->stateNodeForID(frameView.scrollLayerID())); 189 189 if (!stateNode) 190 190 return false; … … 263 263 return; 264 264 265 FrameView* frameView = frameViewForScrollingNode(scrollingNodeID); 266 if (!frameView) 267 return; 268 269 if (scrollingNodeID == frameView->scrollLayerID()) { 270 bool oldProgrammaticScroll = frameView->inProgrammaticScroll(); 271 frameView->setInProgrammaticScroll(programmaticScroll); 272 273 frameView->setConstrainsScrollingToContentEdge(false); 274 frameView->notifyScrollPositionChanged(roundedIntPoint(scrollPosition)); 275 frameView->setConstrainsScrollingToContentEdge(true); 276 277 frameView->setInProgrammaticScroll(oldProgrammaticScroll); 265 FrameView* frameViewPtr = frameViewForScrollingNode(scrollingNodeID); 266 if (!frameViewPtr) 267 return; 268 269 FrameView& frameView = *frameViewPtr; 270 271 if (scrollingNodeID == frameView.scrollLayerID()) { 272 bool oldProgrammaticScroll = frameView.inProgrammaticScroll(); 273 frameView.setInProgrammaticScroll(programmaticScroll); 274 275 frameView.setConstrainsScrollingToContentEdge(false); 276 frameView.notifyScrollPositionChanged(roundedIntPoint(scrollPosition)); 277 frameView.setConstrainsScrollingToContentEdge(true); 278 279 frameView.setInProgrammaticScroll(oldProgrammaticScroll); 278 280 279 281 if (GraphicsLayer* scrollLayer = scrollLayerForFrameView(frameView)) { … … 284 286 GraphicsLayer* headerLayer = headerLayerForFrameView(frameView); 285 287 GraphicsLayer* footerLayer = footerLayerForFrameView(frameView); 286 LayoutSize scrollOffsetForFixed = frameView ->scrollOffsetForFixedPosition();287 288 float topContentInset = frameView ->topContentInset();288 LayoutSize scrollOffsetForFixed = frameView.scrollOffsetForFixedPosition(); 289 290 float topContentInset = frameView.topContentInset(); 289 291 FloatPoint positionForInsetClipLayer = FloatPoint(0, FrameView::yPositionForInsetClipLayer(scrollPosition, topContentInset)); 290 292 FloatPoint positionForContentsLayer = FloatPoint(scrolledContentsLayer->position().x(), 291 FrameView::yPositionForRootContentLayer(scrollPosition, topContentInset, frameView ->headerHeight()));293 FrameView::yPositionForRootContentLayer(scrollPosition, topContentInset, frameView.headerHeight())); 292 294 FloatPoint positionForHeaderLayer = FloatPoint(scrollOffsetForFixed.width(), FrameView::yPositionForHeaderLayer(scrollPosition, topContentInset)); 293 295 FloatPoint positionForFooterLayer = FloatPoint(scrollOffsetForFixed.width(), 294 FrameView::yPositionForFooterLayer(scrollPosition, topContentInset, frameView ->totalContentsSize().height(), frameView->footerHeight()));296 FrameView::yPositionForFooterLayer(scrollPosition, topContentInset, frameView.totalContentsSize().height(), frameView.footerHeight())); 295 297 296 298 if (programmaticScroll || scrollingLayerPositionAction == SetScrollingLayerPosition) { 297 scrollLayer->setPosition(-frameView ->scrollPosition());299 scrollLayer->setPosition(-frameView.scrollPosition()); 298 300 if (counterScrollingLayer) 299 301 counterScrollingLayer->setPosition(toLayoutPoint(scrollOffsetForFixed)); … … 309 311 footerLayer->setPosition(positionForFooterLayer); 310 312 } else { 311 scrollLayer->syncPosition(-frameView ->scrollPosition());313 scrollLayer->syncPosition(-frameView.scrollPosition()); 312 314 if (counterScrollingLayer) 313 315 counterScrollingLayer->syncPosition(toLayoutPoint(scrollOffsetForFixed)); … … 323 325 footerLayer->syncPosition(positionForFooterLayer); 324 326 325 LayoutRect viewportRect = frameView ->viewportConstrainedVisibleContentRect();327 LayoutRect viewportRect = frameView.viewportConstrainedVisibleContentRect(); 326 328 syncChildPositions(viewportRect); 327 329 } … … 332 334 333 335 // Overflow-scroll area. 334 if (ScrollableArea* scrollableArea = frameView ->scrollableAreaForScrollLayerID(scrollingNodeID)) {336 if (ScrollableArea* scrollableArea = frameView.scrollableAreaForScrollLayerID(scrollingNodeID)) { 335 337 scrollableArea->setIsUserScroll(scrollingLayerPositionAction == SyncScrollingLayerPosition); 336 338 scrollableArea->scrollToOffsetWithoutAnimation(scrollPosition); … … 341 343 } 342 344 343 void AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange(ScrollableArea *scrollableArea, ScrollbarOrientation orientation)345 void AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange(ScrollableArea& scrollableArea, ScrollbarOrientation orientation) 344 346 { 345 347 ASSERT(isMainThread()); 346 348 ASSERT(m_page); 347 349 348 if ( scrollableArea != static_cast<ScrollableArea*>(m_page->mainFrame().view()))350 if (&scrollableArea != static_cast<ScrollableArea*>(m_page->mainFrame().view())) 349 351 return; 350 352 351 353 if (orientation == VerticalScrollbar) 352 scrollableArea ->verticalScrollbarLayerDidChange();354 scrollableArea.verticalScrollbarLayerDidChange(); 353 355 else 354 scrollableArea ->horizontalScrollbarLayerDidChange();356 scrollableArea.horizontalScrollbarLayerDidChange(); 355 357 } 356 358 … … 384 386 } 385 387 386 void AsyncScrollingCoordinator::ensureRootStateNodeForFrameView(FrameView *frameView)387 { 388 ASSERT(frameView ->scrollLayerID());389 attachToStateTree(FrameScrollingNode, frameView ->scrollLayerID(), 0);388 void AsyncScrollingCoordinator::ensureRootStateNodeForFrameView(FrameView& frameView) 389 { 390 ASSERT(frameView.scrollLayerID()); 391 attachToStateTree(FrameScrollingNode, frameView.scrollLayerID(), 0); 390 392 } 391 393 … … 482 484 return; 483 485 484 if (GraphicsLayer* scrollLayer = scrollLayerForFrameView( frameView))486 if (GraphicsLayer* scrollLayer = scrollLayerForFrameView(*frameView)) 485 487 scrollLayer->setPosition(-frameView->scrollPosition()); 486 488 } 487 489 488 void AsyncScrollingCoordinator::recomputeWheelEventHandlerCountForFrameView(FrameView *frameView)489 { 490 ScrollingStateFrameScrollingNode* node = downcast<ScrollingStateFrameScrollingNode>(m_scrollingStateTree->stateNodeForID(frameView ->scrollLayerID()));490 void AsyncScrollingCoordinator::recomputeWheelEventHandlerCountForFrameView(FrameView& frameView) 491 { 492 ScrollingStateFrameScrollingNode* node = downcast<ScrollingStateFrameScrollingNode>(m_scrollingStateTree->stateNodeForID(frameView.scrollLayerID())); 491 493 if (!node) 492 494 return; -
trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h
r180493 r182132 74 74 75 75 virtual bool supportsFixedPositionLayers() const override { return true; } 76 virtual bool hasVisibleSlowRepaintViewportConstrainedObjects( FrameView*) const override { return false; }76 virtual bool hasVisibleSlowRepaintViewportConstrainedObjects(const FrameView&) const override { return false; } 77 77 78 WEBCORE_EXPORT virtual void frameViewLayoutUpdated(FrameView *) override;79 WEBCORE_EXPORT virtual void frameViewRootLayerDidChange(FrameView *) override;80 WEBCORE_EXPORT virtual void frameViewNonFastScrollableRegionChanged(FrameView *) override;78 WEBCORE_EXPORT virtual void frameViewLayoutUpdated(FrameView&) override; 79 WEBCORE_EXPORT virtual void frameViewRootLayerDidChange(FrameView&) override; 80 WEBCORE_EXPORT virtual void frameViewNonFastScrollableRegionChanged(FrameView&) override; 81 81 82 WEBCORE_EXPORT virtual bool requestScrollPositionUpdate(FrameView *, const IntPoint&) override;82 WEBCORE_EXPORT virtual bool requestScrollPositionUpdate(FrameView&, const IntPoint&) override; 83 83 84 84 WEBCORE_EXPORT virtual ScrollingNodeID attachToStateTree(ScrollingNodeType, ScrollingNodeID newNodeID, ScrollingNodeID parentID) override; … … 95 95 96 96 WEBCORE_EXPORT virtual void syncChildPositions(const LayoutRect& viewportRect) override; 97 WEBCORE_EXPORT virtual void scrollableAreaScrollbarLayerDidChange(ScrollableArea *, ScrollbarOrientation) override;97 WEBCORE_EXPORT virtual void scrollableAreaScrollbarLayerDidChange(ScrollableArea&, ScrollbarOrientation) override; 98 98 99 WEBCORE_EXPORT virtual void recomputeWheelEventHandlerCountForFrameView(FrameView *) override;99 WEBCORE_EXPORT virtual void recomputeWheelEventHandlerCountForFrameView(FrameView&) override; 100 100 WEBCORE_EXPORT virtual void setSynchronousScrollingReasons(SynchronousScrollingReasons) override; 101 101 102 102 virtual void scheduleTreeStateCommit() = 0; 103 103 104 void ensureRootStateNodeForFrameView(FrameView *);104 void ensureRootStateNodeForFrameView(FrameView&); 105 105 void updateMainFrameScrollLayerPosition(); 106 106 -
trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp
r180474 r182132 80 80 { 81 81 ASSERT(m_page); 82 m_page = 0;83 } 84 85 bool ScrollingCoordinator::coordinatesScrollingForFrameView( FrameView*frameView) const86 { 87 ASSERT(isMainThread()); 88 ASSERT(m_page); 89 90 if (!frameView ->frame().isMainFrame() && !m_page->settings().scrollingTreeIncludesFrames())82 m_page = nullptr; 83 } 84 85 bool ScrollingCoordinator::coordinatesScrollingForFrameView(const FrameView& frameView) const 86 { 87 ASSERT(isMainThread()); 88 ASSERT(m_page); 89 90 if (!frameView.frame().isMainFrame() && !m_page->settings().scrollingTreeIncludesFrames()) 91 91 return false; 92 92 … … 97 97 } 98 98 99 Region ScrollingCoordinator::computeNonFastScrollableRegion(const Frame *frame, const IntPoint& frameLocation) const99 Region ScrollingCoordinator::computeNonFastScrollableRegion(const Frame& frame, const IntPoint& frameLocation) const 100 100 { 101 101 #if ENABLE(IOS_TOUCH_EVENTS) … … 118 118 #else 119 119 Region nonFastScrollableRegion; 120 FrameView* frameView = frame ->view();120 FrameView* frameView = frame.view(); 121 121 if (!frameView) 122 122 return nonFastScrollableRegion; … … 146 146 } 147 147 148 for (Frame* subframe = frame ->tree().firstChild(); subframe; subframe = subframe->tree().nextSibling())149 nonFastScrollableRegion.unite(computeNonFastScrollableRegion( subframe, offset));148 for (Frame* subframe = frame.tree().firstChild(); subframe; subframe = subframe->tree().nextSibling()) 149 nonFastScrollableRegion.unite(computeNonFastScrollableRegion(*subframe, offset)); 150 150 151 151 return nonFastScrollableRegion; … … 165 165 } 166 166 167 void ScrollingCoordinator::frameViewWheelEventHandlerCountChanged(FrameView *frameView)167 void ScrollingCoordinator::frameViewWheelEventHandlerCountChanged(FrameView& frameView) 168 168 { 169 169 ASSERT(isMainThread()); … … 173 173 } 174 174 175 void ScrollingCoordinator::frameViewHasSlowRepaintObjectsDidChange(FrameView *frameView)175 void ScrollingCoordinator::frameViewHasSlowRepaintObjectsDidChange(FrameView& frameView) 176 176 { 177 177 ASSERT(isMainThread()); … … 184 184 } 185 185 186 void ScrollingCoordinator::frameViewFixedObjectsDidChange(FrameView *frameView)186 void ScrollingCoordinator::frameViewFixedObjectsDidChange(FrameView& frameView) 187 187 { 188 188 ASSERT(isMainThread()); … … 195 195 } 196 196 197 GraphicsLayer* ScrollingCoordinator::scrollLayerForScrollableArea(ScrollableArea *scrollableArea)198 { 199 return scrollableArea ->layerForScrolling();200 } 201 202 GraphicsLayer* ScrollingCoordinator::scrollLayerForFrameView(FrameView *frameView)203 { 204 if (RenderView* renderView = frameView ->frame().contentRenderer())197 GraphicsLayer* ScrollingCoordinator::scrollLayerForScrollableArea(ScrollableArea& scrollableArea) 198 { 199 return scrollableArea.layerForScrolling(); 200 } 201 202 GraphicsLayer* ScrollingCoordinator::scrollLayerForFrameView(FrameView& frameView) 203 { 204 if (RenderView* renderView = frameView.frame().contentRenderer()) 205 205 return renderView->compositor().scrollLayer(); 206 206 return nullptr; 207 207 } 208 208 209 GraphicsLayer* ScrollingCoordinator::headerLayerForFrameView(FrameView *frameView)209 GraphicsLayer* ScrollingCoordinator::headerLayerForFrameView(FrameView& frameView) 210 210 { 211 211 #if ENABLE(RUBBER_BANDING) 212 if (RenderView* renderView = frameView ->frame().contentRenderer())212 if (RenderView* renderView = frameView.frame().contentRenderer()) 213 213 return renderView->compositor().headerLayer(); 214 214 return nullptr; … … 219 219 } 220 220 221 GraphicsLayer* ScrollingCoordinator::footerLayerForFrameView(FrameView *frameView)221 GraphicsLayer* ScrollingCoordinator::footerLayerForFrameView(FrameView& frameView) 222 222 { 223 223 #if ENABLE(RUBBER_BANDING) 224 if (RenderView* renderView = frameView ->frame().contentRenderer())224 if (RenderView* renderView = frameView.frame().contentRenderer()) 225 225 return renderView->compositor().footerLayer(); 226 226 return nullptr; … … 231 231 } 232 232 233 GraphicsLayer* ScrollingCoordinator::counterScrollingLayerForFrameView(FrameView *frameView)234 { 235 if (RenderView* renderView = frameView ->frame().contentRenderer())233 GraphicsLayer* ScrollingCoordinator::counterScrollingLayerForFrameView(FrameView& frameView) 234 { 235 if (RenderView* renderView = frameView.frame().contentRenderer()) 236 236 return renderView->compositor().fixedRootBackgroundLayer(); 237 237 return nullptr; 238 238 } 239 239 240 GraphicsLayer* ScrollingCoordinator::insetClipLayerForFrameView(FrameView *frameView)241 { 242 if (RenderView* renderView = frameView ->frame().contentRenderer())240 GraphicsLayer* ScrollingCoordinator::insetClipLayerForFrameView(FrameView& frameView) 241 { 242 if (RenderView* renderView = frameView.frame().contentRenderer()) 243 243 return renderView->compositor().clipLayer(); 244 244 return nullptr; 245 245 } 246 246 247 GraphicsLayer* ScrollingCoordinator::contentShadowLayerForFrameView(FrameView *frameView)247 GraphicsLayer* ScrollingCoordinator::contentShadowLayerForFrameView(FrameView& frameView) 248 248 { 249 249 #if ENABLE(RUBBER_BANDING) 250 if (RenderView* renderView = frameView ->frame().contentRenderer())250 if (RenderView* renderView = frameView.frame().contentRenderer()) 251 251 return renderView->compositor().layerForContentShadow(); 252 252 … … 258 258 } 259 259 260 GraphicsLayer* ScrollingCoordinator::rootContentLayerForFrameView(FrameView *frameView)261 { 262 if (RenderView* renderView = frameView ->frame().contentRenderer())260 GraphicsLayer* ScrollingCoordinator::rootContentLayerForFrameView(FrameView& frameView) 261 { 262 if (RenderView* renderView = frameView.frame().contentRenderer()) 263 263 return renderView->compositor().rootContentLayer(); 264 264 return nullptr; 265 265 } 266 266 267 void ScrollingCoordinator::frameViewRootLayerDidChange(FrameView *frameView)267 void ScrollingCoordinator::frameViewRootLayerDidChange(FrameView& frameView) 268 268 { 269 269 ASSERT(isMainThread()); … … 294 294 #endif 295 295 296 bool ScrollingCoordinator::hasVisibleSlowRepaintViewportConstrainedObjects( FrameView*frameView) const297 { 298 const FrameView::ViewportConstrainedObjectSet* viewportConstrainedObjects = frameView ->viewportConstrainedObjects();296 bool ScrollingCoordinator::hasVisibleSlowRepaintViewportConstrainedObjects(const FrameView& frameView) const 297 { 298 const FrameView::ViewportConstrainedObjectSet* viewportConstrainedObjects = frameView.viewportConstrainedObjects(); 299 299 if (!viewportConstrainedObjects) 300 300 return false; … … 312 312 } 313 313 314 SynchronousScrollingReasons ScrollingCoordinator::synchronousScrollingReasons(FrameView* frameView) const 315 { 316 if (!frameView) 317 return static_cast<SynchronousScrollingReasons>(0); 318 314 SynchronousScrollingReasons ScrollingCoordinator::synchronousScrollingReasons(const FrameView& frameView) const 315 { 319 316 SynchronousScrollingReasons synchronousScrollingReasons = (SynchronousScrollingReasons)0; 320 317 … … 326 323 synchronousScrollingReasons |= ForcedOnMainThread; 327 324 #endif 328 if (frameView ->hasSlowRepaintObjects())325 if (frameView.hasSlowRepaintObjects()) 329 326 synchronousScrollingReasons |= HasSlowRepaintObjects; 330 if (!supportsFixedPositionLayers() && frameView ->hasViewportConstrainedObjects())327 if (!supportsFixedPositionLayers() && frameView.hasViewportConstrainedObjects()) 331 328 synchronousScrollingReasons |= HasViewportConstrainedObjectsWithoutSupportingFixedLayers; 332 329 if (supportsFixedPositionLayers() && hasVisibleSlowRepaintViewportConstrainedObjects(frameView)) 333 330 synchronousScrollingReasons |= HasNonLayerViewportConstrainedObjects; 334 if (frameView ->frame().mainFrame().document() && frameView->frame().document()->isImageDocument())331 if (frameView.frame().mainFrame().document() && frameView.frame().document()->isImageDocument()) 335 332 synchronousScrollingReasons |= IsImageDocument; 336 333 … … 338 335 } 339 336 340 void ScrollingCoordinator::updateSynchronousScrollingReasons(FrameView *frameView)337 void ScrollingCoordinator::updateSynchronousScrollingReasons(FrameView& frameView) 341 338 { 342 339 // FIXME: Once we support async scrolling of iframes, we'll have to track the synchronous scrolling 343 340 // reasons per frame (maybe on scrolling tree nodes). 344 if (!frameView ->frame().isMainFrame())341 if (!frameView.frame().isMainFrame()) 345 342 return; 346 343 … … 354 351 355 352 m_forceSynchronousScrollLayerPositionUpdates = forceSynchronousScrollLayerPositionUpdates; 356 updateSynchronousScrollingReasons(m_page->mainFrame().view()); 353 if (FrameView* frameView = m_page->mainFrame().view()) 354 updateSynchronousScrollingReasons(*frameView); 357 355 } 358 356 359 357 bool ScrollingCoordinator::shouldUpdateScrollLayerPositionSynchronously() const 360 358 { 361 return synchronousScrollingReasons(m_page->mainFrame().view()); 359 if (FrameView* frameView = m_page->mainFrame().view()) 360 return synchronousScrollingReasons(*frameView); 361 return true; 362 362 } 363 363 … … 366 366 { 367 367 // FIXME: Once we support async scrolling of iframes, this should go through all subframes. 368 updateSynchronousScrollingReasons(m_page->mainFrame().view()); 368 if (FrameView* frameView = m_page->mainFrame().view()) 369 updateSynchronousScrollingReasons(*frameView); 369 370 } 370 371 #endif … … 403 404 String ScrollingCoordinator::synchronousScrollingReasonsAsText() const 404 405 { 405 return synchronousScrollingReasonsAsText(synchronousScrollingReasons(m_page->mainFrame().view())); 406 if (FrameView* frameView = m_page->mainFrame().view()) 407 return synchronousScrollingReasonsAsText(synchronousScrollingReasons(*frameView)); 408 409 return String(); 406 410 } 407 411 -
trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h
r175584 r182132 116 116 117 117 // Return whether this scrolling coordinator handles scrolling for the given frame view. 118 virtual bool coordinatesScrollingForFrameView( FrameView*) const;118 virtual bool coordinatesScrollingForFrameView(const FrameView&) const; 119 119 120 120 // Should be called whenever the given frame view has been laid out. 121 virtual void frameViewLayoutUpdated(FrameView *) { }121 virtual void frameViewLayoutUpdated(FrameView&) { } 122 122 123 123 // Should be called whenever a wheel event handler is added or removed in the 124 124 // frame view's underlying document. 125 void frameViewWheelEventHandlerCountChanged(FrameView *);125 void frameViewWheelEventHandlerCountChanged(FrameView&); 126 126 127 127 // Should be called whenever the slow repaint objects counter changes between zero and one. 128 void frameViewHasSlowRepaintObjectsDidChange(FrameView *);128 void frameViewHasSlowRepaintObjectsDidChange(FrameView&); 129 129 130 130 // Should be called whenever the set of fixed objects changes. 131 void frameViewFixedObjectsDidChange(FrameView *);131 void frameViewFixedObjectsDidChange(FrameView&); 132 132 133 133 // Called whenever the non-fast scrollable region changes for reasons other than layout. 134 virtual void frameViewNonFastScrollableRegionChanged(FrameView *) { }134 virtual void frameViewNonFastScrollableRegionChanged(FrameView&) { } 135 135 136 136 // Should be called whenever the root layer for the given frame view changes. 137 virtual void frameViewRootLayerDidChange(FrameView *);137 virtual void frameViewRootLayerDidChange(FrameView&); 138 138 139 139 // Return whether this scrolling coordinator can keep fixed position layers fixed to their … … 157 157 // Their meaningful implementations are in ScrollingCoordinatorMac. 158 158 virtual void commitTreeStateIfNeeded() { } 159 virtual bool requestScrollPositionUpdate(FrameView *, const IntPoint&) { return false; }160 virtual bool handleWheelEvent(FrameView *, const PlatformWheelEvent&) { return true; }159 virtual bool requestScrollPositionUpdate(FrameView&, const IntPoint&) { return false; } 160 virtual bool handleWheelEvent(FrameView&, const PlatformWheelEvent&) { return true; } 161 161 virtual ScrollingNodeID attachToStateTree(ScrollingNodeType, ScrollingNodeID newNodeID, ScrollingNodeID /*parentID*/) { return newNodeID; } 162 162 virtual void detachFromStateTree(ScrollingNodeID) { } … … 187 187 188 188 enum MainThreadScrollingReasonFlags { 189 ForcedOnMainThread = 1 << 0,190 HasSlowRepaintObjects = 1 << 1,191 HasViewportConstrainedObjectsWithoutSupportingFixedLayers = 1 << 2,192 HasNonLayerViewportConstrainedObjects = 1 << 3,193 IsImageDocument = 1 << 4189 ForcedOnMainThread = 1 << 0, 190 HasSlowRepaintObjects = 1 << 1, 191 HasViewportConstrainedObjectsWithoutSupportingFixedLayers = 1 << 2, 192 HasNonLayerViewportConstrainedObjects = 1 << 3, 193 IsImageDocument = 1 << 4 194 194 }; 195 195 196 SynchronousScrollingReasons synchronousScrollingReasons( FrameView*) const;196 SynchronousScrollingReasons synchronousScrollingReasons(const FrameView&) const; 197 197 bool shouldUpdateScrollLayerPositionSynchronously() const; 198 198 199 virtual void willDestroyScrollableArea(ScrollableArea *) { }200 virtual void scrollableAreaScrollLayerDidChange(ScrollableArea *) { }201 virtual void scrollableAreaScrollbarLayerDidChange(ScrollableArea *, ScrollbarOrientation) { }199 virtual void willDestroyScrollableArea(ScrollableArea&) { } 200 virtual void scrollableAreaScrollLayerDidChange(ScrollableArea&) { } 201 virtual void scrollableAreaScrollbarLayerDidChange(ScrollableArea&, ScrollbarOrientation) { } 202 202 203 203 static String synchronousScrollingReasonsAsText(SynchronousScrollingReasons); 204 204 String synchronousScrollingReasonsAsText() const; 205 205 206 Region computeNonFastScrollableRegion(const Frame *, const IntPoint& frameLocation) const;206 Region computeNonFastScrollableRegion(const Frame&, const IntPoint& frameLocation) const; 207 207 208 208 protected: 209 209 explicit ScrollingCoordinator(Page*); 210 210 211 static GraphicsLayer* scrollLayerForScrollableArea(ScrollableArea *);211 static GraphicsLayer* scrollLayerForScrollableArea(ScrollableArea&); 212 212 213 213 unsigned computeCurrentWheelEventHandlerCount(); 214 GraphicsLayer* scrollLayerForFrameView(FrameView *);215 GraphicsLayer* counterScrollingLayerForFrameView(FrameView *);216 GraphicsLayer* insetClipLayerForFrameView(FrameView *);217 GraphicsLayer* rootContentLayerForFrameView(FrameView *);218 GraphicsLayer* contentShadowLayerForFrameView(FrameView *);219 GraphicsLayer* headerLayerForFrameView(FrameView *);220 GraphicsLayer* footerLayerForFrameView(FrameView *);214 GraphicsLayer* scrollLayerForFrameView(FrameView&); 215 GraphicsLayer* counterScrollingLayerForFrameView(FrameView&); 216 GraphicsLayer* insetClipLayerForFrameView(FrameView&); 217 GraphicsLayer* rootContentLayerForFrameView(FrameView&); 218 GraphicsLayer* contentShadowLayerForFrameView(FrameView&); 219 GraphicsLayer* headerLayerForFrameView(FrameView&); 220 GraphicsLayer* footerLayerForFrameView(FrameView&); 221 221 222 222 Page* m_page; // FIXME: ideally this would be a reference but it gets nulled on async teardown. 223 223 224 224 private: 225 virtual void recomputeWheelEventHandlerCountForFrameView(FrameView *) { }225 virtual void recomputeWheelEventHandlerCountForFrameView(FrameView&) { } 226 226 virtual void setSynchronousScrollingReasons(SynchronousScrollingReasons) { } 227 227 228 virtual bool hasVisibleSlowRepaintViewportConstrainedObjects( FrameView*) const;229 void updateSynchronousScrollingReasons(FrameView *);228 virtual bool hasVisibleSlowRepaintViewportConstrainedObjects(const FrameView&) const; 229 void updateSynchronousScrollingReasons(FrameView&); 230 230 231 231 bool m_forceSynchronousScrollLayerPositionUpdates; -
trunk/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp
r177840 r182132 95 95 } 96 96 97 void ScrollingCoordinatorCoordinatedGraphics::scrollableAreaScrollLayerDidChange(ScrollableArea *scrollableArea)97 void ScrollingCoordinatorCoordinatedGraphics::scrollableAreaScrollLayerDidChange(ScrollableArea& scrollableArea) 98 98 { 99 99 CoordinatedGraphicsLayer* layer = toCoordinatedGraphicsLayer(scrollLayerForScrollableArea(scrollableArea)); … … 101 101 return; 102 102 103 layer->setScrollableArea( scrollableArea);103 layer->setScrollableArea(&scrollableArea); 104 104 } 105 105 106 void ScrollingCoordinatorCoordinatedGraphics::willDestroyScrollableArea(ScrollableArea *scrollableArea)106 void ScrollingCoordinatorCoordinatedGraphics::willDestroyScrollableArea(ScrollableArea& scrollableArea) 107 107 { 108 108 CoordinatedGraphicsLayer* layer = toCoordinatedGraphicsLayer(scrollLayerForScrollableArea(scrollableArea)); … … 113 113 } 114 114 115 bool ScrollingCoordinatorCoordinatedGraphics::requestScrollPositionUpdate(FrameView *frameView, const IntPoint& scrollPosition)115 bool ScrollingCoordinatorCoordinatedGraphics::requestScrollPositionUpdate(FrameView& frameView, const IntPoint& scrollPosition) 116 116 { 117 if (!frameView ->delegatesScrolling())117 if (!frameView.delegatesScrolling()) 118 118 return false; 119 119 120 frameView ->setFixedVisibleContentRect(IntRect(scrollPosition, frameView->visibleContentRect().size()));121 frameView ->hostWindow()->delegatedScrollRequested(scrollPosition);120 frameView.setFixedVisibleContentRect(IntRect(scrollPosition, frameView.visibleContentRect().size())); 121 frameView.hostWindow()->delegatedScrollRequested(scrollPosition); 122 122 return true; 123 123 } -
trunk/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h
r177840 r182132 48 48 virtual void updateViewportConstrainedNode(ScrollingNodeID, const ViewportConstraints&, GraphicsLayer*) override; 49 49 50 virtual void scrollableAreaScrollLayerDidChange(ScrollableArea *) override;51 virtual void willDestroyScrollableArea(ScrollableArea *) override;50 virtual void scrollableAreaScrollLayerDidChange(ScrollableArea&) override; 51 virtual void willDestroyScrollableArea(ScrollableArea&) override; 52 52 53 virtual bool requestScrollPositionUpdate(FrameView *, const IntPoint&) override;53 virtual bool requestScrollPositionUpdate(FrameView&, const IntPoint&) override; 54 54 55 55 private: -
trunk/Source/WebCore/page/scrolling/ios/ScrollingCoordinatorIOS.h
r176459 r182132 49 49 50 50 // Handle the wheel event on the scrolling thread. Returns whether the event was handled or not. 51 virtual bool handleWheelEvent(FrameView *, const PlatformWheelEvent&) override { return false; }51 virtual bool handleWheelEvent(FrameView&, const PlatformWheelEvent&) override { return false; } 52 52 53 53 private: -
trunk/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.h
r176459 r182132 49 49 50 50 // Handle the wheel event on the scrolling thread. Returns whether the event was handled or not. 51 virtual bool handleWheelEvent(FrameView *, const PlatformWheelEvent&) override;51 virtual bool handleWheelEvent(FrameView&, const PlatformWheelEvent&) override; 52 52 53 53 private: -
trunk/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm
r177848 r182132 87 87 } 88 88 89 bool ScrollingCoordinatorMac::handleWheelEvent(FrameView *, const PlatformWheelEvent& wheelEvent)89 bool ScrollingCoordinatorMac::handleWheelEvent(FrameView&, const PlatformWheelEvent& wheelEvent) 90 90 { 91 91 ASSERT(isMainThread()); -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r182116 r182132 361 361 if (renderer().frame().page()) { 362 362 if (ScrollingCoordinator* scrollingCoordinator = renderer().frame().page()->scrollingCoordinator()) 363 scrollingCoordinator->willDestroyScrollableArea( this);363 scrollingCoordinator->willDestroyScrollableArea(*this); 364 364 } 365 365 -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r181832 r182132 1296 1296 if (ScrollingCoordinator* scrollingCoordinator = scrollingCoordinatorFromLayer(m_owningLayer)) { 1297 1297 if (horizontalScrollbarLayerChanged) 1298 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange( &m_owningLayer, HorizontalScrollbar);1298 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange(m_owningLayer, HorizontalScrollbar); 1299 1299 if (verticalScrollbarLayerChanged) 1300 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange( &m_owningLayer, VerticalScrollbar);1300 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange(m_owningLayer, VerticalScrollbar); 1301 1301 } 1302 1302 -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r181832 r182132 988 988 updateScrollCoordinatedStatus(layer); 989 989 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) 990 scrollingCoordinator->frameViewRootLayerDidChange( &m_renderView.frameView());990 scrollingCoordinator->frameViewRootLayerDidChange(m_renderView.frameView()); 991 991 #if ENABLE(RUBBER_BANDING) 992 992 if (Page* page = this->page()) { … … 1062 1062 if (layerChanged) { 1063 1063 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) 1064 scrollingCoordinator->frameViewFixedObjectsDidChange( &m_renderView.frameView());1064 scrollingCoordinator->frameViewFixedObjectsDidChange(m_renderView.frameView()); 1065 1065 } 1066 1066 } else … … 1708 1708 { 1709 1709 ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator(); 1710 return scrollingCoordinator && scrollingCoordinator->coordinatesScrollingForFrameView( &m_renderView.frameView());1710 return scrollingCoordinator && scrollingCoordinator->coordinatesScrollingForFrameView(m_renderView.frameView()); 1711 1711 } 1712 1712 … … 1767 1767 { 1768 1768 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) 1769 scrollingCoordinator->scrollableAreaScrollLayerDidChange( &layer);1769 scrollingCoordinator->scrollableAreaScrollLayerDidChange(layer); 1770 1770 } 1771 1771 … … 3113 3113 // by the header layer, so if we remove the header, we need to tell the scrolling tree. 3114 3114 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) 3115 scrollingCoordinator->frameViewRootLayerDidChange( &m_renderView.frameView());3115 scrollingCoordinator->frameViewRootLayerDidChange(m_renderView.frameView()); 3116 3116 } 3117 3117 return 0; … … 3133 3133 3134 3134 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) 3135 scrollingCoordinator->frameViewRootLayerDidChange( &m_renderView.frameView());3135 scrollingCoordinator->frameViewRootLayerDidChange(m_renderView.frameView()); 3136 3136 3137 3137 if (Page* page = this->page()) … … 3154 3154 // by the footer layer, so if we remove the footer, we need to tell the scrolling tree. 3155 3155 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) 3156 scrollingCoordinator->frameViewRootLayerDidChange( &m_renderView.frameView());3156 scrollingCoordinator->frameViewRootLayerDidChange(m_renderView.frameView()); 3157 3157 } 3158 3158 return 0; … … 3174 3174 3175 3175 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) 3176 scrollingCoordinator->frameViewRootLayerDidChange( &m_renderView.frameView());3176 scrollingCoordinator->frameViewRootLayerDidChange(m_renderView.frameView()); 3177 3177 3178 3178 if (Page* page = this->page()) … … 3288 3288 3289 3289 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) 3290 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange( &m_renderView.frameView(), HorizontalScrollbar);3290 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange(m_renderView.frameView(), HorizontalScrollbar); 3291 3291 } 3292 3292 } else if (m_layerForHorizontalScrollbar) { … … 3295 3295 3296 3296 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) 3297 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange( &m_renderView.frameView(), HorizontalScrollbar);3297 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange(m_renderView.frameView(), HorizontalScrollbar); 3298 3298 } 3299 3299 … … 3311 3311 3312 3312 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) 3313 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange( &m_renderView.frameView(), VerticalScrollbar);3313 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange(m_renderView.frameView(), VerticalScrollbar); 3314 3314 } 3315 3315 } else if (m_layerForVerticalScrollbar) { … … 3318 3318 3319 3319 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) 3320 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange( &m_renderView.frameView(), VerticalScrollbar);3320 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange(m_renderView.frameView(), VerticalScrollbar); 3321 3321 } 3322 3322 … … 3438 3438 m_layerForHorizontalScrollbar = nullptr; 3439 3439 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) 3440 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange( &m_renderView.frameView(), HorizontalScrollbar);3440 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange(m_renderView.frameView(), HorizontalScrollbar); 3441 3441 if (Scrollbar* horizontalScrollbar = m_renderView.frameView().verticalScrollbar()) 3442 3442 m_renderView.frameView().invalidateScrollbar(horizontalScrollbar, IntRect(IntPoint(0, 0), horizontalScrollbar->frameRect().size())); … … 3447 3447 m_layerForVerticalScrollbar = nullptr; 3448 3448 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) 3449 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange( &m_renderView.frameView(), VerticalScrollbar);3449 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange(m_renderView.frameView(), VerticalScrollbar); 3450 3450 if (Scrollbar* verticalScrollbar = m_renderView.frameView().verticalScrollbar()) 3451 3451 m_renderView.frameView().invalidateScrollbar(verticalScrollbar, IntRect(IntPoint(0, 0), verticalScrollbar->frameRect().size())); … … 3817 3817 { 3818 3818 ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator(); 3819 ASSERT(scrollingCoordinator->coordinatesScrollingForFrameView( &m_renderView.frameView()));3819 ASSERT(scrollingCoordinator->coordinatesScrollingForFrameView(m_renderView.frameView())); 3820 3820 3821 3821 ScrollingNodeID nodeID = attachScrollingNode(*m_renderView.layer(), FrameScrollingNode, parentNodeID); … … 3826 3826 { 3827 3827 ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator(); 3828 if (!scrollingCoordinator || !scrollingCoordinator->coordinatesScrollingForFrameView( &m_renderView.frameView()))3828 if (!scrollingCoordinator || !scrollingCoordinator->coordinatesScrollingForFrameView(m_renderView.frameView())) 3829 3829 return; 3830 3830 … … 4020 4020 4021 4021 // For Coordinated Graphics. 4022 scrollingCoordinator->scrollableAreaScrollLayerDidChange( &layer);4022 scrollingCoordinator->scrollableAreaScrollLayerDidChange(layer); 4023 4023 return; 4024 4024 } … … 4045 4045 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) { 4046 4046 // For Coordinated Graphics. 4047 scrollingCoordinator->scrollableAreaScrollLayerDidChange( &layer);4047 scrollingCoordinator->scrollableAreaScrollLayerDidChange(layer); 4048 4048 return; 4049 4049 } -
trunk/Source/WebCore/testing/Internals.cpp
r182038 r182132 1772 1772 return nullptr; 1773 1773 1774 return page->nonFastScrollableRects( document->frame());1774 return page->nonFastScrollableRects(*document->frame()); 1775 1775 } 1776 1776 -
trunk/Source/WebKit2/ChangeLog
r182126 r182132 1 2015-03-29 Simon Fraser <simon.fraser@apple.com> 2 3 Convert arguments to ScrollingCoordinator functions to references 4 https://bugs.webkit.org/show_bug.cgi?id=143198 5 6 Reviewed by Darin Adler. 7 8 Convert all the FrameView* and ScrollableArea* arguments to ScrollingCoordinator functions to 9 references, and use references in a few other places. 10 11 * WebProcess/Scrolling/RemoteScrollingCoordinator.h: 12 * WebProcess/Scrolling/RemoteScrollingCoordinator.mm: 13 (WebKit::RemoteScrollingCoordinator::coordinatesScrollingForFrameView): 14 1 15 2015-03-29 Enrica Casucci <enrica@apple.com> 2 16 -
trunk/Source/WebKit2/WebProcess/Scrolling/RemoteScrollingCoordinator.h
r177917 r182132 62 62 63 63 // ScrollingCoordinator 64 virtual bool coordinatesScrollingForFrameView( WebCore::FrameView*) const override;64 virtual bool coordinatesScrollingForFrameView(const WebCore::FrameView&) const override; 65 65 virtual void scheduleTreeStateCommit() override; 66 66 -
trunk/Source/WebKit2/WebProcess/Scrolling/RemoteScrollingCoordinator.mm
r179409 r182132 68 68 } 69 69 70 bool RemoteScrollingCoordinator::coordinatesScrollingForFrameView( FrameView*frameView) const70 bool RemoteScrollingCoordinator::coordinatesScrollingForFrameView(const FrameView& frameView) const 71 71 { 72 RenderView* renderView = frameView ->renderView();72 RenderView* renderView = frameView.renderView(); 73 73 return renderView && renderView->usesCompositing(); 74 74 }
Note:
See TracChangeset
for help on using the changeset viewer.