Commit 70fae526 authored by atwilson@chromium.org's avatar atwilson@chromium.org

MessageEvent should not be cancelable by default

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

Reviewed by Darin Adler.

WebCore:

* dom/MessageEvent.cpp:
(WebCore::MessageEvent::MessageEvent):
Changed constructor to set cancelable=false by default, per the HTML5 spec.

LayoutTests:

* fast/events/message-port-expected.txt:
* fast/events/message-port.html:
Added test case to check state of MessageEvent.cancelable attribute.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48395 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent ef410ecd
2009-09-15 Drew Wilson <atwilson@google.com>
Reviewed by Darin Adler.
MessageEvent should not be cancelable by default
https://bugs.webkit.org/show_bug.cgi?id=27846
* fast/events/message-port-expected.txt:
* fast/events/message-port.html:
Added test case to check state of MessageEvent.cancelable attribute.
2009-09-15 Charles Wei <charles.wei@torchmobile.com.cn>
Reviewed by George Staikos.
......
......@@ -6,5 +6,6 @@ Simple exchange: SUCCESS
Posted port: SUCCESS
Event Listener: SUCCESS
Closed port: SUCCESS
MessageEvent.cancelable defaults to false: PASS
DONE
......@@ -82,7 +82,21 @@ function test5()
// Create a channel and put some messages in it which will go undelivered and should not leak
var channel = new MessageChannel;
channel.port1.postMessage("abcde");
// Now wait a short period of time to ensure no messages come in from previous tests.
test6();
}
function test6()
{
var channel = new MessageChannel;
channel.port1.postMessage("howdy");
channel.port2.onmessage = function(event) {
log("MessageEvent.cancelable defaults to " + event.cancelable + ": " + (event.cancelable ? "FAIL" : "PASS"));
done();
}
}
function done() {
// Wait a short period of time to ensure no messages come in from previous tests.
setTimeout(function() {
log("DONE");
if (window.layoutTestController)
......
2009-09-15 Drew Wilson <atwilson@google.com>
Reviewed by Darin Adler.
MessageEvent should not be cancelable by default
https://bugs.webkit.org/show_bug.cgi?id=27846
* dom/MessageEvent.cpp:
(WebCore::MessageEvent::MessageEvent):
Changed constructor to set cancelable=false by default, per the HTML5 spec.
2009-09-15 Charles Wei <charles.wei@torchmobile.com.cn>
Reviewed by George Staikos.
......@@ -38,7 +38,7 @@ MessageEvent::MessageEvent()
}
MessageEvent::MessageEvent(const String& data, const String& origin, const String& lastEventId, PassRefPtr<DOMWindow> source, PassOwnPtr<MessagePortArray> ports)
: Event(eventNames().messageEvent, false, true)
: Event(eventNames().messageEvent, false, false)
, m_data(data)
, m_origin(origin)
, m_lastEventId(lastEventId)
......
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