about summary refs log tree commit diff stats
path: root/src/css
Commit message (Collapse)AuthorAgeFilesLines
...
* csstree, layout: more refactoringbptato2025-02-135-479/+374
| | | | | Base InlineBox is a fair bit smaller now, and (most) strings are cached using RefString.
* catom: make factory globalbptato2025-02-135-60/+45
| | | | | This isn't great, but neither was passing around a pointer that pointed to a single object.
* layout: separate out tree construction logicbptato2025-02-124-619/+563
| | | | | | | | | | | | | | | 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
|
* layout: respect intrinsic minimum width of table cellsbptato2025-02-091-1/+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
* 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-081-0/+16
|
* layout: fix some pre whitespace bugsbptato2025-02-081-62/+63
|
* layout: fix firstBaseline bugbptato2025-02-081-1/+1
|
* layout: unify BlockBox and InlineBox, refactor buildingbptato2025-02-075-422/+438
| | | | | | | | | | | | | | * 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.
* cssparser: fix an infinite loopbptato2025-02-051-23/+9
| | | | | | | 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.
* layout: round out small list-item margins and paddingbptato2025-02-041-8/+16
| | | | | They can be especially distracting when the rounding error fluctuates between items.
* cssparser: fix parsing of consequitive commentsbptato2025-02-041-1/+1
|
* cascade, ua.css: use ansi red, replace option with anonymous StyledNodesbptato2025-02-042-41/+74
| | | | Now select[multiple] options have the same coloring as w3m.
* layout: merge addOuterBlock with layoutBlock, refactorbptato2025-02-041-478/+571
| | | | | | | | | | | 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.
* lunit: fix negative roundingbptato2025-02-031-0/+2
|
* layout: eliminate InlineAtombptato2025-02-033-225/+230
| | | | | | | | | * For boxes, we now use the box in InlineBox. * For images, wrap bmp in an InlineImage type that stores offset + size. * For text, wrap strings into TextRun objects (an offset + a string). (Ideally, TextRuns shouldn't copy at all, but that's a problem for another time.)
* layout: inline background fixes & simplificationbptato2025-02-031-132/+67
| | | | | Eliminates two superfluous line box alignment passes, and fixes some vertical-align bugs.
* layout: fix list item layoutbptato2025-02-031-14/+6
| | | | The content should clear.
* dom, layout: fix empty canvas cache idsbptato2025-02-011-1/+1
| | | | ok now I understand why I made shareCachedItem crash...
* sheet: fix a hashing bugbptato2025-01-301-1/+1
|
* layout: fix absolute sizing order with floatsbptato2025-01-301-3/+9
| | | | | Also removed the redundant pushPositioned/popPositioned calls in popPositioned.
* mediaquery: fix some parser bugsbptato2025-01-301-9/+8
| | | | | | <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-291-1/+1
| | | | | clipBox must not be allowed to start outside the canvas, or paintBackground will happily try to setTextStr in a negative position.
* layout: fix flow roots in inline boxes not respecting floatsbptato2025-01-281-104/+92
| | | | Also, some more work on the unification of inline & block layouts.
* layout: fix some float margin resolution bugsbptato2025-01-281-34/+21
|
* cascade: fix variable inheritancebptato2025-01-281-11/+16
|
* layout: unify InlineContext with FlowStatebptato2025-01-271-547/+538
|
* cascade: reuse input value when possiblebptato2025-01-271-9/+3
|
* layout: remove obsolete comment, improve struct packingbptato2025-01-261-12/+8
|
* layout: various float fixes in inline contextsbptato2025-01-261-136/+139
| | | | | | | | | | | | | * 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: small cleanupbptato2025-01-261-67/+41
|
* layout: do not generate anonymous inline boxesbptato2025-01-255-278/+356
| | | | | | | | | | | | | | | | 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...)
* cascade: fix canvas conversionbptato2025-01-251-1/+1
|
* layout: always use computed from StyledNodebptato2025-01-251-74/+69
|
* cascade, layout: blockify flex in cascadebptato2025-01-252-23/+4
| | | | Both simpler and more efficient.
* buffer: add placeholders for [frame]bptato2025-01-231-0/+1
| | | | | | | | | | HTML5 doesn't allow frameless processing of documents, so the <noframes> fallback never really worked. Being able to click on the individual frames feels somewhat less broken. I'm unsure how the actual solution should look like. Either we need multiple buffer support per process, or treat them as pseudo-images and handle them in pager.
* cssvalues: add missing bounds checkbptato2025-01-231-3/+3
|
* layout: fix an absolute sizing bugbptato2025-01-231-5/+4
| | | | it's size.h, not size.w
* cssvalues: quick hack to make simple calc() expressions workbptato2025-01-233-2/+40
| | | | | | | | | | Most calc calls I've seen look something like "calc(100% - 2em)", i.e. just a percentage value offset by a pixel value. As it happens, we also had 24 bits available in CSSLength objects because of padding. Just enough to smuggle in that offset :) Very limited of course, but it does fix layout on a couple of websites.
* selectorparser: optimize Selector sizebptato2025-01-222-37/+33
|
* Add annotations for move semanticsbptato2025-01-222-22/+25
| | | | | | | | | Supposedly they aren't broken in refc after 2.0.0, so we can do this now that 1.6.14 is dropped. I've confirmed lent to work as advertised; it indeed reduces copies. sink doesn't seem to help much, but I guess it will be useful once we switch to ORC.
* render: actually fix the "extra unnecessary line" bugbptato2025-01-211-7/+4
| | | | Plus remove addLines, it's no longer very useful.
* render: blend in paintBackgroundbptato2025-01-211-38/+44
| | | | | | | It's an improvement, but the painting order still isn't quite right... Also fixes a bug where paintBackground would unnecessarily append an extra line to the document's end.
* cssvalues: support percentage rgb colors, hsl & hslabptato2025-01-212-38/+108
| | | | hsl is quite popular these days.
* cssvalues: add newer length unitsbptato2025-01-211-18/+36
| | | | I'm not convinced that anybody even knows these exist, but whatever.
* layout: fix division by 0bptato2025-01-211-2/+2
|
* cssvalues: fix rgba() function parsingbptato2025-01-201-4/+4
|