From dcf02caf81284246d8fd6ee4a09161733bd9310a Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Sat, 20 May 2023 18:32:08 -0400 Subject: [PATCH] Enter realms when creating special same-origin iframes. --- components/script/dom/servoparser/mod.rs | 3 +++ components/script/script_thread.rs | 1 + 2 files changed, 4 insertions(+) diff --git a/components/script/dom/servoparser/mod.rs b/components/script/dom/servoparser/mod.rs index 6b5df0e9768..c4b52a038ea 100644 --- a/components/script/dom/servoparser/mod.rs +++ b/components/script/dom/servoparser/mod.rs @@ -919,6 +919,7 @@ impl FetchResponseListener for ParserContext { if parser.aborted.get() { return; } + let _realm = enter_realm(&*parser); parser.parse_bytes_chunk(payload); } @@ -934,6 +935,8 @@ impl FetchResponseListener for ParserContext { return; } + let _realm = enter_realm(&*parser); + match status { // are we throwing this away or can we use it? Ok(_) => (), diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index 325944d33c2..96ea03881d4 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -1649,6 +1649,7 @@ impl ScriptThread { // https://html.spec.whatwg.org/multipage/#the-end step 6 let mut docs = self.docs_with_no_blocking_loads.borrow_mut(); for document in docs.iter() { + let _realm = enter_realm(&**document); document.maybe_queue_document_completion(); } docs.clear();