Consider implementing window.screenLeft and window.screenTop

RESOLVED FIXED in Firefox 64

Status

()

enhancement
P3
normal
RESOLVED FIXED
6 months ago
5 months ago

People

(Reporter: emilio, Assigned: emilio)

Tracking

({dev-doc-complete})

unspecified
mozilla64
Points:
---
Bug Flags:
webcompat +
qe-verify -

Firefox Tracking Flags

(firefox64 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

6 months ago
Looks like other browsers support it as basically aliases of screenX / screenY, and that they're not willing to remove them, see:

  * https://github.com/w3c/csswg-drafts/issues/1091
  * https://bugs.chromium.org/p/chromium/issues/detail?id=695572
(Assignee)

Comment 1

6 months ago
Boris, would you have anything against doing this, provided relevant spec changes are made?
Flags: needinfo?(bzbarsky)
given that there are also other weird aliases for other coordinates, it is somewhat hard to argue why not do this.
(Assignee)

Comment 3

6 months ago
Alright, I can implement this once the tests and the spec are sorted out.
Assignee: nobody → emilio
Flags: needinfo?(emilio)
I'd also argue that screenLeft and screenTop are *better* names than screenX and screenY since they make the coordinate system clearer.  (For RTL use cases you might even want screenRight...)
No objections to doing this.
Flags: needinfo?(bzbarsky)
Priority: -- → P3
(Assignee)

Comment 6

6 months ago
Tests are at https://github.com/web-platform-tests/wpt/pull/13543.

Spec is waiting on those, but this matches all other browsers.
(Assignee)

Updated

6 months ago
Flags: needinfo?(emilio)

Comment 7

6 months ago
Pushed by emilio@crisal.io:
https://hg.mozilla.org/integration/autoland/rev/7b427b166742
Add window.screenLeft / window.screenTop as aliases of screenX / screenY. r=smaug

Comment 8

6 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/7b427b166742
Status: NEW → RESOLVED
Last Resolved: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
Flags: webcompat+
Flags: qe-verify-
Note to docs team:

I have added a note to the Fx 64 rel notes to cover this:
https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/64#APIs

The ref pages will both need writing, and compat data updating, when this is documented.
Documented:

I added new pages for the new properties, and also improved the pages for screenX/screenY:
https://developer.mozilla.org/en-US/docs/Web/API/Window/screenLeft
https://developer.mozilla.org/en-US/docs/Web/API/Window/screenTop
https://developer.mozilla.org/en-US/docs/Web/API/Window/screenX
https://developer.mozilla.org/en-US/docs/Web/API/Window/screenY

The pages link to a fun little demo I wrote to demonstrate how the properties work:
https://mdn.github.io/dom-examples/screenleft-screentop/

I also added the relevant compat data:
https://github.com/mdn/browser-compat-data/pull/3106

Let me know if this looks OK. Thanks!
You need to log in before you can comment on or make changes to this bug.