Jacek Caban : mshtml: Get rid of no longer needed document argument from create_collection_from_nodelist and create_collection_from_htmlcol.

Alexandre Julliard julliard at winehq.org
Tue Feb 20 16:44:53 CST 2018


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Tue Feb 20 13:25:06 2018 +0100

mshtml: Get rid of no longer needed document argument from create_collection_from_nodelist and create_collection_from_htmlcol.

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

---

 dlls/mshtml/htmldoc.c        | 18 +++++++++---------
 dlls/mshtml/htmlelem.c       |  8 ++++----
 dlls/mshtml/htmlelemcol.c    |  8 ++++----
 dlls/mshtml/htmlform.c       |  2 +-
 dlls/mshtml/htmltable.c      |  4 ++--
 dlls/mshtml/htmltablerow.c   |  2 +-
 dlls/mshtml/mshtml_private.h |  4 ++--
 7 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c
index ec4771d..3bf3419 100644
--- a/dlls/mshtml/htmldoc.c
+++ b/dlls/mshtml/htmldoc.c
@@ -354,7 +354,7 @@ static HRESULT WINAPI HTMLDocument_get_images(IHTMLDocument2 *iface, IHTMLElemen
     }
 
     if(nscoll) {
-        *p = create_collection_from_htmlcol(This->doc_node, nscoll);
+        *p = create_collection_from_htmlcol(nscoll, This->doc_node->document_mode);
         nsIDOMHTMLCollection_Release(nscoll);
     }
 
@@ -386,7 +386,7 @@ static HRESULT WINAPI HTMLDocument_get_applets(IHTMLDocument2 *iface, IHTMLEleme
     }
 
     if(nscoll) {
-        *p = create_collection_from_htmlcol(This->doc_node, nscoll);
+        *p = create_collection_from_htmlcol(nscoll, This->doc_node->document_mode);
         nsIDOMHTMLCollection_Release(nscoll);
     }
 
@@ -418,7 +418,7 @@ static HRESULT WINAPI HTMLDocument_get_links(IHTMLDocument2 *iface, IHTMLElement
     }
 
     if(nscoll) {
-        *p = create_collection_from_htmlcol(This->doc_node, nscoll);
+        *p = create_collection_from_htmlcol(nscoll, This->doc_node->document_mode);
         nsIDOMHTMLCollection_Release(nscoll);
     }
 
@@ -450,7 +450,7 @@ static HRESULT WINAPI HTMLDocument_get_forms(IHTMLDocument2 *iface, IHTMLElement
     }
 
     if(nscoll) {
-        *p = create_collection_from_htmlcol(This->doc_node, nscoll);
+        *p = create_collection_from_htmlcol(nscoll, This->doc_node->document_mode);
         nsIDOMHTMLCollection_Release(nscoll);
     }
 
@@ -482,7 +482,7 @@ static HRESULT WINAPI HTMLDocument_get_anchors(IHTMLDocument2 *iface, IHTMLEleme
     }
 
     if(nscoll) {
-        *p = create_collection_from_htmlcol(This->doc_node, nscoll);
+        *p = create_collection_from_htmlcol(nscoll, This->doc_node->document_mode);
         nsIDOMHTMLCollection_Release(nscoll);
     }
 
@@ -567,7 +567,7 @@ static HRESULT WINAPI HTMLDocument_get_scripts(IHTMLDocument2 *iface, IHTMLEleme
     }
 
     if(nscoll) {
-        *p = create_collection_from_htmlcol(This->doc_node, nscoll);
+        *p = create_collection_from_htmlcol(nscoll, This->doc_node->document_mode);
         nsIDOMHTMLCollection_Release(nscoll);
     }
 
@@ -2377,7 +2377,7 @@ static HRESULT WINAPI HTMLDocument3_getElementsByName(IHTMLDocument3 *iface, BST
         return E_FAIL;
     }
 
-    *ppelColl = create_collection_from_nodelist(This->doc_node, node_list);
+    *ppelColl = create_collection_from_nodelist(node_list, This->doc_node->document_mode);
     nsIDOMNodeList_Release(node_list);
     return S_OK;
 }
