Title: [111139] trunk
Revision
111139
Author
[email protected]
Date
2012-03-18 16:07:27 -0700 (Sun, 18 Mar 2012)

Log Message

Invalidation issue when creating backing layer for fixed positioned element.
https://bugs.webkit.org/show_bug.cgi?id=80647

Patch by David Reveman <[email protected]> on 2012-03-18
Reviewed by James Robinson.

Source/WebCore:

Ensure that root layer is correctly invalidated by handling scroll and
invalidation from movement of fixed position elements prior to creating
any backing layers.

Test: compositing/layer-creation/fixed-position-scroll.html

* page/FrameView.cpp:
(WebCore::FrameView::repaintFixedElementsAfterScrolling):
(WebCore):
(WebCore::FrameView::updateFixedElementsAfterScrolling):
* page/FrameView.h:
(FrameView):
* platform/ScrollView.cpp:
(WebCore::ScrollView::scrollTo):
* platform/ScrollView.h:
(WebCore::ScrollView::repaintFixedElementsAfterScrolling):
(WebCore::ScrollView::updateFixedElementsAfterScrolling):

LayoutTests:

* compositing/layer-creation/fixed-position-scroll.html: Added.
* platform/chromium-linux/compositing/layer-creation/fixed-position-scroll-expected.png: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (111138 => 111139)


--- trunk/LayoutTests/ChangeLog	2012-03-18 22:52:01 UTC (rev 111138)
+++ trunk/LayoutTests/ChangeLog	2012-03-18 23:07:27 UTC (rev 111139)
@@ -1,3 +1,13 @@
+2012-03-18  David Reveman  <[email protected]>
+
+        Invalidation issue when creating backing layer for fixed positioned element.
+        https://bugs.webkit.org/show_bug.cgi?id=80647
+
+        Reviewed by James Robinson.
+
+        * compositing/layer-creation/fixed-position-scroll.html: Added.
+        * platform/chromium-linux/compositing/layer-creation/fixed-position-scroll-expected.png: Added.
+
 2012-02-13  Robert Hogan  <[email protected]>
 
         CSS 2.1 failure: eof-003.htm fails

Added: trunk/LayoutTests/compositing/layer-creation/fixed-position-scroll.html (0 => 111139)


--- trunk/LayoutTests/compositing/layer-creation/fixed-position-scroll.html	                        (rev 0)
+++ trunk/LayoutTests/compositing/layer-creation/fixed-position-scroll.html	2012-03-18 23:07:27 UTC (rev 111139)
@@ -0,0 +1,63 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <style type="text/css">
+      .absolute {
+        background-color: green;
+        height: 96px;
+        position: absolute;
+        top: 0;
+        left: 0;
+        width: 100%;
+        z-index: 2;
+      }
+
+      .fixed {
+        background-color: red;
+        height: 32px;
+        position: fixed;
+        top: 0;
+        left: 0;
+        width: 100%;
+        z-index: 1;
+      }
+
+      .transformed {
+        background-color: #6d6d6d;
+        padding-top: 24px;
+        margin: 64px 0px 1920px 0px;
+        width: 100%;
+        height: 40px;
+        -webkit-transform: translateZ(0);
+      }
+    </style>
+    <script src=""
+    <script type="text/_javascript_" charset="utf-8">
+      if (window.layoutTestController) {
+        layoutTestController.dumpAsText(true);
+        layoutTestController.waitUntilDone();
+      }
+
+      function repaintTest()
+      {
+        window.scrollBy(0,-96);
+        if (window.layoutTestController)
+          layoutTestController.notifyDone();
+      }
+
+      function doTest()
+      {
+        window.scrollBy(0,-2048);
+        window.scrollBy(0,160);
+        runRepaintTest();
+      }
+      window.addEventListener('load', doTest, false);
+    </script>
+  </head>
+  <body>
+    <div class="absolute"></div>
+    <div class="fixed"></div>
+    <div class="transformed"></div>
+    <p> For this test to pass, you should not see a red line when scroll position is less or equal to 64px from the top. </p>
+  </body>
+</html>

Added: trunk/LayoutTests/platform/chromium-linux/compositing/layer-creation/fixed-position-scroll-expected.png (0 => 111139)


--- trunk/LayoutTests/platform/chromium-linux/compositing/layer-creation/fixed-position-scroll-expected.png	                        (rev 0)
+++ trunk/LayoutTests/platform/chromium-linux/compositing/layer-creation/fixed-position-scroll-expected.png	2012-03-18 23:07:27 UTC (rev 111139)
@@ -0,0 +1,7 @@
+\x89PNG
+
+
+IHDR X')tEXtchecksumb419f077d04dc4a3f47bfa17451965adīc9
+\xEBIDATx\x9C\xED\xD8\xCBm\x84@@\xC1\xC5\xDA\xC01\x98&"\x88l\x9C\xC0z\xC5\xE1y\xF1\xA7\xEAȴP\x9Fz\xB9}\xDCxn\xDF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x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88}\x95B\xA8
+#x\x86IEND\xAEB`\x82
\ No newline at end of file

