HTML Standard Tracker

Filter

File a bug

SVNBugCommentTime (UTC)
2686[Gecko] [Internet Explorer] [Opera] [Webkit] Make sure to fire the relevant events on the Window object now instead of the body element. Define onpopstate. Other minor fixes for the previous checkin.2009-01-21 11:34
@@ -8188,21 +8188,22 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20HTML%3E%0
     <code title="dom-innerHTML-HTML">innerHTML</code> attribute.</p>
 
    </li>
 
    <li>
 
     <p>Start the parser and let it run until it has consumed all the
     characters just inserted into the input stream. (The
     <code>Document</code> node will have been populated with elements
     and a <code title="event-load">load</code> event will have fired
-    on <span title="the body element">its body element</span>.)</p>
+    on its <span>browsing context</span>'s <code>Window</code>
+    object.)</p>
 
    </li>
 
   </ol>
 
   <p>Otherwise, if the node is an element, then setting the <code
   title="dom-innerHTML-HTML">innerHTML</code> DOM attribute must cause
   the following algorithm to run instead:</p>
 
   <ol>
@@ -11120,35 +11121,37 @@ not-slash     = %x0000-002E / %x0030-%10FFFF
    <dt>Contexts in which this element may be used:</dt>
    <dd>As the second element in an <code>html</code> element.</dd>
    <dt>Content model:</dt>
    <dd><span>Flow content</span>.</dd>
    <dt>Element-specific attributes:</dt>
    <dd><code title="handler-window-onbeforeunload">onbeforeunload</code></dd>
    <dd><code title="handler-window-onerror">onerror</code></dd>
    <dd><code title="handler-window-onhashchange">onhashchange</code></dd>
    <dd><code title="handler-window-onload">onload</code></dd>
    <dd><code title="handler-window-onmessage">onmessage</code></dd>
-   <dd><code title="handler-window-ononline">ononline</code></dd>
    <dd><code title="handler-window-onoffline">onoffline</code></dd>
+   <dd><code title="handler-window-ononline">ononline</code></dd>
+   <dd><code title="handler-window-onpopstate">onpopstate</code></dd>
    <dd><code title="handler-window-onresize">onresize</code></dd>
    <dd><code title="handler-window-onstorage">onstorage</code></dd>
    <dd><code title="handler-window-onunload">onunload</code></dd>
    <dt>DOM interface:</dt>
    <dd>
 <pre class="idl">interface <dfn>HTMLBodyElement</dfn> : <span>HTMLElement</span> {
            attribute <span>Function</span> <span title="handler-window-onbeforeunload">onbeforeunload</span>;
-           attribute <span>Function</span> <span title="handler-window-onerror">onerror</span>;
+           attribute any     <!--      --> <span title="handler-window-onerror">onerror</span>;
            attribute <span>Function</span> <span title="handler-window-onhashchange">onhashchange</span>;
            attribute <span>Function</span> <span title="handler-window-onload">onload</span>;
            attribute <span>Function</span> <span title="handler-window-onmessage">onmessage</span>;
-           attribute <span>Function</span> <span title="handler-window-ononline">ononline</span>;
            attribute <span>Function</span> <span title="handler-window-onoffline">onoffline</span>;
+           attribute <span>Function</span> <span title="handler-window-ononline">ononline</span>;
+           attribute <span>Function</span> <span title="handler-window-onpopstate">onpopstate</span>;
            attribute <span>Function</span> <span title="handler-window-onresize">onresize</span>;
            attribute <span>Function</span> <span title="handler-window-onstorage">onstorage</span>;
            attribute <span>Function</span> <span title="handler-window-onunload">onunload</span>;
 };</pre>
 </dd>
   </dl>
 
   <p>The <code>body</code> element represents the main content of the
   document.</p>
 
