[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

ukai at chromium.org ukai at chromium.org
Thu Apr 8 00:26:16 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 78906a34f174a4386bd7900ada86fdffbf67f4ff
Author: ukai at chromium.org <ukai at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Dec 8 04:19:59 2009 +0000

    2009-12-07  Fumitoshi Ukai  <ukai at chromium.org>
    
            Reviewed by Alexey Proskuryakov.
    
            Fragments now make WebSocket URL parsing fail.
            https://bugs.webkit.org/show_bug.cgi?id=32144
    
            * websocket/tests/script-tests/url-parsing.js:
            * websocket/tests/script-tests/url-with-fragment.js: Removed.
            * websocket/tests/url-parsing-expected.txt:
            * websocket/tests/url-with-fragment-expected.txt: Removed.
            * websocket/tests/url-with-fragment.html: Removed.
    2009-12-07  Fumitoshi Ukai  <ukai at chromium.org>
    
            Reviewed by Alexey Proskuryakov.
    
            Fragments now make WebSocket URL parsing fail.
            https://bugs.webkit.org/show_bug.cgi?id=32144
    
            * websockets/WebSocket.cpp:
            (WebCore::WebSocket::connect):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51830 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 9963f2a..cf033c5 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,5 +1,18 @@
 2009-12-07  Fumitoshi Ukai  <ukai at chromium.org>
 
+        Reviewed by Alexey Proskuryakov.
+
+        Fragments now make WebSocket URL parsing fail.
+        https://bugs.webkit.org/show_bug.cgi?id=32144
+
+        * websocket/tests/script-tests/url-parsing.js:
+        * websocket/tests/script-tests/url-with-fragment.js: Removed.
+        * websocket/tests/url-parsing-expected.txt:
+        * websocket/tests/url-with-fragment-expected.txt: Removed.
+        * websocket/tests/url-with-fragment.html: Removed.
+
+2009-12-07  Fumitoshi Ukai  <ukai at chromium.org>
+
         Reviewed by Darin Adler.
 
         Fix wrong length parsing in WebSocket.
diff --git a/LayoutTests/websocket/tests/script-tests/url-parsing.js b/LayoutTests/websocket/tests/script-tests/url-parsing.js
index 59f2a83..6fdb037 100644
--- a/LayoutTests/websocket/tests/script-tests/url-parsing.js
+++ b/LayoutTests/websocket/tests/script-tests/url-parsing.js
@@ -7,8 +7,16 @@ shouldThrow('new WebSocket("/applet")');
 shouldThrow('new WebSocket("ws://127.0.0.1:25/")');
 
 // This is what we currently do, but not what the spec says (as of Editor's Draft 1 December 2009).
-// The spec says that the string passed to WebScoket constructor should be returned unchanged.
 shouldBe('(new WebSocket("ws://127.0.0.1/a/../")).URL', '"ws://127.0.0.1/"');
 
+shouldBe('(new WebSocket("ws://127.0.0.1/path?")).URL', '"ws://127.0.0.1/path?"');
+shouldBe('(new WebSocket("ws://127.0.0.1/path?k=v")).URL', '"ws://127.0.0.1/path?k=v"');
+
+// draft-hixie-thewebsocketprotocol-60 says If /url/ has a <fragment>
+// component, then fail the parsing Web Socket URLs, so throw a SYNTAX_ERR
+// exception.
+shouldThrow('new WebSocket("ws://127.0.0.1/path#")');
+shouldThrow('new WebSocket("ws://127.0.0.1/path#fragment")');
+
 var successfullyParsed = true;
 isSuccessfullyParsed();
diff --git a/LayoutTests/websocket/tests/script-tests/url-with-fragment.js b/LayoutTests/websocket/tests/script-tests/url-with-fragment.js
deleted file mode 100644
index 73e8a01..0000000
--- a/LayoutTests/websocket/tests/script-tests/url-with-fragment.js
+++ /dev/null
@@ -1,37 +0,0 @@
-description("Make sure handshake with URL with fragment components success.");
-
-if (window.layoutTestController)
-    layoutTestController.waitUntilDone();
-
-var url = "ws://127.0.0.1:8880/websocket/tests/echo-location#fragment";
-var handshake_success = false;
-var ws_location;
-
-function endTest()
-{
-    clearTimeout(timeoutID);
-    shouldBeTrue("handshake_success");
-    shouldBe("ws_location", '"ws://127.0.0.1:8880/websocket/tests/echo-location"');
-    isSuccessfullyParsed();
-    if (window.layoutTestController)
-        layoutTestController.notifyDone();
-}
-
-debug("url=" + url);
-var ws = new WebSocket(url);
-ws.onopen = function () {
-    debug("WebSocket is open");
-    handshake_success = true;
-};
-ws.onmessage = function (evt) {
-    ws_location = evt.data;
-    debug("received:" + ws_location);
-    ws.close();
-};
-ws.onclose = function () {
-    debug("WebSocket is closed");
-    endTest();
-};
-var timeoutID = setTimeout("endTest()", 2000);
-
-var successfullyParsed = true;
diff --git a/LayoutTests/websocket/tests/url-parsing-expected.txt b/LayoutTests/websocket/tests/url-parsing-expected.txt
index d43a689..80d7557 100644
--- a/LayoutTests/websocket/tests/url-parsing-expected.txt
+++ b/LayoutTests/websocket/tests/url-parsing-expected.txt
@@ -5,6 +5,10 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
 PASS new WebSocket("/applet") threw exception Error: SYNTAX_ERR: DOM Exception 12.
 PASS new WebSocket("ws://127.0.0.1:25/") threw exception Error: SECURITY_ERR: DOM Exception 18.
 PASS (new WebSocket("ws://127.0.0.1/a/../")).URL is "ws://127.0.0.1/"
+PASS (new WebSocket("ws://127.0.0.1/path?")).URL is "ws://127.0.0.1/path?"
+PASS (new WebSocket("ws://127.0.0.1/path?k=v")).URL is "ws://127.0.0.1/path?k=v"
+PASS new WebSocket("ws://127.0.0.1/path#") threw exception Error: SYNTAX_ERR: DOM Exception 12.
+PASS new WebSocket("ws://127.0.0.1/path#fragment") threw exception Error: SYNTAX_ERR: DOM Exception 12.
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/LayoutTests/websocket/tests/url-with-fragment-expected.txt b/LayoutTests/websocket/tests/url-with-fragment-expected.txt
deleted file mode 100644
index 27c764f..0000000
--- a/LayoutTests/websocket/tests/url-with-fragment-expected.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-Make sure handshake with URL with fragment components success.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-url=ws://127.0.0.1:8880/websocket/tests/echo-location#fragment
-WebSocket is open
-received:ws://127.0.0.1:8880/websocket/tests/echo-location
-WebSocket is closed
-PASS handshake_success is true
-PASS ws_location is "ws://127.0.0.1:8880/websocket/tests/echo-location"
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/LayoutTests/websocket/tests/url-with-fragment.html b/LayoutTests/websocket/tests/url-with-fragment.html
deleted file mode 100644
index 2b34770..0000000
--- a/LayoutTests/websocket/tests/url-with-fragment.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-<head>
-<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
-<script src="../../fast/js/resources/js-test-pre.js"></script>
-<script src="../../fast/js/resources/js-test-post-function.js"></script>
-</head>
-<body>
-<div id="description"></div>
-<div id="console"></div>
-<script src="script-tests/url-with-fragment.js"></script>
-</body>
-</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index b235deb..ef4e9c6 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,5 +1,15 @@
 2009-12-07  Fumitoshi Ukai  <ukai at chromium.org>
 
+        Reviewed by Alexey Proskuryakov.
+
+        Fragments now make WebSocket URL parsing fail.
+        https://bugs.webkit.org/show_bug.cgi?id=32144
+
+        * websockets/WebSocket.cpp:
+        (WebCore::WebSocket::connect):
+
+2009-12-07  Fumitoshi Ukai  <ukai at chromium.org>
+
         Reviewed by Darin Adler.
 
         Fix wrong length parsing in WebSocket.
diff --git a/WebCore/websockets/WebSocket.cpp b/WebCore/websockets/WebSocket.cpp
index da60025..7d16493 100644
--- a/WebCore/websockets/WebSocket.cpp
+++ b/WebCore/websockets/WebSocket.cpp
@@ -130,6 +130,12 @@ void WebSocket::connect(const KURL& url, const String& protocol, ExceptionCode&
         ec = SYNTAX_ERR;
         return;
     }
+    if (m_url.hasFragmentIdentifier()) {
+        LOG(Network, "URL has fragment component %s", url.string().utf8().data());
+        m_state = CLOSED;
+        ec = SYNTAX_ERR;
+        return;
+    }
     if (!isValidProtocolString(m_protocol)) {
         LOG(Network, "Wrong protocol for WebSocket %s", m_protocol.utf8().data());
         m_state = CLOSED;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list