Files
ladybird/Tests/LibWeb/Text/input/SVG/getBBox-marker-crash.html
Pavel Shliak 88500580e6 LibWeb: Make getBBox() throw error for non-rendered elements
Per SVG2 spec (§ Geometry Properties: getBBox), getBBox() must throw
InvalidStateError if the element is not rendered and its geometry cannot
be computed. Previously we would crash on null paintables; now we throw
with a clear error instead.
2025-10-06 00:14:04 +02:00

17 lines
386 B
HTML

<!DOCTYPE html>
<script src="../include.js"></script>
<svg width="1" height="1">
<marker id="mk" markerWidth="1" markerHeight="1">
<circle id="t" cx="0" cy="0" r="0"></circle>
</marker>
</svg>
<script>
test(() => {
try {
document.getElementById("t").getBBox();
println("Did not throw");
} catch (e) {
println(`Threw ${e.name}`);
}
});
</script>