Skip to content

Commit

Permalink
[e] (0) Split Window into two (editorial-level) definitions. Clean up…
Browse files Browse the repository at this point in the history
… some timeout stuff.

git-svn-id: http://svn.whatwg.org/webapps@1879 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Jul 15, 2008
1 parent b73b0e9 commit 1b77444
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 88 deletions.
98 changes: 52 additions & 46 deletions index
Expand Up @@ -30246,12 +30246,17 @@ never reset. This is nice and consistent.)

<p>The <code>AbstractView</code> object of <a href="#default3"
title="default view">default views</a> must also implement the <code><a
href="#window">Window</a></code> object.
href="#window">Window</a></code> and <code><a
href="#windowbrowsingcontext">WindowBrowsingContext</a></code> objects.

<pre class=idl>[NoInterfaceObject] interface <dfn id=window>Window</dfn> {
// the current browsing context
// self-reference
readonly attribute <a href="#window">Window</a> <a href="#window0" title=dom-window>window</a>;
readonly attribute <a href="#window">Window</a> <a href="#self" title=dom-self>self</a>;
};

[NoInterfaceObject] interface <dfn id=windowbrowsingcontext>WindowBrowsingContext</dfn> {
// the current browsing context
attribute DOMString <a href="#name9" title=dom-name>name</a>;
[PutForwards=href] readonly attribute <a href="#location2">Location</a> <a href="#location0" title=dom-document-location>location</a>;
readonly attribute <a href="#history2">History</a> <a href="#history1" title=dom-history>history</a>;
Expand Down Expand Up @@ -53324,41 +53329,41 @@ xh|section xh|section xh|section xh|section xh|section xh|h1 { /* same styles as

<h3 id=timers><span class=secno>10.4 </span>Timers</h3>

<p>This section is expected to be moved to the Window Object specification
in due course.
<p class=big-issue>This section is expected to be moved to the Window
Object specification in due course.

<pre class=idl>
[NoInterfaceObject] interface <dfn id=windowtimers>WindowTimers</dfn> {
<p>Objects that implement the <code><a href="#window">Window</a></code>
interface must also implement the <code><a
href="#windowtimers">WindowTimers</a></code> interface:

<pre
class=idl>[NoInterfaceObject] interface <dfn id=windowtimers>WindowTimers</dfn> {
// timers
long <a href="#settimeout">setTimeout</a>(in <a href="#timeouthandler">TimeoutHandler</a> handler, in long timeout);
long <a href="#settimeout">setTimeout</a>(in <a href="#timeouthandler">TimeoutHandler</a> handler, in long timeout, <var title="">arguments...</var>);
long <a href="#settimeout">setTimeout</a>(in DOMString code, in long timeout);
long <a href="#settimeout">setTimeout</a>(in DOMString code, in long timeout, in DOMString language);
void <a href="#cleartimeout">clearTimeout</a>(in long handle);
long <a href="#setinterval...">setInterval</a>(in <a href="#timeouthandler">TimeoutHandler</a> handler, in long timeout);
long <a href="#setinterval...">setInterval</a>(in <a href="#timeouthandler">TimeoutHandler</a> handler, in long timeout, <var title="">arguments...</var>);
long <a href="#setinterval...">setInterval</a>(in DOMString code, in long timeout);
long <a href="#setinterval...">setInterval</a>(in DOMString code, in long timeout, in DOMString language);
void <a href="#clearinterval">clearInterval</a>(in long handle);
long <a href="#settimeout" title=dom-windowtimers-setTimeout>setTimeout</a>(in <a href="#timeouthandler">TimeoutHandler</a> handler, in long timeout);
long <a href="#settimeout" title=dom-windowtimers-setTimeout>setTimeout</a>(in <a href="#timeouthandler">TimeoutHandler</a> handler, in long timeout, <var title="">arguments...</var>);
long <a href="#settimeout" title=dom-windowtimers-setTimeout>setTimeout</a>(in DOMString code, in long timeout);
long <a href="#settimeout" title=dom-windowtimers-setTimeout>setTimeout</a>(in DOMString code, in long timeout, in DOMString language);
void <a href="#cleartimeout" title=dom-windowtimers-clearTimeout>clearTimeout</a>(in long handle);
long <a href="#setinterval..." title=dom-windowtimers-setInterval>setInterval</a>(in <a href="#timeouthandler">TimeoutHandler</a> handler, in long timeout);
long <a href="#setinterval..." title=dom-windowtimers-setInterval>setInterval</a>(in <a href="#timeouthandler">TimeoutHandler</a> handler, in long timeout, <var title="">arguments...</var>);
long <a href="#setinterval..." title=dom-windowtimers-setInterval>setInterval</a>(in DOMString code, in long timeout);
long <a href="#setinterval..." title=dom-windowtimers-setInterval>setInterval</a>(in DOMString code, in long timeout, in DOMString language);
void <a href="#clearinterval" title=dom-windowtimers-clearInterval>clearInterval</a>(in long handle);
};

interface <dfn id=timeouthandler>TimeoutHandler</dfn> {
void handleEvent([Variadic] in any args);
};
</pre>

<p>The <code><a href="#windowtimers">WindowTimers</a></code> interface must
be obtainable from any <code><a href="#window">Window</a></code> object
using binding-specific casting methods.

<p class=big-issue>Actually even better would be to just mix it straight
into Window somehow.

<p>The <code><a href="#settimeout">setTimeout</a></code> and <code><a
<p>The <code title=dom-windowtimers-setTimeout><a
href="#settimeout">setTimeout</a></code> and <code
title=dom-windowtimers-setInterval><a
href="#setinterval...">setInterval</a></code> methods allow authors to
schedule timer-based events.

<p>The <dfn id=settimeout title=setTimeout><code>setTimeout(<var
<p>The <dfn id=settimeout
title=dom-windowtimers-setTimeout><code>setTimeout(<var
title="">handler</var>, <var title="">timeout</var>[, <var
title="">arguments...</var>])</code></dfn> method takes a reference to a
<code><a href="#timeouthandler">TimeoutHandler</a></code> object and a
Expand All @@ -53378,32 +53383,33 @@ interface <dfn id=timeouthandler>TimeoutHandler</dfn> {
ECMAScript if the third argument is omitted) and executed in the scope of
the <a href="#browsing1">browsing context</a> associated with the <code><a
href="#window">Window</a></code> object on which the <code
title=setTimeout><a href="#settimeout">setTimeout()</a></code> method was
invoked.
title=setTimeout>setTimeout()</code> method was invoked.

<p class=big-issue>Need to define <var title="">language</var> values.

<p>The <dfn id=setinterval...><code>setInterval(...)</code></dfn> variants
must work in the same way as the <code><a
href="#settimeout">setTimeout</a></code> variants except that if <var
title="">timeout</var> is a value greater than zero, the <var
title="">handler</var> or <code><a href="#code">code</a></code> must be
invoked again every <var title="">timeout</var> milliseconds, not just the
once.</p>
<!-- so setInterval(x) and setInterval(x, 0) are
equivalent to setTimeout(x) and setTimeout(x, 0) respectively -->

<p>The <dfn id=cleartimeout><code>clearTimeout()</code></dfn> and <dfn
id=clearinterval><code>clearInterval()</code></dfn> methods take one
integer (the value returned by <code><a
href="#settimeout">setTimeout</a></code> and <code><a
href="#setinterval...">setInterval</a></code> respectively) and must
cancel the specified timeout. When called with a value that does not
correspond to an active timeout or interval, the methods must return
without doing anything.
<p>The <dfn id=setinterval...
title=dom-windowtimers-setInterval><code>setInterval(...)</code></dfn>
variants must work in the same way as the <code>setTimeout</code> variants
except that if <var title="">timeout</var> is a value greater than zero,
the <var title="">handler</var> or <code><a href="#code">code</a></code>
must be invoked again every <var title="">timeout</var> milliseconds, not
just the once.</p>
<!-- so
setInterval(x) and setInterval(x, 0) are equivalent to setTimeout(x)
and setTimeout(x, 0) respectively -->

<p>The <dfn id=cleartimeout
title=dom-windowtimers-clearTimeout><code>clearTimeout()</code></dfn> and
<dfn id=clearinterval
title=dom-windowtimers-clearInterval><code>clearInterval()</code></dfn>
methods take one integer (the value returned by <code>setTimeout</code>
and <code>setInterval</code> respectively) and must cancel the specified
timeout. When called with a value that does not correspond to an active
timeout or interval, the methods must return without doing anything.

<p>Timeouts must never fire while another script is executing. (Thus the
HTML scripting model is strictly single-threaded and not reentrant.)
HTML scripting model is strictly single-threaded and not reentrant.)</p>
<!-- XXX queue -->

<h2 class=no-num id=index>Index</h2>

Expand Down
91 changes: 49 additions & 42 deletions source
Expand Up @@ -27736,12 +27736,17 @@ never reset. This is nice and consistent.)

<p>The <code>AbstractView</code> object of <span title="default
view">default views</span> must also implement the
<code>Window</code> object.</p>
<code>Window</code> and <code>WindowBrowsingContext</code>
objects.</p>

<pre class="idl">[NoInterfaceObject] interface <dfn>Window</dfn> {
// the current browsing context
// self-reference
readonly attribute <span>Window</span> <span title="dom-window">window</span>;
readonly attribute <span>Window</span> <span title="dom-self">self</span>;
};

[NoInterfaceObject] interface <dfn>WindowBrowsingContext</dfn> {
// the current browsing context
attribute DOMString <span title="dom-name">name</span>;
[PutForwards=href] readonly attribute <span>Location</span> <span title="dom-document-location">location</span>;
readonly attribute <span>History</span> <span title="dom-history">history</span>;
Expand Down Expand Up @@ -48574,40 +48579,37 @@ xh|section xh|section xh|section xh|section xh|section xh|h1 { /* same styles as

<h3 id="timers">Timers</h3>

<p>This section is expected to be moved to the Window Object
specification in due course.</p>
<p class="big-issue">This section is expected to be moved to the
Window Object specification in due course.</p>

<pre class="idl">
[NoInterfaceObject] interface <dfn>WindowTimers</dfn> {
<p>Objects that implement the <code>Window</code> interface must
also implement the <code>WindowTimers</code> interface:</p>

<pre class="idl">[NoInterfaceObject] interface <dfn>WindowTimers</dfn> {
// timers
long <span>setTimeout</span>(in <span>TimeoutHandler</span> handler, in long timeout);
long <span>setTimeout</span>(in <span>TimeoutHandler</span> handler, in long timeout, <var title="">arguments...</var>);
long <span>setTimeout</span>(in DOMString code, in long timeout);
long <span>setTimeout</span>(in DOMString code, in long timeout, in DOMString language);
void <span>clearTimeout</span>(in long handle);
long <span>setInterval</span>(in <span>TimeoutHandler</span> handler, in long timeout);
long <span>setInterval</span>(in <span>TimeoutHandler</span> handler, in long timeout, <var title="">arguments...</var>);
long <span>setInterval</span>(in DOMString code, in long timeout);
long <span>setInterval</span>(in DOMString code, in long timeout, in DOMString language);
void <span>clearInterval</span>(in long handle);
long <span title="dom-windowtimers-setTimeout">setTimeout</span>(in <span>TimeoutHandler</span> handler, in long timeout);
long <span title="dom-windowtimers-setTimeout">setTimeout</span>(in <span>TimeoutHandler</span> handler, in long timeout, <var title="">arguments...</var>);
long <span title="dom-windowtimers-setTimeout">setTimeout</span>(in DOMString code, in long timeout);
long <span title="dom-windowtimers-setTimeout">setTimeout</span>(in DOMString code, in long timeout, in DOMString language);
void <span title="dom-windowtimers-clearTimeout">clearTimeout</span>(in long handle);
long <span title="dom-windowtimers-setInterval">setInterval</span>(in <span>TimeoutHandler</span> handler, in long timeout);
long <span title="dom-windowtimers-setInterval">setInterval</span>(in <span>TimeoutHandler</span> handler, in long timeout, <var title="">arguments...</var>);
long <span title="dom-windowtimers-setInterval">setInterval</span>(in DOMString code, in long timeout);
long <span title="dom-windowtimers-setInterval">setInterval</span>(in DOMString code, in long timeout, in DOMString language);
void <span title="dom-windowtimers-clearInterval">clearInterval</span>(in long handle);
};

interface <dfn>TimeoutHandler</dfn> {
void handleEvent([Variadic] in any args);
};
</pre>

<p>The <code>WindowTimers</code> interface must be obtainable from
any <code>Window</code> object using binding-specific casting
methods.</p>

<p class="big-issue">Actually even better would be to just mix it
straight into Window somehow.</p>

<p>The <code>setTimeout</code> and <code>setInterval</code> methods
allow authors to schedule timer-based events.</p>
<p>The <code title="dom-windowtimers-setTimeout">setTimeout</code>
and <code title="dom-windowtimers-setInterval">setInterval</code>
methods allow authors to schedule timer-based events.</p>

<p>The <dfn title="setTimeout"><code>setTimeout(<var
<p>The <dfn
title="dom-windowtimers-setTimeout"><code>setTimeout(<var
title="">handler</var>, <var title="">timeout</var>[, <var
title="">arguments...</var>])</code></dfn> method takes a reference
to a <code>TimeoutHandler</code> object and a length of time in
Expand All @@ -48630,27 +48632,32 @@ interface <dfn>TimeoutHandler</dfn> {
which the <code title="setTimeout">setTimeout()</code> method was
invoked.</p>

<p class="big-issue">Need to define <var title="">language</var> values.</p>
<p class="big-issue">Need to define <var title="">language</var>
values.</p>

<p>The <dfn><code>setInterval(...)</code></dfn> variants must work
in the same way as the <code>setTimeout</code> variants except that
if <var title="">timeout</var> is a value greater than zero, the
<var title="">handler</var> or <code>code</code> must be invoked
again every <var title="">timeout</var> milliseconds, not just the
once.</p> <!-- so setInterval(x) and setInterval(x, 0) are
equivalent to setTimeout(x) and setTimeout(x, 0) respectively -->
<p>The <dfn
title="dom-windowtimers-setInterval"><code>setInterval(...)</code></dfn>
variants must work in the same way as the <code>setTimeout</code>
variants except that if <var title="">timeout</var> is a value
greater than zero, the <var title="">handler</var> or
<code>code</code> must be invoked again every <var
title="">timeout</var> milliseconds, not just the once.</p> <!-- so
setInterval(x) and setInterval(x, 0) are equivalent to setTimeout(x)
and setTimeout(x, 0) respectively -->

<p>The <dfn><code>clearTimeout()</code></dfn> and
<dfn><code>clearInterval()</code></dfn> methods take one integer (the
value returned by <code>setTimeout</code> and
<code>setInterval</code> respectively) and must cancel the specified
timeout. When called with a value that does not correspond to an
active timeout or interval, the methods must return without doing
anything.</p>
<p>The <dfn
title="dom-windowtimers-clearTimeout"><code>clearTimeout()</code></dfn>
and <dfn
title="dom-windowtimers-clearInterval"><code>clearInterval()</code></dfn>
methods take one integer (the value returned by
<code>setTimeout</code> and <code>setInterval</code> respectively)
and must cancel the specified timeout. When called with a value that
does not correspond to an active timeout or interval, the methods
must return without doing anything.</p>

<p>Timeouts must never fire while another script is executing. (Thus
the HTML scripting model is strictly single-threaded and not
reentrant.)</p>
reentrant.)</p><!-- XXX queue -->



Expand Down

0 comments on commit 1b77444

Please sign in to comment.