Skip to content

Commit 989ded7

Browse files
JonPReillyiText-CI
authored andcommitted
Add some new min/max width test. Update cmps.
DEVSIX-1947 Autoported commit. Original commit hash: [a12c53da]
1 parent 26dc242 commit 989ded7

File tree

13 files changed

+80
-9
lines changed

13 files changed

+80
-9
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,14 @@ public virtual void DisplayTable05Test() {
112112
ConvertToPdfAndCompare("display_table05", sourceFolder, destinationFolder);
113113
}
114114

115+
/// <exception cref="System.IO.IOException"/>
116+
/// <exception cref="System.Exception"/>
117+
[NUnit.Framework.Test]
118+
[LogMessage(iText.IO.LogMessageConstant.TABLE_WIDTH_IS_MORE_THAN_EXPECTED_DUE_TO_MIN_WIDTH)]
119+
public virtual void DisplayTable05aTest() {
120+
ConvertToPdfAndCompare("display_table05a", sourceFolder, destinationFolder);
121+
}
122+
115123
/// <exception cref="System.IO.IOException"/>
116124
/// <exception cref="System.Exception"/>
117125
[NUnit.Framework.Test]

itext.tests/itext.html2pdf.tests/itext/html2pdf/css/w3c/css21/normal_flow/MinWidthAppliesTo005Test.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,8 @@ source product.
4242
*/
4343
using System;
4444
using iText.Html2pdf.Css.W3c;
45-
using iText.Test.Attributes;
4645

4746
namespace iText.Html2pdf.Css.W3c.Css21.Normal_flow {
48-
[LogMessage(iText.IO.LogMessageConstant.RECTANGLE_HAS_NEGATIVE_OR_ZERO_SIZES)]
4947
public class MinWidthAppliesTo005Test : W3CCssTest {
5048
protected internal override String GetHtmlFileName() {
5149
return "min-width-applies-to-005.xht";

itext.tests/itext.html2pdf.tests/itext/html2pdf/css/w3c/css21/normal_flow/MinWidthAppliesTo006Test.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,8 @@ source product.
4242
*/
4343
using System;
4444
using iText.Html2pdf.Css.W3c;
45-
using iText.Test.Attributes;
4645

4746
namespace iText.Html2pdf.Css.W3c.Css21.Normal_flow {
48-
[LogMessage(iText.IO.LogMessageConstant.RECTANGLE_HAS_NEGATIVE_OR_ZERO_SIZES)]
4947
public class MinWidthAppliesTo006Test : W3CCssTest {
5048
protected internal override String GetHtmlFileName() {
5149
return "min-width-applies-to-006.xht";

itext.tests/itext.html2pdf.tests/itext/html2pdf/css/w3c/css21/normal_flow/MinWidthAppliesTo007Test.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,9 @@ source product.
4242
*/
4343
using System;
4444
using iText.Html2pdf.Css.W3c;
45-
using iText.Test.Attributes;
4645

4746
namespace iText.Html2pdf.Css.W3c.Css21.Normal_flow {
48-
[LogMessage(iText.IO.LogMessageConstant.RECTANGLE_HAS_NEGATIVE_OR_ZERO_SIZES)]
4947
public class MinWidthAppliesTo007Test : W3CCssTest {
50-
// NOTE iText sets cellWidth on cell renderer after cell layout.
51-
// It causes applied min-width to be overwritten and thus results are wrong.
5248
protected internal override String GetHtmlFileName() {
5349
return "min-width-applies-to-007.xht";
5450
}

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,13 @@ public virtual void PlainTextTest() {
471471
RunConvertToElements("plainTextTest", false);
472472
}
473473

474+
/// <exception cref="System.IO.IOException"/>
475+
/// <exception cref="System.Exception"/>
476+
[NUnit.Framework.Test]
477+
public virtual void TableCellMinWidthRightAlignmentTest() {
478+
RunConvertToElements("tableCellMinWidthRightAlignmentTest", false);
479+
}
480+
474481
/// <exception cref="System.IO.IOException"/>
475482
/// <exception cref="System.Exception"/>
476483
private void RunTest(String testName) {
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<style>
5+
.table {
6+
display: table;
7+
max-width:100px;
8+
}
9+
.table-row {
10+
display: table-row;
11+
width: 400px; /* - */
12+
height: 400px; /* + */
13+
background-color: green; /* + */
14+
border: 20px solid yellow; /* - */
15+
}
16+
17+
.table-cell {
18+
display: table-cell;
19+
background-color: blue;
20+
border: 5px solid pink;
21+
max-width:50px;
22+
}
23+
</style>
24+
</head>
25+
<body>
26+
<table class="table">
27+
<tr class="table-row">
28+
<td>Ceaaaaaaaaaaaaaaddddddddddddddddll 1 1</td>
29+
<td class="table-cell">Cellaaaaaaaaaaaaaaaaa 1 2</td>
30+
<td>Cedddddddddddddddddddddll 1 1</td>
31+
</tr>
32+
</table>
33+
34+
</body>
35+
</html>

0 commit comments

Comments
 (0)