mshtml: Added IHTMLStyle6::outline property implementation.

This commit is contained in:
Jacek Caban 2013-09-30 16:05:34 +02:00 committed by Alexandre Julliard
parent 93f9d824eb
commit 6d13dd697c
4 changed files with 53 additions and 5 deletions

View File

@ -135,6 +135,8 @@ static const WCHAR attrMarginTop[] =
{'m','a','r','g','i','n','-','t','o','p',0};
static const WCHAR attrMinHeight[] =
{'m','i','n','-','h','e','i','g','h','t',0};
static const WCHAR attrOutline[] =
{'o','u','t','l','i','n','e',0};
static const WCHAR attrOverflow[] =
{'o','v','e','r','f','l','o','w',0};
static const WCHAR attrOverflowX[] =
@ -241,6 +243,7 @@ static const style_tbl_entry_t style_tbl[] = {
{attrMarginRight, DISPID_IHTMLSTYLE_MARGINRIGHT},
{attrMarginTop, DISPID_IHTMLSTYLE_MARGINTOP},
{attrMinHeight, DISPID_IHTMLSTYLE4_MINHEIGHT},
{attrOutline, DISPID_IHTMLSTYLE6_OUTLINE},
{attrOverflow, DISPID_IHTMLSTYLE_OVERFLOW},
{attrOverflowX, DISPID_IHTMLSTYLE2_OVERFLOWX},
{attrOverflowY, DISPID_IHTMLSTYLE2_OVERFLOWY},
@ -464,7 +467,7 @@ static HRESULT nsstyle_to_bstr(const WCHAR *val, DWORD flags, BSTR *p)
DWORD len;
if(!*val) {
*p = NULL;
*p = (flags & ATTR_NO_NULL) ? SysAllocStringLen(NULL, 0) : NULL;
return S_OK;
}

View File

@ -83,6 +83,7 @@ typedef enum {
STYLEID_MARGIN_RIGHT,
STYLEID_MARGIN_TOP,
STYLEID_MIN_HEIGHT,
STYLEID_OUTLINE,
STYLEID_OVERFLOW,
STYLEID_OVERFLOW_X,
STYLEID_OVERFLOW_Y,
@ -123,3 +124,4 @@ HRESULT get_nsstyle_attr_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid,
#define ATTR_STR_TO_INT 0x0004
#define ATTR_HEX_INT 0x0008
#define ATTR_REMOVE_COMMA 0x0010
#define ATTR_NO_NULL 0x0020

View File

@ -702,15 +702,19 @@ static HRESULT WINAPI HTMLStyle6_get_counterReset(IHTMLStyle6 *iface, BSTR *p)
static HRESULT WINAPI HTMLStyle6_put_outline(IHTMLStyle6 *iface, BSTR v)
{
HTMLStyle *This = impl_from_IHTMLStyle6(iface);
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
return E_NOTIMPL;
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
return set_nsstyle_attr(This->nsstyle, STYLEID_OUTLINE, v, 0);
}
static HRESULT WINAPI HTMLStyle6_get_outline(IHTMLStyle6 *iface, BSTR *p)
{
HTMLStyle *This = impl_from_IHTMLStyle6(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
TRACE("(%p)->(%p)\n", This, p);
return get_nsstyle_attr(This->nsstyle, STYLEID_OUTLINE, p, ATTR_NO_NULL);
}
static HRESULT WINAPI HTMLStyle6_put_outlineWidth(IHTMLStyle6 *iface, VARIANT v)

View File

@ -37,6 +37,13 @@ static int strcmp_wa(LPCWSTR strw, const char *stra)
return lstrcmpA(stra, buf);
}
static BOOL wstr_contains(const WCHAR *strw, const char *stra)
{
CHAR buf[512];
WideCharToMultiByte(CP_ACP, 0, strw, -1, buf, sizeof(buf), NULL, NULL);
return strstr(buf, stra) != NULL;
}
static BSTR a2bstr(const char *str)
{
BSTR ret;
@ -464,11 +471,35 @@ static void test_style4(IHTMLStyle4 *style4)
VariantClear(&vdefault);
}
static void test_style6(IHTMLStyle6 *style)
{
BSTR str;
HRESULT hres;
str = (void*)0xdeadbeef;
hres = IHTMLStyle6_get_outline(style, &str);
ok(hres == S_OK, "get_outline failed: %08x\n", hres);
ok(str && !*str, "outline = %s\n", wine_dbgstr_w(str));
SysFreeString(str);
str = a2bstr("1px");
hres = IHTMLStyle6_put_outline(style, str);
ok(hres == S_OK, "put_outline failed: %08x\n", hres);
SysFreeString(str);
str = (void*)0xdeadbeef;
hres = IHTMLStyle6_get_outline(style, &str);
ok(hres == S_OK, "get_outline failed: %08x\n", hres);
ok(wstr_contains(str, "1px"), "outline = %s\n", wine_dbgstr_w(str));
SysFreeString(str);
}
static void test_body_style(IHTMLStyle *style)
{
IHTMLStyle2 *style2;
IHTMLStyle3 *style3;
IHTMLStyle4 *style4;
IHTMLStyle6 *style6;
VARIANT_BOOL b;
VARIANT v;
BSTR str;
@ -2064,6 +2095,14 @@ static void test_body_style(IHTMLStyle *style)
test_style4(style4);
IHTMLStyle4_Release(style4);
}
hres = IHTMLStyle_QueryInterface(style, &IID_IHTMLStyle6, (void**)&style6);
if(SUCCEEDED(hres)) {
test_style6(style6);
IHTMLStyle6_Release(style6);
}else {
win_skip("IHTMLStyle6 not available\n");
}
}
#define test_style_filter(a,b) _test_style_filter(__LINE__,a,b)