mshtml: style attribute is a special case for setAttribute and removeAttribute.

This commit is contained in:
Jacek Caban 2014-11-28 16:19:35 +01:00 committed by Alexandre Julliard
parent 96f628175d
commit 53e9acbf28
1 changed files with 24 additions and 0 deletions

View File

@ -28,6 +28,7 @@
#include "winreg.h"
#include "ole2.h"
#include "shlwapi.h"
#include "mshtmdid.h"
#include "wine/debug.h"
@ -621,6 +622,11 @@ static HRESULT WINAPI HTMLElement_setAttribute(IHTMLElement *iface, BSTR strAttr
if(FAILED(hres))
return hres;
if(dispid == DISPID_IHTMLELEMENT_STYLE) {
TRACE("Ignoring call on style attribute\n");
return S_OK;
}
dispParams.cArgs = 1;
dispParams.cNamedArgs = 1;
dispParams.rgdispidNamedArgs = &dispidNamed;
@ -675,6 +681,24 @@ static HRESULT WINAPI HTMLElement_removeAttribute(IHTMLElement *iface, BSTR strA
if(FAILED(hres))
return hres;
if(id == DISPID_IHTMLELEMENT_STYLE) {
IHTMLStyle *style;
TRACE("Special case: style\n");
hres = IHTMLElement_get_style(&This->IHTMLElement_iface, &style);
if(FAILED(hres))
return hres;
hres = IHTMLStyle_put_cssText(style, NULL);
IHTMLStyle_Release(style);
if(FAILED(hres))
return hres;
*pfSuccess = VARIANT_TRUE;
return S_OK;
}
return remove_attribute(&This->node.dispex, id, pfSuccess);
}