style: Handle TraversalRestyleBehavior::ForReconstruct in the Servo restyle.

This commit is contained in:
Cameron McCormack 2017-04-04 19:32:47 +08:00
parent 2bbeb21551
commit 3f71c80e2f
5 changed files with 89 additions and 23 deletions

View file

@ -223,6 +223,13 @@ impl StoredRestyleHint {
StoredRestyleHint(RESTYLE_SELF | RESTYLE_DESCENDANTS)
}
/// Creates a restyle hint that forces the element and all its later
/// siblings to have their whole subtrees restyled, including the elements
/// themselves.
pub fn subtree_and_later_siblings() -> Self {
StoredRestyleHint(RESTYLE_SELF | RESTYLE_DESCENDANTS | RESTYLE_LATER_SIBLINGS)
}
/// Returns true if the hint indicates that our style may be invalidated.
pub fn has_self_invalidations(&self) -> bool {
self.0.intersects(RestyleHint::for_self())