aboutsummaryrefslogtreecommitdiffstats
path: root/src/data
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-06-02 00:36:54 +0200
committerbptato <nincsnevem662@gmail.com>2023-06-05 03:58:21 +0200
commit8027e52cb221c432bed64517015ebf3182e6166d (patch)
tree18991f9e74c8dcfc0ed7439f3bc78a0cfec9b2d6 /src/data
parentb3b97465805b7367df461a4b7b830fabaccf3a89 (diff)
downloadchawan-8027e52cb221c432bed64517015ebf3182e6166d.tar.gz
Add support for canvas and multipart
Quite incomplete canvas implementation. Crucially, the layout engine can't do much with whatever is drawn because it doesn't support images yet. I've re-introduced multipart as well, with the FormData API. For the append function I've also introduced a hack to the JS binding generator that allows requesting the JSContext pointer in nim procs. Really I should just fix the union generator thing and add support for overloading. In conclusion, for now the only thing canvas can be used for is exporting it as PNG and uploading it somewhere. Also, we now have PNG encoding and decoding too. (Now if only we had sixels as well...)
Diffstat (limited to 'src/data')
-rw-r--r--src/data/charset.nim5
1 files changed, 0 insertions, 5 deletions
diff --git a/src/data/charset.nim b/src/data/charset.nim
index 560e8643..f8f833d5 100644
--- a/src/data/charset.nim
+++ b/src/data/charset.nim
@@ -316,11 +316,6 @@ const CharsetMap = {
"x-user-defined": CHARSET_X_USER_DEFINED
}.toTable()
-func normalizeLocale(s: string): string =
- for i in 0 ..< s.len:
- if cast[uint8](s[i]) > 0x20 and s[i] != '_' and s[i] != '-':
- result &= s[i].toLowerAscii()
-
const NormalizedCharsetMap = (func(): Table[string, Charset] =
for k, v in CharsetMap:
result[k.normalizeLocale()] = v)()