Jacek Caban : mshtml: Added IHTMLLabelElement:: htmlFor property implementation.
Alexandre Julliard
julliard at winehq.org
Thu Aug 22 14:18:41 CDT 2013
Module: wine
Branch: master
Commit: 14a0e875cede6f972f955e96198e9ddadfc2120e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=14a0e875cede6f972f955e96198e9ddadfc2120e
Author: Jacek Caban <jacek at codeweavers.com>
Date: Thu Aug 22 17:13:56 2013 +0200
mshtml: Added IHTMLLabelElement::htmlFor property implementation.
---
dlls/mshtml/htmlinput.c | 45 +++++++++++++++++++++++++++++++++++++++++----
1 files changed, 41 insertions(+), 4 deletions(-)
diff --git a/dlls/mshtml/htmlinput.c b/dlls/mshtml/htmlinput.c
index 4d304b2..e6fb184 100644
--- a/dlls/mshtml/htmlinput.c
+++ b/dlls/mshtml/htmlinput.c
@@ -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)
More information about the wine-cvs
mailing list