Skip to content

Commit

Permalink
[] (0) Fix the spec to use the [Constructor] syntax from WebIDL to de…
Browse files Browse the repository at this point in the history
…fine constructors.

git-svn-id: http://svn.whatwg.org/webapps@1916 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Jul 23, 2008
1 parent 4ade426 commit 07e012a
Show file tree
Hide file tree
Showing 2 changed files with 150 additions and 143 deletions.
174 changes: 87 additions & 87 deletions index
Original file line number Diff line number Diff line change
Expand Up @@ -901,16 +901,19 @@
<li><a href="#the-option"><span class=secno>4.9.9 </span>The
<code>option</code> element</a>

<li><a href="#the-textarea"><span class=secno>4.9.10 </span>The
<li><a href="#constructors"><span class=secno>4.9.10
</span>Constructors</a>

<li><a href="#the-textarea"><span class=secno>4.9.11 </span>The
<code>textarea</code> element</a>

<li><a href="#the-output"><span class=secno>4.9.11 </span>The
<li><a href="#the-output"><span class=secno>4.9.12 </span>The
<code>output</code> element</a>

<li><a href="#processing0"><span class=secno>4.9.12 </span>Processing
<li><a href="#processing0"><span class=secno>4.9.13 </span>Processing
model</a>
<ul class=toc>
<li><a href="#form-submission"><span class=secno>4.9.12.1.
<li><a href="#form-submission"><span class=secno>4.9.13.1.
</span>Form submission</a>
</ul>
</ul>
Expand Down Expand Up @@ -1105,13 +1108,10 @@
<ul class=toc>
<li><a href="#security3"><span class=secno>5.2.1 </span>Security</a>

<li><a href="#constructors"><span class=secno>5.2.2
</span>Constructors</a>

<li><a href="#apis-for"><span class=secno>5.2.3 </span>APIs for
<li><a href="#apis-for"><span class=secno>5.2.2 </span>APIs for
creating and navigating browsing contexts by name</a>

<li><a href="#accessing"><span class=secno>5.2.4 </span>Accessing
<li><a href="#accessing"><span class=secno>5.2.3 </span>Accessing
other browsing contexts</a>
</ul>

Expand Down Expand Up @@ -15220,7 +15220,10 @@ And the mome raths outgrabe.&lt;/p>

<dd>
<pre
class=idl>interface <dfn id=htmlimageelement>HTMLImageElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
class=idl>[NamedConstructor=<a href="#image" title=dom-image>Image</a>(),
NamedConstructor=<a href="#image0" title=dom-image-w>Image</a>(in unsigned long width),
NamedConstructor=<a href="#image1" title=dom-image-wh>Image</a>(in unsigned long width, in unsigned long height)]
interface <dfn id=htmlimageelement>HTMLImageElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
attribute DOMString <a href="#alt0" title=dom-img-alt>alt</a>;
attribute DOMString <a href="#src0" title=dom-img-src>src</a>;
attribute DOMString <a href="#usemap" title=dom-img-useMap>useMap</a>;
Expand All @@ -15229,11 +15232,6 @@ And the mome raths outgrabe.&lt;/p>
attribute long <a href="#height" title=dom-img-height>height</a>;
readonly attribute boolean <a href="#complete" title=dom-img-complete>complete</a>;
};</pre>

<p class=note>An instance of <code><a
href="#htmlimageelement">HTMLImageElement</a></code> can be obtained
using the <code title=dom-image><a href="#image0">Image</a></code>
constructor.</p>
</dl>

<p>An <code><a href="#img">img</a></code> element represents an image.
Expand Down Expand Up @@ -15711,7 +15709,7 @@ The island of Shalott.&lt;/p></pre>

<p>The <code title=attr-hyperlink-usemap><a
href="#usemap1">usemap</a></code> attribute, if present, can indicate that
the image has an associated <a href="#image">image map</a>.
the image has an associated <a href="#image2">image map</a>.

<p>The <dfn id=ismap title=attr-img-ismap><code>ismap</code></dfn>
attribute, when used on an element that is a descendant of an <code><a
Expand Down Expand Up @@ -15757,6 +15755,23 @@ The island of Shalott.&lt;/p></pre>
href="#complete">complete</a></code> can change while a script is
executing.

