about summary refs log tree commit diff stats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* dom: add HTMLOptionsCollection setterbptato2025-02-201-0/+20
|
* render: propagate offset to positioned block child before clip box inheritancebptato2025-02-191-5/+10
| | | | also, fix a typo
* dom: do not reflect name on all elementsbptato2025-02-191-3/+18
|
* fromjs, javascript: optimize out class name registrybptato2025-02-196-38/+34
| | | | | | | | 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.
* render, pager: fix canvas background painting orderbptato2025-02-194-18/+35
| | | | | | | | | | We were painting the background box in render for dump mode, but this conflicted with the standard requirement that the canvas be painted before other elements. So now we handle this directly in the pager. Conveniently enough, this also fixes the issue of canvas color adding pointless spacing to pages (which often made the selection feature less useful.)
* layout: fix nested fixed boxesbptato2025-02-181-5/+10
|
* sheet: hash :root, :link pseudo classesbptato2025-02-183-41/+66
| | | | | | :root is used on the UA sheet, so it's quite important. :link, :visited can be treated as shortcuts (although :visited never matches right now).
* Add mark-links featurebptato2025-02-188-24/+82
| | | | ref. https://todo.sr.ht/~bptato/chawan/43
* layout: implement negative z-indexbptato2025-02-185-130/+230
| | | | Ugly, but works. I think.
* box: use singly linked list instead of seq for childrenbptato2025-02-173-23/+40
| | | | | | | | | | Mainly because the seq was hindering further improvements. I don't expect performance or memory usage to change much; leaf nodes now store one pointer more, but parent nodes no longer pay for the overhead of a seq. (FWIW, other browsers seem to be using linked lists for this, too.)
* render: respect stacking context for inline boxesbptato2025-02-172-23/+44
| | | | | | | | | | | | Also, eliminate the offset attribute in StackItem by just taking render.offset from the nearest ancestor as the base. That leaves us with clipBox, which I'm not yet sure how to get rid of. Its current implementation is certainly wrong: `position: absolute' should really use its absolute container's clip box. It is however correct for `position: relative' in its current form. (One way would be to cache it inside CSSBox, like we do offset.)
* layout: position absolute boxes relative to their parentbptato2025-02-164-67/+71
| | | | | | | | | | | | Also fixes an invisible bug where inline-block child absolutes were queued multiple times. This adds a pointer to the parent box for CSSBox objects, which isn't great, but the alternatives (maintaining an explicit stack or adding another tree traversal) were overly complex and/or too inefficient. On the flip side, now it should be possible to do both stacking contexts (with negative z-index) and overflow tracking in layout. (I think.)
* client: remove client getterbptato2025-02-152-5/+2
| | | | Undocumented, plus and globalThis/window are enough.
* layout: skip Cf charactersbptato2025-02-152-1/+7
| | | | We cannot handle these yet.
* cssparser: optimize a bitbptato2025-02-152-19/+17
| | | | It would be nice to at least make it single-pass.
* catom: toStr -> $bptato2025-02-154-69/+36
|
* xhr, event, catom: fix some bugsbptato2025-02-159-267/+297
| | | | Event handler functions can be set twice now.
* buffer: wait for scripts in headless modebptato2025-02-155-24/+61
| | | | | Dump mode remains the same, except now it can be controlled in config.toml as well.
* buffer: remove estream, fdbptato2025-02-142-7/+4
|
* dom: store pseudo-element computed values in a seqbptato2025-02-144-17/+20
| | | | | A map isn't so bad with three pointers, but it won't be viable once we start adding more pseudo-elements.
* csstree, cssvalues: add non-numeric counters, japanese-formalbptato2025-02-145-123/+157
| | | | plus refactor a bit
* csstree, cssvalues: implement counter()bptato2025-02-134-46/+156
|
* csstree, layout: more refactoringbptato2025-02-139-509/+431
| | | | | Base InlineBox is a fair bit smaller now, and (most) strings are cached using RefString.
* catom: make factory globalbptato2025-02-1313-341/+238
| | | | | This isn't great, but neither was passing around a pointer that pointed to a single object.
* dom: add DocumentType name, publicId, systemId gettersbptato2025-02-131-3/+3
|
* pager: copy cursor position on meta refreshbptato2025-02-132-7/+8
|
* layout: separate out tree construction logicbptato2025-02-125-619/+564
| | | | | | | | | | | | | | | For now, the skeleton remains in layout. Eventually it should be lazily constructed during the actual layout pass (thereby making layout "single-pass" (sometimes :p)) The end goal is to do it all in styledNode.children, so that caching can be as simple as "next box = find next matching cached box ?? make new". This does mean that the internal structure of cached boxes will always have to be reconstructed, but I don't see a better way. (I suppose it still remains possible to optimize out the unnecessary layout pass when only a repaint is needed (e.g. color change) by modifying computed values in-place.)
* cssvalues: fix list-style-type initial valuebptato2025-02-121-1/+1
| | | | | The marker placement in that test is wrong, but that isn't really a result of this change.
* render: fix a visibility bugbptato2025-02-111-8/+6
|
* event: add MouseEvent constructorbptato2025-02-111-1/+49
|
* buffer: fix nil check in maybeReshapebptato2025-02-101-1/+1
|
* dynstream: allow reading less fds than specifiedbptato2025-02-101-7/+19
|
* layout: respect intrinsic minimum width of table cellsbptato2025-02-091-1/+4
|
* dynstream: use seq instead of manual allocationbptato2025-02-091-12/+4
|
* layout: refactor tree building phasebptato2025-02-093-264/+169
| | | | | | | * remove inlineGroup - it was completely pointless now, and was the cause of some whitespace collapsing bugs * fix a float bug made visible by the above change * fix non-standard list item counter behavior
* pager: remove (BUFFER) from prompt, hide alert promptbptato2025-02-091-6/+5
| | | | just a waste of space
* pager: existsDir -> dirExistsbptato2025-02-081-1/+1
|
* layout: fix nested float positioningbptato2025-02-081-2/+0
| | | | | | | | | | Setting the width to max-content was supposed to be an optimization, but it seems max-content has some issues when interacting with floats. Arguably this is just hiding the bug, but my attempt to fix max-content was not successful... (That is to say, I suspect floats still behave strangely in tables.)
* box: abstract over tree traversalbptato2025-02-082-16/+20
|
* buffer: treat elements with click listener as clickablebptato2025-02-082-2/+11
|
* dom: various select fixes/improvementsbptato2025-02-084-21/+41
| | | | | | | | * do not trigger change event if selection did not change * do not destroy old selection on option insertion steps * position select popup correctly * reflectors for disabled attribute * immediately redraw container when select disappears
* dom: add fireEvent for Event objectsbptato2025-02-084-6/+9
|
* layout: fix some pre whitespace bugsbptato2025-02-081-62/+63
|
* layout: fix firstBaseline bugbptato2025-02-081-1/+1
|
* buffer, event: add input events, set isTrustedbptato2025-02-074-1/+55
|
* layout: unify BlockBox and InlineBox, refactor buildingbptato2025-02-076-445/+453
| | | | | | | | | | | | | | * normalize flow baseline computation * fix various margin collapsing bugs * eliminate inlineStack * eliminate push* * derive BlockBox and InlineBox from CSSBox This removes a pointer from BlockBox, and adds a pointer to both BlockBox and InlineBox (type field). A net loss, but it makes the code more manageable. Plus, inline groups now need one less allocation, so overall it's not that bad.
* catom: convert JS_ATOM_NULL to CAtomNullbptato2025-02-061-3/+6
| | | | unsure about the utility of this, but why not
* jsintl: support unitsbptato2025-02-061-20/+194
|
* pager: catch SIGINT for interrupt handlerbptato2025-02-053-45/+27
| | | | | | | | Significantly more efficient in long running commands (as the context switch is gone). For many commands in quick succession... it replaces the fcntl with a tcsetattr, so I guess it's the same?
* dom: various collection fixesbptato2025-02-051-8/+28
| | | | | | | | | | * fix iterator assertion failing if finalizer del's after incl * fix strange mismatch in id * fix missing HTMLOptionsCollection finalizer * optimize refreshCollection * fix root liveCollections not being updated by the finalizer Now it shouldn't crash pages anymore.