Index: third_party/WebKit/Source/core/layout/svg/SVGLayoutSupport.cpp |
diff --git a/third_party/WebKit/Source/core/layout/svg/SVGLayoutSupport.cpp b/third_party/WebKit/Source/core/layout/svg/SVGLayoutSupport.cpp |
index 83d67c8c83eef93361ca0caa9fc487fe5c5805a7..2274567e7652b12f0a10ee97c7e662ef046ff8ea 100644 |
--- a/third_party/WebKit/Source/core/layout/svg/SVGLayoutSupport.cpp |
+++ b/third_party/WebKit/Source/core/layout/svg/SVGLayoutSupport.cpp |
@@ -370,16 +370,18 @@ bool SVGLayoutSupport::hasFilterResource(const LayoutObject& object) |
bool SVGLayoutSupport::pointInClippingArea(const LayoutObject& object, const FloatPoint& point) |
{ |
- // We just take clippers into account to determine if a point is on the node. The Specification may |
- // change later and we also need to check maskers. |
+ ClipPathOperation* clipPathOperation = object.styleRef().svgStyle().clipPath(); |
+ if (!clipPathOperation) |
+ return true; |
+ if (clipPathOperation->type() == ClipPathOperation::SHAPE) { |
+ ShapeClipPathOperation& clipPath = toShapeClipPathOperation(*clipPathOperation); |
+ return clipPath.path(object.objectBoundingBox()).contains(point); |
+ } |
+ DCHECK_EQ(clipPathOperation->type(), ClipPathOperation::REFERENCE); |
SVGResources* resources = SVGResourcesCache::cachedResourcesForLayoutObject(&object); |
- if (!resources) |
+ if (!resources || !resources->clipper()) |
return true; |
- |
- if (LayoutSVGResourceClipper* clipper = resources->clipper()) |
- return clipper->hitTestClipContent(object.objectBoundingBox(), point); |
- |
- return true; |
+ return resources->clipper()->hitTestClipContent(object.objectBoundingBox(), point); |
} |
bool SVGLayoutSupport::transformToUserSpaceAndCheckClipping(const LayoutObject& object, const AffineTransform& localTransform, const FloatPoint& pointInParent, FloatPoint& localPoint) |
@@ -435,7 +437,7 @@ bool SVGLayoutSupport::willIsolateBlendingDescendantsForStyle(const ComputedStyl |
const SVGComputedStyle& svgStyle = style.svgStyle(); |
return style.hasIsolation() || style.opacity() < 1 || style.hasBlendMode() |
- || style.hasFilter() || svgStyle.hasMasker() || svgStyle.hasClipper(); |
+ || style.hasFilter() || svgStyle.hasMasker() || svgStyle.clipPath(); |
} |
bool SVGLayoutSupport::willIsolateBlendingDescendantsForObject(const LayoutObject* object) |