[PATCH 2/2] mshtml: Implement IHTMLWindow7::get_pageXOffset/pageYOffset.
Nikolay Sivov
nsivov at codeweavers.com
Tue Jan 21 14:26:44 CST 2020
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
dlls/mshtml/htmlwindow.c | 30 ++++++++++++++++++++++++++----
dlls/mshtml/tests/dom.c | 13 +++++++++++--
2 files changed, 37 insertions(+), 6 deletions(-)
diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c
index ace727246f..c6ec26de55 100644
--- a/dlls/mshtml/htmlwindow.c
+++ b/dlls/mshtml/htmlwindow.c
@@ -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)
diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c
index 23b3a57282..f77a1ddf80 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -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");
}
--
2.24.1
More information about the wine-devel
mailing list