Skip to content

Commit dbd1be5

Browse files
Update references of ignored tests to JIRA tickets, add new tests
1 parent 48a0bc3 commit dbd1be5

10 files changed

+85
-5
lines changed

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import com.itextpdf.test.annotations.type.IntegrationTest;
1111
import org.junit.Assert;
1212
import org.junit.BeforeClass;
13+
import org.junit.Ignore;
1314
import org.junit.Test;
1415
import org.junit.experimental.categories.Category;
1516

@@ -79,6 +80,24 @@ public void blocksInsideParagraph() throws IOException, InterruptedException {
7980
runTest("blocksInsideParagraph", "diffInside01_");
8081
}
8182

83+
@Test
84+
@Ignore("DEVSIX-1732")
85+
public void inlineBlocksInsideParagraph() throws IOException, InterruptedException {
86+
runTest("inlineBlocksInsideParagraph", "diffInlineInside01_");
87+
}
88+
89+
@Test
90+
@Ignore("DEVSIX-1732: floating element shall not be moved along with text when text alignment is applied.")
91+
public void inlineFloatsWithTextAlignmentTest01() throws IOException, InterruptedException {
92+
runTest("inlineFloatsWithTextAlignmentTest01", "diffInlineFloat01_");
93+
}
94+
95+
@Test
96+
@Ignore("DEVSIX-1732: justification is broken when floating element is inline along with text.")
97+
public void inlineFloatsWithTextAlignmentTest02() throws IOException, InterruptedException {
98+
runTest("inlineFloatsWithTextAlignmentTest02", "diffInlineFloat02_");
99+
}
100+
82101
private void runTest(String testName, String diff) throws IOException, InterruptedException {
83102
String htmlName = sourceFolder + testName + ".html";
84103
String outFileName = destinationFolder + testName + ".pdf";

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public void float15Test() throws IOException, InterruptedException {
156156

157157
@Test
158158
public void float16Test() throws IOException, InterruptedException {
159-
// TODO at the moment we always wrap inline text in paragraphs, thus when we process next floating element it's always on next line
159+
// TODO DEVSIX-1730: at the moment we always wrap inline text in paragraphs, thus when we process next floating element it's always on next line
160160
// see also float50Test and float51Test
161161

162162
// TODO as a possible solution in future we might consider adding floats blocks as inlines-blocks in inline helper
@@ -200,7 +200,7 @@ public void float24Test() throws IOException, InterruptedException {
200200

201201
@Test
202202
public void float25Test() throws IOException, InterruptedException {
203-
// TODO at the moment we always wrap inline text in paragraphs, thus when we process next floating element it's always on next line
203+
// TODO DEVSIX-1730: at the moment we always wrap inline text in paragraphs, thus when we process next floating element it's always on next line
204204
// see also float50Test and float51Test
205205
runTest("float25Test", "diff25_");
206206
}
@@ -270,7 +270,7 @@ public void float35Test() throws IOException, InterruptedException {
270270

271271
@Test
272272
public void float36Test() throws IOException, InterruptedException {
273-
// TODO at the moment we always wrap inline text in paragraphs, thus when we process next floating element it's always on next line
273+
// TODO DEVSIX-1730: at the moment we always wrap inline text in paragraphs, thus when we process next floating element it's always on next line
274274
// see also float50Test and float51Test
275275
runTest("float36Test", "diff36_");
276276
}
@@ -348,7 +348,7 @@ public void float49Test() throws IOException, InterruptedException {
348348

349349
@Test
350350
public void float50Test() throws IOException, InterruptedException {
351-
// TODO at the moment we always wrap inline text in paragraphs, thus we process this test exactly like in float51Test
351+
// TODO DEVSIX-1730: at the moment we always wrap inline text in paragraphs, thus we process this test exactly like in float51Test
352352
runTest("float50Test", "diff50_");
353353
}
354354

src/test/resources/com/itextpdf/html2pdf/css/FloatAndAlignmentTest/SeveralBlocksSingleParagraph.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<div style="float:none; margin: 0; border: solid; width: 100px">Float:none div width 100 px Test aaaaaa aaaaaaaaaaaa aaaaaaaaaaaaaa</div>
3838
<div style="float:right; margin: 0; border: solid; width: 100px">Float:right div width 100 px Test aaaaaa aaaaaaaaaaaa aaaaaaaaaaaaaa</div>
3939
<div style="float:left; margin: 0; border: solid; width: 100px">Float:left div width 100 px Test aaaaaa aaaaaaaaaaaa aaaaaaaaaaaaaa</div>
40-
<p style="margin: 0; text-align: center;">Text (paragraph) text-align center - and some more text for visualization<p>
40+
<p style="margin: 0; text-align: center;">Text (paragraph) text-align center - and some more text for visualization</p>
4141
</div>
4242
</body>
4343
</html>
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<body>
4+
<div style="width: 500px; border: solid green">
5+
<span style="float:none; margin: 0; color: purple; border: solid; width: 100px; display: inline-block;">Float:none div width 100 px Test aaaaaa aaaaaaaaaaaa aaaaaaaaaaaaaa</span>
6+
<span style="float:right; margin: 0;color: red; border: solid; width: 100px; display: inline-block;">Float:right div width 100 px Test aaaaaa aaaaaaaaaaaa aaaaaaaaaaaaaa</span>
7+
<span style="float:left; margin: 0; color: blue; border: solid; width: 100px; display: inline-block;">Float:left div width 100 px Test aaaaaa aaaaaaaaaaaa aaaaaaaaaaaaaa</span>
8+
<p style="margin: 0; text-align: center;">Text (paragraph) text-align CENTER - and some more text for visualization. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.<p>
9+
</div>
10+
<br>
11+
<div style="width: 700px; border: solid green">
12+
<p style="margin: 0; text-align: right;">
13+
Text (paragraph) text-align RIGHT - and some more text for visualization. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud <span style="float:left; margin: 0; color: blue; border: solid; width: 100px; display: inline-block;">Float:left div width 100 px Test aaaaaa aaaaaaaaaaaa aaaaaaaaaaaaaa</span>exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
14+
<span style="float:right; margin: 0; color: red; border: solid; width: 100px; display: inline-block;">Float:right div width 100 px Test aaaaaa aaaaaaaaaaaa aaaaaaaaaaaaaa</span>
15+
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
16+
</div>
17+
<br>
18+
<div style="width: 500px; border: solid green">
19+
<p style="margin: 0; text-align: left;">Text (paragraph) text-align LEFT - and some more text for visualization. Lorem ipsum dolor sit amet, consectetur adipiscing elit,sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. <span style="float:left; margin: 0; color: blue; border: solid; width: 100px; display: inline-block;">Float:left div width 100 px Test aaaaaa aaaaaaaaaaaa aaaaaaaaaaaaaa</span>
20+
<span style="float:right; margin: 0; color: red;border: solid; width: 100px; display: inline-block;">Float:right div width 100 px Test aaaaaa aaaaaaaaaaaa aaaaaaaaaaaaaa</span>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
21+
</div>
22+
<br>
23+
24+
<div style="width: 700px; border: solid green">
25+
<p style="margin: 0; text-align: center;">Text (paragraph) text-align CENTER - andsomemoretextforvisualization. Loremipsum dolorsitamet,consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
26+
<span style="float:left; margin: 0; color: blue; border: solid; width: 100px; display: inline-block;">Float:left div width 100 px Test aaaaaa aaaaaaaaaaaa aaaaaaaaaaaaaa</span>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
27+
<span style="float:right; margin: 0; color: red; border: solid; width: 100px; display: inline-block;">Float:right div width 100 px Test aaaaaa aaaaaaaaaaaa aaaaaaaaaaaaaa</span>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
28+
<span style="float:none; margin: 0; color: purple; background-color: gray; border: solid; width: 100px; display: inline-block;">Float:none div width 100 px Test aaaaaa aaaaaaaaaaaa aaaaaaaaaaaaaa</span>Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
29+
</div>
30+
<br>
31+
32+
<div style="width: 700px; border: solid green">
33+
<p style="margin: 0; text-align: justify;">Text (paragraph) text-align JUSTIFY - text should be placed in more than one line for justify visualization. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
34+
<span style="float:left; margin: 0; color: blue; border: solid; width: 100px; display: inline-block;">Float:left div width 100 px Test aaaaaa aaaaaaaaaaaa aaaaaaaaaaaaaa</span>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
35+
<span style="float:right; margin: 0; color: red; border: solid; width: 100px; display: inline-block;">Float:right div width 100 px Test aaaaaa aaaaaaaaaaaa aaaaaaaaaaaaaa</span>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
36+
<span style="float:none; margin: 0; color: purple; background-color: gray; border: solid; width: 100px; display: inline-block;">Float:none div width 100 px Test aaaaaa aaaaaaaaaaaa aaaaaaaaaaaaaa</span>Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
37+
</div>
38+
</body>
39+
</html>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<body>
4+
<p style="border: dashed 2px; text-align: right;">
5+
<span>Text begin</span>
6+
<span style="border: solid 2px; display: inline-block;">div text</span>
7+
<span>More text</span>
8+
<span style="border: green solid 2px; float: left; display: inline-block;">floating div text</span>
9+
</p>
10+
</body>
11+
</html>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<body>
4+
<p style="border: dashed 2px; text-align: justify; width: 500px">
5+
<span>Text begin</span>
6+
<span style="border: solid 2px; display: inline-block;">div text</span>
7+
<span style="border: green solid 2px; float: left; display: inline-block;">floating div text</span>
8+
<span>MoretextMoretextMoretext. MoretextMoretextMoretext. MoretextMoretextMoretext. MoretextMoretextMoretext. MoretextMoretextMoretext.</span>
9+
</p>
10+
</body>
11+
</html>

0 commit comments

Comments
 (0)