Files
ladybird/Tests/LibWeb/Text/input/SVG/getBBox-pattern-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
406 B
HTML

<!DOCTYPE html>
<script src="../include.js"></script>
<svg width="1" height="1">
<pattern id="pat" width="1" height="1" patternUnits="userSpaceOnUse">
<rect id="tp" width="1" height="1"></rect>
</pattern>
</svg>
<script>
test(() => {
try {
document.getElementById("tp").getBBox();
println("Did not throw");
} catch (e) {
println(`Threw ${e.name}`);
}
});
</script>