From d4d45f4148b47757bab5f2c4d2aa20fd2afc7d25 Mon Sep 17 00:00:00 2001 From: bptato Date: Sun, 1 Jan 2023 22:05:06 +0100 Subject: selectorparser: support :link, :visited I say "support", but :visited is never matched. --- src/css/match.nim | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/css/match.nim') 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 -- cgit 1.4.1-2-gfad0