Skip to content

Commit

Permalink
#336 - A better fix for #328 that allows broken replaced elements.
Browse files Browse the repository at this point in the history
Such as images.
  • Loading branch information
danfickle committed Mar 17, 2019
1 parent fef8e73 commit fb2b800
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public static BlockBox createRootBox(LayoutContext c, Document document) {

public static void createChildren(LayoutContext c, BlockBox parent) {
if (parent.shouldBeReplaced()) {
parent.setChildrenContentType(BlockBox.CONTENT_INLINE);
parent.setChildrenContentType(BlockBox.CONTENT_EMPTY);
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2186,8 +2186,9 @@ public boolean isContainsInlineContent(LayoutContext c) {
public boolean checkPageContext(LayoutContext c) {
if (! getStyle().isIdent(CSSName.PAGE, IdentValue.AUTO)) {
String pageName = getStyle().getStringProperty(CSSName.PAGE);
if ( (! pageName.equals(c.getPageName())) && isInDocumentFlow() &&
isContainsInlineContent(c)) {
if (!pageName.equals(c.getPageName()) &&
isInDocumentFlow() &&
(shouldBeReplaced() || isContainsInlineContent(c))) {
c.setPendingPageName(pageName);
return true;
}
Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,6 @@ public void testSvgInWrapperWithNamedPage() throws IOException {
* than crashing with a NPE. See issue 336.
*/
@Test
@Ignore
public void testBrokenImgInTableCell() throws IOException {
assertTrue(vt.runTest("broken-img-in-table-cell"));
}
Expand All @@ -715,7 +714,6 @@ public void testBrokenImgInTableCell() throws IOException {
* does not crash. See issue 336.
*/
@Test
@Ignore
public void testBrokenImgInInlineBlock() throws IOException {
assertTrue(vt.runTest("broken-img-in-inline-block"));
}
Expand Down

0 comments on commit fb2b800

Please sign in to comment.