} else { int delta = c.getBlockFormattingContext().getFloatManager().getClearDelta( c, (int) border.top() + (int) padding.top() + cell.height); if (delta > 0) { cell.height += delta; }
    private static CellBox layoutCell(LayoutContext c, CellBox cell, Content content, boolean fixed, TableBox table, int col) {        //OK, first set up the current style. All depends on this...        CascadedStyle pushed = content.getStyle();        if (pushed != null) {            c.pushStyle(pushed);        }        if (c.getCurrentStyle().isIdent(CSSName.BACKGROUND_ATTACHMENT, IdentValue.FIXED)) {            c.getRootLayer().setFixedBackground(true);        }        // a cell defines a new bfc        cell.setStyle(new Style(c.getCurrentStyle(), (float) c.getExtents().width));        BlockFormattingContext bfc = new BlockFormattingContext(cell, c);        c.pushBFC(bfc);        // copy the extents        Rectangle oe = c.getExtents();        c.setExtents(new Rectangle(oe));        cell.colspan = (int) c.getCurrentStyle().asFloat(CSSName.FS_COLSPAN);        cell.rowspan = (int) c.getCurrentStyle().asFloat(CSSName.FS_ROWSPAN);        if (fixed) {            int width = 0;            for (int i = 0; i < cell.colspan; i++) width += table.columns[col + i];            c.getExtents().width = width;        }        CalculatedStyle style = c.getCurrentStyle();        BorderPropertySet border = c.getCurrentStyle().getBorder(c);        RectPropertySet padding = c.getCurrentStyle().getPaddingRect((float) oe.getWidth(), (float) oe.getWidth(), c);        // calculate the width and height as much as possible        int setHeight = -1;//means height is not set by css        int setWidth = -1;//means width is not set by css        if (!cell.getStyle().isAutoWidth()) {            setWidth = (int) style.getFloatPropertyProportionalWidth(CSSName.WIDTH, c.getExtents().width, c);            c.getExtents().width = setWidth;            cell.contentWidth = (int) (setWidth - border.left() - padding.left() - padding.right() - border.right());        }        if (!cell.getStyle().isAutoHeight()) {            setHeight = (int) style.getFloatPropertyProportionalHeight(CSSName.HEIGHT, c.getExtents().height, c);            c.getExtents().height = setHeight;            cell.height = setHeight;        }        //check if replaced        JComponent cc = c.getNamespaceHandler().getCustomComponent(content.getElement(), c.getUac(), setWidth, setHeight);        if (cc != null) {            Rectangle bounds = cc.getBounds();            //cell.x = bounds.x;            //cell.y = bounds.y;            cell.contentWidth = bounds.width;            cell.height = bounds.height;            cell.component = cc;        }        // save height incase fixed height        int original_height = cell.height;        // do children's layout        boolean old_sub = c.isSubBlock();        c.setSubBlock(false);        cell.leftPadding = (int) border.left() + (int) padding.left();        cell.rightPadding = (int) padding.right() + (int) border.right();        int tx = (int) border.left() + (int) padding.left();        int ty = (int) border.top() + (int) padding.top();        cell.tx = tx;        cell.ty = ty;        c.translate(tx, ty);        c.shrinkExtents(tx + (int) border.right() + (int) padding.right(), ty + (int) border.bottom() + (int) padding.bottom());        if (cell.component == null)            Boxing.layoutChildren(c, cell, content);        else {            Point origin = c.getOriginOffset();            cell.component.setLocation((int) origin.getX(), (int) origin.getY());            if (c.isInteractive()) {                c.getCanvas().add(cell.component);            }        }        c.unshrinkExtents();        c.translate(-tx, -ty);        c.setSubBlock(old_sub);        // restore height incase fixed height        if (!cell.getStyle().isAutoHeight()) {            // Uu.p("restoring original height");            cell.height = original_height;        }        cell.height = (int) border.top() + (int) padding.top() + cell.height + (int) padding.bottom() + (int) border.bottom();        //restore the extents        c.setExtents(oe);        // remove the bfc        c.popBFC();        //and now, back to previous style        if (pushed != null) {            c.popStyle();        }        // Uu.p("BoxLayout: finished with cell: " + cell);        cell.setState(Box.DONE);        return cell;    }