danfickle/neoflyingsaucer

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

danfickle opened this issue · 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");
    }

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

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.