Jacek Caban : mshtml: Get rid of no loner needed document node reference in HTMLDOMChildrenCollection.

Alexandre Julliard julliard at winehq.org
Mon Feb 19 13:52:02 CST 2018


Module: wine
Branch: master
Commit: a19caad9d08db947e9cd9290ed1d87da92e4e510
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=a19caad9d08db947e9cd9290ed1d87da92e4e510

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Mon Feb 19 14:49:25 2018 +0100

mshtml: Get rid of no loner needed document node reference in HTMLDOMChildrenCollection.

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

---

 dlls/mshtml/htmldoc.c        |  2 +-
 dlls/mshtml/htmlelem.c       |  2 +-
 dlls/mshtml/htmlnode.c       | 11 ++---------
 dlls/mshtml/mshtml_private.h |  2 +-
 4 files changed, 5 insertions(+), 12 deletions(-)

diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c
index 7f5f869..5bd1da1 100644
--- a/dlls/mshtml/htmldoc.c
+++ b/dlls/mshtml/htmldoc.c
@@ -4306,7 +4306,7 @@ static HRESULT WINAPI DocumentSelector_querySelectorAll(IDocumentSelector *iface
         return E_FAIL;
     }
 
-    *pel = create_child_collection(This->doc_node, node_list);
+    *pel = create_child_collection(node_list);
     nsIDOMNodeList_Release(node_list);
     return *pel ? S_OK : E_OUTOFMEMORY;
 }
diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c
index 964e85c..f75a9ec 100644
--- a/dlls/mshtml/htmlelem.c
+++ b/dlls/mshtml/htmlelem.c
@@ -4964,7 +4964,7 @@ static HRESULT WINAPI ElementSelector_querySelectorAll(IElementSelector *iface,
         return E_FAIL;
     }
 
-    *pel = create_child_collection(This->node.doc, node_list);
+    *pel = create_child_collection(node_list);
     nsIDOMNodeList_Release(node_list);
     return *pel ? S_OK : E_OUTOFMEMORY;
 }
diff --git a/dlls/mshtml/htmlnode.c b/dlls/mshtml/htmlnode.c
index 5557729..aec12fc 100644
--- a/dlls/mshtml/htmlnode.c
+++ b/dlls/mshtml/htmlnode.c
@@ -44,9 +44,6 @@ typedef struct {
 
     LONG ref;
 
-    /* FIXME: implement weak reference */
-    HTMLDocumentNode *doc;
-
     nsIDOMNodeList *nslist;
 } HTMLDOMChildrenCollection;
 
@@ -244,7 +241,6 @@ static ULONG WINAPI HTMLDOMChildrenCollection_Release(IHTMLDOMChildrenCollection
     TRACE("(%p) ref=%d\n", This, ref);
 
     if(!ref) {
-        htmldoc_release(&This->doc->basedoc);
         nsIDOMNodeList_Release(This->nslist);
         heap_free(This);
     }
@@ -440,7 +436,7 @@ static dispex_static_data_t HTMLDOMChildrenCollection_dispex = {
     HTMLDOMNode_init_dispex_info
 };
 
-IHTMLDOMChildrenCollection *create_child_collection(HTMLDocumentNode *doc, nsIDOMNodeList *nslist)
+IHTMLDOMChildrenCollection *create_child_collection(nsIDOMNodeList *nslist)
 {
     HTMLDOMChildrenCollection *ret;
 
@@ -454,9 +450,6 @@ IHTMLDOMChildrenCollection *create_child_collection(HTMLDocumentNode *doc, nsIDO
     nsIDOMNodeList_AddRef(nslist);
     ret->nslist = nslist;
 
-    htmldoc_addref(&doc->basedoc);
-    ret->doc = doc;
-
     init_dispex(&ret->dispex, (IUnknown*)&ret->IHTMLDOMChildrenCollection_iface,
             &HTMLDOMChildrenCollection_dispex);
 
@@ -628,7 +621,7 @@ static HRESULT WINAPI HTMLDOMNode_get_childNodes(IHTMLDOMNode *iface, IDispatch
         return E_FAIL;
     }
 
-    *p = (IDispatch*)create_child_collection(This->doc, nslist);
+    *p = (IDispatch*)create_child_collection(nslist);
     nsIDOMNodeList_Release(nslist);
 
     return *p ? S_OK : E_OUTOFMEMORY;
diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h
index 85671a3..0bb3a96 100644
--- a/dlls/mshtml/mshtml_private.h
+++ b/dlls/mshtml/mshtml_private.h
@@ -1089,7 +1089,7 @@ HRESULT wrap_iface(IUnknown*,IUnknown*,IUnknown**) DECLSPEC_HIDDEN;
 IHTMLElementCollection *create_all_collection(HTMLDOMNode*,BOOL) DECLSPEC_HIDDEN;
 IHTMLElementCollection *create_collection_from_nodelist(HTMLDocumentNode*,nsIDOMNodeList*) DECLSPEC_HIDDEN;
 IHTMLElementCollection *create_collection_from_htmlcol(HTMLDocumentNode*,nsIDOMHTMLCollection*) DECLSPEC_HIDDEN;
-IHTMLDOMChildrenCollection *create_child_collection(HTMLDocumentNode*,nsIDOMNodeList*) DECLSPEC_HIDDEN;
+IHTMLDOMChildrenCollection *create_child_collection(nsIDOMNodeList*) DECLSPEC_HIDDEN;
 
 HRESULT attr_value_to_string(VARIANT*) DECLSPEC_HIDDEN;
 HRESULT get_elem_attr_value_by_dispid(HTMLElement*,DISPID,VARIANT*) DECLSPEC_HIDDEN;




More information about the wine-cvs mailing list