@@ -38263,20 +38266,23 @@ interface <dfn>Window</dfn> {
            attribute <span>Function</span> <span title="handler-onkeypress">onkeypress</span>;
            attribute <span>Function</span> <span title="handler-onkeyup">onkeyup</span>;
            attribute <span>Function</span> <span title="handler-window-onload">onload</span>;
            attribute <span>Function</span> <span title="handler-window-onmessage">onmessage</span>;
            attribute <span>Function</span> <span title="handler-onmousedown">onmousedown</span>;
            attribute <span>Function</span> <span title="handler-onmousemove">onmousemove</span>;
            attribute <span>Function</span> <span title="handler-onmouseout">onmouseout</span>;
            attribute <span>Function</span> <span title="handler-onmouseover">onmouseover</span>;
            attribute <span>Function</span> <span title="handler-onmouseup">onmouseup</span>;
            attribute <span>Function</span> <span title="handler-onmousewheel">onmousewheel</span>;
+           attribute <span>Function</span> <span title="handler-window-ononline">ononline</span>;
+           attribute <span>Function</span> <span title="handler-window-onoffline">onoffline</span>;
+           attribute <span>Function</span> <span title="handler-window-onpopstate">onpopstate</span>;
            attribute <span>Function</span> <span title="handler-window-onresize">onresize</span>;
            attribute <span>Function</span> <span title="handler-onscroll">onscroll</span>;
            attribute <span>Function</span> <span title="handler-onselect">onselect</span>;
            attribute <span>Function</span> <span title="handler-window-onstorage">onstorage</span>;
            attribute <span>Function</span> <span title="handler-onsubmit">onsubmit</span>;
            attribute <span>Function</span> <span title="handler-window-onunload">onunload</span>;
 };</pre>
 
  <!-- XXX http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/obj_window.asp
           http://www.mozilla.org/docs/dom/domref/dom_window_ref.html
