about summary refs log tree commit diff stats
path: root/src/css/layout.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2025-02-08 20:27:20 +0100
committerbptato <nincsnevem662@gmail.com>2025-02-08 20:46:07 +0100
commit78eca80d8870c667b5f934033e3b643eef5f0d1a (patch)
tree06f61a686a72030c149d8bf29d459bc603f8cd68 /src/css/layout.nim
parent2c136265658450ea91cb81ee6b3a85198a0c4844 (diff)
downloadchawan-78eca80d8870c667b5f934033e3b643eef5f0d1a.tar.gz
layout: fix nested float positioning
Setting the width to max-content was supposed to be an optimization,
but it seems max-content has some issues when interacting with floats.

Arguably this is just hiding the bug, but my attempt to fix max-content
was not successful...

(That is to say, I suspect floats still behave strangely in tables.)
Diffstat (limited to 'src/css/layout.nim')
-rw-r--r--src/css/layout.nim2
1 files changed, 0 insertions, 2 deletions
diff --git a/src/css/layout.nim b/src/css/layout.nim
index 311f826a..e6050495 100644
--- a/src/css/layout.nim
+++ b/src/css/layout.nim
@@ -1319,8 +1319,6 @@ proc resolveBlockWidth(sizes: var ResolvedSizes; parentWidth: SizeConstraint;
       sizes.space.w = stretch(underflow)
     else:
       sizes.margin[dtHorizontal].send += underflow
-  elif parentWidth.t == scFitContent:
-    sizes.space.w = maxContent()
   if sizes.space.w.isDefinite() and sizes.maxWidth < sizes.space.w.u or
       sizes.maxWidth < LUnit.high and sizes.space.w.t == scMaxContent:
     if sizes.space.w.t == scStretch: