 Chromium Code Reviews
 Chromium Code Reviews Issue 1987943002:
  [wip] unprefix filter 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master
    
  
    Issue 1987943002:
  [wip] unprefix filter 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master| 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; | 
| 
fs
2016/05/23 12:29:53
return !m_object.style()->hasFilter();
?
 
Noel Gordon
2016/05/29 04:15:29
I restored the old code, so done.
 | 
| + } | 
| + | 
| + if (LayoutSVGResourceFilter* filter = resources->filter()) { | 
| + // The root element's filter is applied by the layer filter painter. | 
| 
fs
2016/05/23 12:29:53
Shouldn't need to call this at all if m_object.isS
 
Noel Gordon
2016/05/29 04:15:28
ditto, restored the old code.
 | 
| + 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(); | 
| } | 
| + | 
| 
fs
2016/05/23 12:29:53
Drop.
 
Noel Gordon
2016/05/29 04:15:28
ditto.
 | 
| return true; | 
| } |