Jacek Caban : mshtml: Added IHTMLStyle::whiteSpace property implementation.

Alexandre Julliard julliard at winehq.org
Wed Aug 28 14:03:11 CDT 2013


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Wed Aug 28 17:51:08 2013 +0200

mshtml: Added IHTMLStyle::whiteSpace property implementation.

---

 dlls/mshtml/htmlstyle.c   |   15 +++++++++++----
 dlls/mshtml/htmlstyle.h   |    1 +
 dlls/mshtml/tests/style.c |   16 ++++++++++++++++
 3 files changed, 28 insertions(+), 4 deletions(-)

diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c
index 8d3148c..053c326 100644
--- a/dlls/mshtml/htmlstyle.c
+++ b/dlls/mshtml/htmlstyle.c
@@ -171,6 +171,8 @@ static const WCHAR attrVerticalAlign[] =
     {'v','e','r','t','i','c','a','l','-','a','l','i','g','n',0};
 static const WCHAR attrVisibility[] =
     {'v','i','s','i','b','i','l','i','t','y',0};
+static const WCHAR attrWhiteSpace[] =
+    {'w','h','i','t','e','-','s','p','a','c','e',0};
 static const WCHAR attrWidth[] =
     {'w','i','d','t','h',0};
 static const WCHAR attrWordSpacing[] =
@@ -257,6 +259,7 @@ static const style_tbl_entry_t style_tbl[] = {
     {attrTop,                  DISPID_IHTMLSTYLE_TOP},
     {attrVerticalAlign,        DISPID_IHTMLSTYLE_VERTICALALIGN},
     {attrVisibility,           DISPID_IHTMLSTYLE_VISIBILITY},
+    {attrWhiteSpace,           DISPID_IHTMLSTYLE_WHITESPACE},
     {attrWidth,                DISPID_IHTMLSTYLE_WIDTH},
     {attrWordSpacing,          DISPID_IHTMLSTYLE_WORDSPACING},
     {attrWordWrap,             DISPID_IHTMLSTYLE3_WORDWRAP},
@@ -2214,15 +2217,19 @@ static HRESULT WINAPI HTMLStyle_get_listStyle(IHTMLStyle *iface, BSTR *p)
 static HRESULT WINAPI HTMLStyle_put_whiteSpace(IHTMLStyle *iface, BSTR v)
 {
     HTMLStyle *This = impl_from_IHTMLStyle(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_WHITE_SPACE, v, 0);
 }
 
 static HRESULT WINAPI HTMLStyle_get_whiteSpace(IHTMLStyle *iface, BSTR *p)
 {
     HTMLStyle *This = impl_from_IHTMLStyle(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
+
+    TRACE("(%p)->(%p)\n", This, p);
+
+    return get_nsstyle_attr(This->nsstyle, STYLEID_WHITE_SPACE, p, 0);
 }
 
 static HRESULT WINAPI HTMLStyle_put_top(IHTMLStyle *iface, VARIANT v)
diff --git a/dlls/mshtml/htmlstyle.h b/dlls/mshtml/htmlstyle.h
index 0a45e05..4f2e5ab 100644
--- a/dlls/mshtml/htmlstyle.h
+++ b/dlls/mshtml/htmlstyle.h
@@ -101,6 +101,7 @@ typedef enum {
     STYLEID_TOP,
     STYLEID_VERTICAL_ALIGN,
     STYLEID_VISIBILITY,
+    STYLEID_WHITE_SPACE,
     STYLEID_WIDTH,
     STYLEID_WORD_SPACING,
     STYLEID_WORD_WRAP,
diff --git a/dlls/mshtml/tests/style.c b/dlls/mshtml/tests/style.c
index a32991b..e42bcb7 100644
--- a/dlls/mshtml/tests/style.c
+++ b/dlls/mshtml/tests/style.c
@@ -2028,6 +2028,22 @@ static void test_body_style(IHTMLStyle *style)
     ok(hres == S_OK, "get_pageBreakBefore failed: %08x\n", hres);
     ok(!str, "pageBreakBefore = %s\n", wine_dbgstr_w(str));
 
+    str = (void*)0xdeadbeef;
+    hres = IHTMLStyle_get_whiteSpace(style, &str);
+    ok(hres == S_OK, "get_whiteSpace failed: %08x\n", hres);
+    ok(!str, "whiteSpace = %s\n", wine_dbgstr_w(str));
+
+    str = a2bstr("nowrap");
+    hres = IHTMLStyle_put_whiteSpace(style, str);
+    SysFreeString(str);
+    ok(hres == S_OK, "put_whiteSpace failed: %08x\n", hres);
+
+    str = NULL;
+    hres = IHTMLStyle_get_whiteSpace(style, &str);
+    ok(hres == S_OK, "get_whiteSpace failed: %08x\n", hres);
+    ok(!strcmp_wa(str, "nowrap"), "whiteSpace = %s\n", wine_dbgstr_w(str));
+    SysFreeString(str);
+
     hres = IHTMLStyle_QueryInterface(style, &IID_IHTMLStyle2, (void**)&style2);
     ok(hres == S_OK, "Could not get IHTMLStyle2 iface: %08x\n", hres);
     if(SUCCEEDED(hres)) {




More information about the wine-cvs mailing list