[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 15:25:03 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 4b527ceeb04f84a6eae5049cad7024f851d6ea7c
Author: simon.fraser at apple.com <simon.fraser at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Nov 3 00:59:00 2010 +0000

    2010-11-02  Simon Fraser  <simon.fraser at apple.com>
    
            Reviewed by Dan Bernstein.
    
            Overlapped nested iframes show smearing when scrolled
            https://bugs.webkit.org/show_bug.cgi?id=48873
    
            A FrameView goes into slow scrolling mode (not blitting) when told that it is
            overlapped. However, a nested iframe could still try to use fast scrolling
            when its parent is overlapped, which could result in bad rendering.
    
            Fixed by making useSlowRepaints() and useSlowRepaintsIfNotOverlapped()
            walk up their parent chain, asking if their parents also use slow
            repaints.
    
            All the places that call setCanBlitOnScroll() now call
            updateCanBlitOnScrollRecursively() to ensure that the canBlitOnScroll
            flag is updated correctly on subframes.
    
            Repaint tests do not work on nested iframes, so added manual test.
    
            * manual-tests/frames/nested-iframe-blit-on-scroll.html: Added.
            * manual-tests/frames/resources/blit-on-scroll-subframe.html: Added.
            * manual-tests/frames/resources/blit-on-scroll-subsubframe.html: Added.
            * page/FrameView.cpp:
            (WebCore::FrameView::layout):
            (WebCore::FrameView::useSlowRepaints):
            (WebCore::FrameView::useSlowRepaintsIfNotOverlapped):
            (WebCore::FrameView::updateCanBlitOnScrollRecursively):
            (WebCore::FrameView::setUseSlowRepaints):
            (WebCore::FrameView::addSlowRepaintObject):
            (WebCore::FrameView::removeSlowRepaintObject):
            (WebCore::FrameView::addFixedObject):
            (WebCore::FrameView::removeFixedObject):
            (WebCore::FrameView::setIsOverlapped):
            (WebCore::FrameView::setContentIsOpaque):
            * page/FrameView.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71194 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index de2484f..4e4f6bc 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -96,6 +96,44 @@
 
         Reviewed by Dan Bernstein.
 
+        Overlapped nested iframes show smearing when scrolled
+        https://bugs.webkit.org/show_bug.cgi?id=48873
+
+        A FrameView goes into slow scrolling mode (not blitting) when told that it is
+        overlapped. However, a nested iframe could still try to use fast scrolling
+        when its parent is overlapped, which could result in bad rendering.
+        
+        Fixed by making useSlowRepaints() and useSlowRepaintsIfNotOverlapped()
+        walk up their parent chain, asking if their parents also use slow
+        repaints.
+        
+        All the places that call setCanBlitOnScroll() now call
+        updateCanBlitOnScrollRecursively() to ensure that the canBlitOnScroll
+        flag is updated correctly on subframes.
+        
+        Repaint tests do not work on nested iframes, so added manual test.
+
+        * manual-tests/frames/nested-iframe-blit-on-scroll.html: Added.
+        * manual-tests/frames/resources/blit-on-scroll-subframe.html: Added.
+        * manual-tests/frames/resources/blit-on-scroll-subsubframe.html: Added.
+        * page/FrameView.cpp:
+        (WebCore::FrameView::layout):
+        (WebCore::FrameView::useSlowRepaints):
+        (WebCore::FrameView::useSlowRepaintsIfNotOverlapped):
+        (WebCore::FrameView::updateCanBlitOnScrollRecursively):
+        (WebCore::FrameView::setUseSlowRepaints):
+        (WebCore::FrameView::addSlowRepaintObject):
+        (WebCore::FrameView::removeSlowRepaintObject):
+        (WebCore::FrameView::addFixedObject):
+        (WebCore::FrameView::removeFixedObject):
+        (WebCore::FrameView::setIsOverlapped):
+        (WebCore::FrameView::setContentIsOpaque):
+        * page/FrameView.h:
+
+2010-11-02  Simon Fraser  <simon.fraser at apple.com>
+
+        Reviewed by Dan Bernstein.
+
         Iframes nested inside a compositing layer don't repaint correctly
         https://bugs.webkit.org/show_bug.cgi?id=48880
         <rdar://problem/8194698>
diff --git a/WebCore/manual-tests/frames/nested-iframe-blit-on-scroll.html b/WebCore/manual-tests/frames/nested-iframe-blit-on-scroll.html
new file mode 100644
index 0000000..6d4d30e
--- /dev/null
+++ b/WebCore/manual-tests/frames/nested-iframe-blit-on-scroll.html
@@ -0,0 +1,31 @@
+<html>
+<head>
+  <style type="text/css">
+    iframe {
+        position: relative;
+        z-index: 1;
+        left: 10px;
+        top: 10px;
+        border: 1px solid black;
+    }
+
+    #overlap {
+        position: absolute;
+        width: 100px;
+        height: 100px;
+        z-index: 2;
+        left: 10px;
+        top: 100px;
+        background-color: blue;
+    }
+    p {
+        margin-top: 50px;
+    }
+  </style>
+</head>
+<body>
+<div id="overlap"></div>
+<iframe id="frame" src="resources/blit-on-scroll-subframe.html" scrolling="no"></iframe>
+<p>The blue box should not get "smeared" when you scroll the inner iframe.</p>
+</body>
+</html>
diff --git a/WebCore/manual-tests/frames/resources/blit-on-scroll-subframe.html b/WebCore/manual-tests/frames/resources/blit-on-scroll-subframe.html
new file mode 100644
index 0000000..b0dc4b9
--- /dev/null
+++ b/WebCore/manual-tests/frames/resources/blit-on-scroll-subframe.html
@@ -0,0 +1,10 @@
+<style type="text/css" media="screen">
+  iframe {
+    border: 1px solid black;
+  }
+  
+  body {
+      height: 1000px;
+  }
+</style>
+<iframe id="subframe" src="blit-on-scroll-subsubframe.html" width="280" height="250"></iframe>
diff --git a/WebCore/manual-tests/frames/resources/blit-on-scroll-subsubframe.html b/WebCore/manual-tests/frames/resources/blit-on-scroll-subsubframe.html
new file mode 100644
index 0000000..9084096
--- /dev/null
+++ b/WebCore/manual-tests/frames/resources/blit-on-scroll-subsubframe.html
@@ -0,0 +1,10 @@
+<style type="text/css" media="screen">
+  iframe {
+    padding: 10px;
+  }
+  
+  body {
+      background-color: gray;
+      height: 1000px;
+  }
+</style>
diff --git a/WebCore/page/FrameView.cpp b/WebCore/page/FrameView.cpp
index 3d93720..638620a 100644
--- a/WebCore/page/FrameView.cpp
+++ b/WebCore/page/FrameView.cpp
@@ -831,7 +831,7 @@ void FrameView::layout(bool allowSubtree)
 
     ASSERT(!root->needsLayout());
 
