[OpenLayers-Trac] [OpenLayers] #3262: OpenLayers Event objects in Firefox have unstable 'getPreventDefault' methods.

OpenLayers trac-20090302 at openlayers.org
Mon Apr 18 12:13:57 EDT 2011


#3262: OpenLayers Event objects in Firefox have unstable 'getPreventDefault'
methods.
---------------------+------------------------------------------------------
 Reporter:  mgleahy  |       Owner:              
     Type:  feature  |      Status:  new         
 Priority:  minor    |   Milestone:  2.11 Release
Component:  general  |     Version:  2.10        
 Keywords:           |       State:              
---------------------+------------------------------------------------------
 On line 37 of the attached html file, the getPreventDefault method is
 present and called (in Firefox)...at that point, you will get the
 following error reported:


 ----

 uncaught exception: [Exception... "Illegal operation on WrappedNative
 prototype object"  nsresult: "0x8057000c
 (NS_ERROR_XPC_BAD_OP_ON_WN_PROTO)" location: "JS frame ::
 http://localhost/openlayers/examples/clickEventsDebug.html :: <TOP_LEVEL>
 :: line 36"  data: no]

 Line 0
 ----
 It seems to me that either the getPreventDefault method should not be
 present as a property of the OpenLayers event object, or if it is, it
 should not crash the JavaScript code when it is called.  I encountered
 this because I had been using the jQuery $.event.fix() method in my
 application, and upon the upgrade to 1.5.2 of jQuery, the $.event.fix()
 method started checking for this method.

 The attached file also illustrates a workaround I was able to use, where I
 overrode the getPreventDefault function with a new empty function (though
 I think deleting the property or setting it false would work as well).

-- 
Ticket URL: <http://trac.openlayers.org/ticket/3262>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer


More information about the Trac mailing list