/** Implements {@link ValueManager#createStringValue(short,String,CSSEngine)}. */
 public Value createStringValue(short type, String value, CSSEngine engine) throws DOMException {
   if (type != CSSPrimitiveValue.CSS_IDENT) {
     throw createInvalidIdentifierDOMException(value);
   }
   Object v = values.get(value.toLowerCase().intern());
   if (v == null) {
     throw createInvalidIdentifierDOMException(value);
   }
   return (Value) v;
 }
  /** Implements {@link ValueManager#createValue(LexicalUnit,CSSEngine)}. */
  public Value createValue(LexicalUnit lu, CSSEngine engine) throws DOMException {
    switch (lu.getLexicalUnitType()) {
      case LexicalUnit.SAC_INHERIT:
        return SVGValueConstants.INHERIT_VALUE;

      case LexicalUnit.SAC_IDENT:
        Object v = values.get(lu.getStringValue().toLowerCase().intern());
        if (v == null) {
          throw createInvalidIdentifierDOMException(lu.getStringValue());
        }
        return (Value) v;
    }
    return super.createValue(lu, engine);
  }
示例#3
0
 static {
   values.put(CSSConstants.CSS_AUTO_VALUE, ValueConstants.AUTO_VALUE);
   values.put(CSSConstants.CSS_HIDDEN_VALUE, ValueConstants.HIDDEN_VALUE);
   values.put(CSSConstants.CSS_SCROLL_VALUE, ValueConstants.SCROLL_VALUE);
   values.put(CSSConstants.CSS_VISIBLE_VALUE, ValueConstants.VISIBLE_VALUE);
 }
 static {
   values.put(CSSConstants.CSS_BASELINE_VALUE, SVGValueConstants.BASELINE_VALUE);
   values.put(CSSConstants.CSS_SUB_VALUE, SVGValueConstants.SUB_VALUE);
   values.put(CSSConstants.CSS_SUPER_VALUE, SVGValueConstants.SUPER_VALUE);
 }