about summary refs log tree commit diff stats
path: root/src/server
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/server
parent5356de1a9e8e25c8a999c7a836727b59c565b28b (diff)
downloadchawan-6abe44ea0287786b5073eb63f08fce14e9688604.tar.gz
buffer: improve style invalidation
Diffstat (limited to 'src/server')
-rw-r--r--src/server/buffer.nim10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/server/buffer.nim b/src/server/buffer.nim
index 85d9cd45..cb66e9ef 100644
--- a/src/server/buffer.nim
+++ b/src/server/buffer.nim
@@ -630,16 +630,14 @@ proc do_reshape(buffer: Buffer) =
       buffer.userstyle, buffer.prevstyled)
     buffer.lines = renderDocument(styledRoot, buffer.attrs)
     buffer.prevstyled = styledRoot
-  else:
-    discard
-    #buffer.lines.renderStream(buffer.srenderer) TODO remove?
 
 proc processData(buffer: Buffer): bool =
   if buffer.ishtml:
-    result = buffer.htmlParser.parseAll()
+    let res = buffer.htmlParser.parseAll()
     buffer.document = buffer.htmlParser.builder.document
+    return res
   else:
-    result = buffer.lines.renderStream(buffer.srenderer, debug = buffer.url.pathname != "console")
+    return buffer.lines.renderStream(buffer.srenderer)
 
 proc windowChange*(buffer: Buffer, attrs: WindowAttributes) {.proxy.} =
   buffer.attrs = attrs
@@ -1137,6 +1135,8 @@ proc onload(buffer: Buffer) =
       buffer.uastyle
     else:
       buffer.quirkstyle
+    if buffer.document.cachedSheetsInvalid:
+      buffer.prevstyled = nil
     let styledRoot = buffer.document.applyStylesheets(uastyle,
       buffer.userstyle, buffer.prevstyled)
     buffer.lines = renderDocument(styledRoot, buffer.attrs)