Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(321)

Unified Diff: LayoutTests/transforms/scale-parsing.html

Issue 1158603003: CSS Independent Transform Properties (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase master Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/transforms/scale-expected.html ('k') | LayoutTests/transforms/transform-properties-mixed.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/transforms/scale-parsing.html
diff --git a/LayoutTests/transforms/scale-parsing.html b/LayoutTests/transforms/scale-parsing.html
new file mode 100644
index 0000000000000000000000000000000000000000..7aa23fe6e157795cc5fff4bb21c66aa2246feb77
--- /dev/null
+++ b/LayoutTests/transforms/scale-parsing.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<div id="target" style="width: 100px; height: 200px; display: inline-block"></div>
+<script src="resources/parsing-test-helper.js"></script>
+<script>
+expect = expect.bind(this, 'scale', 'scale');
+
+expect('initial').parsesAs('initial').isComputedTo('1');
+expect('inherit').parsesAs('inherit');
+
+expect('1').parsesAs('1').isComputedTo('1');
+expect('1 -2.3').parsesAs('1 -2.3').isComputedTo('1 -2.3');
+expect('1 -2.3 4').parsesAs('1 -2.3 4').isComputedTo('1 -2.3 4');
+
+/* Note this assumes that scaling with 1 number applies to both x and y axis */
+expect('calc(1 * 2)').parsesAs('2').isComputedTo('2 2');
+expect('calc(1 * 2) calc(2 / 4)').parsesAs('2 0.5').isComputedTo('2 0.5');
+expect('calc(1 * 2) calc(2 / 4) calc(0.5)').parsesAs('2 0.5 0.5').isComputedTo('2 0.5 0.5');
+
+expect('2px').isInvalid();
+expect('30%').isInvalid();
+expect('1 1 1 1').isInvalid();
+expect('1 2 3deg').isInvalid();
+expect('1 + 1').isInvalid();
+expect('1,').isInvalid();
+expect('1, 2,').isInvalid();
+expect('calc(1 * 2 + 4px) calc(2 / 4) calc(0.5)').isInvalid();
+expect('calc(1 * 2) calc(2 / 4 * 4deg) calc(0.5)').isInvalid();
+expect('calc(1 * 2) calc(2 / 4) calc(0.5%)').isInvalid();
+</script>
« no previous file with comments | « LayoutTests/transforms/scale-expected.html ('k') | LayoutTests/transforms/transform-properties-mixed.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698