Bug 1333901 - support document.createEvent(ErrorEvent), r=masayuki

--HG--
extra : rebase_source : c0cb764a8d7d99fb681cafb7c99bb334627299c8
This commit is contained in:
Olli Pettay 2017-01-26 12:00:16 +02:00
parent 3eadc5827f
commit 68d3ebc645
3 changed files with 15 additions and 5 deletions

View File

@ -26,6 +26,7 @@
#include "mozilla/dom/CloseEvent.h"
#include "mozilla/dom/CustomEvent.h"
#include "mozilla/dom/DeviceOrientationEvent.h"
#include "mozilla/dom/ErrorEvent.h"
#include "mozilla/dom/EventTarget.h"
#include "mozilla/dom/FocusEvent.h"
#include "mozilla/dom/HashChangeEvent.h"
@ -1164,6 +1165,13 @@ EventDispatcher::CreateEvent(EventTarget* aOwner,
event->MarkUninitialized();
return event.forget();
}
if (aEventType.LowerCaseEqualsLiteral("errorevent")) {
LOG_EVENT_CREATION(ERROREVENT);
RefPtr<Event> event =
ErrorEvent::Constructor(aOwner, EmptyString(), ErrorEventInit());
event->MarkUninitialized();
return event.forget();
}
#undef LOG_EVENT_CREATION

View File

@ -1,5 +0,0 @@
[Worker_dispatchEvent_ErrorEvent.htm]
type: testharness
[document.createEvent('ErrorEvent')]
expected: FAIL

View File

@ -282,6 +282,13 @@
"kind": "count",
"bug_numbers": [1295588, 1251198]
},
"CREATE_EVENT_ERROREVENT" : {
"alert_emails": ["ayg@aryeh.name"],
"description": "Was document.createEvent(\"errorevent\") ever called",
"expires_in_version": "56",
"kind": "count",
"bug_numbers": [1295588, 1251198, 1333901]
},
"CREATE_EVENT_EVENT" : {
"alert_emails": ["ayg@aryeh.name"],
"description": "Was document.createEvent(\"event\") ever called",