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

Just to elaborate on my answer yesterday, for completeness I retried with `document.documentElement.getBoundingClientRect()` and consistently got this:

```
{
    "x": 0,
    "y": 0,
    "width": 1024,
    "height": 351.8258972167969, // varied
    "top": 0,
    "right": 1024,
    "bottom": 351.8258972167969, // varied
    "left": 0
}
```

Does that still suggest the same cause to you? Given they're both doubles, I believe it's a reasonable expectation that the `width` and `right` values should match the viewport width in this scenario, wdyt?

Some alternatives to rounding the width that may be easier to implement:

- Adding a second scale value to the Visual Viewport API where 1 is the size of the layout viewport, rather than the optimal device-width/height. (Assuming it would report 1.0 when fully pinch-zoomed out rather than 0.999...)
- Adding offsetRight and offsetBottom values to the Visual Viewport API. (Assuming they would report 0 when fully pinch-zoomed out rather than 0.001...)
- Implementing https://github.com/w3c/IntersectionObserver/issues/95. (Assuming the intersection for a 100dvw x 100dvh element is measured as 1.0 when fully pinch-zoomed out.)

-- 
GitHub Notification of comment by lpd-au
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9118#issuecomment-1653343458 using your GitHub account


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

Received on Thursday, 27 July 2023 10:31:18 UTC