summaryrefslogtreecommitdiff
path: root/Source/WebCore/dom/NamedNodeMap.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/dom/NamedNodeMap.h')
-rw-r--r--Source/WebCore/dom/NamedNodeMap.h51
1 files changed, 16 insertions, 35 deletions
diff --git a/Source/WebCore/dom/NamedNodeMap.h b/Source/WebCore/dom/NamedNodeMap.h
index fc8bfbe8b..2cb596449 100644
--- a/Source/WebCore/dom/NamedNodeMap.h
+++ b/Source/WebCore/dom/NamedNodeMap.h
@@ -22,60 +22,41 @@
*
*/
-#ifndef NamedNodeMap_h
-#define NamedNodeMap_h
+#pragma once
+#include "ExceptionOr.h"
#include "ScriptWrappable.h"
-#include <wtf/PassOwnPtr.h>
-#include <wtf/PassRefPtr.h>
-#include <wtf/text/AtomicString.h>
namespace WebCore {
-class Node;
+class Attr;
class Element;
-typedef int ExceptionCode;
-
class NamedNodeMap : public ScriptWrappable {
WTF_MAKE_FAST_ALLOCATED;
- friend class Element;
public:
- static PassOwnPtr<NamedNodeMap> create(Element& element)
+ explicit NamedNodeMap(Element& element)
+ : m_element(element)
{
- return adoptPtr(new NamedNodeMap(element));
}
- void ref();
- void deref();
-
- // Public DOM interface.
-
- PassRefPtr<Node> getNamedItem(const AtomicString&) const;
- PassRefPtr<Node> removeNamedItem(const AtomicString& name, ExceptionCode&);
-
- PassRefPtr<Node> getNamedItemNS(const AtomicString& namespaceURI, const AtomicString& localName) const;
- PassRefPtr<Node> removeNamedItemNS(const AtomicString& namespaceURI, const AtomicString& localName, ExceptionCode&);
+ WEBCORE_EXPORT void ref();
+ WEBCORE_EXPORT void deref();
- PassRefPtr<Node> setNamedItem(Node*, ExceptionCode&);
- PassRefPtr<Node> setNamedItemNS(Node*, ExceptionCode&);
+ WEBCORE_EXPORT unsigned length() const;
+ WEBCORE_EXPORT RefPtr<Attr> item(unsigned index) const;
+ WEBCORE_EXPORT RefPtr<Attr> getNamedItem(const AtomicString&) const;
+ WEBCORE_EXPORT RefPtr<Attr> getNamedItemNS(const AtomicString& namespaceURI, const AtomicString& localName) const;
+ WEBCORE_EXPORT ExceptionOr<RefPtr<Attr>> setNamedItem(Attr&);
+ WEBCORE_EXPORT ExceptionOr<Ref<Attr>> removeNamedItem(const AtomicString& name);
+ WEBCORE_EXPORT ExceptionOr<Ref<Attr>> removeNamedItemNS(const AtomicString& namespaceURI, const AtomicString& localName);
- PassRefPtr<Node> item(unsigned index) const;
- unsigned length() const;
+ Vector<String> supportedPropertyNames() const;
- // FIXME: It's lame that the bindings generator chokes if we return Element& here.
- Element* element() const { return &m_element; }
+ Element& element() { return m_element; }
private:
- explicit NamedNodeMap(Element& element)
- : m_element(element)
- {
- // Only supports NamedNodeMaps with Element associated, DocumentType.entities and DocumentType.notations are not supported yet.
- }
-
Element& m_element;
};
} // namespace WebCore
-
-#endif // NamedNodeMap_h