about summary refs log tree commit diff stats
path: root/src/html/dom.nim
Commit message (Collapse)AuthorAgeFilesLines
...
* env: reflect user agent header in userAgentbptato2024-12-261-0/+1
|
* dom: optimize textContent, nodeValue; add nodeValue setterbptato2024-12-221-16/+31
|
* dom: add inline SVG supportbptato2024-12-201-85/+178
|
* response: automatically resume before closebptato2024-12-191-5/+0
| | | | doing it manually is too error prone
* css: add :target pseudo classbptato2024-12-171-1/+12
|
* dom, match: optimize :nth-child, :nth-last-childbptato2024-12-171-8/+30
| | | | | | I want to use it in the UA sheet, so the loop won't cut it. (Also fix a parsing bug that prevented "of" from working.)
* default(T) -> T.default, add some strict defsbptato2024-12-171-1/+1
|
* css: resolve units to px before layoutbptato2024-12-161-6/+15
| | | | Lets us skip a couple pointless multiplications/divisions during layout.
* dom, css: fix case-insensitive class/id/attr matchingbptato2024-12-151-7/+9
| | | | Uses an additional lower-case map for O(1) case-insensitive comparisons.
* css: align h[1-6] behavior with w3mbptato2024-12-141-0/+23
| | | | | | | | | | | Implemented using proprietary selectors -cha-first-node and -cha-last-node, modeled after -moz-first-node and -moz-last-node. I think they are compatible. That does mean this is more limited than w3m's trimming, e.g. it can't really deal with nesting or empty tags. I think this is fine, as it's mainly meant for unstyled documents in the first place (which are unlikely to have e.g. MAIN tags).
* dom: remove cached childNodes, children pointersbptato2024-12-131-34/+37
| | | | | | | Instead, just define the actual value over the getter function on the first use. Also, avoid accidentally creating the attributes NamedNodeMap on adopt.
* dom: queryCommandSupported, HTMLIFrameELement stubbptato2024-12-131-0/+7
|
* mimetypes: use cmpIgnoreCase for JS typesbptato2024-12-121-4/+4
|
* cssparser: misc cleanupbptato2024-12-071-2/+2
| | | | another case of "the object model was unnecessarily complex"
* dom: another insertAdjacentHTML fixbptato2024-12-071-2/+2
| | | | ctx can be HTML even if we take `this'
* dom: fix crash on insertAdjacentHTMLbptato2024-12-071-28/+15
| | | | In my defense, it was broken in the spec too.
* mimetypes: refactor, use mime.types for inline image extensionsbptato2024-12-051-2/+16
| | | | | | | | | | | | * 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.
* dom: add support for @importbptato2024-12-011-26/+33
| | | | only the most basic form; no media queries yet
* twtstr: add mypairsbptato2024-11-281-8/+8
| | | | | This couldn't get into system.nim for technical reasons, but it's still pretty useful when iterating over non-mutable openArrays.
* dom: fix some comparisonsbptato2024-11-241-2/+2
|
* loader/* -> serverbptato2024-11-241-4/+4
| | | | one less mystery
* dom: implement HTMLDocument, make Image C/Wbptato2024-11-221-1/+3
| | | | | | | | | | * add HTMLDocument as alias to Document * set Image as configurable/writable So looking closer, HTMLDocument *is* specified, just major browsers don't follow the spec. I doubt this incompatibility causes issues, anyway.
* dom: add document named property getter, update monouchabptato2024-11-221-8/+39
|
* dom: add document.compatModebptato2024-11-221-0/+5
|
* buffer: proper toggleImages implementationbptato2024-11-211-9/+18
| | | | | | | 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...)
* dom: add Image constructorbptato2024-11-191-0/+10
|
* dom: add HTMLHyperlinkElementUtils settersbptato2024-11-191-30/+66
|
* Update monoucha, fix some JS testsbptato2024-11-181-35/+36
|
* buffer: fix hover text not showing up with pseudo elementsbptato2024-11-171-0/+5
| | | | | | | | | | | | | | | | | | This was a bit annoying because it triggered the popup warning on cursorNextLink -> click with form buttons (as the square brackets around [button] are implemented with ::before/::after.) Notably, this also removes the visibility check from isClickable. I suspect there was a good reason why I added it, but I can't remember why, and it's incompatible with what desktop browsers do on: <a href="https://asdf.com" style="visibility: hidden"> <div style="visibility: visible"> test </div> </div> So if it's ever added back, then this case should be respected too.
* dom: add getElementsByName, fix adoptbptato2024-11-161-1/+10
|
* dom: run insertion steps for descendants on insertionbptato2024-11-151-10/+21
| | | | | | | | | wait isn't this exponential -- apparently not, at least not with the DOM builder. (however it is if JS builds the DOM out of place. what can you do, at least it works now.)
* formdata: eliminate a global varbptato2024-11-151-0/+1
|
* js: reorganize modules, update docsbptato2024-11-151-3/+3
| | | | | | | 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-2/+4
|
* dom: misc fixes & additionsbptato2024-11-091-0/+22
| | | | | | | | * fix cloneNode not cloning id/name atoms * fix HTMLOptionsCollection named item getter * fix HTMLCollection named item getter not refreshing snapshot * support named item getter for form * add basic createEvent
* dom: skip alternate stylesheets, add disabledbptato2024-11-091-6/+13
| | | | seems to work ok
* dom: support all HTMLHyperlinkElementUtils gettersbptato2024-11-091-17/+43
|
* url: fix compilation on Nim 1.6.14bptato2024-11-071-19/+19
| | | | it handles side effects differently
* utils, types: merge some modulesbptato2024-11-031-3/+0
| | | | | * line, vector, matrix -> path * twtuni, charcategory -> twtstr
* dom: add localName, simplifybptato2024-11-021-16/+15
|
* dom: fix <select> default state with size=1bptato2024-11-011-20/+14
|
* dom: add HTMLSelectElementbptato2024-10-311-8/+76
|
* Clean up forward declarations a bitbptato2024-10-271-46/+48
|
* dynstream: refactorbptato2024-10-201-2/+2
| | | | | | | | | | * consistently use cint instead of FileHandle - this was another remnant of winapi support; on posix, they are the same. * move "blocking" field to PosixStream * recvFileHandle -> recvFd, sendFileHandle -> sendFd * merge serversocket into dynstream * merge auxiliary C functions into dynstream_aux
* twtstr, toml: misc cleanupbptato2024-10-131-6/+5
| | | | | * remove unused DateTime toml type * add parseIntP for pointer-size int parsing
* dom: prevent leaking window size through media queriesbptato2024-10-121-3/+4
|
* dom: html -> documentElementbptato2024-10-101-7/+4
| | | | it's effectively a dupe, except html wouldn't work in XML
* color: reduce CellColor size, misc color refactoringbptato2024-10-061-3/+3
| | | | | | * split out CSSColor from CellColor; now CellColor is just 4 bytes (which helps reduce FormatCell size) * unify color function naming (still not perfect)
* dom: optimize element size, remove importc hack & dead codebptato2024-09-301-81/+60
| | | | | This switches CAtom to uint32; it seems better to use the same size on all platforms.
* dom: invalidate shared images on loadbptato2024-09-251-0/+1
| | | | fixes the race where reused images wouldn't show up after page load