about summary refs log tree commit diff stats
path: root/src/css/values.nim
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* css/values: consistently use exceptionsbptato2023-01-031-56/+41
| | | | | Options are great, but only if used consistently. This also fixes some weird bugs where exceptions were handled incorrectly.
* css/values: remove todobptato2023-01-031-1/+0
|
* selectorparser: support :link, :visitedbptato2023-01-011-2/+9
| | | | I say "support", but :visited is never matched.
* css/values: apply presentational hints after UA stylebptato2023-01-011-4/+5
| | | | | So that e.g. table valign overrides the user-agent vertical-align value, but still respects user/author style.
* css: fix some bugs and improve cascading a bitbptato2022-12-291-3/+21
|
* css/values: fix length shorthand handlingbptato2022-12-281-10/+15
|
* layout/engine: get rid of dom dependencybptato2022-12-271-4/+33
| | | | Layout should only depend on cascading.
* Fix broken css color function parsingbptato2022-12-251-31/+49
|
* css/values: fix some incorrectly accepted valuesbptato2022-12-211-18/+29
|
* Display text for img tag, background-imagebptato2022-12-161-12/+36
|
* layout/engine: fix a <br> bug that ate inline boxes, add broken ↵bptato2022-12-161-4/+32
| | | | | | | | | min-width/max-width min-width, max-width, min-height, max-height are mostly broken, because they aren't enforced on inline level. Though really the whole size calculation mechanism needs to be refactored, its current state is horrible.
* Make background-color non-inherited; fix {}= for CSSComputedValuesbptato2022-12-121-7/+8
|
* Add support for q, fix list-item counter behaviorbptato2022-12-121-20/+132
|
* Add border-collapse, border-spacing; fix fd sending hackbptato2022-12-111-9/+59
| | | | | | Note that they don't actually work correctly because of rounding errors. The fd sending hack now emits C directly. Let's hope this actually works.