Skip to content

Commit

Permalink
[e] (0) Use union types in the IDL blocks where possible.
Browse files Browse the repository at this point in the history
Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=16040
Affected topics: Canvas, DOM APIs, HTML, WebSocket API

git-svn-id: http://svn.whatwg.org/webapps@7002 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Feb 21, 2012
1 parent e0d4e77 commit 0f6653d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 69 deletions.
31 changes: 8 additions & 23 deletions complete.html
Expand Up @@ -240,7 +240,7 @@

<header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
<hgroup><h1 class=allcaps>HTML</h1>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 16 February 2012</h2>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 21 February 2012</h2>
</hgroup><dl><dt><strong>Web developer edition:</strong></dt>
<dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
<dt>Multiple-page version:</dt>
Expand Down Expand Up @@ -9085,10 +9085,7 @@ <h5 id=htmloptionscollection-0><span class=secno>2.8.2.3 </span>HTMLOptionsColle
attribute unsigned long <a href=#dom-htmloptionscollection-length title=dom-HTMLOptionsCollection-length>length</a>; // overrides inherited length
legacycaller getter object? <a href=#dom-htmloptionscollection-nameditem title=dom-HTMLOptionsCollection-namedItem>namedItem</a>(DOMString name); // overrides inherited namedItem()
<a href=#dom-htmloptionscollection-setter title=dom-HTMLOptionsCollection-setter>setter creator</a> void (unsigned long index, <a href=#htmloptionelement>HTMLOptionElement</a> option);
void <a href=#dom-htmloptionscollection-add title=dom-HTMLOptionsCollection-add>add</a>(<a href=#htmloptionelement>HTMLOptionElement</a> element, optional <a href=#htmlelement>HTMLElement</a>? before);
void <a href=#dom-htmloptionscollection-add title=dom-HTMLOptionsCollection-add>add</a>(<a href=#htmloptgroupelement>HTMLOptGroupElement</a> element, optional <a href=#htmlelement>HTMLElement</a>? before);
void <a href=#dom-htmloptionscollection-add title=dom-HTMLOptionsCollection-add>add</a>(<a href=#htmloptionelement>HTMLOptionElement</a> element, long before);
void <a href=#dom-htmloptionscollection-add title=dom-HTMLOptionsCollection-add>add</a>(<a href=#htmloptgroupelement>HTMLOptGroupElement</a> element, long before);
void <a href=#dom-htmloptionscollection-add title=dom-HTMLOptionsCollection-add>add</a>((<a href=#htmloptionelement>HTMLOptionElement</a> or <a href=#htmloptgroupelement>HTMLOptGroupElement</a>) element, optional (<a href=#htmlelement>HTMLElement</a> or long)? before = null);
void <a href=#dom-htmloptionscollection-remove title=dom-HTMLOptionsCollection-remove>remove</a>(long index);
attribute long <a href=#dom-htmloptionscollection-selectedindex title=dom-HTMLOptionsCollection-selectedIndex>selectedIndex</a>;
};</pre>
Expand Down Expand Up @@ -34897,9 +34894,7 @@ <h5 id=2dcontext><span class=secno>4.8.11.1 </span>The 2D context</h5>
attribute any <a href=#dom-context-2d-fillstyle title=dom-context-2d-fillStyle>fillStyle</a>; // (default black)
<a href=#canvasgradient>CanvasGradient</a> <a href=#dom-context-2d-createlineargradient title=dom-context-2d-createLinearGradient>createLinearGradient</a>(double x0, double y0, double x1, double y1);
<a href=#canvasgradient>CanvasGradient</a> <a href=#dom-context-2d-createradialgradient title=dom-context-2d-createRadialGradient>createRadialGradient</a>(double x0, double y0, double r0, double x1, double y1, double r1);
<a href=#canvaspattern>CanvasPattern</a> <a href=#dom-context-2d-createpattern title=dom-context-2d-createPattern>createPattern</a>(<a href=#htmlimageelement>HTMLImageElement</a> image, DOMString repetition);
<a href=#canvaspattern>CanvasPattern</a> <a href=#dom-context-2d-createpattern title=dom-context-2d-createPattern>createPattern</a>(<a href=#htmlcanvaselement>HTMLCanvasElement</a> image, DOMString repetition);
<a href=#canvaspattern>CanvasPattern</a> <a href=#dom-context-2d-createpattern title=dom-context-2d-createPattern>createPattern</a>(<a href=#htmlvideoelement>HTMLVideoElement</a> image, DOMString repetition);
<a href=#canvaspattern>CanvasPattern</a> <a href=#dom-context-2d-createpattern title=dom-context-2d-createPattern>createPattern</a>((<a href=#htmlimageelement>HTMLImageElement</a> or <a href=#htmlcanvaselement>HTMLCanvasElement</a> or <a href=#htmlvideoelement>HTMLVideoElement</a>) image, DOMString repetition);

