| Index: third_party/WebKit/Source/core/paint/SVGPaintContext.cpp
|
| diff --git a/third_party/WebKit/Source/core/paint/SVGPaintContext.cpp b/third_party/WebKit/Source/core/paint/SVGPaintContext.cpp
|
| index c595c9ce65df225c11c2bd9ac0c7e474697ad047..3dd014825d4b9001fe00d82531493e2b6ab2f145 100644
|
| --- a/third_party/WebKit/Source/core/paint/SVGPaintContext.cpp
|
| +++ b/third_party/WebKit/Source/core/paint/SVGPaintContext.cpp
|
| @@ -147,9 +147,16 @@ bool SVGPaintContext::applyMaskIfNecessary(SVGResources* resources)
|
| bool SVGPaintContext::applyFilterIfNecessary(SVGResources* resources)
|
| {
|
| if (!resources) {
|
| - if (m_object.style()->svgStyle().hasFilter())
|
| - return false;
|
| - } else if (LayoutSVGResourceFilter* filter = resources->filter()) {
|
| + if (m_object.style()->hasFilter())
|
| + return false; // Do not allow a draw: the SVG filter is invalid.
|
| + return true;
|
| + }
|
| +
|
| + if (LayoutSVGResourceFilter* filter = resources->filter()) {
|
| + // The root element's filter is applied by the layer filter painter.
|
| + if (m_object.isSVGRoot() && m_object.hasLayer())
|
| + return true;
|
| +
|
| m_filterRecordingContext = adoptPtr(new SVGFilterRecordingContext(paintInfo().context));
|
| m_filter = filter;
|
| GraphicsContext* filterContext = SVGFilterPainter(*filter).prepareEffect(m_object, *m_filterRecordingContext);
|
| @@ -165,6 +172,7 @@ bool SVGPaintContext::applyFilterIfNecessary(SVGResources* resources)
|
| // so elements outside the initial paint (due to scrolling, etc) paint.
|
| m_filterPaintInfo->m_cullRect.m_rect = LayoutRect::infiniteIntRect();
|
| }
|
| +
|
| return true;
|
| }
|
|
|
|
|