Skip to content

Commit 760d5bc

Browse files
Claire Chamberschromium-wpt-export-bot
authored andcommitted
[CompositeClipPathAnimation] Add test for calc() with unit update
To fix a gap in coverage where changes in width/height and calc() were not tested for composited clip path animations. Although believed to be settled now, mixed units were at one time a pain point for the feature, before the transition to SKIA paths rather than storing interpolated values. This test serves as an extra guardrail for regression. Bug: 40503852 Change-Id: I15dac37f9ddd65b4aaac73c1424ad7aa154ce28f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6712153 Reviewed-by: Olga Gerchikov <[email protected]> Commit-Queue: Claire Chambers <[email protected]> Reviewed-by: Kevin Ellis <[email protected]> Cr-Commit-Position: refs/heads/main@{#1486478}
1 parent a7400ee commit 760d5bc

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<style>
3+
.container {
4+
width: 150px;
5+
height: 150px;
6+
background-color: green;
7+
clip-path: circle(35px at 50% 50%);
8+
}
9+
</style>
10+
<body>
11+
<div class="container"></div>
12+
</body>
13+
</html>
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<!DOCTYPE html>
2+
<html class="reftest-wait">
3+
<link rel="help" href="https://drafts.csswg.org/css-shapes-1/#basic-shape-interpolation">
4+
<link rel="match" href="clip-path-animation-mixed-calc-ref.html">
5+
<!--
6+
This test PASSES if a running clip path animation with a mixed-unit
7+
calc changes in response to changes in font size and element size.
8+
-->
9+
<style>
10+
#animated {
11+
width: 100px;
12+
height: 100px;
13+
font-size: 10px;
14+
background-color: green;
15+
animation: clippath 20s steps(2, jump-end) -10.05s;
16+
}
17+
18+
#animated.override {
19+
width: 150px;
20+
height: 150px;
21+
font-size: 15px;
22+
}
23+
24+
@keyframes clippath {
25+
0% { clip-path: circle(10px at 50% 50%); }
26+
100% { clip-path: circle(calc(20% + 2em) at 50% 50%); }
27+
}
28+
</style>
29+
<script src="/common/reftest-wait.js"></script>
30+
<script src="/web-animations/resources/timing-utils.js"></script>
31+
<body>
32+
<div id="animated"></div>
33+
<script>
34+
let element = document.getElementById("animated");
35+
let animation = document.getAnimations()[0];
36+
animation.ready.then(() => {
37+
element.className = "override";
38+
requestAnimationFrame(takeScreenshot);
39+
})
40+
</script>
41+
</body>
42+
</html>

0 commit comments

Comments
 (0)