Module: wine Branch: master Commit: 48cbc036a3f630f14241057411d70f88d72ce462 URL: http://source.winehq.org/git/wine.git/?a=commit;h=48cbc036a3f630f14241057411...
Author: Alistair Leslie-Hughes leslie_alistair@hotmail.com Date: Tue Mar 3 22:01:16 2009 +1100
mshtml: Implement IHTMLStyle_get_borderLeft.
---
dlls/mshtml/htmlstyle.c | 6 ++++-- dlls/mshtml/tests/dom.c | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 2 deletions(-)
diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index d7d4f50..96ab9a4 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -1414,8 +1414,10 @@ static HRESULT WINAPI HTMLStyle_put_borderLeft(IHTMLStyle *iface, BSTR v) static HRESULT WINAPI HTMLStyle_get_borderLeft(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_LEFT, p); }
static HRESULT WINAPI HTMLStyle_put_borderColor(IHTMLStyle *iface, BSTR v) diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index 4b13ed5..f09a78b 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -3395,6 +3395,40 @@ static void test_default_style(IHTMLStyle *style) ok(hres == S_OK, "put_borderColor failed: %08x\n", hres); SysFreeString(sDefault);
+ /* BorderLeft */ + hres = IHTMLStyle_get_borderLeft(style, &sDefault); + ok(hres == S_OK, "get_borderLeft failed: %08x\n", hres); + + str = a2bstr("thick dotted red"); + hres = IHTMLStyle_put_borderLeft(style, str); + ok(hres == S_OK, "put_borderLeft failed: %08x\n", hres); + SysFreeString(str); + + /* IHTMLStyle_get_borderLeft appears to have a bug where + it returns the first letter of the color. So we check + each style individually. + */ + V_BSTR(&v) = NULL; + hres = IHTMLStyle_get_borderLeftColor(style, &v); + todo_wine ok(hres == S_OK, "get_borderLeftColor failed: %08x\n", hres); + todo_wine ok(!strcmp_wa(V_BSTR(&v), "red"), "str=%s\n", dbgstr_w(V_BSTR(&v))); + VariantClear(&v); + + V_BSTR(&v) = NULL; + hres = IHTMLStyle_get_borderLeftWidth(style, &v); + todo_wine ok(hres == S_OK, "get_borderLeftWidth failed: %08x\n", hres); + todo_wine ok(!strcmp_wa(V_BSTR(&v), "thick"), "str=%s\n", dbgstr_w(V_BSTR(&v))); + VariantClear(&v); + + hres = IHTMLStyle_get_borderLeftStyle(style, &str); + ok(hres == S_OK, "get_borderLeftStyle failed: %08x\n", hres); + ok(!strcmp_wa(str, "dotted"), "str=%s\n", dbgstr_w(str)); + SysFreeString(str); + + hres = IHTMLStyle_put_borderLeft(style, sDefault); + ok(hres == S_OK, "put_borderLeft 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)) {