From b75bc189ec0f21171c47a14d6d4561af9a0290fe Mon Sep 17 00:00:00 2001 From: kangax Date: Mon, 28 Apr 2008 18:54:51 -0400 Subject: [PATCH] Fix Event#element accessing nonexistent tagName property (e.g. when element is a document) --- CHANGELOG | 2 ++ src/event.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 89eab05..5a2cccc 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +* Fix Event#element accessing inexistent tagName property (e.g. when element is a document). (kangax) + * Amended failing Element#identify test. * Refactor unit tests. Unit tests are now dynamically generated from a JavaScript test file and optional HTML, JS and CSS fixtures. [Tobie Langel] diff --git a/src/event.js b/src/event.js index 4d6a0ec..3691fde 100644 --- a/src/event.js +++ b/src/event.js @@ -63,7 +63,7 @@ Event.Methods = (function() { var node = event.target, type = event.type; - if (event.currentTarget) { + if (event.currentTarget && event.currentTarget.tagName) { // Firefox screws up the "click" event when moving between radio buttons // via arrow keys. It also screws up the "load" and "error" events on images, // reporting the document as the target instead of the original image.