1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
4 <script src="../../resources/js-test.js"></script>
5 <style id="style" media="screen">
7 transform: translate(10px)
15 scaleX(1.2) /* test uppercase */
20 matrix(1, 0, 0, 1, 0, 0);
25 <p id="description"></p>
26 <div id="console"></div>
27 <script type="text/javascript" charset="utf-8">
29 var stylesheet = document.getElementById("style").sheet;
30 var root = document.documentElement;
32 function jsWrapperClass(node)
36 var string = Object.prototype.toString.apply(node);
37 return string.substr(8, string.length - 9);
40 function test(expression, className, prototypeName, constructorName)
43 prototypeName = className + "Prototype";
45 constructorName = className + "Constructor";
46 shouldBe("jsWrapperClass(" + expression + ")", "'" + className + "'");
47 shouldBe("jsWrapperClass(" + expression + ".__proto__)", "'" + prototypeName + "'");
48 shouldBe("jsWrapperClass(" + expression + ".constructor)", "'" + constructorName + "'");
51 var transformRule = stylesheet.cssRules.item(0).style.getPropertyCSSValue('transform');
52 test("transformRule", "CSSValueList");
54 test("transformRule[0]", "WebKitCSSTransformValue");
56 shouldBe("transformRule[0].operationType", "WebKitCSSTransformValue.CSS_TRANSLATE");
57 shouldBe("transformRule[0].cssText", "'translate(10px)'");
59 shouldBe("transformRule[1].operationType", "WebKitCSSTransformValue.CSS_TRANSLATEX");
60 shouldBe("transformRule[1].cssText", "'translateX(10px)'");
62 shouldBe("transformRule[2].operationType", "WebKitCSSTransformValue.CSS_TRANSLATEY");
63 shouldBe("transformRule[2].cssText", "'translateY(10px)'");
65 shouldBe("transformRule[3].operationType", "WebKitCSSTransformValue.CSS_ROTATE");
66 shouldBe("transformRule[3].cssText", "'rotate(10deg)'");
68 shouldBe("transformRule[4].operationType", "WebKitCSSTransformValue.CSS_ROTATE");
69 shouldBe("transformRule[4].cssText", "'rotate(11rad)'");
71 shouldBe("transformRule[5].operationType", "WebKitCSSTransformValue.CSS_ROTATE");
72 shouldBe("transformRule[5].cssText", "'rotate(12grad)'");
74 shouldBe("transformRule[6].operationType", "WebKitCSSTransformValue.CSS_ROTATE");
75 shouldBe("transformRule[6].cssText", "'rotate(13turn)'");
77 shouldBe("transformRule[7].operationType", "WebKitCSSTransformValue.CSS_SCALE");
78 shouldBe("transformRule[7].cssText", "'scale(2)'");
80 shouldBe("transformRule[8].operationType", "WebKitCSSTransformValue.CSS_SCALEX");
81 shouldBe("transformRule[8].cssText", "'scaleX(1.2)'");
83 shouldBe("transformRule[9].operationType", "WebKitCSSTransformValue.CSS_SCALEY");
84 shouldBe("transformRule[9].cssText", "'scaleY(1.2)'");
86 shouldBe("transformRule[10].operationType", "WebKitCSSTransformValue.CSS_SKEW");
87 shouldBe("transformRule[10].cssText", "'skew(10deg, 10rad)'");
89 shouldBe("transformRule[11].operationType", "WebKitCSSTransformValue.CSS_SKEWX");
90 shouldBe("transformRule[11].cssText", "'skewX(10deg)'");
92 shouldBe("transformRule[12].operationType", "WebKitCSSTransformValue.CSS_SKEWY");
93 shouldBe("transformRule[12].cssText", "'skewY(11grad)'");
95 shouldBe("transformRule[13].operationType", "WebKitCSSTransformValue.CSS_MATRIX");
96 shouldBe("transformRule[13].cssText", "'matrix(1, 0, 0, 1, 0, 0)'");