Changeset 143655 in webkit


Ignore:
Timestamp:
Feb 21, 2013, 3:29:17 PM (13 years ago)
Author:
Simon Fraser
Message:

[Safari] Crash with opacity + drop shadow filter + child element extending beyond filter outsets
https://bugs.webkit.org/show_bug.cgi?id=107467

Source/WebCore:

Reviewed by Dean Jackson.

The filter code plays games with the current GraphicsContext, replacing the current
context with one which will get filtered.

This doesn't play nicely with the RenderLayer code which lazily starts transparency
layers. If we don't start a transparency layer until painting a child of the filtered
layer, then the transparency layer is started using the wrong context.

Fix by eagerly starting transparency layers if we have both a filter and opacity.

Test: css3/filters/filter-with-opacity-and-children.html

  • rendering/RenderLayer.cpp:

(WebCore::RenderLayer::paintLayerContents):

LayoutTests:

Reviewed by Dean Jackson.

Testcase with filtered element with opacity, and layer child.

  • css3/filters/filter-with-opacity-and-children-expected.txt: Added.
  • css3/filters/filter-with-opacity-and-children.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r143651 r143655  
     12013-02-21  Simon Fraser  <simon.fraser@apple.com>
     2
     3        [Safari] Crash with opacity + drop shadow filter + child element extending beyond filter outsets
     4        https://bugs.webkit.org/show_bug.cgi?id=107467
     5
     6        Reviewed by Dean Jackson.
     7       
     8        Testcase with filtered element with opacity, and layer child.
     9
     10        * css3/filters/filter-with-opacity-and-children-expected.txt: Added.
     11        * css3/filters/filter-with-opacity-and-children.html: Added.
     12
    1132013-02-21  Philip Rogers  <pdr@google.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r143652 r143655  
     12013-02-21  Simon Fraser  <simon.fraser@apple.com>
     2
     3        [Safari] Crash with opacity + drop shadow filter + child element extending beyond filter outsets
     4        https://bugs.webkit.org/show_bug.cgi?id=107467
     5
     6        Reviewed by Dean Jackson.
     7       
     8        The filter code plays games with the current GraphicsContext, replacing the current
     9        context with one which will get filtered.
     10       
     11        This doesn't play nicely with the RenderLayer code which lazily starts transparency
     12        layers. If we don't start a transparency layer until painting a child of the filtered
     13        layer, then the transparency layer is started using the wrong context.
     14       
     15        Fix by eagerly starting transparency layers if we have both a filter and opacity.
     16
     17        Test: css3/filters/filter-with-opacity-and-children.html
     18
     19        * rendering/RenderLayer.cpp:
     20        (WebCore::RenderLayer::paintLayerContents):
     21
    1222013-02-21  Tony Chang  <tony@chromium.org>
    223
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r143626 r143655  
    37253725    if (this != localPaintingInfo.rootLayer || !(localPaintFlags & PaintLayerPaintingOverflowContents))
    37263726        shouldPaintContent &= intersectsDamageRect(layerBounds, damageRect.rect(), localPaintingInfo.rootLayer, &offsetFromRoot);
    3727    
     3727
     3728#if ENABLE(CSS_FILTERS)
     3729    if (filterPainter.hasStartedFilterEffect() && haveTransparency) {
     3730        // If we have a filter and transparency, we have to eagerly start a transparency layer here, rather than risk a child layer lazily starts one with the wrong context.
     3731        beginTransparencyLayers(transparencyLayerContext, localPaintingInfo.rootLayer, paintingInfo.paintDirtyRect, localPaintingInfo.paintBehavior);
     3732    }
     3733#endif
     3734
    37283735    if (localPaintFlags & PaintLayerPaintingCompositingBackgroundPhase) {
    37293736        if (shouldPaintContent && !selectionOnly) {
Note: See TracChangeset for help on using the changeset viewer.