mshtml: Added IHTMLCSSStyleDeclaration::opacity property implementation.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2018-09-06 16:15:11 +02:00 committed by Alexandre Julliard
parent 6ebfbcc687
commit 042fbbc5f3
3 changed files with 42 additions and 4 deletions

View File

@ -156,6 +156,8 @@ static const WCHAR min_heightW[] =
{'m','i','n','-','h','e','i','g','h','t',0};
static const WCHAR min_widthW[] =
{'m','i','n','-','w','i','d','t','h',0};
static const WCHAR opacityW[] =
{'o','p','a','c','i','t','y',0};
static const WCHAR outlineW[] =
{'o','u','t','l','i','n','e',0};
static const WCHAR overflowW[] =
@ -393,6 +395,7 @@ static const style_tbl_entry_t style_tbl[] = {
{max_widthW, DISPID_IHTMLSTYLE5_MAXWIDTH, ATTR_FIX_PX},
{min_heightW, DISPID_IHTMLSTYLE4_MINHEIGHT},
{min_widthW, DISPID_IHTMLSTYLE5_MINWIDTH, ATTR_FIX_PX},
{opacityW, DISPID_UNKNOWN},
{outlineW, DISPID_IHTMLSTYLE6_OUTLINE, ATTR_NO_NULL},
{overflowW, DISPID_IHTMLSTYLE_OVERFLOW, 0, overflow_values},
{overflow_xW, DISPID_IHTMLSTYLE2_OVERFLOWX},
@ -6796,15 +6799,15 @@ static HRESULT WINAPI HTMLCSSStyleDeclaration_get_fontStretch(IHTMLCSSStyleDecla
static HRESULT WINAPI HTMLCSSStyleDeclaration_put_opacity(IHTMLCSSStyleDeclaration *iface, VARIANT v)
{
HTMLStyle *This = impl_from_IHTMLCSSStyleDeclaration(iface);
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
return E_NOTIMPL;
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
return set_style_property_var(This, STYLEID_OPACITY, &v);
}
static HRESULT WINAPI HTMLCSSStyleDeclaration_get_opacity(IHTMLCSSStyleDeclaration *iface, VARIANT *p)
{
HTMLStyle *This = impl_from_IHTMLCSSStyleDeclaration(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
TRACE("(%p)->(%p)\n", This, p);
return get_style_property_var(This, STYLEID_OPACITY, p);
}
static HRESULT WINAPI HTMLCSSStyleDeclaration_put_clipPath(IHTMLCSSStyleDeclaration *iface, BSTR v)

View File

@ -94,6 +94,7 @@ typedef enum {
STYLEID_MAX_WIDTH,
STYLEID_MIN_HEIGHT,
STYLEID_MIN_WIDTH,
STYLEID_OPACITY,
STYLEID_OUTLINE,
STYLEID_OVERFLOW,
STYLEID_OVERFLOW_X,

View File

@ -738,6 +738,7 @@ static void test_style6(IHTMLStyle6 *style)
static void test_css_style_declaration(IHTMLCSSStyleDeclaration *css_style)
{
VARIANT v;
BSTR str;
HRESULT hres;
@ -754,6 +755,31 @@ static void test_css_style_declaration(IHTMLCSSStyleDeclaration *css_style)
ok(hres == S_OK, "get_backgroundClip failed: %08x\n", hres);
ok(!strcmp_wa(str, "border-box"), "backgroundClip = %s\n", wine_dbgstr_w(str));
SysFreeString(str);
hres = IHTMLCSSStyleDeclaration_get_opacity(css_style, &v);
ok(hres == S_OK, "get_opacity failed: %08x\n", hres);
test_var_bstr(&v, NULL);
V_VT(&v) = VT_I4;
V_I4(&v) = 0;
hres = IHTMLCSSStyleDeclaration_put_opacity(css_style, v);
ok(hres == S_OK, "put_opacity failed: %08x\n", hres);
hres = IHTMLCSSStyleDeclaration_get_opacity(css_style, &v);
ok(hres == S_OK, "get_opacity failed: %08x\n", hres);
test_var_bstr(&v, "0");
VariantClear(&v);
V_VT(&v) = VT_BSTR;
V_BSTR(&v) = a2bstr("1");
hres = IHTMLCSSStyleDeclaration_put_opacity(css_style, v);
ok(hres == S_OK, "put_opacity failed: %08x\n", hres);
VariantClear(&v);
hres = IHTMLCSSStyleDeclaration_get_opacity(css_style, &v);
ok(hres == S_OK, "get_opacity failed: %08x\n", hres);
test_var_bstr(&v, "1");
VariantClear(&v);
}
static void test_body_style(IHTMLStyle *style)
@ -1790,6 +1816,14 @@ static void test_body_style(IHTMLStyle *style)
ok(hres == S_OK, "put_filter failed: %08x\n", hres);
SysFreeString(str);
hres = IHTMLStyle_put_filter(style, NULL);
ok(hres == S_OK, "put_filter failed: %08x\n", hres);
str = (void*)0xdeadbeef;
hres = IHTMLStyle_get_filter(style, &str);
ok(hres == S_OK, "get_filter failed: %08x\n", hres);
ok(!str, "filter != NULL\n");
V_VT(&v) = VT_EMPTY;
hres = IHTMLStyle_get_zIndex(style, &v);
ok(hres == S_OK, "get_zIndex failed: %08x\n", hres);