Commit df62eea1 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Use get_elem_attr_value helper in check_event_attr.

parent d0898685
......@@ -1523,24 +1523,19 @@ void update_cp_events(HTMLInnerWindow *window, event_target_t **event_target_ptr
}
}
void check_event_attr(HTMLDocumentNode *doc, nsIDOMElement *nselem)
void check_event_attr(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem)
{
const PRUnichar *attr_value;
nsAString attr_name_str, attr_value_str;
nsAString attr_value_str;
IDispatch *disp;
HTMLDOMNode *node;
int i;
nsresult nsres;
HRESULT hres;
nsAString_Init(&attr_value_str, NULL);
nsAString_Init(&attr_name_str, NULL);
for(i=0; i < EVENTID_LAST; i++) {
nsAString_SetData(&attr_name_str, event_info[i].attr_name);
nsres = nsIDOMElement_GetAttribute(nselem, &attr_name_str, &attr_value_str);
nsres = get_elem_attr_value(nselem, event_info[i].attr_name, &attr_value_str, &attr_value);
if(NS_SUCCEEDED(nsres)) {
nsAString_GetData(&attr_value_str, &attr_value);
if(!*attr_value)
continue;
......@@ -1555,11 +1550,9 @@ void check_event_attr(HTMLDocumentNode *doc, nsIDOMElement *nselem)
}
IDispatch_Release(disp);
}
nsAString_Finish(&attr_value_str);
}
}
nsAString_Finish(&attr_value_str);
nsAString_Finish(&attr_name_str);
}
HRESULT doc_init_events(HTMLDocumentNode *doc)
......
......@@ -49,7 +49,7 @@ typedef enum {
} eventid_t;
eventid_t str_to_eid(LPCWSTR) DECLSPEC_HIDDEN;
void check_event_attr(HTMLDocumentNode*,nsIDOMElement*) DECLSPEC_HIDDEN;
void check_event_attr(HTMLDocumentNode*,nsIDOMHTMLElement*) DECLSPEC_HIDDEN;
void release_event_target(event_target_t*) DECLSPEC_HIDDEN;
void fire_event(HTMLDocumentNode*,eventid_t,BOOL,nsIDOMNode*,nsIDOMEvent*,IDispatch*) DECLSPEC_HIDDEN;
HRESULT set_event_handler(event_target_t**,HTMLDocumentNode*,eventid_t,VARIANT*) DECLSPEC_HIDDEN;
......
......@@ -638,16 +638,16 @@ static void NSAPI nsDocumentObserver_BindToDocument(nsIDocumentObserver *iface,
nsIDOMHTMLIFrameElement *nsiframe;
nsIDOMHTMLFrameElement *nsframe;
nsIDOMHTMLScriptElement *nsscript;
nsIDOMHTMLElement *nselem;
nsIDOMComment *nscomment;
nsIDOMElement *nselem;
nsresult nsres;
TRACE("(%p)->(%p %p)\n", This, aDocument, aContent);
nsres = nsIContent_QueryInterface(aContent, &IID_nsIDOMElement, (void**)&nselem);
nsres = nsIContent_QueryInterface(aContent, &IID_nsIDOMHTMLElement, (void**)&nselem);
if(NS_SUCCEEDED(nsres)) {
check_event_attr(This, nselem);
nsIDOMElement_Release(nselem);
nsIDOMHTMLElement_Release(nselem);
}
nsres = nsIContent_QueryInterface(aContent, &IID_nsIDOMComment, (void**)&nscomment);
......
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