Implement the errorevent argument to Document::createEvent

This commit is contained in:
SunyDays 2016-04-27 20:49:25 +03:00
parent ce54234262
commit 7d24426172
3 changed files with 3 additions and 29 deletions

View file

@ -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),
}