mshtml: Override default onsubmit action with our submit implementation.

This commit is contained in:
Jacek Caban 2014-08-20 13:04:28 +02:00 committed by Alexandre Julliard
parent b2962fb87e
commit 255894c1f1
2 changed files with 14 additions and 2 deletions

View File

@ -218,7 +218,7 @@ static const event_info_t event_info[] = {
{selectstartW, onselectstartW, EVENTT_MOUSE, DISPID_EVMETH_ONSELECTSTART,
EVENT_CANCELABLE},
{submitW, onsubmitW, EVENTT_HTML, DISPID_EVMETH_ONSUBMIT,
EVENT_DEFAULTLISTENER|EVENT_BUBBLE|EVENT_CANCELABLE}
EVENT_DEFAULTLISTENER|EVENT_BUBBLE|EVENT_CANCELABLE|EVENT_HASDEFAULTHANDLERS}
};
eventid_t str_to_eid(LPCWSTR str)

View File

@ -714,12 +714,24 @@ static HRESULT HTMLFormElement_invoke(HTMLDOMNode *iface,
return S_OK;
}
static HRESULT HTMLFormElement_handle_event(HTMLDOMNode *iface, eventid_t eid, nsIDOMEvent *event, BOOL *prevent_default)
{
HTMLFormElement *This = impl_from_HTMLDOMNode(iface);
if(eid == EVENTID_SUBMIT) {
*prevent_default = TRUE;
return IHTMLFormElement_submit(&This->IHTMLFormElement_iface);
}
return HTMLElement_handle_event(&This->element.node, eid, event, prevent_default);
}
static const NodeImplVtbl HTMLFormElementImplVtbl = {
HTMLFormElement_QI,
HTMLElement_destructor,
HTMLElement_cpc,
HTMLElement_clone,
HTMLElement_handle_event,
HTMLFormElement_handle_event,
HTMLElement_get_attr_col,
NULL,
NULL,