about summary refs log tree commit diff stats
path: root/src/html/env.nim
Commit message (Collapse)AuthorAgeFilesLines
* env, dom: add crypto.getRandomValues, HTMLInputElement.filesbptato2025-01-161-1/+16
|
* dom: more select interfacesbptato2025-01-101-4/+2
| | | | this should be all of them
* env: basic postMessagebptato2025-01-091-2/+15
|
* Add performance modulebptato2025-01-091-0/+8
| | | | | Just to replace what QJS-NG has, because I don't want to expose a nanosecond precision clock.
* mediaquery: add serializationbptato2025-01-061-1/+1
| | | | also, reduce the number of types named MediaQueryList by 50%
* dom: add document.referrerbptato2025-01-061-1/+2
| | | | Only works if referer-from is enabled.
* env: add media query matchingbptato2025-01-061-0/+22
| | | | | | | In lite mode, it uses default window attributes. Incidentally, this also untangles media query matching from cascade, saving us a forward declaration hack (yay!)
* env, buffer: restyle on getComputedStylebptato2025-01-031-0/+1
| | | | | | style/layout invalidation is a mess :( Fixes acid3 test00
* dom, cssvalues: add getComputedStylebptato2024-12-301-3/+5
| | | | Only available in "app" mode.
* env: stub postMessagebptato2024-12-301-0/+3
|
* env: add innerWidth, innerHeightbptato2024-12-281-0/+6
|
* env: do not copy attrs, fix screen on clientbptato2024-12-281-4/+4
| | | | Now screen.width etc. works in the pager too.
* dom: add focus()bptato2024-12-271-2/+3
| | | | Respects autofocus.
* Optimize some Option[string] outbptato2024-12-261-7/+7
| | | | toJS is generally more efficient
* env: fix taintEnabledbptato2024-12-261-1/+1
| | | | it should have been a function
* buffer: add "app" scripting modebptato2024-12-261-26/+38
| | | | | | | | | | For APIs that cannot be implemented in a privacy-friendly manner. As a start, I've added accurate screen size queries; getComputedStyle, getBoundingClientRect, etc. should follow. (We have a harmless getComputedStyle already, but it's broken.) Probably, things like JS-based scroll belong in here too, but I'm not sure yet. (Perhaps autofocus should be reused instead?)
* env: reflect user agent header in userAgentbptato2024-12-261-5/+5
|
* twtstr: reduce copying in atobbptato2024-12-121-3/+3
|
* env: allow data URL fetchbptato2024-12-051-1/+2
|
* mimetypes: refactor, use mime.types for inline image extensionsbptato2024-12-051-3/+4
| | | | | | | | | | | | * remove std/streams use from mime.types; mmap and parse directly * use mime.types for inline image extensions * add some jpeg file extensions Latter came up because I was trying to add a format locally and it wouldn't recognize it on images from my file system (i.e. by extension). As a security measure we still do not allow additional extensions for predefined inline image types.
* loader/* -> serverbptato2024-11-241-4/+4
| | | | one less mystery
* buffer: proper toggleImages implementationbptato2024-11-211-1/+1
| | | | | | | It necessarily removes the config.images check from codec access, which I'm not quite happy about, so I've added a check to the DOM instead. (TODO: maybe pager should just dynamically grant codec access as a capability instead? but maybe that's even more error prone...)
* Update monoucha, fix some JS testsbptato2024-11-181-7/+8
|
* formdata: eliminate a global varbptato2024-11-151-2/+4
|
* js: reorganize modules, update docsbptato2024-11-151-5/+5
| | | | | | | most of it has already been moved to monoucha, and the rest fits better in other directories. also, move urimethodmap to config
* dom: add replaceChild, requestAnimationFramebptato2024-11-101-0/+9
|
* Clean up forward declarations a bitbptato2024-10-271-3/+3
|
* base64: merge into twtstr/envbptato2024-10-131-5/+26
|
* env: fix getComputedStyle arg2bptato2024-10-101-1/+1
|
* promise: remove newPromisebptato2024-10-101-3/+1
| | | | normal construction is enough (and it wasn't really used anyway)
* timeout: accept err stream as parambptato2024-09-301-1/+1
| | | | | gets rid of a todo. (not sure why I thought this was important, but it sure looks nicer)
* Replace std/selectors with pollbptato2024-09-231-19/+14
| | | | | | | | | | | | std/selectors uses OS-specific selector APIs, which sounds good in theory (faster than poll!), but sucks for portability in practice. Sure, you can fix portability bugs, but who knows how many there are on untested platforms... poll is standard, so if it works on one computer it should work on all other ones. (I hope.) As a bonus, I rewrote the timeout API for poll, which incidentally fixes setTimeout across forks. Also, SIGWINCH should now work on all platforms (as we self-pipe instead of signalfd/kqueue magic).
* 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".
* xhr: more progressbptato2024-08-151-7/+5
| | | | | | | | | | * 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
* Update monouchabptato2024-08-091-2/+3
|
* env, dom: add History stub, basic LocalStoragebptato2024-07-301-0/+68
| | | | | | | * History: doesn't really do anything, just adding it to fix some pages * LocalStorage: kind of works, but does lookups with linear search, and the quota limitation is on the number of entries not their size. plus it doesn't actually store anything on disk yet (like cookies).
* Fixes for Nim 2.2bptato2024-07-291-1/+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.
* buffer, pager, config: add meta-refresh + misc fixesbptato2024-07-281-6/+6
| | | | | | | | | * buffer, pager, config: add meta-refresh value, which makes it possible to follow http-equiv=refresh META tags. * config: clean up redundant format mode parser * timeout: accept varargs for params to pass on to functions * pager: add "options" dict to JS gotoURL * twtstr: remove redundant startsWithNoCase
* headers, request: bring it closer to the standardbptato2024-07-271-3/+3
| | | | | | * add standard interfaces to headers * use window base URL for newRequest * remove pointless generic in newRequest
* env: add alert shimbptato2024-07-271-0/+3
| | | | just call console.error for now
* html: event cleanup, XHR progressbptato2024-07-181-4/+6
|
* timeout: simplify, misc fixesbptato2024-07-161-7/+7
| | | | | | Merge timeout & interval code paths. This fixes clearTimeout not clearing intervals.
* config: add various missing optionsbptato2024-06-291-1/+2
| | | | | | | Mainly things you could already set with [[siteconf]] but not normally. Also, a `styling' option to disable author styles. Also, `images' is now documented as an "experimental" option, since it's halfway usable now.
* env: fix nil deref in clientbptato2024-06-221-1/+3
|
* dom: simplify window.loaderbptato2024-06-091-11/+9
| | | | the Option setup hasn't made much sense for a long time now
* Move JS wrapper into Monouchabptato2024-06-031-5/+6
| | | | Operation "modularize Chawan somewhat" part 3
* html: improve Request, derive Client from Windowbptato2024-05-201-15/+33
| | | | | | | * 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)
* js: allow var instead of ptrbptato2024-05-121-33/+33
|
* js: refactorbptato2024-05-081-2/+7
| | | | | | | * prefix to-be-separated modules with js * remove dynstreams dependency * untangle from EmptyPromise * move typeptr into tojs
* Use isSome instead of isOkbptato2024-05-051-1/+1
| | | | no point in having identical overloads