mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Auto merge of #17636 - upsuper:bug1378814, r=emilio
Don't return None in get_pseudo_style if not probing This is the Servo side change of [bug 1378814](https://bugzilla.mozilla.org/show_bug.cgi?id=1378814).
This commit is contained in:
commit
1425ad1bab
1 changed files with 18 additions and 19 deletions
|
@ -1589,6 +1589,7 @@ fn get_pseudo_style(
|
||||||
PseudoElementCascadeType::Eager => {
|
PseudoElementCascadeType::Eager => {
|
||||||
match *pseudo {
|
match *pseudo {
|
||||||
PseudoElement::FirstLetter => {
|
PseudoElement::FirstLetter => {
|
||||||
|
styles.pseudos.get(&pseudo).and_then(|pseudo_styles| {
|
||||||
// inherited_styles can be None when doing lazy resolution
|
// inherited_styles can be None when doing lazy resolution
|
||||||
// (e.g. for computed style) or when probing. In that case
|
// (e.g. for computed style) or when probing. In that case
|
||||||
// we just inherit from our element, which is what Gecko
|
// we just inherit from our element, which is what Gecko
|
||||||
|
@ -1598,16 +1599,14 @@ fn get_pseudo_style(
|
||||||
inherited_styles.unwrap_or(styles.primary());
|
inherited_styles.unwrap_or(styles.primary());
|
||||||
let guards = StylesheetGuards::same(guard);
|
let guards = StylesheetGuards::same(guard);
|
||||||
let metrics = get_metrics_provider_for_product();
|
let metrics = get_metrics_provider_for_product();
|
||||||
let inputs = match styles.pseudos.get(&pseudo) {
|
let inputs = CascadeInputs::new_from_style(pseudo_styles);
|
||||||
Some(styles) => CascadeInputs::new_from_style(styles),
|
|
||||||
None => return None,
|
|
||||||
};
|
|
||||||
doc_data.stylist
|
doc_data.stylist
|
||||||
.compute_pseudo_element_style_with_inputs(
|
.compute_pseudo_element_style_with_inputs(
|
||||||
&inputs,
|
&inputs,
|
||||||
&guards,
|
&guards,
|
||||||
inherited_styles,
|
inherited_styles,
|
||||||
&metrics)
|
&metrics)
|
||||||
|
})
|
||||||
},
|
},
|
||||||
_ => {
|
_ => {
|
||||||
debug_assert!(inherited_styles.is_none() ||
|
debug_assert!(inherited_styles.is_none() ||
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue