about summary refs log tree commit diff stats
path: root/src/html
Commit message (Collapse)AuthorAgeFilesLines
* 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
* js: fix various leaks etc.bptato2024-05-033-26/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously we didn't actually free the main JS runtime, probably because you can't do this without first waiting for JS to unwind the stack. (This has the unfortunate effect that code now *can* run after quit(). TODO: find a fix for this.) This isn't a huge problem per se, we only have one of these and the OS can clean it up. However, it also disabled the JS_FreeRuntime leak check, which resulted in sieve-like behavior (manual refcounting is a pain). So now we choose the other tradeoff: quit no longer runs exitnow, but it waits for the event loop to run to the end and only then exits the browser. Then, before exit we free the JS context & runtime, and also all JS values allocated by config. Fixes: * fix `ad' flag not being set for just one siteconf/omnirule * fix various leaks (since leak check is enabled now) * use ptr UncheckedArray[JSValue] for QJS bindings that take an array * allow JSAtom in jsgetprop etc., also disallow int types other than uint32 * do not set a destructor for globals
* cssparser: refactorbptato2024-05-011-10/+7
| | | | | | | | | * factor out skipWhitespace * remove streams dependency (cssparser could never stream without blocking the event loop, so we were just passing a StringStream in all cases, which made the whole streaming pointless.)
* css, dom: simplify ident parsing, canvas fixesbptato2024-05-011-8/+40
| | | | | | | | * add CSSStyleDeclaration setter * move ident maps directly into enums * more complete CSSComputedValue stringifier * turn canvas into a pseudo-image in cascade * set canvas to inline-block
* color: RGBAColor -> ARGBColorbptato2024-04-261-5/+5
|
* Initial image supportbptato2024-04-251-1/+1
| | | | | | | | | | | | | | | | | * 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
* dom: remove unnecessary/unused propertiesbptato2024-04-222-11/+8
| | | | | | | | | | * remove some properties we no longer use * convert novalidate into a reflected attribute * fix satClassList * remove reference to root node in every Node The last one is an obvious win when considering how often rootNode is used vs the memory used by a pointless pointer on every single object.
* dom: fix property event handler settersbptato2024-04-212-23/+52
|
* js: fix some incorrect defineProperty usagebptato2024-04-211-2/+2
| | | | It consumes a value, so we must dup those that we pass.
* base64: rewrite btoa toobptato2024-04-211-2/+2
| | | | why not