diff --git a/dlls/mshtml/htmlevent.c b/dlls/mshtml/htmlevent.c index c5ae7585f23..382ed6d2ba4 100644 --- a/dlls/mshtml/htmlevent.c +++ b/dlls/mshtml/htmlevent.c @@ -1175,8 +1175,25 @@ static HRESULT WINAPI DOMUIEvent_Invoke(IDOMUIEvent *iface, DISPID dispIdMember, static HRESULT WINAPI DOMUIEvent_get_view(IDOMUIEvent *iface, IHTMLWindow2 **p) { DOMEvent *This = impl_from_IDOMUIEvent(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + mozIDOMWindowProxy *moz_window; + 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) @@ -1210,6 +1227,9 @@ static HRESULT WINAPI DOMUIEvent_initUIEvent(IDOMUIEvent *iface, BSTR type, VARI return S_OK; } + if(view) + FIXME("view argument is not supported\n"); + hres = IDOMEvent_initEvent(&This->IDOMEvent_iface, type, can_bubble, cancelable); if(FAILED(hres)) return hres; @@ -1463,6 +1483,9 @@ static HRESULT WINAPI DOMMouseEvent_initMouseEvent(IDOMMouseEvent *iface, BSTR t return S_OK; } + if(view) + FIXME("view argument is not supported\n"); + hres = IDOMEvent_initEvent(&This->IDOMEvent_iface, type, can_bubble, cancelable); if(FAILED(hres)) return hres; diff --git a/dlls/mshtml/nsiface.idl b/dlls/mshtml/nsiface.idl index 04add4d1c86..34f83ab9f1b 100644 --- a/dlls/mshtml/nsiface.idl +++ b/dlls/mshtml/nsiface.idl @@ -3175,7 +3175,7 @@ interface nsIDOMUIEvent : nsISupports nsresult GetView(mozIDOMWindowProxy **aView); nsresult GetDetail(int32_t *aDetail); 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 GetLayerY(int32_t *aLayerY); nsresult GetPageX(int32_t *aPageX); diff --git a/dlls/mshtml/tests/events.js b/dlls/mshtml/tests/events.js index 6051295dd0a..fe21efe131f 100644 --- a/dlls/mshtml/tests/events.js +++ b/dlls/mshtml/tests/events.js @@ -631,6 +631,8 @@ function test_mouse_event() { ok(e.cancelable === true, "cancelable = " + e.cancelable); ok(e.bubbles === true, "bubbles = " + e.bubbles); ok(e.detail === 1, "detail = " + e.detail); + todo_wine. + ok(e.view === window, "view != window"); ok(e.screenX === 2, "screenX = " + e.screenX); ok(e.screenY === 3, "screenY = " + e.screenY); ok(e.clientX === 4, "clientX = " + e.clientX); @@ -700,6 +702,8 @@ function test_ui_event() { ok(e.cancelable === true, "cancelable = " + e.cancelable); ok(e.bubbles === true, "bubbles = " + e.bubbles); ok(e.detail === 3, "detail = " + e.detail); + todo_wine. + ok(e.view === window, "view != window"); next_test(); }