Commit b77e727f authored by haozhe's avatar haozhe Committed by Commit Bot

Port text-size-adjust-interpolation tests to wpt

Chrome passes the tests and firefox doesn't support "to" in asssert_true.
bug filed: https://bugzilla.mozilla.org/show_bug.cgi?id=1593036

Bug: 900581
Change-Id: I55df2d439c6c58665f1b1536def0b0b04635cf1a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1891758Reviewed-by: default avatarXida Chen <xidachen@chromium.org>
Commit-Queue: Hao Sheng <haozhes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#711354}
parent 9ba9ad7b
<!DOCTYPE html> <!DOCTYPE html>
<meta charset="UTF-8">
<title>text-size-adjust-interpolation</title>
<link rel="help" href="https://drafts.csswg.org/css-size-adjust/#adjustment-control">
<meta name="assert" content="text-size-adjust supports animation">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/interpolation-testcommon.js"></script>
<style type="text/css"> <style type="text/css">
.container { .container {
display: inline-block; display: inline-block;
...@@ -17,78 +26,77 @@ ...@@ -17,78 +26,77 @@
margin-right: 30px; margin-right: 30px;
} }
</style> </style>
<body></body>
<template id="target-template"> <template id="target-template">
<span class="container"> <span class="container">
<div class="target">x</span> <div class="target">x</span>
</div> </div>
</template> </template>
<script src="resources/interpolation-test.js"></script>
<script> <script>
assertInterpolation({ test_interpolation({
property: 'text-size-adjust', property: 'text-size-adjust',
from: neutralKeyframe, from: neutralKeyframe,
to: '50%', to: '50%',
}, [ }, [
{at: -2, is: '80%'}, {at: -2, expect: '80%'},
{at: -0.3, is: '63%'}, {at: -0.3, expect: '63%'},
{at: 0, is: '60%'}, {at: 0, expect: '60%'},
{at: 0.3, is: '57%'}, {at: 0.3, expect: '57%'},
{at: 0.6, is: '54%'}, {at: 0.6, expect: '54%'},
{at: 1, is: '50%'}, {at: 1, expect: '50%'},
{at: 1.5, is: '45%'}, {at: 1.5, expect: '45%'},
]); ]);
assertNoInterpolation({ test_no_interpolation({
property: 'text-size-adjust', property: 'text-size-adjust',
from: 'initial', from: 'initial',
to: '70%', to: '70%',
}); });
assertInterpolation({ test_interpolation({
property: 'text-size-adjust', property: 'text-size-adjust',
from: 'inherit', // 70% from: 'inherit', // 70%
to: '50%', to: '50%',
}, [ }, [
{at: -2, is: '110%'}, {at: -2, expect: '110%'},
{at: -0.3, is: '76%'}, {at: -0.3, expect: '76%'},
{at: 0, is: '70%'}, {at: 0, expect: '70%'},
{at: 0.3, is: '64%'}, {at: 0.3, expect: '64%'},
{at: 0.6, is: '58%'}, {at: 0.6, expect: '58%'},
{at: 1, is: '50%'}, {at: 1, expect: '50%'},
{at: 1.5, is: '40%'}, {at: 1.5, expect: '40%'},
]); ]);
assertInterpolation({ test_interpolation({
property: 'text-size-adjust', property: 'text-size-adjust',
from: 'unset', from: 'unset',
to: '50%', to: '50%',
}, [ }, [
{at: -2, is: '110%'}, {at: -2, expect: '110%'},
{at: -0.3, is: '76%'}, {at: -0.3, expect: '76%'},
{at: 0, is: '70%'}, {at: 0, expect: '70%'},
{at: 0.3, is: '64%'}, {at: 0.3, expect: '64%'},
{at: 0.6, is: '58%'}, {at: 0.6, expect: '58%'},
{at: 1, is: '50%'}, {at: 1, expect: '50%'},
{at: 1.5, is: '40%'}, {at: 1.5, expect: '40%'},
]); ]);
assertInterpolation({ test_interpolation({
property: 'text-size-adjust', property: 'text-size-adjust',
from: '10%', from: '10%',
to: '0%' to: '0%'
}, [ }, [
{at: -2, is: '30%'}, {at: -2, expect: '30%'},
{at: -0.3, is: '13%'}, {at: -0.3, expect: '13%'},
{at: 0, is: '10%'}, {at: 0, expect: '10%'},
{at: 0.3, is: '7%'}, {at: 0.3, expect: '7%'},
{at: 0.6, is: '4%'}, {at: 0.6, expect: '4%'},
{at: 1, is: '0%'}, {at: 1, expect: '0%'},
{at: 1.5, is: '0%'}, // text-size-adjust can't be negative {at: 1.5, expect: '0%'}, // text-size-adjust can't be negative
]); ]);
assertNoInterpolation({ test_no_interpolation({
property: 'text-size-adjust', property: 'text-size-adjust',
from: 'none', from: 'none',
to: '100%' to: '100%'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment