Struct script::dom::dissimilaroriginwindow::DissimilarOriginWindow
source · #[repr(C)]pub struct DissimilarOriginWindow {
globalscope: GlobalScope,
window_proxy: Dom<WindowProxy>,
location: MutNullableDom<DissimilarOriginLocation>,
}
Expand description
Represents a dissimilar-origin Window
that exists in another script thread.
Since the Window
is in a different script thread, we cannot access it
directly, but some of its accessors (for example window.parent
)
still need to function.
In windowproxy.rs
, we create a custom window proxy for these windows,
that throws security exceptions for most accessors. This is not a replacement
for XOWs, but provides belt-and-braces security.
Fields§
§globalscope: GlobalScope
The global for this window.
window_proxy: Dom<WindowProxy>
The window proxy for this window.
location: MutNullableDom<DissimilarOriginLocation>
The location of this window, initialized lazily.
Implementations§
source§impl DissimilarOriginWindow
impl DissimilarOriginWindow
fn __assert_parent_type(&self)
source§impl DissimilarOriginWindow
impl DissimilarOriginWindow
pub fn new(
global_to_clone_from: &GlobalScope,
window_proxy: &WindowProxy
) -> Root<Dom<Self>>
pub fn window_proxy(&self) -> Root<Dom<WindowProxy>>
source§impl DissimilarOriginWindow
impl DissimilarOriginWindow
sourcefn post_message_impl(
&self,
target_origin: &USVString,
cx: JSContext,
message: HandleValue<'_>,
transfer: CustomAutoRooterGuard<'_, Vec<*mut JSObject>>
) -> Result<(), Error>
fn post_message_impl(
&self,
target_origin: &USVString,
cx: JSContext,
message: HandleValue<'_>,
transfer: CustomAutoRooterGuard<'_, Vec<*mut JSObject>>
) -> Result<(), Error>
https://html.spec.whatwg.org/multipage/#window-post-message-steps
sourcepub fn post_message(
&self,
target_origin: &USVString,
data: StructuredSerializedData
) -> Result<(), Error>
pub fn post_message(
&self,
target_origin: &USVString,
data: StructuredSerializedData
) -> Result<(), Error>
https://html.spec.whatwg.org/multipage/#window-post-message-steps
Trait Implementations§
source§impl Castable for DissimilarOriginWindow
impl Castable for DissimilarOriginWindow
source§impl DissimilarOriginWindowMethods for DissimilarOriginWindow
impl DissimilarOriginWindowMethods for DissimilarOriginWindow
source§fn PostMessage(
&self,
cx: JSContext,
message: HandleValue<'_>,
target_origin: USVString,
transfer: CustomAutoRooterGuard<'_, Vec<*mut JSObject>>
) -> Result<(), Error>
fn PostMessage(
&self,
cx: JSContext,
message: HandleValue<'_>,
target_origin: USVString,
transfer: CustomAutoRooterGuard<'_, Vec<*mut JSObject>>
) -> Result<(), Error>
https://html.spec.whatwg.org/multipage/#dom-window-postmessage
source§fn PostMessage_(
&self,
cx: JSContext,
message: HandleValue<'_>,
options: RootedTraceableBox<WindowPostMessageOptions>
) -> Result<(), Error>
fn PostMessage_(
&self,
cx: JSContext,
message: HandleValue<'_>,
options: RootedTraceableBox<WindowPostMessageOptions>
) -> Result<(), Error>
https://html.spec.whatwg.org/multipage/#dom-window-postmessage-options
fn Window(&self) -> Root<Dom<WindowProxy>>
fn Self_(&self) -> Root<Dom<WindowProxy>>
fn Frames(&self) -> Root<Dom<WindowProxy>>
fn GetParent(&self) -> Option<Root<Dom<WindowProxy>>>
fn GetTop(&self) -> Option<Root<Dom<WindowProxy>>>
fn Length(&self) -> u32
fn Close(&self)
fn Closed(&self) -> bool
fn Opener(&self, _: JSContext) -> JSVal
fn SetOpener(&self, _: JSContext, _: HandleValue<'_>)
fn Blur(&self)
fn Focus(&self)
fn Location(&self) -> Root<Dom<DissimilarOriginLocation>>
source§impl DomObject for DissimilarOriginWindow
impl DomObject for DissimilarOriginWindow
source§impl HasParent for DissimilarOriginWindow
impl HasParent for DissimilarOriginWindow
source§fn as_parent(&self) -> &GlobalScope
fn as_parent(&self) -> &GlobalScope
This is used in a type assertion to ensure that the source and webidls agree as to what the parent type is
type Parent = GlobalScope
source§impl MallocSizeOf for DissimilarOriginWindow
impl MallocSizeOf for DissimilarOriginWindow
source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
source§impl MutDomObject for DissimilarOriginWindow
impl MutDomObject for DissimilarOriginWindow
source§unsafe fn init_reflector(&self, obj: *mut JSObject)
unsafe fn init_reflector(&self, obj: *mut JSObject)
source§impl PartialEq<DissimilarOriginWindow> for DissimilarOriginWindow
impl PartialEq<DissimilarOriginWindow> for DissimilarOriginWindow
source§fn eq(&self, other: &DissimilarOriginWindow) -> bool
fn eq(&self, other: &DissimilarOriginWindow) -> bool
self
and other
values to be equal, and is used
by ==
.