about summary refs log tree commit diff stats
path: root/src/css
Commit message (Collapse)AuthorAgeFilesLines
* 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)
* css: hash attribute namesbptato2024-07-292-44/+56
|
* cascade: move some presentational hints to ua.cssbptato2024-07-291-66/+0
|
* buffer, pager, config: add meta-refresh + misc fixesbptato2024-07-281-3/+3
| | | | | | | | | * buffer, pager, config: add meta-refresh value, which makes it possible to follow http-equiv=refresh META tags. * config: clean up redundant format mode parser * timeout: accept varargs for params to pass on to functions * pager: add "options" dict to JS gotoURL * twtstr: remove redundant startsWithNoCase
* cssvalues: fix parseDimensionValues bugbptato2024-07-271-9/+10
| | | | Whitespace-only dimension values no longer crash the parser.
* cascade: add some presentational hintsbptato2024-07-271-3/+7
| | | | | | * top/middle/bottom for img, remove redundant display: block for floats (they get blockified anyway) * map align for p too, not just div
* selectorparser: fix broken tostrbptato2024-07-251-11/+27
|
* dom, match, event: small cleanupbptato2024-07-171-6/+6
|
* css: clean up a bitbptato2024-07-123-54/+18
|
* cascade: reduce allocationsbptato2024-07-101-57/+42
| | | | | | | Just use the previous tree when possible. The child list is still reconstructed, but at least we no longer alloc every single node again at every single restyle.
* cascade: fix style cachingbptato2024-07-092-6/+8
| | | | the invalid flag must be toggled after styling
* selectorparser: fix parseNthChild `of' token checkbptato2024-07-071-1/+3
| | | | tokenType had to be checked too
* layout: reduce copiesbptato2024-07-031-2/+5
| | | | | Text data is no longer stored separately in InlineFragments; instead, we now include refs to StyledNodes.
* css, html: fix CSS dependency invalidationbptato2024-07-032-36/+19
|
* cascade: support align=left, align=right on imgbptato2024-06-291-2/+14
|
* img, loader: add image resizing, misc fixesbptato2024-06-281-2/+3
| | | | | | | | | | | | | | | * resize images with stb_image_resize * use tee for output handle redirection (redirectToFile blocks) * cache original image files * accept lseek in sandbox * misc stbi fixes For now, I just pulled in stb_image_resize v1. v2 is an extra 150K in size, not sure if it's worth the cost. (Either way, we can always switch later if needed, since the API is almost the same.) Next step: move sixel/kitty encoders to CGI, and cache their output in memory instead of the intermediate RGBA representation.
* misc cleanupsbptato2024-06-223-6/+3
|
* cssvalues: add "clear" to table wrapper boxbptato2024-06-111-1/+3
| | | | this one is weird but I'm sure the standard is technically right
* css: slightly optimize cascadebptato2024-06-024-136/+145
| | | | Parse rule values in sheet addRule, not during cascade.
* stylednode: remove `text' fieldbptato2024-05-282-10/+12
| | | | This avoids some unnecessary string copying.
* stylednode: move invalidation data to DOMbptato2024-05-272-25/+16
| | | | this way, we do not refer to nodes of previous cascade passes
* layout: add wrapper box for table caption + misc stuffbptato2024-05-241-15/+35
| | | | | | | | | Captions are no longer positioned inside tables, yay. Also, misc: * rename some things for consistency * clamp out of bounds rgb() values * remove inherited property lookup table
* layout, layoutunit: remove some automatic convertersbptato2024-05-221-5/+5
| | | | | I wish we didn't need any, but fixing this for integers would be too involved and the float64 one was causing problems now.
* css: stub overflowbptato2024-05-181-1/+15
| | | | | The renderer cannot handle it yet, but at least this fixes pages that expect overflow: hidden (etc.) to establish a new BFC.
* css/values -> css/cssvaluesbptato2024-05-164-3/+3
| | | | for consistency
* cssvalues: fix casingbptato2024-05-161-61/+61
|
* luwrap: use separate context (+ various cleanups)bptato2024-05-101-0/+90
| | | | | | Use a LUContext to only load required CharRanges once per pager. Also, add kana & hangul vi word break categories for convenience.
* cascade: avoid empty ::before/::afterbptato2024-05-051-3/+2
| | | | | If `content' is empty, then generating before/after pseudo-elements is wrong.
* color: separate out JS convertersbptato2024-05-051-0/+1
| | | | | ansi2html depends on color, but we definitely do not want to link it to QJS, so the converters must be moved into a separate module.
* Use isSome instead of isOkbptato2024-05-052-6/+6
| | | | no point in having identical overloads