<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>12510</bug_id>
          
          <creation_ts>2011-04-16 02:11:08 +0000</creation_ts>
          <short_desc>Specs split off from HTML5 (like WebSockets) need to have xrefs linked, otherwise they&apos;re ambiguous</short_desc>
          <delta_ts>2012-10-29 21:50:49 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>WebSocket API (editor: Ian Hickson)</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>xref</status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Glenn Adams">glenn</reporter>
          <assigned_to name="Glenn Adams">glenn</assigned_to>
          <cc>art.barstow</cc>
    
    <cc>ayg</cc>
    
    <cc>bugs</cc>
    
    <cc>contributor</cc>
    
    <cc>ian</cc>
    
    <cc>julian.reschke</cc>
    
    <cc>mike</cc>
    
    <cc>public-webapps</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>47505</commentid>
    <comment_count>0</comment_count>
    <who name="Glenn Adams">glenn</who>
    <bug_when>2011-04-16 02:11:08 +0000</bug_when>
    <thetext>As presently defined, WebSocket may establish a connection before onopen is set. Using the example found in Section 4:

var socket = new WebSocket(&apos;ws://game.example.com:12010/updates&apos;);
socket.onopen = function () {
  setInterval(function() {
    if (socket.bufferedAmount == 0)
      socket.send(getUpdateData());
  }, 50);
};

In this case, the new websocket may transition to OPEN state prior to execution of the statement that sets the onopen property. For instance, this may occur when stepping through this JS code in a JS debugger, or when GC occurs between the constructor and the following statement.

The WS API should be modified to separate construction from opening, e..g., following a paradigm similar to XHR in which case the above example would become:

var socket = new WebSocket();
socket.onopen = function () {
  setInterval(function() {
    if (socket.bufferedAmount == 0)
      socket.send(getUpdateData());
  }, 50);
};
socket.open(&apos;ws://game.example.com:12010/updates&apos;);

Regards,
Glenn Adams</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>47805</commentid>
    <comment_count>1</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2011-04-29 14:23:08 +0000</bug_when>
    <thetext>There&apos;s no race condition. The spec queues a task to fire &apos;open&apos;, so even if the connection is established before the script has finished running, the event isn&apos;t fired until the event loop spins.

Adding .open() doesn&apos;t help since we&apos;d still want there to be no race condition if open() is called before setting the listener (since authors are going to do that).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>48746</commentid>
    <comment_count>2</comment_count>
    <who name="Olli Pettay">bugs</who>
    <bug_when>2011-05-24 19:14:02 +0000</bug_when>
    <thetext>Yeah, this is invalid, as far as I see.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>48748</commentid>
    <comment_count>3</comment_count>
    <who name="Glenn Adams">glenn</who>
    <bug_when>2011-05-24 20:09:39 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; Yeah, this is invalid, as far as I see.

I disagree.

Notwithstanding the statement in 2.1 that &quot;Many fundamental concepts from HTML are used by this specification. [HTML]&quot;, the current WebSocket spec does not normatively reference the task, task queue, or task dispatch semantics defined by HTML5. If the constraints on task semantics that are defined by HTML5 are required to prevent deadlocks in WebSocket, then WebSocket must normatively reference the definitions of task, task queue, and task dispatching semantics defined in HTML5.

Otherwise, WebSocket is underspecified and an arbitrary implementation (that does not happen to employ the HTML5 constraints) may indeed be deadlocked.

Regards,
Glenn</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>48757</commentid>
    <comment_count>4</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-05-24 23:43:50 +0000</bug_when>
    <thetext>The sentence you quote is that normative reference.

You&apos;re better off reading the spec in its full form where those terms are just part of the spec, anyway; the W3C copy is just an extract of the full spec. The full spec is here:

   http://www.whatwg.org/specs/web-apps/current-work/complete/network.html#network</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>48762</commentid>
    <comment_count>5</comment_count>
    <who name="Glenn Adams">glenn</who>
    <bug_when>2011-05-25 04:22:17 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; The sentence you quote is that normative reference.
&gt; 
&gt; You&apos;re better off reading the spec in its full form where those terms are just
&gt; part of the spec, anyway; the W3C copy is just an extract of the full spec. The
&gt; full spec is here:
&gt; 
&gt;   
&gt; http://www.whatwg.org/specs/web-apps/current-work/complete/network.html#network

I&apos;m sorry, but I do not recognize the role of WhatWG in terms of defining normative W3C specifications. The sentence I quoted is insufficient since it does not cite which normative definitions of HTML5 apply. At present, this results in WebSocket being &quot;not-well-defined&quot;.

Regards,
Glenn</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>48825</commentid>
    <comment_count>6</comment_count>
    <who name="Aryeh Gregor">ayg</who>
    <bug_when>2011-05-25 22:42:42 +0000</bug_when>
    <thetext>It looks like the script that splits up the spec doesn&apos;t make cross-spec references into links.  This seems like a bug in the spec-splitter, which could be confusing, since the writing style of HTML5 relies heavily on xrefs to make its meaning clear.  Specs like DOM Range do cross-spec xrefs just fine, so no reason HTML5-related specs shouldn&apos;t.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>48871</commentid>
    <comment_count>7</comment_count>
    <who name="Aryeh Gregor">ayg</who>
    <bug_when>2011-05-27 17:13:05 +0000</bug_when>
    <thetext>Changed summary to make it clear this is a question of bugs in the spec-splitter, not a bug in the original source text.  In this specific case, the terms used are pretty distinctive, and if you know they&apos;re defined in HTML5 (which this spec normatively references) you&apos;ll be able to find them, so it&apos;s not really very ambiguous in the end.  But it could be confusing to someone who&apos;s not so familiar with HTML5.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>48873</commentid>
    <comment_count>8</comment_count>
    <who name="Glenn Adams">glenn</who>
    <bug_when>2011-05-27 17:40:44 +0000</bug_when>
    <thetext>(In reply to comment #7)
&gt; Changed summary to make it clear this is a question of bugs in the
&gt; spec-splitter, not a bug in the original source text.  In this specific case,
&gt; the terms used are pretty distinctive, and if you know they&apos;re defined in HTML5
&gt; (which this spec normatively references) you&apos;ll be able to find them, so it&apos;s
&gt; not really very ambiguous in the end.  But it could be confusing to someone
&gt; who&apos;s not so familiar with HTML5.

Please note also that there is a circular reference between HTML5 and WebSockets, since the former normatively references the latter and the latter normatively references the former.

This is rather unsatisfactory in formal spec writing. It is best to have a non-circular dependency graph.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>48874</commentid>
    <comment_count>9</comment_count>
    <who name="Aryeh Gregor">ayg</who>
    <bug_when>2011-05-27 17:49:55 +0000</bug_when>
    <thetext>If you think that&apos;s an issue, you should probably file a separate bug.  As far as I&apos;m aware, it&apos;s allowed by W3C Process: they&apos;d just have to progress to PR at the same time.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>51185</commentid>
    <comment_count>10</comment_count>
    <who name="Aryeh Gregor">ayg</who>
    <bug_when>2011-07-17 14:29:22 +0000</bug_when>
    <thetext>*** Bug 13280 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59336</commentid>
    <comment_count>11</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-10-31 22:47:58 +0000</bug_when>
    <thetext>I have no intention of adding cross-spec cross-references to the WebSocket spec. If someone is interested in providing patches to the spec splitter to do this, please contact me directly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59770</commentid>
    <comment_count>12</comment_count>
    <who name="Glenn Adams">glenn</who>
    <bug_when>2011-11-09 02:12:32 +0000</bug_when>
    <thetext>(In reply to comment #11)
&gt; I have no intention of adding cross-spec cross-references to the WebSocket
&gt; spec. If someone is interested in providing patches to the spec splitter to do
&gt; this, please contact me directly.

How you create your spec products for use in the W3C is your business, not mine. I am asking that each reference or use of a &quot;fundamental concept&quot; as described in 2.1:

&quot;Many fundamental concepts from HTML are used by this specification. [HTML]&quot;

be made explicit by using a link (anchor) to the relevant defining clause/section in [HTML].

For example, the following phrases should link to the defining sections of [HTML]:

1. &quot;queue a task&quot; =&gt; http://dev.w3.org/html5/spec/Overview.html#queue-a-task
2. &quot;dispatch [an] event&quot; =&gt; http://dev.w3.org/html5/spec/Overview.html#concept-event-dispatch
3. &quot;task source&quot; =&gt; http://dev.w3.org/html5/spec/Overview.html#task-source
4. &quot;event loop&quot; =&gt; http://dev.w3.org/html5/spec/Overview.html#event-loop
5. &quot;task&quot; (otherwise unqualified) =&gt; http://dev.w3.org/html5/spec/Overview.html#concept-task

If these (and any other &quot;concepts from HTML&quot; I don&apos;t list above) are used normatively, then it should be made clear that the HTML definition applies (and not some other random implied definition). I don&apos;t care if it is done by links at each usage, or by listing the concepts in one place (e.g., under dependencies) and placing the links there.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>60780</commentid>
    <comment_count>13</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-12-02 16:48:33 +0000</bug_when>
    <thetext>I understand what you&apos;re asking for. I&apos;m saying that if you want it any time soon, you need to provide the script to set it up. Failing that, it&apos;ll have to wait until I get around to it, which may not be for some time as I don&apos;t really have a good idea for how to do it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>60790</commentid>
    <comment_count>14</comment_count>
    <who name="Julian Reschke">julian.reschke</who>
    <bug_when>2011-12-02 17:19:16 +0000</bug_when>
    <thetext>This is indeed a problem. The W3C version is incomplete/underspecified without these terms being properly linked (note that a similar issue has been raised by me with respect to &quot;URL&quot; parsing during WGLC).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>60876</commentid>
    <comment_count>15</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-12-03 02:54:27 +0000</bug_when>
    <thetext>If you want the hyperlinks, use the WHATWG version. It&apos;s the same text.

Hyperlinks cannot possibly be required for the content to make sense, by the way, otherwise we&apos;d never be able to print the spec. That just makes no sense.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>60890</commentid>
    <comment_count>16</comment_count>
    <who name="Julian Reschke">julian.reschke</who>
    <bug_when>2011-12-03 09:28:05 +0000</bug_when>
    <thetext>(In reply to comment #15)
&gt; If you want the hyperlinks, use the WHATWG version. It&apos;s the same text.

This bug isn&apos;t about the WHATWG spec.

The *published* W3C spec needs to be complete and well-defined. Somebody will have to take care of this. (And yes, it&apos;s your right to not care, in which the W3C should assign somebody else to fix it).
 
&gt; Hyperlinks cannot possibly be required for the content to make sense, by the
&gt; way, otherwise we&apos;d never be able to print the spec. That just makes no sense.

What&apos;s essential is that&apos;s clear what certain text means. Hyperlinking it is one way for HTML. For a print version, external links could be inlined as visibile text. Also, with respect to printing, internal links have the same problem.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69817</commentid>
    <comment_count>17</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-07-10 22:36:31 +0000</bug_when>
    <thetext>If the W3C does &quot;assign somebody else to fix it&quot;, I&apos;d be happy to work with them. So if anyone wants to do that, drop me a private e-mail and I&apos;ll set you up with the right files to edit, etc.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69868</commentid>
    <comment_count>18</comment_count>
    <who name="Julian Reschke">julian.reschke</who>
    <bug_when>2012-07-12 05:35:10 +0000</bug_when>
    <thetext>See &lt;http://lists.w3.org/Archives/Public/public-webapps/2012JulSep/0104.html&gt; for a patch applicable to the W3C version of the spec.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77166</commentid>
    <comment_count>19</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-10-26 23:35:42 +0000</bug_when>
    <thetext>That patch is unhelpful since it is to a dynamically generated file. Hence my comment 17.

I&apos;m marking this WONTFIX, since I view the WHATWG version as canonical and don&apos;t really think it&apos;s a problem for people to use the WHATWG version. The W3C version is only useful for the patent policy, and thus doesn&apos;t need the hyperlinks.

However, I wouldn&apos;t object to someone finding a solution to this. If anyone does want to actually work with me to fix this, please reopen the bug, assign it to yourself, and e-mail me, as per comment 17. Thanks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77179</commentid>
    <comment_count>20</comment_count>
    <who name="Glenn Adams">glenn</who>
    <bug_when>2012-10-27 05:18:33 +0000</bug_when>
    <thetext>I&apos;m unable to accept this resolution, in part because this is a W3C venue and, as a consequence, the W3C version of HTML5 is canonical, not WHATWG. It is the responsibility of the spec writer to define or referenced external definition of formal terms, and that responsibility applies here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77331</commentid>
    <comment_count>21</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-10-29 21:50:49 +0000</bug_when>
    <thetext>I&apos;m not going to be doing it, if you want to do it you are welcome to work with Art to do so. Reassigning it to you to get it off my radar. The W3C versions of these specs are not their canonical versions, whether for Web Sockets or for HTML, as far as I am concerned.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>