summaryrefslogtreecommitdiffstats
path: root/servo/components/selectors
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
commitfbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 (patch)
tree4c1ccaf5486d4f2009f9a338a98a83e886e29c97 /servo/components/selectors
parentReleasing progress-linux version 124.0.1-1~progress7.99u1. (diff)
downloadfirefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.tar.xz
firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.zip
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'servo/components/selectors')
-rw-r--r--servo/components/selectors/parser.rs30
1 files changed, 3 insertions, 27 deletions
diff --git a/servo/components/selectors/parser.rs b/servo/components/selectors/parser.rs
index 792d4eb8bc..9b0acb0671 100644
--- a/servo/components/selectors/parser.rs
+++ b/servo/components/selectors/parser.rs
@@ -2018,34 +2018,10 @@ impl<Impl: SelectorImpl> Component<Impl> {
}
}
- /// Whether this component is valid after a pseudo-element. Only intended
- /// for sanity-checking.
- pub fn maybe_allowed_after_pseudo_element(&self) -> bool {
- match *self {
- Component::NonTSPseudoClass(..) => true,
- Component::Negation(ref selectors) |
- Component::Is(ref selectors) |
- Component::Where(ref selectors) => selectors.slice().iter().all(|selector| {
- selector
- .iter_raw_match_order()
- .all(|c| c.maybe_allowed_after_pseudo_element())
- }),
- _ => false,
- }
- }
-
- /// Whether a given selector should match for stateless pseudo-elements.
- ///
- /// This is a bit subtle: Only selectors that return true in
- /// `maybe_allowed_after_pseudo_element` should end up here, and
- /// `NonTSPseudoClass` never matches (as it is a stateless pseudo after
- /// all).
+ /// Whether a given selector (to the right of a pseudo-element) should match for stateless
+ /// pseudo-elements. Note that generally nothing matches for those, but since we have :not(),
+ /// we still need to traverse nested selector lists.
fn matches_for_stateless_pseudo_element(&self) -> bool {
- debug_assert!(
- self.maybe_allowed_after_pseudo_element(),
- "Someone messed up pseudo-element parsing: {:?}",
- *self
- );
match *self {
Component::Negation(ref selectors) => !selectors.slice().iter().all(|selector| {
selector