#[repr(C)]pub(crate) struct WindowProxy {Show 16 fields
reflector: Reflector,
browsing_context_id: BrowsingContextId,
opener: Option<BrowsingContextId>,
webview_id: WebViewId,
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>,
script_window_proxies: Rc<ScriptWindowProxies>,
}Fields§
§reflector: ReflectorThe 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: BrowsingContextIdThe 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>§webview_id: WebViewIdThe 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>>If the containing <iframe> of this WindowProxy is from a same-origin page,
this will be the Element of the <iframe> element in the realm of the
parent page. Otherwise, it is None.
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.
script_window_proxies: Rc<ScriptWindowProxies>The window proxies the script thread knows.
Implementations§
Source§impl WindowProxy
impl WindowProxy
fn new_inherited( browsing_context_id: BrowsingContextId, webview_id: WebViewId, 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, webview_id: WebViewId, frame_element: Option<&Element>, parent: Option<&WindowProxy>, opener: Option<BrowsingContextId>, creator: CreatorBrowsingContextInfo, ) -> DomRoot<WindowProxy>
pub(crate) fn new_dissimilar_origin( global_to_clone_from: &GlobalScope, browsing_context_id: BrowsingContextId, webview_id: WebViewId, parent: Option<&WindowProxy>, opener: Option<BrowsingContextId>, creator: CreatorBrowsingContextInfo, ) -> DomRoot<WindowProxy>
Sourcefn create_auxiliary_browsing_context(
&self,
name: DOMString,
noopener: bool,
) -> Option<DomRoot<WindowProxy>>
fn create_auxiliary_browsing_context( &self, name: DOMString, noopener: bool, ) -> Option<DomRoot<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, ) -> Fallible<Option<DomRoot<WindowProxy>>>
pub(crate) fn choose_browsing_context( &self, name: DOMString, noopener: bool, ) -> (Option<DomRoot<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 webview_id(&self) -> WebViewId
Sourcepub(crate) fn frame_element(&self) -> Option<&Element>
pub(crate) fn frame_element(&self) -> Option<&Element>
If the containing <iframe> of this WindowProxy is from a same-origin page,
this will return an Element of the <iframe> element in the realm of the parent
page.
pub(crate) fn document(&self) -> Option<DomRoot<Document>>
pub(crate) fn parent(&self) -> Option<&WindowProxy>
pub(crate) fn top(&self) -> &WindowProxy
Sourcepub fn focus(&self)
pub fn focus(&self)
Run the focusing steps with this browsing context.
Sourcefn set_window(
&self,
window: &GlobalScope,
handler: &WindowProxyHandler,
_can_gc: CanGc,
)
fn set_window( &self, window: &GlobalScope, handler: &WindowProxyHandler, _can_gc: CanGc, )
Change the Window that this WindowProxy resolves to.
pub(crate) fn set_currently_active(&self, window: &Window, can_gc: CanGc)
pub(crate) fn unset_currently_active(&self, can_gc: CanGc)
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§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<D, T> DomGlobalGeneric<D> for T
impl<D, T> DomGlobalGeneric<D> for T
Source§fn global_(&self, realm: InRealm<'_>) -> Root<Dom<<D as DomTypes>::GlobalScope>>where
Self: Sized,
fn global_(&self, realm: InRealm<'_>) -> Root<Dom<<D as DomTypes>::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
Nodes it’s almost always better to use NodeTraits::owning_global.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