aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/css/selectorparser.nim7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/css/selectorparser.nim b/src/css/selectorparser.nim
index 97c6f029..926606da 100644
--- a/src/css/selectorparser.nim
+++ b/src/css/selectorparser.nim
@@ -412,7 +412,12 @@ func parseSelectors*(cvals: seq[CSSComponentValue]): seq[ComplexSelector] = {.ca
elif cval of CSSFunction:
state.parseSelectorFunction(CSSFunction(cval))
if state.combinator != nil:
- state.selectors[^1].add(state.combinator)
+ if state.combinator.csels.len == 1:
+ if state.combinator.ct == DESCENDANT_COMBINATOR:
+ # otherwise it's an invalid combinator
+ state.selectors[^1].add(state.combinator.csels[0])
+ else:
+ state.selectors[^1].add(state.combinator)
state.combinator = nil
return state.selectors