Commit 173f7f57 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Added IHTMLStyle::[put|get]_top implementation.

parent d7e693cd
...@@ -69,6 +69,8 @@ static const WCHAR attrPaddingLeft[] = ...@@ -69,6 +69,8 @@ static const WCHAR attrPaddingLeft[] =
{'p','a','d','d','i','n','g','-','l','e','f','t',0}; {'p','a','d','d','i','n','g','-','l','e','f','t',0};
static const WCHAR attrTextDecoration[] = static const WCHAR attrTextDecoration[] =
{'t','e','x','t','-','d','e','c','o','r','a','t','i','o','n',0}; {'t','e','x','t','-','d','e','c','o','r','a','t','i','o','n',0};
static const WCHAR attrTop[] =
{'t','o','p',0};
static const WCHAR attrVisibility[] = static const WCHAR attrVisibility[] =
{'v','i','s','i','b','i','l','i','t','y',0}; {'v','i','s','i','b','i','l','i','t','y',0};
static const WCHAR attrWidth[] = static const WCHAR attrWidth[] =
...@@ -93,6 +95,7 @@ static const LPCWSTR style_strings[] = { ...@@ -93,6 +95,7 @@ static const LPCWSTR style_strings[] = {
attrMarginRight, attrMarginRight,
attrPaddingLeft, attrPaddingLeft,
attrTextDecoration, attrTextDecoration,
attrTop,
attrVisibility, attrVisibility,
attrWidth, attrWidth,
}; };
...@@ -1451,15 +1454,35 @@ static HRESULT WINAPI HTMLStyle_get_whiteSpace(IHTMLStyle *iface, BSTR *p) ...@@ -1451,15 +1454,35 @@ static HRESULT WINAPI HTMLStyle_get_whiteSpace(IHTMLStyle *iface, BSTR *p)
static HRESULT WINAPI HTMLStyle_put_top(IHTMLStyle *iface, VARIANT v) static HRESULT WINAPI HTMLStyle_put_top(IHTMLStyle *iface, VARIANT v)
{ {
HTMLStyle *This = HTMLSTYLE_THIS(iface); HTMLStyle *This = HTMLSTYLE_THIS(iface);
FIXME("(%p)->(v%d)\n", This, V_VT(&v));
return E_NOTIMPL; TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
switch(V_VT(&v)) {
case VT_BSTR:
return set_style_attr(This, STYLEID_TOP, V_BSTR(&v), 0);
default:
FIXME("unimplemented vt %d\n", V_VT(&v));
return E_NOTIMPL;
}
return S_OK;
} }
static HRESULT WINAPI HTMLStyle_get_top(IHTMLStyle *iface, VARIANT *p) static HRESULT WINAPI HTMLStyle_get_top(IHTMLStyle *iface, VARIANT *p)
{ {
HTMLStyle *This = HTMLSTYLE_THIS(iface); HTMLStyle *This = HTMLSTYLE_THIS(iface);
FIXME("(%p)->(%p)\n", This, p); BSTR ret;
return E_NOTIMPL; HRESULT hres;
TRACE("(%p)->(%p)\n", This, p);
hres = get_style_attr(This, STYLEID_TOP, &ret);
if(FAILED(hres))
return hres;
V_VT(p) = VT_BSTR;
V_BSTR(p) = ret;
return S_OK;
} }
static HRESULT WINAPI HTMLStyle_put_left(IHTMLStyle *iface, VARIANT v) static HRESULT WINAPI HTMLStyle_put_left(IHTMLStyle *iface, VARIANT v)
......
...@@ -49,6 +49,7 @@ typedef enum { ...@@ -49,6 +49,7 @@ typedef enum {
STYLEID_MARGIN_RIGHT, STYLEID_MARGIN_RIGHT,
STYLEID_PADDING_LEFT, STYLEID_PADDING_LEFT,
STYLEID_TEXT_DECORATION, STYLEID_TEXT_DECORATION,
STYLEID_TOP,
STYLEID_VISIBILITY, STYLEID_VISIBILITY,
STYLEID_WIDTH STYLEID_WIDTH
} styleid_t; } styleid_t;
......
...@@ -2118,6 +2118,26 @@ static void test_default_style(IHTMLStyle *style) ...@@ -2118,6 +2118,26 @@ static void test_default_style(IHTMLStyle *style)
ok(!strcmp_wa(V_BSTR(&v), "3px"), "V_BSTR(v) = %s\n", dbgstr_w(V_BSTR(&v))); ok(!strcmp_wa(V_BSTR(&v), "3px"), "V_BSTR(v) = %s\n", dbgstr_w(V_BSTR(&v)));
VariantClear(&v); VariantClear(&v);
V_VT(&v) = VT_EMPTY;
hres = IHTMLStyle_get_top(style, &v);
ok(hres == S_OK, "get_top failed: %08x\n", hres);
ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
ok(!V_BSTR(&v), "V_BSTR(v) != NULL\n");
VariantClear(&v);
V_VT(&v) = VT_BSTR;
V_BSTR(&v) = a2bstr("3px");
hres = IHTMLStyle_put_top(style, v);
ok(hres == S_OK, "put_top failed: %08x\n", hres);
VariantClear(&v);
V_VT(&v) = VT_EMPTY;
hres = IHTMLStyle_get_top(style, &v);
ok(hres == S_OK, "get_top failed: %08x\n", hres);
ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
ok(!strcmp_wa(V_BSTR(&v), "3px"), "V_BSTR(v) = %s\n", dbgstr_w(V_BSTR(&v)));
VariantClear(&v);
str = (void*)0xdeadbeef; str = (void*)0xdeadbeef;
hres = IHTMLStyle_get_cursor(style, &str); hres = IHTMLStyle_get_cursor(style, &str);
ok(hres == S_OK, "get_cursor failed: %08x\n", hres); ok(hres == S_OK, "get_cursor failed: %08x\n", hres);
......
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