about summary refs log tree commit diff stats
path: root/src/server
Commit message (Collapse)AuthorAgeFilesLines
...
* buffer: load external resources when they are attachedbptato2024-02-081-81/+6
| | | | | We no longer have to wait for the entire document to be loaded to start loading CSS.
* dom: enumize attribute namesbptato2024-02-081-8/+9
|
* dom: reduce tagType usebptato2024-02-081-8/+7
| | | | | tagType is now a function call, but usually it's enough to just test for the object type.
* Incremental renderingbptato2024-02-071-55/+69
| | | | | | | | | | | | Yay! Admittedly, it is not very useful in its current form, except maybe on very slow networks. The problem is that renderDocument is *slow*, so we only run it when onload fails to consume all bytes from the network in a single pass. Even then, we are guaranteed to get a FOUC, since CSS is only downloaded in finishLoad(). Well, I think it's cool, anyway.
* Update chamebptato2024-02-071-26/+52
| | | | | | | | * Update chame to the latest version * Get rid of nodeType usage * Add atoms * Re-implement DOM attributes * document.write
* forkserver: clean upbptato2024-01-291-7/+17
| | | | | Move forkBuffer into forkserver (why was it in container anyway), remove unused mainproc variable, etc.
* rendertext: add support for backspace overstrike, misc fixesbptato2024-01-231-1/+1
| | | | | * parse manpage output styled ugly backspace overstrike formatting * fix broken charset detection for large files
* Fix form action when submitter has a "form" attrbptato2024-01-191-3/+4
| | | | | | | * Unify form variable for all form-associated elements * Fix broken form association logic in resetFormOwner * Use form action for all form-associated submitters * Remove unused getElementsByTag + de-extern some functions
* buffer: fix clone on *BSDbptato2024-01-191-1/+8
| | | | kqueue does not like being closed after fork(2).
* Fix windowChange not refreshing valid media queriesbptato2024-01-101-0/+3
| | | | | | | | * css/cascade: copy stylesheet in applyMediaQuery (so that changes are reverted on re-style) * buffer: clear prevstyled in windowChange (to avoid using cached results from previous cascading passes); set window.attrs * pager: avoid windowChange if new attrs are identical to the old ones
* Set cgiDir for client loader processbptato2024-01-061-2/+3
|
* Fix some casing issuesbptato2024-01-061-2/+2
|
* buffer: do not trap SIGINT to cleanupbptato2024-01-032-2/+2
| | | | | | | We trap SIGINT with setControlCHook to avoid buffers being killed by the process group receiving a SIGINT; trapping it to cleanup has the opposite effect. SIGTERM should be enough, as that is what we use for cleaning up buffers.
* Compile with styleCheck:usagesbptato2023-12-282-4/+4
| | | | much better
* buffer: prevent crash in reshape before document is parsedbptato2023-12-221-0/+2
| | | | Can happen e.g. if the window is resized or the user manually reshapes.
* buffer: clean up ssock on being killedbptato2023-12-212-21/+37
| | | | | | * use signal handlers to avoid littering tmpdir with dead sockets * add connection reset error (for socketstream) * convert some imports to new style
* Implement local CGI error message handlingbptato2023-12-151-1/+5
| | | | | | This was documented, but not implemented until now. Also, improve the loader module's protocol documentation.
* buffer: use BufferSize constantbptato2023-12-151-1/+1
|
* break up twtstr somewhatbptato2023-12-132-1/+2
| | | | | Avoid computing e.g. charwidth data for http which does not need it at all.
* Move http out of main binarybptato2023-12-131-6/+6
| | | | | | | | | | | | Now it is (technically) no longer mandatory to link to libcurl. Also, Chawan is at last completely protocol and network backend agnostic :) * Implement multipart requests in local CGI * Implement simultaneous download of CGI data * Add REQUEST_HEADERS env var with all headers * cssparser: add a missing check in consumeEscape
* pager: add precnum to [, ]bptato2023-12-091-9/+23
|
* pager: add `{', `}'; document externIntobptato2023-12-091-1/+20
| | | | | | | | { & } acts like in vi (except the cursor is not moved to the line beginning). No reason to leave externInto undocumented, as it is even used in the default config.
* buffer: do not needlessly copy in onloadbptato2023-12-031-9/+5
|
* dom: fix relList setter regression, remove rel()bptato2023-12-021-1/+1
|
* dom: redefine Node.contains to match standardbptato2023-12-011-1/+1
| | | | (and expose it as a JS function)
* buffer: do not set readyState if document is nilbptato2023-11-291-1/+2
| | | | | As the comment says, buffer.document only exists if buffer.ishtml is true.
* dom: add document.readyStatebptato2023-11-271-2/+4
|
* buffer: add DOMContentLoaded, misc event improvementsbptato2023-11-271-46/+72
| | | | | | | * Add DOMContentLoaded * Re-use the same event object for all elements * Reshape if an event was fired * Reshape on setTimeout/setInterval fired
* buffer: call onload function on dispatchLoadEventbptato2023-11-211-3/+13
|
* buffer: optimize findPrevLinkbptato2023-11-201-0/+8
| | | | | It's better to not do it perfectly in 100% of all cases than to loop through the entire document in all cases.
* buffer: remove viewport referencebptato2023-10-281-7/+1
| | | | | Viewport at this point is basically just the layout state, so it makes no sense to store it in buffer.
* renderdocument: slightly refactor, optimize addLinesbptato2023-10-261-4/+13
|
* buffer: close ssock on exitbptato2023-10-261-0/+1
|
* buffer: call load event on loadbptato2023-10-251-1/+13
|
* Remove trailing spacesbptato2023-10-231-1/+1
|
* warn on eprint in release modebptato2023-10-211-1/+1
| | | | Maybe it's easier to avoid accidentally including like this
* WindowAttributes: refactorbptato2023-10-192-2/+2
| | | | | | * rename module (window -> winattrs, to avoid conflict with env/window) * do not use result * remove unused cell_ratio
* container: add cursorNthLink, cursorRevNthLinkbptato2023-10-141-4/+38
|
* Add w3m-cgi-compat optionbptato2023-10-011-2/+4
|
* buffer: fix cursor unnecessarily jumping to y=0bptato2023-09-301-5/+7
| | | | | then() is called even if a nil Promise is returned, so an Opt is needed here.
* Improve implicit form submissionbptato2023-09-301-2/+11
| | | | | | * Implement the "default button" part of the standard. * If the submitter is the form, formmethod may be called on it. Check if this is the case in the function, and if yes, return the form's method.
* Add urimethodmap supportbptato2023-09-302-19/+11
| | | | yay
* buffer: improve submitFormbptato2023-09-301-6/+42
| | | | | * add handlers for javascript, mailto * HTTP-like behavior for unknown protocols
* loader: add local-cgibptato2023-09-302-1/+2
| | | | | | | | | | | Add w3m-style local CGI support. It is not quite as powerful as w3m's local CGI, because it lacks an equivalent to W3m-control. Not sure if it's worth adding; we certainly shouldn't allow passing JS in headers, but a custom language for headers does not sound like a great idea either... eh, idk. also, TODO add multipart
* Response.text: encode/decode properlybptato2023-09-271-5/+8
| | | | also, use blob() for images
* buffer: simplify contentType handlingbptato2023-09-271-24/+20
| | | | | | * remove contentType member of Buffer object * add ishtml to reduce string comparisons * consistent spelling: contenttype -> contentType
* interface clone: remove unused arg, documentbptato2023-09-271-4/+9
|
* Add precnum support to more functionsbptato2023-09-261-6/+18
|
* buffer: make readFromFd work with pipesbptato2023-09-231-4/+17
|
* buffer: make clone fork()bptato2023-09-231-19/+144
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Makes e.g. on-page anchor navigation near-instantaneous. Well, as instantaneous as a fork can be. In any case, it's a lot faster than loading the entire page anew. This involves duplicating open resources (file descriptors, etc.), which is not exactly trivial. For now we have a huge clone() procedure that does an ok-ish job at it, but there remains a lot of room for improvement. e.g. cloning is still broken in some cases: * As noted in the comments, TeeStream'ing the input stream for any buffer is a horrible idea, as readout in the cloned buffer now depends on the original buffer also reading from the stream. (So e.g. if you clone, then kill the old buffer without waiting for the new one to load, the new buffer gets stuck.) * Timeouts/intervals are broken in cloned buffers. The timeout module probably needs a redesign to fix this. * If you clone before connect2, the cloned buffer gets stuck. The previous solution was even worse (i.e. broken in more cases), so this is still an improvement. For example, this fixes some issues with mailcap handling (removes the "set the Content-Type of htmloutput buffers to text/html" hack), does not reload all resources, does not completely break if the buffer is cloned during loading, etc.