Skip to content

Commit 1202d4a

Browse files
introfogiText-CI
authored andcommitted
Fix layout table min width calculation in case of predefined width
DEVSIX-9301 Autoported commit. Original commit hash: [90a7d9100]
1 parent 669bd4b commit 1202d4a

File tree

10 files changed

+48
-2
lines changed

10 files changed

+48
-2
lines changed

itext.tests/itext.html2pdf.tests/itext/html2pdf/css/DisplayTest.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ public virtual void DisplayTable05aTest() {
9191
}
9292

9393
[NUnit.Framework.Test]
94+
[LogMessage(iText.IO.Logs.IoLogMessageConstant.TABLE_WIDTH_IS_MORE_THAN_EXPECTED_DUE_TO_MIN_WIDTH)]
9495
public virtual void DisplayTable06Test() {
9596
ConvertToPdfAndCompare("display_table06", SOURCE_FOLDER, DESTINATION_FOLDER);
9697
}

itext.tests/itext.html2pdf.tests/itext/html2pdf/element/TableTest.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,13 @@ public virtual void BreakRendererTreeOnSplitupTest() {
620620
RunTest("breakRendererTreeOnSplitup");
621621
}
622622

623+
[NUnit.Framework.Test]
624+
[LogMessage(iText.IO.Logs.IoLogMessageConstant.TABLE_WIDTH_IS_MORE_THAN_EXPECTED_DUE_TO_MIN_WIDTH, Count =
625+
2)]
626+
public virtual void NestedTableWithSpecifiedWidthTest() {
627+
RunTest("nestedTableWithSpecifiedWidth");
628+
}
629+
623630
private void RunTest(String testName) {
624631
RunTest(testName, false);
625632
}
Binary file not shown.

itext.tests/itext.html2pdf.tests/resources/itext/html2pdf/css/grid/GridTemplateNestedTest/grid-nested-3-levels-tables.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
border-collapse: collapse;
5757
border-spacing: 0;
5858
background-color: darkcyan;
59-
width: 245px;
59+
width: 255px;
6060
border-radius: 10px;
6161
margin: 10px;
6262
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<html xmlns="http://www.w3.org/1999/xhtml">
2+
3+
<body>
4+
<table>
5+
<tr>
6+
<td style="border:solid gray 2px;" >
7+
<table width="563" height="70" >
8+
<tr>
9+
<td>
10+
<p style="border:solid green 2px;">Hello</p>
11+
</td>
12+
</tr>
13+
</table>
14+
</td>
15+
<td style="border:solid yellow 2px;">
16+
<img src="100x100placeholder.png" height="10" width="542"/>
17+
</td>
18+
</tr>
19+
</table>
20+
<p>Parent table with width</p>
21+
<table width="700">
22+
<tr>
23+
<td style="border:solid gray 2px;" >
24+
<table width="563" height="70" >
25+
<tr>
26+
<td>
27+
<p style="border:solid green 2px;">Hello</p>
28+
</td>
29+
</tr>
30+
</table>
31+
</td>
32+
<td style="border:solid yellow 2px;">
33+
<img src="100x100placeholder.png" height="10" width="542"/>
34+
</td>
35+
</tr>
36+
</table>
37+
</body>
38+
</html>

port-hash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
c079562e55cef4fcbb662baa0a3f932ea3598a2d
1+
90a7d91007f0d42d050b77c20c8872077ccee27e

0 commit comments

Comments
 (0)