aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/css/layout.nim2
-rw-r--r--test/layout/inline-float-weirdness.color.expected6
-rw-r--r--test/layout/shrink-to-fit-indirect-floating-descendant.expected1
-rw-r--r--test/layout/shrink-to-fit-indirect-floating-descendant.html9
4 files changed, 13 insertions, 5 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:
diff --git a/test/layout/inline-float-weirdness.color.expected b/test/layout/inline-float-weirdness.color.expected
index bed34fc1..cb8782d8 100644
--- a/test/layout/inline-float-weirdness.color.expected
+++ b/test/layout/inline-float-weirdness.color.expected
@@ -1,6 +1,6 @@
-test test  test test test 
-test  test  test 
-test  test  test 
+test test  test test  test 
+test  test  test 
+test  test  test 
test test 
test 
test 
diff --git a/test/layout/shrink-to-fit-indirect-floating-descendant.expected b/test/layout/shrink-to-fit-indirect-floating-descendant.expected
new file mode 100644
index 00000000..4d14d06f
--- /dev/null
+++ b/test/layout/shrink-to-fit-indirect-floating-descendant.expected
@@ -0,0 +1 @@
+ abcd
diff --git a/test/layout/shrink-to-fit-indirect-floating-descendant.html b/test/layout/shrink-to-fit-indirect-floating-descendant.html
new file mode 100644
index 00000000..28ebbfac
--- /dev/null
+++ b/test/layout/shrink-to-fit-indirect-floating-descendant.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<div style="float: right">
+<div>
+<div style="float: right">d</div>
+<div style="float: right">c</div>
+<div style="float: left">a</div>
+<div style="float: left">b</div>
+</div>
+</div>