about summary refs log tree commit diff stats
Commit message (Collapse)AuthorAgeFilesLines
...
* Improve Date.parse, small fixesCharlie Gordon2024-04-143-58/+81
| | | | | | | | - add `minimum_length` to enforce array length validation - add `JS_NewDate()` API - add `[Symbol.toStringTag]` property in the global object - simplify `string_get_milliseconds` - support more timezone abbrevs using `string_get_tzabbr` and array
* Revert bignum build fixesbptato2024-04-142-10/+0
| | | | | | | Importing patch from upstream instead. This reverts commits ccf177cc125e120b338612bbf24966faf3fd87fa and 6776f4dba975137f4034b1295c0f1958b752a2cb.
* utils: polyfill addr/unsafeAddr distinction in Nim 2+bptato2024-04-142-0/+19
| | | | | | | | | | | | | | | | | | | | | I wish they didn't change this. unsafeAddr may be a confusing name, but it's more powerful than addr. Merging them violates the principle of least power. e.g. say I get n thru a param, and shadow it proc x(n: int) = var n = n + 1 a screen or two later I call mutates_variable_in_c(addr i) then later I no longer need to add 1, so I remove the var line. In Nim 1.6 the compiler refuses to compile, I can instantly find the bug. In 2.0 it does... whatever?? Maybe for an int it "works", for an object it likely doesn't. Certainly not something I'd enjoy debugging.
* layout: height fixesbptato2024-04-121-41/+22
| | | | | | * fix percHeight not being passed down properly * simplify addTableCaption; get rid of hack that turned caption outer height into inner height
* Update readmebptato2024-04-121-5/+27
|
* bind_unix, connect_unix: add string.h includebptato2024-04-122-0/+2
| | | | | it's needed for memcpy; it usually compiles without the include, but that's not guaranteed.
* dom: fix missing attribute reflection for <button>bptato2024-04-111-0/+1
|
* renderdocument: do not layout with styledRoot == nilbptato2024-04-111-1/+4
| | | | it can happen when do_reshape is called before any parsing happens.
* twtstr: remove isAscii, simplify onlyWhitespacebptato2024-04-102-12/+3
|
* url: use AsciiDigit, not Digitsbptato2024-04-101-5/+5
|
* twtstr: remove pointless lookup tablesbptato2024-04-101-18/+10
| | | | it's a waste of space; we don't use these *that* much.
* term: do not eat last DA1 valuebptato2024-04-101-3/+9
|
* layout: slightly hacky flex-basis implementationbptato2024-04-092-4/+23
| | | | | | | | it's better than nothing. I suppose. (Two-value flex syntax is encouraged even by the standard, so it gets used a lot, and that sets 0, not flex-basis: auto, so not having flex-basis breaks too many things.)
* ftp: fix quoting bugbptato2024-04-091-0/+1
|
* Update Chamebptato2024-04-092-1/+1
|
* Remove unnecessary std/math importsbptato2024-04-082-9/+6
|
* remove dead code, fix openArray casingbptato2024-04-083-7/+4
|
* css, layout: flexbox fixesbptato2024-04-062-8/+31
| | | | | | | * do not re-resolve FlexPendingItem sizes; it's pointless and it breaks percentage sizes * fix some bugs in `flex' shorthand parsing * add `flex-flow' shorthand
* layout: clean up resolveSizesbptato2024-04-051-80/+74
|
* Initial flexbox supportbptato2024-04-055-167/+546
| | | | | | | | | Still far from being fully standards-compliant, or even complete, but it seems to work slightly less horribly than having no flexbox support at all on sites that do use it. (Also includes various refactorings in layout to make it possible at all to add flexbox.)
* ua.css: use padding for lists, not marginbptato2024-04-031-1/+1
| | | | | FF does it this way as well, and it seems sr.ht depends on it being padding instead of margin.
* sandbox: add OpenBSD pledge/unveil supportbptato2024-04-035-9/+40
| | | | | | | | | | | | pledge is a bit more fine-grained than Capsicum's capability mode, so the buffer & http ("network") sandboxes are now split up into two parts. I applied the same hack as in FreeBSD for overriding the buffer selector kqueue, because a) I didn't want to request sysctl promise b) I'm not sure if it would even work and c) if it breaks on OpenBSD, then it's broken on FreeBSD too, so there's a greater chance of discovering the bug.
* Makefile: use -O2 for gmifetchbptato2024-04-021-1/+1
| | | | | -O3 takes ages to compile on slower computers, and it makes roughly zero difference in performance
* loader: constant time key comparisonbptato2024-04-022-5/+17
| | | | | GCC seems to generate something that strongly resembles a constant time comparison, so I guess this should be good enough.
* Makefile: put manpages in the target directorybptato2024-04-021-16/+21
| | | | | Otherwise, if you set OBJDIR with a non-privileged user and then install with sudo, then it will fail to copy the manpages.
* Update readmebptato2024-04-021-9/+13
|
* md2html: add trailing double space to <br> conversionbptato2024-04-021-0/+2
|
* quickjs: fix OpenBSD compilationbptato2024-04-021-1/+1
| | | | it seems OpenBSD has no malloc_usable_size
* update docsbptato2024-04-011-9/+61
|
* man: fix command path manpage linksbptato2024-03-311-5/+6
| | | | isCommand was completely broken
* pager: fix incremental search with empty stringbptato2024-03-301-3/+11
| | | | | | | | | | | | | | This is broken in w3m too, so we take nvi behavior instead. Also, we now consistently complain when the user tries to search for an empty string instead of just occasionally spitting out "invalid regex" alerts. (In w3m, /search^M/^M just jumps to the first search result with ISEARCH. In nvi, it jumps to the second one with both searchincr on and off. w3m only produces the latter behavior with regular search, which is I assume why I made it work this way, but it's still inconsistent for no good reason.)
* pager: fix weird halfPage* behaviorbptato2024-03-301-6/+6
| | | | | | | | | For some reason, halfPageDown decremented height instead of incrementing it, which caused some rather weird behavior where halfPageUp + halfPageDown would put the cursor in a different position than it was before. Also, we must increment *before* dividing to mimic vi behavior properly.
* pager: exclude status line from buffer heightbptato2024-03-302-1/+9
|
* layout: add missing min/max heights to absolute sizesbptato2024-03-301-1/+3
|
* layout: fix various table cell sizing bugsbptato2024-03-301-47/+35
| | | | | | | | | | It seems I never properly converted the table cell (pre-)sizing code to use SizeConstraints, so it was still in a half-working state where it broke down e.g. on nested tables. * move auto check to canpx * simplify convoluted and broken table cell size calculation into something that actually works
* pager: edit source fixesbptato2024-03-303-72/+57
| | | | | | | * URI-decode path name for local files in default config * (ab)use mailcap command quoting for passing params to editor command instead of replicating it badly in formatEditorName * rename mailcap enums
* layout: fix float positioning with marginsbptato2024-03-301-1/+1
| | | | | | | | | | | | | | | Here we are restricting the float to the same width constraint as its parent, so we must add offset.x both when the float is larger than this constraint *and* when the float fits into the constraint. An example of what this fixes: <div style="padding-left: 10em; background: green"> <div style="float: right; background: red"> wat ^ previously the float was positioned as if the padding had been on the *right*, because it did not take into account offset.x.
* buffer: fix markURL in plaintextbptato2024-03-291-3/+31
| | | | | | | We must HTML escape data, or the fragment parser will parse plain text as markup. (However, just running htmlEscape() on data is not enough; that would also mark <, ', etc. as &gt, &apos. So we only escape after the regex is executed.)
* term: flush stdout in anyKeybptato2024-03-291-0/+1
|
* pager: fix broken writeToFilebptato2024-03-292-5/+4
|
* ansi2html: error out on unrecognized switchesbptato2024-03-291-1/+2
|
* ansi2html: support passing titlesbptato2024-03-295-28/+58
| | | | | | | Use content type attributes so e.g. git.cgi can set the title even with a text/x-ansi content type. (This commit also fixes some bugs in content type attribute handling.)
* ansi2html: do not use posixstreambptato2024-03-292-14/+17
| | | | it's an unnecessary abstraction here
* git.cgi: fix on older QJS versionsbptato2024-03-291-1/+1
| | | | Array.prototype.at is not present in previous QJS releases.
* http: suppress proxy connect headersbptato2024-03-292-0/+2
| | | | causes problems with header parsing
* fflush() before forksbptato2024-03-283-6/+19
| | | | | seems like a good idea, especially because CGI uses stdout as the IPC mechanism
* http: fix broken early hint handlingbptato2024-03-281-1/+2
| | | | | | | | | | | The empty string comparison here was in fact pointless; in cw-out.c, libcurl only calls cwb (which is curlWriteHeader in this case) if blen is not 0, so the string will never be empty. (Instead, it is expected to be \r\n; I've added \n too since CGI can already parse headers like that.) Normally it still worked because we just passed through the line to cgi.nim. However, it choked horribly on HTTP/2 early hints.
* Add capsicum supportbptato2024-03-2812-38/+171
| | | | | | | | | | | | | It's the sandboxing system of FreeBSD. Quite pleasant to work with. (Just trying to figure out the basics with this one before tackling the abomination that is seccomp.) Indeed, the only non-trivial part was getting newSelector to work with Capsicum. Long story short it doesn't, so we use an ugly pointer cast + assignment. But even that is stdlib's "fault", not Capsicum's. This also gets rid of that ugly SocketPath global.
* term: improve color detectionbptato2024-03-271-5/+16
| | | | | some terminals (alacritty) don't support XTGETTCAP and don't even respond with ANSI color support to DA1, so just fall back to termcap.
* container: rename enumsbptato2024-03-271-17/+17
|