about summary refs log tree commit diff stats
path: root/src/server/buffer.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-10-28 00:15:18 +0200
committerbptato <nincsnevem662@gmail.com>2023-10-28 00:15:18 +0200
commitf1e85a49a3ef4aaad28f8d4ac677def8732ebe58 (patch)
treef183b7aaf3bf3253f1ccb4a8a51bf558f55784f5 /src/server/buffer.nim
parent6efa186973b01cfaea0e3f6a5bbfca1a2cdd7f66 (diff)
downloadchawan-f1e85a49a3ef4aaad28f8d4ac677def8732ebe58.tar.gz
buffer: remove viewport reference
Viewport at this point is basically just the layout state, so it
makes no sense to store it in buffer.
Diffstat (limited to 'src/server/buffer.nim')
-rw-r--r--src/server/buffer.nim8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/server/buffer.nim b/src/server/buffer.nim
index 1a2b7e02..3a458cc4 100644
--- a/src/server/buffer.nim
+++ b/src/server/buffer.nim
@@ -35,7 +35,6 @@ import js/fromjs
 import js/javascript
 import js/regex
 import js/timeout
-import layout/box
 import loader/connecterror
 import loader/headers
 import loader/loader
@@ -99,7 +98,6 @@ type
     attrs: WindowAttributes
     window: Window
     document: Document
-    viewport: Viewport
     prevstyled: StyledNode
     selector: Selector[int]
     istream: Stream
@@ -591,15 +589,13 @@ let quirkstyle = quirk.parseStylesheet()
 
 proc do_reshape(buffer: Buffer) =
   if buffer.ishtml:
-    if buffer.viewport == nil:
-      buffer.viewport = Viewport(window: buffer.attrs)
     let uastyle = if buffer.document.mode != QUIRKS:
       uastyle
     else:
       quirkstyle
     let styledRoot = buffer.document.applyStylesheets(uastyle,
       buffer.userstyle, buffer.prevstyled)
-    buffer.lines = renderDocument(styledRoot, buffer.viewport, buffer.attrs)
+    buffer.lines = renderDocument(styledRoot, buffer.attrs)
     buffer.prevstyled = styledRoot
   else:
     buffer.lines.renderStream(buffer.srenderer, buffer.available)
@@ -607,7 +603,6 @@ proc do_reshape(buffer: Buffer) =
 
 proc windowChange*(buffer: Buffer, attrs: WindowAttributes) {.proxy.} =
   buffer.attrs = attrs
-  buffer.viewport = Viewport(window: buffer.attrs)
   buffer.width = buffer.attrs.width
   buffer.height = buffer.attrs.height - 1
 
@@ -1720,7 +1715,6 @@ proc launchBuffer*(config: BufferConfig, source: BufferSource,
     loader: loader,
     source: source,
     sstream: newStringStream(),
-    viewport: Viewport(window: attrs),
     width: attrs.width,
     height: attrs.height - 1,
     readbufsize: BufferSize,