Commit 79bb5ebb authored by abarth@webkit.org's avatar abarth@webkit.org
Browse files

Remove webkitPostMessage

https://bugs.webkit.org/show_bug.cgi?id=96577

Reviewed by Ojan Vafai.

.:

Add ENABLE_LEGACY_VENDOR_PREFIXES flag.

* Source/cmake/WebKitFeatures.cmake:
* Source/cmakeconfig.h.cmake:

Source/JavaScriptCore:

Add ENABLE_LEGACY_VENDOR_PREFIXES flag.

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

webkitPostMessage works the same as postMessage. The spec and the
implementation have been stable for a while. We should no longer be
exposing this vendor-prefixed API.

This patch places the webkitPostMessage API behind an ENABLE flag.
We're going to try removing this API in the Chromium port. If we don't
run into trouble, we'll remove it in all the other ports as well.

This topic has been discussed on webkit-dev in
http://lists.webkit.org/pipermail/webkit-dev/2012-April/020237.html and
http://lists.webkit.org/pipermail/webkit-dev/2012-September/022189.html

This patch introduces the ENABLE(LEGACY_VENDOR_PREFIXES) flag. Rather
than having a flag for each vendor-prefixed API we're experimenting
with removing, we'll add vendor prefixed APIs to this ENABLE when we
want to try removing them. If we succeed, we'll just delete the APIs.
If we fail, we'll remove them from the ENABLE. That way we avoid the
churn of adding and removing many ENABLE macros.

* Configurations/FeatureDefines.xcconfig:
* GNUmakefile.am:
* GNUmakefile.features.am:
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore):
* bindings/js/JSDedicatedWorkerContextCustom.cpp:
(WebCore):
* bindings/js/JSMessagePortCustom.cpp:
(WebCore):
* bindings/js/JSWorkerCustom.cpp:
(WebCore):
* bindings/v8/custom/V8DOMWindowCustom.cpp:
(WebCore):
* bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp:
(WebCore):
* bindings/v8/custom/V8MessagePortCustom.cpp:
(WebCore):
* bindings/v8/custom/V8WorkerCustom.cpp:
(WebCore):
* dom/MessagePort.idl:
* page/DOMWindow.idl:
* workers/DedicatedWorkerContext.idl:
* workers/Worker.idl:

Source/WebKit/chromium:

Add ENABLE_LEGACY_VENDOR_PREFIXES flag.

* features.gypi:

Source/WebKit/mac:

Add ENABLE_LEGACY_VENDOR_PREFIXES flag.

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

Add ENABLE_LEGACY_VENDOR_PREFIXES flag.

* Configurations/FeatureDefines.xcconfig:

Tools:

Add ENABLE_LEGACY_VENDOR_PREFIXES flag.

* Scripts/webkitperl/FeatureList.pm:
* qmake/mkspecs/features/features.pri:

LayoutTests:

Update tests to rely only upon the unprefixed API.

* fast/canvas/webgl/script-tests/arraybuffer-transfer-of-control.js:
(wrapSend):
(wrapFailSend):
* fast/dom/Window/post-message-crash.html:
* fast/dom/Window/window-postmessage-args-expected.txt:
* fast/dom/Window/window-postmessage-args.html:
* fast/events/message-port.html:
* fast/events/resources/message-port-multi.js:
* fast/workers/resources/worker-call.js:
* fast/workers/worker-call-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128658 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 73a1c7fd
2012-09-14 Adam Barth <abarth@webkit.org>
Remove webkitPostMessage
https://bugs.webkit.org/show_bug.cgi?id=96577
Reviewed by Ojan Vafai.
Add ENABLE_LEGACY_VENDOR_PREFIXES flag.
* Source/cmake/WebKitFeatures.cmake:
* Source/cmakeconfig.h.cmake:
2012-09-14 Jeffrey Pfau <jpfau@apple.com>
Allow third-party storage blocking setting to change while a page is loaded
......
2012-09-14 Adam Barth <abarth@webkit.org>
Remove webkitPostMessage
https://bugs.webkit.org/show_bug.cgi?id=96577
Reviewed by Ojan Vafai.
Update tests to rely only upon the unprefixed API.
* fast/canvas/webgl/script-tests/arraybuffer-transfer-of-control.js:
(wrapSend):
(wrapFailSend):
* fast/dom/Window/post-message-crash.html:
* fast/dom/Window/window-postmessage-args-expected.txt:
* fast/dom/Window/window-postmessage-args.html:
* fast/events/message-port.html:
* fast/events/resources/message-port-multi.js:
* fast/workers/resources/worker-call.js:
* fast/workers/worker-call-expected.txt:
2012-09-14 Simon Fraser <simon.fraser@apple.com>
 
