Skip to content
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

CSS Color 4 color spaces for canvasGradient #10986

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

mysteryDate
Copy link
Contributor

@mysteryDate mysteryDate commented Feb 3, 2025

Add ColorInterpolationMethod, HueInterpolationMethod and premultiplyAlpha attributes to CanvasGradient.

Open questions:

TODO:

  • Lint
  • Mozilla/Apple stances, bugs
  • Experimental implementation in Chromium
  • WPT tests

/canvas.html ( diff )

@annevk
Copy link
Member

annevk commented Feb 14, 2025

Can you please restore the PR template?

cc @whatwg/canvas

Copy link
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This lacks normative definitions for the new attributes.

@yisibl
Copy link

yisibl commented Feb 18, 2025

https://crbug.com/394052224 This cannot be opened by non-Google internal users.

@mysteryDate
Copy link
Contributor Author

https://crbug.com/394052224 This cannot be opened by non-Google internal users.

Sorry! I believe I have fixed this.

@mysteryDate
Copy link
Contributor Author

Can you please restore the PR template?

cc @whatwg/canvas

Done!

aarongable pushed a commit to chromium/chromium that referenced this pull request Feb 21, 2025
Add ColorInterpolationMethod, HueInterpolationMethod and
premultipliedAlpha attributes to CanvasGradient as described here:

whatwg/html#7947

This is done behind the flag CanvasGradientCSSColor4, as spec is not yet
settled:

whatwg/html#10986

Chromestatus: https://chromestatus.com/feature/5168382242193408

I2P thread:
https://groups.google.com/a/chromium.org/g/blink-dev/c/6PhsIK2kxeM

Gradient::ColorInterpolation is also renamed to
Gradient::PremultipliedAlpha, because that's what it is.

Subpixel antialiasing for test labels is being inconsistently applied on
windows, so the tests are marked as failing with a bug.
crbug.com/396344375

Bug: 394052224
Change-Id: I6b1092376d08c051b161f83c82d585bd03cd4131
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6226021
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Commit-Queue: Aaron Krajeski <aaronhk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1423255}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Feb 21, 2025
Add ColorInterpolationMethod, HueInterpolationMethod and
premultipliedAlpha attributes to CanvasGradient as described here:

whatwg/html#7947

This is done behind the flag CanvasGradientCSSColor4, as spec is not yet
settled:

whatwg/html#10986

Chromestatus: https://chromestatus.com/feature/5168382242193408

I2P thread:
https://groups.google.com/a/chromium.org/g/blink-dev/c/6PhsIK2kxeM

Gradient::ColorInterpolation is also renamed to
Gradient::PremultipliedAlpha, because that's what it is.

Subpixel antialiasing for test labels is being inconsistently applied on
windows, so the tests are marked as failing with a bug.
crbug.com/396344375

Bug: 394052224
Change-Id: I6b1092376d08c051b161f83c82d585bd03cd4131
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6226021
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Commit-Queue: Aaron Krajeski <aaronhk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1423255}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Feb 21, 2025
Add ColorInterpolationMethod, HueInterpolationMethod and
premultipliedAlpha attributes to CanvasGradient as described here:

whatwg/html#7947

This is done behind the flag CanvasGradientCSSColor4, as spec is not yet
settled:

whatwg/html#10986

Chromestatus: https://chromestatus.com/feature/5168382242193408

I2P thread:
https://groups.google.com/a/chromium.org/g/blink-dev/c/6PhsIK2kxeM

Gradient::ColorInterpolation is also renamed to
Gradient::PremultipliedAlpha, because that's what it is.

Subpixel antialiasing for test labels is being inconsistently applied on
windows, so the tests are marked as failing with a bug.
crbug.com/396344375

Bug: 394052224
Change-Id: I6b1092376d08c051b161f83c82d585bd03cd4131
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6226021
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Commit-Queue: Aaron Krajeski <aaronhk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1423255}
@mysteryDate
Copy link
Contributor Author

This lacks normative definitions for the new attributes.

Just added some basic ones. Do we need to define the color spaces themselves? premultipliedAlpha is defined elsewhere in this document, but color interpolation spaces are only defined pretty tersely:

https://html.spec.whatwg.org/#colour-spaces-and-colour-correction

And hue interpolation does appear to be defined at all.

