diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-04-26 17:50:51 -0700 |
---|---|---|
committer | bors-servo <lbergstrom+bors@mozilla.com> | 2016-04-26 17:50:51 -0700 |
commit | aa078a0780465a4dbf3ce91494f8c55a57359fd3 (patch) | |
tree | 576c5e5ee42f9624cccf1691bf755aa6d6d6dcd8 /components/script | |
parent | 2729864af73d62719ea0fd55cef417c43bdd951e (diff) | |
parent | e4f3a31caffe3161291d91c005ba51f2b0f97b6d (diff) | |
download | servo-aa078a0780465a4dbf3ce91494f8c55a57359fd3.tar.gz servo-aa078a0780465a4dbf3ce91494f8c55a57359fd3.zip |
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 -->
Diffstat (limited to 'components/script')
-rw-r--r-- | components/script/dom/document.rs | 2 | ||||
-rw-r--r-- | components/script/dom/focusevent.rs | 6 |
2 files changed, 8 insertions, 0 deletions
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index 7d25e484aa3..66da66574f7 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -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), } diff --git a/components/script/dom/focusevent.rs b/components/script/dom/focusevent.rs index 84259749295..0b0048e1e98 100644 --- a/components/script/dom/focusevent.rs +++ b/components/script/dom/focusevent.rs @@ -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, |