mshtml: Implement IHTMLStyle put_borderTopColor.
This commit is contained in:
parent
fcf8e164c3
commit
63fe5d8489
|
@ -351,8 +351,12 @@ HRESULT set_nsstyle_attr_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid,
|
||||||
|
|
||||||
static const WCHAR format[] = {'%','d',0};
|
static const WCHAR format[] = {'%','d',0};
|
||||||
static const WCHAR px_format[] = {'%','d','p','x',0};
|
static const WCHAR px_format[] = {'%','d','p','x',0};
|
||||||
|
static const WCHAR hex_format[] = {'#','%','0','6','x',0};
|
||||||
|
|
||||||
wsprintfW(str, flags&ATTR_FIX_PX ? px_format : format, V_I4(value));
|
if(flags & ATTR_HEX_INT)
|
||||||
|
wsprintfW(str, hex_format, V_I4(value));
|
||||||
|
else
|
||||||
|
wsprintfW(str, flags&ATTR_FIX_PX ? px_format : format, V_I4(value));
|
||||||
return set_nsstyle_attr(nsstyle, sid, str, flags & ~ATTR_FIX_PX);
|
return set_nsstyle_attr(nsstyle, sid, str, flags & ~ATTR_FIX_PX);
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
@ -1537,8 +1541,10 @@ static HRESULT WINAPI HTMLStyle_get_borderColor(IHTMLStyle *iface, BSTR *p)
|
||||||
static HRESULT WINAPI HTMLStyle_put_borderTopColor(IHTMLStyle *iface, VARIANT v)
|
static HRESULT WINAPI HTMLStyle_put_borderTopColor(IHTMLStyle *iface, VARIANT v)
|
||||||
{
|
{
|
||||||
HTMLStyle *This = impl_from_IHTMLStyle(iface);
|
HTMLStyle *This = impl_from_IHTMLStyle(iface);
|
||||||
FIXME("(%p)->(v%d)\n", This, V_VT(&v));
|
|
||||||
return E_NOTIMPL;
|
TRACE("(%p)->(v%d)\n", This, V_VT(&v));
|
||||||
|
|
||||||
|
return set_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_TOP_COLOR, &v, ATTR_HEX_INT);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI HTMLStyle_get_borderTopColor(IHTMLStyle *iface, VARIANT *p)
|
static HRESULT WINAPI HTMLStyle_get_borderTopColor(IHTMLStyle *iface, VARIANT *p)
|
||||||
|
|
|
@ -108,3 +108,4 @@ HRESULT get_nsstyle_attr_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid,
|
||||||
#define ATTR_FIX_PX 1
|
#define ATTR_FIX_PX 1
|
||||||
#define ATTR_FIX_URL 2
|
#define ATTR_FIX_URL 2
|
||||||
#define ATTR_STR_TO_INT 4
|
#define ATTR_STR_TO_INT 4
|
||||||
|
#define ATTR_HEX_INT 8
|
||||||
|
|
|
@ -5443,6 +5443,24 @@ static void test_default_style(IHTMLStyle *style)
|
||||||
ok(hres == S_OK, "put_letterSpacing: %08x\n", hres);
|
ok(hres == S_OK, "put_letterSpacing: %08x\n", hres);
|
||||||
VariantClear(&vDefault);
|
VariantClear(&vDefault);
|
||||||
|
|
||||||
|
/* borderTopColor */
|
||||||
|
hres = IHTMLStyle_get_borderTopColor(style, &vDefault);
|
||||||
|
ok(hres == S_OK, "get_borderTopColor: %08x\n", hres);
|
||||||
|
|
||||||
|
V_VT(&v) = VT_BSTR;
|
||||||
|
V_BSTR(&v) = a2bstr("red");
|
||||||
|
hres = IHTMLStyle_put_borderTopColor(style, v);
|
||||||
|
ok(hres == S_OK, "put_borderTopColor: %08x\n", hres);
|
||||||
|
VariantClear(&v);
|
||||||
|
|
||||||
|
hres = IHTMLStyle_get_borderTopColor(style, &v);
|
||||||
|
ok(hres == S_OK, "get_borderTopColor: %08x\n", hres);
|
||||||
|
ok(!strcmp_wa(V_BSTR(&v), "red"), "expecte red = %s\n", wine_dbgstr_w(V_BSTR(&v)));
|
||||||
|
VariantClear(&v);
|
||||||
|
|
||||||
|
hres = IHTMLStyle_put_borderTopColor(style, vDefault);
|
||||||
|
ok(hres == S_OK, "put_borderTopColor: %08x\n", hres);
|
||||||
|
|
||||||
hres = IHTMLStyle_QueryInterface(style, &IID_IHTMLStyle2, (void**)&style2);
|
hres = IHTMLStyle_QueryInterface(style, &IID_IHTMLStyle2, (void**)&style2);
|
||||||
ok(hres == S_OK, "Could not get IHTMLStyle2 iface: %08x\n", hres);
|
ok(hres == S_OK, "Could not get IHTMLStyle2 iface: %08x\n", hres);
|
||||||
if(SUCCEEDED(hres)) {
|
if(SUCCEEDED(hres)) {
|
||||||
|
|
Loading…
Reference in New Issue