From dab6474b66fdb468663809e2e8982cc1c921260f Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Fri, 17 Aug 2007 02:39:19 +0200 Subject: [PATCH] mshtml: Added get_scrollWidth and get_scrollHeight implementation. --- dlls/mshtml/htmltextcont.c | 40 ++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/dlls/mshtml/htmltextcont.c b/dlls/mshtml/htmltextcont.c index 42f0805063e..ed079db0214 100644 --- a/dlls/mshtml/htmltextcont.c +++ b/dlls/mshtml/htmltextcont.c @@ -101,15 +101,47 @@ static HRESULT WINAPI HTMLTextContainer_createControlRange(IHTMLTextContainer *i static HRESULT WINAPI HTMLTextContainer_get_scrollHeight(IHTMLTextContainer *iface, long *p) { HTMLTextContainer *This = HTMLTEXTCONT_THIS(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + nsIDOMNSHTMLElement *nselem; + PRInt32 height; + nsresult nsres; + + TRACE("(%p)->(%p)\n", This, p); + + nsres = nsIDOMElement_QueryInterface(This->element->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem); + if(NS_SUCCEEDED(nsres)) { + nsIDOMNSHTMLElement_GetScrollHeight(nselem, &height); + nsIDOMNSHTMLElement_Release(nselem); + }else { + ERR("Could not get nsIDOMNSHTMLElement interface: %08x\n", nsres); + } + + *p = height; + TRACE("*p = %ld\n", *p); + + return S_OK; } static HRESULT WINAPI HTMLTextContainer_get_scrollWidth(IHTMLTextContainer *iface, long *p) { HTMLTextContainer *This = HTMLTEXTCONT_THIS(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + nsIDOMNSHTMLElement *nselem; + PRInt32 width = 0; + nsresult nsres; + + TRACE("(%p)->(%p)\n", This, p); + + nsres = nsIDOMElement_QueryInterface(This->element->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem); + if(NS_SUCCEEDED(nsres)) { + nsIDOMNSHTMLElement_GetScrollWidth(nselem, &width); + nsIDOMNSHTMLElement_Release(nselem); + }else { + ERR("Could not get nsIDOMNSHTMLElement interface: %08x\n", nsres); + } + + *p = width; + TRACE("*p = %ld\n", *p); + + return S_OK; } static HRESULT WINAPI HTMLTextContainer_put_scrollTop(IHTMLTextContainer *iface, long v)