mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 02:05:07 +02:00
SVG images loaded as <img> elements must not execute scripts per spec. Previously, SVGScriptElement::process_the_script_element() did not check whether scripting was disabled, so script processing was triggered via the children_changed() callback during XML parsing, causing a nested event loop spin. Fix this by: - Disabling scripting on the SVG image's Page - Passing XMLScriptingSupport::Disabled to the XML document builder - Checking is_scripting_disabled() in SVGScriptElement before processing any script element - Logging a diagnostic when SVG XML parsing fails (previously the parse result was silently discarded)
8 lines
358 B
XML
8 lines
358 B
XML
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" width="100" height="100">
|
|
<script>document.documentElement.innerHTML = ''</script>
|
|
<rect width="50" height="100" fill="green"/>
|
|
<script>document.querySelector('rect').setAttribute('width', '0')</script>
|
|
<rect x="50" width="50" height="100" fill="green"/>
|
|
<script>void 0</script>
|
|
</svg>
|