Commit beb0b78a authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Added IDOMMouseEvent::fromElement property implementation.

parent c0d248f2
...@@ -1580,8 +1580,27 @@ static HRESULT WINAPI DOMMouseEvent_get_buttons(IDOMMouseEvent *iface, USHORT *p ...@@ -1580,8 +1580,27 @@ static HRESULT WINAPI DOMMouseEvent_get_buttons(IDOMMouseEvent *iface, USHORT *p
static HRESULT WINAPI DOMMouseEvent_get_fromElement(IDOMMouseEvent *iface, IHTMLElement **p) static HRESULT WINAPI DOMMouseEvent_get_fromElement(IDOMMouseEvent *iface, IHTMLElement **p)
{ {
DOMEvent *This = impl_from_IDOMMouseEvent(iface); DOMEvent *This = impl_from_IDOMMouseEvent(iface);
FIXME("(%p)->(%p)\n", This, p); IEventTarget *related_target = NULL;
return E_NOTIMPL;
TRACE("(%p)->(%p)\n", This, p);
if(This->event_id != EVENTID_LAST) {
HRESULT hres = S_OK;
if(event_info[This->event_id].flags & EVENT_MOUSE_FROM_RELATED)
hres = IDOMMouseEvent_get_relatedTarget(&This->IDOMMouseEvent_iface, &related_target);
else if(event_info[This->event_id].flags & EVENT_MOUSE_TO_RELATED)
hres = IDOMEvent_get_target(&This->IDOMEvent_iface, &related_target);
if(FAILED(hres))
return hres;
}
if(!related_target) {
*p = NULL;
return S_OK;
}
IEventTarget_QueryInterface(related_target, &IID_IHTMLElement, (void**)p);
return S_OK;
} }
static HRESULT WINAPI DOMMouseEvent_get_toElement(IDOMMouseEvent *iface, IHTMLElement **p) static HRESULT WINAPI DOMMouseEvent_get_toElement(IDOMMouseEvent *iface, IHTMLElement **p)
......
...@@ -633,6 +633,7 @@ function test_mouse_event() { ...@@ -633,6 +633,7 @@ function test_mouse_event() {
ok(e.which === 1, "which = " + e.which); ok(e.which === 1, "which = " + e.which);
ok(e.relatedTarget === null, "relatedTarget = " + e.relatedTarget); ok(e.relatedTarget === null, "relatedTarget = " + e.relatedTarget);
ok(e.toElement === null, "toElement = " + e.toElement); ok(e.toElement === null, "toElement = " + e.toElement);
ok(e.fromElement === null, "fromElement = " + e.fromElement);
e.initMouseEvent("test", true, true, window, 1, 2, 3, 4, 5, false, false, false, false, 1, document); e.initMouseEvent("test", true, true, window, 1, 2, 3, 4, 5, false, false, false, false, 1, document);
ok(e.type === "test", "type = " + e.type); ok(e.type === "test", "type = " + e.type);
......
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