about summary refs log tree commit diff stats
path: root/src/css
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-01-20 13:33:34 +0100
committerbptato <nincsnevem662@gmail.com>2023-01-20 13:33:34 +0100
commit8d83bfc2c16ee2e789a7dadaff26d6e7cb6047af (patch)
tree65cda1512e12641b7a3a62706dcbdf532425935f /src/css
parentaa5c5f18257a7fdf42eaa7e63ea18f93a6a4ee8c (diff)
downloadchawan-8d83bfc2c16ee2e789a7dadaff26d6e7cb6047af.tar.gz
selectorparser: parse comma correctly in combinators
Diffstat (limited to 'src/css')
-rw-r--r--src/css/selectorparser.nim3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/css/selectorparser.nim b/src/css/selectorparser.nim
index 6a07c277..2a79ecb2 100644
--- a/src/css/selectorparser.nim
+++ b/src/css/selectorparser.nim
@@ -318,6 +318,9 @@ proc parseSelectorToken(state: var SelectorParser, csstoken: CSSToken) =
   of CSS_HASH_TOKEN:
     state.addSelector(Selector(t: ID_SELECTOR, id: csstoken.value))
   of CSS_COMMA_TOKEN:
+    if state.combinator != nil:
+      state.selectors[^1].add(state.combinator)
+      state.combinator = nil
     if state.selectors[^1].len > 0:
       state.addComplexSelector()
   of CSS_WHITESPACE_TOKEN: