Changeset 83424 in webkit


Ignore:
Timestamp:
Apr 10, 2011 10:22:20 PM (13 years ago)
Author:
Simon Fraser
Message:

2011-04-10 Simon Fraser <Simon Fraser>

Reviewed by Maciej Stachowiak.

Car model dropdowns at audiusa.com lay out incorrectly with compositing enabled
https://bugs.webkit.org/show_bug.cgi?id=56660

When overflow on an element changes, we need to inform compositing
layers which create and position an "ancestor clipping" layer based
on that overflow. Do this by triggering a rebuild of compositing layers
when overflow changes on a layer whose stacking context has compositing
descendants. (We can't just check whether the layer itself has compositing
descendants, because overflow follows the render tree, but compositing
follows the z-order tree.)

Test: compositing/geometry/ancestor-overflow-change.html

  • rendering/RenderLayer.cpp: (WebCore::RenderLayer::styleChanged):
  • rendering/RenderLayer.h:
  • rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
Location:
trunk
Files:
4 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r83423 r83424  
     12011-04-10  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Reviewed by Maciej Stachowiak.
     4
     5        Car model dropdowns at audiusa.com lay out incorrectly with compositing enabled
     6        https://bugs.webkit.org/show_bug.cgi?id=56660
     7       
     8        Test that toggles overflow on an element with a composited descendent.
     9
     10        * compositing/geometry/ancestor-overflow-change-expected.checksum: Added.
     11        * compositing/geometry/ancestor-overflow-change-expected.png: Added.
     12        * compositing/geometry/ancestor-overflow-change-expected.txt: Added.
     13        * compositing/geometry/ancestor-overflow-change.html: Added.
     14
    1152011-04-10  Kent Tamura  <tkent@chromium.org>
    216
  • trunk/Source/WebCore/ChangeLog

    r83422 r83424  
     12011-04-10  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Reviewed by Maciej Stachowiak.
     4
     5        Car model dropdowns at audiusa.com lay out incorrectly with compositing enabled
     6        https://bugs.webkit.org/show_bug.cgi?id=56660
     7       
     8        When overflow on an element changes, we need to inform compositing
     9        layers which create and position an "ancestor clipping" layer based
     10        on that overflow. Do this by triggering a rebuild of compositing layers
     11        when overflow changes on a layer whose stacking context has compositing
     12        descendants. (We can't just check whether the layer itself has compositing
     13        descendants, because overflow follows the render tree, but compositing
     14        follows the z-order tree.)
     15
     16        Test: compositing/geometry/ancestor-overflow-change.html
     17
     18        * rendering/RenderLayer.cpp:
     19        (WebCore::RenderLayer::styleChanged):
     20        * rendering/RenderLayer.h:
     21        * rendering/RenderLayerBacking.cpp:
     22        (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
     23
    1242011-04-10  Simon Fraser  <simon.fraser@apple.com>
    225
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r82158 r83424  
    38683868}
    38693869
    3870 void RenderLayer::styleChanged(StyleDifference diff, const RenderStyle*)
     3870void RenderLayer::styleChanged(StyleDifference diff, const RenderStyle* oldStyle)
    38713871{
    38723872    bool isNormalFlowOnly = shouldBeNormalFlowOnly();
     
    39133913    else if (m_backing)
    39143914        m_backing->updateGraphicsLayerGeometry();
    3915 
     3915    else if (oldStyle && oldStyle->overflowX() != renderer()->style()->overflowX()) {
     3916        if (stackingContext()->hasCompositingDescendant())
     3917            compositor()->setCompositingLayersNeedRebuild();
     3918    }
     3919   
    39163920    if (m_backing && diff >= StyleDifferenceRepaint)
    39173921        m_backing->setContentsNeedDisplay();
  • trunk/Source/WebCore/rendering/RenderLayer.h

    r81981 r83424  
    186186#endif
    187187
    188     void styleChanged(StyleDifference, const RenderStyle*);
     188    void styleChanged(StyleDifference, const RenderStyle* oldStyle);
    189189
    190190    RenderMarquee* marquee() const { return m_marquee; }
     
    684684                                            // in a preserves3D hierarchy. Hint to do 3D-aware hit testing.
    685685#if USE(ACCELERATED_COMPOSITING)
    686     bool m_hasCompositingDescendant : 1;
     686    bool m_hasCompositingDescendant : 1; // In the z-order tree.
    687687    bool m_mustOverlapCompositedLayers : 1;
    688688#endif
  • trunk/Source/WebCore/rendering/RenderLayerBacking.cpp

    r81715 r83424  
    366366        // for a compositing layer, rootLayer is the layer itself.
    367367        IntRect parentClipRect = m_owningLayer->backgroundClipRect(compAncestor, true);
     368        ASSERT(parentClipRect != PaintInfo::infiniteRect());
    368369        m_ancestorClippingLayer->setPosition(FloatPoint() + (parentClipRect.location() - graphicsLayerParentLocation));
    369370        m_ancestorClippingLayer->setSize(parentClipRect.size());
Note: See TracChangeset for help on using the changeset viewer.