about summary refs log tree commit diff stats
path: root/src/css/values.nim
Commit message (Collapse)AuthorAgeFilesLines
* color: RGBAColor -> ARGBColorbptato2024-04-261-3/+3
|
* Update code stylebptato2024-04-171-347/+316
| | | | | | * 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.)
* 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-131-1/+1
| | | | | 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
* 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
* 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.))
* Allow non-RGB colors in CSSbptato2024-02-241-48/+96
| | | | | | | | | | | The -cha-ansi color type now sets ANSI colors in CSS. Also, color correction etc. has been improved a bit: * don't completely reset output state in processFormat for new colors * defaultColor is now separated from ANSI color type 0 * bright ANSI colors are no longer replaced with bold + dark variant * replaced ANSI color map to match xterm defaults
* css: reduce CSSComputedValue sizebptato2024-02-171-112/+94
| | | | | | | The `t' field was completely redundant, as it's already included in the CSSComputedValues index. + removed some unused functions
* layout: use html/body bgcolor as canvas bgcolorbptato2024-02-171-4/+10
| | | | | | This is required by the standard. (Without this, lots of websites have incorrect background colors, because they set the body height to 100% of the viewport.)
* twtstr: misc refactoringsbptato2024-02-091-1/+1
| | | | | | * move out half width <-> full width converters * snake_case -> camelCase * improve toScreamingSnakeCase slicing
* Use std/* imports everywherebptato2024-01-071-5/+5
|
* Compile with styleCheck:usagesbptato2023-12-281-5/+5
| | | | much better
* css: add text-transformbptato2023-12-111-5/+29
| | | | | | | Probably not fully correct, but it's a good start. Includes proprietary extension -cha-half-width, which converts full-width characters to half-width ones.
* layout: add clear, etc.bptato2023-11-231-4/+25
| | | | | | * Add clear CSS property * Fix some margin resolution bugs * Apply min-height, max-height to inner inline outer block boxes
* css/values: use Opt instead of Result[string]bptato2023-11-211-55/+54
| | | | the error values were 100% unused
* css/values: simplify getComputedValuebptato2023-11-211-11/+10
|
* css: add box-sizingbptato2023-11-211-4/+21
|
* layout: add floatsbptato2023-11-171-2/+5
| | | | | | | | | | | | | yay!!!! * Add support for float: left, float: right Also, misc stuff: * Add support for display: flow-root * Set line width to the maximum allowed width on line wrap * Various refactorings Still todo: support clear
* layout: refactor flow margin propagation, sizingbptato2023-11-121-0/+13
| | | | | | | | | * Blocks are now positioned before their text contents would be layouted * Untangle calcAvailableSpaceSizes's results from BlockBox * Move a couple of objects from box -> engine * Use Size in a few more places * Set display to block if float is not none
* dom: add some CSSStyleDeclaration functionsbptato2023-10-251-0/+3
|
* WindowAttributes: refactorbptato2023-10-191-1/+1
| | | | | | * rename module (window -> winattrs, to avoid conflict with env/window) * do not use result * remove unused cell_ratio
* css: support more list types, fix <ul/ol type=...bptato2023-10-141-4/+24
| | | | | | | Turns out you can't just throw the value into the CSS value parser. (Also, correction for the previous commit message: it is not LI but UL or OL.)
* css: support alphabetic list types, support <LI TYPE=...bptato2023-10-141-2/+50
|
* css: change type of rvalue to char (from Rune)bptato2023-10-011-4/+4
| | | | | | | | We did were not using it as a unicode value anywhere, it was just making our life harder. If we ever need unicode delimiter tokens, we can re-introduce them as a different token type.
* Get rid of unicode.toLowerbptato2023-10-011-3/+4
| | | | | It was used by mistake in a hundred percent of the cases we were using it.
* px: convert to float first for percentage valuesbptato2023-09-201-1/+1
| | | | | | | | | px now converts to float64 before converting back to a layout unit when calculating percentage values. This should reduce overflow crashes somewhat. (The real solution would be to not crash on overflow, but that's a little more difficult problem to solve.)
* move around more modulesbptato2023-09-141-2/+2
| | | | | | | | | | * ips -> io/ * loader related stuff -> loader/ * tempfile -> extern/ * buffer, forkserver -> server/ * lineedit, window -> display/ * cell -> types/ * opt -> types/
* css: implement case insensitivitybptato2023-08-101-125/+140
| | | | For some reason I forgot about this.
* css: fix percentage min/max-width valuesbptato2023-07-231-1/+1
|
* Fix bug in media-query parsingbptato2023-07-041-4/+4
| | | | This fixes interpretation of "@media (min/max-width: 1234px)".
* Use LayoutUnit in layoutbptato2023-07-041-20/+23
| | | | Reduces ugly rendering caused by rounding errors.
* css/values: remove stray eprintbptato2023-06-251-2/+0
|
* css/values: use Result instead of exceptionsbptato2023-06-251-305/+338
|
* Fix various layout bugs, prepare for image supportbptato2023-06-121-5/+7
|
* Add support for visibilitybptato2023-06-071-5/+25
|
* Add support for width, height media querybptato2023-06-071-1/+2
|
* Add support for canvas and multipartbptato2023-06-051-15/+10
| | | | | | | | | | | | | | | Quite incomplete canvas implementation. Crucially, the layout engine can't do much with whatever is drawn because it doesn't support images yet. I've re-introduced multipart as well, with the FormData API. For the append function I've also introduced a hack to the JS binding generator that allows requesting the JSContext pointer in nim procs. Really I should just fix the union generator thing and add support for overloading. In conclusion, for now the only thing canvas can be used for is exporting it as PNG and uploading it somewhere. Also, we now have PNG encoding and decoding too. (Now if only we had sixels as well...)
* css/values: add some stringifiersbptato2023-03-101-4/+13
|
* css/values: remove equalsbptato2023-01-081-32/+0
| | | | it had zero practical use and was annoying anyways
* css/values: add floatbptato2023-01-081-4/+23
| | | | it does nothing...
* css/cascade, layout/engine: add table alignbptato2023-01-081-5/+7
| | | | Also fix margin-left/right: auto, to some extent.
* css/values, parser, ...: fix background-imagebptato2023-01-061-6/+39
|
* ua.css: fix color, css/values: fix globalsbptato2023-01-041-1/+8
|