1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:07:44 +00:00

LibWeb: Port SVGUseElement from ByteString

This commit is contained in:
Shannon Booth 2023-12-24 15:39:06 +13:00 committed by Andreas Kling
parent 64411127cb
commit 7909475b14
2 changed files with 3 additions and 3 deletions

View file

@ -58,13 +58,13 @@ void SVGUseElement::attribute_changed(FlyString const& name, Optional<String> co
m_y = AttributeParser::parse_coordinate(value.value_or(String {}));
} else if (name == SVG::AttributeNames::href) {
// FIXME: Support the xlink:href attribute as a fallback
m_referenced_id = parse_id_from_href(value.value_or(String {}).to_byte_string());
m_referenced_id = parse_id_from_href(value.value_or(String {}));
clone_element_tree_as_our_shadow_tree(referenced_element());
}
}
Optional<FlyString> SVGUseElement::parse_id_from_href(ByteString const& href)
Optional<FlyString> SVGUseElement::parse_id_from_href(StringView href)
{
auto id_seperator = href.find('#');
if (!id_seperator.has_value()) {