mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
style: Remove quite useless StyleChange constructor.
This commit is contained in:
parent
3bfe529728
commit
92e9f12bd0
3 changed files with 3 additions and 12 deletions
|
@ -72,7 +72,8 @@ impl GeckoRestyleDamage {
|
||||||
} else {
|
} else {
|
||||||
StyleChange::Unchanged
|
StyleChange::Unchanged
|
||||||
};
|
};
|
||||||
StyleDifference::new(GeckoRestyleDamage(nsChangeHint(hint)), change)
|
let damage = GeckoRestyleDamage(nsChangeHint(hint));
|
||||||
|
StyleDifference { damage, change }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns true if this restyle damage contains all the damage of |other|.
|
/// Returns true if this restyle damage contains all the damage of |other|.
|
||||||
|
|
|
@ -31,16 +31,6 @@ pub struct StyleDifference {
|
||||||
pub change: StyleChange,
|
pub change: StyleChange,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl StyleDifference {
|
|
||||||
/// Creates a new `StyleDifference`.
|
|
||||||
pub fn new(damage: RestyleDamage, change: StyleChange) -> Self {
|
|
||||||
StyleDifference {
|
|
||||||
change: change,
|
|
||||||
damage: damage,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Represents whether or not the style of an element has changed.
|
/// Represents whether or not the style of an element has changed.
|
||||||
#[derive(Clone, Copy, Debug)]
|
#[derive(Clone, Copy, Debug)]
|
||||||
pub enum StyleChange {
|
pub enum StyleChange {
|
||||||
|
|
|
@ -74,7 +74,7 @@ impl ServoRestyleDamage {
|
||||||
// optimization to skip the cascade in those cases applies.
|
// optimization to skip the cascade in those cases applies.
|
||||||
StyleChange::Changed { reset_only: false }
|
StyleChange::Changed { reset_only: false }
|
||||||
};
|
};
|
||||||
StyleDifference::new(damage, change)
|
StyleDifference { damage, change }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns a bitmask that represents a flow that needs to be rebuilt and
|
/// Returns a bitmask that represents a flow that needs to be rebuilt and
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue