瀏覽代碼

LibWeb: Make Element::has_attribute_ns take a StringView

Similar to Element::has_attribute, ideally this would take a
`FlyString const&`, but NamedNodeMap::get_attribute_ns already takes a
StringView. To aid in porting away from DeprecatedString, just take a
StringView for now.
Shannon Booth 1 年之前
父節點
當前提交
e5e4920e66
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      Userland/Libraries/LibWeb/DOM/Element.cpp
  2. 1 1
      Userland/Libraries/LibWeb/DOM/Element.h

+ 1 - 1
Userland/Libraries/LibWeb/DOM/Element.cpp

@@ -310,7 +310,7 @@ bool Element::has_attribute(StringView name) const
 }
 }
 
 
 // https://dom.spec.whatwg.org/#dom-element-hasattributens
 // https://dom.spec.whatwg.org/#dom-element-hasattributens
-bool Element::has_attribute_ns(DeprecatedFlyString namespace_, DeprecatedFlyString const& name) const
+bool Element::has_attribute_ns(StringView namespace_, StringView name) const
 {
 {
     // 1. If namespace is the empty string, then set it to null.
     // 1. If namespace is the empty string, then set it to null.
     if (namespace_.is_empty())
     if (namespace_.is_empty())

+ 1 - 1
Userland/Libraries/LibWeb/DOM/Element.h

@@ -93,7 +93,7 @@ public:
 
 
     // FIXME: This should be taking a 'FlyString const&'
     // FIXME: This should be taking a 'FlyString const&'
     bool has_attribute(StringView name) const;
     bool has_attribute(StringView name) const;
-    bool has_attribute_ns(DeprecatedFlyString namespace_, DeprecatedFlyString const& name) const;
+    bool has_attribute_ns(StringView namespace_, StringView name) const;
     bool has_attributes() const;
     bool has_attributes() const;
 
 
     // FIXME: This should be taking a 'FlyString const&'
     // FIXME: This should be taking a 'FlyString const&'