about summary refs log tree commit diff stats
path: root/src/css
Commit message (Collapse)AuthorAgeFilesLines
* layout: remove obsolete todobptato2025-05-171-1/+0
|
* Eliminate some superfluous copiesbptato2025-05-114-8/+8
|
* Enable ProveInit warningbptato2025-05-104-4/+17
| | | | It has caught some minor bugs.
* layout, csstree: build stacking contexts together with treebptato2025-05-034-67/+130
| | | | | | | | We often redo sub-layouts in layout, and this makes stacking contexts very hard to build reliably there. This fixes a bug where positioned descendants of flex items would sometimes mysteriously disappear.
* layout: simplify resolveBoundsbptato2025-04-231-31/+19
| | | | | Not entirely sure what the px check for the mi[dtHorizontal].send assingment was for; tests still pass after removing it.
* cssparser: optimize CSSToken sizebptato2025-04-181-2/+2
| | | | 4 -> 3 words
* selectorparser: check type flag of hash tokensbptato2025-04-182-10/+6
|
* render: fix positioning of absolutes with negative z-indexbptato2025-04-141-2/+5
|
* layout, render: fix positioning of absolute flex item descendantsbptato2025-04-102-51/+23
| | | | | | | | Always placing boxes relative to their parent *seems* prettier, but the implementation was broken and I can't come up with a sane working one. So we're back to just special casing position: absolute in render. Sad, but at least it works. (I think it's also a bit more efficient.)
* cssvalues: add canvas, canvastext colorsbptato2025-04-091-0/+5
| | | | | I've set them to -cha-ansi(default) to avoid having to add even more color type flags.
* layout: always treat flex items as positioned boxesbptato2025-04-071-37/+41
| | | | | it still isn't really correct, they aren't supposed to behave as absolute positioning containers...
* layout: factor out canClear flagbptato2025-04-071-19/+14
| | | | ugly hack that is no longer needed
* layout: fix cleared floats not flushing previous exclusionsbptato2025-04-061-3/+14
| | | | | | | Well, I was trying to reproduce *another* float bug when I accidentally stumbled upon this... The fix is somewhat ugly, but not as bad as I expected.
* layout: correct table-caption width calculationbptato2025-04-031-35/+59
| | | | It's surprisingly tricky.
* csstree: add ::marker pseudo elementbptato2025-04-023-13/+28
|
* cssparser: ignore case in AnB parsing of odd/evenbptato2025-04-021-58/+65
|
* cssparser: optimize out some copiesbptato2025-04-024-456/+402
| | | | | | | | | The input buffer is no longer copied, and parseFloat32 gets an openArray instead of a copy of the string to parse. I've also simplified the parser somewhat so it now operates on openArrays of CSSComponentValues. It's still far more complex and wasteful than it should be, but it's progress.
* cssparser: fix escape sequence parsingbptato2025-04-011-1/+3
|
* config: add user-style, deprecate [css] and stylesheetbptato2025-04-011-36/+45
| | | | | I'm not 100% content with this syntax either, but it's a significant improvement over the previous solution.
* lunit: fix toFloat32 return typebptato2025-03-281-1/+1
|
* layout: remove DisplayBlockLike checkbptato2025-03-281-4/+1
| | | | Doesn't seem to be necessary anymore.
* layout: refactorbptato2025-03-282-619/+579
| | | | | | * layoutBlockChild has two branches less * better separation of code into individual layouts; layout() is now the main entry point for inner layout
* layout: reimplement list items with out-of-flow markersbptato2025-03-273-36/+20
| | | | | | | | 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.
* render: fix formatting generated for paddingbptato2025-03-251-29/+15
| | | | | | | | | | | | | | The old logic was badly copy pasted from the pass that did text formatting; accordingly, it was overly complex and did not work correctly. Now we just add a single formatting cell to override the last one if it exists. (Formatting cells go from x position -> next cell or line end, and padding implies that the line had ended before the starting position of our text.) I've left in a workaround to what I think is a bug. It may be related to cursorNextLink getting stuck at the line's end...
* cascade: map width/height for SVGbptato2025-03-211-4/+1
|
* Revert "csstree: improve intrinsic image sizing"bptato2025-03-212-6/+5
| | | | | | Never mind, it also broke some other things :( This reverts commit bc294d3284e0448b2f149ac6d905c8474508791d.
* csstree: improve intrinsic image sizingbptato2025-03-212-5/+6
| | | | | The algorithm itself is still fundamentally broken, but this at least prevents some cases of images becoming absurdly large.
* layout: eliminate pointless flex relayoutsbptato2025-03-151-5/+12
|
* layout: implement cross auto margins in flexbptato2025-03-142-21/+46
| | | | | Also removes the computation of underflow on the end margin for blocks; as far as I can tell, this was never used.
* cascade: also blockify inline-flex/(inline-)?grid itemsbptato2025-03-131-1/+1
|
* layout: small cleanupbptato2025-03-111-11/+9
|
* layout: shim grid as flow-rootbptato2025-03-113-6/+20
| | | | | | | | | | Pros: basic display on pages that depend on grid being implemented to display anything at all. Cons: breaks pages that have a fallback layout for UAs that can't do grid. (In practice, such pages must be rare - CSS for layout is painful enough that nobody in their right mind will spend time on implementing a fallback layout for the same DOM.)
* layout: revert marginBottom removalbptato2025-03-082-26/+15
| | | | | | It made cached layout inconsistent with uncached layout. (I'm not sure if this is actually observable; either way, it's a bad idea to rely on this.)
* layout: fix bottom margin handling for root blocksbptato2025-03-072-30/+34
| | | | | | 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-032-9/+13
| | | | | | 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-191-5/+10
| | | | also, fix a typo
* render, pager: fix canvas background painting orderbptato2025-02-191-7/+8
| | | | | | | | | | 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-183-7/+19
| | | | ref. https://todo.sr.ht/~bptato/chawan/43
* layout: implement negative z-indexbptato2025-02-184-127/+228
| | | | 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-171-21/+42
| | | | | | | | | | | | 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.)
* layout: skip Cf charactersbptato2025-02-151-1/+2
| | | | 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-152-39/+8
|
* dom: store pseudo-element computed values in a seqbptato2025-02-143-10/+7
| | | | | 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-133-46/+155
|