diff options
Diffstat (limited to 'components/script_bindings/reflector.rs')
-rw-r--r-- | components/script_bindings/reflector.rs | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/components/script_bindings/reflector.rs b/components/script_bindings/reflector.rs index 6b6ae03cb69..4b91b0536fc 100644 --- a/components/script_bindings/reflector.rs +++ b/components/script_bindings/reflector.rs @@ -8,7 +8,7 @@ use malloc_size_of_derive::MallocSizeOf; use crate::interfaces::GlobalScopeHelpers; use crate::iterable::{Iterable, IterableIterator}; -use crate::realms::{AlreadyInRealm, InRealm}; +use crate::realms::InRealm; use crate::root::{Dom, DomRoot, Root}; use crate::script_runtime::{CanGc, JSContext}; use crate::{DomTypes, JSTraceable}; @@ -108,17 +108,6 @@ pub trait DomGlobalGeneric<D: DomTypes>: DomObject { { D::GlobalScope::from_reflector(self, realm) } - - /// Returns the [`GlobalScope`] of the realm that the [`DomObject`] was created in. If this - /// object is a `Node`, this will be different from it's owning `Document` if adopted by. For - /// `Node`s it's almost always better to use `NodeTraits::owning_global`. - fn global(&self) -> DomRoot<D::GlobalScope> - where - Self: Sized, - { - let realm = AlreadyInRealm::assert_for_cx(D::GlobalScope::get_cx()); - D::GlobalScope::from_reflector(self, InRealm::already(&realm)) - } } impl<D: DomTypes, T: DomObject> DomGlobalGeneric<D> for T {} |