Auto merge of #17762 - emilio:visited-nested, r=jryans

style: Cascade the visited style with the normal rules if we didn't find a relevant link.

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17762)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-07-17 15:21:22 -07:00 committed by GitHub
commit e122ea65fd

View file

@ -121,7 +121,7 @@ where
if should_compute_visited_style {
visited_style = Some(self.cascade_style(
visited_rules.as_ref(),
visited_rules.as_ref().or(Some(&primary_results.rule_node)),
/* style_if_visited = */ None,
parent_style,
layout_parent_style,
@ -223,7 +223,7 @@ where
if parent_style.map_or(false, |s| s.get_visited_style().is_some()) ||
inputs.visited_rules.is_some() {
style_if_visited = Some(self.cascade_style(
inputs.visited_rules.as_ref(),
inputs.visited_rules.as_ref().or(inputs.rules.as_ref()),
/* style_if_visited = */ None,
parent_style,
layout_parent_style,