Skip to content

Commit 55565f1

Browse files
Evgeniy PrudnikoviText-CI
authored andcommitted
Fixed bullet drawing when changing direction
DEVSIX-6085
1 parent 8e45f84 commit 55565f1

26 files changed

+208
-32
lines changed

src/main/java/com/itextpdf/html2pdf/attach/impl/DefaultTagWorkerMapping.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ class DefaultTagWorkerMapping {
196196
workerMapping.putMapping(TagConstants.UL, CssConstants.INLINE, (lhs, rhs) -> new SpanTagWorker(lhs, rhs));
197197
workerMapping.putMapping(TagConstants.LI, CssConstants.INLINE, (lhs, rhs) -> new SpanTagWorker(lhs, rhs));
198198
workerMapping.putMapping(TagConstants.LI, CssConstants.INLINE_BLOCK, (lhs, rhs) -> new DivTagWorker(lhs, rhs));
199+
workerMapping.putMapping(TagConstants.LI, CssConstants.BLOCK, (lhs, rhs) -> new DivTagWorker(lhs, rhs));
199200
workerMapping.putMapping(TagConstants.DD, CssConstants.INLINE, (lhs, rhs) -> new SpanTagWorker(lhs, rhs));
200201
workerMapping.putMapping(TagConstants.DT, CssConstants.INLINE, (lhs, rhs) -> new SpanTagWorker(lhs, rhs));
201202

src/main/java/com/itextpdf/html2pdf/css/apply/impl/DefaultTagCssApplierMapping.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ class DefaultTagCssApplierMapping {
154154
mapping.putMapping(TagConstants.UL, CssConstants.INLINE, () -> new SpanTagCssApplier());
155155
mapping.putMapping(TagConstants.LI, CssConstants.INLINE, () -> new SpanTagCssApplier());
156156
mapping.putMapping(TagConstants.LI, CssConstants.INLINE_BLOCK, () -> new BlockCssApplier());
157+
mapping.putMapping(TagConstants.LI, CssConstants.BLOCK, () -> new BlockCssApplier());
157158
mapping.putMapping(TagConstants.DD, CssConstants.INLINE, () -> new SpanTagCssApplier());
158159
mapping.putMapping(TagConstants.DT, CssConstants.INLINE, () -> new SpanTagCssApplier());
159160

src/test/java/com/itextpdf/html2pdf/attribute/DirAttributeTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ public void differentDirsOfDlsTest() throws IOException, InterruptedException {
7474
}
7575

7676
@Test
77-
// TODO DEVSIX-5070 Process dots of ordered list items in the specified direction
7877
@LogMessages(messages = {
7978
@LogMessage(messageTemplate = IoLogMessageConstant.TYPOGRAPHY_NOT_FOUND, count = 18),
8079
})

src/test/java/com/itextpdf/html2pdf/element/ListItemTest.java

Lines changed: 57 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,65 @@ public void rtlListItemInsideLtrUnorderedListTest() throws IOException, Interrup
8181
destinationFolder, "diff01_"));
8282
}
8383

84+
@Test
85+
@LogMessages(messages = {@LogMessage(messageTemplate = IoLogMessageConstant.TYPOGRAPHY_NOT_FOUND, count = 12)})
86+
public void drawBulletRtlTest() throws IOException, InterruptedException {
87+
String name = "drawBulletRtl";
88+
HtmlConverter.convertToPdf(new File(sourceFolder + name + ".html"),
89+
new File(destinationFolder + name +".pdf"));
90+
Assert.assertNull(new CompareTool().compareByContent(destinationFolder + name + ".pdf",
91+
sourceFolder + "cmp_" + name + ".pdf",
92+
destinationFolder, "diff01_"));
93+
}
94+
8495
@Test
8596
@LogMessages(messages = {@LogMessage(messageTemplate = IoLogMessageConstant.TYPOGRAPHY_NOT_FOUND, count = 16)})
86-
public void differentListItemsInsideDifferentListsWithDifferentDirections() throws IOException, InterruptedException {
87-
String name = "differentListItemsInsideDifferentListsWithDifferentDirections";
88-
HtmlConverter.convertToPdf(new File(sourceFolder + name + ".html"),
97+
public void drawBulletLtrTest() throws IOException, InterruptedException {
98+
String name = "drawBulletLtr";
99+
HtmlConverter.convertToPdf(new File(sourceFolder + name + ".html"),
100+
new File(destinationFolder + name +".pdf"));
101+
Assert.assertNull(new CompareTool().compareByContent(destinationFolder + name + ".pdf",
102+
sourceFolder + "cmp_" + name + ".pdf",
103+
destinationFolder, "diff01_"));
104+
}
105+
106+
@Test
107+
@LogMessages(messages = {@LogMessage(messageTemplate = IoLogMessageConstant.TYPOGRAPHY_NOT_FOUND, count = 8)})
108+
public void bulletsAreNotDrawnAsTheyAreInPageMarginsTest() throws IOException, InterruptedException {
109+
String name = "bulletsAreNotDrawnAsTheyAreInPageMargins";
110+
HtmlConverter.convertToPdf(new File(sourceFolder + name + ".html"),
111+
new File(destinationFolder + name +".pdf"));
112+
Assert.assertNull(new CompareTool().compareByContent(destinationFolder + name + ".pdf",
113+
sourceFolder + "cmp_" + name + ".pdf",
114+
destinationFolder, "diff01_"));
115+
}
116+
117+
@Test
118+
@LogMessages(messages = {@LogMessage(messageTemplate = IoLogMessageConstant.TYPOGRAPHY_NOT_FOUND, count = 20)})
119+
public void rltListItemWithDifferentMarginsTest() throws IOException, InterruptedException {
120+
String name = "rltListItemWithDifferentMargins";
121+
HtmlConverter.convertToPdf(new File(sourceFolder + name + ".html"),
122+
new File(destinationFolder + name +".pdf"));
123+
Assert.assertNull(new CompareTool().compareByContent(destinationFolder + name + ".pdf",
124+
sourceFolder + "cmp_" + name + ".pdf",
125+
destinationFolder, "diff01_"));
126+
}
127+
128+
@Test
129+
@LogMessages(messages = {@LogMessage(messageTemplate = IoLogMessageConstant.TYPOGRAPHY_NOT_FOUND, count = 16)})
130+
public void diffListItemsInsideDiffListsWithDiffDirectionsWithoutWidthTest() throws IOException, InterruptedException {
131+
String name = "diffListItemsInsideDiffListsWithDiffDirectionsWithoutWidth";
132+
HtmlConverter.convertToPdf(new File(sourceFolder + name + ".html"),
133+
new File(destinationFolder + name +".pdf"));
134+
Assert.assertNull(new CompareTool().compareByContent(destinationFolder + name + ".pdf",
135+
sourceFolder + "cmp_" + name + ".pdf",
136+
destinationFolder, "diff01_"));
137+
}
138+
139+
@Test
140+
public void listItemWithBlockDisplayTest() throws IOException, InterruptedException {
141+
String name = "listItemWithBlockDisplay";
142+
HtmlConverter.convertToPdf(new File(sourceFolder + name + ".html"),
89143
new File(destinationFolder + name +".pdf"));
90144
Assert.assertNull(new CompareTool().compareByContent(destinationFolder + name + ".pdf",
91145
sourceFolder + "cmp_" + name + ".pdf",
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)