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

Unified Diff: Source/core/rendering/svg/RenderSVGPath.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/RenderSVGPath.h ('k') | Source/core/rendering/svg/RenderSVGRect.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/svg/RenderSVGPath.cpp
diff --git a/Source/core/rendering/svg/RenderSVGPath.cpp b/Source/core/rendering/svg/RenderSVGPath.cpp
index a1ddf125512693e7e7f798073e7a4ae94c090060..a6344ec8aeae9892b7eb8c974b7cec8464798d1b 100644
--- a/Source/core/rendering/svg/RenderSVGPath.cpp
+++ b/Source/core/rendering/svg/RenderSVGPath.cpp
@@ -49,26 +49,24 @@
void RenderSVGPath::updateShapeFromElement()
{
RenderSVGShape::updateShapeFromElement();
+ updateZeroLengthSubpaths();
- updateZeroLengthSubpaths();
- m_hitTestStrokeBoundingBox = calculateUpdatedHitTestStrokeBoundingBox();
-
- m_strokeBoundingBox = style()->svgStyle().hasStroke() ? m_hitTestStrokeBoundingBox : m_fillBoundingBox;
-
- if (!m_markerPositions.isEmpty()) {
- const FloatRect markerRect = this->markerRect(strokeWidth());
- m_strokeBoundingBox.unite(markerRect);
- }
+ m_strokeBoundingBox = calculateUpdatedStrokeBoundingBox();
}
-FloatRect RenderSVGPath::calculateUpdatedHitTestStrokeBoundingBox() const
+FloatRect RenderSVGPath::calculateUpdatedStrokeBoundingBox() const
{
- FloatRect strokeBoundingBox = m_hitTestStrokeBoundingBox;
+ FloatRect strokeBoundingBox = m_strokeBoundingBox;
- // FIXME: zero-length subpaths do not respect vector-effect = non-scaling-stroke.
- const float strokeWidth = this->strokeWidth();
- for (size_t i = 0; i < m_zeroLengthLinecapLocations.size(); ++i)
- strokeBoundingBox.unite(zeroLengthSubpathRect(m_zeroLengthLinecapLocations[i], strokeWidth));
+ if (!m_markerPositions.isEmpty())
+ strokeBoundingBox.unite(markerRect(strokeWidth()));
+
+ if (style()->svgStyle().hasStroke()) {
+ // FIXME: zero-length subpaths do not respect vector-effect = non-scaling-stroke.
+ float strokeWidth = this->strokeWidth();
+ for (size_t i = 0; i < m_zeroLengthLinecapLocations.size(); ++i)
+ strokeBoundingBox.unite(zeroLengthSubpathRect(m_zeroLengthLinecapLocations[i], strokeWidth));
+ }
return strokeBoundingBox;
}
@@ -79,9 +77,9 @@
return true;
const SVGRenderStyle& svgStyle = style()->svgStyle();
- const float strokeWidth = this->strokeWidth();
for (size_t i = 0; i < m_zeroLengthLinecapLocations.size(); ++i) {
ASSERT(svgStyle.hasStroke());
+ float strokeWidth = this->strokeWidth();
if (svgStyle.capStyle() == SquareCap) {
if (zeroLengthSubpathRect(m_zeroLengthLinecapLocations[i], strokeWidth).contains(point))
return true;
« no previous file with comments | « Source/core/rendering/svg/RenderSVGPath.h ('k') | Source/core/rendering/svg/RenderSVGRect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698