Run new MessageEvent constructor instead of initMessageEvent in Firefox.

BUG=
R=blois@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37843 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
efortuna@google.com 2014-06-30 23:03:00 +00:00
parent 6c4eff32c9
commit d00d127379
4 changed files with 14 additions and 3 deletions

View file

@ -18415,6 +18415,11 @@ class MessageEvent extends Event native "MessageEvent" {
if (source == null) {
source = window;
}
if (!Device.isIE) {
return JS('MessageEvent', 'new MessageEvent(#, {bubbles: #, cancelable: #, data: #, origin: #, lastEventId: #, source: #, ports: #})',
type, canBubble, cancelable, data, origin, lastEventId, source,
messagePorts);
}
var event = document._createEvent("MessageEvent");
event._initMessageEvent(type, canBubble, cancelable, data, origin,
lastEventId, source, messagePorts);

View file

@ -400,8 +400,6 @@ speechrecognition_test/supported: Fail
websql_test/supported: Fail
[ $runtime == ff ]
messageevent_test: RuntimeError # Issue 15651
serialized_script_value_test: RuntimeError # Issue 15651
client_rect_test: Fail # Issue 16890
[ $runtime == ff ]

View file

@ -6,7 +6,7 @@ import 'dart:html';
main() {
useHtmlConfiguration();
test('MessageEvent.initMessageEvent', () {
test('new MessageEvent', () {
final event = new MessageEvent('type', cancelable: true, data: 'data',
origin: 'origin', lastEventId: 'lastEventId');

View file

@ -14,6 +14,14 @@ $(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
if (source == null) {
source = window;
}
$if DART2JS
if (!Device.isIE) { // TODO: This if check should be removed once IE
// implements the constructor.
return JS('MessageEvent', 'new MessageEvent(#, {bubbles: #, cancelable: #, data: #, origin: #, lastEventId: #, source: #, ports: #})',
type, canBubble, cancelable, data, origin, lastEventId, source,
messagePorts);
}
$endif
var event = document._createEvent("MessageEvent");
event._initMessageEvent(type, canBubble, cancelable, data, origin,
lastEventId, source, messagePorts);