// line caps/joins
attribute double <a href=#dom-context-2d-linewidth title=dom-context-2d-lineWidth>lineWidth</a>; // (default 1)
Expand Down Expand Up @@ -34947,15 +34942,9 @@ <h5 id=2dcontext><span class=secno>4.8.11.1 </span>The 2D context</h5>
<a href=#textmetrics>TextMetrics</a> <a href=#dom-context-2d-measuretext title=dom-context-2d-measureText>measureText</a>(DOMString text);

// drawing images
void <a href=#dom-context-2d-drawimage title=dom-context-2d-drawImage>drawImage</a>(<a href=#htmlimageelement>HTMLImageElement</a> image, double dx, double dy);
void <a href=#dom-context-2d-drawimage title=dom-context-2d-drawImage>drawImage</a>(<a href=#htmlimageelement>HTMLImageElement</a> image, double dx, double dy, double dw, double dh);
void <a href=#dom-context-2d-drawimage title=dom-context-2d-drawImage>drawImage</a>(<a href=#htmlimageelement>HTMLImageElement</a> image, double sx, double sy, double sw, double sh, double dx, double dy, double dw, double dh);
void <a href=#dom-context-2d-drawimage title=dom-context-2d-drawImage>drawImage</a>(<a href=#htmlcanvaselement>HTMLCanvasElement</a> image, double dx, double dy);
void <a href=#dom-context-2d-drawimage title=dom-context-2d-drawImage>drawImage</a>(<a href=#htmlcanvaselement>HTMLCanvasElement</a> image, double dx, double dy, double dw, double dh);
void <a href=#dom-context-2d-drawimage title=dom-context-2d-drawImage>drawImage</a>(<a href=#htmlcanvaselement>HTMLCanvasElement</a> image, double sx, double sy, double sw, double sh, double dx, double dy, double dw, double dh);
void <a href=#dom-context-2d-drawimage title=dom-context-2d-drawImage>drawImage</a>(<a href=#htmlvideoelement>HTMLVideoElement</a> image, double dx, double dy);
void <a href=#dom-context-2d-drawimage title=dom-context-2d-drawImage>drawImage</a>(<a href=#htmlvideoelement>HTMLVideoElement</a> image, double dx, double dy, double dw, double dh);
void <a href=#dom-context-2d-drawimage title=dom-context-2d-drawImage>drawImage</a>(<a href=#htmlvideoelement>HTMLVideoElement</a> image, double sx, double sy, double sw, double sh, double dx, double dy, double dw, double dh);
void <a href=#dom-context-2d-drawimage title=dom-context-2d-drawImage>drawImage</a>((<a href=#htmlimageelement>HTMLImageElement</a> or <a href=#htmlcanvaselement>HTMLCanvasElement</a> or <a href=#htmlvideoelement>HTMLVideoElement</a>) image, double dx, double dy);
void <a href=#dom-context-2d-drawimage title=dom-context-2d-drawImage>drawImage</a>((<a href=#htmlimageelement>HTMLImageElement</a> or <a href=#htmlcanvaselement>HTMLCanvasElement</a> or <a href=#htmlvideoelement>HTMLVideoElement</a>) image, double dx, double dy, double dw, double dh);
void <a href=#dom-context-2d-drawimage title=dom-context-2d-drawImage>drawImage</a>((<a href=#htmlimageelement>HTMLImageElement</a> or <a href=#htmlcanvaselement>HTMLCanvasElement</a> or <a href=#htmlvideoelement>HTMLVideoElement</a>) image, double sx, double sy, double sw, double sh, double dx, double dy, double dw, double dh);

