mirror of
https://github.com/servo/servo.git
synced 2025-07-23 15:23:42 +01:00
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>
This commit is contained in:
parent
19a7e95a6a
commit
2dbda69534
6 changed files with 26 additions and 24 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue