Browse Source

LibWeb: Allow references via `xlink:href` for SVG `<use>` elements

MacDue 1 năm trước cách đây
mục cha
commit
0a061a6a63
1 tập tin đã thay đổi với 1 bổ sung2 xóa
  1. 1 2
      Userland/Libraries/LibWeb/SVG/SVGUseElement.cpp

+ 1 - 2
Userland/Libraries/LibWeb/SVG/SVGUseElement.cpp

@@ -58,8 +58,7 @@ void SVGUseElement::attribute_changed(FlyString const& name, Optional<String> co
         m_x = AttributeParser::parse_coordinate(value.value_or(String {}));
     } else if (name == SVG::AttributeNames::y) {
         m_y = AttributeParser::parse_coordinate(value.value_or(String {}));
-    } else if (name == SVG::AttributeNames::href) {
-        // FIXME: Support the xlink:href attribute as a fallback
+    } else if (name == SVG::AttributeNames::href || name == "xlink:href"_fly_string) {
         m_referenced_id = parse_id_from_href(value.value_or(String {}));
 
         clone_element_tree_as_our_shadow_tree(referenced_element());