Title: [223240] trunk/Source/WebCore
Revision
223240
Author
[email protected]
Date
2017-10-12 10:42:12 -0700 (Thu, 12 Oct 2017)

Log Message

Use less specific cast in ScrollingTree::scrollPositionChangedViaDelegatedScrolling
https://bugs.webkit.org/show_bug.cgi?id=178211

Patch by Frederic Wang <[email protected]> on 2017-10-12
Reviewed by Simon Fraser.

No new tests, behavior is not changed.

ScrollingTree::scrollPositionChangedViaDelegatedScrolling is a generic function that applies
to scrolling nodes. Casting to more specific ScrollingTreeOverflowScrollingNodes is however
not necessary to implement it. This patch moves to the least specific cast necessary so that
this function will be usable for async scrolling of non-main frames in the future. Note that
the function is currently only called from ScrollingTreeScrollingNodeDelegateIOS which in
turn is only used by the ScrollingTreeScrollingOverflowNodeIOS class and so code behavior is
not changed.

* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling): Only cast the node to
ScrollingTreeScrollingNode.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (223239 => 223240)


--- trunk/Source/WebCore/ChangeLog	2017-10-12 16:02:45 UTC (rev 223239)
+++ trunk/Source/WebCore/ChangeLog	2017-10-12 17:42:12 UTC (rev 223240)
@@ -1,3 +1,24 @@
+2017-10-12  Frederic Wang  <[email protected]>
+
+        Use less specific cast in ScrollingTree::scrollPositionChangedViaDelegatedScrolling
+        https://bugs.webkit.org/show_bug.cgi?id=178211
+
+        Reviewed by Simon Fraser.
+
+        No new tests, behavior is not changed.
+
+        ScrollingTree::scrollPositionChangedViaDelegatedScrolling is a generic function that applies
+        to scrolling nodes. Casting to more specific ScrollingTreeOverflowScrollingNodes is however
+        not necessary to implement it. This patch moves to the least specific cast necessary so that
+        this function will be usable for async scrolling of non-main frames in the future. Note that
+        the function is currently only called from ScrollingTreeScrollingNodeDelegateIOS which in
+        turn is only used by the ScrollingTreeScrollingOverflowNodeIOS class and so code behavior is
+        not changed.
+
+        * page/scrolling/ScrollingTree.cpp:
+        (WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling): Only cast the node to
+        ScrollingTreeScrollingNode.
+
 2017-10-11  Sam Weinig  <[email protected]>
 
         Remove out-parameter variants of copyToVector

Modified: trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp (223239 => 223240)


--- trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp	2017-10-12 16:02:45 UTC (rev 223239)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp	2017-10-12 17:42:12 UTC (rev 223240)
@@ -34,7 +34,6 @@
 #include "ScrollingStateTree.h"
 #include "ScrollingTreeFrameScrollingNode.h"
 #include "ScrollingTreeNode.h"
-#include "ScrollingTreeOverflowScrollingNode.h"
 #include "ScrollingTreeScrollingNode.h"
 #include <wtf/SetForScope.h>
 #include <wtf/text/TextStream.h>
@@ -105,11 +104,11 @@
 void ScrollingTree::scrollPositionChangedViaDelegatedScrolling(ScrollingNodeID nodeID, const WebCore::FloatPoint& scrollPosition, bool inUserInteraction)
 {
     ScrollingTreeNode* node = nodeForID(nodeID);
-    if (!is<ScrollingTreeOverflowScrollingNode>(node))
+    if (!is<ScrollingTreeScrollingNode>(node))
         return;
 
     // Update descendant nodes
-    downcast<ScrollingTreeOverflowScrollingNode>(*node).updateLayersAfterDelegatedScroll(scrollPosition);
+    downcast<ScrollingTreeScrollingNode>(*node).updateLayersAfterDelegatedScroll(scrollPosition);
 
     // Update GraphicsLayers and scroll state.
     scrollingTreeNodeDidScroll(nodeID, scrollPosition, std::nullopt, inUserInteraction ? ScrollingLayerPositionAction::Sync : ScrollingLayerPositionAction::Set);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to