-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Fix color valid color mix test #36668
Fix color valid color mix test #36668
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me.
I noticed in reviewing that the test assumes lab and oklab, lch and oklch have similar ranges which they don't. But that could be fixed in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a lot of changes here, but generally lgtm. Firefox seems to have a pretty good impl in this area so if you could check if Firefox passes all, or if any failures are expected, before landing, that would make me more confident about these changes.
I actually based these changes on Firefox. It still fails most of them because they do not yet handle "none" and is doing some computed-value stuff to the percentages that's not in the spec. Otherwise it matches. |
From https://csswg.sesse.net/css-color-5/#color-mix: color-mix() = color-mix( <color-interpolation-method> , [ <color> && <percentage [0,100]>? ]#{2}) && means the arguments can happen in any order. I also forgot the "in" keyword in serialization. Also need to reject percentage values greater than 100. Contains the same changes to color-valid-color-mix-function.html as #36668 Bug: 1362022 Change-Id: I9da6b32ef79f1217594f82ca684d6bc9d1d22240
From https://csswg.sesse.net/css-color-5/#color-mix: color-mix() = color-mix( <color-interpolation-method> , [ <color> && <percentage [0,100]>? ]#{2}) && means the arguments can happen in any order. I also forgot the "in" keyword in serialization. Also need to reject percentage values greater than 100. Contains the same changes to color-valid-color-mix-function.html as #36668 Bug: 1362022 Change-Id: I9da6b32ef79f1217594f82ca684d6bc9d1d22240
From https://csswg.sesse.net/css-color-5/#color-mix: color-mix() = color-mix( <color-interpolation-method> , [ <color> && <percentage [0,100]>? ]#{2}) && means the arguments can happen in any order. I also forgot the "in" keyword in serialization. Also need to reject percentage values greater than 100. Contains the same changes to color-valid-color-mix-function.html as #36668 Bug: 1362022 Change-Id: I9da6b32ef79f1217594f82ca684d6bc9d1d22240
From https://csswg.sesse.net/css-color-5/#color-mix: color-mix() = color-mix( <color-interpolation-method> , [ <color> && <percentage [0,100]>? ]#{2}) && means the arguments can happen in any order. I also forgot the "in" keyword in serialization. Also need to reject percentage values greater than 100. Contains the same changes to color-valid-color-mix-function.html as web-platform-tests/wpt#36668 Bug: 1362022 Change-Id: I9da6b32ef79f1217594f82ca684d6bc9d1d22240 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3982135 Reviewed-by: Rune Lillesveen <futhark@chromium.org> Commit-Queue: Aaron Krajeski <aaronhk@chromium.org> Cr-Commit-Position: refs/heads/main@{#1066497}
From https://csswg.sesse.net/css-color-5/#color-mix: color-mix() = color-mix( <color-interpolation-method> , [ <color> && <percentage [0,100]>? ]#{2}) && means the arguments can happen in any order. I also forgot the "in" keyword in serialization. Also need to reject percentage values greater than 100. Contains the same changes to color-valid-color-mix-function.html as #36668 Bug: 1362022 Change-Id: I9da6b32ef79f1217594f82ca684d6bc9d1d22240 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3982135 Reviewed-by: Rune Lillesveen <futhark@chromium.org> Commit-Queue: Aaron Krajeski <aaronhk@chromium.org> Cr-Commit-Position: refs/heads/main@{#1066497}
From https://csswg.sesse.net/css-color-5/#color-mix: color-mix() = color-mix( <color-interpolation-method> , [ <color> && <percentage [0,100]>? ]#{2}) && means the arguments can happen in any order. I also forgot the "in" keyword in serialization. Also need to reject percentage values greater than 100. Contains the same changes to color-valid-color-mix-function.html as #36668 Bug: 1362022 Change-Id: I9da6b32ef79f1217594f82ca684d6bc9d1d22240 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3982135 Reviewed-by: Rune Lillesveen <futhark@chromium.org> Commit-Queue: Aaron Krajeski <aaronhk@chromium.org> Cr-Commit-Position: refs/heads/main@{#1066497}
…n color mix function, a=testonly Automatic update from web-platform-tests Allow percentages to precede the color in color mix function From https://csswg.sesse.net/css-color-5/#color-mix: color-mix() = color-mix( <color-interpolation-method> , [ <color> && <percentage [0,100]>? ]#{2}) && means the arguments can happen in any order. I also forgot the "in" keyword in serialization. Also need to reject percentage values greater than 100. Contains the same changes to color-valid-color-mix-function.html as web-platform-tests/wpt#36668 Bug: 1362022 Change-Id: I9da6b32ef79f1217594f82ca684d6bc9d1d22240 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3982135 Reviewed-by: Rune Lillesveen <futhark@chromium.org> Commit-Queue: Aaron Krajeski <aaronhk@chromium.org> Cr-Commit-Position: refs/heads/main@{#1066497} -- wpt-commits: d530c994059de2aa42a6cc2c01fd0beee3ac37f8 wpt-pr: 36764
…n color mix function, a=testonly Automatic update from web-platform-tests Allow percentages to precede the color in color mix function From https://csswg.sesse.net/css-color-5/#color-mix: color-mix() = color-mix( <color-interpolation-method> , [ <color> && <percentage [0,100]>? ]#{2}) && means the arguments can happen in any order. I also forgot the "in" keyword in serialization. Also need to reject percentage values greater than 100. Contains the same changes to color-valid-color-mix-function.html as web-platform-tests/wpt#36668 Bug: 1362022 Change-Id: I9da6b32ef79f1217594f82ca684d6bc9d1d22240 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3982135 Reviewed-by: Rune Lillesveen <futhark@chromium.org> Commit-Queue: Aaron Krajeski <aaronhk@chromium.org> Cr-Commit-Position: refs/heads/main@{#1066497} -- wpt-commits: d530c994059de2aa42a6cc2c01fd0beee3ac37f8 wpt-pr: 36764
Looks like this was basically ready to merge, but it now has conflicts. Is it worth fixing and merging (and maybe addressing @svgeesus 's comment while doing so)? |
Yes, it is worth re-basing to fix the conflicts. |
@mysteryDate could you rebase this, to remove the conflicts? |
I think in the future we should try have smaller test files to avoid issues like this. There are only a couple changes on main that I'm conflicting with (mostly issues of rounding to 127 vs 128) but it's show as a massive conflict. |
They are resolved! |
We're having an issue where for a bunch of tests chrome and safari return For So the issue is that chrome and safari are evaluating |
That was how things were (small, focused tests for specific, small specification sections) until there was a massive rewrite which consolidated things into one-test-per-property style.
From CSS Color 4 5.1. The RGB functions: rgb() and rgba() which in turn references CSS Values 4 on rounding:
a = 0.5 * 255
127.5
b = Math.round(a)
128 From round to the nearest integer:
|
It should probably be tested more generally in css/css-values, but here it is testing a specific reference from CSS Color 4. |
I don't know how to get past the failing sink tasks which are blocking merging. |
Closing and reopening to re-trigger running of checks, since it looks like the underlying error was:
|
Okay, I've set this to round to 128 and not 127, I'll investigate why chrome is doing the wrong thing here. |
Isn't it just testing how "0.5 * 255" is rounded when converting |
I'm adding a simple parsing test to check this here:
It would be my instinct to call this test something like |
color-mix values should not get resolved at specified value time. See: #34158 and w3c/csswg-drafts#7302 (comment)
This PR changes keeps all the cases in the current test, but does not expect the color mix to resolve, only to resolve the input colors as they normally would at specified value time (i.e.
#ff00ff
->rgb(255, 0, 255)
).There are definitely some cases that are missing here:
calc
values, keyword colors, current color, light dark pairs and hex colors. I'll add those next.