style: Minor reformatting.

MozReview-Commit-ID: KVCfX3LqccF
This commit is contained in:
Emilio Cobos Álvarez 2017-07-22 14:38:36 +02:00
parent 689ee54db3
commit 55d9151dd3
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
2 changed files with 19 additions and 13 deletions

View file

@ -305,9 +305,10 @@ impl ElementData {
/// Returns the kind of restyling that we're going to need to do on this /// Returns the kind of restyling that we're going to need to do on this
/// element, based of the stored restyle hint. /// element, based of the stored restyle hint.
pub fn restyle_kind(&self, pub fn restyle_kind(
shared_context: &SharedStyleContext) &self,
-> RestyleKind { shared_context: &SharedStyleContext
) -> RestyleKind {
if shared_context.traversal_flags.for_animation_only() { if shared_context.traversal_flags.for_animation_only() {
return self.restyle_kind_for_animation(shared_context); return self.restyle_kind_for_animation(shared_context);
} }
@ -335,9 +336,10 @@ impl ElementData {
} }
/// Returns the kind of restyling for animation-only restyle. /// Returns the kind of restyling for animation-only restyle.
pub fn restyle_kind_for_animation(&self, fn restyle_kind_for_animation(
shared_context: &SharedStyleContext) &self,
-> RestyleKind { shared_context: &SharedStyleContext,
) -> RestyleKind {
debug_assert!(shared_context.traversal_flags.for_animation_only()); debug_assert!(shared_context.traversal_flags.for_animation_only());
debug_assert!(self.has_styles(), debug_assert!(self.has_styles(),
"Unstyled element shouldn't be traversed during \ "Unstyled element shouldn't be traversed during \
@ -350,8 +352,8 @@ impl ElementData {
if hint.has_animation_hint() { if hint.has_animation_hint() {
return RestyleKind::CascadeWithReplacements(hint & RestyleHint::for_animations()); return RestyleKind::CascadeWithReplacements(hint & RestyleHint::for_animations());
} }
return RestyleKind::CascadeOnly;
return RestyleKind::CascadeOnly;
} }
/// Return true if important rules are different. /// Return true if important rules are different.
@ -362,9 +364,11 @@ impl ElementData {
/// the check which properties do they want. /// the check which properties do they want.
/// If it costs too much, get_properties_overriding_animations() should return a set /// If it costs too much, get_properties_overriding_animations() should return a set
/// containing only opacity and transform properties. /// containing only opacity and transform properties.
pub fn important_rules_are_different(&self, pub fn important_rules_are_different(
rules: &StrongRuleNode, &self,
guards: &StylesheetGuards) -> bool { rules: &StrongRuleNode,
guards: &StylesheetGuards
) -> bool {
debug_assert!(self.has_styles()); debug_assert!(self.has_styles());
let (important_rules, _custom) = let (important_rules, _custom) =
self.styles.primary().rules().get_properties_overriding_animations(&guards); self.styles.primary().rules().get_properties_overriding_animations(&guards);

View file

@ -480,9 +480,11 @@ pub trait TElement : Eq + PartialEq + Debug + Hash + Sized + Copy + Clone +
} }
/// Returns whether the element's styles are up-to-date for |traversal_flags|. /// Returns whether the element's styles are up-to-date for |traversal_flags|.
fn has_current_styles_for_traversal(&self, fn has_current_styles_for_traversal(
data: &ElementData, &self,
traversal_flags: TraversalFlags) -> bool { data: &ElementData,
traversal_flags: TraversalFlags,
) -> bool {
if traversal_flags.for_animation_only() { if traversal_flags.for_animation_only() {
// In animation-only restyle we never touch snapshots and don't // In animation-only restyle we never touch snapshots and don't
// care about them. But we can't assert '!self.handled_snapshot()' // care about them. But we can't assert '!self.handled_snapshot()'