blob: 227c78abd5d524b16de925f009abec9eb90d2094 [file] [log] [blame]
<!DOCTYPE html>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script>
test(function() {
var calcLength = new CSSCalcLength({px: 10, percent: 3.2});
assert_throws(null, function() { new CSSPerspective(calcLength) });
}, "Constructor should throw an error for CSSCalcLengths with a percentage type");
test(function() {
var simpleLength = new CSSSimpleLength(10, 'percent');
assert_throws(null, function() { new CSSPerspective(simpleLength) });
}, "Constructor should throw an error for CSSSimpleLengths with a percentage type");
test(function() {
var simpleLength = new CSSSimpleLength(10, 'px');
var calcLength = new CSSCalcLength({px: 10, em: 3.2});
var perspectiveTransformSimple = new CSSPerspective(simpleLength);
var perspectiveTransformCalc = new CSSPerspective(calcLength);
assert_equals(perspectiveTransformSimple.cssText, 'perspective(10px)');
assert_equals(perspectiveTransformCalc.cssText,'perspective(calc(3.2em + 10px))');
}, "cssText should return a string of form perspective(<CSSLengthValue.cssString()>)");
</script>
<body>
</body>