Commit 3ab9eaf6 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Reimplement get_node_obj using vtbl comparison.

parent 4e10fcc9
......@@ -883,6 +883,15 @@ static const IHTMLDOMNodeVtbl HTMLDOMNodeVtbl = {
HTMLDOMNode_get_nextSibling
};
static HTMLDOMNode *get_node_obj(HTMLDocumentNode *This, IUnknown *iface)
{
IHTMLDOMNode *node;
HRESULT hres;
hres = IUnknown_QueryInterface(iface, &IID_IHTMLDOMNode, (void**)&node);
return hres == S_OK && node->lpVtbl == &HTMLDOMNodeVtbl ? impl_from_IHTMLDOMNode(node) : NULL;
}
static inline HTMLDOMNode *impl_from_IHTMLDOMNode2(IHTMLDOMNode2 *iface)
{
return CONTAINING_RECORD(iface, HTMLDOMNode, IHTMLDOMNode2_iface);
......@@ -1117,29 +1126,6 @@ HRESULT get_node(HTMLDocumentNode *This, nsIDOMNode *nsnode, BOOL create, HTMLDO
return create_node(This, nsnode, ret);
}
/*
* FIXME
* We should use better way for getting node object (like private interface)
* or avoid it at all.
*/
static HTMLDOMNode *get_node_obj(HTMLDocumentNode *This, IUnknown *iface)
{
HTMLDOMNode *iter = This->nodes;
IHTMLDOMNode *node;
IUnknown_QueryInterface(iface, &IID_IHTMLDOMNode, (void**)&node);
while(iter) {
if(&iter->IHTMLDOMNode_iface == node)
return iter;
iter = iter->next;
}
FIXME("Not found %p\n", iface);
IHTMLDOMNode_Release(node);
return NULL;
}
void release_nodes(HTMLDocumentNode *This)
{
HTMLDOMNode *iter, *next;
......
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