Skip to content

[testdriver] Expose BiDi browsingContext.setViewport to regular WPT tests#59265

Open
Minju-kim-igalia wants to merge 6 commits intoweb-platform-tests:masterfrom
Minju-kim-igalia:bidi-set-viewport-dpr-tests
Open

[testdriver] Expose BiDi browsingContext.setViewport to regular WPT tests#59265
Minju-kim-igalia wants to merge 6 commits intoweb-platform-tests:masterfrom
Minju-kim-igalia:bidi-set-viewport-dpr-tests

Conversation

@Minju-kim-igalia
Copy link
Copy Markdown
Contributor

@Minju-kim-igalia Minju-kim-igalia commented Apr 16, 2026

This change exposes the existing BiDi browsingContext.setViewport command to regular WPT tests through testdriver.js?feature=bidi. It adds a thin test_driver.bidi.browsing_context.set_viewport(...) wrapper and the corresponding wptrunner plumbing so testharness-based tests can set a viewport and/or devicePixelRatio override from the page.

This patch also adds a small DPR-focused WPT under css/cssom-view/ that verifies:

  • window.devicePixelRatio reflects the override
  • resolution media queries reflect the override

Testing: ./wpt run chrome css/cssom-view/devicepixelratio-override-bidi.https.html

…ests

This change exposes the existing BiDi `browsingContext.setViewport` command
to regular WPT tests through `testdriver.js?feature=bidi`.
It adds a thin `test_driver.bidi.browsing_context.set_viewport(...)` wrapper
and the corresponding wptrunner plumbing so testharness-based tests can
set a viewport and/or `devicePixelRatio` override from the page.

This patch also adds a small DPR-focused WPT under `css/cssom-view/` that verifies:
- `window.devicePixelRatio` reflects the override
- `resolution` media queries reflect the override

Testing:`./wpt run chrome css/cssom-view/devicepixelratio-override-bidi.https.html

- Ref web-platform-tests#12725
- Chromium: https://issues.chromium.org/issues/489737943
@Minju-kim-igalia Minju-kim-igalia marked this pull request as draft April 16, 2026 14:47
Copy link
Copy Markdown
Contributor Author

@Minju-kim-igalia Minju-kim-igalia Apr 23, 2026

Choose a reason for hiding this comment

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

Added Firefox metadata for the new test.

Firefox currently reports Unknown action bidi.browsing_context.set_viewport from the Marionette executor, so I marked this as expected ERROR for now.

Would it be OK to keep this expectation for now and handle Marionette executor support as follow-up work?

@Minju-kim-igalia Minju-kim-igalia marked this pull request as ready for review April 24, 2026 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cssom-view infra testdriver.js wg-s_css wptrunner The automated test runner, commonly called through ./wpt run

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants