Fix for layer positioning error that occurs when absolute positioned blocks are...
authorhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Jul 2004 20:35:21 +0000 (20:35 +0000)
committerhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Jul 2004 20:35:21 +0000 (20:35 +0000)
elements.

        Reviewed by john

        * khtml/rendering/render_layer.cpp:
        (RenderLayer::updateLayerPosition):

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

WebCore/ChangeLog-2005-08-23
WebCore/khtml/rendering/render_layer.cpp

index 140699d..114520d 100644 (file)
@@ -1,3 +1,13 @@
+2004-07-20  David Hyatt  <hyatt@apple.com>
+
+       Fix for layer positioning error that occurs when absolute positioned blocks are inside static positioned overflow:auto
+       elements.
+       
+        Reviewed by john
+
+        * khtml/rendering/render_layer.cpp:
+        (RenderLayer::updateLayerPosition):
+
 2004-07-20  Trey Matteson  <trey@apple.com>
 
        3705624 REGRESSION: can't rearrange photos on homepage.mac.com album
index 6cd406b..7e27d58 100644 (file)
@@ -182,7 +182,10 @@ void RenderLayer::updateLayerPosition()
     }
     
     // Subtract our parent's scroll offset.
-    if (parent())
+    if (m_object->isPositioned())
+        // For positioned layers, we subtract out the enclosing positioned layer's scroll offset.
+        enclosingPositionedAncestor()->subtractScrollOffset(x, y);
+    else
         parent()->subtractScrollOffset(x, y);
     
     setPos(x,y);