Title: [261849] trunk/Source/WebCore
Revision
261849
Author
simon.fra...@apple.com
Date
2020-05-18 22:09:33 -0700 (Mon, 18 May 2020)

Log Message

Move some of the more chatty Scrolling logging to a ScrollingTree channel
https://bugs.webkit.org/show_bug.cgi?id=212061

Reviewed by Tim Horton.

Move logging about the scrolling tree to a new channel.

* page/FrameView.cpp:
(WebCore::FrameView::scrollToFragmentInternal):
(WebCore::FrameView::scrollToAnchor):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::createNode):
(WebCore::AsyncScrollingCoordinator::insertNode):
* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::createUnparentedNode):
(WebCore::ScrollingStateTree::insertNode):
(WebCore::ScrollingStateTree::unparentNode):
(WebCore::ScrollingStateTree::unparentChildrenAndDestroyNode):
(WebCore::ScrollingStateTree::detachAndDestroySubtree):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::commitTreeState):
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::scrollTo):
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
* page/scrolling/cocoa/ScrollingTreeOverflowScrollProxyNode.mm:
(WebCore::ScrollingTreeOverflowScrollProxyNode::applyLayerPositions):
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::commitTreeStateIfNeeded):
* platform/Logging.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::attachScrollingNode):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (261848 => 261849)


--- trunk/Source/WebCore/ChangeLog	2020-05-19 04:59:16 UTC (rev 261848)
+++ trunk/Source/WebCore/ChangeLog	2020-05-19 05:09:33 UTC (rev 261849)
@@ -1,3 +1,38 @@
+2020-05-18  Simon Fraser  <simon.fra...@apple.com>
+
+        Move some of the more chatty Scrolling logging to a ScrollingTree channel
+        https://bugs.webkit.org/show_bug.cgi?id=212061
+
+        Reviewed by Tim Horton.
+
+        Move logging about the scrolling tree to a new channel.
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::scrollToFragmentInternal):
+        (WebCore::FrameView::scrollToAnchor):
+        * page/scrolling/AsyncScrollingCoordinator.cpp:
+        (WebCore::AsyncScrollingCoordinator::createNode):
+        (WebCore::AsyncScrollingCoordinator::insertNode):
+        * page/scrolling/ScrollingStateTree.cpp:
+        (WebCore::ScrollingStateTree::createUnparentedNode):
+        (WebCore::ScrollingStateTree::insertNode):
+        (WebCore::ScrollingStateTree::unparentNode):
+        (WebCore::ScrollingStateTree::unparentChildrenAndDestroyNode):
+        (WebCore::ScrollingStateTree::detachAndDestroySubtree):
+        * page/scrolling/ScrollingTree.cpp:
+        (WebCore::ScrollingTree::commitTreeState):
+        * page/scrolling/ScrollingTreeScrollingNode.cpp:
+        (WebCore::ScrollingTreeScrollingNode::scrollTo):
+        * page/scrolling/ThreadedScrollingTree.cpp:
+        (WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
+        * page/scrolling/cocoa/ScrollingTreeOverflowScrollProxyNode.mm:
+        (WebCore::ScrollingTreeOverflowScrollProxyNode::applyLayerPositions):
+        * page/scrolling/mac/ScrollingCoordinatorMac.mm:
+        (WebCore::ScrollingCoordinatorMac::commitTreeStateIfNeeded):
+        * platform/Logging.h:
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::attachScrollingNode):
+
 2020-05-18  David Kilzer  <ddkil...@apple.com>
 
         Replace TextIndicatorOptions with OptionSet<TextIndicatorOption>

Modified: trunk/Source/WebCore/page/FrameView.cpp (261848 => 261849)


