about summary refs log tree commit diff stats
path: root/test
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-10-05 19:46:20 +0200
committerbptato <nincsnevem662@gmail.com>2024-10-05 20:11:09 +0200
commit954cef984a70c6e81ec9921a7a9c6982b9ff66e0 (patch)
treecb0baac7aa844ef5a38a6c730cd5d053bb77db9a /test
parent1f6314978683e71abd09b8d028934705119f9633 (diff)
downloadchawan-954cef984a70c6e81ec9921a7a9c6982b9ff66e0.tar.gz
layout: fix floats overriding margin/padding
Diffstat (limited to 'test')
-rw-r--r--test/layout/float-with-margins.expected4
-rw-r--r--test/layout/float-with-margins.html21
-rw-r--r--test/layout/float_negative_margin.expected1
-rw-r--r--test/layout/float_negative_margin.html13
4 files changed, 25 insertions, 14 deletions
diff --git a/test/layout/float-with-margins.expected b/test/layout/float-with-margins.expected
new file mode 100644
index 00000000..d45d0559
--- /dev/null
+++ b/test/layout/float-with-margins.expected
@@ -0,0 +1,4 @@
+testing             aside
+1     2
+      3
+      4
diff --git a/test/layout/float-with-margins.html b/test/layout/float-with-margins.html
new file mode 100644
index 00000000..864a4e2b
--- /dev/null
+++ b/test/layout/float-with-margins.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+<body>
+<div style="width: 20ch">
+<div style="float: left; width: 20ch">
+testing
+</div>
+<aside style="float: left; margin-right: -10ch">
+aside
+</aside>
+</div>
+<br>
+<!-- test if margins & padding do not get consumed after a float -->
+<div style="float: left">1</div>
+<div style="margin-left: 3ch; padding-left: 3ch">
+2<br>
+3<br>
+4
+</div>
+</body>
+</html>
diff --git a/test/layout/float_negative_margin.expected b/test/layout/float_negative_margin.expected
deleted file mode 100644
index 0b4af186..00000000
--- a/test/layout/float_negative_margin.expected
+++ /dev/null
@@ -1 +0,0 @@
-testing               aside
diff --git a/test/layout/float_negative_margin.html b/test/layout/float_negative_margin.html
deleted file mode 100644
index 70dcfa0c..00000000
--- a/test/layout/float_negative_margin.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE html>
-<html>
-<body>
-<div style="width: 200px">
-<div style="float: left; width: 200px">
-testing
-</div>
-<aside style="float: left;margin-right: -100px;">
-aside
-</aside>
-</div>
-</body>
-</html>
^
1159f9ec ^



a6791aee ^
1159f9ec ^


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124