Jacek Caban : mshtml: Use nsIDOMElement for Gecko elements in npplugin.c.

Alexandre Julliard julliard at winehq.org
Mon Feb 12 16:10:36 CST 2018


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Mon Feb 12 01:30:40 2018 +0100

mshtml: Use nsIDOMElement for Gecko elements in npplugin.c.

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

---

 dlls/mshtml/npplugin.c | 22 +++++++---------------
 1 file changed, 7 insertions(+), 15 deletions(-)

diff --git a/dlls/mshtml/npplugin.c b/dlls/mshtml/npplugin.c
index 302ff42..0d94d0d 100644
--- a/dlls/mshtml/npplugin.c
+++ b/dlls/mshtml/npplugin.c
@@ -211,11 +211,10 @@ typedef struct _NPPluginFuncs {
     NPP_LostFocusPtr lostfocus;
 } NPPluginFuncs;
 
-static nsIDOMHTMLElement *get_dom_element(NPP instance)
+static nsIDOMElement *get_dom_element(NPP instance)
 {
     nsISupports *instance_unk = (nsISupports*)instance->ndata;
     nsIPluginInstance *plugin_instance;
-    nsIDOMHTMLElement *html_elem;
     nsIDOMElement *elem;
     nsresult nsres;
 
@@ -232,24 +231,17 @@ static nsIDOMHTMLElement *get_dom_element(NPP instance)
         return NULL;
     }
 
-    nsres = nsIDOMElement_QueryInterface(elem, &IID_nsIDOMHTMLElement, (void**)&html_elem);
-    nsIDOMElement_Release(elem);
-    if(NS_FAILED(nsres)) {
-        ERR("Could not get nsIDOMHTMLElement iface: %08x\n", nsres);
-        return NULL;
-    }
-
-    return html_elem;
+    return elem;
 }
 
-static HTMLInnerWindow *get_elem_window(nsIDOMHTMLElement *elem)
+static HTMLInnerWindow *get_elem_window(nsIDOMElement *elem)
 {
     mozIDOMWindowProxy *mozwindow;
     nsIDOMDocument *nsdoc;
     HTMLOuterWindow *window;
     nsresult nsres;
 
-    nsres = nsIDOMHTMLElement_GetOwnerDocument(elem, &nsdoc);
+    nsres = nsIDOMElement_GetOwnerDocument(elem, &nsdoc);
     if(NS_FAILED(nsres))
         return NULL;
 
@@ -268,7 +260,7 @@ static NPError CDECL NPP_New(NPMIMEType pluginType, NPP instance, UINT16 mode, I
         char **argv, NPSavedData *saved)
 {
     HTMLPluginContainer *container;
-    nsIDOMHTMLElement *nselem;
+    nsIDOMElement *nselem;
     HTMLInnerWindow *window;
     HTMLDOMNode *node;
     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);
     if(!window) {
         ERR("Could not get element's window object\n");
-        nsIDOMHTMLElement_Release(nselem);
+        nsIDOMElement_Release(nselem);
         return NPERR_GENERIC_ERROR;
     }
 
     hres = get_node(window->doc, (nsIDOMNode*)nselem, TRUE, &node);
-    nsIDOMHTMLElement_Release(nselem);
+    nsIDOMElement_Release(nselem);
     if(FAILED(hres))
         return NPERR_GENERIC_ERROR;
 




More information about the wine-cvs mailing list