diff --git a/dlls/mshtml/htmltextcont.c b/dlls/mshtml/htmltextcont.c index c5141bcfb37..212784cf4d0 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 13fcfa2da86..ecdc0c61c55 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; }