Piotr Caban : mshtml: Added IHTMLTextAreaElement_get_type implementation.

Alexandre Julliard julliard at winehq.org
Thu Oct 28 12:19:52 CDT 2010


Module: wine
Branch: master
Commit: 90edfe08d4acea4fcabc6a754dd9473f2cb3d096
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=90edfe08d4acea4fcabc6a754dd9473f2cb3d096

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Thu Oct 28 00:30:55 2010 +0200

mshtml: Added IHTMLTextAreaElement_get_type implementation.

---

 dlls/mshtml/htmltextarea.c |   11 +++++++++--
 dlls/mshtml/tests/dom.c    |   15 +++++++++++++++
 2 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/dlls/mshtml/htmltextarea.c b/dlls/mshtml/htmltextarea.c
index dd33c72..3ea510e 100644
--- a/dlls/mshtml/htmltextarea.c
+++ b/dlls/mshtml/htmltextarea.c
@@ -97,9 +97,16 @@ static HRESULT WINAPI HTMLTextAreaElement_Invoke(IHTMLTextAreaElement *iface, DI
 
 static HRESULT WINAPI HTMLTextAreaElement_get_type(IHTMLTextAreaElement *iface, BSTR *p)
 {
+    static const WCHAR textareaW[] = {'t','e','x','t','a','r','e','a',0};
+
     HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
+
+    TRACE("(%p)->(%p)\n", This, p);
+
+    *p = SysAllocString(textareaW);
+    if(!*p)
+        return E_OUTOFMEMORY;
+    return S_OK;
 }
 
 static HRESULT WINAPI HTMLTextAreaElement_put_value(IHTMLTextAreaElement *iface, BSTR v)
diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c
index ed95b6c..23e0a91 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -1240,6 +1240,20 @@ static void _test_textarea_put_readonly(unsigned line, IUnknown *unk, VARIANT_BO
     _test_textarea_readonly(line, unk, b);
 }
 
+#define test_textarea_type(t) _test_textarea_type(__LINE__,t)
+static void _test_textarea_type(unsigned line, IUnknown *unk)
+{
+    IHTMLTextAreaElement *textarea = _get_textarea_iface(line, unk);
+    BSTR type = (void*)0xdeadbeef;
+    HRESULT hres;
+
+    hres = IHTMLTextAreaElement_get_type(textarea, &type);
+    IHTMLTextAreaElement_Release(textarea);
+    ok_(__FILE__,line)(hres == S_OK, "get_type failed: %08x\n", hres);
+    ok_(__FILE__,line)(!strcmp_wa(type, "textarea"), "type = %s, expected textarea\n", wine_dbgstr_w(type));
+    SysFreeString(type);
+}
+
 #define test_comment_text(c,t) _test_comment_text(__LINE__,c,t)
 static void _test_comment_text(unsigned line, IUnknown *unk, const char *extext)
 {
@@ -6380,6 +6394,7 @@ static void test_elems2(IHTMLDocument2 *doc)
         test_textarea_readonly((IUnknown*)elem, VARIANT_FALSE);
         test_textarea_put_readonly((IUnknown*)elem, VARIANT_TRUE);
         test_textarea_put_readonly((IUnknown*)elem, VARIANT_FALSE);
+        test_textarea_type((IUnknown*)elem);
         IHTMLElement_Release(elem);
     }
 




More information about the wine-cvs mailing list