From bf10dd3ee4d5df7c19245bbdbee68cb6327bd133 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Thu, 31 Jul 2014 20:54:23 +0200 Subject: [PATCH] mshtml: Added IHTMLElement:scrollIntoView implementation. --- dlls/mshtml/htmlelem.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index 8378d74d092..a02baa7fc12 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -851,8 +851,31 @@ static HRESULT WINAPI HTMLElement_get_onselectstart(IHTMLElement *iface, VARIANT static HRESULT WINAPI HTMLElement_scrollIntoView(IHTMLElement *iface, VARIANT varargStart) { HTMLElement *This = impl_from_IHTMLElement(iface); - FIXME("(%p)->(%s)\n", This, debugstr_variant(&varargStart)); - return E_NOTIMPL; + cpp_bool start = TRUE; + nsresult nsres; + + TRACE("(%p)->(%s)\n", This, debugstr_variant(&varargStart)); + + switch(V_VT(&varargStart)) { + case VT_EMPTY: + case VT_ERROR: + break; + case VT_BOOL: + start = V_BOOL(&varargStart) != VARIANT_FALSE; + break; + default: + FIXME("Unsupported argument %s\n", debugstr_variant(&varargStart)); + } + + if(!This->nselem) { + FIXME("Unsupported for comments\n"); + return E_NOTIMPL; + } + + nsres = nsIDOMHTMLElement_ScrollIntoView(This->nselem, start, 1); + assert(nsres == NS_OK); + + return S_OK; } static HRESULT WINAPI HTMLElement_contains(IHTMLElement *iface, IHTMLElement *pChild,