Open Bug 1838663 Opened 1 year ago Updated 5 months ago

[meta] Support "browsingContext.setViewport" command

Categories

(Remote Protocol :: WebDriver BiDi, enhancement)

enhancement

Tracking

(Not tracked)

People

(Reporter: whimboo, Unassigned)

References

(Depends on 3 open bugs, Blocks 1 open bug, )

Details

(Keywords: meta)

The browsingContext.setViewport command will allow clients to adjust the size of the visible viewport.

As of now it is not available in the specification but should get merged soon.

Depends on: 1838664
Depends on: 1840084
Depends on: 1840616
Depends on: 1857961
Depends on: 1865618

Emilio, over on bug 1544417 comment 17 you made a comment related to the viewport emulation in CDP which we haven't addressed yet and also won't given that WebDriver BiDi has the feature as well now. Could you maybe have a look at the BiDi code for browsingContext.setViewport and tell us if anything needs to be changed (these days)? Tests so far are all fine, but maybe the code will not work for some special scenarios? Thanks!

Flags: needinfo?(emilio)

That looks roughly correct. I'd be wary about some rounding errors around here because it could be fractional. Also there's no layout flush at all there.

Flags: needinfo?(emilio)

(which to be clear is fine but contradicts the comment)

Depends on: 1872648

(In reply to Emilio Cobos Álvarez (:emilio) from comment #2)

That looks roughly correct. I'd be wary about some rounding errors around here because it could be fractional. Also there's no layout flush at all there.

Thanks. So far we haven't seen an issue with rounding. So I'll make sure to keep a special look at this when I'm implementing the zoom feature which might indeed cause trouble here. What specifically do you mean with there's no layout flush at all here? Doesn't modifying the browser's width and height trigger a layout flush? If not, what should we actually do?

Flags: needinfo?(emilio)

Not synchronously, which is what the comment implies. I'd just remove the comment tbh, but I don't care much either way :)

Flags: needinfo?(emilio)
Depends on: 1878070
You need to log in before you can comment on or make changes to this bug.