From 166f1999caee70c62fe27435537ec21242404c39 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Tue, 1 Aug 2006 14:50:52 +0200 Subject: [PATCH] mshtml: Added implementation of put_scrollTop and put_scrollLeft. --- dlls/mshtml/htmltextcont.c | 34 ++++++++++++++++++++++++++++++---- dlls/mshtml/nsiface.idl | 24 ++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 4 deletions(-) diff --git a/dlls/mshtml/htmltextcont.c b/dlls/mshtml/htmltextcont.c index 7f5816afc55..2634ac8e4a6 100644 --- a/dlls/mshtml/htmltextcont.c +++ b/dlls/mshtml/htmltextcont.c @@ -115,8 +115,21 @@ static HRESULT WINAPI HTMLTextContainer_get_scrollWidth(IHTMLTextContainer *ifac static HRESULT WINAPI HTMLTextContainer_put_scrollTop(IHTMLTextContainer *iface, long v) { HTMLTextContainer *This = HTMLTEXTCONT_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->element->nselem, &IID_nsIDOMNSHTMLElement, + (void**)&nselem); + if(NS_SUCCEEDED(nsres)) { + nsIDOMNSHTMLElement_SetScrollTop(nselem, v); + nsIDOMNSHTMLElement_Release(nselem); + }else { + ERR("Could not get nsIDOMNSHTMLElement interface: %08lx\n", nsres); + } + + return S_OK; } static HRESULT WINAPI HTMLTextContainer_get_scrollTop(IHTMLTextContainer *iface, long *p) @@ -129,8 +142,21 @@ static HRESULT WINAPI HTMLTextContainer_get_scrollTop(IHTMLTextContainer *iface, static HRESULT WINAPI HTMLTextContainer_put_scrollLeft(IHTMLTextContainer *iface, long v) { HTMLTextContainer *This = HTMLTEXTCONT_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->element->nselem, &IID_nsIDOMNSHTMLElement, + (void**)&nselem); + if(NS_SUCCEEDED(nsres)) { + nsIDOMNSHTMLElement_SetScrollLeft(nselem, v); + nsIDOMNSHTMLElement_Release(nselem); + }else { + ERR("Could not get nsIDOMNSHTMLElement interface: %08lx\n", nsres); + } + + return S_OK; } static HRESULT WINAPI HTMLTextContainer_get_scrollLeft(IHTMLTextContainer *iface, long *p) diff --git a/dlls/mshtml/nsiface.idl b/dlls/mshtml/nsiface.idl index 72735a7b4de..c1d5bb4d83c 100644 --- a/dlls/mshtml/nsiface.idl +++ b/dlls/mshtml/nsiface.idl @@ -465,6 +465,30 @@ interface nsIDOMHTMLElement : nsIDOMElement [ object, + uuid(da83b2ec-8264-4410-8496-ada3acd2ae42) +] +interface nsIDOMNSHTMLElement : nsISupports +{ + nsresult GetOffsetTop(PRInt32 *aOffsetTop); + nsresult GetOffsetLeft(PRInt32 *aOffsetLeft); + nsresult GetOffsetWidth(PRInt32 *aOffsetWidth); + nsresult GetOffsetHeight(PRInt32 *aOffsetHeight); + nsresult GetOffsetParent(nsIDOMElement **aOffsetParent); + nsresult GetInnerHTML(nsAString *aInnerHTML); + nsresult SetInnerHTML(const nsAString *aInnerHTML); + nsresult GetScrollTop(PRInt32 *aScrollTop); + nsresult SetScrollTop(PRInt32 aScrollTop); + nsresult GetScrollLeft(PRInt32 *aScrollLeft); + nsresult SetScrollLeft(PRInt32 aScrollLeft); + nsresult GetScrollHeight(PRInt32 *aScrollHeight); + nsresult GetScrollWidth(PRInt32 *aScrollWidth); + nsresult GetClientHeight(PRInt32 *aClientHeight); + nsresult GetClientWidth(PRInt32 *aClientWidth); + nsresult ScrollIntoView(PRBool top); +} + +[ + object, uuid(a6cf9075-15b3-11d2-932e-00805f8add32) ] interface nsIDOMDocument : nsIDOMNode -- 2.11.4.GIT