Auto merge of #10820 - SunyDays:focusevent_argument, r=Ms2ger

Implement the "focusevent" argument to Document::createEvent

close #10739

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10820)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-04-26 17:50:51 -07:00
commit aa078a0780
3 changed files with 8 additions and 24 deletions

View file

@ -2186,6 +2186,8 @@ impl DocumentMethods for Document {
Ok(Root::upcast(StorageEvent::new_uninitialized(&self.window, self.URL()))),
"progressevent" =>
Ok(Root::upcast(ProgressEvent::new_uninitialized(&self.window))),
"focusevent" =>
Ok(Root::upcast(FocusEvent::new_uninitialized(GlobalRef::Window(&self.window)))),
_ =>
Err(Error::NotSupported),
}

View file

@ -31,6 +31,12 @@ impl FocusEvent {
}
}
pub fn new_uninitialized(global: GlobalRef) -> Root<FocusEvent> {
reflect_dom_object(box FocusEvent::new_inherited(),
global,
FocusEventBinding::Wrap)
}
pub fn new(window: &Window,
type_: DOMString,
can_bubble: EventBubbles,