mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:57:44 +00:00
LibWeb: Use Element::id() when deciding whether to update SVG use trees
This commit is contained in:
parent
65787fffe4
commit
204c46f097
1 changed files with 2 additions and 2 deletions
|
@ -61,7 +61,7 @@ void SVGElement::update_use_elements_that_reference_this()
|
||||||
// If this element is in a shadow root, it already represents a clone and is not itself referenced.
|
// If this element is in a shadow root, it already represents a clone and is not itself referenced.
|
||||||
|| is<DOM::ShadowRoot>(this->root())
|
|| is<DOM::ShadowRoot>(this->root())
|
||||||
// If this does not have an id it cannot be referenced, no point in searching the entire DOM tree.
|
// If this does not have an id it cannot be referenced, no point in searching the entire DOM tree.
|
||||||
|| !this->has_attribute(HTML::AttributeNames::id)
|
|| !id().has_value()
|
||||||
// An unconnected node cannot have valid references.
|
// An unconnected node cannot have valid references.
|
||||||
// This also prevents searches for elements that are in the process of being constructed - as clones.
|
// This also prevents searches for elements that are in the process of being constructed - as clones.
|
||||||
|| !this->is_connected()
|
|| !this->is_connected()
|
||||||
|
@ -87,7 +87,7 @@ void SVGElement::removed_from(Node* parent)
|
||||||
|
|
||||||
void SVGElement::remove_from_use_element_that_reference_this()
|
void SVGElement::remove_from_use_element_that_reference_this()
|
||||||
{
|
{
|
||||||
if (is<SVGUseElement>(this) || !this->has_attribute(HTML::AttributeNames::id)) {
|
if (is<SVGUseElement>(this) || !id().has_value()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue