about summary refs log tree commit diff stats
path: root/src/html
Commit message (Collapse)AuthorAgeFilesLines
...
* dom: add onload content attribute to bodybptato2024-02-242-5/+23
|
* dom: print parse errors to consolebptato2024-02-241-7/+8
| | | | instead of trying to evaluate exceptions...
* buffer: improve cancel, use _exit, misc cleanupsbptato2024-02-231-3/+3
| | | | | | * cancel resources on cancel() call * call _exit in signal handler (also in loader) * misc cleanups
* 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-222-126/+28
| | | | | | The API is horrid :( but at least it copies less. TODO: think of a better API.
* dom: fix href stringifierbptato2024-02-151-0/+2
| | | | Return the empty string if it's unset.
* buffer: improve style invalidationbptato2024-02-142-1/+3
|
* 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
* buffer: more form fixesbptato2024-02-132-1/+2
|
* buffer: form fixesbptato2024-02-121-0/+5
| | | | | * show submission URL on hover for all form-associated elements * skip non-checked checkbox/radio inputs
* Add pager.externFilterSourcebptato2024-02-121-1/+1
| | | | useful for filtering stuff through commands like rdrview
* 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.
* buffer: load external resources when they are attachedbptato2024-02-082-22/+125
| | | | | We no longer have to wait for the entire document to be loaded to start loading CSS.
* dom: reduce todosbptato2024-02-081-10/+20
| | | | | * enumize insertAdjacentHTML position * un-extern attrs
* chadombuilder: remove unnecessary pragmabptato2024-02-081-1/+1
|
* dom: enumize attribute namesbptato2024-02-083-160/+279
|
* dom: atomize id, name, DOMTokenListbptato2024-02-081-36/+72
|
* dom: reduce tagType usebptato2024-02-083-62/+39
| | | | | tagType is now a function call, but usually it's enough to just test for the object type.
* Fix some document.write bugsbptato2024-02-072-44/+88
|
* Incremental renderingbptato2024-02-072-115/+150
| | | | | | | | | | | | 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-075-523/+960
| | | | | | | | * Update chame to the latest version * Get rid of nodeType usage * Add atoms * Re-implement DOM attributes * document.write
* Fix form action when submitter has a "form" attrbptato2024-01-191-17/+26
| | | | | | | * 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
* dom: fix innerHTML tag name regressionbptato2024-01-171-2/+8
|
* dom: fix invalid object conversion defectbptato2024-01-171-1/+1
|
* dom: standard-compliant innerHTML/outerHTMLbptato2024-01-122-5/+73
| | | | | | | | It's still not perfect, but at least now we do not apply non-standard whitespace changes. The stringifier is left as it is since it's more useful for debugging this way.
* js: merge some type modules into jstypesbptato2024-01-112-2/+2
| | | | They only had type definitions, no need to put them in separate modules.
* Use std/* imports everywherebptato2024-01-073-7/+7
|
* Fix some casing issuesbptato2024-01-061-3/+5
|
* Compile with styleCheck:usagesbptato2023-12-282-7/+7
| | | | much better
* dom: export import maps allowedbptato2023-12-251-1/+1
| | | | whoops
* dom: use JS_EvalFunction; add module fetching stubsbptato2023-12-253-50/+153
| | | | (still no module support in buffer...)
* Fix warnings on Nim 2.0.2bptato2023-12-241-1/+2
| | | | | | | | One is a false-positive (in dom). The other one in pager is something I hadn't noticed before, that's nice. For now I want to avoid making a change that may break things, so I just removed the dead code.
* dom: use std/ in importsbptato2023-12-221-8/+8
|
* dom: simplify fetch classic scriptbptato2023-12-221-22/+21
|
* html/dom: do not submit implicitly if there is a submit buttonbptato2023-12-181-8/+10
| | | | | | | | | | | | | | | | See e.g. the sr.ht issue tracker, now forever tainted by the tickets I accidentally submitted :P Chawan will gladly autosubmit without the user having written anything in the textbox just by writing some text in the title. The problem is that graphical web browsers typically have a "submit" keybinding (enter), and a "next field" keybinding (tab). The implicit submission mechanism was created with graphical browsers in mind; like w3m, Chawan only has an "ok" keybinding, which may or may not also mean "submit". With this solution, only forms that could not otherwise be submitted will autosubmit.
* break up twtstr somewhatbptato2023-12-131-0/+1
| | | | | Avoid computing e.g. charwidth data for http which does not need it at all.
* event: remove ctx from CustomEventbptato2023-12-031-13/+9
| | | | | Instead, make finalizers optionally pass their runtime for resource deallocation.
* dom: fix relList setter regression, remove rel()bptato2023-12-021-5/+14
|
* dom: redefine Node.contains to match standardbptato2023-12-011-4/+6
| | | | (and expose it as a JS function)
* dom: functionize parentElement, improve Node.documentbptato2023-12-011-7/+7
| | | | | | * parentElement is now just a function. * Remove TODO from node.document; it is useful and not going anywhere. * Check for Nim type in Node.document, not nodeType
* dom: fix `children' being available for all Nodesbptato2023-12-011-6/+17
| | | | It is only defined for Document, Element, DocumentFragment.
* html: add HTMLElement.dataset (+ some twtstr cleanup)bptato2023-12-011-15/+63
|
* env: add window.top, window.parentbptato2023-11-291-3/+12
| | | | | Also, func-ize some similar identity functions, and add TODOs about [Replaceable].
* dom: add document.readyStatebptato2023-11-271-0/+6
|
* buffer: add DOMContentLoaded, misc event improvementsbptato2023-11-271-3/+3
| | | | | | | * Add DOMContentLoaded * Re-use the same event object for all elements * Reshape if an event was fired * Reshape on setTimeout/setInterval fired
* dom: expose HTMLInputElement.checkedbptato2023-11-241-1/+1
|
* env: stub out window.getComputedStyle()bptato2023-11-212-1/+6
| | | | not a real implementation, just to reduce exceptions
* dom: add baseURI, insertAdjacentHTMLbptato2023-11-201-0/+35
|
* twtstr: remove tolower, isWhitespacebptato2023-11-201-1/+1
| | | | | | | | * tolower: strutils toLowerAscii is good enough for the cases where we need it. Also, it's easy to confuse with unicode toLower and vice versa. * isWhitespace: in AsciiWhitespace is more idiomatic. Also has a naming collision with unicode toLower.
* env: add window.frames, window.selfbptato2023-11-151-0/+6
| | | | both just return identity