style: Handle correctly nested links.

Followup to #19935, since I'm dumb and missed that orange.
This commit is contained in:
Emilio Cobos Álvarez 2018-02-03 20:45:56 +01:00
parent a0d9d3633b
commit 2e08ab1492
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

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);
}
}