if (box.getText() == null) {
if (box.getMasterText() == null) {
    public static InlineBox styleBox(Context c, Node node, int start, int end, String text, Rectangle bounds, InlineBox prev_align, Font font, InlineBox box, CascadedStyle firstLineStyle) {        //u.p("styleBox node = " + node.getNodeName() + " start = " + start + " end = " + end +        //" prev = " + prev + " text = " + text + " bounds = " + bounds + " prev_align = " + prev_align);        //u.p("Making box for: "  + node);        //u.p("prev = " + prev);        // if ( prev_align != prev ) {        //u.p("prev = " + prev);        //u.p("prev align inline = " + prev_align);        // }        Content content = box.getContent();        CalculatedStyle style = content.getStyle();        box.setNode(node);        box.start_index = start;        box.end_index = end;        BoxLayout.getBackgroundColor(c, box);        BoxLayout.getBorder(c, box);        BoxLayout.getMargin(c, box);        BoxLayout.getPadding(c, box);        // 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        try {            if (!(content instanceof InlineBlockContent)) {                if (!(content instanceof FloatedBlockContent)) {                    box.width = FontUtil.len(c, text.substring(start, end), font);                } else {                    box.width = bounds.width;                }            } else {                box.width = bounds.width;            }        } catch (StringIndexOutOfBoundsException ex) {            u.p("ex");            u.p("start = " + start);            u.p("end = " + end);            u.p("text = " + node.getNodeValue());            throw ex;        }        //u.p("box.x = " + box.x);        if (content instanceof InlineBlockContent) {            box.height = bounds.height;        } else if (content instanceof FloatedBlockContent) {            box.height = bounds.height;        } else {            box.height = FontUtil.lineHeight(c, style);        }        box.break_after = true;        box.setText(text);        box.setMasterText(text);        if (!(content instanceof InlineBlockContent)) {            if (!(content instanceof FloatedBlockContent)) {                TextDecoration.setupTextDecoration(box);                if (box.getText() == null) {                    return box;                }            }        }        // do vertical alignment        /*        Element elem = null;        if(node instanceof Element) {            elem = (Element)node;        } else {            elem = (Element)node.getParentNode();        }*/        //CalculatedStyle style = box.getStyle(c);//c.css.getStyle(elem);        VerticalAlign.setupVerticalAlign(c, style, box);        box.setFont(font);//FontUtil.getFont(c,node));        box.color = c.css.getStyle(node).getColor();        Relative.setupRelative(box);                        // if first line then do extra setup                if (c.isFirstLine()) {            //u.p("node = " + node);            //u.p("block elem = " + getNearestBlockElement(node,c));            // if there is a first line firstLineStyle class            if (firstLineStyle != null) {                //CalculatedStyle normal = c.css.getStyle(box.getRealElement());                CalculatedStyle merged = c.css.getDerivedStyle(style, firstLineStyle);                styleInlineBox(c, merged, box);            }        }                        // adjust width based on borders and padding        box.width += box.totalHorizontalPadding();        //box.height += box.totalVerticalPadding();                return box;    }