mirror of
https://github.com/servo/servo
synced 2026-04-30 19:37:43 +02:00
script: Consolidate more logic into ScriptThread::spawn_pipeline (#40586)
Have more of the code follow the same path calling `ScriptThread::spawn_pipeline`. Somewhat tricky was that the `origin` of the new Pipeline was being determined in several different places, but all in a consistent way for different types of page loads. This change makes it is so that the origin is always determined in the same place. This change is preparation for splitting out the creation of a new `ScriptThread` and the spawning of its first pipeline. Testing: This should not change observable behavior, so is covered by existing tests. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
@@ -49,7 +49,7 @@ use crate::dom::trustedhtml::TrustedHTML;
|
||||
use crate::dom::virtualmethods::VirtualMethods;
|
||||
use crate::dom::windowproxy::WindowProxy;
|
||||
use crate::script_runtime::CanGc;
|
||||
use crate::script_thread::ScriptThread;
|
||||
use crate::script_thread::{ScriptThread, with_script_thread};
|
||||
use crate::script_window_proxies::ScriptWindowProxies;
|
||||
|
||||
#[derive(PartialEq)]
|
||||
@@ -228,10 +228,9 @@ impl HTMLIFrameElement {
|
||||
};
|
||||
|
||||
self.pipeline_id.set(Some(new_pipeline_id));
|
||||
ScriptThread::spawn_pipeline_in_current(
|
||||
new_pipeline_info,
|
||||
document.origin().clone(),
|
||||
);
|
||||
with_script_thread(|script_thread| {
|
||||
script_thread.spawn_pipeline(new_pipeline_info);
|
||||
});
|
||||
},
|
||||
PipelineType::Navigation => {
|
||||
let load_info = IFrameLoadInfoWithData {
|
||||
|
||||
Reference in New Issue
Block a user