diff options
author | bptato <nincsnevem662@gmail.com> | 2024-05-27 23:32:55 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2024-05-27 23:35:07 +0200 |
commit | 6340e6a2c041abb9273241897c485aabe87ff5dd (patch) | |
tree | bdaa339338bc382eb7a56bb47536c930749e81f7 /src/css/match.nim | |
parent | a8f3891507cf21320f78f2d4a97731ad4462c676 (diff) | |
download | chawan-6340e6a2c041abb9273241897c485aabe87ff5dd.tar.gz |
stylednode: move invalidation data to DOM
this way, we do not refer to nodes of previous cascade passes
Diffstat (limited to 'src/css/match.nim')
-rw-r--r-- | src/css/match.nim | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/css/match.nim b/src/css/match.nim index e621b332..52a8ab7f 100644 --- a/src/css/match.nim +++ b/src/css/match.nim @@ -83,7 +83,7 @@ func pseudoSelectorMatches[T: Element|StyledNode](elem: T; sel: Selector; return elem.parentNode.firstElementChild == elem and elem.parentNode.lastElementChild == elem of pcHover: - when selem is StyledNode: felem.addDependency(selem, dtHover) + when selem is StyledNode: felem.addDependency(elem, dtHover) return elem.hover of pcRoot: return elem == elem.document.html of pcNthChild: @@ -133,14 +133,14 @@ func pseudoSelectorMatches[T: Element|StyledNode](elem: T; sel: Selector; inc i return false of pcChecked: - when selem is StyledNode: felem.addDependency(selem, dtChecked) + when selem is StyledNode: felem.addDependency(elem, dtChecked) if elem.tagType == TAG_INPUT: return HTMLInputElement(elem).checked elif elem.tagType == TAG_OPTION: return HTMLOptionElement(elem).selected return false of pcFocus: - when selem is StyledNode: felem.addDependency(selem, dtFocus) + when selem is StyledNode: felem.addDependency(elem, dtFocus) return elem.document.focus == elem of pcNot: return not selem.selectorsMatch(sel.pseudo.fsels, felem) |