diff --git a/Userland/Libraries/LibWeb/SVG/SVGElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGElement.cpp index a7f8582b65..562342124c 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGElement.cpp @@ -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. || is(this->root()) // 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. // This also prevents searches for elements that are in the process of being constructed - as clones. || !this->is_connected() @@ -87,7 +87,7 @@ void SVGElement::removed_from(Node* parent) void SVGElement::remove_from_use_element_that_reference_this() { - if (is(this) || !this->has_attribute(HTML::AttributeNames::id)) { + if (is(this) || !id().has_value()) { return; }