Skip to content

Commit

Permalink
#180 - FIX for inline-blocks sitting on overflow pages.
Browse files Browse the repository at this point in the history
  • Loading branch information
danfickle committed Jan 9, 2019
1 parent 013dde8 commit 44b7fee
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -328,14 +328,19 @@ public static Map<TableCellBox, List<CollapsedBorderSide>> collectCollapsedTable
}
}

public DisplayListPageContainer collectInlineBlock(RenderingContext c, BlockBox bb, EnumSet<CollectFlags> noneOf) {
public DisplayListPageContainer collectInlineBlock(RenderingContext c, BlockBox bb, EnumSet<CollectFlags> noneOf, int shadowPageNo) {
DisplayListPageContainer pgInstructions = new DisplayListPageContainer(null);
PagedBoxCollector boxCollector = createBoundedBoxCollector(c.getPageNo(), c.getPageNo());
boxCollector.collect(c, bb.getContainingLayer(), bb, c.getPageNo(), c.getPageNo(), PagedBoxCollector.PAGE_BASE_ONLY);
boxCollector.collect(c, bb.getContainingLayer(), bb, c.getPageNo(), c.getPageNo(), shadowPageNo);

PageResult pgResult = boxCollector.getPageResult(c.getPageNo());
processPage(c, bb.getContainingLayer(), pgResult, pgInstructions, /* includeFloats: */ false, c.getPageNo(), /* shadow page number: */ -1);

if (shadowPageNo >= 0 && pgResult.hasShadowPage(shadowPageNo)) {
processPage(c, bb.getContainingLayer(), pgResult.shadowPages().get(shadowPageNo), pgInstructions, /* includeFloats: */ false, c.getPageNo(), shadowPageNo);
} else if (shadowPageNo < 0) {
processPage(c, bb.getContainingLayer(), pgResult, pgInstructions, /* includeFloats: */ false, c.getPageNo(), shadowPageNo);
}

return pgInstructions;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ private void paintInlineContent(RenderingContext c, List<DisplayListItem> inline
BlockBox bb = (BlockBox) dli;
List<PageBox> pageBoxes = bb.getContainingLayer().getPages();
DisplayListCollector dlCollector = new DisplayListCollector(pageBoxes);
DisplayListPageContainer pageInstructions = dlCollector.collectInlineBlock(c, bb, EnumSet.noneOf(CollectFlags.class));
DisplayListPageContainer pageInstructions = dlCollector.collectInlineBlock(c, bb, EnumSet.noneOf(CollectFlags.class), c.getShadowPageNumber());

paint(c, pageInstructions);
} else {
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
}
body {
margin: 0;
width: 120px;
}
div {
box-sizing: border-box;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ public void testHorizPageOverflowInlineBlock() throws IOException {
* Tests that a static inline-block sitting entirely on an overflow page appears.
*/
@Test
@Ignore // The inline block and its text does not appear on the overflow page.
public void testHorizPageOverflowInlineBlock2() throws IOException {
assertTrue(run("horiz-page-overflow-inline-block-2"));
}
Expand Down

0 comments on commit 44b7fee

Please sign in to comment.