mshtml: Implement IHTMLStyle get/put posWidth.

This commit is contained in:
Alistair Leslie-Hughes 2008-12-08 21:08:17 +11:00 committed by Alexandre Julliard
parent 480e697035
commit b6fa5a2100
2 changed files with 28 additions and 4 deletions

View File

@ -1909,15 +1909,25 @@ static HRESULT WINAPI HTMLStyle_get_posLeft(IHTMLStyle *iface, float *p)
static HRESULT WINAPI HTMLStyle_put_posWidth(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_WIDTH, v);
}
static HRESULT WINAPI HTMLStyle_get_posWidth(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;
if(get_nsstyle_pos(This, STYLEID_WIDTH, p) != S_OK)
*p = 0.0f;
return S_OK;
}
static HRESULT WINAPI HTMLStyle_put_posHeight(IHTMLStyle *iface, float v)

View File

@ -2340,12 +2340,26 @@ static void test_default_style(IHTMLStyle *style)
ok(hres == S_OK, "get_textDecorationLineThrough failed: %08x\n", hres);
ok(b == VARIANT_FALSE, "textDecorationLineThrough = %x\n", b);
hres = IHTMLStyle_get_posWidth(style, NULL);
ok(hres == E_POINTER, "get_posWidth failed: %08x\n", hres);
hres = IHTMLStyle_get_posWidth(style, &f);
ok(hres == S_OK, "get_posWidth failed: %08x\n", hres);
ok(f == 0.0f, "f = %f\n", f);
V_VT(&v) = VT_EMPTY;
hres = IHTMLStyle_get_width(style, &v);
ok(hres == S_OK, "get_width 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)=%p\n", V_BSTR(&v));
hres = IHTMLStyle_put_posWidth(style, 2.2);
ok(hres == S_OK, "get_posWidth failed: %08x\n", hres);
hres = IHTMLStyle_get_posWidth(style, &f);
ok(hres == S_OK, "get_posWidth failed: %08x\n", hres);
ok(f == 2.0f, "f = %f\n", f);
V_VT(&v) = VT_BSTR;
V_BSTR(&v) = a2bstr("auto");
hres = IHTMLStyle_put_width(style, v);