Browse files

:3

  • Loading branch information...
1 parent 3ced362 commit 774d7cc19fce30bd0676277e516352ef614006fb cHoBi committed Oct 7, 2008
Showing with 19 additions and 12 deletions.
  1. +6 −0 lib/DOM/Element.cpp
  2. +6 −6 lib/DOM/NamedNodeMap.cpp
  3. +4 −4 lib/DOM/NamedNodeMap.h
  4. +3 −2 lib/DOM/Node.h
View
6 lib/DOM/Element.cpp
@@ -71,6 +71,12 @@ Element::removeAttribute (const DOMString& name) throw()
}
}
+Attr*
+Element::getAttributeNode (const DOMString& name)
+{
+ return _attributes.getNamedItem (name);
+}
+
};
};
View
12 lib/DOM/NamedNodeMap.cpp
@@ -26,7 +26,7 @@ NamedNodeMap::NamedNodeMap (Node* ownerNode)
}
Node*
-NamedNodeMap::getNamedItem (DOMString name)
+NamedNodeMap::getNamedItem (const DOMString& name)
{
return _items[name];
}
@@ -66,7 +66,7 @@ NamedNodeMap::setNamedItem (Node* node) throw ()
Node*
-NamedNodeMap::removeNamedItem (DOMString name)
+NamedNodeMap::removeNamedItem (const DOMString& name)
{
if (_items.find(name) != _items.end()) {
Node *removed = _items[name];
@@ -85,7 +85,7 @@ NamedNodeMap::item (unsigned long index)
return NULL;
}
- std::map<DOMString, Node*>::iterator item;
+ std::map<const DOMString&, Node*>::iterator item;
size_t i;
for (item = _items.begin(), i = 0; item != _items.end(); item++, i++) {
if (index == i) {
@@ -102,21 +102,21 @@ NamedNodeMap::length (void)
/// @todo Not implemented yet.
Node*
-NamedNodeMap::getNamedItemNS (DOMString namespaceURI, DOMString localName) throw (DOMException)
+NamedNodeMap::getNamedItemNS (const DOMString& namespaceURI, const DOMString& localName) throw (DOMException)
{
return NULL;
}
/// @todo Not implemented yet.
Node*
-NamedNodeMap::setNamedItemNS (DOMString namespaceURI, DOMString localName) throw (DOMException)
+NamedNodeMap::setNamedItemNS (const DOMString& namespaceURI, const DOMString& localName) throw (DOMException)
{
return NULL;
}
/// @todo Not implemented yet.
Node*
-NamedNodeMap::removeNamedItemNS (DOMString namespaceURI, DOMString localName) throw (DOMException)
+NamedNodeMap::removeNamedItemNS (const DOMString& namespaceURI, const DOMString& localName) throw (DOMException)
{
return NULL;
}
View
8 lib/DOM/NamedNodeMap.h
@@ -32,21 +32,21 @@ class NamedNodeMap
public:
NamedNodeMap (Node* ownerNode);
- Node* getNamedItem (DOMString name);
+ Node* getNamedItem (const DOMString& name);
Node* setNamedItem (Node* node) throw ();
- Node* removeNamedItem (DOMString name) throw ();
+ Node* removeNamedItem (const DOMString& name) throw ();
Node* item (unsigned long index);
unsigned long length (void);
- Node* getNamedItemNS (DOMString namespaceURI, DOMString localName) throw ();
+ Node* getNamedItemNS (const DOMString& namespaceURI, const DOMString& localName) throw ();
Node* setNamedItemNS (Node* node) throw ();
- Node* removeNamedItemNS (DOMString namespaceURI, DOMString localName) throw ();
+ Node* removeNamedItemNS (const DOMString& namespaceURI, const DOMString& localName) throw ();
private:
Node* _ownerNode;
View
5 lib/DOM/Node.h
@@ -31,6 +31,9 @@ namespace DOM {
class Node
{
public:
+ #include "NodeList.h"
+
+ public:
static const NodeType ELEMENT_NODE = 1;
static const NodeType ATTRIBUTE_NODE = 2;
static const NodeType TEXT_NODE = 3;
@@ -55,8 +58,6 @@ class Node
Node (Document* ownerDocument, NodeType type);
public:
- #include "NodeList.h"
-
~Node (void);
virtual DOMString nodeName (void) = 0;

0 comments on commit 774d7cc

Please sign in to comment.