block.getChild(runEnd).getAbsY() + childBox.getHeight())) { RelayoutResult result = relayoutOnNewPage(c, contentList, block,
block.getChild(runEnd).getAbsY() + childBox.getHeight()) && ! checkForPendingInlines(relayoutDataList, runStart, offset)) { block.detachChildren(runStart, offset); relayoutOnNewPage(c, contentList, block,
    private static void processPageBreakAvoidRun(final LayoutContext c, final BlockBox block,             List contentList, Boxing.StyleSetListener styleSetListener, int offset,             RelayoutDataList relayoutDataList, RelayoutData relayoutData,             BlockBox childBox) {        if (offset > 0) {            boolean mightNeedRelayout = false;            int runEnd = -1;            if (offset == contentList.size() - 1 && relayoutData.isEndsRun()) {                mightNeedRelayout = true;                runEnd = offset;            } else if (offset > 0){                RelayoutData previousRelayoutData = relayoutDataList.get(offset-1);                if (previousRelayoutData.isEndsRun()) {                    mightNeedRelayout = true;                    runEnd = offset - 1;                }            }            if (mightNeedRelayout) {                int heightBeforeRelayout = block.height;                int runStart = relayoutDataList.getRunStart(runEnd);                if (c.getRootLayer().crossesPageBreak(c,                         block.getChild(runStart).getAbsY(),                        block.getChild(runEnd).getAbsY() + childBox.getHeight())) {                    RelayoutResult result = relayoutOnNewPage(c, contentList, block,                             styleSetListener, relayoutDataList, runStart, offset);                    if (! result.isCanceled()) {                        if (result.isFits()) {                            block.detachChildren(runStart, offset);                        } else {                            block.detachChildren(offset+1, block.getChildCount()-1);                            block.height = heightBeforeRelayout;                        }                    }                }            }        }    }