public static InlineBox generateReplacedInlineBox(Context c, Content content, int avail, InlineBox prev_align, LineBox curr_line, int parent_width, InlineBlockBox pendingBlockBox) {
public static InlineBox generateReplacedInlineBox(Context c, Content content, int avail, InlineBox prev_align, LineBox curr_line, InlineBlockBox pendingBlockBox) {
    public static InlineBox generateReplacedInlineBox(Context c, Content content, int avail, InlineBox prev_align, LineBox curr_line, int parent_width, InlineBlockBox pendingBlockBox) {        InlineBlockBox box = new InlineBlockBox();        box.element = content.getElement();        // use the prev_align to calculate the x        if (prev_align != null && !prev_align.break_after) {            box.x = prev_align.x + prev_align.width;        } else {            box.x = 0;        }        box.y = 0;// it's relative to the line        //can't do VerticalAlign here, it depends on the layout of the element tree        c.translate(box.x + curr_line.x, box.y + curr_line.y);        BlockBox block;        if (pendingBlockBox != null)            block = pendingBlockBox.sub_block;        else            block = (BlockBox) Boxing.layout(c, content);        box.sub_block = block;        block.setParent(box);        // set up the extents        box.width = block.width;        //box.height = margin.top + border.top + padding.top + bounds.height + padding.bottom + border.bottom + margin.bottom;        box.height = block.height;        box.break_after = false;        // if it won't fit on this line, then put it on the next one        // the box will be discarded and recalculated        if (box.width > avail && prev_align != null && !prev_align.break_after) {            box.break_before = true;            box.x = 0;        }        /*if (block.component != null && !box.break_before) {//It will be discarded if break_before is true!            Point origin = c.getOriginOffset();            block.component.setLocation((int) origin.getX(), (int) origin.getY());            //c.getCanvas().add(block.component);        }*/        c.untranslateInsets(box);        c.translate(-box.x - curr_line.x, -box.y - curr_line.y);        return box;    }