c.popStyle();
    static int paintInline(Context c, InlineBox ib, int lx, int ly, LineBox line, boolean restyle, LinkedList pushedStyles, LinkedList decorations, int padX) {        //Uu.p("paint inline: " + ib);        restyle = restyle || ib.restyle;//cascade it down        ib.restyle = false;//reset        if (ib.pushstyles != null) {            for (Iterator i = ib.pushstyles.iterator(); i.hasNext();) {                StylePush sp = (StylePush) i.next();                Element e = sp.getElement();                CascadedStyle cascaded;                if (e == null) {//anonymous inline box                    cascaded = CascadedStyle.emptyCascadedStyle;                } else {                    cascaded = c.getCss().getCascadedStyle(e, restyle);                }                if (pushedStyles != null) pushedStyles.addLast(cascaded);                padX = handleInlineElementStart(c, cascaded, line, ib, padX, decorations);            }        }        if (ib.floated) {            LinkedList unpropagated = (LinkedList) decorations.clone();            decorations.clear();            paintFloat(c, ib, restyle);            decorations.addAll(unpropagated);            debugInlines(c, ib, lx, ly);        } // Uu.p("paintInline: " + inline);        else if (ib instanceof InlineBlockBox) {            //no text-decorations on inline-block            LinkedList restarted = new LinkedList();            for (Iterator i = decorations.iterator(); i.hasNext();) {                TextDecoration td = (TextDecoration) i.next();                td.setEnd(ib.x);                //Uu.p("painting decoration");                td.paint(c, line);                i.remove();                restarted.addLast(td.getRestarted(ib.x + ib.getWidth()));            }            decorations.clear();            c.pushStyle(c.getCss().getCascadedStyle(ib.element, restyle));            //int textAlign = getTextAlign(c, line);            //Uu.p("line.x = " + line.x + " text align = " + textAlign);            //Uu.p("ib.x .y = " + ib.x + " " + ib.y);            c.translate(line.x,                    line.y +                    (line.getBaseline() -                    VerticalAlign.getBaselineOffset(c, line, ib) -                    ib.height));            c.getGraphics().translate(line.x,                    line.y +                    (line.getBaseline() -                    VerticalAlign.getBaselineOffset(c, line, ib) -                    ib.height));            c.translate(ib.x, ib.y);            c.getGraphics().translate(ib.x, ib.y);            BoxRendering.paint(c, ((InlineBlockBox) ib).sub_block, false, restyle);            c.getGraphics().translate(-ib.x, -ib.y);            c.translate(-ib.x, -ib.y);            c.getGraphics().translate(-line.x,                    -(line.y +                    (line.getBaseline() -                    VerticalAlign.getBaselineOffset(c, line, ib) -                    ib.height)));            c.translate(-line.x,                    -(line.y +                    (line.getBaseline() -                    VerticalAlign.getBaselineOffset(c, line, ib) -                    ib.height)));            debugInlines(c, ib, lx, ly);            c.popStyle();            decorations.addAll(restarted);        } else {            InlineTextBox inline = (InlineTextBox) ib;            //Uu.p("inline = " + inline);            //Uu.p("line.x = " + line.x + " lx = " + lx);            //Uu.p("ib.x .y = " + ib.x + " " + ib.y);            c.updateSelection(inline);            // calculate the Xx and y relative to the baseline of the line (ly) and the            // left edge of the line (lx)            int iy = ly - VerticalAlign.getBaselineOffset(c, line, inline);            int ix = lx + inline.x;//TODO: find the right way to work this out            // account for padding            // Uu.p("adjusted inline by: " + inline.totalLeftPadding());            // Uu.p("inline = " + inline);            // Uu.p("padding = " + inline.padding);            // JMM: new adjustments to move the text to account for horizontal insets            //int padding_xoff = inline.totalLeftPadding(c.getCurrentStyle());            c.translate(padX, 0);            c.getGraphics().translate(padX, 0);            LineMetrics lm = FontUtil.getLineMetrics(c, inline);            paintBackground(c, line, inline);            paintSelection(c, inline, lx, ly, lm);            paintText(c, ix, iy, inline, lm);            c.getGraphics().translate(-padX, 0);            c.translate(-padX, 0);            debugInlines(c, inline, lx, ly);        }        padX = ib.getWidth() - ib.rightPadding;        if (ib.popstyles != 0) {            for (int i = 0; i < ib.popstyles; i++) {                padX = handleInlineElementEnd(c, decorations, ib, padX, line, pushedStyles);            }        }        return padX;    }