aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/globalscope.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2024-09-27 23:57:07 -0400
committerJosh Matthews <josh@joshmatthews.net>2024-09-27 23:57:07 -0400
commit4352b4c7ff7270c7add90cea503d962daa404e3b (patch)
tree4cc4e2292684826da34c39a6c2a4b1c459c0ac47 /components/script/dom/globalscope.rs
parentbff5123a992784c764801e137d0cf505200c4434 (diff)
downloadservo-4352b4c7ff7270c7add90cea503d962daa404e3b.tar.gz
servo-4352b4c7ff7270c7add90cea503d962daa404e3b.zip
Synchronously mark iframes as having pending loads when navigating a window proxy with a frame element.
Diffstat (limited to 'components/script/dom/globalscope.rs')
-rw-r--r--components/script/dom/globalscope.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/components/script/dom/globalscope.rs b/components/script/dom/globalscope.rs
index f2f2137271e..70a1b001fe9 100644
--- a/components/script/dom/globalscope.rs
+++ b/components/script/dom/globalscope.rs
@@ -266,7 +266,7 @@ pub struct GlobalScope {
/// The origin of the globalscope
#[no_trace]
- origin: MutableOrigin,
+ origin: RefCell<MutableOrigin>,
/// <https://html.spec.whatwg.org/multipage/#concept-environment-creation-url>
#[no_trace]
@@ -793,7 +793,7 @@ impl GlobalScope {
resource_threads,
timers: OneshotTimers::new(scheduler_chan),
init_timers: Default::default(),
- origin,
+ origin: RefCell::new(origin),
creation_url: RefCell::new(creation_url),
permission_state_invocation_results: Default::default(),
microtask_queue,
@@ -2374,8 +2374,8 @@ impl GlobalScope {
}
/// Get the origin for this global scope
- pub fn origin(&self) -> &MutableOrigin {
- &self.origin
+ pub fn origin(&self) -> Ref<MutableOrigin> {
+ self.origin.borrow()
}
/// Get the creation_url for this global scope
@@ -3406,10 +3406,12 @@ impl GlobalScope {
pipeline_id,
script_to_constellation_chan,
creator_url,
+ origin,
} = data;
self.pipeline_id.set(pipeline_id);
*self.script_to_constellation_chan.borrow_mut() = script_to_constellation_chan;
*self.creation_url.borrow_mut() = Some(creator_url);
+ *self.origin.borrow_mut() = origin;
self.timers.reset();
}
}
@@ -3418,6 +3420,7 @@ pub(crate) struct ReplaceData {
pub pipeline_id: PipelineId,
pub script_to_constellation_chan: ScriptToConstellationChan,
pub creator_url: ServoUrl,
+ pub origin: MutableOrigin,
}
/// Returns the Rust global scope from a JS global object.