about summary refs log tree commit diff stats
Commit message (Collapse)AuthorAgeFilesLines
* dynstream, serversocket: use posix instead of nativesocketsbptato2024-10-2010-106/+56
| | | | | | | | | | | nativesockets is a wrapper over posix and winapi, but we don't support winapi, so we can just fall back to PosixStream instead. SocketStream remains as a constraint over PosixStream to allow sendFileHandle/recvFileHandle. As a nice side effect, we can drop some allowed syscalls from the seccomp filter.
* config.toml: add ?q=/path Google redirectbptato2024-10-181-2/+6
| | | | apparently this is relative to the current page
* sandbox: do not ask for signal permissionsbptato2024-10-174-3/+3
| | | | | On a second thought, no timeouts for name resolution is fine - and even if it weren't, it's better implemented in the loader.
* layout: fix inline float + position: absolute bugbptato2024-10-163-5/+12
| | | | | As per standard, float "only applies to elements that [...] are not absolutely positioned."
* Update docsbptato2024-10-153-22/+62
|
* css: add reverse video extensionbptato2024-10-153-0/+7
| | | | | | | | | | | | Called -cha-reverse. Mostly to solve the problem that code tags are indistinguishable from regular text - on a graphical browser this is normally served by monospace font, but we always use monospace... So now the default ua.css adds reverse video to code and xmp. pre remains as it was, because it means "preformatted", not "monospaced". Also, it would mess with our whatever-to-HTML converter output.
* layout: fix float positioning in inline contextsbptato2024-10-157-65/+138
| | | | | | also fixes a bug in the previous commit where whitespacenum would be reset on absolute positioning + missing absolute margin handling without top/left/etc.
* layout: correct `position: absolute' (FINALLY)bptato2024-10-1511-160/+335
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a) resolution of `position: absolute' percentage sizes with an indefinite containing block size (wait what?), and b) positioning of `position: absolute' inner block boxes inside inline boxes. a) is possible because `position: absolute' does not affect its parent's layout. I would love to have a long talk with whoever thought that specifying it like this is a good idea. You know, just because you can... anyways, shockingly enough, this was still the more straightforward part. b) forced me to change the box tree to allow blocks inside inlines, which is ugly, but no big deal. Two questions then remained: 1. *where* to put such boxes, and 2. *how large* these boxes should be; this is hardly obvious since an inline box does not have an unambiguous width or height. Of course the CSS standard, never too eager to fulfill my basic expectations, says nothing about this (other than "it's not defined"). So I first tried to reverse engineer what Gecko does, and after hours of pain and suffering I realized... that it's broken LOL https://bugzilla.mozilla.org/show_bug.cgi?id=489100 Therefore I ended up (partially) copying Blink behavior, which, while equally nonsensical as Gecko (and of course divergent), at least does not change after a partial layout. Thank you LayoutNG for saving my sanity. As for the practical benefits: this fixes the bug where Invidious [video] tags wouldn't show up. Hey, it's something! Still left to-do: `position: absolute' for `display: inline' boxes.
* pager: refactor mailcap, console; misc fixesbptato2024-10-147-280/+262
| | | | | | | | | * use more PosixStream (because it has double-close checking) * factor out some common mailcap operations * move console from client to pager * fix case-insensitive mime type matching * replace convoluted fdin/fdout comparison logic (that only accidentally worked) with a boolean flag
* dirlist2html: remove redundant slashbptato2024-10-141-5/+2
|
* dirlist2html: fix heisenbug, refactorbptato2024-10-131-72/+74
| | | | | | | | so it turns out you *can't* just deref refcounted strings through a ptr... the entire algorithm was a mess anyway, so I've just re-done the sorting with refc.
* lcgi: support HTTP proxybptato2024-10-132-15/+53
| | | | | | | not quite sure this approach is right, because it still won't work with HTTPS without linking everything with OpenSSL... maybe a socks5 bridge through a UNIX socket would work better?
* twtstr, toml: misc cleanupbptato2024-10-134-13/+9
| | | | | * remove unused DateTime toml type * add parseIntP for pointer-size int parsing
* base64: merge into twtstr/envbptato2024-10-135-82/+67
|
* lcgi_ssl: fix libressl compatbptato2024-10-132-6/+8
| | | | | * use correct headers for types (libressl doesn't have types.h) * use SSL_get_peer_certificate (libressl doesn't have a get0 variant)
* loader: improve CGI header parsingbptato2024-10-121-32/+39
| | | | | | * accept HTTP status line * reject status codes with >3 length * reduce pointless copying
* loader: fix potential nil derefbptato2024-10-121-1/+1
| | | | rare, but possible
* Update monouchabptato2024-10-122-8/+8
|
* Add `nc' tool & adjust finger/spartan to use itbptato2024-10-128-86/+114
| | | | | | | | | Simple netcat clone, useful for portable scripts. Especially because some netcats will close the connection as soon as I close stdin... this one only quits when either stdout or the socket refuses new data. Also, it uses our standard TCP connection routine, meaning it respects ALL_PROXY. (i.e. now spartan works with socks5 too)
* dirlist: separate out into dirlist2htmlbptato2024-10-128-279/+232
| | | | | Now the dirlist parser lives inside dirlist2html, and the file protocol just emulates FTP LIST.
* dom: prevent leaking window size through media queriesbptato2024-10-121-3/+4
|
* gmifetch: rewrite in Nimbptato2024-10-1214-730/+548
| | | | | | | | | | This finally makes it possible to use socks5 for Gemini. Also slightly refactored the config, to make it easier to pass on the config dir. By the way, the known_hosts file is now stored in the config dir too. The adapter will try to move it to there from the old location.
* dom: html -> documentElementbptato2024-10-103-9/+6
| | | | it's effectively a dupe, except html wouldn't work in XML
* env: fix getComputedStyle arg2bptato2024-10-101-1/+1
|
* promise: remove newPromisebptato2024-10-103-17/+6
| | | | normal construction is enough (and it wasn't really used anyway)
* layout, pager: preserve tabs on display, selection & outputbptato2024-10-107-31/+126
| | | | | | | | | | | | Substitute tabs with one of eight PUA characters based on their width, and convert them back in the pager: * TUI mode always prints spaces, but now handles tabs appropriately on cursor movement * dump mode tries to preserve hard tabs, but uses soft tabs when that is not possible (e.g. tabs after a margin, tab with background color, etc) * selection mode always outputs hard tabs.
* Fix compilation on Nim 2.2.0bptato2024-10-103-13/+18
|
* Update docsbptato2024-10-1013-67/+106
|
* resize: use srgbbptato2024-10-092-7/+7
| | | | | | | | since that's our input color space (Actually, mainstream browsers seem to use linear scaling nevertheless. But apparently that produces surprising results in some cases, and stbir can do srgb, so might as well use it.)
* bonus: add stbir2, readme, makefilebptato2024-10-088-6/+260
|
* loader: fix fd leakbptato2024-10-081-0/+1
|
* twtstr: fix stripAndCollapsebptato2024-10-082-11/+19
|
* client: fix redirected buffers jumping back to parent on reloadbptato2024-10-071-0/+5
| | | | | replaceBackup was not being cleared, so the next gotoURL with a replace pointing to such buffers wouldn't work.
* pager: do not choke on empty editor commandbptato2024-10-071-2/+4
|
* layout: small cleanupbptato2024-10-071-14/+11
| | | | the length check is not needed, we do that outside the loop already
* color: reduce CellColor size, misc color refactoringbptato2024-10-0613-140/+157
| | | | | | * split out CSSColor from CellColor; now CellColor is just 4 bytes (which helps reduce FormatCell size) * unify color function naming (still not perfect)
* pager: add missing int conversionbptato2024-10-061-1/+1
|
* man: check exit code after reading first linebptato2024-10-061-8/+14
|
* url: fix IDNA bugsbptato2024-10-062-2/+4
|
* Update Chagashibptato2024-10-053-15/+6
|
* layout: fix floats overriding margin/paddingbptato2024-10-055-16/+28
|
* sixel: simplify compressSixelbptato2024-10-051-12/+5
|
* md2html: support + lists, ~~~ blocksbptato2024-10-041-5/+7
|
* dynstream: fix memory leakbptato2024-10-045-8/+10
| | | | now I know why overloading dealloc felt wrong
* sixel, term: reduce half-dump special casingbptato2024-10-044-84/+83
| | | | | | | Makes it slightly easier to debug image output. Also, we stop sending dimension headers, and no longer check for the scheme env var to make CLI invocation a bit less annoying.
* sixel: fix some weird artifactsbptato2024-10-041-0/+13
| | | | | | | | | | | | Since getColor's color assignment eagerly fills in holes with the nearest neighbor of the first such observed node, it is prone to falling into a local minimum where dithering ends up switching between a few very wrong colors. Ensure this doesn't happen by always allocating at least 4 nodes of the octree branch. (Allocating all 7 seems to result in a heavy performance hit; just 4 means at worst 4096 extra nodes, but likely a lot less, and I don't see a difference in either output or performance.)
* filei: misc updatesbptato2024-10-041-2/+14
| | | | | | * encode path URLs * accept directories without trailing slash * sort file names
* sixel: transparency improvementsbptato2024-10-032-9/+9
| | | | | | | * don't set transparency when raster attributes suffice - it seems terminals don't background-fill in that case either. * fix transparency in encoder standalone mode * update comments
* Update monouchabptato2024-10-022-6/+6
|
* poll: reset events on errorbptato2024-10-021-1/+5
| | | | | poll will return an error if interrupted, which may leave the events in their previous state. Make sure revents is set to 0 first.