Bug 244254
| Summary: | ConicGradient angle should start at the x-axis, not at the top | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Fernando Serboncini <fserb> |
| Component: | Canvas | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | dino, jensimmons, karlcow, mmaxfield, sabouhallawa, simon.fraser, vitor.roriz, webkit-bug-importer |
| Priority: | P2 | Keywords: | BrowserCompat, GoodFirstBug, InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Fernando Serboncini
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.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/99041207>
Karl Dubost
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?
Karl Dubost
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
Myles C. Maxfield
Will this be a breaking change?
Vitor Roriz
Pull request: https://github.com/WebKit/WebKit/pull/3784
Vitor Roriz
> 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?
Fernando Serboncini
yes, yes, sorry for that. You are correct, pi/2.
Vitor Roriz
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.
Fernando Serboncini
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.
Vitor Roriz
That's great, I've imported them now and add to the PR. Thank you!
EWS
Committed 254038@main (cf0a117f4760): <https://commits.webkit.org/254038@main>
Reviewed commits have been landed. Closing PR #3784 and removing active labels.