Alistair Leslie-Hughes : mshtml: Implement IHTMLStyle get/put borderColor.
Alexandre Julliard
julliard at winehq.org
Wed Mar 4 09:00:53 CST 2009
Module: wine
Branch: master
Commit: 73241dfe845e699dbf09e1e627925e3fa045f3a6
URL: http://source.winehq.org/git/wine.git/?a=commit;h=73241dfe845e699dbf09e1e627925e3fa045f3a6
Author: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Date: Tue Mar 3 21:04:49 2009 +1100
mshtml: Implement IHTMLStyle get/put borderColor.
---
dlls/mshtml/htmlstyle.c | 15 +++++++++++----
dlls/mshtml/htmlstyle.h | 1 +
dlls/mshtml/tests/dom.c | 18 ++++++++++++++++++
3 files changed, 30 insertions(+), 4 deletions(-)
diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c
index 90ff089..e571ac9 100644
--- a/dlls/mshtml/htmlstyle.c
+++ b/dlls/mshtml/htmlstyle.c
@@ -47,6 +47,8 @@ static const WCHAR attrBorder[] =
{'b','o','r','d','e','r',0};
static const WCHAR attrBorderBottomStyle[] =
{'b','o','r','d','e','r','-','b','o','t','t','o','m','-','s','t','y','l','e',0};
+static const WCHAR attrBorderColor[] =
+ {'b','o','r','d','e','r','-','c','o','l','o','r',0};
static const WCHAR attrBorderLeft[] =
{'b','o','r','d','e','r','-','l','e','f','t',0};
static const WCHAR attrBorderLeftStyle[] =
@@ -118,6 +120,7 @@ static const struct{
{attrBackgroundRepeat, DISPID_IHTMLSTYLE_BACKGROUNDREPEAT},
{attrBorder, DISPID_IHTMLSTYLE_BORDER},
{attrBorderBottomStyle, DISPID_IHTMLSTYLE_BORDERBOTTOMSTYLE},
+ {attrBorderColor, DISPID_IHTMLSTYLE_BORDERCOLOR},
{attrBorderLeft, DISPID_IHTMLSTYLE_BORDERLEFT},
{attrBorderLeftStyle, DISPID_IHTMLSTYLE_BORDERLEFTSTYLE},
{attrBorderRightStyle, DISPID_IHTMLSTYLE_BORDERRIGHTSTYLE},
@@ -1415,15 +1418,19 @@ static HRESULT WINAPI HTMLStyle_get_borderLeft(IHTMLStyle *iface, BSTR *p)
static HRESULT WINAPI HTMLStyle_put_borderColor(IHTMLStyle *iface, BSTR v)
{
HTMLStyle *This = HTMLSTYLE_THIS(iface);
- FIXME("(%p)->(%s)\n", This, debugstr_w(v));
- return E_NOTIMPL;
+
+ TRACE("(%p)->(%s)\n", This, debugstr_w(v));
+
+ return set_style_attr(This, STYLEID_BORDER_COLOR, v, 0);
}
static HRESULT WINAPI HTMLStyle_get_borderColor(IHTMLStyle *iface, BSTR *p)
{
HTMLStyle *This = HTMLSTYLE_THIS(iface);
- FIXME("(%p)->(%p)\n", This, p);
- return E_NOTIMPL;
+
+ TRACE("(%p)->(%p)\n", This, p);
+
+ return get_style_attr(This, STYLEID_BORDER_COLOR, p);
}
static HRESULT WINAPI HTMLStyle_put_borderTopColor(IHTMLStyle *iface, VARIANT v)
diff --git a/dlls/mshtml/htmlstyle.h b/dlls/mshtml/htmlstyle.h
index 73c7c7d..8922448 100644
--- a/dlls/mshtml/htmlstyle.h
+++ b/dlls/mshtml/htmlstyle.h
@@ -41,6 +41,7 @@ typedef enum {
STYLEID_BACKGROUND_REPEAT,
STYLEID_BORDER,
STYLEID_BORDER_BOTTOM_STYLE,
+ STYLEID_BORDER_COLOR,
STYLEID_BORDER_LEFT,
STYLEID_BORDER_LEFT_STYLE,
STYLEID_BORDER_RIGHT_STYLE,
diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c
index 6674024..8ef7bed 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -3319,6 +3319,24 @@ static void test_default_style(IHTMLStyle *style)
ok(hres == S_OK, "put_backgroundRepeat failed: %08x\n", hres);
SysFreeString(sDefault);
+ /* BorderColor */
+ hres = IHTMLStyle_get_borderColor(style, &sDefault);
+ ok(hres == S_OK, "get_borderColor failed: %08x\n", hres);
+
+ str = a2bstr("red green red blue");
+ hres = IHTMLStyle_put_borderColor(style, str);
+ ok(hres == S_OK, "put_borderColor failed: %08x\n", hres);
+ SysFreeString(str);
+
+ hres = IHTMLStyle_get_borderColor(style, &str);
+ ok(hres == S_OK, "get_borderColor failed: %08x\n", hres);
+ ok(!strcmp_wa(str, "red green red blue"), "str=%s\n", dbgstr_w(str));
+ SysFreeString(str);
+
+ hres = IHTMLStyle_put_borderColor(style, sDefault);
+ ok(hres == S_OK, "put_borderColor failed: %08x\n", hres);
+ SysFreeString(sDefault);
+
hres = IHTMLStyle_QueryInterface(style, &IID_IHTMLStyle2, (void**)&style2);
ok(hres == S_OK, "Could not get IHTMLStyle2 iface: %08x\n", hres);
if(SUCCEEDED(hres)) {
More information about the wine-cvs
mailing list