about summary refs log tree commit diff stats
path: root/src/css
Commit message (Collapse)AuthorAgeFilesLines
...
* 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.
* utils, types: merge some modulesbptato2024-11-032-2/+0
| | | | | * line, vector, matrix -> path * twtuni, charcategory -> twtstr
* cssparser: fix parsing of unrecognized at rulesbptato2024-11-022-25/+20
| | | | + clean up a bit
* Clean up forward declarations a bitbptato2024-10-272-4/+5
|
* selectorparser: fix parsing of invalid pseudo elementsbptato2024-10-261-16/+35
| | | | | Found this because the 5th largest tech company on Earth cannot bother itself with trivial matters such as "writing valid CSS".
* cssparser: do not accept invalid rulesbptato2024-10-251-2/+3
| | | | | | This isn't exactly clear from the standard's wording, but e.g. *display: inline must be discarded (because it incorrectly starts with a delim token).
* css: add reverse video extensionbptato2024-10-151-0/+1
| | | | | | | | | | | | Called -cha-reverse. Mostly to solve the problem that code tags are indistinguishable from regular text - on a graphical browser this is normally served by monospace font, but we always use monospace... So now the default ua.css adds reverse video to code and xmp. pre remains as it was, because it means "preformatted", not "monospaced". Also, it would mess with our whatever-to-HTML converter output.
* dom: html -> documentElementbptato2024-10-102-2/+2
| | | | it's effectively a dupe, except html wouldn't work in XML
* color: reduce CellColor size, misc color refactoringbptato2024-10-062-17/+17
| | | | | | * split out CSSColor from CellColor; now CellColor is just 4 bytes (which helps reduce FormatCell size) * unify color function naming (still not perfect)
* dom: optimize element size, remove importc hack & dead codebptato2024-09-301-13/+13
| | | | | This switches CAtom to uint32; it seems better to use the same size on all platforms.
* layout: remove line-heightbptato2024-09-211-22/+5
| | | | | This was a bad idea that, despite my best efforts, never worked properly.
* Refactor img/*bptato2024-09-151-1/+1
| | | | | I've moved most image logic to adapter, so it doesn't really make sense to have this subdir anymore.
* utils: add twtunibptato2024-09-082-26/+26
| | | | | | | | | | | | | | | | | | | std/unicode has the following issues: * Rune is an int32, which implies overflow checking. Also, it is distinct, so you have to convert it manually to do arithmetic. * QJS libunicode and Chagashi work with uint32, interfacing with these required pointless type conversions. * fastRuneAt is a template, meaning it's pasted into every call site. Also, it decodes to UCS-4, so it generates two branches that aren't even used. Overall this lead to quite some code bloat. * fastRuneAt and lastRune have frustratingly different interfaces. Writing code to handle both cases is error prone. * On older Nim versions which we still support, std/unicode takes strings, not openArray[char]'s. Replace it with "twtuni", which includes some improved versions of the few procedures from std/unicode that we actually use.
* twtstr: type erase binarySearch instantiationbptato2024-09-061-5/+9
| | | | | | | | Do it like parseEnumNoCase0, so we no longer instantiate a gazillion different binary searches for the same type. While we're at it, make matchNameProduction's searchInMap use uint32 too.
* cascade: add missing nil checkbptato2024-09-021-1/+1
|
* canvas: move to separate CGI scriptbptato2024-09-012-8/+10
| | | | | | | | | | * stream: and passFd is now client-based, and accessible for buffers * Bitmap's width & height is now int, not uint64 * no more non-network Bitmap special case in the pager for canvas I just shoehorned it into the static image model, so it still doesn't render changes after page load. But at least now it doesn't crash the browser.
* winattrs: un-snakeifybptato2024-08-232-6/+6
|
* cssvalues: fix broken vmin, vmaxbptato2024-08-231-2/+2
|
* cssvalues, color: use parseEnumNoCase morebptato2024-08-031-39/+18
|
* cssvalues, sheet: fix some more case sensitivity bugsbptato2024-08-023-18/+6
|
* cssvalues, twtstr, mediaquery: refactor & fixesbptato2024-08-023-405/+309
| | | | | | | * cssvalues, twtstr: unify enum parsing code paths, parse enums by bisearch instead of hash tables * mediaquery: refactor (long overdue), fix range comparison syntax parsing, make ident comparisons case-insensitive (as they should be)