mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibWeb: Implement the color-scheme meta tag name
This commit is contained in:
parent
ce5cd012b9
commit
df70455d3f
Notes:
github-actions[bot]
2025-01-08 11:19:34 +00:00
Author: https://github.com/Gingeh
Commit: df70455d3f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3146
Reviewed-by: https://github.com/AtkinsSJ ✅
7 changed files with 97 additions and 3 deletions
|
@ -334,7 +334,7 @@ void NodeWithStyle::apply_style(const CSS::ComputedProperties& computed_style)
|
|||
if (preferred_color_scheme != CSS::PreferredColorScheme::Dark && preferred_color_scheme != CSS::PreferredColorScheme::Light) {
|
||||
preferred_color_scheme = document().page().palette().is_dark() ? CSS::PreferredColorScheme::Dark : CSS::PreferredColorScheme::Light;
|
||||
}
|
||||
computed_values.set_color_scheme(computed_style.color_scheme(preferred_color_scheme));
|
||||
computed_values.set_color_scheme(computed_style.color_scheme(preferred_color_scheme, document().supported_color_schemes()));
|
||||
|
||||
// NOTE: color must be set second to ensure currentColor can be resolved in other properties (e.g. background-color).
|
||||
computed_values.set_color(computed_style.color_or_fallback(CSS::PropertyID::Color, *this, CSS::InitialValues::color()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue