[Fix] Webkit: event.layerX and event.layerY legacy Warning
Since Chrome Update 16 the Console is spammed with warnings while hovering over the chart container:
"event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future."
4369 console-logs in 12 seconds analyzing the data in the chart.
This is fixed in the development branch, as well as the latest Highstock versions. Also, jQuery needs to be updated for it.
Today is 1/9/2012 and I stand by Torstein that there are no mentions of layerX and layerY in the code. Further, the code will stop emitting these warnings when the browsers finally remove these properties (layerX and layerY, specifically).
The problem *IS* out of date adapters, its just in a funny round-about way:
The problem is these properties (layerX and layerY) still exist in event variables. Specifically, there is an extend in fireEvent that writes event arguments (eventArguments) over the event object. If you look into eventArguments, you will notice both layerX and layerY. The reason for the warnings is because you've just done an assignment with the deprecated attributes. And the reason no one caught it is because, like Tor said, those properties don't appear in his code. And finally, as mentioned, the warnings will go away when the properties are removed by the browsers because then they won't be on the event arguments anymore.
If you are employing an adapter, it's probably defining a fireEvent, effectively moving the problem over to your adapter (which is why I say its an adapter issue) since everyone should be using some sort of apply/extend method which wouldn't naturally care that it copied layerX or layerY. If you wish to eliminate the warnings, check the property names before you apply them in your fireEvent or in your apply/extend. Otherwise, I'd suggest just being chill and when the browsers stop supporting the properties, the warnings will go away!
Glad to help!
Captain Adorable commented
Todays date is 1/9/2012. Both the current release version of Highstock 1.1.2 and the GitHub version are both still printing out legacy warnings when "clicking" on the plot area of a chart? Do you know when this will be resolved? I'm running JQuery 1.7 with no issues.