Per discussion on #content, this is a request to drop support for MouseEvent's layerX and layerY. It is currently supported only by Gecko and WebKit (context for WebKit -> https://bugs.webkit.org/show_bug.cgi?id=21868). WebKit is considering removing those 2 properties as our code looks extremely old and we had zero bug about that.
Also, getting coordinates relative to the top-left corner of scrollable element can be quite useful.
Simon, you suggested dropping layerX/Y. May I ask why? Just because they are rarely used, or do you see something badly wrong with them?
They are not specified anywhere, the 'layer' name seems to be a holdover from Netscape 4 "layers", and WebKit's implementation was very probably wrong.
I think we should try removing them.
I agree, we should try to remove this. We absolutely do need an API for dealing with coordinates when there are scrollable and transformed regions involved, but layerX and layerY are unlikely to cut it. I'd be much more interested to see a function which let you pass in an element and returned the event's coordinates in that element's coordinate space. Maybe a good approach here is to add warnings on trunk right now, and remove the functions completely in a couple of weeks when we've branched for FF8.
FYI, as of today, WebKit has deprecated layerX / layerY (we show a warning in the console when they are used). Due to them being exposed in one native API, they will survive until removed from there.
We should add support for offsetX/offsetY which is defined in CSSOM View before dropping layerX/layerY. http://www.w3.org/TR/cssom-view/#dom-mouseevent-offsetx
offsetX/Y is a different beast. What have they to do with layerX/Y?
layerX/Y is often used to compensate a lacking support for offsetX/offsetY.
http://msdn.microsoft.com/en-us/library/ms530302%28VS.85%29.aspx IE now uses layerX layerY for calculating offset to parent's border, not affected by transform. keep the compatibility?
There is no valid justification for removing layerX/Y. layerX/Y are supported in Firefox, Chrome & IE. They work exactly as expected and as documented. Why would you remove useful perfectly working cross-browser compatible functionality with no equivalent functionality to replace it? I use layerX/Y extensively and have done so for many years, I'm sure that I can't be the only person who will be caused massive problems by the removal of these properties.
layerX/Y work in IE? That's not what comment 0 says ...
Comment 11 suggests that IE does (recent versions only?) and so do pages like http://msdn.microsoft.com/en-us/library/gg130967%28v=vs.85%29.aspx That page explicitly indicates it is for cross-browser compatibility.
I don't know which version of IE supports the properties as layerX/Y (IE8 does not) but they are just an alias for the x/y properties which have been in IE for years and have the same functionality as layerX/Y. see http://msdn.microsoft.com/en-us/library/ff974658(v=vs.85).aspx
FWIW Firefox's layerX/Y differs in implementation from Chrome, Safari, and IE now, with regard to some transformed elements. I haven't done extensive testing but on an element that has the following example transform: -moz-transform: matrix3d(2.20842572062084, 0, 0, 0.00241685144124169, 0, 2.11751662971175, 0, 0.00372505543237251, 0, 0, 1, 0, 0, 0, 0, 1); -moz-transform-origin: 0px 0px 0px; Chrome, Safari, and IE report layerX/Y values for the element's original bounding box and FF reports layerX/Y more inline with what the offetX/Y would be (if FF implemented those) - which is to say where the location is as if it had happened on the untransformed element.