mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
style: Remove :-moz-lwtheme-{brighttext,darktext}
They are just convenience for :root[lwthemetextcolor="light"] (and dark, respectively), but they generally shouldn't be used for dark mode theming. In the past it was the only way to do it but now we have prefers-color-scheme. While at it, change lwthemetextcolor to be "lwtheme-brighttext" for consistency with similar code we have for popups etc, and move it to _setDarkModeAttributes. While at it, remove layout.css.moz-lwtheme.content.enabled (which is false always, we unshipped these from content successfully). Differential Revision: https://phabricator.services.mozilla.com/D141593
This commit is contained in:
parent
6edcfe9558
commit
62b84a1fac
4 changed files with 6 additions and 24 deletions
|
@ -139,12 +139,6 @@ impl NonTSPseudoClass {
|
|||
/// Returns whether the pseudo-class is enabled in content sheets.
|
||||
#[inline]
|
||||
fn is_enabled_in_content(&self) -> bool {
|
||||
if matches!(
|
||||
*self,
|
||||
Self::MozLWTheme | Self::MozLWThemeBrightText | Self::MozLWThemeDarkText
|
||||
) {
|
||||
return static_prefs::pref!("layout.css.moz-lwtheme.content.enabled");
|
||||
}
|
||||
if let NonTSPseudoClass::MozLocaleDir(..) = *self {
|
||||
return static_prefs::pref!("layout.css.moz-locale-dir.content.enabled");
|
||||
}
|
||||
|
@ -184,8 +178,6 @@ impl NonTSPseudoClass {
|
|||
},
|
||||
NonTSPseudoClass::MozWindowInactive => DocumentState::WINDOW_INACTIVE,
|
||||
NonTSPseudoClass::MozLWTheme => DocumentState::LWTHEME,
|
||||
NonTSPseudoClass::MozLWThemeBrightText => DocumentState::LWTHEME_BRIGHTTEXT,
|
||||
NonTSPseudoClass::MozLWThemeDarkText => DocumentState::LWTHEME_DARKTEXT,
|
||||
_ => DocumentState::empty(),
|
||||
}
|
||||
}
|
||||
|
@ -208,15 +200,13 @@ impl NonTSPseudoClass {
|
|||
NonTSPseudoClass::MozNativeAnonymous |
|
||||
// :-moz-placeholder is parsed but never matches.
|
||||
NonTSPseudoClass::MozPlaceholder |
|
||||
// :-moz-locale-dir and :-moz-window-inactive depend only on
|
||||
// the state of the document, which is invariant across all
|
||||
// the elements involved in a given style cache.
|
||||
NonTSPseudoClass::MozLocaleDir(_) |
|
||||
NonTSPseudoClass::MozWindowInactive |
|
||||
// Similar for the document themes.
|
||||
// :-moz-lwtheme, :-moz-locale-dir and
|
||||
// :-moz-window-inactive depend only on the state of the
|
||||
// document, which is invariant across all the elements
|
||||
// involved in a given style cache.
|
||||
NonTSPseudoClass::MozLWTheme |
|
||||
NonTSPseudoClass::MozLWThemeBrightText |
|
||||
NonTSPseudoClass::MozLWThemeDarkText
|
||||
NonTSPseudoClass::MozLocaleDir(_) |
|
||||
NonTSPseudoClass::MozWindowInactive
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue