diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-10-07 07:52:09 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-07 07:52:09 -0500 |
commit | a6e4b5bb86ad707a0863acff87344ca4239cfd2c (patch) | |
tree | c820d9f2420c44cdfe29de97f1a710e7dc354bb7 /components/script/dom/focusevent.rs | |
parent | e23959a7618e8e7b7ca20300a2afeb1ac77712f3 (diff) | |
parent | d8e92bb271a9f9dd87bf77e38cd820d01f2f0ae4 (diff) | |
download | servo-a6e4b5bb86ad707a0863acff87344ca4239cfd2c.tar.gz servo-a6e4b5bb86ad707a0863acff87344ca4239cfd2c.zip |
Auto merge of #13596 - nox:inline, r=Ms2ger
Get rid of dom::bindings::global
Globals in that PR are now represented by the fake IDL interface `GlobalScope`.
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13596)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/focusevent.rs')
-rw-r--r-- | components/script/dom/focusevent.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/components/script/dom/focusevent.rs b/components/script/dom/focusevent.rs index dd5e41e8426..d06b725286d 100644 --- a/components/script/dom/focusevent.rs +++ b/components/script/dom/focusevent.rs @@ -6,13 +6,13 @@ use dom::bindings::codegen::Bindings::FocusEventBinding; use dom::bindings::codegen::Bindings::FocusEventBinding::FocusEventMethods; use dom::bindings::codegen::Bindings::UIEventBinding::UIEventMethods; use dom::bindings::error::Fallible; -use dom::bindings::global::GlobalRef; use dom::bindings::inheritance::Castable; use dom::bindings::js::{JS, MutNullableHeap, Root, RootedReference}; use dom::bindings::reflector::reflect_dom_object; use dom::bindings::str::DOMString; use dom::event::{EventBubbles, EventCancelable}; use dom::eventtarget::EventTarget; +use dom::globalscope::GlobalScope; use dom::uievent::UIEvent; use dom::window::Window; use std::default::Default; @@ -31,7 +31,7 @@ impl FocusEvent { } } - pub fn new_uninitialized(global: GlobalRef) -> Root<FocusEvent> { + pub fn new_uninitialized(global: &GlobalScope) -> Root<FocusEvent> { reflect_dom_object(box FocusEvent::new_inherited(), global, FocusEventBinding::Wrap) @@ -44,8 +44,7 @@ impl FocusEvent { view: Option<&Window>, detail: i32, related_target: Option<&EventTarget>) -> Root<FocusEvent> { - let event = box FocusEvent::new_inherited(); - let ev = reflect_dom_object(event, GlobalRef::Window(window), FocusEventBinding::Wrap); + let ev = FocusEvent::new_uninitialized(window.upcast()); ev.upcast::<UIEvent>().InitUIEvent(type_, bool::from(can_bubble), bool::from(cancelable), @@ -54,12 +53,13 @@ impl FocusEvent { ev } - pub fn Constructor(global: GlobalRef, + pub fn Constructor(global: &GlobalScope, type_: DOMString, init: &FocusEventBinding::FocusEventInit) -> Fallible<Root<FocusEvent>> { let bubbles = EventBubbles::from(init.parent.parent.bubbles); let cancelable = EventCancelable::from(init.parent.parent.cancelable); - let event = FocusEvent::new(global.as_window(), type_, + let event = FocusEvent::new(global.as_window(), + type_, bubbles, cancelable, init.parent.view.r(), |