<p>Three constructors are provided for creating <code><a
href="#htmlimageelement">HTMLImageElement</a></code> objects (in addition
to the factory methods from DOM Core such as <code
title="">createElement()</code>): <dfn id=image
title=dom-image><code>Image()</code></dfn>, <dfn id=image0
title=dom-image-w><code>Image(<var title="">width</var>)</code></dfn>, and
<dfn id=image1 title=dom-image-wh><code>Image(<var title="">width</var>,
<var title="">height</var>)</code></dfn>. When invoked as constructors,
these must return a new <code><a
href="#htmlimageelement">HTMLImageElement</a></code> object (a new
<code><a href="#img">img</a></code> element). If the <var
title="">width</var> argument is present, the new object's <code
title=attr-img-width>width</code> content attribute must be set to <var
title="">width</var>. If the <var title="">height</var> argument is also
present, the new object's <code title=attr-img-height>height</code>
content attribute must be set to <var title="">height</var>.

<div class=example>
<p>A single image can have different appropriate alternative text
depending on the context.</p>
Expand Down Expand Up @@ -16751,7 +16766,7 @@ the time Marco had stuck his tongue out...&lt;/p></pre>
<p>The <code title=attr-hyperlink-usemap><a
href="#usemap1">usemap</a></code> attribute, if present while the <code><a
href="#object">object</a></code> element represents an image, can indicate
that the object has an associated <a href="#image">image map</a>. The
that the object has an associated <a href="#image2">image map</a>. The
attribute must be ignored if the <code><a href="#object">object</a></code>
element doesn't represent an image.

Expand Down Expand Up @@ -17235,7 +17250,9 @@ the time Marco had stuck his tongue out...&lt;/p></pre>

