diff options
author | Ting-Yu Lin <tlin@mozilla.com> | 2023-06-02 02:26:03 +0200 |
---|---|---|
committer | Oriol Brufau <obrufau@igalia.com> | 2023-06-09 10:22:19 +0200 |
commit | a0617bff0de3a4de70cc15123d0d6ffd6047f98f (patch) | |
tree | 99dff0986551d662183d98342ff9cb9f02a968a5 /components/style/gecko/selector_parser.rs | |
parent | 33ad82c3da6e2aabca811dae30ee3f5b6a05abf2 (diff) | |
download | servo-a0617bff0de3a4de70cc15123d0d6ffd6047f98f.tar.gz servo-a0617bff0de3a4de70cc15123d0d6ffd6047f98f.zip |
style: Run rustfmt on servo/components/style and servo/ports/geckolib
This patch is generated by running `cargo +nightly fmt` under
`servo/components/style/` and `servo/ports/geckolib` against mozilla-central
https://hg.mozilla.org/mozilla-central/rev/b193f2e7a6a5d1f042c957ea4acd5c89bf210512
My nightly version is: 1.58.0-nightly (c9c4b5d72 2021-11-17)
Manually remove the redundant braces in author_styles.rs to fix a warning.
Differential Revision: https://phabricator.services.mozilla.com/D131556
Diffstat (limited to 'components/style/gecko/selector_parser.rs')
-rw-r--r-- | components/style/gecko/selector_parser.rs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/components/style/gecko/selector_parser.rs b/components/style/gecko/selector_parser.rs index 47b2ce5e412..35c5a5c454d 100644 --- a/components/style/gecko/selector_parser.rs +++ b/components/style/gecko/selector_parser.rs @@ -139,7 +139,10 @@ 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) { + if matches!( + *self, + Self::MozLWTheme | Self::MozLWThemeBrightText | Self::MozLWThemeDarkText + ) { return static_prefs::pref!("layout.css.moz-lwtheme.content.enabled"); } if let NonTSPseudoClass::MozLocaleDir(..) = *self { @@ -174,12 +177,10 @@ impl NonTSPseudoClass { /// Get the document state flag associated with a pseudo-class, if any. pub fn document_state_flag(&self) -> DocumentState { match *self { - NonTSPseudoClass::MozLocaleDir(ref dir) => { - match dir.as_horizontal_direction() { - Some(HorizontalDirection::Ltr) => DocumentState::LTR_LOCALE, - Some(HorizontalDirection::Rtl) => DocumentState::RTL_LOCALE, - None => DocumentState::empty(), - } + NonTSPseudoClass::MozLocaleDir(ref dir) => match dir.as_horizontal_direction() { + Some(HorizontalDirection::Ltr) => DocumentState::LTR_LOCALE, + Some(HorizontalDirection::Rtl) => DocumentState::RTL_LOCALE, + None => DocumentState::empty(), }, NonTSPseudoClass::MozWindowInactive => DocumentState::WINDOW_INACTIVE, NonTSPseudoClass::MozLWTheme => DocumentState::LWTHEME, |