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
This commit is contained in:
Emilio Cobos Álvarez 2019-04-29 05:58:56 +00:00
parent c990c9623d
commit 9f73576f6a

View file

@ -736,6 +736,7 @@ impl<'a, Impl: 'a + SelectorImpl> SelectorIter<'a, Impl> {
/// combinators to the left.
#[inline]
pub(crate) fn is_featureless_host_selector(&mut self) -> bool {
self.selector_length() > 0 &&
self.all(|component| matches!(*component, Component::Host(..))) &&
self.next_sequence().is_none()
}