-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Color mix tests added in https://github.com/web-platform-tests/wpt/pull/42940 may ignore alpha premultiplication #43180
Comments
https://csswg.sesse.net/css-color-4/#missing: """ For handling of missing component in color interpolation, see § 12.2 Interpolating with Missing Components. For all other purposes, a missing component behaves as a zero value, in the appropriate unit for that component: 0, 0%, or 0deg. This includes rendering the color directly, converting it to another color space, performing computations on the color component values, etc. """ Remaining color mix test failures may be invalid: #42940 #43180 Bug: 1495694, 1445171 Change-Id: I0ecd334b595c9c1ff4d3cb2f655176dd3b3eea16
https://csswg.sesse.net/css-color-4/#missing: """ For handling of missing component in color interpolation, see § 12.2 Interpolating with Missing Components. For all other purposes, a missing component behaves as a zero value, in the appropriate unit for that component: 0, 0%, or 0deg. This includes rendering the color directly, converting it to another color space, performing computations on the color component values, etc. """ Remaining color mix test failures may be invalid: #42940 #43180 Bug: 1495694, 1445171 Change-Id: I0ecd334b595c9c1ff4d3cb2f655176dd3b3eea16
https://csswg.sesse.net/css-color-4/#missing: """ For handling of missing component in color interpolation, see § 12.2 Interpolating with Missing Components. For all other purposes, a missing component behaves as a zero value, in the appropriate unit for that component: 0, 0%, or 0deg. This includes rendering the color directly, converting it to another color space, performing computations on the color component values, etc. """ Remaining color mix test failures may be invalid: #42940 #43180 Bug: 1495694, 1445171 Change-Id: I0ecd334b595c9c1ff4d3cb2f655176dd3b3eea16
https://csswg.sesse.net/css-color-4/#missing: """ For handling of missing component in color interpolation, see § 12.2 Interpolating with Missing Components. For all other purposes, a missing component behaves as a zero value, in the appropriate unit for that component: 0, 0%, or 0deg. This includes rendering the color directly, converting it to another color space, performing computations on the color component values, etc. """ Remaining color mix test failures may be invalid: #42940 #43180 Bug: 1495694, 1445171 Change-Id: I0ecd334b595c9c1ff4d3cb2f655176dd3b3eea16
https://csswg.sesse.net/css-color-4/#missing: """ For handling of missing component in color interpolation, see § 12.2 Interpolating with Missing Components. For all other purposes, a missing component behaves as a zero value, in the appropriate unit for that component: 0, 0%, or 0deg. This includes rendering the color directly, converting it to another color space, performing computations on the color component values, etc. """ Remaining color mix test failures may be invalid: #42940 #43180 Bug: 1495694, 1445171 Change-Id: I0ecd334b595c9c1ff4d3cb2f655176dd3b3eea16
https://csswg.sesse.net/css-color-4/#missing: """ For handling of missing component in color interpolation, see § 12.2 Interpolating with Missing Components. For all other purposes, a missing component behaves as a zero value, in the appropriate unit for that component: 0, 0%, or 0deg. This includes rendering the color directly, converting it to another color space, performing computations on the color component values, etc. """ Remaining color mix test failures may be invalid: #42940 #43180 Bug: 1495694, 1445171 Change-Id: I0ecd334b595c9c1ff4d3cb2f655176dd3b3eea16 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5017402 Reviewed-by: Yi Xu <[email protected]> Commit-Queue: Aaron Krajeski <[email protected]> Cr-Commit-Position: refs/heads/main@{#1225694}
https://csswg.sesse.net/css-color-4/#missing: """ For handling of missing component in color interpolation, see § 12.2 Interpolating with Missing Components. For all other purposes, a missing component behaves as a zero value, in the appropriate unit for that component: 0, 0%, or 0deg. This includes rendering the color directly, converting it to another color space, performing computations on the color component values, etc. """ Remaining color mix test failures may be invalid: web-platform-tests/wpt#42940 web-platform-tests/wpt#43180 Bug: 1495694, 1445171 Change-Id: I0ecd334b595c9c1ff4d3cb2f655176dd3b3eea16 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5017402 Reviewed-by: Yi Xu <[email protected]> Commit-Queue: Aaron Krajeski <[email protected]> Cr-Commit-Position: refs/heads/main@{#1225694}
https://csswg.sesse.net/css-color-4/#missing: """ For handling of missing component in color interpolation, see § 12.2 Interpolating with Missing Components. For all other purposes, a missing component behaves as a zero value, in the appropriate unit for that component: 0, 0%, or 0deg. This includes rendering the color directly, converting it to another color space, performing computations on the color component values, etc. """ Remaining color mix test failures may be invalid: #42940 #43180 Bug: 1495694, 1445171 Change-Id: I0ecd334b595c9c1ff4d3cb2f655176dd3b3eea16 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5017402 Reviewed-by: Yi Xu <[email protected]> Commit-Queue: Aaron Krajeski <[email protected]> Cr-Commit-Position: refs/heads/main@{#1225694}
…pace conversion, a=testonly Automatic update from web-platform-tests Resolve missing components during colorspace conversion https://csswg.sesse.net/css-color-4/#missing: """ For handling of missing component in color interpolation, see § 12.2 Interpolating with Missing Components. For all other purposes, a missing component behaves as a zero value, in the appropriate unit for that component: 0, 0%, or 0deg. This includes rendering the color directly, converting it to another color space, performing computations on the color component values, etc. """ Remaining color mix test failures may be invalid: web-platform-tests/wpt#42940 web-platform-tests/wpt#43180 Bug: 1495694, 1445171 Change-Id: I0ecd334b595c9c1ff4d3cb2f655176dd3b3eea16 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5017402 Reviewed-by: Yi Xu <[email protected]> Commit-Queue: Aaron Krajeski <[email protected]> Cr-Commit-Position: refs/heads/main@{#1225694} -- wpt-commits: 6e624cc9cb5dcba7a7e940aa51ea025ebe24a7e7 wpt-pr: 43065
…pace conversion, a=testonly Automatic update from web-platform-tests Resolve missing components during colorspace conversion https://csswg.sesse.net/css-color-4/#missing: """ For handling of missing component in color interpolation, see § 12.2 Interpolating with Missing Components. For all other purposes, a missing component behaves as a zero value, in the appropriate unit for that component: 0, 0%, or 0deg. This includes rendering the color directly, converting it to another color space, performing computations on the color component values, etc. """ Remaining color mix test failures may be invalid: web-platform-tests/wpt#42940 web-platform-tests/wpt#43180 Bug: 1495694, 1445171 Change-Id: I0ecd334b595c9c1ff4d3cb2f655176dd3b3eea16 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5017402 Reviewed-by: Yi Xu <[email protected]> Commit-Queue: Aaron Krajeski <[email protected]> Cr-Commit-Position: refs/heads/main@{#1225694} -- wpt-commits: 6e624cc9cb5dcba7a7e940aa51ea025ebe24a7e7 wpt-pr: 43065
…pace conversion, a=testonly Automatic update from web-platform-tests Resolve missing components during colorspace conversion https://csswg.sesse.net/css-color-4/#missing: """ For handling of missing component in color interpolation, see § 12.2 Interpolating with Missing Components. For all other purposes, a missing component behaves as a zero value, in the appropriate unit for that component: 0, 0%, or 0deg. This includes rendering the color directly, converting it to another color space, performing computations on the color component values, etc. """ Remaining color mix test failures may be invalid: web-platform-tests/wpt#42940 web-platform-tests/wpt#43180 Bug: 1495694, 1445171 Change-Id: I0ecd334b595c9c1ff4d3cb2f655176dd3b3eea16 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5017402 Reviewed-by: Yi Xu <[email protected]> Commit-Queue: Aaron Krajeski <[email protected]> Cr-Commit-Position: refs/heads/main@{#1225694} -- wpt-commits: 6e624cc9cb5dcba7a7e940aa51ea025ebe24a7e7 wpt-pr: 43065
…pace conversion, a=testonly Automatic update from web-platform-tests Resolve missing components during colorspace conversion https://csswg.sesse.net/css-color-4/#missing: """ For handling of missing component in color interpolation, see § 12.2 Interpolating with Missing Components. For all other purposes, a missing component behaves as a zero value, in the appropriate unit for that component: 0, 0%, or 0deg. This includes rendering the color directly, converting it to another color space, performing computations on the color component values, etc. """ Remaining color mix test failures may be invalid: web-platform-tests/wpt#42940 web-platform-tests/wpt#43180 Bug: 1495694, 1445171 Change-Id: I0ecd334b595c9c1ff4d3cb2f655176dd3b3eea16 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5017402 Reviewed-by: Yi Xu <[email protected]> Commit-Queue: Aaron Krajeski <[email protected]> Cr-Commit-Position: refs/heads/main@{#1225694} -- wpt-commits: 6e624cc9cb5dcba7a7e940aa51ea025ebe24a7e7 wpt-pr: 43065
@mysteryDate would it be straightforward to update the test expectations here? |
Yeah, it would be. Looking into the original change here, I see the logic. Any number interpolated with "none" should result in no change, regardless of the alphas involved. I really don't see anywhere in the spec where this is mentioned though. I would not be surprised at all if the spec does change. So, should I change the test expectations to match what the spec says, or should I change chromium's behavior to match what the other UAs are doing and what I suspect the spec will eventually say explicitly? |
If you think the behavior makes sense, I'd suggest filing a spec issue requesting that the spec is updated to match, noting which browsers already have this behavior. Where Firefox and Safari already have the same behavior and pass the test, I wouldn't wait until the spec is changed to align Chromium. That's just creating a risk that the interop issue will turn into a real site compat issue while we wait. |
From 12.2. Interpolating with Missing Components:
and
@mysteryDate You are suggesting that carried forward values should not get un-premultiplied? But did, earlier, get premultiplied? |
…pace conversion, a=testonly Automatic update from web-platform-tests Resolve missing components during colorspace conversion https://csswg.sesse.net/css-color-4/#missing: """ For handling of missing component in color interpolation, see § 12.2 Interpolating with Missing Components. For all other purposes, a missing component behaves as a zero value, in the appropriate unit for that component: 0, 0%, or 0deg. This includes rendering the color directly, converting it to another color space, performing computations on the color component values, etc. """ Remaining color mix test failures may be invalid: web-platform-tests/wpt#42940 web-platform-tests/wpt#43180 Bug: 1495694, 1445171 Change-Id: I0ecd334b595c9c1ff4d3cb2f655176dd3b3eea16 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5017402 Reviewed-by: Yi Xu <yiyixchromium.org> Commit-Queue: Aaron Krajeski <aaronhkchromium.org> Cr-Commit-Position: refs/heads/main{#1225694} -- wpt-commits: 6e624cc9cb5dcba7a7e940aa51ea025ebe24a7e7 wpt-pr: 43065 UltraBlame original commit: 2b12ef1a74b23ed23a261ad7102f8fa5e96afa62
…pace conversion, a=testonly Automatic update from web-platform-tests Resolve missing components during colorspace conversion https://csswg.sesse.net/css-color-4/#missing: """ For handling of missing component in color interpolation, see § 12.2 Interpolating with Missing Components. For all other purposes, a missing component behaves as a zero value, in the appropriate unit for that component: 0, 0%, or 0deg. This includes rendering the color directly, converting it to another color space, performing computations on the color component values, etc. """ Remaining color mix test failures may be invalid: web-platform-tests/wpt#42940 web-platform-tests/wpt#43180 Bug: 1495694, 1445171 Change-Id: I0ecd334b595c9c1ff4d3cb2f655176dd3b3eea16 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5017402 Reviewed-by: Yi Xu <yiyixchromium.org> Commit-Queue: Aaron Krajeski <aaronhkchromium.org> Cr-Commit-Position: refs/heads/main{#1225694} -- wpt-commits: 6e624cc9cb5dcba7a7e940aa51ea025ebe24a7e7 wpt-pr: 43065 UltraBlame original commit: 2b12ef1a74b23ed23a261ad7102f8fa5e96afa62
…pace conversion, a=testonly Automatic update from web-platform-tests Resolve missing components during colorspace conversion https://csswg.sesse.net/css-color-4/#missing: """ For handling of missing component in color interpolation, see § 12.2 Interpolating with Missing Components. For all other purposes, a missing component behaves as a zero value, in the appropriate unit for that component: 0, 0%, or 0deg. This includes rendering the color directly, converting it to another color space, performing computations on the color component values, etc. """ Remaining color mix test failures may be invalid: web-platform-tests/wpt#42940 web-platform-tests/wpt#43180 Bug: 1495694, 1445171 Change-Id: I0ecd334b595c9c1ff4d3cb2f655176dd3b3eea16 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5017402 Reviewed-by: Yi Xu <yiyixchromium.org> Commit-Queue: Aaron Krajeski <aaronhkchromium.org> Cr-Commit-Position: refs/heads/main{#1225694} -- wpt-commits: 6e624cc9cb5dcba7a7e940aa51ea025ebe24a7e7 wpt-pr: 43065 UltraBlame original commit: 2b12ef1a74b23ed23a261ad7102f8fa5e96afa62
Ah, I misundersood
If you follow through my logic in #43180 (comment), I was making this subsitution after pre-multiplying (assuming My misunderstanding: Subsituting before premultiplying: Perhaps it's worth noting in 12.2. Interpolating with Missing Components that pre-multiplication does not affect the result? i.e. if a component is missing in one color, but not missing in the other, the resulting value is equal to the non-missing value, regardless of alpha premultiplication. Or maybe give an example? After a little bit of algebra it's now clear to me that
No, I just mis-understood the order. Apologies for my mistake. I'll fix Chromium. |
There is an explicit order of operations, in 12. Color Interpolation. Was it ambiguous or maybe you just missed it?
Always happy to point out consequences and add examples! |
Clarified in w3c/csswg-drafts@f4e79df |
Great! Thank you, that clears up any nits I have. |
Looking at the tests added here: https://github.com/web-platform-tests/wpt/pull/42940/files#diff-17d0bf90434793454df8bbbd34e081eef94d3697534f8ec2c433359700a6b985R368
Using this line as an example:
color-mix(in lab, lab(10 20 30 / 25%) 0%, lab(none none none / 0.5))
with the expected value:
lab(10 20 30 / 0.5)
And following https://csswg.sesse.net/css-color-4/#interpolation-alpha and https://csswg.sesse.net/css-color-5/#color-mix-with-alpha:
First we must premultiply the values of both colors, so the premultiplied colors are:
lab(2.5 5 7.5 / 0.25)
andlab(none none none / 0.5)
The resulting, interpolated value, taking 0% of the left and 100% of the right, and respecting missing components:
lab(2.5 5 7.5 / 0.5)
Which, un-premultiplied with the interpolated alpha value is, dividing all components by
0.5
:lab(5 10 15 / 0.5)
Which is the current result value in chromium. I believe these tests here omit the fact that the alpha used for premultiplication and un-premultiplication are different.
The text was updated successfully, but these errors were encountered: