mshtml: Added DOMContentLoaded event implementation.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2017-11-01 16:43:53 +01:00 committed by Alexandre Julliard
parent b77f7b54ce
commit 0c0dd3d582
2 changed files with 8 additions and 3 deletions

View File

@ -89,6 +89,7 @@ static const WCHAR selectstartW[] = {'s','e','l','e','c','t','s','t','a','r','t'
static const WCHAR selectionchangeW[] = {'s','e','l','e','c','t','i','o','n','c','h','a','n','g','e',0}; static const WCHAR selectionchangeW[] = {'s','e','l','e','c','t','i','o','n','c','h','a','n','g','e',0};
static const WCHAR submitW[] = {'s','u','b','m','i','t',0}; static const WCHAR submitW[] = {'s','u','b','m','i','t',0};
static const WCHAR unloadW[] = {'u','n','l','o','a','d',0}; static const WCHAR unloadW[] = {'u','n','l','o','a','d',0};
static const WCHAR DOMContentLoadedW[] = {'D','O','M','C','o','n','t','e','n','t','L','o','a','d','e','d',0};
static const WCHAR EventW[] = {'E','v','e','n','t',0}; static const WCHAR EventW[] = {'E','v','e','n','t',0};
static const WCHAR UIEventW[] = {'U','I','E','v','e','n','t',0}; static const WCHAR UIEventW[] = {'U','I','E','v','e','n','t',0};
@ -150,6 +151,8 @@ static const event_info_t event_info[] = {
EVENT_FIXME | EVENT_BUBBLES}, EVENT_FIXME | EVENT_BUBBLES},
{dblclickW, EVENT_TYPE_MOUSE, DISPID_EVMETH_ONDBLCLICK, {dblclickW, EVENT_TYPE_MOUSE, DISPID_EVMETH_ONDBLCLICK,
EVENT_DEFAULTLISTENER | EVENT_BUBBLES | EVENT_CANCELABLE}, EVENT_DEFAULTLISTENER | EVENT_BUBBLES | EVENT_CANCELABLE},
{DOMContentLoadedW, EVENT_TYPE_EVENT, 0,
EVENT_DEFAULTLISTENER | EVENT_BUBBLES | EVENT_CANCELABLE},
{dragW, EVENT_TYPE_DRAG, DISPID_EVMETH_ONDRAG, {dragW, EVENT_TYPE_DRAG, DISPID_EVMETH_ONDRAG,
EVENT_FIXME | EVENT_BUBBLES | EVENT_CANCELABLE}, EVENT_FIXME | EVENT_BUBBLES | EVENT_CANCELABLE},
{dragstartW, EVENT_TYPE_DRAG, DISPID_EVMETH_ONDRAGSTART, {dragstartW, EVENT_TYPE_DRAG, DISPID_EVMETH_ONDRAGSTART,
@ -227,7 +230,7 @@ static eventid_t attr_to_eid(const WCHAR *str)
return EVENTID_LAST; return EVENTID_LAST;
for(i=0; i < sizeof(event_info)/sizeof(event_info[0]); i++) { for(i=0; i < sizeof(event_info)/sizeof(event_info[0]); i++) {
if(!strcmpW(event_info[i].name, str+2)) if(!strcmpW(event_info[i].name, str+2) && event_info[i].dispid)
return i; return i;
} }
@ -1298,7 +1301,7 @@ static void call_event_handlers(EventTarget *event_target, DOMEvent *event)
event_listener_t *listener, listeners_buf[8], *listeners = listeners_buf; event_listener_t *listener, listeners_buf[8], *listeners = listeners_buf;
unsigned listeners_cnt, listeners_size; unsigned listeners_cnt, listeners_size;
ConnectionPointContainer *cp_container = NULL; ConnectionPointContainer *cp_container = NULL;
const event_target_vtbl_t *vtbl; const event_target_vtbl_t *vtbl = NULL;
VARIANT v; VARIANT v;
HRESULT hres; HRESULT hres;
@ -1446,7 +1449,8 @@ static void call_event_handlers(EventTarget *event_target, DOMEvent *event)
if(event->phase == DEP_CAPTURING_PHASE) if(event->phase == DEP_CAPTURING_PHASE)
return; return;
if((vtbl = dispex_get_vtbl(&event_target->dispex)) && vtbl->get_cp_container) if(event_info[eid].dispid && (vtbl = dispex_get_vtbl(&event_target->dispex))
&& vtbl->get_cp_container)
cp_container = vtbl->get_cp_container(&event_target->dispex); cp_container = vtbl->get_cp_container(&event_target->dispex);
if(cp_container) { if(cp_container) {
if(cp_container->cps) { if(cp_container->cps) {

View File

@ -26,6 +26,7 @@ typedef enum {
EVENTID_CONTEXTMENU, EVENTID_CONTEXTMENU,
EVENTID_DATAAVAILABLE, EVENTID_DATAAVAILABLE,
EVENTID_DBLCLICK, EVENTID_DBLCLICK,
EVENTID_DOMCONTENTLOADED,
EVENTID_DRAG, EVENTID_DRAG,
EVENTID_DRAGSTART, EVENTID_DRAGSTART,
EVENTID_ERROR, EVENTID_ERROR,