summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBo Yang <struggleyb.nku@gmail.com>2009-08-12 08:53:05 +0000
committerBo Yang <struggleyb.nku@gmail.com>2009-08-12 08:53:05 +0000
commitbf6bc398bd40e39a016725550f5b8446a01ee2d1 (patch)
treea8174b750f402c13004796c2834a20b9b1a42445 /src
parentdbd495a3cd7352c52aed2c8ef8943f8e45f8aae3 (diff)
downloadlibdom-bf6bc398bd40e39a016725550f5b8446a01ee2d1.tar.gz
libdom-bf6bc398bd40e39a016725550f5b8446a01ee2d1.tar.bz2
Fix up the failed 3 test cases for DOMTS Core level 3.
svn path=/trunk/dom/; revision=9212
Diffstat (limited to 'src')
-rw-r--r--src/core/node.c6
-rw-r--r--src/core/text.c8
2 files changed, 9 insertions, 5 deletions
diff --git a/src/core/node.c b/src/core/node.c
index 0645769..1c0b28f 100644
--- a/src/core/node.c
+++ b/src/core/node.c
@@ -1007,6 +1007,10 @@ dom_exception _dom_node_replace_child(dom_node_internal *node,
_dom_node_detach(new_child);
}
+ /* When a Node is attached, it should be removed from the pending
+ * list */
+ dom_node_remove_pending(new_child);
+
/* Perform the replacement */
_dom_node_replace(old_child, new_child);
@@ -2173,7 +2177,7 @@ void _dom_node_attach(dom_node_internal *node, dom_node_internal *parent,
void _dom_node_detach(dom_node_internal *node)
{
/* When a Node is not in the document tree, it must be in the
- pending list */
+ * pending list */
dom_node_mark_pending(node);
_dom_node_detach_range(node, node);
diff --git a/src/core/text.c b/src/core/text.c
index 6cb9e1f..6aa6d0f 100644
--- a/src/core/text.c
+++ b/src/core/text.c
@@ -344,10 +344,6 @@ dom_exception walk_logic_adjacent_text_in_order(
dom_node_internal *node, walk_operation opt,
walk_order order, dom_string **ret, bool *cont)
{
- dom_exception err;
- dom_string *data, *tmp;
- dom_node_internal *parent = dom_node_get_parent(node);
-
/* If we reach the leaf of the DOM tree, just return to continue
* to next sibling of our parent */
if (node == NULL) {
@@ -355,6 +351,10 @@ dom_exception walk_logic_adjacent_text_in_order(
return DOM_NO_ERR;
}
+ dom_exception err;
+ dom_string *data, *tmp;
+ dom_node_internal *parent = dom_node_get_parent(node);
+
while (node != NULL) {
/* If we reach the boundary of logical-adjacent text, we stop */
if (node->type == DOM_ELEMENT_NODE ||