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

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>9204</bug_id>
          
          <creation_ts>2010-03-06 21:20:32 +0000</creation_ts>
          <short_desc>The onload event is missing a description on when it fires. Particularly on elements downloading auxiliary documents (img, script, link) it is important to specify when exactly that event is fired. Same for onerror and onabort events (and similar).</short_desc>
          <delta_ts>2010-10-04 14:56:29 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML WG</product>
          <component>pre-LC1 HTML5 spec (editor: Ian Hickson)</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>NEEDSINFO</resolution>
          
          
          <bug_file_loc>http://www.whatwg.org/specs/web-apps/current-work/#event-handlers-on-elements,-document-objects,-and-window-objects</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>LC</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>brille1</cc>
    
    <cc>ian</cc>
    
    <cc>mike</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>32836</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2010-03-06 21:20:32 +0000</bug_when>
    <thetext>Section: http://www.whatwg.org/specs/web-apps/current-work/#event-handlers-on-elements,-document-objects,-and-window-objects

Comment:
The onload event is missing a description on when it fires. Particularly on
elements downloading auxiliary documents (img, script, link) it is important
to specify when exactly that event is fired. Same for onerror and onabort
events (and similar).

Posted from: 93.206.147.106</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>34181</commentid>
    <comment_count>1</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2010-03-30 22:20:03 +0000</bug_when>
    <thetext>EDITOR&apos;S RESPONSE: This is an Editor&apos;s Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Did Not Understand Request
Change Description: no spec change
Rationale: I don&apos;t understand. Could you elaborate? As far as I can tell, the spec goes to great lengths to define when &apos;load&apos; events fire, as with &apos;error&apos; and &apos;abort&apos; events.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>34322</commentid>
    <comment_count>2</comment_count>
    <who name="Axel Dahmen">brille1</who>
    <bug_when>2010-04-01 09:34:52 +0000</bug_when>
    <thetext>This sort of refers to bug #9205.

In the course of trying to manipulate an HTML document by DOM manipulation I observed a strange discrepancy in behaviour between the &lt;img&gt; and the &lt;script&gt; object.

While the &lt;img&gt; objects starts downloading a referenced external resource as soon as the &quot;src&quot; attribute gets set (and onload() is fired accordingly), in Internet Explorer the &lt;script&gt; element seems to only initialize some part of downloading sequence. IE doesn&apos;t support the onload() event, yet it fires the onreadystatechanged event with value &quot;loading&quot;. But it won&apos;t fire the onreadystatechanged event with value &quot;complete&quot; until the newly created DOM element becomes added to the DOM tree of the HTML document.

I believe this discrepancy in IE is very irritating and should be obsolated by definition.


Here&apos;s a flow table to better visualize what happens:

CREATING AN IMAGE:
1)  create document element    {document.createElement(&quot;img&quot;);}
2)  assign an IRI to the &quot;scr&quot; attribute
3)  the external resource gets loaded into the cache
4)  the onload event is triggered

in contrast to:

CREATING A SCRIPT REFERENCE:
-non IE-
1)  create document element    {document.createElement(&quot;script&quot;);}
2)  assign an IRI to the &quot;src&quot; attribute
3)  the external resource gets loaded into the cache
4)  the onload event is triggered

-IE-
1)  create document element    {document.createElement(&quot;script&quot;);}
2)  assign an IRI to the &quot;src&quot; attribute
3)  the external resource begins getting loaded into the cache
4)  the onreadystatechanged event is triggered with value &quot;loading&quot;
--  nothing more happens until:
5)  add the new script element to the HTML document tree
6)  the onreadystatechanged event is triggered with value &quot;complete&quot;


I believe the ambiguity between onload and onreadystatechanged should be obsolated at all. The onreadystatechanged event doesn&apos;t provide any additional useful information and complicates code unnecessarily.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>34768</commentid>
    <comment_count>3</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2010-04-12 07:26:06 +0000</bug_when>
    <thetext>EDITOR&apos;S RESPONSE: This is an Editor&apos;s Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Did Not Understand Request
Change Description: no spec change
Rationale: I don&apos;t understand. According to HTML5, there is no &quot;readystate&quot; event on &lt;script&gt;. What part of the processing of &lt;script&gt; are you asking be changed? If you could refer to specific text in the spec you think is wrong, that would be rather helpful.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35491</commentid>
    <comment_count>4</comment_count>
    <who name="Axel Dahmen">brille1</who>
    <bug_when>2010-05-07 03:36:45 +0000</bug_when>
    <thetext>I can&apos;t find a description in the spec about which events are fired for the script element. Could you please point me to the appropriate section?

As I wrote in another bug, the HTML5 spec has become huge and hard to survey. A reorganization might feel appropriate, creating more subsections for each tag, so the user can searche for, e.g., &quot;DTD&quot;, &quot;DOM&quot;, &quot;Events&quot;, &quot;Description&quot;, &quot;Workflow&quot; etc.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>37578</commentid>
    <comment_count>5</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2010-08-17 19:03:05 +0000</bug_when>
    <thetext>Search for &quot;fire a&quot; in:
   http://www.whatwg.org/specs/web-apps/current-work/complete/scripting-1.html#script</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>