mshtml: Added IDOMMouseEvent::fromElement property implementation.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
c0d248f2a5
commit
beb0b78a5a
|
@ -1580,8 +1580,27 @@ static HRESULT WINAPI DOMMouseEvent_get_buttons(IDOMMouseEvent *iface, USHORT *p
|
|||
static HRESULT WINAPI DOMMouseEvent_get_fromElement(IDOMMouseEvent *iface, IHTMLElement **p)
|
||||
{
|
||||
DOMEvent *This = impl_from_IDOMMouseEvent(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
IEventTarget *related_target = NULL;
|
||||
|
||||
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)
|
||||
|
|
|
@ -633,6 +633,7 @@ function test_mouse_event() {
|
|||
ok(e.which === 1, "which = " + e.which);
|
||||
ok(e.relatedTarget === null, "relatedTarget = " + e.relatedTarget);
|
||||
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);
|
||||
ok(e.type === "test", "type = " + e.type);
|
||||
|
|
Loading…
Reference in New Issue