1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 05:27:43 +00:00

LibWeb: Run scripts in XML SVG documents

This will be needed to add a hit testing test for #22305.
This commit is contained in:
MacDue 2024-02-17 21:15:58 +00:00 committed by Alexander Kalenik
parent 2ede299b4a
commit 4843100650

View file

@ -8,6 +8,8 @@
#include <LibWeb/HTML/HTMLTemplateElement.h>
#include <LibWeb/HTML/Window.h>
#include <LibWeb/HighResolutionTime/TimeOrigin.h>
#include <LibWeb/SVG/SVGScriptElement.h>
#include <LibWeb/SVG/TagNames.h>
#include <LibWeb/XML/XMLDocumentBuilder.h>
inline namespace {
@ -128,7 +130,15 @@ void XMLDocumentBuilder::element_end(const XML::Name& name)
// There is no longer a pending parsing-blocking script.
}
}
} else if (m_scripting_support == XMLScriptingSupport::Enabled && m_current_node->is_svg_script_element()) {
// https://www.w3.org/TR/SVGMobile12/struct.html#ProgressiveRendering
// When an end element event occurs for a 'script' element, that element is processed according to the
// Script processing section of the Scripting chapter. Further parsing of the document will be blocked
// until processing of the 'script' is complete.
auto& script_element = static_cast<SVG::SVGScriptElement&>(*m_current_node);
script_element.process_the_script_element();
};
m_current_node = m_current_node->parent_node();
}