-    setCanBlitOnScroll(!useSlowRepaints());
+    updateCanBlitOnScrollRecursively();
 
     if (document->hasListenerType(Document::OVERFLOWCHANGED_LISTENER))
         updateOverflowStatus(layoutWidth() < contentsWidth(),
@@ -912,24 +912,48 @@ void FrameView::adjustMediaTypeForPrinting(bool printing)
 
 bool FrameView::useSlowRepaints() const
 {
-    return m_useSlowRepaints || m_slowRepaintObjectCount > 0 || (platformWidget() && m_fixedObjectCount > 0) || m_isOverlapped || !m_contentIsOpaque;
+    if (m_useSlowRepaints || m_slowRepaintObjectCount > 0 || (platformWidget() && m_fixedObjectCount > 0) || m_isOverlapped || !m_contentIsOpaque)
+        return true;
+
+    if (Frame* parentFrame = m_frame->tree()->parent()) {
+        if (FrameView* parentView = parentFrame->view())
+            return parentView->useSlowRepaints();
+    }
+
+    return false;
 }
 
 bool FrameView::useSlowRepaintsIfNotOverlapped() const
 {
-    return m_useSlowRepaints || m_slowRepaintObjectCount > 0 || (platformWidget() && m_fixedObjectCount > 0) || !m_contentIsOpaque;
+    if (m_useSlowRepaints || m_slowRepaintObjectCount > 0 || (platformWidget() && m_fixedObjectCount > 0) || !m_contentIsOpaque)
+        return true;
+
+    if (Frame* parentFrame = m_frame->tree()->parent()) {
+        if (FrameView* parentView = parentFrame->view())
+            return parentView->useSlowRepaintsIfNotOverlapped();
+    }
+
+    return false;
+}
+
+void FrameView::updateCanBlitOnScrollRecursively()
+{
+    for (Frame* frame = m_frame.get(); frame; frame = frame->tree()->traverseNext(m_frame.get())) {
+        if (FrameView* view = frame->view())
+            view->setCanBlitOnScroll(!view->useSlowRepaints());
+    }
 }
 
 void FrameView::setUseSlowRepaints()
 {
     m_useSlowRepaints = true;
-    setCanBlitOnScroll(false);
+    updateCanBlitOnScrollRecursively();
 }
 
 void FrameView::addSlowRepaintObject()
 {
     if (!m_slowRepaintObjectCount)
-        setCanBlitOnScroll(false);
+        updateCanBlitOnScrollRecursively();
     m_slowRepaintObjectCount++;
 }
 
@@ -938,13 +962,13 @@ void FrameView::removeSlowRepaintObject()
     ASSERT(m_slowRepaintObjectCount > 0);
     m_slowRepaintObjectCount--;
     if (!m_slowRepaintObjectCount)
-        setCanBlitOnScroll(!useSlowRepaints());
+        updateCanBlitOnScrollRecursively();
 }
 
 void FrameView::addFixedObject()
 {
     if (!m_fixedObjectCount && platformWidget())
-        setCanBlitOnScroll(false);
+        updateCanBlitOnScrollRecursively();
     ++m_fixedObjectCount;
 }
 
@@ -953,7 +977,7 @@ void FrameView::removeFixedObject()
     ASSERT(m_fixedObjectCount > 0);
     --m_fixedObjectCount;
     if (!m_fixedObjectCount)
-        setCanBlitOnScroll(!useSlowRepaints());
+        updateCanBlitOnScrollRecursively();
 }
 
 bool FrameView::scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect)
@@ -1036,7 +1060,7 @@ void FrameView::setIsOverlapped(bool isOverlapped)
         return;
 
     m_isOverlapped = isOverlapped;
-    setCanBlitOnScroll(!useSlowRepaints());
+    updateCanBlitOnScrollRecursively();
     
 #if USE(ACCELERATED_COMPOSITING)
     // Overlap can affect compositing tests, so if it changes, we need to trigger
@@ -1059,7 +1083,7 @@ void FrameView::setContentIsOpaque(bool contentIsOpaque)
         return;
 
     m_contentIsOpaque = contentIsOpaque;
-    setCanBlitOnScroll(!useSlowRepaints());
+    updateCanBlitOnScrollRecursively();
 }
 
 void FrameView::restoreScrollbar()
@@ -1526,12 +1550,10 @@ void FrameView::setBaseBackgroundColor(Color bc)
 void FrameView::updateBackgroundRecursively(const Color& backgroundColor, bool transparent)
 {
     for (Frame* frame = m_frame.get(); frame; frame = frame->tree()->traverseNext(m_frame.get())) {
-        FrameView* view = frame->view();
-        if (!view)
-            continue;
-
-        view->setTransparent(transparent);
-        view->setBaseBackgroundColor(backgroundColor);
+        if (FrameView* view = frame->view()) {
+            view->setTransparent(transparent);
+            view->setBaseBackgroundColor(backgroundColor);
+        }
     }
 }
 
diff --git a/WebCore/page/FrameView.h b/WebCore/page/FrameView.h
index f9212c1..7d6591b 100644
--- a/WebCore/page/FrameView.h
+++ b/WebCore/page/FrameView.h
@@ -255,6 +255,7 @@ private:
     friend class RenderWidget;
     bool useSlowRepaints() const;
     bool useSlowRepaintsIfNotOverlapped() const;
+    void updateCanBlitOnScrollRecursively();
 
     bool hasFixedObjects() const { return m_fixedObjectCount > 0; }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list