diff --git a/Userland/Libraries/LibWeb/SVG/SVGUseElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGUseElement.cpp index ea201fc6419..e506855f6e5 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGUseElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGUseElement.cpp @@ -131,14 +131,14 @@ JS::GCPtr SVGUseElement::referenced_element() } // https://svgwg.org/svg2-draft/struct.html#UseShadowTree -void SVGUseElement::clone_element_tree_as_our_shadow_tree(Element* to_clone) const +void SVGUseElement::clone_element_tree_as_our_shadow_tree(Element* to_clone) { - const_cast(*shadow_root()).remove_all_children(); + shadow_root()->remove_all_children(); if (to_clone && is_valid_reference_element(*to_clone)) { // The ‘use’ element references another element, a copy of which is rendered in place of the ‘use’ in the document. auto cloned_reference_node = MUST(to_clone->clone_node(nullptr, true)); - const_cast(*shadow_root()).append_child(cloned_reference_node).release_value_but_fixme_should_propagate_errors(); + shadow_root()->append_child(cloned_reference_node).release_value_but_fixme_should_propagate_errors(); } } diff --git a/Userland/Libraries/LibWeb/SVG/SVGUseElement.h b/Userland/Libraries/LibWeb/SVG/SVGUseElement.h index 09f8c621fc0..49032284ef3 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGUseElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGUseElement.h @@ -57,7 +57,7 @@ private: JS::GCPtr referenced_element(); - void clone_element_tree_as_our_shadow_tree(Element* to_clone) const; + void clone_element_tree_as_our_shadow_tree(Element* to_clone); bool is_valid_reference_element(Element const& reference_element) const; Optional m_x;