private boolean addShorthandAttribute(String value,int shorthandAttr,CSSElement selector){
  if (CSSElement.CSS_IS_SHORTHAND_ATTRIBUTE_COLLATABLE[shorthandAttr]) {
    return addCollatableAttribute(value,shorthandAttr,selector);
  }
  for (int i=0; i < CSSElement.CSS_SHORTHAND_ATTRIBUTE_INDEX[shorthandAttr].length; i++) {
    int attrIndex=CSSElement.CSS_SHORTHAND_ATTRIBUTE_INDEX[shorthandAttr][i];
    if (attrIndex >= CSSElement.CSS_STYLE_ID_OFFSET) {
      if (!selector.isAttributeAssigned(attrIndex)) {
        int result=selector.addAttribute(attrIndex,value);
        if (result == -1) {
          return true;
        }
      }
    }
 else {
      boolean success=addShorthandAttribute(value,attrIndex,selector);
      if (success) {
        return true;
      }
    }
  }
  return false;
}

private boolean addShorthandAttribute ( String value , int shorthandAttr , CSSElement selector ) { if ( CSSElement . CSS_IS_SHORTHAND_ATTRIBUTE_COLLATABLE [ shorthandAttr ] ) { return addCollatableAttribute ( value , shorthandAttr , selector ) ; } for ( int i = 0 ; i < CSSElement . CSS_SHORTHAND_ATTRIBUTE_INDEX [ shorthandAttr ] . length ; i ++ ) { int attrIndex = CSSElement . CSS_SHORTHAND_ATTRIBUTE_INDEX [ shorthandAttr ] [ i ] ; if ( attrIndex >= CSSElement . CSS_STYLE_ID_OFFSET ) { if ( ! selector . isAttributeAssigned ( attrIndex ) ) { int result = selector . addAttribute ( attrIndex , value ) ; if ( result == - 1 ) { return true ; } } } else { boolean success = addShorthandAttribute ( value , attrIndex , selector ) ; if ( success ) { return true ; } } } return false ; }
adds the specified value to the specified selector as a value to the shorthand attribute whose index is specified this methods deals with the complexity of adding values for shorthand attributes , since they can be specified in any order it also handles multiple - shorthand levels such as the ' border ' attribute
