Commit 69af9a4c authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Get rid of no longer needed document argument in get_node.

parent 75863340
......@@ -247,7 +247,7 @@ static HRESULT WINAPI HTMLDocument_get_all(IHTMLDocument2 *iface, IHTMLElementCo
return S_OK;
}
hres = get_node(This->doc_node, (nsIDOMNode*)nselem, TRUE, &node);
hres = get_node((nsIDOMNode*)nselem, TRUE, &node);
nsIDOMElement_Release(nselem);
if(FAILED(hres))
return hres;
......@@ -1615,7 +1615,7 @@ static HRESULT WINAPI HTMLDocument_elementFromPoint(IHTMLDocument2 *iface, LONG
return S_OK;
}
hres = get_node(This->doc_node, (nsIDOMNode*)nselem, TRUE, &node);
hres = get_node((nsIDOMNode*)nselem, TRUE, &node);
nsIDOMElement_Release(nselem);
if(FAILED(hres))
return hres;
......@@ -2021,7 +2021,7 @@ static HRESULT WINAPI HTMLDocument3_get_documentElement(IHTMLDocument3 *iface, I
return S_OK;
}
hres = get_node(This->doc_node, (nsIDOMNode *)nselem, TRUE, &node);
hres = get_node((nsIDOMNode *)nselem, TRUE, &node);
nsIDOMElement_Release(nselem);
if(FAILED(hres))
return hres;
......@@ -5020,7 +5020,7 @@ static HRESULT HTMLDocumentNode_invoke(DispatchEx *dispex, DISPID id, LCID lcid,
if(NS_FAILED(nsres) || !nsnode)
return DISP_E_UNKNOWNNAME;
hres = get_node(This, nsnode, TRUE, &node);
hres = get_node(nsnode, TRUE, &node);
if(FAILED(hres))
return hres;
......@@ -5210,7 +5210,7 @@ HRESULT get_document_node(nsIDOMDocument *dom_document, HTMLDocumentNode **ret)
HTMLDOMNode *node;
HRESULT hres;
hres = get_node(NULL, (nsIDOMNode*)dom_document, FALSE, &node);
hres = get_node((nsIDOMNode*)dom_document, FALSE, &node);
if(FAILED(hres))
return hres;
......
......@@ -1427,7 +1427,7 @@ static HRESULT WINAPI HTMLElement_get_offsetParent(IHTMLElement *iface, IHTMLEle
if(nsparent) {
HTMLDOMNode *node;
hres = get_node(This->node.doc, (nsIDOMNode*)nsparent, TRUE, &node);
hres = get_node((nsIDOMNode*)nsparent, TRUE, &node);
nsIDOMElement_Release(nsparent);
if(FAILED(hres))
return hres;
......@@ -1700,7 +1700,7 @@ static HRESULT insert_adjacent_node(HTMLElement *This, const WCHAR *where, nsIDO
return E_FAIL;
if(ret_node)
hres = get_node(This->node.doc, ret_nsnode, TRUE, ret_node);
hres = get_node(ret_nsnode, TRUE, ret_node);
nsIDOMNode_Release(ret_nsnode);
return hres;
}
......@@ -5470,7 +5470,7 @@ static EventTarget *HTMLElement_get_parent_event_target(DispatchEx *dispex)
if(!nsnode)
return NULL;
hres = get_node(This->node.doc, nsnode, TRUE, &node);
hres = get_node(nsnode, TRUE, &node);
nsIDOMNode_Release(nsnode);
if(FAILED(hres))
return NULL;
......@@ -5628,7 +5628,7 @@ HRESULT get_elem(HTMLDocumentNode *doc, nsIDOMElement *nselem, HTMLElement **ret
HTMLDOMNode *node;
HRESULT hres;
hres = get_node(doc, (nsIDOMNode*)nselem, TRUE, &node);
hres = get_node((nsIDOMNode*)nselem, TRUE, &node);
if(FAILED(hres))
return hres;
......
......@@ -654,7 +654,7 @@ static void create_all_list(HTMLDocumentNode *doc, HTMLDOMNode *elem, elem_vecto
if(is_elem_node(iter)) {
HTMLDOMNode *node;
hres = get_node(doc, iter, TRUE, &node);
hres = get_node(iter, TRUE, &node);
if(FAILED(hres)) {
FIXME("get_node failed: %08x\n", hres);
continue;
......@@ -702,7 +702,7 @@ IHTMLElementCollection *create_collection_from_nodelist(HTMLDocumentNode *doc, n
for(i=0; i<length; i++) {
nsIDOMNodeList_Item(nslist, i, &nsnode);
if(is_elem_node(nsnode)) {
hres = get_node(doc, nsnode, TRUE, &node);
hres = get_node(nsnode, TRUE, &node);
if(FAILED(hres))
continue;
buf.buf[buf.len++] = elem_from_HTMLDOMNode(node);
......@@ -736,7 +736,7 @@ IHTMLElementCollection *create_collection_from_htmlcol(HTMLDocumentNode *doc, ns
for(i=0; i<length; i++) {
nsIDOMHTMLCollection_Item(nscol, i, &nsnode);
hres = get_node(doc, nsnode, TRUE, &node);
hres = get_node(nsnode, TRUE, &node);
nsIDOMNode_Release(nsnode);
if(FAILED(hres))
break;
......@@ -792,12 +792,11 @@ HRESULT get_elem_source_index(HTMLElement *elem, LONG *ret)
return S_OK;
}
hres = get_node(elem->node.doc, parent_node, TRUE, &node);
hres = get_node(parent_node, TRUE, &node);
nsIDOMNode_Release(parent_node);
if(FAILED(hres))
return hres;
/* Create all children collection and find the element in it.
* This could be optimized if we ever find the reason. */
buf.buf = heap_alloc(buf.size*sizeof(*buf.buf));
......
......@@ -2916,7 +2916,7 @@ void check_event_attr(HTMLDocumentNode *doc, nsIDOMElement *nselem)
continue;
if(!node) {
hres = get_node(doc, (nsIDOMNode*)nselem, TRUE, &node);
hres = get_node((nsIDOMNode*)nselem, TRUE, &node);
if(FAILED(hres)) {
IDispatch_Release(disp);
break;
......
......@@ -64,7 +64,7 @@ static HRESULT htmlform_item(HTMLFormElement *This, int i, IDispatch **ret)
}
if(item) {
hres = get_node(This->element.node.doc, item, TRUE, &node);
hres = get_node(item, TRUE, &node);
if(FAILED(hres))
return hres;
......
......@@ -62,7 +62,7 @@ static HRESULT return_nsform(HTMLElement *elem, nsIDOMHTMLFormElement *nsform, I
nsIDOMHTMLFormElement_Release(nsform);
assert(nsres == NS_OK);
hres = get_node(elem->node.doc, form_node, TRUE, &node);
hres = get_node(form_node, TRUE, &node);
nsIDOMNode_Release(form_node);
if (FAILED(hres))
return hres;
......
......@@ -136,7 +136,7 @@ static HRESULT WINAPI HTMLDOMChildrenCollectionEnum_Next(IEnumVARIANT *iface, UL
nsres = nsIDOMNodeList_Item(This->col->nslist, This->iter+fetched, &nsnode);
assert(nsres == NS_OK);
hres = get_node(This->col->doc, nsnode, TRUE, &node);
hres = get_node(nsnode, TRUE, &node);
nsIDOMNode_Release(nsnode);
if(FAILED(hres)) {
ERR("get_node failed: %08x\n", hres);
......@@ -342,7 +342,7 @@ static HRESULT WINAPI HTMLDOMChildrenCollection_item(IHTMLDOMChildrenCollection
return E_FAIL;
}
hres = get_node(This->doc, nsnode, TRUE, &node);
hres = get_node(nsnode, TRUE, &node);
if(FAILED(hres))
return hres;
......@@ -589,7 +589,7 @@ static HRESULT WINAPI HTMLDOMNode_get_parentNode(IHTMLDOMNode *iface, IHTMLDOMNo
return S_OK;
}
hres = get_node(This->doc, nsnode, TRUE, &node);
hres = get_node(nsnode, TRUE, &node);
nsIDOMNode_Release(nsnode);
if(FAILED(hres))
return hres;
......@@ -712,7 +712,7 @@ static HRESULT WINAPI HTMLDOMNode_insertBefore(IHTMLDOMNode *iface, IHTMLDOMNode
if(FAILED(hres))
return hres;
hres = get_node(This->doc, nsnode, TRUE, &node_obj);
hres = get_node(nsnode, TRUE, &node_obj);
nsIDOMNode_Release(nsnode);
if(FAILED(hres))
return hres;
......@@ -743,7 +743,7 @@ static HRESULT WINAPI HTMLDOMNode_removeChild(IHTMLDOMNode *iface, IHTMLDOMNode
return E_FAIL;
}
hres = get_node(This->doc, nsnode, TRUE, &node_obj);
hres = get_node(nsnode, TRUE, &node_obj);
nsIDOMNode_Release(nsnode);
if(FAILED(hres))
return hres;
......@@ -780,7 +780,7 @@ static HRESULT WINAPI HTMLDOMNode_replaceChild(IHTMLDOMNode *iface, IHTMLDOMNode
if(NS_FAILED(nsres))
return E_FAIL;
hres = get_node(This->doc, nsnode, TRUE, &ret_node);
hres = get_node(nsnode, TRUE, &ret_node);
nsIDOMNode_Release(nsnode);
if(FAILED(hres))
return hres;
......@@ -860,7 +860,7 @@ static HRESULT WINAPI HTMLDOMNode_appendChild(IHTMLDOMNode *iface, IHTMLDOMNode
return E_FAIL;
}
hres = get_node(This->doc, nsnode, TRUE, &node_obj);
hres = get_node(nsnode, TRUE, &node_obj);
nsIDOMNode_Release(nsnode);
if(FAILED(hres))
return hres;
......@@ -946,7 +946,7 @@ static HRESULT WINAPI HTMLDOMNode_get_firstChild(IHTMLDOMNode *iface, IHTMLDOMNo
return S_OK;
}
hres = get_node(This->doc, nschild, TRUE, &node);
hres = get_node(nschild, TRUE, &node);
nsIDOMNode_Release(nschild);
if(FAILED(hres))
return hres;
......@@ -970,7 +970,7 @@ static HRESULT WINAPI HTMLDOMNode_get_lastChild(IHTMLDOMNode *iface, IHTMLDOMNod
return S_OK;
}
hres = get_node(This->doc, nschild, TRUE, &node);
hres = get_node(nschild, TRUE, &node);
nsIDOMNode_Release(nschild);
if(FAILED(hres))
return hres;
......@@ -994,7 +994,7 @@ static HRESULT WINAPI HTMLDOMNode_get_previousSibling(IHTMLDOMNode *iface, IHTML
return S_OK;
}
hres = get_node(This->doc, nschild, TRUE, &node);
hres = get_node(nschild, TRUE, &node);
nsIDOMNode_Release(nschild);
if(FAILED(hres))
return hres;
......@@ -1018,7 +1018,7 @@ static HRESULT WINAPI HTMLDOMNode_get_nextSibling(IHTMLDOMNode *iface, IHTMLDOMN
return S_OK;
}
hres = get_node(This->doc, nssibling, TRUE, &node);
hres = get_node(nssibling, TRUE, &node);
nsIDOMNode_Release(nssibling);
if(FAILED(hres))
return hres;
......@@ -1614,7 +1614,7 @@ void init_node_cc(void)
ccp_init(&node_ccp, &node_ccp_callback);
}
HRESULT get_node(HTMLDocumentNode *This, nsIDOMNode *nsnode, BOOL create, HTMLDOMNode **ret)
HRESULT get_node(nsIDOMNode *nsnode, BOOL create, HTMLDOMNode **ret)
{
nsIDOMDocument *dom_document;
HTMLDocumentNode *document;
......
......@@ -334,7 +334,7 @@ static HRESULT WINAPI HTMLOptionElement_get_form(IHTMLOptionElement *iface, IHTM
nsIDOMHTMLFormElement_Release(nsform);
assert(nsres == NS_OK);
hres = get_node(This->element.node.doc, form_node, TRUE, &node);
hres = get_node(form_node, TRUE, &node);
nsIDOMNode_Release(form_node);
if (FAILED(hres))
return hres;
......@@ -579,7 +579,7 @@ static HRESULT WINAPI HTMLOptionElementFactory_create(IHTMLOptionElementFactory
if(FAILED(hres))
return hres;
hres = get_node(This->window->doc, (nsIDOMNode*)nselem, TRUE, &node);
hres = get_node((nsIDOMNode*)nselem, TRUE, &node);
nsIDOMElement_Release(nselem);
if(FAILED(hres))
return hres;
......
......@@ -457,7 +457,7 @@ HRESULT script_elem_from_nsscript(HTMLDocumentNode *doc, nsIDOMHTMLScriptElement
nsres = nsIDOMHTMLScriptElement_QueryInterface(nsscript, &IID_nsIDOMNode, (void**)&nsnode);
assert(nsres == NS_OK);
hres = get_node(doc, nsnode, TRUE, &node);
hres = get_node(nsnode, TRUE, &node);
nsIDOMNode_Release(nsnode);
if(FAILED(hres))
return hres;
......
......@@ -69,7 +69,7 @@ static HRESULT htmlselect_item(HTMLSelectElement *This, int i, IDispatch **ret)
if(nsnode) {
HTMLDOMNode *node;
hres = get_node(This->element.node.doc, nsnode, TRUE, &node);
hres = get_node(nsnode, TRUE, &node);
nsIDOMNode_Release(nsnode);
if(FAILED(hres))
return hres;
......@@ -398,7 +398,7 @@ static HRESULT WINAPI HTMLSelectElement_get_form(IHTMLSelectElement *iface, IHTM
nsIDOMHTMLFormElement_Release(nsform);
assert(nsres == NS_OK);
hres = get_node(This->element.node.doc, form_node, TRUE, &node);
hres = get_node(form_node, TRUE, &node);
nsIDOMNode_Release(form_node);
if (FAILED(hres))
return hres;
......
......@@ -216,7 +216,7 @@ static HRESULT WINAPI HTMLTextAreaElement_get_form(IHTMLTextAreaElement *iface,
nsIDOMHTMLFormElement_Release(nsform);
assert(nsres == NS_OK);
hres = get_node(This->element.node.doc, nsnode, TRUE, &node);
hres = get_node(nsnode, TRUE, &node);
nsIDOMNode_Release(nsnode);
if(FAILED(hres))
return hres;
......
......@@ -170,7 +170,7 @@ static HRESULT WINAPI HTMLDOMTextNode_splitText(IHTMLDOMTextNode *iface, LONG of
return S_OK;
}
hres = get_node(This->node.doc, (nsIDOMNode*)text, TRUE, &node);
hres = get_node((nsIDOMNode*)text, TRUE, &node);
nsIDOMText_Release(text);
if(FAILED(hres))
return hres;
......
......@@ -1072,7 +1072,7 @@ void HTMLElement_init_dispex_info(dispex_data_t*,compat_mode_t) DECLSPEC_HIDDEN;
HRESULT HTMLFrameBase_QI(HTMLFrameBase*,REFIID,void**) DECLSPEC_HIDDEN;
void HTMLFrameBase_destructor(HTMLFrameBase*) DECLSPEC_HIDDEN;
HRESULT get_node(HTMLDocumentNode*,nsIDOMNode*,BOOL,HTMLDOMNode**) DECLSPEC_HIDDEN;
HRESULT get_node(nsIDOMNode*,BOOL,HTMLDOMNode**) DECLSPEC_HIDDEN;
HRESULT get_elem(HTMLDocumentNode*,nsIDOMElement*,HTMLElement**) DECLSPEC_HIDDEN;
HRESULT get_document_node(nsIDOMDocument*,HTMLDocumentNode**) DECLSPEC_HIDDEN;
......
......@@ -230,7 +230,7 @@ static nsresult run_bind_to_tree(HTMLDocumentNode *doc, nsISupports *nsiface, ns
if(NS_FAILED(nsres))
return nsres;
hres = get_node(doc, nsnode, TRUE, &node);
hres = get_node(nsnode, TRUE, &node);
nsIDOMNode_Release(nsnode);
if(FAILED(hres)) {
ERR("Could not get node\n");
......
......@@ -281,7 +281,7 @@ static NPError CDECL NPP_New(NPMIMEType pluginType, NPP instance, UINT16 mode, I
return NPERR_GENERIC_ERROR;
}
hres = get_node(window->doc, (nsIDOMNode*)nselem, TRUE, &node);
hres = get_node((nsIDOMNode*)nselem, TRUE, &node);
nsIDOMElement_Release(nselem);
if(FAILED(hres))
return NPERR_GENERIC_ERROR;
......
......@@ -1494,7 +1494,7 @@ static nsresult NSAPI nsContextMenuListener_OnShowContextMenu(nsIContextMenuList
TRACE("(%p)->(%08x %p %p)\n", This, aContextFlags, aEvent, aNode);
hres = get_node(This->doc->basedoc.doc_node, aNode, TRUE, &node);
hres = get_node(aNode, TRUE, &node);
if(FAILED(hres))
return NS_ERROR_FAILURE;
......
......@@ -322,7 +322,7 @@ static nsresult NSAPI handle_htmlevent(nsIDOMEventListener *iface, nsIDOMEvent *
return NS_OK;
}
hres = get_node(doc, nsnode, TRUE, &node);
hres = get_node(nsnode, TRUE, &node);
nsIDOMNode_Release(nsnode);
if(FAILED(hres))
return NS_OK;
......
......@@ -1023,7 +1023,7 @@ static HRESULT WINAPI HTMLTxtRange_parentElement(IHTMLTxtRange *iface, IHTMLElem
return S_OK;
}
hres = get_node(This->doc, nsnode, TRUE, &node);
hres = get_node(nsnode, TRUE, &node);
nsIDOMNode_Release(nsnode);
if(FAILED(hres))
return hres;
......
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