if (child_box.clear_left || child_box.clear_right) {
if (child_box.getStyle().isCleared()) {
    public static void layoutContent(Context c, Box box, List contentList, Box block) {        // prepare for the list items        int old_counter = c.getListCounter();        c.setListCounter(0);        Iterator contentIterator = contentList.iterator();        while (contentIterator.hasNext()) {            Object o = contentIterator.next();            if (o instanceof FirstLineStyle) {//can actually only be the first object in list                block.firstLineStyle = ((FirstLineStyle) o).getStyle();                //put it into the Context so it gets used on the first line                c.addFirstLineStyle(block.firstLineStyle);                continue;            }            if (o instanceof FirstLetterStyle) {//can actually only be the first or second object in list                block.firstLetterStyle = ((FirstLetterStyle) o).getStyle();                continue;            }            Content currentContent = (Content) o;            Box child_box = null;            //TODO:handle run-ins. For now, treat them as blocks            // update the counter for printing OL list items            //TODO:handle counters correctly            c.setListCounter(c.getListCounter() + 1);            // execute the layout and get the return bounds            //c.parent_box = box;            //c.placement_point = new Point(0, box.height);            c.translate(0, box.height);            //child_box = Boxing.layout(c, currentContent);            child_box = Boxing.preLayout(c, currentContent);            //Uu.p("did pre layout on : " + child_box);            //Uu.p("adding the child: " + child_box);            child_box.list_count = c.getListCounter();            // set the child_box location            child_box.x = 0;            double initialY = box.height;            child_box.y = (int) initialY;                        //Uu.p("set child box y to: " + child_box);            box.addChild(child_box);            Boxing.realLayout(c, child_box, currentContent);            box.propagateChildProperties(child_box);            c.translate(0, -box.height);            //JMM. new code to handle the 'clear' property            // if clear set            if (child_box.clear_left || child_box.clear_right) {//Uu.p("doing a clear on: " + child_box);                // get the distance we have to move it down                int down = 0;                //Uu.p("down = " + down);                if (child_box.clear_left) {                    //Uu.p("left clear");                    //Uu.p("left down = " + c.getPersistentBFC().getLeftDownDistance(child_box));                    down = Math.max(down, c.getBlockFormattingContext().getLeftDownDistance(child_box));                }                //Uu.p("down = " + down);                if (child_box.clear_right) {                    //Uu.p("right clear");                    //Uu.p("right down = " + c.getPersistentBFC().getRightDownDistance(child_box));                    down = Math.max(down, c.getBlockFormattingContext().getRightDownDistance(child_box));                }                //Uu.p("down = " + down);                int diff = down - child_box.y;                //Uu.p("child box.y = " + child_box.y);                //Uu.p("diff = " + diff);                if (diff > 0) {                    // move child box down                    child_box.y = down;                    // adjust parent box                    box.height += diff;                }            }            //joshy fix the 'fixed' stuff later            // if fixed or abs then don't modify the final layout bounds            // because fixed elements are removed from normal flow            if (child_box.fixed) {                // put fixed positioning in later                Fixed.positionFixedChild(c, child_box);            }            if (child_box.absolute) {                Absolute.positionAbsoluteChild(c, child_box);            }            // skip adjusting the parent box if the child            // doesn't affect flow layout            if (LayoutUtil.isOutsideNormalFlow(child_box)) {                continue;            }            // increase the final layout width if the child was greater            box.adjustWidthForChild(child_box.getWidth());            c.addMaxWidth(box.getWidth());            // increase the final layout height by the height of the child            box.height += (child_box.y - initialY) + child_box.height;            c.addMaxHeight(box.height + box.y + (int) c.getOriginOffset().getY());            if (c.shouldStop()) {                System.out.println("doing a quick stop");                break;            }            //Uu.p("alerting that there is a box available");            Dimension max_size = new Dimension(c.getMaxWidth(), c.getMaxHeight());            if (c.isInteractive() && !c.isPrint()) {                if (Configuration.isTrue("xr.incremental.enabled", false) && c.isRenderQueueAvailable()) {                    c.getRenderQueue().dispatchRepaintEvent(new ReflowEvent(ReflowEvent.MORE_BOXES_AVAILABLE, box, max_size));                }                int delay = Configuration.valueAsInt("xr.incremental.debug.layoutdelay", 0);                if (delay > 0) {                    //Uu.p("sleeping for: " + delay);                    try {                        Uu.sleep(delay);                    } catch (Exception ex) {                        Uu.p("sleep was interrupted in BlockBoxing.layoutContent()!");                    }                }            }        }        c.addMaxWidth(box.getWidth());        c.setListCounter(old_counter);        if (block.firstLineStyle != null) {            //pop it in case it wasn't used            c.popFirstLineStyle();        }    }