Bug 33106 - 'load' events fire with event.eventPhase set to '0' instead of '2' AT_TARGET
Summary: 'load' events fire with event.eventPhase set to '0' instead of '2' AT_TARGET
Status: RESOLVED WORKSFORME
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-02 09:39 PST by Diego Perini
Modified: 2010-01-02 13:31 PST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Diego Perini 2010-01-02 09:39:20 PST
I tested this both on Safari Version 4.0.4 (6531.21.10) and Version 3.1.2 (5525.20.1)

I noticed that the 'load' event will fire with event.eventPhase set to '0' instead of '2' AT_TARGET.

This happens in Safari both using DOM2 or DOM0 registration. Doesn't happen in any other tested browser.


Simple test I used:

DOM2

window.addEventListener('load', function(e) { alert("event.eventPhase: " + e.eventPhase + "\nphase should be: 2"); }, false);

DOM0

window.onload = function(e) { alert("event.eventPhase: " + e.eventPhase + "\nphase should be: 2"); };

from what I understand the possible values are 1, 2 and 3 ... If I recall 0 was for custom events.
Comment 1 Alexey Proskuryakov 2010-01-02 11:50:36 PST
I can reproduce with shipping Safari/WebKit, but not with a ToT WebKit build - possibly fixed in <http://trac.webkit.org/changeset/48701>. Please test with a nightly build from <http://nightly.webkit.org>.
Comment 2 Diego Perini 2010-01-02 13:31:49 PST
Alexey, that was fast ;-)

Solves for me, when the 'load' event fires on window object, 'eventPhase' property is now correctly AT_TARGET (2).

Tested with nightly build (r52686).

Thank you for your precious help.