@@ -2452,7 +2452,7 @@ static HRESULT WINAPI HTMLDocument3_getElementsByTagName(IHTMLDocument3 *iface,
     }
 
 
-    *pelColl = create_collection_from_nodelist(This->doc_node, nslist);
+    *pelColl = create_collection_from_nodelist(nslist, This->doc_node->document_mode);
     nsIDOMNodeList_Release(nslist);
 
     return S_OK;
@@ -3368,7 +3368,7 @@ static HRESULT WINAPI HTMLDocument7_getElementsByClassName(IHTMLDocument7 *iface
     }
 
 
-    *pel = create_collection_from_nodelist(This->doc_node, nslist);
+    *pel = create_collection_from_nodelist(nslist, This->doc_node->document_mode);
     nsIDOMNodeList_Release(nslist);
     return S_OK;
 }
diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c
index ca935d3..28dd716 100644
--- a/dlls/mshtml/htmlelem.c
+++ b/dlls/mshtml/htmlelem.c
@@ -1998,7 +1998,7 @@ static HRESULT WINAPI HTMLElement_get_children(IHTMLElement *iface, IDispatch **
         return E_FAIL;
     }
 
-    *p = (IDispatch*)create_collection_from_nodelist(This->node.doc, nsnode_list);
+    *p = (IDispatch*)create_collection_from_nodelist(nsnode_list, This->node.doc->document_mode);
 
     nsIDOMNodeList_Release(nsnode_list);
     return S_OK;
@@ -3185,7 +3185,7 @@ static HRESULT WINAPI HTMLElement2_getElementsByTagName(IHTMLElement2 *iface, BS
     TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), pelColl);
 
     if(!This->dom_element) {
-        *pelColl = create_collection_from_htmlcol(This->node.doc, NULL);
+        *pelColl = create_collection_from_htmlcol(NULL, This->node.doc->document_mode);
         return S_OK;
     }
 
@@ -3197,7 +3197,7 @@ static HRESULT WINAPI HTMLElement2_getElementsByTagName(IHTMLElement2 *iface, BS
         return E_FAIL;
     }
 
-    *pelColl = create_collection_from_htmlcol(This->node.doc, nscol);
+    *pelColl = create_collection_from_htmlcol(nscol, dispex_compat_mode(&This->node.event_target.dispex));
     nsIDOMHTMLCollection_Release(nscol);
     return S_OK;
 }
@@ -4263,7 +4263,7 @@ static HRESULT WINAPI HTMLElement6_getElementsByClassName(IHTMLElement6 *iface,
         }
     }
 
-    *pel = create_collection_from_htmlcol(This->node.doc, nscol);
+    *pel = create_collection_from_htmlcol(nscol, dispex_compat_mode(&This->node.event_target.dispex));
     nsIDOMHTMLCollection_Release(nscol);
     return S_OK;
 }
diff --git a/dlls/mshtml/htmlelemcol.c b/dlls/mshtml/htmlelemcol.c
index 6671434..6398942 100644
--- a/dlls/mshtml/htmlelemcol.c
+++ b/dlls/mshtml/htmlelemcol.c
@@ -683,7 +683,7 @@ IHTMLElementCollection *create_all_collection(HTMLDOMNode *node, BOOL include_ro
                                         dispex_compat_mode(&node->event_target.dispex));
 }
 
-IHTMLElementCollection *create_collection_from_nodelist(HTMLDocumentNode *doc, nsIDOMNodeList *nslist)
+IHTMLElementCollection *create_collection_from_nodelist(nsIDOMNodeList *nslist, compat_mode_t compat_mode)
 {
     UINT32 length = 0, i;
     HTMLDOMNode *node;
@@ -715,10 +715,10 @@ IHTMLElementCollection *create_collection_from_nodelist(HTMLDocumentNode *doc, n
         buf.buf = NULL;
     }
 
-    return HTMLElementCollection_Create(buf.buf, buf.len, doc->document_mode);
+    return HTMLElementCollection_Create(buf.buf, buf.len, compat_mode);
 }
 
