Jacek Caban : mshtml: Forward IHTMLTextContainer:: get_scrollTop to IHTMLElement2.

Alexandre Julliard julliard at winehq.org
Tue Jul 29 07:16:18 CDT 2008


Module: wine
Branch: master
Commit: 985115d804ba62893fbc82307686f964ede10198
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=985115d804ba62893fbc82307686f964ede10198

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Mon Jul 28 22:02:45 2008 +0200

mshtml: Forward IHTMLTextContainer::get_scrollTop to IHTMLElement2.

---

 dlls/mshtml/htmltextcont.c |    6 ++++--
 dlls/mshtml/tests/dom.c    |   11 ++++++++++-
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/dlls/mshtml/htmltextcont.c b/dlls/mshtml/htmltextcont.c
index c5141bc..212784c 100644
--- a/dlls/mshtml/htmltextcont.c
+++ b/dlls/mshtml/htmltextcont.c
@@ -128,8 +128,10 @@ static HRESULT WINAPI HTMLTextContainer_put_scrollTop(IHTMLTextContainer *iface,
 static HRESULT WINAPI HTMLTextContainer_get_scrollTop(IHTMLTextContainer *iface, long *p)
 {
     HTMLTextContainer *This = HTMLTEXTCONT_THIS(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
+
+    TRACE("(%p)->(%p)\n", This, p);
+
+    return IHTMLElement2_get_scrollTop(HTMLELEM2(&This->element), p);
 }
 
 static HRESULT WINAPI HTMLTextContainer_put_scrollLeft(IHTMLTextContainer *iface, long v)
diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c
index 13fcfa2..ecdc0c6 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -1018,13 +1018,22 @@ static long _elem_get_scroll_width(unsigned line, IUnknown *unk)
 static long _elem_get_scroll_top(unsigned line, IUnknown *unk)
 {
     IHTMLElement2 *elem = _get_elem2_iface(line, unk);
-    long l = -1;
+    IHTMLTextContainer *txtcont;
+    long l = -1, l2 = -1;
     HRESULT hres;
 
     hres = IHTMLElement2_get_scrollTop(elem, &l);
     ok_(__FILE__,line) (hres == S_OK, "get_scrollTop failed: %08x\n", hres);
     IHTMLElement2_Release(elem);
 
+    hres = IUnknown_QueryInterface(unk, &IID_IHTMLTextContainer, (void**)&txtcont);
+    ok_(__FILE__,line) (hres == S_OK, "Could not get IHTMLTextContainer: %08x\n", hres);
+
+    hres = IHTMLTextContainer_get_scrollTop(txtcont, &l2);
+    IHTMLTextContainer_Release(txtcont);
+    ok_(__FILE__,line) (hres == S_OK, "IHTMLTextContainer::get_scrollTop failed: %ld\n", l2);
+    ok_(__FILE__,line) (l == l2, "unexpected top %ld, expected %ld\n", l2, l);
+
     return l;
 }
 




More information about the wine-cvs mailing list