Commit 74d6c6d2 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Properly support custom event listeners in XMLHttpRequest object.

parent d7c94cc7
......@@ -538,6 +538,18 @@ function test_dispatch_event() {
ok(calls === "parent.testing(capture),child.testing(capture),"
+ "child.testing(bubble),parent.testing(bubble),", "calls = " + calls);
var xhr = new XMLHttpRequest();
xhr.addEventListener("testing", function(event) {
ok(event === e, "event != e");
ok(event.target === xhr, "target != child");
ok(event.srcElement === null, "srcElement != child");
calls += "xhr.testing";
}, true);
calls = "";
xhr.dispatchEvent(e);
ok(calls === "xhr.testing", "calls = " + calls);
next_test();
}
......
......@@ -755,9 +755,7 @@ static void HTMLXMLHttpRequest_bind_event(DispatchEx *dispex, eventid_t eid)
TRACE("(%p)\n", This);
assert(eid == EVENTID_READYSTATECHANGE);
if(This->event_listener)
if(eid != EVENTID_READYSTATECHANGE || This->event_listener)
return;
This->event_listener = heap_alloc(sizeof(*This->event_listener));
......
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