Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[] (0) Define the Pipe constructor; do other maintenance work around …
…constructors.

git-svn-id: http://svn.whatwg.org/webapps@1867 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Jul 12, 2008
1 parent fbc5455 commit a591750
Show file tree
Hide file tree
Showing 2 changed files with 133 additions and 50 deletions.
111 changes: 78 additions & 33 deletions index
Expand Up @@ -30398,9 +30398,6 @@ never reset. This is nice and consistent.)
processing</span>
</dl>

<p class=big-issue>And when constructors are invoked but without using the
constructor syntax...?

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

Expand Down Expand Up @@ -41304,7 +41301,7 @@ data:&nbsp;test</pre>

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

// ready state
Expand All @@ -41325,18 +41322,19 @@ data:&nbsp;test</pre>
implement the <code>EventTarget</code> interface. <a
href="#refsDOM3EVENTS">[DOM3EVENTS]</a>

<p>The <dfn id=websocket1 title=dom-WebSocket><code>WebSocket</code></dfn>
constructor takes one argument, <var title="">url</var>, which specifies
the <a href="#url">URL</a> to which to connect. When a <code><a
href="#websocket0">WebSocket</a></code> object is created, the UA must <a
href="#parse0" title="parse a url">parse</a> this argument and verify that
the URL parses without failure and has a <a href="#ltschemegt"
title=url-scheme>&lt;scheme&gt;</a> component whose value is either "<code
title="">ws</code>" or "<code title="">wss</code>", when compared
case-insensitively<!-- XXX ASCII -->. If it does, it has, and it is, then
the user agent must asynchronously <a href="#establish">establish a Web
Socket connection</a> to <var title="">url</var>. Otherwise, the
constructor must raise a <code>SYNTAX_ERR</code> exception.
<p>The <dfn id=websocket1 title=dom-WebSocket><code>WebSocket(<var
title="">url</var>)</code></dfn> constructor takes one argument, <var
title="">url</var>, which specifies the <a href="#url">URL</a> to which to
connect. When a <code><a href="#websocket0">WebSocket</a></code> object is
created, the UA must <a href="#parse0" title="parse a url">parse</a> this
argument and verify that the URL parses without failure and has a <a
href="#ltschemegt" title=url-scheme>&lt;scheme&gt;</a> component whose
value is either "<code title="">ws</code>" or "<code title="">wss</code>",
when compared case-insensitively<!-- XXX ASCII -->. If it does, it has,
and it is, then the user agent must asynchronously <a
href="#establish">establish a Web Socket connection</a> to <var
title="">url</var>. Otherwise, the constructor must raise a
<code>SYNTAX_ERR</code> exception.

<p>The <dfn id=url2 title=dom-WebSocket-URL><code>URL</code></dfn>
attribute must return the value that was passed to the constructor.
Expand Down Expand Up @@ -41580,8 +41578,8 @@ Proxy-authorization: Basic ZWRuYW1vZGU6bm9jYXBlcyE=</pre>

<p>Send the <a href="#ascii" title="ASCII serialization of an
origin">ASCII serialization</a> of the <a href="#origin0">origin</a> of
the script that invoked the <code><a
href="#websocket0">WebSocket</a></code> constructor.</p>
the script that invoked the <code title=dom-WebSocket><a
href="#websocket1">WebSocket()</a></code> constructor.</p>

<p>Send the following bytes:</p>

Expand Down Expand Up @@ -41777,9 +41775,10 @@ Proxy-authorization: Basic ZWRuYW1vZGU6bm9jYXBlcyE=</pre>

<dd>Assume the value is a <a href="#url">URL</a>. If the value does not
have the <a href="#same-origin">same origin</a> as the script that
invoked the <code><a href="#websocket0">WebSocket</a></code>
constructor, then <a href="#fail-the">fail the Web Socket
connection</a> and abort these steps.
invoked the <code title=dom-WebSocket><a
href="#websocket1">WebSocket()</a></code> constructor, then <a
href="#fail-the">fail the Web Socket connection</a> and abort these
steps.

