2 <script src=
"../resources/testharness.js"></script>
3 <script src=
"../resources/testharnessreport.js"></script>
4 <div id=
"target" style=
"width: 200px; height: 100px; display: inline-block"></div>
5 <script src=
"resources/parsing-test-helper.js"></script>
7 expect
= expect
.bind(this, 'perspective-origin', 'perspectiveOrigin');
9 expect('initial').parsesAs('initial').isComputedTo('100px 50px');
10 expect('inherit').parsesAs('inherit');
12 expect('left').parsesAs('left 50%').isComputedTo('0px 50px');
13 expect('center').parsesAs('center 50%').isComputedTo('100px 50px');
14 expect('right').parsesAs('right 50%').isComputedTo('200px 50px');
15 expect('top').parsesAs('50% top');
16 expect('bottom').parsesAs('50% bottom');
17 expect('0').parsesAs('0px 50%');
18 expect('10%').parsesAs('10% 50%').isComputedTo('20px 50px');
19 expect('10px').parsesAs('10px 50%').isComputedTo('10px 50px');
21 expect('left top').parsesAs('left top');
22 expect('right bottom').parsesAs('right bottom');
23 expect('center center').parsesAs('center center').isComputedTo('100px 50px');
24 expect('center top').parsesAs('center top');
25 expect('center left').parsesAs('left center');
26 expect('top right').parsesAs('right top');
27 expect('left 10%').parsesAs('left 10%');
28 expect('left 10px').parsesAs('left 10px');
29 expect('10% top').parsesAs('10% top');
30 expect('10px top').parsesAs('10px top');
31 expect('10px 20%').parsesAs('10px 20%');
32 expect('0 0').parsesAs('0px 0px');
33 expect('0px 10%').parsesAs('0px 10%').isComputedTo('0px 10px');
34 expect('0px 20px').parsesAs('0px 20px').isComputedTo('0px 20px');
35 expect('0px top').parsesAs('0px top').isComputedTo('0px 0px');
36 expect('0px bottom').parsesAs('0px bottom').isComputedTo('0px 100px');
37 expect('0px center').parsesAs('0px center').isComputedTo('0px 50px');
39 expect('left right').isInvalid();
40 expect('top bottom').isInvalid();
41 expect('none').isInvalid();
42 expect('20').isInvalid();
43 expect('10% 20% 30%').isInvalid();
44 expect('top 10%').isInvalid();
45 expect('bottom 10%').isInvalid();
46 expect('50% 50% 0px').isInvalid();