mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
style: Minor reformatting.
MozReview-Commit-ID: KVCfX3LqccF
This commit is contained in:
parent
689ee54db3
commit
55d9151dd3
2 changed files with 19 additions and 13 deletions
|
@ -305,9 +305,10 @@ impl ElementData {
|
|||
|
||||
/// Returns the kind of restyling that we're going to need to do on this
|
||||
/// element, based of the stored restyle hint.
|
||||
pub fn restyle_kind(&self,
|
||||
shared_context: &SharedStyleContext)
|
||||
-> RestyleKind {
|
||||
pub fn restyle_kind(
|
||||
&self,
|
||||
shared_context: &SharedStyleContext
|
||||
) -> RestyleKind {
|
||||
if shared_context.traversal_flags.for_animation_only() {
|
||||
return self.restyle_kind_for_animation(shared_context);
|
||||
}
|
||||
|
@ -335,9 +336,10 @@ impl ElementData {
|
|||
}
|
||||
|
||||
/// Returns the kind of restyling for animation-only restyle.
|
||||
pub fn restyle_kind_for_animation(&self,
|
||||
shared_context: &SharedStyleContext)
|
||||
-> RestyleKind {
|
||||
fn restyle_kind_for_animation(
|
||||
&self,
|
||||
shared_context: &SharedStyleContext,
|
||||
) -> RestyleKind {
|
||||
debug_assert!(shared_context.traversal_flags.for_animation_only());
|
||||
debug_assert!(self.has_styles(),
|
||||
"Unstyled element shouldn't be traversed during \
|
||||
|
@ -350,8 +352,8 @@ impl ElementData {
|
|||
if hint.has_animation_hint() {
|
||||
return RestyleKind::CascadeWithReplacements(hint & RestyleHint::for_animations());
|
||||
}
|
||||
return RestyleKind::CascadeOnly;
|
||||
|
||||
return RestyleKind::CascadeOnly;
|
||||
}
|
||||
|
||||
/// Return true if important rules are different.
|
||||
|
@ -362,9 +364,11 @@ impl ElementData {
|
|||
/// the check which properties do they want.
|
||||
/// If it costs too much, get_properties_overriding_animations() should return a set
|
||||
/// containing only opacity and transform properties.
|
||||
pub fn important_rules_are_different(&self,
|
||||
rules: &StrongRuleNode,
|
||||
guards: &StylesheetGuards) -> bool {
|
||||
pub fn important_rules_are_different(
|
||||
&self,
|
||||
rules: &StrongRuleNode,
|
||||
guards: &StylesheetGuards
|
||||
) -> bool {
|
||||
debug_assert!(self.has_styles());
|
||||
let (important_rules, _custom) =
|
||||
self.styles.primary().rules().get_properties_overriding_animations(&guards);
|
||||
|
|
|
@ -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|.
|
||||
fn has_current_styles_for_traversal(&self,
|
||||
data: &ElementData,
|
||||
traversal_flags: TraversalFlags) -> bool {
|
||||
fn has_current_styles_for_traversal(
|
||||
&self,
|
||||
data: &ElementData,
|
||||
traversal_flags: TraversalFlags,
|
||||
) -> bool {
|
||||
if traversal_flags.for_animation_only() {
|
||||
// In animation-only restyle we never touch snapshots and don't
|
||||
// care about them. But we can't assert '!self.handled_snapshot()'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue