mirror of
https://github.com/servo/servo.git
synced 2025-07-23 15:23:42 +01:00
style: Fix a case where we'd allow parsing functional :host incorrectly.
This is a missing check I should've introduced in bug 1632647. Differential Revision: https://phabricator.services.mozilla.com/D76161
This commit is contained in:
parent
a457a2261b
commit
a40b2b610a
1 changed files with 6 additions and 1 deletions
|
@ -2207,7 +2207,12 @@ where
|
|||
"nth-last-of-type" => return parse_nth_pseudo_class(parser, input, state, Component::NthLastOfType),
|
||||
"is" if parser.parse_is_and_where() => return parse_is_or_where(parser, input, state, Component::Is),
|
||||
"where" if parser.parse_is_and_where() => return parse_is_or_where(parser, input, state, Component::Where),
|
||||
"host" => return Ok(Component::Host(Some(parse_inner_compound_selector(parser, input, state)?))),
|
||||
"host" => {
|
||||
if !state.allows_tree_structural_pseudo_classes() {
|
||||
return Err(input.new_custom_error(SelectorParseErrorKind::InvalidState));
|
||||
}
|
||||
return Ok(Component::Host(Some(parse_inner_compound_selector(parser, input, state)?)));
|
||||
},
|
||||
"not" => {
|
||||
if state.intersects(SelectorParsingState::INSIDE_NEGATION) {
|
||||
return Err(input.new_custom_error(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue