mshtml: Added support for IDispatch Html document events.

This commit is contained in:
Thomas Mullaly 2011-05-11 17:15:10 -04:00 committed by Alexandre Julliard
parent 34a297fe76
commit cd69836d54
3 changed files with 22 additions and 12 deletions

View File

@ -1866,7 +1866,7 @@ static void init_doc(HTMLDocument *doc, IUnknown *unk_impl, IDispatchEx *dispex)
HTMLDocument_Hlink_Init(doc);
ConnectionPointContainer_Init(&doc->cp_container, (IUnknown*)&doc->IHTMLDocument2_iface);
ConnectionPoint_Init(&doc->cp_dispatch, &doc->cp_container, &IID_IDispatch, NULL);
ConnectionPoint_Init(&doc->cp_dispatch, &doc->cp_container, &IID_IDispatch, &HTMLDocumentEvents_data);
ConnectionPoint_Init(&doc->cp_propnotif, &doc->cp_container, &IID_IPropertyNotifySink, NULL);
ConnectionPoint_Init(&doc->cp_htmldocevents, &doc->cp_container, &DIID_HTMLDocumentEvents, &HTMLDocumentEvents_data);
ConnectionPoint_Init(&doc->cp_htmldocevents2, &doc->cp_container, &DIID_HTMLDocumentEvents2, NULL);

View File

@ -1460,7 +1460,7 @@ static void test_onclick(IHTMLDocument2 *doc)
CHECK_CALLED(div_onclick_attached);
CHECK_CALLED(body_onclick);
CHECK_CALLED(document_onclick);
todo_wine CHECK_CALLED(invoke_onclick);
CHECK_CALLED(invoke_onclick);
}
xy_todo = TRUE;
@ -1478,7 +1478,7 @@ static void test_onclick(IHTMLDocument2 *doc)
CHECK_CALLED(div_onclick_attached);
CHECK_CALLED(body_onclick);
CHECK_CALLED(document_onclick);
todo_wine CHECK_CALLED(invoke_onclick);
CHECK_CALLED(invoke_onclick);
SET_EXPECT(div_onclick);
SET_EXPECT(div_onclick_attached);
@ -1493,7 +1493,7 @@ static void test_onclick(IHTMLDocument2 *doc)
CHECK_CALLED(div_onclick_attached);
CHECK_CALLED(body_onclick);
CHECK_CALLED(document_onclick);
todo_wine CHECK_CALLED(invoke_onclick);
CHECK_CALLED(invoke_onclick);
cp_cookie = register_cp((IUnknown*)doc, &DIID_HTMLDocumentEvents, (IUnknown*)&doccp_obj);
elem_attach_event((IUnknown*)div, "onclick", (IDispatch*)&div_onclick_disp);
@ -1518,7 +1518,7 @@ static void test_onclick(IHTMLDocument2 *doc)
CHECK_CALLED(document_onclick);
CHECK_CALLED(doc_onclick_attached);
CHECK_CALLED(doccp_onclick);
todo_wine CHECK_CALLED(invoke_onclick);
CHECK_CALLED(invoke_onclick);
unregister_cp((IUnknown*)doc, &DIID_HTMLDocumentEvents, cp_cookie);
@ -1546,7 +1546,7 @@ static void test_onclick(IHTMLDocument2 *doc)
CHECK_CALLED(div_onclick_attached);
CHECK_CALLED(body_onclick);
CHECK_CALLED(document_onclick);
todo_wine CHECK_CALLED(invoke_onclick);
CHECK_CALLED(invoke_onclick);
IHTMLElement_Release(div);
IHTMLElement_Release(body);

View File

@ -74,6 +74,12 @@ DEFINE_OLEGUID(CGID_DocHostCmdPriv, 0x000214D4L, 0, 0);
expect_ ## func = called_ ## func = FALSE; \
}while(0)
#define CHECK_NOT_CALLED(func) \
do { \
ok(!called_ ## func, "unexpected " #func "\n"); \
expect_ ## func = called_ ## func = FALSE; \
}while(0)
#define CHECK_CALLED_BROKEN(func) \
do { \
ok(called_ ## func || broken(!called_ ## func), "expected " #func "\n"); \
@ -4014,7 +4020,7 @@ static void test_Load(IPersistMoniker *persist, IMoniker *mon)
container_locked = TRUE;
}
CHECK_CALLED(OnChanged_READYSTATE);
todo_wine CHECK_CALLED(Invoke_OnReadyStateChange_Loading);
CHECK_CALLED(Invoke_OnReadyStateChange_Loading);
SET_CALLED(IsSystemMoniker); /* IE7 */
SET_CALLED(Exec_ShellDocView_84);
if(mon == &Moniker)
@ -4145,8 +4151,8 @@ static void test_download(DWORD flags)
CHECK_CALLED(UnlockRequest);
}
if(!(flags & DWL_EMPTY))
todo_wine CHECK_CALLED(Invoke_OnReadyStateChange_Interactive);
todo_wine CHECK_CALLED(Invoke_OnReadyStateChange_Complete);
CHECK_CALLED(Invoke_OnReadyStateChange_Interactive);
CHECK_CALLED(Invoke_OnReadyStateChange_Complete);
SET_CALLED(Exec_Explorer_69);
SET_CALLED(EnableModeless_TRUE); /* IE7 */
SET_CALLED(Frame_EnableModeless_TRUE); /* IE7 */
@ -4616,7 +4622,7 @@ static void test_exec_editmode(IUnknown *unk, BOOL loaded)
CHECK_CALLED(Invoke_AMBIENT_SILENT);
CHECK_CALLED(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED);
CHECK_CALLED(OnChanged_READYSTATE);
todo_wine CHECK_CALLED(Invoke_OnReadyStateChange_Loading);
CHECK_CALLED(Invoke_OnReadyStateChange_Loading);
SET_CALLED(IsSystemMoniker); /* IE7 */
SET_CALLED(Exec_ShellDocView_84);
if(loaded)
@ -5309,7 +5315,7 @@ static void test_StreamLoad(IHTMLDocument2 *doc)
CHECK_CALLED(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED);
CHECK_CALLED(Exec_ShellDocView_37);
CHECK_CALLED(OnChanged_READYSTATE);
todo_wine CHECK_CALLED(Invoke_OnReadyStateChange_Loading);
CHECK_CALLED(Invoke_OnReadyStateChange_Loading);
CHECK_CALLED(Read);
todo_wine CHECK_CALLED(GetPendingUrl);
@ -5344,7 +5350,7 @@ static void test_StreamInitNew(IHTMLDocument2 *doc)
CHECK_CALLED(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED);
CHECK_CALLED(Exec_ShellDocView_37);
CHECK_CALLED(OnChanged_READYSTATE);
todo_wine CHECK_CALLED(Invoke_OnReadyStateChange_Loading);
CHECK_CALLED(Invoke_OnReadyStateChange_Loading);
todo_wine CHECK_CALLED(GetPendingUrl);
test_timer(EXPECT_SETTITLE);
@ -5805,7 +5811,11 @@ static void test_HTMLDocument_StreamInitNew(void)
test_GetCurMoniker((IUnknown*)doc, NULL, NULL);
test_StreamInitNew(doc);
SET_EXPECT(Invoke_OnReadyStateChange_Interactive);
test_download(DWL_VERBDONE|DWL_TRYCSS|DWL_EMPTY);
todo_wine CHECK_NOT_CALLED(Invoke_OnReadyStateChange_Interactive);
test_MSHTML_QueryStatus(doc, OLECMDF_SUPPORTED);
test_UIDeactivate();