about summary refs log tree commit diff stats
path: root/src/html
Commit message (Collapse)AuthorAgeFilesLines
* dom, xhr: slight progress on modules, fix an XHR bugbptato2024-08-153-53/+112
| | | | | | * actually download & compile modules (but don't run them yet) * fix a bug in XHR (on some older Nim versions, move() doesn't actually move)
* xhr: more progressbptato2024-08-154-48/+156
| | | | | | | | | | * add responseText, response * add net tests -> currently sync XHR only; should find a way to do async tests... * update monoucha -> simplified & updated some related code that no longer worked properly
* xhr: progressbptato2024-08-131-33/+115
| | | | | | | | | | | | | * fix header case sensitivity issues -> probably still wrong as it discards the original casing. better than nothing, anyway * fix fulfill on generic promises * support standard open() async parameter weirdness * refactor loader response body reading (so bodyRead is no longer mandatory) * actually read response body still missing: response body getters
* dom: remove generic JS bindingsbptato2024-08-112-80/+100
| | | | Dispatch manually with fromJS instead.
* dom: fix crash on wrong image content typebptato2024-08-111-2/+5
| | | | + slightly optimize getContentType
* Update monouchabptato2024-08-095-61/+72
|
* env, dom: add History stub, basic LocalStoragebptato2024-07-302-0/+78
| | | | | | | * History: doesn't really do anything, just adding it to fix some pages * LocalStorage: kind of works, but does lookups with linear search, and the quota limitation is on the number of entries not their size. plus it doesn't actually store anything on disk yet (like cookies).
* Fixes for Nim 2.2bptato2024-07-293-2/+2
| | | | | | | | | * xmlhttprequest: fix missing import * painter: generic tuple workaround * dynstream: merge module with implementations (so it will work with vtables) Not enabling vtables yet since it doesn't work with refc.
* css: hash attribute namesbptato2024-07-291-1/+1
|
* buffer, pager, config: add meta-refresh + misc fixesbptato2024-07-283-7/+15
| | | | | | | | | * buffer, pager, config: add meta-refresh value, which makes it possible to follow http-equiv=refresh META tags. * config: clean up redundant format mode parser * timeout: accept varargs for params to pass on to functions * pager: add "options" dict to JS gotoURL * twtstr: remove redundant startsWithNoCase
* dom: add missing nil checksbptato2024-07-271-1/+4
| | | | document is not set in the main process.
* headers, request: bring it closer to the standardbptato2024-07-273-6/+11
| | | | | | * add standard interfaces to headers * use window base URL for newRequest * remove pointless generic in newRequest
* env: add alert shimbptato2024-07-271-0/+3
| | | | just call console.error for now
* dom: fix wrong proc call in fireEventbptato2024-07-222-2/+2
| | | | dispatchEvent is for JS only, since it unsets isTrusted.
* buffer, dom, event: JS binding for dispatchEventbptato2024-07-225-95/+125
| | | | | | * move dispatchEvent to event, add a JS binding * only reshape if the document was actually invalidated after event dispatch/interval call/etc.
* dom: fix getElementById signaturebptato2024-07-211-3/+3
|
* buffer: replace dispatchEvent procs with that in dombptato2024-07-212-4/+3
|
* dom: fix race condition in image loadingbptato2024-07-211-3/+4
| | | | | | We were not setting the invalid flag on bitmap load, so any incremental reshape could interfere with displaying images that got loaded after the reshape.
* buffer: fix nil deref on click without clickable elementbptato2024-07-191-3/+0
|
* html: event cleanup, XHR progressbptato2024-07-186-97/+459
|
* dom, match, event: small cleanupbptato2024-07-172-27/+26
|
* timeout: simplify, misc fixesbptato2024-07-161-7/+7
| | | | | | Merge timeout & interval code paths. This fixes clearTimeout not clearing intervals.
* css, html: fix CSS dependency invalidationbptato2024-07-032-69/+95
|
* dom, pager: cache images from networkbptato2024-06-291-2/+36
| | | | | | | | | | | With many limitations: * slightly randomized expiry, so it's harder to fingerprint * only images. so e.g. CSS is still left uncached * it's per-buffer and non-persistent, so images are still redownloaded for every new page load so it's more of an image sharing between placements than true caching.
* config: add various missing optionsbptato2024-06-292-3/+5
| | | | | | | Mainly things you could already set with [[siteconf]] but not normally. Also, a `styling' option to disable author styles. Also, `images' is now documented as an "experimental" option, since it's halfway usable now.
* img, loader: add image resizing, misc fixesbptato2024-06-281-27/+33
| | | | | | | | | | | | | | | * resize images with stb_image_resize * use tee for output handle redirection (redirectToFile blocks) * cache original image files * accept lseek in sandbox * misc stbi fixes For now, I just pulled in stb_image_resize v1. v2 is an extra 150K in size, not sure if it's worth the cost. (Either way, we can always switch later if needed, since the API is almost the same.) Next step: move sixel/kitty encoders to CGI, and cache their output in memory instead of the intermediate RGBA representation.
* Update monouchabptato2024-06-221-1/+1
|
* env: fix nil deref in clientbptato2024-06-221-1/+3
|
* misc cleanupsbptato2024-06-222-7/+5
|
* stbi: add encodersbptato2024-06-211-8/+18
|
* img, term: try to detect unknown images, improve kitty encoderbptato2024-06-211-1/+1
| | | | | | * preserve alpha in kitty + simplify encoder * pass unknown image types to stbi (as image/x-unknown) and let it detect the type
* img: use stb_image, drop zlib as dependencybptato2024-06-201-11/+15
| | | | | | | Now we have decoders for gif, jpeg, bmp. Also, the in-house PNG decoder has been replaced in favor of the stbi implementation; this means we no longer depend on zlib, since stbi comes with a built in inflate implementation.
* loader: better error handlingbptato2024-06-201-1/+1
| | | | we no longer crash on broken codecs. yay
* img, loader: separate out png codec into cgi, misc improvementsbptato2024-06-202-31/+139
| | | | | | | | | | | | | | | * multi-processed and sandboxed PNG decoding & encoding (through local CGI) * improved request body passing (including support for output id as response body) * simplified & faster blob()/text() - now every request starts suspended, and OngoingData.buf has been replaced with loader's buffering capability * image caching: we no longer pull bitmaps from the container after every single getLines call Next steps: replace our bespoke PNG decoder with something more usable, add other decoders, and make them stream.
* buffer: decoding fixesbptato2024-06-141-1/+3
| | | | | | * simplify processData * set document charset on creation * update chagashi
* Update Chame, Chagashibptato2024-06-131-5/+2
|
* dom: simplify window.loaderbptato2024-06-092-25/+17
| | | | the Option setup hasn't made much sense for a long time now
* buffer: add autofocusbptato2024-06-082-0/+7
| | | | naturally, it's opt-in
* Move JS wrapper into Monouchabptato2024-06-037-37/+46
| | | | Operation "modularize Chawan somewhat" part 3
* stylednode: remove `text' fieldbptato2024-05-281-1/+1
| | | | This avoids some unnecessary string copying.
* stylednode: move invalidation data to DOMbptato2024-05-271-0/+7
| | | | this way, we do not refer to nodes of previous cascade passes
* html: improve Request, derive Client from Windowbptato2024-05-205-57/+103
| | | | | | | * make Client an instance of Window (for less special casing) * misc work on Request & fetch * improve origin comparison (opaque origins of same URLs are now considered the same)
* css/values -> css/cssvaluesbptato2024-05-161-3/+3
| | | | for consistency
* js: allow var instead of ptrbptato2024-05-122-53/+53
|
* buffer: fix multipart formsbptato2024-05-113-51/+40
| | | | | | | | | * fix enctype not getting picked up * fix form data constructor requiring open() syscall (which gets blocked by our seccomp filter) * add closing boundary to multipart end * pass fds instead of path names through WebFile/Blob and send those through bufwriter/bufreader
* dom: simplify ButtonTypebptato2024-05-082-11/+7
|
* js: fix compileModulebptato2024-05-081-1/+1
|
* js: refactorbptato2024-05-084-7/+12
| | | | | | | * prefix to-be-separated modules with js * remove dynstreams dependency * untangle from EmptyPromise * move typeptr into tojs
* dom: fix area relList elementbptato2024-05-071-1/+1
|
* Use isSome instead of isOkbptato2024-05-052-12/+12
| | | | no point in having identical overloads