KEMBAR78
Forced Colors Mode WebDriver Emulation by alisonmaher · Pull Request #11823 · w3c/csswg-drafts · GitHub
Skip to content

Conversation

alisonmaher
Copy link
Collaborator

@alisonmaher alisonmaher commented Mar 4, 2025

Forced Colors Mode is difficult to test via WPT because it is dependent on OS state (Window High Contrast) to trigger the feature to light up.

This change builds on a drafted webdriver-bidi emulation command (see w3c/webdriver-bidi#905) to define a new forced colors emulation (https://alisonmaher.github.io/alisonmaher/css-color-adjust-1/Overview.html#emualte-forced-colors-mode) that keeps track of the current forced colors mode emulation state.

The change also updates the forced colors mode algorithm (https://alisonmaher.github.io/alisonmaher/css-color-adjust-1/Overview.html#forced) to inform the UA what to do when the forced colors mode emulation state is either "light" or "dark".

CSSWG resolution for this change: #11824 (comment)

This change also fixes a few unrelated tabbing issues in the CSS Color Adjust 1 spec.

@alisonmaher alisonmaher marked this pull request as ready for review April 10, 2025 17:00
@alisonmaher
Copy link
Collaborator Author

alisonmaher commented Apr 10, 2025

Opening for official review given the resolution in #11824 (comment).

Thanks @tabatkins for already taking a look. @fantasai feel free to lmk if you have any feedback. In the meantime, I'll reach out to the WebDriver folks to see if they have any thoughts on this change.

@alisonmaher
Copy link
Collaborator Author

Adding @shs96c in comment since I wasn't able to add as a direct reviewer.

He is one of the WebDriver spec editors, and said that the change looks good overall, but offered to take a closer look at the content of the change once back from vacation.

He also noted that there is a new version of the WebDriver spec:

"The only comment I would make is that the main focus on the Browser Tools and Testing WG is now WebDriver BiDi. Browser vendors are focusing on implementing that and not the “Classic” spec, so for adoption I’d suggest extending BiDi.

The main difference between the two is that while the original spec used URL templates and the verbs of HTTP, BiDi is event based, passing messages using a websocket. In terms of addding to the spec, I think either approach requires about the same amount of text."

So in the meantime, I'll look at the Bidi version of the spec and make the necessary updates to move over to that model

@alisonmaher
Copy link
Collaborator Author

An update for reviewers (@tabatkins, @fantasai, @shs96c, @svgeesus), I've updated this PR to be based on the webdriver bidi spec. All PR links in the description have been updated.

Based on existing Bidi modules, this seemed to fit nicely into the existing emulation module, which required a draft spec change in w3c/webdriver-bidi#905.

I'll inform the bidi spec owners of these PRs, as well, for review.

Copy link
Contributor

@svgeesus svgeesus left a comment

Choose a reason for hiding this comment

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

Looks good to me

@svgeesus svgeesus merged commit 9fa86d0 into w3c:main Apr 26, 2025
1 check passed
@alisonmaher alisonmaher deleted the forced-colors-mode-web-driver branch May 5, 2025 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants