mshtml: Add IHTMLStyle5::maxWidth property implementation.

This commit is contained in:
Chen Yuan 2014-11-05 01:32:42 +08:00 committed by Alexandre Julliard
parent 743d80fea5
commit 94209192e7
4 changed files with 44 additions and 4 deletions

View File

@ -144,6 +144,8 @@ static const WCHAR attrMarginRight[] =
{'m','a','r','g','i','n','-','r','i','g','h','t',0};
static const WCHAR attrMarginTop[] =
{'m','a','r','g','i','n','-','t','o','p',0};
static const WCHAR attrMaxWidth[] =
{'m','a','x','-','w','i','d','t','h',0};
static const WCHAR attrMinHeight[] =
{'m','i','n','-','h','e','i','g','h','t',0};
static const WCHAR attrMinWidth[] =
@ -264,6 +266,7 @@ static const style_tbl_entry_t style_tbl[] = {
{attrMarginLeft, DISPID_IHTMLSTYLE_MARGINLEFT},
{attrMarginRight, DISPID_IHTMLSTYLE_MARGINRIGHT},
{attrMarginTop, DISPID_IHTMLSTYLE_MARGINTOP},
{attrMaxWidth, DISPID_IHTMLSTYLE5_MAXWIDTH},
{attrMinHeight, DISPID_IHTMLSTYLE4_MINHEIGHT},
{attrMinWidth, DISPID_IHTMLSTYLE5_MINWIDTH},
{attrOutline, DISPID_IHTMLSTYLE6_OUTLINE},

View File

@ -87,6 +87,7 @@ typedef enum {
STYLEID_MARGIN_LEFT,
STYLEID_MARGIN_RIGHT,
STYLEID_MARGIN_TOP,
STYLEID_MAX_WIDTH,
STYLEID_MIN_HEIGHT,
STYLEID_MIN_WIDTH,
STYLEID_OUTLINE,

View File

@ -562,15 +562,19 @@ static HRESULT WINAPI HTMLStyle5_get_minWidth(IHTMLStyle5 *iface, VARIANT *p)
static HRESULT WINAPI HTMLStyle5_put_maxWidth(IHTMLStyle5 *iface, VARIANT v)
{
HTMLStyle *This = impl_from_IHTMLStyle5(iface);
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
return E_NOTIMPL;
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
return set_nsstyle_attr_var(This->nsstyle, STYLEID_MAX_WIDTH, &v, ATTR_FIX_PX);
}
static HRESULT WINAPI HTMLStyle5_get_maxWidth(IHTMLStyle5 *iface, VARIANT *p)
{
HTMLStyle *This = impl_from_IHTMLStyle5(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
TRACE("(%p)->(%p)\n", This, p);
return get_nsstyle_attr_var(This->nsstyle, STYLEID_MAX_WIDTH, p, 0);
}
static const IHTMLStyle5Vtbl HTMLStyle5Vtbl = {

View File

@ -548,6 +548,38 @@ static void test_style5(IHTMLStyle5 *style5)
hres = IHTMLStyle5_put_minWidth(style5, vdefault);
ok(hres == S_OK, "put_minWidth failed: %08x\n", hres);
VariantClear(&vdefault);
/* maxWidth */
hres = IHTMLStyle5_get_maxWidth(style5, &vdefault);
ok(hres == S_OK, "get_maxWidth failed: %08x\n", hres);
V_VT(&v) = VT_BSTR;
V_BSTR(&v) = a2bstr("200px");
hres = IHTMLStyle5_put_maxWidth(style5, v);
ok(hres == S_OK, "put_maxWidth failed: %08x\n", hres);
VariantClear(&v);
hres = IHTMLStyle5_get_maxWidth(style5, &v);
ok(hres == S_OK, "get_maxWidth failed: %08x\n", hres);
ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n",V_VT(&v));
ok(!strcmp_wa(V_BSTR(&v), "200px"), "expect 200px got (%s)\n", wine_dbgstr_w(V_BSTR(&v)));
VariantClear(&v);
V_VT(&v) = VT_BSTR;
V_BSTR(&v) = a2bstr("70%");
hres = IHTMLStyle5_put_maxWidth(style5, v);
ok(hres == S_OK, "put_maxWidth failed: %08x\n", hres);
VariantClear(&v);
hres = IHTMLStyle5_get_maxWidth(style5, &v);
ok(hres == S_OK, "get maxWidth failed: %08x\n", hres);
ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
ok(!strcmp_wa(V_BSTR(&v), "70%"), "expect 70%% got (%s)\n", wine_dbgstr_w(V_BSTR(&v)));
VariantClear(&v);
hres = IHTMLStyle5_put_maxWidth(style5,vdefault);
ok(hres == S_OK, "put_maxWidth failed: %08x\n", hres);
VariantClear(&vdefault);
}
static void test_style6(IHTMLStyle6 *style)