mshtml: Implement IHTMLStyle get/put posTop.

This commit is contained in:
Alistair Leslie-Hughes 2008-11-11 22:36:39 +11:00 committed by Alexandre Julliard
parent 1425b1b9ef
commit 71eac71e16
2 changed files with 31 additions and 4 deletions

View File

@ -1845,15 +1845,22 @@ static HRESULT WINAPI HTMLStyle_get_pixelHeight(IHTMLStyle *iface, long *p)
static HRESULT WINAPI HTMLStyle_put_posTop(IHTMLStyle *iface, float v)
{
HTMLStyle *This = HTMLSTYLE_THIS(iface);
FIXME("(%p)->()\n", This);
return E_NOTIMPL;
TRACE("(%p)->(%f)\n", This, v);
return set_style_pos(This, STYLEID_TOP, v);
}
static HRESULT WINAPI HTMLStyle_get_posTop(IHTMLStyle *iface, float *p)
{
HTMLStyle *This = HTMLSTYLE_THIS(iface);
FIXME("(%p)->()\n", This);
return E_NOTIMPL;
TRACE("(%p)->(%p)\n", This, p);
if(!p)
return E_POINTER;
return get_nsstyle_pos(This, STYLEID_TOP, p);
}
static HRESULT WINAPI HTMLStyle_put_posLeft(IHTMLStyle *iface, float v)

View File

@ -2445,6 +2445,22 @@ static void test_default_style(IHTMLStyle *style)
ok(!V_BSTR(&v), "V_BSTR(v) != NULL\n");
VariantClear(&v);
/* Test posTop */
hres = IHTMLStyle_get_posTop(style, NULL);
ok(hres == E_POINTER, "get_left failed: %08x\n", hres);
f = 1.0f;
hres = IHTMLStyle_get_posTop(style, &f);
ok(hres == S_OK, "get_left failed: %08x\n", hres);
ok(f == 0.0, "expected 0.0 got %f\n", f);
hres = IHTMLStyle_put_posTop(style, 4.9f);
ok(hres == S_OK, "get_left failed: %08x\n", hres);
hres = IHTMLStyle_get_posTop(style, &f);
ok(hres == S_OK, "get_left failed: %08x\n", hres);
ok(f == 4.0, "expected 4.0 got %f\n", f);
V_VT(&v) = VT_BSTR;
V_BSTR(&v) = a2bstr("3px");
hres = IHTMLStyle_put_top(style, v);
@ -2458,6 +2474,10 @@ static void test_default_style(IHTMLStyle *style)
ok(!strcmp_wa(V_BSTR(&v), "3px"), "V_BSTR(v) = %s\n", dbgstr_w(V_BSTR(&v)));
VariantClear(&v);
hres = IHTMLStyle_get_posTop(style, &f);
ok(hres == S_OK, "get_left failed: %08x\n", hres);
ok(f == 3.0, "expected 3.0 got %f\n", f);
V_VT(&v) = VT_NULL;
hres = IHTMLStyle_put_top(style, v);
ok(hres == S_OK, "put_top failed: %08x\n", hres);