Commit 78b8ee54 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Added IHTMLCSSStyleDeclaration::get_cssText implementation.

parent 45f8c03c
......@@ -2472,26 +2472,10 @@ static HRESULT WINAPI HTMLStyle_put_cssText(IHTMLStyle *iface, BSTR v)
static HRESULT WINAPI HTMLStyle_get_cssText(IHTMLStyle *iface, BSTR *p)
{
HTMLStyle *This = impl_from_IHTMLStyle(iface);
nsAString text_str;
nsresult nsres;
TRACE("(%p)->(%p)\n", This, p);
/* FIXME: Gecko style formatting is different than IE (uppercase). */
nsAString_Init(&text_str, NULL);
nsres = nsIDOMCSSStyleDeclaration_GetCssText(This->nsstyle, &text_str);
if(NS_SUCCEEDED(nsres)) {
const PRUnichar *text;
nsAString_GetData(&text_str, &text);
*p = *text ? SysAllocString(text) : NULL;
}else {
FIXME("GetCssStyle failed: %08x\n", nsres);
*p = NULL;
}
nsAString_Finish(&text_str);
return S_OK;
return IHTMLCSSStyleDeclaration_get_cssText(&This->IHTMLCSSStyleDeclaration_iface, p);
}
static HRESULT WINAPI HTMLStyle_put_pixelTop(IHTMLStyle *iface, LONG v)
......@@ -5802,8 +5786,15 @@ static HRESULT WINAPI HTMLCSSStyleDeclaration_put_cssText(IHTMLCSSStyleDeclarati
static HRESULT WINAPI HTMLCSSStyleDeclaration_get_cssText(IHTMLCSSStyleDeclaration *iface, BSTR *p)
{
HTMLStyle *This = impl_from_IHTMLCSSStyleDeclaration(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
nsAString text_str;
nsresult nsres;
TRACE("(%p)->(%p)\n", This, p);
/* NOTE: Quicks mode should use different formatting (uppercase, no ';' at the end of rule). */
nsAString_Init(&text_str, NULL);
nsres = nsIDOMCSSStyleDeclaration_GetCssText(This->nsstyle, &text_str);
return return_nsstr(nsres, &text_str, p);
}
static HRESULT WINAPI HTMLCSSStyleDeclaration_put_cursor(IHTMLCSSStyleDeclaration *iface, BSTR v)
......
......@@ -380,10 +380,17 @@ static void test_set_csstext(IHTMLStyle *style)
SysFreeString(str);
hres = IHTMLCSSStyleDeclaration_get_cssFloat(css_style, &str);
ok(hres == S_OK, "get_cssText failed: %08x\n", hres);
ok(hres == S_OK, "get_cssFloat failed: %08x\n", hres);
ok(!strcmp_wa(str, "left"), "cssFloat = %s\n", wine_dbgstr_w(str));
SysFreeString(str);
hres = IHTMLCSSStyleDeclaration_get_cssText(css_style, &str);
ok(hres == S_OK, "get_cssText failed: %08x\n", hres);
todo_wine_if(compat_mode < COMPAT_IE9)
ok(!strcmp_wa(str, compat_mode >= COMPAT_IE9 ? "float: left;" : "FLOAT: 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);
......
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