Here's the latest discussion about it on WhatWG: https://github.com/whatwg/html/pull/8213 Here's the relevant spec: https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-createconicgradient And the broken WPT: https://wpt.fyi/results/html/canvas/element/fill-and-stroke-styles?label=master&label=experimental&aligned&view=subtest&q=canvas%20conic This means that the angle on ConicGradient needs to be +PI/4 to match the rest of the Canvas API.
<rdar://problem/99041207>
according to the PR https://github.com/whatwg/html/pull/8213 > The current implementations on Safari and Firefox align the angle with CSS. Chrome's implementation and the current spec doesn't. An example of the problem is described here with this code. So Safari and Firefox behaves correctly and Chrome is being changed. https://bugs.chromium.org/p/chromium/issues/detail?id=1355539 Is there something to fix on WebKit?
Never mind. A but has been opened on Firefox and WebKit to encourage them to change. https://github.com/whatwg/html/pull/8213#issuecomment-1223436129
Will this be a breaking change?
Pull request: https://github.com/WebKit/WebKit/pull/3784
> This means that the angle on ConicGradient needs to be +PI/4 to match the rest of the Canvas API. I believe this is a typo and it should be 90 deg (+pi/2), right?
yes, yes, sorry for that. You are correct, pi/2.
I can't yet update our expected files for the related WPT tests (https://wpt.fyi/results/html/canvas/element/fill-and-stroke-styles?label=master&label=experimental&aligned&view=subtest&q=canvas%20conic) because they are using pixel assertion without any tolerance. A tolerance of 1 would be enough, since we diverge in some assertions in +-1 for some channels. However, the divergence is not related to this bug so we need to create a new one investigate and update the tests, and/or create an issue in WPT for allowing tolerance.
Hey, I've just updated the WPT tests to include some tolerance: https://github.com/web-platform-tests/wpt/pull/35716 please let me know if this works for you.
That's great, I've imported them now and add to the PR. Thank you!
Committed 254038@main (cf0a117f4760): <https://commits.webkit.org/254038@main> Reviewed commits have been landed. Closing PR #3784 and removing active labels.