Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(187)

Unified Diff: third_party/WebKit/Source/core/paint/SVGPaintContext.cpp

Issue 2312713002: Unprefix -webkit-clip-path (Closed)
Patch Set: Rebase Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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());
« no previous file with comments | « third_party/WebKit/Source/core/paint/SVGClipPainter.cpp ('k') | third_party/WebKit/Source/core/style/ComputedStyle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698