CSS Object Model - example


[NOTE: this is approximative. Final spec not expected for some months!]

val1 = CSSValue.new(2.54, CSSValue.CM);
x.setProperty("text-indent", val1);
val2 = x.getProperty("text-indent");
nr_of_inches = val2.getFloat(CSSValue.INCH);
if (nr_of_inches != 1.0) error("2.54 cm isn't 1 inch!?");