Skip to content

Commit 9d51b26

Browse files
committed
Add a test on table splitup issue with broken renderers tree
DEVSIX-8826
1 parent caba3ba commit 9d51b26

File tree

3 files changed

+220
-0
lines changed

3 files changed

+220
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,16 @@ public void emptyRowEliminationTest2() throws IOException, InterruptedException
636636
runTest("emptyRowElimination2");
637637
}
638638

639+
@Test
640+
@LogMessages(messages = {
641+
@LogMessage(messageTemplate = IoLogMessageConstant.TABLE_WIDTH_IS_MORE_THAN_EXPECTED_DUE_TO_MIN_WIDTH,
642+
count = 2),
643+
@LogMessage(messageTemplate = Html2PdfLogMessageConstant.ELEMENT_DOES_NOT_FIT_CURRENT_AREA)
644+
})
645+
public void breakRendererTreeOnSplitupTest() throws IOException, InterruptedException {
646+
runTest("breakRendererTreeOnSplitup");
647+
}
648+
639649
private void runTest(String testName) throws IOException, InterruptedException {
640650
runTest(testName, false);
641651
}
Lines changed: 210 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,210 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<style type="text/css">
5+
body { border-width: thin;} td { overflow-wrap: break-word; } table { margin-left: auto; margin-right: auto; } .tg { table-layout: fixed; border-collapse:collapse;border-spacing:0; width: 700px; max-width: 700px; } .tg td{ border-color:black; border-style:solid; font-family:Arial, sans-serif; font-size:12px; overflow:hidden; padding:5px 5px; word-break:normal; } .tg th{ border-color:black; border-style:solid;border-width:1px; font-family:Arial, sans-serif;font-size:13px; font-weight:normal;overflow:hidden;padding:10px 5px;word-break:normal; } .tg .tg-1wig{font-weight:bold; text-align:left; height: 17px; vertical-align:top; min-width: 150px; max-width: 150px; width: 150px;} .tg .tg-0lax{text-align:left;vertical-align:top;} tr.emptyRow { border-right-style:hidden; border-left-style:hidden; border-color: black white black white; } tr.emptyRow td {font-size: 2px; padding:0px; margin:0px; } .tg-0lax.colspan { max-width: 600px; } .tg2 {border-collapse: collapse; margin-bottom: 6px; width: 660px; max-width: 660px;} td.emailType {height: 15px; font-size: 10px; margin:0px; padding:0 0 0 5px;} td.tg-1wig-2 {width: 20px; font-weight: bold; height: 15px; } td.tg-0lax-2 {text-align:left;vertical-align:top; width: 80px; max-width: 80px;} .fieldCell {width: 50px;} .fieldValueCell { } .emailBodyContainer { width:570px; display: inline-block; overflow-wrap: break-word; }
6+
</style>
7+
</head>
8+
9+
<body>
10+
<table class="tg">
11+
<tbody>
12+
<tr>
13+
<td class="tg-1wig" colspan="4">
14+
<div class="emailBodyContainer">
15+
<div class="header">
16+
<table class="tg2">
17+
<tbody>
18+
<tr>
19+
<td class="emailType" colspan="4">Email received</td>
20+
</tr>
21+
<tr>
22+
<td class="fieldCell">From</td>
23+
<td class="fieldValueCell">example@example.com</td>
24+
<td class="fieldCell">Timestamp</td>
25+
<td class="fieldValueCell">09/30/2024 10:49:39 AM</td>
26+
</tr>
27+
<tr>
28+
<td class="fieldCell">To</td>
29+
<td class="fieldValueCell">example@example.com</td>
30+
<td class="fieldCell">CC</td>
31+
<td class="fieldValueCell"></td>
32+
</tr>
33+
<tr>
34+
<td class="fieldCell">Subject</td>
35+
<td colspan="3">FW: Email Subject</td>
36+
</tr>
37+
</tbody>
38+
</table>
39+
</div>
40+
<div class="contents" style="border: 0px solid black; padding: 0 2px 0px 5px; margin-bottom: 20px;">
41+
<div>
42+
43+
<style type="text/css">
44+
<!--#outlook a {padding:0}a {white-space:nowrap; color:#2D7Ae8!important; text-decoration:none; background-color:transparent; text-align:left; vertical-align:top}p, h1, h2, h3, h4 {font-family:"Inter",-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif; color:#222}p {font-size:0.8rem; line-height:1.45; margin:0 auto}h1, h2, h3, h4 {font-weight:200; margin:1.414em 0 0.5em; color:#222}h1 {font-size:1.728rem}h2 {font-size:1.44rem}h3 {font-size:1.22rem; font-weight:300}h4 {font-size:1rem; font-weight:700}div.status_item {display:flex; flex-direction:row}h3.status_value {margin:0; padding:0}h4.status_header {text-transform:uppercase; font-size:0.68rem; letter-spacing:0.025rem; padding-top:0; padding-bottom:0.1rem; padding-right:0.05rem; color:#828285}.status_good {color:#67B346}.status_alerting {color:#F2A200}.status_bad {color:#E64D2E}.headerlabel {text-align:left; vertical-align:top; color:#828285; display:block; text-transform:uppercase; font-size:0.68rem; letter-spacing:0.025rem; padding-bottom:0.1rem; padding-right:0.05rem}.headercontents {font-size:1rem}.headerspacer {width:2rem}#meraki-email-body {border-top:4px solid #78be20}.tablesection {width:60em; border-bottom:0.05rem solid #dddddd; background-color:#FFFFFF; padding:1.5rem 0}body {width:100%!important; margin:0; padding:0}.ReadMsgBody {width:100%}.ExternalClass {width:100%}.backgroundTable {margin:0 auto; padding:0; width:100%!important}table td {border-collapse:collapse}.ExternalClass * {line-height:115%}-->
45+
</style>
46+
47+
<div style="padding:0; margin:0; font-size:0.8125rem; font-family:Helvetica,Arial,sans-serif; color:#666666; background-color:#F7F7F7"><strong><div><font face="Tahoma" color="#000000" size="2">&nbsp;</font></div></strong>
48+
<hr tabindex="-1" style="display:inline-block; width:98%"><font face="Tahoma" size="2">Long text</font>
49+
<br>
50+
<div></div>
51+
<table border="0" class="shrinkbody" cellpadding="0" width="100%" style="margin:1em 0; padding:0; border-spacing:0">
52+
<tbody>
53+
<tr>
54+
<td align="center" valign="top">
55+
<table id="meraki-email-body" class="100p tablesection">
56+
<tbody>
57+
<tr>
58+
<td align="left" class="100p" valign="top" style="padding:0 2rem">
59+
<table id="meraki-email-header" class="100p" border="0" cellpadding="0">
60+
<tbody>
61+
<tr>
62+
<td class="100col2rows">
63+
<table border="0" class="100p" cellpadding="0">
64+
<tbody>
65+
<tr>
66+
<td id="meraki-email-organization-label" class="headerlabel">Organization </td>
67+
</tr>
68+
<tr>
69+
<td id="meraki-email-organization-value" class="headercontents"><div>Org</div></td>
70+
</tr>
71+
</tbody>
72+
</table>
73+
</td>
74+
<td class="100col2rows headerspacer"></td>
75+
<td class="100col2rows">
76+
<table border="0" class="100p" cellpadding="0">
77+
<tbody>
78+
<tr>
79+
<td id="meraki-email-network-label" class="headerlabel">Network </td>
80+
</tr>
81+
<tr>
82+
<td id="meraki-email-network-value" class="headercontents"><div>Net</div></td>
83+
</tr>
84+
</tbody>
85+
</table>
86+
</td>
87+
<td class="100col2rows headerspacer"></td>
88+
<td class="100col2rows">
89+
<table border="0" class="100p" cellpadding="0">
90+
<tbody>
91+
<tr>
92+
<td id="meraki-email-detected-label" class="headerlabel">Detected </td>
93+
</tr>
94+
<tr>
95+
<td id="meraki-email-detected-value" class="headercontents">Aug 10 15:31 </td>
96+
</tr>
97+
</tbody>
98+
</table>
99+
</td>
100+
<td class="100col2rows headerspacer"></td>
101+
<td class="100col2rows">
102+
<table border="0" class="100p" cellpadding="0">
103+
<tbody>
104+
<tr>
105+
<td id="meraki-email-monitoring-window-label" class="headerlabel">Monitoring&nbsp;Window</td>
106+
</tr>
107+
<tr>
108+
<td id="meraki-email-monitoring-window-value" class="headercontents">5 minutes </td>
109+
</tr>
110+
</tbody>
111+
</table>
112+
</td>
113+
</tr>
114+
</tbody>
115+
</table>
116+
</td>
117+
</tr>
118+
</tbody>
119+
</table>
120+
<table class="100p tablesection">
121+
<tbody>
122+
<tr>
123+
<td align="left" class="100p" valign="top" style="padding:0 2rem">
124+
<table class="100p" border="0" cellpadding="0">
125+
<tbody>
126+
<tr>
127+
<td valign="top" align="left">
128+
<h3>Possible root cause</h3>
129+
<p>Authentication failures above threshold</p>
130+
<h3>Recommended next steps</h3>
131+
<p>Check that credentials on client devices align with the network configuration.</p>
132+
<p>If using 802.1X authentication, check the specific AP and authentication server configuration and logs for more details.</p>
133+
<p><div>Click here for more supporting documentation</div></p>
134+
<h3>Connection status</h3>
135+
<div class="status_item">
136+
<h3 class="status_value status_good"></h3>
137+
<h3 class="status_value">&nbsp;0% Association</h3></div>
138+
<div class="status_item">
139+
<h3 class="status_value status_bad"></h3>
140+
<h3 class="status_value">&nbsp;85% Authentication</h3></div>
141+
<div class="status_item">
142+
<h3 class="status_value status_bad"></h3>
143+
<h3 class="status_value">&nbsp;100% DHCP</h3></div>
144+
<div class="status_item">
145+
<h3 class="status_value status_good"></h3>
146+
<h3 class="status_value">&nbsp;0% DNS</h3></div>
147+
<h3>Top 5 access points affected</h3>
148+
<p>AP1</p>
149+
<p>AP2</p>
150+
<p>AP3</p>
151+
<p>AP4</p>
152+
<p>AP5</p>
153+
</td>
154+
</tr>
155+
</tbody>
156+
</table>
157+
</td>
158+
</tr>
159+
</tbody>
160+
</table>
161+
<table class="100p tablesection">
162+
<tbody>
163+
<tr>
164+
<td align="left" valign="top">
165+
<table class="100p" border="0" cellpadding="0" style="padding:0 2rem">
166+
<tbody>
167+
<tr>
168+
<td id="meraki-email-alert-help-feedback"
169+
valign="top" align="left" style="color:#69696B">Was this alert helpful?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<div>Yes</div>&nbsp;&nbsp;&nbsp;
170+
<div>No</div>
171+
</td>
172+
</tr>
173+
<tr>
174+
<td valign="top" align="left" colspan="2" style="height:1em"></td>
175+
</tr>
176+
<tr>
177+
<td id="meraki-email-alert-help-useful"
178+
valign="top" align="left" style="color:#69696B">Didn't find this alert useful? Change your alert settings on the <div>Network wide alerts page</div>.
179+
</td>
180+
</tr>
181+
<tr>
182+
<td valign="top" align="left" colspan="2" style="height:1em"></td>
183+
</tr>
184+
<tr>
185+
<td id="meraki-email-alert-help-support"
186+
valign="top" align="left" style="color:#69696b">Having trouble? We can help! <div>Contact support</div>. </td>
187+
</tr>
188+
</tbody>
189+
</table>
190+
</td>
191+
</tr>
192+
</tbody>
193+
</table>
194+
</td>
195+
</tr>
196+
</tbody>
197+
</table>
198+
</div>
199+
</div>
200+
</div>
201+
</div>
202+
</div>
203+
</div>
204+
</td>
205+
</tr>
206+
</tbody>
207+
</table>
208+
<hr>
209+
</body>
210+
</html>

0 commit comments

Comments
 (0)