Module: wine Branch: master Commit: c67952ae1484d9475e127889181e1c613084aa2e URL: http://source.winehq.org/git/wine.git/?a=commit;h=c67952ae1484d9475e12788918...
Author: Jacek Caban jacek@codeweavers.com Date: Tue Oct 7 14:43:30 2008 -0500
mshtml: Added IHTMLElement::get_offsetWidth 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 d3c0633..bed5f59 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -707,8 +707,27 @@ static HRESULT WINAPI HTMLElement_get_offsetTop(IHTMLElement *iface, long *p) static HRESULT WINAPI HTMLElement_get_offsetWidth(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_GetOffsetWidth(nselem, &offset); + nsIDOMNSHTMLElement_Release(nselem); + if(NS_FAILED(nsres)) { + ERR("GetOffsetWidth failed: %08x\n", nsres); + return E_FAIL; + } + + *p = offset; + return S_OK; }
static HRESULT WINAPI HTMLElement_get_offsetHeight(IHTMLElement *iface, long *p) diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index ee7f3ea..9ce91ba 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -541,6 +541,9 @@ static void _test_elem_offset(unsigned line, IUnknown *unk) hres = IHTMLElement_get_offsetHeight(elem, &l); ok_(__FILE__,line) (hres == S_OK, "get_offsetHeight failed: %08x\n", hres);
+ hres = IHTMLElement_get_offsetWidth(elem, &l); + ok_(__FILE__,line) (hres == S_OK, "get_offsetWidth failed: %08x\n", hres); + IHTMLElement_Release(elem); }