Skip to content

Commit

Permalink
#364 Tests unsupported paginated table inside a footnote.
Browse files Browse the repository at this point in the history
Unsupported but does not cause infinite loop, OOM, etc.
  • Loading branch information
danfickle committed Aug 25, 2021
1 parent 228744a commit efa3310
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<html>
<head>
<style>
@page {
size: 300px 300px;
}
html {
orphans: 0;
widows: 0;
}
body {
font-size: 16px;
}
.footnote {
color: green;
float: footnote;
}
::footnote-call {
counter-increment: footnote;
content: " [fn " counter(footnote) "] ";
}
::footnote-marker {
content: "fn " counter(footnote) ". ";
}
thead td {
background: orange;
}
tfoot td {
background: aqua;
}
</style>
</head>
<body>
This is some in-flow content.

<div class="footnote">
This footnote has a paginated table inside.
<table style="-fs-table-paginate: paginate; border-collapse: collapse;">
<thead>
<tr><td>One</td></tr>
<tr><td>Two</td></tr>
</thead>
<tbody>
<tr><td>Three</td></tr>
<tr><td>Four</td></tr>
<tr><td>Five</td></tr>
</tbody>
<tfoot>
<tr><td>Six</td></tr>
</tfoot>
</table>
</div>

End of document.

<div class="footnote">
Normal footnote
</div>

</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,20 @@ public void testIssue364LinkToInFlowContent() throws IOException {
}
}

/**
* Tests bad footnote related content such as:
* + Paginated table inside footnotes.
* Primarily to check that these scenarios do not cause infinite loop
* or out-of-memory and ideally don't throw exceptions.
* Bad footnote content is not supported and will not produce expected results.
*/
@Test
public void testIssue364InvalidFootnoteContent() throws IOException {
try (PDDocument doc = run("issue-364-invalid-footnote-content")) {
remove("issue-364-invalid-footnote-content", doc);
}
}

/**
* Tests that link annotation area is correctly translated-y.
*/
Expand Down

0 comments on commit efa3310

Please sign in to comment.