Enter realms more consistently during the script event loop.

This commit is contained in:
Josh Matthews 2023-02-18 14:07:36 -05:00
parent 9ea1399c30
commit 864e072d5c
6 changed files with 52 additions and 5 deletions

View file

@ -34,6 +34,7 @@ use crate::dom::processinginstruction::ProcessingInstruction;
use crate::dom::text::Text;
use crate::dom::virtualmethods::vtable_for;
use crate::network_listener::PreInvoke;
use crate::realms::enter_realm;
use crate::script_thread::ScriptThread;
use content_security_policy::{self as csp, CspList};
use dom_struct::dom_struct;
@ -828,6 +829,8 @@ impl FetchResponseListener for ParserContext {
return;
}
let _realm = enter_realm(&*parser.document);
parser.document.set_csp_list(csp_list);
self.parser = Some(Trusted::new(&*parser));
self.submit_resource_timing();