| Index: Source/core/rendering/svg/RenderSVGPath.cpp
|
| diff --git a/Source/core/rendering/svg/RenderSVGPath.cpp b/Source/core/rendering/svg/RenderSVGPath.cpp
|
| index a6344ec8aeae9892b7eb8c974b7cec8464798d1b..30ae5bdb013d72122068a9be934f4901503d7d4a 100644
|
| --- a/Source/core/rendering/svg/RenderSVGPath.cpp
|
| +++ b/Source/core/rendering/svg/RenderSVGPath.cpp
|
| @@ -49,24 +49,26 @@ RenderSVGPath::~RenderSVGPath()
|
| void RenderSVGPath::updateShapeFromElement()
|
| {
|
| RenderSVGShape::updateShapeFromElement();
|
| - updateZeroLengthSubpaths();
|
|
|
| - m_strokeBoundingBox = calculateUpdatedStrokeBoundingBox();
|
| + if (m_markerPositions.isEmpty()) {
|
| + m_markerRect = FloatRect();
|
| + } else {
|
| + m_markerRect = markerRect(strokeWidth());
|
| + m_hitTestStrokeBoundingBox.unite(m_markerRect);
|
| + }
|
| +
|
| + updateZeroLengthSubpaths();
|
| + m_hitTestStrokeBoundingBox = calculateUpdatedHitTestStrokeBoundingBox();
|
| }
|
|
|
| -FloatRect RenderSVGPath::calculateUpdatedStrokeBoundingBox() const
|
| +FloatRect RenderSVGPath::calculateUpdatedHitTestStrokeBoundingBox() const
|
| {
|
| - FloatRect strokeBoundingBox = m_strokeBoundingBox;
|
| -
|
| - if (!m_markerPositions.isEmpty())
|
| - strokeBoundingBox.unite(markerRect(strokeWidth()));
|
| + FloatRect strokeBoundingBox = m_hitTestStrokeBoundingBox;
|
|
|
| - 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));
|
| - }
|
| + // 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));
|
|
|
| return strokeBoundingBox;
|
| }
|
| @@ -77,9 +79,9 @@ bool RenderSVGPath::shapeDependentStrokeContains(const FloatPoint& point)
|
| 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;
|
| @@ -93,6 +95,16 @@ bool RenderSVGPath::shapeDependentStrokeContains(const FloatPoint& point)
|
| return false;
|
| }
|
|
|
| +FloatRect RenderSVGPath::strokeBoundingBox() const
|
| +{
|
| + if (style()->svgStyle().hasStroke())
|
| + return m_hitTestStrokeBoundingBox;
|
| +
|
| + FloatRect strokeBoundingBox = m_fillBoundingBox;
|
| + strokeBoundingBox.unite(m_markerRect);
|
| + return strokeBoundingBox;
|
| +}
|
| +
|
| bool RenderSVGPath::shouldStrokeZeroLengthSubpath() const
|
| {
|
| // Spec(11.4): Any zero length subpath shall not be stroked if the "stroke-linecap" property has a value of butt
|
|
|