diff options
author | bptato <nincsnevem662@gmail.com> | 2023-01-01 22:05:06 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-01-01 22:05:06 +0100 |
commit | d4d45f4148b47757bab5f2c4d2aa20fd2afc7d25 (patch) | |
tree | 2a0ee6fa8002c5e49d56b2aa88215c95d17004d1 /src/css/match.nim | |
parent | bfac3a3e843fcb3a6f2d5dd3cc2e45967e8b4f1b (diff) | |
download | chawan-d4d45f4148b47757bab5f2c4d2aa20fd2afc7d25.tar.gz |
selectorparser: support :link, :visited
I say "support", but :visited is never matched.
Diffstat (limited to 'src/css/match.nim')
-rw-r--r-- | src/css/match.nim | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/css/match.nim b/src/css/match.nim index 2d69943b..b17c690d 100644 --- a/src/css/match.nim +++ b/src/css/match.nim @@ -100,6 +100,10 @@ func pseudoSelectorMatches[T: Element|StyledNode](elem: T, sel: Selector, felem: return selem.selectorsMatch(sel.pseudo.fsels, felem) of PSEUDO_LANG: return sel.pseudo.s == "en" #TODO languages? + of PSEUDO_LINK: + return elem.tagType in {TAG_A, TAG_AREA} and elem.attrb("href") + of PSEUDO_VISITED: + return false func combinatorSelectorMatches[T: Element|StyledNode](elem: T, sel: Selector, felem: T): bool = let selem = elem |