c.restoreStateForRelayout(relayoutData.getLayoutState());
    private static boolean relayoutOnNewPage(            LayoutContext c, List contentList, Box block,             StyleSetListener styleSetListener, RelayoutDataList relayoutDataList,             int start, int end) {        block.height = relayoutDataList.get(start).getInitialParentHeight();        block.expandToPageBottom(c);                int startAbsY = block.getAbsY() + block.ty + block.height;        int endAbsY = 0;                int offset = start - 1;        for (int i = start; i <= end; i++) {            Content currentContent = (Content)contentList.get(i);            offset++;                        RelayoutData relayoutData = relayoutDataList.get(i);            BlockBox childBox = null;            //TODO:handle run-ins. For now, treat them as blocks                        childBox = layoutBlockChild(                    c, block, styleSetListener, relayoutData.getListIndex(),                   relayoutData.isResetMargins(), false, currentContent);                        if (childBox.getStyle().isAvoidPageBreakInside() &&                     childBox.crossesPageBreak(c)) {                c.restoreStateForRelayout(relayoutData.getLayoutState());                BlockBox secondTry = layoutBlockChild(                        c, block, styleSetListener, relayoutData.getListIndex(),                        relayoutData.isResetMargins(), true, currentContent);                                if (secondTry.crossesPageBreak(c)) {                    secondTry.detach();                } else {                    childBox.detach();                    childBox = secondTry;                }            }                        c.getRootLayer().ensureHasPage(c, childBox);                        block.adjustWidthForChild(childBox.getWidth());            block.height = childBox.y + childBox.height;                        if ((i == end && end == contentList.size()-1) ||                    (i == end - 1)) {                endAbsY = childBox.getAbsY() + childBox.getHeight();            }                        if (childBox.getStyle().isForcePageBreakAfter()) {                block.expandToPageBottom(c);            }        }                return ! c.getRootLayer().crossesPageBreak(c, startAbsY, endAbsY);    }