neoflyingsaucer icon indicating copy to clipboard operation
neoflyingsaucer copied to clipboard

Infinite loop bug (possibly when margins are too large for page).

Open danfickle opened this issue 9 years ago • 2 comments

Test case at: com.github.neoflyingsaucer.test.pdf.TestPage.testInfiniteLoopBugOnTooWideContent():

    @Test
    @Ignore("Failing (infinite loop somewhere in code)")
    public void testInfiniteLoopBugOnTooWideContent()
    {
        PdfTest pdf = new PdfTest("InfiniteLoopBugOnTooWideContent");

        String html =
            "<html><head><style>" +
            "@page { size: 30px; margin: 0; }" +
            "</style></head><body>" +
            "<ul><li>TEST</li></ul></body></html>";

        pdf.prepare(html);
        pdf.assertContains("/MediaBox");
    }

danfickle avatar Apr 11 '15 13:04 danfickle

Found the location of the endless loop at: com.github.neoflyingsaucer.layout.InlineBoxing.layoutContent(LayoutContext, BlockBox, int, int) inside the do loop.

danfickle avatar Aug 01 '15 13:08 danfickle

The fix is broken. The endless loop is solved but now it just discards words that are too long for the block. This is obviously not acceptable so I'll reopen this issue.

danfickle avatar Aug 10 '15 10:08 danfickle