Commit 07954f36 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Added IDOMEvent::get_srcElement implementation.

parent 6f7532cb
......@@ -396,10 +396,12 @@ static HRESULT WINAPI HTMLEventObj_get_srcElement(IHTMLEventObj *iface, IHTMLEle
TRACE("(%p)->(%p)\n", This, p);
*p = NULL;
if(This->event && This->event->target)
IDispatchEx_QueryInterface(&This->event->target->dispex.IDispatchEx_iface, &IID_IHTMLElement, (void**)p);
return S_OK;
if(!This->event) {
*p = NULL;
return S_OK;
}
return IDOMEvent_get_srcElement(&This->event->IDOMEvent_iface, p);
}
static HRESULT WINAPI HTMLEventObj_get_altKey(IHTMLEventObj *iface, VARIANT_BOOL *p)
......@@ -1167,8 +1169,14 @@ static HRESULT WINAPI DOMEvent_get_cancelBubble(IDOMEvent *iface, VARIANT_BOOL *
static HRESULT WINAPI DOMEvent_get_srcElement(IDOMEvent *iface, IHTMLElement **p)
{
DOMEvent *This = impl_from_IDOMEvent(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
TRACE("(%p)->(%p)\n", This, p);
if(This->target)
IDispatchEx_QueryInterface(&This->target->dispex.IDispatchEx_iface, &IID_IHTMLElement, (void**)p);
else
*p = NULL;
return S_OK;
}
static const IDOMEventVtbl DOMEventVtbl = {
......
......@@ -469,6 +469,7 @@ function test_dispatch_event() {
return function(event) {
ok(event === e, "event != e");
ok(event.target === child, "target != child");
ok(event.srcElement === child, "srcElement != child");
calls += msg + ",";
};
}
......@@ -485,12 +486,14 @@ function test_dispatch_event() {
e = document.createEvent("Event");
e.initEvent("click", true, true);
ok(e.target === null, "e.target != null");
ok(e.srcElement === null, "e.srcElement != null");
calls = "";
child.dispatchEvent(e);
ok(calls === "parent.click(capture),child.click(capture),child.click(bubble),"
+ "parent.click(bubble),", "calls = " + calls);
ok(e.target === child, "e.target != child");
ok(e.srcElement === child, "e.srcElement != child");
ok(e.currentTarget === null, "e.currentTarget != null");
e = document.createEvent("Event");
......
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