about summary refs log tree commit diff stats
Commit message (Collapse)AuthorAgeFilesLines
...
* js: fix various leaks etc.bptato2024-05-0320-310/+360
| | | | | | | | | | | | | | | | | | | | | | | | | | 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-016-380/+329
| | | | | | | | * 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
* Update readmebptato2024-05-011-7/+8
|
* config: add insecure-ssl-no-verify option to siteconfbptato2024-05-018-355/+349
| | | | | | | 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-272-2/+10
|
* 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
|
* config: fix copy image URL, document copy commandsbptato2024-04-273-1/+34
|
* buffer: add toggleImagesbptato2024-04-273-1/+15
|
* 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-275-9/+27
|
* 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
|
* doc: include auto-generated manpages in repositorybptato2024-04-2610-33/+3371
| | | | | The 100kb or so doesn't hurt as much as not having manual pages at all without pandoc (+ not auto-updating them through make all) does.
* adapter: update code stylebptato2024-04-2610-93/+82
|
* ftp: support multiple arguments in ssh config Hostbptato2024-04-261-13/+31
|
* 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-254-70/+75
| | | | | | | | | | 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-253-91/+192
|
* png: fix off by onebptato2024-04-251-3/+1
| | | | + remove outdated comment
* Initial image supportbptato2024-04-2515-63/+239
| | | | | | | | | | | | | | | | | * 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
* Update docsbptato2024-04-246-382/+842
|
* sandbox: remove unveil callbptato2024-04-231-7/+4
| | | | | We no longer modify the file system inside the sandbox, so this permission is simply not needed.
* 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.
* test: add js & layout testsbptato2024-04-2187-2/+1457
| | | | (Sadly some layout tests still fail.)
* layout: do not use parent computed values in root fragmentbptato2024-04-211-19/+11
| | | | | | * use rootProperties so the root fragment does not color its children * assert if the root gets inline blocks; this can (hopefully) no longer happen.
* dom: fix property event handler settersbptato2024-04-212-23/+52
|
* js: fix some incorrect defineProperty usagebptato2024-04-214-7/+7
| | | | It consumes a value, so we must dup those that we pass.
* js: override default toString tag of globalbptato2024-04-211-1/+5
| | | | Some JS modules use this to check if they are running in a browser.
* base64: rewrite btoa toobptato2024-04-212-5/+41
| | | | why not
* base64: rewrite atobbptato2024-04-211-6/+65
| | | | | | | | | Turns out std/base64's `decode' is broken: atob(" ") would panic. So we no longer use that. Basic testing indicates that the new version is closer to the standard- mandated behavior than the old one was. OTOH I assume it's somewhat slower, but that can be improved later if it proves to be a bottleneck.
* layout: slightly refactor layoutInlinebptato2024-04-211-40/+42
|
* layout: flex item margin fixesbptato2024-04-201-25/+34
| | | | Still far from perfect, but it's an improvement.
* layout: fix double padding in flexbptato2024-04-201-2/+4
| | | | | | | | sizes.space regulates content-box width, in which padding is not included, so we must to subtract padding here. (Neither is margin, but margin is applied by outer layout, in this case flex itself, so it's not relevant here. Not to say it isn't broken...)
* dom: sort attributesbptato2024-04-201-21/+30
| | | | needed for isEqualNode to work correctly
* buffer: fix switch from charset decoder to UTF-8 validatorbptato2024-04-201-1/+3
| | | | | The validator is used only if the decoder is nil, so it must be cleared in switchCharset.
* dom: add isSameNode, isEqualNodebptato2024-04-201-0/+54
| | | | TODO: isEqualNode is not quite correct yet, because we don't sort attrs.
* sandbox: allow syscalls for epoll Nim selectorsbptato2024-04-201-0/+4
| | | | | | | | | | | | This fixes setTimeout/setInterval causing crashes. Note: timerfd_gettime is not actually used by Nim right now. However, it seems like a good idea to add it to the set in case a future Nim version needs it, as it does no harm. We still do not allow signalfd, because it would let rogue buffers override our SIGSYS handler. (Not sure if this really matters, but we don't need it for now anyway.)
* layout: fix a list style positioning bugbptato2024-04-201-2/+2
| | | | | | If we are going to move out the child's offset, then we must also tell the child where it starts so it can behave correctly when it encounters exclusions.
* layout: float sizing fixesbptato2024-04-191-8/+21
| | | | | | | | | | | Turns out our shrink-to-fit emulation was inadequate: it assumed all floats are positioned on a separate line, which is the *opposite* of what we want, as that would be the behavior of min-content. Now we instead sum together the width of all floats and the widest non-floating child, and then clamp that to the target fitContent width. This correctly gives us max-content width in the first pass, still without having to actually position the floats.
* http: fix sandbox violation in readFromStdinbptato2024-04-192-3/+5
| | | | | | | | | glibc apparently calls fstat from fread, and we didn't allow it in seccomp. So: * allow fstat in the sandbox; no reason not to, and it seems too big of a footgun to assume we never call fread * use read(2) in http; no need for buffered i/o here
* twtstr: remove pointless checks in parseIntImplbptato2024-04-191-5/+3
|