-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
2D canvas color parsing and serialization #47148
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wpt-pr-bot
requested review from
AmeliaBR,
domenic,
foolip,
fserb,
jdm,
jgraham and
kenrussell
July 16, 2024 13:49
@Loirooriol @weinig @svgeesus would very much appreciate your feedback! (And suggestions for additional tests.) |
weinig
reviewed
Jul 20, 2024
I've addressed the feedback. Any remaining comments or can this be approved? (I won't merge until we merge the corresponding HTML standard PRs.) |
svgeesus
reviewed
Aug 14, 2024
5 tasks
weinig
approved these changes
Sep 3, 2024
weinig
added a commit
to weinig/WebKit
that referenced
this pull request
Sep 3, 2024
… canvas https://bugs.webkit.org/show_bug.cgi?id=278392 Reviewed by NOBODY (OOPS!). When using HTML serialization (such as in canvas code), `rgb(none none none)` should serialize as `#000000`, not `rgb(0, 0, 0)` as it currently does. This is more consistent and matches other browsers. * LayoutTests/fast/canvas/canvas-color-serialization.html: * LayoutTests/fast/canvas/canvas-color-serialization-expected.txt: - Add serialization tests. Additional will be added in WPT via web-platform-tests/wpt#47148. * Source/WebCore/platform/graphics/ColorSerialization.cpp: (WebCore::serializationForHTML): - Make sure to call through to the HTML serializer for legacy rgb() colors that have none (which is indicated by the use of SRGBA<float> without the "useColorFunctionSerialization" bit set).
weinig
added a commit
to weinig/WebKit
that referenced
this pull request
Sep 3, 2024
… canvas https://bugs.webkit.org/show_bug.cgi?id=278392 Reviewed by NOBODY (OOPS!). When using HTML serialization (such as in canvas code), `rgb(none none none)` should serialize as `#000000`, not `rgb(0, 0, 0)` as it currently does. This is more consistent and matches other browsers. * LayoutTests/fast/canvas/canvas-color-serialization.html: * LayoutTests/fast/canvas/canvas-color-serialization-expected.txt: - Add serialization tests. Additional will be added in WPT via web-platform-tests/wpt#47148. * Source/WebCore/platform/graphics/ColorSerialization.cpp: (WebCore::serializationForHTML): - Make sure to call through to the HTML serializer for legacy rgb() colors that have none (which is indicated by the use of SRGBA<float> without the "useColorFunctionSerialization" bit set).
webkit-commit-queue
pushed a commit
to weinig/WebKit
that referenced
this pull request
Sep 3, 2024
… canvas https://bugs.webkit.org/show_bug.cgi?id=278392 Reviewed by Darin Adler. When using HTML serialization (such as in canvas code), `rgb(none none none)` should serialize as `#000000`, not `rgb(0, 0, 0)` as it currently does. This is more consistent and matches other browsers. * LayoutTests/fast/canvas/canvas-color-serialization.html: * LayoutTests/fast/canvas/canvas-color-serialization-expected.txt: - Add serialization tests. Additional will be added in WPT via web-platform-tests/wpt#47148. * Source/WebCore/platform/graphics/ColorSerialization.cpp: (WebCore::serializationForHTML): - Make sure to call through to the HTML serializer for legacy rgb() colors that have none (which is indicated by the use of SRGBA<float> without the "useColorFunctionSerialization" bit set). Canonical link: https://commits.webkit.org/283120@main
I've decided to go ahead with this as the standard is blocked on an editorial matter. Might as well have the tests reflect the latest. |
annevk
added a commit
to whatwg/html
that referenced
this pull request
Sep 19, 2024
Although fillStyle, strokeStyle, and shadowColor setters accepted all kinds of CSS color values, those could not be serialized. Update that by relying on CSS Color for serialization instead, which now has an HTML-compatible serialization method to preserve compatibility with 2D canvas and <input type=color> for certain colors. While here, also link the algorithm to be used for color space conversion and correct the reference for 'relative-colorimetric'. Tests: web-platform-tests/wpt#47148. Fixes #8917.
dizhang168
pushed a commit
to dizhang168/html
that referenced
this pull request
Oct 28, 2024
Although fillStyle, strokeStyle, and shadowColor setters accepted all kinds of CSS color values, those could not be serialized. Update that by relying on CSS Color for serialization instead, which now has an HTML-compatible serialization method to preserve compatibility with 2D canvas and <input type=color> for certain colors. While here, also link the algorithm to be used for color space conversion and correct the reference for 'relative-colorimetric'. Tests: web-platform-tests/wpt#47148. Fixes whatwg#8917.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For whatwg/html#8917, w3c/csswg-drafts#10550, and whatwg/html#10481.