Skip to content

emulation.setMediaFeaturesOverride#1076

Open
sadym-chromium wants to merge 47 commits intomainfrom
sadym/emulation.setMediaFeaturesOverride
Open

emulation.setMediaFeaturesOverride#1076
sadym-chromium wants to merge 47 commits intomainfrom
sadym/emulation.setMediaFeaturesOverride

Conversation

@sadym-chromium
Copy link
Copy Markdown
Contributor

@sadym-chromium sadym-chromium commented Feb 16, 2026

Addressing #750.

Allow for overriding media features.

Related specs:

I added a CSS spec patch until the CSS PR w3c/csswg-drafts#13549 is merged.


Preview | Diff

@sadym-chromium sadym-chromium marked this pull request as ready for review February 23, 2026 15:18
? userContexts: [+browser.UserContext],
}

emulation.MediaFeatures = {
Copy link
Copy Markdown
Contributor

@OrKoN OrKoN Feb 23, 2026

Choose a reason for hiding this comment

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

I am not a fan of this API as it requires changing WebDriver BiDi spec whenever there is a new media feature available in the underlying browser.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since media query features generally support unknown values, e.g., in CSS rules or in the matchMedia API, I think it might be beneficial to just pass a list of media features to the browser without re-listing all possible feature names in the WebDriver BiDi's CDDL. WDYT @jgraham ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@lutien WDYT about this proposal?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think we can ensure interoperability between the browsers if we don't specify the supported media features here, and we have to write wpt tests anyway for every feature.

sadym-chromium and others added 2 commits February 25, 2026 14:39
Co-authored-by: Alexandra Borovova <lutien@users.noreply.github.com>
Copy link
Copy Markdown
Member

@lutien lutien left a comment

Choose a reason for hiding this comment

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

Thanks! I think it looks fine now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants