ReactOS 0.4.16-dev-329-g9223134
style.c File Reference
#include "precomp.h"
Include dependency graph for style.c:

Go to the source code of this file.

Macros

#define test_var_bstr(a, b)   _test_var_bstr(__LINE__,a,b)
 
#define get_elem2_iface(u)   _get_elem2_iface(__LINE__,u)
 
#define get_current_style2_iface(u)   _get_current_style2_iface(__LINE__,u)
 
#define get_current_style(e)   _get_current_style(__LINE__,e)
 
#define test_border_styles(p, n)   _test_border_styles(__LINE__, p, n)
 
#define test_style_csstext(s, t)   _test_style_csstext(__LINE__,s,t)
 
#define test_style_set_csstext(s, t)   _test_style_set_csstext(__LINE__,s,t)
 
#define test_style_remove_attribute(a, b, c)   _test_style_remove_attribute(__LINE__,a,b,c)
 
#define set_text_decoration(a, b)   _set_text_decoration(__LINE__,a,b)
 
#define test_text_decoration(a, b)   _test_text_decoration(__LINE__,a,b)
 
#define test_style_filter(a, b)   _test_style_filter(__LINE__,a,b)
 
#define test_current_style_filter(a, b)   _test_current_style_filter(__LINE__,a,b)
 
#define set_style_filter(a, b)   _set_style_filter(__LINE__,a,b)
 

Typedefs

typedef void(* style_test_t) (IHTMLDocument2 *)
 

Functions

static int strcmp_wa (LPCWSTR strw, const char *stra)
 
static BOOL wstr_contains (const WCHAR *strw, const char *stra)
 
static BSTR a2bstr (const char *str)
 
static const WCHARstrstr_wa (const WCHAR *str, const char *suba)
 
static void _test_var_bstr (unsigned line, const VARIANT *v, const char *expect)
 
static IHTMLElement2 * _get_elem2_iface (unsigned line, IUnknown *unk)
 
static IHTMLCurrentStyle2 * _get_current_style2_iface (unsigned line, IUnknown *unk)
 
static IHTMLElement * get_element_by_id (IHTMLDocument2 *doc, const char *id)
 
static IHTMLCurrentStyle * _get_current_style (unsigned line, IHTMLElement *elem)
 
static void _test_border_styles (unsigned line, IHTMLStyle *pStyle, BSTR Name)
 
static void _test_style_csstext (unsigned line, IHTMLStyle *style, const char *extext)
 
static void _test_style_set_csstext (unsigned line, IHTMLStyle *style, const char *text)
 
static void _test_style_remove_attribute (unsigned line, IHTMLStyle *style, const char *attr, VARIANT_BOOL exb)
 
static void _set_text_decoration (unsigned line, IHTMLStyle *style, const char *v)
 
static void _test_text_decoration (unsigned line, IHTMLStyle *style, const char *exdec)
 
static void test_set_csstext (IHTMLStyle *style)
 
static void test_style2 (IHTMLStyle2 *style2)
 
static void test_style3 (IHTMLStyle3 *style3)
 
static void test_style4 (IHTMLStyle4 *style4)
 
static void test_style5 (IHTMLStyle5 *style5)
 
static void test_style6 (IHTMLStyle6 *style)
 
static void test_body_style (IHTMLStyle *style)
 
static void _test_style_filter (unsigned line, IHTMLStyle *style, const char *exval)
 
static void _test_current_style_filter (unsigned line, IHTMLCurrentStyle2 *style, const char *exval)
 
static void _set_style_filter (unsigned line, IHTMLStyle *style, const char *val)
 
static void test_style_filters (IHTMLElement *elem)
 
static void test_current_style (IHTMLCurrentStyle *current_style)
 
static void basic_style_test (IHTMLDocument2 *doc)
 
static void runtimestyle_test (IHTMLDocument2 *doc)
 
static IHTMLDocument2 * create_document (void)
 
static HRESULT WINAPI PropertyNotifySink_QueryInterface (IPropertyNotifySink *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI PropertyNotifySink_AddRef (IPropertyNotifySink *iface)
 
static ULONG WINAPI PropertyNotifySink_Release (IPropertyNotifySink *iface)
 
static HRESULT WINAPI PropertyNotifySink_OnChanged (IPropertyNotifySink *iface, DISPID dispID)
 
static HRESULT WINAPI PropertyNotifySink_OnRequestEdit (IPropertyNotifySink *iface, DISPID dispID)
 
static IHTMLDocument2 * create_doc_with_string (const char *str)
 
static void do_advise (IUnknown *unk, REFIID riid, IUnknown *unk_advise)
 
static void run_test (const char *str, style_test_t test)
 
 START_TEST (style)
 

Variables

static const char basic_test_str [] = "<html><body><div id=\"divid\"></div/</body></html>"
 
static const char runtimestyle_test_str []
 
static IHTMLDocument2 * notif_doc
 
static BOOL doc_complete
 
static IPropertyNotifySinkVtbl PropertyNotifySinkVtbl
 
static IPropertyNotifySink PropertyNotifySink = { &PropertyNotifySinkVtbl }
 

Macro Definition Documentation

◆ get_current_style

#define get_current_style (   e)    _get_current_style(__LINE__,e)

Definition at line 117 of file style.c.

◆ get_current_style2_iface

#define get_current_style2_iface (   u)    _get_current_style2_iface(__LINE__,u)

Definition at line 87 of file style.c.

◆ get_elem2_iface

#define get_elem2_iface (   u)    _get_elem2_iface(__LINE__,u)

Definition at line 76 of file style.c.

◆ set_style_filter

#define set_style_filter (   a,
  b 
)    _set_style_filter(__LINE__,a,b)

Definition at line 2567 of file style.c.

◆ set_text_decoration

#define set_text_decoration (   a,
  b 
)    _set_text_decoration(__LINE__,a,b)

Definition at line 280 of file style.c.

◆ test_border_styles

#define test_border_styles (   p,
  n 
)    _test_border_styles(__LINE__, p, n)

Definition at line 136 of file style.c.

◆ test_current_style_filter

#define test_current_style_filter (   a,
  b 
)    _test_current_style_filter(__LINE__,a,b)

Definition at line 2550 of file style.c.

◆ test_style_csstext

#define test_style_csstext (   s,
  t 
)    _test_style_csstext(__LINE__,s,t)

Definition at line 239 of file style.c.

◆ test_style_filter

#define test_style_filter (   a,
  b 
)    _test_style_filter(__LINE__,a,b)

Definition at line 2533 of file style.c.

◆ test_style_remove_attribute

#define test_style_remove_attribute (   a,
  b,
  c 
)    _test_style_remove_attribute(__LINE__,a,b,c)

Definition at line 267 of file style.c.

◆ test_style_set_csstext

#define test_style_set_csstext (   s,
  t 
)    _test_style_set_csstext(__LINE__,s,t)

Definition at line 255 of file style.c.

◆ test_text_decoration

#define test_text_decoration (   a,
  b 
)    _test_text_decoration(__LINE__,a,b)

Definition at line 292 of file style.c.

◆ test_var_bstr

#define test_var_bstr (   a,
  b 
)    _test_var_bstr(__LINE__,a,b)

Definition at line 66 of file style.c.

Typedef Documentation

◆ style_test_t

typedef void(* style_test_t) (IHTMLDocument2 *)

Definition at line 3115 of file style.c.

Function Documentation

◆ _get_current_style()

static IHTMLCurrentStyle * _get_current_style ( unsigned  line,
IHTMLElement *  elem 
)
static

Definition at line 118 of file style.c.

119{
120 IHTMLCurrentStyle *cstyle;
121 IHTMLElement2 *elem2;
123
124 hres = IHTMLElement_QueryInterface(elem, &IID_IHTMLElement2, (void**)&elem2);
125 ok(hres == S_OK, "Could not get IHTMLElement2 iface: %08x\n", hres);
126
127 cstyle = NULL;
128 hres = IHTMLElement2_get_currentStyle(elem2, &cstyle);
129 ok(hres == S_OK, "get_currentStyle failed: %08x\n", hres);
130 ok(cstyle != NULL, "cstyle = %p\n", cstyle);
131
132 IHTMLElement2_Release(elem2);
133 return cstyle;
134}
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112
#define S_OK
Definition: intsafe.h:52
HRESULT hres
Definition: protocol.c:465
static size_t elem
Definition: string.c:68

◆ _get_current_style2_iface()

static IHTMLCurrentStyle2 * _get_current_style2_iface ( unsigned  line,
IUnknown unk 
)
static

Definition at line 88 of file style.c.

89{
90 IHTMLCurrentStyle2 *current_style2;
92
93 hres = IUnknown_QueryInterface(unk, &IID_IHTMLCurrentStyle2, (void**)&current_style2);
94 ok_(__FILE__,line) (hres == S_OK, "Could not get IHTMLElement2: %08x\n", hres);
95 return current_style2;
96}
#define ok_(x1, x2)
Definition: atltest.h:61
Definition: parser.c:49

◆ _get_elem2_iface()

static IHTMLElement2 * _get_elem2_iface ( unsigned  line,
IUnknown unk 
)
static

Definition at line 77 of file style.c.

78{
79 IHTMLElement2 *elem;
81
82 hres = IUnknown_QueryInterface(unk, &IID_IHTMLElement2, (void**)&elem);
83 ok_(__FILE__,line) (hres == S_OK, "Could not get IHTMLElement2: %08x\n", hres);
84 return elem;
85}

◆ _set_style_filter()

static void _set_style_filter ( unsigned  line,
IHTMLStyle *  style,
const char val 
)
static

Definition at line 2568 of file style.c.

2569{
2570 BSTR str = a2bstr(val);
2571 HRESULT hres;
2572
2573 hres = IHTMLStyle_put_filter(style, str);
2574 ok_(__FILE__,line)(hres == S_OK, "put_filter failed: %08x\n", hres);
2576
2578}
Arabic default style
Definition: afstyles.h:94
OLECHAR * BSTR
Definition: compat.h:2293
GLuint GLfloat * val
Definition: glext.h:7180
static BSTR a2bstr(const char *str)
Definition: style.c:35
static void _test_style_filter(unsigned line, IHTMLStyle *style, const char *exval)
Definition: style.c:2534
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
const WCHAR * str

◆ _set_text_decoration()

static void _set_text_decoration ( unsigned  line,
IHTMLStyle *  style,
const char v 
)
static

Definition at line 281 of file style.c.

282{
283 BSTR str;
285
286 str = a2bstr(v);
287 hres = IHTMLStyle_put_textDecoration(style, str);
288 ok_(__FILE__,line)(hres == S_OK, "put_textDecoration failed: %08x\n", hres);
290}
const GLdouble * v
Definition: gl.h:2040

◆ _test_border_styles()

static void _test_border_styles ( unsigned  line,
IHTMLStyle *  pStyle,
BSTR  Name 
)
static

Definition at line 137 of file style.c.

