Jacek Caban : mshtml: Fixed cloning comment nodes.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Mar 17 10:02:14 CDT 2016


Module: wine
Branch: master
Commit: 13079c56961bffdb83ce8205b7ed6fcb2d5cf9e4
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=13079c56961bffdb83ce8205b7ed6fcb2d5cf9e4

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Thu Mar 17 11:49:26 2016 +0100

mshtml: Fixed cloning comment nodes.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/mshtml/htmlcomment.c | 16 +++++++++++++++-
 dlls/mshtml/tests/dom.c   |  7 ++++---
 2 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/dlls/mshtml/htmlcomment.c b/dlls/mshtml/htmlcomment.c
index 23bbc82..abb71a8 100644
--- a/dlls/mshtml/htmlcomment.c
+++ b/dlls/mshtml/htmlcomment.c
@@ -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
 };
diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c
index 15a3027..4206e9c 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -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);
         }
 




More information about the wine-cvs mailing list