about summary refs log tree commit diff stats
path: root/src/css/match.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-05-27 23:32:55 +0200
committerbptato <nincsnevem662@gmail.com>2024-05-27 23:35:07 +0200
commit6340e6a2c041abb9273241897c485aabe87ff5dd (patch)
treebdaa339338bc382eb7a56bb47536c930749e81f7 /src/css/match.nim
parenta8f3891507cf21320f78f2d4a97731ad4462c676 (diff)
downloadchawan-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.nim6
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)