Commit 13079c56 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Fixed cloning comment nodes.

parent 906db769
...@@ -169,11 +169,25 @@ static void HTMLCommentElement_destructor(HTMLDOMNode *iface) ...@@ -169,11 +169,25 @@ static void HTMLCommentElement_destructor(HTMLDOMNode *iface)
HTMLElement_destructor(&This->element.node); 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 = { static const NodeImplVtbl HTMLCommentElementImplVtbl = {
HTMLCommentElement_QI, HTMLCommentElement_QI,
HTMLCommentElement_destructor, HTMLCommentElement_destructor,
HTMLElement_cpc, HTMLElement_cpc,
HTMLElement_clone, HTMLCommentElement_clone,
HTMLElement_handle_event, HTMLElement_handle_event,
HTMLElement_get_attr_col HTMLElement_get_attr_col
}; };
......
...@@ -6244,12 +6244,10 @@ static void test_unique_id(IHTMLDocument2 *doc, IHTMLElement *elem) ...@@ -6244,12 +6244,10 @@ static void test_unique_id(IHTMLDocument2 *doc, IHTMLElement *elem)
hres = IHTMLUniqueName_get_uniqueID(unique_name, &id); hres = IHTMLUniqueName_get_uniqueID(unique_name, &id);
ok(hres == S_OK, "get_uniqueName failed: %08x\n", hres); 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); hres = IHTMLUniqueName_get_uniqueID(unique_name, &id2);
ok(hres == S_OK, "get_uniqueName failed: %08x\n", hres); ok(hres == S_OK, "get_uniqueName failed: %08x\n", hres);
ok(!lstrcmpW(id, id2), "unique names differ\n"); ok(!lstrcmpW(id, id2), "unique names differ\n");
trace("id %s\n", wine_dbgstr_w(id2));
hres = IHTMLUniqueName_get_uniqueNumber(unique_name, &num); hres = IHTMLUniqueName_get_uniqueNumber(unique_name, &num);
ok(hres == S_OK, "get_uniqueName failed: %08x\n", hres); ok(hres == S_OK, "get_uniqueName failed: %08x\n", hres);
...@@ -6257,7 +6255,6 @@ static void test_unique_id(IHTMLDocument2 *doc, IHTMLElement *elem) ...@@ -6257,7 +6255,6 @@ static void test_unique_id(IHTMLDocument2 *doc, IHTMLElement *elem)
sprintf(buf, "ms__id%u", num); sprintf(buf, "ms__id%u", num);
ok(!strcmp_wa(id, buf), "unexpected id %s\n", wine_dbgstr_w(id)); ok(!strcmp_wa(id, buf), "unexpected id %s\n", wine_dbgstr_w(id));
trace("num %d\n", num);
SysFreeString(id); SysFreeString(id);
SysFreeString(id2); SysFreeString(id2);
...@@ -8907,6 +8904,10 @@ static void test_create_elems(IHTMLDocument2 *doc) ...@@ -8907,6 +8904,10 @@ static void test_create_elems(IHTMLDocument2 *doc)
test_elem_outerhtml((IUnknown*)comment, "<!--testing-->"); test_elem_outerhtml((IUnknown*)comment, "<!--testing-->");
test_comment_attrs((IUnknown*)comment); test_comment_attrs((IUnknown*)comment);
node2 = clone_node((IUnknown*)comment, VARIANT_TRUE);
test_comment_text((IUnknown*)node2, "<!--testing-->");
IHTMLDOMNode_Release(node2);
IHTMLDOMNode_Release(comment); IHTMLDOMNode_Release(comment);
} }
......
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