mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-05 18:01:34 +00:00
mshtml: Added IHTMLDocument4::fireEvent implementation.
This commit is contained in:
parent
fae1fff830
commit
05dc7eac8d
3 changed files with 37 additions and 9 deletions
|
@ -777,8 +777,10 @@ static HRESULT WINAPI HTMLDocument4_fireEvent(IHTMLDocument4 *iface, BSTR bstrEv
|
|||
VARIANT *pvarEventObject, VARIANT_BOOL *pfCanceled)
|
||||
{
|
||||
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,
|
||||
|
|
|
@ -364,13 +364,10 @@ static HRESULT WINAPI HTMLEventObj_get_srcElement(IHTMLEventObj *iface, IHTMLEle
|
|||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
if(!This->target) {
|
||||
*p = NULL;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
return IHTMLDOMNode_QueryInterface(&This->target->IHTMLDOMNode_iface, &IID_IHTMLElement,
|
||||
(void**)p);
|
||||
*p = NULL;
|
||||
if(This->target)
|
||||
IHTMLDOMNode_QueryInterface(&This->target->IHTMLDOMNode_iface, &IID_IHTMLElement, (void**)p);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLEventObj_get_altKey(IHTMLEventObj *iface, VARIANT_BOOL *p)
|
||||
|
|
|
@ -20,6 +20,16 @@ function ondataavailable_test() {
|
|||
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);
|
||||
|
||||
evobj = document.createEventObject();
|
||||
|
@ -33,6 +43,25 @@ function ondataavailable_test() {
|
|||
|
||||
ok(evobj.srcElement === div, "evobj.srcElement = " + evobj.srcElement);
|
||||
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() {
|
||||
|
|
Loading…
Reference in a new issue