Skip to content

Commit

Permalink
#79 - PDF/UA test (FAILING) for z-index layers.
Browse files Browse the repository at this point in the history
Having trouble with boxes that span two or more pages.
  • Loading branch information
danfickle committed Jan 18, 2019
1 parent 35bf7bd commit be71e17
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ private static void run(String testCase) throws Exception {
}

public static void main(String... args) throws Exception {
run("simple");
run("simplest");
run("simple");
run("layers-z-index");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<html>
<head>
<title>Simple PDF/UA Testcase</title>
<meta name="description" content="A simple example"/>
<style>
@page {
size: 200px 200px;
margin: 0;
}
body {
margin: 0;
width: 200px;
}
.abs {
position: absolute;
left: 0;
right: 0;
height: 70px;
}
</style>
</head>
<body style="font-family: 'TestFont'; font-size: 14px;">
<div style="position:relative;">
<div class="abs" style="z-index: 2; background-color: red; top: 0;">One</div>
<div class="abs" style="z-index: 3; background-color: purple; top: 60px;">Two</div>
<div class="abs" style="z-index: 1; background-color: blue; top: 120px;">Three</div>
<div class="abs" style="z-index: 4; background-color: green; top: 180px;">Four</div>
<div class="abs" style="z-index: 3; background-color: orange; top: 240px;">Five</div>
</div>
<div style="page-break-after: always;">PAGE</div>
<div style="min-height: 10px; background-color: pink;">PAGE</div>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ private String chooseTag(StructureItem item) {
BlockBox block = (BlockBox) item.box;

if (block.isFloated()) {
return StandardStructureTypes.NOTE;
return StandardStructureTypes.DIV;
} else if (block.isInline()) {
return StandardStructureTypes.SPAN;
} else if (block.getElement() != null && block.getElement().getNodeName().equals("p")) {
Expand Down Expand Up @@ -220,7 +220,9 @@ private StructureItem createStructureItem(StructureType type, Box box) {

ensureAncestorTree(child, box.getParent());
ensureParent(box, child);
} else if (child.box == null) {
}

if (child.box == null) {
child.box = box;
}

Expand Down

0 comments on commit be71e17

Please sign in to comment.