Pass a callback to recalc_style_at to avoid traversing children twice.

MozReview-Commit-ID: DIHXaVNzbFM
This commit is contained in:
Bobby Holley 2017-07-12 17:46:21 -07:00
parent e534ec9e47
commit b7de96e702
6 changed files with 166 additions and 188 deletions

View file

@ -70,11 +70,16 @@ impl RestyleData {
/// Returns whether this element or any ancestor is going to be
/// reconstructed.
pub fn reconstructed_self_or_ancestor(&self) -> bool {
self.reconstructed_ancestor() ||
self.reconstructed_ancestor() || self.reconstructed_self()
}
/// Returns whether this element is going to be reconstructed.
pub fn reconstructed_self(&self) -> bool {
self.damage.contains(RestyleDamage::reconstruct())
}
/// Returns whether any ancestor of this element was restyled.
/// Returns whether any ancestor of this element is going to be
/// reconstructed.
fn reconstructed_ancestor(&self) -> bool {
self.flags.contains(ANCESTOR_WAS_RECONSTRUCTED)
}