about summary refs log tree commit diff stats
path: root/src/css
diff options
context:
space:
mode:
Diffstat (limited to 'src/css')
-rw-r--r--src/css/match.nim3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/css/match.nim b/src/css/match.nim
index 5a4f81d2..ffd6bf9b 100644
--- a/src/css/match.nim
+++ b/src/css/match.nim
@@ -216,7 +216,7 @@ func matches(element: Element; sels: CompoundSelector;
 func matches*(element: Element; cxsel: ComplexSelector;
     depends: var DependencyInfo): bool =
   var e = element
-  var pmatch = mtFalse
+  var pmatch = mtTrue
   var mdepends = DependencyInfo()
   for i in countdown(cxsel.high, 0):
     var match = mtFalse
@@ -258,6 +258,7 @@ func matches*(element: Element; cxsel: ComplexSelector;
     if match == mtFalse:
       return false # we can discard depends.
     if pmatch == mtContinue and match == mtTrue or e == nil:
+      pmatch = mtContinue
       break # we must update depends.
     pmatch = match
   depends.merge(mdepends)