mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
script: Expose NodeTraits::owner_global
/ Window::as_global_scope
(#34843)
Expose two new helpers and start using them as much as possible. - `NodeTraits::owner_global`: which gets the `GlobalScope` that currenty owns a `Node`. This may be different than `.global()` in the case that the `Node` was adopted by a different `Document`. - `Window::as_global_scope`: A helper to avoid having to cast so much when treating a `Window` like a `GlobalScope`. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
17e2ca3f01
commit
e42b4b793d
33 changed files with 262 additions and 258 deletions
|
@ -145,17 +145,16 @@ impl WorkletMethods<crate::DomTypeHolder> for Worklet {
|
|||
|
||||
// Steps 6-12 in parallel.
|
||||
let pending_tasks_struct = PendingTasksStruct::new();
|
||||
let global = self.window.upcast::<GlobalScope>();
|
||||
|
||||
self.droppable_field
|
||||
.thread_pool
|
||||
.get_or_init(ScriptThread::worklet_thread_pool)
|
||||
.fetch_and_invoke_a_worklet_script(
|
||||
global.pipeline_id(),
|
||||
self.window.pipeline_id(),
|
||||
self.droppable_field.worklet_id,
|
||||
self.global_type,
|
||||
self.window.origin().immutable().clone(),
|
||||
global.api_base_url(),
|
||||
self.window.as_global_scope().api_base_url(),
|
||||
module_url_record,
|
||||
options.credentials,
|
||||
pending_tasks_struct,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue