Skip to content

Commit f251520

Browse files
committed
#482 #483 #491 Add test to prove that too long words fall below floats.
This is to make sure infinite loop fixes do not break this functionality.
1 parent 15319be commit f251520

File tree

3 files changed

+47
-0
lines changed

3 files changed

+47
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<html>
2+
<head>
3+
<style>
4+
@page {
5+
size: 160px 350px;
6+
margin: 0;
7+
}
8+
body {
9+
margin: 10px 30px;
10+
font-size: 13px;
11+
line-height: 16px;
12+
}
13+
.floater {
14+
background-color: blue;
15+
}
16+
</style>
17+
</head>
18+
<body>
19+
<!-- The third lot of x chars should be pushed below the float. -->
20+
<div style="border: 1px solid red;">
21+
<div style="float: left; width: 50px; height: 50px;" class="floater"></div>
22+
xxx xxxxxx xxxxxxxxxxxxxx xxxxxxxxxxxxxxxxx
23+
</div>
24+
25+
<div style="border: 1px solid red; margin-top: 10px;">
26+
<div style="float: right; width: 50px; height: 50px;" class="floater"></div>
27+
xxx xxxxxx xxxxxxxxxxxxxx xxxxxxxxxxxxxxxxx
28+
</div>
29+
30+
<div style="border: 1px solid red; margin-top: 10px;">
31+
<div style="float: left; width: 20px; height: 50px;" class="floater"></div>
32+
<div style="float: right; width: 30px; height: 70px;" class="floater"></div>
33+
xxx xxxxxx xxxxxxxxxxxxxx xxxxxxxxxxxxxxxxx
34+
</div>
35+
36+
</body>
37+
</html>

openhtmltopdf-examples/src/test/java/com/openhtmltopdf/visualregressiontests/VisualRegressionTest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,6 +1167,16 @@ public void testIssue482InfiniteLoopTable() throws IOException {
11671167
}));
11681168
}
11691169

1170+
/**
1171+
* Tests that too long words fall below floats (left, right, both).
1172+
* This test is needed to make sure fixes for issue 482 do not prevent
1173+
* this behavior.
1174+
*/
1175+
@Test
1176+
public void testTooLongWordsFallBelowFloats() throws IOException {
1177+
assertTrue(vt.runTest("too-long-words-fall-below-floats"));
1178+
}
1179+
11701180
// TODO:
11711181
// + Elements that appear just on generated overflow pages.
11721182
// + content property (page counters, etc)

0 commit comments

Comments
 (0)