138{
140 DISPID dispid;
141
142 hres = IHTMLStyle_GetIDsOfNames(pStyle, &IID_NULL, &Name, 1,
143 LOCALE_USER_DEFAULT, &dispid);
144 ok_(__FILE__,line) (hres == S_OK, "GetIDsOfNames: %08x\n", hres);
145 if(hres == S_OK)
146 {
147 DISPPARAMS params = {NULL,NULL,0,0};
148 DISPID dispidNamed = DISPID_PROPERTYPUT;
149 VARIANT ret;
150 VARIANT vDefault;
152
153 hres = IHTMLStyle_Invoke(pStyle, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
154 DISPATCH_PROPERTYGET, &params, &vDefault, NULL, NULL);
155 ok_(__FILE__,line) (hres == S_OK, "get_default. ret: %08x\n", hres);
156
157 params.cArgs = 1;
158 params.cNamedArgs = 1;
159 params.rgdispidNamedArgs = &dispidNamed;
160 V_VT(&arg) = VT_BSTR;
161 V_BSTR(&arg) = a2bstr("none");
162 params.rgvarg = &arg;
163 hres = IHTMLStyle_Invoke(pStyle, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
165 ok_(__FILE__,line) (hres == S_OK, "none. ret: %08x\n", hres);
167
168 V_VT(&arg) = VT_BSTR;
169 V_BSTR(&arg) = a2bstr("dotted");
170 hres = IHTMLStyle_Invoke(pStyle, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
172 ok_(__FILE__,line) (hres == S_OK, "dotted. ret: %08x\n", hres);
174
175 V_VT(&arg) = VT_BSTR;
176 V_BSTR(&arg) = a2bstr("dashed");
177 hres = IHTMLStyle_Invoke(pStyle, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
179 ok_(__FILE__,line) (hres == S_OK, "dashed. ret: %08x\n", hres);
181
182 V_VT(&arg) = VT_BSTR;
183 V_BSTR(&arg) = a2bstr("solid");
184 hres = IHTMLStyle_Invoke(pStyle, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
186 ok_(__FILE__,line) (hres == S_OK, "solid. ret: %08x\n", hres);
188
189 V_VT(&arg) = VT_BSTR;
190 V_BSTR(&arg) = a2bstr("double");
191 hres = IHTMLStyle_Invoke(pStyle, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
193 ok_(__FILE__,line) (hres == S_OK, "double. ret: %08x\n", hres);
195
196 V_VT(&arg) = VT_BSTR;
197 V_BSTR(&arg) = a2bstr("groove");
198 hres = IHTMLStyle_Invoke(pStyle, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
200 ok_(__FILE__,line) (hres == S_OK, "groove. ret: %08x\n", hres);
202
203 V_VT(&arg) = VT_BSTR;
204 V_BSTR(&arg) = a2bstr("ridge");
205 hres = IHTMLStyle_Invoke(pStyle, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
207 ok_(__FILE__,line) (hres == S_OK, "ridge. ret: %08x\n", hres);
209
210 V_VT(&arg) = VT_BSTR;
211 V_BSTR(&arg) = a2bstr("inset");
212 hres = IHTMLStyle_Invoke(pStyle, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
214 ok_(__FILE__,line) (hres == S_OK, "inset. ret: %08x\n", hres);
216
217 V_VT(&arg) = VT_BSTR;
218 V_BSTR(&arg) = a2bstr("outset");
219 hres = IHTMLStyle_Invoke(pStyle, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
221 ok_(__FILE__,line) (hres == S_OK, "outset. ret: %08x\n", hres);
223
224 V_VT(&arg) = VT_BSTR;
225 V_BSTR(&arg) = a2bstr("invalid");
226 hres = IHTMLStyle_Invoke(pStyle, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
228 ok_(__FILE__,line) (FAILED(hres), "invalid value passed.\n");
230
231 params.rgvarg = &vDefault;
232 hres = IHTMLStyle_Invoke(pStyle, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
234 ok_(__FILE__,line) (hres == S_OK, "default. ret: %08x\n", hres);
235 VariantClear(&vDefault);
236 }
237}
@ VT_BSTR
Definition: compat.h:2303
GLenum const GLfloat * params
Definition: glext.h:5645
#define FAILED(hr)
Definition: intsafe.h:51
static VARIANTARG static DISPID
Definition: ordinal.c:52
struct stdole::DISPPARAMS DISPPARAMS
#define LOCALE_USER_DEFAULT
#define LOCALE_SYSTEM_DEFAULT
#define DISPATCH_PROPERTYPUT
Definition: oleauto.h:1008
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
#define IID_NULL
Definition: guiddef.h:98
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
int ret
void * arg
Definition: msvc.h:10

◆ _test_current_style_filter()

static void _test_current_style_filter ( unsigned  line,
IHTMLCurrentStyle2 *  style,
const char exval 
)
static

Definition at line 2551 of file style.c.

2552{
2553 BSTR str;
2554 HRESULT hres;
2555
2556 str = (void*)0xdeadbeef;
2557 hres = IHTMLCurrentStyle2_get_filter(style, &str);
2558 ok_(__FILE__,line)(hres == S_OK, "get_filter failed: %08x\n", hres);
2559 if(exval)
2560 ok_(__FILE__,line)(str && !strcmp_wa(str, exval), "filter = %s, expected %s\n", wine_dbgstr_w(str), exval);
2561 else
2562 ok_(__FILE__,line)(!str, "str = %s, expected NULL\n", wine_dbgstr_w(str));
2563
2565}
#define wine_dbgstr_w
Definition: kernel32.h:34
static int strcmp_wa(LPCWSTR strw, const char *stra)
Definition: style.c:21

◆ _test_style_csstext()

static void _test_style_csstext ( unsigned  line,
IHTMLStyle *  style,
const char extext 
)
static

Definition at line 240 of file style.c.

241{
242 BSTR text = (void*)0xdeadbeef;
244
245 hres = IHTMLStyle_get_cssText(style, &text);
246 ok_(__FILE__,line)(hres == S_OK, "get_cssText failed: %08x\n", hres);
247 if(extext)
248 ok_(__FILE__,line)(!strcmp_wa(text, extext), "cssText = %s\n", wine_dbgstr_w(text));
249 else
250 ok_(__FILE__,line)(!text, "cssText = %s\n", wine_dbgstr_w(text));
251
253}
const WCHAR * text
Definition: package.c:1794

◆ _test_style_filter()

static void _test_style_filter ( unsigned  line,
IHTMLStyle *  style,
const char exval 
)
static

Definition at line 2534 of file style.c.

2535{
2536 BSTR str;
2537 HRESULT hres;
2538
2539 str = (void*)0xdeadbeef;
2540 hres = IHTMLStyle_get_filter(style, &str);
2541 ok_(__FILE__,line)(hres == S_OK, "get_filter failed: %08x\n", hres);
2542 if(exval)
2543 ok_(__FILE__,line)(str && !strcmp_wa(str, exval), "filter = %s, expected %s\n", wine_dbgstr_w(str), exval);
2544 else
2545 ok_(__FILE__,line)(!str, "str = %s, expected NULL\n", wine_dbgstr_w(str));
2546
2548}

Referenced by _set_style_filter().

◆ _test_style_remove_attribute()

static void _test_style_remove_attribute ( unsigned  line,
IHTMLStyle *  style,
const char attr,
VARIANT_BOOL  exb 
)
static

Definition at line 268 of file style.c.

269{
270 BSTR str = a2bstr(attr);
271 VARIANT_BOOL b = 100;
273
274 hres = IHTMLStyle_removeAttribute(style, str, 1, &b);
276 ok_(__FILE__,line)(hres == S_OK, "removeAttribute failed: %08x\n", hres);
277 ok_(__FILE__,line)(b == exb, "removeAttribute returned %x, expected %x\n", b, exb);
278}
short VARIANT_BOOL
Definition: compat.h:2290
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define b
Definition: ke_i.h:79
Definition: cookie.c:202

◆ _test_style_set_csstext()

static void _test_style_set_csstext ( unsigned  line,
IHTMLStyle *  style,
const char text 
)
static

Definition at line 256 of file style.c.

257{
258 BSTR tmp;
260
261 tmp = a2bstr(text);
262 hres = IHTMLStyle_put_cssText(style, tmp);
263 ok_(__FILE__,line)(hres == S_OK, "put_cssText failed: %08x\n", hres);
264 SysFreeString(tmp);
265}

◆ _test_text_decoration()

static void _test_text_decoration ( unsigned  line,
IHTMLStyle *  style,
const char exdec 
)
static

Definition at line 293 of file style.c.

294{
295 BSTR str;
297
298 hres = IHTMLStyle_get_textDecoration(style, &str);
299 ok_(__FILE__,line)(hres == S_OK, "get_textDecoration failed: %08x\n", hres);
300 if(exdec)
301 ok_(__FILE__,line)(!strcmp_wa(str, exdec), "textDecoration = %s, expected %s\n", wine_dbgstr_w(str), exdec);
302 else
303 ok_(__FILE__,line)(!str, "textDecoration = %s, expected NULL\n", wine_dbgstr_w(str));
305}

◆ _test_var_bstr()

static void _test_var_bstr ( unsigned  line,
const VARIANT v,
const char expect 
)
static

Definition at line 67 of file style.c.

68{
69 ok_(__FILE__,line)(V_VT(v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(v));
70 if(expect)
71 ok_(__FILE__,line)(!strcmp_wa(V_BSTR(v), expect), "V_BSTR(v) = %s, expected %s\n", wine_dbgstr_w(V_BSTR(v)), expect);
72 else
73 ok_(__FILE__,line)(!V_BSTR(v), "V_BSTR(v) = %s, expected NULL\n", wine_dbgstr_w(V_BSTR(v)));
74}
#define expect(EXPECTED, GOT)
Definition: SystemMenu.c:483

◆ a2bstr()

static BSTR a2bstr ( const char str)
static

Definition at line 35 of file style.c.

36{
37 BSTR ret;
38 int len;
39
40 if(!str)
41 return NULL;
42
43 len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
46
47 return ret;
48}
#define CP_ACP
Definition: compat.h:109
#define MultiByteToWideChar
Definition: compat.h:110
GLenum GLsizei len
Definition: glext.h:6722
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:339

Referenced by _set_style_filter(), _set_text_decoration(), _test_border_styles(), _test_style_remove_attribute(), _test_style_set_csstext(), get_element_by_id(), strstr_wa(), test_body_style(), test_style2(), test_style3(), test_style4(), test_style5(), and test_style6().

◆ basic_style_test()

static void basic_style_test ( IHTMLDocument2 *  doc)
static

Definition at line 2912 of file style.c.

2913{
2914 IHTMLCurrentStyle *cstyle;
2915 IHTMLElement *elem;
2916 IHTMLStyle *style;
2917 HRESULT hres;
2918
2919 hres = IHTMLDocument2_get_body(doc, &elem);
2920 ok(hres == S_OK, "get_body failed: %08x\n", hres);
2921
2922 hres = IHTMLElement_get_style(elem, &style);
2923 ok(hres == S_OK, "get_style failed: %08x\n", hres);
2924
2926
2927 cstyle = get_current_style(elem);
2928 test_current_style(cstyle);
2929 IHTMLCurrentStyle_Release(cstyle);
2930 IHTMLElement_Release(elem);
2931
2932 elem = get_element_by_id(doc, "divid");
2934
2936 IHTMLStyle_Release(style);
2937 IHTMLElement_Release(elem);
2938}
#define get_current_style(e)
Definition: style.c:117
static void test_style_filters(IHTMLElement *elem)
Definition: style.c:2580
static void test_current_style(IHTMLCurrentStyle *current_style)
Definition: style.c:2621
static IHTMLElement * get_element_by_id(IHTMLDocument2 *doc, const char *id)
Definition: style.c:98
static void test_set_csstext(IHTMLStyle *style)
Definition: style.c:307
static void test_body_style(IHTMLStyle *style)
Definition: style.c:689

Referenced by START_TEST().

◆ create_doc_with_string()

static IHTMLDocument2 * create_doc_with_string ( const char str)
static

Definition at line 3069 of file style.c.

3070{
3072 IStream *stream;
3073 IHTMLDocument2 *doc;
3074 HGLOBAL mem;
3075 SIZE_T len;
3076
3077 notif_doc = doc = create_document();
3078 if(!doc)
3079 return NULL;
3080
3082 len = strlen(str);
3083 mem = GlobalAlloc(0, len);
3084 memcpy(mem, str, len);
3086
3087 IHTMLDocument2_QueryInterface(doc, &IID_IPersistStreamInit, (void**)&init);
3088
3089 IPersistStreamInit_Load(init, stream);
3090 IPersistStreamInit_Release(init);
3091 IStream_Release(stream);
3092
3093 return doc;
3094}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
HRESULT WINAPI CreateStreamOnHGlobal(HGLOBAL hGlobal, BOOL fDeleteOnRelease, LPSTREAM *ppstm)
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static IHTMLDocument2 * create_document(void)
Definition: style.c:2990
static BOOL doc_complete
Definition: style.c:2988
static IHTMLDocument2 * notif_doc
Definition: style.c:2987
const GUID IID_IPersistStreamInit
Definition: mem.c:349
Definition: parse.h:23
ULONG_PTR SIZE_T
Definition: typedefs.h:80
static int init
Definition: wintirpc.c:33

Referenced by run_test().

◆ create_document()

static IHTMLDocument2 * create_document ( void  )
static

Definition at line 2990 of file style.c.

2991{
2992 IHTMLDocument2 *doc;
2993 IHTMLDocument5 *doc5;
2994 HRESULT hres;
2995
2996 hres = CoCreateInstance(&CLSID_HTMLDocument, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
2997 &IID_IHTMLDocument2, (void**)&doc);
2998 ok(hres == S_OK, "CoCreateInstance failed: %08x\n", hres);
2999 if(FAILED(hres))
3000 return NULL;
3001
3002 hres = IHTMLDocument2_QueryInterface(doc, &IID_IHTMLDocument5, (void**)&doc5);
3003 if(FAILED(hres)) {
3004 win_skip("Could not get IHTMLDocument5, probably too old IE\n");
3005 IHTMLDocument2_Release(doc);
3006 return NULL;
3007 }
3008
3009 IHTMLDocument5_Release(doc5);
3010 return doc;
3011}
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
#define win_skip
Definition: test.h:163

Referenced by create_doc_with_string().

◆ do_advise()

static void do_advise ( IUnknown unk,
REFIID  riid,
IUnknown unk_advise 
)
static

Definition at line 3096 of file style.c.

3097{
3100 DWORD cookie;
3101 HRESULT hres;
3102
3103 hres = IUnknown_QueryInterface(unk, &IID_IConnectionPointContainer, (void**)&container);
3104 ok(hres == S_OK, "QueryInterface(IID_IConnectionPointContainer) failed: %08x\n", hres);
3105
3106 hres = IConnectionPointContainer_FindConnectionPoint(container, riid, &cp);
3107 IConnectionPointContainer_Release(container);
3108 ok(hres == S_OK, "FindConnectionPoint failed: %08x\n", hres);
3109
3110 hres = IConnectionPoint_Advise(cp, unk_advise, &cookie);
3111 IConnectionPoint_Release(cp);
3112 ok(hres == S_OK, "Advise failed: %08x\n", hres);
3113}
unsigned long DWORD
Definition: ntddk_ex.h:95
REFIID riid
Definition: atlbase.h:39
POINT cp
Definition: magnifier.c:59
const GUID IID_IConnectionPointContainer
Definition: cookie.c:34

Referenced by run_test().

◆ get_element_by_id()

static IHTMLElement * get_element_by_id ( IHTMLDocument2 *  doc,
const char id 
)
static

Definition at line 98 of file style.c.

99{
101 IHTMLDocument3 *doc3;
102 IHTMLElement *result;
103 BSTR idW = a2bstr(id);
104
105 hres = IHTMLDocument2_QueryInterface(doc, &IID_IHTMLDocument3, (void**)&doc3);
106 ok(hres == S_OK, "QueryInterface(IID_IHTMLDocument3) failed: %08x\n", hres);
107
108 hres = IHTMLDocument3_getElementById(doc3, idW, &result);
109 ok(hres == S_OK, "getElementById failed: %08x\n", hres);
110 ok(result != NULL, "result == NULL\n");
111 SysFreeString(idW);
112
113 IHTMLDocument3_Release(doc3);
114 return result;
115}
GLuint64EXT * result
Definition: glext.h:11304

Referenced by basic_style_test().

◆ PropertyNotifySink_AddRef()

static ULONG WINAPI PropertyNotifySink_AddRef ( IPropertyNotifySink iface)
static

Definition at line 3025 of file style.c.

3026{
3027 return 2;
3028}

◆ PropertyNotifySink_OnChanged()

static HRESULT WINAPI PropertyNotifySink_OnChanged ( IPropertyNotifySink iface,
DISPID  dispID 
)
static

Definition at line 3035 of file style.c.

3036{
3037 if(dispID == DISPID_READYSTATE){
3038 BSTR state;
3039 HRESULT hres;
3040
3041 hres = IHTMLDocument2_get_readyState(notif_doc, &state);
3042 ok(hres == S_OK, "get_readyState failed: %08x\n", hres);
3043
3044 if(!strcmp_wa(state, "complete"))
3046
3048 }
3049
3050 return S_OK;
3051}
static int state
Definition: maze.c:121
#define DISPID_READYSTATE
Definition: idispids.h:22

◆ PropertyNotifySink_OnRequestEdit()

static HRESULT WINAPI PropertyNotifySink_OnRequestEdit ( IPropertyNotifySink iface,
DISPID  dispID 
)
static

Definition at line 3053 of file style.c.

3054{
3055 ok(0, "unexpected call\n");
3056 return E_NOTIMPL;
3057}
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ PropertyNotifySink_QueryInterface()

static HRESULT WINAPI PropertyNotifySink_QueryInterface ( IPropertyNotifySink iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 3013 of file style.c.

3015{
3017 *ppv = iface;
3018 return S_OK;
3019 }
3020
3021 ok(0, "unexpected call\n");
3022 return E_NOINTERFACE;
3023}
REFIID LPVOID * ppv
Definition: atlbase.h:39
const GUID IID_IPropertyNotifySink
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ PropertyNotifySink_Release()

static ULONG WINAPI PropertyNotifySink_Release ( IPropertyNotifySink iface)
static

Definition at line 3030 of file style.c.

3031{
3032 return 1;
3033}

◆ run_test()

static void run_test ( const char str,
style_test_t  test 
)
static

Definition at line 3117 of file style.c.

3118{
3119 IHTMLDocument2 *doc;
3120 ULONG ref;
3121 MSG msg;
3122
3124 if(!doc)
3125 return;
3126
3128
3129 while(!doc_complete && GetMessageW(&msg, NULL, 0, 0)) {
3132 }
3133
3134 test(doc);
3135
3136 ref = IHTMLDocument2_Release(doc);
3137 ok(!ref || broken(ref == 1), /* Vista */
3138 "ref = %d\n", ref);
3139}
#define broken(x)
Definition: atltest.h:178
#define msg(x)
Definition: auth_time.c:54
static void do_advise(IUnknown *unk, REFIID riid, IUnknown *unk_advise)
Definition: style.c:3096
static IHTMLDocument2 * create_doc_with_string(const char *str)
Definition: style.c:3069
static IPropertyNotifySink PropertyNotifySink
Definition: style.c:3067
#define test
Definition: rosglue.h:37
Definition: send.c:48
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
uint32_t ULONG
Definition: typedefs.h:59
BOOL WINAPI TranslateMessage(_In_ const MSG *)
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)

◆ runtimestyle_test()

static void runtimestyle_test ( IHTMLDocument2 *  doc)
static

Definition at line 2943 of file style.c.

2944{
2945 IHTMLStyle *style, *runtime_style;
2946 IHTMLElement2 *elem2;
2947 IHTMLElement *elem;
2948 BSTR str;
2949 HRESULT hres;
2950
2951 hres = IHTMLDocument2_get_body(doc, &elem);
2952 ok(hres == S_OK, "get_body failed: %08x\n", hres);
2953
2954 elem2 = get_elem2_iface((IUnknown*)elem);
2955
2956 hres = IHTMLElement2_get_runtimeStyle(elem2, &runtime_style);
2957 ok(hres == S_OK, "get_runtimeStyle failed: %08x\n", hres);
2958
2959 hres = IHTMLElement_get_style(elem, &style);
2960 ok(hres == S_OK, "get_style failed: %08x\n", hres);
2961
2963 test_text_decoration(runtime_style, NULL);
2964 set_text_decoration(style, "underline");
2965 test_text_decoration(style, "underline");
2966
2967 hres = IHTMLStyle_get_textDecoration(style, &str);
2968 ok(hres == S_OK, "get_textDecoration failed: %08x\n", hres);
2969 ok(broken(!str) || !strcmp_wa(str, "underline"), "textDecoration = %s\n", wine_dbgstr_w(str));
2971
2972 set_text_decoration(runtime_style, "blink");
2973 test_text_decoration(runtime_style, "blink");
2974
2975 hres = IHTMLStyle_get_textDecoration(style, &str);
2976 ok(hres == S_OK, "get_textDecoration failed: %08x\n", hres);
2977 todo_wine
2978 ok(!strcmp_wa(str, "underline"), "textDecoration = %s\n", wine_dbgstr_w(str));
2980
2981 IHTMLStyle_Release(runtime_style);
2982 IHTMLStyle_Release(style);
2983 IHTMLElement2_Release(elem2);
2984 IHTMLElement_Release(elem);
2985}
#define set_text_decoration(a, b)
Definition: style.c:280
#define get_elem2_iface(u)
Definition: style.c:76
#define test_text_decoration(a, b)
Definition: style.c:292
#define todo_wine
Definition: custom.c:89

Referenced by START_TEST().

◆ START_TEST()

START_TEST ( style  )

Definition at line 3142 of file style.c.

3143{
3145
3148
3150}
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1964
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
static void basic_style_test(IHTMLDocument2 *doc)
Definition: style.c:2912
static const char basic_test_str[]
Definition: style.c:2910
static void runtimestyle_test(IHTMLDocument2 *doc)
Definition: style.c:2943
static const char runtimestyle_test_str[]
Definition: style.c:2940
#define run_test(test)
Definition: ms_seh.c:71

◆ strcmp_wa()

static int strcmp_wa ( LPCWSTR  strw,
const char stra 
)
static

Definition at line 21 of file style.c.

22{
23 CHAR buf[512];
24 WideCharToMultiByte(CP_ACP, 0, strw, -1, buf, sizeof(buf), NULL, NULL);
25 return lstrcmpA(stra, buf);
26}
#define WideCharToMultiByte
Definition: compat.h:111
int WINAPI lstrcmpA(LPCSTR str1, LPCSTR str2)
Definition: locale.c:4195
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static const char * strw(LPCWSTR x)
Definition: actctx.c:49
char CHAR
Definition: xmlstorage.h:175

Referenced by _test_current_style_filter(), _test_style_csstext(), _test_style_filter(), _test_text_decoration(), _test_var_bstr(), PropertyNotifySink_OnChanged(), runtimestyle_test(), test_body_style(), test_current_style(), test_set_csstext(), test_style2(), test_style3(), test_style4(), test_style5(), and test_style6().

◆ strstr_wa()

static const WCHAR * strstr_wa ( const WCHAR str,
const char suba 
)
static

Definition at line 50 of file style.c.

51{
52 BSTR sub;
53 const WCHAR *ret = NULL;
54 sub = a2bstr(suba);
55 while (*str)
56 {
57 const WCHAR *p1 = str, *p2 = sub;
58 while (*p1 && *p2 && *p1 == *p2) { p1++; p2++; }
59 if (!*p2) {ret = str; break;}
60 str++;
61 }
62 SysFreeString(sub);
63 return ret;
64}
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by test_body_style().

◆ test_body_style()

static void test_body_style ( IHTMLStyle *  style)
static

Definition at line 689 of file style.c.

690{
691 IHTMLStyle2 *style2;
692 IHTMLStyle3 *style3;
693 IHTMLStyle4 *style4;
694 IHTMLStyle5 *style5;
695 IHTMLStyle6 *style6;
697 VARIANT v;
698 BSTR str;
700 float f;
701 BSTR sOverflowDefault;
702 BSTR sDefault;
703 LONG l;
704 VARIANT vDefault;
705
707
708 hres = IHTMLStyle_get_position(style, &str);
709 ok(hres == S_OK, "get_position failed: %08x\n", hres);
710 ok(!str, "str=%s\n", wine_dbgstr_w(str));
711
712 V_VT(&v) = VT_NULL;
713 hres = IHTMLStyle_get_marginRight(style, &v);
714 ok(hres == S_OK, "get_marginRight failed: %08x\n", hres);
715 ok(V_VT(&v) == VT_BSTR, "V_VT(marginRight) = %d\n", V_VT(&v));
716 ok(!V_BSTR(&v), "V_BSTR(marginRight) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
717
718 V_VT(&v) = VT_I4;
719 V_I4(&v) = 6;
720 hres = IHTMLStyle_put_marginRight(style, v);
721 ok(hres == S_OK, "put_marginRight failed: %08x\n", hres);
722
723 V_VT(&v) = VT_NULL;
724 hres = IHTMLStyle_get_marginRight(style, &v);
725 ok(hres == S_OK, "get_marginRight failed: %08x\n", hres);
726 ok(V_VT(&v) == VT_BSTR, "V_VT(marginRight) = %d\n", V_VT(&v));
727 ok(!strcmp_wa(V_BSTR(&v), "6px"), "V_BSTR(marginRight) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
728
729 V_VT(&v) = VT_NULL;
730 hres = IHTMLStyle_get_marginBottom(style, &v);
731 ok(hres == S_OK, "get_marginBottom failed: %08x\n", hres);
732 ok(V_VT(&v) == VT_BSTR, "V_VT(marginBottom) = %d\n", V_VT(&v));
733 ok(!V_BSTR(&v), "V_BSTR(marginBottom) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
734
735 V_VT(&v) = VT_I4;
736 V_I4(&v) = 6;
737 hres = IHTMLStyle_put_marginBottom(style, v);
738 ok(hres == S_OK, "put_marginBottom failed: %08x\n", hres);
739
740 V_VT(&v) = VT_NULL;
741 hres = IHTMLStyle_get_marginBottom(style, &v);
742 ok(hres == S_OK, "get_marginBottom failed: %08x\n", hres);
743 ok(V_VT(&v) == VT_BSTR, "V_VT(marginBottom) = %d\n", V_VT(&v));
744 ok(!strcmp_wa(V_BSTR(&v), "6px"), "V_BSTR(marginBottom) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
745
746 V_VT(&v) = VT_NULL;
747 hres = IHTMLStyle_get_marginLeft(style, &v);
748 ok(hres == S_OK, "get_marginLeft failed: %08x\n", hres);
749 ok(V_VT(&v) == VT_BSTR, "V_VT(marginLeft) = %d\n", V_VT(&v));
750 ok(!V_BSTR(&v), "V_BSTR(marginLeft) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
751
752 V_VT(&v) = VT_I4;
753 V_I4(&v) = 6;
754 hres = IHTMLStyle_put_marginLeft(style, v);
755 ok(hres == S_OK, "put_marginLeft failed: %08x\n", hres);
756
757 V_VT(&v) = VT_NULL;
758 hres = IHTMLStyle_get_marginLeft(style, &v);
759 ok(hres == S_OK, "get_marginLeft failed: %08x\n", hres);
760 ok(V_VT(&v) == VT_BSTR, "V_VT(marginLeft) = %d\n", V_VT(&v));
761 ok(!strcmp_wa(V_BSTR(&v), "6px"), "V_BSTR(marginLeft) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
762
763 str = (void*)0xdeadbeef;
764 hres = IHTMLStyle_get_fontFamily(style, &str);
765 ok(hres == S_OK, "get_fontFamily failed: %08x\n", hres);
766 ok(!str, "fontFamily = %s\n", wine_dbgstr_w(str));
767
768 str = (void*)0xdeadbeef;
769 hres = IHTMLStyle_get_fontWeight(style, &str);
770 ok(hres == S_OK, "get_fontWeight failed: %08x\n", hres);
771 ok(!str, "fontWeight = %s\n", wine_dbgstr_w(str));
772
773 hres = IHTMLStyle_get_fontWeight(style, &sDefault);
774 ok(hres == S_OK, "get_fontWeight failed: %08x\n", hres);
775
776 str = a2bstr("test");
777 hres = IHTMLStyle_put_fontWeight(style, str);
778 ok(hres == E_INVALIDARG, "put_fontWeight failed: %08x\n", hres);
780
781 str = a2bstr("bold");
782 hres = IHTMLStyle_put_fontWeight(style, str);
783 ok(hres == S_OK, "put_fontWeight failed: %08x\n", hres);
785
786 str = a2bstr("bolder");
787 hres = IHTMLStyle_put_fontWeight(style, str);
788 ok(hres == S_OK, "put_fontWeight failed: %08x\n", hres);
790
791 str = a2bstr("lighter");
792 hres = IHTMLStyle_put_fontWeight(style, str);
793 ok(hres == S_OK, "put_fontWeight failed: %08x\n", hres);
795
796 str = a2bstr("100");
797 hres = IHTMLStyle_put_fontWeight(style, str);
798 ok(hres == S_OK, "put_fontWeight failed: %08x\n", hres);
800
801 str = a2bstr("200");
802 hres = IHTMLStyle_put_fontWeight(style, str);
803 ok(hres == S_OK, "put_fontWeight failed: %08x\n", hres);
805
806 str = a2bstr("300");
807 hres = IHTMLStyle_put_fontWeight(style, str);
808 ok(hres == S_OK, "put_fontWeight failed: %08x\n", hres);
810
811 str = a2bstr("400");
812 hres = IHTMLStyle_put_fontWeight(style, str);
813 ok(hres == S_OK, "put_fontWeight failed: %08x\n", hres);
815
816 str = a2bstr("500");
817 hres = IHTMLStyle_put_fontWeight(style, str);
818 ok(hres == S_OK, "put_fontWeight failed: %08x\n", hres);
820
821 str = a2bstr("600");
822 hres = IHTMLStyle_put_fontWeight(style, str);
823 ok(hres == S_OK, "put_fontWeight failed: %08x\n", hres);
825
826 str = a2bstr("700");
827 hres = IHTMLStyle_put_fontWeight(style, str);
828 ok(hres == S_OK, "put_fontWeight failed: %08x\n", hres);
830
831 str = a2bstr("800");
832 hres = IHTMLStyle_put_fontWeight(style, str);
833 ok(hres == S_OK, "put_fontWeight failed: %08x\n", hres);
835
836 str = a2bstr("900");
837 hres = IHTMLStyle_put_fontWeight(style, str);
838 ok(hres == S_OK, "put_fontWeight failed: %08x\n", hres);
840
841 hres = IHTMLStyle_get_fontWeight(style, &str);
842 ok(hres == S_OK, "get_fontWeight failed: %08x\n", hres);
843 ok(!strcmp_wa(str, "900"), "str != style900\n");
845
846 str = a2bstr("");
847 hres = IHTMLStyle_put_fontWeight(style, str);
848 ok(hres == S_OK, "put_fontWeight failed: %08x\n", hres);
850
851 hres = IHTMLStyle_get_fontWeight(style, &str);
852 ok(hres == S_OK, "get_fontWeight failed: %08x\n", hres);
853 ok(!str, "str != NULL\n");
855
856 hres = IHTMLStyle_put_fontWeight(style, sDefault);
857 ok(hres == S_OK, "put_fontWeight failed: %08x\n", hres);
858 SysFreeString(sDefault);
859
860 /* font Variant */
861 hres = IHTMLStyle_get_fontVariant(style, NULL);
862 ok(hres == E_INVALIDARG, "get_fontVariant failed: %08x\n", hres);
863
864 hres = IHTMLStyle_get_fontVariant(style, &sDefault);
865 ok(hres == S_OK, "get_fontVariant failed: %08x\n", hres);
866
867 str = a2bstr("test");
868 hres = IHTMLStyle_put_fontVariant(style, str);
869 ok(hres == E_INVALIDARG, "fontVariant failed: %08x\n", hres);
871
872 str = a2bstr("small-caps");
873 hres = IHTMLStyle_put_fontVariant(style, str);
874 ok(hres == S_OK, "fontVariant failed: %08x\n", hres);
876
877 str = a2bstr("normal");
878 hres = IHTMLStyle_put_fontVariant(style, str);
879 ok(hres == S_OK, "fontVariant failed: %08x\n", hres);
881
882 hres = IHTMLStyle_put_fontVariant(style, sDefault);
883 ok(hres == S_OK, "fontVariant failed: %08x\n", hres);
884 SysFreeString(sDefault);
885
886 str = (void*)0xdeadbeef;
887 hres = IHTMLStyle_get_display(style, &str);
888 ok(hres == S_OK, "get_display failed: %08x\n", hres);
889 ok(!str, "display = %s\n", wine_dbgstr_w(str));
890
891 str = (void*)0xdeadbeef;
892 hres = IHTMLStyle_get_visibility(style, &str);
893 ok(hres == S_OK, "get_visibility failed: %08x\n", hres);
894 ok(!str, "visibility = %s\n", wine_dbgstr_w(str));
895
896 V_VT(&v) = VT_NULL;
897 hres = IHTMLStyle_get_fontSize(style, &v);
898 ok(hres == S_OK, "get_fontSize failed: %08x\n", hres);
899 ok(V_VT(&v) == VT_BSTR, "V_VT(fontSize) = %d\n", V_VT(&v));
900 ok(!V_BSTR(&v), "V_BSTR(fontSize) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
901
902 V_VT(&v) = VT_I4;
903 V_I4(&v) = 12;
904 hres = IHTMLStyle_put_fontSize(style, v);
905 ok(hres == S_OK, "put_fontSize failed: %08x\n", hres);
906
907 V_VT(&v) = VT_NULL;
908 hres = IHTMLStyle_get_fontSize(style, &v);
909 ok(hres == S_OK, "get_fontSize failed: %08x\n", hres);
910 ok(V_VT(&v) == VT_BSTR, "V_VT(fontSize) = %d\n", V_VT(&v));
911 ok(!strcmp_wa(V_BSTR(&v), "12px"), "V_BSTR(fontSize) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
912
913 V_VT(&v) = VT_NULL;
914 hres = IHTMLStyle_get_color(style, &v);
915 ok(hres == S_OK, "get_color failed: %08x\n", hres);
916 ok(V_VT(&v) == VT_BSTR, "V_VT(color) = %d\n", V_VT(&v));
917 ok(!V_BSTR(&v), "V_BSTR(color) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
918
919 V_VT(&v) = VT_I4;
920 V_I4(&v) = 0xfdfd;
921 hres = IHTMLStyle_put_color(style, v);
922 ok(hres == S_OK, "put_color failed: %08x\n", hres);
923
924 V_VT(&v) = VT_NULL;
925 hres = IHTMLStyle_get_color(style, &v);
926 ok(hres == S_OK, "get_color failed: %08x\n", hres);
927 ok(V_VT(&v) == VT_BSTR, "V_VT(color) = %d\n", V_VT(&v));
929 ok(!strcmp_wa(V_BSTR(&v), "#00fdfd"), "V_BSTR(color) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
930
931 V_VT(&v) = VT_I4;
932 V_I4(&v) = 3;
933 hres = IHTMLStyle_put_lineHeight(style, v);
934 ok(hres == S_OK, "put_lineHeight failed: %08x\n", hres);
935
936 hres = IHTMLStyle_get_lineHeight(style, &v);
937 ok(hres == S_OK, "get_lineHeight failed: %08x\n", hres);
938 ok(V_VT(&v) == VT_BSTR, "V_VT(lineHeight) = %d, expect VT_BSTR\n", V_VT(&v));
939 ok(!strcmp_wa(V_BSTR(&v), "3"), "V_BSTR(lineHeight) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
940
941 V_VT(&v) = VT_BSTR;
942 V_BSTR(&v) = a2bstr("300%");
943 hres = IHTMLStyle_put_lineHeight(style, v);
944 ok(hres == S_OK, "put_lineHeight failed: %08x\n", hres);
945 VariantClear(&v);
946
947 hres = IHTMLStyle_get_lineHeight(style, &v);
948 ok(hres == S_OK, "get_lineHeight failed: %08x\n", hres);
949 ok(V_VT(&v) == VT_BSTR, "V_VT(lineHeight) = %d, expect VT_BSTR\n", V_VT(&v));
950 ok(!strcmp_wa(V_BSTR(&v), "300%"), "V_BSTR(lineHeight) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
951 VariantClear(&v);
952
953 b = 0xfefe;
954 hres = IHTMLStyle_get_textDecorationUnderline(style, &b);
955 ok(hres == S_OK, "get_textDecorationUnderline failed: %08x\n", hres);
956 ok(b == VARIANT_FALSE, "textDecorationUnderline = %x\n", b);
957
958 hres = IHTMLStyle_put_textDecorationUnderline(style, VARIANT_TRUE);
959 ok(hres == S_OK, "put_textDecorationUnderline failed: %08x\n", hres);
960
961 hres = IHTMLStyle_get_textDecorationUnderline(style, &b);
962 ok(hres == S_OK, "get_textDecorationUnderline failed: %08x\n", hres);
963 ok(b == VARIANT_TRUE, "textDecorationUnderline = %x\n", b);
964
965 hres = IHTMLStyle_put_textDecorationUnderline(style, VARIANT_FALSE);
966 ok(hres == S_OK, "put_textDecorationUnderline failed: %08x\n", hres);
967
968 b = 0xfefe;
969 hres = IHTMLStyle_get_textDecorationLineThrough(style, &b);
970 ok(hres == S_OK, "get_textDecorationLineThrough failed: %08x\n", hres);
971 ok(b == VARIANT_FALSE, "textDecorationLineThrough = %x\n", b);
972
973 hres = IHTMLStyle_put_textDecorationLineThrough(style, VARIANT_TRUE);
974 ok(hres == S_OK, "put_textDecorationLineThrough failed: %08x\n", hres);
975
976 hres = IHTMLStyle_get_textDecorationLineThrough(style, &b);
977 ok(hres == S_OK, "get_textDecorationLineThrough failed: %08x\n", hres);
978 ok(b == VARIANT_TRUE, "textDecorationLineThrough = %x\n", b);
979
980 hres = IHTMLStyle_put_textDecorationLineThrough(style, VARIANT_FALSE);
981 ok(hres == S_OK, "put_textDecorationLineThrough failed: %08x\n", hres);
982
983 b = 0xfefe;
984 hres = IHTMLStyle_get_textDecorationNone(style, &b);
985 ok(hres == S_OK, "get_textDecorationNone failed: %08x\n", hres);
986 ok(b == VARIANT_FALSE, "textDecorationNone = %x\n", b);
987
988 hres = IHTMLStyle_put_textDecorationNone(style, VARIANT_TRUE);
989 ok(hres == S_OK, "put_textDecorationNone failed: %08x\n", hres);
990
991 hres = IHTMLStyle_get_textDecorationNone(style, &b);
992 ok(hres == S_OK, "get_textDecorationNone failed: %08x\n", hres);
993 ok(b == VARIANT_TRUE, "textDecorationNone = %x\n", b);
994
995 hres = IHTMLStyle_put_textDecorationNone(style, VARIANT_FALSE);
996 ok(hres == S_OK, "put_textDecorationNone failed: %08x\n", hres);
997
998 b = 0xfefe;
999 hres = IHTMLStyle_get_textDecorationOverline(style, &b);
1000 ok(hres == S_OK, "get_textDecorationOverline failed: %08x\n", hres);
1001 ok(b == VARIANT_FALSE, "textDecorationOverline = %x\n", b);
1002
1003 hres = IHTMLStyle_put_textDecorationOverline(style, VARIANT_TRUE);
1004 ok(hres == S_OK, "put_textDecorationOverline failed: %08x\n", hres);
1005
1006 hres = IHTMLStyle_get_textDecorationOverline(style, &b);
1007 ok(hres == S_OK, "get_textDecorationOverline failed: %08x\n", hres);
1008 ok(b == VARIANT_TRUE, "textDecorationOverline = %x\n", b);
1009
1010 hres = IHTMLStyle_put_textDecorationOverline(style, VARIANT_FALSE);
1011 ok(hres == S_OK, "put_textDecorationOverline failed: %08x\n", hres);
1012
1013 b = 0xfefe;
1014 hres = IHTMLStyle_get_textDecorationBlink(style, &b);
1015 ok(hres == S_OK, "get_textDecorationBlink failed: %08x\n", hres);
1016 ok(b == VARIANT_FALSE, "textDecorationBlink = %x\n", b);
1017
1018 hres = IHTMLStyle_put_textDecorationBlink(style, VARIANT_TRUE);
1019 ok(hres == S_OK, "put_textDecorationBlink failed: %08x\n", hres);
1020
1021 hres = IHTMLStyle_get_textDecorationBlink(style, &b);
1022 ok(hres == S_OK, "get_textDecorationBlink failed: %08x\n", hres);
1023 ok(b == VARIANT_TRUE, "textDecorationBlink = %x\n", b);
1024
1025 hres = IHTMLStyle_put_textDecorationBlink(style, VARIANT_FALSE);
1026 ok(hres == S_OK, "textDecorationBlink failed: %08x\n", hres);
1027
1028 hres = IHTMLStyle_get_textDecoration(style, &sDefault);
1029 ok(hres == S_OK, "get_textDecoration failed: %08x\n", hres);
1030
1031 str = a2bstr("invalid");
1032 hres = IHTMLStyle_put_textDecoration(style, str);
1033 ok(hres == E_INVALIDARG, "put_textDecoration failed: %08x\n", hres);
1035
1036 set_text_decoration(style, "none");
1037 test_text_decoration(style, "none");
1038 set_text_decoration(style, "underline");
1039 set_text_decoration(style, "overline");
1040 set_text_decoration(style, "line-through");
1041 set_text_decoration(style, "blink");
1042 set_text_decoration(style, "overline");
1043 set_text_decoration(style, "blink");
1044 test_text_decoration(style, "blink");
1045
1046 hres = IHTMLStyle_put_textDecoration(style, sDefault);
1047 ok(hres == S_OK, "put_textDecoration failed: %08x\n", hres);
1048 SysFreeString(sDefault);
1049
1050 hres = IHTMLStyle_get_posWidth(style, NULL);
1051 ok(hres == E_POINTER, "get_posWidth failed: %08x\n", hres);
1052
1053 hres = IHTMLStyle_get_posWidth(style, &f);
1054 ok(hres == S_OK, "get_posWidth failed: %08x\n", hres);
1055 ok(f == 0.0f, "f = %f\n", f);
1056
1057 V_VT(&v) = VT_EMPTY;
1058 hres = IHTMLStyle_get_width(style, &v);
1059 ok(hres == S_OK, "get_width failed: %08x\n", hres);
1060 ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
1061 ok(!V_BSTR(&v), "V_BSTR(v)=%p\n", V_BSTR(&v));
1062
1063 hres = IHTMLStyle_put_posWidth(style, 2.2);
1064 ok(hres == S_OK, "put_posWidth failed: %08x\n", hres);
1065
1066 hres = IHTMLStyle_get_posWidth(style, &f);
1067 ok(hres == S_OK, "get_posWidth failed: %08x\n", hres);
1068 ok(f == 2.0f ||
1069 f == 2.2f, /* IE8 */
1070 "f = %f\n", f);
1071
1072 l = 0xdeadbeef;
1073 hres = IHTMLStyle_get_pixelWidth(style, &l);
1074 ok(hres == S_OK, "get_pixelWidth failed: %08x\n", hres);
1075 ok(l == 2, "pixelWidth = %d\n", l);
1076
1077 V_VT(&v) = VT_BSTR;
1078 V_BSTR(&v) = a2bstr("auto");
1079 hres = IHTMLStyle_put_width(style, v);
1080 ok(hres == S_OK, "put_width failed: %08x\n", hres);
1081 VariantClear(&v);
1082
1083 V_VT(&v) = VT_EMPTY;
1084 hres = IHTMLStyle_get_width(style, &v);
1085 ok(hres == S_OK, "get_width failed: %08x\n", hres);
1086 ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
1087 ok(!strcmp_wa(V_BSTR(&v), "auto"), "V_BSTR(v)=%s\n", wine_dbgstr_w(V_BSTR(&v)));
1088 VariantClear(&v);
1089
1090 V_VT(&v) = VT_I4;
1091 V_I4(&v) = 100;
1092 hres = IHTMLStyle_put_width(style, v);
1093 ok(hres == S_OK, "put_width failed: %08x\n", hres);
1094
1095 l = 0xdeadbeef;
1096 hres = IHTMLStyle_get_pixelWidth(style, &l);
1097 ok(hres == S_OK, "get_pixelWidth failed: %08x\n", hres);
1098 ok(l == 100, "pixelWidth = %d\n", l);
1099
1100 V_VT(&v) = VT_EMPTY;
1101 hres = IHTMLStyle_get_width(style, &v);
1102 ok(hres == S_OK, "get_width failed: %08x\n", hres);
1103 ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
1104 ok(!strcmp_wa(V_BSTR(&v), "100px"), "V_BSTR(v)=%s\n", wine_dbgstr_w(V_BSTR(&v)));
1105 VariantClear(&v);
1106
1107 hres = IHTMLStyle_put_pixelWidth(style, 50);
1108 ok(hres == S_OK, "put_pixelWidth failed: %08x\n", hres);
1109
1110 l = 0xdeadbeef;
1111 hres = IHTMLStyle_get_pixelWidth(style, &l);
1112 ok(hres == S_OK, "get_pixelWidth failed: %08x\n", hres);
1113 ok(l == 50, "pixelWidth = %d\n", l);
1114
1115 hres = IHTMLStyle_get_pixelWidth(style, NULL);
1116 ok(hres == E_POINTER, "get_pixelWidth failed: %08x\n", hres);
1117
1118 V_VT(&v) = VT_EMPTY;
1119 hres = IHTMLStyle_get_width(style, &v);
1120 ok(hres == S_OK, "get_width failed: %08x\n", hres);
1121 ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
1122 ok(!strcmp_wa(V_BSTR(&v), "50px"), "V_BSTR(v)=%s\n", wine_dbgstr_w(V_BSTR(&v)));
1123 VariantClear(&v);
1124
1125 /* margin tests */
1126 str = (void*)0xdeadbeef;
1127 hres = IHTMLStyle_get_margin(style, &str);
1128 ok(hres == S_OK, "get_margin failed: %08x\n", hres);
1129 ok(!str, "margin = %s\n", wine_dbgstr_w(str));
1130
1131 str = a2bstr("1");
1132 hres = IHTMLStyle_put_margin(style, str);
1133 ok(hres == S_OK, "put_margin failed: %08x\n", hres);
1135
1136 hres = IHTMLStyle_get_margin(style, &str);
1137 ok(hres == S_OK, "get_margin failed: %08x\n", hres);
1138 ok(!strcmp_wa(str, "1px"), "margin = %s\n", wine_dbgstr_w(str));
1140
1141 hres = IHTMLStyle_put_margin(style, NULL);
1142 ok(hres == S_OK, "put_margin failed: %08x\n", hres);
1143
1144 str = (void*)0xdeadbeef;
1145 hres = IHTMLStyle_get_marginTop(style, &v);
1146 ok(hres == S_OK, "get_marginTop failed: %08x\n", hres);
1147 ok(V_VT(&v) == VT_BSTR, "V_VT(marginTop) = %d\n", V_VT(&v));
1148 ok(!V_BSTR(&v), "V_BSTR(marginTop) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1149
1150 V_VT(&v) = VT_BSTR;
1151 V_BSTR(&v) = a2bstr("6px");
1152 hres = IHTMLStyle_put_marginTop(style, v);
1154 ok(hres == S_OK, "put_marginTop failed: %08x\n", hres);
1155
1156 str = (void*)0xdeadbeef;
1157 hres = IHTMLStyle_get_marginTop(style, &v);
1158 ok(hres == S_OK, "get_marginTop failed: %08x\n", hres);
1159 ok(V_VT(&v) == VT_BSTR, "V_VT(marginTop) = %d\n", V_VT(&v));
1160 ok(!strcmp_wa(V_BSTR(&v), "6px"), "V_BSTR(marginTop) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1161 VariantClear(&v);
1162
1163 V_VT(&v) = VT_I4;
1164 V_I4(&v) = 5;
1165 hres = IHTMLStyle_put_marginTop(style, v);
1166 ok(hres == S_OK, "put_marginTop failed: %08x\n", hres);
1167
1168 str = (void*)0xdeadbeef;
1169 hres = IHTMLStyle_get_marginTop(style, &v);
1170 ok(hres == S_OK, "get_marginTop failed: %08x\n", hres);
1171 ok(V_VT(&v) == VT_BSTR, "V_VT(marginTop) = %d\n", V_VT(&v));
1172 ok(!strcmp_wa(V_BSTR(&v), "5px"), "V_BSTR(marginTop) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1173 VariantClear(&v);
1174
1175 str = NULL;
1176 hres = IHTMLStyle_get_border(style, &str);
1177 ok(hres == S_OK, "get_border failed: %08x\n", hres);
1178 ok(!str || !*str, "str is not empty\n");
1180
1181 str = a2bstr("1px");
1182 hres = IHTMLStyle_put_border(style, str);
1183 ok(hres == S_OK, "put_border failed: %08x\n", hres);
1185
1186 V_VT(&v) = VT_EMPTY;
1187 hres = IHTMLStyle_get_left(style, &v);
1188 ok(hres == S_OK, "get_left failed: %08x\n", hres);
1189 ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
1190 ok(!V_BSTR(&v), "V_BSTR(v) != NULL\n");
1191 VariantClear(&v);
1192
1193 l = 0xdeadbeef;
1194 hres = IHTMLStyle_get_pixelLeft(style, &l);
1195 ok(hres == S_OK, "get_pixelLeft failed: %08x\n", hres);
1196 ok(!l, "pixelLeft = %d\n", l);
1197
1198 /* Test posLeft */
1199 hres = IHTMLStyle_get_posLeft(style, NULL);
1200 ok(hres == E_POINTER, "get_posLeft failed: %08x\n", hres);
1201
1202 f = 1.0f;
1203 hres = IHTMLStyle_get_posLeft(style, &f);
1204 ok(hres == S_OK, "get_posLeft failed: %08x\n", hres);
1205 ok(f == 0.0, "expected 0.0 got %f\n", f);
1206
1207 hres = IHTMLStyle_put_posLeft(style, 4.9f);
1208 ok(hres == S_OK, "put_posLeft failed: %08x\n", hres);
1209
1210 hres = IHTMLStyle_get_posLeft(style, &f);
1211 ok(hres == S_OK, "get_posLeft failed: %08x\n", hres);
1212 ok(f == 4.0 ||
1213 f == 4.9f, /* IE8 */
1214 "expected 4.0 or 4.9 (IE8) got %f\n", f);
1215
1216 /* Ensure left is updated correctly. */
1217 V_VT(&v) = VT_EMPTY;
1218 hres = IHTMLStyle_get_left(style, &v);
1219 ok(hres == S_OK, "get_left failed: %08x\n", hres);
1220 ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
1221 ok(!strcmp_wa(V_BSTR(&v), "4px") ||
1222 !strcmp_wa(V_BSTR(&v), "4.9px"), /* IE8 */
1223 "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1224 VariantClear(&v);
1225
1226 /* Test left */
1227 V_VT(&v) = VT_BSTR;
1228 V_BSTR(&v) = a2bstr("3px");
1229 hres = IHTMLStyle_put_left(style, v);
1230 ok(hres == S_OK, "put_left failed: %08x\n", hres);
1231 VariantClear(&v);
1232
1233 hres = IHTMLStyle_get_posLeft(style, &f);
1234 ok(hres == S_OK, "get_posLeft failed: %08x\n", hres);
1235 ok(f == 3.0, "expected 3.0 got %f\n", f);
1236
1237 l = 0xdeadbeef;
1238 hres = IHTMLStyle_get_pixelLeft(style, &l);
1239 ok(hres == S_OK, "get_pixelLeft failed: %08x\n", hres);
1240 ok(l == 3, "pixelLeft = %d\n", l);
1241
1242 V_VT(&v) = VT_EMPTY;
1243 hres = IHTMLStyle_get_left(style, &v);
1244 ok(hres == S_OK, "get_left failed: %08x\n", hres);
1245 ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
1246 ok(!strcmp_wa(V_BSTR(&v), "3px"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1247 VariantClear(&v);
1248
1249 V_VT(&v) = VT_BSTR;
1250 V_BSTR(&v) = a2bstr("4.99");
1251 hres = IHTMLStyle_put_left(style, v);
1252 ok(hres == S_OK, "put_left failed: %08x\n", hres);
1253 VariantClear(&v);
1254
1255 l = 0xdeadbeef;
1256 hres = IHTMLStyle_get_pixelLeft(style, &l);
1257 ok(hres == S_OK, "get_pixelLeft failed: %08x\n", hres);
1258 ok(l == 4, "pixelLeft = %d\n", l);
1259
1260 V_VT(&v) = VT_NULL;
1261 hres = IHTMLStyle_put_left(style, v);
1262 ok(hres == S_OK, "put_left failed: %08x\n", hres);
1263
1264 V_VT(&v) = VT_EMPTY;
1265 hres = IHTMLStyle_get_left(style, &v);
1266 ok(hres == S_OK, "get_left failed: %08x\n", hres);
1267 ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
1268 ok(!V_BSTR(&v), "V_BSTR(v) != NULL\n");
1269 VariantClear(&v);
1270
1271 V_VT(&v) = VT_EMPTY;
1272 hres = IHTMLStyle_get_top(style, &v);
1273 ok(hres == S_OK, "get_top failed: %08x\n", hres);
1274 ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
1275 ok(!V_BSTR(&v), "V_BSTR(v) != NULL\n");
1276 VariantClear(&v);
1277
1278 l = 0xdeadbeef;
1279 hres = IHTMLStyle_get_pixelLeft(style, &l);
1280 ok(hres == S_OK, "get_pixelLeft failed: %08x\n", hres);
1281 ok(!l, "pixelLeft = %d\n", l);
1282
1283 hres = IHTMLStyle_put_pixelLeft(style, 6);
1284 ok(hres == S_OK, "put_pixelLeft failed: %08x\n", hres);
1285
1286 l = 0xdeadbeef;
1287 hres = IHTMLStyle_get_pixelLeft(style, &l);
1288 ok(hres == S_OK, "get_pixelLeft failed: %08x\n", hres);
1289 ok(l == 6, "pixelLeft = %d\n", l);
1290
1291 hres = IHTMLStyle_get_pixelLeft(style, NULL);
1292 ok(hres == E_POINTER, "get_pixelLeft failed: %08x\n", hres);
1293
1294 V_VT(&v) = VT_EMPTY;
1295 hres = IHTMLStyle_get_left(style, &v);
1296 ok(hres == S_OK, "get_left failed: %08x\n", hres);
1297 ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
1298 ok(!strcmp_wa(V_BSTR(&v), "6px"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1299 VariantClear(&v);
1300
1301 /* Test posTop */
1302 hres = IHTMLStyle_get_posTop(style, NULL);
1303 ok(hres == E_POINTER, "get_posTop failed: %08x\n", hres);
1304
1305 f = 1.0f;
1306 hres = IHTMLStyle_get_posTop(style, &f);
1307 ok(hres == S_OK, "get_posTop failed: %08x\n", hres);
1308 ok(f == 0.0, "expected 0.0 got %f\n", f);
1309
1310 hres = IHTMLStyle_put_posTop(style, 4.9f);
1311 ok(hres == S_OK, "put_posTop failed: %08x\n", hres);
1312
1313 hres = IHTMLStyle_get_posTop(style, &f);
1314 ok(hres == S_OK, "get_posTop failed: %08x\n", hres);
1315 ok(f == 4.0 ||
1316 f == 4.9f, /* IE8 */
1317 "expected 4.0 or 4.9 (IE8) got %f\n", f);
1318
1319 hres = IHTMLStyle_put_pixelTop(style, 6);
1320 ok(hres == S_OK, "put_pixelTop failed: %08x\n", hres);
1321
1322 l = 0xdeadbeef;
1323 hres = IHTMLStyle_get_pixelTop(style, &l);
1324 ok(hres == S_OK, "get_pixelTop failed: %08x\n", hres);
1325 ok(l == 6, "pixelTop = %d\n", l);
1326
1327 hres = IHTMLStyle_get_pixelTop(style, NULL);
1328 ok(hres == E_POINTER, "get_pixelTop failed: %08x\n", hres);
1329
1330 V_VT(&v) = VT_BSTR;
1331 V_BSTR(&v) = a2bstr("3px");
1332 hres = IHTMLStyle_put_top(style, v);
1333 ok(hres == S_OK, "put_top failed: %08x\n", hres);
1334 VariantClear(&v);
1335
1336 V_VT(&v) = VT_EMPTY;
1337 hres = IHTMLStyle_get_top(style, &v);
1338 ok(hres == S_OK, "get_top failed: %08x\n", hres);
1339 ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
1340 ok(!strcmp_wa(V_BSTR(&v), "3px"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1341 VariantClear(&v);
1342
1343 hres = IHTMLStyle_get_posTop(style, &f);
1344 ok(hres == S_OK, "get_posTop failed: %08x\n", hres);
1345 ok(f == 3.0, "expected 3.0 got %f\n", f);
1346
1347 l = 0xdeadbeef;
1348 hres = IHTMLStyle_get_pixelTop(style, &l);
1349 ok(hres == S_OK, "get_pixelTop failed: %08x\n", hres);
1350 ok(l == 3, "pixelTop = %d\n", l);
1351
1352 V_VT(&v) = VT_NULL;
1353 hres = IHTMLStyle_put_top(style, v);
1354 ok(hres == S_OK, "put_top failed: %08x\n", hres);
1355
1356 V_VT(&v) = VT_EMPTY;
1357 hres = IHTMLStyle_get_top(style, &v);
1358 ok(hres == S_OK, "get_top failed: %08x\n", hres);
1359 ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
1360 ok(!V_BSTR(&v), "V_BSTR(v) != NULL\n");
1361 VariantClear(&v);
1362
1363 l = 0xdeadbeef;
1364 hres = IHTMLStyle_get_pixelTop(style, &l);
1365 ok(hres == S_OK, "get_pixelTop failed: %08x\n", hres);
1366 ok(!l, "pixelTop = %d\n", l);
1367
1368 /* Test posHeight */
1369 hres = IHTMLStyle_get_posHeight(style, NULL);
1370 ok(hres == E_POINTER, "get_posHeight failed: %08x\n", hres);
1371
1372 V_VT(&v) = VT_EMPTY;
1373 hres = IHTMLStyle_get_height(style, &v);
1374 ok(hres == S_OK, "get_height failed: %08x\n", hres);
1375 ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
1376 ok(!V_BSTR(&v), "V_BSTR(v) != NULL\n");
1377 VariantClear(&v);
1378
1379 f = 1.0f;
1380 hres = IHTMLStyle_get_posHeight(style, &f);
1381 ok(hres == S_OK, "get_posHeight failed: %08x\n", hres);
1382 ok(f == 0.0, "expected 0.0 got %f\n", f);
1383
1384 l = 0xdeadbeef;
1385 hres = IHTMLStyle_get_pixelHeight(style, &l);
1386 ok(hres == S_OK, "get_pixelHeight failed: %08x\n", hres);
1387 ok(!l, "pixelHeight = %d\n", l);
1388
1389 hres = IHTMLStyle_put_posHeight(style, 4.9f);
1390 ok(hres == S_OK, "put_posHeight failed: %08x\n", hres);
1391
1392 hres = IHTMLStyle_get_posHeight(style, &f);
1393 ok(hres == S_OK, "get_posHeight failed: %08x\n", hres);
1394 ok(f == 4.0 ||
1395 f == 4.9f, /* IE8 */
1396 "expected 4.0 or 4.9 (IE8) got %f\n", f);
1397
1398 l = 0xdeadbeef;
1399 hres = IHTMLStyle_get_pixelHeight(style, &l);
1400 ok(hres == S_OK, "get_pixelHeight failed: %08x\n", hres);
1401 ok(l == 4 ||
1402 l == 5, /* IE8 */
1403 "pixelHeight = %d\n", l);
1404
1405 V_VT(&v) = VT_BSTR;
1406 V_BSTR(&v) = a2bstr("70px");
1407 hres = IHTMLStyle_put_height(style, v);
1408 ok(hres == S_OK, "put_height failed: %08x\n", hres);
1409 VariantClear(&v);
1410
1411 V_VT(&v) = VT_EMPTY;
1412 hres = IHTMLStyle_get_height(style, &v);
1413 ok(hres == S_OK, "get_height failed: %08x\n", hres);
1414 ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
1415 ok(!strcmp_wa(V_BSTR(&v), "70px"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1416 VariantClear(&v);
1417
1418 l = 0xdeadbeef;
1419 hres = IHTMLStyle_get_pixelHeight(style, &l);
1420 ok(hres == S_OK, "get_pixelHeight failed: %08x\n", hres);
1421 ok(l == 70, "pixelHeight = %d\n", l);
1422
1423 V_VT(&v) = VT_BSTR;
1424 V_BSTR(&v) = NULL;
1425 hres = IHTMLStyle_put_height(style, v);
1426 ok(hres == S_OK, "put_height failed: %08x\n", hres);
1427 VariantClear(&v);
1428
1429 V_VT(&v) = VT_EMPTY;
1430 hres = IHTMLStyle_get_height(style, &v);
1431 ok(hres == S_OK, "get_height failed: %08x\n", hres);
1432 ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
1433 ok(!V_BSTR(&v), "V_BSTR(v) = %s, expected NULL\n", wine_dbgstr_w(V_BSTR(&v)));
1434 VariantClear(&v);
1435
1436 l = 0xdeadbeef;
1437 hres = IHTMLStyle_get_pixelHeight(style, &l);
1438 ok(hres == S_OK, "get_pixelHeight failed: %08x\n", hres);
1439 ok(!l, "pixelHeight = %d\n", l);
1440
1441 hres = IHTMLStyle_put_pixelHeight(style, 50);
1442 ok(hres == S_OK, "put_pixelHeight failed: %08x\n", hres);
1443
1444 l = 0xdeadbeef;
1445 hres = IHTMLStyle_get_pixelHeight(style, &l);
1446 ok(hres == S_OK, "get_pixelHeight failed: %08x\n", hres);
1447 ok(l == 50, "pixelHeight = %d\n", l);
1448
1449 hres = IHTMLStyle_get_pixelHeight(style, NULL);
1450 ok(hres == E_POINTER, "get_pixelHeight failed: %08x\n", hres);
1451
1452 V_VT(&v) = VT_I4;
1453 V_I4(&v) = 64;
1454 hres = IHTMLStyle_put_height(style, v);
1455 ok(hres == S_OK, "put_height failed: %08x\n", hres);
1456
1457 V_VT(&v) = VT_EMPTY;
1458 hres = IHTMLStyle_get_height(style, &v);
1459 ok(hres == S_OK, "get_height failed: %08x\n", hres);
1460 ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
1461 ok(!strcmp_wa(V_BSTR(&v), "64px"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1462 VariantClear(&v);
1463
1464 hres = IHTMLStyle_get_posHeight(style, &f);
1465 ok(hres == S_OK, "get_posHeight failed: %08x\n", hres);
1466 ok(f == 64.0, "expected 64.0 got %f\n", f);
1467
1468 l = 0xdeadbeef;
1469 hres = IHTMLStyle_get_pixelHeight(style, &l);
1470 ok(hres == S_OK, "get_pixelHeight failed: %08x\n", hres);
1471 ok(l == 64, "pixelHeight = %d\n", l);
1472
1473 str = (void*)0xdeadbeef;
1474 hres = IHTMLStyle_get_cursor(style, &str);
1475 ok(hres == S_OK, "get_cursor failed: %08x\n", hres);
1476 ok(!str, "get_cursor != NULL\n");
1478
1479 str = a2bstr("default");
1480 hres = IHTMLStyle_put_cursor(style, str);
1481 ok(hres == S_OK, "put_cursor failed: %08x\n", hres);
1483
1484 str = NULL;
1485 hres = IHTMLStyle_get_cursor(style, &str);
1486 ok(hres == S_OK, "get_cursor failed: %08x\n", hres);
1487 ok(!strcmp_wa(str, "default"), "get_cursor returned %s\n", wine_dbgstr_w(str));
1489
1490 V_VT(&v) = VT_EMPTY;
1491 hres = IHTMLStyle_get_verticalAlign(style, &v);
1492 ok(hres == S_OK, "get_vertivalAlign failed: %08x\n", hres);
1493 ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
1494 ok(!V_BSTR(&v), "V_BSTR(v) != NULL\n");
1495 VariantClear(&v);
1496
1497 V_VT(&v) = VT_BSTR;
1498 V_BSTR(&v) = a2bstr("middle");
1499 hres = IHTMLStyle_put_verticalAlign(style, v);
1500 ok(hres == S_OK, "put_vertivalAlign failed: %08x\n", hres);
1501 VariantClear(&v);
1502
1503 V_VT(&v) = VT_EMPTY;
1504 hres = IHTMLStyle_get_verticalAlign(style, &v);
1505 ok(hres == S_OK, "get_verticalAlign failed: %08x\n", hres);
1506 ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
1507 ok(!strcmp_wa(V_BSTR(&v), "middle"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1508 VariantClear(&v);
1509
1510 V_VT(&v) = VT_I4;
1511 V_I4(&v) = 100;
1512 hres = IHTMLStyle_put_verticalAlign(style, v);
1513 ok(hres == S_OK, "put_vertivalAlign failed: %08x\n", hres);
1514 VariantClear(&v);
1515
1516 V_VT(&v) = VT_EMPTY;
1517 hres = IHTMLStyle_get_verticalAlign(style, &v);
1518 ok(hres == S_OK, "get_verticalAlign failed: %08x\n", hres);
1519 ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
1520 ok(!strcmp_wa(V_BSTR(&v), "100px"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1521 VariantClear(&v);
1522
1523 str = (void*)0xdeadbeef;
1524 hres = IHTMLStyle_get_textAlign(style, &str);
1525 ok(hres == S_OK, "get_textAlign failed: %08x\n", hres);
1526 ok(!str, "textAlign != NULL\n");
1527
1528 str = a2bstr("center");
1529 hres = IHTMLStyle_put_textAlign(style, str);
1530 ok(hres == S_OK, "put_textAlign failed: %08x\n", hres);
1532
1533 str = NULL;
1534 hres = IHTMLStyle_get_textAlign(style, &str);
1535 ok(hres == S_OK, "get_textAlign failed: %08x\n", hres);
1536 ok(!strcmp_wa(str, "center"), "textAlign = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1538
1539 V_VT(&v) = VT_NULL;
1540 hres = IHTMLStyle_get_textIndent(style, &v);
1541 ok(hres == S_OK, "get_textIndent failed: %08x\n", hres);
1542 ok(V_VT(&v) == VT_BSTR, "V_VT(textIndent) = %d\n", V_VT(&v));
1543 ok(!V_BSTR(&v), "V_BSTR(textIndent) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1544
1545 V_VT(&v) = VT_I4;
1546 V_I4(&v) = 6;
1547 hres = IHTMLStyle_put_textIndent(style, v);
1548 ok(hres == S_OK, "put_textIndent failed: %08x\n", hres);
1549
1550 V_VT(&v) = VT_NULL;
1551 hres = IHTMLStyle_get_textIndent(style, &v);
1552 ok(hres == S_OK, "get_textIndent failed: %08x\n", hres);
1553 ok(V_VT(&v) == VT_BSTR, "V_VT(textIndent) = %d\n", V_VT(&v));
1554 ok(!strcmp_wa(V_BSTR(&v), "6px"), "V_BSTR(textIndent) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1555
1556 str = (void*)0xdeadbeef;
1557 hres = IHTMLStyle_get_textTransform(style, &str);
1558 ok(hres == S_OK, "get_textTransform failed: %08x\n", hres);
1559 ok(!str, "textTransform != NULL\n");
1560
1561 str = a2bstr("lowercase");
1562 hres = IHTMLStyle_put_textTransform(style, str);
1563 ok(hres == S_OK, "put_textTransform failed: %08x\n", hres);
1565
1566 str = NULL;
1567 hres = IHTMLStyle_get_textTransform(style, &str);
1568 ok(hres == S_OK, "get_textTransform failed: %08x\n", hres);
1569 ok(!strcmp_wa(str, "lowercase"), "textTransform = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1571
1572 str = (void*)0xdeadbeef;
1573 hres = IHTMLStyle_get_filter(style, &str);
1574 ok(hres == S_OK, "get_filter failed: %08x\n", hres);
1575 ok(!str, "filter != NULL\n");
1576
1577 str = a2bstr("alpha(opacity=100)");
1578 hres = IHTMLStyle_put_filter(style, str);
1579 ok(hres == S_OK, "put_filter failed: %08x\n", hres);
1581
1582 V_VT(&v) = VT_EMPTY;
1583 hres = IHTMLStyle_get_zIndex(style, &v);
1584 ok(hres == S_OK, "get_zIndex failed: %08x\n", hres);
1585 ok(V_VT(&v) == VT_I4, "V_VT(v)=%d\n", V_VT(&v));
1586 ok(!V_I4(&v), "V_I4(v) != 0\n");
1587 VariantClear(&v);
1588
1589 V_VT(&v) = VT_BSTR;
1590 V_BSTR(&v) = a2bstr("1");
1591 hres = IHTMLStyle_put_zIndex(style, v);
1592 ok(hres == S_OK, "put_zIndex failed: %08x\n", hres);
1593 VariantClear(&v);
1594
1595 V_VT(&v) = VT_EMPTY;
1596 hres = IHTMLStyle_get_zIndex(style, &v);
1597 ok(hres == S_OK, "get_zIndex failed: %08x\n", hres);
1598 ok(V_VT(&v) == VT_I4, "V_VT(v)=%d\n", V_VT(&v));
1599 ok(V_I4(&v) == 1, "V_I4(v) = %d\n", V_I4(&v));
1600 VariantClear(&v);
1601
1602 /* fontStyle */
1603 hres = IHTMLStyle_get_fontStyle(style, &sDefault);
1604 ok(hres == S_OK, "get_fontStyle failed: %08x\n", hres);
1605
1606 str = a2bstr("test");
1607 hres = IHTMLStyle_put_fontStyle(style, str);
1608 ok(hres == E_INVALIDARG, "put_fontStyle failed: %08x\n", hres);
1610
1611 str = a2bstr("italic");
1612 hres = IHTMLStyle_put_fontStyle(style, str);
1613 ok(hres == S_OK, "put_fontStyle failed: %08x\n", hres);
1615
1616 str = a2bstr("oblique");
1617 hres = IHTMLStyle_put_fontStyle(style, str);
1618 ok(hres == S_OK, "put_fontStyle failed: %08x\n", hres);
1620
1621 str = a2bstr("normal");
1622 hres = IHTMLStyle_put_fontStyle(style, str);
1623 ok(hres == S_OK, "put_fontStyle failed: %08x\n", hres);
1625
1626 hres = IHTMLStyle_put_fontStyle(style, sDefault);
1627 ok(hres == S_OK, "put_fontStyle failed: %08x\n", hres);
1628 SysFreeString(sDefault);
1629
1630 /* overflow */
1631 hres = IHTMLStyle_get_overflow(style, NULL);
1632 ok(hres == E_INVALIDARG, "get_overflow failed: %08x\n", hres);
1633
1634 hres = IHTMLStyle_get_overflow(style, &sOverflowDefault);
1635 ok(hres == S_OK, "get_overflow failed: %08x\n", hres);
1636
1637 str = a2bstr("test");
1638 hres = IHTMLStyle_put_overflow(style, str);
1639 ok(hres == E_INVALIDARG, "put_overflow failed: %08x\n", hres);
1641
1642 str = a2bstr("visible");
1643 hres = IHTMLStyle_put_overflow(style, str);
1644 ok(hres == S_OK, "put_overflow failed: %08x\n", hres);
1646
1647 str = a2bstr("scroll");
1648 hres = IHTMLStyle_put_overflow(style, str);
1649 ok(hres == S_OK, "put_overflow failed: %08x\n", hres);
1651
1652 str = a2bstr("hidden");
1653 hres = IHTMLStyle_put_overflow(style, str);
1654 ok(hres == S_OK, "put_overflow failed: %08x\n", hres);
1656
1657 str = a2bstr("auto");
1658 hres = IHTMLStyle_put_overflow(style, str);
1659 ok(hres == S_OK, "put_overflow failed: %08x\n", hres);
1661
1662 hres = IHTMLStyle_get_overflow(style, &str);
1663 ok(hres == S_OK, "get_overflow failed: %08x\n", hres);
1664 ok(!strcmp_wa(str, "auto"), "str=%s\n", wine_dbgstr_w(str));
1666
1667 str = a2bstr("");
1668 hres = IHTMLStyle_put_overflow(style, str);
1669 ok(hres == S_OK, "put_overflow failed: %08x\n", hres);
1671
1672 hres = IHTMLStyle_get_overflow(style, &str);
1673 ok(hres == S_OK, "get_overflow failed: %08x\n", hres);
1674 ok(!str, "str=%s\n", wine_dbgstr_w(str));
1676
1677 /* restore overflow default */
1678 hres = IHTMLStyle_put_overflow(style, sOverflowDefault);
1679 ok(hres == S_OK, "put_overflow failed: %08x\n", hres);
1680 SysFreeString(sOverflowDefault);
1681
1682 /* Attribute Tests*/
1683 hres = IHTMLStyle_getAttribute(style, NULL, 1, &v);
1684 ok(hres == E_INVALIDARG, "getAttribute failed: %08x\n", hres);
1685
1686 str = a2bstr("position");
1687 hres = IHTMLStyle_getAttribute(style, str, 1, NULL);
1688 ok(hres == E_INVALIDARG, "getAttribute failed: %08x\n", hres);
1689
1690 hres = IHTMLStyle_getAttribute(style, str, 1, &v);
1691 ok(hres == S_OK, "getAttribute failed: %08x\n", hres);
1692 ok(V_VT(&v) == VT_BSTR, "type failed: %d\n", V_VT(&v));
1693 VariantClear(&v);
1694
1695 hres = IHTMLStyle_setAttribute(style, NULL, v, 1);
1696 ok(hres == E_INVALIDARG, "setAttribute failed: %08x\n", hres);
1697
1698 V_VT(&v) = VT_BSTR;
1699 V_BSTR(&v) = a2bstr("absolute");
1700 hres = IHTMLStyle_setAttribute(style, str, v, 1);
1701 ok(hres == S_OK, "setAttribute failed: %08x\n", hres);
1702 VariantClear(&v);
1703
1704 hres = IHTMLStyle_getAttribute(style, str, 1, &v);
1705 ok(hres == S_OK, "getAttribute failed: %08x\n", hres);
1706 ok(V_VT(&v) == VT_BSTR, "type failed: %d\n", V_VT(&v));
1707 ok(!strcmp_wa(V_BSTR(&v), "absolute"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
1708 VariantClear(&v);
1709
1710 V_VT(&v) = VT_BSTR;
1711 V_BSTR(&v) = NULL;
1712 hres = IHTMLStyle_setAttribute(style, str, v, 1);
1713 ok(hres == S_OK, "setAttribute failed: %08x\n", hres);
1714 VariantClear(&v);
1715
1717
1718 str = a2bstr("borderLeftStyle");
1721
1722 str = a2bstr("borderbottomstyle");
1725
1726 str = a2bstr("borderrightstyle");
1729
1730 str = a2bstr("bordertopstyle");
1733
1734 hres = IHTMLStyle_get_borderStyle(style, &sDefault);
1735 ok(hres == S_OK, "get_borderStyle failed: %08x\n", hres);
1736
1737 str = a2bstr("none dotted dashed solid");
1738 hres = IHTMLStyle_put_borderStyle(style, str);
1739 ok(hres == S_OK, "put_borderStyle failed: %08x\n", hres);
1741
1742 str = a2bstr("none dotted dashed solid");
1743 hres = IHTMLStyle_get_borderStyle(style, &str);
1744 ok(hres == S_OK, "get_borderStyle failed: %08x\n", hres);
1745 ok(!strcmp_wa(str, "none dotted dashed solid"),
1746 "expected (none dotted dashed solid) = (%s)\n", wine_dbgstr_w(V_BSTR(&v)));
1748
1749 str = a2bstr("double groove ridge inset");
1750 hres = IHTMLStyle_put_borderStyle(style, str);
1751 ok(hres == S_OK, "put_borderStyle failed: %08x\n", hres);
1753
1754 str = a2bstr("window-inset outset ridge inset");
1755 hres = IHTMLStyle_put_borderStyle(style, str);
1756 ok(hres == S_OK, "put_borderStyle failed: %08x\n", hres);
1758
1759 str = a2bstr("window-inset");
1760 hres = IHTMLStyle_put_borderStyle(style, str);
1761 ok(hres == S_OK, "put_borderStyle failed: %08x\n", hres);
1763
1764 str = a2bstr("none none none none none");
1765 hres = IHTMLStyle_put_borderStyle(style, str);
1766 ok(hres == S_OK, "put_borderStyle failed: %08x\n", hres);
1768
1769 str = a2bstr("invalid none none none");
1770 hres = IHTMLStyle_put_borderStyle(style, str);
1771 ok(hres == E_INVALIDARG, "put_borderStyle failed: %08x\n", hres);
1773
1774 str = a2bstr("none invalid none none");
1775 hres = IHTMLStyle_put_borderStyle(style, str);
1776 ok(hres == E_INVALIDARG, "put_borderStyle failed: %08x\n", hres);
1778
1779 hres = IHTMLStyle_put_borderStyle(style, sDefault);
1780 ok(hres == S_OK, "put_borderStyle failed: %08x\n", hres);
1781 SysFreeString(sDefault);
1782
1783 /* backgoundColor */
1784 hres = IHTMLStyle_get_backgroundColor(style, &v);
1785 ok(hres == S_OK, "get_backgroundColor: %08x\n", hres);
1786 ok(V_VT(&v) == VT_BSTR, "type failed: %d\n", V_VT(&v));
1787 ok(!V_BSTR(&v), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
1788 VariantClear(&v);
1789
1790 V_VT(&v) = VT_BSTR;
1791 V_BSTR(&v) = a2bstr("red");
1792 hres = IHTMLStyle_put_backgroundColor(style, v);
1793 ok(hres == S_OK, "put_backgroundColor failed: %08x\n", hres);
1794 VariantClear(&v);
1795
1796 hres = IHTMLStyle_get_backgroundColor(style, &v);
1797 ok(hres == S_OK, "get_backgroundColor: %08x\n", hres);
1798 ok(V_VT(&v) == VT_BSTR, "type failed: %d\n", V_VT(&v));
1799 ok(!strcmp_wa(V_BSTR(&v), "red"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
1800 VariantClear(&v);
1801
1802 str = a2bstr("fixed");
1803 hres = IHTMLStyle_put_backgroundAttachment(style, str);
1804 ok(hres == S_OK, "put_backgroundAttachment failed: %08x\n", hres);
1806
1807 hres = IHTMLStyle_get_backgroundAttachment(style, &str);
1808 ok(hres == S_OK, "get_backgroundAttachment failed: %08x\n", hres);
1809 ok(!strcmp_wa(str, "fixed"), "ret = %s\n", wine_dbgstr_w(str));
1811
1812 /* padding */
1813 hres = IHTMLStyle_get_padding(style, &str);
1814 ok(hres == S_OK, "get_padding failed: %08x\n", hres);
1815 ok(!str, "padding = %s\n", wine_dbgstr_w(str));
1817
1818 hres = IHTMLStyle_get_paddingTop(style, &v);
1819 ok(hres == S_OK, "get_paddingTop: %08x\n", hres);
1820 ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
1821 ok(!V_BSTR(&v), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1822
1823 V_VT(&v) = VT_I4;
1824 V_I4(&v) = 6;
1825 hres = IHTMLStyle_put_paddingTop(style, v);
1826 ok(hres == S_OK, "put_paddingTop failed: %08x\n", hres);
1827
1828 hres = IHTMLStyle_get_paddingTop(style, &v);
1829 ok(hres == S_OK, "get_paddingTop: %08x\n", hres);
1830 ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
1831 ok(!strcmp_wa(V_BSTR(&v), "6px"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1832 VariantClear(&v);
1833
1834 hres = IHTMLStyle_get_paddingRight(style, &v);
1835 ok(hres == S_OK, "get_paddingRight: %08x\n", hres);
1836 ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
1837 ok(!V_BSTR(&v), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1838
1839 V_VT(&v) = VT_I4;
1840 V_I4(&v) = 6;
1841 hres = IHTMLStyle_put_paddingRight(style, v);
1842 ok(hres == S_OK, "put_paddingRight failed: %08x\n", hres);
1843
1844 hres = IHTMLStyle_get_paddingRight(style, &v);
1845 ok(hres == S_OK, "get_paddingRight: %08x\n", hres);
1846 ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
1847 ok(!strcmp_wa(V_BSTR(&v), "6px"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1848 VariantClear(&v);
1849
1850 hres = IHTMLStyle_get_paddingBottom(style, &v);
1851 ok(hres == S_OK, "get_paddingBottom: %08x\n", hres);
1852 ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
1853 ok(!V_BSTR(&v), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1854
1855 V_VT(&v) = VT_I4;
1856 V_I4(&v) = 6;
1857 hres = IHTMLStyle_put_paddingBottom(style, v);
1858 ok(hres == S_OK, "put_paddingBottom failed: %08x\n", hres);
1859
1860 hres = IHTMLStyle_get_paddingBottom(style, &v);
1861 ok(hres == S_OK, "get_paddingBottom: %08x\n", hres);
1862 ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
1863 ok(!strcmp_wa(V_BSTR(&v), "6px"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1864 VariantClear(&v);
1865
1866 str = a2bstr("1");
1867 hres = IHTMLStyle_put_padding(style, str);
1868 ok(hres == S_OK, "put_padding failed: %08x\n", hres);
1870
1871 hres = IHTMLStyle_get_padding(style, &str);
1872 ok(hres == S_OK, "get_padding failed: %08x\n", hres);
1873 ok(!strcmp_wa(str, "1px"), "padding = %s\n", wine_dbgstr_w(str));
1875
1876 /* PaddingLeft */
1877 hres = IHTMLStyle_get_paddingLeft(style, &vDefault);
1878 ok(hres == S_OK, "get_paddingLeft: %08x\n", hres);
1879 ok(V_VT(&vDefault) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&vDefault));
1880 ok(!strcmp_wa(V_BSTR(&vDefault), "1px"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&vDefault)));
1881
1882 V_VT(&v) = VT_BSTR;
1883 V_BSTR(&v) = a2bstr("10");
1884 hres = IHTMLStyle_put_paddingLeft(style, v);
1885 ok(hres == S_OK, "put_paddingLeft: %08x\n", hres);
1886 VariantClear(&v);
1887
1888 hres = IHTMLStyle_get_paddingLeft(style, &v);
1889 ok(hres == S_OK, "get_paddingLeft: %08x\n", hres);
1890 ok(!strcmp_wa(V_BSTR(&v), "10px"), "expecte 10 = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1891 VariantClear(&v);
1892
1893 hres = IHTMLStyle_put_paddingLeft(style, vDefault);
1894 ok(hres == S_OK, "put_paddingLeft: %08x\n", hres);
1895
1896 /* BackgroundRepeat */
1897 hres = IHTMLStyle_get_backgroundRepeat(style, &sDefault);
1898 ok(hres == S_OK, "get_backgroundRepeat failed: %08x\n", hres);
1899
1900 str = a2bstr("invalid");
1901 hres = IHTMLStyle_put_backgroundRepeat(style, str);
1902 ok(hres == E_INVALIDARG, "put_backgroundRepeat failed: %08x\n", hres);
1904
1905 str = a2bstr("repeat");
1906 hres = IHTMLStyle_put_backgroundRepeat(style, str);
1907 ok(hres == S_OK, "put_backgroundRepeat failed: %08x\n", hres);
1909
1910 str = a2bstr("no-repeat");
1911 hres = IHTMLStyle_put_backgroundRepeat(style, str);
1912 ok(hres == S_OK, "put_backgroundRepeat failed: %08x\n", hres);
1914
1915 str = a2bstr("repeat-x");
1916 hres = IHTMLStyle_put_backgroundRepeat(style, str);
1917 ok(hres == S_OK, "put_backgroundRepeat failed: %08x\n", hres);
1919
1920 str = a2bstr("repeat-y");
1921 hres = IHTMLStyle_put_backgroundRepeat(style, str);
1922 ok(hres == S_OK, "put_backgroundRepeat failed: %08x\n", hres);
1924
1925 hres = IHTMLStyle_get_backgroundRepeat(style, &str);
1926 ok(hres == S_OK, "get_backgroundRepeat failed: %08x\n", hres);
1927 ok(!strcmp_wa(str, "repeat-y"), "str=%s\n", wine_dbgstr_w(str));
1929
1930 hres = IHTMLStyle_put_backgroundRepeat(style, sDefault);
1931 ok(hres == S_OK, "put_backgroundRepeat failed: %08x\n", hres);
1932 SysFreeString(sDefault);
1933
1934 /* BorderColor */
1935 hres = IHTMLStyle_get_borderColor(style, &sDefault);
1936 ok(hres == S_OK, "get_borderColor failed: %08x\n", hres);
1937
1938 str = a2bstr("red green red blue");
1939 hres = IHTMLStyle_put_borderColor(style, str);
1940 ok(hres == S_OK, "put_borderColor failed: %08x\n", hres);
1942
1943 hres = IHTMLStyle_get_borderColor(style, &str);
1944 ok(hres == S_OK, "get_borderColor failed: %08x\n", hres);
1945 ok(!strcmp_wa(str, "red green red blue"), "str=%s\n", wine_dbgstr_w(str));
1947
1948 hres = IHTMLStyle_put_borderColor(style, sDefault);
1949 ok(hres == S_OK, "put_borderColor failed: %08x\n", hres);
1950 SysFreeString(sDefault);
1951
1952 /* BorderRight */
1953 hres = IHTMLStyle_get_borderRight(style, &sDefault);
1954 ok(hres == S_OK, "get_borderRight failed: %08x\n", hres);
1955
1956 str = a2bstr("thick dotted red");
1957 hres = IHTMLStyle_put_borderRight(style, str);
1958 ok(hres == S_OK, "put_borderRight failed: %08x\n", hres);
1960
1961 /* IHTMLStyle_get_borderRight appears to have a bug where
1962 it returns the first letter of the color. So we check
1963 each style individually.
1964 */
1965 V_BSTR(&v) = NULL;
1966 hres = IHTMLStyle_get_borderRightColor(style, &v);
1967 ok(hres == S_OK, "get_borderRightColor failed: %08x\n", hres);
1968 ok(!strcmp_wa(V_BSTR(&v), "red"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
1969 VariantClear(&v);
1970
1971 V_BSTR(&v) = NULL;
1972 hres = IHTMLStyle_get_borderRightWidth(style, &v);
1973 ok(hres == S_OK, "get_borderRightWidth failed: %08x\n", hres);
1974 ok(!strcmp_wa(V_BSTR(&v), "thick"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
1975 VariantClear(&v);
1976
1977 hres = IHTMLStyle_get_borderRightStyle(style, &str);
1978 ok(hres == S_OK, "get_borderRightStyle failed: %08x\n", hres);
1979 ok(!strcmp_wa(str, "dotted"), "str=%s\n", wine_dbgstr_w(str));
1981
1982 hres = IHTMLStyle_put_borderRight(style, sDefault);
1983 ok(hres == S_OK, "put_borderRight failed: %08x\n", hres);
1984 SysFreeString(sDefault);
1985
1986 /* BorderTop */
1987 hres = IHTMLStyle_get_borderTop(style, &sDefault);
1988 ok(hres == S_OK, "get_borderTop failed: %08x\n", hres);
1989
1990 str = a2bstr("thick dotted red");
1991 hres = IHTMLStyle_put_borderTop(style, str);
1992 ok(hres == S_OK, "put_borderTop failed: %08x\n", hres);
1994
1995 /* IHTMLStyle_get_borderTop appears to have a bug where
1996 it returns the first letter of the color. So we check
1997 each style individually.
1998 */
1999 V_BSTR(&v) = NULL;
2000 hres = IHTMLStyle_get_borderTopColor(style, &v);
2001 ok(hres == S_OK, "get_borderTopColor failed: %08x\n", hres);
2002 ok(!strcmp_wa(V_BSTR(&v), "red"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
2003 VariantClear(&v);
2004
2005 V_BSTR(&v) = NULL;
2006 hres = IHTMLStyle_get_borderTopWidth(style, &v);
2007 ok(hres == S_OK, "get_borderTopWidth failed: %08x\n", hres);
2008 ok(!strcmp_wa(V_BSTR(&v), "thick"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
2009 VariantClear(&v);
2010
2011 hres = IHTMLStyle_get_borderTopStyle(style, &str);
2012 ok(hres == S_OK, "get_borderTopStyle failed: %08x\n", hres);
2013 ok(!strcmp_wa(str, "dotted"), "str=%s\n", wine_dbgstr_w(str));
2015
2016 hres = IHTMLStyle_put_borderTop(style, sDefault);
2017 ok(hres == S_OK, "put_borderTop failed: %08x\n", hres);
2018 SysFreeString(sDefault);
2019
2020 /* BorderBottom */
2021 hres = IHTMLStyle_get_borderBottom(style, &sDefault);
2022 ok(hres == S_OK, "get_borderBottom failed: %08x\n", hres);
2023
2024 str = a2bstr("thick dotted red");
2025 hres = IHTMLStyle_put_borderBottom(style, str);
2026 ok(hres == S_OK, "put_borderBottom failed: %08x\n", hres);
2028
2029 /* IHTMLStyle_get_borderBottom appears to have a bug where
2030 it returns the first letter of the color. So we check
2031 each style individually.
2032 */
2033 V_BSTR(&v) = NULL;
2034 hres = IHTMLStyle_get_borderBottomColor(style, &v);
2035 ok(hres == S_OK, "get_borderBottomColor failed: %08x\n", hres);
2036 ok(!strcmp_wa(V_BSTR(&v), "red"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
2037 VariantClear(&v);
2038
2039 V_BSTR(&v) = NULL;
2040 hres = IHTMLStyle_get_borderBottomWidth(style, &v);
2041 ok(hres == S_OK, "get_borderBottomWidth failed: %08x\n", hres);
2042 ok(!strcmp_wa(V_BSTR(&v), "thick"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
2043 VariantClear(&v);
2044
2045 hres = IHTMLStyle_get_borderBottomStyle(style, &str);
2046 ok(hres == S_OK, "get_borderBottomStyle failed: %08x\n", hres);
2047 ok(!strcmp_wa(str, "dotted"), "str=%s\n", wine_dbgstr_w(str));
2049
2050 hres = IHTMLStyle_put_borderBottom(style, sDefault);
2051 ok(hres == S_OK, "put_borderBottom failed: %08x\n", hres);
2052 SysFreeString(sDefault);
2053
2054 /* BorderLeft */
2055 hres = IHTMLStyle_get_borderLeft(style, &sDefault);
2056 ok(hres == S_OK, "get_borderLeft failed: %08x\n", hres);
2057
2058 str = a2bstr("thick dotted red");
2059 hres = IHTMLStyle_put_borderLeft(style, str);
2060 ok(hres == S_OK, "put_borderLeft failed: %08x\n", hres);
2062
2063 /* IHTMLStyle_get_borderLeft appears to have a bug where
2064 it returns the first letter of the color. So we check
2065 each style individually.
2066 */
2067 V_BSTR(&v) = NULL;
2068 hres = IHTMLStyle_get_borderLeftColor(style, &v);
2069 ok(hres == S_OK, "get_borderLeftColor failed: %08x\n", hres);
2070 ok(!strcmp_wa(V_BSTR(&v), "red"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
2071 VariantClear(&v);
2072
2073 V_BSTR(&v) = NULL;
2074 hres = IHTMLStyle_get_borderLeftWidth(style, &v);
2075 ok(hres == S_OK, "get_borderLeftWidth failed: %08x\n", hres);
2076 ok(!strcmp_wa(V_BSTR(&v), "thick"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
2077 VariantClear(&v);
2078
2079 hres = IHTMLStyle_get_borderLeftStyle(style, &str);
2080 ok(hres == S_OK, "get_borderLeftStyle failed: %08x\n", hres);
2081 ok(!strcmp_wa(str, "dotted"), "str=%s\n", wine_dbgstr_w(str));
2083
2084 hres = IHTMLStyle_put_borderLeft(style, sDefault);
2085 ok(hres == S_OK, "put_borderLeft failed: %08x\n", hres);
2086 SysFreeString(sDefault);
2087
2088 /* backgroundPositionX */
2089 hres = IHTMLStyle_get_backgroundPositionX(style, &v);
2090 ok(hres == S_OK, "get_backgroundPositionX failed: %08x\n", hres);
2091 ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
2092 ok(!V_BSTR(&v), "backgroundPositionX = %s\n", wine_dbgstr_w(V_BSTR(&v)));
2093 VariantClear(&v);
2094
2095 V_VT(&v) = VT_BSTR;
2096 V_BSTR(&v) = a2bstr("10px");
2097 hres = IHTMLStyle_put_backgroundPositionX(style, v);
2098 ok(hres == S_OK, "put_backgroundPositionX failed: %08x\n", hres);
2099 VariantClear(&v);
2100
2101 hres = IHTMLStyle_get_backgroundPositionX(style, &v);
2102 ok(hres == S_OK, "get_backgroundPositionX failed: %08x\n", hres);
2103 ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
2104 ok(!strcmp_wa(V_BSTR(&v), "10px"), "backgroundPositionX = %s\n", wine_dbgstr_w(V_BSTR(&v)));
2105 VariantClear(&v);
2106
2107 /* backgroundPositionY */
2108 hres = IHTMLStyle_get_backgroundPositionY(style, &v);
2109 ok(hres == S_OK, "get_backgroundPositionY failed: %08x\n", hres);
2110 ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
2111 VariantClear(&v);
2112
2113 V_VT(&v) = VT_BSTR;
2114 V_BSTR(&v) = a2bstr("15px");
2115 hres = IHTMLStyle_put_backgroundPositionY(style, v);
2116 ok(hres == S_OK, "put_backgroundPositionY failed: %08x\n", hres);
2117 VariantClear(&v);
2118
2119 hres = IHTMLStyle_get_backgroundPositionY(style, &v);
2120 ok(hres == S_OK, "get_backgroundPositionY failed: %08x\n", hres);
2121 ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
2122 ok(!strcmp_wa(V_BSTR(&v), "15px"), "backgroundPositionY = %s\n", wine_dbgstr_w(V_BSTR(&v)));
2123 VariantClear(&v);
2124
2125 /* backgroundPosition */
2126 str = NULL;
2127 hres = IHTMLStyle_get_backgroundPosition(style, &str);
2128 ok(hres == S_OK, "get_backgroundPosition failed: %08x\n", hres);
2129 ok(!strcmp_wa(str, "10px 15px"), "backgroundPosition = %s\n", wine_dbgstr_w(str));
2131
2132 str = a2bstr("center 20%");
2133 hres = IHTMLStyle_put_backgroundPosition(style, str);
2134 ok(hres == S_OK, "put_backgroundPosition failed: %08x\n", hres);
2136
2137 str = NULL;
2138 hres = IHTMLStyle_get_backgroundPosition(style, &str);
2139 ok(hres == S_OK, "get_backgroundPosition failed: %08x\n", hres);
2140 ok(!strcmp_wa(str, "center 20%"), "backgroundPosition = %s\n", wine_dbgstr_w(str));
2142
2143 hres = IHTMLStyle_get_backgroundPositionX(style, &v);
2144 ok(hres == S_OK, "get_backgroundPositionX failed: %08x\n", hres);
2145 ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
2146 ok(!strcmp_wa(V_BSTR(&v), "center"), "backgroundPositionX = %s\n", wine_dbgstr_w(V_BSTR(&v)));
2147 VariantClear(&v);
2148
2149 hres = IHTMLStyle_get_backgroundPositionY(style, &v);
2150 ok(hres == S_OK, "get_backgroundPositionY failed: %08x\n", hres);
2151 ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
2152 ok(!strcmp_wa(V_BSTR(&v), "20%"), "backgroundPositionY = %s\n", wine_dbgstr_w(V_BSTR(&v)));
2153 VariantClear(&v);
2154
2155 /* borderTopWidth */
2156 hres = IHTMLStyle_get_borderTopWidth(style, &vDefault);
2157 ok(hres == S_OK, "get_borderTopWidth: %08x\n", hres);
2158
2159 V_VT(&v) = VT_BSTR;
2160 V_BSTR(&v) = a2bstr("10px");
2161 hres = IHTMLStyle_put_borderTopWidth(style, v);
2162 ok(hres == S_OK, "put_borderTopWidth: %08x\n", hres);
2163 VariantClear(&v);
2164
2165 hres = IHTMLStyle_get_borderTopWidth(style, &v);
2166 ok(hres == S_OK, "get_borderTopWidth: %08x\n", hres);
2167 ok(!strcmp_wa(V_BSTR(&v), "10px"), "expected 10px = %s\n", wine_dbgstr_w(V_BSTR(&v)));
2168 VariantClear(&v);
2169
2170 hres = IHTMLStyle_put_borderTopWidth(style, vDefault);
2171 ok(hres == S_OK, "put_borderTopWidth: %08x\n", hres);
2172 VariantClear(&vDefault);
2173
2174 /* borderRightWidth */
2175 hres = IHTMLStyle_get_borderRightWidth(style, &vDefault);
2176 ok(hres == S_OK, "get_borderRightWidth: %08x\n", hres);
2177
2178 V_VT(&v) = VT_BSTR;
2179 V_BSTR(&v) = a2bstr("10");
2180 hres = IHTMLStyle_put_borderRightWidth(style, v);
2181 ok(hres == S_OK, "put_borderRightWidth: %08x\n", hres);
2182 VariantClear(&v);
2183
2184 hres = IHTMLStyle_get_borderRightWidth(style, &v);
2185 ok(hres == S_OK, "get_borderRightWidth: %08x\n", hres);
2186 ok(!strcmp_wa(V_BSTR(&v), "10px"), "expected 10px = %s\n", wine_dbgstr_w(V_BSTR(&v)));
2187 VariantClear(&v);
2188
2189 hres = IHTMLStyle_put_borderRightWidth(style, vDefault);
2190 ok(hres == S_OK, "put_borderRightWidth: %08x\n", hres);
2191 VariantClear(&vDefault);
2192
2193 /* borderBottomWidth */
2194 hres = IHTMLStyle_get_borderBottomWidth(style, &vDefault);
2195 ok(hres == S_OK, "get_borderBottomWidth: %08x\n", hres);
2196
2197 V_VT(&v) = VT_BSTR;
2198 V_BSTR(&v) = a2bstr("10");
2199 hres = IHTMLStyle_put_borderBottomWidth(style, v);
2200 ok(hres == S_OK, "put_borderBottomWidth: %08x\n", hres);
2201 VariantClear(&v);
2202
2203 hres = IHTMLStyle_get_borderBottomWidth(style, &v);
2204 ok(hres == S_OK, "get_borderBottomWidth: %08x\n", hres);
2205 ok(!strcmp_wa(V_BSTR(&v), "10px"), "expected 10px = %s\n", wine_dbgstr_w(V_BSTR(&v)));
2206 VariantClear(&v);
2207
2208 hres = IHTMLStyle_put_borderBottomWidth(style, vDefault);
2209 ok(hres == S_OK, "put_borderBottomWidth: %08x\n", hres);
2210 VariantClear(&vDefault);
2211
2212 /* borderLeftWidth */
2213 hres = IHTMLStyle_get_borderLeftWidth(style, &vDefault);
2214 ok(hres == S_OK, "get_borderLeftWidth: %08x\n", hres);
2215
2216 V_VT(&v) = VT_BSTR;
2217 V_BSTR(&v) = a2bstr("10");
2218 hres = IHTMLStyle_put_borderLeftWidth(style, v);
2219 ok(hres == S_OK, "put_borderLeftWidth: %08x\n", hres);
2220 VariantClear(&v);
2221
2222 hres = IHTMLStyle_get_borderLeftWidth(style, &v);
2223 ok(hres == S_OK, "get_borderLeftWidth: %08x\n", hres);
2224 ok(!strcmp_wa(V_BSTR(&v), "10px"), "expected 10px = %s\n", wine_dbgstr_w(V_BSTR(&v)));
2225 VariantClear(&v);
2226
2227 hres = IHTMLStyle_put_borderLeftWidth(style, vDefault);
2228 ok(hres == S_OK, "put_borderLeftWidth: %08x\n", hres);
2229 VariantClear(&vDefault);
2230
2231 /* wordSpacing */
2232 hres = IHTMLStyle_get_wordSpacing(style, &vDefault);
2233 ok(hres == S_OK, "get_wordSpacing: %08x\n", hres);
2234
2235 V_VT(&v) = VT_BSTR;
2236 V_BSTR(&v) = a2bstr("10");
2237 hres = IHTMLStyle_put_wordSpacing(style, v);
2238 ok(hres == S_OK, "put_wordSpacing: %08x\n", hres);
2239 VariantClear(&v);
2240
2241 hres = IHTMLStyle_get_wordSpacing(style, &v);
2242 ok(hres == S_OK, "get_wordSpacing: %08x\n", hres);
2243 ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
2244 ok(!strcmp_wa(V_BSTR(&v), "10px"), "expected 10px = %s\n", wine_dbgstr_w(V_BSTR(&v)));
2245 VariantClear(&v);
2246
2247 hres = IHTMLStyle_put_wordSpacing(style, vDefault);
2248 ok(hres == S_OK, "put_wordSpacing: %08x\n", hres);
2249 VariantClear(&vDefault);
2250
2251 /* letterSpacing */
2252 hres = IHTMLStyle_get_letterSpacing(style, &vDefault);
2253 ok(hres == S_OK, "get_letterSpacing: %08x\n", hres);
2254
2255 V_VT(&v) = VT_BSTR;
2256 V_BSTR(&v) = a2bstr("11");
2257 hres = IHTMLStyle_put_letterSpacing(style, v);
2258 ok(hres == S_OK, "put_letterSpacing: %08x\n", hres);
2259 VariantClear(&v);
2260
2261 hres = IHTMLStyle_get_letterSpacing(style, &v);
2262 ok(hres == S_OK, "get_letterSpacing: %08x\n", hres);
2263 ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
2264 ok(!strcmp_wa(V_BSTR(&v), "11px"), "expected 10px = %s\n", wine_dbgstr_w(V_BSTR(&v)));
2265 VariantClear(&v);
2266
2267 hres = IHTMLStyle_put_letterSpacing(style, vDefault);
2268 ok(hres == S_OK, "put_letterSpacing: %08x\n", hres);
2269 VariantClear(&vDefault);
2270
2271 /* borderTopColor */
2272 hres = IHTMLStyle_get_borderTopColor(style, &vDefault);
2273 ok(hres == S_OK, "get_borderTopColor: %08x\n", hres);
2274
2275 V_VT(&v) = VT_BSTR;
2276 V_BSTR(&v) = a2bstr("red");
2277 hres = IHTMLStyle_put_borderTopColor(style, v);
2278 ok(hres == S_OK, "put_borderTopColor: %08x\n", hres);
2279 VariantClear(&v);
2280
2281 hres = IHTMLStyle_get_borderTopColor(style, &v);
2282 ok(hres == S_OK, "get_borderTopColor: %08x\n", hres);
2283 ok(!strcmp_wa(V_BSTR(&v), "red"), "expecte red = %s\n", wine_dbgstr_w(V_BSTR(&v)));
2284 VariantClear(&v);
2285
2286 hres = IHTMLStyle_put_borderTopColor(style, vDefault);
2287 ok(hres == S_OK, "put_borderTopColor: %08x\n", hres);
2288
2289 /* borderRightColor */
2290 hres = IHTMLStyle_get_borderRightColor(style, &vDefault);
2291 ok(hres == S_OK, "get_borderRightColor: %08x\n", hres);
2292
2293 V_VT(&v) = VT_BSTR;
2294 V_BSTR(&v) = a2bstr("blue");
2295 hres = IHTMLStyle_put_borderRightColor(style, v);
2296 ok(hres == S_OK, "put_borderRightColor: %08x\n", hres);
2297 VariantClear(&v);
2298
2299 hres = IHTMLStyle_get_borderRightColor(style, &v);
2300 ok(hres == S_OK, "get_borderRightColor: %08x\n", hres);
2301 ok(!strcmp_wa(V_BSTR(&v), "blue"), "expected blue = %s\n", wine_dbgstr_w(V_BSTR(&v)));
2302 VariantClear(&v);
2303
2304 hres = IHTMLStyle_put_borderRightColor(style, vDefault);
2305 ok(hres == S_OK, "putborderRightColorr: %08x\n", hres);
2306
2307 /* borderBottomColor */
2308 hres = IHTMLStyle_get_borderBottomColor(style, &vDefault);
2309 ok(hres == S_OK, "get_borderBottomColor: %08x\n", hres);
2310
2311 V_VT(&v) = VT_BSTR;
2312 V_BSTR(&v) = a2bstr("cyan");
2313 hres = IHTMLStyle_put_borderBottomColor(style, v);
2314 ok(hres == S_OK, "put_borderBottomColor: %08x\n", hres);
2315 VariantClear(&v);
2316
2317 hres = IHTMLStyle_get_borderBottomColor(style, &v);
2318 ok(hres == S_OK, "get_borderBottomColor: %08x\n", hres);
2319 ok(!strcmp_wa(V_BSTR(&v), "cyan"), "expected cyan = %s\n", wine_dbgstr_w(V_BSTR(&v)));
2320 VariantClear(&v);
2321
2322 hres = IHTMLStyle_put_borderBottomColor(style, vDefault);
2323 ok(hres == S_OK, "put_borderBottomColor: %08x\n", hres);
2324
2325 /* borderLeftColor */
2326 hres = IHTMLStyle_get_borderLeftColor(style, &vDefault);
2327 ok(hres == S_OK, "get_borderLeftColor: %08x\n", hres);
2328
2329 V_VT(&v) = VT_BSTR;
2330 V_BSTR(&v) = a2bstr("cyan");
2331 hres = IHTMLStyle_put_borderLeftColor(style, v);
2332 ok(hres == S_OK, "put_borderLeftColor: %08x\n", hres);
2333 VariantClear(&v);
2334
2335 hres = IHTMLStyle_get_borderLeftColor(style, &v);
2336 ok(hres == S_OK, "get_borderLeftColor: %08x\n", hres);
2337 ok(!strcmp_wa(V_BSTR(&v), "cyan"), "expected cyan = %s\n", wine_dbgstr_w(V_BSTR(&v)));
2338 VariantClear(&v);
2339
2340 hres = IHTMLStyle_put_borderLeftColor(style, vDefault);
2341 ok(hres == S_OK, "put_borderLeftColor: %08x\n", hres);
2342
2343 /* clip */
2344 hres = IHTMLStyle_get_clip(style, &str);
2345 ok(hres == S_OK, "get_clip failed: %08x\n", hres);
2346 ok(!str, "clip = %s\n", wine_dbgstr_w(str));
2347
2348 str = a2bstr("rect(0px 1px 500px 505px)");
2349 hres = IHTMLStyle_put_clip(style, str);
2350 ok(hres == S_OK, "put_clip failed: %08x\n", hres);
2352
2353 hres = IHTMLStyle_get_clip(style, &str);
2354 ok(hres == S_OK, "get_clip failed: %08x\n", hres);
2355 ok(!strcmp_wa(str, "rect(0px 1px 500px 505px)"), "clip = %s\n", wine_dbgstr_w(str));
2357
2358 /* clear */
2359 hres = IHTMLStyle_get_clear(style, &str);
2360 ok(hres == S_OK, "get_clear failed: %08x\n", hres);
2361 ok(!str, "clear = %s\n", wine_dbgstr_w(str));
2362
2363 str = a2bstr("both");
2364 hres = IHTMLStyle_put_clear(style, str);
2365 ok(hres == S_OK, "put_clear failed: %08x\n", hres);
2367
2368 hres = IHTMLStyle_get_clear(style, &str);
2369 ok(hres == S_OK, "get_clear failed: %08x\n", hres);
2370 ok(!strcmp_wa(str, "both"), "clear = %s\n", wine_dbgstr_w(str));
2372
2373 /* pageBreakAfter */
2374 hres = IHTMLStyle_get_pageBreakAfter(style, &str);
2375 ok(hres == S_OK, "get_pageBreakAfter failed: %08x\n", hres);
2376 ok(!str, "pageBreakAfter = %s\n", wine_dbgstr_w(str));
2377
2378 str = a2bstr("always");
2379 hres = IHTMLStyle_put_pageBreakAfter(style, str);
2380 ok(hres == S_OK, "put_pageBreakAfter failed: %08x\n", hres);
2382
2383 hres = IHTMLStyle_get_pageBreakAfter(style, &str);
2384 ok(hres == S_OK, "get_pageBreakAfter failed: %08x\n", hres);
2385 ok(!strcmp_wa(str, "always"), "pageBreakAfter = %s\n", wine_dbgstr_w(str));
2387
2388 /* pageBreakBefore */
2389 hres = IHTMLStyle_get_pageBreakBefore(style, &str);
2390 ok(hres == S_OK, "get_pageBreakBefore failed: %08x\n", hres);
2391 ok(!str, "pageBreakBefore = %s\n", wine_dbgstr_w(str));
2392
2393 str = a2bstr("always");
2394 hres = IHTMLStyle_put_pageBreakBefore(style, str);
2395 ok(hres == S_OK, "put_pageBreakBefore failed: %08x\n", hres);
2397
2398 hres = IHTMLStyle_get_pageBreakBefore(style, &str);
2399 ok(hres == S_OK, "get_pageBreakBefore failed: %08x\n", hres);
2400 ok(!strcmp_wa(str, "always"), "pageBreakBefore = %s\n", wine_dbgstr_w(str));
2402
2403 test_style_remove_attribute(style, "pageBreakBefore", VARIANT_TRUE);
2404 test_style_remove_attribute(style, "pageBreakBefore", VARIANT_FALSE);
2405
2406 hres = IHTMLStyle_get_pageBreakBefore(style, &str);
2407 ok(hres == S_OK, "get_pageBreakBefore failed: %08x\n", hres);
2408 ok(!str, "pageBreakBefore = %s\n", wine_dbgstr_w(str));
2409
2410 str = (void*)0xdeadbeef;
2411 hres = IHTMLStyle_get_whiteSpace(style, &str);
2412 ok(hres == S_OK, "get_whiteSpace failed: %08x\n", hres);
2413 ok(!str, "whiteSpace = %s\n", wine_dbgstr_w(str));
2414
2415 str = a2bstr("nowrap");
2416 hres = IHTMLStyle_put_whiteSpace(style, str);
2418 ok(hres == S_OK, "put_whiteSpace failed: %08x\n", hres);
2419
2420 str = NULL;
2421 hres = IHTMLStyle_get_whiteSpace(style, &str);
2422 ok(hres == S_OK, "get_whiteSpace failed: %08x\n", hres);
2423 ok(!strcmp_wa(str, "nowrap"), "whiteSpace = %s\n", wine_dbgstr_w(str));
2425
2426 str = a2bstr("normal");
2427 hres = IHTMLStyle_put_whiteSpace(style, str);
2429 ok(hres == S_OK, "put_whiteSpace failed: %08x\n", hres);
2430
2431 str = NULL;
2432 hres = IHTMLStyle_get_whiteSpace(style, &str);
2433 ok(hres == S_OK, "get_whiteSpace failed: %08x\n", hres);
2434 ok(!strcmp_wa(str, "normal"), "whiteSpace = %s\n", wine_dbgstr_w(str));
2436
2437 /* listStyleType */
2438 hres = IHTMLStyle_get_listStyleType(style, &str);
2439 ok(hres == S_OK, "get_listStyleType failed: %08x\n", hres);
2440 ok(!str, "listStyleType = %s\n", wine_dbgstr_w(str));
2441
2442 str = a2bstr("square");
2443 hres = IHTMLStyle_put_listStyleType(style, str);
2444 ok(hres == S_OK, "put_listStyleType failed: %08x\n", hres);
2446
2447 str = NULL;
2448 hres = IHTMLStyle_get_listStyleType(style, &str);
2449 ok(hres == S_OK, "get_listStyleType failed: %08x\n", hres);
2450 ok(!strcmp_wa(str, "square"), "listStyleType = %s\n", wine_dbgstr_w(str));
2451
2452 str = a2bstr("inside");
2453 hres = IHTMLStyle_put_listStylePosition(style, str);
2454 ok(hres == S_OK, "put_listStylePosition failed: %08x\n", hres);
2456
2457 hres = IHTMLStyle_get_listStylePosition(style, &str);
2458 ok(hres == S_OK, "get_listStylePosition failed: %08x\n", hres);
2459 ok(!strcmp_wa(str, "inside"), "listStyleType = %s\n", wine_dbgstr_w(str));
2461
2462 str = a2bstr("decimal-leading-zero none inside");
2463 hres = IHTMLStyle_put_listStyle(style, str);
2464 ok(hres == S_OK || broken(hres == E_INVALIDARG), /* win 2000 */
2465 "put_listStyle(%s) failed: %08x\n", wine_dbgstr_w(str), hres);
2467
2468 if (hres != E_INVALIDARG) {
2469 hres = IHTMLStyle_get_listStyle(style, &str);
2470 ok(hres == S_OK, "get_listStyle failed: %08x\n", hres);
2471 ok(strstr_wa(str, "decimal-leading-zero") &&
2472 strstr_wa(str, "none") != NULL &&
2473 strstr_wa(str, "inside") != NULL,
2474 "listStyle = %s\n", wine_dbgstr_w(str));
2476 } else {
2477 win_skip("IHTMLStyle_put_listStyle already failed\n");
2478 }
2479
2480 str = (void*)0xdeadbeef;
2481 hres = IHTMLStyle_get_styleFloat(style, &str);
2482 ok(hres == S_OK, "get_styleFloat failed: %08x\n", hres);
2483 ok(!str, "styleFloat = %s\n", wine_dbgstr_w(str));
2484
2485 str = a2bstr("left");
2486 hres = IHTMLStyle_put_styleFloat(style, str);
2487 ok(hres == S_OK, "put_styleFloat failed: %08x\n", hres);
2489
2490 str = NULL;
2491 hres = IHTMLStyle_get_styleFloat(style, &str);
2492 ok(hres == S_OK, "get_styleFloat failed: %08x\n", hres);
2493 ok(!strcmp_wa(str, "left"), "styleFloat = %s\n", wine_dbgstr_w(str));
2494
2495 hres = IHTMLStyle_QueryInterface(style, &IID_IHTMLStyle2, (void**)&style2);
2496 ok(hres == S_OK, "Could not get IHTMLStyle2 iface: %08x\n", hres);
2497 if(SUCCEEDED(hres)) {
2498 test_style2(style2);
2499 IHTMLStyle2_Release(style2);
2500 }
2501
2502 hres = IHTMLStyle_QueryInterface(style, &IID_IHTMLStyle3, (void**)&style3);
2503 ok(hres == S_OK, "Could not get IHTMLStyle3 iface: %08x\n", hres);
2504 if(SUCCEEDED(hres)) {
2505 test_style3(style3);
2506 IHTMLStyle3_Release(style3);
2507 }
2508
2509 hres = IHTMLStyle_QueryInterface(style, &IID_IHTMLStyle4, (void**)&style4);
2510 ok(hres == S_OK, "Could not get IHTMLStyle4 iface: %08x\n", hres);
2511 if(SUCCEEDED(hres)) {
2512 test_style4(style4);
2513 IHTMLStyle4_Release(style4);
2514 }
2515
2516 hres = IHTMLStyle_QueryInterface(style, &IID_IHTMLStyle5, (void**)&style5);
2517 if(SUCCEEDED(hres)) {
2518 test_style5(style5);
2519 IHTMLStyle5_Release(style5);
2520 }else {
2521 win_skip("IHTMLStyle5 not available\n");
2522 }
2523
2524 hres = IHTMLStyle_QueryInterface(style, &IID_IHTMLStyle6, (void**)&style6);
2525 if(SUCCEEDED(hres)) {
2526 test_style6(style6);
2527 IHTMLStyle6_Release(style6);
2528 }else {
2529 win_skip("IHTMLStyle6 not available\n");
2530 }
2531}
r l[0]
Definition: byte_order.h:168
#define E_INVALIDARG
Definition: ddrawi.h:101
@ VT_NULL
Definition: compat.h:2296
@ VT_I4
Definition: compat.h:2298
@ VT_EMPTY
Definition: compat.h:2295
GLfloat f
Definition: glext.h:7540
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define f
Definition: ke_i.h:83
static void test_style3(IHTMLStyle3 *style3)
Definition: style.c:442
static void test_style4(IHTMLStyle4 *style4)
Definition: style.c:496
static void test_style5(IHTMLStyle5 *style5)
Definition: style.c:522
#define test_style_remove_attribute(a, b, c)
Definition: style.c:267
static void test_style2(IHTMLStyle2 *style2)
Definition: