diff options
| author | bptato <nincsnevem662@gmail.com> | 2024-12-18 02:19:47 +0100 |
|---|---|---|
| committer | bptato <nincsnevem662@gmail.com> | 2024-12-18 02:23:45 +0100 |
| commit | f4daa425483e902e2bd43b82427fe10a27eaca66 (patch) | |
| tree | b55c8d567cd8f36771c0b01b84d2e03d8303c395 /src/css | |
| parent | 13f395f20bd786d6c055b59ad19e9018d85bc139 (diff) | |
| download | chawan-f4daa425483e902e2bd43b82427fe10a27eaca66.tar.gz | |
match: fix nested hover selector
I didn't get it right :(
true is the default return value, and true + continue should resolve
to false.
Diffstat (limited to 'src/css')
| -rw-r--r-- | src/css/match.nim | 3 |
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) |