Skip to main content

Bug Tracker

Side navigation

#109 closed enhancement (fixed)

Opened July 28, 2006 04:28PM UTC

Closed October 26, 2006 02:30PM UTC

Normalize event object

Reported by: john Owned by:
Priority: minor Milestone:
Component: core Version:
Keywords: Cc:
Blocked by: Blocking:
Description

Some cross-browser normalization of the event object has already been done - it should be taken further (handling target, etc. propertly).

Attachments (0)
Change History (8)

Changed August 15, 2006 04:56AM UTC by john comment:1

milestone: 1.0
version: 1.0

Changed August 31, 2006 04:23AM UTC by john comment:2

priority: majorminor

Changed October 20, 2006 10:31PM UTC by joern comment:3

Something like this, added to event.fix:

{{{

var targ;

if (event.target) {

targ = event.target;

}

else if( event.srcElement ) {

targ = event.srcElement;

}

if (targ.nodeType == 3) { // defeat Safari bug

targ = targ.parentNode;

}

event.target = targ;

Changed October 20, 2006 10:49PM UTC by joern comment:4

Try again, handling target element:

if(event.srcElement) {
 event.target = event.srcElement;
} else if(e.target.nodeType == 3) {
 event.target = event.target.parentNode;
}

Changed October 21, 2006 10:30AM UTC by joern comment:5

target etc. are read-only (http://www.w3.org/TR/DOM-Level-2-Events/ecma-script-binding.html), therefore it might be a good idea to create a new object and copy properties and methods from the original object.

Changed October 26, 2006 12:43PM UTC by joern comment:6

Fixed in svn.

Changed October 26, 2006 02:18PM UTC by joern comment:7

Target property is now fixed for both IE and Safari.

Changed October 26, 2006 02:30PM UTC by joern comment:8

resolution: → fixed
status: newclosed

I close this. Please reopen the ticket if you find something of the event object that should be handled by jQuery, too.