diff options
author | Alexander Narsudinov <a.narsudinov@gmail.com> | 2022-12-16 17:45:03 +0300 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-12-17 18:27:57 +0100 |
commit | f2d7690702fadd4bd4bdee7229461357ea7d56e6 (patch) | |
tree | 5aaa2e3d32c3004319121919e3be1e06f6329e75 /Userland/Libraries/LibWeb/DOM | |
parent | ce6cf5bab8322412c14aa8a273f1fa4714769248 (diff) | |
download | serenity-f2d7690702fadd4bd4bdee7229461357ea7d56e6.zip |
LibWeb: Add NamedNodeMap::getNamedItemNS()
This patch allows us to use method getNamedItemNS() of NamedNodeMap API.
Diffstat (limited to 'Userland/Libraries/LibWeb/DOM')
-rw-r--r-- | Userland/Libraries/LibWeb/DOM/NamedNodeMap.cpp | 6 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/DOM/NamedNodeMap.h | 1 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/DOM/NamedNodeMap.idl | 2 |
3 files changed, 8 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/DOM/NamedNodeMap.cpp b/Userland/Libraries/LibWeb/DOM/NamedNodeMap.cpp index 5ba887d206..6d47d3c065 100644 --- a/Userland/Libraries/LibWeb/DOM/NamedNodeMap.cpp +++ b/Userland/Libraries/LibWeb/DOM/NamedNodeMap.cpp @@ -80,6 +80,12 @@ Attr const* NamedNodeMap::get_named_item(StringView qualified_name) const return get_attribute(qualified_name); } +// https://dom.spec.whatwg.org/#dom-namednodemap-getnameditemns +Attr const* NamedNodeMap::get_named_item_ns(StringView namespace_, StringView local_name) const +{ + return get_attribute_ns(namespace_, local_name); +} + // https://dom.spec.whatwg.org/#dom-namednodemap-setnameditem WebIDL::ExceptionOr<Attr const*> NamedNodeMap::set_named_item(Attr& attribute) { diff --git a/Userland/Libraries/LibWeb/DOM/NamedNodeMap.h b/Userland/Libraries/LibWeb/DOM/NamedNodeMap.h index b79e65a12f..9e6d25c60c 100644 --- a/Userland/Libraries/LibWeb/DOM/NamedNodeMap.h +++ b/Userland/Libraries/LibWeb/DOM/NamedNodeMap.h @@ -36,6 +36,7 @@ public: // Methods defined by the spec for JavaScript: Attr const* item(u32 index) const; Attr const* get_named_item(StringView qualified_name) const; + Attr const* get_named_item_ns(StringView namespace_, StringView local_name) const; WebIDL::ExceptionOr<Attr const*> set_named_item(Attr& attribute); WebIDL::ExceptionOr<Attr const*> remove_named_item(StringView qualified_name); diff --git a/Userland/Libraries/LibWeb/DOM/NamedNodeMap.idl b/Userland/Libraries/LibWeb/DOM/NamedNodeMap.idl index b5230735d0..8fa192a842 100644 --- a/Userland/Libraries/LibWeb/DOM/NamedNodeMap.idl +++ b/Userland/Libraries/LibWeb/DOM/NamedNodeMap.idl @@ -6,7 +6,7 @@ interface NamedNodeMap { getter Attr? item(unsigned long index); getter Attr? getNamedItem(DOMString qualifiedName); - // Attr? getNamedItemNS(DOMString? namespace, DOMString localName); + Attr? getNamedItemNS(DOMString? namespace, DOMString localName); [CEReactions] Attr? setNamedItem(Attr attr); // [CEReactions] Attr? setNamedItemNS(Attr attr); |