mshtml: Added better IHTMLCurrentStyle2::get_hasLayout stub.

This commit is contained in:
Jacek Caban 2013-08-22 15:58:47 +02:00 committed by Alexandre Julliard
parent 4a5bc1375e
commit b095b1f67e
2 changed files with 28 additions and 5 deletions

View File

@ -979,8 +979,11 @@ static HRESULT WINAPI HTMLCurrentStyle2_get_textUnderlinePosition(IHTMLCurrentSt
static HRESULT WINAPI HTMLCurrentStyle2_get_hasLayout(IHTMLCurrentStyle2 *iface, VARIANT_BOOL *p) static HRESULT WINAPI HTMLCurrentStyle2_get_hasLayout(IHTMLCurrentStyle2 *iface, VARIANT_BOOL *p)
{ {
HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface); HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL; FIXME("(%p)->(%p) returning true\n", This, p);
*p = VARIANT_TRUE;
return S_OK;
} }
static HRESULT WINAPI HTMLCurrentStyle2_get_scrollbarBaseColor(IHTMLCurrentStyle2 *iface, VARIANT *p) static HRESULT WINAPI HTMLCurrentStyle2_get_scrollbarBaseColor(IHTMLCurrentStyle2 *iface, VARIANT *p)

View File

@ -73,6 +73,17 @@ static IHTMLElement2 *_get_elem2_iface(unsigned line, IUnknown *unk)
return elem; return elem;
} }
#define get_current_style2_iface(u) _get_current_style2_iface(__LINE__,u)
static IHTMLCurrentStyle2 *_get_current_style2_iface(unsigned line, IUnknown *unk)
{
IHTMLCurrentStyle2 *current_style2;
HRESULT hres;
hres = IUnknown_QueryInterface(unk, &IID_IHTMLCurrentStyle2, (void**)&current_style2);
ok_(__FILE__,line) (hres == S_OK, "Could not get IHTMLElement2: %08x\n", hres);
return current_style2;
}
static IHTMLElement *get_element_by_id(IHTMLDocument2 *doc, const char *id) static IHTMLElement *get_element_by_id(IHTMLDocument2 *doc, const char *id)
{ {
HRESULT hres; HRESULT hres;
@ -2100,9 +2111,7 @@ static void test_style_filters(IHTMLElement *elem)
hres = IHTMLElement2_get_currentStyle(elem2, &current_style); hres = IHTMLElement2_get_currentStyle(elem2, &current_style);
ok(hres == S_OK, "get_style failed: %08x\n", hres); ok(hres == S_OK, "get_style failed: %08x\n", hres);
hres = IHTMLCurrentStyle_QueryInterface(current_style, &IID_IHTMLCurrentStyle2, (void**)&current_style2); current_style2 = get_current_style2_iface((IUnknown*)current_style);
IHTMLCurrentStyle_Release(current_style);
ok(hres == S_OK, "Could not get IHTMLCurrentStyle2 iface: %08x\n", hres);
test_style_filter(style, NULL); test_style_filter(style, NULL);
test_current_style_filter(current_style2, NULL); test_current_style_filter(current_style2, NULL);
@ -2131,6 +2140,8 @@ static void test_style_filters(IHTMLElement *elem)
static void test_current_style(IHTMLCurrentStyle *current_style) static void test_current_style(IHTMLCurrentStyle *current_style)
{ {
IHTMLCurrentStyle2 *current_style2;
VARIANT_BOOL b;
BSTR str; BSTR str;
HRESULT hres; HRESULT hres;
VARIANT v; VARIANT v;
@ -2390,6 +2401,15 @@ static void test_current_style(IHTMLCurrentStyle *current_style)
ok(hres == S_OK, "get_textIndent failed: %08x\n", hres); ok(hres == S_OK, "get_textIndent failed: %08x\n", hres);
ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v)); ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
VariantClear(&v); VariantClear(&v);
current_style2 = get_current_style2_iface((IUnknown*)current_style);
b = 100;
hres = IHTMLCurrentStyle2_get_hasLayout(current_style2, &b);
ok(hres == S_OK, "get_hasLayout failed: %08x\n", hres);
ok(b == VARIANT_TRUE, "hasLayout = %x\n", b);
IHTMLCurrentStyle2_Release(current_style2);
} }
static const char basic_test_str[] = "<html><body><div id=\"divid\"></div/</body></html>"; static const char basic_test_str[] = "<html><body><div id=\"divid\"></div/</body></html>";