aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/window.rs
diff options
context:
space:
mode:
authorDelan Azabani <dazabani@igalia.com>2023-02-27 22:20:16 +0800
committerDelan Azabani <dazabani@igalia.com>2023-03-23 18:06:17 +0800
commit1f74d4c75bdc3c4a649665bb7e7fb51b6dba854d (patch)
tree0653bb1094e9d6aa1251330896d3400b163d319f /components/script/dom/window.rs
parent4c7f198ee22ba5c6c1393395ceb9889d2d4decaa (diff)
downloadservo-1f74d4c75bdc3c4a649665bb7e7fb51b6dba854d.tar.gz
servo-1f74d4c75bdc3c4a649665bb7e7fb51b6dba854d.zip
revert: Introduce `Untransplantable` trait to indicate transplantability at the type level
(8f7b0cff87f0eab921e13e6990d76e12935e8675)
Diffstat (limited to 'components/script/dom/window.rs')
-rw-r--r--components/script/dom/window.rs13
1 files changed, 6 insertions, 7 deletions
diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs
index 64ad1d72544..76dcc79424f 100644
--- a/components/script/dom/window.rs
+++ b/components/script/dom/window.rs
@@ -24,7 +24,7 @@ use crate::dom::bindings::inheritance::{Castable, ElementTypeId, HTMLElementType
use crate::dom::bindings::num::Finite;
use crate::dom::bindings::refcounted::Trusted;
use crate::dom::bindings::reflector::DomObject;
-use crate::dom::bindings::root::{Dom, DomRoot, MutNullableDom, MutNullableTransplantableDom};
+use crate::dom::bindings::root::{Dom, DomRoot, MutNullableDom};
use crate::dom::bindings::str::{DOMString, USVString};
use crate::dom::bindings::structuredclone;
use crate::dom::bindings::trace::{JSTraceable, RootedTraceableBox};
@@ -201,7 +201,7 @@ pub struct Window {
image_cache: Arc<dyn ImageCache>,
#[ignore_malloc_size_of = "channels are hard"]
image_cache_chan: Sender<ImageCacheMsg>,
- window_proxy: MutNullableTransplantableDom<WindowProxy>,
+ window_proxy: MutNullableDom<WindowProxy>,
document: MutNullableDom<Document>,
location: MutNullableDom<Location>,
history: MutNullableDom<History>,
@@ -382,7 +382,7 @@ impl Window {
pub fn clear_js_runtime_for_script_deallocation(&self) {
unsafe {
*self.js_runtime.borrow_for_script_deallocation() = None;
- self.window_proxy.set(None, &self.global().upcast());
+ self.window_proxy.set(None);
self.current_state.set(WindowState::Zombie);
self.ignore_all_tasks();
}
@@ -1682,7 +1682,7 @@ impl Window {
let pipeline_id = self.upcast::<GlobalScope>().pipeline_id();
if let Some(currently_active) = proxy.currently_active() {
if currently_active == pipeline_id {
- self.window_proxy.set(None, &self.global());
+ self.window_proxy.set(None);
}
}
}
@@ -2190,7 +2190,7 @@ impl Window {
#[allow(unsafe_code)]
pub fn init_window_proxy(&self, window_proxy: &WindowProxy) {
assert!(self.window_proxy.get().is_none());
- self.window_proxy.set(Some(&window_proxy), &self.global());
+ self.window_proxy.set(Some(&window_proxy));
}
#[allow(unsafe_code)]
@@ -2596,8 +2596,7 @@ impl Window {
location: Default::default(),
history: Default::default(),
custom_element_registry: Default::default(),
- // Safety: This field won't be assigned until it's pinned
- window_proxy: unsafe { MutNullableTransplantableDom::new() },
+ window_proxy: Default::default(),
document: Default::default(),
performance: Default::default(),
navigation_start: Cell::new(navigation_start),