Jacek Caban : mshtml: Added IHTMLElement::get_offsetHeight implementation.

Alexandre Julliard julliard at winehq.org
Fri Aug 1 05:33:44 CDT 2008


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Fri Aug  1 01:25:11 2008 +0200

mshtml: Added IHTMLElement::get_offsetHeight implementation.

---

 dlls/mshtml/htmlelem.c  |   23 +++++++++++++++++++++--
 dlls/mshtml/tests/dom.c |    3 +++
 2 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c
index 670c615..244661f 100644
--- a/dlls/mshtml/htmlelem.c
+++ b/dlls/mshtml/htmlelem.c
@@ -745,8 +745,27 @@ static HRESULT WINAPI HTMLElement_get_offsetWidth(IHTMLElement *iface, long *p)
 static HRESULT WINAPI HTMLElement_get_offsetHeight(IHTMLElement *iface, long *p)
 {
     HTMLElement *This = HTMLELEM_THIS(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
+    nsIDOMNSHTMLElement *nselem;
+    PRInt32 offset = 0;
+    nsresult nsres;
+
+    TRACE("(%p)->(%p)\n", This, p);
+
+    nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
+    if(NS_FAILED(nsres)) {
+        ERR("Could not get nsIDOMNSHTMLElement: %08x\n", nsres);
+        return E_FAIL;
+    }
+
+    nsres = nsIDOMNSHTMLElement_GetOffsetHeight(nselem, &offset);
+    nsIDOMNSHTMLElement_Release(nselem);
+    if(NS_FAILED(nsres)) {
+        ERR("GetOffsetHeight failed: %08x\n", nsres);
+        return E_FAIL;
+    }
+
+    *p = offset;
+    return S_OK;
 }
 
 static HRESULT WINAPI HTMLElement_get_offsetParent(IHTMLElement *iface, IHTMLElement **p)
diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c
index ecdc0c6..e7a2907 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -496,6 +496,9 @@ static void _test_elem_offset(unsigned line, IUnknown *unk)
     hres = IHTMLElement_get_offsetTop(elem, &l);
     ok_(__FILE__,line) (hres == S_OK, "get_offsetTop failed: %08x\n", hres);
 
+    hres = IHTMLElement_get_offsetHeight(elem, &l);
+    ok_(__FILE__,line) (hres == S_OK, "get_offsetHeight failed: %08x\n", hres);
+
     IHTMLElement_Release(elem);
 }
 




More information about the wine-cvs mailing list