--- trunk/Source/WebCore/page/FrameView.cpp	2020-05-19 04:59:16 UTC (rev 261848)
+++ trunk/Source/WebCore/page/FrameView.cpp	2020-05-19 05:09:33 UTC (rev 261849)
@@ -2195,12 +2195,12 @@
 
 bool FrameView::scrollToFragmentInternal(const String& fragmentIdentifier)
 {
-    LOG(Scrolling, "FrameView::scrollToFragmentInternal %s", fragmentIdentifier.utf8().data());
-
     // If our URL has no ref, then we have no place we need to jump to.
     if (fragmentIdentifier.isNull())
         return false;
 
+    LOG_WITH_STREAM(Scrolling, stream << *this << " scrollToFragmentInternal " << fragmentIdentifier);
+
     ASSERT(frame().document());
     auto& document = *frame().document();
     RELEASE_ASSERT(document.haveStylesheetsLoaded());
@@ -3148,14 +3148,14 @@
 void FrameView::scrollToAnchor()
 {
     RefPtr<ContainerNode> anchorNode = m_maintainScrollPositionAnchor;
-
-    LOG_WITH_STREAM(Scrolling, stream << "FrameView::scrollToAnchor() " << anchorNode.get());
-
     if (!anchorNode)
         return;
 
+    LOG_WITH_STREAM(Scrolling, stream << *this << " scrollToAnchor() " << anchorNode.get());
+
     if (!anchorNode->renderer())
         return;
+
     m_shouldScrollToFocusedElement = false;
     m_delayedScrollToFocusedElementTimer.stop();
 

Modified: trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp (261848 => 261849)


--- trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp	2020-05-19 04:59:16 UTC (rev 261848)
+++ trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp	2020-05-19 05:09:33 UTC (rev 261849)
@@ -555,13 +555,13 @@
 
 ScrollingNodeID AsyncScrollingCoordinator::createNode(ScrollingNodeType nodeType, ScrollingNodeID newNodeID)
 {
-    LOG_WITH_STREAM(Scrolling, stream << "AsyncScrollingCoordinator::createNode " << nodeType << " node " << newNodeID);
+    LOG_WITH_STREAM(ScrollingTree, stream << "AsyncScrollingCoordinator::createNode " << nodeType << " node " << newNodeID);
     return m_scrollingStateTree->createUnparentedNode(nodeType, newNodeID);
 }
 
 ScrollingNodeID AsyncScrollingCoordinator::insertNode(ScrollingNodeType nodeType, ScrollingNodeID newNodeID, ScrollingNodeID parentID, size_t childIndex)
 {
-    LOG_WITH_STREAM(Scrolling, stream << "AsyncScrollingCoordinator::insertNode " << nodeType << " node " << newNodeID << " parent " << parentID << " index " << childIndex);
+    LOG_WITH_STREAM(ScrollingTree, stream << "AsyncScrollingCoordinator::insertNode " << nodeType << " node " << newNodeID << " parent " << parentID << " index " << childIndex);
     return m_scrollingStateTree->insertNode(nodeType, newNodeID, parentID, childIndex);
 }
 

Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateTree.cpp (261848 => 261849)


--- trunk/Source/WebCore/page/scrolling/ScrollingStateTree.cpp	2020-05-19 04:59:16 UTC (rev 261848)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateTree.cpp	2020-05-19 05:09:33 UTC (rev 261849)
@@ -96,7 +96,7 @@
 
 ScrollingNodeID ScrollingStateTree::createUnparentedNode(ScrollingNodeType nodeType, ScrollingNodeID newNodeID)
 {
-    LOG_WITH_STREAM(Scrolling, stream << "ScrollingStateTree " << this << " createUnparentedNode " << newNodeID);
+    LOG_WITH_STREAM(ScrollingTree, stream << "ScrollingStateTree " << this << " createUnparentedNode " << newNodeID);
 
     if (auto* node = stateNodeForID(newNodeID)) {
         if (node->nodeType() == nodeType) {
@@ -122,7 +122,7 @@
 
 ScrollingNodeID ScrollingStateTree::insertNode(ScrollingNodeType nodeType, ScrollingNodeID newNodeID, ScrollingNodeID parentID, size_t childIndex)
 {
-    LOG_WITH_STREAM(Scrolling, stream << "ScrollingStateTree " << this << " insertNode " << newNodeID << " in parent " << parentID << " at " << childIndex);
+    LOG_WITH_STREAM(ScrollingTree, stream << "ScrollingStateTree " << this << " insertNode " << newNodeID << " in parent " << parentID << " at " << childIndex);
     ASSERT(newNodeID);
 
     if (auto* node = stateNodeForID(newNodeID)) {
@@ -176,7 +176,7 @@
 
         if (parentID) {
             if (auto unparentedNode = m_unparentedNodes.take(newNodeID)) {
-                LOG_WITH_STREAM(Scrolling, stream << "ScrollingStateTree " << this << " insertNode " << newNodeID << " getting node from unparented nodes");
+                LOG_WITH_STREAM(ScrollingTree, stream << "ScrollingStateTree " << this << " insertNode " << newNodeID << " getting node from unparented nodes");
                 newNode = unparentedNode.get();
                 nodeWasReattachedRecursive(*unparentedNode);
 
@@ -206,7 +206,7 @@
     if (!nodeID)
         return;
 
-    LOG_WITH_STREAM(Scrolling, stream << "ScrollingStateTree " << this << " unparentNode " << nodeID);
+    LOG_WITH_STREAM(ScrollingTree, stream << "ScrollingStateTree " << this << " unparentNode " << nodeID);
 
     // The node may not be found if clear() was recently called.
     auto protectedNode = m_stateNodeMap.get(nodeID);
@@ -225,7 +225,7 @@
     if (!nodeID)
         return;
 
-    LOG_WITH_STREAM(Scrolling, stream << "ScrollingStateTree " << this << " unparentChildrenAndDestroyNode " << nodeID);
+    LOG_WITH_STREAM(ScrollingTree, stream << "ScrollingStateTree " << this << " unparentChildrenAndDestroyNode " << nodeID);
 
     // The node may not be found if clear() was recently called.
     auto protectedNode = m_stateNodeMap.take(nodeID);
@@ -239,7 +239,7 @@
         auto isolatedChildren = protectedNode->takeChildren();
         for (auto child : *isolatedChildren) {
             child->removeFromParent();
-            LOG_WITH_STREAM(Scrolling, stream << " moving " << child->scrollingNodeID() << " to unparented nodes");
+            LOG_WITH_STREAM(ScrollingTree, stream << " moving " << child->scrollingNodeID() << " to unparented nodes");
             m_unparentedNodes.add(child->scrollingNodeID(), WTFMove(child));
         }
     }
@@ -253,7 +253,7 @@
     if (!nodeID)
         return;
 
-    LOG_WITH_STREAM(Scrolling, stream << "ScrollingStateTree " << this << " detachAndDestroySubtree " << nodeID);
+    LOG_WITH_STREAM(ScrollingTree, stream << "ScrollingStateTree " << this << " detachAndDestroySubtree " << nodeID);
 
     // The node may not be found if clear() was recently called.
     auto node = m_stateNodeMap.take(nodeID);

Modified: trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp (261848 => 261849)


--- trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp	2020-05-19 04:59:16 UTC (rev 261848)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp	2020-05-19 05:09:33 UTC (rev 261849)
@@ -218,7 +218,7 @@
 
     bool rootStateNodeChanged = scrollingStateTree->hasNewRootStateNode();
     
-    LOG(Scrolling, "\nScrollingTree %p commitTreeState", this);
+    LOG(ScrollingTree, "\nScrollingTree %p commitTreeState", this);
     
     auto* rootNode = scrollingStateTree->rootStateNode();
     if (rootNode
@@ -260,7 +260,7 @@
         m_nodeMap.remove(nodeID);
     }
 
-    LOG_WITH_STREAM(Scrolling, stream << "committed ScrollingTree" << scrollingTreeAsText(ScrollingStateTreeAsTextBehaviorDebug));
+    LOG_WITH_STREAM(ScrollingTree, stream << "committed ScrollingTree" << scrollingTreeAsText(ScrollingStateTreeAsTextBehaviorDebug));
 }
 
 void ScrollingTree::updateTreeFromStateNodeRecursive(const ScrollingStateNode* stateNode, CommitTreeState& state)

Modified: trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp (261848 => 261849)


--- trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp	2020-05-19 04:59:16 UTC (rev 261848)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp	2020-05-19 05:09:33 UTC (rev 261849)
@@ -239,7 +239,7 @@
     
     m_currentScrollPosition = adjustedScrollPosition(position, clamp);
     
-    LOG_WITH_STREAM(Scrolling, stream << "ScrollingTreeScrollingNode " << scrollingNodeID() << " scrollTo " << position << " (delta from last committed position " << (m_lastCommittedScrollPosition - m_currentScrollPosition) << ")");
+    LOG_WITH_STREAM(Scrolling, stream << "ScrollingTreeScrollingNode " << scrollingNodeID() << " scrollTo " << position << " (" << scrollType << ") (delta from last committed position " << (m_lastCommittedScrollPosition - m_currentScrollPosition) << ")");
 
     updateViewportForCurrentScrollPosition();
     currentScrollPositionChanged();

Modified: trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp (261848 => 261849)


--- trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp	2020-05-19 04:59:16 UTC (rev 261848)
+++ trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp	2020-05-19 05:09:33 UTC (rev 261849)
@@ -29,6 +29,7 @@
 #if ENABLE(ASYNC_SCROLLING) && ENABLE(SCROLLING_THREAD)
 
 #include "AsyncScrollingCoordinator.h"
+#include "Logging.h"
 #include "PlatformWheelEvent.h"
 #include "ScrollingThread.h"
 #include "ScrollingTreeFrameScrollingNode.h"
@@ -37,6 +38,7 @@
 #include "ScrollingTreeScrollingNode.h"
 #include <wtf/RunLoop.h>
 #include <wtf/SetForScope.h>
+#include <wtf/text/TextStream.h>
 
 namespace WebCore {
 
@@ -139,6 +141,8 @@
         deferWheelEventTestCompletionForReason(reinterpret_cast<WheelEventTestMonitor::ScrollableAreaIdentifier>(node.scrollingNodeID()), WheelEventTestMonitor::ScrollingThreadSyncNeeded);
 #endif
 
+    LOG_WITH_STREAM(Scrolling, stream << "ThreadedScrollingTree::scrollingTreeNodeDidScroll " << node.scrollingNodeID() << " to " << scrollPosition << " bouncing to main thread");
+
     RunLoop::main().dispatch([strongThis = makeRef(*this), nodeID = node.scrollingNodeID(), scrollPosition, layoutViewportOrigin, scrollingLayerPositionAction] {
         if (auto* scrollingCoordinator = strongThis->m_scrollingCoordinator.get())
             scrollingCoordinator->scheduleUpdateScrollPositionAfterAsyncScroll(nodeID, scrollPosition, layoutViewportOrigin, scrollingLayerPositionAction);

Modified: trunk/Source/WebCore/page/scrolling/cocoa/ScrollingTreeOverflowScrollProxyNode.mm (261848 => 261849)


--- trunk/Source/WebCore/page/scrolling/cocoa/ScrollingTreeOverflowScrollProxyNode.mm	2020-05-19 04:59:16 UTC (rev 261848)
+++ trunk/Source/WebCore/page/scrolling/cocoa/ScrollingTreeOverflowScrollProxyNode.mm	2020-05-19 05:09:33 UTC (rev 261849)
@@ -87,7 +87,7 @@
         }
     }
 
-    LOG_WITH_STREAM(Scrolling, stream << "ScrollingTreeOverflowScrollProxyNode " << scrollingNodeID() << " applyLayerPositions: setting bounds origin to " << scrollOffset);
+    LOG_WITH_STREAM(ScrollingTree, stream << "ScrollingTreeOverflowScrollProxyNode " << scrollingNodeID() << " applyLayerPositions: setting bounds origin to " << scrollOffset);
     [m_layer _web_setLayerBoundsOrigin:scrollOffset];
 }
 

Modified: trunk/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm (261848 => 261849)


--- trunk/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm	2020-05-19 04:59:16 UTC (rev 261848)
+++ trunk/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm	2020-05-19 05:09:33 UTC (rev 261849)
@@ -102,7 +102,7 @@
     if (!scrollingStateTree()->hasChangedProperties())
         return;
 
-    LOG_WITH_STREAM(Scrolling, stream << scrollingStateTreeAsText(ScrollingStateTreeAsTextBehaviorDebug));
+    LOG_WITH_STREAM(ScrollingTree, stream << scrollingStateTreeAsText(ScrollingStateTreeAsTextBehaviorDebug));
 
     auto stateTree = scrollingStateTree()->commit(LayerRepresentation::PlatformLayerRepresentation);
     scrollingTree()->commitTreeState(WTFMove(stateTree));

Modified: trunk/Source/WebCore/platform/Logging.h (261848 => 261849)


--- trunk/Source/WebCore/platform/Logging.h	2020-05-19 04:59:16 UTC (rev 261848)
+++ trunk/Source/WebCore/platform/Logging.h	2020-05-19 05:09:33 UTC (rev 261849)
@@ -95,6 +95,7 @@
     M(ResourceLoadObserver) \
     M(ResourceLoadStatistics) \
     M(Scrolling) \
+    M(ScrollingTree) \
     M(ScrollLatching) \
     M(Selection) \
     M(Services) \

Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (261848 => 261849)


--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2020-05-19 04:59:16 UTC (rev 261848)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2020-05-19 05:09:33 UTC (rev 261849)
@@ -4311,7 +4311,7 @@
     
     nodeID = registerScrollingNodeID(*scrollingCoordinator, nodeID, nodeType, treeState);
 
-    LOG_WITH_STREAM(Scrolling, stream << "RenderLayerCompositor " << this << " attachScrollingNode " << nodeID << " (layer " << backing->graphicsLayer()->primaryLayerID() << ") type " << nodeType << " parent " << treeState.parentNodeID.valueOr(0));
+    LOG_WITH_STREAM(ScrollingTree, stream << "RenderLayerCompositor " << this << " attachScrollingNode " << nodeID << " (layer " << backing->graphicsLayer()->primaryLayerID() << ") type " << nodeType << " parent " << treeState.parentNodeID.valueOr(0));
 
     if (!nodeID)
         return 0;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to