mshtml: Fixed cloning comment nodes.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2016-03-17 11:49:26 +01:00 committed by Alexandre Julliard
parent 906db769f1
commit 13079c5696
2 changed files with 19 additions and 4 deletions

View File

@ -169,11 +169,25 @@ static void HTMLCommentElement_destructor(HTMLDOMNode *iface)
HTMLElement_destructor(&This->element.node);
}
HRESULT HTMLCommentElement_clone(HTMLDOMNode *iface, nsIDOMNode *nsnode, HTMLDOMNode **ret)
{
HTMLCommentElement *This = impl_from_HTMLDOMNode(iface);
HTMLElement *new_elem;
HRESULT hres;
hres = HTMLCommentElement_Create(This->element.node.doc, nsnode, &new_elem);
if(FAILED(hres))
return hres;
*ret = &new_elem->node;
return S_OK;
}
static const NodeImplVtbl HTMLCommentElementImplVtbl = {
HTMLCommentElement_QI,
HTMLCommentElement_destructor,
HTMLElement_cpc,
HTMLElement_clone,
HTMLCommentElement_clone,
HTMLElement_handle_event,
HTMLElement_get_attr_col
};

View File

@ -6244,12 +6244,10 @@ static void test_unique_id(IHTMLDocument2 *doc, IHTMLElement *elem)
hres = IHTMLUniqueName_get_uniqueID(unique_name, &id);
ok(hres == S_OK, "get_uniqueName failed: %08x\n", hres);
trace("id %s\n", wine_dbgstr_w(id));
hres = IHTMLUniqueName_get_uniqueID(unique_name, &id2);
ok(hres == S_OK, "get_uniqueName failed: %08x\n", hres);
ok(!lstrcmpW(id, id2), "unique names differ\n");
trace("id %s\n", wine_dbgstr_w(id2));
hres = IHTMLUniqueName_get_uniqueNumber(unique_name, &num);
ok(hres == S_OK, "get_uniqueName failed: %08x\n", hres);
@ -6257,7 +6255,6 @@ static void test_unique_id(IHTMLDocument2 *doc, IHTMLElement *elem)
sprintf(buf, "ms__id%u", num);
ok(!strcmp_wa(id, buf), "unexpected id %s\n", wine_dbgstr_w(id));
trace("num %d\n", num);
SysFreeString(id);
SysFreeString(id2);
@ -8907,6 +8904,10 @@ static void test_create_elems(IHTMLDocument2 *doc)
test_elem_outerhtml((IUnknown*)comment, "<!--testing-->");
test_comment_attrs((IUnknown*)comment);
node2 = clone_node((IUnknown*)comment, VARIANT_TRUE);
test_comment_text((IUnknown*)node2, "<!--testing-->");
IHTMLDOMNode_Release(node2);
IHTMLDOMNode_Release(comment);
}