Permalink
Browse files

[giow] (2) 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.

git-svn-id: http://svn.whatwg.org/webapps@2686 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information...
1 parent a20f539 commit afdba55e4ae45f4c9d42c00902da1a0df7381aad @Hixie Hixie committed Jan 21, 2009
Showing with 105 additions and 76 deletions.
  1. +52 −37 index
  2. +53 −39 source
View
@@ -7955,7 +7955,8 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20HTML%3E%0
characters just inserted into the input stream. (The
<code>Document</code> node will have been populated with elements
and a <code title=event-load><a href=#event-load>load</a></code> event will have fired
- on <a href=#the-body-element-1 title="the body element">its body element</a>.)</p>
+ on its <a href=#browsing-context>browsing context</a>'s <code><a href=#window>Window</a></code>
+ object.)</p>
</li>
@@ -10472,21 +10473,23 @@ not-slash = %x0000-002E / %x0030-%10FFFF
<dd><code title=handler-window-onhashchange><a href=#handler-window-onhashchange>onhashchange</a></code></dd>
<dd><code title=handler-window-onload><a href=#handler-window-onload>onload</a></code></dd>
<dd><code title=handler-window-onmessage><a href=#handler-window-onmessage>onmessage</a></code></dd>
- <dd><code title=handler-window-ononline><a href=#handler-window-ononline>ononline</a></code></dd>
<dd><code title=handler-window-onoffline><a href=#handler-window-onoffline>onoffline</a></code></dd>
+ <dd><code title=handler-window-ononline><a href=#handler-window-ononline>ononline</a></code></dd>
+ <dd><code title=handler-window-onpopstate><a href=#handler-window-onpopstate>onpopstate</a></code></dd>
<dd><code title=handler-window-onresize><a href=#handler-window-onresize>onresize</a></code></dd>
<dd><code title=handler-window-onstorage><a href=#handler-window-onstorage>onstorage</a></code></dd>
<dd><code title=handler-window-onunload><a href=#handler-window-onunload>onunload</a></code></dd>
<dt>DOM interface:</dt>
<dd>
<pre class=idl>interface <dfn id=htmlbodyelement>HTMLBodyElement</dfn> : <a href=#htmlelement>HTMLElement</a> {
attribute <a href=#function>Function</a> <a href=#handler-window-onbeforeunload title=handler-window-onbeforeunload>onbeforeunload</a>;
- attribute <a href=#function>Function</a> <a href=#handler-window-onerror title=handler-window-onerror>onerror</a>;
+ attribute any <!-- --> <a href=#handler-window-onerror title=handler-window-onerror>onerror</a>;
attribute <a href=#function>Function</a> <a href=#handler-window-onhashchange title=handler-window-onhashchange>onhashchange</a>;
attribute <a href=#function>Function</a> <a href=#handler-window-onload title=handler-window-onload>onload</a>;
attribute <a href=#function>Function</a> <a href=#handler-window-onmessage title=handler-window-onmessage>onmessage</a>;
- attribute <a href=#function>Function</a> <a href=#handler-window-ononline title=handler-window-ononline>ononline</a>;
attribute <a href=#function>Function</a> <a href=#handler-window-onoffline title=handler-window-onoffline>onoffline</a>;
+ attribute <a href=#function>Function</a> <a href=#handler-window-ononline title=handler-window-ononline>ononline</a>;
+ attribute <a href=#function>Function</a> <a href=#handler-window-onpopstate title=handler-window-onpopstate>onpopstate</a>;
attribute <a href=#function>Function</a> <a href=#handler-window-onresize title=handler-window-onresize>onresize</a>;
attribute <a href=#function>Function</a> <a href=#handler-window-onstorage title=handler-window-onstorage>onstorage</a>;
attribute <a href=#function>Function</a> <a href=#handler-window-onunload title=handler-window-onunload>onunload</a>;
@@ -33689,6 +33692,9 @@ interface <dfn id=window>Window</dfn> {
attribute <a href=#function>Function</a> <a href=#handler-onmouseover title=handler-onmouseover>onmouseover</a>;
attribute <a href=#function>Function</a> <a href=#handler-onmouseup title=handler-onmouseup>onmouseup</a>;
attribute <a href=#function>Function</a> <a href=#handler-onmousewheel title=handler-onmousewheel>onmousewheel</a>;
+ attribute <a href=#function>Function</a> <a href=#handler-window-ononline title=handler-window-ononline>ononline</a>;
+ attribute <a href=#function>Function</a> <a href=#handler-window-onoffline title=handler-window-onoffline>onoffline</a>;
+ attribute <a href=#function>Function</a> <a href=#handler-window-onpopstate title=handler-window-onpopstate>onpopstate</a>;
attribute <a href=#function>Function</a> <a href=#handler-window-onresize title=handler-window-onresize>onresize</a>;
attribute <a href=#function>Function</a> <a href=#handler-onscroll title=handler-onscroll>onscroll</a>;
attribute <a href=#function>Function</a> <a href=#handler-onselect title=handler-onselect>onselect</a>;
@@ -35463,6 +35469,11 @@ interface <dfn id=function>Function</dfn> {
<dd><p>Must be invoked whenever a <code title=event-online><a href=#event-online>online</a></code> event is targeted at or bubbles
through the object.</dd>
+ <dt><dfn id=handler-window-onpopstate title=handler-window-onpopstate><code>onpopstate</code></dfn></dt> <!-- new -->
+
+ <dd><p>Must be invoked whenever a <code title=event-popstate><a href=#event-popstate>popstate</a></code> event is targeted at or bubbles
+ through the object.</dd>
+
<dt><dfn id=handler-window-onresize 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
@@ -37985,14 +37996,14 @@ style/default.css</pre>
<p>When the value that would be returned by the <code title=dom-navigator-onLine><a href=#dom-navigator-online>navigator.onLine</a></code> attribute of
the <code><a href=#window>Window</a></code> changes from true to false, the user agent
- must <a href=#fire-a-simple-event>fire a simple event</a> called <dfn id=event-offline title=event-offline><code>offline</code></dfn> at <a href=#the-body-element-1>the body
- element</a>.</p>
+ must <a href=#fire-a-simple-event>fire a simple event</a> called <dfn id=event-offline title=event-offline><code>offline</code></dfn> at the
+ <code><a href=#window>Window</a></code> object.</p>
<p>On the other hand, when the value that would be returned by the
<code title=dom-navigator-onLine><a href=#dom-navigator-online>navigator.onLine</a></code> attribute
of the <code><a href=#window>Window</a></code> changes from false to true, the user
- agent must <a href=#fire-a-simple-event>fire a simple event</a> called <dfn id=event-online title=event-online><code>online</code></dfn> at <a href=#the-body-element-1>the body
- element</a>.</p>
+ agent must <a href=#fire-a-simple-event>fire a simple event</a> called <dfn id=event-online title=event-online><code>online</code></dfn> at the
+ <code><a href=#window>Window</a></code> object.</p>
<p class=note>This attribute is inherently unreliable. A computer
can be connected to a network without having Internet access.</p>
@@ -38230,12 +38241,13 @@ style/default.css</pre>
string "complete"</dt>
<dd><p><a href=#queue-a-task>Queue a task</a> to fire a <dfn id=event-popstate title=event-popstate><code>popstate</code></dfn> event in no
- namespace on <a href=#the-body-element-1>the body element</a> using the
- <code><a href=#popstateevent>PopStateEvent</a></code> interface, with the <code title=dom-PopStateEvent-state><a href=#dom-popstateevent-state>state</a></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 <a href=#task-source>task
- source</a> for this task is the <a href=#dom-manipulation-task-source>DOM manipulation task
- source</a>.</dd>
+ namespace on the <code><a href=#window>Window</a></code> object of the <a href=#browsing-context>browsing
+ context</a>, using the <code><a href=#popstateevent>PopStateEvent</a></code> interface,
+ with the <code title=dom-PopStateEvent-state><a href=#dom-popstateevent-state>state</a></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 <a href=#task-source>task source</a> for this task is the
+ <a href=#dom-manipulation-task-source>DOM manipulation task source</a>.</dd>
<dt>Otherwise</dt>
@@ -38250,10 +38262,7 @@ style/default.css</pre>
</ol><p>The <a href=#pending-state-object>pending state object</a> must be initially null.</p>
- <!-- XXX onpopstate should be defined somewhere -->
-
-
- <pre class=idl>interface <dfn id=popstateevent>PopStateEvent</dfn> : Event {
+ <hr><pre class=idl>interface <dfn id=popstateevent>PopStateEvent</dfn> : Event {
readonly attribute any <a href=#dom-popstateevent-state title=dom-PopStateEvent-state>state</a>;
void <a href=#dom-popstateevent-initpopstateevent title=dom-PopStateEvent-initPopStateEvent>initPopStateEvent</a>(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in any stateArg);
void <a href=#dom-popstateevent-initpopstateeventns title=dom-PopStateEvent-initPopStateEventNS>initPopStateEventNS</a>(in DOMString namespaceURIArg, in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in any stateArg);
@@ -39166,9 +39175,9 @@ user reload must be equivalent to .reload()
and the two share the same <code>Document</code> object, then
first, if the <code>Document</code>'s <a href=#current-document-readiness>current document
readiness</a> is the string "complete", then <a href=#fire-a-simple-event>fire a simple
- event</a> with the name <code title=event-hashchange>hashchange</code> at <a href=#the-body-element-1>the
- <code>body</code> element</a>; and second, if the new URL has a
- fragment identifier, <a href=#scroll-to-the-fragment-identifier>scroll to the fragment
+ event</a> with the name <code title=event-hashchange>hashchange</code> at the <a href=#browsing-context>browsing
+ context</a>'s <code><a href=#window>Window</a></code> object; and second, if the new
+ URL has a fragment identifier, <a href=#scroll-to-the-fragment-identifier>scroll to the fragment
identifier</a>.</li>
<li><p>User agents may also update other aspects of the document
@@ -39196,8 +39205,9 @@ user reload must be equivalent to .reload()
<code><a href=#beforeunloadevent>BeforeUnloadEvent</a></code> event object with the name <code title=event-beforeunload>beforeunload</code>, with no namespace,
which does not bubble but is cancelable.</li>
- <li><p>Dispatch <var title="">event</var> at <a href=#the-body-element-1>the
- <code>body</code> element</a>.</li>
+ <li><p>Dispatch <var title="">event</var> at the
+ <code><a href=#window>Window</a></code> object of the <code>Document</code>'s
+ <a href=#browsing-context>browsing context</a>.</li>
<li><p>If any event listeners were triggered by the previous step,
then set <var title="">salvageable</var> to false.</li>
@@ -39223,8 +39233,9 @@ user reload must be equivalent to .reload()
</li>
- <li><p><a href=#fire-a-simple-event>Fire a simple event</a> called <code title=event-unload>unload</code> at <a href=#the-body-element-1>the <code>body</code>
- element</a>.</li>
+ <li><p><a href=#fire-a-simple-event>Fire a simple event</a> called <code title=event-unload>unload</code> at the <code><a href=#window>Window</a></code>
+ object of the <code>Document</code>'s <a href=#browsing-context>browsing
+ context</a>.</li>
<li><p>If any event listeners were triggered by the previous step,
then set <var title="">salvageable</var> to false.</li>
@@ -39579,14 +39590,17 @@ user reload must be equivalent to .reload()
definitions are wrong -->
<p>The <dfn id=event-storage title=event-storage><code>storage</code></dfn> event
- is fired in an <code><a href=#htmldocument>HTMLDocument</a></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><a href=#storage-0>storage</a></code>, with no namespace, which does not bubble
but is cancelable, and which uses the <code><a href=#storageevent>StorageEvent</a></code>
- interface, at <a href=#the-body-element-1>the body element</a> of each <a href=#active-document title="active document">active</a> <code><a href=#htmldocument>HTMLDocument</a></code>
- object affected.</p>
+ interface, at each <code><a href=#window>Window</a></code> object whose <a href=#active-document>active
+ document</a> has a <code><a href=#storage-0>Storage</a></code> object that is
+ affected.</p>
<p>If the event is being fired due to an invocation of the
<code title=dom-Storage-setItem><a href=#dom-storage-setitem>setItem()</a></code> or <code title=dom-Storage-removeItem><a href=#dom-storage-removeitem>removeItem()</a></code> methods, the
@@ -52695,17 +52709,18 @@ interface <dfn id=messagechannel>MessageChannel</dfn> {
<ol><li><a href=#queue-a-task>Queue a task</a> to set the <a href=#current-document-readiness>current document
readiness</a> to "complete".</li>
- <li><a href=#queue-a-task>Queue a task</a> to <a href=#fire-a-load-event title="fire a load
- event">fire a <code title=event-load>load</code> event</a> at
- <a href=#the-body-element-1>the <code>body</code> element</a>.</li>
+ <li>If the <code>Document</code> is in a <a href=#browsing-context>browsing
+ context</a>, then <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-load-event title="fire
+ a load event">fire a <code title=event-load>load</code>
+ event</a> at the <a href=#browsing-context>browsing context</a>'s
+ <code><a href=#window>Window</a></code> object.</li>
<li>If the <code>Document</code> has a <a href=#pending-state-object>pending state
- object</a>, then <a href=#queue-a-task>queue a task</a> to fire a <code title=event-popstate><a href=#event-popstate>popstate</a></code> event in no namespace on
- <a href=#the-body-element-1>the body element</a> using the <code><a href=#popstateevent>PopStateEvent</a></code>
- interface, with the <code title=dom-PopStateEvent-state><a href=#dom-popstateevent-state>state</a></code> attribute set to the
+ object</a>, then <a href=#queue-a-task>queue a task</a> to fire a <code title=event-popstate><a href=#event-popstate>popstate</a></code> event in no namespace on the
+ <a href=#browsing-context>browsing context</a>'s <code><a href=#window>Window</a></code> object using
+ the <code><a href=#popstateevent>PopStateEvent</a></code> interface, with the <code title=dom-PopStateEvent-state><a href=#dom-popstateevent-state>state</a></code> attribute set to the
current value of the <a href=#pending-state-object>pending state object</a>. 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 <a href=#task-source>task source</a> for these tasks is the <a href=#dom-manipulation-task-source>DOM
manipulation task source</a>.</p>
Oops, something went wrong.

0 comments on commit afdba55

Please sign in to comment.