Jacek Caban : mshtml: Use get_element helper in IHTMLElement:: get_offsetParent implementation.

Alexandre Julliard julliard at winehq.org
Mon Feb 19 13:52:02 CST 2018


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Mon Feb 19 14:50:21 2018 +0100

mshtml: Use get_element helper in IHTMLElement::get_offsetParent implementation.

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

---

 dlls/mshtml/htmlelem.c | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c
index 4789047..ca935d3 100644
--- a/dlls/mshtml/htmlelem.c
+++ b/dlls/mshtml/htmlelem.c
@@ -1408,6 +1408,7 @@ static HRESULT WINAPI HTMLElement_get_offsetParent(IHTMLElement *iface, IHTMLEle
 {
     HTMLElement *This = impl_from_IHTMLElement(iface);
     nsIDOMElement *nsparent;
+    HTMLElement *parent;
     nsresult nsres;
     HRESULT hres;
 
@@ -1424,22 +1425,18 @@ static HRESULT WINAPI HTMLElement_get_offsetParent(IHTMLElement *iface, IHTMLEle
         return E_FAIL;
     }
 
-    if(nsparent) {
-        HTMLDOMNode *node;
-
-        hres = get_node((nsIDOMNode*)nsparent, TRUE, &node);
-        nsIDOMElement_Release(nsparent);
-        if(FAILED(hres))
-            return hres;
-
-        hres = IHTMLDOMNode_QueryInterface(&node->IHTMLDOMNode_iface, &IID_IHTMLElement, (void**)p);
-        node_release(node);
-    }else {
+    if(!nsparent) {
         *p = NULL;
         hres = S_OK;
     }
 
-    return hres;
+    hres = get_element(nsparent, &parent);
+    nsIDOMElement_Release(nsparent);
+    if(FAILED(hres))
+        return hres;
+
+    *p = &parent->IHTMLElement_iface;
+    return S_OK;
 }
 
 static HRESULT WINAPI HTMLElement_put_innerHTML(IHTMLElement *iface, BSTR v)




More information about the wine-cvs mailing list