chromium/third_party/blink/web_tests/transforms/transform-origin-parsing.html

<!DOCTYPE html>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<div id="target" style="width: 200px; height: 100px; display: inline-block"></div>
<script src="resources/parsing-test-helper.js"></script>
<script>
expect = expect.bind(this, 'transform-origin', 'transformOrigin');

expect('initial').parsesAs('initial').isComputedTo('100px 50px');
expect('inherit').parsesAs('inherit');

expect('left').parsesAs('left center').isComputedTo('0px 50px');
expect('center').parsesAs('center center').isComputedTo('100px 50px');
expect('right').parsesAs('right center').isComputedTo('200px 50px');
expect('top').parsesAs('center top');
expect('bottom').parsesAs('center bottom');
expect('0').parsesAs('0px center');
expect('10%').parsesAs('10% center').isComputedTo('20px 50px');
expect('10px').parsesAs('10px center').isComputedTo('10px 50px');

expect('left top').parsesAs('left top');
expect('right bottom').parsesAs('right bottom');
expect('center center').parsesAs('center center').isComputedTo('100px 50px');
expect('center top').parsesAs('center top');
expect('center left').parsesAs('left center');
expect('top right').parsesAs('right top');
expect('left 10%').parsesAs('left 10%');
expect('left 10px').parsesAs('left 10px');
expect('10% top').parsesAs('10% top');
expect('10px top').parsesAs('10px top');
expect('10px 20%').parsesAs('10px 20%');
expect('0 0').parsesAs('0px 0px');
expect('0px 10%').parsesAs('0px 10%').isComputedTo('0px 10px');
expect('0px 20px').parsesAs('0px 20px').isComputedTo('0px 20px');
expect('0px top').parsesAs('0px top').isComputedTo('0px 0px');
expect('0px bottom').parsesAs('0px bottom').isComputedTo('0px 100px');
expect('0px center').parsesAs('0px center').isComputedTo('0px 50px');

expect('0 0 0').parsesAs('0px 0px 0px');
expect('10% 20% 30px').parsesAs('10% 20% 30px');
expect('left top 10px').parsesAs('left top 10px');
expect('center center 20px').parsesAs('center center 20px');
expect('0px 0px 5px').parsesAs('0px 0px 5px').isComputedTo('0px 0px 5px');

expect('left right').isInvalid();
expect('top bottom').isInvalid();
expect('none').isInvalid();
expect('20').isInvalid();
expect('10% 20% 30%').isInvalid();
expect('top 10%').isInvalid();
expect('bottom 10%').isInvalid();
expect('50% 50% 0px 0px').isInvalid();
expect('top 0px').isInvalid();
expect('bottom 0px').isInvalid();
</script>