<dd>
<pre
class=idl>interface <dfn id=htmlaudioelement>HTMLAudioElement</dfn> : <a href="#htmlmediaelement">HTMLMediaElement</a> {
class=idl>[NamedConstructor=<a href="#audio2" title=dom-Audio>Audio</a>(),
NamedConstructor=<a href="#audio3" title=dom-Audio-u>Audio</a>(in DOMString url)]
interface <dfn id=htmlaudioelement>HTMLAudioElement</dfn> : <a href="#htmlmediaelement">HTMLMediaElement</a> {
// no members
};</pre>
</dl>
Expand Down Expand Up @@ -17282,6 +17299,21 @@ the time Marco had stuck his tongue out...&lt;/p></pre>
href="#actively">actively playing</a>, audio must not play for the
element.

<p>Two constructors are provided for creating <code><a
href="#htmlaudioelement">HTMLAudioElement</a></code> objects (in addition
to the factory methods from DOM Core such as <code
title="">createElement()</code>): <dfn id=audio2
title=dom-Audio><code>Audio()</code></dfn> and <dfn id=audio3
title=dom-Audio-u><code>Audio(<var title="">url</var>)</code></dfn>. When
invoked as constructors, these must return a new <code><a
href="#htmlaudioelement">HTMLAudioElement</a></code> object (a new
<code><a href="#audio1">audio</a></code> element). If the <var
title="">src</var> argument is present, the object created must have its
<code title=dom-media-src><a href="#src8">src</a></code> content attribute
set to the provided value, and the user agent must invoke the <code
title=dom-media-load><a href="#load">load()</a></code> method on the
object before returning.

<h5 id=audio0><span class=secno>4.7.8.1. </span>Audio codecs for <code><a
href="#audio1">audio</a></code> elements</h5>

Expand Down Expand Up @@ -22476,7 +22508,7 @@ function AddCloud(data, x, y) { ... }</pre>

<p>The <code><a href="#map">map</a></code> element, in conjunction with any
<code><a href="#area">area</a></code> element descendants, defines an <a
href="#image">image map</a>.
href="#image2">image map</a>.

<p>The <dfn id=name7 title=attr-map-name><code>name</code></dfn> attribute
gives the map a name so that it can be referenced. The attribute must be
Expand All @@ -22495,7 +22527,7 @@ function AddCloud(data, x, y) { ... }</pre>
<code>Document</code> node, whose filter matches only <code><a
href="#img">img</a></code> and <code><a href="#object">object</a></code>
elements that are associated with this <code><a href="#map">map</a></code>
element according to the <a href="#image">image map</a> processing model.
element according to the <a href="#image2">image map</a> processing model.

<p>The DOM attribute <dfn id=name8
title=dom-map-name><code>name</code></dfn> must <a
Expand Down Expand Up @@ -22562,7 +22594,7 @@ function AddCloud(data, x, y) { ... }</pre>

<p>The <code><a href="#area">area</a></code> element represents either a
hyperlink with some text and a corresponding area on an <a
href="#image">image map</a>, or a dead area on an image map.
href="#image2">image map</a>, or a dead area on an image map.

<p>If the <code><a href="#area">area</a></code> element has an <code
title=attr-hyperlink-href><a href="#href6">href</a></code> attribute, then
Expand Down Expand Up @@ -22653,7 +22685,7 @@ function AddCloud(data, x, y) { ... }</pre>
integers</a>. This attribute gives the coordinates for the shape described
by the <code title=attr-area-shape><a href="#shape">shape</a></code>
attribute. The processing for this attribute is described as part of the
<a href="#image">image map</a> processing model.
<a href="#image2">image map</a> processing model.

<p>In the <a href="#circle" title=attr-area-shape-circle>circle state</a>,
<code><a href="#area">area</a></code> elements must have a <code
Expand Down Expand Up @@ -22768,7 +22800,7 @@ function AddCloud(data, x, y) { ... }</pre>
http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E%0D%0A%3Cp%3E%3Cimg%20src%3D%22http%3A//hixie.ch/resources/images/astrophy/128%22%20usemap%3D%23a%3E%0D%0A%3Cmap%20name%3Da%3E%3Carea%20shape%3Dcirc%20coords%3D%2220%2C20%2C10%25%22%20href%3D%23%3E%3Carea%20shape%3Dcirc%20coords%3D%2220%2C20%2C10%22%20href%3D%23%3E%3C/map%3E%0D%0A%3Cscript%3Edocument.write%28document.getElementsByTagName%28%27area%27%29%5B0%5D.coords%29%3C/script%3E
-->

<p>An <dfn id=image>image map</dfn> allows geometric areas on an image to
<p>An <dfn id=image2>image map</dfn> allows geometric areas on an image to
be associated with <a href="#hyperlinks" title=hyperlink>hyperlinks</a>.

<p>An image, in the form of an <code><a href="#img">img</a></code> element
Expand Down Expand Up @@ -25008,19 +25040,40 @@ function AddCloud(data, x, y) { ... }</pre>
<h4 id=the-option><span class=secno>4.9.9 </span>The <code>option</code>
element</h4>

<h4 id=the-textarea><span class=secno>4.9.10 </span>The
<h4 id=constructors><span class=secno>4.9.10 </span>Constructors</h4>

<p>All <code><a href="#window">Window</a></code> objects must provide the
following constructors:

<dl>
<dt><dfn id=option title=dom-option><code>Option()</code></dfn>

<dt><dfn id=optionin title=dom-option-n><code>Option(in DOMString <var
title="">name</var>)</code></dfn>

<dt><dfn id=optionin0 title=dom-option-nv><code>Option(in DOMString <var
title="">name</var>, in DOMString <var title="">value</var>)</code></dfn>

<dd>
<p>When invoked as constructors, these must return a new
<code>HTMLOptionElement</code> object (a new <code>option</code>
element). <span class=big-issue>need to define argument
processing</span>
</dl>

<h4 id=the-textarea><span class=secno>4.9.11 </span>The
<code>textarea</code> element</h4>

<h4 id=the-output><span class=secno>4.9.11 </span>The <code>output</code>
<h4 id=the-output><span class=secno>4.9.12 </span>The <code>output</code>
element</h4>

<h4 id=processing0><span class=secno>4.9.12 </span>Processing model</h4>
<h4 id=processing0><span class=secno>4.9.13 </span>Processing model</h4>

<p class=big-issue>See <a
href="http://www.whatwg.org/specs/web-forms/current-work/#extend-form-controls">WF2</a>
for now

<h5 id=form-submission><span class=secno>4.9.12.1. </span>Form submission</h5>
<h5 id=form-submission><span class=secno>4.9.13.1. </span>Form submission</h5>

<p class=big-issue>See <a
href="http://www.whatwg.org/specs/web-forms/current-work/#form-submission">WF2</a>
Expand Down Expand Up @@ -30837,61 +30890,7 @@ never reset. This is nice and consistent.)
title=dom-location><a href="#location1">location</a></code> object's
setter.

<h4 id=constructors><span class=secno>5.2.2 </span>Constructors</h4>

<p>All <code><a href="#window">Window</a></code> objects must provide the
following constructors:

<dl>
<dt><dfn id=audio2 title=dom-audio><code>Audio()</code></dfn>

