about summary refs log tree commit diff stats
path: root/src/html/dom.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/html/dom.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/html/dom.nim')
-rw-r--r--src/html/dom.nim7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/html/dom.nim b/src/html/dom.nim
index 14d46037..4f8b7cef 100644
--- a/src/html/dom.nim
+++ b/src/html/dom.nim
@@ -66,6 +66,9 @@ type DocumentReadyState* = enum
   rsComplete = "complete"
 
 type
+  DependencyType* = enum
+    dtHover, dtChecked, dtFocus
+
   Location = ref object
     window: Window
 
@@ -228,6 +231,10 @@ type
     style_cached*: CSSStyleDeclaration
     children_cached: HTMLCollection
 
+    # The owner StyledNode is marked as invalid when one of these no longer
+    # matches the DOM value.
+    prev*: array[DependencyType, bool]
+
   AttrDummyElement = ref object of Element
 
   CSSStyleDeclaration* = ref object