From 41bdff629fb6f0fa4420d1a567f26d7894cab114 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Mon, 23 Jun 2008 09:54:51 -0500 Subject: [PATCH] mshtml: Added IHTMLElement::put_onclick implementation. --- dlls/mshtml/htmlelem.c | 6 ++++-- dlls/mshtml/htmlevent.c | 13 +++++++++++++ dlls/mshtml/mshtml_private.h | 1 + 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index ce93399c270..3968156c0ed 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -443,8 +443,10 @@ static HRESULT WINAPI HTMLElement_get_onhelp(IHTMLElement *iface, VARIANT *p) static HRESULT WINAPI HTMLElement_put_onclick(IHTMLElement *iface, VARIANT v) { HTMLElement *This = HTMLELEM_THIS(iface); - FIXME("(%p)->()\n", This); - return E_NOTIMPL; + + TRACE("(%p)->()\n", This); + + return set_node_event(&This->node, EVENTID_CLICK, &v); } static HRESULT WINAPI HTMLElement_get_onclick(IHTMLElement *iface, VARIANT *p) diff --git a/dlls/mshtml/htmlevent.c b/dlls/mshtml/htmlevent.c index d155ed50fbd..cfd6ebc1a9c 100644 --- a/dlls/mshtml/htmlevent.c +++ b/dlls/mshtml/htmlevent.c @@ -419,6 +419,19 @@ static HRESULT set_node_event_disp(HTMLDOMNode *node, eventid_t eid, IDispatch * return S_OK; } +HRESULT set_node_event(HTMLDOMNode *node, eventid_t eid, VARIANT *var) +{ + switch(V_VT(var)) { + case VT_DISPATCH: + return set_node_event_disp(node, eid, V_DISPATCH(var)); + + default: + FIXME("not supported vt=%d\n", V_VT(var)); + } + + return E_NOTIMPL; +} + void check_event_attr(HTMLDocument *doc, nsIDOMElement *nselem) { const PRUnichar *attr_value; diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 38dc7157f5f..3842591a2be 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -505,6 +505,7 @@ nsresult get_nsinterface(nsISupports*,REFIID,void**); void check_event_attr(HTMLDocument*,nsIDOMElement*); void release_event_target(event_target_t*); void fire_event(HTMLDocument*,eventid_t,nsIDOMNode*); +HRESULT set_node_event(HTMLDOMNode*,eventid_t,VARIANT*); eventid_t str_to_eid(LPCWSTR); void set_document_bscallback(HTMLDocument*,nsChannelBSC*); -- 2.11.4.GIT