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

Unified Diff: Source/core/rendering/svg/RenderSVGShape.cpp

Issue 62943002: Implement SVGGeometryElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update copyrights Created 7 years, 1 month 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: Source/core/rendering/svg/RenderSVGShape.cpp
diff --git a/Source/core/rendering/svg/RenderSVGShape.cpp b/Source/core/rendering/svg/RenderSVGShape.cpp
index a21930c5bf70f26b805c64b71cd0f9731b46d278..4dab8d3037ee5ac024cc13e8cfba61f7d89ba899 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;
@@ -322,6 +322,16 @@ bool RenderSVGShape::nodeAtFloatPoint(const HitTestRequest& request, HitTestResu
return false;
PointerEventsHitRules hitRules(PointerEventsHitRules::SVG_PATH_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;
}

Powered by Google App Engine
This is Rietveld 408576698