https://bugs.webkit.org/show_bug.cgi?id=104950
Reviewed by James Robinson.
Source/WebCore:
Test: compositing/iframes/iframe-composited-scrolling.html
* page/FrameView.cpp:
(WebCore::FrameView::usesCompositedScrolling): Returns true if compositedScrollingForFramesEnabled and the frame is in forced compositing mode (which is set when forced compositing mode and compositing for scrollable frames are enabled), so that ScrollingCoordinator won't include the region of the frame in the nonFastScrollableRegion.
(WebCore):
* page/FrameView.h:
(FrameView):
* page/Settings.in: Add compositedScrollingForFramesEnabled setting.
* page/scrolling/chromium/ScrollingCoordinatorChromium.cpp:
(WebCore::ScrollingCoordinatorChromium::frameViewLayoutUpdated): Changed the comment about which ScrollableAreas are non-fast-scrollable.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::frameViewDidScroll): Let ScrollongCoordinator know when the scrolling changes for a frame with composited scrolling enabled.
LayoutTests:
Test case to ensure iframes are not added into nonFastScrollableRegion when acceleratedCompositingForScrollableFramesEnabled and compositedScrollingForFramesEnabled.
* compositing/iframes/iframe-composited-scrolling-expected.txt: Added.
* compositing/iframes/iframe-composited-scrolling.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@139024
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2013-01-07 Xianzhu Wang <wangxianzhu@chromium.org>
+
+ Add a setting to enable composited scrolling for frames
+ https://bugs.webkit.org/show_bug.cgi?id=104950
+
+ Reviewed by James Robinson.
+
+ Test case to ensure iframes are not added into nonFastScrollableRegion when acceleratedCompositingForScrollableFramesEnabled and compositedScrollingForFramesEnabled.
+
+ * compositing/iframes/iframe-composited-scrolling-expected.txt: Added.
+ * compositing/iframes/iframe-composited-scrolling.html: Added.
+
2013-01-07 Adam Barth <abarth@webkit.org>
HTMLTreeBuilder should not depend on Frame
--- /dev/null
+<!DOCTYPE html>
+<html>
+<head>
+ <style>
+ iframe {
+ height: 150px;
+ width: 150px;
+ }
+ </style>
+ <script>
+ if (window.internals) {
+ internals.settings.setForceCompositingMode(true);
+ internals.settings.setAcceleratedCompositingForScrollableFramesEnabled(true);
+ internals.settings.setCompositedScrollingForFramesEnabled(true);
+ }
+ function doTest()
+ {
+ if (window.testRunner) {
+ testRunner.dumpAsText(false);
+ if (window.internals)
+ document.getElementById("result").innerText = window.internals.nonFastScrollableRects(document).length ? "FAIL" : "PASS";
+ }
+ }
+ window.addEventListener("load", doTest, false);
+ </script>
+</head>
+<body>
+ <iframe id="scrollable-iframe" src="resources/subframe.html" style="width: 100px; height: 100px"></iframe>
+ <iframe id="non-scrollable-iframe" src="resources/subframe.html" style="width: 2000px; height: 2000px"></iframe>
+ <pre id="result"></pre>
+</body>
+</html>
+2013-01-07 Xianzhu Wang <wangxianzhu@chromium.org>
+
+ Add a setting to enable composited scrolling for frames
+ https://bugs.webkit.org/show_bug.cgi?id=104950
+
+ Reviewed by James Robinson.
+
+ Test: compositing/iframes/iframe-composited-scrolling.html
+
+ * page/FrameView.cpp:
+ (WebCore::FrameView::usesCompositedScrolling): Returns true if compositedScrollingForFramesEnabled and the frame is in forced compositing mode (which is set when forced compositing mode and compositing for scrollable frames are enabled), so that ScrollingCoordinator won't include the region of the frame in the nonFastScrollableRegion.
+ (WebCore):
+ * page/FrameView.h:
+ (FrameView):
+ * page/Settings.in: Add compositedScrollingForFramesEnabled setting.
+ * page/scrolling/chromium/ScrollingCoordinatorChromium.cpp:
+ (WebCore::ScrollingCoordinatorChromium::frameViewLayoutUpdated): Changed the comment about which ScrollableAreas are non-fast-scrollable.
+ * rendering/RenderLayerCompositor.cpp:
+ (WebCore::RenderLayerCompositor::frameViewDidScroll): Let ScrollongCoordinator know when the scrolling changes for a frame with composited scrolling enabled.
+
2013-01-07 Alexandre Elias <aelias@chromium.org>
Divide gesture scroll delta by scale factor
compositor->updateCompositingLayers(CompositingUpdateAfterLayout);
}
+bool FrameView::usesCompositedScrolling() const
+{
+ if (m_frame->settings() && m_frame->settings()->compositedScrollingForFramesEnabled()) {
+ RenderView* root = rootRenderer(this);
+ return root && root->compositor()->inForcedCompositingMode();
+ }
+ return false;
+}
+
GraphicsLayer* FrameView::layerForHorizontalScrollbar() const
{
RenderView* root = rootRenderer(this);
virtual IntRect scrollableAreaBoundingBox() const OVERRIDE;
virtual bool scrollAnimatorEnabled() const OVERRIDE;
#if USE(ACCELERATED_COMPOSITING)
+ virtual bool usesCompositedScrolling() const OVERRIDE;
virtual GraphicsLayer* layerForHorizontalScrollbar() const OVERRIDE;
virtual GraphicsLayer* layerForVerticalScrollbar() const OVERRIDE;
virtual GraphicsLayer* layerForScrollCorner() const OVERRIDE;
# Works only in conjunction with forceCompositingMode.
acceleratedCompositingForScrollableFramesEnabled initial=false
+compositedScrollingForFramesEnabled initial=false
experimentalNotificationsEnabled initial=false
webGLEnabled initial=false
ASSERT(m_page);
// Compute the region of the page that we can't do fast scrolling for. This currently includes
- // all scrollable areas, such as subframes, overflow divs and list boxes. We need to do this even if the
- // frame view whose layout was updated is not the main frame.
+ // all scrollable areas, such as subframes, overflow divs and list boxes, whose composited
+ // scrolling are not enabled. We need to do this even if the frame view whose layout was updated
+ // is not the main frame.
Region nonFastScrollableRegion = computeNonFastScrollableRegion(m_page->mainFrame(), IntPoint());
setNonFastScrollableRegion(nonFastScrollableRegion);
#if ENABLE(TOUCH_EVENT_TRACKING)
if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) {
if (scrollingCoordinator->coordinatesScrollingForFrameView(frameView))
return;
+ if (Settings* settings = m_renderView->document()->settings())
+ if (settings->compositedScrollingForFramesEnabled())
+ scrollingCoordinator->scrollableAreaScrollLayerDidChange(frameView, m_scrollLayer.get());
}
m_scrollLayer->setPosition(FloatPoint(-scrollPosition.x(), -scrollPosition.y()));