<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[52402] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/52402">52402</a></dd>
<dt>Author</dt> <dd>abarth@webkit.org</dd>
<dt>Date</dt> <dd>2009-12-19 23:36:50 -0800 (Sat, 19 Dec 2009)</dd>
</dl>

<h3>Log Message</h3>
<pre>2009-12-19  Adam Barth  &lt;abarth@webkit.org&gt;

        No review, rolling out <a href="http://trac.webkit.org/projects/webkit/changeset/52399">r52399</a>.
        http://trac.webkit.org/changeset/52399

        * websocket/tests/bad-sub-protocol-expected.txt:
        * websocket/tests/script-tests/url-parsing.js:
        * websocket/tests/url-parsing-expected.txt:
2009-12-19  Adam Barth  &lt;abarth@webkit.org&gt;

        No review, rolling out <a href="http://trac.webkit.org/projects/webkit/changeset/52399">r52399</a>.
        http://trac.webkit.org/changeset/52399

        * websockets/WebSocket.cpp:
        (WebCore::WebSocket::connect):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestswebsockettestsbadsubprotocolexpectedtxt">trunk/LayoutTests/websocket/tests/bad-sub-protocol-expected.txt</a></li>
<li><a href="#trunkLayoutTestswebsockettestsscripttestsurlparsingjs">trunk/LayoutTests/websocket/tests/script-tests/url-parsing.js</a></li>
<li><a href="#trunkLayoutTestswebsockettestsurlparsingexpectedtxt">trunk/LayoutTests/websocket/tests/url-parsing-expected.txt</a></li>
<li><a href="#trunkWebCoreChangeLog">trunk/WebCore/ChangeLog</a></li>
<li><a href="#trunkWebCorewebsocketsWebSocketcpp">trunk/WebCore/websockets/WebSocket.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (52401 => 52402)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2009-12-20 07:22:56 UTC (rev 52401)
+++ trunk/LayoutTests/ChangeLog        2009-12-20 07:36:50 UTC (rev 52402)
</span><span class="lines">@@ -1,5 +1,14 @@
</span><span class="cx"> 2009-12-19  Adam Barth  &lt;abarth@webkit.org&gt;
</span><span class="cx"> 
</span><ins>+        No review, rolling out r52399.
+        http://trac.webkit.org/changeset/52399
+
+        * websocket/tests/bad-sub-protocol-expected.txt:
+        * websocket/tests/script-tests/url-parsing.js:
+        * websocket/tests/url-parsing-expected.txt:
+
+2009-12-19  Adam Barth  &lt;abarth@webkit.org&gt;
+
</ins><span class="cx">         Reviewed by Eric Seidel.
</span><span class="cx"> 
</span><span class="cx">         Add a test for window.open and JavaScript URLs.
</span></span></pre></div>
<a id="trunkLayoutTestswebsockettestsbadsubprotocolexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/websocket/tests/bad-sub-protocol-expected.txt (52401 => 52402)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/websocket/tests/bad-sub-protocol-expected.txt        2009-12-20 07:22:56 UTC (rev 52401)
+++ trunk/LayoutTests/websocket/tests/bad-sub-protocol-expected.txt        2009-12-20 07:36:50 UTC (rev 52402)
</span><span class="lines">@@ -1,14 +1,3 @@
</span><del>-CONSOLE MESSAGE: line 0: Wrong protocol for WebSocket 
-CONSOLE MESSAGE: line 0: Wrong protocol for WebSocket 
-CONSOLE MESSAGE: line 0: Wrong protocol for WebSocket         
-CONSOLE MESSAGE: line 0: Wrong protocol for WebSocket 
-CONSOLE MESSAGE: line 0: Wrong protocol for WebSocket 
-CONSOLE MESSAGE: line 0: Wrong protocol for WebSocket €
-CONSOLE MESSAGE: line 0: Wrong protocol for WebSocket あ
-CONSOLE MESSAGE: line 0: Wrong protocol for WebSocket \x{FFFF}
-CONSOLE MESSAGE: line 0: Wrong protocol for WebSocket 
-CONSOLE MESSAGE: line 0: Wrong protocol for WebSocket ￾
-CONSOLE MESSAGE: line 0: Wrong protocol for WebSocket 𠀋
</del><span class="cx"> Test WebSocket bad sub-protocol names.
</span><span class="cx"> 
</span><span class="cx"> On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
</span></span></pre></div>
<a id="trunkLayoutTestswebsockettestsscripttestsurlparsingjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/websocket/tests/script-tests/url-parsing.js (52401 => 52402)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/websocket/tests/script-tests/url-parsing.js        2009-12-20 07:22:56 UTC (rev 52401)
+++ trunk/LayoutTests/websocket/tests/script-tests/url-parsing.js        2009-12-20 07:36:50 UTC (rev 52402)
</span><span class="lines">@@ -1,23 +1,17 @@
</span><span class="cx"> description(&quot;Test WebSocket URL parsing.&quot;);
</span><span class="cx"> 
</span><del>-// Invalid url will fail to be parsed.
-shouldThrow('new WebSocket(&quot;ws://javascript:a&quot;)');
-
</del><span class="cx"> // Can't use relative URLs - because spec says so, and because the scheme is different anyway.
</span><span class="cx"> shouldThrow('new WebSocket(&quot;/applet&quot;)');
</span><span class="cx"> 
</span><del>-// Non ws URL is not allowed.
-shouldThrow('new WebSocket(&quot;javascript:a&quot;)');
-
</del><span class="cx"> // UA is allowed to block access to some ports, which we do.
</span><span class="cx"> shouldThrow('new WebSocket(&quot;ws://127.0.0.1:25/&quot;)');
</span><span class="cx"> 
</span><del>-// Resolve the url string using the resolve a Web address algorithm.
-// Use 127.0.0.1:8880 and existing ws handler to make sure we don't receive unexpected response (so no console message appears)
-shouldBe('(new WebSocket(&quot;ws://127.0.0.1:8880/a/../websocket/tests/simple&quot;)).URL', '&quot;ws://127.0.0.1:8880/websocket/tests/simple&quot;');
-shouldBe('(new WebSocket(&quot;ws://127.0.0.1:8880/websocket/tests/simple?&quot;)).URL', '&quot;ws://127.0.0.1:8880/websocket/tests/simple?&quot;');
-shouldBe('(new WebSocket(&quot;ws://127.0.0.1:8880/websocket/tests/simple?k=v&quot;)).URL', '&quot;ws://127.0.0.1:8880/websocket/tests/simple?k=v&quot;');
</del><ins>+// This is what we currently do, but not what the spec says (as of Editor's Draft 1 December 2009).
+shouldBe('(new WebSocket(&quot;ws://127.0.0.1/a/../&quot;)).URL', '&quot;ws://127.0.0.1/&quot;');
</ins><span class="cx"> 
</span><ins>+shouldBe('(new WebSocket(&quot;ws://127.0.0.1/path?&quot;)).URL', '&quot;ws://127.0.0.1/path?&quot;');
+shouldBe('(new WebSocket(&quot;ws://127.0.0.1/path?k=v&quot;)).URL', '&quot;ws://127.0.0.1/path?k=v&quot;');
+
</ins><span class="cx"> // draft-hixie-thewebsocketprotocol-60 says If /url/ has a &lt;fragment&gt;
</span><span class="cx"> // component, then fail the parsing Web Socket URLs, so throw a SYNTAX_ERR
</span><span class="cx"> // exception.
</span></span></pre></div>
<a id="trunkLayoutTestswebsockettestsurlparsingexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/websocket/tests/url-parsing-expected.txt (52401 => 52402)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/websocket/tests/url-parsing-expected.txt        2009-12-20 07:22:56 UTC (rev 52401)
+++ trunk/LayoutTests/websocket/tests/url-parsing-expected.txt        2009-12-20 07:36:50 UTC (rev 52402)
</span><span class="lines">@@ -1,20 +1,12 @@
</span><del>-CONSOLE MESSAGE: line 0: Invalid url for WebSocket ws://javascript:a
-CONSOLE MESSAGE: line 0: Wrong url scheme for WebSocket http://127.0.0.1:8880/applet
-CONSOLE MESSAGE: line 0: Wrong url scheme for WebSocket javascript:a
-CONSOLE MESSAGE: line 0: WebSocket port 25 blocked
-CONSOLE MESSAGE: line 0: URL has fragment component ws://127.0.0.1/path#
-CONSOLE MESSAGE: line 0: URL has fragment component ws://127.0.0.1/path#fragment
</del><span class="cx"> Test WebSocket URL parsing.
</span><span class="cx"> 
</span><span class="cx"> On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
</span><span class="cx"> 
</span><del>-PASS new WebSocket(&quot;ws://javascript:a&quot;) threw exception Error: SYNTAX_ERR: DOM Exception 12.
</del><span class="cx"> PASS new WebSocket(&quot;/applet&quot;) threw exception Error: SYNTAX_ERR: DOM Exception 12.
</span><del>-PASS new WebSocket(&quot;javascript:a&quot;) threw exception Error: SYNTAX_ERR: DOM Exception 12.
</del><span class="cx"> PASS new WebSocket(&quot;ws://127.0.0.1:25/&quot;) threw exception Error: SECURITY_ERR: DOM Exception 18.
</span><del>-PASS (new WebSocket(&quot;ws://127.0.0.1:8880/a/../websocket/tests/simple&quot;)).URL is &quot;ws://127.0.0.1:8880/websocket/tests/simple&quot;
-PASS (new WebSocket(&quot;ws://127.0.0.1:8880/websocket/tests/simple?&quot;)).URL is &quot;ws://127.0.0.1:8880/websocket/tests/simple?&quot;
-PASS (new WebSocket(&quot;ws://127.0.0.1:8880/websocket/tests/simple?k=v&quot;)).URL is &quot;ws://127.0.0.1:8880/websocket/tests/simple?k=v&quot;
</del><ins>+PASS (new WebSocket(&quot;ws://127.0.0.1/a/../&quot;)).URL is &quot;ws://127.0.0.1/&quot;
+PASS (new WebSocket(&quot;ws://127.0.0.1/path?&quot;)).URL is &quot;ws://127.0.0.1/path?&quot;
+PASS (new WebSocket(&quot;ws://127.0.0.1/path?k=v&quot;)).URL is &quot;ws://127.0.0.1/path?k=v&quot;
</ins><span class="cx"> PASS new WebSocket(&quot;ws://127.0.0.1/path#&quot;) threw exception Error: SYNTAX_ERR: DOM Exception 12.
</span><span class="cx"> PASS new WebSocket(&quot;ws://127.0.0.1/path#fragment&quot;) threw exception Error: SYNTAX_ERR: DOM Exception 12.
</span><span class="cx"> PASS successfullyParsed is true
</span></span></pre></div>
<a id="trunkWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/ChangeLog (52401 => 52402)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/ChangeLog        2009-12-20 07:22:56 UTC (rev 52401)
+++ trunk/WebCore/ChangeLog        2009-12-20 07:36:50 UTC (rev 52402)
</span><span class="lines">@@ -1,5 +1,13 @@
</span><span class="cx"> 2009-12-19  Adam Barth  &lt;abarth@webkit.org&gt;
</span><span class="cx"> 
</span><ins>+        No review, rolling out r52399.
+        http://trac.webkit.org/changeset/52399
+
+        * websockets/WebSocket.cpp:
+        (WebCore::WebSocket::connect):
+
+2009-12-19  Adam Barth  &lt;abarth@webkit.org&gt;
+
</ins><span class="cx">         Reviewed by Eric Seidel.
</span><span class="cx"> 
</span><span class="cx">         Added a missing &quot;not&quot;.
</span></span></pre></div>
<a id="trunkWebCorewebsocketsWebSocketcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/websockets/WebSocket.cpp (52401 => 52402)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/websockets/WebSocket.cpp        2009-12-20 07:22:56 UTC (rev 52401)
+++ trunk/WebCore/websockets/WebSocket.cpp        2009-12-20 07:36:50 UTC (rev 52402)
</span><span class="lines">@@ -101,33 +101,26 @@
</span><span class="cx">     m_url = url;
</span><span class="cx">     m_protocol = protocol;
</span><span class="cx"> 
</span><del>-    if (!m_url.isValid()) {
-        scriptExecutionContext()-&gt;addMessage(ConsoleDestination, JSMessageSource, LogMessageType, ErrorMessageLevel, &quot;Invalid url for WebSocket &quot; + url.string(), 0, scriptExecutionContext()-&gt;securityOrigin()-&gt;toString());
-        m_state = CLOSED;
-        ec = SYNTAX_ERR;
-        return;
-    }
-
</del><span class="cx">     if (!m_url.protocolIs(&quot;ws&quot;) &amp;&amp; !m_url.protocolIs(&quot;wss&quot;)) {
</span><del>-        scriptExecutionContext()-&gt;addMessage(ConsoleDestination, JSMessageSource, LogMessageType, ErrorMessageLevel, &quot;Wrong url scheme for WebSocket &quot; + url.string(), 0, scriptExecutionContext()-&gt;securityOrigin()-&gt;toString());
</del><ins>+        LOG(Network, &quot;Wrong url scheme for WebSocket %s&quot;, url.string().utf8().data());
</ins><span class="cx">         m_state = CLOSED;
</span><span class="cx">         ec = SYNTAX_ERR;
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx">     if (m_url.hasFragmentIdentifier()) {
</span><del>-        scriptExecutionContext()-&gt;addMessage(ConsoleDestination, JSMessageSource, LogMessageType, ErrorMessageLevel, &quot;URL has fragment component &quot; + url.string(), 0, scriptExecutionContext()-&gt;securityOrigin()-&gt;toString());
</del><ins>+        LOG(Network, &quot;URL has fragment component %s&quot;, url.string().utf8().data());
</ins><span class="cx">         m_state = CLOSED;
</span><span class="cx">         ec = SYNTAX_ERR;
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx">     if (!isValidProtocolString(m_protocol)) {
</span><del>-        scriptExecutionContext()-&gt;addMessage(ConsoleDestination, JSMessageSource, LogMessageType, ErrorMessageLevel, &quot;Wrong protocol for WebSocket &quot; + m_protocol, 0, scriptExecutionContext()-&gt;securityOrigin()-&gt;toString());
</del><ins>+        LOG(Network, &quot;Wrong protocol for WebSocket %s&quot;, m_protocol.utf8().data());
</ins><span class="cx">         m_state = CLOSED;
</span><span class="cx">         ec = SYNTAX_ERR;
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx">     if (!portAllowed(url)) {
</span><del>-        scriptExecutionContext()-&gt;addMessage(ConsoleDestination, JSMessageSource, LogMessageType, ErrorMessageLevel, String::format(&quot;WebSocket port %d blocked&quot;, url.port()), 0, scriptExecutionContext()-&gt;securityOrigin()-&gt;toString());
</del><ins>+        LOG(Network, &quot;WebSocket port %d blocked&quot;, url.port());
</ins><span class="cx">         m_state = CLOSED;
</span><span class="cx">         ec = SECURITY_ERR;
</span><span class="cx">         return;
</span></span></pre>
</div>
</div>

</body>
</html>