Bug 236232

Summary: devicePixelRatio and screen coordinates behave oddly with zoom.
Product: WebKit Reporter: Emilio Cobos Álvarez (:emilio) <emilio>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=124862

Description Emilio Cobos Álvarez (:emilio) 2022-02-07 06:29:39 PST
See also https://bugs.chromium.org/p/chromium/issues/detail?id=1294796 and https://bugzilla.mozilla.org/show_bug.cgi?id=1753836 which is why I'm looking into this.

Test-case is https://bug1753836.bmoattachments.org/attachment.cgi?id=9262644.

WebKit behaves oddly in different ways. devicePixelRatio doesn't change when zoomed, but window dimensions and so on do, but Screen coordinates don't.

Given all browsers agree on Window dimensions and the meaning of a CSS pixel changing on full-page zoom, it seems to me the most logical behavior would be that everything reacts to zoom, including Screen coordinates and devicePixelRatio. Otherwise you get into rather odd situations like innerWidth being greater than screen.width.

Firefox is the closest to this behavior (though we remove the zoom factor on event coordinates, which is what I'm going to fix next).
Comment 1 Radar WebKit Bug Importer 2022-02-14 06:30:16 PST
<rdar://problem/88901282>