mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
54 lines
No EOL
1.6 KiB
HTML
54 lines
No EOL
1.6 KiB
HTML
<!doctype html>
|
|
<html>
|
|
<meta charset="utf-8">
|
|
<title>Test the behavior of one discard applied on another discard</title>
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<script src="/resources/SVGAnimationTestCase-testharness.js"></script>
|
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<animate id="anim" attributeName="visibility" to="visible" begin="0s" end="5s"/>
|
|
<rect x="0" y="0" width="50" height="50" fill="rgb(255, 0, 0)">
|
|
<set id="set1" attributeName="fill" to="rgb(0, 255, 0)" begin="2s" fill="freeze"/>
|
|
<set id="set2" attributeName="fill" to="rgb(0, 0, 255)" begin="3s" fill="freeze"/>
|
|
</rect>
|
|
|
|
<discard id="discard1" xlink:href="#set1" begin="1s"/>
|
|
<discard id="discard2" xlink:href="#set2"/>
|
|
<discard id="discard3" xlink:href="#discard1"/>
|
|
</svg>
|
|
|
|
<script>
|
|
var rootSVGElement = document.querySelector("svg");
|
|
var epsilon = 1.0;
|
|
|
|
// Setup animation test
|
|
function sample1() {
|
|
expectFillColor(rect1, 255, 0, 0);
|
|
}
|
|
|
|
function sample2() {
|
|
expectFillColor(rect1, 0, 255, 0);
|
|
}
|
|
|
|
smil_async_test((t) => {
|
|
var rects = rootSVGElement.ownerDocument.getElementsByTagName("rect");
|
|
rect1 = rects[0];
|
|
|
|
const expectedValues = [
|
|
// [animationId, time, sampleCallback]
|
|
["anim", 0.0, sample1],
|
|
["anim", 0.01, sample1],
|
|
["anim", 2.0, sample2],
|
|
["anim", 2.01, sample2],
|
|
["anim", 3.0, sample2],
|
|
["anim", 3.01, sample2]
|
|
];
|
|
|
|
runAnimationTest(t, expectedValues);
|
|
});
|
|
|
|
window.animationStartsImmediately = true;
|
|
|
|
</script> |