Jacek Caban : mshtml: Added IHTMLStyle::[get|put]_width implementation.

Alexandre Julliard julliard at winehq.org
Tue Jul 1 08:27:31 CDT 2008


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Mon Jun 30 21:39:52 2008 +0200

mshtml: Added IHTMLStyle::[get|put]_width implementation.

---

 dlls/mshtml/htmlstyle.c |   21 ++++++++++++++++++---
 dlls/mshtml/tests/dom.c |   19 +++++++++++++++++++
 2 files changed, 37 insertions(+), 3 deletions(-)

diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c
index 83a587f..e4bc483 100644
--- a/dlls/mshtml/htmlstyle.c
+++ b/dlls/mshtml/htmlstyle.c
@@ -73,6 +73,8 @@ static const WCHAR attrTextDecoration[] =
     {'t','e','x','t','-','d','e','c','o','r','a','t','i','o','n',0};
 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 valLineThrough[] =
     {'l','i','n','e','-','t','h','r','o','u','g','h',0};
@@ -1237,15 +1239,28 @@ static HRESULT WINAPI HTMLStyle_get_borderLeftStyle(IHTMLStyle *iface, BSTR *p)
 static HRESULT WINAPI HTMLStyle_put_width(IHTMLStyle *iface, VARIANT v)
 {
     HTMLStyle *This = HTMLSTYLE_THIS(iface);
-    FIXME("(%p)->(v%d)\n", This, V_VT(&v));
+
+    TRACE("(%p)->(v%d)\n", This, V_VT(&v));
+
+    switch(V_VT(&v)) {
+    case VT_BSTR:
+        TRACE("%s\n", debugstr_w(V_BSTR(&v)));
+        return set_style_attr(This, attrWidth, V_BSTR(&v), 0);
+    default:
+        FIXME("unsupported vt %d\n", V_VT(&v));
+    }
+
     return E_NOTIMPL;
 }
 
 static HRESULT WINAPI HTMLStyle_get_width(IHTMLStyle *iface, VARIANT *p)
 {
     HTMLStyle *This = HTMLSTYLE_THIS(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
+
+    TRACE("(%p)->(%p)\n", This, p);
+
+    V_VT(p) = VT_BSTR;
+    return get_style_attr(This, attrWidth, &V_BSTR(p));
 }
 
 static HRESULT WINAPI HTMLStyle_put_height(IHTMLStyle *iface, VARIANT v)
diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c
index dd2d303..4540ed4 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -1817,6 +1817,25 @@ static void test_default_style(IHTMLStyle *style)
     hres = IHTMLStyle_get_textDecorationLineThrough(style, &b);
     ok(hres == S_OK, "get_textDecorationLineThrough failed: %08x\n", hres);
     ok(b == VARIANT_FALSE, "textDecorationLineThrough = %x\n", b);
+
+    V_VT(&v) = VT_EMPTY;
+    hres = IHTMLStyle_get_width(style, &v);
+    ok(hres == S_OK, "get_width failed: %08x\n", hres);
+    ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
+    ok(!V_BSTR(&v), "V_BSTR(v)=%p\n", V_BSTR(&v));
+
+    V_VT(&v) = VT_BSTR;
+    V_BSTR(&v) = a2bstr("auto");
+    hres = IHTMLStyle_put_width(style, v);
+    ok(hres == S_OK, "put_width failed: %08x\n", hres);
+    VariantClear(&v);
+
+    V_VT(&v) = VT_EMPTY;
+    hres = IHTMLStyle_get_width(style, &v);
+    ok(hres == S_OK, "get_width failed: %08x\n", hres);
+    ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
+    ok(!strcmp_wa(V_BSTR(&v), "auto"), "V_BSTR(v)=%s\n", dbgstr_w(V_BSTR(&v)));
+    VariantClear(&v);
 }
 
 static void test_default_selection(IHTMLDocument2 *doc)




More information about the wine-cvs mailing list