diff options
-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 |