blob: affeaf1fb0e32e4863da5c118623afaf867be3ed [file] [log] [blame]
<!DOCTYPE html>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script>
test(function() {
var transformValueObject = new CSSTransformValue();
assert_true(transformValueObject instanceof CSSTransformValue);
assert_true(transformValueObject instanceof CSSStyleValue);
}, "A CSSTransformValue object can be constructed");
test(function() {
var transformArray = [new CSSScale(2,2),
new CSSMatrixTransformComponent(1,1,1,1,1,1), new CSSScale(5,6)];
var transformValue = new CSSTransformValue(transformArray);
assert_true(transformValue.is2D());
}, "is2D returns true for transformValues containing only 2D transformComponents");
test(function() {
var transformArray = [new CSSScale(2,2),
new CSSMatrixTransformComponent(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1), new CSSScale(5,6)];
var transformValue = new CSSTransformValue(transformArray);
assert_false(transformValue.is2D());
}, "is2D returns false for transformValues containing both 2D and 3D transformComponents");
test(function() {
var transformArray = [new CSSScale(2,2),
new CSSMatrixTransformComponent(1,1,1,1,1,1), new CSSScale(5,6)];
var transformValue = new CSSTransformValue(transformArray);
var newTransformArray = [];
for (var component of transformValue) {
newTransformArray.push(component);
}
assert_true(newTransformArray.length == 3);
assert_true(newTransformArray[0] instanceof CSSScale);
assert_true(newTransformArray[1] instanceof CSSMatrixTransformComponent);
assert_true(newTransformArray[2] instanceof CSSScale);
}, "CSSTransformValue can iterate through all its all its transformComponent members");
</script>
<body>
</body>