c.getRootLayer().ensureHasPage(c, block);
    public static FloatLayoutResult generateFloated(            final LayoutContext c, FloatedBlockContent content, int avail,             LineBox curr_line, List pendingFloats) {        FloatLayoutResult result = new FloatLayoutResult();                Rectangle oe = c.getExtents();        c.setExtents(new Rectangle(oe));                MarkerData markerData = c.getCurrentMarkerData();        c.setCurrentMarkerData(null);            FloatedBlockBox block = new FloatedBlockBox();        block.setContainingBlock(curr_line.getParent());        block.setContainingLayer(curr_line.getContainingLayer());                if (pendingFloats != null) {            block.y = curr_line.y + content.getMarginFromPrevious();        } else {            block.y = curr_line.y + curr_line.height;        }                block.calcInitialCanvasLocation(c);                int initialY = block.y;                block.element = content.getElement();                Boxing.layout(c, block, content);        c.getBlockFormattingContext().floatBox(c, (FloatedBlockBox) block);        if (pendingFloats != null &&                 (pendingFloats.size() > 0 || block.getWidth() > avail)) {            block.detach();            result.setPending(true);            result.setPendingContent(content);        } else {            if (c.isPrint()) {                positionFloatOnPage(c, content, curr_line, block, initialY != block.y);            }            result.setBlock(block);        }                c.setCurrentMarkerData(markerData);            c.setExtents(oe);                return result;    }