Title: [107848] trunk/Source/WebCore
- Revision
- 107848
- Author
- [email protected]
- Date
- 2012-02-15 15:37:25 -0800 (Wed, 15 Feb 2012)
Log Message
Scrolling coordinator should handle pages being restored from the page cache
https://bugs.webkit.org/show_bug.cgi?id=78753
<rdar://problem/10866171>
Reviewed by Sam Weinig.
Replace ScrollingCoordinator::frameViewScrollLayerDidChange with a new member function,
ScrollingCoordinator::frameViewRootLayerDidChange which is called whenever the root layer
of the frame view changes (which happens on back/forward navigation as well).
In this function, reset the scrolling tree state from the frame view.
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::scrollLayerForFrameView):
Add a helper function.
(WebCore::ScrollingCoordinator::frameViewRootLayerDidChange):
Reset the entire scrolling tree state.
(WebCore::ScrollingCoordinator::updateMainFrameScrollPositionAndScrollLayerPosition):
Call the newly added helper function.
* page/scrolling/ScrollingCoordinator.h:
(ScrollingCoordinator):
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
Remove frameViewScrollLayerDidChange.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::ensureRootLayer):
Remove call to ScrollingCoordinator::frameViewScrollLayerDidChange.
(WebCore::RenderLayerCompositor::attachRootLayer):
Call ScrollingCoordinator::frameViewRootLayerDidChange.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (107847 => 107848)
--- trunk/Source/WebCore/ChangeLog 2012-02-15 23:36:34 UTC (rev 107847)
+++ trunk/Source/WebCore/ChangeLog 2012-02-15 23:37:25 UTC (rev 107848)
@@ -1,3 +1,39 @@
+2012-02-15 Anders Carlsson <[email protected]>
+
+ Scrolling coordinator should handle pages being restored from the page cache
+ https://bugs.webkit.org/show_bug.cgi?id=78753
+ <rdar://problem/10866171>
+
+ Reviewed by Sam Weinig.
+
+ Replace ScrollingCoordinator::frameViewScrollLayerDidChange with a new member function,
+ ScrollingCoordinator::frameViewRootLayerDidChange which is called whenever the root layer
+ of the frame view changes (which happens on back/forward navigation as well).
+
+ In this function, reset the scrolling tree state from the frame view.
+
+ * page/scrolling/ScrollingCoordinator.cpp:
+ (WebCore::scrollLayerForFrameView):
+ Add a helper function.
+
+ (WebCore::ScrollingCoordinator::frameViewRootLayerDidChange):
+ Reset the entire scrolling tree state.
+
+ (WebCore::ScrollingCoordinator::updateMainFrameScrollPositionAndScrollLayerPosition):
+ Call the newly added helper function.
+
+ * page/scrolling/ScrollingCoordinator.h:
+ (ScrollingCoordinator):
+ * page/scrolling/mac/ScrollingCoordinatorMac.mm:
+ Remove frameViewScrollLayerDidChange.
+
+ * rendering/RenderLayerCompositor.cpp:
+ (WebCore::RenderLayerCompositor::ensureRootLayer):
+ Remove call to ScrollingCoordinator::frameViewScrollLayerDidChange.
+
+ (WebCore::RenderLayerCompositor::attachRootLayer):
+ Call ScrollingCoordinator::frameViewRootLayerDidChange.
+
2012-02-15 Enrica Casucci <[email protected]>
Refactor ClipboardMac class to use PlatformStrategies.
Modified: trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp (107847 => 107848)
--- trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp 2012-02-15 23:36:34 UTC (rev 107847)
+++ trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp 2012-02-15 23:37:25 UTC (rev 107848)
@@ -168,6 +168,35 @@
updateShouldUpdateScrollLayerPositionOnMainThread();
}
+static GraphicsLayer* scrollLayerForFrameView(FrameView* frameView)
+{
+ Frame* frame = frameView->frame();
+ if (!frame)
+ return 0;
+
+ RenderView* renderView = frame->contentRenderer();
+ if (!renderView)
+ return 0;
+
+ return renderView->compositor()->scrollLayer();
+}
+
+void ScrollingCoordinator::frameViewRootLayerDidChange(FrameView* frameView)
+{
+ ASSERT(isMainThread());
+ ASSERT(m_page);
+
+ if (frameView->frame() != m_page->mainFrame())
+ return;
+
+ frameViewLayoutUpdated(frameView);
+ recomputeWheelEventHandlerCount();
+ updateShouldUpdateScrollLayerPositionOnMainThread();
+ m_scrollingTreeState->setScrollLayer(scrollLayerForFrameView(frameView));
+
+ scheduleTreeStateCommit();
+}
+
bool ScrollingCoordinator::requestScrollPositionUpdate(FrameView* frameView, const IntPoint& scrollPosition)
{
ASSERT(isMainThread());
@@ -211,12 +240,7 @@
void ScrollingCoordinator::updateMainFrameScrollPositionAndScrollLayerPosition(const IntPoint& scrollPosition)
{
FrameView* frameView = m_page->mainFrame()->view();
-
- RenderView* renderView = m_page->mainFrame()->contentRenderer();
- if (!renderView)
- return;
-
- GraphicsLayer* scrollLayer = renderView->compositor()->scrollLayer();
+ GraphicsLayer* scrollLayer = scrollLayerForFrameView(frameView);
if (!scrollLayer)
return;
Modified: trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h (107847 => 107848)
--- trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h 2012-02-15 23:36:34 UTC (rev 107847)
+++ trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h 2012-02-15 23:37:25 UTC (rev 107848)
@@ -80,8 +80,8 @@
// so it can make sure they stay fixed even when we scroll on the scrolling thread.
void frameViewHasFixedObjectsDidChange(FrameView*);
- // Should be called whenever the scroll layer for the given frame view changes.
- void frameViewScrollLayerDidChange(FrameView*, const GraphicsLayer*);
+ // Should be called whenever the root layer for the given frame view changes.
+ void frameViewRootLayerDidChange(FrameView*);
// Should be called whenever the horizontal scrollbar layer for the given frame view changes.
void frameViewHorizontalScrollbarLayerDidChange(FrameView*, GraphicsLayer* horizontalScrollbarLayer);
Modified: trunk/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm (107847 => 107848)
--- trunk/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm 2012-02-15 23:36:34 UTC (rev 107847)
+++ trunk/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm 2012-02-15 23:37:25 UTC (rev 107848)
@@ -64,18 +64,6 @@
// FIXME: Implement.
}
-void ScrollingCoordinator::frameViewScrollLayerDidChange(FrameView* frameView, const GraphicsLayer* scrollLayer)
-{
- ASSERT(isMainThread());
- ASSERT(m_page);
-
- if (frameView->frame() != m_page->mainFrame())
- return;
-
- m_scrollingTreeState->setScrollLayer(scrollLayer);
- scheduleTreeStateCommit();
-}
-
} // namespace WebCore
#endif // ENABLE(THREADED_SCROLLING)
Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (107847 => 107848)
--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp 2012-02-15 23:36:34 UTC (rev 107847)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp 2012-02-15 23:37:25 UTC (rev 107848)
@@ -1936,11 +1936,6 @@
frameViewDidChangeSize();
frameViewDidScroll();
-
-#if ENABLE(THREADED_SCROLLING)
- if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
- scrollingCoordinator->frameViewScrollLayerDidChange(m_renderView->frameView(), m_scrollLayer.get());
-#endif
}
} else {
if (m_overflowControlsHostLayer) {
@@ -2024,7 +2019,12 @@
break;
}
}
-
+
+#if ENABLE(THREADED_SCROLLING)
+ if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
+ scrollingCoordinator->frameViewRootLayerDidChange(m_renderView->frameView());
+#endif
+
m_rootLayerAttachment = attachment;
rootLayerAttachmentChanged();
}
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes