소스 검색

LibWeb: Don't infer descendant combinator for <compound-selector>

This fixes an issue where :host(foo) would parse as if "foo" was the
on the right side of a descendant combinator.

Not testable yet, but will be in the next commit.
Andreas Kling 11 달 전
부모
커밋
274c46a3c9
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 1
      Userland/Libraries/LibWeb/CSS/Parser/SelectorParsing.cpp

+ 4 - 1
Userland/Libraries/LibWeb/CSS/Parser/SelectorParsing.cpp

@@ -506,7 +506,10 @@ Parser::ParseErrorOr<Selector::SimpleSelector> Parser::parse_pseudo_simple_selec
                 return ParseError::SyntaxError;
                 return ParseError::SyntaxError;
             }
             }
 
 
-            Vector compound_selectors { compound_selector_or_error.release_value().release_value() };
+            auto compound_selector = compound_selector_or_error.release_value().release_value();
+            compound_selector.combinator = Selector::Combinator::None;
+
+            Vector compound_selectors { move(compound_selector) };
             auto selector = Selector::create(move(compound_selectors));
             auto selector = Selector::create(move(compound_selectors));
 
 
             return Selector::SimpleSelector {
             return Selector::SimpleSelector {