if (cssName == CSSName.BACKGROUND_POSITION) { val = new PointValue(style, cssName, cssSACUnitType, cssText, cssStringValue); } else if ( COLOR_PROPERTIES.contains(cssName)) { val = new ColorValue(style, cssName, cssSACUnitType, cssText, cssStringValue, rgbColor); } else if (STRING_PROPERTIES.contains(cssName)) { val = new StringValue(style, cssName, cssSACUnitType, cssText, cssStringValue); } else if (Idents.looksLikeALength(cssText) && !(cssName == CSSName.FONT_WEIGHT)) { val = new LengthValue(style, cssName, cssSACUnitType, cssText, cssStringValue); } else if (IDENT_PROPERTIES.contains(cssName) || IdentValue.looksLikeIdent(cssText)) { val = IdentValue.getByIdentString(cssText); if ( val == IdentValue.INHERIT ) { if ( style.getParent().isLengthValue(cssName)) { val = new InheritedLength(); }
boolean declaredInherit = cssText.equals("inherit"); if (declaredInherit) { if (style.getParent().isLengthValue(cssName)) { val = InheritedLength.instance(); } else {   val = style.getParent().copyOf(cssName);
    public static FSDerivedValue newDerivedValue(            CalculatedStyle style,            CSSName cssName,            short cssSACUnitType,            String cssText,            String cssStringValue,            RGBColor rgbColor    ) {        FSDerivedValue val = null;        if (cssName == CSSName.BACKGROUND_POSITION) {            val = new PointValue(style, cssName, cssSACUnitType, cssText, cssStringValue);        } else if ( COLOR_PROPERTIES.contains(cssName)) {            val = new ColorValue(style, cssName, cssSACUnitType, cssText, cssStringValue, rgbColor);        } else if (STRING_PROPERTIES.contains(cssName)) {            val = new StringValue(style, cssName, cssSACUnitType, cssText, cssStringValue);        } else if (Idents.looksLikeALength(cssText) && !(cssName == CSSName.FONT_WEIGHT)) {            val = new LengthValue(style, cssName, cssSACUnitType, cssText, cssStringValue);        } else if (IDENT_PROPERTIES.contains(cssName) || IdentValue.looksLikeIdent(cssText)) {            val = IdentValue.getByIdentString(cssText);            if ( val == IdentValue.INHERIT ) {                if ( style.getParent().isLengthValue(cssName)) {                    val = new InheritedLength();                }            }        } else {            throw new XRRuntimeException(                    "Can't determine the dervived value type to use for property " +                     "named '" + cssName + "' with value " + cssText            );        }        return val;    }