Jacek Caban : mshtml: Added implementation of put_scrollTop and put_scrollLeft.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Aug 1 12:45:11 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: 166f1999caee70c62fe27435537ec21242404c39
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=166f1999caee70c62fe27435537ec21242404c39

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Tue Aug  1 14:50:52 2006 +0200

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 7f5816a..2634ac8 100644
--- a/dlls/mshtml/htmltextcont.c
+++ b/dlls/mshtml/htmltextcont.c
@@ -115,8 +115,21 @@ static HRESULT WINAPI HTMLTextContainer_
 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_
 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 72735a7..c1d5bb4 100644
--- a/dlls/mshtml/nsiface.idl
+++ b/dlls/mshtml/nsiface.idl
@@ -465,6 +465,30 @@ interface nsIDOMHTMLElement : nsIDOMElem
 
 [
     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




More information about the wine-cvs mailing list