// pixel manipulation
<a href=#imagedata>ImageData</a> <a href=#dom-context-2d-createimagedata title=dom-context-2d-createImageData>createImageData</a>(double sw, double sh);
Expand Down Expand Up @@ -48605,10 +48594,7 @@ <h4 id=the-select-element><span class=secno>4.10.9 </span>The <dfn><code>select<
attribute unsigned long <a href=#dom-select-length title=dom-select-length>length</a>;
getter <a href=#element>Element</a> <a href=#dom-select-item title=dom-select-item>item</a>(unsigned long index);
object <a href=#dom-select-nameditem title=dom-select-namedItem>namedItem</a>(DOMString name);
void <a href=#dom-select-add title=dom-select-add>add</a>(<a href=#htmloptionelement>HTMLOptionElement</a> element, optional <a href=#htmlelement>HTMLElement</a>? before);
void <a href=#dom-select-add title=dom-select-add>add</a>(<a href=#htmloptgroupelement>HTMLOptGroupElement</a> element, optional <a href=#htmlelement>HTMLElement</a>? before);
void <a href=#dom-select-add title=dom-select-add>add</a>(<a href=#htmloptionelement>HTMLOptionElement</a> element, long before);
void <a href=#dom-select-add title=dom-select-add>add</a>(<a href=#htmloptgroupelement>HTMLOptGroupElement</a> element, long before);
void <a href=#dom-select-add title=dom-select-add>add</a>((<a href=#htmloptionelement>HTMLOptionElement</a> or <a href=#htmloptgroupelement>HTMLOptGroupElement</a>) element, optional (<a href=#htmlelement>HTMLElement</a> or long)? before = null);
void <a href=#dom-select-remove title=dom-select-remove>remove</a>(long index);
<a href=#dom-htmloptionscollection-setter title=dom-HTMLOptionsCollection-setter>setter creator</a> void (unsigned long index, <a href=#htmloptionelement>HTMLOptionElement</a> option);

Expand Down Expand Up @@ -77950,8 +77936,7 @@ <h4 id=network-intro><span class=secno>10.3.1 </span>Introduction</h4>

<h4 id=the-websocket-interface><span class=secno>10.3.2 </span>The <code><a href=#websocket>WebSocket</a></code> interface</h4>

