TestUtil.checkError(color.getStringValue().equals("red"));
color.setStringValue(CSSPrimitiveValue.CSS_IDENT," blue ");
TestUtil.checkError(color.getStringValue().equals("blue"));
color.setCssText(" red "); // Restauramos el valor original
CSSValue border = props.getPropertyCSSValue("border");
TestUtil.checkError(border.getCssValueType() == CSSValue.CSS_VALUE_LIST);
CSSValueList borderList = (CSSValueList)border;
TestUtil.checkError(borderList.getLength() == 2);
CSSPrimitiveValue borderType = (CSSPrimitiveValue)borderList.item(0);
TestUtil.checkError(borderType.getPrimitiveType() == CSSPrimitiveValue.CSS_IDENT);
TestUtil.checkError(borderType.getStringValue().equals("solid"));
borderType.setStringValue(CSSPrimitiveValue.CSS_IDENT,"dotted");
TestUtil.checkError(borderType.getStringValue().equals("dotted"));
TestUtil.checkError(body.getAttribute("style").equals("color: red ;border:dotted 1.5px;clip: rect( 1px 2in 3cm 4 );border-color: #aabbcc;width: 50%;anytext: \"hello guy\" "));
borderType.setStringValue(CSSPrimitiveValue.CSS_IDENT,"solid"); // restaurar
CSSPrimitiveValue borderWidth = (CSSPrimitiveValue)borderList.item(1);
TestUtil.checkError(borderWidth.getPrimitiveType() == CSSPrimitiveValue.CSS_PX);
TestUtil.checkError(borderWidth.getFloatValue(CSSPrimitiveValue.CSS_PX) == 1.5);
borderWidth.setFloatValue(CSSPrimitiveValue.CSS_IN,(float)2.5);
TestUtil.checkError(borderWidth.getPrimitiveType() == CSSPrimitiveValue.CSS_IN);
TestUtil.checkError(borderWidth.getFloatValue(CSSPrimitiveValue.CSS_IN) == 2.5);
borderWidth.setFloatValue(CSSPrimitiveValue.CSS_PX,(float)1.5); // Restaurar
CSSValue clip = props.getPropertyCSSValue("clip");
TestUtil.checkError(clip.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE);
CSSPrimitiveValue clipValue = (CSSPrimitiveValue)clip;
Rect clipRect = clipValue.getRectValue();
CSSPrimitiveValue top = clipRect.getTop();
TestUtil.checkError(top.getPrimitiveType() == CSSPrimitiveValue.CSS_PX);
TestUtil.checkError(top.getFloatValue(CSSPrimitiveValue.CSS_PX) == 1);