Index: Source/core/layout/svg/LayoutSVGResourceClipper.cpp |
diff --git a/Source/core/layout/svg/LayoutSVGResourceClipper.cpp b/Source/core/layout/svg/LayoutSVGResourceClipper.cpp |
index ec02b32ca3ee31a74c68aaade1fea311cab625bf..46976cf95f8d18d2e8d4c51620adcd95f89d30c3 100644 |
--- a/Source/core/layout/svg/LayoutSVGResourceClipper.cpp |
+++ b/Source/core/layout/svg/LayoutSVGResourceClipper.cpp |
@@ -32,6 +32,7 @@ |
#include "core/paint/CompositingRecorder.h" |
#include "core/paint/PaintInfo.h" |
#include "core/paint/TransformRecorder.h" |
+#include "core/svg/SVGGeometryElement.h" |
#include "core/svg/SVGUseElement.h" |
#include "platform/RuntimeEnabledFeatures.h" |
#include "platform/graphics/paint/ClipPathDisplayItem.h" |
@@ -94,14 +95,20 @@ bool LayoutSVGResourceClipper::tryPathOnlyClipping(const LayoutObject& layoutObj |
if (clipPath.isEmpty()) { |
// First clip shape. |
- styled->toClipPath(clipPath); |
+ if (isSVGGeometryElement(styled)) |
+ toSVGGeometryElement(styled)->toClipPath(clipPath); |
+ else if (isSVGUseElement(styled)) |
+ toSVGUseElement(styled)->toClipPath(clipPath); |
continue; |
} |
if (RuntimeEnabledFeatures::pathOpsSVGClippingEnabled()) { |
// Attempt to generate a combined clip path, fall back to masking if not possible. |
Path subPath; |
- styled->toClipPath(subPath); |
+ if (isSVGGeometryElement(styled)) |
+ toSVGGeometryElement(styled)->toClipPath(clipPath); |
+ else if (isSVGUseElement(styled)) |
+ toSVGUseElement(styled)->toClipPath(clipPath); |
if (!clipPath.unionPath(subPath)) |
return false; |
} else { |