Ticket #10531 (closed enhancement: fixed)
Consider removing layerX and layerY from $.event.props
| Reported by: | mathias | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | 1.7 |
| Component: | event | Version: | 1.7b2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
Every jQuery-bound event handler now logs this warning:
event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.
Screenshot: http://i.imgur.com/wyQG4.png
You may want to consider removing layerX and layerY from $.event.props. This is a backwards-incompatible change, but it must be done.
Change History
comment:1 Changed 19 months ago by timmywil
- Priority changed from undecided to low
- Status changed from new to open
- Version changed from git to 1.7b2
- Component changed from unfiled to event
- Milestone changed from None to 1.7
comment:2 Changed 19 months ago by mathias
Exactly.
Also, if people really need layerX/layerY they can always use event.originalEvent.layerX and event.originalEvent.layerY, but again — they would need to check if they are defined.
comment:4 Changed 19 months ago by mathias
Pull request: https://github.com/jquery/jquery/pull/554
No unit tests are affected by this change.
comment:5 Changed 19 months ago by anonymous
Same problem here. Please remove those warning messages.
comment:6 Changed 19 months ago by paul.irish
FWIW just some links..
https://bugs.webkit.org/show_bug.cgi?id=21868 Webkit removing them (still open) https://bugs.webkit.org/show_bug.cgi?id=69951 Webkit deprecating them (fixed)
Mozilla is planning to remove them as well: https://bugzilla.mozilla.org/show_bug.cgi?id=674292
comment:7 Changed 19 months ago by Mathias Bynens
- Status changed from open to closed
- Resolution set to fixed
comment:8 Changed 17 months ago by anonymous
This ticket is indicating that the problem still arises in Jquery 1.7: http://stackoverflow.com/questions/7825448/webkit-issues-with-event-layerx-and-event-layery
comment:10 Changed 12 months ago by anonymous
Reproduce with : Chrome 19.0.1084.52 MacOS, jQuery 1.7.2 Result: event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.
Safari on Mac is fine.
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
jQuery(document).ready(function(){
$(document).click(function(e) {
console.log("click!");
});
})
</script>
<body>
</body>
</html>
comment:11 Changed 12 months ago by AndreasLoew
Reproduce with : Chrome 19.0.1084.52 MacOS, jQuery 1.7.2 Result: event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.
Safari on Mac is fine.
comment:12 Changed 12 months ago by dmethvin
This can happen if any of your Chrome extensions use an old version of jQuery. Please don't report it here. Report it to the author of the extension, or wait for Chrome to fix this which is supposed to happen in 20.
comment:13 Changed 12 months ago by Gregoire D.
Hi,
This is still happening, with Chrome (19.0.1084.56) and jQuery (1.7.2), even with no extension. For instance :
jQuery("body").ajaxSuccess(function(e,r,o) {
console.log(o.url);
}
return "event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future."
comment:14 Changed 12 months ago by dmethvin
DO NOT POST A "ME TOO". PLEASE READ THIS MESSAGE.
This can happen if any of your Chrome extensions use an old version of jQuery. Please don't report it here. Report it to the author of the extension, or wait for Chrome to fix this which is supposed to happen in 20.
comment:15 Changed 11 months ago by Joseph.Upshaw@…
dmethvin,
Not publishing a "Me too," just ensuring that the present state of things is understood in light of your most recent response. We are getting the warning with absolutely no extensions installed with Chrome 19.0.1084.56 m.
comment:16 Changed 11 months ago by dmethvin
jQuery 1.7 fixed this problem. If this message is o҉ozing from Chrome's console it is not coming from anything the standard jQuery 1.7+ is doing. There is no test case proving otherwise. You are seeing this in some unholy MaŚs of web page populated from "10O Best jQuery Plugins of 2O09". jQuery was trying to do the world a favor. This is a Chrome bug. They bailed out and reversed their decision in Chrome 2o҉ so ín any case DO͇̹̺ͅƝ̴ȳ̳T BË͖́̉ ͠P̯͍̭O̚STƝ̴G M̲̖͊̒ͪͩͬ̚̚͜ ̶̧̨̱̹̭̯ͧ̾ͬOͮ͏̮̪̝͍RȆ̴̟̟͙̞ͩ͌͝!**
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

layerX/Y are not used internally and we do not normalize them. They are only present on the event object where supported, so anyone actually using them would have to check if they were undefined first anyway. I'm ok with removing them in 1.7.