Commit cd69836d authored by Thomas Mullaly's avatar Thomas Mullaly Committed by Alexandre Julliard

mshtml: Added support for IDispatch Html document events.

parent 34a297fe
...@@ -1866,7 +1866,7 @@ static void init_doc(HTMLDocument *doc, IUnknown *unk_impl, IDispatchEx *dispex) ...@@ -1866,7 +1866,7 @@ static void init_doc(HTMLDocument *doc, IUnknown *unk_impl, IDispatchEx *dispex)
HTMLDocument_Hlink_Init(doc); HTMLDocument_Hlink_Init(doc);
ConnectionPointContainer_Init(&doc->cp_container, (IUnknown*)&doc->IHTMLDocument2_iface); 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_propnotif, &doc->cp_container, &IID_IPropertyNotifySink, NULL);
ConnectionPoint_Init(&doc->cp_htmldocevents, &doc->cp_container, &DIID_HTMLDocumentEvents, &HTMLDocumentEvents_data); ConnectionPoint_Init(&doc->cp_htmldocevents, &doc->cp_container, &DIID_HTMLDocumentEvents, &HTMLDocumentEvents_data);
ConnectionPoint_Init(&doc->cp_htmldocevents2, &doc->cp_container, &DIID_HTMLDocumentEvents2, NULL); ConnectionPoint_Init(&doc->cp_htmldocevents2, &doc->cp_container, &DIID_HTMLDocumentEvents2, NULL);
......
...@@ -1460,7 +1460,7 @@ static void test_onclick(IHTMLDocument2 *doc) ...@@ -1460,7 +1460,7 @@ static void test_onclick(IHTMLDocument2 *doc)
CHECK_CALLED(div_onclick_attached); CHECK_CALLED(div_onclick_attached);
CHECK_CALLED(body_onclick); CHECK_CALLED(body_onclick);
CHECK_CALLED(document_onclick); CHECK_CALLED(document_onclick);
todo_wine CHECK_CALLED(invoke_onclick); CHECK_CALLED(invoke_onclick);
} }
xy_todo = TRUE; xy_todo = TRUE;
...@@ -1478,7 +1478,7 @@ static void test_onclick(IHTMLDocument2 *doc) ...@@ -1478,7 +1478,7 @@ static void test_onclick(IHTMLDocument2 *doc)
CHECK_CALLED(div_onclick_attached); CHECK_CALLED(div_onclick_attached);
CHECK_CALLED(body_onclick); CHECK_CALLED(body_onclick);
CHECK_CALLED(document_onclick); CHECK_CALLED(document_onclick);
todo_wine CHECK_CALLED(invoke_onclick); CHECK_CALLED(invoke_onclick);
SET_EXPECT(div_onclick); SET_EXPECT(div_onclick);
SET_EXPECT(div_onclick_attached); SET_EXPECT(div_onclick_attached);
...@@ -1493,7 +1493,7 @@ static void test_onclick(IHTMLDocument2 *doc) ...@@ -1493,7 +1493,7 @@ static void test_onclick(IHTMLDocument2 *doc)
CHECK_CALLED(div_onclick_attached); CHECK_CALLED(div_onclick_attached);
CHECK_CALLED(body_onclick); CHECK_CALLED(body_onclick);
CHECK_CALLED(document_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); cp_cookie = register_cp((IUnknown*)doc, &DIID_HTMLDocumentEvents, (IUnknown*)&doccp_obj);
elem_attach_event((IUnknown*)div, "onclick", (IDispatch*)&div_onclick_disp); elem_attach_event((IUnknown*)div, "onclick", (IDispatch*)&div_onclick_disp);
...@@ -1518,7 +1518,7 @@ static void test_onclick(IHTMLDocument2 *doc) ...@@ -1518,7 +1518,7 @@ static void test_onclick(IHTMLDocument2 *doc)
CHECK_CALLED(document_onclick); CHECK_CALLED(document_onclick);
CHECK_CALLED(doc_onclick_attached); CHECK_CALLED(doc_onclick_attached);
CHECK_CALLED(doccp_onclick); CHECK_CALLED(doccp_onclick);
todo_wine CHECK_CALLED(invoke_onclick); CHECK_CALLED(invoke_onclick);
unregister_cp((IUnknown*)doc, &DIID_HTMLDocumentEvents, cp_cookie); unregister_cp((IUnknown*)doc, &DIID_HTMLDocumentEvents, cp_cookie);
...@@ -1546,7 +1546,7 @@ static void test_onclick(IHTMLDocument2 *doc) ...@@ -1546,7 +1546,7 @@ static void test_onclick(IHTMLDocument2 *doc)
CHECK_CALLED(div_onclick_attached); CHECK_CALLED(div_onclick_attached);
CHECK_CALLED(body_onclick); CHECK_CALLED(body_onclick);
CHECK_CALLED(document_onclick); CHECK_CALLED(document_onclick);
todo_wine CHECK_CALLED(invoke_onclick); CHECK_CALLED(invoke_onclick);
IHTMLElement_Release(div); IHTMLElement_Release(div);
IHTMLElement_Release(body); IHTMLElement_Release(body);
......
...@@ -74,6 +74,12 @@ DEFINE_OLEGUID(CGID_DocHostCmdPriv, 0x000214D4L, 0, 0); ...@@ -74,6 +74,12 @@ DEFINE_OLEGUID(CGID_DocHostCmdPriv, 0x000214D4L, 0, 0);
expect_ ## func = called_ ## func = FALSE; \ expect_ ## func = called_ ## func = FALSE; \
}while(0) }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) \ #define CHECK_CALLED_BROKEN(func) \
do { \ do { \
ok(called_ ## func || broken(!called_ ## func), "expected " #func "\n"); \ ok(called_ ## func || broken(!called_ ## func), "expected " #func "\n"); \
...@@ -4014,7 +4020,7 @@ static void test_Load(IPersistMoniker *persist, IMoniker *mon) ...@@ -4014,7 +4020,7 @@ static void test_Load(IPersistMoniker *persist, IMoniker *mon)
container_locked = TRUE; container_locked = TRUE;
} }
CHECK_CALLED(OnChanged_READYSTATE); CHECK_CALLED(OnChanged_READYSTATE);
todo_wine CHECK_CALLED(Invoke_OnReadyStateChange_Loading); CHECK_CALLED(Invoke_OnReadyStateChange_Loading);
SET_CALLED(IsSystemMoniker); /* IE7 */ SET_CALLED(IsSystemMoniker); /* IE7 */
SET_CALLED(Exec_ShellDocView_84); SET_CALLED(Exec_ShellDocView_84);
if(mon == &Moniker) if(mon == &Moniker)
...@@ -4145,8 +4151,8 @@ static void test_download(DWORD flags) ...@@ -4145,8 +4151,8 @@ static void test_download(DWORD flags)
CHECK_CALLED(UnlockRequest); CHECK_CALLED(UnlockRequest);
} }
if(!(flags & DWL_EMPTY)) if(!(flags & DWL_EMPTY))
todo_wine CHECK_CALLED(Invoke_OnReadyStateChange_Interactive); CHECK_CALLED(Invoke_OnReadyStateChange_Interactive);
todo_wine CHECK_CALLED(Invoke_OnReadyStateChange_Complete); CHECK_CALLED(Invoke_OnReadyStateChange_Complete);
SET_CALLED(Exec_Explorer_69); SET_CALLED(Exec_Explorer_69);
SET_CALLED(EnableModeless_TRUE); /* IE7 */ SET_CALLED(EnableModeless_TRUE); /* IE7 */
SET_CALLED(Frame_EnableModeless_TRUE); /* IE7 */ SET_CALLED(Frame_EnableModeless_TRUE); /* IE7 */
...@@ -4616,7 +4622,7 @@ static void test_exec_editmode(IUnknown *unk, BOOL loaded) ...@@ -4616,7 +4622,7 @@ static void test_exec_editmode(IUnknown *unk, BOOL loaded)
CHECK_CALLED(Invoke_AMBIENT_SILENT); CHECK_CALLED(Invoke_AMBIENT_SILENT);
CHECK_CALLED(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED); CHECK_CALLED(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED);
CHECK_CALLED(OnChanged_READYSTATE); CHECK_CALLED(OnChanged_READYSTATE);
todo_wine CHECK_CALLED(Invoke_OnReadyStateChange_Loading); CHECK_CALLED(Invoke_OnReadyStateChange_Loading);
SET_CALLED(IsSystemMoniker); /* IE7 */ SET_CALLED(IsSystemMoniker); /* IE7 */
SET_CALLED(Exec_ShellDocView_84); SET_CALLED(Exec_ShellDocView_84);
if(loaded) if(loaded)
...@@ -5309,7 +5315,7 @@ static void test_StreamLoad(IHTMLDocument2 *doc) ...@@ -5309,7 +5315,7 @@ static void test_StreamLoad(IHTMLDocument2 *doc)
CHECK_CALLED(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED); CHECK_CALLED(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED);
CHECK_CALLED(Exec_ShellDocView_37); CHECK_CALLED(Exec_ShellDocView_37);
CHECK_CALLED(OnChanged_READYSTATE); CHECK_CALLED(OnChanged_READYSTATE);
todo_wine CHECK_CALLED(Invoke_OnReadyStateChange_Loading); CHECK_CALLED(Invoke_OnReadyStateChange_Loading);
CHECK_CALLED(Read); CHECK_CALLED(Read);
todo_wine CHECK_CALLED(GetPendingUrl); todo_wine CHECK_CALLED(GetPendingUrl);
...@@ -5344,7 +5350,7 @@ static void test_StreamInitNew(IHTMLDocument2 *doc) ...@@ -5344,7 +5350,7 @@ static void test_StreamInitNew(IHTMLDocument2 *doc)
CHECK_CALLED(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED); CHECK_CALLED(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED);
CHECK_CALLED(Exec_ShellDocView_37); CHECK_CALLED(Exec_ShellDocView_37);
CHECK_CALLED(OnChanged_READYSTATE); CHECK_CALLED(OnChanged_READYSTATE);
todo_wine CHECK_CALLED(Invoke_OnReadyStateChange_Loading); CHECK_CALLED(Invoke_OnReadyStateChange_Loading);
todo_wine CHECK_CALLED(GetPendingUrl); todo_wine CHECK_CALLED(GetPendingUrl);
test_timer(EXPECT_SETTITLE); test_timer(EXPECT_SETTITLE);
...@@ -5805,7 +5811,11 @@ static void test_HTMLDocument_StreamInitNew(void) ...@@ -5805,7 +5811,11 @@ static void test_HTMLDocument_StreamInitNew(void)
test_GetCurMoniker((IUnknown*)doc, NULL, NULL); test_GetCurMoniker((IUnknown*)doc, NULL, NULL);
test_StreamInitNew(doc); test_StreamInitNew(doc);
SET_EXPECT(Invoke_OnReadyStateChange_Interactive);
test_download(DWL_VERBDONE|DWL_TRYCSS|DWL_EMPTY); test_download(DWL_VERBDONE|DWL_TRYCSS|DWL_EMPTY);
todo_wine CHECK_NOT_CALLED(Invoke_OnReadyStateChange_Interactive);
test_MSHTML_QueryStatus(doc, OLECMDF_SUPPORTED); test_MSHTML_QueryStatus(doc, OLECMDF_SUPPORTED);
test_UIDeactivate(); test_UIDeactivate();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment