Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 39758fd

Browse files
committed
servo: Merge #19163 - style: Remove the skip_applying_damage "optimization" (from emilio:useless-opt); r=nox
We already remove all change hints down the tree when finding a reframe hint using ClearServoRestyleFromSubtree in ServoRestyleManager, so this is useless. MozReview-Commit-ID: 1twx7iPt79x Source-Repo: https://github.com/servo/servo Source-Revision: 20ccde9a75e52f3dc7adccf0136f5753deb41158 --HG-- extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear extra : subtree_revision : 4e8d88923fef766a3d9eeca267356ef6962809c6
1 parent 6fe0ace commit 39758fd

2 files changed

Lines changed: 1 addition & 20 deletions

File tree

servo/components/style/data.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -466,20 +466,6 @@ impl ElementData {
466466
self.is_restyle() || !self.hint.is_empty() || !self.damage.is_empty()
467467
}
468468

469-
/// If an ancestor is already getting reconstructed by Gecko's top-down
470-
/// frame constructor, no need to apply damage. Similarly if we already
471-
/// have an explicitly stored ReconstructFrame hint.
472-
///
473-
/// See https://bugzilla.mozilla.org/show_bug.cgi?id=1301258#c12
474-
/// for followup work to make the optimization here more optimal by considering
475-
/// each bit individually.
476-
#[cfg(feature = "gecko")]
477-
pub fn skip_applying_damage(&self) -> bool { self.reconstructed_self_or_ancestor() }
478-
479-
/// N/A in Servo.
480-
#[cfg(feature = "servo")]
481-
pub fn skip_applying_damage(&self) -> bool { false }
482-
483469
/// Returns whether it is safe to perform cousin sharing based on the ComputedValues
484470
/// identity of the primary style in this ElementData. There are a few subtle things
485471
/// to check.

servo/components/style/matching.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,6 @@ trait PrivateMatchMethods: TElement {
333333
fn accumulate_damage_for(
334334
&self,
335335
shared_context: &SharedStyleContext,
336-
skip_applying_damage: bool,
337336
damage: &mut RestyleDamage,
338337
old_values: &ComputedValues,
339338
new_values: &ComputedValues,
@@ -345,9 +344,7 @@ trait PrivateMatchMethods: TElement {
345344
let difference =
346345
self.compute_style_difference(old_values, new_values, pseudo);
347346

348-
if !skip_applying_damage {
349-
*damage |= difference.damage;
350-
}
347+
*damage |= difference.damage;
351348

352349
debug!(" > style difference: {:?}", difference);
353350

@@ -590,7 +587,6 @@ pub trait MatchMethods : TElement {
590587
cascade_requirement,
591588
self.accumulate_damage_for(
592589
context.shared,
593-
data.skip_applying_damage(),
594590
&mut data.damage,
595591
&old_primary_style,
596592
new_primary_style,
@@ -612,7 +608,6 @@ pub trait MatchMethods : TElement {
612608
(&Some(ref old), &Some(ref new)) => {
613609
self.accumulate_damage_for(
614610
context.shared,
615-
data.skip_applying_damage(),
616611
&mut data.damage,
617612
old,
618613
new,

0 commit comments

Comments
 (0)