mshtml: Use nsIDOMElement for Gecko elements in npplugin.c.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
300c64603f
commit
364e1c87a5
|
@ -211,11 +211,10 @@ typedef struct _NPPluginFuncs {
|
||||||
NPP_LostFocusPtr lostfocus;
|
NPP_LostFocusPtr lostfocus;
|
||||||
} NPPluginFuncs;
|
} NPPluginFuncs;
|
||||||
|
|
||||||
static nsIDOMHTMLElement *get_dom_element(NPP instance)
|
static nsIDOMElement *get_dom_element(NPP instance)
|
||||||
{
|
{
|
||||||
nsISupports *instance_unk = (nsISupports*)instance->ndata;
|
nsISupports *instance_unk = (nsISupports*)instance->ndata;
|
||||||
nsIPluginInstance *plugin_instance;
|
nsIPluginInstance *plugin_instance;
|
||||||
nsIDOMHTMLElement *html_elem;
|
|
||||||
nsIDOMElement *elem;
|
nsIDOMElement *elem;
|
||||||
nsresult nsres;
|
nsresult nsres;
|
||||||
|
|
||||||
|
@ -232,24 +231,17 @@ static nsIDOMHTMLElement *get_dom_element(NPP instance)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsres = nsIDOMElement_QueryInterface(elem, &IID_nsIDOMHTMLElement, (void**)&html_elem);
|
return elem;
|
||||||
nsIDOMElement_Release(elem);
|
|
||||||
if(NS_FAILED(nsres)) {
|
|
||||||
ERR("Could not get nsIDOMHTMLElement iface: %08x\n", nsres);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return html_elem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static HTMLInnerWindow *get_elem_window(nsIDOMHTMLElement *elem)
|
static HTMLInnerWindow *get_elem_window(nsIDOMElement *elem)
|
||||||
{
|
{
|
||||||
mozIDOMWindowProxy *mozwindow;
|
mozIDOMWindowProxy *mozwindow;
|
||||||
nsIDOMDocument *nsdoc;
|
nsIDOMDocument *nsdoc;
|
||||||
HTMLOuterWindow *window;
|
HTMLOuterWindow *window;
|
||||||
nsresult nsres;
|
nsresult nsres;
|
||||||
|
|
||||||
nsres = nsIDOMHTMLElement_GetOwnerDocument(elem, &nsdoc);
|
nsres = nsIDOMElement_GetOwnerDocument(elem, &nsdoc);
|
||||||
if(NS_FAILED(nsres))
|
if(NS_FAILED(nsres))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -268,7 +260,7 @@ static NPError CDECL NPP_New(NPMIMEType pluginType, NPP instance, UINT16 mode, I
|
||||||
char **argv, NPSavedData *saved)
|
char **argv, NPSavedData *saved)
|
||||||
{
|
{
|
||||||
HTMLPluginContainer *container;
|
HTMLPluginContainer *container;
|
||||||
nsIDOMHTMLElement *nselem;
|
nsIDOMElement *nselem;
|
||||||
HTMLInnerWindow *window;
|
HTMLInnerWindow *window;
|
||||||
HTMLDOMNode *node;
|
HTMLDOMNode *node;
|
||||||
NPError err = NPERR_NO_ERROR;
|
NPError err = NPERR_NO_ERROR;
|
||||||
|
@ -285,12 +277,12 @@ static NPError CDECL NPP_New(NPMIMEType pluginType, NPP instance, UINT16 mode, I
|
||||||
window = get_elem_window(nselem);
|
window = get_elem_window(nselem);
|
||||||
if(!window) {
|
if(!window) {
|
||||||
ERR("Could not get element's window object\n");
|
ERR("Could not get element's window object\n");
|
||||||
nsIDOMHTMLElement_Release(nselem);
|
nsIDOMElement_Release(nselem);
|
||||||
return NPERR_GENERIC_ERROR;
|
return NPERR_GENERIC_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
hres = get_node(window->doc, (nsIDOMNode*)nselem, TRUE, &node);
|
hres = get_node(window->doc, (nsIDOMNode*)nselem, TRUE, &node);
|
||||||
nsIDOMHTMLElement_Release(nselem);
|
nsIDOMElement_Release(nselem);
|
||||||
if(FAILED(hres))
|
if(FAILED(hres))
|
||||||
return NPERR_GENERIC_ERROR;
|
return NPERR_GENERIC_ERROR;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue