mirror of
https://github.com/reactos/wine.git
synced 2024-11-30 15:10:27 +00:00
mshtml: Added IDOMEvent:get_eventPhase implementation.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
caa3c43272
commit
85527dbdf3
@ -938,8 +938,11 @@ static HRESULT WINAPI DOMEvent_get_defaultPrevented(IDOMEvent *iface, VARIANT_BO
|
||||
static HRESULT WINAPI DOMEvent_get_eventPhase(IDOMEvent *iface, USHORT *p)
|
||||
{
|
||||
DOMEvent *This = impl_from_IDOMEvent(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
*p = This->phase;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI DOMEvent_get_target(IDOMEvent *iface, IEventTarget **p)
|
||||
@ -1434,10 +1437,13 @@ void dispatch_event(EventTarget *event_target, DOMEvent *event)
|
||||
event->target = event_target;
|
||||
IDispatchEx_AddRef(&event_target->dispex.IDispatchEx_iface);
|
||||
|
||||
for(i = 0; i < chain_cnt; i++) {
|
||||
call_event_handlers(target_chain[i], event);
|
||||
if(!(event_flags & EVENT_BUBBLES) || event->stop_propagation)
|
||||
break;
|
||||
event->phase = DEP_AT_TARGET;
|
||||
call_event_handlers(target_chain[0], event);
|
||||
|
||||
if(event_flags & EVENT_BUBBLES) {
|
||||
event->phase = DEP_BUBBLING_PHASE;
|
||||
for(i = 1; !event->stop_propagation && i < chain_cnt; i++)
|
||||
call_event_handlers(target_chain[i], event);
|
||||
}
|
||||
|
||||
if(target_vtbl && target_vtbl->set_current_event) {
|
||||
|
@ -66,6 +66,7 @@ typedef struct {
|
||||
EventTarget *target;
|
||||
BOOL prevent_default;
|
||||
BOOL stop_propagation;
|
||||
USHORT phase;
|
||||
|
||||
IHTMLEventObj *event_obj;
|
||||
BOOL no_event_obj;
|
||||
|
@ -2534,6 +2534,7 @@ static void test_create_event(IHTMLDocument2 *doc)
|
||||
{
|
||||
IDocumentEvent *doc_event;
|
||||
IDOMEvent *event;
|
||||
USHORT phase;
|
||||
BSTR str;
|
||||
HRESULT hres;
|
||||
|
||||
@ -2547,6 +2548,11 @@ static void test_create_event(IHTMLDocument2 *doc)
|
||||
SysFreeString(str);
|
||||
ok(hres == S_OK, "createEvent failed: %08x\n", hres);
|
||||
|
||||
phase = 0xdead;
|
||||
hres = IDOMEvent_get_eventPhase(event, &phase);
|
||||
ok(hres == S_OK, "get_eventPhase failed: %08x\n", hres);
|
||||
ok(!phase, "phase = %u\n", phase);
|
||||
|
||||
hres = IDOMEvent_preventDefault(event);
|
||||
ok(hres == S_OK, "preventDefault failed: %08x\n", hres);
|
||||
|
||||
|
@ -20031,6 +20031,14 @@ interface IEventTarget : IDispatch
|
||||
[out, retval] VARIANT_BOOL *pfResult);
|
||||
}
|
||||
|
||||
typedef enum _DOM_EVENT_PHASE
|
||||
{
|
||||
DEP_CAPTURING_PHASE = 1,
|
||||
DEP_AT_TARGET = 2,
|
||||
DEP_BUBBLING_PHASE = 3,
|
||||
DOM_EVENT_PHASE_Max = 0x7fffffff
|
||||
} DOM_EVENT_PHASE;
|
||||
|
||||
/*****************************************************************************
|
||||
* IDOMEvent interface
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user