about summary refs log tree commit diff stats
Commit message (Collapse)AuthorAgeFilesLines
* pager: PNGify kitty images, clear images on buffer switchbptato2024-07-025-31/+84
| | | | | | | | | | | Saves bandwidth; it's especially useful over SSH. Still not sure if this is the right solution, since it now needs two select cycles instead of one, and it does yet another copy of the image. (Unnecessarily, because stbi cannot stream its output, and stbiw cannot stream its input.) Also, to save memory, we now discard decoded images of buffers that are not being viewed.
* git.cgi: use formsbptato2024-06-301-4/+13
| | | | it's safer this way
* renderdocument: avoid recursionbptato2024-06-301-9/+12
|
* promise, container: fix nil derefsbptato2024-06-302-17/+25
|
* layout: flex padding/margin fixesbptato2024-06-305-2/+27
|
* cascade: support align=left, align=right on imgbptato2024-06-291-2/+14
|
* term: fix sixel OOBbptato2024-06-291-1/+1
| | | | x is clamped to 0, so there is no need to offset it by offx.
* stbi: fix broken allocation in resizingbptato2024-06-291-1/+1
| | | | ;_;
* layout: clamp image size to available spacebptato2024-06-291-5/+14
| | | | reduces images spilling out of their containers
* dom, pager: cache images from networkbptato2024-06-297-50/+86
| | | | | | | | | | | 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.
* layout: fix image baselinebptato2024-06-291-6/+5
| | | | I doubt this is correct, but at least it's less broken than previously
* layout: fix text-align + padding coloringbptato2024-06-293-3/+4
|
* loader: fix fd leaksbptato2024-06-291-0/+2
|
* config: add various missing optionsbptato2024-06-298-10/+119
| | | | | | | 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-2817-131/+2866
| | | | | | | | | | | | | | | * 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.
* layout: inline fixes & improvementsbptato2024-06-278-248/+217
| | | | | | | | | | | | | | | * fix text-align breaking down in the presence of floats * improve (and simplify) background color area painting This greatly simplifies inline layout by removing the additional text-align atom movement code and replacing it with a full re-layout when needed. That re-layout only occurs in (rare) cases where the text is likely to be relatively short anyway, so it's probably a win in any remotely realistic layout. This has also made it possible to at last merge the last three passes (horizontal/vertical alignment and background painting) and drop that weird synchronized tree + vector traversal.
* layout: simplifybptato2024-06-241-53/+44
|
* doc: update manpagesbptato2024-06-247-350/+287
|
* test: print running test names to the same linebptato2024-06-232-2/+2
|
* layout: avoid shrink-to-fit padding/margin overflowbptato2024-06-233-7/+27
|
* layout: get rid of incorrect hackbptato2024-06-233-1/+8
|
* config: fix JS command definitionsbptato2024-06-232-3/+4
|
* term: fix negative line damage bugbptato2024-06-231-4/+2
|
* loader: fix failing assertionbptato2024-06-221-2/+4
| | | | | There is no guarantee that iclose is called exactly at rsBeforeStatus or rsBeforeHeaders.
* Update monouchabptato2024-06-226-6/+6
|
* env: fix nil deref in clientbptato2024-06-221-1/+3
|
* misc cleanupsbptato2024-06-2215-35/+24
|
* pager: fix nil deref in dupeBufferbptato2024-06-221-15/+18
|
* stbi: allow x-unknownbptato2024-06-221-1/+1
|
* forkserver: add missing exitnowbptato2024-06-221-0/+1
|
* pager: refactor drawing codebptato2024-06-227-504/+536
| | | | | | | * merge select into container * avoid unnecessary redraws in draw() for parts of the screen that haven't been updated * various image redraw fixes
* term, pager: improve image displaybptato2024-06-216-102/+224
| | | | | | * basic repaint algorithm for sixel (instead of brute force "clear the whole screen") * do not re-send kitty images already on the screen
* client, pager: fix cached item refcounting bugsbptato2024-06-214-30/+66
|
* stbi: add encodersbptato2024-06-215-27/+1828
|
* img, term: try to detect unknown images, improve kitty encoderbptato2024-06-215-50/+54
| | | | | | * 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-2015-57/+8174
| | | | | | | 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-204-21/+31
| | | | we no longer crash on broken codecs. yay
* img, loader: separate out png codec into cgi, misc improvementsbptato2024-06-2029-291/+645
| | | | | | | | | | | | | | | * 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.
* pager: prefill lmUsername with current usernamebptato2024-06-161-1/+1
|
* buffer: copy lessbptato2024-06-141-8/+10
|
* buffer: decoding fixesbptato2024-06-144-46/+48
| | | | | | * simplify processData * set document charset on creation * update chagashi
* Update Chame, Chagashibptato2024-06-139-149/+46
|
* cssvalues: add "clear" to table wrapper boxbptato2024-06-113-1/+8
| | | | this one is weird but I'm sure the standard is technically right
* pager: actually fix broken logicbptato2024-06-091-2/+2
| | | | | | | | ok we block if: * method is not GET * scheme is different * it is not the case that both the current and the target schemes are http/s
* pager: fix broken logicbptato2024-06-091-3/+3
| | | | bleh
* dom: simplify window.loaderbptato2024-06-093-29/+18
| | | | the Option setup hasn't made much sense for a long time now
* pager: send Accept: */* for viewImagebptato2024-06-082-3/+15
|
* buffer: add autofocusbptato2024-06-088-101/+136
| | | | naturally, it's opt-in
* pager, buffer: improve forms, protocol configbptato2024-06-087-173/+192
| | | | | | * refactor form submission * add options to specify form handling per protocol * block cross-protocol POST requests
* config.toml: update headersbptato2024-06-081-2/+2
| | | | | | | | | * prepend Mozilla/5.0 to User-Agent; an unfortunate fact is that even the G-lettered search engine breaks without it, and I've seen sites that refuse to serve pages at all. * Add */* to Accept, in the hope that we'll get images more often. (The ideal solution is to set it to "*/*" when fetching images, but the API format doesn't let us do this yet; TODO.)