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

Let CSS Color handle CSS <color> value parsing #10175

Merged
merged 2 commits into from
Mar 5, 2024
Merged

Conversation

annevk
Copy link
Member

@annevk annevk commented Mar 4, 2024

Our definition had issues such as not resolving currentcolor correctly when used as part of CSS color functions.

Fixes #9940.

(See WHATWG Working Mode: Changes for more details.)


/canvas.html ( diff )
/infrastructure.html ( diff )
/semantics.html ( diff )

Our definition had issues such as not resolving currentcolor correctly when used as part of CSS color functions.

Fixes #9940.
@annevk
Copy link
Member Author

annevk commented Mar 4, 2024

@Loirooriol do you know if this is tested? Is any browser non-compliant?

@Loirooriol
Copy link
Contributor

Loirooriol commented Mar 4, 2024

There is web-platform-tests/wpt@cf3bea4, e.g. https://wpt.fyi/results/html/canvas/element/fill-and-stroke-styles/2d.fillStyle.colormix.currentcolor.html?label=master&label=experimental&product=chrome&product=edge&product=firefox&product=safari&product=servo

WebKit rejects color-mix(), while Gecko treats currentcolor as #000000. Blink passes the test, Servo is also right but fails due to #8917.

@annevk
Copy link
Member Author

annevk commented Mar 4, 2024

Thank you! @domenic any objection to treating this as an obvious bug fix?

@Kaiido
Copy link
Member

Kaiido commented Mar 4, 2024

I notice that shadowColor uses some old attribute syntax which makes the use of the parsing algo a bit odd (potentially setting the color to failure, before pretending nothing did happen).
Though I suppose it would be best to handle that in a separate PR that would update the 4 CanvasShadowStyles attributes to use getter & setter steps instead?

Copy link
Member

@domenic domenic left a comment

Choose a reason for hiding this comment

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

@domenic any objection to treating this as an obvious bug fix?

I guess it doesn't seem necessary. If Blink already implements this and you're happy to speak for WebKit, and we have tests... might as well just check all the boxes.

@annevk annevk merged commit de99ee1 into main Mar 5, 2024
2 checks passed
@annevk annevk deleted the annevk/CSS-color-parsing branch March 5, 2024 08:01
@annevk
Copy link
Member Author

annevk commented Mar 5, 2024

@Kaiido I meant to reply before closing this. It seems worthwhile updating those getter/setters, yes.

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.

"parse a CSS <color> value" should take into account that currentColor can be nested in color-mix()
4 participants