mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
style: Refactor the per_pseudo map from StyleData to avoid having an option value type.
This make the layout code way clearer.
This commit is contained in:
parent
a604d605ed
commit
61e04df266
7 changed files with 52 additions and 52 deletions
|
@ -49,7 +49,7 @@ bitflags! {
|
|||
}
|
||||
|
||||
impl TRestyleDamage for RestyleDamage {
|
||||
fn compute(old: &Option<Arc<ComputedValues>>, new: &ComputedValues) -> RestyleDamage { compute_damage(old, new) }
|
||||
fn compute(old: Option<&Arc<ComputedValues>>, new: &ComputedValues) -> RestyleDamage { compute_damage(old, new) }
|
||||
|
||||
/// Returns a bitmask that represents a flow that needs to be rebuilt and reflowed.
|
||||
///
|
||||
|
@ -143,12 +143,11 @@ macro_rules! add_if_not_equal(
|
|||
})
|
||||
);
|
||||
|
||||
pub fn compute_damage(old: &Option<Arc<ComputedValues>>, new: &ComputedValues) -> RestyleDamage {
|
||||
let old: &ComputedValues =
|
||||
match old.as_ref() {
|
||||
None => return RestyleDamage::rebuild_and_reflow(),
|
||||
Some(cv) => &**cv,
|
||||
};
|
||||
pub fn compute_damage(old: Option<&Arc<ComputedValues>>, new: &ComputedValues) -> RestyleDamage {
|
||||
let old: &ComputedValues = match old {
|
||||
None => return RestyleDamage::rebuild_and_reflow(),
|
||||
Some(cv) => &**cv,
|
||||
};
|
||||
|
||||
let mut damage = RestyleDamage::empty();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue