Skip to content

Commit 35ad6c0

Browse files
committed
Add test. DEVSIX-2335
1 parent eca375c commit 35ad6c0

File tree

3 files changed

+76
-0
lines changed

3 files changed

+76
-0
lines changed

src/test/java/com/itextpdf/html2pdf/css/FloatTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,12 @@ public void nestedFloat01Test() throws IOException, InterruptedException {
487487
runTest("nestedFloat01Test", "diffNested01_");
488488
}
489489

490+
@Test
491+
//This test should fail after the fix in DEVSIX-2335
492+
public void floatingDivBottomBorderTest() throws IOException, InterruptedException {
493+
runTest("floatingDivBottomBorderTest", "diff_BottomBorderTest_");
494+
}
495+
490496
private void runTest(String testName, String diff) throws IOException, InterruptedException {
491497
String htmlName = sourceFolder + testName + ".html";
492498
String outFileName = destinationFolder + testName + ".pdf";
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<style>
5+
.clear {
6+
clear: both;
7+
}
8+
9+
div.label {
10+
float: left;
11+
width: 40%;
12+
margin: 0 20pt 5pt 0;
13+
}
14+
15+
div.field {
16+
float: left;
17+
margin: 0 20pt 5pt 0;
18+
color: #00a850;
19+
}
20+
21+
div.block_bad {
22+
margin-top: 10pt;
23+
background: lightblue;
24+
border: 1pt solid black;
25+
}
26+
27+
div.block_good {
28+
margin-top: 10pt;
29+
background: lightblue;
30+
border-top: 1pt solid black;
31+
border-left: 1pt solid black;
32+
border-right: 1pt solid black;
33+
}
34+
</style>
35+
</head>
36+
<body>
37+
<div class="block_bad">
38+
<h1>Both blocks should have equal height, only difference is the bottom border</h1>
39+
<div>Lorem Ipsum</div>
40+
<div>Lorem Ipsum</div>
41+
<div>Lorem Ipsum</div>
42+
<div>Lorem Ipsum</div>
43+
<div class="label">Lorem Ipsum</div><div class="field">Lorem Ipsum</div>
44+
<div class="clear"></div>
45+
<div class="label">Lorem Ipsum</div><div class="field">Lorem Ipsum</div>
46+
<div class="clear"></div>
47+
<div class="label">Lorem Ipsum</div><div class="field">Lorem Ipsum</div>
48+
<div class="clear"></div>
49+
<div class="label">Lorem Ipsum</div><div class="field">Lorem Ipsum</div>
50+
<div class="clear"></div>
51+
</div>
52+
53+
<div class="block_good">
54+
<h1>Both blocks should have equal height, only difference is the bottom border</h1>
55+
<div>Lorem Ipsum</div>
56+
<div>Lorem Ipsum</div>
57+
<div>Lorem Ipsum</div>
58+
<div>Lorem Ipsum</div>
59+
<div class="label">Lorem Ipsum</div><div class="field">Lorem Ipsum</div>
60+
<div class="clear"></div>
61+
<div class="label">Lorem Ipsum</div><div class="field">Lorem Ipsum</div>
62+
<div class="clear"></div>
63+
<div class="label">Lorem Ipsum</div><div class="field">Lorem Ipsum</div>
64+
<div class="clear"></div>
65+
<div class="label">Lorem Ipsum</div><div class="field">Lorem Ipsum</div>
66+
<div class="clear"></div>
67+
</div>
68+
69+
</body>
70+
</html>

0 commit comments

Comments
 (0)