Skip to content

Commit 7b296a9

Browse files
committed
Fix that flex with keep together property can lead to infinite loop on page split
DEVSIX-9342
1 parent 0d1af22 commit 7b296a9

File tree

4 files changed

+31
-1
lines changed

4 files changed

+31
-1
lines changed

src/test/java/com/itextpdf/html2pdf/css/flex/DisplayFlexTest.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,11 +666,17 @@ public void displayFlexOnHeaderTagTest() throws IOException, InterruptedExceptio
666666
}
667667

668668
@Test
669-
@Disabled("TODO DEVSIX-9342 Flex: keep together property can lead to infinite loop on page split")
669+
@LogMessages(messages = {@LogMessage(messageTemplate = LayoutLogMessageConstant.ELEMENT_DOES_NOT_FIT_AREA)})
670670
public void flexWithPageBreakInsideAvoidAndPageSplitTest() throws IOException, InterruptedException {
671671
convertToPdfAndCompare("flexWithPageBreakInsideAvoidAndPageSplit", SOURCE_FOLDER, DESTINATION_FOLDER);
672672
}
673673

674+
@Test
675+
@LogMessages(messages = {@LogMessage(messageTemplate = LayoutLogMessageConstant.ELEMENT_DOES_NOT_FIT_AREA)})
676+
public void flexWithPageBreakInsideAvoidAndPageSplit2Test() throws IOException, InterruptedException {
677+
convertToPdfAndCompare("flexWithPageBreakInsideAvoidAndPageSplit2", SOURCE_FOLDER, DESTINATION_FOLDER);
678+
}
679+
674680
private static List<IElement> convertToElements(String name) throws IOException {
675681
String sourceHtml = SOURCE_FOLDER + name + ".html";
676682
ConverterProperties converterProperties = new ConverterProperties().setBaseUri(SOURCE_FOLDER);
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<html>
2+
<body>
3+
<div style='display: flex; page-break-inside: avoid; font-size:30px'>
4+
<div>
5+
123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
6+
123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
7+
123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
8+
123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
9+
123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
10+
123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
11+
123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
12+
</div>
13+
<div>
14+
123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
15+
123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
16+
123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
17+
123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
18+
123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
19+
123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
20+
123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
21+
</div>
22+
</div>
23+
</body>
24+
</html>

0 commit comments

Comments
 (0)