Closed Bug 1498860 Opened 6 years ago Closed 6 years ago

Consider implementing window.screenLeft and window.screenTop

Categories

(Core :: DOM: CSS Object Model, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla64
Tracking Status
firefox64 --- fixed

People

(Reporter: emilio, Assigned: emilio)

Details

(Keywords: dev-doc-complete)

Attachments

(1 file)

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
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.
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
Tests are at https://github.com/web-platform-tests/wpt/pull/13543.

Spec is waiting on those, but this matches all other browsers.
Flags: needinfo?(emilio)
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
https://hg.mozilla.org/mozilla-central/rev/7b427b166742
Status: NEW → RESOLVED
Closed: 6 years 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.

Attachment

General

Created:
Updated:
Size: