Commit Graph

6 Commits

Author SHA1 Message Date
Shannon Booth
e1171618d4 LibWeb/SVG: Detect invalid circular reference for <use> elements
Previously, referencing an element that eventually pointed back to
the original <use> element would cause a stack overflow.

We now look at the referenced element and follow every <use> element
in its subtree and aim to detect any duplicates. If so, we consider
that referenced element invalid.
2026-01-21 22:26:14 +01:00
Gingeh
690c48d912 LibWeb: Don't crash from svg mask reference cycles 2025-12-20 23:54:54 -06:00
Tim Ledbetter
551c7f966b LibWeb: Use correct root element when resolving paint properties
Previously, the first `HTMLHtmlELement` in the given document would
always be  used when determining whether to propagate background
properties to the body element. This meant the wrong root element was
used for SVG `foreignObject` elements, which could lead to a crash.
2025-09-10 11:35:02 +02:00
Andreas Kling
3873b1d8cf LibWeb: Create XML document object for SVG-as-image
It's not enough to just use the XML parser, we also have to make sure
the DOM document we produce is an actual XML document.

Fixes #5966
2025-08-23 14:01:37 +01:00
Tim Ledbetter
1263d58689 LibWeb: Ignore zero width when calculating SVG intrinsic aspect ratio
Previously, an SVG with width of zero would have am intrinsic aspect
ratio of zero. With this change, if an SVG has a width or height of
zero, the intrinsic aspect ratio is determined by the SVG's viewbox.
2025-07-21 11:29:25 +02:00
Tim Ledbetter
488333aa4b Tests: Convert an SVG text test to a crash test
This should have been a crash test, but the test runner previously
didn't wait long enough for the test to crash.
2025-07-14 13:05:17 -04:00