From 2dbda695349b910e009135d897a81bedba75b9bd Mon Sep 17 00:00:00 2001 From: Nico Burns Date: Sat, 30 Nov 2024 02:48:28 +1300 Subject: Make Servo compatible with Stylo with `prefers-color-scheme` support (#34423) * Make Servo compatible with Stylo with prefer-color-scheme support Signed-off-by: Nico Burns Update imports to work with deduped version of stylo PR Signed-off-by: Nico Burns Switch back to stylo main branch Signed-off-by: Nico Burns * Fix unit tests Signed-off-by: Nico Burns * Update text expectations Signed-off-by: Nico Burns --------- Signed-off-by: Nico Burns --- components/layout_thread/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'components/layout_thread') diff --git a/components/layout_thread/lib.rs b/components/layout_thread/lib.rs index 949ee05e5dc..51e07a9c044 100644 --- a/components/layout_thread/lib.rs +++ b/components/layout_thread/lib.rs @@ -87,6 +87,7 @@ use style::logical_geometry::LogicalPoint; use style::media_queries::{Device, MediaList, MediaType}; use style::properties::style_structs::Font; use style::properties::{ComputedValues, PropertyId}; +use style::queries::values::PrefersColorScheme; use style::selector_parser::{PseudoElement, SnapshotMap}; use style::servo::media_queries::FontMetricsProvider; use style::servo::restyle_damage::ServoRestyleDamage; @@ -591,6 +592,8 @@ impl LayoutThread { Scale::new(window_size.device_pixel_ratio.get()), Box::new(LayoutFontMetricsProvider), ComputedValues::initial_values_with_font_override(font), + // TODO: obtain preferred color scheme from embedder + PrefersColorScheme::Light, ); LayoutThread { @@ -1414,6 +1417,8 @@ impl LayoutThread { Scale::new(window_size_data.device_pixel_ratio.get()), Box::new(LayoutFontMetricsProvider), self.stylist.device().default_computed_values().to_arc(), + // TODO: obtain preferred color scheme from embedder + PrefersColorScheme::Light, ); // Preserve any previously computed root font size. -- cgit v1.2.3