public
Description: Prototype JavaScript framework
Homepage: http://prototypejs.org/
Clone URL: git://github.com/sstephenson/prototype.git
Fix Event#element accessing nonexistent tagName property (e.g. when 
element is a document)
kangax (author)
Mon Apr 28 15:54:51 -0700 2008
savetheclocktower (committer)
Wed Apr 30 11:37:45 -0700 2008
commit  5ad0b871986b11af02ee6555c50b93e230ca679f
tree    43f1c3bfb19d4154d8b015ba572b24b9dda6a30f
parent  51c5bbd05209acbfa04237e981bf270f272e0139
...
 
 
1
2
3
...
1
2
3
4
5
0
@@ -1,3 +1,5 @@
0
+* Fix Event#element accessing inexistent tagName property (e.g. when element is a document). (kangax)
0
+
0
 * Amended failing Element#identify test.
0
 
0
 * Fix error when calling Event.stopObserving(window). (jddalton) [#30 state:resolved]
...
63
64
65
66
 
67
68
69
...
63
64
65
 
66
67
68
69
0
@@ -63,7 +63,7 @@ Event.Methods = (function() {
0
       
0
       var node = event.target, type = event.type;
0
       
0
- if (event.currentTarget) {
1
+ if (event.currentTarget && event.currentTarget.tagName) {
0
         // Firefox screws up the "click" event when moving between radio buttons
0
         // via arrow keys. It also screws up the "load" and "error" events on images,
0
         // reporting the document as the target instead of the original image.

Comments

  • jdalton Thu May 01 13:17:20 -0700 2008 at src/event.js L67

    maybe it would be simplerto use
    if (Object.isElement(event.currentTarget)) {