Skip to content
  • simon.fraser@apple.com's avatar
    2009-08-28 Simon Fraser <simon.fraser@apple.com> · 83b64d5a
    simon.fraser@apple.com authored
            Reviewed by Dan Bernstein.
    
            Fix positioning error when a compositing, absolutely-positioned element has an ancestor with opacity.
            https://bugs.webkit.org/show_bug.cgi?id=28754
    
            For absolutely-positioned layers, convertToLayerCoords() jumps to the positioned
            ancestor, since the layer x and y are relative to that ancestor. However, this could
            skip over the ancestorLayer, thus giving the wrong result.
    
            Fix by duplicating the enclosingPositionedAncestor() logic in convertToLayerCoords(),
            and checking for ancestorLayer along the way. If found, compute offset of both to
            the enclosingPositionedAncestor() and subtract.
    
            This also fixes a positioning bug with abs. positioned elements in reflections,
            so there is a new reflection test with a pixel result.
    
            Tests: compositing/geometry/abs-position-inside-opacity.html
                   fast/reflections/abs-position-in-reflection.html
    
            * rendering/RenderLayer.cpp:
            (WebCore::isPositionedContainer):
            (WebCore::RenderLayer::enclosingPositionedAncestor):
            (WebCore::RenderLayer::enclosingTransformedAncestor):
            (WebCore::RenderLayer::convertToLayerCoords):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@47900 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    83b64d5a