about summary refs log tree commit diff stats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* dom: support all HTMLHyperlinkElementUtils gettersbptato2024-11-093-20/+64
|
* layout: fix initial flex item width calculationbptato2024-11-081-13/+32
| | | | | | | | | | | | | | | Before, the initial layout of a flex item would have inherited the parent's sizing constraint. This almost worked, except when a descendant of a flex item with an unspecified width would resolve its percentage against this incorrectly inherited width - per standard, this must resolve to auto. Also, the shrink case was wrong, because it did not scale the unit to the respective widths; the standard mandates this as well. Hopefully I got it right this time. Finally, this fixes positioned inline container blocks not being set as the absolute container.
* Fix some C warnings, more makefile vars, etc.bptato2024-11-081-1/+1
| | | | | | | * add some more env vars to makefile * remove fpermissive from GCC builds * update Monoucha * fix borked seccomp filter length safety check (ugh)
* poll: fix clear()bptato2024-11-072-3/+6
| | | | | setLen(0) inside the events iterator was wrong; it should have just set all items to -1.
* url: fix compilation on Nim 1.6.14bptato2024-11-075-28/+29
| | | | it handles side effects differently
* chaseccomp: update docs, remove redundant importbptato2024-11-071-2/+0
|
* luwrap: fix compilation on 2.0.8 and refactor a bitbptato2024-11-055-23/+16
| | | | ref. https://todo.sr.ht/~bptato/chawan/21
* url: fix crash on invalid ipv6 syntaxbptato2024-11-041-1/+1
|
* dynstream: fix crash on *BSDbptato2024-11-041-1/+4
| | | | turns out fchmod on sockets only works on Linux.
* utils, types: merge some modulesbptato2024-11-0330-315/+262
| | | | | * line, vector, matrix -> path * twtuni, charcategory -> twtstr
* renderdocument: recurse in renderBlockBoxbptato2024-11-031-54/+47
| | | | Looks like this no longer overflows the stack.
* layout: fix a small table bugbptato2024-11-021-2/+2
|
* dom: add localName, simplifybptato2024-11-021-16/+15
|
* layout: remove inline roundingbptato2024-11-022-6/+2
| | | | | | | | | It broke styles like "margin-top: -5px; padding-top: 5px", because the margin would be taken as-is, and the padding rounded to 0. Now they cancel each other out again. (I think I had added this to reduce error caused by line-height, but we don't have line-height anymore.)
* remove an empty filebptato2024-11-021-0/+0
|
* cssparser: fix parsing of unrecognized at rulesbptato2024-11-022-25/+20
| | | | + clean up a bit
* container: fix nil deref on cancelbptato2024-11-021-3/+4
|
* layout: fix yet another inline float bugbptato2024-11-011-1/+4
| | | | | | | | | you can't just set the BFC offset to your own offset when the BFC's origin is your inner offset. (in block layout, this is addressed by initBlockPositionStates & co, but we don't call that for inline because the offset is already resolved there anyway. so this is a special case)
* dom: fix <select> default state with size=1bptato2024-11-011-20/+14
|
* layout: simplify a bit, fix some inline float bugsbptato2024-11-012-113/+77
| | | | | | | | | | | | | | * simplify "positioned" value calculation: - don't include it in ResolvedSizes, since it's unused in most layouts - resolvePositioned for both absolute and relative positioning - use "size" instead of "space" for absolute positioning - include parent width in layout so that renderdocument does not have to account for it * return bottom margins as regular return values instead of var * fix child bottom margins being discarded in inline floats * fix inline float not including the parent block position in its BFC position
* config: fix relative includes with -Cbptato2024-10-311-2/+3
|
* dom: add HTMLSelectElementbptato2024-10-311-8/+76
|
* layout: refactor flow and fix some bugs in the processbptato2024-10-313-351/+318
| | | | | | | | | | | | * factor out `margin' field from box state * get rid of RootInlineFragment * `nested' -> `children' * get rid of repositionChildren pass; now we handle relative positioning and -cha-center/-cha-right separately * cha-center, cha-right no longer applies to floats * use consistent naming scheme for tests * fix float bottom margin strut not being flushed * fix inline floats changing non-fit-content width
* headers: fix formattingbptato2024-10-311-1/+1
|
* pager: fix borked error checkbptato2024-10-311-1/+1
|
* dynstream: restrict permissions to userbptato2024-10-311-0/+1
| | | | | the man page says this isn't really portable, but it's better than nothing
* chaseccomp: fix compilation with newest dash, misc changesbptato2024-10-311-3/+0
| | | | | | | | | | | | | | * fix matching on unstripped whitespace: caught after upgrading to upstream dash & chaseccomp wouldn't compile * add defines to ensure that we computed the filter length correctly * inline cut_label * EPERM on sigaction, sigprocmask, gettid, and kill on tgkill (so a crash doesn't trigger sandbox violations) * move SIGSYS handler to C and add one for the network The last change removes the stack trace from SIGSYS, but gives us the syscall number which is probably more useful. (Indeed, we don't even have a stack trace in release builds.)
* container: fix peekCursor showing hover texts in the wrong orderbptato2024-10-291-4/+5
|
* timeout: fix crash on clearTimeout inside setTimeoutbptato2024-10-281-9/+16
|
* Update monouchabptato2024-10-281-1/+1
|
* url: small cleanupbptato2024-10-281-11/+9
|
* config: refactor, accept more possible config dirsbptato2024-10-284-90/+69
| | | | | | | | | | | | | | | | | | | | | I'm starting to favor dotfiles over XDG basedirs, but there's no reason why we couldn't have both. So now the search path is: 0. if config was set through -C, use that 1. $CHA_CONFIG_DIR is set -> $CHA_CONFIG_DIR/config.toml 2. $XDG_CONFIG_HOME is set -> $XDG_CONFIG_HOME/chawan/config.toml 3. ~/.config/chawan/config.toml exists -> use that 4. ~/.chawan/config.toml exists -> use that Notably, this makes it so the default directory is ~/.chawan *if* you don't have an existing config.toml file. So in that case known_hosts will be placed in ~/.chawan/known_hosts. However, configurations with a config in ~/.config/chawan/config.toml continue to work as expected, as for those the known_hosts file remains inside ~/.config/chawan/. Finally, I've added a default user CGI directory to reduce friction in setting CGI up. (Like known_hosts, it's also relative to whatever config dir you have.)
* layout: fix margin resolution for absolutely positioned boxesbptato2024-10-281-6/+10
|
* layout: implement position: fixedbptato2024-10-282-16/+18
| | | | just a special case of position: absolute
* url: add searchParams.hasbptato2024-10-281-0/+8
|
* xhr: fix onReadXHR EAGAIN handlingbptato2024-10-281-4/+4
| | | | now it loads invidious comments. wow
* pager: misc extern fixesbptato2024-10-271-80/+109
| | | | | * fix externFilterSource ignoring content types other than html * refactor runProcess to use a custom fork/exec instead of system(3)
* Clean up forward declarations a bitbptato2024-10-279-68/+72
|
* container: fix crash on isearch between redirectsbptato2024-10-271-1/+1
| | | | | | | | | | | | | | | | | | | | Sadly, pushCursorPos may not be paired with a popCursorPos in case the container in question is replaced during the isearch. The easiest way to reproduce this is: * start request to a page that redirects * start isearch * redirection happens, now the old container is gone * type something Then, popCursorPos would try to pop the cursor position from the new container. An alternative (and better) solution would be to add a weak ref to the container as the line edit data. Sadly, we don't have weak refs, and I don't want to hack them in with finalizers. (But maybe I should. Hmm.)
* selectorparser: fix parsing of invalid pseudo elementsbptato2024-10-261-16/+35
| | | | | Found this because the 5th largest tech company on Earth cannot bother itself with trivial matters such as "writing valid CSS".
* cssparser: do not accept invalid rulesbptato2024-10-251-2/+3
| | | | | | This isn't exactly clear from the standard's wording, but e.g. *display: inline must be discarded (because it incorrectly starts with a delim token).
* layout: fix nested absolute positioning, refactor initial size resolutionbptato2024-10-252-109/+113
| | | | | | | | | | Nested position: absolute was broken, so fix it. Also, it makes no sense to dispatch inside layoutBlockChild when we know the expected resolution algorithm upon calling it anyway, so now we do that statically. Finally, fix some bugs in position: absolute size resolution.
* sandbox: use relative path to the object filebptato2024-10-231-1/+6
|
* termcap: merge into termbptato2024-10-233-35/+29
| | | | | again, not that useful to put it in a separate module if only term uses it
* sandbox: replace libseccomp with chaseccompbptato2024-10-234-240/+29
| | | | | | | | | | | | | | | This drops libseccomp as a dependency. Also, move the capsicum/pledge definitions from bindings to sandbox.nim because they are only used there. Interestingly, after integrating chaseccomp I found that the stbi process would mysteriously crash by a getrandom(2) syscall. Closer investigation revealed it is only called on the initialization of glibc's malloc; presumably it had never surfaced before because libseccomp would always allocate before entering the sandbox. So I've added getrandom to our filter as well.
* color: use 64-bit SWARbptato2024-10-221-34/+15
| | | | | I originally left this at 32-bits because I was on a 32-bit arch, but that is no longer the case.
* layout: remove questionable use of newSeqUninitializedbptato2024-10-211-5/+2
|
* poll: nimifybptato2024-10-201-8/+22
| | | | until it's fixed upstream...
* dynstream: refactorbptato2024-10-2018-255/+224
| | | | | | | | | | * consistently use cint instead of FileHandle - this was another remnant of winapi support; on posix, they are the same. * move "blocking" field to PosixStream * recvFileHandle -> recvFd, sendFileHandle -> sendFd * merge serversocket into dynstream * merge auxiliary C functions into dynstream_aux
* 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.