about summary refs log tree commit diff stats
path: root/src/css
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-04-25 01:06:43 +0200
committerbptato <nincsnevem662@gmail.com>2024-04-25 01:20:58 +0200
commit14b871eb7eaf329b67b71385597f114f8782318a (patch)
treeac7b4655124b4579ad27d56116d9a2dee63cd31e /src/css
parent62944ac7abc6e37475739a1667ed5a0240fedf66 (diff)
downloadchawan-14b871eb7eaf329b67b71385597f114f8782318a.tar.gz
Initial image support
* png: add missing filters, various decoder fixes
* term: fix kitty response interpretation, add support for kitty image
  detection
* buffer, pager: initial image display support

Emphasis on "initial"; it only "works" with kitty output and PNG input.
Also, it's excruciatingly slow, and repaints images way too often.

Left undocumented intentionally it for now, until it actually becomes
useful.  In the meantime, adventurous users can find out themselves why:

[[siteconf]]
url = "https://.*"
images = true
Diffstat (limited to 'src/css')
-rw-r--r--src/css/cascade.nim6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/css/cascade.nim b/src/css/cascade.nim
index 9c3e5803..b2d007f2 100644
--- a/src/css/cascade.nim
+++ b/src/css/cascade.nim
@@ -380,7 +380,11 @@ proc applyRulesFrameInvalid(frame: CascadeFrame; ua, user: CSSStylesheet;
         styledParent.children.add(styledText)
     of peImage:
       let src = Element(styledParent.node).attr(satSrc)
-      let content = CSSContent(t: ContentImage, s: src)
+      let content = CSSContent(
+        t: ContentImage,
+        s: src,
+        bmp: HTMLImageElement(styledParent.node).bitmap
+      )
       let styledText = styledParent.newStyledReplacement(content)
       styledText.pseudo = pseudo
       styledParent.children.add(styledText)