diff --git a/src/web/vaev-style/select.cpp b/src/web/vaev-style/select.cpp index 6c10db04..aa25b211 100644 --- a/src/web/vaev-style/select.cpp +++ b/src/web/vaev-style/select.cpp @@ -500,7 +500,8 @@ static Res _parseSelectorElement(Cursor& cur, OpCode current if (cur->prefix == Css::Token::function("not(")) { Cursor c = cur->content; - val = Selector::not_(try$(_parseSelectorElement(c, OpCode::NOT))); + // consume a whole selector not a single one + val = Selector::not_(try$(Selector::parse(c))); } else { val = Pseudo::make(cur->token.data); } diff --git a/src/web/vaev-style/tests/test-parse-selectors.cpp b/src/web/vaev-style/tests/test-parse-selectors.cpp index 48e4c879..c7194d08 100644 --- a/src/web/vaev-style/tests/test-parse-selectors.cpp +++ b/src/web/vaev-style/tests/test-parse-selectors.cpp @@ -276,6 +276,22 @@ test$("vaev-style-parse-pseudo-selectors") { }) ); + expectEq$( + try$(Selector::parse("div::not(.foo)")), + Selector::and_({ + TypeSelector{Html::DIV}, + Selector::not_(ClassSelector{"foo"s}) + }) + ); + + expectEq$( + try$(Selector::parse("div::not(.foo, .bar)")), + Selector::and_({ + TypeSelector{Html::DIV}, + Selector::not_(Selector::or_({ClassSelector{"foo"s},ClassSelector{"bar"s}})) + }) + ); + return Ok(); }