Bug 1706464 [wpt PR 28605] - Off-thread CSS paint: handle no-op animation, a=testonly

Automatic update from web-platform-tests
Off-thread CSS paint: handle no-op animation

In a previous CL here:
https://chromium-review.googlesource.com/c/chromium/src/+/2795243
We handled a no-op background-color animation by keep it running on
the compositor thread. This is okay because it is a no-op animation.

This CL follows the same approach as the background-color animation
case. In particular, when it is a custom property animated by CSS
paint worklet, and this custom property animation is a no-op one,
then we keep it running on the compositor thread.

Bug: 1193162
Change-Id: I3f2093092053ad9c9363a64d6d46df039e9bddf0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2841783
Reviewed-by: Kevin Ellis <kevers@chromium.org>
Commit-Queue: Xida Chen <xidachen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#874704}

--

wpt-commits: b47b8a1f933a9ec2b62f1608886155f911431111
wpt-pr: 28605
This commit is contained in:
Xida Chen 2021-04-24 09:14:50 +00:00 коммит произвёл moz-wptsync-bot
Родитель a3301dfb95
Коммит b362e94f35
2 изменённых файлов: 64 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,15 @@
<!DOCTYPE html>
<body "lightyellow" contenteditable="true"="0">
<div>=</div>
<script>
function edit() {
document.execCommand("selectAll");
document.execCommand("InsertHTML",false,"<pre></pre>");
document.execCommand("InsertHTML",false,"<div>i</div>");
document.execCommand("indent");
}
edit();
</script>
</body>
</html>

Просмотреть файл

@ -0,0 +1,49 @@
<!DOCTYPE html>
<html class="reftest-wait">
<link rel="help" href="https://drafts.css-houdini.org/css-paint-api/">
<link rel="match" href="no-op-animation-ref.html">
<style>
#container {
}
.animate {
background-image: paint(foo);
animation: anim 1s;
}
@keyframes anim {
0% { --foo: rgb(200, 0, 0); }
}
</style>
<script src="/common/reftest-wait.js"></script>
<body "lightyellow" contenteditable="true"="0">
<div id="container">=</div>
<script id="code" type="text/worklet">
registerPaint('foo', class {
static get inputProperties() { return ['--foo']; }
paint() {}
});
</script>
<script>
CSS.registerProperty({
name: '--foo',
syntax: '<color>',
initialValue: 'rgb(0, 0, 0)',
inherits: false
});
var code = document.getElementById('code').textContent;
var blob = new Blob([code], {type: 'text/javascript'});
CSS.paintWorklet.addModule(URL.createObjectURL(blob)).then(function() {
document.getElementById('container').classList.add('animate');
edit();
});
function edit() {
document.execCommand("selectAll");
document.execCommand("InsertHTML",false,"<pre></pre>");
document.execCommand("InsertHTML",false,"<div>i</div>");
document.execCommand("indent");
takeScreenshot();
}
</script>
</body>
</html>