Commit 50126adf authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Added IHTMLStyle::get_cssText implementation.

parent 76d667ca
......@@ -2063,8 +2063,26 @@ static HRESULT WINAPI HTMLStyle_put_cssText(IHTMLStyle *iface, BSTR v)
static HRESULT WINAPI HTMLStyle_get_cssText(IHTMLStyle *iface, BSTR *p)
{
HTMLStyle *This = HTMLSTYLE_THIS(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
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;
}
static HRESULT WINAPI HTMLStyle_put_pixelTop(IHTMLStyle *iface, long v)
......
......@@ -1927,6 +1927,22 @@ static void _test_border_styles(unsigned line, IHTMLStyle *pStyle, BSTR Name)
}
}
#define test_style_csstext(s,t) _test_style_csstext(__LINE__,s,t)
static void _test_style_csstext(unsigned line, IHTMLStyle *style, const char *extext)
{
BSTR text = (void*)0xdeadbeef;
HRESULT hres;
hres = IHTMLStyle_get_cssText(style, &text);
ok_(__FILE__,line)(hres == S_OK, "get_cssText failed: %08x\n", hres);
if(extext)
ok_(__FILE__,line)(!strcmp_wa(text, extext), "cssText = %s\n", dbgstr_w(text));
else
ok_(__FILE__,line)(!text, "cssText = %s\n", dbgstr_w(text));
SysFreeString(text);
}
static void test_elem_col_item(IHTMLElementCollection *col, LPCWSTR n,
const elem_type_t *elem_types, long len)
{
......@@ -2608,6 +2624,8 @@ static void test_default_style(IHTMLStyle *style)
test_disp((IUnknown*)style, &DIID_DispHTMLStyle);
test_ifaces((IUnknown*)style, style_iids);
test_style_csstext(style, NULL);
hres = IHTMLStyle_get_position(style, &str);
ok(hres == S_OK, "get_position failed: %08x\n", hres);
ok(!str, "str=%s\n", dbgstr_w(str));
......
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