aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-12-28 20:35:17 +0100
committerbptato <nincsnevem662@gmail.com>2024-12-28 20:35:17 +0100
commit6a627ab38cabe0543d961a190b59dcfac622ce90 (patch)
tree4c6ece1cbc1152002c3139618255b8b693b069aa /test
parent9703f00237662f8eda685e9392bd97247b8074dd (diff)
downloadchawan-6a627ab38cabe0543d961a190b59dcfac622ce90.tar.gz
layout: fix various padding bugs
They need some peculiar conditions to manifest, but the logic errors are clear: * padding contributing to intrinsic minimum size wasn't being clamped * inline padding was being applied twice
Diffstat (limited to 'test')
-rw-r--r--test/layout/flex-no-shrink-padding-cancels-out-parent-margin.color.expected4
-rw-r--r--test/layout/flex-no-shrink-padding-cancels-out-parent-margin.html22
2 files changed, 26 insertions, 0 deletions
diff --git a/test/layout/flex-no-shrink-padding-cancels-out-parent-margin.color.expected b/test/layout/flex-no-shrink-padding-cancels-out-parent-margin.color.expected
new file mode 100644
index 00000000..de757ffa
--- /dev/null
+++ b/test/layout/flex-no-shrink-padding-cancels-out-parent-margin.color.expected
@@ -0,0 +1,4 @@
+ aaaa aaaa
+test 
+test 
+
diff --git a/test/layout/flex-no-shrink-padding-cancels-out-parent-margin.html b/test/layout/flex-no-shrink-padding-cancels-out-parent-margin.html
new file mode 100644
index 00000000..d07af919
--- /dev/null
+++ b/test/layout/flex-no-shrink-padding-cancels-out-parent-margin.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<style>* { font-family: monospace }</style>
+<div style="background: red; width: 11ch">
+<div style="margin-left: -3ch">
+<div style="flex-shrink: 0; width: 100%; padding-left: 3ch">
+<div style="display: flex; flex-wrap: wrap">
+<div style="padding: 0 1ch">aaaa</div>
+<div style="padding: 0 1ch">aaaa</div>
+</div>
+</div>
+</div>
+</div>
+
+<div style="width: 5ch; background: red">
+<div style="display: flex; margin: 0 -1ch">
+<div style="flex-basis: 100%; flex-shrink: 0; width: 100%; padding: 0 1ch; box-sizing: border-box">
+<div>
+test
+</div>
+<div style="background: blue">
+test
+</div>