From 7d2442617201c0b1112c7aa5901aa19eb0e7537a Mon Sep 17 00:00:00 2001 From: SunyDays Date: Wed, 27 Apr 2016 20:49:25 +0300 Subject: [PATCH] Implement the errorevent argument to Document::createEvent --- components/script/dom/document.rs | 3 +++ .../dom/nodes/Document-createEvent.html.ini | 24 ------------------- .../Worker_dispatchEvent_ErrorEvent.htm.ini | 5 ---- 3 files changed, 3 insertions(+), 29 deletions(-) delete mode 100644 tests/wpt/metadata/workers/Worker_dispatchEvent_ErrorEvent.htm.ini diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index d8fa81be023..fffd81fdac6 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -38,6 +38,7 @@ use dom::documentfragment::DocumentFragment; use dom::documenttype::DocumentType; use dom::domimplementation::DOMImplementation; use dom::element::{Element, ElementCreator}; +use dom::errorevent::ErrorEvent; use dom::event::{Event, EventBubbles, EventCancelable}; use dom::eventtarget::EventTarget; use dom::focusevent::FocusEvent; @@ -2188,6 +2189,8 @@ impl DocumentMethods for Document { Ok(Root::upcast(ProgressEvent::new_uninitialized(&self.window))), "focusevent" => Ok(Root::upcast(FocusEvent::new_uninitialized(GlobalRef::Window(&self.window)))), + "errorevent" => + Ok(Root::upcast(ErrorEvent::new_uninitialized(GlobalRef::Window(&self.window)))), _ => Err(Error::NotSupported), } diff --git a/tests/wpt/metadata/dom/nodes/Document-createEvent.html.ini b/tests/wpt/metadata/dom/nodes/Document-createEvent.html.ini index 0e01e60b441..c40d8e327c9 100644 --- a/tests/wpt/metadata/dom/nodes/Document-createEvent.html.ini +++ b/tests/wpt/metadata/dom/nodes/Document-createEvent.html.ini @@ -133,30 +133,6 @@ [createEvent('DRAGEVENT') should be initialized correctly.] expected: FAIL - [ErrorEvent should be an alias for ErrorEvent.] - bug: https://github.com/servo/servo/issues/10738 - expected: FAIL - - [createEvent('ErrorEvent') should be initialized correctly.] - bug: https://github.com/servo/servo/issues/10738 - expected: FAIL - - [errorevent should be an alias for ErrorEvent.] - bug: https://github.com/servo/servo/issues/10738 - expected: FAIL - - [createEvent('errorevent') should be initialized correctly.] - bug: https://github.com/servo/servo/issues/10738 - expected: FAIL - - [ERROREVENT should be an alias for ErrorEvent.] - bug: https://github.com/servo/servo/issues/10738 - expected: FAIL - - [createEvent('ERROREVENT') should be initialized correctly.] - bug: https://github.com/servo/servo/issues/10738 - expected: FAIL - [HashChangeEvent should be an alias for HashChangeEvent.] expected: FAIL diff --git a/tests/wpt/metadata/workers/Worker_dispatchEvent_ErrorEvent.htm.ini b/tests/wpt/metadata/workers/Worker_dispatchEvent_ErrorEvent.htm.ini deleted file mode 100644 index e3f456034a3..00000000000 --- a/tests/wpt/metadata/workers/Worker_dispatchEvent_ErrorEvent.htm.ini +++ /dev/null @@ -1,5 +0,0 @@ -[Worker_dispatchEvent_ErrorEvent.htm] - type: testharness - [document.createEvent('ErrorEvent')] - expected: FAIL -