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

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

Issue 882443006: Revert of Fix pointer-events:all when stroke="none" (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 11 months 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
« no previous file with comments | « Source/core/rendering/svg/RenderSVGShape.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/svg/RenderSVGShape.cpp
diff --git a/Source/core/rendering/svg/RenderSVGShape.cpp b/Source/core/rendering/svg/RenderSVGShape.cpp
index 12e391fa7065ffa7829a706f52b5afa98e80db7d..92e822d3146ad2acb68869289c1cf5e0e26301bc 100644
--- a/Source/core/rendering/svg/RenderSVGShape.cpp
+++ b/Source/core/rendering/svg/RenderSVGShape.cpp
@@ -64,8 +64,7 @@
processMarkerPositions();
m_fillBoundingBox = calculateObjectBoundingBox();
- m_hitTestStrokeBoundingBox = calculateHitTestStrokeBoundingBox();
- m_strokeBoundingBox = style()->svgStyle().hasStroke() ? m_hitTestStrokeBoundingBox : m_fillBoundingBox;
+ m_strokeBoundingBox = calculateStrokeBoundingBox();
}
bool RenderSVGShape::shapeDependentStrokeContains(const FloatPoint& point)
@@ -102,16 +101,11 @@
bool RenderSVGShape::strokeContains(const FloatPoint& point, bool requiresStroke)
{
- if (requiresStroke) {
- if (!strokeBoundingBox().contains(point))
- return false;
-
- if (!SVGPaintServer::existsForRenderer(*this, style(), ApplyToStrokeMode))
- return false;
- } else {
- if (!hitTestStrokeBoundingBox().contains(point))
- return false;
- }
+ if (!strokeBoundingBox().contains(point))
+ return false;
+
+ if (requiresStroke && !SVGPaintServer::existsForRenderer(*this, style(), ApplyToStrokeMode))
+ return false;
return shapeDependentStrokeContains(point);
}
@@ -227,23 +221,25 @@
return path().boundingRect();
}
-FloatRect RenderSVGShape::calculateHitTestStrokeBoundingBox() const
+FloatRect RenderSVGShape::calculateStrokeBoundingBox() const
{
ASSERT(m_path);
FloatRect strokeBoundingBox = m_fillBoundingBox;
- StrokeData strokeData;
- SVGRenderSupport::applyStrokeStyleToStrokeData(&strokeData, style(), this);
- if (hasNonScalingStroke()) {
- AffineTransform nonScalingTransform = nonScalingStrokeTransform();
- if (nonScalingTransform.isInvertible()) {
- Path* usePath = nonScalingStrokePath(m_path.get(), nonScalingTransform);
- FloatRect strokeBoundingRect = usePath->strokeBoundingRect(strokeData);
- strokeBoundingRect = nonScalingTransform.inverse().mapRect(strokeBoundingRect);
- strokeBoundingBox.unite(strokeBoundingRect);
+ if (style()->svgStyle().hasStroke()) {
+ StrokeData strokeData;
+ SVGRenderSupport::applyStrokeStyleToStrokeData(&strokeData, style(), this);
+ if (hasNonScalingStroke()) {
+ AffineTransform nonScalingTransform = nonScalingStrokeTransform();
+ if (nonScalingTransform.isInvertible()) {
+ Path* usePath = nonScalingStrokePath(m_path.get(), nonScalingTransform);
+ FloatRect strokeBoundingRect = usePath->strokeBoundingRect(strokeData);
+ strokeBoundingRect = nonScalingTransform.inverse().mapRect(strokeBoundingRect);
+ strokeBoundingBox.unite(strokeBoundingRect);
+ }
+ } else {
+ strokeBoundingBox.unite(path().strokeBoundingRect(strokeData));
}
- } else {
- strokeBoundingBox.unite(path().strokeBoundingRect(strokeData));
}
return strokeBoundingBox;
« no previous file with comments | « Source/core/rendering/svg/RenderSVGShape.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698