Index: LayoutTests/transforms/transform-origin-parsing.html |
diff --git a/LayoutTests/transforms/transform-origin-parsing.html b/LayoutTests/transforms/transform-origin-parsing.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..39018d2ec4fc57c8b2fdb7f840011bcc343bbe49 |
--- /dev/null |
+++ b/LayoutTests/transforms/transform-origin-parsing.html |
@@ -0,0 +1,53 @@ |
+<!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 50% 0px').isComputedTo('0px 50px'); |
+expect('center').parsesAs('center 50% 0px').isComputedTo('100px 50px'); |
+expect('right').parsesAs('right 50% 0px').isComputedTo('200px 50px'); |
+expect('top').parsesAs('50% top 0px'); |
+expect('bottom').parsesAs('50% bottom 0px'); |
+expect('0').parsesAs('0px 50% 0px'); |
+expect('10%').parsesAs('10% 50% 0px').isComputedTo('20px 50px'); |
+expect('10px').parsesAs('10px 50% 0px').isComputedTo('10px 50px'); |
+ |
+expect('left top').parsesAs('left top 0px'); |
+expect('right bottom').parsesAs('right bottom 0px'); |
+expect('center center').parsesAs('center center 0px').isComputedTo('100px 50px'); |
+expect('center top').parsesAs('center top 0px'); |
+expect('center left').parsesAs('left center 0px'); |
+expect('top right').parsesAs('right top 0px'); |
+expect('left 10%').parsesAs('left 10% 0px'); |
+expect('left 10px').parsesAs('left 10px 0px'); |
+expect('10% top').parsesAs('10% top 0px'); |
+expect('10px top').parsesAs('10px top 0px'); |
+expect('10px 20%').parsesAs('10px 20% 0px'); |
+expect('0 0').parsesAs('0px 0px 0px'); |
+expect('0px 10%').parsesAs('0px 10% 0px').isComputedTo('0px 10px'); |
+expect('0px 20px').parsesAs('0px 20px 0px').isComputedTo('0px 20px'); |
+expect('0px top').parsesAs('0px top 0px').isComputedTo('0px 0px'); |
+expect('0px bottom').parsesAs('0px bottom 0px').isComputedTo('0px 100px'); |
+expect('0px center').parsesAs('0px center 0px').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(); |
+</script> |