aboutsummaryrefslogtreecommitdiffstats
path: root/components/selectors/parser.rs
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <emilio@crisal.io>2019-04-29 05:58:56 +0000
committerEmilio Cobos Álvarez <emilio@crisal.io>2019-05-07 12:55:43 +0200
commit9f73576f6a61b3f1866d5eb509b849f6ad5aea36 (patch)
treed2062edd7a759e66a11c132ff8b848003a33484d /components/selectors/parser.rs
parentc990c9623d8f204594e9fa12777fd595e1559bbc (diff)
downloadservo-9f73576f6a61b3f1866d5eb509b849f6ad5aea36.tar.gz
servo-9f73576f6a61b3f1866d5eb509b849f6ad5aea36.zip
style: Check iterator length in SelectorIter::is_featureless_host_selector.
I'm going to unconditionally generate the PseudoElement combinator, and this causes issues since we'll put the raw `::pseudo` selectors in the host bucket, which is obviously wrong. Differential Revision: https://phabricator.services.mozilla.com/D27528
Diffstat (limited to 'components/selectors/parser.rs')
-rw-r--r--components/selectors/parser.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/components/selectors/parser.rs b/components/selectors/parser.rs
index e3afab57e16..21459e4e46d 100644
--- a/components/selectors/parser.rs
+++ b/components/selectors/parser.rs
@@ -736,7 +736,8 @@ impl<'a, Impl: 'a + SelectorImpl> SelectorIter<'a, Impl> {
/// combinators to the left.
#[inline]
pub(crate) fn is_featureless_host_selector(&mut self) -> bool {
- self.all(|component| matches!(*component, Component::Host(..))) &&
+ self.selector_length() > 0 &&
+ self.all(|component| matches!(*component, Component::Host(..))) &&
self.next_sequence().is_none()
}