mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
style: Inline RestyleData.
Bug: 1368236 MozReview-Commit-ID: 49s3SO0PMHf
This commit is contained in:
parent
0c53ba318a
commit
ffc45e9aaa
11 changed files with 183 additions and 202 deletions
|
@ -697,8 +697,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,
|
||||
|
@ -1177,12 +1176,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();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1247,16 +1244,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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue