Index: Source/core/layout/svg/LayoutSVGPath.cpp |
diff --git a/Source/core/layout/svg/LayoutSVGPath.cpp b/Source/core/layout/svg/LayoutSVGPath.cpp |
index 2d14461c137230652dbb042e1b3687562a1e4c11..89e82d7eaca0f4082b352a428fa018ae4222aed6 100644 |
--- a/Source/core/layout/svg/LayoutSVGPath.cpp |
+++ b/Source/core/layout/svg/LayoutSVGPath.cpp |
@@ -32,7 +32,6 @@ |
#include "core/layout/svg/LayoutSVGResourceMarker.h" |
#include "core/layout/svg/SVGResources.h" |
#include "core/layout/svg/SVGResourcesCache.h" |
-#include "core/layout/svg/SVGSubpathData.h" |
#include "core/svg/SVGGeometryElement.h" |
#include "wtf/MathExtras.h" |
@@ -47,12 +46,6 @@ LayoutSVGPath::~LayoutSVGPath() |
{ |
} |
-void LayoutSVGPath::updateShapeFromElement() |
-{ |
- LayoutSVGShape::updateShapeFromElement(); |
- updateZeroLengthSubpaths(); |
-} |
- |
void LayoutSVGPath::updateStrokeAndFillBoundingBoxes() |
{ |
LayoutSVGShape::updateStrokeAndFillBoundingBoxes(); |
@@ -61,13 +54,6 @@ void LayoutSVGPath::updateStrokeAndFillBoundingBoxes() |
processMarkerPositions(); |
if (!m_markerPositions.isEmpty()) |
m_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) |
- m_strokeBoundingBox.unite(zeroLengthSubpathRect(m_zeroLengthLinecapLocations[i], strokeWidth)); |
- } |
} |
FloatRect LayoutSVGPath::hitTestStrokeBoundingBox() const |
@@ -98,59 +84,9 @@ FloatRect LayoutSVGPath::hitTestStrokeBoundingBox() const |
} |
box.inflate(delta); |
- |
- for (size_t i = 0; i < m_zeroLengthLinecapLocations.size(); ++i) |
- box.unite(zeroLengthSubpathRect(m_zeroLengthLinecapLocations[i], strokeWidth)); |
- |
return box; |
} |
-bool LayoutSVGPath::shapeDependentStrokeContains(const FloatPoint& point) |
-{ |
- if (LayoutSVGShape::shapeDependentStrokeContains(point)) |
- return true; |
- |
- const SVGComputedStyle& svgStyle = style()->svgStyle(); |
- const float strokeWidth = this->strokeWidth(); |
- for (size_t i = 0; i < m_zeroLengthLinecapLocations.size(); ++i) { |
- ASSERT(svgStyle.hasStroke()); |
- if (svgStyle.capStyle() == SquareCap) { |
- if (zeroLengthSubpathRect(m_zeroLengthLinecapLocations[i], strokeWidth).contains(point)) |
- return true; |
- } else { |
- ASSERT(svgStyle.capStyle() == RoundCap); |
- FloatPoint radiusVector(point.x() - m_zeroLengthLinecapLocations[i].x(), point.y() - m_zeroLengthLinecapLocations[i].y()); |
- if (radiusVector.lengthSquared() < strokeWidth * strokeWidth * .25f) |
- return true; |
- } |
- } |
- return false; |
-} |
- |
-bool LayoutSVGPath::shouldStrokeZeroLengthSubpath() const |
-{ |
- // Spec(11.4): Any zero length subpath shall not be stroked if the "stroke-linecap" property has a value of butt |
- // but shall be stroked if the "stroke-linecap" property has a value of round or square |
- return style()->svgStyle().hasStroke() && style()->svgStyle().capStyle() != ButtCap; |
-} |
- |
-FloatRect LayoutSVGPath::zeroLengthSubpathRect(const FloatPoint& linecapPosition, float strokeWidth) |
-{ |
- return FloatRect(linecapPosition.x() - strokeWidth / 2, linecapPosition.y() - strokeWidth / 2, strokeWidth, strokeWidth); |
-} |
- |
-void LayoutSVGPath::updateZeroLengthSubpaths() |
-{ |
- m_zeroLengthLinecapLocations.clear(); |
- |
- if (!strokeWidth() || !shouldStrokeZeroLengthSubpath()) |
- return; |
- |
- SVGSubpathData subpathData(m_zeroLengthLinecapLocations); |
- path().apply(&subpathData, SVGSubpathData::updateFromPathElement); |
- subpathData.pathIsDone(); |
-} |
- |
FloatRect LayoutSVGPath::markerRect(float strokeWidth) const |
{ |
ASSERT(!m_markerPositions.isEmpty()); |