[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

simon.fraser at apple.com simon.fraser at apple.com
Wed Dec 22 14:57:22 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 2fb2dbfcad7d267ed789a82c3aeab10864411baf
Author: simon.fraser at apple.com <simon.fraser at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Oct 26 01:06:30 2010 +0000

    2010-10-25  Simon Fraser  <simon.fraser at apple.com>
    
            Reviewed by Dan Bernstein.
    
            Fix scrolling of noncomposited iframes within composited document
            https://bugs.webkit.org/show_bug.cgi?id=47391
    
            When an iframe that is painting into a compositing layer is scrolled,
            we need to repaint via the RenderObject (which dirties the compositing layer contents),
            rather than going out to hostWindow.
    
            Test: compositing/iframes/composited-iframe-scroll.html
    
            * page/FrameView.cpp:
            (WebCore::FrameView::scrollContentsSlowPath):
            * page/FrameView.h:
            * platform/ScrollView.cpp:
            (WebCore::ScrollView::scrollContents):
            (WebCore::ScrollView::scrollContentsSlowPath):
            * platform/ScrollView.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70509 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 3ac9da7..fa9bfff 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,18 @@
+2010-10-25  Simon Fraser  <simon.fraser at apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        Fix scrolling of noncomposited iframes within composited document
+        https://bugs.webkit.org/show_bug.cgi?id=47391
+        
+        Testcase for scrolling a transformed iframe inside a compositing layer.
+
+        * compositing/iframes/composited-iframe-scroll-expected.checksum: Added.
+        * compositing/iframes/composited-iframe-scroll-expected.png: Added.
+        * compositing/iframes/composited-iframe-scroll-expected.txt: Added.
+        * compositing/iframes/composited-iframe-scroll.html: Added.
+        * compositing/iframes/resources/green-red-subframe.html: Added.
+
 2010-10-25  Kenneth Russell  <kbr at google.com>
 
         Unreviewed, test expectations update. Mark WebGL layout test
diff --git a/LayoutTests/compositing/iframes/composited-iframe-scroll-expected.checksum b/LayoutTests/compositing/iframes/composited-iframe-scroll-expected.checksum
new file mode 100644
index 0000000..a056fa0
--- /dev/null
+++ b/LayoutTests/compositing/iframes/composited-iframe-scroll-expected.checksum
@@ -0,0 +1 @@
+50be89be6ede8a83c52197f671e7b928
\ No newline at end of file
diff --git a/LayoutTests/compositing/iframes/composited-iframe-scroll-expected.png b/LayoutTests/compositing/iframes/composited-iframe-scroll-expected.png
new file mode 100644
index 0000000..06c01ae
Binary files /dev/null and b/LayoutTests/compositing/iframes/composited-iframe-scroll-expected.png differ
diff --git a/LayoutTests/compositing/iframes/composited-iframe-scroll-expected.txt b/LayoutTests/compositing/iframes/composited-iframe-scroll-expected.txt
new file mode 100644
index 0000000..77c25cd
--- /dev/null
+++ b/LayoutTests/compositing/iframes/composited-iframe-scroll-expected.txt
@@ -0,0 +1,19 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x0
+  RenderBlock {HTML} at (0,0) size 800x0
+    RenderBody {BODY} at (0,0) size 800x0
+layer at (120,120) size 200x200
+  RenderBlock (positioned) {DIV} at (120,120) size 200x200 [bgcolor=#FF0000]
+layer at (0,100) size 240x244
+  RenderBlock (positioned) {DIV} at (0,100) size 240x244
+    RenderText {#text} at (0,0) size 0x0
+layer at (10,110) size 220x220
+  RenderPartObject {IFRAME} at (10,10) size 220x220
+    layer at (0,0) size 200x400
+      RenderView at (0,0) size 200x200
+    layer at (0,0) size 200x400
+      RenderBlock {HTML} at (0,0) size 200x400
+        RenderBody {BODY} at (0,0) size 200x400
+          RenderBlock {DIV} at (0,0) size 200x200 [bgcolor=#FF0000]
+          RenderBlock {DIV} at (0,200) size 200x200 [bgcolor=#008000]
diff --git a/LayoutTests/compositing/iframes/composited-iframe-scroll.html b/LayoutTests/compositing/iframes/composited-iframe-scroll.html
new file mode 100644
index 0000000..76e7b96
--- /dev/null
+++ b/LayoutTests/compositing/iframes/composited-iframe-scroll.html
@@ -0,0 +1,62 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+  <style type="text/css" media="screen">
+    body {
+      margin: 0;
+    }
+    
+    iframe {
+      height: 200px;
+      width: 200px;
+      margin: 10px;
+      padding: 10px;
+      border: none;
+      -webkit-transform: translateX(100px);
+    }
+    
+    .container {
+      position: absolute;
+      top: 100px;
+      -webkit-transform: translateZ(0);
+    }
+    
+    #indicator {
+      position: absolute;
+      top: 120px;
+      left: 120px;
+      height: 200px;
+      width: 200px;
+      background-color: red;
+    }
+  </style>
+  <script type="text/javascript" charset="utf-8">
+    
+    if (window.layoutTestController)
+      layoutTestController.waitUntilDone();
+
+    function doTest()
+    {
+      window.setTimeout(function() {
+        var iframe = document.getElementsByTagName('iframe')[0];
+        iframe.contentWindow.scrollTo(0, 200);
+
+        if (window.layoutTestController)
+          layoutTestController.notifyDone();
+      }, 0)
+    }
+    
+    window.addEventListener('load', doTest, false);
+  </script>
+</head>
+<body>
+  <!-- You should see a green box below. -->
+  <div id="indicator"></div>
+
+  <div class="container">
+    <iframe src="resources/green-red-subframe.html" scrolling="no"></iframe>
+  </div>
+
+</body>
+</html>
diff --git a/LayoutTests/compositing/iframes/resources/green-red-subframe.html b/LayoutTests/compositing/iframes/resources/green-red-subframe.html
new file mode 100644
index 0000000..d78c5fb
--- /dev/null
+++ b/LayoutTests/compositing/iframes/resources/green-red-subframe.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+  <style type="text/css" media="screen">
+    body {
+      margin: 0;
+    }
+    
+    .box {
+        height: 200px;
+        width: 200px;
+    }
+  </style>
+</head>
+<body>
+
+    <div class="box" style="background-color: red;"></div>
+    <div class="box" style="background-color: green;"></div>
+
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index fa58925..ac8fd2d 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,24 @@
+2010-10-25  Simon Fraser  <simon.fraser at apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        Fix scrolling of noncomposited iframes within composited document
+        https://bugs.webkit.org/show_bug.cgi?id=47391
+        
+        When an iframe that is painting into a compositing layer is scrolled,
+        we need to repaint via the RenderObject (which dirties the compositing layer contents),
+        rather than going out to hostWindow.
+
+        Test: compositing/iframes/composited-iframe-scroll.html
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::scrollContentsSlowPath):
+        * page/FrameView.h:
+        * platform/ScrollView.cpp:
+        (WebCore::ScrollView::scrollContents):
+        (WebCore::ScrollView::scrollContentsSlowPath):
+        * platform/ScrollView.h:
+
 2010-10-25  Ryosuke Niwa  <rniwa at webkit.org>
 
         Unreviewed Qt build fix for r70496.
diff --git a/WebCore/page/FrameView.cpp b/WebCore/page/FrameView.cpp
index 0c063e0..1e7ab50 100644
--- a/WebCore/page/FrameView.cpp
+++ b/WebCore/page/FrameView.cpp
@@ -1000,6 +1000,23 @@ bool FrameView::scrollContentsFastPath(const IntSize& scrollDelta, const IntRect
     return false;
 }
 
+void FrameView::scrollContentsSlowPath(const IntRect& updateRect)
+{
+#if USE(ACCELERATED_COMPOSITING)
+    if (RenderPart* frameRenderer = m_frame->ownerRenderer()) {
+        if (frameRenderer->containerForRepaint()) {
+            IntRect rect(frameRenderer->borderLeft() + frameRenderer->paddingLeft(),
+                         frameRenderer->borderTop() + frameRenderer->paddingTop(),
+                         visibleWidth(), visibleHeight());
+            frameRenderer->repaintRectangle(rect);
+            return;
+        }
+    }
+#endif
+
+    ScrollView::scrollContentsSlowPath(updateRect);
+}
+
 // Note that this gets called at painting time.
 void FrameView::setIsOverlapped(bool isOverlapped)
 {
diff --git a/WebCore/page/FrameView.h b/WebCore/page/FrameView.h
index 1518233..f9212c1 100644
--- a/WebCore/page/FrameView.h
+++ b/WebCore/page/FrameView.h
@@ -242,7 +242,8 @@ public:
 
 protected:
     virtual bool scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect);
-    
+    virtual void scrollContentsSlowPath(const IntRect& updateRect);
+
 private:
     FrameView(Frame*);
 
diff --git a/WebCore/platform/ScrollView.cpp b/WebCore/platform/ScrollView.cpp
index f5174d3..63e9427 100644
--- a/WebCore/platform/ScrollView.cpp
+++ b/WebCore/platform/ScrollView.cpp
@@ -535,6 +535,8 @@ void ScrollView::scrollContents(const IntSize& scrollDelta)
     hostWindow()->invalidateWindow(updateRect, false /*immediate*/);
 
     if (m_drawPanScrollIcon) {
+        // FIXME: the pan icon is broken when accelerated compositing is on, since it will draw under the compositing layers.
+        // https://bugs.webkit.org/show_bug.cgi?id=47837
         int panIconDirtySquareSizeLength = 2 * (panIconSizeLength + max(abs(scrollDelta.width()), abs(scrollDelta.height()))); // We only want to repaint what's necessary
         IntPoint panIconDirtySquareLocation = IntPoint(m_panScrollIconPoint.x() - (panIconDirtySquareSizeLength / 2), m_panScrollIconPoint.y() - (panIconDirtySquareSizeLength / 2));
         IntRect panScrollIconDirtyRect = IntRect(panIconDirtySquareLocation , IntSize(panIconDirtySquareSizeLength, panIconDirtySquareSizeLength));
@@ -545,11 +547,11 @@ void ScrollView::scrollContents(const IntSize& scrollDelta)
     if (canBlitOnScroll()) { // The main frame can just blit the WebView window
         // FIXME: Find a way to scroll subframes with this faster path
         if (!scrollContentsFastPath(-scrollDelta, scrollViewRect, clipRect))
-            hostWindow()->invalidateContentsForSlowScroll(updateRect, false);
+            scrollContentsSlowPath(updateRect);
     } else { 
        // We need to go ahead and repaint the entire backing store.  Do it now before moving the
        // windowed plugins.
-       hostWindow()->invalidateContentsForSlowScroll(updateRect, false);
+       scrollContentsSlowPath(updateRect);
     }
 
     // This call will move children with native widgets (plugins) and invalidate them as well.
@@ -565,6 +567,11 @@ bool ScrollView::scrollContentsFastPath(const IntSize& scrollDelta, const IntRec
     return true;
 }
 
+void ScrollView::scrollContentsSlowPath(const IntRect& updateRect)
+{
+    hostWindow()->invalidateContentsForSlowScroll(updateRect, false);
+}
+
 IntPoint ScrollView::windowToContents(const IntPoint& windowPoint) const
 {
     IntPoint viewPoint = convertFromContainingWindow(windowPoint);
diff --git a/WebCore/platform/ScrollView.h b/WebCore/platform/ScrollView.h
index 23f48ca..eef6d0b 100644
--- a/WebCore/platform/ScrollView.h
+++ b/WebCore/platform/ScrollView.h
@@ -264,8 +264,10 @@ protected:
     virtual void updateScrollCorner();
     virtual void paintScrollCorner(GraphicsContext*, const IntRect& cornerRect);
 
-    // Scroll the content by blitting the pixels
+    // Scroll the content by blitting the pixels.
     virtual bool scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect);
+    // Scroll the content by invalidating everything.
+    virtual void scrollContentsSlowPath(const IntRect& updateRect);
 
 private:
     RefPtr<Scrollbar> m_horizontalScrollbar;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list