about summary refs log tree commit diff stats
path: root/src/html
Commit message (Collapse)AuthorAgeFilesLines
* xhr: fix flipped exception in overrideMimeTypebptato2024-12-281-1/+1
|
* env: add innerWidth, innerHeightbptato2024-12-281-0/+6
|
* env: do not copy attrs, fix screen on clientbptato2024-12-282-8/+8
| | | | Now screen.width etc. works in the pager too.
* dom: standard querySelector/All; type erase childrenbptato2024-12-271-12/+50
|
* dom: set elIndex to -1 for AttrDummyElementbptato2024-12-271-0/+2
|
* dom: expose getPropertyValuebptato2024-12-271-1/+1
|
* dom: add focus()bptato2024-12-272-2/+9
| | | | Respects autofocus.
* jsencoding: fix nil deref on empty encode inputbptato2024-12-261-9/+9
|
* Optimize some Option[string] outbptato2024-12-262-15/+15
| | | | toJS is generally more efficient
* env: fix taintEnabledbptato2024-12-261-1/+1
| | | | it should have been a function
* buffer: add "app" scripting modebptato2024-12-264-29/+49
| | | | | | | | | | 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-262-5/+6
|
* dom: optimize textContent, nodeValue; add nodeValue setterbptato2024-12-221-16/+31
|
* dom: add inline SVG supportbptato2024-12-202-86/+184
|
* 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-172-2/+2
|
* 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-152-9/+35
| | | | 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
|
* twtstr: reduce copying in atobbptato2024-12-121-3/+3
|
* 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.
* env: allow data URL fetchbptato2024-12-051-1/+2
|
* mimetypes: refactor, use mime.types for inline image extensionsbptato2024-12-052-5/+20
| | | | | | | | | | | | * 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.
* cascade: add cellspacingbptato2024-12-031-0/+1
|
* dom: add support for @importbptato2024-12-011-26/+33
| | | | only the most basic form; no media queries yet
* twtstr: add mypairsbptato2024-11-282-9/+10
| | | | | 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-243-12/+12
| | | | 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-212-10/+19
| | | | | | | 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...)
* chadombuilder: fix removeImpl definitionbptato2024-11-211-1/+2
| | | | | It is documented in chame that parentNode may be nil, and indeed, it is nil in some cases.
* dom: add Image constructorbptato2024-11-191-0/+10
|
* event: fix preventDefault with stopImmediatePropagationbptato2024-11-191-5/+4
| | | | canceled was not being set, because we jumped out of the loop too early.
* dom: add HTMLHyperlinkElementUtils settersbptato2024-11-192-30/+82
|
* Update monoucha, fix some JS testsbptato2024-11-183-42/+50
|
* ua.css, event: small clean upbptato2024-11-181-1/+0
|
* 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-153-13/+13
|
* js: reorganize modules, update docsbptato2024-11-158-12/+233
| | | | | | | most of it has already been moved to monoucha, and the rest fits better in other directories. also, move urimethodmap to config