-IHTMLElementCollection *create_collection_from_htmlcol(HTMLDocumentNode *doc, nsIDOMHTMLCollection *nscol)
+IHTMLElementCollection *create_collection_from_htmlcol(nsIDOMHTMLCollection *nscol, compat_mode_t compat_mode)
 {
     UINT32 length = 0, i;
     elem_vector_t buf;
@@ -751,7 +751,7 @@ IHTMLElementCollection *create_collection_from_htmlcol(HTMLDocumentNode *doc, ns
         return NULL;
     }
 
-    return HTMLElementCollection_Create(buf.buf, buf.len, doc->document_mode);
+    return HTMLElementCollection_Create(buf.buf, buf.len, compat_mode);
 }
 
 HRESULT get_elem_source_index(HTMLElement *elem, LONG *ret)
diff --git a/dlls/mshtml/htmlform.c b/dlls/mshtml/htmlform.c
index acf2eba..27a82fa 100644
--- a/dlls/mshtml/htmlform.c
+++ b/dlls/mshtml/htmlform.c
@@ -291,7 +291,7 @@ static HRESULT WINAPI HTMLFormElement_get_elements(IHTMLFormElement *iface, IDis
         return E_FAIL;
     }
 
-    *p = (IDispatch*)create_collection_from_htmlcol(This->element.node.doc, elements);
+    *p = (IDispatch*)create_collection_from_htmlcol(elements, dispex_compat_mode(&This->element.node.event_target.dispex));
     nsIDOMHTMLCollection_Release(elements);
     return S_OK;
 }
diff --git a/dlls/mshtml/htmltable.c b/dlls/mshtml/htmltable.c
index 455826e..983e81d 100644
--- a/dlls/mshtml/htmltable.c
+++ b/dlls/mshtml/htmltable.c
@@ -478,7 +478,7 @@ static HRESULT WINAPI HTMLTable_get_rows(IHTMLTable *iface, IHTMLElementCollecti
         return E_FAIL;
     }
 
-    *p = create_collection_from_htmlcol(This->element.node.doc, nscol);
+    *p = create_collection_from_htmlcol(nscol, dispex_compat_mode(&This->element.node.event_target.dispex));
 
     nsIDOMHTMLCollection_Release(nscol);
     return S_OK;
@@ -605,7 +605,7 @@ static HRESULT WINAPI HTMLTable_get_tBodies(IHTMLTable *iface, IHTMLElementColle
         return E_FAIL;
     }
 
-    *p = create_collection_from_htmlcol(This->element.node.doc, nscol);
+    *p = create_collection_from_htmlcol(nscol, dispex_compat_mode(&This->element.node.event_target.dispex));
 
     nsIDOMHTMLCollection_Release(nscol);
     return S_OK;
diff --git a/dlls/mshtml/htmltablerow.c b/dlls/mshtml/htmltablerow.c
index 61bdbd4..0097e58 100644
--- a/dlls/mshtml/htmltablerow.c
+++ b/dlls/mshtml/htmltablerow.c
@@ -299,7 +299,7 @@ static HRESULT WINAPI HTMLTableRow_get_cells(IHTMLTableRow *iface, IHTMLElementC
         return E_FAIL;
     }
 
-    *p = create_collection_from_htmlcol(This->element.node.doc, nscol);
+    *p = create_collection_from_htmlcol(nscol, dispex_compat_mode(&This->element.node.event_target.dispex));
 
     nsIDOMHTMLCollection_Release(nscol);
     return S_OK;
diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h
index c9c6682..c720ef4 100644
--- a/dlls/mshtml/mshtml_private.h
+++ b/dlls/mshtml/mshtml_private.h
@@ -1087,8 +1087,8 @@ HRESULT handle_link_click_event(HTMLElement*,nsAString*,nsAString*,nsIDOMEvent*,
 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;
+IHTMLElementCollection *create_collection_from_nodelist(nsIDOMNodeList*,compat_mode_t) DECLSPEC_HIDDEN;
+IHTMLElementCollection *create_collection_from_htmlcol(nsIDOMHTMLCollection*,compat_mode_t) DECLSPEC_HIDDEN;
 IHTMLDOMChildrenCollection *create_child_collection(nsIDOMNodeList*) DECLSPEC_HIDDEN;
 
 HRESULT attr_value_to_string(VARIANT*) DECLSPEC_HIDDEN;




More information about the wine-cvs mailing list