Jacek Caban : mshtml: Added IHTMLCSSStyleDeclaration:: get_cssText implementation.

Alexandre Julliard julliard at winehq.org
Fri Sep 7 16:49:26 CDT 2018


Module: wine
Branch: master
Commit: 78b8ee543f73934121b3a8e126c1c27336ca8ed9
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=78b8ee543f73934121b3a8e126c1c27336ca8ed9

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Fri Sep  7 14:45:03 2018 +0200

mshtml: Added IHTMLCSSStyleDeclaration::get_cssText implementation.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/mshtml/htmlstyle.c   | 29 ++++++++++-------------------
 dlls/mshtml/tests/style.c |  9 ++++++++-
 2 files changed, 18 insertions(+), 20 deletions(-)

diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c
index 2e2777a..d6ea37d 100644
--- a/dlls/mshtml/htmlstyle.c
+++ b/dlls/mshtml/htmlstyle.c
@@ -2472,26 +2472,10 @@ static HRESULT WINAPI HTMLStyle_put_cssText(IHTMLStyle *iface, BSTR v)
 static HRESULT WINAPI HTMLStyle_get_cssText(IHTMLStyle *iface, BSTR *p)
 {
     HTMLStyle *This = impl_from_IHTMLStyle(iface);
-    nsAString text_str;
-    nsresult nsres;
 
     TRACE("(%p)->(%p)\n", This, p);
 
-    /* FIXME: Gecko style formatting is different than IE (uppercase). */
-    nsAString_Init(&text_str, NULL);
-    nsres = nsIDOMCSSStyleDeclaration_GetCssText(This->nsstyle, &text_str);
-    if(NS_SUCCEEDED(nsres)) {
-        const PRUnichar *text;
-
-        nsAString_GetData(&text_str, &text);
-        *p = *text ? SysAllocString(text) : NULL;
-    }else {
-        FIXME("GetCssStyle failed: %08x\n", nsres);
-        *p = NULL;
-    }
-
-    nsAString_Finish(&text_str);
-    return S_OK;
+    return IHTMLCSSStyleDeclaration_get_cssText(&This->IHTMLCSSStyleDeclaration_iface, p);
 }
 
 static HRESULT WINAPI HTMLStyle_put_pixelTop(IHTMLStyle *iface, LONG v)
@@ -5802,8 +5786,15 @@ static HRESULT WINAPI HTMLCSSStyleDeclaration_put_cssText(IHTMLCSSStyleDeclarati
 static HRESULT WINAPI HTMLCSSStyleDeclaration_get_cssText(IHTMLCSSStyleDeclaration *iface, BSTR *p)
 {
     HTMLStyle *This = impl_from_IHTMLCSSStyleDeclaration(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
+    nsAString text_str;
+    nsresult nsres;
+
+    TRACE("(%p)->(%p)\n", This, p);
+
+    /* NOTE: Quicks mode should use different formatting (uppercase, no ';' at the end of rule). */
+    nsAString_Init(&text_str, NULL);
+    nsres = nsIDOMCSSStyleDeclaration_GetCssText(This->nsstyle, &text_str);
+    return return_nsstr(nsres, &text_str, p);
 }
 
 static HRESULT WINAPI HTMLCSSStyleDeclaration_put_cursor(IHTMLCSSStyleDeclaration *iface, BSTR v)
diff --git a/dlls/mshtml/tests/style.c b/dlls/mshtml/tests/style.c
index b33cd01..cbd3257 100644
--- a/dlls/mshtml/tests/style.c
+++ b/dlls/mshtml/tests/style.c
@@ -380,10 +380,17 @@ static void test_set_csstext(IHTMLStyle *style)
     SysFreeString(str);
 
     hres = IHTMLCSSStyleDeclaration_get_cssFloat(css_style, &str);
-    ok(hres == S_OK, "get_cssText failed: %08x\n", hres);
+    ok(hres == S_OK, "get_cssFloat failed: %08x\n", hres);
     ok(!strcmp_wa(str, "left"), "cssFloat = %s\n", wine_dbgstr_w(str));
     SysFreeString(str);
 
+    hres = IHTMLCSSStyleDeclaration_get_cssText(css_style, &str);
+    ok(hres == S_OK, "get_cssText failed: %08x\n", hres);
+    todo_wine_if(compat_mode < COMPAT_IE9)
+    ok(!strcmp_wa(str, compat_mode >= COMPAT_IE9 ? "float: left;" : "FLOAT: left"),
+       "cssFloat = %s\n", wine_dbgstr_w(str));
+    SysFreeString(str);
+
     hres = IHTMLCSSStyleDeclaration_put_cssText(css_style, NULL);
     ok(hres == S_OK, "put_cssText failed: %08x\n", hres);
 




More information about the wine-cvs mailing list