Alistair Leslie-Hughes : mshtml: Implement IHTMLStyle get/ put backgroundPositionY.

Alexandre Julliard julliard at winehq.org
Fri Mar 6 09:49:48 CST 2009


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

Author: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Date:   Thu Mar  5 20:26:36 2009 +1100

mshtml: Implement IHTMLStyle get/put backgroundPositionY.

---

 dlls/mshtml/htmlstyle.c |   11 +++++++----
 dlls/mshtml/htmlstyle.h |    1 +
 dlls/mshtml/tests/dom.c |   19 +++++++++++++++++++
 3 files changed, 27 insertions(+), 4 deletions(-)

diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c
index 82d4869..a199a3c 100644
--- a/dlls/mshtml/htmlstyle.c
+++ b/dlls/mshtml/htmlstyle.c
@@ -43,6 +43,8 @@ static const WCHAR attrBackgroundImage[] =
     {'b','a','c','k','g','r','o','u','n','d','-','i','m','a','g','e',0};
 static const WCHAR attrBackgroundPositionX[] =
     {'b','a','c','k','g','r','o','u','n','d','-','p','o','s','i','t','i','o','n','-','x',0};
+static const WCHAR attrBackgroundPositionY[] =
+    {'b','a','c','k','g','r','o','u','n','d','-','p','o','s','i','t','i','o','n','-','y',0};
 static const WCHAR attrBackgroundRepeat[] =
     {'b','a','c','k','g','r','o','u','n','d','-','r','e','p','e','a','t',0};
 static const WCHAR attrBorder[] =
@@ -122,6 +124,7 @@ static const struct{
     {attrBackgroundColor,      DISPID_IHTMLSTYLE_BACKGROUNDCOLOR},
     {attrBackgroundImage,      DISPID_IHTMLSTYLE_BACKGROUNDIMAGE},
     {attrBackgroundPositionX,  DISPID_IHTMLSTYLE_BACKGROUNDPOSITIONX},
+    {attrBackgroundPositionY,  DISPID_IHTMLSTYLE_BACKGROUNDPOSITIONY},
     {attrBackgroundRepeat,     DISPID_IHTMLSTYLE_BACKGROUNDREPEAT},
     {attrBorder,               DISPID_IHTMLSTYLE_BORDER},
     {attrBorderBottomStyle,    DISPID_IHTMLSTYLE_BORDERBOTTOMSTYLE},
@@ -891,15 +894,15 @@ static HRESULT WINAPI HTMLStyle_get_backgroundPositionX(IHTMLStyle *iface, VARIA
 static HRESULT WINAPI HTMLStyle_put_backgroundPositionY(IHTMLStyle *iface, VARIANT v)
 {
     HTMLStyle *This = HTMLSTYLE_THIS(iface);
-    FIXME("(%p)->(v%d)\n", This, V_VT(&v));
-    return E_NOTIMPL;
+    TRACE("(%p)->(v%d)\n", This, V_VT(&v));
+    return set_nsstyle_attr_var(This->nsstyle, STYLEID_BACKGROUND_POSITION_Y, &v, 0);
 }
 
 static HRESULT WINAPI HTMLStyle_get_backgroundPositionY(IHTMLStyle *iface, VARIANT *p)
 {
     HTMLStyle *This = HTMLSTYLE_THIS(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
+    TRACE("(%p)->(%p)\n", This, p);
+    return get_nsstyle_attr_var(This->nsstyle, STYLEID_BACKGROUND_POSITION_Y, p, 0);
 }
 
 static HRESULT WINAPI HTMLStyle_put_wordSpacing(IHTMLStyle *iface, VARIANT v)
diff --git a/dlls/mshtml/htmlstyle.h b/dlls/mshtml/htmlstyle.h
index 407a4ab..b5fa230 100644
--- a/dlls/mshtml/htmlstyle.h
+++ b/dlls/mshtml/htmlstyle.h
@@ -39,6 +39,7 @@ typedef enum {
     STYLEID_BACKGROUND_COLOR,
     STYLEID_BACKGROUND_IMAGE,
     STYLEID_BACKGROUND_POSITION_X,
+    STYLEID_BACKGROUND_POSITION_Y,
     STYLEID_BACKGROUND_REPEAT,
     STYLEID_BORDER,
     STYLEID_BORDER_BOTTOM_STYLE,
diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c
index 2a67585..50f55b1 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -3448,6 +3448,25 @@ static void test_default_style(IHTMLStyle *style)
     ok(hres == S_OK, "put_backgroundPositionX failed: %08x\n", hres);
     VariantClear(&vDefault);
 
+    /* backgroundPositionY */
+    hres = IHTMLStyle_get_backgroundPositionY(style, &vDefault);
+    ok(hres == S_OK, "get_backgroundPositionY failed: %08x\n", hres);
+
+    V_VT(&v) = VT_BSTR;
+    V_BSTR(&v) = a2bstr("10px");
+    hres = IHTMLStyle_put_backgroundPositionY(style, v);
+    ok(hres == S_OK, "put_backgroundPositionY failed: %08x\n", hres);
+    VariantClear(&v);
+
+    hres = IHTMLStyle_get_backgroundPositionY(style, &v);
+    ok(hres == S_OK, "get_backgroundPositionY failed: %08x\n", hres);
+    ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
+    VariantClear(&v);
+
+    hres = IHTMLStyle_put_backgroundPositionY(style, vDefault);
+    ok(hres == S_OK, "put_backgroundPositionY failed: %08x\n", hres);
+    VariantClear(&vDefault);
+
     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