Bug 236232 - devicePixelRatio and screen coordinates behave oddly with zoom.
Summary: devicePixelRatio and screen coordinates behave oddly with zoom.
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-02-07 06:29 PST by Emilio Cobos Álvarez (:emilio)
Modified: 2022-02-14 06:30 PST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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>