<pre class=idl>[<a href=#dom-websocket title=dom-WebSocket>Constructor</a>(DOMString url, optional DOMString protocols),
<a href=#dom-websocket title=dom-WebSocket>Constructor</a>(DOMString url, optional DOMString[] protocols)]
<pre class=idl>[<a href=#dom-websocket title=dom-WebSocket>Constructor</a>(DOMString url, optional (DOMString or DOMString[]) protocols)]
interface <dfn id=websocket>WebSocket</dfn> : <a href=#eventtarget>EventTarget</a> {
readonly attribute DOMString <a href=#dom-websocket-url title=dom-WebSocket-url>url</a>;

Expand Down
31 changes: 8 additions & 23 deletions index
Expand Up @@ -240,7 +240,7 @@

<header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
<hgroup><h1 class=allcaps>HTML</h1>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 16 February 2012</h2>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 21 February 2012</h2>
</hgroup><dl><dt><strong>Web developer edition:</strong></dt>
<dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
<dt>Multiple-page version:</dt>
Expand Down Expand Up @@ -9085,10 +9085,7 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E..
attribute unsigned long <a href=#dom-htmloptionscollection-length title=dom-HTMLOptionsCollection-length>length</a>; // overrides inherited length
legacycaller getter object? <a href=#dom-htmloptionscollection-nameditem title=dom-HTMLOptionsCollection-namedItem>namedItem</a>(DOMString name); // overrides inherited namedItem()
<a href=#dom-htmloptionscollection-setter title=dom-HTMLOptionsCollection-setter>setter creator</a> void (unsigned long index, <a href=#htmloptionelement>HTMLOptionElement</a> option);
void <a href=#dom-htmloptionscollection-add title=dom-HTMLOptionsCollection-add>add</a>(<a href=#htmloptionelement>HTMLOptionElement</a> element, optional <a href=#htmlelement>HTMLElement</a>? before);
void <a href=#dom-htmloptionscollection-add title=dom-HTMLOptionsCollection-add>add</a>(<a href=#htmloptgroupelement>HTMLOptGroupElement</a> element, optional <a href=#htmlelement>HTMLElement</a>? before);
void <a href=#dom-htmloptionscollection-add title=dom-HTMLOptionsCollection-add>add</a>(<a href=#htmloptionelement>HTMLOptionElement</a> element, long before);
void <a href=#dom-htmloptionscollection-add title=dom-HTMLOptionsCollection-add>add</a>(<a href=#htmloptgroupelement>HTMLOptGroupElement</a> element, long before);
void <a href=#dom-htmloptionscollection-add title=dom-HTMLOptionsCollection-add>add</a>((<a href=#htmloptionelement>HTMLOptionElement</a> or <a href=#htmloptgroupelement>HTMLOptGroupElement</a>) element, optional (<a href=#htmlelement>HTMLElement</a> or long)? before = null);
void <a href=#dom-htmloptionscollection-remove title=dom-HTMLOptionsCollection-remove>remove</a>(long index);
attribute long <a href=#dom-htmloptionscollection-selectedindex title=dom-HTMLOptionsCollection-selectedIndex>selectedIndex</a>;
};</pre>
Expand Down Expand Up @@ -34897,9 +34894,7 @@ dictionary <dfn id=trackeventinit>TrackEventInit</dfn> : <a href=#eventinit>Even
attribute any <a href=#dom-context-2d-fillstyle title=dom-context-2d-fillStyle>fillStyle</a>; // (default black)
<a href=#canvasgradient>CanvasGradient</a> <a href=#dom-context-2d-createlineargradient title=dom-context-2d-createLinearGradient>createLinearGradient</a>(double x0, double y0, double x1, double y1);
<a href=#canvasgradient>CanvasGradient</a> <a href=#dom-context-2d-createradialgradient title=dom-context-2d-createRadialGradient>createRadialGradient</a>(double x0, double y0, double r0, double x1, double y1, double r1);
<a href=#canvaspattern>CanvasPattern</a> <a href=#dom-context-2d-createpattern title=dom-context-2d-createPattern>createPattern</a>(<a href=#htmlimageelement>HTMLImageElement</a> image, DOMString repetition);
<a href=#canvaspattern>CanvasPattern</a> <a href=#dom-context-2d-createpattern title=dom-context-2d-createPattern>createPattern</a>(<a href=#htmlcanvaselement>HTMLCanvasElement</a> image, DOMString repetition);
<a href=#canvaspattern>CanvasPattern</a> <a href=#dom-context-2d-createpattern title=dom-context-2d-createPattern>createPattern</a>(<a href=#htmlvideoelement>HTMLVideoElement</a> image, DOMString repetition);
<a href=#canvaspattern>CanvasPattern</a> <a href=#dom-context-2d-createpattern title=dom-context-2d-createPattern>createPattern</a>((<a href=#htmlimageelement>HTMLImageElement</a> or <a href=#htmlcanvaselement>HTMLCanvasElement</a> or <a href=#htmlvideoelement>HTMLVideoElement</a>) image, DOMString repetition);

// line caps/joins
attribute double <a href=#dom-context-2d-linewidth title=dom-context-2d-lineWidth>lineWidth</a>; // (default 1)
Expand Down Expand Up @@ -34947,15 +34942,9 @@ dictionary <dfn id=trackeventinit>TrackEventInit</dfn> : <a href=#eventinit>Even
<a href=#textmetrics>TextMetrics</a> <a href=#dom-context-2d-measuretext title=dom-context-2d-measureText>measureText</a>(DOMString text);

// drawing images
void <a href=#dom-context-2d-drawimage title=dom-context-2d-drawImage>drawImage</a>(<a href=#htmlimageelement>HTMLImageElement</a> image, double dx, double dy);
void <a href=#dom-context-2d-drawimage title=dom-context-2d-drawImage>drawImage</a>(<a href=#htmlimageelement>HTMLImageElement</a> image, double dx, double dy, double dw, double dh);
void <a href=#dom-context-2d-drawimage title=dom-context-2d-drawImage>drawImage</a>(<a href=#htmlimageelement>HTMLImageElement</a> image, double sx, double sy, double sw, double sh, double dx, double dy, double dw, double dh);
void <a href=#dom-context-2d-drawimage title=dom-context-2d-drawImage>drawImage</a>(<a href=#htmlcanvaselement>HTMLCanvasElement</a> image, double dx, double dy);
void <a href=#dom-context-2d-drawimage title=dom-context-2d-drawImage>drawImage</a>(<a href=#htmlcanvaselement>HTMLCanvasElement</a> image, double dx, double dy, double dw, double dh);
void <a href=#dom-context-2d-drawimage title=dom-context-2d-drawImage>drawImage</a>(<a href=#htmlcanvaselement>HTMLCanvasElement</a> image, double sx, double sy, double sw, double sh, double dx, double dy, double dw, double dh);
void <a href=#dom-context-2d-drawimage title=dom-context-2d-drawImage>drawImage</a>(<a href=#htmlvideoelement>HTMLVideoElement</a> image, double dx, double dy);
void <a href=#dom-context-2d-drawimage title=dom-context-2d-drawImage>drawImage</a>(<a href=#htmlvideoelement>HTMLVideoElement</a> image, double dx, double dy, double dw, double dh);
void <a href=#dom-context-2d-drawimage title=dom-context-2d-drawImage>drawImage</a>(<a href=#htmlvideoelement>HTMLVideoElement</a> image, double sx, double sy, double sw, double sh, double dx, double dy, double dw, double dh);
void <a href=#dom-context-2d-drawimage title=dom-context-2d-drawImage>drawImage</a>((<a href=#htmlimageelement>HTMLImageElement</a> or <a href=#htmlcanvaselement>HTMLCanvasElement</a> or <a href=#htmlvideoelement>HTMLVideoElement</a>) image, double dx, double dy);
void <a href=#dom-context-2d-drawimage title=dom-context-2d-drawImage>drawImage</a>((<a href=#htmlimageelement>HTMLImageElement</a> or <a href=#htmlcanvaselement>HTMLCanvasElement</a> or <a href=#htmlvideoelement>HTMLVideoElement</a>) image, double dx, double dy, double dw, double dh);
void <a href=#dom-context-2d-drawimage title=dom-context-2d-drawImage>drawImage</a>((<a href=#htmlimageelement>HTMLImageElement</a> or <a href=#htmlcanvaselement>HTMLCanvasElement</a> or <a href=#htmlvideoelement>HTMLVideoElement</a>) image, double sx, double sy, double sw, double sh, double dx, double dy, double dw, double dh);

// pixel manipulation
<a href=#imagedata>ImageData</a> <a href=#dom-context-2d-createimagedata title=dom-context-2d-createImageData>createImageData</a>(double sw, double sh);
Expand Down Expand Up @@ -48605,10 +48594,7 @@ You cannot submit this form when the field is incorrect.</samp></pre>
attribute unsigned long <a href=#dom-select-length title=dom-select-length>length</a>;
getter <a href=#element>Element</a> <a href=#dom-select-item title=dom-select-item>item</a>(unsigned long index);
object <a href=#dom-select-nameditem title=dom-select-namedItem>namedItem</a>(DOMString name);
void <a href=#dom-select-add title=dom-select-add>add</a>(<a href=#htmloptionelement>HTMLOptionElement</a> element, optional <a href=#htmlelement>HTMLElement</a>? before);
void <a href=#dom-select-add title=dom-select-add>add</a>(<a href=#htmloptgroupelement>HTMLOptGroupElement</a> element, optional <a href=#htmlelement>HTMLElement</a>? before);
void <a href=#dom-select-add title=dom-select-add>add</a>(<a href=#htmloptionelement>HTMLOptionElement</a> element, long before);
void <a href=#dom-select-add title=dom-select-add>add</a>(<a href=#htmloptgroupelement>HTMLOptGroupElement</a> element, long before);
void <a href=#dom-select-add title=dom-select-add>add</a>((<a href=#htmloptionelement>HTMLOptionElement</a> or <a href=#htmloptgroupelement>HTMLOptGroupElement</a>) element, optional (<a href=#htmlelement>HTMLElement</a> or long)? before = null);
void <a href=#dom-select-remove title=dom-select-remove>remove</a>(long index);
<a href=#dom-htmloptionscollection-setter title=dom-HTMLOptionsCollection-setter>setter creator</a> void (unsigned long index, <a href=#htmloptionelement>HTMLOptionElement</a> option);

Expand Down Expand Up @@ -77950,8 +77936,7 @@ data:&nbsp;test

<h4 id=the-websocket-interface><span class=secno>10.3.2 </span>The <code><a href=#websocket>WebSocket</a></code> interface</h4>

<pre class=idl>[<a href=#dom-websocket title=dom-WebSocket>Constructor</a>(DOMString url, optional DOMString protocols),
<a href=#dom-websocket title=dom-WebSocket>Constructor</a>(DOMString url, optional DOMString[] protocols)]
<pre class=idl>[<a href=#dom-websocket title=dom-WebSocket>Constructor</a>(DOMString url, optional (DOMString or DOMString[]) protocols)]
interface <dfn id=websocket>WebSocket</dfn> : <a href=#eventtarget>EventTarget</a> {
readonly attribute DOMString <a href=#dom-websocket-url title=dom-WebSocket-url>url</a>;

Expand Down

0 comments on commit 0f6653d

Please sign in to comment.