1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 22:48:11 +00:00

LibWeb: Make Element::has_attribute take a StringView

It calls Element::get_attribute which takes a StringView. Ultimately,
this should be taking a FlyString, but to help in porting away from
DeprecatedString, just leave a FIXME for that for now.
This commit is contained in:
Shannon Booth 2023-09-21 20:26:19 +12:00 committed by Andreas Kling
parent 52fccae654
commit 79f97da4b4
5 changed files with 8 additions and 5 deletions

View file

@ -94,7 +94,7 @@ JS::GCPtr<SVGGradientElement const> SVGGradientElement::linked_gradient() const
// FIXME: This entire function is an ad-hoc hack!
// It can only resolve #<ids> in the same document.
auto link = has_attribute("href") ? get_attribute("href") : get_attribute("xlink:href");
auto link = has_attribute(AttributeNames::href) ? get_attribute(AttributeNames::href) : get_attribute("xlink:href"sv);
if (auto href = link; !href.is_empty()) {
auto url = document().parse_url(href);
auto id = url.fragment();