Skip to content

(Mostly dynamic) Viewport-related tests #2

Open

Description

@bramus

There’s a bunch of suggested tests specifically targeted towards mobile devices that came out of the Viewport Investigation from Interop 2022: web-platform-tests/interop-2022-viewport#23 (comment). It would be nice if these could be possible as the outcome of this effort (Also see: #1)

During the Viewport Investigation we also did the exercise of listing which internal APIs would be needed to allow these tests: web-platform-tests/interop-2022-viewport#23 (comment).

I hope this information is useful – or could form a starting point – for future discussions part of this Mobile Testing Investigation.

Activity

  1. changed the title [-]Viewport-related tests[/-] [+](Mostly dynamic) Viewport-related tests[/+] on Aug 26, 2025
  2. gsnedders commented on Aug 26, 2025

    @gsnedders
    Member

    One of our tasks for this year is:

    Figure out the requirements for testing dynamic viewport sizing. Suggest a viable approach if possible.

    web-platform-tests/interop-2022-viewport#23 (comment) has a list of suggested API:

    We need to distill which internal APIs we need to achieve this:

    • Retract UA UI
    • Expand UA UI
    • Show OSK
    • Hide OSK
    • Set Page Scale
    • Pinch-Zoom (already covered by touch actions most likely)
    • Overscrolling (can current scroll handle it?)
    • Ability to get properties of device, e.g. screen size, pixel density, size of UA UI, … (because maybe not directly web exposed)

    A lot of this probably just needs to be thrown over to WebDriver, but…

    For the first two, we probably want to phrase it slightly more in line with CSS Value and define it along the lines of "expand the viewport to the large viewport size".

    For Pinch Zoom, I do wonder how much the goal is Pinch Zoom specifically and how much is control over the visual viewport in general?

    For overscroll, we had tests in Interop 2022 which rely on scrolling to do that — see e.g. https://github.com/web-platform-tests/wpt/blob/6871b9f5cf0c788fb60676cf4e208d27cd572729/css/css-overscroll-behavior/overscroll-behavior.html#L77-L93. That said, one of the scenarios in Interop 2022 Viewport Investigation Test Results (though not visible to me, given it's View Only, and the grouped rows are collapsed!) is "Overscroll at Top, triggering Pull to Refresh", which is more problematic insofar as we can't really rely on pull to refresh being a feature.

    For device properties — a lot of these are already exposed either via CSSOM or via WebDriver today. Would be good to know what if anything is missing.

  3. jgraham commented on Aug 27, 2025

    @jgraham
    Contributor

    I think the device properties are either already exposed or are natural extensions of existing APIs. In practice for wpt you typically have out of band information that will tell you the pixel density, etc.

    I think we should concentrate on the first five bullet points.

    For onscreen keyboard an obvious WebDriver API would be something like:

    browser.setVirtualKeyboard({visible: bool})

    I don't know if something similar is enough for the UA UI case i.e. if we can get away with an API like

    browser.setUIState({state: "visible" / "hidden"})

    as an initial cut, or if we need more flexibility.

    I'm not sure about page scale.

  4. bramus commented on Aug 27, 2025

    @bramus
    Author

    That said, one of the scenarios in Interop 2022 Viewport Investigation Test Results (though not visible to me, given it's View Only, and the grouped rows are collapsed!)

    Oh, wasn’t aware that collapsed groups could not be expanded by anonymous viewers. Hereby corrected, with all groups expanded now.

    Note that some results in the sheet are no longer accurate, as the sheet dates back to 2022. I am aware of the following changes since making that sheet:

    1. Chrome (and Firefox too?) has aligned its default viewport resize-behavior when the on-screen keyboard gets shown with that of Safari.
    2. Dynamic viewport units are broken in all 3rd party iOS browsers with a previous major iOS version release (I don’t know which version exactly)
  5. gsnedders commented on Feb 3, 2026

    @gsnedders
    Member
    • Retract UA UI
    • Expand UA UI

    w3c/webdriver-bidi#1060

    • Show OSK
    • Hide OSK

    w3c/webdriver-bidi#1059

    • Set Page Scale

    The context of this web-platform-tests/interop-2022-viewport#23 (comment) makes me unsure what this is meant to be: is this this page zoom, or is this the visual viewport scale?

    • Pinch-Zoom (already covered by touch actions most likely)

    Need to investigate whether touch actions suffice here, which depends on what level events are being injected.

    • Overscrolling (can current scroll handle it?)

    As mentioned above, we have prior history of tests already testing this via scroll.

    • Ability to get properties of device, e.g. screen size, pixel density, size of UA UI, … (because maybe not directly web exposed)

    I think this we probably have to ask ourselves about on a per-property basis?

  6. bramus commented on Feb 3, 2026

    @bramus
    Author
    • Set Page Scale

    The context of this web-platform-tests/interop-2022-viewport#23 (comment) makes me unsure what this is meant to be: is this this page zoom, or is this the visual viewport scale?

    IIRC that would be page zoom, which would then allow you to check the effect of a changed scale on the size of ICB. Visual Viewport Scale can be altered by pinch-zoom.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions