about summary refs log tree commit diff stats
path: root/src/html/chadombuilder.nim
Commit message (Collapse)AuthorAgeFilesLines
* buffer: remove BufferSourcebptato2024-02-221-6/+3
| | | | | | | | | | Aside from being a wrapper of Request, it was just storing the -I charset, except even that didn't actually work. Whoops. This fixes -I effectively not doing anything; now it's a forced override that even disables BOM sniffing. (If the user wants to decode a file using a certain encoding, it seems wise to assume that they really meant it.)
* Replace Chakasu with Chagashibptato2024-02-221-111/+18
| | | | | | The API is horrid :( but at least it copies less. TODO: think of a better API.
* buffer: improve style invalidationbptato2024-02-141-0/+2
|
* loader: fixes & improvementsbptato2024-02-131-24/+20
| | | | | | | | * factor out pushBuffer to make loadFromCache async * fix incorrect cache path * replace rewind with loadFromCache (it does the same thing except actually works) * remove rewindImpl callback, rewind in buffer instead
* Remove CLONE BufferSource; cache document sources in tmpdirbptato2024-02-121-19/+45
| | | | | | | | | | | | | | | | | | | | | | | At last all BufferSources are unified. To achieve the same effect as the previous CLONE source type, we now use the "fromcache" flag in Request. This *forces* the document to be streamed from the disk; if the file no longer exists for some reason, an error is returned (i.e. the document is not re-downloaded). For a document to be cached, it has to be the main document of the buffer (i.e. no additional resources requested with fetch()), and also not an x-htmloutput HTML file (for those, the original source is saved). The result is that toggleSource now always returns the actual source for e.g. markdown files, not the HTML-transformed version. Also, it is now possible to view the source of a document that is still being downloaded. buffer.sstream has almost been eliminated; it still exists, but only as a pseudo-buffer to interface with EncoderStream and DecoderStream. It no longer holds the entire source of a buffer at any point, and is cleared as soon as the buffer is completely loaded.
* chadombuilder: remove unnecessary pragmabptato2024-02-081-1/+1
|
* dom: reduce tagType usebptato2024-02-081-1/+1
| | | | | tagType is now a function call, but usually it's enough to just test for the object type.
* Fix some document.write bugsbptato2024-02-071-43/+75
|
* Incremental renderingbptato2024-02-071-113/+143
| | | | | | | | | | | | 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-129/+242
| | | | | | | | * Update chame to the latest version * Get rid of nodeType usage * Add atoms * Re-implement DOM attributes * document.write
* Use std/* imports everywherebptato2024-01-071-3/+3
|
* Compile with styleCheck:usagesbptato2023-12-281-1/+1
| | | | much better
* reduce new() usagebptato2023-10-251-1/+1
|
* Add innerHTML setterbptato2023-10-231-2/+39
| | | | yay
* update chamebptato2023-09-191-0/+1
| | | | and with that, resolve the unknown input type issue
* Update submodulesbptato2023-09-141-1/+9
|
* javascript: factor out fromJSbptato2023-08-291-0/+1
|
* javascript: refactorbptato2023-08-281-1/+2
| | | | | | | Split out parts of the JS module, because it was starting to confuse the compiler a little. (Peakmem is back at 750M. Interesting.)
* DOMParser: use correct URLbptato2023-08-231-5/+11
| | | | | | | | Use current document's URL if window && window.document, otherwise default to about:blank. Also, it seems that passing nil to window is really necessary in some cases, so remove notes indicating otherwise.
* chadombuilder: implement restartbptato2023-08-151-0/+12
| | | | | Now pages (once again) do not break when a meta charset tag is defined. Hooray!
* Move HTML parsing into Chamebptato2023-08-151-2/+3
| | | | Operation "modularize Chawan somewhat" part 2
* Move charsets into chakasubptato2023-08-141-1/+2
| | | | Operation "modularize Chawan somewhat" part 1
* htmlparser: remove nil comparisons for Handlebptato2023-07-271-2/+3
| | | | This makes it possible to use non-reference types as Handle.
* htmlparser: add parse error handlingbptato2023-07-151-1/+0
|
* htmlparser: fix form association regressionbptato2023-07-101-2/+3
| | | | | | | associateWithForm was checking whether the element was in the same tree as the form, however associateWithForm is called when element is has not been inserted into the tree yet. As a fix, pass the intended parent and perform the check on that.
* htmlparser: remove more references to dombptato2023-07-091-3/+6
|
* htmlparser: decouple from DOMbptato2023-07-091-0/+204
Instead of directly appending nodes to the DOM, use a DOMBuilder interface.