emulation.setViewportMetaOverride#1073
Conversation
|
@lutien WDYT? |
| Note: no need to update the |affected navigables|, as |viewport meta override| takes affect | ||
| only after the next navigation. |
There was a problem hiding this comment.
I think it's clear that we have to trigger reflow somehow for the viewport meta tag to take effect. And I guess navigation is the only way to do it now (?). But I'm not sure if it's fine to just delay it to the next navigation. So tagging @jgraham and @juliandescottes to get their opinions.
There was a problem hiding this comment.
I'm not sure if it's only about a reflow, or if handling the viewport meta is only something that happens at navigation time. If it only requires a reflow, it sounds like we could try to apply this dynamically and maybe the spec should reflect that.
If not, if it's really something that can only be applied after navigation, it might be good to expose this to a user via an additional parameter that allows to reload impacted contexts? Otherwise if you want to set the emulation and make sure all impacted contexts are applying it you'd need to set the emulation, then get all the contexts, and then send individual reload commands.
There was a problem hiding this comment.
Agree. I updated the algorithm to trigger "evaluate media queries and report changes" which should be sufficient to re-calculate the viewport changes.
8ad902e to
e3843ca
Compare
| 1. Let |affected navigables| be the result of [=store WebDriver configuration=] | ||
| [=viewport meta override configuration=] |viewport meta override| for |command parameters|. | ||
|
|
||
| 1. For each |navigable| of |affected navigables|, run [=evaluate media queries and report changes=] |
There was a problem hiding this comment.
I believe this is sufficient to re-calculate the viewport meta, as according to the spec, the UA MUST use it after it is enabled.
juliandescottes
left a comment
There was a problem hiding this comment.
LGTM, one question + one thing to fix.
| 1. If |viewport meta override| is null, set |viewport meta override| to | ||
| [=WebDriver configuration/unset=]. | ||
|
|
||
| 1. Let |affected navigables| be the result of [=store WebDriver configuration=] |
There was a problem hiding this comment.
This should use trying to
| 1. Let |affected navigables| be the result of [=store WebDriver configuration=] | |
| 1. Let |affected navigables| be the result of [=trying=] to [=store WebDriver configuration=] |
| 1. Let |navigable| be |document|'s [=node navigable=]. | ||
|
|
There was a problem hiding this comment.
I guess we don't really care about retrieving the top level navigable here, since the viewport meta is only relevant for top level documents? We could still do it for consistency though.
Addressing #1053.
Introduce a new command
emulation.setViewportMetaOverrideallowing for force-using viewport<meta>element.Defined the logic in the "8. Patches to Other Specifications" until the related CSS PR w3c/csswg-drafts#13548 is merged.
Preview | Diff