mshtml: Pass element as nsIDOMElement to get_elem_attr_value.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
54a746f155
commit
3cac8d223b
|
@ -295,7 +295,7 @@ static void get_font_size(HTMLDocument *This, WCHAR *ret)
|
|||
|
||||
TRACE("found font tag %p\n", elem);
|
||||
|
||||
get_elem_attr_value(elem, sizeW, &val_str, &val);
|
||||
get_elem_attr_value((nsIDOMElement*)elem, sizeW, &val_str, &val);
|
||||
if(*val) {
|
||||
TRACE("found size %s\n", debugstr_w(val));
|
||||
strcpyW(ret, val);
|
||||
|
|
|
@ -166,14 +166,14 @@ HRESULT replace_node_by_html(nsIDOMHTMLDocument *nsdoc, nsIDOMNode *nsnode, cons
|
|||
return hres;
|
||||
}
|
||||
|
||||
nsresult get_elem_attr_value(nsIDOMHTMLElement *nselem, const WCHAR *name, nsAString *val_str, const PRUnichar **val)
|
||||
nsresult get_elem_attr_value(nsIDOMElement *nselem, const WCHAR *name, nsAString *val_str, const PRUnichar **val)
|
||||
{
|
||||
nsAString name_str;
|
||||
nsresult nsres;
|
||||
|
||||
nsAString_InitDepend(&name_str, name);
|
||||
nsAString_Init(val_str, NULL);
|
||||
nsres = nsIDOMHTMLElement_GetAttribute(nselem, &name_str, val_str);
|
||||
nsres = nsIDOMElement_GetAttribute(nselem, &name_str, val_str);
|
||||
nsAString_Finish(&name_str);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("GetAttribute(%s) failed: %08x\n", debugstr_w(name), nsres);
|
||||
|
@ -192,7 +192,7 @@ HRESULT elem_string_attr_getter(HTMLElement *elem, const WCHAR *name, BOOL use_n
|
|||
nsresult nsres;
|
||||
HRESULT hres = S_OK;
|
||||
|
||||
nsres = get_elem_attr_value(elem->nselem, name, &val_str, &val);
|
||||
nsres = get_elem_attr_value(elem->dom_element, name, &val_str, &val);
|
||||
if(NS_FAILED(nsres))
|
||||
return E_FAIL;
|
||||
|
||||
|
|
|
@ -381,14 +381,14 @@ static BOOL is_elem_name(HTMLElement *elem, LPCWSTR name)
|
|||
return FALSE;
|
||||
|
||||
nsAString_Init(&nsstr, NULL);
|
||||
nsIDOMHTMLElement_GetId(elem->nselem, &nsstr);
|
||||
nsIDOMElement_GetId(elem->dom_element, &nsstr);
|
||||
nsAString_GetData(&nsstr, &str);
|
||||
if(!strcmpiW(str, name)) {
|
||||
nsAString_Finish(&nsstr);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
nsres = get_elem_attr_value(elem->nselem, nameW, &nsstr, &str);
|
||||
nsres = get_elem_attr_value(elem->dom_element, nameW, &nsstr, &str);
|
||||
if(NS_SUCCEEDED(nsres)) {
|
||||
ret = !strcmpiW(str, name);
|
||||
nsAString_Finish(&nsstr);
|
||||
|
|
|
@ -671,7 +671,7 @@ static HRESULT HTMLFormElement_get_dispid(HTMLDOMNode *iface,
|
|||
nsAString_Init(&nsstr, NULL);
|
||||
for(i = 0; i < len; ++i) {
|
||||
nsIDOMNode *nsitem;
|
||||
nsIDOMHTMLElement *nshtml_elem;
|
||||
nsIDOMElement *elem;
|
||||
const PRUnichar *str;
|
||||
|
||||
nsres = nsIDOMHTMLCollection_Item(elements, i, &nsitem);
|
||||
|
@ -681,7 +681,7 @@ static HRESULT HTMLFormElement_get_dispid(HTMLDOMNode *iface,
|
|||
break;
|
||||
}
|
||||
|
||||
nsres = nsIDOMNode_QueryInterface(nsitem, &IID_nsIDOMHTMLElement, (void**)&nshtml_elem);
|
||||
nsres = nsIDOMNode_QueryInterface(nsitem, &IID_nsIDOMElement, (void**)&elem);
|
||||
nsIDOMNode_Release(nsitem);
|
||||
if(NS_FAILED(nsres)) {
|
||||
FIXME("Failed to get nsIDOMHTMLNode interface: 0x%08x\n", nsres);
|
||||
|
@ -690,16 +690,16 @@ static HRESULT HTMLFormElement_get_dispid(HTMLDOMNode *iface,
|
|||
}
|
||||
|
||||
/* compare by id attr */
|
||||
nsres = nsIDOMHTMLElement_GetId(nshtml_elem, &nsstr);
|
||||
nsres = nsIDOMElement_GetId(elem, &nsstr);
|
||||
if(NS_FAILED(nsres)) {
|
||||
FIXME("GetId failed: 0x%08x\n", nsres);
|
||||
nsIDOMHTMLElement_Release(nshtml_elem);
|
||||
nsIDOMElement_Release(elem);
|
||||
hres = E_FAIL;
|
||||
break;
|
||||
}
|
||||
nsAString_GetData(&nsstr, &str);
|
||||
if(!strcmpiW(str, name)) {
|
||||
nsIDOMHTMLElement_Release(nshtml_elem);
|
||||
nsIDOMElement_Release(elem);
|
||||
/* FIXME: using index for dispid */
|
||||
*pid = MSHTML_DISPID_CUSTOM_MIN + i;
|
||||
hres = S_OK;
|
||||
|
@ -707,8 +707,8 @@ static HRESULT HTMLFormElement_get_dispid(HTMLDOMNode *iface,
|
|||
}
|
||||
|
||||
/* compare by name attr */
|
||||
nsres = get_elem_attr_value(nshtml_elem, nameW, &name_str, &str);
|
||||
nsIDOMHTMLElement_Release(nshtml_elem);
|
||||
nsres = get_elem_attr_value(elem, nameW, &name_str, &str);
|
||||
nsIDOMElement_Release(elem);
|
||||
if(NS_SUCCEEDED(nsres)) {
|
||||
if(!strcmpiW(str, name)) {
|
||||
nsAString_Finish(&name_str);
|
||||
|
|
|
@ -1095,7 +1095,7 @@ HRESULT attr_value_to_string(VARIANT*) DECLSPEC_HIDDEN;
|
|||
HRESULT get_elem_attr_value_by_dispid(HTMLElement*,DISPID,VARIANT*) DECLSPEC_HIDDEN;
|
||||
HRESULT get_elem_source_index(HTMLElement*,LONG*) DECLSPEC_HIDDEN;
|
||||
|
||||
nsresult get_elem_attr_value(nsIDOMHTMLElement*,const WCHAR*,nsAString*,const PRUnichar**) DECLSPEC_HIDDEN;
|
||||
nsresult get_elem_attr_value(nsIDOMElement*,const WCHAR*,nsAString*,const PRUnichar**) DECLSPEC_HIDDEN;
|
||||
HRESULT elem_string_attr_getter(HTMLElement*,const WCHAR*,BOOL,BSTR*) DECLSPEC_HIDDEN;
|
||||
HRESULT elem_string_attr_setter(HTMLElement*,const WCHAR*,const WCHAR*) DECLSPEC_HIDDEN;
|
||||
|
||||
|
|
|
@ -1669,7 +1669,7 @@ static BOOL get_elem_clsid(nsIDOMHTMLElement *elem, CLSID *clsid)
|
|||
|
||||
static const PRUnichar classidW[] = {'c','l','a','s','s','i','d',0};
|
||||
|
||||
nsres = get_elem_attr_value(elem, classidW, &val_str, &val);
|
||||
nsres = get_elem_attr_value((nsIDOMElement*)elem, classidW, &val_str, &val);
|
||||
if(NS_SUCCEEDED(nsres)) {
|
||||
if(*val)
|
||||
ret = parse_classid(val, clsid);
|
||||
|
@ -1907,7 +1907,7 @@ static void check_codebase(HTMLInnerWindow *window, nsIDOMHTMLElement *nselem)
|
|||
|
||||
static const PRUnichar codebaseW[] = {'c','o','d','e','b','a','s','e',0};
|
||||
|
||||
nsres = get_elem_attr_value(nselem, codebaseW, &val_str, &val);
|
||||
nsres = get_elem_attr_value((nsIDOMElement*)nselem, codebaseW, &val_str, &val);
|
||||
if(NS_SUCCEEDED(nsres)) {
|
||||
if(*val) {
|
||||
hres = CoInternetCombineUrlEx(window->base.outer_window->uri, val, 0, &uri, 0);
|
||||
|
|
|
@ -273,7 +273,7 @@ static HRESULT fill_props(nsIDOMHTMLElement *nselem, PropertyBag *prop_bag)
|
|||
const PRUnichar *name, *value;
|
||||
nsAString name_str, value_str;
|
||||
nsIDOMHTMLCollection *params;
|
||||
nsIDOMHTMLElement *param_elem;
|
||||
nsIDOMElement *param_elem;
|
||||
UINT32 length, i;
|
||||
nsIDOMNode *nsnode;
|
||||
nsresult nsres;
|
||||
|
@ -300,7 +300,7 @@ static HRESULT fill_props(nsIDOMHTMLElement *nselem, PropertyBag *prop_bag)
|
|||
break;
|
||||
}
|
||||
|
||||
nsres = nsIDOMNode_QueryInterface(nsnode, &IID_nsIDOMHTMLElement, (void**)¶m_elem);
|
||||
nsres = nsIDOMNode_QueryInterface(nsnode, &IID_nsIDOMElement, (void**)¶m_elem);
|
||||
nsIDOMNode_Release(nsnode);
|
||||
if(NS_FAILED(nsres)) {
|
||||
hres = E_FAIL;
|
||||
|
@ -318,7 +318,7 @@ static HRESULT fill_props(nsIDOMHTMLElement *nselem, PropertyBag *prop_bag)
|
|||
nsAString_Finish(&name_str);
|
||||
}
|
||||
|
||||
nsIDOMHTMLElement_Release(param_elem);
|
||||
nsIDOMElement_Release(param_elem);
|
||||
if(FAILED(hres))
|
||||
break;
|
||||
if(NS_FAILED(nsres)) {
|
||||
|
|
|
@ -1205,7 +1205,7 @@ static BOOL get_guid_from_language(LPCWSTR type, GUID *guid)
|
|||
|
||||
static BOOL get_script_guid(HTMLInnerWindow *window, nsIDOMHTMLScriptElement *nsscript, GUID *guid)
|
||||
{
|
||||
nsIDOMHTMLElement *nselem;
|
||||
nsIDOMElement *nselem;
|
||||
const PRUnichar *language;
|
||||
nsAString val_str;
|
||||
BOOL ret = FALSE;
|
||||
|
@ -1229,11 +1229,11 @@ static BOOL get_script_guid(HTMLInnerWindow *window, nsIDOMHTMLScriptElement *ns
|
|||
ERR("GetType failed: %08x\n", nsres);
|
||||
}
|
||||
|
||||
nsres = nsIDOMHTMLScriptElement_QueryInterface(nsscript, &IID_nsIDOMHTMLElement, (void**)&nselem);
|
||||
nsres = nsIDOMHTMLScriptElement_QueryInterface(nsscript, &IID_nsIDOMElement, (void**)&nselem);
|
||||
assert(nsres == NS_OK);
|
||||
|
||||
nsres = get_elem_attr_value(nselem, languageW, &val_str, &language);
|
||||
nsIDOMHTMLElement_Release(nselem);
|
||||
nsIDOMElement_Release(nselem);
|
||||
if(NS_SUCCEEDED(nsres)) {
|
||||
if(*language) {
|
||||
ret = get_guid_from_language(language, guid);
|
||||
|
|
Loading…
Reference in New Issue