Bug 309219
| Summary: | Make sure than when polyline have an odd number (missing coordinates), we drop the last one and draws the rest. | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Karl Dubost <karlcow> |
| Component: | SVG | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | ahmad.saleem792, sabouhallawa, webkit-bug-importer, zimmermann |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=311469 | ||
Karl Dubost
This pull request
https://github.com/WebKit/WebKit/pull/59513
erroneously changed LayoutTests/svg/custom/poly-parsing-error.html
SVG2 specification specifies what should happen in case of an odd number of coordinates.
> If an odd number of coordinates is provided, then the element is in error, with the same user agent behavior as occurs with an incorrectly specified ‘path’ element. In such error cases the user agent will drop the last, odd coordinate and otherwise render the shape. — https://w3c.github.io/svgwg/svg2-draft/shapes.html#PolylineElementPointsAttribute
This is a square.
<svg width="100px" height="100px" viewBox="0 0 300 300">
<desc>polyline odd number of points coordinates</desc>
<polyline fill="none" stroke="blue" stroke-width="5"
points="50,150
150,150
150,50
50,50
50,150
" />
</svg>
5 points / missing last y coordinates. This should render like the next one.
<svg width="100px" height="100px" viewBox="0 0 300 300">
<desc>polyline odd number of points coordinates</desc>
<polyline fill="none" stroke="blue" stroke-width="5"
points="50,150
150,150
150,50
50,50
50
" />
</svg>
<svg width="100px" height="100px" viewBox="0 0 300 300">
<desc>polyline odd number of points coordinates</desc>
<polyline fill="none" stroke="blue" stroke-width="5"
points="50,150
150,150
150,50
50,50
" />
</svg>
Question, what should happen when a point in the middle is incorrect.
Make a WPT test for polyline.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/172341540>