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 e1e4c0de82cfbceca0e6d578447f456e3c4ebf28..463bb0ad0b44c7e96ba51d91714f89dabe5f2998 100644 |
--- a/third_party/WebKit/Source/core/paint/SVGPaintContext.cpp |
+++ b/third_party/WebKit/Source/core/paint/SVGPaintContext.cpp |
@@ -65,6 +65,7 @@ bool SVGPaintContext::applyClipMaskAndFilterIfNecessary() |
// When rendering clip paths as masks, only geometric operations should be included so skip |
// non-geometric operations such as compositing, masking, and filtering. |
if (paintInfo().isRenderingClipPathAsMaskImage()) { |
+ DCHECK(!m_object.isSVGRoot()); |
applyClipIfNecessary(); |
return true; |
} |
@@ -78,7 +79,11 @@ bool SVGPaintContext::applyClipMaskAndFilterIfNecessary() |
applyCompositingIfNecessary(); |
} |
- applyClipIfNecessary(); |
+ if (isSVGRoot) { |
+ DCHECK(!m_object.styleRef().clipPath() || m_object.hasLayer()); |
+ } else { |
+ applyClipIfNecessary(); |
+ } |
SVGResources* resources = SVGResourcesCache::cachedResourcesForLayoutObject(&m_object); |
@@ -114,14 +119,7 @@ void SVGPaintContext::applyCompositingIfNecessary() |
void SVGPaintContext::applyClipIfNecessary() |
{ |
- ClipPathOperation* clipPathOperation = m_object.styleRef().svgStyle().clipPath(); |
- // If no 'clip-path' is specified, try '-webkit-clip-path'. |
- if (!clipPathOperation) { |
- clipPathOperation = m_object.styleRef().clipPath(); |
- // We don't support URL references in '-webkit-clip-path'. |
- if (clipPathOperation && clipPathOperation->type() == ClipPathOperation::REFERENCE) |
- clipPathOperation = nullptr; |
- } |
+ ClipPathOperation* clipPathOperation = m_object.styleRef().clipPath(); |
if (!clipPathOperation) |
return; |
m_clipPathClipper.emplace(paintInfo().context, *clipPathOperation, m_object, m_object.objectBoundingBox(), FloatPoint()); |