mshtml: Added IHTMLElement2::get_runtimeStyle hackish implementation.

This commit is contained in:
Jacek Caban 2012-07-25 14:47:13 +02:00 committed by Alexandre Julliard
parent 5b633c29b9
commit 9ccc5f487b
4 changed files with 24 additions and 2 deletions

View File

@ -1563,6 +1563,10 @@ void HTMLElement_destructor(HTMLDOMNode *iface)
This->style->elem = NULL;
IHTMLStyle_Release(&This->style->IHTMLStyle_iface);
}
if(This->runtime_style) {
This->runtime_style->elem = NULL;
IHTMLStyle_Release(&This->runtime_style->IHTMLStyle_iface);
}
if(This->attrs) {
HTMLDOMAttribute *attr;

View File

@ -30,6 +30,7 @@
#include "mshtml_private.h"
#include "htmlevent.h"
#include "htmlstyle.h"
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
@ -1188,8 +1189,23 @@ static HRESULT WINAPI HTMLElement2_removeBehavior(IHTMLElement2 *iface, LONG coo
static HRESULT WINAPI HTMLElement2_get_runtimeStyle(IHTMLElement2 *iface, IHTMLStyle **p)
{
HTMLElement *This = impl_from_IHTMLElement2(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
FIXME("(%p)->(%p): hack\n", This, p);
/* We can't implement correct behavior on top of Gecko (although we could
try a bit harder). Making runtimeStyle behave like regular style is
enough for most use cases. */
if(!This->runtime_style) {
HRESULT hres;
hres = HTMLStyle_Create(This, &This->runtime_style);
if(FAILED(hres))
return hres;
}
*p = &This->runtime_style->IHTMLStyle_iface;
IHTMLStyle_AddRef(*p);
return S_OK;
}
static HRESULT WINAPI HTMLElement2_get_behaviorUrns(IHTMLElement2 *iface, IDispatch **p)

View File

@ -721,6 +721,7 @@ static ULONG WINAPI HTMLStyle_Release(IHTMLStyle *iface)
TRACE("(%p) ref=%d\n", This, ref);
if(!ref) {
assert(!This->elem);
if(This->nsstyle)
nsIDOMCSSStyleDeclaration_Release(This->nsstyle);
release_dispex(&This->dispex);

View File

@ -634,6 +634,7 @@ typedef struct {
nsIDOMHTMLElement *nselem;
HTMLStyle *style;
HTMLStyle *runtime_style;
HTMLAttributeCollection *attrs;
WCHAR *filter;
} HTMLElement;