gecko-dev/testing/web-platform/tests/css/css-text/animations/text-indent-composition.html
haozhe c02a70bd8c Bug 1605198 [wpt PR 20870] - Port css-text related composition tests to external, a=testonly
Automatic update from web-platform-tests
Port css-text related composition tests to external

Chrome pass all tests
Firefox does not support hanging: https://bugzilla.mozilla.org/show_bug.cgi?id=784648

Bug: 1034538
Change-Id: Ic60846b2e439eb325c682b01376ac0805f0b6a0e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1976494
Reviewed-by: Xida Chen <xidachen@chromium.org>
Commit-Queue: Hao Sheng <haozhes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#727769}

--

wpt-commits: e2d7dd2bbc5cd8741876afa2b571c0854145a99f
wpt-pr: 20870
2020-01-03 11:36:13 +00:00

84 lines
2.2 KiB
HTML

<!DOCTYPE html>
<meta charset="UTF-8">
<title>letter-spacing composition</title>
<link rel="help" href="https://drafts.csswg.org/css-text-3/#text-indent-property">
<meta name="test" content="text-indent supports animation by computed value type">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/interpolation-testcommon.js"></script>
<body></body>
<script>
test_composition({
property: 'text-indent',
underlying: '100%',
addFrom: '50px',
addTo: '150px',
}, [
{at: -0.3, expect: 'calc(100% + 20px)'},
{at: 0, expect: 'calc(100% + 50px)'},
{at: 0.3, expect: 'calc(100% + 80px)'},
{at: 0.6, expect: 'calc(100% + 110px)'},
{at: 1, expect: 'calc(100% + 150px)'},
{at: 1.5, expect: 'calc(100% + 200px)'},
]);
test_composition({
property: 'text-indent',
underlying: '250px',
addFrom: '50px',
replaceTo: '100px',
}, [
{at: -0.3, expect: '360px'},
{at: 0, expect: '300px'},
{at: 0.3, expect: '240px'},
{at: 0.6, expect: '180px'},
{at: 1, expect: '100px'},
{at: 1.5, expect: '0px'},
]);
test_composition({
property: 'text-indent',
underlying: '50%',
replaceFrom: '-100%',
addTo: '50%',
}, [
{at: -0.3, expect: '-160%'},
{at: 0, expect: '-100%'},
{at: 0.3, expect: '-40%'},
{at: 0.5, expect: '0%'},
{at: 0.6, expect: '20%'},
{at: 1, expect: '100%'},
{at: 1.5, expect: '200%'},
]);
test_composition({
property: 'text-indent',
underlying: '250px',
addFrom: '50px each-line hanging',
replaceTo: '150px hanging each-line',
}, [
{at: -0.3, expect: '20px hanging each-line'},
{at: 0, expect: '50px hanging each-line'},
{at: 0.3, expect: '80px hanging each-line'},
{at: 0.6, expect: '110px hanging each-line'},
{at: 1, expect: '150px hanging each-line'},
{at: 1.5, expect: '200px hanging each-line'},
]);
test_composition({
property: 'text-indent',
underlying: '250px each-line',
addFrom: '50px each-line',
replaceTo: '150px hanging',
}, [
{at: -0.3, expect: '300px each-line'},
{at: 0, expect: '300px each-line'},
{at: 0.3, expect: '300px each-line'},
{at: 0.6, expect: '150px hanging'},
{at: 1, expect: '150px hanging'},
{at: 1.5, expect: '150px hanging'},
]);
</script>
</body>