diff options
author | Nico Burns <nico@nicoburns.com> | 2024-11-30 02:48:28 +1300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-29 13:48:28 +0000 |
commit | 2dbda695349b910e009135d897a81bedba75b9bd (patch) | |
tree | 6141efa2e1b39c7fd5c1842fb40f98b83165ad89 /components/layout_thread | |
parent | 19a7e95a6a4cc4e6aa187f2fe2302c4707401e34 (diff) | |
download | servo-2dbda695349b910e009135d897a81bedba75b9bd.tar.gz servo-2dbda695349b910e009135d897a81bedba75b9bd.zip |
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 <nico@nicoburns.com>
Update imports to work with deduped version of stylo PR
Signed-off-by: Nico Burns <nico@nicoburns.com>
Switch back to stylo main branch
Signed-off-by: Nico Burns <nico@nicoburns.com>
* Fix unit tests
Signed-off-by: Nico Burns <nico@nicoburns.com>
* Update text expectations
Signed-off-by: Nico Burns <nico@nicoburns.com>
---------
Signed-off-by: Nico Burns <nico@nicoburns.com>
Diffstat (limited to 'components/layout_thread')
-rw-r--r-- | components/layout_thread/lib.rs | 5 |
1 files changed, 5 insertions, 0 deletions
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. |