<dt>If the entry's name is "<code title="">websocket-location</code>"

Expand Down Expand Up @@ -42272,10 +42271,9 @@ function receiver(e) {
<h3 id=pipe-messaging><span class=secno>7.5 </span><dfn
id=pipe-messaging0>Pipe messaging</dfn></h3>

<p class=big-issue>...

<pre class=idl>[Constructor] interface <dfn id=pipe>Pipe</dfn> {
readonly attribute <a href="#pipeend0">PipeEnd</a> <span title=dom-pipe-end1>end1</span>;
<pre
class=idl>[<a href="#pipe0" title=dom-Pipe>Constructor</a>] interface <dfn id=pipe>Pipe</dfn> {
readonly attribute <a href="#pipeend0">PipeEnd</a> <a href="#end2" title=dom-pipe-end1>end1</a>;
readonly attribute <a href="#pipeend0">PipeEnd</a> <span title=dom-pipe-end2>end2</span>;
};

Expand All @@ -42291,7 +42289,54 @@ interface <dfn id=pipeend0>PipeEnd</dfn> {
attribute <span>EventListener</span> <span title=handler-endpipe-onunload>onunload</span>;
};</pre>

<p class=big-issue>...
<p>When the <dfn id=pipe0 title=dom-Pipe><code>Pipe()</code></dfn>
constructor is called, it must run the following algorithm:

<ol>
<li>
<p><a href="#create">Create a new <code>PipeEnd</code> object</a> owned
by the <a href="#script3">script browsing context</a>, and let <var
title="">end1</var> be that object.

<li>
<p><a href="#create">Create a new <code>PipeEnd</code> object</a> owned
by the <a href="#script3">script browsing context</a>, and let <var
title="">end2</var> be that object.

<li>
<p><a href="#entangle">Entangle</a> the <var title="">end1</var> and <var
title="">end2</var> objects.

<li>
<p>Create a new <code><a href="#pipe">Pipe</a></code> object, and let
<var title="">pipe</var> be that object.

<li>
<p>Let the <code title=dom-pipe-end1><a href="#end2">end1</a></code>
attribute of the <var title="">pipe</var> object be <var
title="">end1</var>.</p>

<li>
<p>Let the <code title=dom-pipe-end2>end2</code> attribute of the <var
title="">pipe</var> object be <var title="">end2</var>.</p>

<li>
<p>Return <var title="">pipe</var>.
</ol>

<p class=big-issue><dfn id=end1 title=dom-pipe-end1><code>end1</code></dfn>
<dfn id=end2 title=dom-pipe-end1><code>end2</code></dfn>

<hr>

<p class=big-issue>When the user agent is to <dfn id=create>create a new
<code>PipeEnd</code> object</dfn> owned by a <code><a
href="#window">Window</a></code> object <var title="">owner</var>, it
must...

<p class=big-issue>When the user agent is to <dfn
id=entangle>entangle</dfn> teo <code><a
href="#pipeend0">PipeEnd</a></code> objects, it must...

<h2 id=syntax><span class=secno>8. </span>The HTML syntax</h2>

Expand Down Expand Up @@ -46252,7 +46297,7 @@ interface <dfn id=pipeend0>PipeEnd</dfn> {
<h5 id=creating><span class=secno>8.2.5.1. </span>Creating and inserting
elements</h5>

<p>When the steps below require the UA to <dfn id=create title="create an
<p>When the steps below require the UA to <dfn id=create0 title="create an
element for the token">create an element for a token</dfn> in a particular
namespace, the UA must create a node implementing the interface
appropriate for the element type corresponding to the tag name of the
Expand All @@ -46272,7 +46317,7 @@ interface <dfn id=pipeend0>PipeEnd</dfn> {
defined by that namespace's specification is <code>Element</code>.

<p>When the steps below require the UA to <dfn id=insert0>insert an HTML
element</dfn> for a token, the UA must first <a href="#create">create an
element</dfn> for a token, the UA must first <a href="#create0">create an
element for the token</a> in the <a href="#html-namespace0">HTML
namespace</a>, and then append this node to the <a
href="#current5">current node</a>, and push it onto the <a
Expand All @@ -46286,7 +46331,7 @@ interface <dfn id=pipeend0>PipeEnd</dfn> {
happens in particular during the parsing of tables with invalid content.)

<p>When the steps below require the UA to <dfn id=insert1>insert a foreign
element</dfn> for a token, the UA must first <a href="#create">create an
element</dfn> for a token, the UA must first <a href="#create0">create an
element for the token</a> in the given namespace, and then append this
node to the <a href="#current5">current node</a>, and push it onto the <a
href="#stack">stack of open elements</a> so that it is the new <a
Expand Down Expand Up @@ -46509,7 +46554,7 @@ interface <dfn id=pipeend0>PipeEnd</dfn> {

<ol>
<li>
<p><a href="#create">Create an element for the token</a> in the <a
<p><a href="#create0">Create an element for the token</a> in the <a
href="#html-namespace0">HTML namespace</a>.

<li>
Expand Down Expand Up @@ -46937,7 +46982,7 @@ interface <dfn id=pipeend0>PipeEnd</dfn> {
<dt>A start tag whose tag name is "html"

<dd>
<p><a href="#create">Create an element for the token</a> in the <a
<p><a href="#create0">Create an element for the token</a> in the <a
href="#html-namespace0">HTML namespace</a>. Append it to the
<code>Document</code> object. Put this element in the <a
href="#stack">stack of open elements</a>.</p>
Expand Down Expand Up @@ -47154,7 +47199,7 @@ interface <dfn id=pipeend0>PipeEnd</dfn> {
<dt id=scriptTag>A start tag whose tag name is "script"

<dd>
<p><a href="#create">Create an element for the token</a> in the <a
<p><a href="#create0">Create an element for the token</a> in the <a
href="#html-namespace0">HTML namespace</a>.</p>

<p>Mark the element as being <a
Expand Down Expand Up @@ -48367,7 +48412,7 @@ interface <dfn id=pipeend0>PipeEnd</dfn> {
<dt>A start tag whose tag name is "textarea"

<dd>
<p><a href="#create">Create an element for the token</a> in the <a
<p><a href="#create0">Create an element for the token</a> in the <a
href="#html-namespace0">HTML namespace</a>. Append the new element to
the <a href="#current5">current node</a>.</p>

Expand Down
72 changes: 55 additions & 17 deletions source
Expand Up @@ -27916,9 +27916,6 @@ never reset. This is nice and consistent.)

</dl>

<p class="big-issue">And when constructors are invoked but without
using the constructor syntax...?</p>



<h4>APIs for creating and navigating browsing contexts by name</h4>
Expand Down Expand Up @@ -38876,7 +38873,7 @@ data:&nbsp;test</pre>

<pre class="idl">interface <dfn>WebSocket</dfn> {
// constructor
[Constructor] <span>WebSocket</span>(in DOMString url);
[<span title="dom-WebSocket">Constructor</span>] <span>WebSocket</span>(in DOMString url);
readonly attribute DOMString <span title="dom-WebSocket-URL">URL</span>;

// ready state
Expand All @@ -38897,12 +38894,12 @@ data:&nbsp;test</pre>
<code>EventTarget</code> interface. <a
href="#refsDOM3EVENTS">[DOM3EVENTS]</a>

<p>The <dfn title="dom-WebSocket"><code>WebSocket</code></dfn>
constructor takes one argument, <var title="">url</var>, which
specifies the <span>URL</span> to which to connect. When a
<code>WebSocket</code> object is created, the UA must <span
title="parse a url">parse</span> this argument and verify that the
URL parses without failure and has a <span
<p>The <dfn title="dom-WebSocket"><code>WebSocket(<var
title="">url</var>)</code></dfn> constructor takes one argument,
<var title="">url</var>, which specifies the <span>URL</span> to
which to connect. When a <code>WebSocket</code> object is created,
the UA must <span title="parse a url">parse</span> this argument and
verify that the URL parses without failure and has a <span
title="url-scheme">&lt;scheme&gt;</span> component whose value is
either "<code title="">ws</code>" or "<code title="">wss</code>",
when compared case-insensitively<!-- XXX ASCII -->. If it does, it
Expand Down Expand Up @@ -39153,7 +39150,8 @@ Proxy-authorization: Basic ZWRuYW1vZGU6bm9jYXBlcyE=</pre>

<p>Send the <span title="ASCII serialization of an origin">ASCII
serialization</span> of the <span>origin</span> of the script that
invoked the <code>WebSocket</code> constructor.</p>
invoked the <code title="dom-WebSocket">WebSocket()</code>
constructor.</p>

<p>Send the following bytes:</p>

Expand Down Expand Up @@ -39406,8 +39404,9 @@ Proxy-authorization: Basic ZWRuYW1vZGU6bm9jYXBlcyE=</pre>

<dd>Assume the value is a <span>URL</span>. If the value does not
have the <span>same origin</span> as the script that invoked the
<code>WebSocket</code> constructor, then <span>fail the Web
Socket connection</span> and abort these steps.</dd>
<code title="dom-WebSocket">WebSocket()</code> constructor, then
<span>fail the Web Socket connection</span> and abort these
steps.</dd>


<dt>If the entry's name is "<code
Expand Down Expand Up @@ -39969,9 +39968,7 @@ function receiver(e) {

<h3><dfn>Pipe messaging</dfn></h3>

<p class="big-issue">...</p>

<pre class="idl">[Constructor] interface <dfn>Pipe</dfn> {
<pre class="idl">[<span title="dom-Pipe">Constructor</span>] interface <dfn>Pipe</dfn> {
readonly attribute <span>PipeEnd</span> <span title="dom-pipe-end1">end1</span>;
readonly attribute <span>PipeEnd</span> <span title="dom-pipe-end2">end2</span>;
};
Expand All @@ -39988,8 +39985,49 @@ interface <dfn>PipeEnd</dfn> {
attribute <span>EventListener</span> <span title="handler-endpipe-onunload">onunload</span>;
};</pre>

<p class="big-issue">...</p>
<p>When the <dfn title="dom-Pipe"><code>Pipe()</code></dfn>
constructor is called, it must run the following algorithm:</p>

<ol>

<li><p><span>Create a new <code>PipeEnd</code> object</span> owned
by the <span>script browsing context</span>, and let <var
title="">end1</var> be that object.</p></li>

<li><p><span>Create a new <code>PipeEnd</code> object</span> owned
by the <span>script browsing context</span>, and let <var
title="">end2</var> be that object.</p></li>

<li><p><span>Entangle</span> the <var title="">end1</var> and <var
title="">end2</var> objects.</p></li>

<li><p>Create a new <code>Pipe</code> object, and let <var
title="">pipe</var> be that object.</p></li>

<li><p>Let the <code title="dom-pipe-end1">end1</code> attribute of
the <var title="">pipe</var> object be <var
title="">end1</var>.</p>

<li><p>Let the <code title="dom-pipe-end2">end2</code> attribute of
the <var title="">pipe</var> object be <var
title="">end2</var>.</p>

<li><p>Return <var title="">pipe</var>.</p></li>

</ol>

<p class="big-issue"><dfn
title="dom-pipe-end1"><code>end1</code></dfn> <dfn
title="dom-pipe-end1"><code>end2</code></dfn></p>

<hr>

<p class="big-issue">When the user agent is to <dfn>create a new
<code>PipeEnd</code> object</dfn> owned by a <code>Window</code>
object <var title="">owner</var>, it must...</p>

<p class="big-issue">When the user agent is to <dfn>entangle</dfn>
teo <code>PipeEnd</code> objects, it must...</p>


<h2 id="syntax">The HTML syntax</h2>
Expand Down

0 comments on commit a591750

Please sign in to comment.