mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Update web-platform-tests to revision b'ee6da9d71d0268d7fdb04e8e5b26858f46ee0cc4'
This commit is contained in:
parent
4401622eb1
commit
b77ad115f6
16832 changed files with 270819 additions and 87621 deletions
|
@ -0,0 +1,51 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="UTF-8">
|
||||
<title>content animation</title>
|
||||
<link rel="help" href="https://drafts.csswg.org/css-content/#content-property">
|
||||
<meta name="test" content="box-shadow supports animation">
|
||||
<link rel="author" href="mailto:graouts@apple.com" title="Antoine Quint">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<style>
|
||||
|
||||
.target::after {
|
||||
content: "default";
|
||||
}
|
||||
|
||||
@keyframes content-animation {
|
||||
from { content: "from" }
|
||||
to { content: "to" }
|
||||
}
|
||||
|
||||
.target.animated::after {
|
||||
animation: content-animation 1s paused linear forwards;
|
||||
}
|
||||
|
||||
</style>
|
||||
<body>
|
||||
<div class="target"></div>
|
||||
<script>
|
||||
|
||||
test(function() {
|
||||
const target = document.querySelector(".target");
|
||||
const style = getComputedStyle(target, "::after");
|
||||
|
||||
assert_equals(style.content, '"default"', "Before the animation is applied.");
|
||||
|
||||
target.classList.add("animated");
|
||||
const animation = target.getAnimations({ subtree: true })[0];
|
||||
|
||||
const testContentAtTime = (time, expected) => {
|
||||
animation.currentTime = time;
|
||||
assert_equals(style.content, `"${expected}"`, `Check the animated value at time = ${time}ms`);
|
||||
};
|
||||
|
||||
testContentAtTime(0, 'from');
|
||||
testContentAtTime(499, 'from');
|
||||
testContentAtTime(500, 'to');
|
||||
testContentAtTime(999, 'to');
|
||||
testContentAtTime(1000, 'to');
|
||||
}, "The content property can be animated with a discrete animation type.");
|
||||
|
||||
</script>
|
||||
</body>
|
Loading…
Add table
Add a link
Reference in a new issue