about summary refs log tree commit diff stats
path: root/src/server
Commit message (Collapse)AuthorAgeFilesLines
...
* dom: various select fixes/improvementsbptato2025-02-081-4/+7
| | | | | | | | * do not trigger change event if selection did not change * do not destroy old selection on option insertion steps * position select popup correctly * reflectors for disabled attribute * immediately redraw container when select disappears
* dom: add fireEvent for Event objectsbptato2025-02-081-3/+3
|
* buffer, event: add input events, set isTrustedbptato2025-02-071-0/+15
|
* layout: unify BlockBox and InlineBox, refactor buildingbptato2025-02-071-23/+15
| | | | | | | | | | | | | | * normalize flow baseline computation * fix various margin collapsing bugs * eliminate inlineStack * eliminate push* * derive BlockBox and InlineBox from CSSBox This removes a pointer from BlockBox, and adds a pointer to both BlockBox and InlineBox (type field). A net loss, but it makes the code more manageable. Plus, inline groups now need one less allocation, so overall it's not that bad.
* formdata: fix FormData constructor, append filename handlingbptato2025-02-051-2/+1
| | | | + some strict defs
* buffer: remove rfd, fdbptato2025-02-052-58/+55
| | | | | | maybe InputData should just be a Response (really it should be a ReadableStream - if we had that...)
* buffer: fire change event on selection etcbptato2025-02-031-0/+14
|
* buffer: fix evalJSURL angle bracket placementbptato2025-02-031-2/+2
|
* dom, layout: fix empty canvas cache idsbptato2025-02-012-1/+8
| | | | ok now I understand why I made shareCachedItem crash...
* dom: add title setter, unify newText usebptato2025-02-011-1/+1
| | | | createTextNode is redundant...
* response: stub constructorbptato2025-02-011-3/+13
|
* loader: do not crash on invalid shareCachedItembptato2025-01-311-3/+4
| | | | | | | It could be legitimate. (Although I found it in a case where it likely isn't legitimate. But that's another question...)
* buffer: drop pipe, pipe2, passFd privilegesbptato2025-01-303-22/+70
| | | | | All uses of these could be delegated to other processes with more privileges.
* about: move to loaderbptato2025-01-301-5/+13
| | | | | This means we can now use about:downloads for downloads. Plus it shaves off some ks from the distribution.
* loader: fix missing newline in downloadsbptato2025-01-281-3/+3
|
* cascade: reuse input value when possiblebptato2025-01-271-1/+1
|
* loader: fix etabptato2025-01-261-4/+5
|
* buffer: do not force-invalidate on finishLoadbptato2025-01-261-1/+0
| | | | Either this is unnecessary, or it's hiding a bug.
* loader: add download managerbptato2025-01-242-19/+217
| | | | | | Crude, but better than nothing. (I really wish the screen didn't flash on reload...)
* buffer: support navigation on load/click, use origin for hover checkingbptato2025-01-241-2/+10
| | | | | | | 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.
* forkserver: fix fd leakbptato2025-01-241-0/+1
|
* buffer: add placeholders for [frame]bptato2025-01-231-18/+20
| | | | | | | | | | HTML5 doesn't allow frameless processing of documents, so the <noframes> fallback never really worked. Being able to click on the individual frames feels somewhat less broken. I'm unsure how the actual solution should look like. Either we need multiple buffer support per process, or treat them as pseudo-images and handle them in pager.
* buffer: improve screen state synchronizationbptato2025-01-231-122/+105
| | | | | | | | | | The intent behind the original design was that the page shouldn't change without user interaction. This sounds good in theory, but in practice it's unnecessary if you disable JS (nothing will modify the page), and annoying if you enable it (breaks pages that load with AJAX). So now we queue a task to notify us when the page has been updated, and act accordingly when the task is completed.
* pager, term: replace execCmd, Filebptato2025-01-221-1/+0
| | | | | | | | | | pager: I want to change mailcap command parsing, so a custom implementation is needed. term: now it uses a custom buffer for the output stream too. I don't think there is much difference in performance, but stdio was in the way. (Also, this way it will be easier to make it async in the future.)
* Add annotations for move semanticsbptato2025-01-222-2/+2
| | | | | | | | | 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.
* cascade: collapse StyledNode tree into DOMbptato2025-01-201-45/+25
| | | | | We now compute styles on-demand, which is both more efficient and simpler than the convoluted tree diffing logic we previously used.
* term: rework input bufferbptato2025-01-171-1/+1
| | | | heh
* css: reduce StyledNode usebptato2025-01-161-14/+3
| | | | | Eventually the tree should be collapsed into the DOM, and StyledNode should be created on the stack.
* env, dom: add crypto.getRandomValues, HTMLInputElement.filesbptato2025-01-161-3/+4
|
* pager: improve content type handlingbptato2025-01-151-3/+6
| | | | also remove some unused fields of Container
* buffer: add back node nil checksbptato2025-01-151-2/+2
| | | | | Actually, I'm not sure if this can be nil, especially in anonymous table boxes...
* cascade, stylednode: remove parent field from StyledNodebptato2025-01-151-15/+6
| | | | | | | | Now StyledNode has an "element" reference, which refers to the element it was derived from. This reduces the object's size, removes the need for casting around the "node" field, and also gets rid of a pointless cycle.
* config: switch to camel casebptato2025-01-134-6/+6
| | | | | | We already need a camel -> kebab converter anyway. Unfortunately this also changes JS binding names, so it's a breaking change. Oh well.
* loader: remove obsolete todobptato2025-01-121-1/+0
|
* buffer, dynstream: fix clone race, recvmsg/sendmsg castbptato2025-01-121-4/+4
| | | | | | | The fds must be read before the other buffer resumes execution. Also, for some reason, CMSG_SPACE/CMSG_LEN are inconsistent in their size with controllen on BSDs...
* loader: refcount LoaderBuffer pagesbptato2025-01-111-24/+9
| | | | | | | | | | | | One less unsafe/error prone construct. Refcounting the page as seq is unfortunate, but still miles better than zero-filling a non-refcounted array. (Plus it works better for base64 decoding.) The len field is still necessary, because old runtime doesn't support setLenUninit. Oh well, it's one wasted word, not the end of the world. As for the chunks, it looks like the allocator still uses small ones for the seq, so we're good.
* loader: fix memory leak on x-saveoutput + various fd leaksbptato2025-01-112-2/+4
|
* loader: truncate existing files on downloadbptato2025-01-111-1/+1
|
* loader: fix loader buffer page size optimizationbptato2025-01-111-1/+5
| | | | | | The goal is to get "SmallChunk" pages from the allocator. I think I stole the idea from faststreams, but the overhead might be different with raw pointers...
* bufreader, bufwriter: send all fds in one messagebptato2025-01-113-72/+75
| | | | | | | | Moves sendfd/recvfd out of C, and fixes some of its flaws too. The main one is that now all file descriptors are sent together. Also, I've decided to remove the ServerSocket after all; it's easy to add it back if it's ever needed again.
* buffer, ua.css, dom: more select adjustmentsbptato2025-01-101-39/+18
| | | | | | | ok, now it works like in w3m. (mostly, barring CSS limitations...) we'll see how this works out Also adds/fixes some select and option DOM APIs.
* buffer: remove server socketbptato2025-01-094-115/+58
| | | | | | | | | | | Now we just pass through a socket created in pager. This removes the need for a socket directory, and strengthens the buffer sandbox slightly. I've kept the ServerSocket code, because I want to add some form of RPC and communication between separate instances in the future. However, I don't expect this to be handled outside the main process, so I've removed the Capsicum-specific connectat/bindat code.
* dynstream: remove safeClose, add moveFdbptato2025-01-092-6/+3
| | | | | | | | | | | | | | | | | | | safeClose was originally added to prevent this bug: let fd = doSomething() # allocates fd on 0, e.g. by opening a socket let ps = newPosixStream(fd) ... discard dup2(ps.fd, STDIN_FILENO) ps.sclose() # stdin is now closed, despite the opposite intention. With safeClose called on fds that could be stdin, the goal was that stdin/stdout/stderr would never be allocated as a different file, but it was still error-prone. Enter moveFd: ps.moveFd(STDIN_FILENO) If ps is already stdin, this does nothing. If not, it dup2's ps to stdin, closes ps.fd, and sets it to stdin.
* bufstream: allow 0-width packetsbptato2025-01-091-2/+0
|
* buffer: make iframes clickablebptato2025-01-091-1/+18
| | | | better than nothing
* buffer: fix crash on clonebptato2025-01-081-0/+2
| | | | welp. bufreader chokes on 0-sized packets...
* loader: use per-process control socketsbptato2025-01-084-369/+372
| | | | | | | | | | | | | | | | | | | | | | | | Previously, each message (load, resume, passFd, etc.) would open a new connection to loader's UNIX socket, and assumed the loader was dead when the loader did not respond (ECONNREFUSED). As it turns out, this model was hopelessly broken: POSIX does not specify when a UNIX socket can refuse connections, so while it happened to work on Linux (which just blocks if it can't accept right now), FreeBSD would randomly refuse connections whenever its listen queue was full. Instead, we now take a socketpair() from the loader in addClient, and pass on one half to the client (the other half stays in loader); this is the control stream, and all messages from the specific client are sent through it. If a message includes a new stream (e.g. lcLoad), then it sends a new socketpair through the control stream. Aside from not being completely broken (and being marginally more efficient), this arrangement has several other benefits: it removes the need for authentication, almost removes the need for sockdir (now only buffers use it), and will make it easier to add async message processing in the future.
* dom: add document.referrerbptato2025-01-061-2/+4
| | | | Only works if referer-from is enabled.
* buffer: force restyle on toggleImagesbptato2025-01-061-1/+1
| | | | In some cases, it works without restyle, but not always.
* loaderiface: fix race in poll registerbptato2025-01-062-9/+30
| | | | | | | handleRead can register through fetch, so this doesn't work out as nicely as in loader (where we control all register/unregister calls). So now we queue up register events first, and only process them after the "events" iterator exits.