mshtml: Added IHTMLCSSStyleDeclaration::put_cssStyle implementation.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2018-09-07 14:44:50 +02:00 committed by Alexandre Julliard
parent 78d0aab45b
commit 45f8c03cc7
2 changed files with 38 additions and 13 deletions

View File

@ -2463,20 +2463,10 @@ static HRESULT WINAPI HTMLStyle_get_pageBreakAfter(IHTMLStyle *iface, BSTR *p)
static HRESULT WINAPI HTMLStyle_put_cssText(IHTMLStyle *iface, BSTR v)
{
HTMLStyle *This = impl_from_IHTMLStyle(iface);
nsAString text_str;
nsresult nsres;
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
nsAString_InitDepend(&text_str, v);
nsres = nsIDOMCSSStyleDeclaration_SetCssText(This->nsstyle, &text_str);
nsAString_Finish(&text_str);
if(NS_FAILED(nsres)) {
FIXME("SetCssStyle failed: %08x\n", nsres);
return E_FAIL;
}
return S_OK;
return IHTMLCSSStyleDeclaration_put_cssText(&This->IHTMLCSSStyleDeclaration_iface, v);
}
static HRESULT WINAPI HTMLStyle_get_cssText(IHTMLStyle *iface, BSTR *p)
@ -5793,8 +5783,20 @@ static HRESULT WINAPI HTMLCSSStyleDeclaration_get_pageBreakAfter(IHTMLCSSStyleDe
static HRESULT WINAPI HTMLCSSStyleDeclaration_put_cssText(IHTMLCSSStyleDeclaration *iface, BSTR v)
{
HTMLStyle *This = impl_from_IHTMLCSSStyleDeclaration(iface);
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
return E_NOTIMPL;
nsAString text_str;
nsresult nsres;
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
nsAString_InitDepend(&text_str, v);
nsres = nsIDOMCSSStyleDeclaration_SetCssText(This->nsstyle, &text_str);
nsAString_Finish(&text_str);
if(NS_FAILED(nsres)) {
FIXME("SetCssStyle failed: %08x\n", nsres);
return E_FAIL;
}
return S_OK;
}
static HRESULT WINAPI HTMLCSSStyleDeclaration_get_cssText(IHTMLCSSStyleDeclaration *iface, BSTR *p)

View File

@ -355,7 +355,9 @@ static void _test_text_decoration(unsigned line, IHTMLStyle *style, const char *
static void test_set_csstext(IHTMLStyle *style)
{
IHTMLCSSStyleDeclaration *css_style;
VARIANT v;
BSTR str;
HRESULT hres;
test_style_set_csstext(style, "background-color: black;");
@ -365,6 +367,27 @@ static void test_set_csstext(IHTMLStyle *style)
ok(V_VT(&v) == VT_BSTR, "type failed: %d\n", V_VT(&v));
ok(!strcmp_wa(V_BSTR(&v), "black"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
VariantClear(&v);
hres = IHTMLStyle_QueryInterface(style, &IID_IHTMLCSSStyleDeclaration, (void**)&css_style);
ok(hres == S_OK || broken(!is_ie9plus && hres == E_NOINTERFACE),
"Could not get IHTMLCSSStyleDeclaration interface: %08x\n", hres);
if(FAILED(hres))
return;
str = a2bstr("float: left;");
hres = IHTMLCSSStyleDeclaration_put_cssText(css_style, str);
ok(hres == S_OK, "put_cssText failed: %08x\n", hres);
SysFreeString(str);
hres = IHTMLCSSStyleDeclaration_get_cssFloat(css_style, &str);
ok(hres == S_OK, "get_cssText failed: %08x\n", hres);
ok(!strcmp_wa(str, "left"), "cssFloat = %s\n", wine_dbgstr_w(str));
SysFreeString(str);
hres = IHTMLCSSStyleDeclaration_put_cssText(css_style, NULL);
ok(hres == S_OK, "put_cssText failed: %08x\n", hres);
IHTMLCSSStyleDeclaration_Release(css_style);
}
static void test_style2(IHTMLStyle2 *style2)