[csswg-drafts] [cssom-view] visual viewport sometimes reportedly cannot fully scale out to layout viewport (#9118)

lpd-au has just created a new issue for https://github.com/w3c/csswg-drafts:

== [cssom-view] visual viewport sometimes reportedly cannot fully scale out to layout viewport ==
I have an older site with a viewport meta tag like this: `<meta name="viewport" content="width=1024">`.

When fully pinch-zoomed out on a mobile device (and upon first loading), I would expect the visual viewport to be at minimum 1024 CSS pixels wide, matching the layout viewport. However, depending on the mobile device, that isn't always the case.

Here's my simplified test case: https://output.jsbin.com/xesolop
And here's the widths reported by the Visual Viewport API:

```
PIXEL 6 PRO

Firefox:
- Portrait:  1024
- Landscape: 1024

Chrome
- Portrait:  1024
- Landscape: 1023.9999389648438

PIXEL 7

Firefox
- Portrait:  1024
- Landscape: 1023.9833374023438

Chrome
- Portrait:  1023.9998779296875
- Landscape: 1024

GALAXY S23

Firefox:
- Portrait:  1024
- Landscape: 1024

Chrome
- Portrait:  1024
- Landscape: 1024
```

Is reporting 1023.9 (when fully pinch-zoomed out) expected/allowed behaviour? From my point of view, it's undesirable behaviour since it complicates detecting when the user has either pinch-zoomed in or refreshed the page whilst zoomed (`visualViewport.width < 1024`).

Thanks!

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9118 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 26 July 2023 14:17:25 UTC