aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/script/devtools.rs1
-rw-r--r--components/script/dom/bindings/global.rs17
2 files changed, 10 insertions, 8 deletions
diff --git a/components/script/devtools.rs b/components/script/devtools.rs
index 389d652fefa..8f08cab9701 100644
--- a/components/script/devtools.rs
+++ b/components/script/devtools.rs
@@ -16,6 +16,7 @@ use dom::bindings::conversions::{ConversionResult, FromJSValConvertible, jsstrin
use dom::bindings::global::GlobalRef;
use dom::bindings::inheritance::Castable;
use dom::bindings::js::Root;
+use dom::bindings::reflector::Reflectable;
use dom::bindings::str::DOMString;
use dom::browsingcontext::BrowsingContext;
use dom::element::Element;
diff --git a/components/script/dom/bindings/global.rs b/components/script/dom/bindings/global.rs
index af4cd59a86f..54efb11250d 100644
--- a/components/script/dom/bindings/global.rs
+++ b/components/script/dom/bindings/global.rs
@@ -271,14 +271,6 @@ impl<'a> GlobalRef<'a> {
}
}
- /// Returns the receiver's reflector.
- pub fn reflector(&self) -> &Reflector {
- match *self {
- GlobalRef::Window(ref window) => window.reflector(),
- GlobalRef::Worker(ref worker) => worker.reflector(),
- }
- }
-
/// Returns a wrapper for runnables to ensure they are cancelled if the global
/// is being destroyed.
pub fn get_runnable_wrapper(&self) -> RunnableWrapper {
@@ -297,6 +289,15 @@ impl<'a> GlobalRef<'a> {
}
}
+impl<'a> Reflectable for GlobalRef<'a> {
+ fn reflector(&self) -> &Reflector {
+ match *self {
+ GlobalRef::Window(ref window) => window.reflector(),
+ GlobalRef::Worker(ref worker) => worker.reflector(),
+ }
+ }
+}
+
impl GlobalRoot {
/// Obtain a safe reference to the global object that cannot outlive the
/// lifetime of this root.