emulation.setMediaFeaturesOverride#1076
Conversation
Co-authored-by: Henrik Skupin <mail@hskupin.info>
Co-authored-by: jgraham <james@hoppipolla.co.uk>
This reverts commit c6511ae.
| ? userContexts: [+browser.UserContext], | ||
| } | ||
|
|
||
| emulation.MediaFeatures = { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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.
Co-authored-by: Alexandra Borovova <lutien@users.noreply.github.com>
lutien
left a comment
There was a problem hiding this comment.
Thanks! I think it looks fine now
| text: media feature; url: #media-features | ||
| text: mf-name; url: #typedef-mf-name |
There was a problem hiding this comment.
The spec already exports these terms although, for <mf-name>, the correct way to reference the term is going to be with the <<mf-name>> shorthand syntax.
| text: media feature; url: #media-features | |
| text: mf-name; url: #typedef-mf-name |
(FWIW, the spec also exports "media type", but it's been introduced before this PR)
| <div algorithm="evaluate media feature"> | ||
| To get the result of evaluating a [=media feature=] |media feature| in the given [=/Document=] |document|: | ||
|
|
||
| 1. Let |media feature name| be the |media feature|'s [=mf-name=]. |
There was a problem hiding this comment.
| 1. Let |media feature name| be the |media feature|'s [=mf-name=]. | |
| 1. Let |media feature name| be the |media feature|'s <<mf-name>>. |
Note: this will render as <mf-name>, but that matches how the CSS spec defines it.
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