mshtml: Added IHTMLLabelElement::htmlFor property implementation.

oldstable
Jacek Caban 2013-08-22 17:13:56 +02:00 committed by Alexandre Julliard
parent b095b1f67e
commit 14a0e875ce
1 changed files with 41 additions and 4 deletions

View File

@ -43,6 +43,8 @@ typedef struct {
nsIDOMHTMLInputElement *nsinput;
} HTMLInputElement;
static const WCHAR forW[] = {'f','o','r',0};
static inline HTMLInputElement *impl_from_IHTMLInputElement(IHTMLInputElement *iface)
{
return CONTAINING_RECORD(iface, HTMLInputElement, IHTMLInputElement_iface);
@ -1311,15 +1313,50 @@ static HRESULT WINAPI HTMLLabelElement_Invoke(IHTMLLabelElement *iface, DISPID d
static HRESULT WINAPI HTMLLabelElement_put_htmlFor(IHTMLLabelElement *iface, BSTR v)
{
HTMLLabelElement *This = impl_from_IHTMLLabelElement(iface);
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
return E_NOTIMPL;
nsAString for_str, val_str;
nsresult nsres;
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
nsAString_InitDepend(&for_str, forW);
nsAString_InitDepend(&val_str, v);
nsres = nsIDOMHTMLElement_SetAttribute(This->element.nselem, &for_str, &val_str);
nsAString_Finish(&for_str);
nsAString_Finish(&val_str);
if(NS_FAILED(nsres)) {
ERR("SetAttribute failed: %08x\n", nsres);
return E_FAIL;
}
return S_OK;
}
static HRESULT WINAPI HTMLLabelElement_get_htmlFor(IHTMLLabelElement *iface, BSTR *p)
{
HTMLLabelElement *This = impl_from_IHTMLLabelElement(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
nsAString for_str, val_str;
nsresult nsres;
HRESULT hres;
TRACE("(%p)->(%p)\n", This, p);
nsAString_InitDepend(&for_str, forW);
nsAString_Init(&val_str, NULL);
nsres = nsIDOMHTMLElement_GetAttribute(This->element.nselem, &for_str, &val_str);
nsAString_Finish(&for_str);
if(NS_SUCCEEDED(nsres)) {
const PRUnichar *val;
nsAString_GetData(&val_str, &val);
*p = SysAllocString(val);
hres = *p ? S_OK : E_OUTOFMEMORY;
}else {
ERR("GetAttribute failed: %08x\n", nsres);
hres = E_FAIL;
}
nsAString_Finish(&val_str);
return hres;
}
static HRESULT WINAPI HTMLLabelElement_put_accessKey(IHTMLLabelElement *iface, BSTR v)