Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!doctype html>
<html class="reftest-wait">
<head>
<meta charset="utf-8">
<title>discard element removes the element it references and itself</title>
<script src="/common/rendering-utils.js"></script>
<script src="/common/reftest-wait.js"></script>
<link rel="match" href="reference/green-100x100.svg">
</head>
<body>
<style>
html, body, svg {
padding: 0;
margin: 0;
}
</style>
<svg onload="startTest()">
<rect id="r1" width="100" height="100" fill="green"/>
<rect id="r2" width="100" height="100" fill="red" />
<discard id="discard1" href="#r2" begin="2s"/>
<set attributeName="display" to="inline" begin="2.01s" dur="1s" fill="freeze" onbegin="checkDelete()"/>
<script>
function startTest() {
document.documentElement.setCurrentTime(2);
}
function checkDelete() {
let d1 = document.getElementById("discard1");
let r2 = document.getElementById("r2");
if (d1 || r2) {
document.getElementById("r1").setAttribute("fill", "orange");
}
takeScreenshot();
}
</script>
</svg>
</body>
</html>