aboutsummaryrefslogtreecommitdiffstats
path: root/src/css/cascade.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2025-01-09 20:58:21 +0100
committerbptato <nincsnevem662@gmail.com>2025-01-09 21:31:10 +0100
commitf269971cc52f534f1deeceb5cfb0049dee4dcc93 (patch)
tree818ea1b10e277bef60d257b171a20df965c519fa /src/css/cascade.nim
parent8c769fc302a04737f1060fdcc0fab16a733d94c9 (diff)
downloadchawan-f269971cc52f534f1deeceb5cfb0049dee4dcc93.tar.gz
ua.css: improve select rendering
Regular select is now rendered as flex, and does not wrap. This gets rid of the pointless whitespace before/after options. multiple still looks weird, but maybe a bit less? Probably we should just render it with pseudo-checkboxes, and drop the special mode from select.nim.
Diffstat (limited to 'src/css/cascade.nim')
-rw-r--r--src/css/cascade.nim5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/css/cascade.nim b/src/css/cascade.nim
index 2bcff009..273a344c 100644
--- a/src/css/cascade.nim
+++ b/src/css/cascade.nim
@@ -176,6 +176,11 @@ proc applyPresHints(computed: CSSValues; element: Element;
let input = HTMLInputElement(element)
if input.inputType in InputTypeWithSize:
map_size
+ of TAG_SELECT:
+ let select = HTMLSelectElement(element)
+ if select.attrb(satMultiple):
+ let size = element.attrulgz(satSize).get(4)
+ set_cv cptHeight, length, resolveLength(cuEm, float64(size), attrs)
else: discard
type