Alistair Leslie-Hughes : mshtml: Implement IHTMLStyle get/put posHeight.
Alexandre Julliard
julliard at winehq.org
Wed Dec 10 07:41:55 CST 2008
Module: wine
Branch: master
Commit: 84abbd64aeaa15be2eebe957732d5dcb8901e404
URL: http://source.winehq.org/git/wine.git/?a=commit;h=84abbd64aeaa15be2eebe957732d5dcb8901e404
Author: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Date: Wed Dec 10 10:40:28 2008 +1100
mshtml: Implement IHTMLStyle get/put posHeight.
---
dlls/mshtml/htmlstyle.c | 18 ++++++++++++++----
dlls/mshtml/tests/dom.c | 20 ++++++++++++++++++++
2 files changed, 34 insertions(+), 4 deletions(-)
diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c
index b612f6a..ed0c27f 100644
--- a/dlls/mshtml/htmlstyle.c
+++ b/dlls/mshtml/htmlstyle.c
@@ -1933,15 +1933,25 @@ static HRESULT WINAPI HTMLStyle_get_posWidth(IHTMLStyle *iface, float *p)
static HRESULT WINAPI HTMLStyle_put_posHeight(IHTMLStyle *iface, float v)
{
HTMLStyle *This = HTMLSTYLE_THIS(iface);
- FIXME("(%p)->()\n", This);
- return E_NOTIMPL;
+
+ TRACE("(%p)->(%f)\n", This, v);
+
+ return set_style_pos(This, STYLEID_HEIGHT, v);
}
static HRESULT WINAPI HTMLStyle_get_posHeight(IHTMLStyle *iface, float *p)
{
HTMLStyle *This = HTMLSTYLE_THIS(iface);
- FIXME("(%p)->()\n", This);
- return E_NOTIMPL;
+
+ TRACE("(%p)->(%p)\n", This, p);
+
+ if(!p)
+ return E_POINTER;
+
+ if(get_nsstyle_pos(This, STYLEID_HEIGHT, p) != S_OK)
+ *p = 0.0f;
+
+ return S_OK;
}
static HRESULT WINAPI HTMLStyle_put_cursor(IHTMLStyle *iface, BSTR v)
diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c
index e620e56..c1f5105 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -2513,6 +2513,10 @@ static void test_default_style(IHTMLStyle *style)
ok(!V_BSTR(&v), "V_BSTR(v) != NULL\n");
VariantClear(&v);
+ /* Test posHeight */
+ hres = IHTMLStyle_get_posHeight(style, NULL);
+ ok(hres == E_POINTER, "get_left failed: %08x\n", hres);
+
V_VT(&v) = VT_EMPTY;
hres = IHTMLStyle_get_height(style, &v);
ok(hres == S_OK, "get_height failed: %08x\n", hres);
@@ -2520,6 +2524,18 @@ static void test_default_style(IHTMLStyle *style)
ok(!V_BSTR(&v), "V_BSTR(v) != NULL\n");
VariantClear(&v);
+ f = 1.0f;
+ hres = IHTMLStyle_get_posHeight(style, &f);
+ ok(hres == S_OK, "get_left failed: %08x\n", hres);
+ ok(f == 0.0, "expected 0.0 got %f\n", f);
+
+ hres = IHTMLStyle_put_posHeight(style, 4.9f);
+ ok(hres == S_OK, "get_left failed: %08x\n", hres);
+
+ hres = IHTMLStyle_get_posHeight(style, &f);
+ ok(hres == S_OK, "get_left failed: %08x\n", hres);
+ ok(f == 4.0, "expected 4.0 got %f\n", f);
+
V_VT(&v) = VT_BSTR;
V_BSTR(&v) = a2bstr("64px");
hres = IHTMLStyle_put_height(style, v);
@@ -2533,6 +2549,10 @@ static void test_default_style(IHTMLStyle *style)
ok(!strcmp_wa(V_BSTR(&v), "64px"), "V_BSTR(v) = %s\n", dbgstr_w(V_BSTR(&v)));
VariantClear(&v);
+ hres = IHTMLStyle_get_posHeight(style, &f);
+ ok(hres == S_OK, "get_left failed: %08x\n", hres);
+ ok(f == 64.0, "expected 64.0 got %f\n", f);
+
str = (void*)0xdeadbeef;
hres = IHTMLStyle_get_cursor(style, &str);
ok(hres == S_OK, "get_cursor failed: %08x\n", hres);
More information about the wine-cvs
mailing list