Auto merge of #17837 - emilio:assert-fix, r=hiikezoe

style: Avoid looking at descendant hints to check whether the element needs a restyle.

This makes us hit some assertions in Gecko.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17837)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-07-24 04:49:08 -07:00 committed by GitHub
commit 9f412caab2
3 changed files with 8 additions and 4 deletions

View file

@ -324,7 +324,7 @@ impl ElementData {
}
debug_assert!(hint.has_recascade_self(),
"We definitely need to do something!");
"We definitely need to do something: {:?}!", hint);
return RestyleKind::CascadeOnly;
}

View file

@ -492,7 +492,7 @@ pub trait TElement : Eq + PartialEq + Debug + Hash + Sized + Copy + Clone +
return false;
}
data.has_styles() && !data.restyle.hint.has_non_animation_hint()
data.has_styles() && !data.restyle.hint.has_non_animation_invalidations()
}
/// Flags an element and its ancestors with a given `DescendantsBit`.

View file

@ -65,8 +65,12 @@ impl RestyleHint {
}
/// Returns whether we need to restyle this element.
pub fn has_self_invalidations(&self) -> bool {
self.intersects(RESTYLE_SELF | RECASCADE_SELF | Self::replacements())
pub fn has_non_animation_invalidations(&self) -> bool {
self.intersects(
RESTYLE_SELF |
RECASCADE_SELF |
(Self::replacements() & !Self::for_animations())
)
}
/// Propagates this restyle hint to a child element.