Commit 2896c462 authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

msxml3: previousSibling not supported for Attribute, Document and Document Fragment Nodes.

parent f31cd308
......@@ -359,7 +359,23 @@ static HRESULT WINAPI xmlnode_get_previousSibling(
IXMLDOMNode** previousSibling)
{
xmlnode *This = impl_from_IXMLDOMNode( iface );
TRACE("%p\n", This );
if (!previousSibling)
return E_INVALIDARG;
switch( This->node->type )
{
/* Attribute, Document and Document Fragment Nodes do not support previousSibling */
case XML_DOCUMENT_NODE:
case XML_DOCUMENT_FRAG_NODE:
case XML_ATTRIBUTE_NODE:
*previousSibling = NULL;
return S_FALSE;
default:
return get_node( This, "previous", This->node->prev, previousSibling );
}
}
static HRESULT WINAPI xmlnode_get_nextSibling(
......
......@@ -1829,6 +1829,15 @@ static void test_xmlTypes(void)
ok(hr == S_FALSE, "ret %08x\n", hr );
ok(pNextChild == NULL, "pDocChild not NULL\n");
/* test previous Sibling */
hr = IXMLDOMDocument_get_previousSibling(doc, NULL);
ok(hr == E_INVALIDARG, "ret %08x\n", hr );
pNextChild = (IXMLDOMNode *)0x1;
hr = IXMLDOMDocument_get_previousSibling(doc, &pNextChild);
ok(hr == S_FALSE, "ret %08x\n", hr );
ok(pNextChild == NULL, "pNextChild not NULL\n");
hr = IXMLDOMDocument_createElement(doc, _bstr_("Testing"), &pRoot);
ok(hr == S_OK, "ret %08x\n", hr );
if(hr == S_OK)
......@@ -1891,6 +1900,15 @@ static void test_xmlTypes(void)
ok(hr == S_FALSE, "ret %08x\n", hr );
ok(pNextChild == NULL, "pNextChild not NULL\n");
/* test Previous Sibling*/
hr = IXMLDOMAttribute_get_previousSibling(pAttrubute, NULL);
ok(hr == E_INVALIDARG, "ret %08x\n", hr );
pNextChild = (IXMLDOMNode *)0x1;
hr = IXMLDOMAttribute_get_previousSibling(pAttrubute, &pNextChild);
ok(hr == S_FALSE, "ret %08x\n", hr );
ok(pNextChild == NULL, "pNextChild not NULL\n");
hr = IXMLDOMElement_appendChild(pElement, (IXMLDOMNode*)pAttrubute, &pNewChild);
ok(hr == E_FAIL, "ret %08x\n", hr );
ok(pNewChild == NULL, "pNewChild not NULL\n");
......
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