about summary refs log tree commit diff stats
path: root/src/html/xmlhttprequest.nim
Commit message (Collapse)AuthorAgeFilesLines
* event: implement capturing phase, misc improvementsbptato2025-05-051-5/+10
| | | | Fixes acid3 tests 31, 32
* xhr: support FormData/string in POST, remove redundant trybptato2025-03-281-11/+28
|
* loader: respect credentials modebptato2025-03-281-3/+4
|
* xmlhttprequest: fix open with credentialsbptato2025-03-231-5/+3
| | | | | * ignore username/password if undefined * do not throw on subsequent fetch with username/password
* headers: hide table, always specify guardbptato2025-03-121-5/+4
|
* Re-add JSValueConstbptato2025-03-121-3/+3
| | | | | | | | | This time, I've also ported over the consistency check to prevent some ownership bugs. Unfortunately, the check is very limited, and it is still possible to double-free or leak JSValues. I think it would be possible to make coverage 100%, but only with ARC...
* xhr: add withCredentials, getAllResponseHeadersbptato2025-03-051-4/+22
| | | | | withCredentials doesn't really do anything yet, but will be needed if we do cors fetch/XHR
* dynstream: remove exceptionsbptato2025-02-261-7/+4
| | | | | | | | | | | | | Now we just pass down the value of n and check errno, plus readDataLoop/writeDataLoop returns a bool indicating whether it failed. For now this seems to work OK, but maybe I'll add a better abstraction in the future. EOFError is still used for handling failed packets; this is brittle, and should be replaced once we have a proper buffering mechanism for them. (That will also let us kill BufStream.) Unrelated: this also fixes a bug in buffer with cacheId.
* fromjs, javascript: optimize out class name registrybptato2025-02-191-3/+2
| | | | | | | | Instead of hashing the class name for isInstanceOf, we now just reuse the Nim type pointer -> JSClassID map, which should be more efficient. This removes getClass and hasClass; these can be replaced by just reusing the class ID returned from registerType.
* xhr, event, catom: fix some bugsbptato2025-02-151-47/+10
| | | | Event handler functions can be set twice now.
* catom: make factory globalbptato2025-02-131-2/+2
| | | | | This isn't great, but neither was passing around a pointer that pointed to a single object.
* dom: add fireEvent for Event objectsbptato2025-02-081-1/+1
|
* dom: more select interfacesbptato2025-01-101-3/+2
| | | | this should be all of them
* script: improve defineConstsbptato2024-12-301-1/+1
| | | | | | Well, I guess this works for now, but something is still wrong. In Gecko, document.__proto__ === Document.__proto__, but in Chawan, it isn't.
* xhr: fix flipped exception in overrideMimeTypebptato2024-12-281-1/+1
|
* loader/* -> serverbptato2024-11-241-4/+4
| | | | one less mystery
* js: reorganize modules, update docsbptato2024-11-151-1/+1
| | | | | | | most of it has already been moved to monoucha, and the rest fits better in other directories. also, move urimethodmap to config
* xhr: fix onReadXHR EAGAIN handlingbptato2024-10-281-4/+4
| | | | now it loads invidious comments. wow
* Clean up forward declarations a bitbptato2024-10-271-1/+1
|
* loader: refactor/move around some procsbptato2024-09-151-1/+1
| | | | | | | | | | | | | | Module boundaries didn't make much sense here either. Specifically: * loader/cgi was originally just one of the many "real" protocols supported by loader, so it was in a separate module (like the other ones). Now it's mostly an "internal" protocol, and it was getting cumbersome to pass all required loader state to loadCGI. * The loader interface has grown quite large, but there is no need for (or advantage in) putting it in the same module as the implementation. Now CGI is handled by loader, and the interface is in the new module "loaderiface".
* dom, xhr: slight progress on modules, fix an XHR bugbptato2024-08-151-12/+6
| | | | | | * actually download & compile modules (but don't run them yet) * fix a bug in XHR (on some older Nim versions, move() doesn't actually move)
* xhr: more progressbptato2024-08-151-10/+105
| | | | | | | | | | * add responseText, response * add net tests -> currently sync XHR only; should find a way to do async tests... * update monoucha -> simplified & updated some related code that no longer worked properly
* xhr: progressbptato2024-08-131-33/+115
| | | | | | | | | | | | | * fix header case sensitivity issues -> probably still wrong as it discards the original casing. better than nothing, anyway * fix fulfill on generic promises * support standard open() async parameter weirdness * refactor loader response body reading (so bodyRead is no longer mandatory) * actually read response body still missing: response body getters
* Update monouchabptato2024-08-091-8/+12
|
* Fixes for Nim 2.2bptato2024-07-291-0/+1
| | | | | | | | | * xmlhttprequest: fix missing import * painter: generic tuple workaround * dynstream: merge module with implementations (so it will work with vtables) Not enabling vtables yet since it doesn't work with refc.
* headers, request: bring it closer to the standardbptato2024-07-271-3/+5
| | | | | | * add standard interfaces to headers * use window base URL for newRequest * remove pointless generic in newRequest
* buffer, dom, event: JS binding for dispatchEventbptato2024-07-221-2/+2
| | | | | | * move dispatchEvent to event, add a JS binding * only reshape if the document was actually invalidated after event dispatch/interval call/etc.
* html: event cleanup, XHR progressbptato2024-07-181-32/+273
|
* Move JS wrapper into Monouchabptato2024-06-031-3/+4
| | | | Operation "modularize Chawan somewhat" part 3
* html: improve Request, derive Client from Windowbptato2024-05-201-7/+7
| | | | | | | * make Client an instance of Window (for less special casing) * misc work on Request & fetch * improve origin comparison (opaque origins of same URLs are now considered the same)
* Update code stylebptato2024-04-171-12/+12
| | | | | | * separate params with ; (semicolon) instead of , (colon) * reduce screaming snake case use * wrap long lines
* Move around some modulesbptato2024-03-141-0/+118
* 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