Jacek Caban : mshtml: Added IHTMLStyle6::boxSizing property implementation.

Alexandre Julliard julliard at winehq.org
Thu Nov 7 14:10:03 CST 2013


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Thu Nov  7 17:01:31 2013 +0100

mshtml: Added IHTMLStyle6::boxSizing property implementation.

---

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

diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c
index 5ed2f93..5f4fc67 100644
--- a/dlls/mshtml/htmlstyle.c
+++ b/dlls/mshtml/htmlstyle.c
@@ -91,6 +91,9 @@ static const WCHAR attrBorderWidth[] =
     {'b','o','r','d','e','r','-','w','i','d','t','h',0};
 static const WCHAR attrBottom[] =
     {'b','o','t','t','o','m',0};
+/* FIXME: Use unprefixed version (requires Gecko changes). */
+static const WCHAR attrBoxSizing[] =
+    {'-','m','o','z','-','b','o','x','-','s','i','z','i','n','g',0};
 static const WCHAR attrClear[] =
     {'c','l','e','a','r',0};
 static const WCHAR attrClip[] =
@@ -221,6 +224,7 @@ static const style_tbl_entry_t style_tbl[] = {
     {attrBorderTopWidth,       DISPID_IHTMLSTYLE_BORDERTOPWIDTH},
     {attrBorderWidth,          DISPID_IHTMLSTYLE_BORDERWIDTH},
     {attrBottom,               DISPID_IHTMLSTYLE2_BOTTOM},
+    {attrBoxSizing,            DISPID_IHTMLSTYLE6_BOXSIZING},
     {attrClear,                DISPID_IHTMLSTYLE_CLEAR},
     {attrClip,                 DISPID_IHTMLSTYLE_CLIP},
     {attrColor,                DISPID_IHTMLSTYLE_COLOR},
diff --git a/dlls/mshtml/htmlstyle.h b/dlls/mshtml/htmlstyle.h
index 646375f..382a226 100644
--- a/dlls/mshtml/htmlstyle.h
+++ b/dlls/mshtml/htmlstyle.h
@@ -61,6 +61,7 @@ typedef enum {
     STYLEID_BORDER_TOP_WIDTH,
     STYLEID_BORDER_WIDTH,
     STYLEID_BOTTOM,
+    STYLEID_BOX_SIZING,
     STYLEID_CLEAR,
     STYLEID_CLIP,
     STYLEID_COLOR,
diff --git a/dlls/mshtml/htmlstyle3.c b/dlls/mshtml/htmlstyle3.c
index 116181c..1cff71b 100644
--- a/dlls/mshtml/htmlstyle3.c
+++ b/dlls/mshtml/htmlstyle3.c
@@ -762,15 +762,19 @@ static HRESULT WINAPI HTMLStyle6_get_outlineColor(IHTMLStyle6 *iface, VARIANT *p
 static HRESULT WINAPI HTMLStyle6_put_boxSizing(IHTMLStyle6 *iface, BSTR v)
 {
     HTMLStyle *This = impl_from_IHTMLStyle6(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_BOX_SIZING, v, 0);
 }
 
 static HRESULT WINAPI HTMLStyle6_get_boxSizing(IHTMLStyle6 *iface, BSTR *p)
 {
     HTMLStyle *This = impl_from_IHTMLStyle6(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
+
+    TRACE("(%p)->(%p)\n", This, p);
+
+    return get_nsstyle_attr(This->nsstyle, STYLEID_BOX_SIZING, p, 0);
 }
 
 static HRESULT WINAPI HTMLStyle6_put_boxSpacing(IHTMLStyle6 *iface, BSTR v)
diff --git a/dlls/mshtml/tests/style.c b/dlls/mshtml/tests/style.c
index c434c1c..2df585a 100644
--- a/dlls/mshtml/tests/style.c
+++ b/dlls/mshtml/tests/style.c
@@ -492,6 +492,23 @@ static void test_style6(IHTMLStyle6 *style)
     ok(hres == S_OK, "get_outline failed: %08x\n", hres);
     ok(wstr_contains(str, "1px"), "outline = %s\n", wine_dbgstr_w(str));
     SysFreeString(str);
+
+    str = (void*)0xdeadbeef;
+    hres = IHTMLStyle6_get_boxSizing(style, &str);
+    ok(hres == S_OK, "get_boxSizing failed: %08x\n", hres);
+    ok(!str, "boxSizing = %s\n", wine_dbgstr_w(str));
+    SysFreeString(str);
+
+    str = a2bstr("border-box");
+    hres = IHTMLStyle6_put_boxSizing(style, str);
+    ok(hres == S_OK, "put_boxSizing failed: %08x\n", hres);
+    SysFreeString(str);
+
+    str = NULL;
+    hres = IHTMLStyle6_get_boxSizing(style, &str);
+    ok(hres == S_OK, "get_boxSizing failed: %08x\n", hres);
+    ok(!strcmp_wa(str, "border-box"), "boxSizing = %s\n", wine_dbgstr_w(str));
+    SysFreeString(str);
 }
 
 static void test_body_style(IHTMLStyle *style)




More information about the wine-cvs mailing list