about summary refs log tree commit diff stats
path: root/src/html
Commit message (Collapse)AuthorAgeFilesLines
...
* dom: fix previousElementSiblingbptato2023-09-011-2/+2
| | | | (again. ouch.)
* buffer: basic click event supportbptato2023-08-311-7/+15
| | | | | | | Mostly a proof of concept. Just bubble it unconditionally for now and never prevent default. Also, fix fromJSFunction by Dup'ing its closure JSValue.
* dom: fix previous/nextElementSibling, add location stringifierbptato2023-08-311-12/+15
|
* javascript: factor out fromJSbptato2023-08-293-1/+4
|
* refactor: Result[T, DOMException] -> DOMResult[T]bptato2023-08-281-15/+15
|
* refactor: Result[T, JSError] -> JSResult[T]bptato2023-08-281-2/+2
|
* javascript: refactorbptato2023-08-284-4/+11
| | | | | | | Split out parts of the JS module, because it was starting to confuse the compiler a little. (Peakmem is back at 750M. Interesting.)
* javascript: de-ref some interfacesbptato2023-08-282-33/+36
| | | | | | | Also, make ActionMap use getters/hasprop instead of a table copy. peakmem remains up +200M at 950M after commit 9991bd3393483158ab0d1b9d995f695dee3c65dc. :(
* dom: add some null checks for windowbptato2023-08-232-5/+9
| | | | | | | Now that we have established that window *can* be nil. (Though the document.location window null check is probably unnecessary, because it is only called from scripts... but better safe than sorry.)
* 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.
* javascript: finish LegacyUnforgeable + misc fixesbptato2023-08-202-14/+16
| | | | | | | | Add jsuffget, jsuffunc for setting LegacyUnforgeable on functions. Misc fixes: * define LegacyUnforgeable properties for native object shims * replace some macros with templates
* javascript: update Events, misc fixes & additionsbptato2023-08-202-2/+236
| | | | | | | | | | | | | | Events: just implement the interfaces, no events are triggered yet. JS changes: * add LegacyUnforgeable * make consts enumerable * fix crash in isInstanceOf * fix destructor warnings * refactor registerType As a result, peakmem is now 1G+ on 1.6.14. It stays ~750M on 2.0.0. Hmm. Well, better upgrade to 2.0.0 I guess.
* dom: remove dead codebptato2023-08-161-7/+0
|
* 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-157-4589/+5
| | | | Operation "modularize Chawan somewhat" part 2
* Move charsets into chakasubptato2023-08-144-6/+10
| | | | Operation "modularize Chawan somewhat" part 1
* Add mailcap, mime.types & misc refactoringsbptato2023-08-131-4/+5
| | | | | | | | * add mailcap: works with copiousoutput, needsterminal, etc. * add mime.types (only works with mailcap) * refactor pipeBuffer * remove "dispatcher" * fix bug in directory display where baseurl would not be used
* Fixes & workarounds to compile on Nim 2.0.0bptato2023-08-012-27/+27
| | | | | | | | | | | | | | * Import punycode, as it has been removed from stdlib. * Fix some syntax errors * Apparently you can no longer compare distinct pointers with nil. Add explicit comparisons with typeof(nil) instead. * htmlparser: rename _ to other, as semantics of _ have changed. (Quite a shame, it looked better with _. Oh well.) * Explicitly specify mm:refc, as the browser OOMs with orc for some reason. Confirmed to compile & run on 2.0.0, 1.6.14, 1.6.12, 1.6.10 and 1.6.8. (<1.6.8 it's broken & wontfix.)
* htmlparser: replace stray insert callbptato2023-07-271-1/+1
|
* dom: fix hasChildbptato2023-07-271-1/+1
| | | | Return true instead of false when a node with nodeType was found.
* htmlparser: fix <th> not closing table cellsbptato2023-07-271-1/+1
| | | | | <th> should close table cells, but was missing from the table cell closing list for some reason.
* htmlparser: remove stray nil comparisonbptato2023-07-271-4/+3
|
* htmlparser: remove nil comparisons for Handlebptato2023-07-272-41/+52
| | | | This makes it possible to use non-reference types as Handle.
* html: include SEARCH tag in parserbptato2023-07-252-5/+7
|
* html: add SEARCH tagbptato2023-07-251-17/+17
|
* Fix compilation on nim 1.6.10bptato2023-07-171-2/+3
| | | | It appears there is a compiler bug we have to work around there.
* htmlparser: fix regressionbptato2023-07-171-2/+2
| | | | Fixed unintended variable shadowing introduced during refactoring
* htmlparser: make getTemplateContent optionalbptato2023-07-151-3/+4
|
* htmlparser: check required callbacksbptato2023-07-151-0/+13
|
* htmlparser: add parse error handlingbptato2023-07-154-281/+437
|
* htmlparser: correct outdated commentbptato2023-07-141-9/+3
|
* htmlparser: fix form association regressionbptato2023-07-102-8/+13
| | | | | | | 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-092-13/+34
|
* htmlparser: more Option wrapping, remove dom referencebptato2023-07-091-18/+21
|
* htmlparser: fix fragment case, fix head bugbptato2023-07-091-8/+13
| | | | Also, wrap head in an Option
* htmltokenizer: only yield oncebptato2023-07-091-12/+22
| | | | | Seems to reverse the +200M peakmem during compile introduced by the previous commit.
* htmlparser: decouple from DOMbptato2023-07-095-542/+1110
| | | | | Instead of directly appending nodes to the DOM, use a DOMBuilder interface.
* dom: work around bad codegenbptato2023-07-041-4/+6
|
* dom: add NodeType consts to Nodebptato2023-07-042-1/+1
|
* Event: add some properties, js: add defineConstsbptato2023-07-041-2/+17
|
* htmltokenizer: fix regressionbptato2023-07-031-0/+3
| | | | we need that break statement there, it seems
* tokenizer: fix unreachable code warningbptato2023-07-031-1/+0
|
* Fix compilation failurebptato2023-07-031-1/+2
|
* Add XHR/Event stubsbptato2023-07-023-5/+22
|
* return Result[T, JSError] from fromJSbptato2023-07-021-1/+0
|
* Cache Node.children, Node.childNodesbptato2023-07-011-4/+23
| | | | To avoid unexpected behavior (e.g. node.children != node.children)
* Factor out headers into separate modulebptato2023-07-011-0/+2
|
* Use separate flag for adding getset instead of reprbptato2023-07-011-2/+2
| | | | Still a hack, but maybe more reliable?
* use =destroy instead of finalizersbptato2023-07-012-0/+55
| | | | | This should help with moving to ORC in the future. (Also, finalizers do not work very well in the first place.)
* dom: synchronously load scriptsbptato2023-06-291-17/+13
| | | | | fetch() does not work here because we can only resume parsing after the script has been executed