[BlackBerry] compositing/iframes/scroll-fixed-transformed-element.html fails in manua...
authoranilsson@rim.com <anilsson@rim.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Mar 2013 18:20:59 +0000 (18:20 +0000)
committeranilsson@rim.com <anilsson@rim.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Mar 2013 18:20:59 +0000 (18:20 +0000)
https://bugs.webkit.org/show_bug.cgi?id=112806

Reviewed by Antonio Gomes.

PR 283363

When scrolling the iframe, the position: fixed element is correctly
positioned, that is, as if it was fixed with respect to the iframe's
viewport. When scrolling the main frame however, the fixed pos element
was positioned as if it was fixed with respect to the main frame's
viewport.

Fixed by falling back to using the WebKit-thread scroll position for
fixed positioning in LayerRenderer, if the override doesn't have a
position currently set, i.e. if we are not currently scrolling the
iframe.

The effects of the bug are only visual, i.e. not detectable by DRT.

Manually testable using compositing/iframes/scroll-fixed-transformed-element.html

* platform/graphics/blackberry/LayerRenderer.cpp:
(WebCore::LayerRenderer::updateLayersRecursive):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@146366 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/blackberry/LayerRenderer.cpp

index 2da15ed..44d8f6d 100644 (file)
@@ -1,3 +1,30 @@
+2013-03-20  Arvid Nilsson  <anilsson@rim.com>
+
+        [BlackBerry] compositing/iframes/scroll-fixed-transformed-element.html fails in manual testing
+        https://bugs.webkit.org/show_bug.cgi?id=112806
+
+        Reviewed by Antonio Gomes.
+
+        PR 283363
+
+        When scrolling the iframe, the position: fixed element is correctly
+        positioned, that is, as if it was fixed with respect to the iframe's
+        viewport. When scrolling the main frame however, the fixed pos element
+        was positioned as if it was fixed with respect to the main frame's
+        viewport.
+
+        Fixed by falling back to using the WebKit-thread scroll position for
+        fixed positioning in LayerRenderer, if the override doesn't have a
+        position currently set, i.e. if we are not currently scrolling the
+        iframe.
+
+        The effects of the bug are only visual, i.e. not detectable by DRT.
+
+        Manually testable using compositing/iframes/scroll-fixed-transformed-element.html
+
+        * platform/graphics/blackberry/LayerRenderer.cpp:
+        (WebCore::LayerRenderer::updateLayersRecursive):
+
 2013-03-20  Michael Pruett  <michael@68k.org>
 
         [V8] Simplify implementation of EnforceRange conversions
index 3355ed0..7ec32c9 100644 (file)
@@ -685,18 +685,23 @@ void LayerRenderer::updateLayersRecursive(LayerCompositingThread* layer, const T
         FloatRect visibleRect = m_visibleRect;
         for (LayerCompositingThread* curr = layer->superlayer(); curr; curr = curr->superlayer()) {
 
-            // If we reach a container for fixed position layers, and it has its override's position set, it means it is a scrollable iframe
-            if (curr->isContainerForFixedPositionLayers() && curr->override()->isPositionSet()) {
+            if (curr->isContainerForFixedPositionLayers()) {
                 layoutRect = curr->frameVisibleRect();
                 contentsSize = curr->frameContentsSize();
 
-                // Inverted logic of
-                // FloatPoint layerPosition(-scrollPosition.x() + anchor.x() * bounds.width(),
-                //                          -scrollPosition.y() + anchor.y() * bounds.height());
-                FloatPoint scrollPosition(
-                    -(curr->override()->position().x() - (curr->anchorPoint().x() * curr->bounds().width())),
-                    -(curr->override()->position().y() - (curr->anchorPoint().y() * curr->bounds().height())));
-                visibleRect = FloatRect(scrollPosition, layoutRect.size());
+                // If we reach a container for fixed position layers, and it has its override's position set, it means it is a scrollable iframe
+                // currently being scrolled. Otherwise, use the WebKit-thread scroll position stored in frameVisibleRect().
+                if (curr->override()->isPositionSet()) {
+                    // Inverted logic of
+                    // FloatPoint layerPosition(-scrollPosition.x() + anchor.x() * bounds.width(),
+                    //                          -scrollPosition.y() + anchor.y() * bounds.height());
+                    FloatPoint scrollPosition(
+                        -(curr->override()->position().x() - (curr->anchorPoint().x() * curr->bounds().width())),
+                        -(curr->override()->position().y() - (curr->anchorPoint().y() * curr->bounds().height())));
+                    visibleRect = FloatRect(scrollPosition, layoutRect.size());
+                } else
+                    visibleRect = layoutRect;
+
                 break;
             }
         }