Struct script::dom::windowproxy::WindowProxy
source · #[repr(C)]pub 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 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 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 fn is_delaying_load_events_mode(&self) -> bool
pub fn is_delaying_load_events_mode(&self) -> bool
sourcepub fn start_delaying_load_events_mode(&self)
pub fn start_delaying_load_events_mode(&self)
sourcepub fn stop_delaying_load_events_mode(&self)
pub fn stop_delaying_load_events_mode(&self)
pub fn disown(&self)
sourcepub fn close(&self)
pub fn close(&self)
https://html.spec.whatwg.org/multipage/#dom-window-close
Step 3.1, set BCs is_closing
to true.
sourcepub fn is_closing(&self) -> bool
pub fn is_closing(&self) -> bool
sourcepub fn creator_base_url(&self) -> Option<ServoUrl>
pub fn creator_base_url(&self) -> Option<ServoUrl>
pub fn has_creator_base_url(&self) -> bool
sourcepub fn creator_url(&self) -> Option<ServoUrl>
pub fn creator_url(&self) -> Option<ServoUrl>
pub fn has_creator_url(&self) -> bool
sourcepub fn creator_origin(&self) -> Option<ImmutableOrigin>
pub fn creator_origin(&self) -> Option<ImmutableOrigin>
pub fn has_creator_origin(&self) -> bool
pub fn opener( &self, cx: *mut JSContext, in_realm_proof: InRealm<'_>, retval: MutableHandleValue<'_>, )
pub fn open( &self, url: USVString, target: DOMString, features: DOMString, can_gc: CanGc, ) -> Result<Option<Root<Dom<WindowProxy>>>, Error>
pub fn choose_browsing_context( &self, name: DOMString, noopener: bool, ) -> (Option<Root<Dom<WindowProxy>>>, bool)
pub fn is_auxiliary(&self) -> bool
pub fn discard_browsing_context(&self)
pub fn is_browsing_context_discarded(&self) -> bool
pub fn browsing_context_id(&self) -> BrowsingContextId
pub fn top_level_browsing_context_id(&self) -> TopLevelBrowsingContextId
pub fn frame_element(&self) -> Option<&Element>
pub fn document(&self) -> Option<Root<Dom<Document>>>
pub fn parent(&self) -> Option<&WindowProxy>
pub 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 fn set_currently_active(&self, window: &Window)
pub fn unset_currently_active(&self)
pub fn currently_active(&self) -> Option<PipelineId>
pub fn get_name(&self) -> DOMString
pub fn set_name(&self, name: DOMString)
Trait Implementations§
source§impl DomObject for WindowProxy
impl DomObject for WindowProxy
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