about summary refs log tree commit diff stats
Commit message (Collapse)AuthorAgeFilesLines
* sandbox: seccomp support on Linuxbptato2024-04-1814-50/+302
| | | | | | | | | | | | | | | | | We use libseccomp, which is now a semi-mandatory dependency on Linux. (You can still build without it, but only if you pass a scary long flag to make.) For this to work I had to disable getTimezoneOffset, which would otherwise call localtime_r which in turn reads in some files from /usr/share/zoneinfo. To allow this we would have to give unrestricted openat(2) access to buffer processes, which is unacceptable. (Giving websites access to the local timezone is a fingerprinting vector so if this ever gets fixed then it should be an opt-in config setting.) This patch also includes misc fixes to buffer cloning, and fixes the LIBEXECDIR override in the makefile so that it is actually useful.
* layout: accept inline-flex in iflushbptato2024-04-171-1/+1
|
* strwidth: return alpha for underscore in vi wordsbptato2024-04-171-1/+1
|
* Update code stylebptato2024-04-1777-2689/+2821
| | | | | | * separate params with ; (semicolon) instead of , (colon) * reduce screaming snake case use * wrap long lines
* term: save/restore title after "set title"bptato2024-04-161-2/+12
| | | | | | | | | It is quite straightforward, because XTerm has a functionality to do just this. (In fact, it automatically restores the title when I use smcup/rmcup. But when I don't, it will linger until I close the window or change the title again.)
* url: fix flipped comparisonbptato2024-04-161-1/+1
|
* layout: fix list-item positioningbptato2024-04-162-3/+12
| | | | we also have to move the inner box offset to the parent
* url: refactorbptato2024-04-161-186/+187
| | | | | * clean up formatting * more efficient endsInNumber
* js: remove automatic function -> closure conversionbptato2024-04-159-107/+75
| | | | | | | | | | | | | | | It's a bad idea for several reasons: * it's inefficient; must allocate an environment for a closure in Nim, even though we already have one in JS * writing macros for automatically creating functions with variadic arguments is suprisingly difficult (see the entire `js/javascript' module) * it never really worked properly, because we never freed the associated function pointer. We hardly used it anyway, so the easiest fix is to get rid of it completely.
* Update todobptato2024-04-151-18/+17
|
* layout: remove ListItemBox, handle inline-flex correctlybptato2024-04-153-91/+65
| | | | | This allows us to unify BlockBox instantiation and block-level inner layout calls.
* quickjs: fix member accesses for non-decimal number literalsbptato2024-04-141-1/+2
| | | | e.g. 0x0.a should return undefined, not SyntaxError.
* dom: use pointers instead of numerical ids for collectionsbptato2024-04-141-10/+9
| | | | | | | | | | The "id" scheme had obvious problems when multiple documents existed. Originally it was needed because the old hacky integration with QuickJS would occasionally result in objects being moved to other addresses. This has been fixed long ago when I decided to vendor in a fork, so we can just use pointers as ids unique to the entire process.
* dom: add onclick attribute supportbptato2024-04-144-53/+112
| | | | | + better align attribute-based event handler behavior with other browsers
* Fix endianness handling in `js_dataview_getValue` / `js_dataview_setValue`Charlie Gordon2024-04-141-8/+8
|
* Improve error handlingCharlie Gordon2024-04-141-8/+17
| | | | | | | - detect and report invalid duplicate parameter names - throw RangeError for too many function arguments - throw RangeError for invalid string length - prevent `-Wcast-function-type` warnings
* Improve `JSON.stringify`Charlie Gordon2024-04-141-39/+43
| | | | | | | | - changed error messages - clarify `toJSON` method usage - simplify boxed objects handling - for ECMA conformity, BigInt objects need a toJSON method in the prototype chain including boxed objects
* Use more explicit magic values for array methodsCharlie Gordon2024-04-141-26/+24
|
* Simplify redundant initializers for `JS_NewBool()`Charlie Gordon2024-04-141-18/+17
|
* Fix compilation with -DCONFIG_BIGNUMCharlie Gordon2024-04-142-32/+43
| | | | | - disable BigDecimal convertion in `JS_ReadBigNum` - fix some error messages
* 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