about summary refs log tree commit diff stats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* cssparser: fix escape sequence parsingbptato2025-04-012-0/+5
|
* config: add user-style, deprecate [css] and stylesheetbptato2025-04-011-1/+1
| | | | | I'm not 100% content with this syntax either, but it's a significant improvement over the previous solution.
* layout: reimplement list items with out-of-flow markersbptato2025-03-272-0/+12
| | | | | | | | Instead of generating a separate container box for list items, just set the marker's display to an internal value that is treated specially. This fixes a bug where position: relative would not register the correct block as the positioned ancestor.
* xmlhttprequest: fix open with credentialsbptato2025-03-231-1/+1
| | | | | * ignore username/password if undefined * do not throw on subsequent fetch with username/password
* Revert "csstree: improve intrinsic image sizing"bptato2025-03-212-29/+0
| | | | | | Never mind, it also broke some other things :( This reverts commit bc294d3284e0448b2f149ac6d905c8474508791d.
* csstree: improve intrinsic image sizingbptato2025-03-212-0/+29
| | | | | The algorithm itself is still fundamentally broken, but this at least prevents some cases of images becoming absurdly large.
* bonus: add new http handler with tinflbptato2025-03-201-0/+3
| | | | not much else is done yet, but it's a start
* layout: implement cross auto margins in flexbptato2025-03-142-0/+25
| | | | | Also removes the computation of underflow on the end margin for blocks; as far as I can tell, this was never used.
* layout: fix bottom margin handling for root blocksbptato2025-03-073-0/+12
| | | | | | I've also refactored the code a bit, so it's both easier to understand and more efficient. (In particular, BlockLayoutState no longer has to store marginBottom.)
* layout: adjust table cell height to fill rowsbptato2025-03-031-3/+3
| | | | | | Achieved by generating an anonymous flow root child for the contents and positioning that. (Not the cell contents directly - that wouldn't work because of inline child boxes.)
* render: propagate offset to positioned block child before clip box inheritancebptato2025-02-192-0/+6
| | | | also, fix a typo
* dom: do not reflect name on all elementsbptato2025-02-191-0/+1
|
* render, pager: fix canvas background painting orderbptato2025-02-195-1/+16
| | | | | | | | | | 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.)
* Fix testbptato2025-02-182-6/+1
| | | | ...
* layout: fix nested fixed boxesbptato2025-02-182-0/+14
|
* layout: implement negative z-indexbptato2025-02-184-0/+64
| | | | Ugly, but works. I think.
* render: respect stacking context for inline boxesbptato2025-02-172-0/+3
| | | | | | | | | | | | 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-165-3/+26
| | | | | | | | | | | | 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.)
* xhr, event, catom: fix some bugsbptato2025-02-156-7/+36
| | | | Event handler functions can be set twice now.
* csstree, cssvalues: add non-numeric counters, japanese-formalbptato2025-02-142-4/+4
| | | | plus refactor a bit
* csstree, cssvalues: implement counter()bptato2025-02-132-0/+52
|
* layout: separate out tree construction logicbptato2025-02-122-0/+4
| | | | | | | | | | | | | | | 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-112-0/+9
|
* layout: respect intrinsic minimum width of table cellsbptato2025-02-092-0/+12
|
* layout: refactor tree building phasebptato2025-02-097-5/+29
| | | | | | | * 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
* layout: fix nested float positioningbptato2025-02-083-3/+13
| | | | | | | | | | 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.)
* layout: fix some pre whitespace bugsbptato2025-02-082-0/+8
|
* layout: fix firstBaseline bugbptato2025-02-082-0/+11
|
* layout: unify BlockBox and InlineBox, refactor buildingbptato2025-02-079-3/+111
| | | | | | | | | | | | | | * 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.
* formdata: fix FormData constructor, append filename handlingbptato2025-02-051-0/+6
| | | | + some strict defs
* cssparser: fix an infinite loopbptato2025-02-051-0/+1
| | | | | | | startsWithNumber was a poorly copied version of the standard algorithm, which, as it turns out, is largely redundant. So I removed most of it and inlined the rest.
* cssparser: fix parsing of consequitive commentsbptato2025-02-042-0/+6
|
* cascade, ua.css: use ansi red, replace option with anonymous StyledNodesbptato2025-02-047-14/+17
| | | | Now select[multiple] options have the same coloring as w3m.
* layout: merge addOuterBlock with layoutBlock, refactorbptato2025-02-044-13/+6
| | | | | | | | | | | Having to initLine after every block hurts... I've added a mechanism to at least eliminate cleared floats, but I wish we just didn't init the line :/ (I tried making it lazy, but I couldn't get it to work elegantly.) I've also added some comments about flow, and moved around code so that related layouts are mostly in the same place.
* layout: inline background fixes & simplificationbptato2025-02-037-0/+52
| | | | | Eliminates two superfluous line box alignment passes, and fixes some vertical-align bugs.
* javascript: derive ctor functions from parent ctor functionsbptato2025-02-021-0/+1
| | | | no idea why JS_NewCFunction3 is not public...
* sheet: fix a hashing bugbptato2025-01-302-0/+6
|
* layout: fix absolute sizing order with floatsbptato2025-01-302-0/+6
| | | | | Also removed the redundant pushPositioned/popPositioned calls in popPositioned.
* mediaquery: fix some parser bugsbptato2025-01-302-3/+20
| | | | | | <media-condition-without-or> works correctly once again. ref. https://todo.sr.ht/~bptato/chawan/46
* render: fix OOB panic with scroll container outside the canvasbptato2025-01-292-0/+4
| | | | | clipBox must not be allowed to start outside the canvas, or paintBackground will happily try to setTextStr in a negative position.
* nanosvg: fix infinite loopbptato2025-01-292-0/+4
| | | | My bad; not present upstream.
* javascript: fix .jsget on JSValuebptato2025-01-281-0/+17
| | | | | | | | | | | | | | Since toJS doesn't create a new value, `node' must be dup'd if it is a JSValue. Also, forbid .jsset on JSValue as it was broken as well and it's not obvious what the intention is when using it. (Probably it should free the old value, but did the user think of setting it? :P) I can see why I made toJS not dup the value - to make returning consistent with Nim's semantics - but it really makes things confusing... implicitly behaving as lent might be better, albeit less convenient.
* layout: fix flow roots in inline boxes not respecting floatsbptato2025-01-282-0/+10
| | | | Also, some more work on the unification of inline & block layouts.
* layout: fix some float margin resolution bugsbptato2025-01-284-0/+25
|
* cascade: fix variable inheritancebptato2025-01-282-2/+8
|
* layout: various float fixes in inline contextsbptato2025-01-268-0/+75
| | | | | | | | | | | | | * reinit line after outer block height is known * do not set wrap in finishLine preceding outer block layout * attach pending inline floats to line boxes * unify flow a bit more The last two points mean that we now (mostly) handle inline floats like block floats, which is great because only the latter ever worked properly. (Well, margin resolution still needs work...)
* layout: do not generate anonymous inline boxesbptato2025-01-2516-23/+73
| | | | | | | | | | | | | | | | Anonymous inline boxes were blocking progress on layout caching, so they are now gone. Instead, we handle them in layoutInline (which meanwhile has spaghettified to beyond comprehension... now it's a special case of inner BlockBox (kind of?) - incredibly, it still passes tests :P) This seems to match what major browsers do as well; some test cases were updated to reflect the "improved" rendering this brings. Next I'd like to remove anonymous table boxes by generating them in cascade. Then it should be straightforward enough to at least reuse flow roots on relayout. (And clean up flow layout...)
* layout: fix an absolute sizing bugbptato2025-01-232-0/+5
| | | | it's size.h, not size.w
* render: actually fix the "extra unnecessary line" bugbptato2025-01-2131-31/+0
| | | | Plus remove addLines, it's no longer very useful.