Skip to content
  • mvujovic@adobe.com's avatar
    [CSS Filters] CSS opacity property clips filter outsets · 07d7fc6a
    mvujovic@adobe.com authored
    https://bugs.webkit.org/show_bug.cgi?id=106549
    
    Reviewed by Dirk Schulze.
    
    Source/WebCore:
    
    Expand the transparencyClipBox for filter outsets and pass the filter output rect instead of
    the input rect to beginTransparencyLayers for clipping. Details below.
    
    Test: css3/filters/css-opacity-with-drop-shadow.html
    
    * rendering/RenderLayer.cpp:
    (WebCore):
    (WebCore::RenderLayer::setFilterBackendNeedsRepaintingInRect):
        Replace filter outset calcuation with a call to expandRectForFilterOutsets.
    (WebCore::expandRectForFilterOutsets):
        New method to factor out repeated filter outset calculation code.
    (WebCore::transparencyClipBox):
        After expanding the clip rect for descendants and reflection, expand it for filter
        outsets, so they don't get clipped when we begin a transparency layer.
    (WebCore::RenderLayer::paintLayerContents):
        Pass paintingInfo.paintDirtyRect instead of localPaintingInfo.paintDirtyRect to
        beginTransparencyLayers for clipping. localPaintingInfo.paintDirtyRect (aka the filter
        input rect) does not contain filter outsets, so they would get clipped. Now, we pass
        paintingInfo.paintDirtyRect (the filter output rect), which includes the filter outsets.
    (WebCore::RenderLayer::calculateLayerBounds):
        Replace filter outset calcuation with a call to expandRectForFilterOutsets.
    * rendering/RenderLayer.h:
    (RenderLayer):
    
    LayoutTests:
    
    Add a reftest to verify that an element's drop shadow filter is not clipped when a CSS
    opacity property is not applied.
    
    * css3/filters/css-opacity-with-drop-shadow-expected.html: Added.
    * css3/filters/css-opacity-with-drop-shadow.html: Added.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140702 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    07d7fc6a