@@ -15,12 +15,12 @@ namespace Web::SVG {
1515
1616GC_DEFINE_ALLOCATOR (SVGAnimatedString);
1717
18- GC::Ref<SVGAnimatedString> SVGAnimatedString::create (JS::Realm& realm, GC::Ref<SVGElement> element, FlyString reflected_attribute, Optional<FlyString > deprecated_reflected_attribute, Optional<FlyString> initial_value)
18+ GC::Ref<SVGAnimatedString> SVGAnimatedString::create (JS::Realm& realm, GC::Ref<SVGElement> element, DOM::QualifiedName reflected_attribute, Optional<DOM::QualifiedName > deprecated_reflected_attribute, Optional<FlyString> initial_value)
1919{
2020 return realm.create <SVGAnimatedString>(realm, element, move (reflected_attribute), move (deprecated_reflected_attribute), move (initial_value));
2121}
2222
23- SVGAnimatedString::SVGAnimatedString (JS::Realm& realm, GC::Ref<SVGElement> element, FlyString reflected_attribute, Optional<FlyString > deprecated_reflected_attribute, Optional<FlyString> initial_value)
23+ SVGAnimatedString::SVGAnimatedString (JS::Realm& realm, GC::Ref<SVGElement> element, DOM::QualifiedName reflected_attribute, Optional<DOM::QualifiedName > deprecated_reflected_attribute, Optional<FlyString> initial_value)
2424 : Bindings::PlatformObject(realm)
2525 , m_element(element)
2626 , m_reflected_attribute(move(reflected_attribute))
@@ -48,11 +48,11 @@ String SVGAnimatedString::base_val() const
4848{
4949 // On getting baseVal or animVal, the following steps are run:
5050 // 1. If the reflected attribute is not present, then:
51- if (!m_element->has_attribute (m_reflected_attribute)) {
51+ if (!m_element->has_attribute_ns (m_reflected_attribute. namespace_ (), m_reflected_attribute. local_name () )) {
5252 // 1. If the SVGAnimatedString object is defined to additionally reflect a second, deprecated attribute,
5353 // and that attribute is present, then return its value.
5454 if (m_deprecated_reflected_attribute.has_value ()) {
55- if (auto attribute = m_element->get_attribute (m_deprecated_reflected_attribute. value ()); attribute.has_value ())
55+ if (auto attribute = m_element->get_attribute_ns (m_deprecated_reflected_attribute-> namespace_ (), m_deprecated_reflected_attribute-> local_name ()); attribute.has_value ())
5656 return attribute.release_value ();
5757 }
5858
@@ -65,7 +65,7 @@ String SVGAnimatedString::base_val() const
6565 }
6666
6767 // 2. Otherwise, the reflected attribute is present. Return its value.
68- return m_element->attribute (m_reflected_attribute).value ();
68+ return m_element->get_attribute_ns (m_reflected_attribute. namespace_ (), m_reflected_attribute. local_name () ).value ();
6969}
7070
7171// https://svgwg.org/svg2-draft/types.html#__svg__SVGAnimatedString__baseVal
@@ -74,15 +74,15 @@ void SVGAnimatedString::set_base_val(String const& base_val)
7474 // 1. If the reflected attribute is not present, the SVGAnimatedString object is defined to additionally reflect
7575 // a second, deprecated attribute, and that deprecated attribute is present, then set that deprecated attribute
7676 // to the specified value.
77- if (!m_element->has_attribute (m_reflected_attribute)
77+ if (!m_element->has_attribute_ns (m_reflected_attribute. namespace_ (), m_reflected_attribute. local_name () )
7878 && m_deprecated_reflected_attribute.has_value ()
79- && m_element->has_attribute (m_deprecated_reflected_attribute. value ())) {
80- MUST ( m_element->set_attribute (m_deprecated_reflected_attribute. value (), base_val));
79+ && m_element->has_attribute_ns (m_deprecated_reflected_attribute-> namespace_ (), m_deprecated_reflected_attribute-> local_name ())) {
80+ m_element->set_attribute_value (m_deprecated_reflected_attribute-> local_name (), base_val, m_deprecated_reflected_attribute-> prefix (), m_deprecated_reflected_attribute-> namespace_ ( ));
8181 return ;
8282 }
8383
8484 // 2. Otherwise, set the reflected attribute to the specified value.
85- MUST ( m_element->set_attribute (m_reflected_attribute, base_val));
85+ m_element->set_attribute_value (m_reflected_attribute. local_name () , base_val, m_reflected_attribute. prefix (), m_reflected_attribute. namespace_ ( ));
8686}
8787
8888}
0 commit comments