LayoutTests/ChangeLog

 12011-12-08 Dmitry Lomov <dslomov@google.com>
 2
 3 https://bugs.webkit.org/show_bug.cgi?id=73691
 4 [JSC] Implement correct order of window.postMessage arguments.
 5 This change supports a new signature of windowPostMessage:
 6 postMessage(message, targetOrigin[, transferrables])
 7 as well as the legacy webkit-proprietary:
 8 postMessage(message, [transferrables,] targetOrigin)
 9 The latter is only supported for cases when targetOrigin is a String.
 10
 11 Reviewed by NOBODY (OOPS!).
 12
 13 * fast/dom/Window/window-postmessage-args-expected.txt:
 14
 152011-12-08 Dmitry Lomov <dslomov@google.com>
 16
 17 Need a short description and bug URL (OOPS!)
 18
 19 Reviewed by NOBODY (OOPS!).
 20
 21 * fast/dom/Window/window-postmessage-args-expected.txt:
 22
1232011-12-08 Szilard Ledan <Ledan-Muntean.Szilard@stud.u-szeged.hu>
224
325 Add test for inline style block in HTML tag

LayoutTests/fast/dom/Window/window-postmessage-args-expected.txt

@@PASS: Posting message ('2', c): threw exception TypeError: Type error
66PASS: Posting message ('2', c): threw exception TypeError: Type error
77PASS: Posting message ('3', [object Object]): threw exception TypeError: Type error
88PASS: Posting message ('3', [object Object]): threw exception TypeError: Type error
9 FAIL: Posting message ('4', [object DOMWindow]): threw exception TypeError: Type error
10 FAIL: Posting message ('4', [object DOMWindow]): threw exception TypeError: Type error
 9PASS: Posting message ('4', [object DOMWindow]) did not throw an exception
 10PASS: Posting message ('4', [object DOMWindow]) did not throw an exception
1111PASS: Posting message ('4a', *) did not throw an exception
1212PASS: Posting message ('4a', *) did not throw an exception
1313PASS: Posting message ('5', null) did not throw an exception
1414PASS: Posting message ('5', null) did not throw an exception
1515PASS: Posting message ('6', undefined) did not throw an exception
1616PASS: Posting message ('6', undefined) did not throw an exception
17 FAIL: Posting message ('7', [object MessagePort],[object MessagePort]): threw exception TypeError: Type error
 17PASS: Posting message ('7', [object MessagePort],[object MessagePort]) did not throw an exception
1818PASS: Posting message ('7a', *) did not throw an exception
19 FAIL: Posting message ('7', [object MessagePort],[object MessagePort]): threw exception TypeError: Type error
 19PASS: Posting message ('7', [object MessagePort],[object MessagePort]) did not throw an exception
2020PASS: Posting message ('2147483648', null) did not throw an exception
2121PASS: Posting message ('2147483648', null) did not throw an exception
22 FAIL: Posting message ('[object MessagePort]', [object MessagePort],[object MessagePort]): threw exception TypeError: Type error
23 FAIL: Posting message ('[object MessagePort]', [object MessagePort],[object MessagePort]): threw exception TypeError: Type error
24 FAIL: Posting message ('[object MessagePort],[object MessagePort]', [object MessagePort],[object MessagePort]): threw exception TypeError: Type error
 22PASS: Posting message ('[object MessagePort]', [object MessagePort],[object MessagePort]) did not throw an exception
 23PASS: Posting message ('[object MessagePort]', [object MessagePort],[object MessagePort]) did not throw an exception
 24PASS: Posting message ('[object MessagePort],[object MessagePort]', [object MessagePort],[object MessagePort]) did not throw an exception
2525FAIL: Posting message ('[object ArrayBuffer]', [object ArrayBuffer]): threw exception TypeError: Type error
2626FAIL: arrayBuffer not neutered; byteLength = 30
2727FAIL: view was not neutered; length = 10
2828PASS: Posting message ('done', undefined) did not throw an exception
 29Received message '4' with 0 ports.
 30Received message '4' with 0 ports.
2931Received message '4a' with 0 ports.
3032Received message '4a' with 0 ports.
3133Received message '5' with 0 ports.
3234Received message '5' with 0 ports.
3335Received message '6' with 0 ports.
3436Received message '6' with 0 ports.
 37Received message '7' with 2 ports.
