#[repr(C)]pub(crate) struct WindowProxy {Show 15 fields
reflector: Reflector,
browsing_context_id: BrowsingContextId,
opener: Option<BrowsingContextId>,
top_level_browsing_context_id: TopLevelBrowsingContextId,
name: DomRefCell<DOMString>,
currently_active: Cell<Option<PipelineId>>,
discarded: Cell<bool>,
disowned: Cell<bool>,
is_closing: Cell<bool>,
frame_element: Option<Dom<Element>>,
parent: Option<Dom<WindowProxy>>,
delaying_load_events_mode: Cell<bool>,
creator_base_url: Option<ServoUrl>,
creator_url: Option<ServoUrl>,
creator_origin: Option<ImmutableOrigin>,
}
Fields§
§reflector: Reflector
The JS WindowProxy object. Unlike other reflectors, we mutate this field because we have to brain-transplant the reflector when the WindowProxy changes Window.
browsing_context_id: BrowsingContextId
The id of the browsing context. In the case that this is a nested browsing context, this is the id of the container.
opener: Option<BrowsingContextId>
§top_level_browsing_context_id: TopLevelBrowsingContextId
The frame id of the top-level ancestor browsing context. In the case that this is a top-level window, this is our id.
name: DomRefCell<DOMString>
The name of the browsing context (sometimes, but not always, equal to the name of a container element)
currently_active: Cell<Option<PipelineId>>
The pipeline id of the currently active document. May be None, when the currently active document is in another script thread. We do not try to keep the pipeline id for documents in other threads, as this would require the constellation notifying many script threads about the change, which could be expensive.
discarded: Cell<bool>
Has the browsing context been discarded?
disowned: Cell<bool>
Has the browsing context been disowned?
is_closing: Cell<bool>
§frame_element: Option<Dom<Element>>
The containing iframe element, if this is a same-origin iframe
parent: Option<Dom<WindowProxy>>
The parent browsing context’s window proxy, if this is a nested browsing context
delaying_load_events_mode: Cell<bool>
§creator_base_url: Option<ServoUrl>
The creator browsing context’s base url.
creator_url: Option<ServoUrl>
The creator browsing context’s url.
creator_origin: Option<ImmutableOrigin>
The creator browsing context’s origin.
Implementations§
source§impl WindowProxy
impl WindowProxy
fn new_inherited( browsing_context_id: BrowsingContextId, top_level_browsing_context_id: TopLevelBrowsingContextId, currently_active: Option<PipelineId>, frame_element: Option<&Element>, parent: Option<&WindowProxy>, opener: Option<BrowsingContextId>, creator: CreatorBrowsingContextInfo, ) -> WindowProxy
pub(crate) fn new( window: &Window, browsing_context_id: BrowsingContextId, top_level_browsing_context_id: TopLevelBrowsingContextId, frame_element: Option<&Element>, parent: Option<&WindowProxy>, opener: Option<BrowsingContextId>, creator: CreatorBrowsingContextInfo, ) -> Root<Dom<WindowProxy>>
pub(crate) fn new_dissimilar_origin( global_to_clone_from: &GlobalScope, browsing_context_id: BrowsingContextId, top_level_browsing_context_id: TopLevelBrowsingContextId, parent: Option<&WindowProxy>, opener: Option<BrowsingContextId>, creator: CreatorBrowsingContextInfo, ) -> Root<Dom<WindowProxy>>
fn create_auxiliary_browsing_context( &self, name: DOMString, noopener: bool, ) -> Option<Root<Dom<WindowProxy>>>
sourcepub(crate) fn is_delaying_load_events_mode(&self) -> bool
pub(crate) fn is_delaying_load_events_mode(&self) -> bool
sourcepub(crate) fn start_delaying_load_events_mode(&self)
pub(crate) fn start_delaying_load_events_mode(&self)
sourcepub(crate) fn stop_delaying_load_events_mode(&self)
pub(crate) fn stop_delaying_load_events_mode(&self)
pub(crate) fn disown(&self)
sourcepub(crate) fn close(&self)
pub(crate) fn close(&self)
https://html.spec.whatwg.org/multipage/#dom-window-close
Step 3.1, set BCs is_closing
to true.
sourcepub(crate) fn is_closing(&self) -> bool
pub(crate) fn is_closing(&self) -> bool
sourcepub(crate) fn creator_base_url(&self) -> Option<ServoUrl>
pub(crate) fn creator_base_url(&self) -> Option<ServoUrl>
pub(crate) fn has_creator_base_url(&self) -> bool
sourcepub(crate) fn creator_url(&self) -> Option<ServoUrl>
pub(crate) fn creator_url(&self) -> Option<ServoUrl>
pub(crate) fn has_creator_url(&self) -> bool
sourcepub(crate) fn creator_origin(&self) -> Option<ImmutableOrigin>
pub(crate) fn creator_origin(&self) -> Option<ImmutableOrigin>
pub(crate) fn has_creator_origin(&self) -> bool
pub(crate) fn opener( &self, cx: *mut JSContext, in_realm_proof: InRealm<'_>, retval: MutableHandleValue<'_>, )
pub(crate) fn open( &self, url: USVString, target: DOMString, features: DOMString, can_gc: CanGc, ) -> Result<Option<Root<Dom<WindowProxy>>>, Error>
pub(crate) fn choose_browsing_context( &self, name: DOMString, noopener: bool, ) -> (Option<Root<Dom<WindowProxy>>>, bool)
pub(crate) fn is_auxiliary(&self) -> bool
pub(crate) fn discard_browsing_context(&self)
pub(crate) fn is_browsing_context_discarded(&self) -> bool
pub(crate) fn browsing_context_id(&self) -> BrowsingContextId
pub(crate) fn top_level_browsing_context_id(&self) -> TopLevelBrowsingContextId
pub(crate) fn frame_element(&self) -> Option<&Element>
pub(crate) fn document(&self) -> Option<Root<Dom<Document>>>
pub(crate) fn parent(&self) -> Option<&WindowProxy>
pub(crate) fn top(&self) -> &WindowProxy
sourcefn set_window(&self, window: &GlobalScope, handler: &WindowProxyHandler)
fn set_window(&self, window: &GlobalScope, handler: &WindowProxyHandler)
Change the Window that this WindowProxy resolves to.
pub(crate) fn set_currently_active(&self, window: &Window)
pub(crate) fn unset_currently_active(&self)
pub(crate) fn currently_active(&self) -> Option<PipelineId>
pub(crate) fn get_name(&self) -> DOMString
pub(crate) fn set_name(&self, name: DOMString)
Trait Implementations§
source§impl DomObject for WindowProxy
impl DomObject for WindowProxy
source§fn global(&self) -> Root<Dom<GlobalScope>>where
Self: Sized,
fn global(&self) -> Root<Dom<GlobalScope>>where
Self: Sized,
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
.source§impl HasParent for WindowProxy
impl HasParent for WindowProxy
source§impl MallocSizeOf for WindowProxy
impl MallocSizeOf for WindowProxy
source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
source§impl MutDomObject for WindowProxy
impl MutDomObject for WindowProxy
source§impl PartialEq for WindowProxy
impl PartialEq for WindowProxy
source§impl ToJSValConvertible for WindowProxy
impl ToJSValConvertible for WindowProxy
source§impl Traceable for WindowProxy
impl Traceable for WindowProxy
impl Eq for WindowProxy
Auto Trait Implementations§
impl !Freeze for WindowProxy
impl !RefUnwindSafe for WindowProxy
impl !Send for WindowProxy
impl !Sync for WindowProxy
impl Unpin for WindowProxy
impl !UnwindSafe for WindowProxy
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<T> Filterable for T
impl<T> Filterable for T
source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more