1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 09:57:35 +00:00

AK: Port URL::m_fragment from DeprecatedString to String

This commit is contained in:
Shannon Booth 2023-08-12 16:52:42 +12:00 committed by Andrew Kaster
parent 5663a2d3b4
commit 9d60f23abc
21 changed files with 68 additions and 76 deletions

View file

@ -87,9 +87,9 @@ JS::GCPtr<SVGGradientElement const> SVGGradientElement::linked_gradient() const
if (auto href = link; !href.is_empty()) {
auto url = document().parse_url(href);
auto id = url.fragment();
if (id.is_empty())
if (!id.has_value() || id->is_empty())
return {};
auto element = document().get_element_by_id(id);
auto element = document().get_element_by_id(id->to_deprecated_string());
if (!element)
return {};
if (!is<SVGGradientElement>(*element))

View file

@ -46,8 +46,10 @@ Optional<Gfx::PaintStyle const&> SVGGraphicsElement::svg_paint_computed_value_to
// FIXME: This entire function is an ad-hoc hack:
if (!paint_value.has_value() || !paint_value->is_url())
return {};
auto& url = paint_value->as_url();
auto gradient = document().get_element_by_id(url.fragment());
auto const& url = paint_value->as_url();
if (!url.fragment().has_value())
return {};
auto gradient = document().get_element_by_id(url.fragment()->to_deprecated_string());
if (!gradient)
return {};
if (is<SVG::SVGGradientElement>(*gradient))