about summary refs log tree commit diff stats
path: root/src/types
Commit message (Collapse)AuthorAgeFilesLines
* Eliminate some superfluous copiesbptato2025-05-112-2/+2
|
* fromjs: switch back res to `var' from `out'bptato2025-05-101-5/+3
| | | | | | | | The original goal was to comply the Uninit warning, but this is now a futile effort as Uninit is no longer planned to be the default in Nim. Setting `res' to its type's default value is therefore just a waste of cycles when it's already zero-initialized.
* url: add schemeType, fix port bug on protocol assignmentbptato2025-05-032-97/+126
| | | | Allows branching on the scheme without string comparisons.
* url: simplify tuple originbptato2025-05-031-33/+8
|
* url, twtstr: misc cleanup, fix overflow check in parseUInt8bptato2025-05-011-108/+76
|
* myaddr: backport & switch to newSeqUninitbptato2025-04-301-1/+1
|
* pager, formdata: DynStream -> PosixStreambptato2025-04-141-2/+2
|
* formdata: avoid sending CRLF for epiloguebptato2025-04-101-2/+0
| | | | | it *is* allowed by the RFC, but others don't do it and some servers choke on it.
* url, twtstr: misc cleanupbptato2025-03-291-6/+2
|
* Re-add JSValueConstbptato2025-03-123-4/+4
| | | | | | | | | This time, I've also ported over the consistency check to prevent some ownership bugs. Unfortunately, the check is very limited, and it is still possible to double-free or leak JSValues. I think it would be possible to make coverage 100%, but only with ARC...
* blob: default value for lastModified, misc cleanupbptato2025-03-052-24/+32
| | | | Now only WebFile can have an fd.
* blob: work around crash on nightly compilerbptato2025-03-041-1/+1
| | | | | Apparently it's a bug in the optimizer. TODO: reduce & report it
* Refactor bufreader, bufwriterbptato2025-03-013-42/+39
| | | | | This adds a runtime check to packet readers to ensure that all fds have been read, and switches to seqs for packet writers.
* dynstream: remove exceptionsbptato2025-02-261-5/+4
| | | | | | | | | | | | | Now we just pass down the value of n and check errno, plus readDataLoop/writeDataLoop returns a bool indicating whether it failed. For now this seems to work OK, but maybe I'll add a better abstraction in the future. EOFError is still used for handling failed packets; this is brittle, and should be replaced once we have a proper buffering mechanism for them. (That will also let us kill BufStream.) Unrelated: this also fixes a bug in buffer with cacheId.
* color: small cleanupbptato2025-02-201-11/+9
|
* render, pager: fix canvas background painting orderbptato2025-02-191-7/+9
| | | | | | | | | | We were painting the background box in render for dump mode, but this conflicted with the standard requirement that the canvas be painted before other elements. So now we handle this directly in the pager. Conveniently enough, this also fixes the issue of canvas color adding pointless spacing to pages (which often made the selection feature less useful.)
* csstree, layout: more refactoringbptato2025-02-131-0/+26
| | | | | Base InlineBox is a fair bit smaller now, and (most) strings are cached using RefString.
* dom, layout: fix empty canvas cache idsbptato2025-02-011-1/+1
| | | | ok now I understand why I made shareCachedItem crash...
* response: stub constructorbptato2025-02-011-0/+3
|
* buffer: support navigation on load/click, use origin for hover checkingbptato2025-01-241-5/+13
| | | | | | | Navigation from e.g. setTimeout still doesn't work. Also, the hover check now uses the auth origin instead of the host, and the auth origin now works for "file" as expected.
* Add annotations for move semanticsbptato2025-01-224-9/+11
| | | | | | | | | Supposedly they aren't broken in refc after 2.0.0, so we can do this now that 1.6.14 is dropped. I've confirmed lent to work as advertised; it indeed reduces copies. sink doesn't seem to help much, but I guess it will be useful once we switch to ORC.
* render: blend in paintBackgroundbptato2025-01-211-0/+24
| | | | | | | It's an improvement, but the painting order still isn't quite right... Also fixes a bug where paintBackground would unnecessarily append an extra line to the document's end.
* cssvalues: support percentage rgb colors, hsl & hslabptato2025-01-211-3/+21
| | | | hsl is quite popular these days.
* dom: CSSStyleDeclaration improvementsbptato2025-01-191-1/+4
| | | | Now getComputedStyle works with pseudo-elements too.
* opt: remove value.ok, value.err overloads, use lentbptato2025-01-141-17/+5
| | | | | | largely unused lent idea from nim-results
* env: add media query matchingbptato2025-01-061-0/+10
| | | | | | | In lite mode, it uses default window attributes. Incidentally, this also untangles media query matching from cascade, saving us a forward declaration hack (yay!)
* loader: add proper HTTP auth handlingbptato2025-01-031-0/+11
| | | | | | | | | | | | | Until now, we just stuffed it into the URL, which was somewhat problematic. Mainstream browsers like to hide the username from the user, but I've decided to follow w3m: buffers do not receive auth info, but the pager itself displays the username. As for the origin: I wanted to use the regular origin, but that does not work with any custom URL. So instead of changing the regular origin function, I've added another.
* url: do not rely on $ -> toString conversionbptato2025-01-011-2/+2
| | | | I want to remove it
* dom, cssvalues: add getComputedStylebptato2024-12-301-2/+7
| | | | Only available in "app" mode.
* cookie: add persistent cookies, misc refactoring/fixesbptato2024-12-292-255/+2
| | | | | | | | | | | | | Mostly compatible with other browsers/tools that follow the Netscape/curl format. Cookie jars are represented by prepending "jar@" to the host part, but *only* if the target jar is different than the domain. Hopefully, other software at least does not choke on this convention. (At least curl seems to simply ignore the entries.) Also, I've moved cookies.nim to config so that code for local files parsed at startup remains in one place.
* cookie: remove redundant checkbptato2024-12-281-3/+1
| | | | | | | | This only resulted in false negatives; seems like it's a remnant from the old, non-standard implementation that did not correctly check for the per-cookie domain. (also, fix a strict def)
* cookie: remove broken third-party-cookie optionbptato2024-12-271-20/+3
| | | | | | | | | Looking at it closer, this never actually did what it advertised to do. It only affected first-party cookies from subdomains, but that has been fixed; third-party cookies were never supported in the first place. (In fact, even first-party cookies are still skipped unless directly received on navigation. This should probably be fixed.)
* Optimize some Option[string] outbptato2024-12-261-3/+5
| | | | toJS is generally more efficient
* Strict def fixesbptato2024-12-221-2/+2
|
* cookie: fix another regressionbptato2024-12-191-1/+1
| | | | did I ever test this?
* cookie: fix regression in cookieJar.addbptato2024-12-191-1/+5
|
* cookie: small bugfix, misc refactoringbptato2024-12-171-21/+23
| | | | | Always override Expires with Max-Age, but never the other way (as per spec.)
* default(T) -> T.default, add some strict defsbptato2024-12-172-6/+6
|
* url: fix file:/ serializationbptato2024-12-141-1/+1
| | | | file:/// is the standard serialization.
* cookie: allow first-party cookies for subdomains with cookie sharingbptato2024-12-141-38/+50
| | | | | | | | Cookie jar separation is already enough to mitigate tracking issues in this case. (Also, the fact that third-party-cookie controlled this made things even more confusing.) Also, add the previously missing host-only flag.
* container, cookie: simplify extractCookies, cookieJar.addbptato2024-12-131-6/+1
|
* cookie: remove JS modulebptato2024-12-131-27/+17
| | | | I no longer need it
* url: remove dead codebptato2024-12-121-5/+0
|
* response: simplify text()bptato2024-12-081-0/+7
| | | | | | | | | | | | | It gets copied once anyway, so just use a blob. I guess I could skip the copy with some effort, but the 4 lines implementation is too attractive :P This is still an improvement, as it doesn't needlessly zero-fill the buffer on realloc. (I've also removed the final realloc from blob, as it seemed quite pointless. Using Content-Length could help... except it doesn't, because it refers to the encoded length. Ugh.)
* mimetypes: refactor, use mime.types for inline image extensionsbptato2024-12-051-1/+1
| | | | | | | | | | | | * remove std/streams use from mime.types; mmap and parse directly * use mime.types for inline image extensions * add some jpeg file extensions Latter came up because I was trying to add a format locally and it wouldn't recognize it on images from my file system (i.e. by extension). As a security measure we still do not allow additional extensions for predefined inline image types.
* layout, term, url: misc cleanupbptato2024-11-281-2/+0
|
* loader/* -> serverbptato2024-11-241-1/+1
| | | | one less mystery
* url: improve special scheme detectionbptato2024-11-161-62/+69
| | | | | * get rid of hash table * only do a single port lookup every time the port changes
* url: fix serializeFormURLEncoded, refactorbptato2024-11-151-26/+17
| | | | kill qmark hack, plus refactor the form data parser/serializer
* color: clean up dead codebptato2024-11-151-16/+4
|