child_box.y = box.height;  box.addChild(child_box);   BlockBoxing.count++; int bc = Configuration.valueAsInt("xr.incremental.repaint.blockcount",1); if(BlockBoxing.count%bc == 0) { Dimension max_size = new Dimension(c.getMaxWidth(),c.getMaxHeight()); if(Configuration.isTrue("xr.incremental.enabled",false)) { RenderQueue.getInstance().dispatchRepaintEvent(new ReflowEvent(ReflowEvent.MORE_BOXES_AVAILABLE,box,max_size)); } }  int delay = Configuration.valueAsInt("xr.incremental.debug.layoutdelay",0); if(delay > 0) {  try { Uu.sleep(delay); } catch (Exception ex) { Uu.p("sleep was interrupted in BlockBoxing.layoutContent()!"); } }  Boxing.realLayout(c,child_box,currentContent); c.translate(0, -box.height);
    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);        BlockBoxing.count++;        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.y = box.height; //           c.translate(0, -box.height);            box.addChild(child_box);			//Uu.p("alerting that there is a box available");			BlockBoxing.count++;			int bc = Configuration.valueAsInt("xr.incremental.repaint.blockcount",1);			if(BlockBoxing.count%bc == 0) {				Dimension max_size = new Dimension(c.getMaxWidth(),c.getMaxHeight());                if(Configuration.isTrue("xr.incremental.enabled",false)) {                    RenderQueue.getInstance().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()!");                }			}            Boxing.realLayout(c,child_box,currentContent);            c.translate(0, -box.height);                        child_box.list_count = c.getListCounter();            // set the child_box location            child_box.x = 0;            child_box.y = box.height;			//Uu.p("set child box y to: " + child_box);						//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.getBlockFormattingContext().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.getBlockFormattingContext().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			c.addMaxWidth(box.getWidth());            if (child_box.getWidth() > box.getWidth()) {                box.setWidth( child_box.getWidth() );            }            // increase the final layout height by the height of the child            box.height += child_box.height;			c.addMaxHeight(box.height);			if(c.shouldStop()) {				System.out.println("doing a quick stop");				break;			}        }        c.addMaxWidth(box.getWidth());        c.setListCounter(old_counter);        if (block.firstLineStyle != null) {            //pop it in case it wasn't used            c.popFirstLineStyle();        }    }