diff options
author | bptato <nincsnevem662@gmail.com> | 2024-12-08 17:30:32 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2024-12-08 17:30:34 +0100 |
commit | 782ebcea2a1df040f34603e77b8d8588ba7ebbf1 (patch) | |
tree | e576017a38290b6855c36afd41d4ef9830c8ad0e | |
parent | 8c0efdda8b3a68e2de60e3333adde5beb90a8dd8 (diff) | |
download | chawan-782ebcea2a1df040f34603e77b8d8588ba7ebbf1.tar.gz |
layout: another xminwidth kludge
yeah idk
-rw-r--r-- | src/css/layout.nim | 4 | ||||
-rw-r--r-- | test/layout/min-width-flex-basis-idk.expected | 6 | ||||
-rw-r--r-- | test/layout/min-width-flex-basis-idk.html | 5 |
3 files changed, 15 insertions, 0 deletions
diff --git a/src/css/layout.nim b/src/css/layout.nim index d0a19250..58078d73 100644 --- a/src/css/layout.nim +++ b/src/css/layout.nim @@ -1212,6 +1212,10 @@ proc applyMinWidth(box: BlockBox; sizes: ResolvedSizes) = # (or maybe I could just change DefaultSpan to start from # LayoutUnit.low? then I'll need another extra 0 check everywhere I # apply it but that should be ok) + # Also I have doubts on whether checking for stretch is OK... why + # isn't it reflected by minWidth anyway? + if sizes.space.w.t == scStretch: + box.state.xminwidth = min(box.state.xminwidth, sizes.space.w.u) if sizes.minWidth > 0: box.state.xminwidth = min(box.state.xminwidth, sizes.minWidth) diff --git a/test/layout/min-width-flex-basis-idk.expected b/test/layout/min-width-flex-basis-idk.expected new file mode 100644 index 00000000..c4a4c5e4 --- /dev/null +++ b/test/layout/min-width-flex-basis-idk.expected @@ -0,0 +1,6 @@ + +test test test + +test +test +test diff --git a/test/layout/min-width-flex-basis-idk.html b/test/layout/min-width-flex-basis-idk.html new file mode 100644 index 00000000..045953d3 --- /dev/null +++ b/test/layout/min-width-flex-basis-idk.html @@ -0,0 +1,5 @@ +<!DOCTYPE html> +<div style="display: flex; flex-wrap: wrap; width: 5ch"> +<div style="flex-basis: 100%; width: 5ch"> +<pre>test test test</pre> +<div>test test test |