From f6d0a14246933b038a1521bc4d89855cd206af33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Mon, 18 Dec 2017 22:21:44 +0100 Subject: [PATCH] style: Don't adjust :visited styles. As the comment says those are not interesting, and it matches what we do for text and placeholders in Servo_ComputedValues_Inherit. This fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1425893 --- components/style/style_adjuster.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/components/style/style_adjuster.rs b/components/style/style_adjuster.rs index 4355a8a4385..bf48b98696e 100644 --- a/components/style/style_adjuster.rs +++ b/components/style/style_adjuster.rs @@ -557,6 +557,15 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> { layout_parent_style: &ComputedValues, flags: CascadeFlags, ) { + // Don't adjust visited styles, visited-dependent properties aren't + // affected by these adjustments and it'd be just wasted work anyway. + // + // It also doesn't make much sense to adjust them, since we don't + // cascade most properties anyway, and they wouldn't be looked up. + if flags.contains(CascadeFlags::VISITED_DEPENDENT_ONLY) { + return; + } + self.adjust_for_visited(flags); #[cfg(feature = "gecko")] {