about summary refs log tree commit diff stats
path: root/src/css
Commit message (Collapse)AuthorAgeFilesLines
* 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
* cssparser: refactorbptato2024-05-015-139/+84
| | | | | | | | | * factor out skipWhitespace * remove streams dependency (cssparser could never stream without blocking the event loop, so we were just passing a StringStream in all cases, which made the whole streaming pointless.)
* css, dom: simplify ident parsing, canvas fixesbptato2024-05-013-371/+287
| | | | | | | | * add CSSStyleDeclaration setter * move ident maps directly into enums * more complete CSSComputedValue stringifier * turn canvas into a pseudo-image in cascade * set canvas to inline-block
* css/values: refactorbptato2024-04-281-283/+222
| | | | | | | | | * clean up global parsing * getValueFromDecl (now parseValue) no longer depends on receiving a CSSDeclaration (just its value) * getComputedValues now also takes a tuple of (name, cvals) instead of a CSSDeclaration * fix padding shorthand accepting auto
* color: RGBAColor -> ARGBColorbptato2024-04-261-3/+3
|
* Initial image supportbptato2024-04-251-1/+5
| | | | | | | | | | | | | | | | | * png: add missing filters, various decoder fixes * term: fix kitty response interpretation, add support for kitty image detection * buffer, pager: initial image display support Emphasis on "initial"; it only "works" with kitty output and PNG input. Also, it's excruciatingly slow, and repaints images way too often. Left undocumented intentionally it for now, until it actually becomes useful. In the meantime, adventurous users can find out themselves why: [[siteconf]] url = "https://.*" images = true
* Update code stylebptato2024-04-178-972/+956
| | | | | | * separate params with ; (semicolon) instead of , (colon) * reduce screaming snake case use * wrap long lines
* css, layout: flexbox fixesbptato2024-04-061-2/+29
| | | | | | | * do not re-resolve FlexPendingItem sizes; it's pointless and it breaks percentage sizes * fix some bugs in `flex' shorthand parsing * add `flex-flow' shorthand
* Initial flexbox supportbptato2024-04-051-38/+158
| | | | | | | | | Still far from being fully standards-compliant, or even complete, but it seems to work slightly less horribly than having no flexbox support at all on sites that do use it. (Also includes various refactorings in layout to make it possible at all to add flexbox.)
* catom: at -> satbptato2024-03-212-19/+19
| | | | just for consistency
* stylednode: clean up code stylebptato2024-03-181-30/+39
|
* Move around some modulesbptato2024-03-141-1/+1
| | | | | | | | * extern -> gone, runproc absorbed by pager, others moved into io/ * display -> local/ (where else would we display?) * xhr -> html/ * move out WindowAttributes from term, so we don't depend on local from server
* rudimentary support for <video>, <audio>bptato2024-03-133-2/+17
| | | | | we just treat them as img tags. lazy, but works suprisingly well -- so long as the server sends us a Content-Type, anyway.
* css: fix {} macros on older Nim versionsbptato2024-03-111-6/+9
| | | | | old Nim chokes on unquoting enums without explicitly casting them to the target enum type.
* css: simplify property & value definitionsbptato2024-03-041-266/+272
| | | | having to manually add them to a million places is annoying
* catom: merge TagType with AttrTypebptato2024-03-042-1/+1
| | | | | it's inefficient and pointless to treat them differently, so just derive a new enum from TagType with a macro
* cssparser: fix another anb parsing bugbptato2024-03-021-2/+2
| | | | obviously for ident tokens we must check value, not unit
* cssparser: fix anb parser whitespace handling bugsbptato2024-03-021-4/+7
| | | | | * skip whitespace in some places where we didn't but should * fix crash in get_tok when eof comes after whitespace
* css: remove caption-side: left, right, fix caption-side: bottombptato2024-03-011-7/+2
| | | | | | | | left/right never really worked correctly, is non-standard, and the only browser that supported it (Firefox) removed it years ago. bottom was adding the table width to its offset instead of the height, that is now fixed.
* css/values: assign to the correct variablebptato2024-03-011-6/+6
|
* css: fix shorthands not overriding all valuesbptato2024-02-291-29/+32
| | | | background & list-style did not override unspecified values
* misc refactoringsbptato2024-02-271-2/+2
| | | | | | * rename buffer enums * fix isAscii for char 0x80 * remove dead code from URL
* term: improve pixels-per-column/line detectionbptato2024-02-251-1/+1
| | | | | | | | | Some terminal emulators (AKA vte) refuse to set ws_xpixel and ws_ypixel in the TIOCGWINSZ ioctl, so we now query for CSI 14 t as well. (Also CSI 18 t for good measure, just in case we can't ioctl for some reason.) Also added some fallback (optionally forced) config values for width, height, ppc, and ppl. (This is especially useful in dump mode.)
* css: always use defaultColor as the initial colorbptato2024-02-251-7/+4
| | | | | | | | | | This way, we do not end up with ugly contrast-corrected white on terminals with arbitrary backgrounds by default. (Now we get the native -cha-ansi(default) instead). (We leave background-color as transparent; this should have the same effect, since defaultColor as bgcolor is ignored, but makes more sense (and will allow us to un-ignore defaultColor as bgcolor in the future.))