Title: [224914] trunk/Source/WebCore
- Revision
- 224914
- Author
- fred.w...@free.fr
- Date
- 2017-11-16 05:49:02 -0800 (Thu, 16 Nov 2017)
Log Message
Consider non-main frames for frameViewRootLayerDidChange
https://bugs.webkit.org/show_bug.cgi?id=178508
Patch by Frederic Wang <fw...@igalia.com> on 2017-11-16
Reviewed by Antonio Gomes.
No new tests, behavior unchanged.
AsyncScrollingCoordinator::frameViewRootLayerDidChange assumes that frameView is always a
main-frame. It calls ensureRootStateNodeForFrameView, which always attaches a frame node with
null parent ID. It also has an ASSERT to check m_scrollingStateTree->rootStateNode(), instead
of m_scrollingStateTree->stateNodeForID(frameView.scrollLayerID()). This patch makes the
ASSERT more generic. It also adds an early return into ensureRootStateNodeForFrameView when the
node already exists so that the call to attachToStateTree can be skipped. It turns out that that
call is actually only necessary for main frame, so another ASSERT is added to verify it.
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange): Modify the ASSERT to
verify the availability of a scrolling node for the frame, not just the root node.
(WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView): Add an early return to
skip the call to attachToStateTree when the node is actually already available. Add an ASSERT to
ensure that attaching a new node is only necessary for main frames.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (224913 => 224914)
--- trunk/Source/WebCore/ChangeLog 2017-11-16 12:48:22 UTC (rev 224913)
+++ trunk/Source/WebCore/ChangeLog 2017-11-16 13:49:02 UTC (rev 224914)
@@ -1,3 +1,27 @@
+2017-11-16 Frederic Wang <fw...@igalia.com>
+
+ Consider non-main frames for frameViewRootLayerDidChange
+ https://bugs.webkit.org/show_bug.cgi?id=178508
+
+ Reviewed by Antonio Gomes.
+
+ No new tests, behavior unchanged.
+
+ AsyncScrollingCoordinator::frameViewRootLayerDidChange assumes that frameView is always a
+ main-frame. It calls ensureRootStateNodeForFrameView, which always attaches a frame node with
+ null parent ID. It also has an ASSERT to check m_scrollingStateTree->rootStateNode(), instead
+ of m_scrollingStateTree->stateNodeForID(frameView.scrollLayerID()). This patch makes the
+ ASSERT more generic. It also adds an early return into ensureRootStateNodeForFrameView when the
+ node already exists so that the call to attachToStateTree can be skipped. It turns out that that
+ call is actually only necessary for main frame, so another ASSERT is added to verify it.
+
+ * page/scrolling/AsyncScrollingCoordinator.cpp:
+ (WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange): Modify the ASSERT to
+ verify the availability of a scrolling node for the frame, not just the root node.
+ (WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView): Add an early return to
+ skip the call to attachToStateTree when the node is actually already available. Add an ASSERT to
+ ensure that attaching a new node is only necessary for main frames.
+
2017-11-16 Miguel Gomez <mago...@igalia.com>
[TexMap] Remove use of GraphicsContext3D
Modified: trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp (224913 => 224914)
--- trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp 2017-11-16 12:48:22 UTC (rev 224913)
+++ trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp 2017-11-16 13:49:02 UTC (rev 224914)
@@ -220,7 +220,7 @@
// If the root layer does not have a ScrollingStateNode, then we should create one.
ensureRootStateNodeForFrameView(frameView);
- ASSERT(m_scrollingStateTree->rootStateNode());
+ ASSERT(m_scrollingStateTree->stateNodeForID(frameView.scrollLayerID()));
ScrollingCoordinator::frameViewRootLayerDidChange(frameView);
@@ -512,6 +512,12 @@
void AsyncScrollingCoordinator::ensureRootStateNodeForFrameView(FrameView& frameView)
{
ASSERT(frameView.scrollLayerID());
+ if (m_scrollingStateTree->stateNodeForID(frameView.scrollLayerID()))
+ return;
+
+ // For non-main frames, it is only possible to arrive in this function from
+ // RenderLayerCompositor::updateBacking where the node has already been created.
+ ASSERT(frameView.frame().isMainFrame());
attachToStateTree(FrameScrollingNode, frameView.scrollLayerID(), 0);
}
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes