Module: wine Branch: master Commit: 71eac71e16c168d467a5a52e53ba6b08a766c959 URL: http://source.winehq.org/git/wine.git/?a=commit;h=71eac71e16c168d467a5a52e53...
Author: Alistair Leslie-Hughes leslie_alistair@hotmail.com Date: Tue Nov 11 22:36:39 2008 +1100
mshtml: Implement IHTMLStyle get/put posTop.
---
dlls/mshtml/htmlstyle.c | 15 +++++++++++---- dlls/mshtml/tests/dom.c | 20 ++++++++++++++++++++ 2 files changed, 31 insertions(+), 4 deletions(-)
diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index b11c8c2..b88437d 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -1845,15 +1845,22 @@ static HRESULT WINAPI HTMLStyle_get_pixelHeight(IHTMLStyle *iface, long *p) static HRESULT WINAPI HTMLStyle_put_posTop(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_TOP, v); }
static HRESULT WINAPI HTMLStyle_get_posTop(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; + + return get_nsstyle_pos(This, STYLEID_TOP, p); }
static HRESULT WINAPI HTMLStyle_put_posLeft(IHTMLStyle *iface, float v) diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index 6608a4a..e21ead4 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -2445,6 +2445,22 @@ static void test_default_style(IHTMLStyle *style) ok(!V_BSTR(&v), "V_BSTR(v) != NULL\n"); VariantClear(&v);
+ /* Test posTop */ + hres = IHTMLStyle_get_posTop(style, NULL); + ok(hres == E_POINTER, "get_left failed: %08x\n", hres); + + f = 1.0f; + hres = IHTMLStyle_get_posTop(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_posTop(style, 4.9f); + ok(hres == S_OK, "get_left failed: %08x\n", hres); + + hres = IHTMLStyle_get_posTop(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("3px"); hres = IHTMLStyle_put_top(style, v); @@ -2458,6 +2474,10 @@ static void test_default_style(IHTMLStyle *style) ok(!strcmp_wa(V_BSTR(&v), "3px"), "V_BSTR(v) = %s\n", dbgstr_w(V_BSTR(&v))); VariantClear(&v);
+ hres = IHTMLStyle_get_posTop(style, &f); + ok(hres == S_OK, "get_left failed: %08x\n", hres); + ok(f == 3.0, "expected 3.0 got %f\n", f); + V_VT(&v) = VT_NULL; hres = IHTMLStyle_put_top(style, v); ok(hres == S_OK, "put_top failed: %08x\n", hres);