mshtml: Added IDOMEvent::view property implementation.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2018-02-15 17:05:00 +01:00 committed by Alexandre Julliard
parent ab210dd7a4
commit 2e91bf3212
3 changed files with 30 additions and 3 deletions

View File

@ -1175,8 +1175,25 @@ static HRESULT WINAPI DOMUIEvent_Invoke(IDOMUIEvent *iface, DISPID dispIdMember,
static HRESULT WINAPI DOMUIEvent_get_view(IDOMUIEvent *iface, IHTMLWindow2 **p) static HRESULT WINAPI DOMUIEvent_get_view(IDOMUIEvent *iface, IHTMLWindow2 **p)
{ {
DOMEvent *This = impl_from_IDOMUIEvent(iface); DOMEvent *This = impl_from_IDOMUIEvent(iface);
FIXME("(%p)->(%p)\n", This, p); mozIDOMWindowProxy *moz_window;
return E_NOTIMPL; HTMLOuterWindow *view = NULL;
nsresult nsres;
TRACE("(%p)->(%p)\n", This, p);
nsres = nsIDOMUIEvent_GetView(This->ui_event, &moz_window);
if(NS_FAILED(nsres))
return E_FAIL;
if(moz_window) {
view = mozwindow_to_window(moz_window);
mozIDOMWindowProxy_Release(moz_window);
}
if(view)
IHTMLWindow2_AddRef((*p = &view->base.inner_window->base.IHTMLWindow2_iface));
else
*p = NULL;
return S_OK;
} }
static HRESULT WINAPI DOMUIEvent_get_detail(IDOMUIEvent *iface, LONG *p) static HRESULT WINAPI DOMUIEvent_get_detail(IDOMUIEvent *iface, LONG *p)
@ -1210,6 +1227,9 @@ static HRESULT WINAPI DOMUIEvent_initUIEvent(IDOMUIEvent *iface, BSTR type, VARI
return S_OK; return S_OK;
} }
if(view)
FIXME("view argument is not supported\n");
hres = IDOMEvent_initEvent(&This->IDOMEvent_iface, type, can_bubble, cancelable); hres = IDOMEvent_initEvent(&This->IDOMEvent_iface, type, can_bubble, cancelable);
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
@ -1463,6 +1483,9 @@ static HRESULT WINAPI DOMMouseEvent_initMouseEvent(IDOMMouseEvent *iface, BSTR t
return S_OK; return S_OK;
} }
if(view)
FIXME("view argument is not supported\n");
hres = IDOMEvent_initEvent(&This->IDOMEvent_iface, type, can_bubble, cancelable); hres = IDOMEvent_initEvent(&This->IDOMEvent_iface, type, can_bubble, cancelable);
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;

View File

@ -3175,7 +3175,7 @@ interface nsIDOMUIEvent : nsISupports
nsresult GetView(mozIDOMWindowProxy **aView); nsresult GetView(mozIDOMWindowProxy **aView);
nsresult GetDetail(int32_t *aDetail); nsresult GetDetail(int32_t *aDetail);
nsresult InitUIEvent(const nsAString *typeArg, bool canBubbleArg, bool cancelableArg, nsresult InitUIEvent(const nsAString *typeArg, bool canBubbleArg, bool cancelableArg,
mozIDOMWindowProxy *viewArg, int32_t detailArg); mozIDOMWindow *viewArg, int32_t detailArg);
nsresult GetLayerX(int32_t *aLayerX); nsresult GetLayerX(int32_t *aLayerX);
nsresult GetLayerY(int32_t *aLayerY); nsresult GetLayerY(int32_t *aLayerY);
nsresult GetPageX(int32_t *aPageX); nsresult GetPageX(int32_t *aPageX);

View File

@ -631,6 +631,8 @@ function test_mouse_event() {
ok(e.cancelable === true, "cancelable = " + e.cancelable); ok(e.cancelable === true, "cancelable = " + e.cancelable);
ok(e.bubbles === true, "bubbles = " + e.bubbles); ok(e.bubbles === true, "bubbles = " + e.bubbles);
ok(e.detail === 1, "detail = " + e.detail); ok(e.detail === 1, "detail = " + e.detail);
todo_wine.
ok(e.view === window, "view != window");
ok(e.screenX === 2, "screenX = " + e.screenX); ok(e.screenX === 2, "screenX = " + e.screenX);
ok(e.screenY === 3, "screenY = " + e.screenY); ok(e.screenY === 3, "screenY = " + e.screenY);
ok(e.clientX === 4, "clientX = " + e.clientX); ok(e.clientX === 4, "clientX = " + e.clientX);
@ -700,6 +702,8 @@ function test_ui_event() {
ok(e.cancelable === true, "cancelable = " + e.cancelable); ok(e.cancelable === true, "cancelable = " + e.cancelable);
ok(e.bubbles === true, "bubbles = " + e.bubbles); ok(e.bubbles === true, "bubbles = " + e.bubbles);
ok(e.detail === 3, "detail = " + e.detail); ok(e.detail === 3, "detail = " + e.detail);
todo_wine.
ok(e.view === window, "view != window");
next_test(); next_test();
} }