CSSOMReadOnlyValue value,
String priority,
int origin) {
ImmutableValue im = value.getImmutableValue();
boolean b = im == ValueConstants.SMALLER_VALUE;
CSSOMReadOnlyValue val = null;
if (b || im == ValueConstants.LARGER_VALUE) {
Element p = HiddenChildElementSupport.getParentElement(element);
if (p == null) {
val = new CSSOMReadOnlyValue((b)
? ValueConstants.SMALL_VALUE
: ValueConstants.LARGE_VALUE);
} else {
CSSOMReadOnlyStyleDeclaration sd;
sd = (CSSOMReadOnlyStyleDeclaration)view.getComputedStyle
(p, null);
CSSOMReadOnlyValue prop;
prop = (CSSOMReadOnlyValue)sd.getPropertyCSSValue
(getPropertyName());
im = prop.getImmutableValue();
if (im == ValueConstants.LARGE_VALUE) {
val = new CSSOMReadOnlyValue((b)
? ValueConstants.MEDIUM_VALUE
: ValueConstants.X_LARGE_VALUE);
} else if (im == ValueConstants.MEDIUM_VALUE) {
val = new CSSOMReadOnlyValue((b)
? ValueConstants.SMALL_VALUE
: ValueConstants.LARGE_VALUE);
} else if (im == ValueConstants.SMALL_VALUE) {
val = new CSSOMReadOnlyValue((b)
? ValueConstants.MEDIUM_VALUE
: ValueConstants.X_LARGE_VALUE);
} else if (im == ValueConstants.X_LARGE_VALUE) {
val = new CSSOMReadOnlyValue((b)
? ValueConstants.LARGE_VALUE
: ValueConstants.XX_LARGE_VALUE);
} else if (im == ValueConstants.X_SMALL_VALUE) {
val = new CSSOMReadOnlyValue((b)
? ValueConstants.XX_SMALL_VALUE
: ValueConstants.SMALL_VALUE);
} else if (im == ValueConstants.XX_LARGE_VALUE) {
val = new CSSOMReadOnlyValue((b)
? ValueConstants.X_LARGE_VALUE
: ValueConstants.XX_LARGE_VALUE);
} else if (im == ValueConstants.XX_SMALL_VALUE) {
val = new CSSOMReadOnlyValue((b)
? ValueConstants.XX_SMALL_VALUE
: ValueConstants.X_SMALL_VALUE);
} else if (im instanceof ImmutableFloat) {
short t = ((ImmutableFloat)im).getPrimitiveType();
float f = ((ImmutableFloat)im).getFloatValue(t);
if (t == CSSPrimitiveValue.CSS_PERCENTAGE) {
throw new RuntimeException("!!! TODO %");
} else {
val = new CSSOMReadOnlyValue
(new ImmutableFloat(t, (b) ? f / 1.2f : f * 1.2f));
}
}
if (val != null) {
styleDeclaration.setPropertyCSSValue(getPropertyName(),