Auto merge of #17348 - emilio:bup, r=bholley

style: Inline RestyleData.

Bug: 1368236
MozReview-Commit-ID: 49s3SO0PMHf

<!-- 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/17348)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-06-15 20:28:56 -07:00 committed by GitHub
commit 33766b2714
11 changed files with 183 additions and 202 deletions

View file

@ -707,8 +707,7 @@ trait PrivateMatchMethods: TElement {
// for followup work to make the optimization here more optimal by considering
// each bit individually.
let skip_applying_damage =
restyle.damage.contains(RestyleDamage::reconstruct()) ||
restyle.reconstructed_ancestor;
restyle.reconstructed_self_or_ancestor();
let difference = self.compute_style_difference(&old_values,
&new_values,
@ -1187,12 +1186,10 @@ pub trait MatchMethods : TElement {
}
});
if matches_different_pseudos {
if let Some(r) = data.get_restyle_mut() {
// Any changes to the matched pseudo-elements trigger
// reconstruction.
r.damage |= RestyleDamage::reconstruct();
}
if matches_different_pseudos && data.restyle.is_restyle() {
// Any changes to the matched pseudo-elements trigger
// reconstruction.
data.restyle.damage |= RestyleDamage::reconstruct();
}
}
@ -1257,16 +1254,11 @@ pub trait MatchMethods : TElement {
/// Computes and applies restyle damage.
fn accumulate_damage(&self,
shared_context: &SharedStyleContext,
restyle: Option<&mut RestyleData>,
restyle: &mut RestyleData,
old_values: Option<&ComputedValues>,
new_values: &Arc<ComputedValues>,
pseudo: Option<&PseudoElement>)
-> ChildCascadeRequirement {
let restyle = match restyle {
Some(r) => r,
None => return ChildCascadeRequirement::MustCascadeChildren,
};
let old_values = match old_values {
Some(v) => v,
None => return ChildCascadeRequirement::MustCascadeChildren,