Commit d224a2a8 authored by Gabriel Ivăncescu's avatar Gabriel Ivăncescu Committed by Alexandre Julliard

mshtml: Restructure element removeAttribute.

parent 368199c6
...@@ -1197,46 +1197,47 @@ static HRESULT WINAPI HTMLElement_removeAttribute(IHTMLElement *iface, BSTR strA ...@@ -1197,46 +1197,47 @@ static HRESULT WINAPI HTMLElement_removeAttribute(IHTMLElement *iface, BSTR strA
LONG lFlags, VARIANT_BOOL *pfSuccess) LONG lFlags, VARIANT_BOOL *pfSuccess)
{ {
HTMLElement *This = impl_from_IHTMLElement(iface); HTMLElement *This = impl_from_IHTMLElement(iface);
compat_mode_t compat_mode = dispex_compat_mode(&This->node.event_target.dispex);
DISPID id; DISPID id;
HRESULT hres; HRESULT hres;
TRACE("(%p)->(%s %x %p)\n", This, debugstr_w(strAttributeName), lFlags, pfSuccess); TRACE("(%p)->(%s %x %p)\n", This, debugstr_w(strAttributeName), lFlags, pfSuccess);
if(dispex_compat_mode(&This->node.event_target.dispex) >= COMPAT_MODE_IE8) { if(compat_mode < COMPAT_MODE_IE8 || !This->dom_element) {
*pfSuccess = element_has_attribute(This, strAttributeName); hres = IDispatchEx_GetDispID(&This->node.event_target.dispex.IDispatchEx_iface, strAttributeName,
if(*pfSuccess) lFlags&ATTRFLAG_CASESENSITIVE ? fdexNameCaseSensitive : fdexNameCaseInsensitive, &id);
return element_remove_attribute(This, strAttributeName); if(hres == DISP_E_UNKNOWNNAME) {
return S_OK; *pfSuccess = VARIANT_FALSE;
} return S_OK;
}
if(FAILED(hres))
return hres;
hres = IDispatchEx_GetDispID(&This->node.event_target.dispex.IDispatchEx_iface, strAttributeName, if(id == DISPID_IHTMLELEMENT_STYLE) {
lFlags&ATTRFLAG_CASESENSITIVE ? fdexNameCaseSensitive : fdexNameCaseInsensitive, &id); IHTMLStyle *style;
if(hres == DISP_E_UNKNOWNNAME) {
*pfSuccess = VARIANT_FALSE;
return S_OK;
}
if(FAILED(hres))
return hres;
if(id == DISPID_IHTMLELEMENT_STYLE) { TRACE("Special case: style\n");
IHTMLStyle *style;
TRACE("Special case: style\n"); hres = IHTMLElement_get_style(&This->IHTMLElement_iface, &style);
if(FAILED(hres))
return hres;
hres = IHTMLElement_get_style(&This->IHTMLElement_iface, &style); hres = IHTMLStyle_put_cssText(style, NULL);
if(FAILED(hres)) IHTMLStyle_Release(style);
return hres; if(FAILED(hres))
return hres;
hres = IHTMLStyle_put_cssText(style, NULL); *pfSuccess = VARIANT_TRUE;
IHTMLStyle_Release(style); return S_OK;
if(FAILED(hres)) }
return hres;
*pfSuccess = VARIANT_TRUE; return remove_attribute(&This->node.event_target.dispex, id, pfSuccess);
return S_OK;
} }
return remove_attribute(&This->node.event_target.dispex, id, pfSuccess); *pfSuccess = element_has_attribute(This, strAttributeName);
if(*pfSuccess)
return element_remove_attribute(This, strAttributeName);
return S_OK;
} }
static HRESULT WINAPI HTMLElement_put_className(IHTMLElement *iface, BSTR v) static HRESULT WINAPI HTMLElement_put_className(IHTMLElement *iface, BSTR v)
......
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