about summary refs log tree commit diff stats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* client, pager: remove unnecessary std/streamsbptato2024-05-112-12/+7
|
* buffer: fix multipart formsbptato2024-05-1114-233/+244
| | | | | | | | | * 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
* pager: take $EDITOR from envbptato2024-05-111-5/+5
| | | | | | * use EDITOR environment variable in default config, fix line number ordering in fallback * autodetect vi-like editors and add line number
* term: optimize canvas redraw, remove emulate-overlinebptato2024-05-102-64/+38
| | | | | | | * Replaced the `pcanvas' comparison with a much simpler tracking of the first damaged cell in writeGrid, which is significantly faster. * Removed emulate-overline: it's of too little utility compared to the maintenance burden it caused.
* luwrap: use separate context (+ various cleanups)bptato2024-05-109-256/+293
| | | | | | Use a LUContext to only load required CharRanges once per pager. Also, add kana & hangul vi word break categories for convenience.
* luwrap: replace Nim unicode maps with libunicodebptato2024-05-098-69/+136
| | | | | | | | | | | | | | | | | Instead of using the built-in (and outdated, and buggy) tables, we now use libunicode from QJS. This shaves some bytes off the executable, though far less than I had imagined it would. Also, a surprising effect of this change: because libunicode's tables aren't glitched out, kanji properly gets classified as alpha. I found this greatly annoying because `w' in Japanese text would now jump through whole sentences. As a band-aid solution I added an extra Han category, but I wish we had a more robust solution that could differentiate between *all* scripts. TODO: I suspect that separately loading the tables for every rune in breaksViWordCat is rather inefficient. Using some context object (at least per operation) would probably be beneficial.
* layout: unify some code pathsbptato2024-05-093-246/+236
| | | | | | | Turn Offset, Size, etc. into arrays indexed by a DimensionType enum, and use it to unify code that only differs in the dimension it is computing for. (e.g. this lets us use the same code for flex row & column layouts.)
* img: rename SEGMENT_*bptato2024-05-091-16/+15
|
* fromjs: remove broken uint64 converterbptato2024-05-091-5/+0
| | | | It would silently truncate the upper 32 bits... not a very bright idea.
* dom: simplify ButtonTypebptato2024-05-084-20/+19
|
* layout: another table colwidth fixbptato2024-05-081-2/+8
| | | | | | Turns out we also have to *expand* column width, if the specified column width is too small *and* no unspecified column exists to take the rest of the place.
* js: fix compileModulebptato2024-05-083-3/+3
|
* js: clean up eval wrappersbptato2024-05-081-6/+4
|
* js: fix finalizer effectsbptato2024-05-082-2/+3
|
* js: refactorbptato2024-05-0832-171/+183
| | | | | | | * prefix to-be-separated modules with js * remove dynstreams dependency * untangle from EmptyPromise * move typeptr into tojs
* layout: small cleanupbptato2024-05-081-39/+34
|
* layout: resize over-constrained table columnsbptato2024-05-081-12/+24
| | | | | | | | | If the total specified column width is larger than the table's allowed width, we now resize them proportionally to the specified width. This is quite important because many tables set the width to e.g. 50% for "give me half of the table", instead of its true meaning "give me half of the page".
* dom: fix area relList elementbptato2024-05-071-1/+1
|
* js: fix compilation on 1.6.14bptato2024-05-063-5/+4
| | | | | | | | | * resolve empty promises without params, not a single undefined param (we can't just unsafeAddr constants on 1.6.14, and I don't see why we need to pass undefined?) * same in client with InternalError * explicitly convert static `asglobal' to bool (1.6.14 turns unquoted enums into ints...)
* cascade: avoid empty ::before/::afterbptato2024-05-051-3/+2
| | | | | If `content' is empty, then generating before/after pseudo-elements is wrong.
* color: separate out JS convertersbptato2024-05-054-43/+49
| | | | | ansi2html depends on color, but we definitely do not want to link it to QJS, so the converters must be moved into a separate module.
* layout: table cell resizing fixesbptato2024-05-051-24/+29
|
* Use isSome instead of isOkbptato2024-05-0514-56/+49
| | | | no point in having identical overloads
* js: move fromJS_or_return nil check to JSError toJSbptato2024-05-042-7/+4
|
* client: make quit() actually quit, misc fixesbptato2024-05-048-103/+98
| | | | | | | * unwind the QJS stack with an uncatchable exception when quit is called * clean up JS references in JSRuntime free even when the Nim counterparts are still alive * simplify some tests
* js: fix various leaks etc.bptato2024-05-0316-256/+319
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* loader: fix applying config for initial requestbptato2024-05-023-31/+46
| | | | | | Instead of the error-prone method of selectively applying config values only for non-initial requests, add a separate (privileged) loader command which allows specifying a different client config.
* cssparser: refactorbptato2024-05-017-151/+91
| | | | | | | | | * 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-014-379/+327
| | | | | | | | * 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
* config: add insecure-ssl-no-verify option to siteconfbptato2024-05-014-5/+16
| | | | | | | Equivalent to curl --insecure. Note: unfortunately this does not help if the server is using unsafe legacy renegotiation, you have to allow that in the OpenSSL config.
* term: fix incorrect dimensions used in sixelbptato2024-04-291-30/+29
|
* term: add sixel background color blendingbptato2024-04-291-9/+19
| | | | | | | | | | | | | * blend bgcolor with cell color * do not round up to 6 We don't use the sixel transparency feature because it's useless: sixel transparency (AFAICT) only lets us respect alpha == 0, but we should either respect *all* alpha, or no alpha at all. Since we do color blending, we *do* respect all alpha, but only of background color. This sadly means that text under images gets destroyed, but at least transparent images don't look like garbage.
* css/values: refactorbptato2024-04-281-283/+222
| | | | | | | | | * clean up global parsing * getValueFromDecl (now parseValue) no longer depends on receiving a CSSDeclaration (just its value) * getComputedValues now also takes a tuple of (name, cvals) instead of a CSSDeclaration * fix padding shorthand accepting auto
* term: remove background color blending in sixelbptato2024-04-271-9/+1
|
* ua.css: style xmp like prebptato2024-04-271-1/+9
|
* png: fix check in readU8bptato2024-04-271-1/+1
| | | | i + 1 must be > reader.limit, so >= is needed to avoid the addition
* png: fix indexed color with tRNSbptato2024-04-271-5/+7
|
* buffer: add toggleImagesbptato2024-04-272-1/+13
|
* sandbox: allow getpid in seccomp network sandboxbptato2024-04-271-0/+1
| | | | openssl needs it
* layout: fix float size in table cells; remove redundant positioningbptato2024-04-271-7/+14
|
* term: query sixel color register numberbptato2024-04-271-32/+51
|
* color: RGBAColor -> ARGBColorbptato2024-04-2610-88/+88
|
* layout: fix image baselinebptato2024-04-261-2/+3
|
* adapter: update code stylebptato2024-04-261-2/+1
|
* Remove unnecessary unsigned castsbptato2024-04-266-43/+43
| | | | | Unsigned operations and conversions to unsigned types always wrap/narrow without checks, so no need to manually mask/cast/etc. them.
* pager: reduce unnecessary image redrawsbptato2024-04-261-1/+1
| | | | the status line can't have images, so this should work
* data: replace std/base64 with atobbptato2024-04-252-64/+67
| | | | | | | | | | std's version is known to be broken on versions we still support, and it makes no sense to use different decoders anyway. (This does introduce a bit of a dependency hell, because js/base64 depends on js/javascript which tries to bring in the entire QuickJS runtime. So we move that out into twtstr, and manually convert a Result[string, string] to DOMException in js/base64.)
* term: add sixel encoderbptato2024-04-252-85/+182
|
* png: fix off by onebptato2024-04-251-3/+1
| | | | + remove outdated comment
* Initial image supportbptato2024-04-2513-62/+233
| | | | | | | | | | | | | | | | | * 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