Bug 234256 - window.screenY is always 0 on mobile devices
Summary: window.screenY is always 0 on mobile devices
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-12-13 11:15 PST by Aidin NasiriShargh
Modified: 2022-02-06 02:53 PST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aidin NasiriShargh 2021-12-13 11:15:27 PST
window.screenY (https://developer.mozilla.org/en-US/docs/Web/API/Window/screenY) is supposed to return the vertical distance, in CSS pixels, of the top border of the user's browser viewport to the top edge of the screen.

On mobile devices (Chrome 96 on Android and iOS + Safari on iOS) it always returns 0.  Firefox (Gecko) on Android, however, returns a non-zero value (53 in my case) which is properly the height of the addressbar and other things between the top of the window and top of the screen.

PS. I can get this by subtracting event.clientY and event.screenY on touch/click events.  But I want it on non-event contexts as well.
Comment 1 Aidin NasiriShargh 2021-12-13 11:28:13 PST
PS. I asked it in stackoverflow too, and shared the background of my problem: https://stackoverflow.com/q/70339906
Comment 2 Radar WebKit Bug Importer 2021-12-20 11:16:15 PST
<rdar://problem/86732718>