if (! block.getStyle().isFloated()) { throw new XRRuntimeException("Invalid call to generateFloatedBlock(); where float: none ");
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);
    public static FloatedBlockBox generateFloated(            LayoutContext c, FloatedBlockContent content, int avail,             LineBox curr_line, List pendingFloats) {        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());        block.y = curr_line.y + content.getMarginFromPrevious();        block.element = content.getElement();        Boxing.layout(c, block, content);        c.getBlockFormattingContext().floatBox(c, (FloatedBlockBox) block);                if (! block.getStyle().isFloated()) {            throw new XRRuntimeException("Invalid call to generateFloatedBlock(); where float: none ");        }                c.setCurrentMarkerData(markerData);            c.setExtents(oe);                if (pendingFloats.size() > 0 || block.getWidth() > avail) {            if (pendingFloats.size() > 0) {                block.y = 0;            }            pendingFloats.add(block);            c.getBlockFormattingContext().getFloatManager().removeFloat(block);            c.getLayer().removeFloat(block);            // FIXME Not yet, will also detach children.              // Should be laying out again though anyway.            /*            block.detach();            */            block.setPending(true);        }                return block;    }