@@ -40350,20 +40356,26 @@ interface <dfn>Function</dfn> {
    <dd><p>Must be invoked whenever a <code
    title="event-offline">offline</code> event is targeted at or bubbles
    through the object.</p></dd>
 
    <dt><dfn title="handler-window-ononline"><code>ononline</code></dfn></dt> <!-- new -->
 
    <dd><p>Must be invoked whenever a <code
    title="event-online">online</code> event is targeted at or bubbles
    through the object.</p></dd>
 
+   <dt><dfn title="handler-window-onpopstate"><code>onpopstate</code></dfn></dt> <!-- new -->
+
+   <dd><p>Must be invoked whenever a <code
+   title="event-popstate">popstate</code> event is targeted at or bubbles
+   through the object.</p></dd>
+
    <dt><dfn title="handler-window-onresize"><code>onresize</code></dfn></dt> <!-- widely used -->
 
    <dd><p>Must be invoked whenever a <code
    title="event-resize">resize</code> event is targeted at or bubbles
    through the object.</p></dd> <!-- XXX should define when it fires -->
 
    <dt><dfn title="handler-window-onstorage"><code>onstorage</code></dfn></dt> <!-- new -->
 
    <dd><p>Must be invoked whenever a <code
    title="event-storage">storage</code> event is targeted at or bubbles
@@ -43257,29 +43269,29 @@ style/default.css</pre>
   title="dom-navigator-onLine"><code>navigator.onLine</code></dfn>
   attribute must return false if the user agent will not contact the
   network when the user follows links or when a script requests a
   remote page (or knows that such an attempt would fail), and must
   return true otherwise.</p>
 
   <p>When the value that would be returned by the <code
   title="dom-navigator-onLine">navigator.onLine</code> attribute of
   the <code>Window</code> changes from true to false, the user agent
   must <span>fire a simple event</span> called <dfn
-  title="event-offline"><code>offline</code></dfn> at <span>the body
-  element</span>.</p>
+  title="event-offline"><code>offline</code></dfn> at the
+  <code>Window</code> object.</p>
 
   <p>On the other hand, when the value that would be returned by the
   <code title="dom-navigator-onLine">navigator.onLine</code> attribute
   of the <code>Window</code> changes from false to true, the user
   agent must <span>fire a simple event</span> called <dfn
-  title="event-online"><code>online</code></dfn> at <span>the body
-  element</span>.</p>
+  title="event-online"><code>online</code></dfn> at the
+  <code>Window</code> object.</p>
 
   <p class="note">This attribute is inherently unreliable. A computer
   can be connected to a network without having Internet access.</p>
 
 
 
   <h3 id="history">Session history and navigation</h3>
 
   <h4>The session history of browsing contexts</h4>
 
@@ -43544,48 +43556,47 @@ style/default.css</pre>
 
     <p>Run the appropriate according to the conditions described:</p>
 
     <dl class="switch">
 
      <dt>If the <span>current document readiness</span> is set to the
      string "complete"</dt>
 
      <dd><p><span>Queue a task</span> to fire a <dfn
      title="event-popstate"><code>popstate</code></dfn> event in no
-     namespace on <span>the body element</span> using the
-     <code>PopStateEvent</code> interface, with the <code
-     title="dom-PopStateEvent-state">state</code> attribute set to the
-     value of <var title="">state</var>. This event must bubble but
-     not be cancelable and has no default action. The <span>task
-     source</span> for this task is the <span>DOM manipulation task
-     source</span>.</p></dd>
+     namespace on the <code>Window</code> object of the <span>browsing
+     context</span>, using the <code>PopStateEvent</code> interface,
+     with the <code title="dom-PopStateEvent-state">state</code>
+     attribute set to the value of <var title="">state</var>. This
+     event must bubble but not be cancelable and has no default
+     action. The <span>task source</span> for this task is the
+     <span>DOM manipulation task source</span>.</p></dd>
 
      <dt>Otherwise</dt>
 
      <dd><p>Let the <code>Document</code>'s <dfn>pending state
      object</dfn> be <var title="">state</var>. (If there was already
      a <span>pending state object</span>, the previous one is
      discarded.)</p>
 
      <p class="note">The event will then be fired just after the <code
      title="event-load">load</code> event.</p></dd>
 
     </dl>
 
    </li>
 
   </ol>
 
   <p>The <span>pending state object</span> must be initially null.</p>
 
-  <!-- XXX onpopstate should be defined somewhere -->
-
+  <hr>
 
   <pre class="idl">interface <dfn>PopStateEvent</dfn> : Event {
   readonly attribute any <span title="dom-PopStateEvent-state">state</span>;
   void <span title="dom-PopStateEvent-initPopStateEvent">initPopStateEvent</span>(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in any stateArg);
   void <span title="dom-PopStateEvent-initPopStateEventNS">initPopStateEventNS</span>(in DOMString namespaceURIArg, in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in any stateArg);
 };</pre>
 
   <p>The <dfn
   title="dom-PopStateEvent-initPopStateEvent"><code>initPopStateEvent()</code></dfn>
   and <dfn
@@ -44619,23 +44630,23 @@ user reload must be equivalent to .reload()
    first entry for a <code>Document</code>, the user agent must <span
    title="activate the state object">activate that
    entry</span>.</p></li>
 
    <li><p>If the <i>specified entry</i> has a URL that differs from
    the <span>current entry</span>'s only by its fragment identifier,
    and the two share the same <code>Document</code> object, then
    first, if the <code>Document</code>'s <span>current document
    readiness</span> is the string "complete", then <span>fire a simple
    event</span> with the name <code
-   title="event-hashchange">hashchange</code> at <span>the
-   <code>body</code> element</span>; and second, if the new URL has a
-   fragment identifier, <span>scroll to the fragment
+   title="event-hashchange">hashchange</code> at the <span>browsing
+   context</span>'s <code>Window</code> object; and second, if the new
+   URL has a fragment identifier, <span>scroll to the fragment
    identifier</span>.</p></li>
 
    <li><p>User agents may also update other aspects of the document
    view when the location changes in this way, for instance the scroll
    position, values of form fields, etc.</p></li>
 
    <li><p>The <span>current entry</span> is now the <i>specified
    entry</i>.</p></li>
 
   </ol>
@@ -44656,22 +44667,23 @@ user reload must be equivalent to .reload()
 
   <ol>
 
    <li><p>Set <var title="">salvageable</var> to true.</p></li>
 
    <li><p>Let <var title="">event</var> be a new
    <code>BeforeUnloadEvent</code> event object with the name <code
    title="event-beforeunload">beforeunload</code>, with no namespace,
    which does not bubble but is cancelable.</p></li>
 
-   <li><p>Dispatch <var title="">event</var> at <span>the
-   <code>body</code> element</span>.</p></li>
+   <li><p>Dispatch <var title="">event</var> at the
+   <code>Window</code> object of the <code>Document</code>'s
+   <span>browsing context</span>.</p></li>
 
    <li><p>If any event listeners were triggered by the previous step,
    then set <var title="">salvageable</var> to false.</p></li>
 
    <li>
 
     <p>If the <code
     title="dom-BeforeUnloadEvent-returnValue">returnValue</code>
     attribute of the <var title="">event</var> object is not the empty
     string, or if the event was canceled, then the user agent should
@@ -44686,22 +44698,23 @@ user reload must be equivalent to .reload()
 
     <p>The user agent must <span>pause</span> while waiting for the
     user's response.</p>
 
     <p>If the user <dfn>refused to allow the document to be
     unloaded</dfn> then these steps must be aborted.</p>
 
    </li>
 
    <li><p><span>Fire a simple event</span> called <code
-   title="event-unload">unload</code> at <span>the <code>body</code>
-   element</span>.</p></li>
+   title="event-unload">unload</code> at the <code>Window</code>
+   object of the <code>Document</code>'s <span>browsing
+   context</span>.</p></li>
 
    <li><p>If any event listeners were triggered by the previous step,
    then set <var title="">salvageable</var> to false.</p></li>
 
    <li><p>If there are any outstanding transactions that have
    callbacks that involve <span title="concept-script">scripts</span>
    that are in the document's <span>current script group</span>, roll
    them back (without invoking any of the callbacks) and set <var
    title="">salvageable</var> to false.</p>
 
@@ -45078,31 +45091,31 @@ user reload must be equivalent to .reload()
   title="event-storage">storage</code> event must be fired, as <span
   title="event-storage">described below</span>.</p>
 
 
   <h5>The <code title="event-storage">storage</code> event</h5>
 
   <!-- XXX fix up for workers: target is wrong, source and storageArea
   definitions are wrong -->
 
   <p>The <dfn title="event-storage"><code>storage</code></dfn> event
-  is fired in an <code>HTMLDocument</code> when a storage area
-  changes, as described in the previous two sections (<a
-  href="#sessionStorageEvent">for session storage</a>, <a
-  href="#localStorageEvent">for local storage</a>).</p>
+  is fired when a storage area changes, as described in the previous
+  two sections (<a href="#sessionStorageEvent">for session
+  storage</a>, <a href="#localStorageEvent">for local
+  storage</a>).</p>
 
   <p>When this happens, the user agent must dispatch an event with the
   name <code>storage</code>, with no namespace, which does not bubble
   but is cancelable, and which uses the <code>StorageEvent</code>
-  interface, at <span>the body element</span> of each <span
-  title="active document">active</span> <code>HTMLDocument</code>
-  object affected.</p>
+  interface, at each <code>Window</code> object whose <span>active
+  document</span> has a <code>Storage</code> object that is
+  affected.</p>
 
   <p>If the event is being fired due to an invocation of the
   <code title="dom-Storage-setItem">setItem()</code> or <code
   title="dom-Storage-removeItem">removeItem()</code> methods, the
   event must have its <code title="dom-StorageEvent-key">key</code>
   attribute set to the name of the key in question, its <code
   title="dom-StorageEvent-oldValue">oldValue</code> attribute set to
   the old value of the key in question, or null if the key is newly
   added, and its <code title="dom-StorageEvent-newValue">newValue</code>
   attribute set to the new value of the key in question, or null if
@@ -60017,33 +60030,34 @@ interface <dfn>MessageChannel</dfn> {
 
   <p>Once everything that <dfn title="delay the load event">delays the
   load event</dfn> has completed, the user agent must run the
   following steps:</p>
 
   <ol>
 
    <li><span>Queue a task</span> to set the <span>current document
    readiness</span> to "complete".</li>
 
-   <li><span>Queue a task</span> to <span title="fire a load
-   event">fire a <code title="event-load">load</code> event</span> at
-   <span>the <code>body</code> element</span>.</li>
+   <li>If the <code>Document</code> is in a <span>browsing
+   context</span>, then <span>queue a task</span> to <span title="fire
+   a load event">fire a <code title="event-load">load</code>
+   event</span> at the <span>browsing context</span>'s
+   <code>Window</code> object.</li>
 
    <li>If the <code>Document</code> has a <span>pending state
    object</span>, then <span>queue a task</span> to fire a <code
-   title="event-popstate">popstate</code> event in no namespace on
-   <span>the body element</span> using the <code>PopStateEvent</code>
-   interface, with the <code
+   title="event-popstate">popstate</code> event in no namespace on the
+   <span>browsing context</span>'s <code>Window</code> object using
+   the <code>PopStateEvent</code> interface, with the <code
    title="dom-PopStateEvent-state">state</code> attribute set to the
    current value of the <span>pending state object</span>. This event
-   must bubble but not be cancelable and has no default
-   action.</li>
+   must bubble but not be cancelable and has no default action.</li>
 
   </ol>
 
   <p>The <span>task source</span> for these tasks is the <span>DOM
   manipulation task source</span>.</p>
 
   <!-- XXX make sure things "delay the load event" -->
 
   <p class="XXX">delaying the load event for things like image
   loads allows for intranet port scans (even without

|