Should my normative definitions cite CSS? Or do we need separate definitions here.

@annevk
Copy link
Member

annevk commented Feb 25, 2025

  1. These attributes need to be defined in a way that is similar to how fillStyle is defined. I.e., some internal concept to hold the data, getter steps, and setter steps.
  2. The internal concept needs to be referenced from where we need to use it for some calculation (i.e., from the processing model, to the extent one is defined).

I think it's okay if some aspects are a bit hand-wavy, but ideally they are not or at least done in such a way that we can gradually fill out the details over time.

If concepts are shared with CSS it would be good to reference CSS. Perhaps some kind of shared abstraction is in order. We have done this for other features that are shared with CSS as well.

moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Feb 28, 2025
…asGradient, a=testonly

Automatic update from web-platform-tests
Add CSS Color 4 gradient options to CanvasGradient

Add ColorInterpolationMethod, HueInterpolationMethod and
premultipliedAlpha attributes to CanvasGradient as described here:

whatwg/html#7947

This is done behind the flag CanvasGradientCSSColor4, as spec is not yet
settled:

whatwg/html#10986

Chromestatus: https://chromestatus.com/feature/5168382242193408

I2P thread:
https://groups.google.com/a/chromium.org/g/blink-dev/c/6PhsIK2kxeM

Gradient::ColorInterpolation is also renamed to
Gradient::PremultipliedAlpha, because that's what it is.

Subpixel antialiasing for test labels is being inconsistently applied on
windows, so the tests are marked as failing with a bug.
crbug.com/396344375

Bug: 394052224
Change-Id: I6b1092376d08c051b161f83c82d585bd03cd4131
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6226021
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Commit-Queue: Aaron Krajeski <aaronhk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1423255}

--

wpt-commits: fa9792e79e03bcdb6ce8a913c74981cbebe77756
wpt-pr: 50878
i3roly pushed a commit to i3roly/firefox-dynasty that referenced this pull request Feb 28, 2025
…asGradient, a=testonly

Automatic update from web-platform-tests
Add CSS Color 4 gradient options to CanvasGradient

Add ColorInterpolationMethod, HueInterpolationMethod and
premultipliedAlpha attributes to CanvasGradient as described here:

whatwg/html#7947

This is done behind the flag CanvasGradientCSSColor4, as spec is not yet
settled:

whatwg/html#10986

Chromestatus: https://chromestatus.com/feature/5168382242193408

I2P thread:
https://groups.google.com/a/chromium.org/g/blink-dev/c/6PhsIK2kxeM

Gradient::ColorInterpolation is also renamed to
Gradient::PremultipliedAlpha, because that's what it is.

Subpixel antialiasing for test labels is being inconsistently applied on
windows, so the tests are marked as failing with a bug.
crbug.com/396344375

Bug: 394052224
Change-Id: I6b1092376d08c051b161f83c82d585bd03cd4131
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6226021
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Commit-Queue: Aaron Krajeski <aaronhk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1423255}

--

wpt-commits: fa9792e79e03bcdb6ce8a913c74981cbebe77756
wpt-pr: 50878
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Mar 1, 2025
…asGradient, a=testonly

Automatic update from web-platform-tests
Add CSS Color 4 gradient options to CanvasGradient

Add ColorInterpolationMethod, HueInterpolationMethod and
premultipliedAlpha attributes to CanvasGradient as described here:

whatwg/html#7947

This is done behind the flag CanvasGradientCSSColor4, as spec is not yet
settled:

whatwg/html#10986

Chromestatus: https://chromestatus.com/feature/5168382242193408

I2P thread:
https://groups.google.com/a/chromium.org/g/blink-dev/c/6PhsIK2kxeM

Gradient::ColorInterpolation is also renamed to
Gradient::PremultipliedAlpha, because that's what it is.

Subpixel antialiasing for test labels is being inconsistently applied on
windows, so the tests are marked as failing with a bug.
crbug.com/396344375

