diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2017-12-08 04:48:03 +0100 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2017-12-08 05:35:12 +0100 |
commit | 3119db724aa1ba257b919799e3783e2a047bf28f (patch) | |
tree | d0f96edc14c67b5e577e0ae37398c3f06910f79e /components/script/dom/element.rs | |
parent | e4bb3a102e4965e7867de03d39aee83d36598e4f (diff) | |
download | servo-3119db724aa1ba257b919799e3783e2a047bf28f.tar.gz servo-3119db724aa1ba257b919799e3783e2a047bf28f.zip |
selectors: Simplify :visited by only using the "is inside link" information.
Right now we go through a lot of hoops to see if we ever see a relevant link.
However, that information is not needed: if the element is a link, we'll always
need to compute its visited style because its its own relevant link.
If the element inherits from a link, we need to also compute the visited style
anyway.
So the "has a relevant link been found" is pretty useless when we know what are
we inheriting from.
The branches at the beginning of matches_complex_selector_internal were
affecting performance, and there are no good reasons to keep them.
I've verified that this passes all the visited tests in mozilla central, and
that the test-cases too-flaky to be landed still pass.
Diffstat (limited to 'components/script/dom/element.rs')
-rw-r--r-- | components/script/dom/element.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs index 9f23888ba40..30ac45802a8 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -89,7 +89,8 @@ use script_layout_interface::message::ReflowGoal; use script_thread::ScriptThread; use selectors::Element as SelectorsElement; use selectors::attr::{AttrSelectorOperation, NamespaceConstraint, CaseSensitivity}; -use selectors::matching::{ElementSelectorFlags, MatchingContext, RelevantLinkStatus}; +use selectors::context::VisitedHandlingMode; +use selectors::matching::{ElementSelectorFlags, MatchingContext}; use selectors::sink::Push; use servo_arc::Arc; use servo_atoms::Atom; @@ -2635,7 +2636,7 @@ impl<'a> SelectorsElement for DomRoot<Element> { &self, pseudo_class: &NonTSPseudoClass, _: &mut MatchingContext<Self::Impl>, - _: &RelevantLinkStatus, + _: VisitedHandlingMode, _: &mut F, ) -> bool where |