Modified: trunk/Source/WebCore/ChangeLog (111138 => 111139)


--- trunk/Source/WebCore/ChangeLog	2012-03-18 22:52:01 UTC (rev 111138)
+++ trunk/Source/WebCore/ChangeLog	2012-03-18 23:07:27 UTC (rev 111139)
@@ -1,3 +1,28 @@
+2012-03-18  David Reveman  <[email protected]>
+
+        Invalidation issue when creating backing layer for fixed positioned element.
+        https://bugs.webkit.org/show_bug.cgi?id=80647
+
+        Reviewed by James Robinson.
+
+        Ensure that root layer is correctly invalidated by handling scroll and
+        invalidation from movement of fixed position elements prior to creating
+        any backing layers.
+
+        Test: compositing/layer-creation/fixed-position-scroll.html
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::repaintFixedElementsAfterScrolling):
+        (WebCore):
+        (WebCore::FrameView::updateFixedElementsAfterScrolling):
+        * page/FrameView.h:
+        (FrameView):
+        * platform/ScrollView.cpp:
+        (WebCore::ScrollView::scrollTo):
+        * platform/ScrollView.h:
+        (WebCore::ScrollView::repaintFixedElementsAfterScrolling):
+        (WebCore::ScrollView::updateFixedElementsAfterScrolling):
+
 2012-03-18  Dana Jansens  <[email protected]>
 
         [chromium] Transform animation state should be inherited from parents

Modified: trunk/Source/WebCore/page/FrameView.cpp (111138 => 111139)


--- trunk/Source/WebCore/page/FrameView.cpp	2012-03-18 22:52:01 UTC (rev 111138)
+++ trunk/Source/WebCore/page/FrameView.cpp	2012-03-18 23:07:27 UTC (rev 111139)
@@ -1718,11 +1718,19 @@
         if (RenderView* root = rootRenderer(this)) {
             root->updateWidgetPositions();
             root->layer()->updateLayerPositionsAfterScroll();
+        }
+    }
+}
+
+void FrameView::updateFixedElementsAfterScrolling()
+{
 #if USE(ACCELERATED_COMPOSITING)
+    if (!m_nestedLayoutCount && hasFixedObjects()) {
+        if (RenderView* root = rootRenderer(this)) {
             root->compositor()->updateCompositingLayers(CompositingUpdateOnScroll);
-#endif
         }
     }
+#endif
 }
 
 bool FrameView::shouldRubberBandInDirection(ScrollDirection direction) const

Modified: trunk/Source/WebCore/page/FrameView.h (111138 => 111139)


--- trunk/Source/WebCore/page/FrameView.h	2012-03-18 22:52:01 UTC (rev 111138)
+++ trunk/Source/WebCore/page/FrameView.h	2012-03-18 23:07:27 UTC (rev 111139)
@@ -173,6 +173,7 @@
     void setScrollPosition(const IntPoint&);
     void scrollPositionChangedViaPlatformWidget();
     virtual void repaintFixedElementsAfterScrolling();
+    virtual void updateFixedElementsAfterScrolling();
     virtual bool shouldRubberBandInDirection(ScrollDirection) const;
     virtual bool requestScrollPositionUpdate(const IntPoint&) OVERRIDE;
 

Modified: trunk/Source/WebCore/platform/ScrollView.cpp (111138 => 111139)


--- trunk/Source/WebCore/platform/ScrollView.cpp	2012-03-18 22:52:01 UTC (rev 111138)
+++ trunk/Source/WebCore/platform/ScrollView.cpp	2012-03-18 23:07:27 UTC (rev 111139)
@@ -362,6 +362,7 @@
 
     repaintFixedElementsAfterScrolling();
     scrollContents(scrollDelta);
+    updateFixedElementsAfterScrolling();
 }
 
 int ScrollView::scrollPosition(Scrollbar* scrollbar) const

Modified: trunk/Source/WebCore/platform/ScrollView.h (111138 => 111139)


--- trunk/Source/WebCore/platform/ScrollView.h	2012-03-18 22:52:01 UTC (rev 111138)
+++ trunk/Source/WebCore/platform/ScrollView.h	2012-03-18 23:07:27 UTC (rev 111139)
@@ -362,7 +362,8 @@
     IntRect rectToCopyOnScroll() const;
 
     // Called when the scroll position within this view changes.  FrameView overrides this to generate repaint invalidations.
-    virtual void repaintFixedElementsAfterScrolling() {}
+    virtual void repaintFixedElementsAfterScrolling() { }
+    virtual void updateFixedElementsAfterScrolling() { }
 
     void platformInit();
     void platformDestroy();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to