Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[e] (0) Cleanup

Affected topics: HTML, Workers

git-svn-id: http://svn.whatwg.org/webapps@7704 340c8d12-0b0e-0410-8428-c7bf67bfef74
(cherry picked from commit 4c33512)

Line breaks.
  • Loading branch information...
commit f914fb8864403df5bf7d420c884ed7cfbf366aab 1 parent e719d65
ianh authored silviapfeiffer committed
Showing with 281 additions and 371 deletions.
  1. +281 −371 source
View
652 source
@@ -17962,12 +17962,12 @@ isn't his only passion. He also enjoys other pleasures.</p>
<dt><span title="element-dfn-dom">DOM interface</span>:</dt><!--TOPIC:DOM APIs-->
<dd>Uses <code>HTMLElement</code>.</dd>
</dl><!--TOPIC:HTML-->
-<!--CLEANUP-->
- <p>The <code>hgroup</code> element <span>represents</span> the heading of a section,
- which consists of all the <code>h1</code>&ndash;<code>h6</code> element children of the <code>hgroup</code> element. The element
- is used to group a set of <code>h1</code>&ndash;<code>h6</code> elements when the heading has
- multiple levels, such as subheadings, alternative titles, or taglines.</p>
+ <p>The <code>hgroup</code> element <span>represents</span> the heading of a section, which
+ consists of all the <code>h1</code>&ndash;<code>h6</code> element children of the
+ <code>hgroup</code> element. The element is used to group a set of
+ <code>h1</code>&ndash;<code>h6</code> elements when the heading has multiple levels, such as
+ subheadings, alternative titles, or taglines.</p>
<p>Other elements of <span>heading content</span> in the <code>hgroup</code> element indicate
subheadings or subtitles.</p>
@@ -27188,70 +27188,70 @@ of various sizes."></strong></pre>
</dd>
</dl><!--TOPIC:HTML-->
- <p>The <code>embed</code> element <span>represents</span> an
- integration point for an external (typically non-HTML) application
- or interactive content.</p>
+ <p>The <code>embed</code> element <span>represents</span> an integration point for an external
+ (typically non-HTML) application or interactive content.</p>
- <p>The <dfn title="attr-embed-src"><code>src</code></dfn> attribute
- gives the address of the resource being embedded. The attribute, if
- present, must contain a <span>valid non-empty URL potentially
- surrounded by spaces</span>.</p>
+ <p>The <dfn title="attr-embed-src"><code>src</code></dfn> attribute gives the address of the
+ resource being embedded. The attribute, if present, must contain a <span>valid non-empty URL
+ potentially surrounded by spaces</span>.</p>
<!--END w3c-html--><!--MD-->
- <p>If the <code title="attr-itemprop">itemprop</code> is specified
- on an <code>embed</code> element, then the <code
- title="attr-embed-src">src</code> attribute must also be
- specified.</p>
+ <p>If the <code title="attr-itemprop">itemprop</code> is specified on an <code>embed</code>
+ element, then the <code title="attr-embed-src">src</code> attribute must also be specified.</p>
<!--START w3c-html--><!--MD-->
- <p>The <dfn title="attr-embed-type"><code>type</code></dfn>
- attribute, if present, gives the <span>MIME type</span> by which the
- plugin to instantiate is selected. The value must be a <span>valid
- MIME type</span>. If both the <code
- title="attr-embed-type">type</code> attribute and the <code
- title="attr-embed-src">src</code> attribute are present, then the
- <code title="attr-embed-type">type</code> attribute must specify the
- same type as the <span title="Content-Type">explicit Content-Type
- metadata</span> of the resource given by the <code
+ <p>The <dfn title="attr-embed-type"><code>type</code></dfn> attribute, if present, gives the
+ <span>MIME type</span> by which the plugin to instantiate is selected. The value must be a
+ <span>valid MIME type</span>. If both the <code title="attr-embed-type">type</code> attribute and
+ the <code title="attr-embed-src">src</code> attribute are present, then the <code
+ title="attr-embed-type">type</code> attribute must specify the same type as the <span
+ title="Content-Type">explicit Content-Type metadata</span> of the resource given by the <code
title="attr-embed-src">src</code> attribute.</p>
<div class="impl">
- <p>When the element is created with neither a <code
- title="attr-embed-src">src</code> attribute nor a <code
- title="attr-embed-type">type</code> attribute, and when attributes
- are removed such that neither attribute is present on the element
- anymore, and when the element has a <span>media element</span>
- ancestor, and when the element has an ancestor <code>object</code>
- element that is <em>not</em> showing its <span>fallback
- content</span>, any plugins instantiated for the element must be
- removed, and the <code>embed</code> element represents nothing.</p>
+ <p>When the element is created with neither a <code title="attr-embed-src">src</code> attribute
+ nor a <code title="attr-embed-type">type</code> attribute, and when attributes are removed such
+ that neither attribute is present on the element anymore, and when the element has a <span>media
+ element</span> ancestor, and when the element has an ancestor <code>object</code> element that is
+ <em>not</em> showing its <span>fallback content</span>, any plugins instantiated for the element
+ must be removed, and the <code>embed</code> element represents nothing.</p>
- <p>An <code>embed</code> element is said to be <dfn
- title="concept-embed-active">potentially active</dfn> when the
- following conditions are all met simultaneously:</p>
+ <p>An <code>embed</code> element is said to be <dfn title="concept-embed-active">potentially
+ active</dfn> when the following conditions are all met simultaneously:</p>
<ul class="brief">
- <li>The element is <span title="in a document">in a <code>Document</code></span> or was <span title="in a document">in a <code>Document</code></span> the last time the <span>event loop</span> reached step 1.</li>
+
+ <li>The element is <span title="in a document">in a <code>Document</code></span> or was <span
+ title="in a document">in a <code>Document</code></span> the last time the <span>event loop</span>
+ reached step 1.</li>
+
<li>The element's <code>Document</code> is <span>fully active</span>.</li>
- <li>The element has either a <code title="attr-embed-src">src</code> attribute set or a <code title="attr-embed-type">type</code> attribute set (or both).</li>
- <li>The element's <code title="attr-embed-src">src</code> attribute is either absent or its value is not the empty string.</li>
+
+ <li>The element has either a <code title="attr-embed-src">src</code> attribute set or a <code
+ title="attr-embed-type">type</code> attribute set (or both).</li>
+
+ <li>The element's <code title="attr-embed-src">src</code> attribute is either absent or its value
+ is not the empty string.</li>
+
<li>The element is not a descendant of a <span>media element</span>.</li>
- <li>The element is not a descendant of an <code>object</code> element that is not showing its <span>fallback content</span>.</li>
- <li>The element is <span>being rendered</span>, or was <span>being rendered</span> the last time the <span>event loop</span> reached step 1.</li>
+
+ <li>The element is not a descendant of an <code>object</code> element that is not showing its
+ <span>fallback content</span>.</li>
+
+ <li>The element is <span>being rendered</span>, or was <span>being rendered</span> the last time
+ the <span>event loop</span> reached step 1.</li>
+
</ul>
-<!--CLEANUP-->
<p>Whenever an <code>embed</code> element that was not <span
title="concept-embed-active">potentially active</span> becomes <span
- title="concept-embed-active">potentially active</span>, and whenever
- a <span title="concept-embed-active">potentially active</span>
- <code>embed</code> element that is remaining <span
- title="concept-embed-active">potentially active</span> and has its
- <code title="attr-embed-type">src</code> attribute set, changed, or
- removed or its <code title="attr-embed-type">type</code> attribute
- set, changed, or removed, the user agent must <span>queue a task</span>
- using the <dfn>embed task source</dfn> to run the following steps:</p>
+ title="concept-embed-active">potentially active</span>, and whenever a <span
+ title="concept-embed-active">potentially active</span> <code>embed</code> element that is
+ remaining <span title="concept-embed-active">potentially active</span> and has its <code
+ title="attr-embed-type">src</code> attribute set, changed, or removed or its <code
+ title="attr-embed-type">type</code> attribute set, changed, or removed, the user agent must
+ <span>queue a task</span> using the <dfn>embed task source</dfn> to run the following steps:</p>
<ol>
@@ -27260,51 +27260,42 @@ of various sizes."></strong></pre>
<li>
- <dl class="switch">
-
- <dt>If the element has a <code title="attr-embed-src">src</code>
- attribute set</dt>
+ <dl class="switch">
- <dd>
+ <dt>If the element has a <code title="attr-embed-src">src</code> attribute set</dt>
- <p>The user agent must <span title="resolve a url">resolve</span>
- the value of the element's <code title="attr-embed-src">src</code>
- attribute, relative to the element. If that is successful, the
- user agent should <span>fetch</span><!--FETCH--> the resulting
- <span>absolute URL</span>, from the element's <span>browsing
- context scope origin</span> if it has one<!-- potentially
- http-origin privacy sensitive -->. The <span
- title="concept-task">task</span> that is <span title="queue a
- task">queued</span> by the <span>networking task source</span>
- once the resource has been <span title="fetch">fetched</span> must
- find and instantiate an appropriate <span>plugin</span> based on
- the <span title="concept-embed-type">content's type</span>, and
- hand that <span>plugin</span> the content of the resource,
- replacing any previously instantiated plugin for the element.</p>
- <!-- Note that this doesn't happen when the base URL changes. -->
+ <dd>
- <p>Fetching the resource must <span>delay the load event</span> of
- the element's document.</p>
- <!-- if we add load/error events, then replace the previous
- paragraph with the text one: -->
- <!-- similar text in various places -->
- <!--<p>Fetching the resource must <span>delay the load
- event</span> of the element's document until the final <span
- title="concept-task">task</span> that is <span title="queue a
- task">queued</span> by the <span>networking task source</span>
- once the resource has been <span title="fetch">fetched</span> has
- been run.</p>-->
+ <p>The user agent must <span title="resolve a url">resolve</span> the value of the element's
+ <code title="attr-embed-src">src</code> attribute, relative to the element. If that is
+ successful, the user agent should <span>fetch</span><!--FETCH--> the resulting <span>absolute
+ URL</span>, from the element's <span>browsing context scope origin</span> if it has one<!--
+ potentially http-origin privacy sensitive -->. The <span title="concept-task">task</span> that
+ is <span title="queue a task">queued</span> by the <span>networking task source</span> once
+ the resource has been <span title="fetch">fetched</span> must find and instantiate an
+ appropriate <span>plugin</span> based on the <span title="concept-embed-type">content's
+ type</span>, and hand that <span>plugin</span> the content of the resource, replacing any
+ previously instantiated plugin for the element.</p>
+ <!-- Note that this doesn't happen when the base URL changes. -->
+
+ <p>Fetching the resource must <span>delay the load event</span> of the element's document.</p>
+ <!-- if we add load/error events, then replace the previous paragraph with the text one: -->
+ <!-- similar text in various places -->
+ <!--<p>Fetching the resource must <span>delay the load event</span> of the element's document
+ until the final <span title="concept-task">task</span> that is <span title="queue a
+ task">queued</span> by the <span>networking task source</span> once the resource has been
+ <span title="fetch">fetched</span> has been run.</p>-->
- </dd>
+ </dd>
- <dt>If the element has no <code title="attr-embed-src">src</code> attribute set</dt>
+ <dt>If the element has no <code title="attr-embed-src">src</code> attribute set</dt>
- <dd><p>The user agent should find and instantiate an appropriate <span>plugin</span> based on the
- value of the <code title="attr-embed-type">type</code> attribute.</p>
+ <dd><p>The user agent should find and instantiate an appropriate <span>plugin</span> based on
+ the value of the <code title="attr-embed-type">type</code> attribute.</p>
- </dl>
+ </dl>
- </li>
+ </li>
</ol>
@@ -27426,8 +27417,8 @@ of various sizes."></strong></pre>
<p>If the user does not have the plugin (for example if the plugin vendor doesn't support the
user's platform), then the user will be unable to use the resource.</p>
- <p>To pass the plugin a parameter "quality" with the value "high",
- an attribute can be specified:</p>
+ <p>To pass the plugin a parameter "quality" with the value "high", an attribute can be
+ specified:</p>
<pre>&lt;embed src="catgame.swf" quality="high"></pre>
@@ -93746,10 +93737,10 @@ worker.port.postMessage({ foo: 'structured', bar: ['data', 'also', 'possible']})
shutting down unexpectedly.</p></li>
-->
- <li><p>If there are any <span title="concept-task">tasks</span> queued in the <code>WorkerGlobalScope</code> object's <span>event <!--CLEANUP-->
- loop</span>'s <span title="task queue">task queues</span><!-- v2-onclose other than the <code
- title="event-worker-close">close</code> event that this algorithm just added-->, discard them
- without processing them.</p></li>
+ <li><p>If there are any <span title="concept-task">tasks</span> queued in the
+ <code>WorkerGlobalScope</code> object's <span>event loop</span>'s <span title="task queue">task
+ queues</span><!-- v2-onclose other than the <code title="event-worker-close">close</code> event
+ that this algorithm just added-->, discard them without processing them.</p></li>
<!-- v2-onclose
<li><p>If the <code title="event-worker-close">close</code> event that this algorithm just queued
@@ -93780,9 +93771,9 @@ worker.port.postMessage({ foo: 'structured', bar: ['data', 'also', 'possible']})
<li><p>Set the worker's <code>WorkerGlobalScope</code> object's <span
title="dom-WorkerGlobalScope-closing">closing</span> flag to true.</p></li>
- <li><p>If there are any <span title="concept-task">tasks</span> queued in the <code>WorkerGlobalScope</code> object's <span>event <!--CLEANUP-->
- loop</span>'s <span title="task queue">task queues</span>, discard them without processing
- them.</p></li>
+ <li><p>If there are any <span title="concept-task">tasks</span> queued in the
+ <code>WorkerGlobalScope</code> object's <span>event loop</span>'s <span title="task queue">task
+ queues</span>, discard them without processing them.</p></li>
<li><p>Abort the script currently running in the worker.</p></li>
@@ -95877,140 +95868,113 @@ interface <dfn>WebSocket</dfn> : <span>EventTarget</span> {
void <span title="dom-WebSocket-send">send</span>(<span>ArrayBufferView</span> data);
};</pre>
- <p>The <dfn title="dom-WebSocket"><code>WebSocket(<var
- title="">url</var>, <var title="">protocols</var>)</code></dfn>
- constructor takes one or two arguments. The first argument, <var
- title="">url</var>, specifies the <span>URL</span> to which to
- connect. The second, <var title="">protocols</var>, if present, is
- either a string or an array of strings. If it is a string, it is
- equivalent to an array consisting of just that string; if it is
- omitted, it is equivalent to the empty array. Each string in the
- array is a subprotocol name. The connection will only be established
- if the server reports that it has selected one of these
- subprotocols. The subprotocol names must all be strings that match
- the requirements for elements that comprise the value of <code
- title="http-sec-websocket-protocol">Sec-WebSocket-Protocol</code>
- header fields as defined by the WebSocket protocol specification. <a
- href="#refsWSP">[WSP]</a></p>
+ <p>The <dfn title="dom-WebSocket"><code>WebSocket(<var title="">url</var>, <var
+ title="">protocols</var>)</code></dfn> constructor takes one or two arguments. The first argument,
+ <var title="">url</var>, specifies the <span>URL</span> to which to connect. The second, <var
+ title="">protocols</var>, if present, is either a string or an array of strings. If it is a
+ string, it is equivalent to an array consisting of just that string; if it is omitted, it is
+ equivalent to the empty array. Each string in the array is a subprotocol name. The connection will
+ only be established if the server reports that it has selected one of these subprotocols. The
+ subprotocol names must all be strings that match the requirements for elements that comprise the
+ value of <code title="http-sec-websocket-protocol">Sec-WebSocket-Protocol</code> header fields as
+ defined by the WebSocket protocol specification. <a href="#refsWSP">[WSP]</a></p>
- <p>When the <code>WebSocket()</code> constructor is invoked, the UA
- must run these steps:</p>
+ <p>When the <code>WebSocket()</code> constructor is invoked, the UA must run these steps:</p>
<ol>
- <li><p><i>Parse a WebSocket URL's components</i> from the <var
- title="">url</var> argument, to obtain <var title="">host</var>,
- <var title="">port</var>, <var title="">resource name</var>, and
- <var title="">secure</var>. If this fails, throw a
- <code>SyntaxError</code> exception and abort these steps. <a
- href="#refsWSP">[WSP]</a></p></li>
+ <li><p><i>Parse a WebSocket URL's components</i> from the <var title="">url</var> argument, to
+ obtain <var title="">host</var>, <var title="">port</var>, <var title="">resource name</var>, and
+ <var title="">secure</var>. If this fails, throw a <code>SyntaxError</code> exception and abort
+ these steps. <a href="#refsWSP">[WSP]</a></p></li>
- <li><p>If <var title="">secure</var> is false but the
- <span>origin</span> of the <span>entry script</span> has a scheme
- component that is itself a secure protocol, e.g. HTTPS, then throw
- a <code>SecurityError</code> exception.</p></li>
+ <li><p>If <var title="">secure</var> is false but the <span>origin</span> of the <span>entry
+ script</span> has a scheme component that is itself a secure protocol, e.g. HTTPS, then throw a
+ <code>SecurityError</code> exception.</p></li>
<li>
- <p>If <var title="">port</var> is a port to which the user agent
- is configured to block access, then throw a
- <code>SecurityError</code> exception. (User agents typically block
- access to well-known ports like SMTP.)</p>
-
+ <p>If <var title="">port</var> is a port to which the user agent is configured to block access,
+ then throw a <code>SecurityError</code> exception. (User agents typically block access to
+ well-known ports like SMTP.)</p>
<!-- e.g. http://www.mozilla.org/projects/netlib/PortBanning.html -->
- <p>Access to ports 80 and 443 should not be blocked, including the
- unlikely cases when <var title="">secure</var> is false but <var
- title="">port</var> is 443 or <var title="">secure</var> is true
- but <var title="">port</var> is 80.</p>
+ <p>Access to ports 80 and 443 should not be blocked, including the unlikely cases when <var
+ title="">secure</var> is false but <var title="">port</var> is 443 or <var title="">secure</var>
+ is true but <var title="">port</var> is 80.</p>
<!-- paragraph requested by zcorpan -->
</li>
<li>
- <p>If <var title="">protocols</var> is absent, let <var
- title="">protocols</var> be an empty array.</p>
+ <p>If <var title="">protocols</var> is absent, let <var title="">protocols</var> be an empty
+ array.</p>
- <p>Otherwise, if <var title="">protocols</var> is present and a
- string, let <var title="">protocols</var> instead be an array
- consisting of just that string.</p>
+ <p>Otherwise, if <var title="">protocols</var> is present and a string, let <var
+ title="">protocols</var> instead be an array consisting of just that string.</p>
</li>
- <li><p>If any of the values in <var title="">protocols</var> occur
- more than once or otherwise fail to match the requirements for
- elements that comprise the value of <code
- title="http-sec-websocket-protocol">Sec-WebSocket-Protocol</code>
- header fields as defined by the WebSocket protocol specification,
- then throw a <code>SyntaxError</code> exception and abort these
+ <li><p>If any of the values in <var title="">protocols</var> occur more than once or otherwise
+ fail to match the requirements for elements that comprise the value of <code
+ title="http-sec-websocket-protocol">Sec-WebSocket-Protocol</code> header fields as defined by the
+ WebSocket protocol specification, then throw a <code>SyntaxError</code> exception and abort these
steps. <a href="#refsWSP">[WSP]</a></p></li>
- <li><p>Let <var title="">origin</var> be the <span title="ASCII
- serialization of an origin">ASCII serialization</span> of the
- <span>origin</span> of the <span>entry script</span>,
- <span>converted to ASCII lowercase</span>.</p></li>
+ <li><p>Let <var title="">origin</var> be the <span title="ASCII serialization of an origin">ASCII
+ serialization</span> of the <span>origin</span> of the <span>entry script</span>, <span>converted
+ to ASCII lowercase</span>.</p></li>
- <li><p>Return a new <code>WebSocket</code> object, and continue
- these steps in the background (without blocking scripts).</p></li>
+ <li><p>Return a new <code>WebSocket</code> object, and continue these steps in the background
+ (without blocking scripts).</p></li>
<li>
- <p><i>Establish a WebSocket connection</i> given the set (<var
- title="">host</var>, <var title="">port</var>, <var
- title="">resource name</var>, <var title="">secure</var>), along
- with the <var title="">protocols</var> list, an empty list for the
- extensions, and <var title="">origin</var>. The <i>headers to send
- appropriate cookies</i> must be a <code
- title="http-Cookie">Cookie</code> header whose value is the
- <i>cookie-string</i> computed from the user's cookie store and the
- URL <var title="">url</var>; for these purposes this is
+ <p><i>Establish a WebSocket connection</i> given the set (<var title="">host</var>, <var
+ title="">port</var>, <var title="">resource name</var>, <var title="">secure</var>), along with
+ the <var title="">protocols</var> list, an empty list for the extensions, and <var
+ title="">origin</var>. The <i>headers to send appropriate cookies</i> must be a <code
+ title="http-Cookie">Cookie</code> header whose value is the <i>cookie-string</i> computed from
+ the user's cookie store and the URL <var title="">url</var>; for these purposes this is
<em>not</em> a "non-HTTP" API. <a href="#refsWSP">[WSP]</a> <a
href="#refsCOOKIES">[COOKIES]</a></p>
- <p>When the user agent <i title="validate the server's
- response">validates the server's response</i> during the
- "<i>establish a WebSocket connection</i>" algorithm, if the status
- code received from the server is not 101 (e.g. it is a redirect),
- the user agent must <i>fail the WebSocket connection</i>.</p>
-
- <p class="warning">Following HTTP procedures here could introduce
- serious security problems in a Web browser context. For example,
- consider a host with a WebSocket server at one path and an open
- HTTP redirector at another. Suddenly, any script that can be given
- a particular WebSocket URL can be tricked into communicating to
- (and potentially sharing secrets with) any host on the Internet,
- even if the script checks that the URL has the right hostname.</p>
+ <p>When the user agent <i title="validate the server's response">validates the server's
+ response</i> during the "<i>establish a WebSocket connection</i>" algorithm, if the status code
+ received from the server is not 101 (e.g. it is a redirect), the user agent must <i>fail the
+ WebSocket connection</i>.</p>
+
+ <p class="warning">Following HTTP procedures here could introduce serious security problems in a
+ Web browser context. For example, consider a host with a WebSocket server at one path and an
+ open HTTP redirector at another. Suddenly, any script that can be given a particular WebSocket
+ URL can be tricked into communicating to (and potentially sharing secrets with) any host on the
+ Internet, even if the script checks that the URL has the right hostname.</p>
<!-- http://www.ietf.org/mail-archive/web/hybi/current/msg06951.html -->
- <p class="note">If the <i>establish a WebSocket connection</i>
- algorithm fails, it triggers the <i>fail the WebSocket
- connection</i> algorithm, which then invokes the <i>close the
- WebSocket connection</i> algorithm, which then establishes that
- <i>the WebSocket connection is closed</i>, which fires the <code
- title="event-socket-close">close</code> event <a
- href="#closeWebSocket">as described below</a>.</p>
+ <p class="note">If the <i>establish a WebSocket connection</i> algorithm fails, it triggers the
+ <i>fail the WebSocket connection</i> algorithm, which then invokes the <i>close the WebSocket
+ connection</i> algorithm, which then establishes that <i>the WebSocket connection is closed</i>,
+ which fires the <code title="event-socket-close">close</code> event <a href="#closeWebSocket">as
+ described below</a>.</p>
</li>
</ol>
- <p>This constructor must be visible when the <span>script's global
- object</span> is either a <code>Window</code> object or an object
- implementing the <code>WorkerGlobalScope</code> interface.</p>
+ <p>This constructor must be visible when the <span>script's global object</span> is either a
+ <code>Window</code> object or an object implementing the <code>WorkerGlobalScope</code>
+ interface.</p>
<hr>
- <p>The <dfn title="dom-WebSocket-url"><code>url</code></dfn>
- attribute must return the result of <span title="resolve a
- url">resolving</span> the <span>URL</span> that was passed to the
- constructor. (It doesn't matter what it is resolved relative to,
- since we already know it is an <span>absolute URL</span>.)</p>
+ <p>The <dfn title="dom-WebSocket-url"><code>url</code></dfn> attribute must return the result of
+ <span title="resolve a url">resolving</span> the <span>URL</span> that was passed to the
+ constructor. (It doesn't matter what it is resolved relative to, since we already know it is an
+ <span>absolute URL</span>.)</p>
- <p>The <dfn
- title="dom-WebSocket-readyState"><code>readyState</code></dfn>
- attribute represents the state of the connection. It can have the
- following values:</p>
+ <p>The <dfn title="dom-WebSocket-readyState"><code>readyState</code></dfn> attribute represents
+ the state of the connection. It can have the following values:</p>
<dl>
@@ -96024,7 +95988,8 @@ interface <dfn>WebSocket</dfn> : <span>EventTarget</span> {
<dt><dfn title="dom-WebSocket-CLOSING"><code>CLOSING</code></dfn> (numeric value 2)</dt>
- <dd>The connection is going through the closing handshake, or the <code title="dom-WebSocket-close">close()</code> method has been invoked.</dd>
+ <dd>The connection is going through the closing handshake, or the <code
+ title="dom-WebSocket-close">close()</code> method has been invoked.</dd>
<dt><dfn title="dom-WebSocket-CLOSED"><code>CLOSED</code></dfn> (numeric value 3)</dt>
@@ -96032,65 +95997,52 @@ interface <dfn>WebSocket</dfn> : <span>EventTarget</span> {
</dl>
- <p>When the object is created its <code
- title="dom-WebSocket-readyState">readyState</code> must be set to
- <code title="dom-WebSocket-CONNECTING">CONNECTING</code> (0).</p>
+ <p>When the object is created its <code title="dom-WebSocket-readyState">readyState</code> must be
+ set to <code title="dom-WebSocket-CONNECTING">CONNECTING</code> (0).</p>
- <p>The <dfn
- title="dom-WebSocket-extensions"><code>extensions</code></dfn>
- attribute must initially return the empty string. After <i>the
- WebSocket connection is established</i>, its value might change, as
- defined below.</p>
+ <p>The <dfn title="dom-WebSocket-extensions"><code>extensions</code></dfn> attribute must
+ initially return the empty string. After <i>the WebSocket connection is established</i>, its value
+ might change, as defined below.</p>
- <p class="note">The <code
- title="dom-WebSocket-extensions">extensions</code> attribute returns
- the extensions selected by the server, if any. (Currently this will
- only ever be the empty string.)</p>
+ <p class="note">The <code title="dom-WebSocket-extensions">extensions</code> attribute returns the
+ extensions selected by the server, if any. (Currently this will only ever be the empty
+ string.)</p>
- <p>The <dfn
- title="dom-WebSocket-protocol"><code>protocol</code></dfn> attribute
- must initially return the empty string. After <i>the WebSocket
- connection is established</i>, its value might change, as defined
- below.</p>
+ <p>The <dfn title="dom-WebSocket-protocol"><code>protocol</code></dfn> attribute must initially
+ return the empty string. After <i>the WebSocket connection is established</i>, its value might
+ change, as defined below.</p>
- <p class="note">The <code
- title="dom-WebSocket-protocol">protocol</code> attribute returns the
- subprotocol selected by the server, if any. It can be used in
- conjunction with the array form of the constructor's second argument
- to perform subprotocol negotiation.</p>
+ <p class="note">The <code title="dom-WebSocket-protocol">protocol</code> attribute returns the
+ subprotocol selected by the server, if any. It can be used in conjunction with the array form of
+ the constructor's second argument to perform subprotocol negotiation.</p>
- <p>The <dfn title="dom-WebSocket-close"><code>close()</code></dfn>
- method must run the following steps:</p>
+ <p>The <dfn title="dom-WebSocket-close"><code>close()</code></dfn> method must run the following
+ steps:</p>
-<!--CLEANUP-->
<ol>
- <li><p>If the method's first argument is present but is neither an
- integer equal to 1000 nor an integer in the range 3000 to 4999, throw an
- <code>InvalidAccessError</code> exception and abort these
- steps.</p></li>
+ <li><p>If the method's first argument is present but is neither an integer equal to 1000 nor an
+ integer in the range 3000 to 4999, throw an <code>InvalidAccessError</code> exception and abort
+ these steps.</p></li>
<li>
- <p>If the method's second argument is present, then run these
- substeps:</p>
+ <p>If the method's second argument is present, then run these substeps:</p>
<ol>
- <li><p>Let <var title="">raw reason</var> be the method's second
- argument.</p></li>
+ <li><p>Let <var title="">raw reason</var> be the method's second argument.</p></li>
- <li><p>Let <var title="">Unicode reason</var> be the result of
- <span title="convert a DOMString to a sequence of Unicode
- characters">converting <var title="">raw reason</var> to a
- sequence of Unicode characters</span>.</p></li>
+ <li><p>Let <var title="">Unicode reason</var> be the result of <span title="convert a DOMString
+ to a sequence of Unicode characters">converting <var title="">raw reason</var> to a sequence of
+ Unicode characters</span>.</p></li>
- <li><p>Let <var title="">reason</var> be the result of encoding
- <var title="">Unicode reason</var> as UTF-8.</p></li>
+ <li><p>Let <var title="">reason</var> be the result of encoding <var title="">Unicode
+ reason</var> as UTF-8.</p></li>
- <li><p>If <var title="">reason</var> is longer than 123 bytes,
- then throw a <code>SyntaxError</code> exception and abort these
- steps. <a href="#refsRFC3629">[RFC3629]</a></p></li>
+ <li><p>If <var title="">reason</var> is longer than 123 bytes, then throw a
+ <code>SyntaxError</code> exception and abort these steps. <a
+ href="#refsRFC3629">[RFC3629]</a></p></li>
</ol>
@@ -96100,8 +96052,7 @@ interface <dfn>WebSocket</dfn> : <span>EventTarget</span> {
<dl class="switch">
- <dt>If the <code title="dom-WebSocket-readyState">readyState</code>
- attribute is in the <code
+ <dt>If the <code title="dom-WebSocket-readyState">readyState</code> attribute is in the <code
title="dom-WebSocket-CLOSING">CLOSING</code> (2) or <code
title="dom-WebSocket-CLOSED">CLOSED</code> (3) state</dt>
@@ -96109,64 +96060,52 @@ interface <dfn>WebSocket</dfn> : <span>EventTarget</span> {
<p>Do nothing.</p>
- <p class="note">The connection is already closing or is already
- closed. If it has not already, a <code
- title="event-socket-close">close</code> event will eventually fire <a
+ <p class="note">The connection is already closing or is already closed. If it has not already,
+ a <code title="event-socket-close">close</code> event will eventually fire <a
href="#closeWebSocket">as described below</a>.</p>
</dd>
- <dt>If the WebSocket connection is not yet <i title="the
- WebSocket connection is established">established</i> <a
- href="#refsWSP">[WSP]</a></dt>
+ <dt>If the WebSocket connection is not yet <i title="the WebSocket connection is
+ established">established</i> <a href="#refsWSP">[WSP]</a></dt>
<dd>
<p><i>Fail the WebSocket connection</i> and set the <code
- title="dom-WebSocket-readyState">readyState</code> attribute's
- value to <code title="dom-WebSocket-CLOSING">CLOSING</code> (2).
- <a href="#refsWSP">[WSP]</a></p>
+ title="dom-WebSocket-readyState">readyState</code> attribute's value to <code
+ title="dom-WebSocket-CLOSING">CLOSING</code> (2). <a href="#refsWSP">[WSP]</a></p>
- <p class="note">The <i>fail the WebSocket connection</i>
- algorithm invokes the <i>close the WebSocket
- connection</i> algorithm, which then establishes that
- <i>the WebSocket connection is closed</i>, which fires the
- <code title="event-socket-close">close</code> event <a
+ <p class="note">The <i>fail the WebSocket connection</i> algorithm invokes the <i>close the
+ WebSocket connection</i> algorithm, which then establishes that <i>the WebSocket connection is
+ closed</i>, which fires the <code title="event-socket-close">close</code> event <a
href="#closeWebSocket">as described below</a>.</p>
</dd>
- <dt>If the WebSocket closing handshake has not yet been <i
- title="the WebSocket closing handshake is
- started">started</i> <a href="#refsWSP">[WSP]</a></dt>
+ <dt>If the WebSocket closing handshake has not yet been <i title="the WebSocket closing
+ handshake is started">started</i> <a href="#refsWSP">[WSP]</a></dt>
<dd>
- <p><i>Start the WebSocket closing handshake</i> and set the
- <code title="dom-WebSocket-readyState">readyState</code>
- attribute's value to <code
- title="dom-WebSocket-CLOSING">CLOSING</code> (2). <a
- href="#refsWSP">[WSP]</a></p>
+ <p><i>Start the WebSocket closing handshake</i> and set the <code
+ title="dom-WebSocket-readyState">readyState</code> attribute's value to <code
+ title="dom-WebSocket-CLOSING">CLOSING</code> (2). <a href="#refsWSP">[WSP]</a></p>
- <p>If the first argument is present, then the status
- code<!--CLOSE CODE--> to use in the WebSocket Close message must
- be the integer given by the first argument. <a
+ <p>If the first argument is present, then the status code<!--CLOSE CODE--> to use in the
+ WebSocket Close message must be the integer given by the first argument. <a
href="#refsWSP">[WSP]</a></p>
- <p>If the second argument is also present, then <var
- title="">reason</var> must be provided in the Close message
- after the status code<!--CLOSE CODE-->. <a
- href="#refsRFC3629">[RFC3629]</a> <a
- href="#refsWSP">[WSP]</a></p>
+ <p>If the second argument is also present, then <var title="">reason</var> must be provided in
+ the Close message after the status code<!--CLOSE CODE-->. <a href="#refsRFC3629">[RFC3629]</a>
+ <a href="#refsWSP">[WSP]</a></p>
- <p class="note">The <i>start the WebSocket closing handshake</i>
- algorithm eventually invokes the <i>close the WebSocket
- connection</i> algorithm, which then establishes that <i>the
+ <p class="note">The <i>start the WebSocket closing handshake</i> algorithm eventually invokes
+ the <i>close the WebSocket connection</i> algorithm, which then establishes that <i>the
WebSocket connection is closed</i>, which fires the <code
- title="event-socket-close">close</code> event <a
- href="#closeWebSocket">as described below</a>.</p>
+ title="event-socket-close">close</code> event <a href="#closeWebSocket">as described
+ below</a>.</p>
</dd>
@@ -96175,17 +96114,13 @@ interface <dfn>WebSocket</dfn> : <span>EventTarget</span> {
<dd>
- <p>Set the <code
- title="dom-WebSocket-readyState">readyState</code> attribute's
- value to <code title="dom-WebSocket-CLOSING">CLOSING</code>
- (2).</p>
+ <p>Set the <code title="dom-WebSocket-readyState">readyState</code> attribute's value to <code
+ title="dom-WebSocket-CLOSING">CLOSING</code> (2).</p>
- <p class="note"><i>The WebSocket closing handshake is
- started</i>, and will eventually invoke the <i>close the
- WebSocket connection</i> algorithm, which will establish that
- <i>the WebSocket connection is closed</i>, and thus the <code
- title="event-socket-close">close</code> event will fire, <a
- href="#closeWebSocket">as described below</a>.</p>
+ <p class="note"><i>The WebSocket closing handshake is started</i>, and will eventually invoke
+ the <i>close the WebSocket connection</i> algorithm, which will establish that <i>the
+ WebSocket connection is closed</i>, and thus the <code title="event-socket-close">close</code>
+ event will fire, <a href="#closeWebSocket">as described below</a>.</p>
</dd>
@@ -96567,100 +96502,81 @@ socket.onopen = function () {
<h4>Ping and Pong frames</h4>
- <p>The WebSocket protocol specification defines Ping and Pong frames
- that can be used for keep-alive, heart-beats, network status
- probing, latency instrumentation, and so forth. These are not
- currently exposed in the API.</p>
-
- <p>User agents may send ping and unsolicited pong frames as desired,
- for example in an attempt to maintain local network NAT mappings, to
- detect failed connections, or to display latency metrics to the
- user. User agents must not use pings or unsolicited pongs to aid the
- server; it is assumed that servers will solicit pongs whenever
- appropriate for the server's needs.</p>
-
- <!-- v2: we'll probably add a way to make the client send pings and
- automatically terminate the connection if they don't get a pong
- within an author-provided timeout; see
+ <p>The WebSocket protocol specification defines Ping and Pong frames that can be used for
+ keep-alive, heart-beats, network status probing, latency instrumentation, and so forth. These are
+ not currently exposed in the API.</p>
+
+ <p>User agents may send ping and unsolicited pong frames as desired, for example in an attempt to
+ maintain local network NAT mappings, to detect failed connections, or to display latency metrics
+ to the user. User agents must not use pings or unsolicited pongs to aid the server; it is assumed
+ that servers will solicit pongs whenever appropriate for the server's needs.</p>
+
+ <!-- v2: we'll probably add a way to make the client send pings and automatically terminate the
+ connection if they don't get a pong within an author-provided timeout; see
https://www.w3.org/Bugs/Public/show_bug.cgi?id=17264 -->
<h4>Parsing WebSocket URLs</h4>
- <p>The steps to <dfn>parse a WebSocket URL's components</dfn> from
- a string <var title="">url</var> are as follows. These steps return
- either a <var title="">host</var>, a <var title="">port</var>, a
- <var title="">resource name</var>, and a <var title="">secure</var>
- flag, or they fail.</p>
+ <p>The steps to <dfn>parse a WebSocket URL's components</dfn> from a string <var
+ title="">url</var> are as follows. These steps return either a <var title="">host</var>, a <var
+ title="">port</var>, a <var title="">resource name</var>, and a <var title="">secure</var> flag,
+ or they fail.</p>
<ol>
- <li><p>If the <var title="">url</var> string is not an
- <span>absolute URL</span>, then fail this algorithm.</p></li>
+ <li><p>If the <var title="">url</var> string is not an <span>absolute URL</span>, then fail this
+ algorithm.</p></li>
<li>
- <p><span title="resolve a url">Resolve</span> the <var
- title="">url</var> string, with the URL character encoding set to
- UTF-8. <a href="#refsRFC3629">[RFC3629]</a></p> <!-- the URL
- character encoding is used to escape the query component -->
+ <p><span title="resolve a url">Resolve</span> the <var title="">url</var> string, with the URL
+ character encoding set to UTF-8. <a href="#refsRFC3629">[RFC3629]</a></p> <!-- the URL character
+ encoding is used to escape the query component -->
- <p class="note">It doesn't matter what it is resolved relative to,
- since we already know it is an <span>absolute URL</span> at this
- point.</p>
+ <p class="note">It doesn't matter what it is resolved relative to, since we already know it is
+ an <span>absolute URL</span> at this point.</p>
</li>
- <li><p>If <var title="">url</var> does not have a <span
- title="url-scheme">&lt;scheme&gt;</span> component whose value,
- when <span>converted to ASCII lowercase</span>, is either "<code
- title="">ws</code>" or "<code title="">wss</code>", then fail this
- algorithm.</p></li>
+ <li><p>If <var title="">url</var> does not have a <span title="url-scheme">&lt;scheme&gt;</span>
+ component whose value, when <span>converted to ASCII lowercase</span>, is either "<code
+ title="">ws</code>" or "<code title="">wss</code>", then fail this algorithm.</p></li>
- <li><p>If <var title="">url</var> has a <span
- title="url-fragment">&lt;fragment&gt;</span> component, then fail
- this algorithm.</p></li>
+ <li><p>If <var title="">url</var> has a <span title="url-fragment">&lt;fragment&gt;</span>
+ component, then fail this algorithm.</p></li>
- <li><p>If the <span title="url-scheme">&lt;scheme&gt;</span>
- component of <var title="">url</var> is "<code title="">ws</code>",
- set <var title="">secure</var> to false; otherwise, the <span
- title="url-scheme">&lt;scheme&gt;</span> component is "<code
- title="">wss</code>", set <var title="">secure</var> to
- true.</p></li>
+ <li><p>If the <span title="url-scheme">&lt;scheme&gt;</span> component of <var title="">url</var>
+ is "<code title="">ws</code>", set <var title="">secure</var> to false; otherwise, the <span
+ title="url-scheme">&lt;scheme&gt;</span> component is "<code title="">wss</code>", set <var
+ title="">secure</var> to true.</p></li>
<li><p>Let <var title="">host</var> be the value of the <span
- title="url-host">&lt;host&gt;</span> component of <var
- title="">url</var>, <span>converted to ASCII
- lowercase</span>.</p></li> <!-- at this point this is
- Punycode-encoded already -->
-
- <li><p>If <var title="">url</var> has a <span
- title="url-port">&lt;port&gt;</span> component, then let <var
- title="">port</var> be that component's value; otherwise, there is
- no explicit <var title="">port</var>.</p></li>
-
- <li><p>If there is no explicit <var title="">port</var>, then: if
- <var title="">secure</var> is false, let <var title="">port</var>
- be 80, otherwise let <var title="">port</var> be 443.</p></li>
-
- <li><p>Let <var title="">resource name</var> be the value of the
- <span title="url-path">&lt;path&gt;</span> component (which might
- be empty) of <var title="">url</var>.</p></li> <!-- at this point
- this is UTF-8 encoded and %-escaped -->
-
- <li><p>If <var title="">resource name</var> is the empty string,
- set it to a single character U+002F SOLIDUS (/).</p></li>
-
- <li><p>If <var title="">url</var> has a <span
- title="url-query">&lt;query&gt;</span> component, then append a
- single U+003F QUESTION MARK character (?) to <var title="">resource
- name</var>, followed by the value of the <span
- title="url-query">&lt;query&gt;</span> component.</p></li> <!-- at
- this point this is UTF-8 encoded and %-escaped -->
-
- <li><p>Return <var title="">host</var>, <var title="">port</var>,
- <var title="">resource name</var>, and <var
- title="">secure</var>.</p></li>
+ title="url-host">&lt;host&gt;</span> component of <var title="">url</var>, <span>converted to
+ ASCII lowercase</span>.</p></li> <!-- at this point this is Punycode-encoded already -->
+
+ <li><p>If <var title="">url</var> has a <span title="url-port">&lt;port&gt;</span> component,
+ then let <var title="">port</var> be that component's value; otherwise, there is no explicit <var
+ title="">port</var>.</p></li>
+
+ <li><p>If there is no explicit <var title="">port</var>, then: if <var title="">secure</var> is
+ false, let <var title="">port</var> be 80, otherwise let <var title="">port</var> be
+ 443.</p></li>
+
+ <li><p>Let <var title="">resource name</var> be the value of the <span
+ title="url-path">&lt;path&gt;</span> component (which might be empty) of <var
+ title="">url</var>.</p></li> <!-- at this point this is UTF-8 encoded and %-escaped -->
+
+ <li><p>If <var title="">resource name</var> is the empty string, set it to a single character
+ U+002F SOLIDUS (/).</p></li>
+
+ <li><p>If <var title="">url</var> has a <span title="url-query">&lt;query&gt;</span> component,
+ then append a single U+003F QUESTION MARK character (?) to <var title="">resource name</var>,
+ followed by the value of the <span title="url-query">&lt;query&gt;</span> component.</p></li>
+ <!-- at this point this is UTF-8 encoded and %-escaped -->
+
+ <li><p>Return <var title="">host</var>, <var title="">port</var>, <var title="">resource
+ name</var>, and <var title="">secure</var>.</p></li>
</ol>
@@ -96680,23 +96596,17 @@ dictionary <dfn>CloseEventInit</dfn> : <span>EventInit</span> {
DOMString reason;
};</pre>
- <p>The <dfn
- title="dom-CloseEvent-wasClean"><code>wasClean</code></dfn>
- attribute must return the value it was initialized to. When the
- object is created, this attribute must be initialized to false. It
- represents whether the connection closed cleanly or not.</p>
+ <p>The <dfn title="dom-CloseEvent-wasClean"><code>wasClean</code></dfn> attribute must return the
+ value it was initialized to. When the object is created, this attribute must be initialized to
+ false. It represents whether the connection closed cleanly or not.</p>
- <p>The <dfn title="dom-CloseEvent-code"><code>code</code></dfn>
- attribute must return the value it was initialized to. When the
- object is created, this attribute must be initialized to zero. It
- represents the WebSocket connection close code provided by the
- server.</p>
+ <p>The <dfn title="dom-CloseEvent-code"><code>code</code></dfn> attribute must return the value it
+ was initialized to. When the object is created, this attribute must be initialized to zero. It
+ represents the WebSocket connection close code provided by the server.</p>
- <p>The <dfn title="dom-CloseEvent-reason"><code>reason</code></dfn>
- attribute must return the value it was initialized to. When the
- object is created, this attribute must be initialized to empty
- string. It represents the WebSocket connection close reason provided
- by the server.</p>
+ <p>The <dfn title="dom-CloseEvent-reason"><code>reason</code></dfn> attribute must return the
+ value it was initialized to. When the object is created, this attribute must be initialized to
+ empty string. It represents the WebSocket connection close reason provided by the server.</p>
Please sign in to comment.
Something went wrong with that request. Please try again.