From bb8c3ee8ba0445ff22709ffb5bae283fafe10fb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Thu, 18 Jun 2020 20:27:58 +0200 Subject: [PATCH] style: fix formatting. --- components/canvas/canvas_data.rs | 8 +++----- components/style/gecko/wrapper.rs | 10 ++++++++-- components/style/matching.rs | 11 ++++++----- components/style/values/specified/box.rs | 2 +- 4 files changed, 18 insertions(+), 13 deletions(-) diff --git a/components/canvas/canvas_data.rs b/components/canvas/canvas_data.rs index 027c6a3155c..706648e8bf3 100644 --- a/components/canvas/canvas_data.rs +++ b/components/canvas/canvas_data.rs @@ -11,7 +11,7 @@ use euclid::{point2, vec2}; use font_kit::family_name::FamilyName; use font_kit::font::Font; use font_kit::metrics::Metrics; -use font_kit::properties::{Properties, Weight, Stretch, Style}; +use font_kit::properties::{Properties, Stretch, Style, Weight}; use font_kit::source::SystemSource; use gfx::font::FontHandleMethods; use gfx::font_cache_thread::FontCacheThread; @@ -1385,9 +1385,7 @@ fn to_font_kit_family(font_family: &font::SingleFontFamily) -> FamilyName { font::GenericFontFamily::Monospace => FamilyName::Monospace, font::GenericFontFamily::Fantasy => FamilyName::Fantasy, font::GenericFontFamily::Cursive => FamilyName::Cursive, - font::GenericFontFamily::None => { - unreachable!("Shouldn't appear in computed values") - }, + font::GenericFontFamily::None => unreachable!("Shouldn't appear in computed values"), }, } } @@ -1411,7 +1409,7 @@ fn load_system_font_from_style(font_style: Option<&FontStyleStruct>) -> Font { font::FontStyle::Oblique(..) => { // TODO: support oblique angle. Style::Oblique - } + }, }) .weight(Weight(style.font_weight.0)) .stretch(Stretch(style.font_stretch.value())); diff --git a/components/style/gecko/wrapper.rs b/components/style/gecko/wrapper.rs index 9d63be36cd4..8184ccaa3e4 100644 --- a/components/style/gecko/wrapper.rs +++ b/components/style/gecko/wrapper.rs @@ -1241,11 +1241,17 @@ impl<'le> TElement for GeckoElement<'le> { } } - fn animation_rule(&self, _: &SharedStyleContext) -> Option>> { + fn animation_rule( + &self, + _: &SharedStyleContext, + ) -> Option>> { get_animation_rule(self, CascadeLevel::Animations) } - fn transition_rule(&self, _: &SharedStyleContext) -> Option>> { + fn transition_rule( + &self, + _: &SharedStyleContext, + ) -> Option>> { get_animation_rule(self, CascadeLevel::Transitions) } diff --git a/components/style/matching.rs b/components/style/matching.rs index 8e4398bc8c2..c74d4feda3c 100644 --- a/components/style/matching.rs +++ b/components/style/matching.rs @@ -421,11 +421,12 @@ trait PrivateMatchMethods: TElement { new_values, /* pseudo_element = */ None, ) { - let after_change_style = if self.has_css_transitions(context.shared, /* pseudo_element = */ None) { - self.after_change_style(context, new_values) - } else { - None - }; + let after_change_style = + if self.has_css_transitions(context.shared, /* pseudo_element = */ None) { + self.after_change_style(context, new_values) + } else { + None + }; // In order to avoid creating a SequentialTask for transitions which // may not be updated, we check it per property to make sure Gecko diff --git a/components/style/values/specified/box.rs b/components/style/values/specified/box.rs index 6fc86b48678..aeaa1930675 100644 --- a/components/style/values/specified/box.rs +++ b/components/style/values/specified/box.rs @@ -40,7 +40,7 @@ fn flexbox_enabled() -> bool { return servo_config::prefs::pref_map() .get("layout.flexbox.enabled") .as_bool() - .unwrap_or(false) + .unwrap_or(false); } true