Bug: 394052224
Change-Id: I6b1092376d08c051b161f83c82d585bd03cd4131
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6226021
Reviewed-by: Chris Harrelson <chrishtrchromium.org>
Commit-Queue: Aaron Krajeski <aaronhkchromium.org>
Cr-Commit-Position: refs/heads/main{#1423255}

--

wpt-commits: fa9792e79e03bcdb6ce8a913c74981cbebe77756
wpt-pr: 50878

UltraBlame original commit: f95ce76846e9f8b4d9cce5a7926d6b2778608be2
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Mar 1, 2025
…asGradient, a=testonly

Automatic update from web-platform-tests
Add CSS Color 4 gradient options to CanvasGradient

Add ColorInterpolationMethod, HueInterpolationMethod and
premultipliedAlpha attributes to CanvasGradient as described here:

whatwg/html#7947

This is done behind the flag CanvasGradientCSSColor4, as spec is not yet
settled:

whatwg/html#10986

Chromestatus: https://chromestatus.com/feature/5168382242193408

I2P thread:
https://groups.google.com/a/chromium.org/g/blink-dev/c/6PhsIK2kxeM

Gradient::ColorInterpolation is also renamed to
Gradient::PremultipliedAlpha, because that's what it is.

Subpixel antialiasing for test labels is being inconsistently applied on
windows, so the tests are marked as failing with a bug.
crbug.com/396344375

Bug: 394052224
Change-Id: I6b1092376d08c051b161f83c82d585bd03cd4131
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6226021
Reviewed-by: Chris Harrelson <chrishtrchromium.org>
Commit-Queue: Aaron Krajeski <aaronhkchromium.org>
Cr-Commit-Position: refs/heads/main{#1423255}

--

wpt-commits: fa9792e79e03bcdb6ce8a913c74981cbebe77756
wpt-pr: 50878

UltraBlame original commit: f95ce76846e9f8b4d9cce5a7926d6b2778608be2
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Mar 1, 2025
…asGradient, a=testonly

Automatic update from web-platform-tests
Add CSS Color 4 gradient options to CanvasGradient

Add ColorInterpolationMethod, HueInterpolationMethod and
premultipliedAlpha attributes to CanvasGradient as described here:

whatwg/html#7947

This is done behind the flag CanvasGradientCSSColor4, as spec is not yet
settled:

whatwg/html#10986

Chromestatus: https://chromestatus.com/feature/5168382242193408

I2P thread:
https://groups.google.com/a/chromium.org/g/blink-dev/c/6PhsIK2kxeM

Gradient::ColorInterpolation is also renamed to
Gradient::PremultipliedAlpha, because that's what it is.

Subpixel antialiasing for test labels is being inconsistently applied on
windows, so the tests are marked as failing with a bug.
crbug.com/396344375

Bug: 394052224
Change-Id: I6b1092376d08c051b161f83c82d585bd03cd4131
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6226021
Reviewed-by: Chris Harrelson <chrishtrchromium.org>
Commit-Queue: Aaron Krajeski <aaronhkchromium.org>
Cr-Commit-Position: refs/heads/main{#1423255}

--

wpt-commits: fa9792e79e03bcdb6ce8a913c74981cbebe77756
wpt-pr: 50878

UltraBlame original commit: f95ce76846e9f8b4d9cce5a7926d6b2778608be2
jamienicol pushed a commit to jamienicol/gecko that referenced this pull request Mar 5, 2025
…asGradient, a=testonly

Automatic update from web-platform-tests
Add CSS Color 4 gradient options to CanvasGradient

Add ColorInterpolationMethod, HueInterpolationMethod and
premultipliedAlpha attributes to CanvasGradient as described here:

whatwg/html#7947

This is done behind the flag CanvasGradientCSSColor4, as spec is not yet
settled:

whatwg/html#10986

Chromestatus: https://chromestatus.com/feature/5168382242193408

I2P thread:
https://groups.google.com/a/chromium.org/g/blink-dev/c/6PhsIK2kxeM

Gradient::ColorInterpolation is also renamed to
Gradient::PremultipliedAlpha, because that's what it is.

Subpixel antialiasing for test labels is being inconsistently applied on
windows, so the tests are marked as failing with a bug.
crbug.com/396344375

Bug: 394052224
Change-Id: I6b1092376d08c051b161f83c82d585bd03cd4131
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6226021
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Commit-Queue: Aaron Krajeski <aaronhk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1423255}

--

wpt-commits: fa9792e79e03bcdb6ce8a913c74981cbebe77756
wpt-pr: 50878
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants