about summary refs log tree commit diff stats
path: root/src/css/selectorparser.nim
Commit message (Collapse)AuthorAgeFilesLines
* cascade: collapse StyledNode tree into DOMbptato2025-01-201-10/+0
| | | | | We now compute styles on-demand, which is both more efficient and simpler than the convoluted tree diffing logic we previously used.
* sheet, selectorparser: fix attr hashing, hash multiple tags in :isbptato2025-01-161-1/+1
|
* cssparser: enumize CSSFunction namebptato2025-01-151-7/+7
|
* css: refactor selector parsing & cascading, some work on variablesbptato2025-01-141-29/+47
| | | | | | | | | Untangled some nested arrays to reduce the number of intermediary seqs in cascade, and collapsed the two rule def sorts into just one (per pseudo element). This should make cascading somewhat faster. Also, we now parse variables, but they aren't resolved yet. Probably a seq won't cut it for var lookup...
* buffer: make iframes clickablebptato2025-01-091-0/+1
| | | | better than nothing
* dom: add inline SVG supportbptato2024-12-201-0/+1
|
* css: add :target pseudo classbptato2024-12-171-0/+2
|
* dom, match: optimize :nth-child, :nth-last-childbptato2024-12-171-0/+3
| | | | | | 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.)
* dom, css: fix case-insensitive class/id/attr matchingbptato2024-12-151-6/+5
| | | | Uses an additional lower-case map for O(1) case-insensitive comparisons.
* css: align h[1-6] behavior with w3mbptato2024-12-141-0/+4
| | | | | | | | | | | 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).
* css: misc refactoringbptato2024-12-021-14/+14
|
* selectorparser: fix parsing of invalid pseudo elementsbptato2024-10-261-16/+35
| | | | | Found this because the 5th largest tech company on Earth cannot bother itself with trivial matters such as "writing valid CSS".
* selectorparser: fix broken tostrbptato2024-07-251-11/+27
|
* selectorparser: fix parseNthChild `of' token checkbptato2024-07-071-1/+3
| | | | tokenType had to be checked too
* cssparser: refactorbptato2024-05-011-4/+3
| | | | | | | | | * factor out skipWhitespace * remove streams dependency (cssparser could never stream without blocking the event loop, so we were just passing a StringStream in all cases, which made the whole streaming pointless.)
* css, dom: simplify ident parsing, canvas fixesbptato2024-05-011-1/+1
| | | | | | | | * add CSSStyleDeclaration setter * move ident maps directly into enums * more complete CSSComputedValue stringifier * turn canvas into a pseudo-image in cascade * set canvas to inline-block
* Update code stylebptato2024-04-171-143/+141
| | | | | | * separate params with ; (semicolon) instead of , (colon) * reduce screaming snake case use * wrap long lines
* rudimentary support for <video>, <audio>bptato2024-03-131-1/+2
| | | | | we just treat them as img tags. lazy, but works suprisingly well -- so long as the server sends us a Content-Type, anyway.
* dom: enumize attribute namesbptato2024-02-081-4/+10
|
* dom: atomize id, name, DOMTokenListbptato2024-02-081-10/+30
|
* Update chamebptato2024-02-071-27/+31
| | | | | | | | * Update chame to the latest version * Get rid of nodeType usage * Add atoms * Re-implement DOM attributes * document.write
* Use std/* imports everywherebptato2024-01-071-3/+3
|
* css: add case-insensitive matchingbptato2023-12-111-11/+38
| | | | Also case-sensitive, but for now that is the same as normal matching...
* selectorparser: enum-ize relbptato2023-12-091-17/+28
|
* css: change type of rvalue to char (from Rune)bptato2023-10-011-14/+18
| | | | | | | | We did were not using it as a unicode value anywhere, it was just making our life harder. If we ever need unicode delimiter tokens, we can re-introduce them as a different token type.
* selectorparser: fix missing case insensitivitybptato2023-10-011-10/+16
|
* Use twtstr.join everywherebptato2023-10-011-1/+2
|
* Get rid of unicode.toLowerbptato2023-10-011-1/+1
| | | | | It was used by mistake in a hundred percent of the cases we were using it.
* Move HTML parsing into Chamebptato2023-08-151-1/+2
| | | | Operation "modularize Chawan somewhat" part 2
* css: implement case insensitivitybptato2023-08-101-2/+2
| | | | For some reason I forgot about this.
* css: handle unknown tag names correctlybptato2023-07-251-4/+13
| | | | | | Instead of grouping all of them into TAG_UNKNOWN, match their tag names. To-do: this implementation is not very efficient.
* Remove unused variablebptato2023-01-271-1/+0
|
* WIP selector rewritebptato2023-01-271-346/+274
| | | | pretty slow for some reason
* selectorparser: refactor, fix combinator bugsbptato2023-01-201-79/+79
| | | | Fixes universal selectors after a combinator.
* selectorparser: parse comma correctly in combinatorsbptato2023-01-201-0/+3
|
* selectorparser: do not accept invalid selectorsbptato2023-01-071-44/+78
|
* selectorparser: support :link, :visitedbptato2023-01-011-1/+6
| | | | I say "support", but :visited is never matched.
* selectorparser: accept less invalid selectorsbptato2022-12-311-2/+14
|
* css: fix some bugs and improve cascading a bitbptato2022-12-291-1/+14
|
* selectorparser: fix pseudo elements on combinator selectorsbptato2022-12-281-2/+5
|
* layout/engine: get rid of dom dependencybptato2022-12-271-1/+1
| | | | Layout should only depend on cascading.
* Display text for img tag, background-imagebptato2022-12-161-1/+1
|
* Fix parsing of empty combinator selectorsbptato2022-12-051-1/+6
|
* Add textareabptato2022-11-281-1/+1
| | | | Editing is implemented using an external editor (like vi).
* Fix combinator bugs + reimplement querySelectorAllbptato2022-09-011-42/+20
|
* Use more accurate selector terminologybptato2022-08-231-24/+27
|
* Fix nth-child bugs, rename select to matchbptato2022-08-231-28/+17
|
* Merge functional and normal pseudo-class selectorsbptato2022-08-211-95/+139
| | | | And parse An+B syntax for nth-child/nth-last-child.
* Refactor css function selectors a bitbptato2022-08-201-28/+28
|
* Fix incorrect selector parsing, remove httpclient from loaderbptato2022-08-031-1/+61
|