mirror of
https://github.com/servo/servo.git
synced 2025-09-30 00:29:14 +01:00
script: Move FontContext
from Window
to GlobalScope
(#38918)
This change makes it so that every `GlobalScope` can contain an optional `FontContext`. This will be necessary for every `GlobalScope` that accesses canvas. Currently, `FontContext` is created and accessed via the canvas worker thread, but this means that web fonts are not available to canvas. This change will eventually make it possible for canvas to share web fonts with the `Document` that owns them. Testing: This should not change behavior and is thus covered by existing tests. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
909ceee830
commit
4f68508624
18 changed files with 281 additions and 193 deletions
|
@ -16,6 +16,7 @@ use content_security_policy::CspList;
|
|||
use crossbeam_channel::Receiver;
|
||||
use devtools_traits::{DevtoolScriptControlMsg, WorkerId};
|
||||
use dom_struct::dom_struct;
|
||||
use fonts::FontContext;
|
||||
use ipc_channel::ipc::IpcSender;
|
||||
use js::jsval::UndefinedValue;
|
||||
use js::panic::maybe_resume_unwind;
|
||||
|
@ -167,6 +168,7 @@ impl WorkerGlobalScope {
|
|||
closing: Arc<AtomicBool>,
|
||||
#[cfg(feature = "webgpu")] gpu_id_hub: Arc<IdentityHub>,
|
||||
insecure_requests_policy: InsecureRequestsPolicy,
|
||||
font_context: Option<Arc<FontContext>>,
|
||||
) -> Self {
|
||||
// Install a pipeline-namespace in the current thread.
|
||||
PipelineNamespace::auto_install();
|
||||
|
@ -192,6 +194,7 @@ impl WorkerGlobalScope {
|
|||
gpu_id_hub,
|
||||
init.inherited_secure_context,
|
||||
false,
|
||||
font_context,
|
||||
),
|
||||
worker_id: init.worker_id,
|
||||
worker_name,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue