about summary refs log tree commit diff stats
path: root/src/css
Commit message (Collapse)AuthorAgeFilesLines
* css: resolve units to px before layoutbptato2024-12-166-219/+217
| | | | Lets us skip a couple pointless multiplications/divisions during layout.
* layout: do not allow canpx for scFitContentbptato2024-12-151-2/+2
| | | | | The test case attached is undefined in CSS 2.1, but css-sizing-3 wants us to just ignore the width property (I think).
* layout: also propagate xminwidth from table captionbptato2024-12-151-0/+1
| | | | | | | this is necessary too, now that I think of it (well, table caption sizing is still half-broken, but that's a problem for another day...)
* layout: set table intrinsic min width to specified widthbptato2024-12-151-0/+3
|
* layout: do not trust specified table cell heightbptato2024-12-151-3/+4
| | | | | If the contents are larger than the specified cell height, then it is simply ignored.
* dom, css: fix case-insensitive class/id/attr matchingbptato2024-12-154-19/+18
| | | | Uses an additional lower-case map for O(1) case-insensitive comparisons.
* css: align h[1-6] behavior with w3mbptato2024-12-142-0/+6
| | | | | | | | | | | 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).
* cascade: misc cleanupbptato2024-12-141-6/+3
|
* lunit: remove redundant codebptato2024-12-132-6/+2
| | | | | | using div instead of / is sort of weird, but it makes it clearer if we're dividing floats or layoutunits (and is already what the code uses).
* css: CSSComputedValue -> CSSValuebptato2024-12-126-109/+109
| | | | | "Computed" was redundant; other types of values don't have a common type.
* layout: small cleanupbptato2024-12-101-60/+60
|
* render: apply visibility to inline boxesbptato2024-12-101-21/+23
|
* layout: override table cell width if its min width is greaterbptato2024-12-101-0/+2
| | | | We can do this now that xminwidth is more accurate.
* layout: proper min width clampingbptato2024-12-101-73/+70
| | | | better
* layout: another min width clamping hackbptato2024-12-101-20/+29
| | | | still not quite right, but it's slowly taking shape
* layout: another xminwidth kludgebptato2024-12-081-0/+4
| | | | yeah idk
* cssparser: misc cleanupbptato2024-12-072-120/+64
| | | | another case of "the object model was unnecessarily complex"
* layout: round inline block padding to cellsbptato2024-12-071-1/+7
| | | | | Seems more compatible with websites that use smaller fonts + padding for styled code tags.
* cssparser: misc cleanupbptato2024-12-051-50/+47
|
* pager, term: use cell offset with kitty imagesbptato2024-12-032-3/+11
| | | | | | | | Gets rid of rounding errors when positioning images. Theoretically this is possible with Sixel too, but as always, it's ten times as difficult to implement as with Kitty, so I'll leave it for later.
* cascade: add cellspacingbptato2024-12-031-0/+7
|
* cssvalues: optimize CSSComputedValues sizebptato2024-12-033-271/+269
| | | | | | | | Roughly halves the object's size, and gets rid of a large number of allocations. It could be compressed further into a bitmap, but I'm not sure if it's worth the complexity.
* cssvalues: fix min-width/min-height autobptato2024-12-021-19/+18
| | | | | | so for max-width it's called "none", but for min-width it's "auto". why :(
* layout: temporary hack to fix xminwidth + flexbptato2024-12-021-0/+12
| | | | | | | | | | | | ugly, but better than the status quo. the core issue is that width, min-width should clamp xminwidth too, but it doesn't. this hadn't been an issue until recently, but since I made <pre> stretch out xminwidth too it had the unfortunate result that you now have to scroll on pages that nest pre in a flex. this still isn't a proper fix, in particular it won't work if min-width is set to 0, but on the sites I tried it happens to work anyway.
* cascade, cssvalues: clean up a bit morebptato2024-12-022-68/+76
|
* css: misc refactoringbptato2024-12-025-137/+128
|
* sheet, mediaquery: misc cleanupbptato2024-12-012-64/+29
|
* mediaquery: fix and after bare keywordbptato2024-12-011-1/+0
| | | | | no idea what that reconsume was doing there; probably a refactoring mistake
* dom: add support for @importbptato2024-12-012-26/+49
| | | | only the most basic form; no media queries yet
* cascade: allow presentational hints with styling=falsebptato2024-11-291-2/+2
| | | | They are UA style.
* layout: remove mystery startOffset adjustmentbptato2024-11-281-2/+0
| | | | | | | | Probably a remnant from back when startOffset meant (and was used for) something different. Interestingly, there was already a test case for this, but it was also wrong.
* twtstr: add mypairsbptato2024-11-282-7/+7
| | | | | This couldn't get into system.nim for technical reasons, but it's still pretty useful when iterating over non-mutable openArrays.
* layout, term, url: misc cleanupbptato2024-11-281-1/+0
|
* cascade: apply buffer.styling to inline stylesbptato2024-11-271-8/+11
| | | | it's author style too
* layout: support br clearbptato2024-11-271-28/+34
|
* buffer: optimize hover switchingbptato2024-11-261-0/+6
| | | | | Fixed a bug that would lead to styles unnecessarily being recalculated if the root element had a :hover dependency.
* layout: another intrinsic min width fixbptato2024-11-241-2/+4
| | | | forgot about word-break
* layout: fix intrinsic min width for words with wrapping opportunitiesbptato2024-11-241-11/+18
| | | | | | | This broke CJK combined with table layouts. (Inline layout's state dependencies between procs are getting a bit scary...)
* match, stylednode: remove generics, refactorbptato2024-11-193-137/+91
| | | | | | Turns out the generics weren't really needed in the first place. Also, StyledNode is now 16 bytes smaller.
* layout: fix intrinsic min width with whitespace: prebptato2024-11-191-0/+1
|
* layout: fix indefinitely sized flex items with boundsbptato2024-11-191-1/+8
| | | | maybe I'll get it right one of these days
* layout: fix crash on overlapping rowspan/colspanbptato2024-11-171-2/+3
| | | | | The rowspan filler must get a smaller colspan if its first cells are occupied by another cell with a colspan > 1.
* js: reorganize modules, update docsbptato2024-11-152-2/+2
| | | | | | | most of it has already been moved to monoucha, and the rest fits better in other directories. also, move urimethodmap to config
* cssvalues: reduce CSSComputedValue sizebptato2024-11-145-91/+102
| | | | | | | far from perfect, but it's something. (ideally, we should store enums in a bitmap instead of allocating a GC'ed property for each of them.)
* layout: fix another flex sizing bugbptato2024-11-141-1/+8
|
* layout: remove inline paddingbptato2024-11-131-24/+5
| | | | like line height, this caused more trouble than it was worth
* buffer: fix broken gotoAnchor behaviorbptato2024-11-122-5/+11
| | | | | | | | | | | | | | | | | 23beebe6 introduced a regression that broke gotoAnchor. This fixes that, plus a couple other long-standing gotoAnchor bugs: * If no anchor is found, do not dupe the buffer. Desktop browsers still add a history entry, while w3m prints an error. I've copied the latter because it makes more sense as a user, but this will have to be refined for the navigation API at some point. * If the anchor *is* found, then always jump to it, even if it's not visible. This was a limitation of relying on the line array, so now we rely on the box tree instead. (Sooner or later, the former must go anyway.) Also, fix `U' reload not restoring the position (hopefully this time for good).
* cascade: adjust prefers-color-scheme based on terminal backgroundbptato2024-11-101-1/+1
| | | | also, default link color is now blue for light terminal backgrounds
* layout -> cssbptato2024-11-106-2/+4080
| | | | as much as I wish it weren't, layout *is* css.
* renderdocument: basic stacking context supportbptato2024-11-091-1/+9
| | | | | negative z-index and inline positioning are still not respected, but better than nothing I guess.