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:
bors-servo 2017-07-07 16:11:50 -07:00 committed by GitHub
commit 1425ad1bab

View file

@ -1589,25 +1589,24 @@ fn get_pseudo_style(
PseudoElementCascadeType::Eager => { PseudoElementCascadeType::Eager => {
match *pseudo { match *pseudo {
PseudoElement::FirstLetter => { PseudoElement::FirstLetter => {
// inherited_styles can be None when doing lazy resolution styles.pseudos.get(&pseudo).and_then(|pseudo_styles| {
// (e.g. for computed style) or when probing. In that case // inherited_styles can be None when doing lazy resolution
// we just inherit from our element, which is what Gecko // (e.g. for computed style) or when probing. In that case
// does in that situation. What should actually happen in // we just inherit from our element, which is what Gecko
// the computed style case is a bit unclear. // does in that situation. What should actually happen in
let inherited_styles = // the computed style case is a bit unclear.
inherited_styles.unwrap_or(styles.primary()); let inherited_styles =
let guards = StylesheetGuards::same(guard); inherited_styles.unwrap_or(styles.primary());
let metrics = get_metrics_provider_for_product(); let guards = StylesheetGuards::same(guard);
let inputs = match styles.pseudos.get(&pseudo) { let metrics = get_metrics_provider_for_product();
Some(styles) => CascadeInputs::new_from_style(styles), let inputs = CascadeInputs::new_from_style(pseudo_styles);
None => return None, doc_data.stylist
}; .compute_pseudo_element_style_with_inputs(
doc_data.stylist &inputs,
.compute_pseudo_element_style_with_inputs( &guards,
&inputs, inherited_styles,
&guards, &metrics)
inherited_styles, })
&metrics)
}, },
_ => { _ => {
debug_assert!(inherited_styles.is_none() || debug_assert!(inherited_styles.is_none() ||