about summary refs log tree commit diff stats
path: root/src/html/dom.nim
Commit message (Collapse)AuthorAgeFilesLines
* Move charsets into chakasubptato2023-08-141-2/+3
| | | | 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-011-6/+6
| | | | | | | | | | | | | | * 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.)
* dom: fix hasChildbptato2023-07-271-1/+1
| | | | Return true instead of false when a node with nodeType was found.
* htmlparser: decouple from DOMbptato2023-07-091-17/+8
| | | | | 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-041-0/+1
|
* Add XHR/Event stubsbptato2023-07-021-4/+2
|
* Cache Node.children, Node.childNodesbptato2023-07-011-4/+23
| | | | To avoid unexpected behavior (e.g. node.children != node.children)
* 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-011-0/+53
| | | | | 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
* Add assign, replace, reload to locationbptato2023-06-291-1/+13
| | | | Just stubs: none of them actually work
* Add window.locationbptato2023-06-291-2/+132
| | | | Note: setters do not work yet.
* Remove .jsgctorbptato2023-06-291-3/+6
| | | | | Not sure how it ever worked. This fixes Text() constructors etc.
* cssparser: remove SyntaxErrorbptato2023-06-251-4/+7
| | | | return DOMException instead
* css/values: use Result instead of exceptionsbptato2023-06-251-4/+2
|
* Do not allow text() twice, etc...bptato2023-06-201-2/+4
|
* Reject fetch promise on network errorbptato2023-06-191-4/+3
| | | | Instead of setting the non-standard res variable.
* Get rid of the .jserr pragmabptato2023-06-191-147/+167
|
* Cleanups & bug fixes involving promisesbptato2023-06-151-12/+17
| | | | | Now a promise returning nil doesn't just leave the rest of the then chain hanging. Hooray.
* Fix various layout bugs, prepare for image supportbptato2023-06-121-5/+29
|
* Remove JSObject again, add File API constructorbptato2023-06-081-7/+7
|
* Add support for width, height media querybptato2023-06-071-0/+2
|
* Refactor bitmap, add png color modesbptato2023-06-061-0/+2
| | | | | Now PNG encoding/decoding, painting, etc. are done in separate files. Plus we support all color modes except indexed color.
* Add support for canvas and multipartbptato2023-06-051-79/+478
| | | | | | | | | | | | | | | Quite incomplete canvas implementation. Crucially, the layout engine can't do much with whatever is drawn because it doesn't support images yet. I've re-introduced multipart as well, with the FormData API. For the append function I've also introduced a hack to the JS binding generator that allows requesting the JSContext pointer in nim procs. Really I should just fix the union generator thing and add support for overloading. In conclusion, for now the only thing canvas can be used for is exporting it as PNG and uploading it somewhere. Also, we now have PNG encoding and decoding too. (Now if only we had sixels as well...)
* Add some console functions to DOMbptato2023-06-011-0/+17
| | | | Mainly to avoid errors
* Add setTimeout, setInterval to windowbptato2023-06-011-0/+2
|
* Rewrite new Request bindingbptato2023-05-211-1/+4
| | | | | Still far from perfect, but now at least it has a bit more to do with what the standard mandates.
* remove stray eprint, remove unused make*bptato2023-05-131-6/+0
|
* dom: fix one-off error in insertNodebptato2023-04-301-2/+1
| | | | This caused the last child node to not be copied.
* nim 1.6.12 supportbptato2023-04-161-1/+1
|
* dom: store index among siblings for nodesbptato2023-03-101-57/+67
|
* dom: set document url in constructorbptato2023-03-081-1/+2
|
* dom: set childonly flags where neededbptato2023-02-141-6/+7
|
* html/dom: add Node.remove()bptato2023-02-131-1/+4
|
* css/cascade: remove scoped sheetsbptato2023-01-071-13/+26
| | | | ...in favor of handling all style elements like other browsers
* dom: fix object conversion bug in optionsbptato2023-01-051-1/+1
|
* client, pager, dom, ...: better error handlingbptato2023-01-041-7/+5
| | | | Now the browser shouldn't completely die when a buffer crashes.
* dom: add better attribute reflectionbptato2023-01-021-104/+222
| | | | | Instead of creating a new function for each attribute, use a single magic function for reflected attributes.
* dom: support a few more getters/settersbptato2023-01-021-8/+47
|
* Add support for <label>bptato2023-01-021-1/+53
|
* dom: fix collection cachingbptato2022-12-271-37/+51
| | | | Use ids instead of pure pointers, so we can utilize the JS finalizer.
* Implement DOMTokenList, item functions for collectionsbptato2022-12-261-34/+125
|
* getElementsByClassName on Document and Elementbptato2022-12-261-3/+9
| | | | Instead of Node.
* Correct attribute functions, de-extern jserrbptato2022-12-261-75/+54
| | | | | | Instead of unnecessarily marking every jserr function as *, add the used pragma (so the C compiler can get rid of them later.) Also, use the correct definition of attribute namespace.
* dom: correct constructors, more create functionsbptato2022-12-261-43/+85
|
* DOM: implement many new methodsbptato2022-12-261-8/+121
|
* dom: add navigator objectbptato2022-12-261-2/+12
|
* dom: fix select default displaybptato2022-12-211-3/+15
|