fune/testing/web-platform/tests/css/css-transforms/parsing/scale-parsing-valid.html
Eric Willigers dd433c697f Bug 1701384 [wpt PR 28267] - CSS Transforms: scale() accepts percentages., a=testonly
Automatic update from web-platform-tests
CSS Transforms: scale() accepts percentages.

The functions  scale() scaleX() scaleY() scaleZ() scale3d()  and the
property  scale  each accept percentages, that serialize as numbers.

https://github.com/w3c/csswg-drafts/issues/3399
https://github.com/w3c/csswg-drafts/pull/4396
https://drafts.csswg.org/css-transforms-2/#transform-functions
https://drafts.csswg.org/css-transforms-2/#propdef-scale

Bug: 1179579
Change-Id: Icfbc42bf529c1c63045c3e918a6a1db2b14d1ae3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2703674
Commit-Queue: Eric Willigers <ericwilligers@chromium.org>
Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org>
Cr-Commit-Position: refs/heads/master@{#867008}

--

wpt-commits: 808a9ed80e45a9da615fb930d212fcc7461648e6
wpt-pr: 28267
2021-03-27 17:41:31 +00:00

42 lines
1.5 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Transform Module Level 2: parsing scale with valid values</title>
<link rel="help" href="https://drafts.csswg.org/css-transforms-2/#propdef-scale">
<meta name="assert" content="scale supports the full grammar 'none | <number>{1,3}'.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
</head>
<body>
<script>
test_valid_value("scale", "none");
test_valid_value("scale", "1");
test_valid_value("scale", "1%", "0.01");
test_valid_value("scale", "100");
test_valid_value("scale", "100%", "1");
test_valid_value("scale", "100 100", "100");
test_valid_value("scale", "100% 100%", "1");
test_valid_value("scale", "100 100 1", "100");
test_valid_value("scale", "100% 100% 1", "1");
test_valid_value("scale", "-100");
test_valid_value("scale", "-100%", "-1");
test_valid_value("scale", "-100 -100", "-100");
test_valid_value("scale", "-100% -100%", "-1");
test_valid_value("scale", "-100 -100 1", "-100");
test_valid_value("scale", "-100% -100% 1", "-1");
test_valid_value("scale", "100 200");
test_valid_value("scale", "100% 200%", "1 2");
test_valid_value("scale", "100 200 1", "100 200");
test_valid_value("scale", "100% 200% 1", "1 2");
test_valid_value("scale", "100 200 300");
test_valid_value("scale", "100 100 2", "100 100 2");
test_valid_value("scale", "100% 200% 300%", "1 2 3");
</script>
</body>
</html>