From 3e0250ae61fcac63361e0b879aabafb13feefbf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Wed, 5 Sep 2018 12:52:16 +0000 Subject: [PATCH] style: Only no-op visited <-> unvisited changes. Other changes should really be (and are) indistinguishable. Differential Revision: https://phabricator.services.mozilla.com/D4847 --- .../element/state_and_attributes.rs | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/components/style/invalidation/element/state_and_attributes.rs b/components/style/invalidation/element/state_and_attributes.rs index fa0ccdd8be9..d13da58a89b 100644 --- a/components/style/invalidation/element/state_and_attributes.rs +++ b/components/style/invalidation/element/state_and_attributes.rs @@ -155,22 +155,11 @@ where return false; } - // If we are sensitive to visitedness and the visited state changed, we - // force a restyle here. Matching doesn't depend on the actual visited - // state at all, so we can't look at matching results to decide what to - // do for this case. - if state_changes.intersects(ElementState::IN_VISITED_OR_UNVISITED_STATE) && - self.shared_context.visited_styles_enabled - { + // If we the visited state changed, we force a restyle here. Matching + // doesn't depend on the actual visited state at all, so we can't look + // at matching results to decide what to do for this case. + if state_changes.intersects(ElementState::IN_VISITED_OR_UNVISITED_STATE) { trace!(" > visitedness change, force subtree restyle"); - // We shouldn't get here with visited links disabled, but it's hard - // to assert in cases where you record a visitedness change and - // afterwards you change some of the stuff (like the pref) that - // changes whether visited styles are enabled. - // - // So just avoid the restyle here, because it kind of would kill the - // point of disabling visited links. - // // We can't just return here because there may also be attribute // changes as well that imply additional hints for siblings. self.data.hint.insert(RestyleHint::restyle_subtree());