Skip to content

Commit cd40777

Browse files
[HiC] Disable composited clip-path animations inside canvas
Fixed: 567613566 Change-Id: Id9e77fe3df096ea5c2067f8eab5ff7861a6ed996 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8487173 Reviewed-by: Philip Rogers <[email protected]> Commit-Queue: Stefan Zager <[email protected]> Cr-Commit-Position: refs/heads/main@{#1710501}
1 parent 3a34a13 commit cd40777

2 files changed

Lines changed: 48 additions & 0 deletions

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<!DOCTYPE html>
2+
<div style="background:grey;width:100px;height:100px">
3+
<img style="width:100px;height:100px;clip-path:inset(50%)" src="/images/blue-100x100.png"/>
4+
</div>
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<!DOCTYPE html>
2+
<html class="reftest-wait">
3+
<title>Canvas.drawElementImage: animated clip-path inside drawable element</title>
4+
<link rel="help" href="https://github.com/WICG/html-in-canvas">
5+
<link rel="match" href="animated-clip-path-ref.html">
6+
<script src="/common/reftest-wait.js"></script>
7+
<style>
8+
#child {
9+
width: 100px;
10+
height: 100px;
11+
}
12+
#canvas {
13+
background: grey;
14+
}
15+
#image {
16+
width: 100px;
17+
height: 100px;
18+
clip-path: inset(0);
19+
transition: clip-path 100ms;
20+
}
21+
</style>
22+
<canvas id=canvas width="100px" height="100px" content=drawable>
23+
<div drawable id=child>
24+
<img id=image src="/images/blue-100x100.png"/>
25+
</div>
26+
</canvas>
27+
<script>
28+
onload = async () => {
29+
let canvas = document.getElementById("canvas");
30+
let ctx = canvas.getContext("2d");
31+
let child = document.getElementById("child");
32+
let image = document.getElementById("image");
33+
34+
canvas.onpaint = (evt) => {
35+
ctx.clearRect(0, 0, 100, 100);
36+
ctx.drawElementImage(child, 0, 0);
37+
};
38+
await new Promise(requestAnimationFrame);
39+
await new Promise(requestAnimationFrame);
40+
image.ontransitionend = takeScreenshot;
41+
image.style.clipPath = "inset(50%)";
42+
};
43+
</script>
44+
</html>

0 commit comments

Comments
 (0)