if (c.hasFirstLineStyles() && pushedStyles == null) {  pushedStyles = new LinkedList(); for (Iterator i = c.getFirstLineStyles().iterator(); i.hasNext();) { CascadedStyle firstLineStyle = (CascadedStyle) i.next(); padX = handleInlineElementStart(c, firstLineStyle, line, box, padX, decorations); } }
    static void paintLine(Context c, LineBox line, boolean restyle, LinkedList decorations) {        //Uu.p("painting line: " + line);        // get Xx and y        if (!line.textAligned) {            line.x += getTextAlign(c, line);            line.textAligned = true;        }        int lx = line.x;        //Uu.p("getting the text align for line: " + line);        //Uu.p("getTextAlign = " + getTextAlign(c,line));        //Uu.p("lx = " + lx);        int ly = line.y + line.getBaseline();        LinkedList pushedStyles = null;        // for each inline box        InlineBox lastInline = null;        int padX = 0;        for (int j = 0; j < line.getChildCount(); j++) {            Box child = line.getChild(j);            if (child.absolute) {                LinkedList unpropagated = (LinkedList) decorations.clone();                decorations.clear();                paintAbsolute(c, child, restyle);                decorations.addAll(unpropagated);                continue;            }            InlineBox box = (InlineBox) child;            lastInline = box;            padX = 0;            if (c.hasFirstLineStyles() && pushedStyles == null) {                //Uu.p("doing first line styles");                pushedStyles = new LinkedList();                for (Iterator i = c.getFirstLineStyles().iterator(); i.hasNext();) {                    CascadedStyle firstLineStyle = (CascadedStyle) i.next();                    padX = handleInlineElementStart(c, firstLineStyle, line, box, padX, decorations);                }            }            padX = paintInline(c, box, lx, ly, line, restyle, pushedStyles, decorations, padX);        }        //do text decorations, all are still active        ListIterator li = decorations.listIterator(0);        while (li.hasNext()) {            TextDecoration decoration = (TextDecoration) li.next();            //Uu.p("painting a decoration");            decoration.paint(c, line);        }        if (c.hasFirstLineStyles() && pushedStyles != null) {            for (int i = 0; i < pushedStyles.size(); i++) {                IdentValue decoration = c.getCurrentStyle().getIdent(CSSName.TEXT_DECORATION);                if (decoration != IdentValue.NONE) {                    decorations.removeLast();//might have changed because of first line style                }                c.popStyle();            }            LinkedList pushedBorders = (LinkedList) c.getInlineBorders().clone();            c.getInlineBorders().clear();//No other inline borders could be present, except those created on first line            for (Iterator i = c.getFirstLineStyles().iterator(); i.hasNext(); i.next()) {                c.getInlineBorders().add(pushedBorders.removeFirst());//paint the first-line pseudo-element border            }            //should really be reverse order here, but since it isn't used...            for (Iterator i = c.getFirstLineStyles().iterator(); i.hasNext(); i.next()) {                padX = handleInlineElementEnd(c, decorations, lastInline, padX, line, null);//get rid of firstLineStyle            }            //reinstitute the rest            c.getInlineBorders().addAll(pushedBorders);            for (Iterator i = pushedStyles.iterator(); i.hasNext();) {                c.pushStyle((CascadedStyle) i.next());                IdentValue decoration = c.getCurrentStyle().getIdent(CSSName.TEXT_DECORATION);                if (decoration != IdentValue.NONE) {                    decorations.addLast(new TextDecoration(decoration, 0, c.getCurrentStyle().getColor(), FontUtil.getLineMetrics(c, null)));                }            }            c.clearFirstLineStyles();        }        if (c.debugDrawLineBoxes()) {            c.getGraphics().translate(lx, ly - line.getBaseline());            GraphicsUtil.drawBox(c.getGraphics(), line, Color.blue);            c.getGraphics().translate(-lx, -ly - +line.getBaseline());        }    }