Commit 1d759b09 authored by philipj@opera.com's avatar philipj@opera.com

Deprecate EventSource.URL and WebSocket.URL

Intent to Deprecate:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/1m47rW4w7dc/MOf_2kgb2wIJw

Review URL: https://codereview.chromium.org/422743002

git-svn-id: svn://svn.chromium.org/blink/trunk@179032 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent ab3e2499
CONSOLE WARNING: 'EventSource.URL' is deprecated. Please use 'EventSource.url' instead.
Both .URL and .url should work (for compatibility reasons).
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
......
CONSOLE WARNING: 'EventSource.URL' is deprecated. Please use 'EventSource.url' instead.
[Worker] Both .URL and .url should work (for compatibility reasons).
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
......
......@@ -18,7 +18,7 @@ function endTest()
}
var ws = new WebSocket("ws://127.0.0.1:8880/simple");
debug("Created a socket to '" + ws.URL + "'; readyState " + ws.readyState + ".");
debug("Created a socket to '" + ws.url + "'; readyState " + ws.readyState + ".");
ws.onopen = function()
{
......
CONSOLE WARNING: 'WebSocket.URL' is deprecated. Please use 'WebSocket.url' instead.
Both .URL and .url attributes should work (for compatibility reasons).
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
......
......@@ -8,9 +8,9 @@ PASS new WebSocket("ws://javascript:a") threw exception SyntaxError: Failed to c
PASS new WebSocket("/applet") threw exception SyntaxError: Failed to construct 'WebSocket': The URL '/applet' is invalid..
PASS new WebSocket("javascript:a") threw exception SyntaxError: Failed to construct 'WebSocket': The URL's scheme must be either 'ws' or 'wss'. 'javascript' is not allowed..
PASS new WebSocket("ws://127.0.0.1:25/") threw exception SecurityError: Failed to construct 'WebSocket': The port 25 is not allowed..
PASS (new WebSocket("ws://127.0.0.1:8880/a/../simple")).URL is "ws://127.0.0.1:8880/simple"
PASS (new WebSocket("ws://127.0.0.1:8880/simple?")).URL is "ws://127.0.0.1:8880/simple?"
PASS (new WebSocket("ws://127.0.0.1:8880/simple?k=v")).URL is "ws://127.0.0.1:8880/simple?k=v"
PASS (new WebSocket("ws://127.0.0.1:8880/a/../simple")).url is "ws://127.0.0.1:8880/simple"
PASS (new WebSocket("ws://127.0.0.1:8880/simple?")).url is "ws://127.0.0.1:8880/simple?"
PASS (new WebSocket("ws://127.0.0.1:8880/simple?k=v")).url is "ws://127.0.0.1:8880/simple?k=v"
PASS new WebSocket("ws://127.0.0.1/path#") threw exception SyntaxError: Failed to construct 'WebSocket': The URL contains a fragment identifier (''). Fragment identifiers are not allowed in WebSocket URLs..
PASS new WebSocket("ws://127.0.0.1/path#fragment") threw exception SyntaxError: Failed to construct 'WebSocket': The URL contains a fragment identifier ('fragment'). Fragment identifiers are not allowed in WebSocket URLs..
PASS new WebSocket("ws:://127.0.0.1/") threw exception SyntaxError: Failed to construct 'WebSocket': The URL 'ws:://127.0.0.1/' is invalid..
......
......@@ -29,9 +29,9 @@ shouldThrow('new WebSocket("ws://127.0.0.1:25/")');
// 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("ws://127.0.0.1:8880/a/../simple")).URL', '"ws://127.0.0.1:8880/simple"');
shouldBe('(new WebSocket("ws://127.0.0.1:8880/simple?")).URL', '"ws://127.0.0.1:8880/simple?"');
shouldBe('(new WebSocket("ws://127.0.0.1:8880/simple?k=v")).URL', '"ws://127.0.0.1:8880/simple?k=v"');
shouldBe('(new WebSocket("ws://127.0.0.1:8880/a/../simple")).url', '"ws://127.0.0.1:8880/simple"');
shouldBe('(new WebSocket("ws://127.0.0.1:8880/simple?")).url', '"ws://127.0.0.1:8880/simple?"');
shouldBe('(new WebSocket("ws://127.0.0.1:8880/simple?k=v")).url', '"ws://127.0.0.1:8880/simple?k=v"');
// The WebSocket API specification says If /url/ has a <fragment>
// component, then fail the parsing WebSocket URLs, so throw a SYNTAX_ERR
......
......@@ -739,6 +739,12 @@ String UseCounter::deprecationMessage(Feature feature)
case OpenWebDatabaseSyncInWorker:
return "'openDatabaseSync' is deprecated. Please switch to Indexed Database API.";
case EventSourceURL:
return "'EventSource.URL' is deprecated. Please use 'EventSource.url' instead.";
case WebSocketURL:
return "'WebSocket.URL' is deprecated. Please use 'WebSocket.url' instead.";
// Features that aren't deprecated don't have a deprecation message.
default:
return String();
......
......@@ -38,7 +38,7 @@
RaisesException=Constructor,
] interface EventSource : EventTarget {
[MeasureAs=EventSourceURL] readonly attribute DOMString URL; // Lowercased .url is the one in the spec, but leaving .URL for compatibility reasons.
[DeprecateAs=EventSourceURL] readonly attribute DOMString URL; // Lowercased .url is the one in the spec, but leaving .URL for compatibility reasons.
readonly attribute DOMString url;
readonly attribute boolean withCredentials;
......
......@@ -46,7 +46,7 @@ enum BinaryType { "blob", "arraybuffer" };
WillBeGarbageCollected,
ImplementedAs=DOMWebSocket,
] interface WebSocket : EventTarget {
[MeasureAs=WebSocketURL] readonly attribute DOMString URL; // Lowercased .url is the one in the spec, but leaving .URL for compatibility reasons.
[DeprecateAs=WebSocketURL] readonly attribute DOMString URL; // Lowercased .url is the one in the spec, but leaving .URL for compatibility reasons.
readonly attribute DOMString url;
// ready state
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment