Skip to content

Commit

Permalink
style: fix formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
emilio committed Jun 18, 2020
1 parent 97f29c8 commit bb8c3ee
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 13 deletions.
8 changes: 3 additions & 5 deletions components/canvas/canvas_data.rs
Expand Up @@ -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;
Expand Down Expand Up @@ -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"),
},
}
}
Expand All @@ -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()));
Expand Down
10 changes: 8 additions & 2 deletions components/style/gecko/wrapper.rs
Expand Up @@ -1241,11 +1241,17 @@ impl<'le> TElement for GeckoElement<'le> {
}
}

fn animation_rule(&self, _: &SharedStyleContext) -> Option<Arc<Locked<PropertyDeclarationBlock>>> {
fn animation_rule(
&self,
_: &SharedStyleContext,
) -> Option<Arc<Locked<PropertyDeclarationBlock>>> {
get_animation_rule(self, CascadeLevel::Animations)
}

fn transition_rule(&self, _: &SharedStyleContext) -> Option<Arc<Locked<PropertyDeclarationBlock>>> {
fn transition_rule(
&self,
_: &SharedStyleContext,
) -> Option<Arc<Locked<PropertyDeclarationBlock>>> {
get_animation_rule(self, CascadeLevel::Transitions)
}

Expand Down
11 changes: 6 additions & 5 deletions components/style/matching.rs
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion components/style/values/specified/box.rs
Expand Up @@ -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
Expand Down

0 comments on commit bb8c3ee

Please sign in to comment.