Search in sources :

Example 6 with Property

use of com.gargoylesoftware.css.dom.Property in project LoboEvolution by LoboEvolution.

the class CSS3Parser method mediaExpression.

// 
// expression
// : '(' S* media_feature S* [ ':' S* expr ]? ')' S*
// ;
// 
public final Property mediaExpression() throws ParseException {
    String p;
    LexicalUnit e = null;
    Property prop;
    jj_consume_token(LROUND);
    label_18: while (true) {
        switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
            case S:
                {
                    ;
                    break;
                }
            default:
                jj_la1[30] = jj_gen;
                break label_18;
        }
        jj_consume_token(S);
    }
    p = property();
    switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
        case COLON:
            {
                jj_consume_token(COLON);
                label_19: while (true) {
                    switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
                        case S:
                            {
                                ;
                                break;
                            }
                        default:
                            jj_la1[31] = jj_gen;
                            break label_19;
                    }
                    jj_consume_token(S);
                }
                e = expr();
                break;
            }
        default:
            jj_la1[32] = jj_gen;
            ;
    }
    jj_consume_token(RROUND);
    label_20: while (true) {
        switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
            case S:
                {
                    ;
                    break;
                }
            default:
                jj_la1[33] = jj_gen;
                break label_20;
        }
        jj_consume_token(S);
    }
    if (e == null) {
        prop = new Property(p, null, false);
    } else {
        prop = new Property(p, new CSSValueImpl(e), false);
    }
    return prop;
}
Also used : CSSValueImpl(com.gargoylesoftware.css.dom.CSSValueImpl) Property(com.gargoylesoftware.css.dom.Property) LexicalUnit(com.gargoylesoftware.css.parser.LexicalUnit)

Aggregations

Property (com.gargoylesoftware.css.dom.Property)6 CSSValueImpl (com.gargoylesoftware.css.dom.CSSValueImpl)2 CSSStyleDeclarationImpl (com.gargoylesoftware.css.dom.CSSStyleDeclarationImpl)1 CSSException (com.gargoylesoftware.css.parser.CSSException)1 CSSParseException (com.gargoylesoftware.css.parser.CSSParseException)1 LexicalUnit (com.gargoylesoftware.css.parser.LexicalUnit)1 MediaQuery (com.gargoylesoftware.css.parser.media.MediaQuery)1 SelectorSpecificity (com.gargoylesoftware.css.parser.selector.SelectorSpecificity)1 WebWindow (com.gargoylesoftware.htmlunit.WebWindow)1 StyleElement (com.gargoylesoftware.htmlunit.css.StyleElement)1 IOException (java.io.IOException)1 AttributedString (java.text.AttributedString)1 LinkedHashMap (java.util.LinkedHashMap)1 NoSuchElementException (java.util.NoSuchElementException)1 DOMException (org.w3c.dom.DOMException)1