-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Canvas stroke(): Subpaths of length 0 should render their line caps. #1079
Comments
Also, rendering back to back lineCaps on zero-length subpaths would match the behavior of SVG path rendering. |
It sounds like there's a compelling argument in favor of removing that step, so works for me. It would be good to get a WebKit canvas person's take to make sure they are OK eventually aligning with the majority and with the proposed spec, but I don't think that should block a PR. |
I took a closer look at this to make sure there aren't any weird edge case side-effects from removing step 3:
If we want to match SVG, this is what it says for square line caps: "If a subpath has zero length, then the resulting effect is that the stroke for that subpath consists solely of a square with side length equal to the stroke width, centered at the subpath's point, and oriented such that two of its sides are parallel to the effective tangent at that subpath's point. See ‘path’ element implementation notes for details on how to determine the tangent at a zero-length subpath." [1] Summoning @dirkschulze : Help! References: |
cc @whatwg/canvas |
@AmeliaBR could you maybe help with the SVG question in #1079 (comment) or know someone who can? |
The SVG behavior is that a zero-length path segment is drawn with line caps, but a single point (e.g., created by two consecutive move-to commands) is not. There's a detailed algorithm in SVG 2, and it includes some edge case details (like what is the direction of a zero-length path, and what to do with a zero-length close path) that have been clarified since SVG 1.1. Browsers are mostly consistent, but an updated test suite for all the edge cases is still required. Current behavior: Example showing the same path in SVG and Canvas with square line caps: https://codepen.io/AmeliaBR/pen/KQKjXJ The path includes:
As expected, all browsers draw line-caps for most zero-length SVG path segments, but with some quirks (Edge skips the zero-length arc segment, and Safari draws two double-linecap squares at different orientations for each--not sure what's going on there.) Chrome and Safari both draw line-caps for the zero-length path segments in canvas (although they disagree on orientation & for reasons I don't understand Safari initializes a canvas to solid black). Firefox and Edge do not draw any of the zero-length segment linecaps in canvas, conforming with the current canvas spec. (Note that I'm using a polyfill for Edge; the thin black square confirms that it can draw from a path data string.) My opinion: I believe it would be preferable to authors (and maybe even convenient for implementers) if canvas stroking behavior was consistent with SVG behavior, unless there is a legacy reason to maintain a difference. Since some major implementations do not match the current canvas spec, I doubt there would be a significant compat issue with changing it. |
I tend to agree. (I think it would be great if eventually SVG and canvas could use a shared underlying model for paths, instead of having separate descriptions that are somehow magically intertwined (canvas accepts SVG paths after all). CSS needs this too to define its various path-related things, some of which seemingly accept SVG path syntax already.) |
bumping this, as we seem to have stumbled upon a similar problem. We are planning to change behavior to match Firefox and SVG. |
@fserb I notice that in https://bugs.chromium.org/p/chromium/issues/detail?id=644067, this behavior was recently changed in Blink -- but not in the way you suggest here, rather the opposite. I think that's regrettable, as it's a significant step away from the goal of a common canvas2d/svg rendering model that people in the discussion here seemed to agree was desirable. Can you perhaps raise this with the concerned engineers/teams, and maybe get people to reconsider that change? |
I believe the original comment was a bit mislead.
In the previous step (8), the line dash algorithm can create such points, and these are the ones that step 9 has to handle. So the specs made sense, but the current behavior is anyway too far from being interoperable even today, and I won't be arguing that keeping the step 3 is the best move. I guess going as close as possible to SVG would be good, but most implementations are relatively far from it. I ran a few quick tests to see how bad the discrepancies are between implementations (along with their SVG counter parts), and it's pretty bad. Even with the latest changes done in Chrome Canary. Also even SVGs implementations aren't really 100% interoperable in the way they render line-dashes. I didn't check what SVG specs really ask there. And my reading of the canvas specs might be mislead too in some cases. Toggle to see the results:JSFiddle | Graphic resultsRendering of zero-length sub-pathsmoveTo (✅)Removed everywhere, in accordance with the specs, step 3. moveTo + moveTo (✅)Removed everywhere, in accordance with the specs, step 3. moveTo + lineTo (❌)Kept in Chrome stable & Safari - Removed in Firefox and Canary - Kept in SVG everywhere. moveTo + closePath (❌)Kept in Chrome stable - Removed in Firefox, Safari, and Canary - Kept in SVG everywhere. moveTo + moveTo + closePath (❌)Same as moveTo + closePath. moveTo + lineTo + closePath (✅*)Same as moveTo + closePath. moveTo + lineTo(1) (✅)Kept everywhere. Line cap is drawn on both sides of the point. moveTo + lineTo(1) + closePath (✅)Kept everywhere. Line cap is not drawn on any side of the point. (Safari has a weird 1px dot in the middle, in both canvas and SVG). moveTo + lineTo + draw more (❌)Kept in Chrome stable and Canary. Removed in Firefox and Safari. Kept in SVG everywhere. lineTo x4 + closePath + moveTo + closePath (❌)Kept in Chrome stable, Canary, and Firefox... Removed in Safari. Kept in SVG everywhere. lineTo x4 + closePath lineDash([0, width]) (✅)Kept everywhere. (Tests single points segments are correctly rendered when they're created from the stroke-dash algorithm). Rendering of line-dash capslineTo x4 + closePath lineDash([length, 0]) (✅*)Only the top left corner has its cap rendered everywhere. Firefox's SVG does not render the top-left cap. lineTo x4 + closePath lineDash([length, length]) (❌)Chrome (stable and Canary), and Safari render the top left corner's cap. Firefox doesn't. Same varying results in SVG. repeat2(lineTo x4 + closePath) lineDash([length / 2, length / 2]) (✅)Top-left corner's cap is rendered everywhere, even in Firefox, even in SVG. lineTo x4 + closePath lineDash([width, 0]) (❌)Top-left corner's cap is not rendered in Chrome (stable & Canary) in both canvas and SVG. Rendered in Firefox and Safari (canvas & SVG). lineTo x1 + closePath lineDash([length, 0]) (✅*)Left cap is rendered everywhere, but in Firefox's SVG. Right cap is not rendered anywhere. (Safari has a weird 1px glitch in the middle). lineTo x1 + closePath lineDash([length / 2, 0]) (❌)Left cap is not rendered in Chrome (both) and Firefox, both in Canvas and in SVG. Safari renders it. Right cap is rendered everywhere, but in Firefox's SVG. lineTo x4 lineDash([length / 4, length / 4]) (✅*)Renders caps on both ends of both segments everywhere, but with a compositing bug in Safari (looks like the stroke filling crosses itself). |
Hi Kelsey, @kdashg, since this discussion is generally positive to render the line end-caps for empty paths, I am tempting to change the spec to reflect it (#9663). What's the firefox perspective on it? Note that Firefox's current behavior almost matches with the spec after change (https://wpt.fyi/results/html/canvas/offscreen/path-objects?label=master&label=experimental&aligned&q=2d.path.stroke.prune, failling the test meaning draw the line caps). |
Mozilla think this is a good idea to standardize on yes-drawing. When we tried to match spec with this, we had web-compat issues and reverted to our draw-zero-subpath-end-caps behavior. Edge and Safari will begin to fail these tests if this change is made. Would you update behavior to match a changed spec (and tests), @annevk (Apple) and @RafaelCintron (Microsoft)? |
As discussed in the github issue, whatwg/html#1079, it's generally agreed to skip drawing line caps for closed paths. This will also fix the test 2d.path.stroke.prune.rect.html. Bug: 644067 Change-Id: Ic31ae8311262da56101a59600972f20d306a668b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4864280 Commit-Queue: Yi Xu <yiyix@google.com> Reviewed-by: Justin Novosad <junov@chromium.org> Cr-Commit-Position: refs/heads/main@{#1197284}
I discussed this with colleagues and it seems reasonable to us. |
As discussed in the github issue, whatwg/html#1079, it's generally agreed to skip drawing line caps for closed paths. This will also fix the test 2d.path.stroke.prune.closed.html. Bug: 644067 Change-Id: I6e1ae0c31384e98c39e22f315214a14d9ce791d8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4864061 Reviewed-by: Justin Novosad <junov@chromium.org> Commit-Queue: Yi Xu <yiyix@google.com> Cr-Commit-Position: refs/heads/main@{#1204192}
As discussed in the github issue, whatwg/html#1079, it's generally agreed to skip drawing line caps for closed paths. This is a follow up cl of: https://chromium-review.googlesource.com/c/chromium/src/+/4864061 It fixes the extra line caps issue for closed path with other paths. Bug: 644067 Change-Id: I14c5c4819a31eb9249d01574ff1b5c60826c3b9e
As discussed in the github issue, whatwg/html#1079, it's generally agreed to skip drawing line caps for closed paths. Add test cases for full ellipse path. Bug: 644067 Change-Id: I3fde274f4b15a96d4ecaa593b0317c585eeb4a25
As discussed in the github issue, whatwg/html#1079, it's generally agreed to skip drawing line caps for closed paths. Add test cases for full ellipse path. Bug: 644067 Change-Id: I3fde274f4b15a96d4ecaa593b0317c585eeb4a25
As discussed in the github issue, whatwg/html#1079, it's generally agreed to skip drawing line caps for closed paths. This is a follow up cl of: https://chromium-review.googlesource.com/c/chromium/src/+/4864061 It fixes the extra line caps issue for closed path with other paths. Bug: 644067 Change-Id: I14c5c4819a31eb9249d01574ff1b5c60826c3b9e
As discussed in the github issue, whatwg/html#1079, it's generally agreed to skip drawing line caps for closed paths. Add test cases for full ellipse path. Bug: 644067 Change-Id: I3fde274f4b15a96d4ecaa593b0317c585eeb4a25
As discussed in the github issue, whatwg/html#1079, it's generally agreed to skip drawing line caps for closed paths. Add test cases for full ellipse path. Bug: 644067 Change-Id: I3fde274f4b15a96d4ecaa593b0317c585eeb4a25
…e paths", a=testonly Automatic update from web-platform-tests Revert "Skip line caps for closed ellipse paths" This reverts commit a7c44e6c2a28134ad01add05c3a0b7ec2f6e441a. Reason for revert: line caps for closed subpath are supposed to be skipped. But full ellipse are arcs, not closed paths according to spec, https://html.spec.whatwg.org/multipage/canvas.html#ellipse-method-steps. Original change's description: > Skip line caps for closed ellipse paths > > As discussed in the github issue, whatwg/html#1079, it's generally agreed to skip drawing line caps for closed paths. Add test cases for full > ellipse path. > > Bug: 644067 > > Change-Id: I3fde274f4b15a96d4ecaa593b0317c585eeb4a25 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4919559 > Commit-Queue: Yi Xu <yiyixgoogle.com> > Reviewed-by: Justin Novosad <junovchromium.org> > Cr-Commit-Position: refs/heads/main{#1208078} Bug: 644067 Change-Id: Idc4810290d431edc608eaf2cd9d3a35e7f83f9aa Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4935432 Reviewed-by: Jean-Philippe Gravel <jpgravelchromium.org> Bot-Commit: Rubber Stamper <rubber-stamperappspot.gserviceaccount.com> Commit-Queue: Yi Xu <yiyixchromium.org> Cr-Commit-Position: refs/heads/main{#1209057} -- wpt-commits: bbd6ebee4588e0eefef6a63fbb4ceb668d4fe33a wpt-pr: 42511 UltraBlame original commit: 90b22e81ce378846fa924c1a836e0ae6adf58a71
… a=testonly Automatic update from web-platform-tests Skip line caps for closed ellipse paths As discussed in the github issue, whatwg/html#1079, it's generally agreed to skip drawing line caps for closed paths. Add test cases for full ellipse path. Bug: 644067 Change-Id: I3fde274f4b15a96d4ecaa593b0317c585eeb4a25 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4919559 Commit-Queue: Yi Xu <yiyixgoogle.com> Reviewed-by: Justin Novosad <junovchromium.org> Cr-Commit-Position: refs/heads/main{#1208078} -- wpt-commits: 098e71af4436d7d0840d42465c4d20046a2e08f7 wpt-pr: 42403 UltraBlame original commit: 8b48bec1373ec6ef99682e810df8ad04531671e1
…e paths", a=testonly Automatic update from web-platform-tests Revert "Skip line caps for closed ellipse paths" This reverts commit a7c44e6c2a28134ad01add05c3a0b7ec2f6e441a. Reason for revert: line caps for closed subpath are supposed to be skipped. But full ellipse are arcs, not closed paths according to spec, https://html.spec.whatwg.org/multipage/canvas.html#ellipse-method-steps. Original change's description: > Skip line caps for closed ellipse paths > > As discussed in the github issue, whatwg/html#1079, it's generally agreed to skip drawing line caps for closed paths. Add test cases for full > ellipse path. > > Bug: 644067 > > Change-Id: I3fde274f4b15a96d4ecaa593b0317c585eeb4a25 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4919559 > Commit-Queue: Yi Xu <yiyixgoogle.com> > Reviewed-by: Justin Novosad <junovchromium.org> > Cr-Commit-Position: refs/heads/main{#1208078} Bug: 644067 Change-Id: Idc4810290d431edc608eaf2cd9d3a35e7f83f9aa Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4935432 Reviewed-by: Jean-Philippe Gravel <jpgravelchromium.org> Bot-Commit: Rubber Stamper <rubber-stamperappspot.gserviceaccount.com> Commit-Queue: Yi Xu <yiyixchromium.org> Cr-Commit-Position: refs/heads/main{#1209057} -- wpt-commits: bbd6ebee4588e0eefef6a63fbb4ceb668d4fe33a wpt-pr: 42511 UltraBlame original commit: 90b22e81ce378846fa924c1a836e0ae6adf58a71
As discussed in the github issue, whatwg/html#1079, it's generally agreed to skip drawing line caps for closed paths. This is a follow up cl of: https://chromium-review.googlesource.com/c/chromium/src/+/4864061 It fixes the extra line caps issue for closed path with other paths. Bug: 644067 Change-Id: I14c5c4819a31eb9249d01574ff1b5c60826c3b9e
As discussed in the github issue, whatwg/html#1079, it's generally agreed to skip drawing line caps for closed paths. This is a follow up cl of: https://chromium-review.googlesource.com/c/chromium/src/+/4864061 It fixes the extra line caps issue for closed path with other paths. Bug: 644067 Change-Id: I14c5c4819a31eb9249d01574ff1b5c60826c3b9e
As discussed in the github issue, whatwg/html#1079, it's generally agreed to skip drawing line caps for closed paths. This is a follow up cl of: https://chromium-review.googlesource.com/c/chromium/src/+/4864061. In this cl, it verifies if each closed path is empty, then it removes the empty closed subpaths from path. As the subpaths are removed, the corresponding line caps are skipped. Bug: 644067 Change-Id: I14c5c4819a31eb9249d01574ff1b5c60826c3b9e
As discussed in the github issue, whatwg/html#1079, it's generally agreed to skip drawing line caps for closed paths. This is a follow up cl of: https://chromium-review.googlesource.com/c/chromium/src/+/4864061. In this cl, it verifies if each closed path is empty, then it removes the empty closed subpaths from path. As the subpaths are removed, the corresponding line caps are skipped. Bug: 644067 Change-Id: I14c5c4819a31eb9249d01574ff1b5c60826c3b9e
As discussed in the github issue, whatwg/html#1079, it's generally agreed to skip drawing line caps for closed paths. This is a follow up cl of: https://chromium-review.googlesource.com/c/chromium/src/+/4864061. In this cl, it verifies if each closed path is empty, then it removes the empty closed subpaths from path. As the subpaths are removed, the corresponding line caps are skipped. Bug: 644067 Change-Id: I14c5c4819a31eb9249d01574ff1b5c60826c3b9e
As discussed in the github issue, whatwg/html#1079, it's generally agreed to skip drawing line caps for closed paths. This is a follow up cl of: https://chromium-review.googlesource.com/c/chromium/src/+/4864061. In this cl, it verifies if each closed path is empty, then it removes the empty closed subpaths from path. As the subpaths are removed, the corresponding line caps are skipped. Bug: 644067 Change-Id: I14c5c4819a31eb9249d01574ff1b5c60826c3b9e
As discussed in the github issue, whatwg/html#1079, it's generally agreed to skip drawing line caps for closed paths. This is a follow up cl of: https://chromium-review.googlesource.com/c/chromium/src/+/4864061. In this cl, it verifies if each closed path is empty, then it removes the empty closed subpaths from path. As the subpaths are removed, the corresponding line caps are skipped. Bug: 644067 Change-Id: I14c5c4819a31eb9249d01574ff1b5c60826c3b9e
As discussed in the github issue, whatwg/html#1079, it's generally agreed to skip drawing line caps for closed paths. This is a follow up cl of: https://chromium-review.googlesource.com/c/chromium/src/+/4864061. In this cl, it verifies if each closed path is empty, then it removes the empty closed subpaths from path. As the subpaths are removed, the corresponding line caps are skipped. Bug: 644067 Change-Id: I14c5c4819a31eb9249d01574ff1b5c60826c3b9e
As discussed in the github issue, whatwg/html#1079, it's generally agreed to skip drawing line caps for closed paths. This is a follow up cl of: https://chromium-review.googlesource.com/c/chromium/src/+/4864061. In this cl, it verifies if each closed path is empty, then it removes the empty closed subpaths from path. As the subpaths are removed, the corresponding line caps are skipped. Bug: 644067 Change-Id: I14c5c4819a31eb9249d01574ff1b5c60826c3b9e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4916516 Commit-Queue: Yi Xu <yiyix@google.com> Reviewed-by: Jean-Philippe Gravel <jpgravel@chromium.org> Reviewed-by: Justin Novosad <junov@chromium.org> Cr-Commit-Position: refs/heads/main@{#1247735}
As discussed in the github issue, whatwg/html#1079, it's generally agreed to skip drawing line caps for closed paths. This is a follow up cl of: https://chromium-review.googlesource.com/c/chromium/src/+/4864061. In this cl, it verifies if each closed path is empty, then it removes the empty closed subpaths from path. As the subpaths are removed, the corresponding line caps are skipped. Bug: 644067 Change-Id: I14c5c4819a31eb9249d01574ff1b5c60826c3b9e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4916516 Commit-Queue: Yi Xu <yiyix@google.com> Reviewed-by: Jean-Philippe Gravel <jpgravel@chromium.org> Reviewed-by: Justin Novosad <junov@chromium.org> Cr-Commit-Position: refs/heads/main@{#1247735}
As discussed in the github issue, whatwg/html#1079, it's generally agreed to skip drawing line caps for closed paths. This is a follow up cl of: https://chromium-review.googlesource.com/c/chromium/src/+/4864061. In this cl, it verifies if each closed path is empty, then it removes the empty closed subpaths from path. As the subpaths are removed, the corresponding line caps are skipped. Bug: 644067 Change-Id: I14c5c4819a31eb9249d01574ff1b5c60826c3b9e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4916516 Commit-Queue: Yi Xu <yiyix@google.com> Reviewed-by: Jean-Philippe Gravel <jpgravel@chromium.org> Reviewed-by: Justin Novosad <junov@chromium.org> Cr-Commit-Position: refs/heads/main@{#1247735}
Automatic update from web-platform-tests Remove empty closed paths As discussed in the github issue, whatwg/html#1079, it's generally agreed to skip drawing line caps for closed paths. This is a follow up cl of: https://chromium-review.googlesource.com/c/chromium/src/+/4864061. In this cl, it verifies if each closed path is empty, then it removes the empty closed subpaths from path. As the subpaths are removed, the corresponding line caps are skipped. Bug: 644067 Change-Id: I14c5c4819a31eb9249d01574ff1b5c60826c3b9e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4916516 Commit-Queue: Yi Xu <yiyix@google.com> Reviewed-by: Jean-Philippe Gravel <jpgravel@chromium.org> Reviewed-by: Justin Novosad <junov@chromium.org> Cr-Commit-Position: refs/heads/main@{#1247735} -- Fix the inconsistency between yaml and generated files -- wpt-commits: 3b5bcfe6fae26f8de7e5086bf9d5794dbefd456d, 3aa1c64bf887fa1ffa2fe960f43e67a2cc65f0b0 wpt-pr: 42385
Automatic update from web-platform-tests Remove empty closed paths As discussed in the github issue, whatwg/html#1079, it's generally agreed to skip drawing line caps for closed paths. This is a follow up cl of: https://chromium-review.googlesource.com/c/chromium/src/+/4864061. In this cl, it verifies if each closed path is empty, then it removes the empty closed subpaths from path. As the subpaths are removed, the corresponding line caps are skipped. Bug: 644067 Change-Id: I14c5c4819a31eb9249d01574ff1b5c60826c3b9e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4916516 Commit-Queue: Yi Xu <yiyix@google.com> Reviewed-by: Jean-Philippe Gravel <jpgravel@chromium.org> Reviewed-by: Justin Novosad <junov@chromium.org> Cr-Commit-Position: refs/heads/main@{#1247735} -- Fix the inconsistency between yaml and generated files -- wpt-commits: 3b5bcfe6fae26f8de7e5086bf9d5794dbefd456d, 3aa1c64bf887fa1ffa2fe960f43e67a2cc65f0b0 wpt-pr: 42385
This reverts commit 572074cb06425797e7e110511db405134cf67e2f. Reason for revert: caused regression bug: crbug.com/1521614 Original change's description: > Remove empty closed paths > > As discussed in the github issue, > whatwg/html#1079, it's generally agreed to > skip drawing line caps for closed paths. This is a follow up cl of: > https://chromium-review.googlesource.com/c/chromium/src/+/4864061. > > In this cl, it verifies if each closed path is empty, then it removes > the empty closed subpaths from path. As the subpaths are removed, the > corresponding line caps are skipped. > > Bug: 644067 > > Change-Id: I14c5c4819a31eb9249d01574ff1b5c60826c3b9e > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4916516 > Commit-Queue: Yi Xu <yiyix@google.com> > Reviewed-by: Jean-Philippe Gravel <jpgravel@chromium.org> > Reviewed-by: Justin Novosad <junov@chromium.org> > Cr-Commit-Position: refs/heads/main@{#1247735} Bug: 644067 Change-Id: I33ecfd76574d6f60e6f8c471a38183f87757e3ef
This reverts commit 572074cb06425797e7e110511db405134cf67e2f. Reason for revert: caused regression bug: crbug.com/1521614 Original change's description: > Remove empty closed paths > > As discussed in the github issue, > whatwg/html#1079, it's generally agreed to > skip drawing line caps for closed paths. This is a follow up cl of: > https://chromium-review.googlesource.com/c/chromium/src/+/4864061. > > In this cl, it verifies if each closed path is empty, then it removes > the empty closed subpaths from path. As the subpaths are removed, the > corresponding line caps are skipped. > > Bug: 644067 > > Change-Id: I14c5c4819a31eb9249d01574ff1b5c60826c3b9e > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4916516 > Commit-Queue: Yi Xu <yiyix@google.com> > Reviewed-by: Jean-Philippe Gravel <jpgravel@chromium.org> > Reviewed-by: Justin Novosad <junov@chromium.org> > Cr-Commit-Position: refs/heads/main@{#1247735} Bug: 644067 Change-Id: I33ecfd76574d6f60e6f8c471a38183f87757e3ef
This reverts commit 572074c. Reason for revert: caused regression bug: crbug.com/1521614 Original change's description: > Remove empty closed paths > > As discussed in the github issue, > whatwg/html#1079, it's generally agreed to > skip drawing line caps for closed paths. This is a follow up cl of: > https://chromium-review.googlesource.com/c/chromium/src/+/4864061. > > In this cl, it verifies if each closed path is empty, then it removes > the empty closed subpaths from path. As the subpaths are removed, the > corresponding line caps are skipped. > > Bug: 644067 > > Change-Id: I14c5c4819a31eb9249d01574ff1b5c60826c3b9e > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4916516 > Commit-Queue: Yi Xu <yiyix@google.com> > Reviewed-by: Jean-Philippe Gravel <jpgravel@chromium.org> > Reviewed-by: Justin Novosad <junov@chromium.org> > Cr-Commit-Position: refs/heads/main@{#1247735} Bug: 644067 Change-Id: I33ecfd76574d6f60e6f8c471a38183f87757e3ef Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5258624 Reviewed-by: Aaron Krajeski <aaronhk@chromium.org> Reviewed-by: Jean-Philippe Gravel <jpgravel@chromium.org> Commit-Queue: Yi Xu <yiyix@google.com> Cr-Commit-Position: refs/heads/main@{#1255711}
This reverts commit 572074cb06425797e7e110511db405134cf67e2f. Reason for revert: caused regression bug: crbug.com/1521614 Original change's description: > Remove empty closed paths > > As discussed in the github issue, > whatwg/html#1079, it's generally agreed to > skip drawing line caps for closed paths. This is a follow up cl of: > https://chromium-review.googlesource.com/c/chromium/src/+/4864061. > > In this cl, it verifies if each closed path is empty, then it removes > the empty closed subpaths from path. As the subpaths are removed, the > corresponding line caps are skipped. > > Bug: 644067 > > Change-Id: I14c5c4819a31eb9249d01574ff1b5c60826c3b9e > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4916516 > Commit-Queue: Yi Xu <yiyix@google.com> > Reviewed-by: Jean-Philippe Gravel <jpgravel@chromium.org> > Reviewed-by: Justin Novosad <junov@chromium.org> > Cr-Commit-Position: refs/heads/main@{#1247735} Bug: 644067 Change-Id: I33ecfd76574d6f60e6f8c471a38183f87757e3ef Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5258624 Reviewed-by: Aaron Krajeski <aaronhk@chromium.org> Reviewed-by: Jean-Philippe Gravel <jpgravel@chromium.org> Commit-Queue: Yi Xu <yiyix@google.com> Cr-Commit-Position: refs/heads/main@{#1255711}
This reverts commit 572074cb06425797e7e110511db405134cf67e2f. Reason for revert: caused regression bug: crbug.com/1521614 Original change's description: > Remove empty closed paths > > As discussed in the github issue, > whatwg/html#1079, it's generally agreed to > skip drawing line caps for closed paths. This is a follow up cl of: > https://chromium-review.googlesource.com/c/chromium/src/+/4864061. > > In this cl, it verifies if each closed path is empty, then it removes > the empty closed subpaths from path. As the subpaths are removed, the > corresponding line caps are skipped. > > Bug: 644067 > > Change-Id: I14c5c4819a31eb9249d01574ff1b5c60826c3b9e > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4916516 > Commit-Queue: Yi Xu <yiyix@google.com> > Reviewed-by: Jean-Philippe Gravel <jpgravel@chromium.org> > Reviewed-by: Justin Novosad <junov@chromium.org> > Cr-Commit-Position: refs/heads/main@{#1247735} Bug: 644067 Change-Id: I33ecfd76574d6f60e6f8c471a38183f87757e3ef Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5258624 Reviewed-by: Aaron Krajeski <aaronhk@chromium.org> Reviewed-by: Jean-Philippe Gravel <jpgravel@chromium.org> Commit-Queue: Yi Xu <yiyix@google.com> Cr-Commit-Position: refs/heads/main@{#1255711}
This reverts commit 572074c. Reason for revert: caused regression bug: b/41494582, crbug.com/1521614 Original change's description: > Remove empty closed paths > > As discussed in the github issue, > whatwg/html#1079, it's generally agreed to > skip drawing line caps for closed paths. This is a follow up cl of: > https://chromium-review.googlesource.com/c/chromium/src/+/4864061. > > In this cl, it verifies if each closed path is empty, then it removes > the empty closed subpaths from path. As the subpaths are removed, the > corresponding line caps are skipped. > > Bug: 644067 > > Change-Id: I14c5c4819a31eb9249d01574ff1b5c60826c3b9e > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4916516 > Commit-Queue: Yi Xu <yiyix@google.com> > Reviewed-by: Jean-Philippe Gravel <jpgravel@chromium.org> > Reviewed-by: Justin Novosad <junov@chromium.org> > Cr-Commit-Position: refs/heads/main@{#1247735} (cherry picked from commit b495280) Bug: 644067 Change-Id: I33ecfd76574d6f60e6f8c471a38183f87757e3ef Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5258624 Reviewed-by: Aaron Krajeski <aaronhk@chromium.org> Reviewed-by: Jean-Philippe Gravel <jpgravel@chromium.org> Commit-Queue: Yi Xu <yiyix@google.com> Cr-Original-Commit-Position: refs/heads/main@{#1255711} Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5265681 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Prudhvikumar Bommana <pbommana@google.com> Owners-Override: Prudhvikumar Bommana <pbommana@google.com> Cr-Commit-Position: refs/branch-heads/6261@{#458} Cr-Branched-From: 9755d9d-refs/heads/main@{#1250580}
As discussed in the github issue, whatwg/html#1079, it's generally agreed to skip drawing line caps for closed paths. This is a follow up cl of: https://chromium-review.googlesource.com/c/chromium/src/+/4864061. In this cl, it verifies if each closed path is empty, then it removes the empty closed subpaths from path. As the subpaths are removed, the corresponding line caps are skipped. fix Change-Id: Ic4a2f23470a7c1abcc5b9793cd100451db3a4ac1
…stonly Automatic update from web-platform-tests Revert "Remove empty closed paths" This reverts commit 572074cb06425797e7e110511db405134cf67e2f. Reason for revert: caused regression bug: crbug.com/1521614 Original change's description: > Remove empty closed paths > > As discussed in the github issue, > whatwg/html#1079, it's generally agreed to > skip drawing line caps for closed paths. This is a follow up cl of: > https://chromium-review.googlesource.com/c/chromium/src/+/4864061. > > In this cl, it verifies if each closed path is empty, then it removes > the empty closed subpaths from path. As the subpaths are removed, the > corresponding line caps are skipped. > > Bug: 644067 > > Change-Id: I14c5c4819a31eb9249d01574ff1b5c60826c3b9e > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4916516 > Commit-Queue: Yi Xu <yiyix@google.com> > Reviewed-by: Jean-Philippe Gravel <jpgravel@chromium.org> > Reviewed-by: Justin Novosad <junov@chromium.org> > Cr-Commit-Position: refs/heads/main@{#1247735} Bug: 644067 Change-Id: I33ecfd76574d6f60e6f8c471a38183f87757e3ef Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5258624 Reviewed-by: Aaron Krajeski <aaronhk@chromium.org> Reviewed-by: Jean-Philippe Gravel <jpgravel@chromium.org> Commit-Queue: Yi Xu <yiyix@google.com> Cr-Commit-Position: refs/heads/main@{#1255711} -- wpt-commits: 64b75a906f010f05c58a9941c75d3719079130a0 wpt-pr: 44373
…stonly Automatic update from web-platform-tests Revert "Remove empty closed paths" This reverts commit 572074cb06425797e7e110511db405134cf67e2f. Reason for revert: caused regression bug: crbug.com/1521614 Original change's description: > Remove empty closed paths > > As discussed in the github issue, > whatwg/html#1079, it's generally agreed to > skip drawing line caps for closed paths. This is a follow up cl of: > https://chromium-review.googlesource.com/c/chromium/src/+/4864061. > > In this cl, it verifies if each closed path is empty, then it removes > the empty closed subpaths from path. As the subpaths are removed, the > corresponding line caps are skipped. > > Bug: 644067 > > Change-Id: I14c5c4819a31eb9249d01574ff1b5c60826c3b9e > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4916516 > Commit-Queue: Yi Xu <yiyix@google.com> > Reviewed-by: Jean-Philippe Gravel <jpgravel@chromium.org> > Reviewed-by: Justin Novosad <junov@chromium.org> > Cr-Commit-Position: refs/heads/main@{#1247735} Bug: 644067 Change-Id: I33ecfd76574d6f60e6f8c471a38183f87757e3ef Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5258624 Reviewed-by: Aaron Krajeski <aaronhk@chromium.org> Reviewed-by: Jean-Philippe Gravel <jpgravel@chromium.org> Commit-Queue: Yi Xu <yiyix@google.com> Cr-Commit-Position: refs/heads/main@{#1255711} -- wpt-commits: 64b75a906f010f05c58a9941c75d3719079130a0 wpt-pr: 44373
This reverts commit 572074cb06425797e7e110511db405134cf67e2f. Reason for revert: caused regression bug: crbug.com/1521614 Original change's description: > Remove empty closed paths > > As discussed in the github issue, > whatwg/html#1079, it's generally agreed to > skip drawing line caps for closed paths. This is a follow up cl of: > https://chromium-review.googlesource.com/c/chromium/src/+/4864061. > > In this cl, it verifies if each closed path is empty, then it removes > the empty closed subpaths from path. As the subpaths are removed, the > corresponding line caps are skipped. > > Bug: 644067 > > Change-Id: I14c5c4819a31eb9249d01574ff1b5c60826c3b9e > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4916516 > Commit-Queue: Yi Xu <yiyix@google.com> > Reviewed-by: Jean-Philippe Gravel <jpgravel@chromium.org> > Reviewed-by: Justin Novosad <junov@chromium.org> > Cr-Commit-Position: refs/heads/main@{#1247735} Bug: 644067 Change-Id: I33ecfd76574d6f60e6f8c471a38183f87757e3ef Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5258624 Reviewed-by: Aaron Krajeski <aaronhk@chromium.org> Reviewed-by: Jean-Philippe Gravel <jpgravel@chromium.org> Commit-Queue: Yi Xu <yiyix@google.com> Cr-Commit-Position: refs/heads/main@{#1255711}
As discussed in the github issue, whatwg/html#1079, it's generally agreed to skip drawing line caps for closed paths. This is a follow up cl of: https://chromium-review.googlesource.com/c/chromium/src/+/4864061. In this cl, it verifies if each closed path is empty, then it removes the empty closed subpaths from path. As the subpaths are removed, the corresponding line caps are skipped. Bug: 644067 Change-Id: I14c5c4819a31eb9249d01574ff1b5c60826c3b9e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4916516 Commit-Queue: Yi Xu <yiyix@google.com> Reviewed-by: Jean-Philippe Gravel <jpgravel@chromium.org> Reviewed-by: Justin Novosad <junov@chromium.org> Cr-Commit-Position: refs/heads/main@{#1247735}
This reverts commit 572074cb06425797e7e110511db405134cf67e2f. Reason for revert: caused regression bug: crbug.com/1521614 Original change's description: > Remove empty closed paths > > As discussed in the github issue, > whatwg/html#1079, it's generally agreed to > skip drawing line caps for closed paths. This is a follow up cl of: > https://chromium-review.googlesource.com/c/chromium/src/+/4864061. > > In this cl, it verifies if each closed path is empty, then it removes > the empty closed subpaths from path. As the subpaths are removed, the > corresponding line caps are skipped. > > Bug: 644067 > > Change-Id: I14c5c4819a31eb9249d01574ff1b5c60826c3b9e > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4916516 > Commit-Queue: Yi Xu <yiyix@google.com> > Reviewed-by: Jean-Philippe Gravel <jpgravel@chromium.org> > Reviewed-by: Justin Novosad <junov@chromium.org> > Cr-Commit-Position: refs/heads/main@{#1247735} Bug: 644067 Change-Id: I33ecfd76574d6f60e6f8c471a38183f87757e3ef Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5258624 Reviewed-by: Aaron Krajeski <aaronhk@chromium.org> Reviewed-by: Jean-Philippe Gravel <jpgravel@chromium.org> Commit-Queue: Yi Xu <yiyix@google.com> Cr-Commit-Position: refs/heads/main@{#1255711}
The spec is currently inconsistent with itself.
Step 3 of the "trace a path" algorithm says: "Remove from path any subpaths containing no lines (i.e. subpaths with just one point)."
In step 9, in the part that explains line caps, it says: "Points with no lines coming out of them must have two caps placed back-to-back as if it was really two points connected to each other by an infinitesimally short straight line in the direction of the point's directionality (as defined above)."
Points with no lines coming out of them should never occur at step 9 since those subpaths are supposed to be pruned in step 3. This is confusing.
Currently, implementations are not compatible.
Gecko and Edge will draw back to back line caps for a zero-length subpath
WebKit and Blink draw nothing.
From developer feedback on the chromium issue tracker, it seems that drawing back to back line caps is desired behavior: https://bugs.chromium.org/p/chromium/issues/detail?id=577655
Blink is being changed to match the behaviours of Gecko and Edge.
Any objections to removing step 3 of the "trace a path" algorithm?
https://html.spec.whatwg.org/multipage/scripting.html#trace-a-path
The text was updated successfully, but these errors were encountered: