LibWeb: Handle reference cycles in SVG gradient linking

Since SVG gradients can reference each other, we have to keep track of
visited gradients when traversing the link chain, or we will recurse
infinitely when there's a reference cycle.
This commit is contained in:
Andreas Kling 2024-03-10 12:18:09 +01:00
commit 2e0297d703
Notes: sideshowbarker 2024-07-17 02:14:39 +09:00
8 changed files with 155 additions and 36 deletions

View file

@ -0,0 +1,13 @@
<!doctype html>
<script src="../include.js"></script>
<svg>
<linearGradient id="lol" href="#lmao"/>
<linearGradient id="lmao" href="#even"/>
<linearGradient id="even" href="#lol"/>
<rect fill="url(#lol)" />
</svg>
<script>
test(() => {
println("PASS (didn't hang or crash)");
});
</script>