Bug 1471063: Remove unneeded combinator check in selector-matching. r?xidorn draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Tue, 26 Jun 2018 00:25:58 +0200
changeset 810468 cbafff3e6f222faa9192fc769a680722e2d7eacb
parent 810467 c5eae13f6455762e771e35e8edeedcacdc541dbe
child 810469 94cf634b575b75a7dd9c4ff8556c9abdd963342b
push id114007
push userbmo:emilio@crisal.io
push dateMon, 25 Jun 2018 22:53:31 +0000
reviewersxidorn
bugs1471063
milestone62.0a1
Bug 1471063: Remove unneeded combinator check in selector-matching. r?xidorn The combinator doesn't change during the loop, no need to check it. MozReview-Commit-ID: KIAt0WiEOtI
servo/components/selectors/matching.rs
--- a/servo/components/selectors/matching.rs
+++ b/servo/components/selectors/matching.rs
@@ -571,17 +571,17 @@ where
             // NotMatchedAndRestartFromClosestLaterSibling or
             // NotMatchedAndRestartFromClosestDescendant, or the
             // Combinator::LaterSibling combinator and the status is
             // NotMatchedAndRestartFromClosestDescendant, we can continue to
             // matching on the next candidate element.
             _ => {},
         }
 
-        if element.is_link() || combinator.is_sibling() {
+        if element.is_link() {
             visited_handling = VisitedHandlingMode::AllLinksUnvisited;
         }
 
         next_element = next_element_for_combinator(&element, combinator, &selector_iter);
     }
 }
 
 #[inline]