aboutsummaryrefslogtreecommitdiffstats
path: root/components/shared/script_layout
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@igalia.com>2025-01-07 05:44:31 +0100
committerGitHub <noreply@github.com>2025-01-07 04:44:31 +0000
commit7142a96d369f9636533e1dde06e5bf69b18f6618 (patch)
tree9e5ddeaaab02a838379c33906160cb1794764cf3 /components/shared/script_layout
parentfe8a22b72c42296ccbbd5c4f459936ea28c5dee2 (diff)
downloadservo-7142a96d369f9636533e1dde06e5bf69b18f6618.tar.gz
servo-7142a96d369f9636533e1dde06e5bf69b18f6618.zip
script: Move the `FontContext` to `Window` (#34845)
This will allow using layout's `FontContext` in `Window` letting script manage font selection and download. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Diffstat (limited to 'components/shared/script_layout')
-rw-r--r--components/shared/script_layout/lib.rs9
1 files changed, 2 insertions, 7 deletions
diff --git a/components/shared/script_layout/lib.rs b/components/shared/script_layout/lib.rs
index f8643e866e7..d1b31da003f 100644
--- a/components/shared/script_layout/lib.rs
+++ b/components/shared/script_layout/lib.rs
@@ -24,13 +24,12 @@ use canvas_traits::canvas::{CanvasId, CanvasMsg};
use euclid::default::{Point2D, Rect};
use euclid::Size2D;
use fnv::FnvHashMap;
-use fonts::SystemFontServiceProxy;
+use fonts::{FontContext, SystemFontServiceProxy};
use ipc_channel::ipc::IpcSender;
use libc::c_void;
use malloc_size_of_derive::MallocSizeOf;
use metrics::PaintTimeMetrics;
use net_traits::image_cache::{ImageCache, PendingImageId};
-use net_traits::ResourceThreads;
use profile_traits::mem::Report;
use profile_traits::time;
use script_traits::{
@@ -188,8 +187,7 @@ pub struct LayoutConfig {
pub constellation_chan: IpcSender<LayoutMsg>,
pub script_chan: IpcSender<ConstellationControlMsg>,
pub image_cache: Arc<dyn ImageCache>,
- pub resource_threads: ResourceThreads,
- pub system_font_service: Arc<SystemFontServiceProxy>,
+ pub font_context: Arc<FontContext>,
pub time_profiler_chan: time::ProfilerChan,
pub compositor_api: CrossProcessCompositorApi,
pub paint_time_metrics: PaintTimeMetrics,
@@ -205,9 +203,6 @@ pub trait Layout {
/// resolve font metrics.
fn device(&self) -> &Device;
- /// Whether or not this layout is waiting for fonts from loaded stylesheets to finish loading.
- fn waiting_for_web_fonts_to_load(&self) -> bool;
-
/// The currently laid out Epoch that this Layout has finished.
fn current_epoch(&self) -> Epoch;