mshtml: Support VT_R8 in variant_to_nsstr.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2019-04-19 16:37:32 +02:00 committed by Alexandre Julliard
parent d538e86a60
commit 2c38966729
3 changed files with 27 additions and 0 deletions

View File

@ -962,6 +962,21 @@ HRESULT variant_to_nsstr(VARIANT *v, BOOL hex_int, nsAString *nsstr)
nsAString_Init(nsstr, buf);
break;
case VT_R8: {
VARIANT strv;
HRESULT hres;
V_VT(&strv) = VT_EMPTY;
hres = VariantChangeTypeEx(&strv, v, MAKELCID(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),SORT_DEFAULT),
0, VT_BSTR);
if(FAILED(hres))
return hres;
nsAString_Init(nsstr, V_BSTR(&strv));
SysFreeString(V_BSTR(&strv));
break;
}
default:
FIXME("not implemented for %s\n", debugstr_variant(v));
return E_NOTIMPL;

View File

@ -81,6 +81,8 @@ function test_textContent() {
ok(div.textContent === "", "div.textContent = " + div.textContent);
div.textContent = 11;
ok(div.textContent === "11", "div.textContent = " + div.textContent);
div.textContent = 10.5;
ok(div.textContent === "10.5", "div.textContent = " + div.textContent);
ok(document.textContent === null, "document.textContent = " + document.textContent);

View File

@ -852,6 +852,16 @@ static void test_css_style_declaration(IHTMLCSSStyleDeclaration *css_style)
test_var_bstr(&v, "0");
VariantClear(&v);
V_VT(&v) = VT_R8;
V_R8(&v) = 0.5;
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.5");
VariantClear(&v);
V_VT(&v) = VT_BSTR;
V_BSTR(&v) = a2bstr("1");
hres = IHTMLCSSStyleDeclaration_put_opacity(css_style, v);