Title: [223339] trunk/Source/WebCore
Revision
223339
Author
[email protected]
Date
2017-10-16 00:58:15 -0700 (Mon, 16 Oct 2017)

Log Message

Use auto/nullptr in scrolling code
https://bugs.webkit.org/show_bug.cgi?id=178306

Patch by Frederic Wang <[email protected]> on 2017-10-16
Reviewed by Carlos Garcia Campos.

This patch modifies the scrolling code to use the auto keyword when
possible. It also replaces '0' with 'nullptr' for the return value of
ScrollingStateTree::stateNodeForID.

No new tests, behavior unchanged.

* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
(WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
(WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
(WebCore::AsyncScrollingCoordinator::frameViewForScrollingNode const):
(WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
(WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
(WebCore::AsyncScrollingCoordinator::updateFrameScrollingNode):
(WebCore::AsyncScrollingCoordinator::updateOverflowScrollingNode):
(WebCore::AsyncScrollingCoordinator::updateNodeLayer):
(WebCore::AsyncScrollingCoordinator::updateNodeViewportConstraints):
(WebCore::AsyncScrollingCoordinator::setSynchronousScrollingReasons):
(WebCore::AsyncScrollingCoordinator::updateScrollLayerPosition):
(WebCore::AsyncScrollingCoordinator::setActiveScrollSnapIndices):
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::coordinatesScrollingForFrameView const):
(WebCore::ScrollingCoordinator::absoluteEventTrackingRegionsForFrame const):
(WebCore::ScrollingCoordinator::scrollLayerForFrameView):
(WebCore::ScrollingCoordinator::headerLayerForFrameView):
(WebCore::ScrollingCoordinator::footerLayerForFrameView):
(WebCore::ScrollingCoordinator::counterScrollingLayerForFrameView):
(WebCore::ScrollingCoordinator::insetClipLayerForFrameView):
(WebCore::ScrollingCoordinator::contentShadowLayerForFrameView):
(WebCore::ScrollingCoordinator::rootContentLayerForFrameView):
(WebCore::ScrollingCoordinator::handleWheelEventPhase):
(WebCore::ScrollingCoordinator::hasVisibleSlowRepaintViewportConstrainedObjects const):
(WebCore::ScrollingCoordinator::updateSynchronousScrollingReasonsForAllFrames):
(WebCore::ScrollingCoordinator::synchronousScrollingReasonsAsText const):
* page/scrolling/ScrollingStateFixedNode.cpp:
(WebCore::ScrollingStateFixedNode::reconcileLayerPositionForViewportRect):
* page/scrolling/ScrollingStateStickyNode.cpp:
(WebCore::ScrollingStateStickyNode::reconcileLayerPositionForViewportRect):
* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::nodeTypeAndParentMatch const):
(WebCore::ScrollingStateTree::attachNode):
(WebCore::ScrollingStateTree::detachNode):
(WebCore::ScrollingStateTree::removeNodeAndAllDescendants):
(WebCore::ScrollingStateTree::stateNodeForID const):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::shouldHandleWheelEventSynchronously):
(WebCore::ScrollingTree::viewportChangedViaDelegatedScrolling):
(WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling):
(WebCore::ScrollingTree::commitTreeState):
(WebCore::ScrollingTree::updateTreeFromStateNode):
* page/scrolling/ScrollingTreeNode.cpp:
(WebCore::ScrollingTreeNode::enclosingFrameNode const):
* page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
(WebCore::ScrollingCoordinatorCoordinatedGraphics::detachFromStateTree):
(WebCore::ScrollingCoordinatorCoordinatedGraphics::updateNodeLayer):
(WebCore::ScrollingCoordinatorCoordinatedGraphics::updateNodeViewportConstraints):
(WebCore::ScrollingCoordinatorCoordinatedGraphics::scrollableAreaScrollLayerDidChange):
(WebCore::ScrollingCoordinatorCoordinatedGraphics::willDestroyScrollableArea):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (223338 => 223339)


--- trunk/Source/WebCore/ChangeLog	2017-10-16 07:48:05 UTC (rev 223338)
+++ trunk/Source/WebCore/ChangeLog	2017-10-16 07:58:15 UTC (rev 223339)
@@ -1,3 +1,69 @@
+2017-10-16  Frederic Wang  <[email protected]>
+
+        Use auto/nullptr in scrolling code
+        https://bugs.webkit.org/show_bug.cgi?id=178306
+
+        Reviewed by Carlos Garcia Campos.
+
+        This patch modifies the scrolling code to use the auto keyword when
+        possible. It also replaces '0' with 'nullptr' for the return value of
+        ScrollingStateTree::stateNodeForID.
+
+        No new tests, behavior unchanged.
+
+        * page/scrolling/AsyncScrollingCoordinator.cpp:
+        (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
+        (WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
+        (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
+        (WebCore::AsyncScrollingCoordinator::frameViewForScrollingNode const):
+        (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
+        (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
+        (WebCore::AsyncScrollingCoordinator::updateFrameScrollingNode):
+        (WebCore::AsyncScrollingCoordinator::updateOverflowScrollingNode):
+        (WebCore::AsyncScrollingCoordinator::updateNodeLayer):
+        (WebCore::AsyncScrollingCoordinator::updateNodeViewportConstraints):
+        (WebCore::AsyncScrollingCoordinator::setSynchronousScrollingReasons):
+        (WebCore::AsyncScrollingCoordinator::updateScrollLayerPosition):
+        (WebCore::AsyncScrollingCoordinator::setActiveScrollSnapIndices):
+        * page/scrolling/ScrollingCoordinator.cpp:
+        (WebCore::ScrollingCoordinator::coordinatesScrollingForFrameView const):
+        (WebCore::ScrollingCoordinator::absoluteEventTrackingRegionsForFrame const):
+        (WebCore::ScrollingCoordinator::scrollLayerForFrameView):
+        (WebCore::ScrollingCoordinator::headerLayerForFrameView):
+        (WebCore::ScrollingCoordinator::footerLayerForFrameView):
+        (WebCore::ScrollingCoordinator::counterScrollingLayerForFrameView):
+        (WebCore::ScrollingCoordinator::insetClipLayerForFrameView):
+        (WebCore::ScrollingCoordinator::contentShadowLayerForFrameView):
+        (WebCore::ScrollingCoordinator::rootContentLayerForFrameView):
+        (WebCore::ScrollingCoordinator::handleWheelEventPhase):
+        (WebCore::ScrollingCoordinator::hasVisibleSlowRepaintViewportConstrainedObjects const):
+        (WebCore::ScrollingCoordinator::updateSynchronousScrollingReasonsForAllFrames):
+        (WebCore::ScrollingCoordinator::synchronousScrollingReasonsAsText const):
+        * page/scrolling/ScrollingStateFixedNode.cpp:
+        (WebCore::ScrollingStateFixedNode::reconcileLayerPositionForViewportRect):
+        * page/scrolling/ScrollingStateStickyNode.cpp:
+        (WebCore::ScrollingStateStickyNode::reconcileLayerPositionForViewportRect):
+        * page/scrolling/ScrollingStateTree.cpp:
+        (WebCore::ScrollingStateTree::nodeTypeAndParentMatch const):
+        (WebCore::ScrollingStateTree::attachNode):
+        (WebCore::ScrollingStateTree::detachNode):
+        (WebCore::ScrollingStateTree::removeNodeAndAllDescendants):
+        (WebCore::ScrollingStateTree::stateNodeForID const):
+        * page/scrolling/ScrollingTree.cpp:
+        (WebCore::ScrollingTree::shouldHandleWheelEventSynchronously):
+        (WebCore::ScrollingTree::viewportChangedViaDelegatedScrolling):
+        (WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling):
+        (WebCore::ScrollingTree::commitTreeState):
+        (WebCore::ScrollingTree::updateTreeFromStateNode):
+        * page/scrolling/ScrollingTreeNode.cpp:
+        (WebCore::ScrollingTreeNode::enclosingFrameNode const):
+        * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
+        (WebCore::ScrollingCoordinatorCoordinatedGraphics::detachFromStateTree):
+        (WebCore::ScrollingCoordinatorCoordinatedGraphics::updateNodeLayer):
+        (WebCore::ScrollingCoordinatorCoordinatedGraphics::updateNodeViewportConstraints):
+        (WebCore::ScrollingCoordinatorCoordinatedGraphics::scrollableAreaScrollLayerDidChange):
+        (WebCore::ScrollingCoordinatorCoordinatedGraphics::willDestroyScrollableArea):
+
 2017-10-16  Fujii Hironori  <[email protected]>
 
         A lot of "Can't stat WebCore/animation: No such file or directory" since r223328

Modified: trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp (223338 => 223339)


--- trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp	2017-10-16 07:48:05 UTC (rev 223338)
+++ trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp	2017-10-16 07:58:15 UTC (rev 223339)
@@ -136,12 +136,12 @@
     if (!coordinatesScrollingForFrameView(frameView))
         return;
 
-    ScrollingStateFrameScrollingNode* node = downcast<ScrollingStateFrameScrollingNode>(m_scrollingStateTree->stateNodeForID(frameView.scrollLayerID()));
+    auto* node = downcast<ScrollingStateFrameScrollingNode>(m_scrollingStateTree->stateNodeForID(frameView.scrollLayerID()));
     if (!node)
         return;
 
-    Scrollbar* verticalScrollbar = frameView.verticalScrollbar();
-    Scrollbar* horizontalScrollbar = frameView.horizontalScrollbar();
+    auto* verticalScrollbar = frameView.verticalScrollbar();
+    auto* horizontalScrollbar = frameView.horizontalScrollbar();
     node->setScrollerImpsFromScrollbars(verticalScrollbar, horizontalScrollbar);
     
     node->setFrameScaleFactor(frameView.frame().frameScaleFactor());
@@ -167,7 +167,7 @@
 #endif
 
 #if PLATFORM(COCOA)
-    Page* page = frameView.frame().page();
+    auto* page = frameView.frame().page();
     if (page && page->expectsWheelEventTriggers()) {
         LOG(WheelEventTestTriggers, "    AsyncScrollingCoordinator::frameViewLayoutUpdated: Expects wheel event test trigger=%d", page->expectsWheelEventTriggers());
         node->setExpectsWheelEventTestTrigger(page->expectsWheelEventTriggers());
@@ -226,7 +226,7 @@
 
     ScrollingCoordinator::frameViewRootLayerDidChange(frameView);
 
-    ScrollingStateFrameScrollingNode* node = downcast<ScrollingStateFrameScrollingNode>(m_scrollingStateTree->stateNodeForID(frameView.scrollLayerID()));
+    auto* node = downcast<ScrollingStateFrameScrollingNode>(m_scrollingStateTree->stateNodeForID(frameView.scrollLayerID()));
     node->setLayer(scrollLayerForFrameView(frameView));
     node->setScrolledContentsLayer(rootContentLayerForFrameView(frameView));
     node->setCounterScrollingLayer(counterScrollingLayerForFrameView(frameView));
@@ -254,7 +254,7 @@
     if (frameView.frame().document()->pageCacheState() != Document::NotInPageCache)
         return true;
 
-    ScrollingStateScrollingNode* stateNode = downcast<ScrollingStateScrollingNode>(m_scrollingStateTree->stateNodeForID(frameView.scrollLayerID()));
+    auto* stateNode = downcast<ScrollingStateScrollingNode>(m_scrollingStateTree->stateNodeForID(frameView.scrollLayerID()));
     if (!stateNode)
         return false;
 
@@ -301,12 +301,12 @@
     if (scrollingNodeID == m_scrollingStateTree->rootStateNode()->scrollingNodeID())
         return m_page->mainFrame().view();
 
-    ScrollingStateNode* stateNode = m_scrollingStateTree->stateNodeForID(scrollingNodeID);
+    auto* stateNode = m_scrollingStateTree->stateNodeForID(scrollingNodeID);
     if (!stateNode)
         return nullptr;
 
     // Find the enclosing frame scrolling node.
-    ScrollingStateNode* parentNode = stateNode;
+    auto* parentNode = stateNode;
     while (parentNode && !parentNode->isFrameScrollingNode())
         parentNode = parentNode->parent();
     
@@ -316,7 +316,7 @@
     // Walk the frame tree to find the matching FrameView. This is not ideal, but avoids back pointers to FrameViews
     // from ScrollingTreeStateNodes.
     for (Frame* frame = &m_page->mainFrame(); frame; frame = frame->tree().traverseNext()) {
-        if (FrameView* view = frame->view()) {
+        if (auto* view = frame->view()) {
             if (view->scrollLayerID() == parentNode->scrollingNodeID())
                 return view;
         }
@@ -332,13 +332,13 @@
     if (!m_page)
         return;
 
-    FrameView* frameViewPtr = frameViewForScrollingNode(scrollingNodeID);
+    auto* frameViewPtr = frameViewForScrollingNode(scrollingNodeID);
     if (!frameViewPtr)
         return;
 
     LOG_WITH_STREAM(Scrolling, stream << "AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll node " << scrollingNodeID << " scrollPosition " << scrollPosition << " action " << scrollingLayerPositionAction);
 
-    FrameView& frameView = *frameViewPtr;
+    auto& frameView = *frameViewPtr;
 
     if (scrollingNodeID == frameView.scrollLayerID()) {
         reconcileScrollingState(frameView, scrollPosition, layoutViewportOrigin, programmaticScroll, ViewportRectStability::Stable, scrollingLayerPositionAction);
@@ -355,7 +355,7 @@
     }
 
     // Overflow-scroll area.
-    if (ScrollableArea* scrollableArea = frameView.scrollableAreaForScrollLayerID(scrollingNodeID)) {
+    if (auto* scrollableArea = frameView.scrollableAreaForScrollLayerID(scrollingNodeID)) {
         scrollableArea->setIsUserScroll(scrollingLayerPositionAction == ScrollingLayerPositionAction::Sync);
         scrollableArea->scrollToOffsetWithoutAnimation(scrollPosition);
         scrollableArea->setIsUserScroll(false);
@@ -411,16 +411,16 @@
             reconcileViewportConstrainedLayerPositions(LayoutRect(layoutViewportRect.value()), scrollingLayerPositionAction);
     }
 
-    GraphicsLayer* scrollLayer = scrollLayerForFrameView(frameView);
+    auto* scrollLayer = scrollLayerForFrameView(frameView);
     if (!scrollLayer)
         return;
 
-    GraphicsLayer* counterScrollingLayer = counterScrollingLayerForFrameView(frameView);
-    GraphicsLayer* insetClipLayer = insetClipLayerForFrameView(frameView);
-    GraphicsLayer* contentShadowLayer = contentShadowLayerForFrameView(frameView);
-    GraphicsLayer* scrolledContentsLayer = rootContentLayerForFrameView(frameView);
-    GraphicsLayer* headerLayer = headerLayerForFrameView(frameView);
-    GraphicsLayer* footerLayer = footerLayerForFrameView(frameView);
+    auto* counterScrollingLayer = counterScrollingLayerForFrameView(frameView);
+    auto* insetClipLayer = insetClipLayerForFrameView(frameView);
+    auto* contentShadowLayer = contentShadowLayerForFrameView(frameView);
+    auto* scrolledContentsLayer = rootContentLayerForFrameView(frameView);
+    auto* headerLayer = headerLayerForFrameView(frameView);
+    auto* footerLayer = footerLayerForFrameView(frameView);
 
     ASSERT(frameView.scrollPosition() == roundedIntPoint(scrollPosition));
     LayoutPoint scrollPositionForFixed = frameView.scrollPositionForFixedPosition();
@@ -519,7 +519,7 @@
 
 void AsyncScrollingCoordinator::updateFrameScrollingNode(ScrollingNodeID nodeID, GraphicsLayer* layer, GraphicsLayer* scrolledContentsLayer, GraphicsLayer* counterScrollingLayer, GraphicsLayer* insetClipLayer, const ScrollingGeometry* scrollingGeometry)
 {
-    ScrollingStateFrameScrollingNode* node = downcast<ScrollingStateFrameScrollingNode>(m_scrollingStateTree->stateNodeForID(nodeID));
+    auto* node = downcast<ScrollingStateFrameScrollingNode>(m_scrollingStateTree->stateNodeForID(nodeID));
     ASSERT(node);
     if (!node)
         return;
@@ -540,7 +540,7 @@
     
 void AsyncScrollingCoordinator::updateOverflowScrollingNode(ScrollingNodeID nodeID, GraphicsLayer* layer, GraphicsLayer* scrolledContentsLayer, const ScrollingGeometry* scrollingGeometry)
 {
-    ScrollingStateOverflowScrollingNode* node = downcast<ScrollingStateOverflowScrollingNode>(m_scrollingStateTree->stateNodeForID(nodeID));
+    auto* node = downcast<ScrollingStateOverflowScrollingNode>(m_scrollingStateTree->stateNodeForID(nodeID));
     ASSERT(node);
     if (!node)
         return;
@@ -565,7 +565,7 @@
 
 void AsyncScrollingCoordinator::updateNodeLayer(ScrollingNodeID nodeID, GraphicsLayer* graphicsLayer)
 {
-    ScrollingStateNode* node = m_scrollingStateTree->stateNodeForID(nodeID);
+    auto* node = m_scrollingStateTree->stateNodeForID(nodeID);
     if (!node)
         return;
 
@@ -574,18 +574,18 @@
 
 void AsyncScrollingCoordinator::updateNodeViewportConstraints(ScrollingNodeID nodeID, const ViewportConstraints& constraints)
 {
-    ScrollingStateNode* node = m_scrollingStateTree->stateNodeForID(nodeID);
+    auto* node = m_scrollingStateTree->stateNodeForID(nodeID);
     if (!node)
         return;
 
     switch (constraints.constraintType()) {
     case ViewportConstraints::FixedPositionConstraint: {
-        ScrollingStateFixedNode& fixedNode = downcast<ScrollingStateFixedNode>(*node);
+        auto& fixedNode = downcast<ScrollingStateFixedNode>(*node);
         fixedNode.updateConstraints((const FixedPositionViewportConstraints&)constraints);
         break;
     }
     case ViewportConstraints::StickyPositionConstraint: {
-        ScrollingStateStickyNode& stickyNode = downcast<ScrollingStateStickyNode>(*node);
+        auto& stickyNode = downcast<ScrollingStateStickyNode>(*node);
         stickyNode.updateConstraints((const StickyPositionViewportConstraints&)constraints);
         break;
     }
@@ -594,7 +594,7 @@
 
 void AsyncScrollingCoordinator::setSynchronousScrollingReasons(FrameView& frameView, SynchronousScrollingReasons reasons)
 {
-    ScrollingStateFrameScrollingNode* scrollingStateNode = static_cast<ScrollingStateFrameScrollingNode*>(m_scrollingStateTree->stateNodeForID(frameView.scrollLayerID()));
+    auto* scrollingStateNode = static_cast<ScrollingStateFrameScrollingNode*>(m_scrollingStateTree->stateNodeForID(frameView.scrollLayerID()));
     if (!scrollingStateNode)
         return;
 
@@ -609,7 +609,7 @@
 void AsyncScrollingCoordinator::updateScrollLayerPosition(FrameView& frameView)
 {
     ASSERT(isMainThread());
-    if (GraphicsLayer* scrollLayer = scrollLayerForFrameView(frameView))
+    if (auto* scrollLayer = scrollLayerForFrameView(frameView))
         scrollLayer->setPosition(-frameView.scrollPosition());
 }
 
@@ -647,7 +647,7 @@
     if (!m_page)
         return;
     
-    FrameView* frameView = frameViewForScrollingNode(scrollingNodeID);
+    auto* frameView = frameViewForScrollingNode(scrollingNodeID);
     if (!frameView)
         return;
     
@@ -658,7 +658,7 @@
     }
     
     // Overflow-scroll area.
-    if (ScrollableArea* scrollableArea = frameView->scrollableAreaForScrollLayerID(scrollingNodeID)) {
+    if (auto* scrollableArea = frameView->scrollableAreaForScrollLayerID(scrollingNodeID)) {
         scrollableArea->setCurrentHorizontalSnapPointIndex(horizontalIndex);
         scrollableArea->setCurrentVerticalSnapPointIndex(verticalIndex);
     }

Modified: trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp (223338 => 223339)


--- trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp	2017-10-16 07:48:05 UTC (rev 223338)
+++ trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp	2017-10-16 07:58:15 UTC (rev 223339)
@@ -89,7 +89,7 @@
     )
         return false;
 
-    RenderView* renderView = frameView.frame().contentRenderer();
+    auto* renderView = frameView.frame().contentRenderer();
     if (!renderView)
         return false;
     return renderView->usesCompositing();
@@ -147,7 +147,7 @@
     EventTrackingRegions eventTrackingRegions;
 
     // FIXME: if we've already accounted for this subframe as a scrollable area, we can avoid recursing into it here.
-    for (Frame* subframe = frame.tree().firstChild(); subframe; subframe = subframe->tree().nextSibling()) {
+    for (auto* subframe = frame.tree().firstChild(); subframe; subframe = subframe->tree().nextSibling()) {
         auto* subframeView = subframe->view();
         if (!subframeView)
             continue;
@@ -212,7 +212,7 @@
 
 GraphicsLayer* ScrollingCoordinator::scrollLayerForFrameView(FrameView& frameView)
 {
-    if (RenderView* renderView = frameView.frame().contentRenderer())
+    if (auto* renderView = frameView.frame().contentRenderer())
         return renderView->compositor().scrollLayer();
     return nullptr;
 }
@@ -220,7 +220,7 @@
 GraphicsLayer* ScrollingCoordinator::headerLayerForFrameView(FrameView& frameView)
 {
 #if ENABLE(RUBBER_BANDING)
-    if (RenderView* renderView = frameView.frame().contentRenderer())
+    if (auto* renderView = frameView.frame().contentRenderer())
         return renderView->compositor().headerLayer();
     return nullptr;
 #else
@@ -232,7 +232,7 @@
 GraphicsLayer* ScrollingCoordinator::footerLayerForFrameView(FrameView& frameView)
 {
 #if ENABLE(RUBBER_BANDING)
-    if (RenderView* renderView = frameView.frame().contentRenderer())
+    if (auto* renderView = frameView.frame().contentRenderer())
         return renderView->compositor().footerLayer();
     return nullptr;
 #else
@@ -243,7 +243,7 @@
 
 GraphicsLayer* ScrollingCoordinator::counterScrollingLayerForFrameView(FrameView& frameView)
 {
-    if (RenderView* renderView = frameView.frame().contentRenderer())
+    if (auto* renderView = frameView.frame().contentRenderer())
         return renderView->compositor().fixedRootBackgroundLayer();
     return nullptr;
 }
@@ -250,7 +250,7 @@
 
 GraphicsLayer* ScrollingCoordinator::insetClipLayerForFrameView(FrameView& frameView)
 {
-    if (RenderView* renderView = frameView.frame().contentRenderer())
+    if (auto* renderView = frameView.frame().contentRenderer())
         return renderView->compositor().clipLayer();
     return nullptr;
 }
@@ -258,7 +258,7 @@
 GraphicsLayer* ScrollingCoordinator::contentShadowLayerForFrameView(FrameView& frameView)
 {
 #if ENABLE(RUBBER_BANDING)
-    if (RenderView* renderView = frameView.frame().contentRenderer())
+    if (auto* renderView = frameView.frame().contentRenderer())
         return renderView->compositor().layerForContentShadow();
     
     return nullptr;
@@ -270,7 +270,7 @@
 
 GraphicsLayer* ScrollingCoordinator::rootContentLayerForFrameView(FrameView& frameView)
 {
-    if (RenderView* renderView = frameView.frame().contentRenderer())
+    if (auto* renderView = frameView.frame().contentRenderer())
         return renderView->compositor().rootContentLayer();
     return nullptr;
 }
@@ -295,7 +295,7 @@
     if (!m_page)
         return;
 
-    FrameView* frameView = m_page->mainFrame().view();
+    auto* frameView = m_page->mainFrame().view();
     if (!frameView)
         return;
 
@@ -312,7 +312,7 @@
     for (auto& viewportConstrainedObject : *viewportConstrainedObjects) {
         if (!is<RenderBoxModelObject>(*viewportConstrainedObject) || !viewportConstrainedObject->hasLayer())
             return true;
-        RenderLayer& layer = *downcast<RenderBoxModelObject>(*viewportConstrainedObject).layer();
+        auto& layer = *downcast<RenderBoxModelObject>(*viewportConstrainedObject).layer();
         // Any explicit reason that a fixed position element is not composited shouldn't cause slow scrolling.
         if (!layer.isComposited() && layer.viewportConstrainedNotCompositedReason() == RenderLayer::NoNotCompositedReason)
             return true;
@@ -345,7 +345,7 @@
 void ScrollingCoordinator::updateSynchronousScrollingReasonsForAllFrames()
 {
     for (Frame* frame = &m_page->mainFrame(); frame; frame = frame->tree().traverseNext()) {
-        if (FrameView* frameView = frame->view()) {
+        if (auto* frameView = frame->view()) {
             if (coordinatesScrollingForFrameView(*frameView))
                 updateSynchronousScrollingReasons(*frameView);
         }
@@ -402,7 +402,7 @@
 
 String ScrollingCoordinator::synchronousScrollingReasonsAsText() const
 {
-    if (FrameView* frameView = m_page->mainFrame().view())
+    if (auto* frameView = m_page->mainFrame().view())
         return synchronousScrollingReasonsAsText(synchronousScrollingReasons(*frameView));
 
     return String();

Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateFixedNode.cpp (223338 => 223339)


--- trunk/Source/WebCore/page/scrolling/ScrollingStateFixedNode.cpp	2017-10-16 07:48:05 UTC (rev 223338)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateFixedNode.cpp	2017-10-16 07:58:15 UTC (rev 223339)
@@ -75,7 +75,7 @@
 {
     FloatPoint position = m_constraints.layerPositionForViewportRect(viewportRect);
     if (layer().representsGraphicsLayer()) {
-        GraphicsLayer* graphicsLayer = static_cast<GraphicsLayer*>(layer());
+        auto* graphicsLayer = static_cast<GraphicsLayer*>(layer());
 
         LOG_WITH_STREAM(Scrolling, stream << "ScrollingStateFixedNode " << scrollingNodeID() <<" reconcileLayerPositionForViewportRect " << action << " position of layer " << graphicsLayer->primaryLayerID() << " to " << position);
         

Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateStickyNode.cpp (223338 => 223339)


--- trunk/Source/WebCore/page/scrolling/ScrollingStateStickyNode.cpp	2017-10-16 07:48:05 UTC (rev 223338)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateStickyNode.cpp	2017-10-16 07:58:15 UTC (rev 223339)
@@ -75,7 +75,7 @@
 {
     FloatPoint position = m_constraints.layerPositionForConstrainingRect(viewportRect);
     if (layer().representsGraphicsLayer()) {
-        GraphicsLayer* graphicsLayer = static_cast<GraphicsLayer*>(layer());
+        auto* graphicsLayer = static_cast<GraphicsLayer*>(layer());
 
         LOG_WITH_STREAM(Compositing, stream << "ScrollingStateStickyNode " << scrollingNodeID() << " reconcileLayerPositionForViewportRect " << action << " position of layer " << graphicsLayer->primaryLayerID() << " to " << position << " sticky offset " << m_constraints.stickyOffsetAtLastLayout());
         

Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateTree.cpp (223338 => 223339)


--- trunk/Source/WebCore/page/scrolling/ScrollingStateTree.cpp	2017-10-16 07:48:05 UTC (rev 223338)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateTree.cpp	2017-10-16 07:58:15 UTC (rev 223339)
@@ -88,7 +88,7 @@
     if (node.nodeType() != nodeType)
         return false;
 
-    ScrollingStateNode* parent = stateNodeForID(parentID);
+    auto* parent = stateNodeForID(parentID);
     if (!parent)
         return true;
 
@@ -99,7 +99,7 @@
 {
     ASSERT(newNodeID);
 
-    if (ScrollingStateNode* node = stateNodeForID(newNodeID)) {
+    if (auto* node = stateNodeForID(newNodeID)) {
         if (nodeTypeAndParentMatch(*node, nodeType, parentID))
             return newNodeID;
 
@@ -122,7 +122,7 @@
         newNode = rootStateNode();
         m_hasNewRootStateNode = true;
     } else {
-        ScrollingStateNode* parent = stateNodeForID(parentID);
+        auto* parent = stateNodeForID(parentID);
         if (!parent)
             return 0;
 
@@ -151,7 +151,7 @@
         return;
 
     // The node may not be found if clearStateTree() was recently called.
-    ScrollingStateNode* node = m_stateNodeMap.take(nodeID);
+    auto* node = m_stateNodeMap.take(nodeID);
     if (!node)
         return;
 
@@ -204,7 +204,7 @@
 
 void ScrollingStateTree::removeNodeAndAllDescendants(ScrollingStateNode* node, SubframeNodeRemoval subframeNodeRemoval)
 {
-    ScrollingStateNode* parent = node->parent();
+    auto* parent = node->parent();
 
     recursiveNodeWillBeRemoved(node, subframeNodeRemoval);
 
@@ -252,11 +252,11 @@
 ScrollingStateNode* ScrollingStateTree::stateNodeForID(ScrollingNodeID scrollLayerID) const
 {
     if (!scrollLayerID)
-        return 0;
+        return nullptr;
 
     auto it = m_stateNodeMap.find(scrollLayerID);
     if (it == m_stateNodeMap.end())
-        return 0;
+        return nullptr;
 
     ASSERT(it->value->scrollingNodeID() == scrollLayerID);
     return it->value;

Modified: trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp (223338 => 223339)


--- trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp	2017-10-16 07:48:05 UTC (rev 223338)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp	2017-10-16 07:58:15 UTC (rev 223339)
@@ -62,7 +62,7 @@
         m_latchedNode = 0;
     
     if (!m_eventTrackingRegions.isEmpty() && m_rootNode) {
-        ScrollingTreeFrameScrollingNode& frameScrollingNode = downcast<ScrollingTreeFrameScrollingNode>(*m_rootNode);
+        auto& frameScrollingNode = downcast<ScrollingTreeFrameScrollingNode>(*m_rootNode);
         FloatPoint position = wheelEvent.position();
         position.move(frameScrollingNode.viewToContentsOffset(m_mainFrameScrollPosition));
 
@@ -94,7 +94,7 @@
 
 void ScrollingTree::viewportChangedViaDelegatedScrolling(ScrollingNodeID nodeID, const FloatRect& fixedPositionRect, double scale)
 {
-    ScrollingTreeNode* node = nodeForID(nodeID);
+    auto* node = nodeForID(nodeID);
     if (!is<ScrollingTreeScrollingNode>(node))
         return;
 
@@ -103,7 +103,7 @@
 
 void ScrollingTree::scrollPositionChangedViaDelegatedScrolling(ScrollingNodeID nodeID, const WebCore::FloatPoint& scrollPosition, bool inUserInteraction)
 {
-    ScrollingTreeNode* node = nodeForID(nodeID);
+    auto* node = nodeForID(nodeID);
     if (!is<ScrollingTreeScrollingNode>(node))
         return;
 
@@ -120,7 +120,7 @@
     
     LOG(Scrolling, "\nScrollingTree::commitTreeState");
     
-    ScrollingStateScrollingNode* rootNode = scrollingStateTree->rootStateNode();
+    auto* rootNode = scrollingStateTree->rootStateNode();
     if (rootNode
         && (rootStateNodeChanged
             || rootNode->hasChangedProperty(ScrollingStateFrameScrollingNode::EventTrackingRegion)
@@ -178,7 +178,7 @@
         auto parentIt = m_nodeMap.find(parentNodeID);
         ASSERT_WITH_SECURITY_IMPLICATION(parentIt != m_nodeMap.end());
         if (parentIt != m_nodeMap.end()) {
-            ScrollingTreeNode* parent = parentIt->value;
+            auto* parent = parentIt->value;
             node->setParent(parent);
             parent->appendChild(*node);
         }

Modified: trunk/Source/WebCore/page/scrolling/ScrollingTreeNode.cpp (223338 => 223339)


--- trunk/Source/WebCore/page/scrolling/ScrollingTreeNode.cpp	2017-10-16 07:48:05 UTC (rev 223338)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTreeNode.cpp	2017-10-16 07:58:15 UTC (rev 223339)
@@ -81,7 +81,7 @@
 
 ScrollingTreeFrameScrollingNode* ScrollingTreeNode::enclosingFrameNode() const
 {
-    ScrollingTreeNode* node = parent();
+    auto* node = parent();
     while (node && !node->isFrameScrollingNode())
         node = node->parent();
 

Modified: trunk/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp (223338 => 223339)


--- trunk/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp	2017-10-16 07:48:05 UTC (rev 223338)
+++ trunk/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp	2017-10-16 07:58:15 UTC (rev 223339)
@@ -59,7 +59,7 @@
 
 void ScrollingCoordinatorCoordinatedGraphics::detachFromStateTree(ScrollingNodeID nodeID)
 {
-    ScrollingStateNode* node = m_scrollingStateTree->stateNodeForID(nodeID);
+    auto* node = m_scrollingStateTree->stateNodeForID(nodeID);
     if (node && node->nodeType() == FixedNode)
         downcast<CoordinatedGraphicsLayer>(*static_cast<GraphicsLayer*>(node->layer())).setFixedToViewport(false);
 
@@ -73,7 +73,7 @@
 
 void ScrollingCoordinatorCoordinatedGraphics::updateNodeLayer(ScrollingNodeID nodeID, GraphicsLayer* graphicsLayer)
 {
-    ScrollingStateNode* node = m_scrollingStateTree->stateNodeForID(nodeID);
+    auto* node = m_scrollingStateTree->stateNodeForID(nodeID);
     if (!node)
         return;
 
@@ -82,7 +82,7 @@
 
 void ScrollingCoordinatorCoordinatedGraphics::updateNodeViewportConstraints(ScrollingNodeID nodeID, const ViewportConstraints& constraints)
 {
-    ScrollingStateNode* node = m_scrollingStateTree->stateNodeForID(nodeID);
+    auto* node = m_scrollingStateTree->stateNodeForID(nodeID);
     if (!node)
         return;
 
@@ -102,7 +102,7 @@
 
 void ScrollingCoordinatorCoordinatedGraphics::scrollableAreaScrollLayerDidChange(ScrollableArea& scrollableArea)
 {
-    CoordinatedGraphicsLayer* layer = downcast<CoordinatedGraphicsLayer>(scrollLayerForScrollableArea(scrollableArea));
+    auto* layer = downcast<CoordinatedGraphicsLayer>(scrollLayerForScrollableArea(scrollableArea));
     if (!layer)
         return;
 
@@ -111,7 +111,7 @@
 
 void ScrollingCoordinatorCoordinatedGraphics::willDestroyScrollableArea(ScrollableArea& scrollableArea)
 {
-    CoordinatedGraphicsLayer* layer = downcast<CoordinatedGraphicsLayer>(scrollLayerForScrollableArea(scrollableArea));
+    auto* layer = downcast<CoordinatedGraphicsLayer>(scrollLayerForScrollableArea(scrollableArea));
     if (!layer)
         return;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to