Changeset 106882 in webkit
- Timestamp:
- Feb 6, 2012 5:30:50 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r106878 r106882 1 2012-02-06 Stephen Chenney <schenney@chromium.org> 2 3 RenderSVGShape::strokeContains will fail for some strokes 4 https://bugs.webkit.org/show_bug.cgi?id=76931 5 6 Reviewed by Darin Adler. 7 8 New tests for hit testing against an SVG path of zero length with 9 endcaps. 10 11 * svg/hittest/zero-length-butt-cap-path-expected.txt: Added. 12 * svg/hittest/zero-length-butt-cap-path.xhtml: Added. 13 * svg/hittest/zero-length-round-cap-path-expected.txt: Added. 14 * svg/hittest/zero-length-round-cap-path.xhtml: Added. 15 * svg/hittest/zero-length-square-cap-path-expected.txt: Added. 16 * svg/hittest/zero-length-square-cap-path.xhtml: Added. 17 1 18 2012-02-06 Philip Rogers <pdr@google.com> 2 19 -
trunk/Source/WebCore/ChangeLog
r106881 r106882 1 2012-02-06 Stephen Chenney <schenney@chromium.org> 2 3 RenderSVGShape::strokeContains will fail for some strokes 4 https://bugs.webkit.org/show_bug.cgi?id=76931 5 6 Reviewed by Darin Adler. 7 8 Adding support for rounded zero-length endcaps for SVG path hit 9 testing. 10 11 Tests: svg/hittest/zero-length-butt-cap-path.xhtml 12 svg/hittest/zero-length-round-cap-path.xhtml 13 svg/hittest/zero-length-square-cap-path.xhtml 14 15 * rendering/svg/RenderSVGShape.cpp: 16 (WebCore::RenderSVGShape::strokeContains): 17 1 18 2012-02-06 Gregg Tavares <gman@google.com> 2 19 -
trunk/Source/WebCore/rendering/svg/RenderSVGShape.cpp
r105878 r106882 137 137 return false; 138 138 139 // FIXME: This is not correct for round linecaps. https://bugs.webkit.org/show_bug.cgi?id=76931139 const SVGRenderStyle* svgStyle = style()->svgStyle(); 140 140 for (size_t i = 0; i < m_zeroLengthLinecapLocations.size(); ++i) { 141 if (zeroLengthSubpathRect(m_zeroLengthLinecapLocations[i], this->strokeWidth()).contains(point)) 142 return true; 143 } 144 145 const SVGRenderStyle* svgStyle = style()->svgStyle(); 141 ASSERT(style()->svgStyle()->hasStroke()); 142 float strokeWidth = this->strokeWidth(); 143 if (style()->svgStyle()->capStyle() == SquareCap) { 144 if (zeroLengthSubpathRect(m_zeroLengthLinecapLocations[i], strokeWidth).contains(point)) 145 return true; 146 } else { 147 ASSERT(style()->svgStyle()->capStyle() == RoundCap); 148 FloatPoint radiusVector(point.x() - m_zeroLengthLinecapLocations[i].x(), point.y() - m_zeroLengthLinecapLocations[i].y()); 149 if (radiusVector.lengthSquared() < strokeWidth * strokeWidth * .25f) 150 return true; 151 } 152 } 153 146 154 if (!svgStyle->strokeDashArray().isEmpty() || svgStyle->strokeMiterLimit() != svgStyle->initialStrokeMiterLimit() 147 155 || svgStyle->joinStyle() != svgStyle->initialJoinStyle() || svgStyle->capStyle() != svgStyle->initialCapStyle() || static_cast<SVGElement*>(node())->isStyled()) {
Note: See TracChangeset
for help on using the changeset viewer.