[Webkit-unassigned] [Bug 245361] New: window.innerWidth and window.innerHeight change when pinch-zooming in

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Sep 19 05:58:39 PDT 2022


https://bugs.webkit.org/show_bug.cgi?id=245361

            Bug ID: 245361
           Summary: window.innerWidth and window.innerHeight change when
                    pinch-zooming in
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Layout and Rendering
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: bramus at google.com
                CC: bfulgham at webkit.org, simon.fraser at apple.com,
                    zalan at apple.com

(This issue is filed as a result of the Interop 2022 Viewport Investigation Effort. It was originally discussed at https://github.com/web-platform-tests/interop-2022-viewport/issues/9, with people from Apple/WebKit attending.)

As per spec[^2]:

> The innerWidth attribute must return the viewport width including the size of a rendered scroll bar (if any), or zero if there is no viewport.

The same principle applies to `window.innerHeight`

Through testing[^3], turns out WebKit-based browsers – both on Mobile and Desktop – adjust these values as you pinch-zoom in on the page.

This behavior is not according to spec and not interoperable as other engines do not adjust the value. Should authors want to get the actual visible area in CSS pixels, they can use the Visual Viewport for exactly that.

---

Steps to reproduce:
1. Visit https://interop-2022-viewport.netlify.app/combined/viewport-units/
2. Note the reported value for `window.innerHeight` in the top green box
3. Pinch-zoom in 
4. Check the reported value for `window.innerHeight` in the top green box again

Expected result:
The value remains the same

Actual result:
The value has changed

---

[^1]: https://github.com/web-platform-tests/interop-2022-viewport/
[^2]: https://github.com/web-platform-tests/interop-2022-viewport/blob/main/explainers/sizing.md#windowinnerwidth-and-windowinnerheight
[^3]: https://github.com/web-platform-tests/interop-2022-viewport/blob/main/explainers/sizing.md#findings

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220919/907a0d6b/attachment.htm>


More information about the webkit-unassigned mailing list