Jacek Caban : mshtml: Added IHTMLElement::get_offsetLeft implementation.
Alexandre Julliard
julliard at winehq.org
Tue May 31 13:08:18 CDT 2011
Module: wine
Branch: master
Commit: 0a77eb68e3007581a0c4d6e25490f3ec65128e98
URL: http://source.winehq.org/git/wine.git/?a=commit;h=0a77eb68e3007581a0c4d6e25490f3ec65128e98
Author: Jacek Caban <jacek at codeweavers.com>
Date: Tue May 31 12:19:13 2011 +0200
mshtml: Added IHTMLElement::get_offsetLeft 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 74a4394..0cf0227 100644
--- a/dlls/mshtml/htmlelem.c
+++ b/dlls/mshtml/htmlelem.c
@@ -819,8 +819,27 @@ static HRESULT WINAPI HTMLElement_get_lang(IHTMLElement *iface, BSTR *p)
static HRESULT WINAPI HTMLElement_get_offsetLeft(IHTMLElement *iface, LONG *p)
{
HTMLElement *This = impl_from_IHTMLElement(iface);
- FIXME("(%p)->(%p)\n", This, p);
- return E_NOTIMPL;
+ nsIDOMNSHTMLElement *nselem;
+ PRInt32 off_left = 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_GetOffsetLeft(nselem, &off_left);
+ nsIDOMNSHTMLElement_Release(nselem);
+ if(NS_FAILED(nsres)) {
+ ERR("GetOffsetLeft failed: %08x\n", nsres);
+ return E_FAIL;
+ }
+
+ *p = off_left;
+ return S_OK;
}
static HRESULT WINAPI HTMLElement_get_offsetTop(IHTMLElement *iface, LONG *p)
diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c
index d7e8dda..03eb48a 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -947,6 +947,9 @@ static void _test_elem_offset(unsigned line, IUnknown *unk)
hres = IHTMLElement_get_offsetWidth(elem, &l);
ok_(__FILE__,line) (hres == S_OK, "get_offsetWidth failed: %08x\n", hres);
+ hres = IHTMLElement_get_offsetLeft(elem, &l);
+ ok_(__FILE__,line) (hres == S_OK, "get_offsetLeft failed: %08x\n", hres);
+
IHTMLElement_Release(elem);
}
More information about the wine-cvs
mailing list