From 53e9acbf28c68d3558372597311dda14b4fe0345 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Fri, 28 Nov 2014 16:19:35 +0100 Subject: [PATCH] mshtml: style attribute is a special case for setAttribute and removeAttribute. --- dlls/mshtml/htmlelem.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index e302f2a4ddf..48fff3f23fc 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -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); }