From 2006994ae6c4e313b6a26b399a27981e15b5144b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Thu, 20 Jul 2017 19:05:16 +0200 Subject: [PATCH] Add a comment about visited style inheritance. --- components/style/style_resolver.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/style/style_resolver.rs b/components/style/style_resolver.rs index bd3eb57f75b..71598ab14d2 100644 --- a/components/style/style_resolver.rs +++ b/components/style/style_resolver.rs @@ -474,6 +474,9 @@ where cascade_flags.insert(SKIP_ROOT_AND_ITEM_BASED_DISPLAY_FIXUP); } if cascade_visited.visited_dependent_only() { + // If this element is a link, we want its visited style to inherit + // from the regular style of its parent, because only the + // visitedness of the relevant link should influence style. if pseudo.is_some() || !self.element.is_link() { parent_style = parent_style.map(|s| { s.get_visited_style().unwrap_or(s)