private boolean handlePropertyValue ( CssDeclaration declaration , CssToken start , CssTokenIterator iter , boolean isStyleAttribute ) { // we dont worry about EOF here, throw to caller while ( true ) { if ( start . type == CssToken . Type . IMPORTANT ) { declaration . important = true ; } else { CssConstruct cc = CssConstructFactory . create ( start , iter , MATCH_SEMI_CLOSEBRACE , ContextRestrictions . PROPERTY_VALUE ) ; if ( cc == null ) { return false ; } else { declaration . components . add ( cc ) ; } } //if isStyleAttribute, then parse as declaration-list grammar, //i.e. no braces if ( ( isStyleAttribute && ! iter . hasNext ( ) ) || ( MATCH_SEMI . apply ( iter . peek ( ) ) ) || ( ! isStyleAttribute && MATCH_CLOSEBRACE . apply ( iter . peek ( ) ) ) ) { return declaration . components . size ( ) > 0 ; } else { start = iter . next ( ) ; } } }
Append property value components to declaration . value return false if fail with iter . last at the the token which caused the fail .