diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2007-09-24 23:26:04 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2007-09-24 23:26:04 +0000 |
commit | 7259d8fa11f3fc45adbfa9634c145ba58f7f6257 (patch) | |
tree | 341664962cc99a7ac74430bb57e8e9ad20016c20 /src/core/node.c | |
parent | c224138caa7b6e392a14a023d74cd4683503a60e (diff) | |
download | libdom-7259d8fa11f3fc45adbfa9634c145ba58f7f6257.tar.gz libdom-7259d8fa11f3fc45adbfa9634c145ba58f7f6257.tar.bz2 |
Move attributes field to struct dom_element as it doesn't apply to other node types.
svn path=/trunk/dom/; revision=3590
Diffstat (limited to 'src/core/node.c')
-rw-r--r-- | src/core/node.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/core/node.c b/src/core/node.c index e8ebc34..ea957e4 100644 --- a/src/core/node.c +++ b/src/core/node.c @@ -157,7 +157,6 @@ dom_exception dom_node_initialise(struct dom_node *node, node->last_child = NULL; node->previous = NULL; node->next = NULL; - node->attributes = NULL; /* Note: nodes do not reference the document to which they belong, * as this would result in the document never being destroyed once @@ -232,7 +231,6 @@ void dom_node_finalise(struct dom_document *doc, struct dom_node *node) node->owner = NULL; /* Paranoia */ - node->attributes = NULL; node->next = NULL; node->previous = NULL; node->last_child = NULL; @@ -565,8 +563,7 @@ dom_exception dom_node_get_attributes(struct dom_node *node, return DOM_NO_ERR; } - return dom_document_get_namednodemap(node->owner, node, - DOM_ATTRIBUTE_NODE, result); + return dom_element_get_attributes((struct dom_element *) node, result); } /** @@ -1105,9 +1102,13 @@ dom_exception dom_node_get_local_name(struct dom_node *node, */ dom_exception dom_node_has_attributes(struct dom_node *node, bool *result) { - *result = node->attributes != NULL; + if (node->type != DOM_ELEMENT_NODE) { + *result = false; - return DOM_NO_ERR; + return DOM_NO_ERR; + } + + return dom_element_has_attributes((struct dom_element *) node, result); } /** |