gecko-dev/testing/web-platform/tests/animation-worklet/worklet-animation-with-non-ascii-name.https.html
Kevin Ellis 7b7de75cfc Bug 1536296 [wpt PR 15843] - Support international characters in animation worklets., a=testonly
Automatic update from web-platform-tests
Support international characters in animation worklets.

Code in cc/ is not permitted to use wtf::String. Thus, we perform conversions between wtf::String and std::string.  The later is not aware of encodings.  This is OK provided a consistent encoding is used for round tripping, where the encoding supports the set of allowed characters.  The UTF-8 encoding is adequate for this task and supported by wtf::String.

Bug: 940493
Change-Id: Ie2b994412f502ea11df06713439b8cf8ffedc885
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1524087
Reviewed-by: Robert Flack <flackr@chromium.org>
Commit-Queue: Kevin Ellis <kevers@chromium.org>
Cr-Commit-Position: refs/heads/master@{#641278}

--

wpt-commits: 151b78244c1595920405ca887e59c5f17f1ce6e5
wpt-pr: 15843
2019-04-01 14:43:54 +01:00

59 lines
1.7 KiB
HTML

<html class="reftest-wait">
<title>WorkletAnimation name should accept non-ASCII characters</title>
<link rel="help" href="https://drafts.css-houdini.org/css-animationworklet/">
<meta name="assert" content="Worklet Animation name should accept non-ASCII characters">
<link rel="match" href="worklet-animation-with-non-ascii-name-ref.html">
<script src="/web-animations/testcommon.js"></script>
<script src="/common/reftest-wait.js"></script>
<script src="common.js"></script>
<style>
.box {
width: 100px;
height: 100px;
background-color: green;
}
</style>
<div id="t0" class="box"></div>
<div id="t1" class="box"></div>
<script id="visual_update" type="text/worklet">
registerAnimator('bob', class {
animate(currentTime, effect) {
effect.localTime = 250;
}
});
registerAnimator('東京', class {
animate(currentTime, effect) {
effect.localTime = 750;
}
});
</script>
<script>
runInAnimationWorklet(
document.getElementById('visual_update').textContent
).then(() => {
const keyframes = [
{transform: 'translateX(0)' },
{transform: 'translateX(200px)' }
];
const options = {
duration: 1000
};
const $t0 = document.getElementById('t0');
const $t0_effect = new KeyframeEffect($t0, keyframes, options);
const $t0_animation = new WorkletAnimation('bob', $t0_effect);
const $t1 = document.getElementById('t1');
const $t1_effect = new KeyframeEffect($t1, keyframes, options);
const $t1_animation = new WorkletAnimation('東京', $t1_effect);
$t0_animation.play();
$t1_animation.play();
waitForAsyncAnimationFrames(1).then(_ => {
takeScreenshot();
});
});
</script>