Bug 1917034 - Apply color-scheme after forced-color-adjust. r=firefox-style-system-reviewers,zrhoffman

It is one of the skipped-on-forced-colors properties.

Differential Revision: https://phabricator.services.mozilla.com/D221768
This commit is contained in:
Emilio Cobos Álvarez 2024-09-12 11:25:34 +00:00
Родитель 42b2dc5f6b
Коммит f299fb9ba0
4 изменённых файлов: 39 добавлений и 3 удалений

Просмотреть файл

@ -0,0 +1,18 @@
<!doctype html>
<style>
:root {
forced-color-adjust: none;
}
div {
background-color: light-dark(beige, brown);
color: light-dark(purple, blue);
}
div:first-of-type {
color-scheme: light;
}
div:last-of-type {
color-scheme: dark;
}
</style>
<div>Light</div>
<div>Dark</div>

Просмотреть файл

@ -0,0 +1,16 @@
<!doctype html>
<style>
div {
background-color: light-dark(beige, brown);
color: light-dark(purple, blue);
forced-color-adjust: none;
}
div:first-of-type {
color-scheme: light;
}
div:last-of-type {
color-scheme: dark;
}
</style>
<div>Light</div>
<div>Dark</div>

Просмотреть файл

@ -107,3 +107,5 @@ pref(ui.use_standins_for_native_colors,false) pref(browser.display.use_system_co
# Forced color adjust
pref(layout.css.forced-color-adjust.enabled,true) == backplate-force-color-adjust.html backplate-force-color-adjust-ref.html
== transparent-textarea.html transparent-textarea-ref.html
== color-scheme.html color-scheme-ref.html

Просмотреть файл

@ -809,11 +809,11 @@ impl<'b> Cascade<'b> {
#[cfg(feature = "gecko")]
apply!(FontSizeAdjust);
apply!(ColorScheme);
#[cfg(feature = "gecko")]
apply!(ForcedColorAdjust);
// Compute the line height.
// color-scheme needs to be after forced-color-adjust, since it's one of the "skipped in
// forced-colors-mode" properties.
apply!(ColorScheme);
apply!(LineHeight);
}