[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

dbates at webkit.org dbates at webkit.org
Thu Apr 8 01:14:46 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 275c68a93e0a688084d57ad7f2ef34f867d2efd6
Author: dbates at webkit.org <dbates at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jan 19 18:48:18 2010 +0000

    2010-01-19  Daniel Bates  <dbates at rim.com>
    
            Reviewed by Adam Treat.
    
            https://bugs.webkit.org/show_bug.cgi?id=33408
    
            Implements an optimization to ignore fixed background images
            (i.e. background-attachment: fixed) when a page does not contain
            any fixed position elements so as to allow fast repaints (via bit
            blit) when scrolling a page.
    
            Currently, if a page has elements that specify either a fixed
            background or a fixed position then we perform a slow repaint
            (i.e disable blitting) so as to avoid rendering artifacts.
            However, on low-powered/mobile devices slow repaints can cause
            noticeable delays when scrolling a page with a fixed background
            image. By sacrificing support for fixed background images when
            there are no fixed elements on the page and with come care, we
            don't need to force slow repaints and can avoid rendering artifacts.
            Hence, on such devices we can improve the responsiveness of
            scrolling a page with a fixed background image.
    
            Note, this optimization is only enabled if the WebKit is built
            with FAST_MOBILE_SCROLLING enabled.
    
            Tests: fast/fast-mobile-scrolling/fixed-position-element.html
                   fast/fast-mobile-scrolling/no-fixed-position-elements.html
    
            * rendering/RenderBoxModelObject.cpp:
            (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
            Disable fixed background attachment if we can blit on scroll.
            * rendering/RenderObject.cpp:
            (WebCore::RenderObject::styleWillChange):
    2010-01-19  Daniel Bates  <dbates at rim.com>
    
            Reviewed by Adam Treat.
    
            https://bugs.webkit.org/show_bug.cgi?id=33408
    
            Tests that fixed background images are ignored when there are no
            fixed elements on a page and honored otherwise.
    
            Note, includes expected failure results for the test
            fast/fast-mobile-scrolling/no-fixed-position-elements.html, since
            the Mac and Windows ports do not support FAST_MOBILE_SCROLLING.
    
            * fast/fast-mobile-scrolling: Added.
            * fast/fast-mobile-scrolling/fixed-position-element.html: Added.
            * fast/fast-mobile-scrolling/no-fixed-position-elements.html: Added.
            * platform/mac/fast/fast-mobile-scrolling: Added.
            * platform/mac/fast/fast-mobile-scrolling/fixed-position-element-expected.checksum: Added.
            * platform/mac/fast/fast-mobile-scrolling/fixed-position-element-expected.png: Added.
            * platform/mac/fast/fast-mobile-scrolling/fixed-position-element-expected.txt: Added.
            * platform/mac/fast/fast-mobile-scrolling/no-fixed-position-elements-expected.checksum: Added.
            * platform/mac/fast/fast-mobile-scrolling/no-fixed-position-elements-expected.png: Added.
            Expected failure result since the Mac port does not enable FAST_MOBILE_SCROLLING.
            * platform/mac/fast/fast-mobile-scrolling/no-fixed-position-elements-expected.txt: Added.
            Expected failure result since the Mac port does not enable FAST_MOBILE_SCROLLING.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53476 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index c5f6b2a..c63090c 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,29 @@
+2010-01-19  Daniel Bates  <dbates at rim.com>
+
+        Reviewed by Adam Treat.
+
+        https://bugs.webkit.org/show_bug.cgi?id=33408
+
+        Tests that fixed background images are ignored when there are no
+        fixed elements on a page and honored otherwise.
+
+        Note, includes expected failure results for the test
+        fast/fast-mobile-scrolling/no-fixed-position-elements.html, since
+        the Mac and Windows ports do not support FAST_MOBILE_SCROLLING.
+
+        * fast/fast-mobile-scrolling: Added.
+        * fast/fast-mobile-scrolling/fixed-position-element.html: Added.
+        * fast/fast-mobile-scrolling/no-fixed-position-elements.html: Added.
+        * platform/mac/fast/fast-mobile-scrolling: Added.
+        * platform/mac/fast/fast-mobile-scrolling/fixed-position-element-expected.checksum: Added.
+        * platform/mac/fast/fast-mobile-scrolling/fixed-position-element-expected.png: Added.
+        * platform/mac/fast/fast-mobile-scrolling/fixed-position-element-expected.txt: Added.
+        * platform/mac/fast/fast-mobile-scrolling/no-fixed-position-elements-expected.checksum: Added.
+        * platform/mac/fast/fast-mobile-scrolling/no-fixed-position-elements-expected.png: Added.
+        Expected failure result since the Mac port does not enable FAST_MOBILE_SCROLLING.
+        * platform/mac/fast/fast-mobile-scrolling/no-fixed-position-elements-expected.txt: Added.
+        Expected failure result since the Mac port does not enable FAST_MOBILE_SCROLLING.
+
 2010-01-19  Brady Eidson  <beidson at apple.com>
 
         Reviewed by Alexey Proskuryakov.
diff --git a/LayoutTests/fast/fast-mobile-scrolling/fixed-position-element.html b/LayoutTests/fast/fast-mobile-scrolling/fixed-position-element.html
new file mode 100644
index 0000000..f8a7f79
--- /dev/null
+++ b/LayoutTests/fast/fast-mobile-scrolling/fixed-position-element.html
@@ -0,0 +1,25 @@
+<html>
+<head>
+<style>
+#square
+{
+    height: 64px;
+    width: 64px;
+    margin-top: 3em;
+    background: green url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAIAAAAlC+aJAAAAAXNSR0IArs4c6QAAAE1JREFUaN7tz0ENAAAIBKDT/p21gX83aEBl8lonAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgK3BVGGAX99FLDRAAAAAElFTkSuQmCC') no-repeat fixed
+}
+#fixed-position-element
+{
+    position: fixed;
+    top: 100px;
+    height: 64px;
+    width: 64px;
+}
+</style>
+</head>
+<body>
+<p>This tests that fixed background images are honored on a page with at least one fixed position element. If the square (below) is green, then the test PASSED.</p>
+<div id="square">&nbsp;</div>
+<div id="fixed-position-element">&nbsp;</div>
+</body>
+</html>
diff --git a/LayoutTests/fast/fast-mobile-scrolling/no-fixed-position-elements.html b/LayoutTests/fast/fast-mobile-scrolling/no-fixed-position-elements.html
new file mode 100644
index 0000000..899a8ba
--- /dev/null
+++ b/LayoutTests/fast/fast-mobile-scrolling/no-fixed-position-elements.html
@@ -0,0 +1,18 @@
+<html>
+<head>
+<style>
+#square
+{
+    height: 64px;
+    width: 64px;
+    margin-top: 3em;
+    background: red url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAIAAAAlC+aJAAAAAXNSR0IArs4c6QAAAE1JREFUaN7tz0ENAAAIBKDT/p21gX83aEBl8lonAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgK3BVGGAX99FLDRAAAAAElFTkSuQmCC') no-repeat fixed
+}
+</style>
+</head>
+<body>
+<p>This tests that fixed background images are ignored on a page with no fixed positioned elements. If the square (below) is green, then the test PASSED.</p>
+<p>Note, we expect this test to fail on all ports that have not compiled with FAST_MOBILE_SCROLLING enabled.</p>
+<div id="square">&nbsp;</div>
+</body>
+</html>
diff --git a/LayoutTests/platform/mac/fast/fast-mobile-scrolling/fixed-position-element-expected.checksum b/LayoutTests/platform/mac/fast/fast-mobile-scrolling/fixed-position-element-expected.checksum
new file mode 100644
index 0000000..aefcf5d
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/fast-mobile-scrolling/fixed-position-element-expected.checksum
@@ -0,0 +1 @@
+e782534f05580602f977164a6a9b3a40
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/fast-mobile-scrolling/fixed-position-element-expected.png b/LayoutTests/platform/mac/fast/fast-mobile-scrolling/fixed-position-element-expected.png
new file mode 100644
index 0000000..89a9c13
Binary files /dev/null and b/LayoutTests/platform/mac/fast/fast-mobile-scrolling/fixed-position-element-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/fast-mobile-scrolling/fixed-position-element-expected.txt b/LayoutTests/platform/mac/fast/fast-mobile-scrolling/fixed-position-element-expected.txt
new file mode 100644
index 0000000..bb08f8e
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/fast-mobile-scrolling/fixed-position-element-expected.txt
@@ -0,0 +1,16 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderBlock {P} at (0,0) size 784x36
+        RenderText {#text} at (0,0) size 781x36
+          text run at (0,0) width 781: "This tests that fixed background images are honored on a page with at least one fixed position element. If the square (below)"
+          text run at (0,18) width 201: "is green, then the test PASSED."
+      RenderBlock {DIV} at (0,84) size 64x64 [bgcolor=#008000]
+        RenderText {#text} at (0,0) size 4x18
+          text run at (0,0) width 4: " "
+layer at (8,100) size 64x64
+  RenderBlock (positioned) {DIV} at (8,100) size 64x64
+    RenderText {#text} at (0,0) size 4x18
+      text run at (0,0) width 4: " "
diff --git a/LayoutTests/platform/mac/fast/fast-mobile-scrolling/no-fixed-position-elements-expected.checksum b/LayoutTests/platform/mac/fast/fast-mobile-scrolling/no-fixed-position-elements-expected.checksum
new file mode 100644
index 0000000..03c947d
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/fast-mobile-scrolling/no-fixed-position-elements-expected.checksum
@@ -0,0 +1 @@
+c0213215f95ab5dadb4764c9172bb6fe
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/fast-mobile-scrolling/no-fixed-position-elements-expected.png b/LayoutTests/platform/mac/fast/fast-mobile-scrolling/no-fixed-position-elements-expected.png
new file mode 100644
index 0000000..d4c17fb
Binary files /dev/null and b/LayoutTests/platform/mac/fast/fast-mobile-scrolling/no-fixed-position-elements-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/fast-mobile-scrolling/no-fixed-position-elements-expected.txt b/LayoutTests/platform/mac/fast/fast-mobile-scrolling/no-fixed-position-elements-expected.txt
new file mode 100644
index 0000000..039b97a
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/fast-mobile-scrolling/no-fixed-position-elements-expected.txt
@@ -0,0 +1,15 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderBlock {P} at (0,0) size 784x36
+        RenderText {#text} at (0,0) size 758x36
+          text run at (0,0) width 758: "This tests that fixed background images are ignored on a page with no fixed positioned elements. If the square (below) is"
+          text run at (0,18) width 187: "green, then the test PASSED."
+      RenderBlock {P} at (0,52) size 784x18
+        RenderText {#text} at (0,0) size 718x18
+          text run at (0,0) width 718: "Note, we expect this test to fail on all ports that have not compiled with FAST_MOBILE_SCROLLING enabled."
+      RenderBlock {DIV} at (0,118) size 64x64 [bgcolor=#FF0000]
+        RenderText {#text} at (0,0) size 4x18
+          text run at (0,0) width 4: " "
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 9f05f9f..b85233d 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,37 @@
+2010-01-19  Daniel Bates  <dbates at rim.com>
+
+        Reviewed by Adam Treat.
+
+        https://bugs.webkit.org/show_bug.cgi?id=33408
+
+        Implements an optimization to ignore fixed background images
+        (i.e. background-attachment: fixed) when a page does not contain
+        any fixed position elements so as to allow fast repaints (via bit
+        blit) when scrolling a page.
+
+        Currently, if a page has elements that specify either a fixed
+        background or a fixed position then we perform a slow repaint
+        (i.e disable blitting) so as to avoid rendering artifacts.
+        However, on low-powered/mobile devices slow repaints can cause
+        noticeable delays when scrolling a page with a fixed background
+        image. By sacrificing support for fixed background images when
+        there are no fixed elements on the page and with come care, we
+        don't need to force slow repaints and can avoid rendering artifacts.
+        Hence, on such devices we can improve the responsiveness of
+        scrolling a page with a fixed background image.
+
+        Note, this optimization is only enabled if the WebKit is built
+        with FAST_MOBILE_SCROLLING enabled.
+
+        Tests: fast/fast-mobile-scrolling/fixed-position-element.html
+               fast/fast-mobile-scrolling/no-fixed-position-elements.html
+
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
+        Disable fixed background attachment if we can blit on scroll.
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::styleWillChange):
+
 2010-01-19  Dave Hyatt  <hyatt at apple.com>
 
         Build bustage fix.  Land modified WebCore.base.exp file that includes export of currentWorld().
diff --git a/WebCore/rendering/RenderBoxModelObject.cpp b/WebCore/rendering/RenderBoxModelObject.cpp
index ad52aa6..af94524 100644
--- a/WebCore/rendering/RenderBoxModelObject.cpp
+++ b/WebCore/rendering/RenderBoxModelObject.cpp
@@ -544,6 +544,17 @@ void RenderBoxModelObject::calculateBackgroundImageGeometry(const FillLayer* fil
     // Determine the background positioning area and set destRect to the background painting area.
     // destRect will be adjusted later if the background is non-repeating.
     bool fixedAttachment = fillLayer->attachment() == FixedBackgroundAttachment;
+
+#if ENABLE(FAST_MOBILE_SCROLLING)
+    if (view()->frameView() && view()->frameView()->canBlitOnScroll()) {
+        // As a side effect of an optimization to blit on scroll, we do not honor the CSS
+        // property "background-attachment: fixed" because it may result in rendering
+        // artifacts. Note, these artifacts only appear if we are blitting on scroll of
+        // a page that has fixed background images.
+        fixedAttachment = false;
+    }
+#endif
+
     if (!fixedAttachment) {
         destRect = IntRect(tx, ty, w, h);
 
diff --git a/WebCore/rendering/RenderObject.cpp b/WebCore/rendering/RenderObject.cpp
index 9d4e2cd..4828a26 100644
--- a/WebCore/rendering/RenderObject.cpp
+++ b/WebCore/rendering/RenderObject.cpp
@@ -1650,8 +1650,20 @@ void RenderObject::styleWillChange(StyleDifference diff, const RenderStyle* newS
     if (view()->frameView()) {
         // FIXME: A better solution would be to only invalidate the fixed regions when scrolling.  It's overkill to
         // prevent the entire view from blitting on a scroll.
-        bool newStyleSlowScroll = newStyle && (newStyle->position() == FixedPosition || newStyle->hasFixedBackgroundImage());
-        bool oldStyleSlowScroll = m_style && (m_style->position() == FixedPosition || m_style->hasFixedBackgroundImage());
+
+        bool shouldBlitOnFixedBackgroundImage = false;
+#if ENABLE(FAST_MOBILE_SCROLLING)
+        // On low-powered/mobile devices, preventing blitting on a scroll can cause noticeable delays
+        // when scrolling a page with a fixed background image. As an optimization, assuming there are
+        // no fixed positoned elements on the page, we can acclerate scrolling (via blitting) if we
+        // ignore the CSS property "background-attachment: fixed".
+        shouldBlitOnFixedBackgroundImage = true;
+#endif
+
+        bool newStyleSlowScroll = newStyle && (newStyle->position() == FixedPosition
+                                               || (!shouldBlitOnFixedBackgroundImage && newStyle->hasFixedBackgroundImage()));
+        bool oldStyleSlowScroll = m_style && (m_style->position() == FixedPosition
+                                               || (!shouldBlitOnFixedBackgroundImage && m_style->hasFixedBackgroundImage()));
         if (oldStyleSlowScroll != newStyleSlowScroll) {
             if (oldStyleSlowScroll)
                 view()->frameView()->removeSlowRepaintObject();

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list