c.setSubBlock(old_sub);
    public Box layout(Context c, Element elem) {        // this is to keep track of when we are inside of a form        if(elem.getNodeName().equals("form")) {            if(elem.hasAttribute("name")) {                String name = elem.getAttribute("name");                String action = elem.getAttribute("action");                c.setForm(name,action);            }        }        //u.p("BoxLayout.layout() : " + elem);        //u.p("box layout for: " + elem.getNodeName());        BlockBox block = (BlockBox)createBox(c,elem);        Rectangle oe = c.getExtents();        //u.p("old extents = " + c.getExtents());        c.setExtents(new Rectangle(oe));        adjustWidth(c, block);        adjustHeight(c, block);        block.x = c.getExtents().x;        block.y = c.getExtents().y;        prepareBox(block,c);        Border border = getBorder(c, block);        Border padding = getPadding(c, block);        Border margin = getMargin(c, block);        getBackgroundColor(c,block);        //u.p("margin on box block = " + block.margin);        //u.p("border on box block = " + block.border);        //u.p("padding on box block = " + block.padding);        // do children's layout        //u.p("avail space = " + block.width);        layoutChildren(c, block);        // calculate the inner width        block.width = margin.left + border.left + padding.left + block.width +                padding.right + border.right + margin.right;        block.height = margin.top + border.top + padding.top + block.height +                padding.bottom + border.bottom + margin.bottom;        //u.p("final width = " + block.width);        // if this is a fixed height, then set it explicitly        /*if (!block.auto_height) {            contents.height = block.height;        }        */        //u.p("old extents = " + c.getExtents());        //restore the extents        c.setExtents(oe);        // account for special positioning        setupRelative(c, block);        setupFixed(c, block);        this.contents_height = block.height;        if(elem.getNodeName().equals("form")) {            if(elem.hasAttribute("name")) {                c.setForm(null,null);            }        }        return block;    }