Add .url attribute alongside .URL in EventSource and WebSocket to comply with the...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 22 Jan 2012 01:09:18 +0000 (01:09 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 22 Jan 2012 01:09:18 +0000 (01:09 +0000)
https://bugs.webkit.org/show_bug.cgi?id=40899

Patch by Pablo Flouret <pablof@motorola.com> on 2012-01-21
Reviewed by Adam Barth.

Source/WebCore:

Tests: fast/eventsource/eventsource-url-attribute.html
       http/tests/websocket/tests/hixie76/url-attribute.html
       http/tests/websocket/tests/hybi/url-attribute.html

* page/EventSource.idl:
* websockets/WebSocket.idl:

LayoutTests:

* fast/eventsource/eventsource-url-attribute-expected.txt: Added.
* fast/eventsource/eventsource-url-attribute.html: Added.
* http/tests/websocket/tests/hixie76/url-attribute-expected.txt: Added.
* http/tests/websocket/tests/hixie76/url-attribute.html: Added.
* http/tests/websocket/tests/hybi/url-attribute-expected.txt: Added.
* http/tests/websocket/tests/hybi/url-attribute.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105580 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/eventsource/eventsource-url-attribute-expected.txt [new file with mode: 0644]
LayoutTests/fast/eventsource/eventsource-url-attribute.html [new file with mode: 0644]
LayoutTests/http/tests/websocket/tests/hixie76/url-attribute-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/websocket/tests/hixie76/url-attribute.html [new file with mode: 0644]
LayoutTests/http/tests/websocket/tests/hybi/url-attribute-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/websocket/tests/hybi/url-attribute.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/page/EventSource.idl
Source/WebCore/websockets/WebSocket.idl

index 9df12de..4cf132d 100644 (file)
@@ -1,3 +1,17 @@
+2012-01-21  Pablo Flouret  <pablof@motorola.com>
+
+        Add .url attribute alongside .URL in EventSource and WebSocket to comply with the specs but not break existing usage.
+        https://bugs.webkit.org/show_bug.cgi?id=40899
+
+        Reviewed by Adam Barth.
+
+        * fast/eventsource/eventsource-url-attribute-expected.txt: Added.
+        * fast/eventsource/eventsource-url-attribute.html: Added.
+        * http/tests/websocket/tests/hixie76/url-attribute-expected.txt: Added.
+        * http/tests/websocket/tests/hixie76/url-attribute.html: Added.
+        * http/tests/websocket/tests/hybi/url-attribute-expected.txt: Added.
+        * http/tests/websocket/tests/hybi/url-attribute.html: Added.
+
 2012-01-21  Csaba Osztrogonác  <ossy@webkit.org>
 
         [Qt] Unreviewed weekend gardening. Skip the new failing tests to paint the bots green.
diff --git a/LayoutTests/fast/eventsource/eventsource-url-attribute-expected.txt b/LayoutTests/fast/eventsource/eventsource-url-attribute-expected.txt
new file mode 100644 (file)
index 0000000..05fc655
--- /dev/null
@@ -0,0 +1,12 @@
+Both .URL and .url should work (for compatibility reasons).
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS source.URL is "http://localhost/"
+PASS source.url is "http://localhost/"
+PASS source.URL === source.url is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/eventsource/eventsource-url-attribute.html b/LayoutTests/fast/eventsource/eventsource-url-attribute.html
new file mode 100644 (file)
index 0000000..a4d08ed
--- /dev/null
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<script src="../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<script>
+
+description("Both .URL and .url should work (for compatibility reasons).");
+
+var url = "http://localhost/";
+var source = new EventSource(url);
+
+shouldBeEqualToString("source.URL", url);
+shouldBeEqualToString("source.url", url);
+shouldBeTrue("source.URL === source.url");
+
+</script>
+<script src="../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/websocket/tests/hixie76/url-attribute-expected.txt b/LayoutTests/http/tests/websocket/tests/hixie76/url-attribute-expected.txt
new file mode 100644 (file)
index 0000000..97d42aa
--- /dev/null
@@ -0,0 +1,11 @@
+Both .URL and .url attributes should work (for compatibility reasons).
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+PASS ws.url is "ws://127.0.0.1:8880/"
+PASS ws.URL is "ws://127.0.0.1:8880/"
+PASS ws.URL === ws.url is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/http/tests/websocket/tests/hixie76/url-attribute.html b/LayoutTests/http/tests/websocket/tests/hixie76/url-attribute.html
new file mode 100644 (file)
index 0000000..b5315fa
--- /dev/null
@@ -0,0 +1,24 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src="../../../../js-test-resources/js-test-pre.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script type="text/javascript">
+
+description("Both .URL and .url attributes should work (for compatibility reasons).");
+
+var url = "ws://127.0.0.1:8880/";
+var ws = new WebSocket(url);
+
+shouldBeEqualToString("ws.url", url);
+shouldBeEqualToString("ws.URL", url);
+shouldBeTrue("ws.URL === ws.url");
+
+</script>
+<script src="../../../../js-test-resources/js-test-post.js"></script>
+</body>
+</html>
+
diff --git a/LayoutTests/http/tests/websocket/tests/hybi/url-attribute-expected.txt b/LayoutTests/http/tests/websocket/tests/hybi/url-attribute-expected.txt
new file mode 100644 (file)
index 0000000..97d42aa
--- /dev/null
@@ -0,0 +1,11 @@
+Both .URL and .url attributes should work (for compatibility reasons).
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+PASS ws.url is "ws://127.0.0.1:8880/"
+PASS ws.URL is "ws://127.0.0.1:8880/"
+PASS ws.URL === ws.url is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/http/tests/websocket/tests/hybi/url-attribute.html b/LayoutTests/http/tests/websocket/tests/hybi/url-attribute.html
new file mode 100644 (file)
index 0000000..ea3b959
--- /dev/null
@@ -0,0 +1,27 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src="../../../../js-test-resources/js-test-pre.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script type="text/javascript">
+
+description("Both .URL and .url attributes should work (for compatibility reasons).");
+
+if (window.layoutTestController)
+    layoutTestController.overridePreference("WebKitHixie76WebSocketProtocolEnabled", 0);
+
+var url = "ws://127.0.0.1:8880/";
+var ws = new WebSocket(url);
+
+shouldBeEqualToString("ws.url", url);
+shouldBeEqualToString("ws.URL", url);
+shouldBeTrue("ws.URL === ws.url");
+
+</script>
+<script src="../../../../js-test-resources/js-test-post.js"></script>
+</body>
+</html>
+
index 146cd0b..89904ec 100644 (file)
@@ -1,3 +1,17 @@
+2012-01-21  Pablo Flouret  <pablof@motorola.com>
+
+        Add .url attribute alongside .URL in EventSource and WebSocket to comply with the specs but not break existing usage.
+        https://bugs.webkit.org/show_bug.cgi?id=40899
+
+        Reviewed by Adam Barth.
+
+        Tests: fast/eventsource/eventsource-url-attribute.html
+               http/tests/websocket/tests/hixie76/url-attribute.html
+               http/tests/websocket/tests/hybi/url-attribute.html
+
+        * page/EventSource.idl:
+        * websockets/WebSocket.idl:
+
 2012-01-21  Sheriff Bot  <webkit.review.bot@gmail.com>
 
         Unreviewed, rolling out r105564.
index c06076c..4c4433f 100644 (file)
@@ -41,7 +41,8 @@ module window {
         NoStaticTables
     ] EventSource {
 
-        readonly attribute DOMString URL;
+        readonly attribute DOMString URL; // Lowercased .url is the one in the spec, but leaving .URL for compatibility reasons.
+        readonly attribute DOMString url;
 
         // ready state
         const unsigned short CONNECTING = 0;
index 4c09ec1..b2b6779 100644 (file)
@@ -39,7 +39,8 @@ module websockets {
         EventTarget,
         NoStaticTables
     ] WebSocket {
-        readonly attribute DOMString URL;
+        readonly attribute DOMString URL; // Lowercased .url is the one in the spec, but leaving .URL for compatibility reasons.
+        readonly attribute DOMString url;
 
         // ready state
         const unsigned short CONNECTING = 0;