mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
style: Fix relevant-link-visited logic in presence of nested links.
MozReview-Commit-ID: LIjpTAgrPBY
This commit is contained in:
parent
aea24fa81e
commit
04e855c38d
3 changed files with 19 additions and 7 deletions
|
@ -436,15 +436,20 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> {
|
|||
/// FIXME(emilio): This isn't technically a style adjustment thingie, could
|
||||
/// it move somewhere else?
|
||||
fn adjust_for_visited(&mut self, flags: CascadeFlags) {
|
||||
use properties::IS_VISITED_LINK;
|
||||
use properties::{IS_LINK, IS_VISITED_LINK};
|
||||
use properties::computed_value_flags::IS_RELEVANT_LINK_VISITED;
|
||||
|
||||
if !self.style.has_visited_style() {
|
||||
return;
|
||||
}
|
||||
|
||||
if flags.contains(IS_VISITED_LINK) ||
|
||||
self.style.inherited_style().flags.contains(IS_RELEVANT_LINK_VISITED) {
|
||||
let relevant_link_visited = if flags.contains(IS_LINK) {
|
||||
flags.contains(IS_VISITED_LINK)
|
||||
} else {
|
||||
self.style.inherited_style().flags.contains(IS_RELEVANT_LINK_VISITED)
|
||||
};
|
||||
|
||||
if relevant_link_visited {
|
||||
self.style.flags.insert(IS_RELEVANT_LINK_VISITED);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue