about summary refs log tree commit diff stats
path: root/src/io/buffer.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2022-07-11 22:02:15 +0200
committerbptato <nincsnevem662@gmail.com>2022-07-11 22:31:43 +0200
commit1abd3aadf0c999c6e26ba4e7910b5abe3510c6c2 (patch)
tree537e938a4a5a12a69d148c83c5e279e46a73b8b4 /src/io/buffer.nim
parent62cba694e47a7a1f4bedc7fd48ceac9c26aa3aa1 (diff)
downloadchawan-1abd3aadf0c999c6e26ba4e7910b5abe3510c6c2.tar.gz
Fix and clean up some dom-based features
Diffstat (limited to 'src/io/buffer.nim')
-rw-r--r--src/io/buffer.nim9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/io/buffer.nim b/src/io/buffer.nim
index 3d317afe..7dc59777 100644
--- a/src/io/buffer.nim
+++ b/src/io/buffer.nim
@@ -278,9 +278,8 @@ func hasAnchor*(buffer: Buffer, anchor: string): bool =
 
 func getTitle(buffer: Buffer): string =
   if buffer.document != nil:
-    let titles = buffer.document.getElementsByTag(TAG_TITLE)
-    if titles.len > 0:
-      return titles[0].textContent.strip().clearControls()
+    result = buffer.document.title
+    if result != "": return result
   if buffer.ispipe:
     return "*pipe*"
   return $buffer.location
@@ -718,7 +717,7 @@ proc updateHover(buffer: Buffer) =
 
     let link = thisnode.getLink()
     if link != nil:
-      buffer.hovertext = parseUrl(link.href, buffer.location.some).serialize()
+      buffer.hovertext = link.href
     else:
       buffer.hovertext = ""
 
@@ -748,7 +747,7 @@ proc loadResources(buffer: Buffer, document: Document) =
             let res = buffer.loader.getPage(url.get)
             if res.s != nil and res.contenttype == "text/css":
               let sheet = parseStylesheet(res.s)
-              #elem.parentElement.sheets.add(sheet) #TODO this is broken...
+              elem.sheet = sheet
 
     for i in countdown(elem.children.high, 0):
       let child = elem.children[i]