<dt><dfn id=audio3 title=dom-audio-s><code>Audio(<var
title="">src</var>)</code></dfn>

<dd>
<p>When invoked as constructors, these must return a new <code><a
href="#htmlaudioelement">HTMLAudioElement</a></code> object (a new
<code><a href="#audio1">audio</a></code> element). If the <var
title=src>src</var> argument is present, the object created must have
its <code title=dom-media-src><a href="#src8">src</a></code> content
attribute set to the provided value, and the user agent must invoke the
<code title=dom-media-load><a href="#load">load()</a></code> method on
the object before returning.

<dt><dfn id=image0 title=dom-image><code>Image()</code></dfn>

<dt><dfn id=imagein title=dom-image-w><code>Image(in unsigned long <var
title="">w</var>)</code></dfn>

<dt><dfn id=imagein0 title=dom-image-wh><code>Image(in unsigned long <var
title="">w</var>, in unsigned long <var title="">h</var>)</code></dfn>

<dd>
<p>When invoked as constructors, these must return a new <code><a
href="#htmlimageelement">HTMLImageElement</a></code> object (a new
<code><a href="#img">img</a></code> element). If the <var
title="">h</var> argument is present, the new object's <code
title=attr-img-height>height</code> content attribute must be set to
<var title="">h</var>. If the <var title="">w</var> argument is present,
the new object's <code title=attr-img-width>width</code> content
attribute must be set to <var title="">w</var>.

<dt><dfn id=option title=dom-option><code>Option()</code></dfn>

<dt><dfn id=optionin title=dom-option-n><code>Option(in DOMString <var
title="">name</var>)</code></dfn>

<dt><dfn id=optionin0 title=dom-option-nv><code>Option(in DOMString <var
title="">name</var>, in DOMString <var title="">value</var>)</code></dfn>

<dd>
<p>When invoked as constructors, these must return a new
<code>HTMLOptionElement</code> object (a new <code>option</code>
element). <span class=big-issue>need to define argument
processing</span>
</dl>

<h4 id=apis-for><span class=secno>5.2.3 </span>APIs for creating and
<h4 id=apis-for><span class=secno>5.2.2 </span>APIs for creating and
navigating browsing contexts by name</h4>

<p>The <dfn id=open2 title=dom-open><code>open()</code></dfn> method on
Expand Down Expand Up @@ -30974,7 +30973,7 @@ never reset. This is nice and consistent.)
<p class=note>The name <a href="#resetBCName">gets reset</a> when the
browsing context is navigated to another domain.

<h4 id=accessing><span class=secno>5.2.4 </span>Accessing other browsing
<h4 id=accessing><span class=secno>5.2.3 </span>Accessing other browsing
contexts</h4>

<p>The <dfn id=length7 title=dom-length><code>length</code></dfn> DOM
Expand Down Expand Up @@ -41838,9 +41837,9 @@ data:&nbsp;test</pre>
<h4 id=the-websocket><span class=secno>7.3.2 </span>The <code><a
href="#websocket0">WebSocket</a></code> interface</h4>

<pre class=idl>interface <dfn id=websocket0>WebSocket</dfn> {
// constructor
[<a href="#websocket1" title=dom-WebSocket>Constructor</a>] <a href="#websocket0">WebSocket</a>(in DOMString url);
<pre class=idl>
[<a href="#websocket1" title=dom-WebSocket>Constructor</a>(in DOMString url)]
interface <dfn id=websocket0>WebSocket</dfn> {
readonly attribute DOMString <a href="#url2" title=dom-WebSocket-URL>URL</a>;

// ready state
Expand Down Expand Up @@ -42945,7 +42944,8 @@ function receiver(e) {
<h4 id=message><span class=secno>7.5.2 </span>Message channels</h4>

<pre
class=idl>[<span title=dom-Pipe>Constructor</span>] interface <dfn id=messagechannel>MessageChannel</dfn> {
class=idl>[<a href="#messagechannel0" title=dom-MessageChannel>Constructor</a>]
interface <dfn id=messagechannel>MessageChannel</dfn> {
readonly attribute <a href="#messageport0">MessagePort</a> <a href="#port1" title=dom-channel-port1>port1</a>;
readonly attribute <a href="#messageport0">MessagePort</a> <a href="#port2" title=dom-channel-port2>port2</a>;
};</pre>
Expand Down
Loading

0 comments on commit 07e012a

Please sign in to comment.