From: Gabriel Ivăncescu gabrielopcode@gmail.com
Instead of specially treating them.
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmlevent.c | 155 +++++++++++++++++++++++++--------------- dlls/mshtml/htmlevent.h | 2 - 2 files changed, 96 insertions(+), 61 deletions(-)
diff --git a/dlls/mshtml/htmlevent.c b/dlls/mshtml/htmlevent.c index e91269dc55a..8ed58d832ce 100644 --- a/dlls/mshtml/htmlevent.c +++ b/dlls/mshtml/htmlevent.c @@ -324,6 +324,23 @@ static inline DOMMouseEvent *unsafe_DOMMouseEvent_from_DOMEvent(DOMEvent *event) return event && event->query_interface == &DOMMouseEvent_query_interface ? DOMMouseEvent_from_DOMEvent(event) : NULL; }
+typedef struct { + DOMUIEvent ui_event; + IDOMKeyboardEvent IDOMKeyboardEvent_iface; + nsIDOMKeyEvent *nsevent; +} DOMKeyboardEvent; + +static DOMKeyboardEvent *DOMKeyboardEvent_from_DOMEvent(DOMEvent *event) +{ + return CONTAINING_RECORD(event, DOMKeyboardEvent, ui_event.event); +} + +static void *DOMKeyboardEvent_query_interface(DOMEvent*,REFIID); +static inline DOMKeyboardEvent *unsafe_DOMKeyboardEvent_from_DOMEvent(DOMEvent *event) +{ + return event && event->query_interface == &DOMKeyboardEvent_query_interface ? DOMKeyboardEvent_from_DOMEvent(event) : NULL; +} + typedef struct { DispatchEx dispex; IHTMLEventObj IHTMLEventObj_iface; @@ -436,6 +453,7 @@ static HRESULT WINAPI HTMLEventObj_get_srcElement(IHTMLEventObj *iface, IHTMLEle static HRESULT WINAPI HTMLEventObj_get_altKey(IHTMLEventObj *iface, VARIANT_BOOL *p) { HTMLEventObj *This = impl_from_IHTMLEventObj(iface); + DOMKeyboardEvent *keyboard_event; DOMMouseEvent *mouse_event; cpp_bool ret = FALSE;
@@ -444,8 +462,8 @@ static HRESULT WINAPI HTMLEventObj_get_altKey(IHTMLEventObj *iface, VARIANT_BOOL if((mouse_event = unsafe_DOMMouseEvent_from_DOMEvent(This->event))) return IDOMMouseEvent_get_altKey(&mouse_event->IDOMMouseEvent_iface, p);
- if(This->event && This->event->keyboard_event) - return IDOMKeyboardEvent_get_altKey(&This->event->IDOMKeyboardEvent_iface, p); + if((keyboard_event = unsafe_DOMKeyboardEvent_from_DOMEvent(This->event))) + return IDOMKeyboardEvent_get_altKey(&keyboard_event->IDOMKeyboardEvent_iface, p);
*p = variant_bool(ret); return S_OK; @@ -454,6 +472,7 @@ static HRESULT WINAPI HTMLEventObj_get_altKey(IHTMLEventObj *iface, VARIANT_BOOL static HRESULT WINAPI HTMLEventObj_get_ctrlKey(IHTMLEventObj *iface, VARIANT_BOOL *p) { HTMLEventObj *This = impl_from_IHTMLEventObj(iface); + DOMKeyboardEvent *keyboard_event; DOMMouseEvent *mouse_event; cpp_bool ret = FALSE;
@@ -462,8 +481,8 @@ static HRESULT WINAPI HTMLEventObj_get_ctrlKey(IHTMLEventObj *iface, VARIANT_BOO if((mouse_event = unsafe_DOMMouseEvent_from_DOMEvent(This->event))) return IDOMMouseEvent_get_ctrlKey(&mouse_event->IDOMMouseEvent_iface, p);
- if(This->event && This->event->keyboard_event) - return IDOMKeyboardEvent_get_ctrlKey(&This->event->IDOMKeyboardEvent_iface, p); + if((keyboard_event = unsafe_DOMKeyboardEvent_from_DOMEvent(This->event))) + return IDOMKeyboardEvent_get_ctrlKey(&keyboard_event->IDOMKeyboardEvent_iface, p);
*p = variant_bool(ret); return S_OK; @@ -472,6 +491,7 @@ static HRESULT WINAPI HTMLEventObj_get_ctrlKey(IHTMLEventObj *iface, VARIANT_BOO static HRESULT WINAPI HTMLEventObj_get_shiftKey(IHTMLEventObj *iface, VARIANT_BOOL *p) { HTMLEventObj *This = impl_from_IHTMLEventObj(iface); + DOMKeyboardEvent *keyboard_event; DOMMouseEvent *mouse_event; cpp_bool ret = FALSE;
@@ -480,8 +500,8 @@ static HRESULT WINAPI HTMLEventObj_get_shiftKey(IHTMLEventObj *iface, VARIANT_BO if((mouse_event = unsafe_DOMMouseEvent_from_DOMEvent(This->event))) return IDOMMouseEvent_get_shiftKey(&mouse_event->IDOMMouseEvent_iface, p);
- if(This->event && This->event->keyboard_event) - return IDOMKeyboardEvent_get_shiftKey(&This->event->IDOMKeyboardEvent_iface, p); + if((keyboard_event = unsafe_DOMKeyboardEvent_from_DOMEvent(This->event))) + return IDOMKeyboardEvent_get_shiftKey(&keyboard_event->IDOMKeyboardEvent_iface, p);
*p = variant_bool(ret); return S_OK; @@ -573,11 +593,12 @@ static HRESULT WINAPI HTMLEventObj_put_keyCode(IHTMLEventObj *iface, LONG v) static HRESULT WINAPI HTMLEventObj_get_keyCode(IHTMLEventObj *iface, LONG *p) { HTMLEventObj *This = impl_from_IHTMLEventObj(iface); + DOMKeyboardEvent *keyboard_event;
TRACE("(%p)->(%p)\n", This, p);
- if(This->event && This->event->keyboard_event) - return IDOMKeyboardEvent_get_keyCode(&This->event->IDOMKeyboardEvent_iface, p); + if((keyboard_event = unsafe_DOMKeyboardEvent_from_DOMEvent(This->event))) + return IDOMKeyboardEvent_get_keyCode(&keyboard_event->IDOMKeyboardEvent_iface, p);
*p = 0; return S_OK; @@ -880,8 +901,6 @@ static HRESULT WINAPI DOMEvent_QueryInterface(IDOMEvent *iface, REFIID riid, voi *ppv = &This->IDOMEvent_iface; else if(IsEqualGUID(&IID_IDOMEvent, riid)) *ppv = &This->IDOMEvent_iface; - else if(This->keyboard_event && IsEqualGUID(&IID_IDOMKeyboardEvent, riid)) - *ppv = &This->IDOMKeyboardEvent_iface; else if(dispex_query_interface(&This->dispex, riid, ppv)) return *ppv ? S_OK : E_NOINTERFACE; else if(!This->query_interface || !(*ppv = This->query_interface(This, riid))) { @@ -914,8 +933,6 @@ static ULONG WINAPI DOMEvent_Release(IDOMEvent *iface) if(!ref) { if(This->destroy) This->destroy(This); - if(This->keyboard_event) - nsIDOMKeyEvent_Release(This->keyboard_event); if(This->target) IEventTarget_Release(&This->target->IEventTarget_iface); nsIDOMEvent_Release(This->nsevent); @@ -1861,47 +1878,47 @@ static void DOMMouseEvent_destroy(DOMEvent *event) nsIDOMMouseEvent_Release(This->nsevent); }
-static inline DOMEvent *impl_from_IDOMKeyboardEvent(IDOMKeyboardEvent *iface) +static inline DOMKeyboardEvent *impl_from_IDOMKeyboardEvent(IDOMKeyboardEvent *iface) { - return CONTAINING_RECORD(iface, DOMEvent, IDOMKeyboardEvent_iface); + return CONTAINING_RECORD(iface, DOMKeyboardEvent, IDOMKeyboardEvent_iface); }
static HRESULT WINAPI DOMKeyboardEvent_QueryInterface(IDOMKeyboardEvent *iface, REFIID riid, void **ppv) { - DOMEvent *This = impl_from_IDOMKeyboardEvent(iface); - return IDOMEvent_QueryInterface(&This->IDOMEvent_iface, riid, ppv); + DOMKeyboardEvent *This = impl_from_IDOMKeyboardEvent(iface); + return IDOMEvent_QueryInterface(&This->ui_event.event.IDOMEvent_iface, riid, ppv); }
static ULONG WINAPI DOMKeyboardEvent_AddRef(IDOMKeyboardEvent *iface) { - DOMEvent *This = impl_from_IDOMKeyboardEvent(iface); - return IDOMEvent_AddRef(&This->IDOMEvent_iface); + DOMKeyboardEvent *This = impl_from_IDOMKeyboardEvent(iface); + return IDOMEvent_AddRef(&This->ui_event.event.IDOMEvent_iface); }
static ULONG WINAPI DOMKeyboardEvent_Release(IDOMKeyboardEvent *iface) { - DOMEvent *This = impl_from_IDOMKeyboardEvent(iface); - return IDOMEvent_Release(&This->IDOMEvent_iface); + DOMKeyboardEvent *This = impl_from_IDOMKeyboardEvent(iface); + return IDOMEvent_Release(&This->ui_event.event.IDOMEvent_iface); }
static HRESULT WINAPI DOMKeyboardEvent_GetTypeInfoCount(IDOMKeyboardEvent *iface, UINT *pctinfo) { - DOMEvent *This = impl_from_IDOMKeyboardEvent(iface); - return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo); + DOMKeyboardEvent *This = impl_from_IDOMKeyboardEvent(iface); + return IDispatchEx_GetTypeInfoCount(&This->ui_event.event.dispex.IDispatchEx_iface, pctinfo); }
static HRESULT WINAPI DOMKeyboardEvent_GetTypeInfo(IDOMKeyboardEvent *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) { - DOMEvent *This = impl_from_IDOMKeyboardEvent(iface); - return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo); + DOMKeyboardEvent *This = impl_from_IDOMKeyboardEvent(iface); + return IDispatchEx_GetTypeInfo(&This->ui_event.event.dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo); }
static HRESULT WINAPI DOMKeyboardEvent_GetIDsOfNames(IDOMKeyboardEvent *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) { - DOMEvent *This = impl_from_IDOMKeyboardEvent(iface); - return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames, + DOMKeyboardEvent *This = impl_from_IDOMKeyboardEvent(iface); + return IDispatchEx_GetIDsOfNames(&This->ui_event.event.dispex.IDispatchEx_iface, riid, rgszNames, cNames, lcid, rgDispId); }
@@ -1909,14 +1926,14 @@ static HRESULT WINAPI DOMKeyboardEvent_Invoke(IDOMKeyboardEvent *iface, DISPID d REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) { - DOMEvent *This = impl_from_IDOMKeyboardEvent(iface); - return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid, + DOMKeyboardEvent *This = impl_from_IDOMKeyboardEvent(iface); + return IDispatchEx_Invoke(&This->ui_event.event.dispex.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); }
static HRESULT WINAPI DOMKeyboardEvent_get_key(IDOMKeyboardEvent *iface, BSTR *p) { - DOMEvent *This = impl_from_IDOMKeyboardEvent(iface); + DOMKeyboardEvent *This = impl_from_IDOMKeyboardEvent(iface); nsAString key_str; nsresult nsres;
@@ -1924,19 +1941,19 @@ static HRESULT WINAPI DOMKeyboardEvent_get_key(IDOMKeyboardEvent *iface, BSTR *p
nsAString_Init(&key_str, NULL); - nsres = nsIDOMKeyEvent_GetKey(This->keyboard_event, &key_str); + nsres = nsIDOMKeyEvent_GetKey(This->nsevent, &key_str); return return_nsstr(nsres, &key_str, p); }
static HRESULT WINAPI DOMKeyboardEvent_get_location(IDOMKeyboardEvent *iface, ULONG *p) { - DOMEvent *This = impl_from_IDOMKeyboardEvent(iface); + DOMKeyboardEvent *This = impl_from_IDOMKeyboardEvent(iface); UINT32 r; nsresult nsres;
TRACE("(%p)->(%p)\n", This, p);
- nsres = nsIDOMKeyEvent_GetLocation(This->keyboard_event, &r); + nsres = nsIDOMKeyEvent_GetLocation(This->nsevent, &r); if(NS_FAILED(nsres)) return E_FAIL;
@@ -1946,13 +1963,13 @@ static HRESULT WINAPI DOMKeyboardEvent_get_location(IDOMKeyboardEvent *iface, UL
static HRESULT WINAPI DOMKeyboardEvent_get_ctrlKey(IDOMKeyboardEvent *iface, VARIANT_BOOL *p) { - DOMEvent *This = impl_from_IDOMKeyboardEvent(iface); + DOMKeyboardEvent *This = impl_from_IDOMKeyboardEvent(iface); cpp_bool r; nsresult nsres;
TRACE("(%p)->(%p)\n", This, p);
- nsres = nsIDOMKeyEvent_GetCtrlKey(This->keyboard_event, &r); + nsres = nsIDOMKeyEvent_GetCtrlKey(This->nsevent, &r); if(NS_FAILED(nsres)) return E_FAIL;
@@ -1962,13 +1979,13 @@ static HRESULT WINAPI DOMKeyboardEvent_get_ctrlKey(IDOMKeyboardEvent *iface, VAR
static HRESULT WINAPI DOMKeyboardEvent_get_shiftKey(IDOMKeyboardEvent *iface, VARIANT_BOOL *p) { - DOMEvent *This = impl_from_IDOMKeyboardEvent(iface); + DOMKeyboardEvent *This = impl_from_IDOMKeyboardEvent(iface); cpp_bool r; nsresult nsres;
TRACE("(%p)->(%p)\n", This, p);
- nsres = nsIDOMKeyEvent_GetShiftKey(This->keyboard_event, &r); + nsres = nsIDOMKeyEvent_GetShiftKey(This->nsevent, &r); if(NS_FAILED(nsres)) return E_FAIL;
@@ -1978,13 +1995,13 @@ static HRESULT WINAPI DOMKeyboardEvent_get_shiftKey(IDOMKeyboardEvent *iface, VA
static HRESULT WINAPI DOMKeyboardEvent_get_altKey(IDOMKeyboardEvent *iface, VARIANT_BOOL *p) { - DOMEvent *This = impl_from_IDOMKeyboardEvent(iface); + DOMKeyboardEvent *This = impl_from_IDOMKeyboardEvent(iface); cpp_bool r; nsresult nsres;
TRACE("(%p)->(%p)\n", This, p);
- nsres = nsIDOMKeyEvent_GetAltKey(This->keyboard_event, &r); + nsres = nsIDOMKeyEvent_GetAltKey(This->nsevent, &r); if(NS_FAILED(nsres)) return E_FAIL;
@@ -1994,13 +2011,13 @@ static HRESULT WINAPI DOMKeyboardEvent_get_altKey(IDOMKeyboardEvent *iface, VARI
static HRESULT WINAPI DOMKeyboardEvent_get_metaKey(IDOMKeyboardEvent *iface, VARIANT_BOOL *p) { - DOMEvent *This = impl_from_IDOMKeyboardEvent(iface); + DOMKeyboardEvent *This = impl_from_IDOMKeyboardEvent(iface); cpp_bool r; nsresult nsres;
TRACE("(%p)->(%p)\n", This, p);
- nsres = nsIDOMKeyEvent_GetMetaKey(This->keyboard_event, &r); + nsres = nsIDOMKeyEvent_GetMetaKey(This->nsevent, &r); if(NS_FAILED(nsres)) return E_FAIL;
@@ -2010,13 +2027,13 @@ static HRESULT WINAPI DOMKeyboardEvent_get_metaKey(IDOMKeyboardEvent *iface, VAR
static HRESULT WINAPI DOMKeyboardEvent_get_repeat(IDOMKeyboardEvent *iface, VARIANT_BOOL *p) { - DOMEvent *This = impl_from_IDOMKeyboardEvent(iface); + DOMKeyboardEvent *This = impl_from_IDOMKeyboardEvent(iface); cpp_bool r; nsresult nsres;
TRACE("(%p)->(%p)\n", This, p);
- nsres = nsIDOMKeyEvent_GetRepeat(This->keyboard_event, &r); + nsres = nsIDOMKeyEvent_GetRepeat(This->nsevent, &r); if(NS_FAILED(nsres)) return E_FAIL;
@@ -2027,7 +2044,7 @@ static HRESULT WINAPI DOMKeyboardEvent_get_repeat(IDOMKeyboardEvent *iface, VARI static HRESULT WINAPI DOMKeyboardEvent_getModifierState(IDOMKeyboardEvent *iface, BSTR key, VARIANT_BOOL *state) { - DOMEvent *This = impl_from_IDOMKeyboardEvent(iface); + DOMKeyboardEvent *This = impl_from_IDOMKeyboardEvent(iface); FIXME("(%p)->(%s %p)\n", This, debugstr_w(key), state); return E_NOTIMPL; } @@ -2036,7 +2053,7 @@ static HRESULT WINAPI DOMKeyboardEvent_initKeyboardEvent(IDOMKeyboardEvent *ifac VARIANT_BOOL can_bubble, VARIANT_BOOL cancelable, IHTMLWindow2 *view, BSTR key, ULONG location, BSTR modifiers_list, VARIANT_BOOL repeat, BSTR locale) { - DOMEvent *This = impl_from_IDOMKeyboardEvent(iface); + DOMKeyboardEvent *This = impl_from_IDOMKeyboardEvent(iface); FIXME("(%p)->(%s %x %x %p %s %lu %s %x %s)\n", This, debugstr_w(type), can_bubble, cancelable, view, debugstr_w(key), location, debugstr_w(modifiers_list), repeat, debugstr_w(locale)); @@ -2045,13 +2062,13 @@ static HRESULT WINAPI DOMKeyboardEvent_initKeyboardEvent(IDOMKeyboardEvent *ifac
static HRESULT WINAPI DOMKeyboardEvent_get_keyCode(IDOMKeyboardEvent *iface, LONG *p) { - DOMEvent *This = impl_from_IDOMKeyboardEvent(iface); + DOMKeyboardEvent *This = impl_from_IDOMKeyboardEvent(iface); UINT32 r; nsresult nsres;
TRACE("(%p)->(%p)\n", This, p);
- nsres = nsIDOMKeyEvent_GetKeyCode(This->keyboard_event, &r); + nsres = nsIDOMKeyEvent_GetKeyCode(This->nsevent, &r); if(NS_FAILED(nsres)) return E_FAIL;
@@ -2061,13 +2078,13 @@ static HRESULT WINAPI DOMKeyboardEvent_get_keyCode(IDOMKeyboardEvent *iface, LON
static HRESULT WINAPI DOMKeyboardEvent_get_charCode(IDOMKeyboardEvent *iface, LONG *p) { - DOMEvent *This = impl_from_IDOMKeyboardEvent(iface); + DOMKeyboardEvent *This = impl_from_IDOMKeyboardEvent(iface); UINT32 r; nsresult nsres;
TRACE("(%p)->(%p)\n", This, p);
- nsres = nsIDOMKeyEvent_GetKeyCode(This->keyboard_event, &r); + nsres = nsIDOMKeyEvent_GetKeyCode(This->nsevent, &r); if(NS_FAILED(nsres)) return E_FAIL;
@@ -2077,13 +2094,13 @@ static HRESULT WINAPI DOMKeyboardEvent_get_charCode(IDOMKeyboardEvent *iface, LO
static HRESULT WINAPI DOMKeyboardEvent_get_which(IDOMKeyboardEvent *iface, LONG *p) { - DOMEvent *This = impl_from_IDOMKeyboardEvent(iface); + DOMKeyboardEvent *This = impl_from_IDOMKeyboardEvent(iface); UINT32 r; nsresult nsres;
TRACE("(%p)->(%p)\n", This, p);
- nsres = nsIDOMKeyEvent_GetWhich(This->keyboard_event, &r); + nsres = nsIDOMKeyEvent_GetWhich(This->nsevent, &r); if(NS_FAILED(nsres)) return E_FAIL;
@@ -2093,14 +2110,14 @@ static HRESULT WINAPI DOMKeyboardEvent_get_which(IDOMKeyboardEvent *iface, LONG
static HRESULT WINAPI DOMKeyboardEvent_get_char(IDOMKeyboardEvent *iface, VARIANT *p) { - DOMEvent *This = impl_from_IDOMKeyboardEvent(iface); + DOMKeyboardEvent *This = impl_from_IDOMKeyboardEvent(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI DOMKeyboardEvent_get_locale(IDOMKeyboardEvent *iface, BSTR *p) { - DOMEvent *This = impl_from_IDOMKeyboardEvent(iface); + DOMKeyboardEvent *This = impl_from_IDOMKeyboardEvent(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; } @@ -2129,6 +2146,23 @@ static const IDOMKeyboardEventVtbl DOMKeyboardEventVtbl = { DOMKeyboardEvent_get_locale };
+static void *DOMKeyboardEvent_query_interface(DOMEvent *event, REFIID riid) +{ + DOMKeyboardEvent *This = DOMKeyboardEvent_from_DOMEvent(event); + if(IsEqualGUID(&IID_IDOMKeyboardEvent, riid)) + return &This->IDOMKeyboardEvent_iface; + if(IsEqualGUID(&IID_IDOMUIEvent, riid)) + return &This->ui_event.IDOMUIEvent_iface; + return NULL; +} + +static void DOMKeyboardEvent_destroy(DOMEvent *event) +{ + DOMKeyboardEvent *This = DOMKeyboardEvent_from_DOMEvent(event); + DOMUIEvent_destroy(&This->ui_event.event); + nsIDOMKeyEvent_Release(This->nsevent); +} + typedef struct { DOMEvent event; IDOMCustomEvent IDOMCustomEvent_iface; @@ -2605,6 +2639,14 @@ static void mouse_event_ctor(void *event, void *iface) fill_parent_ui_event(iface, &mouse_event->ui_event); }
+static void keyboard_event_ctor(void *event, void *iface) +{ + DOMKeyboardEvent *keyboard_event = event; + keyboard_event->IDOMKeyboardEvent_iface.lpVtbl = &DOMKeyboardEventVtbl; + keyboard_event->nsevent = iface; + fill_parent_ui_event(iface, &keyboard_event->ui_event); +} + static void custom_event_ctor(void *event, void *iface) { DOMCustomEvent *custom_event = event; @@ -2632,6 +2674,8 @@ static DOMEvent *alloc_event(nsIDOMEvent *nsevent, compat_mode_t compat_mode, ev } types_table[] = { { &IID_nsIDOMMouseEvent, &DOMMouseEvent_dispex, mouse_event_ctor, DOMMouseEvent_query_interface, DOMMouseEvent_destroy, sizeof(DOMMouseEvent) }, + { &IID_nsIDOMKeyEvent, &DOMKeyboardEvent_dispex, keyboard_event_ctor, DOMKeyboardEvent_query_interface, + DOMKeyboardEvent_destroy, sizeof(DOMKeyboardEvent) }, { &IID_nsIDOMUIEvent, &DOMUIEvent_dispex, ui_event_ctor, DOMUIEvent_query_interface, DOMUIEvent_destroy, sizeof(DOMUIEvent) }, { &IID_nsIDOMCustomEvent, &DOMCustomEvent_dispex, custom_event_ctor, DOMCustomEvent_query_interface, @@ -2680,7 +2724,6 @@ static DOMEvent *alloc_event(nsIDOMEvent *nsevent, compat_mode_t compat_mode, ev }
event->IDOMEvent_iface.lpVtbl = &DOMEventVtbl; - event->IDOMKeyboardEvent_iface.lpVtbl = &DOMKeyboardEventVtbl; event->ref = 1; event->event_id = event_id; if(event_id != EVENTID_LAST) { @@ -2696,12 +2739,6 @@ static DOMEvent *alloc_event(nsIDOMEvent *nsevent, compat_mode_t compat_mode, ev
event->time_stamp = get_time_stamp();
- nsres = nsIDOMEvent_QueryInterface(nsevent, &IID_nsIDOMKeyEvent, (void**)&event->keyboard_event); - if(NS_SUCCEEDED(nsres)) - dispex_data = &DOMKeyboardEvent_dispex; - else - event->keyboard_event = NULL; - init_dispatch(&event->dispex, (IUnknown*)&event->IDOMEvent_iface, dispex_data, compat_mode); return event; } diff --git a/dlls/mshtml/htmlevent.h b/dlls/mshtml/htmlevent.h index 207c0a7aaab..d0c72d87a5d 100644 --- a/dlls/mshtml/htmlevent.h +++ b/dlls/mshtml/htmlevent.h @@ -67,14 +67,12 @@ typedef enum { typedef struct DOMEvent { DispatchEx dispex; IDOMEvent IDOMEvent_iface; - IDOMKeyboardEvent IDOMKeyboardEvent_iface;
LONG ref; void *(*query_interface)(struct DOMEvent*,REFIID); void (*destroy)(struct DOMEvent*);
nsIDOMEvent *nsevent; - nsIDOMKeyEvent *keyboard_event;
eventid_t event_id; WCHAR *type;