about summary refs log tree commit diff stats
path: root/src/html
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-02-14 02:11:18 +0100
committerbptato <nincsnevem662@gmail.com>2024-02-14 02:11:36 +0100
commit6abe44ea0287786b5073eb63f08fce14e9688604 (patch)
tree7071fed7097f2f274001e80ee9d29e8101fec79e /src/html
parent5356de1a9e8e25c8a999c7a836727b59c565b28b (diff)
downloadchawan-6abe44ea0287786b5073eb63f08fce14e9688604.tar.gz
buffer: improve style invalidation
Diffstat (limited to 'src/html')
-rw-r--r--src/html/chadombuilder.nim2
-rw-r--r--src/html/dom.nim2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/html/chadombuilder.nim b/src/html/chadombuilder.nim
index e202bc50..221cf7f8 100644
--- a/src/html/chadombuilder.nim
+++ b/src/html/chadombuilder.nim
@@ -170,6 +170,8 @@ proc insertTextImpl(builder: ChaDOMBuilder, parent: Node, text: string,
     parent.lastChild
   if prevSibling != nil and prevSibling of Text:
     Text(prevSibling).data &= text
+    if parent of Element:
+      Element(parent).invalid = true
   else:
     let text = builder.document.createTextNode(text)
     discard parent.insertBefore(text, before.get(nil))
diff --git a/src/html/dom.nim b/src/html/dom.nim
index cb0c41d8..622331a2 100644
--- a/src/html/dom.nim
+++ b/src/html/dom.nim
@@ -177,7 +177,7 @@ type
 
     all_cached: HTMLAllCollection
     cachedSheets: seq[CSSStylesheet]
-    cachedSheetsInvalid: bool
+    cachedSheetsInvalid*: bool
     children_cached: HTMLCollection
     #TODO I hate this but I really don't want to put chadombuilder into dom too
     parser*: pointer