LibWeb/SVG: Remove remaining user of of old try_resolve_url_to()

This commit is contained in:
Sam Atkins 2025-04-30 10:50:48 +01:00
commit 094c2bbc89
Notes: github-actions[bot] 2025-04-30 16:39:33 +00:00
2 changed files with 1 additions and 17 deletions

View file

@ -79,19 +79,6 @@ protected:
Gfx::AffineTransform m_transform = {};
template<typename T>
GC::Ptr<T> try_resolve_url_to(URL::URL const& url) const
{
if (!url.fragment().has_value())
return {};
auto node = document().get_element_by_id(*url.fragment());
if (!node)
return {};
if (is<T>(*node))
return static_cast<T&>(*node);
return {};
}
template<typename T>
GC::Ptr<T> try_resolve_url_to(CSS::URL const& url) const
{

View file

@ -24,10 +24,7 @@ GC::Ptr<SVGGeometryElement const> SVGTextPathElement::path_or_shape() const
auto href = get_attribute(AttributeNames::href);
if (!href.has_value())
return {};
auto url = document().url().complete_url(*href);
if (!url.has_value())
return {};
return try_resolve_url_to<SVGGeometryElement const>(*url);
return try_resolve_url_to<SVGGeometryElement const>(*href);
}
void SVGTextPathElement::initialize(JS::Realm& realm)