Changeset 201835 in webkit
- Timestamp:
- Jun 8, 2016 3:14:55 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r201832 r201835 1 2016-06-08 Chris Dumez <cdumez@apple.com> 2 3 First parameter to MessagePort / DedicatedWorkerGlobalScope.postMessage() should be mandatory 4 https://bugs.webkit.org/show_bug.cgi?id=158540 5 6 Reviewed by Geoffrey Garen. 7 8 Add test coverage. 9 10 * fast/files/workers/inline-worker-via-blob-url.html: 11 * fast/workers/postMessage-missing-parameter-expected.txt: Added. 12 * fast/workers/postMessage-missing-parameter.html: Added. 13 * fast/workers/worker-messageport-expected.txt: 14 * fast/workers/worker-messageport.html: 15 1 16 2016-06-08 Nan Wang <n_wang@apple.com> 2 17 -
trunk/LayoutTests/fast/files/workers/inline-worker-via-blob-url.html
r125149 r201835 24 24 testRunner.notifyDone(); 25 25 }; 26 worker.postMessage( );26 worker.postMessage("message"); 27 27 } 28 28 -
trunk/LayoutTests/fast/workers/worker-messageport-expected.txt
r93709 r201835 5 5 PASS: Received response from Worker via MessagePort 6 6 PASS: Got port from worker 7 PASS: Calling MessagePort.postMessage() without parameter threw exception: TypeError: Not enough arguments 7 8 PASS: Received final response from worker 8 9 PASS: Got 1000 messages -
trunk/LayoutTests/fast/workers/worker-messageport.html
r124680 r201835 52 52 } else { 53 53 log("PASS: Got port from worker"); 54 try { 55 // Missing parameter, should throw. 56 evt.ports[0].postMessage(); 57 log("FAIL: Calling MessagePort.postMessage() without parameter did not throw."); 58 } catch (e) { 59 log("PASS: Calling MessagePort.postMessage() without parameter threw exception: " + e); 60 } 54 61 evt.ports[0].postMessage("ping"); 55 62 evt.ports[0].onmessage = function(evt) { -
trunk/Source/WebCore/ChangeLog
r201834 r201835 1 2016-06-08 Chris Dumez <cdumez@apple.com> 2 3 First parameter to MessagePort / DedicatedWorkerGlobalScope.postMessage() should be mandatory 4 https://bugs.webkit.org/show_bug.cgi?id=158540 5 6 Reviewed by Geoffrey Garen. 7 8 First parameter to MessagePort / DedicatedWorkerGlobalScope.postMessage() should be mandatory: 9 - https://html.spec.whatwg.org/multipage/comms.html#messageport 10 - https://html.spec.whatwg.org/multipage/workers.html#dedicated-workers-and-the-dedicatedworkerglobalscope-interface 11 12 Previously, WebKit send a bogus MessageEvent whose data attribute is undefined. This would 13 cause a testharness error when running the following W3C test: 14 - http://w3c-test.org/workers/interfaces.worker 15 16 Firefox and Chrome already correctly throw in this case. Our Window.postMessage() API is also 17 already throwing in this case. 18 19 Test: fast/workers/postMessage-missing-parameter.html 20 21 * bindings/js/JSMessagePortCustom.h: 22 (WebCore::handlePostMessage): 23 1 24 2016-06-08 Gavin Barraclough <barraclough@apple.com> 2 25 -
trunk/Source/WebCore/bindings/js/JSMessagePortCustom.h
r190036 r201835 33 33 34 34 #include "MessagePort.h" 35 #include <runtime/Error.h> 35 36 #include <runtime/JSCInlines.h> 36 37 #include <runtime/JSCJSValue.h> … … 50 51 inline JSC::JSValue handlePostMessage(JSC::ExecState& state, T* impl) 51 52 { 53 if (UNLIKELY(state.argumentCount() < 1)) 54 return state.vm().throwException(&state, createNotEnoughArgumentsError(&state)); 55 52 56 MessagePortArray portArray; 53 57 ArrayBufferArray arrayBufferArray; 54 58 fillMessagePortArray(state, state.argument(1), portArray, arrayBufferArray); 55 RefPtr<SerializedScriptValue> message = SerializedScriptValue::create(&state, state. argument(0), &portArray, &arrayBufferArray);59 RefPtr<SerializedScriptValue> message = SerializedScriptValue::create(&state, state.uncheckedArgument(0), &portArray, &arrayBufferArray); 56 60 if (state.hadException()) 57 61 return JSC::jsUndefined();
Note: See TracChangeset
for help on using the changeset viewer.