Diff
Modified: trunk/Source/WebCore/ChangeLog (174339 => 174340)
--- trunk/Source/WebCore/ChangeLog 2014-10-06 05:13:09 UTC (rev 174339)
+++ trunk/Source/WebCore/ChangeLog 2014-10-06 05:14:36 UTC (rev 174340)
@@ -1,5 +1,50 @@
2014-10-05 Christophe Dumez <cdu...@apple.com>
+ Use is<>() / downcast<>() for ScrollingCoordinator / ScrollingStateNode subclasses
+ https://bugs.webkit.org/show_bug.cgi?id=137440
+
+ Reviewed by Ryosuke Niwa.
+
+ Use is<>() / downcast<>() for ScrollingCoordinator / ScrollingStateNode subclasses.
+
+ No new tests, no behavior change.
+
+ * page/scrolling/AsyncScrollingCoordinator.cpp:
+ (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
+ (WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
+ (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
+ (WebCore::AsyncScrollingCoordinator::updateFrameScrollingNode):
+ (WebCore::AsyncScrollingCoordinator::updateOverflowScrollingNode):
+ (WebCore::AsyncScrollingCoordinator::updateViewportConstrainedNode):
+ (WebCore::AsyncScrollingCoordinator::recomputeWheelEventHandlerCountForFrameView):
+ * page/scrolling/AsyncScrollingCoordinator.h:
+ * page/scrolling/ScrollingCoordinator.h:
+ * page/scrolling/ScrollingStateFixedNode.h:
+ * page/scrolling/ScrollingStateFrameScrollingNode.h:
+ * page/scrolling/ScrollingStateNode.h:
+ * page/scrolling/ScrollingStateOverflowScrollingNode.h:
+ * page/scrolling/ScrollingStateScrollingNode.h:
+ * page/scrolling/ScrollingStateStickyNode.h:
+ * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
+ (WebCore::ScrollingTreeFrameScrollingNode::updateBeforeChildren):
+ * page/scrolling/ScrollingTreeScrollingNode.cpp:
+ (WebCore::ScrollingTreeScrollingNode::updateBeforeChildren):
+ (WebCore::ScrollingTreeScrollingNode::updateAfterChildren):
+ * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
+ (WebCore::ScrollingCoordinatorCoordinatedGraphics::updateViewportConstrainedNode):
+ * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
+ (WebCore::ScrollingTreeFrameScrollingNodeIOS::updateBeforeChildren):
+ (WebCore::ScrollingTreeFrameScrollingNodeIOS::updateAfterChildren):
+ * page/scrolling/mac/ScrollingTreeFixedNode.mm:
+ (WebCore::ScrollingTreeFixedNode::updateBeforeChildren):
+ * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
+ (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren):
+ (WebCore::ScrollingTreeFrameScrollingNodeMac::updateAfterChildren):
+ * page/scrolling/mac/ScrollingTreeStickyNode.mm:
+ (WebCore::ScrollingTreeStickyNode::updateBeforeChildren):
+
+2014-10-05 Christophe Dumez <cdu...@apple.com>
+
Use is<>() / downcast<>() for CachedRawResource
https://bugs.webkit.org/show_bug.cgi?id=137439
Modified: trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp (174339 => 174340)
--- trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp 2014-10-06 05:13:09 UTC (rev 174339)
+++ trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp 2014-10-06 05:14:36 UTC (rev 174340)
@@ -93,7 +93,7 @@
if (!coordinatesScrollingForFrameView(frameView))
return;
- ScrollingStateFrameScrollingNode* node = toScrollingStateFrameScrollingNode(m_scrollingStateTree->stateNodeForID(frameView->scrollLayerID()));
+ ScrollingStateFrameScrollingNode* node = downcast<ScrollingStateFrameScrollingNode>(m_scrollingStateTree->stateNodeForID(frameView->scrollLayerID()));
if (!node)
return;
@@ -158,7 +158,7 @@
ScrollingCoordinator::frameViewRootLayerDidChange(frameView);
- ScrollingStateFrameScrollingNode* node = toScrollingStateFrameScrollingNode(m_scrollingStateTree->stateNodeForID(frameView->scrollLayerID()));
+ ScrollingStateFrameScrollingNode* node = downcast<ScrollingStateFrameScrollingNode>(m_scrollingStateTree->stateNodeForID(frameView->scrollLayerID()));
node->setLayer(scrollLayerForFrameView(frameView));
node->setScrolledContentsLayer(rootContentLayerForFrameView(frameView));
node->setCounterScrollingLayer(counterScrollingLayerForFrameView(frameView));
@@ -185,7 +185,7 @@
if (frameView->frame().document()->inPageCache())
return true;
- ScrollingStateScrollingNode* stateNode = toScrollingStateScrollingNode(m_scrollingStateTree->stateNodeForID(frameView->scrollLayerID()));
+ ScrollingStateScrollingNode* stateNode = downcast<ScrollingStateScrollingNode>(m_scrollingStateTree->stateNodeForID(frameView->scrollLayerID()));
if (!stateNode)
return false;
@@ -387,7 +387,7 @@
void AsyncScrollingCoordinator::updateFrameScrollingNode(ScrollingNodeID nodeID, GraphicsLayer* layer, GraphicsLayer* scrolledContentsLayer, GraphicsLayer* counterScrollingLayer, GraphicsLayer* insetClipLayer, const ScrollingGeometry* scrollingGeometry)
{
- ScrollingStateFrameScrollingNode* node = toScrollingStateFrameScrollingNode(m_scrollingStateTree->stateNodeForID(nodeID));
+ ScrollingStateFrameScrollingNode* node = downcast<ScrollingStateFrameScrollingNode>(m_scrollingStateTree->stateNodeForID(nodeID));
ASSERT(node);
if (!node)
return;
@@ -408,7 +408,7 @@
void AsyncScrollingCoordinator::updateOverflowScrollingNode(ScrollingNodeID nodeID, GraphicsLayer* layer, GraphicsLayer* scrolledContentsLayer, const ScrollingGeometry* scrollingGeometry)
{
- ScrollingStateOverflowScrollingNode* node = toScrollingStateOverflowScrollingNode(m_scrollingStateTree->stateNodeForID(nodeID));
+ ScrollingStateOverflowScrollingNode* node = downcast<ScrollingStateOverflowScrollingNode>(m_scrollingStateTree->stateNodeForID(nodeID));
ASSERT(node);
if (!node)
return;
@@ -439,15 +439,15 @@
switch (constraints.constraintType()) {
case ViewportConstraints::FixedPositionConstraint: {
- ScrollingStateFixedNode* fixedNode = toScrollingStateFixedNode(node);
- fixedNode->setLayer(graphicsLayer);
- fixedNode->updateConstraints((const FixedPositionViewportConstraints&)constraints);
+ ScrollingStateFixedNode& fixedNode = downcast<ScrollingStateFixedNode>(*node);
+ fixedNode.setLayer(graphicsLayer);
+ fixedNode.updateConstraints((const FixedPositionViewportConstraints&)constraints);
break;
}
case ViewportConstraints::StickyPositionConstraint: {
- ScrollingStateStickyNode* stickyNode = toScrollingStateStickyNode(node);
- stickyNode->setLayer(graphicsLayer);
- stickyNode->updateConstraints((const StickyPositionViewportConstraints&)constraints);
+ ScrollingStateStickyNode& stickyNode = downcast<ScrollingStateStickyNode>(*node);
+ stickyNode.setLayer(graphicsLayer);
+ stickyNode.updateConstraints((const StickyPositionViewportConstraints&)constraints);
break;
}
}
@@ -483,7 +483,7 @@
void AsyncScrollingCoordinator::recomputeWheelEventHandlerCountForFrameView(FrameView* frameView)
{
- ScrollingStateFrameScrollingNode* node = toScrollingStateFrameScrollingNode(m_scrollingStateTree->stateNodeForID(frameView->scrollLayerID()));
+ ScrollingStateFrameScrollingNode* node = downcast<ScrollingStateFrameScrollingNode>(m_scrollingStateTree->stateNodeForID(frameView->scrollLayerID()));
if (!node)
return;
node->setWheelEventHandlerCount(computeCurrentWheelEventHandlerCount());
Modified: trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h (174339 => 174340)
--- trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h 2014-10-06 05:13:09 UTC (rev 174339)
+++ trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h 2014-10-06 05:14:36 UTC (rev 174340)
@@ -144,10 +144,10 @@
RefPtr<ScrollingTree> m_scrollingTree;
};
-SCROLLING_COORDINATOR_TYPE_CASTS(AsyncScrollingCoordinator, isAsyncScrollingCoordinator());
-
} // namespace WebCore
+SPECIALIZE_TYPE_TRAITS_SCROLLING_COORDINATOR(WebCore::AsyncScrollingCoordinator, isAsyncScrollingCoordinator());
+
#endif // ENABLE(ASYNC_SCROLLING)
#endif // AsyncScrollingCoordinator_h
Modified: trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h (174339 => 174340)
--- trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h 2014-10-06 05:13:09 UTC (rev 174339)
+++ trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h 2014-10-06 05:14:36 UTC (rev 174340)
@@ -32,6 +32,7 @@
#include "RenderObject.h"
#include "ScrollTypes.h"
#include <wtf/Forward.h>
+#include <wtf/TypeCasts.h>
#if ENABLE(ASYNC_SCROLLING)
#include <wtf/HashMap.h>
@@ -232,9 +233,11 @@
bool m_forceSynchronousScrollLayerPositionUpdates;
};
-#define SCROLLING_COORDINATOR_TYPE_CASTS(ToValueTypeName, predicate) \
- TYPE_CASTS_BASE(ToValueTypeName, WebCore::ScrollingCoordinator, value, value->predicate, value.predicate)
-
} // namespace WebCore
+#define SPECIALIZE_TYPE_TRAITS_SCROLLING_COORDINATOR(ToValueTypeName, predicate) \
+SPECIALIZE_TYPE_TRAITS_BEGIN(ToValueTypeName) \
+ static bool isType(const WebCore::ScrollingCoordinator& value) { return value.predicate; } \
+SPECIALIZE_TYPE_TRAITS_END()
+
#endif // ScrollingCoordinator_h
Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateFixedNode.h (174339 => 174340)
--- trunk/Source/WebCore/page/scrolling/ScrollingStateFixedNode.h 2014-10-06 05:13:09 UTC (rev 174339)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateFixedNode.h 2014-10-06 05:14:36 UTC (rev 174340)
@@ -63,10 +63,10 @@
FixedPositionViewportConstraints m_constraints;
};
-SCROLLING_STATE_NODE_TYPE_CASTS(ScrollingStateFixedNode, isFixedNode());
-
} // namespace WebCore
+SPECIALIZE_TYPE_TRAITS_SCROLLING_STATE_NODE(ScrollingStateFixedNode, isFixedNode())
+
#endif // ENABLE(ASYNC_SCROLLING) || USE(COORDINATED_GRAPHICS)
#endif // ScrollingStateFixedNode_h
Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h (174339 => 174340)
--- trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h 2014-10-06 05:13:09 UTC (rev 174339)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h 2014-10-06 05:14:36 UTC (rev 174340)
@@ -149,10 +149,10 @@
float m_topContentInset;
};
-SCROLLING_STATE_NODE_TYPE_CASTS(ScrollingStateFrameScrollingNode, isFrameScrollingNode());
-
} // namespace WebCore
+SPECIALIZE_TYPE_TRAITS_SCROLLING_STATE_NODE(ScrollingStateFrameScrollingNode, isFrameScrollingNode())
+
#endif // ENABLE(ASYNC_SCROLLING) || USE(COORDINATED_GRAPHICS)
#endif // ScrollingStateFrameScrollingNode_h
Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateNode.h (174339 => 174340)
--- trunk/Source/WebCore/page/scrolling/ScrollingStateNode.h 2014-10-06 05:13:09 UTC (rev 174339)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateNode.h 2014-10-06 05:14:36 UTC (rev 174340)
@@ -32,6 +32,7 @@
#include "ScrollingCoordinator.h"
#include <wtf/OwnPtr.h>
#include <wtf/RefCounted.h>
+#include <wtf/TypeCasts.h>
#include <wtf/Vector.h>
namespace WebCore {
@@ -254,11 +255,13 @@
LayerRepresentation m_layer;
};
-#define SCROLLING_STATE_NODE_TYPE_CASTS(ToValueTypeName, predicate) \
- TYPE_CASTS_BASE(ToValueTypeName, ScrollingStateNode, value, value->predicate, value.predicate)
-
} // namespace WebCore
+#define SPECIALIZE_TYPE_TRAITS_SCROLLING_STATE_NODE(ToValueTypeName, predicate) \
+SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::ToValueTypeName) \
+ static bool isType(const WebCore::ScrollingStateNode& node) { return node.predicate; } \
+SPECIALIZE_TYPE_TRAITS_END()
+
#endif // ENABLE(ASYNC_SCROLLING) || USE(COORDINATED_GRAPHICS)
#endif // ScrollingStateNode_h
Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateOverflowScrollingNode.h (174339 => 174340)
--- trunk/Source/WebCore/page/scrolling/ScrollingStateOverflowScrollingNode.h 2014-10-06 05:13:09 UTC (rev 174339)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateOverflowScrollingNode.h 2014-10-06 05:14:36 UTC (rev 174340)
@@ -57,10 +57,10 @@
LayerRepresentation m_scrolledContentsLayer;
};
-SCROLLING_STATE_NODE_TYPE_CASTS(ScrollingStateOverflowScrollingNode, isOverflowScrollingNode());
-
} // namespace WebCore
+SPECIALIZE_TYPE_TRAITS_SCROLLING_STATE_NODE(ScrollingStateOverflowScrollingNode, isOverflowScrollingNode())
+
#endif // ENABLE(ASYNC_SCROLLING) || USE(COORDINATED_GRAPHICS)
#endif // ScrollingStateScrollingNode_h
Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h (174339 => 174340)
--- trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h 2014-10-06 05:13:09 UTC (rev 174339)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h 2014-10-06 05:14:36 UTC (rev 174340)
@@ -105,10 +105,10 @@
bool m_requestedScrollPositionRepresentsProgrammaticScroll;
};
-SCROLLING_STATE_NODE_TYPE_CASTS(ScrollingStateScrollingNode, isScrollingNode());
-
} // namespace WebCore
+SPECIALIZE_TYPE_TRAITS_SCROLLING_STATE_NODE(ScrollingStateScrollingNode, isScrollingNode())
+
#endif // ENABLE(ASYNC_SCROLLING) || USE(COORDINATED_GRAPHICS)
#endif // ScrollingStateScrollingNode_h
Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateStickyNode.h (174339 => 174340)
--- trunk/Source/WebCore/page/scrolling/ScrollingStateStickyNode.h 2014-10-06 05:13:09 UTC (rev 174339)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateStickyNode.h 2014-10-06 05:14:36 UTC (rev 174340)
@@ -63,10 +63,10 @@
StickyPositionViewportConstraints m_constraints;
};
-SCROLLING_STATE_NODE_TYPE_CASTS(ScrollingStateStickyNode, isStickyNode());
-
} // namespace WebCore
+SPECIALIZE_TYPE_TRAITS_SCROLLING_STATE_NODE(ScrollingStateStickyNode, isStickyNode())
+
#endif // ENABLE(ASYNC_SCROLLING) || USE(COORDINATED_GRAPHICS)
#endif // ScrollingStateStickyNode_h
Modified: trunk/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.cpp (174339 => 174340)
--- trunk/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.cpp 2014-10-06 05:13:09 UTC (rev 174339)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.cpp 2014-10-06 05:14:36 UTC (rev 174340)
@@ -52,7 +52,7 @@
{
ScrollingTreeScrollingNode::updateBeforeChildren(stateNode);
- const ScrollingStateFrameScrollingNode& state = toScrollingStateFrameScrollingNode(stateNode);
+ const ScrollingStateFrameScrollingNode& state = downcast<ScrollingStateFrameScrollingNode>(stateNode);
if (state.hasChangedProperty(ScrollingStateFrameScrollingNode::FrameScaleFactor))
m_frameScaleFactor = state.frameScaleFactor();
Modified: trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp (174339 => 174340)
--- trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp 2014-10-06 05:13:09 UTC (rev 174339)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp 2014-10-06 05:14:36 UTC (rev 174340)
@@ -44,7 +44,7 @@
void ScrollingTreeScrollingNode::updateBeforeChildren(const ScrollingStateNode& stateNode)
{
- const ScrollingStateScrollingNode& state = toScrollingStateScrollingNode(stateNode);
+ const ScrollingStateScrollingNode& state = downcast<ScrollingStateScrollingNode>(stateNode);
if (state.hasChangedProperty(ScrollingStateScrollingNode::ScrollableAreaSize))
m_scrollableAreaSize = state.scrollableAreaSize();
@@ -81,7 +81,7 @@
void ScrollingTreeScrollingNode::updateAfterChildren(const ScrollingStateNode& stateNode)
{
- const ScrollingStateScrollingNode& scrollingStateNode = toScrollingStateScrollingNode(stateNode);
+ const ScrollingStateScrollingNode& scrollingStateNode = downcast<ScrollingStateScrollingNode>(stateNode);
if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::RequestedScrollPosition))
scrollingTree().scrollingTreeNodeRequestsScroll(scrollingNodeID(), scrollingStateNode.requestedScrollPosition(), scrollingStateNode.requestedScrollPositionRepresentsProgrammaticScroll());
}
Modified: trunk/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp (174339 => 174340)
--- trunk/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp 2014-10-06 05:13:09 UTC (rev 174339)
+++ trunk/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp 2014-10-06 05:14:36 UTC (rev 174340)
@@ -84,8 +84,7 @@
switch (constraints.constraintType()) {
case ViewportConstraints::FixedPositionConstraint: {
toCoordinatedGraphicsLayer(graphicsLayer)->setFixedToViewport(true); // FIXME : Use constraints!
- ScrollingStateFixedNode* fixedNode = toScrollingStateFixedNode(node);
- fixedNode->setLayer(graphicsLayer);
+ downcast<ScrollingStateFixedNode>(*node).setLayer(graphicsLayer);
break;
}
case ViewportConstraints::StickyPositionConstraint:
Modified: trunk/Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm (174339 => 174340)
--- trunk/Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm 2014-10-06 05:13:09 UTC (rev 174339)
+++ trunk/Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm 2014-10-06 05:14:36 UTC (rev 174340)
@@ -58,7 +58,7 @@
{
ScrollingTreeFrameScrollingNode::updateBeforeChildren(stateNode);
- const auto& scrollingStateNode = toScrollingStateFrameScrollingNode(stateNode);
+ const auto& scrollingStateNode = downcast<ScrollingStateFrameScrollingNode>(stateNode);
if (scrollingStateNode.hasChangedProperty(ScrollingStateNode::ScrollLayer))
m_scrollLayer = scrollingStateNode.layer();
@@ -90,7 +90,7 @@
{
ScrollingTreeFrameScrollingNode::updateAfterChildren(stateNode);
- const auto& scrollingStateNode = toScrollingStateFrameScrollingNode(stateNode);
+ const auto& scrollingStateNode = downcast<ScrollingStateFrameScrollingNode>(stateNode);
// Update the scroll position after child nodes have been updated, because they need to have updated their constraints before any scrolling happens.
if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::RequestedScrollPosition))
Modified: trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFixedNode.mm (174339 => 174340)
--- trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFixedNode.mm 2014-10-06 05:13:09 UTC (rev 174339)
+++ trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFixedNode.mm 2014-10-06 05:14:36 UTC (rev 174340)
@@ -52,7 +52,7 @@
void ScrollingTreeFixedNode::updateBeforeChildren(const ScrollingStateNode& stateNode)
{
- const ScrollingStateFixedNode& fixedStateNode = toScrollingStateFixedNode(stateNode);
+ const ScrollingStateFixedNode& fixedStateNode = downcast<ScrollingStateFixedNode>(stateNode);
if (fixedStateNode.hasChangedProperty(ScrollingStateNode::ScrollLayer))
m_layer = fixedStateNode.layer();
Modified: trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm (174339 => 174340)
--- trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm 2014-10-06 05:13:09 UTC (rev 174339)
+++ trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm 2014-10-06 05:14:36 UTC (rev 174340)
@@ -73,7 +73,7 @@
void ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren(const ScrollingStateNode& stateNode)
{
ScrollingTreeFrameScrollingNode::updateBeforeChildren(stateNode);
- const auto& scrollingStateNode = toScrollingStateFrameScrollingNode(stateNode);
+ const auto& scrollingStateNode = downcast<ScrollingStateFrameScrollingNode>(stateNode);
if (scrollingStateNode.hasChangedProperty(ScrollingStateNode::ScrollLayer))
m_scrollLayer = scrollingStateNode.layer();
@@ -127,7 +127,7 @@
{
ScrollingTreeFrameScrollingNode::updateAfterChildren(stateNode);
- const auto& scrollingStateNode = toScrollingStateScrollingNode(stateNode);
+ const auto& scrollingStateNode = downcast<ScrollingStateScrollingNode>(stateNode);
// Update the scroll position after child nodes have been updated, because they need to have updated their constraints before any scrolling happens.
if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::RequestedScrollPosition))
Modified: trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeStickyNode.mm (174339 => 174340)
--- trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeStickyNode.mm 2014-10-06 05:13:09 UTC (rev 174339)
+++ trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeStickyNode.mm 2014-10-06 05:14:36 UTC (rev 174340)
@@ -53,7 +53,7 @@
void ScrollingTreeStickyNode::updateBeforeChildren(const ScrollingStateNode& stateNode)
{
- const ScrollingStateStickyNode& stickyStateNode = toScrollingStateStickyNode(stateNode);
+ const ScrollingStateStickyNode& stickyStateNode = downcast<ScrollingStateStickyNode>(stateNode);
if (stickyStateNode.hasChangedProperty(ScrollingStateNode::ScrollLayer))
m_layer = stickyStateNode.layer();
Modified: trunk/Source/WebKit2/ChangeLog (174339 => 174340)
--- trunk/Source/WebKit2/ChangeLog 2014-10-06 05:13:09 UTC (rev 174339)
+++ trunk/Source/WebKit2/ChangeLog 2014-10-06 05:14:36 UTC (rev 174340)
@@ -1,3 +1,31 @@
+2014-10-05 Christophe Dumez <cdu...@apple.com>
+
+ Use is<>() / downcast<>() for ScrollingCoordinator / ScrollingStateNode subclasses
+ https://bugs.webkit.org/show_bug.cgi?id=137440
+
+ Reviewed by Ryosuke Niwa.
+
+ Use is<>() / downcast<>() for ScrollingCoordinator / ScrollingStateNode subclasses.
+
+ * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
+ (WebKit::encodeNodeAndDescendants):
+ (WebKit::RemoteScrollingCoordinatorTransaction::decode):
+ (WebKit::RemoteScrollingTreeTextStream::dump):
+ * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
+ (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
+ * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
+ (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateBeforeChildren):
+ (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren):
+ * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
+ (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
+ * WebProcess/Scrolling/RemoteScrollingCoordinator.h:
+ * WebProcess/WebPage/EventDispatcher.cpp:
+ (WebKit::EventDispatcher::addScrollingTreeForPage):
+ * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
+ (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
+ * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+ (WebKit::TiledCoreAnimationDrawingArea::updatePreferences):
+
2014-10-05 Ryuan Choi <ryuan.c...@gmail.com>
[EFL] Introduce EWebKit_Extension
Modified: trunk/Source/WebKit2/Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp (174339 => 174340)
--- trunk/Source/WebKit2/Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp 2014-10-06 05:13:09 UTC (rev 174339)
+++ trunk/Source/WebKit2/Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp 2014-10-06 05:14:36 UTC (rev 174340)
@@ -333,16 +333,16 @@
switch (stateNode.nodeType()) {
case FrameScrollingNode:
- encoder << toScrollingStateFrameScrollingNode(stateNode);
+ encoder << downcast<ScrollingStateFrameScrollingNode>(stateNode);
break;
case OverflowScrollingNode:
- encoder << toScrollingStateOverflowScrollingNode(stateNode);
+ encoder << downcast<ScrollingStateOverflowScrollingNode>(stateNode);
break;
case FixedNode:
- encoder << toScrollingStateFixedNode(stateNode);
+ encoder << downcast<ScrollingStateFixedNode>(stateNode);
break;
case StickyNode:
- encoder << toScrollingStateStickyNode(stateNode);
+ encoder << downcast<ScrollingStateStickyNode>(stateNode);
break;
}
@@ -417,19 +417,19 @@
switch (nodeType) {
case FrameScrollingNode:
- if (!decoder.decode(*toScrollingStateFrameScrollingNode(newNode)))
+ if (!decoder.decode(downcast<ScrollingStateFrameScrollingNode>(*newNode)))
return false;
break;
case OverflowScrollingNode:
- if (!decoder.decode(*toScrollingStateOverflowScrollingNode(newNode)))
+ if (!decoder.decode(downcast<ScrollingStateOverflowScrollingNode>(*newNode)))
return false;
break;
case FixedNode:
- if (!decoder.decode(*toScrollingStateFixedNode(newNode)))
+ if (!decoder.decode(downcast<ScrollingStateFixedNode>(*newNode)))
return false;
break;
case StickyNode:
- if (!decoder.decode(*toScrollingStateStickyNode(newNode)))
+ if (!decoder.decode(downcast<ScrollingStateStickyNode>(*newNode)))
return false;
break;
}
@@ -556,16 +556,16 @@
switch (node.nodeType()) {
case FrameScrollingNode:
- dump(toScrollingStateFrameScrollingNode(node), changedPropertiesOnly);
+ dump(downcast<ScrollingStateFrameScrollingNode>(node), changedPropertiesOnly);
break;
case OverflowScrollingNode:
- dump(toScrollingStateOverflowScrollingNode(node), changedPropertiesOnly);
+ dump(downcast<ScrollingStateOverflowScrollingNode>(node), changedPropertiesOnly);
break;
case FixedNode:
- dump(toScrollingStateFixedNode(node), changedPropertiesOnly);
+ dump(downcast<ScrollingStateFixedNode>(node), changedPropertiesOnly);
break;
case StickyNode:
- dump(toScrollingStateStickyNode(node), changedPropertiesOnly);
+ dump(downcast<ScrollingStateStickyNode>(node), changedPropertiesOnly);
break;
}
}
Modified: trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp (174339 => 174340)
--- trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp 2014-10-06 05:13:09 UTC (rev 174339)
+++ trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp 2014-10-06 05:14:36 UTC (rev 174340)
@@ -105,33 +105,33 @@
switch (currNode->nodeType()) {
case FrameScrollingNode: {
- ScrollingStateFrameScrollingNode* scrollingStateNode = toScrollingStateFrameScrollingNode(currNode);
+ ScrollingStateFrameScrollingNode& scrollingStateNode = downcast<ScrollingStateFrameScrollingNode>(*currNode);
- if (scrollingStateNode->hasChangedProperty(ScrollingStateFrameScrollingNode::ScrolledContentsLayer))
- scrollingStateNode->setScrolledContentsLayer(layerTreeHost.getLayer(scrollingStateNode->scrolledContentsLayer()));
+ if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::ScrolledContentsLayer))
+ scrollingStateNode.setScrolledContentsLayer(layerTreeHost.getLayer(scrollingStateNode.scrolledContentsLayer()));
- if (scrollingStateNode->hasChangedProperty(ScrollingStateFrameScrollingNode::CounterScrollingLayer))
- scrollingStateNode->setCounterScrollingLayer(layerTreeHost.getLayer(scrollingStateNode->counterScrollingLayer()));
+ if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::CounterScrollingLayer))
+ scrollingStateNode.setCounterScrollingLayer(layerTreeHost.getLayer(scrollingStateNode.counterScrollingLayer()));
- if (scrollingStateNode->hasChangedProperty(ScrollingStateFrameScrollingNode::InsetClipLayer))
- scrollingStateNode->setInsetClipLayer(layerTreeHost.getLayer(scrollingStateNode->insetClipLayer()));
+ if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::InsetClipLayer))
+ scrollingStateNode.setInsetClipLayer(layerTreeHost.getLayer(scrollingStateNode.insetClipLayer()));
- if (scrollingStateNode->hasChangedProperty(ScrollingStateFrameScrollingNode::ContentShadowLayer))
- scrollingStateNode->setContentShadowLayer(layerTreeHost.getLayer(scrollingStateNode->contentShadowLayer()));
+ if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::ContentShadowLayer))
+ scrollingStateNode.setContentShadowLayer(layerTreeHost.getLayer(scrollingStateNode.contentShadowLayer()));
// FIXME: we should never have header and footer layers coming from the WebProcess.
- if (scrollingStateNode->hasChangedProperty(ScrollingStateFrameScrollingNode::HeaderLayer))
- scrollingStateNode->setHeaderLayer(layerTreeHost.getLayer(scrollingStateNode->headerLayer()));
+ if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::HeaderLayer))
+ scrollingStateNode.setHeaderLayer(layerTreeHost.getLayer(scrollingStateNode.headerLayer()));
- if (scrollingStateNode->hasChangedProperty(ScrollingStateFrameScrollingNode::FooterLayer))
- scrollingStateNode->setFooterLayer(layerTreeHost.getLayer(scrollingStateNode->footerLayer()));
+ if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::FooterLayer))
+ scrollingStateNode.setFooterLayer(layerTreeHost.getLayer(scrollingStateNode.footerLayer()));
break;
}
case OverflowScrollingNode: {
- ScrollingStateOverflowScrollingNode* scrollingStateNode = toScrollingStateOverflowScrollingNode(currNode);
+ ScrollingStateOverflowScrollingNode& scrollingStateNode = downcast<ScrollingStateOverflowScrollingNode>(*currNode);
- if (scrollingStateNode->hasChangedProperty(ScrollingStateOverflowScrollingNode::ScrolledContentsLayer))
- scrollingStateNode->setScrolledContentsLayer(layerTreeHost.getLayer(scrollingStateNode->scrolledContentsLayer()));
+ if (scrollingStateNode.hasChangedProperty(ScrollingStateOverflowScrollingNode::ScrolledContentsLayer))
+ scrollingStateNode.setScrolledContentsLayer(layerTreeHost.getLayer(scrollingStateNode.scrolledContentsLayer()));
break;
}
case FixedNode:
Modified: trunk/Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm (174339 => 174340)
--- trunk/Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm 2014-10-06 05:13:09 UTC (rev 174339)
+++ trunk/Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm 2014-10-06 05:14:36 UTC (rev 174340)
@@ -145,7 +145,7 @@
ScrollingTreeOverflowScrollingNode::updateBeforeChildren(stateNode);
- const auto& scrollingStateNode = toScrollingStateOverflowScrollingNode(stateNode);
+ const auto& scrollingStateNode = downcast<ScrollingStateOverflowScrollingNode>(stateNode);
if (scrollingStateNode.hasChangedProperty(ScrollingStateNode::ScrollLayer))
m_scrollLayer = scrollingStateNode.layer();
@@ -159,7 +159,7 @@
TemporaryChange<bool> updatingChange(m_updatingFromStateNode, true);
- const auto& scrollingStateNode = toScrollingStateOverflowScrollingNode(stateNode);
+ const auto& scrollingStateNode = downcast<ScrollingStateOverflowScrollingNode>(stateNode);
if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrollLayer)
|| scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::TotalContentsSize)
Modified: trunk/Source/WebKit2/UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm (174339 => 174340)
--- trunk/Source/WebKit2/UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm 2014-10-06 05:13:09 UTC (rev 174339)
+++ trunk/Source/WebKit2/UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm 2014-10-06 05:14:36 UTC (rev 174340)
@@ -57,30 +57,30 @@
for (auto& currNode : stateTree.nodeMap().values()) {
switch (currNode->nodeType()) {
case OverflowScrollingNode: {
- ScrollingStateOverflowScrollingNode* scrollingStateNode = toScrollingStateOverflowScrollingNode(currNode);
+ ScrollingStateOverflowScrollingNode& scrollingStateNode = downcast<ScrollingStateOverflowScrollingNode>(*currNode);
- if (scrollingStateNode->hasChangedProperty(ScrollingStateNode::ScrollLayer))
- scrollingStateNode->setLayer(layerRepresentationFromLayerOrView(layerTreeHost.getLayer(scrollingStateNode->layer())));
+ if (scrollingStateNode.hasChangedProperty(ScrollingStateNode::ScrollLayer))
+ scrollingStateNode.setLayer(layerRepresentationFromLayerOrView(layerTreeHost.getLayer(scrollingStateNode.layer())));
- if (scrollingStateNode->hasChangedProperty(ScrollingStateOverflowScrollingNode::ScrolledContentsLayer))
- scrollingStateNode->setScrolledContentsLayer(layerRepresentationFromLayerOrView(layerTreeHost.getLayer(scrollingStateNode->scrolledContentsLayer())));
+ if (scrollingStateNode.hasChangedProperty(ScrollingStateOverflowScrollingNode::ScrolledContentsLayer))
+ scrollingStateNode.setScrolledContentsLayer(layerRepresentationFromLayerOrView(layerTreeHost.getLayer(scrollingStateNode.scrolledContentsLayer())));
break;
};
case FrameScrollingNode: {
- ScrollingStateFrameScrollingNode* scrollingStateNode = toScrollingStateFrameScrollingNode(currNode);
+ ScrollingStateFrameScrollingNode& scrollingStateNode = downcast<ScrollingStateFrameScrollingNode>(*currNode);
- if (scrollingStateNode->hasChangedProperty(ScrollingStateNode::ScrollLayer))
- scrollingStateNode->setLayer(layerRepresentationFromLayerOrView(layerTreeHost.getLayer(scrollingStateNode->layer())));
+ if (scrollingStateNode.hasChangedProperty(ScrollingStateNode::ScrollLayer))
+ scrollingStateNode.setLayer(layerRepresentationFromLayerOrView(layerTreeHost.getLayer(scrollingStateNode.layer())));
- if (scrollingStateNode->hasChangedProperty(ScrollingStateFrameScrollingNode::CounterScrollingLayer))
- scrollingStateNode->setCounterScrollingLayer(layerRepresentationFromLayerOrView(layerTreeHost.getLayer(scrollingStateNode->counterScrollingLayer())));
+ if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::CounterScrollingLayer))
+ scrollingStateNode.setCounterScrollingLayer(layerRepresentationFromLayerOrView(layerTreeHost.getLayer(scrollingStateNode.counterScrollingLayer())));
// FIXME: we should never have header and footer layers coming from the WebProcess.
- if (scrollingStateNode->hasChangedProperty(ScrollingStateFrameScrollingNode::HeaderLayer))
- scrollingStateNode->setHeaderLayer(layerRepresentationFromLayerOrView(layerTreeHost.getLayer(scrollingStateNode->headerLayer())));
+ if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::HeaderLayer))
+ scrollingStateNode.setHeaderLayer(layerRepresentationFromLayerOrView(layerTreeHost.getLayer(scrollingStateNode.headerLayer())));
- if (scrollingStateNode->hasChangedProperty(ScrollingStateFrameScrollingNode::FooterLayer))
- scrollingStateNode->setFooterLayer(layerRepresentationFromLayerOrView(layerTreeHost.getLayer(scrollingStateNode->footerLayer())));
+ if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::FooterLayer))
+ scrollingStateNode.setFooterLayer(layerRepresentationFromLayerOrView(layerTreeHost.getLayer(scrollingStateNode.footerLayer())));
break;
}
case FixedNode:
Modified: trunk/Source/WebKit2/WebProcess/Scrolling/RemoteScrollingCoordinator.h (174339 => 174340)
--- trunk/Source/WebKit2/WebProcess/Scrolling/RemoteScrollingCoordinator.h 2014-10-06 05:13:09 UTC (rev 174339)
+++ trunk/Source/WebKit2/WebProcess/Scrolling/RemoteScrollingCoordinator.h 2014-10-06 05:14:36 UTC (rev 174340)
@@ -76,10 +76,10 @@
WebPage* m_webPage;
};
-SCROLLING_COORDINATOR_TYPE_CASTS(RemoteScrollingCoordinator, isRemoteScrollingCoordinator());
-
} // namespace WebKit
+SPECIALIZE_TYPE_TRAITS_SCROLLING_COORDINATOR(WebKit::RemoteScrollingCoordinator, isRemoteScrollingCoordinator());
+
#endif // ENABLE(ASYNC_SCROLLING)
#endif // RemoteScrollingCoordinator_h
Modified: trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp (174339 => 174340)
--- trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp 2014-10-06 05:13:09 UTC (rev 174339)
+++ trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp 2014-10-06 05:14:36 UTC (rev 174340)
@@ -72,8 +72,8 @@
ASSERT(webPage->corePage()->scrollingCoordinator());
ASSERT(!m_scrollingTrees.contains(webPage->pageID()));
- AsyncScrollingCoordinator* scrollingCoordinator = toAsyncScrollingCoordinator(webPage->corePage()->scrollingCoordinator());
- m_scrollingTrees.set(webPage->pageID(), toThreadedScrollingTree(scrollingCoordinator->scrollingTree()));
+ AsyncScrollingCoordinator& scrollingCoordinator = downcast<AsyncScrollingCoordinator>(*webPage->corePage()->scrollingCoordinator());
+ m_scrollingTrees.set(webPage->pageID(), toThreadedScrollingTree(scrollingCoordinator.scrollingTree()));
}
void EventDispatcher::removeScrollingTreeForPage(WebPage* webPage)
Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm (174339 => 174340)
--- trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm 2014-10-06 05:13:09 UTC (rev 174339)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm 2014-10-06 05:14:36 UTC (rev 174340)
@@ -358,7 +358,7 @@
RemoteScrollingCoordinatorTransaction scrollingTransaction;
#if ENABLE(ASYNC_SCROLLING)
if (m_webPage.scrollingCoordinator())
- toRemoteScrollingCoordinator(m_webPage.scrollingCoordinator())->buildTransaction(scrollingTransaction);
+ downcast<RemoteScrollingCoordinator>(*m_webPage.scrollingCoordinator()).buildTransaction(scrollingTransaction);
#endif
m_waitingForBackingStoreSwap = true;
Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm (174339 => 174340)
--- trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm 2014-10-06 05:13:09 UTC (rev 174339)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm 2014-10-06 05:14:36 UTC (rev 174340)
@@ -187,7 +187,7 @@
Settings& settings = m_webPage.corePage()->settings();
#if ENABLE(ASYNC_SCROLLING)
- if (AsyncScrollingCoordinator* scrollingCoordinator = toAsyncScrollingCoordinator(m_webPage.corePage()->scrollingCoordinator())) {
+ if (AsyncScrollingCoordinator* scrollingCoordinator = downcast<AsyncScrollingCoordinator>(m_webPage.corePage()->scrollingCoordinator())) {
bool scrollingPerformanceLoggingEnabled = m_webPage.scrollingPerformanceLoggingEnabled();
ScrollingThread::dispatch(bind(&ScrollingTree::setScrollingPerformanceLoggingEnabled, scrollingCoordinator->scrollingTree(), scrollingPerformanceLoggingEnabled));
}