Jacek Caban : mshtml: Added IHTMLStyle3::wordWrap property implementation.

Alexandre Julliard julliard at winehq.org
Mon Aug 3 11:14:13 CDT 2009


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Sun Aug  2 00:09:49 2009 +0200

mshtml: Added IHTMLStyle3::wordWrap property implementation.

---

 dlls/mshtml/htmlstyle.c  |    3 +++
 dlls/mshtml/htmlstyle.h  |    1 +
 dlls/mshtml/htmlstyle3.c |   12 ++++++++----
 dlls/mshtml/tests/dom.c  |   30 ++++++++++++++++++++++++++++++
 4 files changed, 42 insertions(+), 4 deletions(-)

diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c
index 6a225a6..f036077 100644
--- a/dlls/mshtml/htmlstyle.c
+++ b/dlls/mshtml/htmlstyle.c
@@ -119,6 +119,8 @@ static const WCHAR attrVisibility[] =
     {'v','i','s','i','b','i','l','i','t','y',0};
 static const WCHAR attrWidth[] =
     {'w','i','d','t','h',0};
+static const WCHAR attrWordWrap[] =
+    {'w','o','r','d','-','w','r','a','p',0};
 static const WCHAR attrZIndex[] =
     {'z','-','i','n','d','e','x',0};
 
@@ -168,6 +170,7 @@ static const struct{
     {attrVerticalAlign,        DISPID_IHTMLSTYLE_VERTICALALIGN},
     {attrVisibility,           DISPID_IHTMLSTYLE_VISIBILITY},
     {attrWidth,                DISPID_IHTMLSTYLE_WIDTH},
+    {attrWordWrap,             DISPID_IHTMLSTYLE3_WORDWRAP},
     {attrZIndex,               DISPID_IHTMLSTYLE_ZINDEX}
 };
 
diff --git a/dlls/mshtml/htmlstyle.h b/dlls/mshtml/htmlstyle.h
index 596f579..307824e 100644
--- a/dlls/mshtml/htmlstyle.h
+++ b/dlls/mshtml/htmlstyle.h
@@ -77,6 +77,7 @@ typedef enum {
     STYLEID_VERTICAL_ALIGN,
     STYLEID_VISIBILITY,
     STYLEID_WIDTH,
+    STYLEID_WORD_WRAP,
     STYLEID_Z_INDEX
 } styleid_t;
 
diff --git a/dlls/mshtml/htmlstyle3.c b/dlls/mshtml/htmlstyle3.c
index ce1d56e..505e91e 100644
--- a/dlls/mshtml/htmlstyle3.c
+++ b/dlls/mshtml/htmlstyle3.c
@@ -117,15 +117,19 @@ static HRESULT WINAPI HTMLStyle3_get_zoom(IHTMLStyle3 *iface, VARIANT *p)
 static HRESULT WINAPI HTMLStyle3_put_wordWrap(IHTMLStyle3 *iface, BSTR v)
 {
     HTMLStyle *This = HTMLSTYLE3_THIS(iface);
-    FIXME("(%p)->(%s)\n", This, debugstr_w(v));
-    return E_NOTIMPL;
+
+    TRACE("(%p)->(%s)\n", This, debugstr_w(v));
+
+    return set_nsstyle_attr(This->nsstyle, STYLEID_WORD_WRAP, v, 0);
 }
 
 static HRESULT WINAPI HTMLStyle3_get_wordWrap(IHTMLStyle3 *iface, BSTR *p)
 {
     HTMLStyle *This = HTMLSTYLE3_THIS(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
+
+    TRACE("(%p)->(%p)\n", This, p);
+
+    return get_nsstyle_attr(This->nsstyle, STYLEID_WORD_WRAP, p);
 }
 
 static HRESULT WINAPI HTMLStyle3_put_textUnderlinePosition(IHTMLStyle3 *iface, BSTR v)
diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c
index a153a14..97102db 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -2627,6 +2627,28 @@ static void test_style2(IHTMLStyle2 *style2)
     SysFreeString(str);
 }
 
+static void test_style3(IHTMLStyle3 *style3)
+{
+    BSTR str;
+    HRESULT hres;
+
+    str = (void*)0xdeadbeef;
+    hres = IHTMLStyle3_get_wordWrap(style3, &str);
+    ok(hres == S_OK, "get_wordWrap failed: %08x\n", hres);
+    ok(!str, "str != NULL\n");
+
+    str = a2bstr("break-word");
+    hres = IHTMLStyle3_put_wordWrap(style3, str);
+    ok(hres == S_OK, "put_wordWrap failed: %08x\n", hres);
+    SysFreeString(str);
+
+    str = NULL;
+    hres = IHTMLStyle3_get_wordWrap(style3, &str);
+    ok(hres == S_OK, "get_wordWrap failed: %08x\n", hres);
+    ok(!strcmp_wa(str, "break-word"), "get_wordWrap returned %s\n", dbgstr_w(str));
+    SysFreeString(str);
+}
+
 static void test_style4(IHTMLStyle4 *style4)
 {
     HRESULT hres;
@@ -2655,6 +2677,7 @@ static void test_style4(IHTMLStyle4 *style4)
 static void test_default_style(IHTMLStyle *style)
 {
     IHTMLStyle2 *style2;
+    IHTMLStyle3 *style3;
     IHTMLStyle4 *style4;
     VARIANT_BOOL b;
     VARIANT v;
@@ -3637,6 +3660,13 @@ static void test_default_style(IHTMLStyle *style)
         IHTMLStyle2_Release(style2);
     }
 
+    hres = IHTMLStyle_QueryInterface(style, &IID_IHTMLStyle3, (void**)&style3);
+    ok(hres == S_OK, "Could not get IHTMLStyle3 iface: %08x\n", hres);
+    if(SUCCEEDED(hres)) {
+        test_style3(style3);
+        IHTMLStyle3_Release(style3);
+    }
+
     hres = IHTMLStyle_QueryInterface(style, &IID_IHTMLStyle4, (void**)&style4);
     ok(hres == S_OK, "Could not get IHTMLStyle4 iface: %08x\n", hres);
     if(SUCCEEDED(hres)) {




More information about the wine-cvs mailing list