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

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

Issue 810343003: Fix pointer-events:all when stroke="none" (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove braces from single-line if statement Created 5 years, 12 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
Index: Source/core/rendering/svg/RenderSVGShape.cpp
diff --git a/Source/core/rendering/svg/RenderSVGShape.cpp b/Source/core/rendering/svg/RenderSVGShape.cpp
index 92e822d3146ad2acb68869289c1cf5e0e26301bc..31113917f5f6a60de3195884e01d840845494316 100644
--- a/Source/core/rendering/svg/RenderSVGShape.cpp
+++ b/Source/core/rendering/svg/RenderSVGShape.cpp
@@ -101,7 +101,7 @@ bool RenderSVGShape::fillContains(const FloatPoint& point, bool requiresFill, co
bool RenderSVGShape::strokeContains(const FloatPoint& point, bool requiresStroke)
{
- if (!strokeBoundingBox().contains(point))
+ if (!(requiresStroke ? actualStrokeBoundingBox() : m_strokeBoundingBox).contains(point))
return false;
if (requiresStroke && !SVGPaintServer::existsForRenderer(*this, style(), ApplyToStrokeMode))
@@ -226,20 +226,18 @@ FloatRect RenderSVGShape::calculateStrokeBoundingBox() const
ASSERT(m_path);
FloatRect strokeBoundingBox = m_fillBoundingBox;
- 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));
+ 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));
}
return strokeBoundingBox;
@@ -247,7 +245,7 @@ FloatRect RenderSVGShape::calculateStrokeBoundingBox() const
void RenderSVGShape::updatePaintInvalidationBoundingBox()
{
- m_paintInvalidationBoundingBox = strokeBoundingBox();
+ m_paintInvalidationBoundingBox = actualStrokeBoundingBox();
if (strokeWidth() < 1.0f && !m_paintInvalidationBoundingBox.isEmpty())
m_paintInvalidationBoundingBox.inflate(1);
SVGRenderSupport::intersectPaintInvalidationRectWithResources(this, m_paintInvalidationBoundingBox);
« Source/core/rendering/svg/RenderSVGShape.h ('K') | « Source/core/rendering/svg/RenderSVGShape.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698