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

source

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

source

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>>

source

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>>

source

fn create_auxiliary_browsing_context( &self, name: DOMString, noopener: bool, ) -> Option<Root<Dom<WindowProxy>>>

source

pub fn is_delaying_load_events_mode(&self) -> bool

source

pub fn start_delaying_load_events_mode(&self)

source

pub fn stop_delaying_load_events_mode(&self)

source

pub fn disown(&self)

source

pub fn close(&self)

https://html.spec.whatwg.org/multipage/#dom-window-close Step 3.1, set BCs is_closing to true.

source

pub fn is_closing(&self) -> bool

source

pub fn creator_base_url(&self) -> Option<ServoUrl>

source

pub fn has_creator_base_url(&self) -> bool

source

pub fn creator_url(&self) -> Option<ServoUrl>

source

pub fn has_creator_url(&self) -> bool

source

pub fn creator_origin(&self) -> Option<ImmutableOrigin>

source

pub fn has_creator_origin(&self) -> bool

source

pub fn opener( &self, cx: *mut JSContext, in_realm_proof: InRealm<'_>, retval: MutableHandleValue<'_>, )

source

pub fn open( &self, url: USVString, target: DOMString, features: DOMString, can_gc: CanGc, ) -> Result<Option<Root<Dom<WindowProxy>>>, Error>

source

pub fn choose_browsing_context( &self, name: DOMString, noopener: bool, ) -> (Option<Root<Dom<WindowProxy>>>, bool)

source

pub fn is_auxiliary(&self) -> bool

source

pub fn discard_browsing_context(&self)

source

pub fn is_browsing_context_discarded(&self) -> bool

source

pub fn browsing_context_id(&self) -> BrowsingContextId

source

pub fn top_level_browsing_context_id(&self) -> TopLevelBrowsingContextId

source

pub fn frame_element(&self) -> Option<&Element>

source

pub fn document(&self) -> Option<Root<Dom<Document>>>

source

pub fn parent(&self) -> Option<&WindowProxy>

source

pub fn top(&self) -> &WindowProxy

source

fn set_window(&self, window: &GlobalScope, handler: &WindowProxyHandler)

Change the Window that this WindowProxy resolves to.

source

pub fn set_currently_active(&self, window: &Window)

source

pub fn unset_currently_active(&self)

source

pub fn currently_active(&self) -> Option<PipelineId>

source

pub fn get_name(&self) -> DOMString

source

pub fn set_name(&self, name: DOMString)

Trait Implementations§

source§

impl DomObject for WindowProxy

source§

fn reflector(&self) -> &Reflector

Returns the receiver’s reflector.
source§

fn global(&self) -> Root<Dom<GlobalScope>>
where Self: Sized,

Returns the global scope of the realm that the DomObject was created in.
source§

impl HasParent for WindowProxy

source§

fn as_parent(&self) -> &Reflector

This is used in a type assertion to ensure that the source and webidls agree as to what the parent type is

§

type Parent = Reflector

source§

impl MallocSizeOf for WindowProxy

source§

fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize

Measure the heap usage of all descendant heap-allocated structures, but not the space taken up by the value itself.
source§

impl MutDomObject for WindowProxy

source§

unsafe fn init_reflector(&self, obj: *mut JSObject)

Initializes the Reflector Read more
source§

impl PartialEq for WindowProxy

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl ToJSValConvertible for WindowProxy

source§

unsafe fn to_jsval(&self, cx: *mut JSContext, rval: MutableHandleValue<'_>)

Convert self to a JSVal. JSAPI failure causes a panic.
source§

impl Traceable for WindowProxy

source§

unsafe fn trace(&self, tracer: *mut JSTracer)

Trace self.
source§

impl Eq for WindowProxy

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> Downcast<T> for T

source§

fn downcast(&self) -> &T

source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> Filterable for T

source§

fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>

Creates a filterable data provider with the given name for debugging. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
source§

impl<T> MaybeBoxed<Box<T>> for T

source§

fn maybe_boxed(self) -> Box<T>

Convert
source§

impl<T> MaybeBoxed<T> for T

source§

fn maybe_boxed(self) -> T

Convert
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> Upcast<T> for T

source§

fn upcast(&self) -> Option<&T>

source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> ErasedDestructor for T
where T: 'static,

source§

impl<T> MaybeSendSync for T