mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 17:28:30 +00:00
LibWeb/SVG: Process script element when its text content changes
This commit is contained in:
committed by
Jelle Raaijmakers
parent
db7aa68340
commit
a187d5f28f
@@ -35,6 +35,24 @@ void SVGScriptElement::visit_edges(Cell::Visitor& visitor)
|
||||
visitor.visit(m_script);
|
||||
}
|
||||
|
||||
void SVGScriptElement::inserted()
|
||||
{
|
||||
Base::inserted();
|
||||
if (m_parser_inserted)
|
||||
return;
|
||||
|
||||
process_the_script_element();
|
||||
}
|
||||
|
||||
void SVGScriptElement::children_changed(ChildrenChangedMetadata const* metadata)
|
||||
{
|
||||
Base::children_changed(metadata);
|
||||
if (m_parser_inserted)
|
||||
return;
|
||||
|
||||
process_the_script_element();
|
||||
}
|
||||
|
||||
// https://www.w3.org/TR/SVGMobile12/script.html#ScriptContentProcessing
|
||||
void SVGScriptElement::process_the_script_element()
|
||||
{
|
||||
@@ -114,6 +132,8 @@ void SVGScriptElement::process_the_script_element()
|
||||
} else {
|
||||
// Inline script content
|
||||
script_content = child_text_content();
|
||||
if (script_content.is_empty())
|
||||
return;
|
||||
}
|
||||
|
||||
// 3. The 'script' element's "already processed" flag is set to true.
|
||||
|
||||
Reference in New Issue
Block a user