jooking / closure-library

Automatically exported from code.google.com/p/closure-library
Apache License 2.0
0 stars 1 forks source link

goog.graphics.CanvasElement can not listen for events. #610

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago

What steps will reproduce the problem?
Either:
1. Modify goog/demos/graphics/events.html to create a new CanvasGraphics object 
rather than calling goog.graphics.createGraphics()
or
2. Run the demo page on a mobile device
or
3. Modify goog.grahpics.createGraphics() to always return a CanvasGraphics 
object rather than an SvgGraphics object

What is the expected output? What do you see instead?

Running the demo after any of the above changes should produce three ellipses 
with mouse over/out events bound to them all.  Events are logged as they are 
triggered on the right side of the screen.

Instead of that, no canvas elements show up as the javascript encounters and 
error on load.

On line 89 of demo/graphics/events.html the code breaks when trying to add the 
event listener to a new CanvasEllipseElement.  The problem is the "element_" 
parameter of the object is null but the goog.graphics.Element.addEventListener 
function tries to add a new event listener using "element_" which in turn fails 
due to it being null.

So, in the situation that no code is modified, this error will not show up on a 
desktop as createGraphics() will always return an SvgGraphics object which 
handles events fine.  It is only on a mobile device that createGraphics() 
returns a CanvasGraphics object and this starts to fail.

This may all be a moot point if no further development is being made on the 
graphics library after depreciation.

What version of the product are you using? On what operating system?

Google closure library pulled from repository mid-October.  Mixture of systems 
(Firefox/Chrome on Linux, plus BB10 and Andriod 4.2)

Please provide any additional information below.

Note: we cannot accept patches without the contributor license agreement
being signed. See http://code.google.com/p/closure-
library/wiki/Contributors for more info.

Original issue reported on code.google.com by david.qu...@gmail.com on 20 Nov 2013 at 8:41