3538Received message '7a' with 2 ports.
 39Received message '7' with 2 ports.
3640Received message '2147483648' with 0 ports.
3741Received message '2147483648' with 0 ports.
 42Received message '[object Object]' with 2 ports.
 43Received message '[object MessagePort]' with 2 ports.
 44Received message '[object MessagePort],[object MessagePort]' with 2 ports.
3845Received message 'done' with 0 ports.
3946

Source/WebCore/ChangeLog

 12011-12-08 Dmitry Lomov <dslomov@google.com>
 2
 3 https://bugs.webkit.org/show_bug.cgi?id=73691
 4 [JSC] Implement correct order of window.postMessage arguments.
 5 This change supports a new signature of windowPostMessage:
 6 postMessage(message, targetOrigin[, transferrables])
 7 as well as the legacy webkit-proprietary:
 8 postMessage(message, [transferrables,] targetOrigin)
 9 The latter is only supported for cases when targetOrigin is a String.
 10
 11 Reviewed by NOBODY (OOPS!).
 12
 13 * bindings/js/JSDOMWindowCustom.cpp:
 14 (WebCore::handlePostMessage):
 15 * page/DOMWindow.idl:
 16
1172011-12-08 Kentaro Hara <haraken@chromium.org>
218
319 Use the [Supplemental] IDL for webaudio attributes in Chromium

Source/WebCore/bindings/js/JSDOMWindowCustom.cpp

@@JSValue JSDOMWindow::showModalDialog(ExecState* exec)
705705static JSValue handlePostMessage(DOMWindow* impl, ExecState* exec, bool doTransfer)
706706{
707707 MessagePortArray messagePorts;
708  if (exec->argumentCount() > 2)
709  fillMessagePortArray(exec, exec->argument(1), messagePorts);
 708
 709 // This function has variable arguments and can be:
 710 // Per current spec:
 711 // postMessage(message, targetOrigin)
 712 // postMessage(message, targetOrigin, {sequence of transferrables})
 713 // Legacy non-standard implementations in webkit allowed:
 714 // postMessage(message, {sequence of transferrables}, targetOrigin);
 715 int targetOriginArgIndex = 1;
 716 if (exec->argumentCount() > 2) {
 717 int transferablesArgIndex = 2;
 718 if (exec->argument(2).isString()) {
 719 targetOriginArgIndex = 2;
 720 transferablesArgIndex = 1;
 721 }
 722 fillMessagePortArray(exec, exec->argument(transferablesArgIndex), messagePorts);
 723 }
710724 if (exec->hadException())
711725 return jsUndefined();
712726

@@static JSValue handlePostMessage(DOMWindow* impl, ExecState* exec, bool doTransf
716730 if (exec->hadException())
717731 return jsUndefined();
718732
719  String targetOrigin = valueToStringWithUndefinedOrNullCheck(exec, exec->argument((exec->argumentCount() == 2) ? 1 : 2));
 733 String targetOrigin = valueToStringWithUndefinedOrNullCheck(exec, exec->argument(targetOriginArgIndex));
720734 if (exec->hadException())
721735 return jsUndefined();
722736

Source/WebCore/page/DOMWindow.idl

@@module window {
212212#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
213213 [DoNotCheckDomainSecurity, Custom] void postMessage(in SerializedScriptValue message, in DOMString targetOrigin)
214214 raises(DOMException);
215  [DoNotCheckDomainSecurity, Custom] void postMessage(in SerializedScriptValue message, in Array messagePorts, in DOMString targetOrigin)
 215 [DoNotCheckDomainSecurity, Custom] void postMessage(in SerializedScriptValue message, in DOMString targetOrigin, in Array messagePorts)
216216 raises(DOMException);
217217
218218 [DoNotCheckDomainSecurity, Custom] void webkitPostMessage(in SerializedScriptValue message, in DOMString targetOrigin)
219219 raises(DOMException);
220  [DoNotCheckDomainSecurity, Custom] void webkitPostMessage(in SerializedScriptValue message, in Array transferList, in DOMString targetOrigin)
 220 [DoNotCheckDomainSecurity, Custom] void webkitPostMessage(in SerializedScriptValue message, in DOMString targetOrigin, in Array transferList)
221221 raises(DOMException);
222222#else
223223 // There's no good way to expose an array via the ObjC bindings, so for now just allow passing in a single port.