Commit 431e77be authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

msxml3: CDATA nodes can't have children.

parent 2d5c9f4f
...@@ -290,10 +290,9 @@ static HRESULT WINAPI domcdata_insertBefore( ...@@ -290,10 +290,9 @@ static HRESULT WINAPI domcdata_insertBefore(
IXMLDOMNode** outOldNode) IXMLDOMNode** outOldNode)
{ {
domcdata *This = impl_from_IXMLDOMCDATASection( iface ); domcdata *This = impl_from_IXMLDOMCDATASection( iface );
TRACE("(%p)->(%p %s %p)\n", This, newNode, debugstr_variant(&refChild), outOldNode);
FIXME("(%p)->(%p %s %p) needs test\n", This, newNode, debugstr_variant(&refChild), outOldNode); if (outOldNode) *outOldNode = NULL;
return E_FAIL;
return node_insert_before(&This->node, newNode, &refChild, outOldNode);
} }
static HRESULT WINAPI domcdata_replaceChild( static HRESULT WINAPI domcdata_replaceChild(
...@@ -303,10 +302,9 @@ static HRESULT WINAPI domcdata_replaceChild( ...@@ -303,10 +302,9 @@ static HRESULT WINAPI domcdata_replaceChild(
IXMLDOMNode** outOldNode) IXMLDOMNode** outOldNode)
{ {
domcdata *This = impl_from_IXMLDOMCDATASection( iface ); domcdata *This = impl_from_IXMLDOMCDATASection( iface );
TRACE("(%p)->(%p %p %p)\n", This, newNode, oldNode, outOldNode);
FIXME("(%p)->(%p %p %p) needs tests\n", This, newNode, oldNode, outOldNode); if (outOldNode) *outOldNode = NULL;
return E_FAIL;
return node_replace_child(&This->node, newNode, oldNode, outOldNode);
} }
static HRESULT WINAPI domcdata_removeChild( static HRESULT WINAPI domcdata_removeChild(
...@@ -315,7 +313,8 @@ static HRESULT WINAPI domcdata_removeChild( ...@@ -315,7 +313,8 @@ static HRESULT WINAPI domcdata_removeChild(
{ {
domcdata *This = impl_from_IXMLDOMCDATASection( iface ); domcdata *This = impl_from_IXMLDOMCDATASection( iface );
TRACE("(%p)->(%p %p)\n", This, child, oldChild); TRACE("(%p)->(%p %p)\n", This, child, oldChild);
return node_remove_child(&This->node, child, oldChild); if (oldChild) *oldChild = NULL;
return E_FAIL;
} }
static HRESULT WINAPI domcdata_appendChild( static HRESULT WINAPI domcdata_appendChild(
...@@ -324,7 +323,8 @@ static HRESULT WINAPI domcdata_appendChild( ...@@ -324,7 +323,8 @@ static HRESULT WINAPI domcdata_appendChild(
{ {
domcdata *This = impl_from_IXMLDOMCDATASection( iface ); domcdata *This = impl_from_IXMLDOMCDATASection( iface );
TRACE("(%p)->(%p %p)\n", This, child, outChild); TRACE("(%p)->(%p %p)\n", This, child, outChild);
return node_append_child(&This->node, child, outChild); if (outChild) *outChild = NULL;
return E_FAIL;
} }
static HRESULT WINAPI domcdata_hasChildNodes( static HRESULT WINAPI domcdata_hasChildNodes(
......
...@@ -8370,6 +8370,22 @@ static void test_insertBefore(void) ...@@ -8370,6 +8370,22 @@ static void test_insertBefore(void)
ok(hr == S_OK, "got 0x%08x\n", hr); ok(hr == S_OK, "got 0x%08x\n", hr);
ok(cdata != NULL, "got %p\n", cdata); ok(cdata != NULL, "got %p\n", cdata);
EXPECT_NO_CHILDREN(cdata);
/* attribute to cdata */
V_VT(&v) = VT_NULL;
node = (void*)0xdeadbeef;
hr = IXMLDOMNode_insertBefore(cdata, (IXMLDOMNode*)attr, v, &node);
ok(hr == E_FAIL, "got 0x%08x\n", hr);
ok(node == NULL, "got %p\n", node);
/* document to cdata */
V_VT(&v) = VT_NULL;
node = (void*)0xdeadbeef;
hr = IXMLDOMNode_insertBefore(cdata, (IXMLDOMNode*)doc, v, &node);
ok(hr == E_FAIL, "got 0x%08x\n", hr);
ok(node == NULL, "got %p\n", node);
V_VT(&v) = VT_NULL; V_VT(&v) = VT_NULL;
node = (void*)0xdeadbeef; node = (void*)0xdeadbeef;
hr = IXMLDOMDocument_insertBefore(doc3, cdata, v, &node); hr = IXMLDOMDocument_insertBefore(doc3, cdata, v, &node);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment