From 0a0d72ac5d5bc3a5943eefdd78360051bb5b0b3c Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Wed, 26 Sep 2007 20:44:37 +0200 Subject: [PATCH] mshtml: Added IHTMLElement2::put_scrollTop and put_scrollLeft implementation. --- dlls/mshtml/htmlelem2.c | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/dlls/mshtml/htmlelem2.c b/dlls/mshtml/htmlelem2.c index 5b25086f46a..1d1fcfaf676 100644 --- a/dlls/mshtml/htmlelem2.c +++ b/dlls/mshtml/htmlelem2.c @@ -626,8 +626,20 @@ static HRESULT WINAPI HTMLElement2_get_scrollWidth(IHTMLElement2 *iface, long *p static HRESULT WINAPI HTMLElement2_put_scrollTop(IHTMLElement2 *iface, long v) { HTMLElement *This = HTMLELEM2_THIS(iface); - FIXME("(%p)->(%ld)\n", This, v); - return E_NOTIMPL; + nsIDOMNSHTMLElement *nselem; + nsresult nsres; + + TRACE("(%p)->(%ld)\n", This, v); + + nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem); + if(NS_SUCCEEDED(nsres)) { + nsIDOMNSHTMLElement_SetScrollTop(nselem, v); + nsIDOMNSHTMLElement_Release(nselem); + }else { + ERR("Could not get nsIDOMNSHTMLElement interface: %08x\n", nsres); + } + + return S_OK; } static HRESULT WINAPI HTMLElement2_get_scrollTop(IHTMLElement2 *iface, long *p) @@ -640,8 +652,20 @@ static HRESULT WINAPI HTMLElement2_get_scrollTop(IHTMLElement2 *iface, long *p) static HRESULT WINAPI HTMLElement2_put_scrollLeft(IHTMLElement2 *iface, long v) { HTMLElement *This = HTMLELEM2_THIS(iface); - FIXME("(%p)->()\n", This); - return E_NOTIMPL; + nsIDOMNSHTMLElement *nselem; + nsresult nsres; + + TRACE("(%p)->(%ld)\n", This, v); + + nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem); + if(NS_SUCCEEDED(nsres)) { + nsIDOMNSHTMLElement_SetScrollLeft(nselem, v); + nsIDOMNSHTMLElement_Release(nselem); + }else { + ERR("Could not get nsIDOMNSHTMLElement interface: %08x\n", nsres); + } + + return S_OK; } static HRESULT WINAPI HTMLElement2_get_scrollLeft(IHTMLElement2 *iface, long *p)