<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>33106</bug_id>
          
          <creation_ts>2010-01-02 09:39:20 -0800</creation_ts>
          <short_desc>&apos;load&apos; events fire with event.eventPhase set to &apos;0&apos; instead of &apos;2&apos; AT_TARGET</short_desc>
          <delta_ts>2010-01-02 13:31:49 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Page Loading</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Diego Perini">diego.perini</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>176326</commentid>
    <comment_count>0</comment_count>
    <who name="Diego Perini">diego.perini</who>
    <bug_when>2010-01-02 09:39:20 -0800</bug_when>
    <thetext>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 &apos;load&apos; event will fire with event.eventPhase set to &apos;0&apos; instead of &apos;2&apos; AT_TARGET.

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


Simple test I used:

DOM2

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

DOM0

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

from what I understand the possible values are 1, 2 and 3 ... If I recall 0 was for custom events.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>176349</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2010-01-02 11:50:36 -0800</bug_when>
    <thetext>I can reproduce with shipping Safari/WebKit, but not with a ToT WebKit build - possibly fixed in &lt;http://trac.webkit.org/changeset/48701&gt;. Please test with a nightly build from &lt;http://nightly.webkit.org&gt;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>176381</commentid>
    <comment_count>2</comment_count>
    <who name="Diego Perini">diego.perini</who>
    <bug_when>2010-01-02 13:31:49 -0800</bug_when>
    <thetext>Alexey, that was fast ;-)

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

Tested with nightly build (r52686).

Thank you for your precious help.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>