public String asString() { return toString(); }
public String asString() { return toString(); }
public PropertyValue(IdentValue ident) { _type = CSSPrimitiveValue.CSS_IDENT; _stringValue = ident.toString(); _cssValueType = _stringValue.equals("inherit") ? CSSValue.CSS_INHERIT : CSSValue.CSS_PRIMITIVE_VALUE; _cssText = ident.toString(); _propertyValueType = VALUE_TYPE_IDENT; _identValue = ident; }
public PropertyValue(IdentValue ident) { _type = CSSPrimitiveValue.CSS_IDENT; _stringValue = ident.toString(); _cssValueType = _stringValue.equals("inherit") ? CSSValue.CSS_INHERIT : CSSValue.CSS_PRIMITIVE_VALUE; _cssText = ident.toString(); _propertyValueType = VALUE_TYPE_IDENT; _identValue = ident; }
public float getFloatProportionalTo(CSSName cssName, float baseValue, CssContext ctx) { throw new XRRuntimeException("Ident value (" + toString() + ") is never a length; wrong class used for derived value."); }
public float getFloatProportionalTo(CSSName cssName, float baseValue, CssContext ctx) { throw new XRRuntimeException("Ident value (" + toString() + ") is never a length; wrong class used for derived value."); }
result.append(getStyle().getIdent(CSSName.DISPLAY).toString()); result.append(") ");
result.append(getStyle().getIdent(CSSName.DISPLAY).toString()); result.append(") ");
private CSSPrimitiveValue convertToBorderWidth(CSSPrimitiveValue value) { int type = value.getPrimitiveType(); if (type != CSSPrimitiveValue.CSS_IDENT && ! isLength(value)) { return null; } if (isLength(value)) { return value; } else { IdentValue ident = IdentValue.valueOf(value.getStringValue()); if (ident == null) { return null; } if (PrimitivePropertyBuilders.BORDER_WIDTHS.get(ident.FS_ID)) { return Conversions.getBorderWidth(ident.toString()); } else { return null; } } }
private CSSPrimitiveValue convertToBorderWidth(CSSPrimitiveValue value) { int type = value.getPrimitiveType(); if (type != CSSPrimitiveValue.CSS_IDENT && ! isLength(value)) { return null; } if (isLength(value)) { return value; } else { IdentValue ident = IdentValue.valueOf(value.getStringValue()); if (ident == null) { return null; } if (PrimitivePropertyBuilders.BORDER_WIDTHS.get(ident.FS_ID)) { return Conversions.getBorderWidth(ident.toString()); } else { return null; } } }
public List buildDeclarations( CSSName cssName, List values, int origin, boolean important, boolean inheritAllowed) { checkValueCount(cssName, 1, values.size()); PropertyValue value = (PropertyValue)values.get(0); checkInheritAllowed(value, inheritAllowed); if (value.getCssValueType() != CSSPrimitiveValue.CSS_INHERIT) { checkIdentOrLengthType(cssName, value); if (value.getPrimitiveType() == CSSPrimitiveValue.CSS_IDENT) { IdentValue ident = checkIdent(cssName, value); checkValidity(cssName, BORDER_WIDTHS, ident); return Collections.singletonList( new PropertyDeclaration( cssName, Conversions.getBorderWidth(ident.toString()), important, origin)); } else { if (value.getFloatValue() < 0.0f) { throw new CSSParseException(cssName + " may not be negative", -1); } } } return Collections.singletonList( new PropertyDeclaration(cssName, value, important, origin)); } }
public List buildDeclarations( CSSName cssName, List values, int origin, boolean important, boolean inheritAllowed) { checkValueCount(cssName, 1, values.size()); PropertyValue value = (PropertyValue)values.get(0); checkInheritAllowed(value, inheritAllowed); if (value.getCssValueType() != CSSPrimitiveValue.CSS_INHERIT) { checkIdentOrNumberType(cssName, value); short type = value.getPrimitiveType(); if (type == CSSPrimitiveValue.CSS_IDENT) { checkIdentType(cssName, value); IdentValue ident = checkIdent(cssName, value); checkValidity(cssName, getAllowed(), ident); } else if (type == CSSPrimitiveValue.CSS_NUMBER) { IdentValue weight = Conversions.getNumericFontWeight(value.getFloatValue()); if (weight == null) { throw new CSSParseException(value + " is not a valid font weight", -1); } PropertyValue replacement = new PropertyValue( CSSPrimitiveValue.CSS_IDENT, weight.toString(), weight.toString()); replacement.setIdentValue(weight); return Collections.singletonList( new PropertyDeclaration(cssName, replacement, important, origin)); } } return Collections.singletonList( new PropertyDeclaration(cssName, value, important, origin)); }
public List buildDeclarations( CSSName cssName, List values, int origin, boolean important, boolean inheritAllowed) { checkValueCount(cssName, 1, values.size()); PropertyValue value = (PropertyValue)values.get(0); checkInheritAllowed(value, inheritAllowed); if (value.getCssValueType() != CSSPrimitiveValue.CSS_INHERIT) { checkIdentOrLengthType(cssName, value); if (value.getPrimitiveType() == CSSPrimitiveValue.CSS_IDENT) { IdentValue ident = checkIdent(cssName, value); checkValidity(cssName, BORDER_WIDTHS, ident); return Collections.singletonList( new PropertyDeclaration( cssName, Conversions.getBorderWidth(ident.toString()), important, origin)); } else { if (value.getFloatValue() < 0.0f) { throw new CSSParseException(cssName + " may not be negative", -1); } } } return Collections.singletonList( new PropertyDeclaration(cssName, value, important, origin)); } }