w3c / webdriver-bidi

Bidirectional WebDriver protocol for browser automation
https://w3c.github.io/webdriver-bidi/
336 stars 35 forks source link

Extend browsingContext.setViewport with devicePixelRatio #557

Closed OrKoN closed 9 months ago

OrKoN commented 9 months ago

Closes #529


Preview | Diff

whimboo commented 9 months ago

Please also see the comment from the last TPAC meeting (2 weeks ago).

OrKoN commented 9 months ago

@gsnedders I could not recall the last bits of the discussion that happened at TPAC and I wondered if you could expand on your comment about naming of the devicePixelRatio parameter?

jrandolf commented 9 months ago

In some fuzzy sense, browsingContext.setViewport is related to visualViewport, so I think it would make sense putting devicePixelRatio in a new method since it doesn't exist on visualViewport. In particular, devicePixelRatio is a property on window, so browsingContext.setDevicePixelRatio makes more sense.

OrKoN commented 9 months ago

Any thoughts on whether we want a separate method for configuring DPR? cc @whimboo @jgraham (see https://github.com/w3c/webdriver-bidi/pull/557#issuecomment-1740817555)

whimboo commented 9 months ago

Any thoughts on whether we want a separate method for configuring DPR? cc @whimboo @jgraham (see #557 (comment))

I'm fine with having it as part of the viewport emulation command as well.

whimboo commented 9 months ago

@OrKoN I assume you are going to add some wpt tests for that new feature?

OrKoN commented 9 months ago

@whimboo yep, once there are no open discussions on the API structure for devicePixelRatio. Using the setViewport method sounds good to me too, to avoid roundtrip and multiple updates to the page layout.

OrKoN commented 9 months ago

Started WPT work here https://github.com/web-platform-tests/wpt/pull/42398/files