Commit 67eb7492 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

mshtml: Implement IHTMLWindow7::get_pageXOffset/pageYOffset.

parent 98fc7db1
......@@ -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)
......
......@@ -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");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment