aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/windowproxy.rs
diff options
context:
space:
mode:
authoryvt <i@yvt.jp>2021-07-07 22:21:26 +0900
committeryvt <i@yvt.jp>2021-07-07 22:21:26 +0900
commitd597264d1b2260cd5c8d56116b3eec857c365d58 (patch)
treed67cbe4299f44dd4e34122242d0b1fd1199c1829 /components/script/dom/windowproxy.rs
parent5871d09c26dcee3cc75c2dd1b7efc8ce208bbb45 (diff)
downloadservo-d597264d1b2260cd5c8d56116b3eec857c365d58.tar.gz
servo-d597264d1b2260cd5c8d56116b3eec857c365d58.zip
doc(script): we don't do cross-compartment brain transplantation anymore
Diffstat (limited to 'components/script/dom/windowproxy.rs')
-rw-r--r--components/script/dom/windowproxy.rs12
1 files changed, 5 insertions, 7 deletions
diff --git a/components/script/dom/windowproxy.rs b/components/script/dom/windowproxy.rs
index e37e561af06..0f92e4b3367 100644
--- a/components/script/dom/windowproxy.rs
+++ b/components/script/dom/windowproxy.rs
@@ -637,13 +637,11 @@ impl WindowProxy {
// The old window proxy no longer owns this browsing context.
SetProxyReservedSlot(old_js_proxy.get(), 0, &PrivateValue(ptr::null_mut()));
- // Brain transpant the window proxy.
- // We need to do this, because the Window and WindowProxy
- // objects need to be in the same realm.
- // JS_TransplantObject does this by copying the contents
- // of the old window proxy to the new window proxy, then
- // making the old window proxy a cross-realm wrapper
- // pointing to the new window proxy.
+ // Brain transpant the window proxy. Brain transplantation is
+ // usually done to move a window proxy between compartments, but
+ // that's not what we are doing here. We need to do this just
+ // because we want to replace the wrapper's `ProxyTraps`, but we
+ // don't want to update its identity.
rooted!(in(*cx) let new_js_proxy = NewWindowProxy(*cx, window_jsobject, handler));
debug!(
"Transplanting proxy from {:p} to {:p}.",