Index: Source/core/rendering/svg/RenderSVGShape.cpp |
diff --git a/Source/core/rendering/svg/RenderSVGShape.cpp b/Source/core/rendering/svg/RenderSVGShape.cpp |
index a21930c5bf70f26b805c64b71cd0f9731b46d278..51c8e0651259e68ffddc38a50f786b765ad75f88 100644 |
--- a/Source/core/rendering/svg/RenderSVGShape.cpp |
+++ b/Source/core/rendering/svg/RenderSVGShape.cpp |
@@ -312,7 +312,7 @@ void RenderSVGShape::addFocusRingRects(Vector<IntRect>& rects, const LayoutPoint |
bool RenderSVGShape::nodeAtFloatPoint(const HitTestRequest& request, HitTestResult& result, const FloatPoint& pointInParent, HitTestAction hitTestAction) |
{ |
- // We only draw in the forground phase, so we only hit-test then. |
+ // We only draw in the foreground phase, so we only hit-test then. |
if (hitTestAction != HitTestForeground) |
return false; |
@@ -321,7 +321,17 @@ bool RenderSVGShape::nodeAtFloatPoint(const HitTestRequest& request, HitTestResu |
if (!SVGRenderSupport::pointInClippingArea(this, localPoint)) |
return false; |
- PointerEventsHitRules hitRules(PointerEventsHitRules::SVG_PATH_HITTESTING, request, style()->pointerEvents()); |
+ PointerEventsHitRules hitRules(PointerEventsHitRules::SVG_GEOMETRY_HITTESTING, request, style()->pointerEvents()); |
+ if (nodeAtFloatPointInternal(request, localPoint, hitRules)) { |
+ updateHitTestResult(result, roundedLayoutPoint(localPoint)); |
+ return true; |
+ } |
+ |
+ return false; |
+} |
+ |
+bool RenderSVGShape::nodeAtFloatPointInternal(const HitTestRequest& request, const FloatPoint& localPoint, PointerEventsHitRules hitRules) |
+{ |
bool isVisible = (style()->visibility() == VISIBLE); |
if (isVisible || !hitRules.requireVisible) { |
const SVGRenderStyle* svgStyle = style()->svgStyle(); |
@@ -329,10 +339,8 @@ bool RenderSVGShape::nodeAtFloatPoint(const HitTestRequest& request, HitTestResu |
if (request.svgClipContent()) |
fillRule = svgStyle->clipRule(); |
if ((hitRules.canHitStroke && (svgStyle->hasStroke() || !hitRules.requireStroke) && strokeContains(localPoint, hitRules.requireStroke)) |
- || (hitRules.canHitFill && (svgStyle->hasFill() || !hitRules.requireFill) && fillContains(localPoint, hitRules.requireFill, fillRule))) { |
- updateHitTestResult(result, roundedLayoutPoint(localPoint)); |
+ || (hitRules.canHitFill && (svgStyle->hasFill() || !hitRules.requireFill) && fillContains(localPoint, hitRules.requireFill, fillRule))) |
return true; |
- } |
} |
return false; |
} |