Chromium Code Reviews| 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..dbc2c1f9700055e5e610295e06c2b052a2398409 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().clipPath(); |
| + if (!clipPathOperation) |
| + return true; |
| + if (clipPathOperation->type() == ClipPathOperation::SHAPE) { |
|
chrishtr
2016/09/09 02:04:46
Why this new code to support SHAPE? Is this to imp
fs
2016/09/09 08:28:10
No, this is actually what falls out by starting to
fs
2016/09/09 08:31:35
I should probably mention that "Support for nestin
fs
2016/09/09 16:26:42
I've split out <basic-shape> support for 'clip-pat
fs
2016/09/09 20:12:16
Done.
|
| + 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() || style.clipPath(); |
| } |
| bool SVGLayoutSupport::willIsolateBlendingDescendantsForObject(const LayoutObject* object) |