mshtml: Implement IHTMLWindow7::get_pageXOffset/pageYOffset.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
feature/deterministic
Nikolay Sivov 2020-01-21 23:26:44 +03:00 committed by Alexandre Julliard
parent 98fc7db10a
commit 67eb749225
2 changed files with 37 additions and 6 deletions

View File

@ -2444,15 +2444,37 @@ static HRESULT WINAPI HTMLWindow7_get_innerHeight(IHTMLWindow7 *iface, LONG *p)
static HRESULT WINAPI HTMLWindow7_get_pageXOffset(IHTMLWindow7 *iface, LONG *p)
{
HTMLWindow *This = impl_from_IHTMLWindow7(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
nsresult nsres;
INT32 ret;
TRACE("(%p)->(%p)\n", This, p);
nsres = nsIDOMWindow_GetPageXOffset(This->outer_window->nswindow, &ret);
if(NS_FAILED(nsres)) {
ERR("GetPageXOffset failed: %08x\n", nsres);
return E_FAIL;
}
*p = ret;
return S_OK;
}
static HRESULT WINAPI HTMLWindow7_get_pageYOffset(IHTMLWindow7 *iface, LONG *p)
{
HTMLWindow *This = impl_from_IHTMLWindow7(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
nsresult nsres;
INT32 ret;
TRACE("(%p)->(%p)\n", This, p);
nsres = nsIDOMWindow_GetPageYOffset(This->outer_window->nswindow, &ret);
if(NS_FAILED(nsres)) {
ERR("GetPageYOffset failed: %08x\n", nsres);
return E_FAIL;
}
*p = ret;
return S_OK;
}
static HRESULT WINAPI HTMLWindow7_get_screenX(IHTMLWindow7 *iface, LONG *p)

View File

@ -6974,6 +6974,7 @@ static void test_window(IHTMLDocument2 *doc)
IHTMLPerformance *performance;
IHTMLDOMNode *node;
IHTMLElement *elem;
LONG offset;
ok(window7 != NULL, "window7 == NULL\n");
@ -6998,10 +6999,16 @@ static void test_window(IHTMLDocument2 *doc)
ok(hres == S_OK, "get_performance failed: %08x\n", hres);
ok(V_VT(&v) == VT_I2, "V_VT(performance) = %u\n", V_VT(&v));
ok(V_I2(&v) == 2, "V_I2(performance) = %d\n", V_I2(&v));
IHTMLWindow7_Release(window7);
}
hres = IHTMLWindow7_get_pageXOffset(window7, &offset);
ok(hres == S_OK, "get_pageXOffset failed: %08x\n", hres);
ok(!offset, "Unexpected offset %d.\n", offset);
hres = IHTMLWindow7_get_pageYOffset(window7, &offset);
ok(hres == S_OK, "get_pageYOffset failed: %08x\n", hres);
ok(!offset, "Unexpected offset %d.\n", offset);
hres = IHTMLDocument2_get_body(doc, &elem);
ok(hres == S_OK, "get_body failed: %08x\n", hres);
@ -7020,6 +7027,8 @@ static void test_window(IHTMLDocument2 *doc)
IHTMLDOMNode_Release(node);
IHTMLElement_Release(elem);
IHTMLWindow7_Release(window7);
}else {
win_skip("IHTMLWindow7 not supported\n");
}