Title: [139632] branches/chromium/1364
Revision
139632
Author
[email protected]
Date
2013-01-14 11:23:26 -0800 (Mon, 14 Jan 2013)

Log Message

Merge 139024
> Add a setting to enable composited scrolling for frames
> 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.
> 

[email protected]
Review URL: https://codereview.chromium.org/11880030

Modified Paths

Added Paths

Diff

Copied: branches/chromium/1364/LayoutTests/compositing/iframes/iframe-composited-scrolling-expected.txt (from rev 139024, trunk/LayoutTests/compositing/iframes/iframe-composited-scrolling-expected.txt) (0 => 139632)


--- branches/chromium/1364/LayoutTests/compositing/iframes/iframe-composited-scrolling-expected.txt	                        (rev 0)
+++ branches/chromium/1364/LayoutTests/compositing/iframes/iframe-composited-scrolling-expected.txt	2013-01-14 19:23:26 UTC (rev 139632)
@@ -0,0 +1,2 @@
+ 
+PASS

Copied: branches/chromium/1364/LayoutTests/compositing/iframes/iframe-composited-scrolling.html (from rev 139024, trunk/LayoutTests/compositing/iframes/iframe-composited-scrolling.html) (0 => 139632)


--- branches/chromium/1364/LayoutTests/compositing/iframes/iframe-composited-scrolling.html	                        (rev 0)
+++ branches/chromium/1364/LayoutTests/compositing/iframes/iframe-composited-scrolling.html	2013-01-14 19:23:26 UTC (rev 139632)
@@ -0,0 +1,32 @@
+<!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="" style="width: 100px; height: 100px"></iframe>
+  <iframe id="non-scrollable-iframe" src="" style="width: 2000px; height: 2000px"></iframe>
+  <pre id="result"></pre>
+</body>
+</html>

Modified: branches/chromium/1364/Source/WebCore/page/FrameView.cpp (139631 => 139632)


--- branches/chromium/1364/Source/WebCore/page/FrameView.cpp	2013-01-14 19:21:46 UTC (rev 139631)
+++ branches/chromium/1364/Source/WebCore/page/FrameView.cpp	2013-01-14 19:23:26 UTC (rev 139632)
@@ -767,6 +767,15 @@
     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);

Modified: branches/chromium/1364/Source/WebCore/page/FrameView.h (139631 => 139632)


--- branches/chromium/1364/Source/WebCore/page/FrameView.h	2013-01-14 19:21:46 UTC (rev 139631)
+++ branches/chromium/1364/Source/WebCore/page/FrameView.h	2013-01-14 19:23:26 UTC (rev 139632)
@@ -436,6 +436,7 @@
     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;

Modified: branches/chromium/1364/Source/WebCore/page/Settings.in (139631 => 139632)


--- branches/chromium/1364/Source/WebCore/page/Settings.in	2013-01-14 19:21:46 UTC (rev 139631)
+++ branches/chromium/1364/Source/WebCore/page/Settings.in	2013-01-14 19:23:26 UTC (rev 139632)
@@ -92,6 +92,7 @@
 
 # Works only in conjunction with forceCompositingMode.
 acceleratedCompositingForScrollableFramesEnabled initial=false
+compositedScrollingForFramesEnabled initial=false
 
 experimentalNotificationsEnabled initial=false
 webGLEnabled initial=false

Modified: branches/chromium/1364/Source/WebCore/page/scrolling/chromium/ScrollingCoordinatorChromium.cpp (139631 => 139632)


--- branches/chromium/1364/Source/WebCore/page/scrolling/chromium/ScrollingCoordinatorChromium.cpp	2013-01-14 19:21:46 UTC (rev 139631)
+++ branches/chromium/1364/Source/WebCore/page/scrolling/chromium/ScrollingCoordinatorChromium.cpp	2013-01-14 19:23:26 UTC (rev 139632)
@@ -111,8 +111,9 @@
     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)

Modified: branches/chromium/1364/Source/WebCore/rendering/RenderLayerCompositor.cpp (139631 => 139632)


--- branches/chromium/1364/Source/WebCore/rendering/RenderLayerCompositor.cpp	2013-01-14 19:21:46 UTC (rev 139631)
+++ branches/chromium/1364/Source/WebCore/rendering/RenderLayerCompositor.cpp	2013-01-14 19:23:26 UTC (rev 139632)
@@ -1169,6 +1169,9 @@
     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()));
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to