REGRESSION: transition doesn’t always override transition-property
......@@ -242,9 +242,9 @@ function checkEmptyArray(testName, array)
function wrapSend(testName, message, xfer)
{
try {
window.webkitPostMessage(message, '*', xfer);
window.postMessage(message, '*', xfer);
} catch (e) {
testFailed(testName + ": could not webkitPostMessage: " + e);
testFailed(testName + ": could not postMessage: " + e);
doneTest();
return false;
}
......@@ -254,11 +254,11 @@ function wrapSend(testName, message, xfer)
function wrapFailSend(testName, message, xfer)
{
try {
window.webkitPostMessage(message, '*', xfer);
window.postMessage(message, '*', xfer);
} catch (e) {
return true;
}
testFailed(testName + ": expected webkitPostMessage to fail but it didn't.");
testFailed(testName + ": expected postMessage to fail but it didn't.");
return false;
}
......
......@@ -23,8 +23,8 @@ window.onerror = function() {
return true;
};
webkitRequestAnimationFrame(webkitPostMessage);
setTimeout(webkitPostMessage);
webkitRequestAnimationFrame(postMessage);
setTimeout(postMessage);
if (window.testRunner)
testRunner.display();
......@@ -36,4 +36,4 @@ setTimeout(function() {
</script>
</body>
</html>
\ No newline at end of file
</html>
Test that the second argument of window.postMessage is ignored or triggers an error if it is not a message port. You should see PASS message '1' through '7', followed by 'done', with messages 4-7 received below.
PASS: Posting message ('1', 1): threw exception TypeError: Type error
PASS: Posting message ('1', 1): threw exception TypeError: Type error
PASS: Posting message ('2', c): threw exception TypeError: Type error
PASS: Posting message ('2', c): threw exception TypeError: Type error
PASS: Posting message ('3', [object Object]): threw exception TypeError: Type error
PASS: Posting message ('3', [object Object]): threw exception TypeError: Type error
PASS: Posting message ('4', [object Window]) did not throw an exception
PASS: Posting message ('4', [object Window]) did not throw an exception
PASS: Posting message ('4a', *) did not throw an exception
PASS: Posting message ('4a', *) did not throw an exception
PASS: Posting message ('5', null) did not throw an exception
PASS: Posting message ('5', null) did not throw an exception
PASS: Posting message ('6', undefined) did not throw an exception
PASS: Posting message ('6', undefined) did not throw an exception
PASS: Posting message ('7', [object MessagePort],[object MessagePort]) did not throw an exception
PASS: Posting message ('7a', *) did not throw an exception
PASS: Posting message ('7', [object MessagePort],[object MessagePort]) did not throw an exception
PASS: Posting message ('2147483648', null) did not throw an exception
PASS: Posting message ('2147483648', null) did not throw an exception
PASS: Posting message ('[object MessagePort]', [object MessagePort],[object MessagePort]) did not throw an exception
PASS: Posting message ('[object MessagePort]', [object MessagePort],[object MessagePort]) did not throw an exception
PASS: Posting message ('[object MessagePort],[object MessagePort]', [object MessagePort],[object MessagePort]) did not throw an exception
......@@ -27,18 +19,13 @@ PASS: arrayBuffer neutered
PASS: view neutered
PASS: Posting message ('done', undefined) did not throw an exception
Received message '4' with 0 ports.
Received message '4' with 0 ports.
Received message '4a' with 0 ports.
Received message '4a' with 0 ports.
Received message '5' with 0 ports.
Received message '5' with 0 ports.
Received message '6' with 0 ports.
Received message '6' with 0 ports.
Received message '7' with 2 ports.
Received message '7a' with 2 ports.
Received message '7' with 2 ports.
Received message '2147483648' with 0 ports.
Received message '2147483648' with 0 ports.
Received message '[object MessagePort]' with 2 ports.
Received message '[object MessagePort]' with 2 ports.
Received message '[object MessagePort],[object MessagePort]' with 2 ports.
......
......@@ -37,7 +37,6 @@ function tryPostMessageFunction(postMessageFunction, first, second, third, shoul
function tryPostMessage(first, second, third, shouldFail) {
tryPostMessageFunction(window.postMessage, first, second, third, shouldFail);
tryPostMessageFunction(window.webkitPostMessage, first, second, third, shouldFail);
}
document.getElementById("description").innerHTML = "Test that the second argument of window.postMessage is ignored or triggers an error if it is not a message port. You should see PASS message '1' through '7', followed by 'done', with messages 4-7 received below.<br><br>";
......@@ -54,18 +53,18 @@ tryPostMessageFunction(window.postMessage, '7', '*', [channel1.port1, channel1.p
var channel1a = new MessageChannel;
tryPostMessageFunction(window.postMessage, '7a', [channel1a.port1, channel1a.port2], '*');
var channel2 = new MessageChannel;
tryPostMessageFunction(window.webkitPostMessage, '7', '*', [channel2.port1, channel2.port2]);
tryPostMessageFunction(window.postMessage, '7', '*', [channel2.port1, channel2.port2]);
var channel3 = new MessageChannel;
tryPostMessage(2147483648, '*', null);
tryPostMessageFunction(window.postMessage, channel3.port1, '*', [channel3.port1, channel3.port2]);
var channel4 = new MessageChannel;
tryPostMessageFunction(window.webkitPostMessage, channel4.port1, '*', [channel4.port1, channel4.port2]);
tryPostMessageFunction(window.postMessage, channel4.port1, '*', [channel4.port1, channel4.port2]);
var channel5 = new MessageChannel;
tryPostMessageFunction(window.webkitPostMessage, [channel5.port1, channel5.port2], '*', [channel5.port1, channel5.port2]);
tryPostMessageFunction(window.postMessage, [channel5.port1, channel5.port2], '*', [channel5.port1, channel5.port2]);
var arrayBuffer = new ArrayBuffer(30);
var int8View = new Int8Array(arrayBuffer, 2, 10);
tryPostMessageFunction(window.webkitPostMessage, arrayBuffer, '*', [arrayBuffer]);
tryPostMessageFunction(window.postMessage, arrayBuffer, '*', [arrayBuffer]);
if (!(arrayBuffer.byteLength === 0)) {
console.innerHTML += "FAIL: arrayBuffer not neutered; byteLength = " + arrayBuffer.byteLength + "<br>";
}
......
......@@ -20,7 +20,7 @@ var currentTest = 0;
function nextTest()
{
var fun = currentTest % 2 == 0 ? "postMessage" : "webkitPostMessage";
var fun = "postMessage";
var testFunNo = Math.floor(currentTest / 2);
if (testFunNo < allTests.length)
{
......
......@@ -38,14 +38,14 @@ function testTransfers() {
var channel0 = new MessageChannel();
var c1 = new MessageChannel();
channel0.port1.webkitPostMessage({id:"send-port", port:c1.port1}, [c1.port1]);
channel0.port1.postMessage({id:"send-port", port:c1.port1}, [c1.port1]);
var c2 = new MessageChannel();
channel0.port1.webkitPostMessage({id:"send-port-twice", port0:c2.port1, port1:c2.port1}, [c2.port1]);
channel0.port1.postMessage({id:"send-port-twice", port0:c2.port1, port1:c2.port1}, [c2.port1]);
var c3 = new MessageChannel();
channel0.port1.webkitPostMessage({id:"send-two-ports", port0:c3.port1, port1:c3.port2}, [c3.port1, c3.port2]);
channel0.port1.postMessage({id:"send-two-ports", port0:c3.port1, port1:c3.port2}, [c3.port1, c3.port2]);
var c4 = new MessageChannel();
try {
channel0.port1.webkitPostMessage({id:"host-object", hostObject:c3, port:c4.port1}, [c4.port1]);
channel0.port1.postMessage({id:"host-object", hostObject:c3, port:c4.port1}, [c4.port1]);
testFailed("Sending host object should throw");
} catch(e) {
if (e.code == DOMException.DATA_CLONE_ERR)
......@@ -54,7 +54,7 @@ function testTransfers() {
testFailed("Sending host object should throw a DataCloneError, got: " + e);
}
try {
channel0.port1.webkitPostMessage({id:"host-object2", hostObject:navigator, port:c4.port1}, [c4.port1]);
channel0.port1.postMessage({id:"host-object2", hostObject:navigator, port:c4.port1}, [c4.port1]);
testFailed("Sending host object should throw");
} catch(e) {
if (e.code == DOMException.DATA_CLONE_ERR)
......@@ -64,7 +64,7 @@ function testTransfers() {
}
try {
var f1 = function() {}
channel0.port1.webkitPostMessage({id:"function-object", function:f1, port:c4.port1}, [c4.port1]);
channel0.port1.postMessage({id:"function-object", function:f1, port:c4.port1}, [c4.port1]);
testFailed("Sending Function object should throw");
} catch(e) {
if (e.code == DOMException.DATA_CLONE_ERR)
......@@ -74,7 +74,7 @@ function testTransfers() {
}
try {
var err = new Error();
channel0.port1.webkitPostMessage({id:"error-object", error:err, port:c4.port1}, [c4.port1]);
channel0.port1.postMessage({id:"error-object", error:err, port:c4.port1}, [c4.port1]);
testFailed("Sending Error object should throw");
} catch(e) {
if (e.code == DOMException.DATA_CLONE_ERR)
......@@ -83,7 +83,7 @@ function testTransfers() {
testPassed("Sending Error object should throw a DataCloneError, got: " + e);
}
c4.port1.postMessage("Should succeed");
channel0.port1.webkitPostMessage({id:"done"});
channel0.port1.postMessage({id:"done"});
channel0.port2.onmessage = function(event) {
if (event.data.id == "send-port") {
......
postMessage("SUCCESS: postMessage() called directly");
webkitPostMessage("SUCCESS: webkitPostMessage() called directly");
postMessage.call(null, "SUCCESS: postMessage() invoked via postMessage.call()");
webkitPostMessage.call(null, "SUCCESS: webkitPostMessage() invoked via webkitPostMessage.call()");
var saved = postMessage;
saved("SUCCESS: postMessage() called via intermediate variable");
var saved1 = webkitPostMessage;
saved1("SUCCESS: webkitPostMessage() called via intermediate variable");
postMessage("DONE");
Test calling functions from WorkerContext. Should print multiple SUCCESS lines, followed by DONE.
SUCCESS: postMessage() called directly
SUCCESS: webkitPostMessage() called directly
SUCCESS: postMessage() invoked via postMessage.call()
SUCCESS: webkitPostMessage() invoked via webkitPostMessage.call()
SUCCESS: postMessage() called via intermediate variable
SUCCESS: webkitPostMessage() called via intermediate variable
DONE
2012-09-14 Adam Barth <abarth@webkit.org>
Remove webkitPostMessage
https://bugs.webkit.org/show_bug.cgi?id=96577
Reviewed by Ojan Vafai.
Add ENABLE_LEGACY_VENDOR_PREFIXES flag.
* Configurations/FeatureDefines.xcconfig:
2012-09-14 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
 
[Qt] Make force_static_libs_as_shared work on Mac OS
......
......@@ -95,6 +95,7 @@ ENABLE_LEGACY_NOTIFICATIONS_macosx = $(ENABLE_LEGACY_NOTIFICATIONS_macosx_$(TARG
ENABLE_LEGACY_NOTIFICATIONS_macosx_1070 = ;
ENABLE_LEGACY_NOTIFICATIONS_macosx_1080 = ENABLE_LEGACY_NOTIFICATIONS;
ENABLE_LEGACY_NOTIFICATIONS_macosx_1090 = ENABLE_LEGACY_NOTIFICATIONS;
ENABLE_LEGACY_VENDOR_PREFIXES = ENABLE_LEGACY_VENDOR_PREFIXES;
ENABLE_LINK_PREFETCH = ;
ENABLE_LINK_PRERENDER = ;
ENABLE_MATHML = ENABLE_MATHML;
......@@ -139,4 +140,4 @@ ENABLE_WIDGET_REGION_macosx = ENABLE_WIDGET_REGION;
ENABLE_WORKERS = ENABLE_WORKERS;
ENABLE_XSLT = ENABLE_XSLT;
FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ANIMATION_API) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_HIERARCHIES) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_STICKY_POSITION) $(ENABLE_CSS_VARIABLES) $(ENABLE_CSS3_TEXT_DECORATION) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MICRODATA) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PROGRESS_ELEMENT) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_UNDO_MANAGER) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WIDGET_REGION) $(ENABLE_WORKERS) $(ENABLE_XSLT);
FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ANIMATION_API) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_HIERARCHIES) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_STICKY_POSITION) $(ENABLE_CSS_VARIABLES) $(ENABLE_CSS3_TEXT_DECORATION) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MICRODATA) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PROGRESS_ELEMENT) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_UNDO_MANAGER) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WIDGET_REGION) $(ENABLE_WORKERS) $(ENABLE_XSLT);
2012-09-14 Adam Barth <abarth@webkit.org>
Remove webkitPostMessage
https://bugs.webkit.org/show_bug.cgi?id=96577
Reviewed by Ojan Vafai.
webkitPostMessage works the same as postMessage. The spec and the
implementation have been stable for a while. We should no longer be
exposing this vendor-prefixed API.
This patch places the webkitPostMessage API behind an ENABLE flag.
We're going to try removing this API in the Chromium port. If we don't
run into trouble, we'll remove it in all the other ports as well.
This topic has been discussed on webkit-dev in
http://lists.webkit.org/pipermail/webkit-dev/2012-April/020237.html and
http://lists.webkit.org/pipermail/webkit-dev/2012-September/022189.html
This patch introduces the ENABLE(LEGACY_VENDOR_PREFIXES) flag. Rather
than having a flag for each vendor-prefixed API we're experimenting
with removing, we'll add vendor prefixed APIs to this ENABLE when we
want to try removing them. If we succeed, we'll just delete the APIs.
If we fail, we'll remove them from the ENABLE. That way we avoid the
churn of adding and removing many ENABLE macros.
* Configurations/FeatureDefines.xcconfig:
* GNUmakefile.am:
* GNUmakefile.features.am:
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore):
* bindings/js/JSDedicatedWorkerContextCustom.cpp:
(WebCore):
* bindings/js/JSMessagePortCustom.cpp:
(WebCore):
* bindings/js/JSWorkerCustom.cpp:
(WebCore):
* bindings/v8/custom/V8DOMWindowCustom.cpp:
(WebCore):
* bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp:
(WebCore):
* bindings/v8/custom/V8MessagePortCustom.cpp:
(WebCore):
* bindings/v8/custom/V8WorkerCustom.cpp:
(WebCore):
* dom/MessagePort.idl:
* page/DOMWindow.idl:
* workers/DedicatedWorkerContext.idl:
* workers/Worker.idl:
2012-09-14 Simon Fraser <simon.fraser@apple.com>
 
REGRESSION: transition doesn’t always override transition-property
......@@ -96,6 +96,7 @@ ENABLE_LEGACY_NOTIFICATIONS_macosx = $(ENABLE_LEGACY_NOTIFICATIONS_macosx_$(TARG
ENABLE_LEGACY_NOTIFICATIONS_macosx_1070 = ;
ENABLE_LEGACY_NOTIFICATIONS_macosx_1080 = ENABLE_LEGACY_NOTIFICATIONS;
ENABLE_LEGACY_NOTIFICATIONS_macosx_1090 = ENABLE_LEGACY_NOTIFICATIONS;
ENABLE_LEGACY_VENDOR_PREFIXES = ENABLE_LEGACY_VENDOR_PREFIXES;
ENABLE_LINK_PREFETCH = ;
ENABLE_LINK_PRERENDER = ;
ENABLE_MATHML = ENABLE_MATHML;
......@@ -140,4 +141,4 @@ ENABLE_WIDGET_REGION_macosx = ENABLE_WIDGET_REGION;
ENABLE_WORKERS = ENABLE_WORKERS;
ENABLE_XSLT = ENABLE_XSLT;
FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ANIMATION_API) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_HIERARCHIES) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_STICKY_POSITION) $(ENABLE_CSS_VARIABLES) $(ENABLE_CSS3_TEXT_DECORATION) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MICRODATA) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PROGRESS_ELEMENT) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_UNDO_MANAGER) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WIDGET_REGION) $(ENABLE_WORKERS) $(ENABLE_XSLT);
FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ANIMATION_API) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_HIERARCHIES) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_STICKY_POSITION) $(ENABLE_CSS_VARIABLES) $(ENABLE_CSS3_TEXT_DECORATION) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MICRODATA) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PROGRESS_ELEMENT) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_UNDO_MANAGER) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WIDGET_REGION) $(ENABLE_WORKERS) $(ENABLE_XSLT);
......@@ -460,6 +460,15 @@ else
feature_defines_overrides += ENABLE_BLOB=0
endif # END ENABLE_BLOB
# ---
# Legacy vendor prefixes support
# ---
if ENABLE_LEGACY_VENDOR_PREFIXES
feature_defines_overrides += ENABLE_LEGACY_VENDOR_PREFIXES=1
else
feature_defines_overrides += ENABLE_LEGACY_VENDOR_PREFIXES=0
endif # END ENABLE_LEGACY_VENDOR_PREFIXES
# ---
# Legacy WebKitBlobBuilder support
# ---
......
......@@ -47,6 +47,7 @@ feature_defines_defaults += \
ENABLE_JAVASCRIPT_DEBUGGER=1 \
ENABLE_LEGACY_CSS_VENDOR_PREFIXES=0 \
ENABLE_LEGACY_NOTIFICATIONS=0 \
ENABLE_LEGACY_VENDOR_PREFIXES=1 \
ENABLE_LEGACY_WEBKIT_BLOB_BUILDER=1 \
ENABLE_LINK_PREFETCH=1 \
ENABLE_LINK_PRERENDER=0 \
......
......@@ -693,10 +693,12 @@ JSValue JSDOMWindow::postMessage(ExecState* exec)
return handlePostMessage(impl(), exec);
}
#if ENABLE(LEGACY_VENDOR_PREFIXES)
JSValue JSDOMWindow::webkitPostMessage(ExecState* exec)
{
return handlePostMessage(impl(), exec);
}
#endif
JSValue JSDOMWindow::setTimeout(ExecState* exec)
{
......
......@@ -47,10 +47,12 @@ JSC::JSValue JSDedicatedWorkerContext::postMessage(JSC::ExecState* exec)
return handlePostMessage(exec, impl());
}
#if ENABLE(LEGACY_VENDOR_PREFIXES)
JSC::JSValue JSDedicatedWorkerContext::webkitPostMessage(JSC::ExecState* exec)
{
return handlePostMessage(exec, impl());
}
#endif
} // namespace WebCore
......
......@@ -63,10 +63,12 @@ JSC::JSValue JSMessagePort::postMessage(JSC::ExecState* exec)
return handlePostMessage(exec, impl());
}
#if ENABLE(LEGACY_VENDOR_PREFIXES)
JSC::JSValue JSMessagePort::webkitPostMessage(JSC::ExecState* exec)
{
return handlePostMessage(exec, impl());
}
#endif
void fillMessagePortArray(JSC::ExecState* exec, JSC::JSValue value, MessagePortArray& portArray, ArrayBufferArray& arrayBuffers)
{
......
......@@ -45,10 +45,12 @@ JSC::JSValue JSWorker::postMessage(JSC::ExecState* exec)
return handlePostMessage(exec, impl());
}
#if ENABLE(LEGACY_VENDOR_PREFIXES)
JSC::JSValue JSWorker::webkitPostMessage(JSC::ExecState* exec)
{
return handlePostMessage(exec, impl());
}
#endif
EncodedJSValue JSC_HOST_CALL JSWorkerConstructor::constructJSWorker(ExecState* exec)
{
......
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