Auto merge of #19941 - emilio:cleanup-style-builder, r=emilio

style: Handle correctly nested links.

Followup to #19935, since I'm dumb and missed some orange in my try run.

<!-- 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/19941)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2018-02-03 15:28:58 -05:00 committed by GitHub
commit 2f8cd0fe22
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -552,8 +552,15 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> {
self.style.pseudo.is_none() &&
element.map_or(false, |e| e.is_link());
if is_link_element && element.unwrap().is_visited_link() {
if !is_link_element {
return;
}
if element.unwrap().is_visited_link() {
self.style.flags.insert(ComputedValueFlags::IS_RELEVANT_LINK_VISITED);
} else {
// Need to remove to handle unvisited link inside visited.
self.style.flags.remove(ComputedValueFlags::IS_RELEVANT_LINK_VISITED);
}
}