about summary refs log tree commit diff stats
path: root/src/html/dom.nim
Commit message (Collapse)AuthorAgeFilesLines
* fix size for some input typesbptato2023-09-221-1/+1
| | | | | | padToWidth should be called for all input types in InputWithSize. Also, they should be underlined by ua.css.
* buffer: support <a name=... for anchor navigationbptato2023-09-201-0/+9
|
* update chamebptato2023-09-191-2/+1
| | | | and with that, resolve the unknown input type issue
* dom: fix regressionbptato2023-09-191-1/+1
|
* dom: add document.all, misc fixesbptato2023-09-191-17/+63
| | | | | | | | * Fix an issue with Collection cache invalidation (we must invalidate collections of the parent node on insertion, so that it triggers a refresh). * Remove circular reference of document.document, now we use a function instead.
* dom: exclude password from exception logbptato2023-09-191-1/+3
|
* response: add blob() functionbptato2023-09-171-1/+1
|
* dom: fix incorrect iteration in descendantsbptato2023-09-141-2/+3
|
* Update submodulesbptato2023-09-141-1/+2
|
* move around more modulesbptato2023-09-141-3/+3
| | | | | | | | | | * ips -> io/ * loader related stuff -> loader/ * tempfile -> extern/ * buffer, forkserver -> server/ * lineedit, window -> display/ * cell -> types/ * opt -> types/
* dom: align some return values with their webidlbptato2023-09-081-11/+11
| | | | | Certain functions were returning types that do not align with the WebIDL defined in the dom standard.
* dom: set input type to text if not givenbptato2023-09-071-0/+2
| | | | | | | HTMLInputElement.inputString depends on inputType not being unknown. (Maybe we should move this logic out of the html parser module entirely and just set text as the default value...)
* twtstr: remove toLowerAscii2bptato2023-09-071-8/+10
|
* dom: fix previousElementSiblingbptato2023-09-011-2/+2
| | | | (again. ouch.)
* dom: fix previous/nextElementSibling, add location stringifierbptato2023-08-311-12/+15
|
* javascript: factor out fromJSbptato2023-08-291-1/+2
|
* refactor: Result[T, DOMException] -> DOMResult[T]bptato2023-08-281-15/+15
|
* javascript: refactorbptato2023-08-281-2/+5
| | | | | | | 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-281-8/+11
| | | | | | | 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-231-4/+8
| | | | | | | 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.)
* javascript: finish LegacyUnforgeable + misc fixesbptato2023-08-201-13/+13
| | | | | | | | 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-201-1/+12
| | | | | | | | | | | | | | 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
|
* Move HTML parsing into Chamebptato2023-08-151-1/+2
| | | | Operation "modularize Chawan somewhat" part 2
* 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...)