Commit 05dc7eac authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Added IHTMLDocument4::fireEvent implementation.

parent fae1fff8
...@@ -777,8 +777,10 @@ static HRESULT WINAPI HTMLDocument4_fireEvent(IHTMLDocument4 *iface, BSTR bstrEv ...@@ -777,8 +777,10 @@ static HRESULT WINAPI HTMLDocument4_fireEvent(IHTMLDocument4 *iface, BSTR bstrEv
VARIANT *pvarEventObject, VARIANT_BOOL *pfCanceled) VARIANT *pvarEventObject, VARIANT_BOOL *pfCanceled)
{ {
HTMLDocument *This = impl_from_IHTMLDocument4(iface); HTMLDocument *This = impl_from_IHTMLDocument4(iface);
FIXME("(%p)->(%s %p %p)\n", This, debugstr_w(bstrEventName), pvarEventObject, pfCanceled);
return E_NOTIMPL; TRACE("(%p)->(%s %p %p)\n", This, debugstr_w(bstrEventName), pvarEventObject, pfCanceled);
return dispatch_event(&This->doc_node->node, bstrEventName, pvarEventObject, pfCanceled);
} }
static HRESULT WINAPI HTMLDocument4_createRenderStyle(IHTMLDocument4 *iface, BSTR v, static HRESULT WINAPI HTMLDocument4_createRenderStyle(IHTMLDocument4 *iface, BSTR v,
......
...@@ -364,13 +364,10 @@ static HRESULT WINAPI HTMLEventObj_get_srcElement(IHTMLEventObj *iface, IHTMLEle ...@@ -364,13 +364,10 @@ static HRESULT WINAPI HTMLEventObj_get_srcElement(IHTMLEventObj *iface, IHTMLEle
TRACE("(%p)->(%p)\n", This, p); TRACE("(%p)->(%p)\n", This, p);
if(!This->target) { *p = NULL;
*p = NULL; if(This->target)
return S_OK; IHTMLDOMNode_QueryInterface(&This->target->IHTMLDOMNode_iface, &IID_IHTMLElement, (void**)p);
} return S_OK;
return IHTMLDOMNode_QueryInterface(&This->target->IHTMLDOMNode_iface, &IID_IHTMLElement,
(void**)p);
} }
static HRESULT WINAPI HTMLEventObj_get_altKey(IHTMLEventObj *iface, VARIANT_BOOL *p) static HRESULT WINAPI HTMLEventObj_get_altKey(IHTMLEventObj *iface, VARIANT_BOOL *p)
......
...@@ -20,6 +20,16 @@ function ondataavailable_test() { ...@@ -20,6 +20,16 @@ function ondataavailable_test() {
ok(evobj.type === "dataavailable", "evobj.type = " + evobj.type); ok(evobj.type === "dataavailable", "evobj.type = " + evobj.type);
} }
function ondataavailableDocHandler() {
b = true;
ok(window.event === evobj, "window.event != evobj");
ok(evobj.srcElement === null, "evobj.srcElement = " + evobj.srcElement);
ok(evobj.fromElement === null, "evobj.srcElement = " + evobj.fromElement);
ok(evobj.toElement === null, "evobj.srcElement = " + evobj.toElement);
ok(evobj.type === "dataavailable", "evobj.type = " + evobj.type);
}
div.attachEvent("ondataavailable", ondataavailableHandler); div.attachEvent("ondataavailable", ondataavailableHandler);
evobj = document.createEventObject(); evobj = document.createEventObject();
...@@ -33,6 +43,25 @@ function ondataavailable_test() { ...@@ -33,6 +43,25 @@ function ondataavailable_test() {
ok(evobj.srcElement === div, "evobj.srcElement = " + evobj.srcElement); ok(evobj.srcElement === div, "evobj.srcElement = " + evobj.srcElement);
ok(evobj.type === "dataavailable", "evobj.type = " + evobj.type); ok(evobj.type === "dataavailable", "evobj.type = " + evobj.type);
div.detachEvent("ondataavailable", ondataavailableHandler);
b = false;
div.fireEvent("ondataavailable", evobj);
ok(!b, "ondataavailable handler called?");
ok(evobj.srcElement === div, "evobj.srcElement = " + evobj.srcElement);
ok(evobj.type === "dataavailable", "evobj.type = " + evobj.type);
document.attachEvent("ondataavailable", ondataavailableDocHandler);
evobj = document.createEventObject();
document.fireEvent("ondataavailable", evobj);
ok(b, "ondataavailable handler not called?");
ok(evobj.srcElement === null, "evobj.srcElement = " + evobj.srcElement);
ok(evobj.type === "dataavailable", "evobj.type = " + evobj.type);
} }
function runTests() { function runTests() {
......
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