mshtml: Added support for IHTMLDOMAttribute2::get_value on detached attributes.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2016-03-30 14:38:58 +02:00 committed by Alexandre Julliard
parent a3ab8d6792
commit 7ad4aeb735
2 changed files with 12 additions and 6 deletions

View File

@ -310,12 +310,11 @@ static HRESULT WINAPI HTMLDOMAttribute2_get_value(IHTMLDOMAttribute2 *iface, BST
TRACE("(%p)->(%p)\n", This, p);
if(!This->elem) {
FIXME("NULL This->elem\n");
return E_UNEXPECTED;
}
hres = get_elem_attr_value_by_dispid(This->elem, This->dispid, &val);
V_VT(&val) = VT_EMPTY;
if(This->elem)
hres = get_elem_attr_value_by_dispid(This->elem, This->dispid, &val);
else
hres = VariantCopy(&val, &This->value);
if(SUCCEEDED(hres))
hres = attr_value_to_string(&val);
if(FAILED(hres))

View File

@ -8610,11 +8610,18 @@ static void test_attr(IHTMLDocument2 *doc, IHTMLElement *elem)
get_attr_node_value(attr, &v, VT_I4);
ok(V_I4(&v) == 1, "nodeValue = %d\n", V_I4(&v));
test_attr_value(attr, "1");
V_VT(&v) = VT_EMPTY;
put_attr_node_value(attr, v);
get_attr_node_value(attr, &v, VT_EMPTY);
V_VT(&v) = VT_BSTR;
V_BSTR(&v) = a2bstr("testing");
put_attr_node_value(attr, v);
SysFreeString(V_BSTR(&v));
test_attr_value(attr, "testing");
IHTMLDOMAttribute_Release(attr);
}