about summary refs log tree commit diff stats
path: root/src/html/env.nim
Commit message (Collapse)AuthorAgeFilesLines
* io: derive DynStream from RootObj (not Stream)bptato2024-03-241-8/+9
| | | | | | | | This way they are no longer compatible, but we no longer need them to be compatible anyway. (This also forces us to throw out the old serialize module, and use packet writers everywhere.)
* Move around some modulesbptato2024-03-141-3/+3
| | | | | | | | * extern -> gone, runproc absorbed by pager, others moved into io/ * display -> local/ (where else would we display?) * xhr -> html/ * move out WindowAttributes from term, so we don't depend on local from server
* quickjs: reduce diff with upstreambptato2024-03-021-2/+3
| | | | | | * the uint8array thing is probably from txiki.js, but we never used it * upstream now has JS_GetClassID, importing that instead... (so this commit won't build :/)
* env: add window.screenbptato2024-03-021-1/+21
|
* term: improve pixels-per-column/line detectionbptato2024-02-251-1/+1
| | | | | | | | | Some terminal emulators (AKA vte) refuse to set ws_xpixel and ws_ypixel in the TIOCGWINSZ ioctl, so we now query for CSI 14 t as well. (Also CSI 18 t for good measure, just in case we can't ioctl for some reason.) Also added some fallback (optionally forced) config values for width, height, ppc, and ppl. (This is especially useful in dump mode.)
* buffer: load external resources when they are attachedbptato2024-02-081-1/+2
| | | | | We no longer have to wait for the entire document to be loaded to start loading CSS.
* Update chamebptato2024-02-071-3/+5
| | | | | | | | * Update chame to the latest version * Get rid of nodeType usage * Add atoms * Re-implement DOM attributes * document.write
* js: merge some type modules into jstypesbptato2024-01-111-1/+1
| | | | They only had type definitions, no need to put them in separate modules.
* dom: use JS_EvalFunction; add module fetching stubsbptato2023-12-251-2/+4
| | | | (still no module support in buffer...)
* env: add window.top, window.parentbptato2023-11-291-3/+12
| | | | | Also, func-ize some similar identity functions, and add TODOs about [Replaceable].
* env: stub out window.getComputedStyle()bptato2023-11-211-0/+5
| | | | not a real implementation, just to reduce exceptions
* env: add window.frames, window.selfbptato2023-11-151-0/+6
| | | | both just return identity
* window: inherit from EventTargetbptato2023-10-251-2/+3
|
* base64: reduce pointless re-coding using JSStringbptato2023-10-211-2/+4
| | | | | We now expose some functions from QuickJS to interact with JavaScript strings without re-encoding them into UTF-8.
* javascript: add TextEncoder, TextDecoderbptato2023-10-211-0/+2
|
* WindowAttributes: refactorbptato2023-10-191-1/+1
| | | | | | * rename module (window -> winattrs, to avoid conflict with env/window) * do not use result * remove unused cell_ratio
* Refactor Consolebptato2023-10-131-2/+4
| | | | | * merge dom.console & client.Console * move client-specific stuff out of Console (into callbacks when necessary)
* move around more modulesbptato2023-09-141-5/+5
| | | | | | | | | | * ips -> io/ * loader related stuff -> loader/ * tempfile -> extern/ * buffer, forkserver -> server/ * lineedit, window -> display/ * cell -> types/ * opt -> types/
* fetch: use JSDictbptato2023-09-091-1/+1
|
* dom: align some return values with their webidlbptato2023-09-081-2/+2
| | | | | Certain functions were returning types that do not align with the WebIDL defined in the dom standard.
* fetch: allow string input, allow init dictionarybptato2023-09-081-2/+4
|
* Add btoa, atobbptato2023-09-071-0/+7
|
* 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.)
* javascript: de-ref some interfacesbptato2023-08-281-25/+25
| | | | | | | 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-1/+1
| | | | | | | 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-1/+3
| | | | | | | | Add jsuffget, jsuffunc for setting LegacyUnforgeable on functions. Misc fixes: * define LegacyUnforgeable properties for native object shims * replace some macros with templates
* htmlparser: decouple from DOMbptato2023-07-091-1/+1
| | | | | Instead of directly appending nodes to the DOM, use a DOMBuilder interface.
* Add XHR/Event stubsbptato2023-07-021-1/+5
|
* Factor out headers into separate modulebptato2023-07-011-0/+2
|
* Add window.locationbptato2023-06-291-4/+8
| | | | Note: setters do not work yet.
* Working Nim-QuickJS GC integrationbptato2023-06-241-1/+1
| | | | I believe this works correctly. Hopefully I'm not wrong.
* Reject fetch promise on network errorbptato2023-06-191-1/+1
| | | | Instead of setting the non-standard res variable.
* Rework JS exception systembptato2023-06-191-0/+2
| | | | | Now we use Result for passing exceptions to JS. As a result, we can finally get rid of the .jserr pragma.
* Cleanups & bug fixes involving promisesbptato2023-06-151-0/+2
| | | | | Now a promise returning nil doesn't just leave the rest of the then chain hanging. Hooray.
* Add support for width, height media querybptato2023-06-071-1/+3
|
* Add support for canvas and multipartbptato2023-06-051-0/+17
| | | | | | | | | | | | | | | 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 module loading to clientbptato2023-06-011-1/+1
| | | | Files only, for now.
* Add setTimeout, setInterval to windowbptato2023-06-011-16/+54
|
* WIP fetchbptato2023-04-301-0/+6
|
* client, pager, dom, ...: better error handlingbptato2023-01-041-1/+3
| | | | Now the browser shouldn't completely die when a buffer crashes.
* dom: add better attribute reflectionbptato2023-01-021-5/+3
| | | | | Instead of creating a new function for each attribute, use a single magic function for reflected attributes.
* DOM: implement many new methodsbptato2022-12-261-0/+3
|
* dom: add navigator objectbptato2022-12-261-0/+46
|
* More DOM workbptato2022-12-191-0/+2
|
* Add JS support to documentsbptato2022-12-181-0/+26