mirror of
https://github.com/servo/servo.git
synced 2025-08-16 10:55:34 +01:00
style: trivially cleanup the matching code.
I'm reworking this, and found this cleanup that I think is worth to land.
This commit is contained in:
parent
55e2caba4c
commit
7bdd614540
2 changed files with 71 additions and 57 deletions
|
@ -454,10 +454,17 @@ pub extern "C" fn Servo_StyleSet_GetBaseComputedValuesForElement(raw_data: RawSe
|
|||
Some(PseudoElement::from_atom_unchecked(atom, /* anon_box = */ false))
|
||||
};
|
||||
let pseudos = &styles.pseudos;
|
||||
let pseudo_style = pseudo.as_ref().map(|p| (p, pseudos.get(p).unwrap()));
|
||||
let pseudo_style = match pseudo {
|
||||
Some(ref p) => {
|
||||
let style = pseudos.get(p);
|
||||
debug_assert!(style.is_some());
|
||||
style
|
||||
}
|
||||
None => None,
|
||||
};
|
||||
|
||||
let provider = get_metrics_provider_for_product();
|
||||
element.get_base_style(shared_context, &provider, &styles.primary, &pseudo_style)
|
||||
element.get_base_style(shared_context, &provider, &styles.primary, pseudo_style)
|
||||
.into_strong()
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue