Release 1.4-rc5.
[wine] / dlls / mshtml / tests / style.c
1 /*
2  * Copyright 2007-2011 Jacek Caban for CodeWeavers
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17  */
18
19 #define COBJMACROS
20 #define CONST_VTABLE
21
22 #include <wine/test.h>
23 #include <stdarg.h>
24 #include <stdio.h>
25
26 #include "windef.h"
27 #include "winbase.h"
28 #include "ole2.h"
29 #include "mshtml.h"
30 #include "mshtmhst.h"
31 #include "docobj.h"
32
33 static int strcmp_wa(LPCWSTR strw, const char *stra)
34 {
35     CHAR buf[512];
36     WideCharToMultiByte(CP_ACP, 0, strw, -1, buf, sizeof(buf), NULL, NULL);
37     return lstrcmpA(stra, buf);
38 }
39
40 static BSTR a2bstr(const char *str)
41 {
42     BSTR ret;
43     int len;
44
45     if(!str)
46         return NULL;
47
48     len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
49     ret = SysAllocStringLen(NULL, len);
50     MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
51
52     return ret;
53 }
54
55 static IHTMLElement *get_element_by_id(IHTMLDocument2 *doc, const char *id)
56 {
57     HRESULT hres;
58     IHTMLDocument3 *doc3;
59     IHTMLElement *result;
60     BSTR idW = a2bstr(id);
61
62     hres = IHTMLDocument2_QueryInterface(doc, &IID_IHTMLDocument3, (void**)&doc3);
63     ok(hres == S_OK, "QueryInterface(IID_IHTMLDocument3) failed: %08x\n", hres);
64
65     hres = IHTMLDocument3_getElementById(doc3, idW, &result);
66     ok(hres == S_OK, "getElementById failed: %08x\n", hres);
67     ok(result != NULL, "result == NULL\n");
68     SysFreeString(idW);
69
70     IHTMLDocument3_Release(doc3);
71     return result;
72 }
73
74 #define get_current_style(e) _get_current_style(__LINE__,e)
75 static IHTMLCurrentStyle *_get_current_style(unsigned line, IHTMLElement *elem)
76 {
77     IHTMLCurrentStyle *cstyle;
78     IHTMLElement2 *elem2;
79     HRESULT hres;
80
81     hres = IHTMLElement_QueryInterface(elem, &IID_IHTMLElement2, (void**)&elem2);
82     ok(hres == S_OK, "Could not get IHTMLElement2 iface: %08x\n", hres);
83
84     cstyle = NULL;
85     hres = IHTMLElement2_get_currentStyle(elem2, &cstyle);
86     ok(hres == S_OK, "get_currentStyle failed: %08x\n", hres);
87     ok(cstyle != NULL, "cstyle = %p\n", cstyle);
88
89     IHTMLElement2_Release(elem2);
90     return cstyle;
91 }
92
93 #define test_border_styles(p, n) _test_border_styles(__LINE__, p, n)
94 static void _test_border_styles(unsigned line, IHTMLStyle *pStyle, BSTR Name)
95 {
96     HRESULT hres;
97     DISPID dispid;
98
99     hres = IHTMLStyle_GetIDsOfNames(pStyle, &IID_NULL, &Name, 1,
100                         LOCALE_USER_DEFAULT, &dispid);
101     ok_(__FILE__,line) (hres == S_OK, "GetIDsOfNames: %08x\n", hres);
102     if(hres == S_OK)
103     {
104         DISPPARAMS params = {NULL,NULL,0,0};
105         DISPID dispidNamed = DISPID_PROPERTYPUT;
106         VARIANT ret;
107         VARIANT vDefault;
108         VARIANTARG arg;
109
110         hres = IHTMLStyle_Invoke(pStyle, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
111             DISPATCH_PROPERTYGET, &params, &vDefault, NULL, NULL);
112         ok_(__FILE__,line) (hres == S_OK, "get_default. ret: %08x\n", hres);
113
114         params.cArgs = 1;
115         params.cNamedArgs = 1;
116         params.rgdispidNamedArgs = &dispidNamed;
117         V_VT(&arg) = VT_BSTR;
118         V_BSTR(&arg) = a2bstr("none");
119         params.rgvarg = &arg;
120         hres = IHTMLStyle_Invoke(pStyle, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
121             DISPATCH_PROPERTYPUT, &params, &ret, NULL, NULL);
122         ok_(__FILE__,line) (hres == S_OK, "none. ret: %08x\n", hres);
123         VariantClear(&arg);
124
125         V_VT(&arg) = VT_BSTR;
126         V_BSTR(&arg) = a2bstr("dotted");
127         hres = IHTMLStyle_Invoke(pStyle, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
128             DISPATCH_PROPERTYPUT, &params, &ret, NULL, NULL);
129         ok_(__FILE__,line) (hres == S_OK, "dotted. ret: %08x\n", hres);
130         VariantClear(&arg);
131
132         V_VT(&arg) = VT_BSTR;
133         V_BSTR(&arg) = a2bstr("dashed");
134         hres = IHTMLStyle_Invoke(pStyle, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
135         DISPATCH_PROPERTYPUT, &params, &ret, NULL, NULL);
136         ok_(__FILE__,line) (hres == S_OK, "dashed. ret: %08x\n", hres);
137         VariantClear(&arg);
138
139         V_VT(&arg) = VT_BSTR;
140         V_BSTR(&arg) = a2bstr("solid");
141         hres = IHTMLStyle_Invoke(pStyle, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
142             DISPATCH_PROPERTYPUT, &params, &ret, NULL, NULL);
143         ok_(__FILE__,line) (hres == S_OK, "solid. ret: %08x\n", hres);
144         VariantClear(&arg);
145
146         V_VT(&arg) = VT_BSTR;
147         V_BSTR(&arg) = a2bstr("double");
148         hres = IHTMLStyle_Invoke(pStyle, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
149             DISPATCH_PROPERTYPUT, &params, &ret, NULL, NULL);
150         ok_(__FILE__,line) (hres == S_OK, "double. ret: %08x\n", hres);
151         VariantClear(&arg);
152
153         V_VT(&arg) = VT_BSTR;
154         V_BSTR(&arg) = a2bstr("groove");
155         hres = IHTMLStyle_Invoke(pStyle, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
156             DISPATCH_PROPERTYPUT, &params, &ret, NULL, NULL);
157         ok_(__FILE__,line) (hres == S_OK, "groove. ret: %08x\n", hres);
158         VariantClear(&arg);
159
160         V_VT(&arg) = VT_BSTR;
161         V_BSTR(&arg) = a2bstr("ridge");
162         hres = IHTMLStyle_Invoke(pStyle, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
163             DISPATCH_PROPERTYPUT, &params, &ret, NULL, NULL);
164         ok_(__FILE__,line) (hres == S_OK, "ridge. ret: %08x\n", hres);
165         VariantClear(&arg);
166
167         V_VT(&arg) = VT_BSTR;
168         V_BSTR(&arg) = a2bstr("inset");
169         hres = IHTMLStyle_Invoke(pStyle, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
170             DISPATCH_PROPERTYPUT, &params, &ret, NULL, NULL);
171         ok_(__FILE__,line) (hres == S_OK, "inset. ret: %08x\n", hres);
172         VariantClear(&arg);
173
174         V_VT(&arg) = VT_BSTR;
175         V_BSTR(&arg) = a2bstr("outset");
176         hres = IHTMLStyle_Invoke(pStyle, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
177             DISPATCH_PROPERTYPUT, &params, &ret, NULL, NULL);
178         ok_(__FILE__,line) (hres == S_OK, "outset. ret: %08x\n", hres);
179         VariantClear(&arg);
180
181         V_VT(&arg) = VT_BSTR;
182         V_BSTR(&arg) = a2bstr("invalid");
183         hres = IHTMLStyle_Invoke(pStyle, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
184             DISPATCH_PROPERTYPUT, &params, &ret, NULL, NULL);
185         ok_(__FILE__,line) (FAILED(hres), "invalid value passed.\n");
186         VariantClear(&arg);
187
188         params.rgvarg = &vDefault;
189         hres = IHTMLStyle_Invoke(pStyle, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
190             DISPATCH_PROPERTYPUT, &params, &ret, NULL, NULL);
191         ok_(__FILE__,line) (hres == S_OK, "default. ret: %08x\n", hres);
192         VariantClear(&vDefault);
193     }
194 }
195
196 #define test_style_csstext(s,t) _test_style_csstext(__LINE__,s,t)
197 static void _test_style_csstext(unsigned line, IHTMLStyle *style, const char *extext)
198 {
199     BSTR text = (void*)0xdeadbeef;
200     HRESULT hres;
201
202     hres = IHTMLStyle_get_cssText(style, &text);
203     ok_(__FILE__,line)(hres == S_OK, "get_cssText failed: %08x\n", hres);
204     if(extext)
205         ok_(__FILE__,line)(!strcmp_wa(text, extext), "cssText = %s\n", wine_dbgstr_w(text));
206     else
207         ok_(__FILE__,line)(!text, "cssText = %s\n", wine_dbgstr_w(text));
208
209     SysFreeString(text);
210 }
211
212 #define test_style_set_csstext(s,t) _test_style_set_csstext(__LINE__,s,t)
213 static void _test_style_set_csstext(unsigned line, IHTMLStyle *style, const char *text)
214 {
215     BSTR tmp;
216     HRESULT hres;
217
218     tmp = a2bstr(text);
219     hres = IHTMLStyle_put_cssText(style, tmp);
220     ok_(__FILE__,line)(hres == S_OK, "put_cssText failed: %08x\n", hres);
221     SysFreeString(tmp);
222 }
223
224 static void test_set_csstext(IHTMLStyle *style)
225 {
226     VARIANT v;
227     HRESULT hres;
228
229     test_style_set_csstext(style, "background-color: black;");
230
231     hres = IHTMLStyle_get_backgroundColor(style, &v);
232     ok(hres == S_OK, "get_backgroundColor: %08x\n", hres);
233     ok(V_VT(&v) == VT_BSTR, "type failed: %d\n", V_VT(&v));
234     ok(!strcmp_wa(V_BSTR(&v), "black"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
235     VariantClear(&v);
236 }
237
238 static void test_style2(IHTMLStyle2 *style2)
239 {
240     VARIANT v;
241     BSTR str;
242     HRESULT hres;
243
244     str = (void*)0xdeadbeef;
245     hres = IHTMLStyle2_get_position(style2, &str);
246     ok(hres == S_OK, "get_position failed: %08x\n", hres);
247     ok(!str, "str != NULL\n");
248
249     str = a2bstr("absolute");
250     hres = IHTMLStyle2_put_position(style2, str);
251     ok(hres == S_OK, "put_position failed: %08x\n", hres);
252     SysFreeString(str);
253
254     str = NULL;
255     hres = IHTMLStyle2_get_position(style2, &str);
256     ok(hres == S_OK, "get_position failed: %08x\n", hres);
257     ok(!strcmp_wa(str, "absolute"), "get_position returned %s\n", wine_dbgstr_w(str));
258     SysFreeString(str);
259
260     /* Test right */
261     V_VT(&v) = VT_EMPTY;
262     hres = IHTMLStyle2_get_right(style2, &v);
263     ok(hres == S_OK, "get_top failed: %08x\n", hres);
264     ok(V_VT(&v) == VT_BSTR, "V_VT(right)=%d\n", V_VT(&v));
265     ok(!V_BSTR(&v), "V_BSTR(right) != NULL\n");
266     VariantClear(&v);
267
268     V_VT(&v) = VT_BSTR;
269     V_BSTR(&v) = a2bstr("3px");
270     hres = IHTMLStyle2_put_right(style2, v);
271     ok(hres == S_OK, "put_right failed: %08x\n", hres);
272     VariantClear(&v);
273
274     V_VT(&v) = VT_EMPTY;
275     hres = IHTMLStyle2_get_right(style2, &v);
276     ok(hres == S_OK, "get_right failed: %08x\n", hres);
277     ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
278     ok(!strcmp_wa(V_BSTR(&v), "3px"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
279     VariantClear(&v);
280
281     /* direction */
282     str = (void*)0xdeadbeef;
283     hres = IHTMLStyle2_get_direction(style2, &str);
284     ok(hres == S_OK, "get_direction failed: %08x\n", hres);
285     ok(!str, "str = %s\n", wine_dbgstr_w(str));
286
287     str = a2bstr("ltr");
288     hres = IHTMLStyle2_put_direction(style2, str);
289     ok(hres == S_OK, "put_direction failed: %08x\n", hres);
290     SysFreeString(str);
291
292     str = NULL;
293     hres = IHTMLStyle2_get_direction(style2, &str);
294     ok(hres == S_OK, "get_direction failed: %08x\n", hres);
295     ok(!strcmp_wa(str, "ltr"), "str = %s\n", wine_dbgstr_w(str));
296     SysFreeString(str);
297 }
298
299 static void test_style3(IHTMLStyle3 *style3)
300 {
301     BSTR str;
302     HRESULT hres;
303
304     str = (void*)0xdeadbeef;
305     hres = IHTMLStyle3_get_wordWrap(style3, &str);
306     ok(hres == S_OK, "get_wordWrap failed: %08x\n", hres);
307     ok(!str, "str != NULL\n");
308
309     str = a2bstr("break-word");
310     hres = IHTMLStyle3_put_wordWrap(style3, str);
311     ok(hres == S_OK, "put_wordWrap failed: %08x\n", hres);
312     SysFreeString(str);
313
314     str = NULL;
315     hres = IHTMLStyle3_get_wordWrap(style3, &str);
316     ok(hres == S_OK, "get_wordWrap failed: %08x\n", hres);
317     ok(!strcmp_wa(str, "break-word"), "get_wordWrap returned %s\n", wine_dbgstr_w(str));
318     SysFreeString(str);
319 }
320
321 static void test_style4(IHTMLStyle4 *style4)
322 {
323     HRESULT hres;
324     VARIANT v;
325     VARIANT vdefault;
326
327     hres = IHTMLStyle4_get_minHeight(style4, &vdefault);
328     ok(hres == S_OK, "get_minHeight failed: %08x\n", hres);
329
330     V_VT(&v) = VT_BSTR;
331     V_BSTR(&v) = a2bstr("10px");
332     hres = IHTMLStyle4_put_minHeight(style4, v);
333     ok(hres == S_OK, "put_minHeight failed: %08x\n", hres);
334     VariantClear(&v);
335
336     hres = IHTMLStyle4_get_minHeight(style4, &v);
337     ok(hres == S_OK, "get_minHeight failed: %08x\n", hres);
338     ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
339     ok( !strcmp_wa(V_BSTR(&v), "10px"), "expect 10px got (%s)\n", wine_dbgstr_w(V_BSTR(&v)));
340     VariantClear(&v);
341
342     hres = IHTMLStyle4_put_minHeight(style4, vdefault);
343     ok(hres == S_OK, "put_minHeight failed: %08x\n", hres);
344     VariantClear(&vdefault);
345 }
346
347 static void test_body_style(IHTMLStyle *style)
348 {
349     IHTMLStyle2 *style2;
350     IHTMLStyle3 *style3;
351     IHTMLStyle4 *style4;
352     VARIANT_BOOL b;
353     VARIANT v;
354     BSTR str;
355     HRESULT hres;
356     float f;
357     BSTR sOverflowDefault;
358     BSTR sDefault;
359     VARIANT vDefault;
360
361     test_style_csstext(style, NULL);
362
363     hres = IHTMLStyle_get_position(style, &str);
364     ok(hres == S_OK, "get_position failed: %08x\n", hres);
365     ok(!str, "str=%s\n", wine_dbgstr_w(str));
366
367     V_VT(&v) = VT_NULL;
368     hres = IHTMLStyle_get_marginRight(style, &v);
369     ok(hres == S_OK, "get_marginRight failed: %08x\n", hres);
370     ok(V_VT(&v) == VT_BSTR, "V_VT(marginRight) = %d\n", V_VT(&v));
371     ok(!V_BSTR(&v), "V_BSTR(marginRight) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
372
373     V_VT(&v) = VT_I4;
374     V_I4(&v) = 6;
375     hres = IHTMLStyle_put_marginRight(style, v);
376     ok(hres == S_OK, "put_marginRight failed: %08x\n", hres);
377
378     V_VT(&v) = VT_NULL;
379     hres = IHTMLStyle_get_marginRight(style, &v);
380     ok(hres == S_OK, "get_marginRight failed: %08x\n", hres);
381     ok(V_VT(&v) == VT_BSTR, "V_VT(marginRight) = %d\n", V_VT(&v));
382     ok(!strcmp_wa(V_BSTR(&v), "6px"), "V_BSTR(marginRight) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
383
384     V_VT(&v) = VT_NULL;
385     hres = IHTMLStyle_get_marginBottom(style, &v);
386     ok(hres == S_OK, "get_marginBottom failed: %08x\n", hres);
387     ok(V_VT(&v) == VT_BSTR, "V_VT(marginBottom) = %d\n", V_VT(&v));
388     ok(!V_BSTR(&v), "V_BSTR(marginBottom) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
389
390     V_VT(&v) = VT_I4;
391     V_I4(&v) = 6;
392     hres = IHTMLStyle_put_marginBottom(style, v);
393     ok(hres == S_OK, "put_marginBottom failed: %08x\n", hres);
394
395     V_VT(&v) = VT_NULL;
396     hres = IHTMLStyle_get_marginBottom(style, &v);
397     ok(hres == S_OK, "get_marginBottom failed: %08x\n", hres);
398     ok(V_VT(&v) == VT_BSTR, "V_VT(marginBottom) = %d\n", V_VT(&v));
399     ok(!strcmp_wa(V_BSTR(&v), "6px"), "V_BSTR(marginBottom) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
400
401     V_VT(&v) = VT_NULL;
402     hres = IHTMLStyle_get_marginLeft(style, &v);
403     ok(hres == S_OK, "get_marginLeft failed: %08x\n", hres);
404     ok(V_VT(&v) == VT_BSTR, "V_VT(marginLeft) = %d\n", V_VT(&v));
405     ok(!V_BSTR(&v), "V_BSTR(marginLeft) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
406
407     V_VT(&v) = VT_I4;
408     V_I4(&v) = 6;
409     hres = IHTMLStyle_put_marginLeft(style, v);
410     ok(hres == S_OK, "put_marginLeft failed: %08x\n", hres);
411
412     V_VT(&v) = VT_NULL;
413     hres = IHTMLStyle_get_marginLeft(style, &v);
414     ok(hres == S_OK, "get_marginLeft failed: %08x\n", hres);
415     ok(V_VT(&v) == VT_BSTR, "V_VT(marginLeft) = %d\n", V_VT(&v));
416     ok(!strcmp_wa(V_BSTR(&v), "6px"), "V_BSTR(marginLeft) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
417
418     str = (void*)0xdeadbeef;
419     hres = IHTMLStyle_get_fontFamily(style, &str);
420     ok(hres == S_OK, "get_fontFamily failed: %08x\n", hres);
421     ok(!str, "fontFamily = %s\n", wine_dbgstr_w(str));
422
423     str = (void*)0xdeadbeef;
424     hres = IHTMLStyle_get_fontWeight(style, &str);
425     ok(hres == S_OK, "get_fontWeight failed: %08x\n", hres);
426     ok(!str, "fontWeight = %s\n", wine_dbgstr_w(str));
427
428     hres = IHTMLStyle_get_fontWeight(style, &sDefault);
429     ok(hres == S_OK, "get_fontWeight failed: %08x\n", hres);
430
431     str = a2bstr("test");
432     hres = IHTMLStyle_put_fontWeight(style, str);
433     ok(hres == E_INVALIDARG, "put_fontWeight failed: %08x\n", hres);
434     SysFreeString(str);
435
436     str = a2bstr("bold");
437     hres = IHTMLStyle_put_fontWeight(style, str);
438     ok(hres == S_OK, "put_fontWeight failed: %08x\n", hres);
439     SysFreeString(str);
440
441     str = a2bstr("bolder");
442     hres = IHTMLStyle_put_fontWeight(style, str);
443     ok(hres == S_OK, "put_fontWeight failed: %08x\n", hres);
444     SysFreeString(str);
445
446     str = a2bstr("lighter");
447     hres = IHTMLStyle_put_fontWeight(style, str);
448     ok(hres == S_OK, "put_fontWeight failed: %08x\n", hres);
449     SysFreeString(str);
450
451     str = a2bstr("100");
452     hres = IHTMLStyle_put_fontWeight(style, str);
453     ok(hres == S_OK, "put_fontWeight failed: %08x\n", hres);
454     SysFreeString(str);
455
456     str = a2bstr("200");
457     hres = IHTMLStyle_put_fontWeight(style, str);
458     ok(hres == S_OK, "put_fontWeight failed: %08x\n", hres);
459     SysFreeString(str);
460
461     str = a2bstr("300");
462     hres = IHTMLStyle_put_fontWeight(style, str);
463     ok(hres == S_OK, "put_fontWeight failed: %08x\n", hres);
464     SysFreeString(str);
465
466     str = a2bstr("400");
467     hres = IHTMLStyle_put_fontWeight(style, str);
468     ok(hres == S_OK, "put_fontWeight failed: %08x\n", hres);
469     SysFreeString(str);
470
471     str = a2bstr("500");
472     hres = IHTMLStyle_put_fontWeight(style, str);
473     ok(hres == S_OK, "put_fontWeight failed: %08x\n", hres);
474     SysFreeString(str);
475
476     str = a2bstr("600");
477     hres = IHTMLStyle_put_fontWeight(style, str);
478     ok(hres == S_OK, "put_fontWeight failed: %08x\n", hres);
479     SysFreeString(str);
480
481     str = a2bstr("700");
482     hres = IHTMLStyle_put_fontWeight(style, str);
483     ok(hres == S_OK, "put_fontWeight failed: %08x\n", hres);
484     SysFreeString(str);
485
486     str = a2bstr("800");
487     hres = IHTMLStyle_put_fontWeight(style, str);
488     ok(hres == S_OK, "put_fontWeight failed: %08x\n", hres);
489     SysFreeString(str);
490
491     str = a2bstr("900");
492     hres = IHTMLStyle_put_fontWeight(style, str);
493     ok(hres == S_OK, "put_fontWeight failed: %08x\n", hres);
494     SysFreeString(str);
495
496     hres = IHTMLStyle_get_fontWeight(style, &str);
497     ok(hres == S_OK, "get_fontWeight failed: %08x\n", hres);
498     ok(!strcmp_wa(str, "900"), "str != style900\n");
499     SysFreeString(str);
500
501     hres = IHTMLStyle_put_fontWeight(style, sDefault);
502     ok(hres == S_OK, "put_fontWeight failed: %08x\n", hres);
503     SysFreeString(sDefault);
504
505     /* font Variant */
506     hres = IHTMLStyle_get_fontVariant(style, NULL);
507     ok(hres == E_INVALIDARG, "get_fontVariant failed: %08x\n", hres);
508
509     hres = IHTMLStyle_get_fontVariant(style, &sDefault);
510     ok(hres == S_OK, "get_fontVariant failed: %08x\n", hres);
511
512     str = a2bstr("test");
513     hres = IHTMLStyle_put_fontVariant(style, str);
514     ok(hres == E_INVALIDARG, "fontVariant failed: %08x\n", hres);
515     SysFreeString(str);
516
517     str = a2bstr("small-caps");
518     hres = IHTMLStyle_put_fontVariant(style, str);
519     ok(hres == S_OK, "fontVariant failed: %08x\n", hres);
520     SysFreeString(str);
521
522     str = a2bstr("normal");
523     hres = IHTMLStyle_put_fontVariant(style, str);
524     ok(hres == S_OK, "fontVariant failed: %08x\n", hres);
525     SysFreeString(str);
526
527     hres = IHTMLStyle_put_fontVariant(style, sDefault);
528     ok(hres == S_OK, "fontVariant failed: %08x\n", hres);
529     SysFreeString(sDefault);
530
531     str = (void*)0xdeadbeef;
532     hres = IHTMLStyle_get_display(style, &str);
533     ok(hres == S_OK, "get_display failed: %08x\n", hres);
534     ok(!str, "display = %s\n", wine_dbgstr_w(str));
535
536     str = (void*)0xdeadbeef;
537     hres = IHTMLStyle_get_visibility(style, &str);
538     ok(hres == S_OK, "get_visibility failed: %08x\n", hres);
539     ok(!str, "visibility = %s\n", wine_dbgstr_w(str));
540
541     V_VT(&v) = VT_NULL;
542     hres = IHTMLStyle_get_fontSize(style, &v);
543     ok(hres == S_OK, "get_fontSize failed: %08x\n", hres);
544     ok(V_VT(&v) == VT_BSTR, "V_VT(fontSize) = %d\n", V_VT(&v));
545     ok(!V_BSTR(&v), "V_BSTR(fontSize) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
546
547     V_VT(&v) = VT_NULL;
548     hres = IHTMLStyle_get_color(style, &v);
549     ok(hres == S_OK, "get_color failed: %08x\n", hres);
550     ok(V_VT(&v) == VT_BSTR, "V_VT(color) = %d\n", V_VT(&v));
551     ok(!V_BSTR(&v), "V_BSTR(color) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
552
553     b = 0xfefe;
554     hres = IHTMLStyle_get_textDecorationUnderline(style, &b);
555     ok(hres == S_OK, "get_textDecorationUnderline failed: %08x\n", hres);
556     ok(b == VARIANT_FALSE, "textDecorationUnderline = %x\n", b);
557
558     hres = IHTMLStyle_put_textDecorationUnderline(style, VARIANT_TRUE);
559     ok(hres == S_OK, "put_textDecorationUnderline failed: %08x\n", hres);
560     ok(b == VARIANT_FALSE, "textDecorationUnderline = %x\n", b);
561
562     hres = IHTMLStyle_get_textDecorationUnderline(style, &b);
563     ok(hres == S_OK, "get_textDecorationUnderline failed: %08x\n", hres);
564     ok(b == VARIANT_TRUE, "textDecorationUnderline = %x\n", b);
565
566     hres = IHTMLStyle_put_textDecorationUnderline(style, VARIANT_FALSE);
567     ok(hres == S_OK, "put_textDecorationUnderline failed: %08x\n", hres);
568
569     b = 0xfefe;
570     hres = IHTMLStyle_get_textDecorationLineThrough(style, &b);
571     ok(hres == S_OK, "get_textDecorationLineThrough failed: %08x\n", hres);
572     ok(b == VARIANT_FALSE, "textDecorationLineThrough = %x\n", b);
573
574     hres = IHTMLStyle_put_textDecorationLineThrough(style, VARIANT_TRUE);
575     ok(hres == S_OK, "put_textDecorationLineThrough failed: %08x\n", hres);
576     ok(b == VARIANT_FALSE, "textDecorationLineThrough = %x\n", b);
577
578     hres = IHTMLStyle_get_textDecorationLineThrough(style, &b);
579     ok(hres == S_OK, "get_textDecorationLineThrough failed: %08x\n", hres);
580     ok(b == VARIANT_TRUE, "textDecorationLineThrough = %x\n", b);
581
582     hres = IHTMLStyle_put_textDecorationLineThrough(style, VARIANT_FALSE);
583     ok(hres == S_OK, "put_textDecorationLineThrough failed: %08x\n", hres);
584
585     b = 0xfefe;
586     hres = IHTMLStyle_get_textDecorationNone(style, &b);
587     ok(hres == S_OK, "get_textDecorationNone failed: %08x\n", hres);
588     ok(b == VARIANT_FALSE, "textDecorationNone = %x\n", b);
589
590     hres = IHTMLStyle_put_textDecorationNone(style, VARIANT_TRUE);
591     ok(hres == S_OK, "put_textDecorationNone failed: %08x\n", hres);
592     ok(b == VARIANT_FALSE, "textDecorationNone = %x\n", b);
593
594     hres = IHTMLStyle_get_textDecorationNone(style, &b);
595     ok(hres == S_OK, "get_textDecorationNone failed: %08x\n", hres);
596     ok(b == VARIANT_TRUE, "textDecorationNone = %x\n", b);
597
598     hres = IHTMLStyle_put_textDecorationNone(style, VARIANT_FALSE);
599     ok(hres == S_OK, "put_textDecorationNone failed: %08x\n", hres);
600
601     b = 0xfefe;
602     hres = IHTMLStyle_get_textDecorationOverline(style, &b);
603     ok(hres == S_OK, "get_textDecorationOverline failed: %08x\n", hres);
604     ok(b == VARIANT_FALSE, "textDecorationOverline = %x\n", b);
605
606     hres = IHTMLStyle_put_textDecorationOverline(style, VARIANT_TRUE);
607     ok(hres == S_OK, "put_textDecorationOverline failed: %08x\n", hres);
608     ok(b == VARIANT_FALSE, "textDecorationOverline = %x\n", b);
609
610     hres = IHTMLStyle_get_textDecorationOverline(style, &b);
611     ok(hres == S_OK, "get_textDecorationOverline failed: %08x\n", hres);
612     ok(b == VARIANT_TRUE, "textDecorationOverline = %x\n", b);
613
614     hres = IHTMLStyle_put_textDecorationOverline(style, VARIANT_FALSE);
615     ok(hres == S_OK, "put_textDecorationOverline failed: %08x\n", hres);
616
617     b = 0xfefe;
618     hres = IHTMLStyle_get_textDecorationBlink(style, &b);
619     ok(hres == S_OK, "get_textDecorationBlink failed: %08x\n", hres);
620     ok(b == VARIANT_FALSE, "textDecorationBlink = %x\n", b);
621
622     hres = IHTMLStyle_put_textDecorationBlink(style, VARIANT_TRUE);
623     ok(hres == S_OK, "put_textDecorationBlink failed: %08x\n", hres);
624     ok(b == VARIANT_FALSE, "textDecorationBlink = %x\n", b);
625
626     hres = IHTMLStyle_get_textDecorationBlink(style, &b);
627     ok(hres == S_OK, "get_textDecorationBlink failed: %08x\n", hres);
628     ok(b == VARIANT_TRUE, "textDecorationBlink = %x\n", b);
629
630     hres = IHTMLStyle_put_textDecorationBlink(style, VARIANT_FALSE);
631     ok(hres == S_OK, "textDecorationBlink failed: %08x\n", hres);
632
633     hres = IHTMLStyle_get_textDecoration(style, &sDefault);
634     ok(hres == S_OK, "get_textDecoration failed: %08x\n", hres);
635
636     str = a2bstr("invalid");
637     hres = IHTMLStyle_put_textDecoration(style, str);
638     ok(hres == E_INVALIDARG, "put_textDecoration failed: %08x\n", hres);
639     SysFreeString(str);
640
641     str = a2bstr("none");
642     hres = IHTMLStyle_put_textDecoration(style, str);
643     ok(hres == S_OK, "put_textDecoration failed: %08x\n", hres);
644     SysFreeString(str);
645
646     str = a2bstr("underline");
647     hres = IHTMLStyle_put_textDecoration(style, str);
648     ok(hres == S_OK, "put_textDecoration failed: %08x\n", hres);
649     SysFreeString(str);
650
651     str = a2bstr("overline");
652     hres = IHTMLStyle_put_textDecoration(style, str);
653     ok(hres == S_OK, "put_textDecoration failed: %08x\n", hres);
654     SysFreeString(str);
655
656     str = a2bstr("line-through");
657     hres = IHTMLStyle_put_textDecoration(style, str);
658     ok(hres == S_OK, "put_textDecoration failed: %08x\n", hres);
659     SysFreeString(str);
660
661     str = a2bstr("blink");
662     hres = IHTMLStyle_put_textDecoration(style, str);
663     ok(hres == S_OK, "put_textDecoration failed: %08x\n", hres);
664     SysFreeString(str);
665
666     hres = IHTMLStyle_get_textDecoration(style, &str);
667     ok(hres == S_OK, "get_textDecoration failed: %08x\n", hres);
668     ok(!strcmp_wa(str, "blink"), "str != blink\n");
669     SysFreeString(str);
670
671     hres = IHTMLStyle_put_textDecoration(style, sDefault);
672     ok(hres == S_OK, "put_textDecoration failed: %08x\n", hres);
673     SysFreeString(sDefault);
674
675     hres = IHTMLStyle_get_posWidth(style, NULL);
676     ok(hres == E_POINTER, "get_posWidth failed: %08x\n", hres);
677
678     hres = IHTMLStyle_get_posWidth(style, &f);
679     ok(hres == S_OK, "get_posWidth failed: %08x\n", hres);
680     ok(f == 0.0f, "f = %f\n", f);
681
682     V_VT(&v) = VT_EMPTY;
683     hres = IHTMLStyle_get_width(style, &v);
684     ok(hres == S_OK, "get_width failed: %08x\n", hres);
685     ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
686     ok(!V_BSTR(&v), "V_BSTR(v)=%p\n", V_BSTR(&v));
687
688     hres = IHTMLStyle_put_posWidth(style, 2.2);
689     ok(hres == S_OK, "put_posWidth failed: %08x\n", hres);
690
691     hres = IHTMLStyle_get_posWidth(style, &f);
692     ok(hres == S_OK, "get_posWidth failed: %08x\n", hres);
693     ok(f == 2.0f ||
694        f == 2.2f, /* IE8 */
695        "f = %f\n", f);
696
697     V_VT(&v) = VT_BSTR;
698     V_BSTR(&v) = a2bstr("auto");
699     hres = IHTMLStyle_put_width(style, v);
700     ok(hres == S_OK, "put_width failed: %08x\n", hres);
701     VariantClear(&v);
702
703     V_VT(&v) = VT_EMPTY;
704     hres = IHTMLStyle_get_width(style, &v);
705     ok(hres == S_OK, "get_width failed: %08x\n", hres);
706     ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
707     ok(!strcmp_wa(V_BSTR(&v), "auto"), "V_BSTR(v)=%s\n", wine_dbgstr_w(V_BSTR(&v)));
708     VariantClear(&v);
709
710     V_VT(&v) = VT_I4;
711     V_I4(&v) = 100;
712     hres = IHTMLStyle_put_width(style, v);
713     ok(hres == S_OK, "put_width failed: %08x\n", hres);
714
715     V_VT(&v) = VT_EMPTY;
716     hres = IHTMLStyle_get_width(style, &v);
717     ok(hres == S_OK, "get_width failed: %08x\n", hres);
718     ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
719     ok(!strcmp_wa(V_BSTR(&v), "100px"), "V_BSTR(v)=%s\n", wine_dbgstr_w(V_BSTR(&v)));
720     VariantClear(&v);
721
722     /* margin tests */
723     str = (void*)0xdeadbeef;
724     hres = IHTMLStyle_get_margin(style, &str);
725     ok(hres == S_OK, "get_margin failed: %08x\n", hres);
726     ok(!str, "margin = %s\n", wine_dbgstr_w(str));
727
728     str = a2bstr("1");
729     hres = IHTMLStyle_put_margin(style, str);
730     ok(hres == S_OK, "put_margin failed: %08x\n", hres);
731     SysFreeString(str);
732
733     hres = IHTMLStyle_get_margin(style, &str);
734     ok(hres == S_OK, "get_margin failed: %08x\n", hres);
735     ok(!strcmp_wa(str, "1px"), "margin = %s\n", wine_dbgstr_w(str));
736     SysFreeString(str);
737
738     hres = IHTMLStyle_put_margin(style, NULL);
739     ok(hres == S_OK, "put_margin failed: %08x\n", hres);
740
741     str = (void*)0xdeadbeef;
742     hres = IHTMLStyle_get_marginTop(style, &v);
743     ok(hres == S_OK, "get_marginTop failed: %08x\n", hres);
744     ok(V_VT(&v) == VT_BSTR, "V_VT(marginTop) = %d\n", V_VT(&v));
745     ok(!V_BSTR(&v), "V_BSTR(marginTop) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
746
747     V_VT(&v) = VT_BSTR;
748     V_BSTR(&v) = a2bstr("6px");
749     hres = IHTMLStyle_put_marginTop(style, v);
750     SysFreeString(V_BSTR(&v));
751     ok(hres == S_OK, "put_marginTop failed: %08x\n", hres);
752
753     str = (void*)0xdeadbeef;
754     hres = IHTMLStyle_get_marginTop(style, &v);
755     ok(hres == S_OK, "get_marginTop failed: %08x\n", hres);
756     ok(V_VT(&v) == VT_BSTR, "V_VT(marginTop) = %d\n", V_VT(&v));
757     ok(!strcmp_wa(V_BSTR(&v), "6px"), "V_BSTR(marginTop) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
758     VariantClear(&v);
759
760     V_VT(&v) = VT_I4;
761     V_I4(&v) = 5;
762     hres = IHTMLStyle_put_marginTop(style, v);
763     ok(hres == S_OK, "put_marginTop failed: %08x\n", hres);
764
765     str = (void*)0xdeadbeef;
766     hres = IHTMLStyle_get_marginTop(style, &v);
767     ok(hres == S_OK, "get_marginTop failed: %08x\n", hres);
768     ok(V_VT(&v) == VT_BSTR, "V_VT(marginTop) = %d\n", V_VT(&v));
769     ok(!strcmp_wa(V_BSTR(&v), "5px"), "V_BSTR(marginTop) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
770     VariantClear(&v);
771
772     str = NULL;
773     hres = IHTMLStyle_get_border(style, &str);
774     ok(hres == S_OK, "get_border failed: %08x\n", hres);
775     ok(!str || !*str, "str is not empty\n");
776     SysFreeString(str);
777
778     str = a2bstr("1px");
779     hres = IHTMLStyle_put_border(style, str);
780     ok(hres == S_OK, "put_border failed: %08x\n", hres);
781     SysFreeString(str);
782
783     V_VT(&v) = VT_EMPTY;
784     hres = IHTMLStyle_get_left(style, &v);
785     ok(hres == S_OK, "get_left failed: %08x\n", hres);
786     ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
787     ok(!V_BSTR(&v), "V_BSTR(v) != NULL\n");
788     VariantClear(&v);
789
790     /* Test posLeft */
791     hres = IHTMLStyle_get_posLeft(style, NULL);
792     ok(hres == E_POINTER, "get_posLeft failed: %08x\n", hres);
793
794     f = 1.0f;
795     hres = IHTMLStyle_get_posLeft(style, &f);
796     ok(hres == S_OK, "get_posLeft failed: %08x\n", hres);
797     ok(f == 0.0, "expected 0.0 got %f\n", f);
798
799     hres = IHTMLStyle_put_posLeft(style, 4.9f);
800     ok(hres == S_OK, "put_posLeft failed: %08x\n", hres);
801
802     hres = IHTMLStyle_get_posLeft(style, &f);
803     ok(hres == S_OK, "get_posLeft failed: %08x\n", hres);
804     ok(f == 4.0 ||
805        f == 4.9f, /* IE8 */
806        "expected 4.0 or 4.9 (IE8) got %f\n", f);
807
808     /* Ensure left is updated correctly. */
809     V_VT(&v) = VT_EMPTY;
810     hres = IHTMLStyle_get_left(style, &v);
811     ok(hres == S_OK, "get_left failed: %08x\n", hres);
812     ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
813     ok(!strcmp_wa(V_BSTR(&v), "4px") ||
814        !strcmp_wa(V_BSTR(&v), "4.9px"), /* IE8 */
815        "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
816     VariantClear(&v);
817
818     /* Test left */
819     V_VT(&v) = VT_BSTR;
820     V_BSTR(&v) = a2bstr("3px");
821     hres = IHTMLStyle_put_left(style, v);
822     ok(hres == S_OK, "put_left failed: %08x\n", hres);
823     VariantClear(&v);
824
825     hres = IHTMLStyle_get_posLeft(style, &f);
826     ok(hres == S_OK, "get_posLeft failed: %08x\n", hres);
827     ok(f == 3.0, "expected 3.0 got %f\n", f);
828
829     V_VT(&v) = VT_EMPTY;
830     hres = IHTMLStyle_get_left(style, &v);
831     ok(hres == S_OK, "get_left failed: %08x\n", hres);
832     ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
833     ok(!strcmp_wa(V_BSTR(&v), "3px"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
834     VariantClear(&v);
835
836     V_VT(&v) = VT_NULL;
837     hres = IHTMLStyle_put_left(style, v);
838     ok(hres == S_OK, "put_left failed: %08x\n", hres);
839
840     V_VT(&v) = VT_EMPTY;
841     hres = IHTMLStyle_get_left(style, &v);
842     ok(hres == S_OK, "get_left failed: %08x\n", hres);
843     ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
844     ok(!V_BSTR(&v), "V_BSTR(v) != NULL\n");
845     VariantClear(&v);
846
847     V_VT(&v) = VT_EMPTY;
848     hres = IHTMLStyle_get_top(style, &v);
849     ok(hres == S_OK, "get_top failed: %08x\n", hres);
850     ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
851     ok(!V_BSTR(&v), "V_BSTR(v) != NULL\n");
852     VariantClear(&v);
853
854     /* Test posTop */
855     hres = IHTMLStyle_get_posTop(style, NULL);
856     ok(hres == E_POINTER, "get_posTop failed: %08x\n", hres);
857
858     f = 1.0f;
859     hres = IHTMLStyle_get_posTop(style, &f);
860     ok(hres == S_OK, "get_posTop failed: %08x\n", hres);
861     ok(f == 0.0, "expected 0.0 got %f\n", f);
862
863     hres = IHTMLStyle_put_posTop(style, 4.9f);
864     ok(hres == S_OK, "put_posTop failed: %08x\n", hres);
865
866     hres = IHTMLStyle_get_posTop(style, &f);
867     ok(hres == S_OK, "get_posTop failed: %08x\n", hres);
868     ok(f == 4.0 ||
869        f == 4.9f, /* IE8 */
870        "expected 4.0 or 4.9 (IE8) got %f\n", f);
871
872     V_VT(&v) = VT_BSTR;
873     V_BSTR(&v) = a2bstr("3px");
874     hres = IHTMLStyle_put_top(style, v);
875     ok(hres == S_OK, "put_top failed: %08x\n", hres);
876     VariantClear(&v);
877
878     V_VT(&v) = VT_EMPTY;
879     hres = IHTMLStyle_get_top(style, &v);
880     ok(hres == S_OK, "get_top failed: %08x\n", hres);
881     ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
882     ok(!strcmp_wa(V_BSTR(&v), "3px"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
883     VariantClear(&v);
884
885     hres = IHTMLStyle_get_posTop(style, &f);
886     ok(hres == S_OK, "get_posTop failed: %08x\n", hres);
887     ok(f == 3.0, "expected 3.0 got %f\n", f);
888
889     V_VT(&v) = VT_NULL;
890     hres = IHTMLStyle_put_top(style, v);
891     ok(hres == S_OK, "put_top failed: %08x\n", hres);
892
893     V_VT(&v) = VT_EMPTY;
894     hres = IHTMLStyle_get_top(style, &v);
895     ok(hres == S_OK, "get_top failed: %08x\n", hres);
896     ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
897     ok(!V_BSTR(&v), "V_BSTR(v) != NULL\n");
898     VariantClear(&v);
899
900     /* Test posHeight */
901     hres = IHTMLStyle_get_posHeight(style, NULL);
902     ok(hres == E_POINTER, "get_posHeight failed: %08x\n", hres);
903
904     V_VT(&v) = VT_EMPTY;
905     hres = IHTMLStyle_get_height(style, &v);
906     ok(hres == S_OK, "get_height failed: %08x\n", hres);
907     ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
908     ok(!V_BSTR(&v), "V_BSTR(v) != NULL\n");
909     VariantClear(&v);
910
911     f = 1.0f;
912     hres = IHTMLStyle_get_posHeight(style, &f);
913     ok(hres == S_OK, "get_posHeight failed: %08x\n", hres);
914     ok(f == 0.0, "expected 0.0 got %f\n", f);
915
916     hres = IHTMLStyle_put_posHeight(style, 4.9f);
917     ok(hres == S_OK, "put_posHeight failed: %08x\n", hres);
918
919     hres = IHTMLStyle_get_posHeight(style, &f);
920     ok(hres == S_OK, "get_posHeight failed: %08x\n", hres);
921     ok(f == 4.0 ||
922        f == 4.9f, /* IE8 */
923        "expected 4.0 or 4.9 (IE8) got %f\n", f);
924
925     V_VT(&v) = VT_BSTR;
926     V_BSTR(&v) = a2bstr("70px");
927     hres = IHTMLStyle_put_height(style, v);
928     ok(hres == S_OK, "put_height failed: %08x\n", hres);
929     VariantClear(&v);
930
931     V_VT(&v) = VT_EMPTY;
932     hres = IHTMLStyle_get_height(style, &v);
933     ok(hres == S_OK, "get_height failed: %08x\n", hres);
934     ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
935     ok(!strcmp_wa(V_BSTR(&v), "70px"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
936     VariantClear(&v);
937
938     V_VT(&v) = VT_I4;
939     V_I4(&v) = 64;
940     hres = IHTMLStyle_put_height(style, v);
941     ok(hres == S_OK, "put_height failed: %08x\n", hres);
942
943     V_VT(&v) = VT_EMPTY;
944     hres = IHTMLStyle_get_height(style, &v);
945     ok(hres == S_OK, "get_height failed: %08x\n", hres);
946     ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
947     ok(!strcmp_wa(V_BSTR(&v), "64px"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
948     VariantClear(&v);
949
950     hres = IHTMLStyle_get_posHeight(style, &f);
951     ok(hres == S_OK, "get_posHeight failed: %08x\n", hres);
952     ok(f == 64.0, "expected 64.0 got %f\n", f);
953
954     str = (void*)0xdeadbeef;
955     hres = IHTMLStyle_get_cursor(style, &str);
956     ok(hres == S_OK, "get_cursor failed: %08x\n", hres);
957     ok(!str, "get_cursor != NULL\n");
958     SysFreeString(str);
959
960     str = a2bstr("default");
961     hres = IHTMLStyle_put_cursor(style, str);
962     ok(hres == S_OK, "put_cursor failed: %08x\n", hres);
963     SysFreeString(str);
964
965     str = NULL;
966     hres = IHTMLStyle_get_cursor(style, &str);
967     ok(hres == S_OK, "get_cursor failed: %08x\n", hres);
968     ok(!strcmp_wa(str, "default"), "get_cursor returned %s\n", wine_dbgstr_w(str));
969     SysFreeString(str);
970
971     V_VT(&v) = VT_EMPTY;
972     hres = IHTMLStyle_get_verticalAlign(style, &v);
973     ok(hres == S_OK, "get_vertivalAlign failed: %08x\n", hres);
974     ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
975     ok(!V_BSTR(&v), "V_BSTR(v) != NULL\n");
976     VariantClear(&v);
977
978     V_VT(&v) = VT_BSTR;
979     V_BSTR(&v) = a2bstr("middle");
980     hres = IHTMLStyle_put_verticalAlign(style, v);
981     ok(hres == S_OK, "put_vertivalAlign failed: %08x\n", hres);
982     VariantClear(&v);
983
984     V_VT(&v) = VT_EMPTY;
985     hres = IHTMLStyle_get_verticalAlign(style, &v);
986     ok(hres == S_OK, "get_verticalAlign failed: %08x\n", hres);
987     ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
988     ok(!strcmp_wa(V_BSTR(&v), "middle"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
989     VariantClear(&v);
990
991     str = (void*)0xdeadbeef;
992     hres = IHTMLStyle_get_textAlign(style, &str);
993     ok(hres == S_OK, "get_textAlign failed: %08x\n", hres);
994     ok(!str, "textAlign != NULL\n");
995
996     str = a2bstr("center");
997     hres = IHTMLStyle_put_textAlign(style, str);
998     ok(hres == S_OK, "put_textAlign failed: %08x\n", hres);
999     SysFreeString(str);
1000
1001     str = NULL;
1002     hres = IHTMLStyle_get_textAlign(style, &str);
1003     ok(hres == S_OK, "get_textAlign failed: %08x\n", hres);
1004     ok(!strcmp_wa(str, "center"), "textAlign = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1005     SysFreeString(str);
1006
1007     str = (void*)0xdeadbeef;
1008     hres = IHTMLStyle_get_filter(style, &str);
1009     ok(hres == S_OK, "get_filter failed: %08x\n", hres);
1010     ok(!str, "filter != NULL\n");
1011
1012     str = a2bstr("alpha(opacity=100)");
1013     hres = IHTMLStyle_put_filter(style, str);
1014     ok(hres == S_OK, "put_filter failed: %08x\n", hres);
1015     SysFreeString(str);
1016
1017     V_VT(&v) = VT_EMPTY;
1018     hres = IHTMLStyle_get_zIndex(style, &v);
1019     ok(hres == S_OK, "get_zIndex failed: %08x\n", hres);
1020     ok(V_VT(&v) == VT_I4, "V_VT(v)=%d\n", V_VT(&v));
1021     ok(!V_I4(&v), "V_I4(v) != 0\n");
1022     VariantClear(&v);
1023
1024     V_VT(&v) = VT_BSTR;
1025     V_BSTR(&v) = a2bstr("1");
1026     hres = IHTMLStyle_put_zIndex(style, v);
1027     ok(hres == S_OK, "put_zIndex failed: %08x\n", hres);
1028     VariantClear(&v);
1029
1030     V_VT(&v) = VT_EMPTY;
1031     hres = IHTMLStyle_get_zIndex(style, &v);
1032     ok(hres == S_OK, "get_zIndex failed: %08x\n", hres);
1033     ok(V_VT(&v) == VT_I4, "V_VT(v)=%d\n", V_VT(&v));
1034     ok(V_I4(&v) == 1, "V_I4(v) = %d\n", V_I4(&v));
1035     VariantClear(&v);
1036
1037     /* fontStyle */
1038     hres = IHTMLStyle_get_fontStyle(style, &sDefault);
1039     ok(hres == S_OK, "get_fontStyle failed: %08x\n", hres);
1040
1041     str = a2bstr("test");
1042     hres = IHTMLStyle_put_fontStyle(style, str);
1043     ok(hres == E_INVALIDARG, "put_fontStyle failed: %08x\n", hres);
1044     SysFreeString(str);
1045
1046     str = a2bstr("italic");
1047     hres = IHTMLStyle_put_fontStyle(style, str);
1048     ok(hres == S_OK, "put_fontStyle failed: %08x\n", hres);
1049     SysFreeString(str);
1050
1051     str = a2bstr("oblique");
1052     hres = IHTMLStyle_put_fontStyle(style, str);
1053     ok(hres == S_OK, "put_fontStyle failed: %08x\n", hres);
1054     SysFreeString(str);
1055
1056     str = a2bstr("normal");
1057     hres = IHTMLStyle_put_fontStyle(style, str);
1058     ok(hres == S_OK, "put_fontStyle failed: %08x\n", hres);
1059     SysFreeString(str);
1060
1061     hres = IHTMLStyle_put_fontStyle(style, sDefault);
1062     ok(hres == S_OK, "put_fontStyle failed: %08x\n", hres);
1063     SysFreeString(sDefault);
1064
1065     /* overflow */
1066     hres = IHTMLStyle_get_overflow(style, NULL);
1067     ok(hres == E_INVALIDARG, "get_overflow failed: %08x\n", hres);
1068
1069     hres = IHTMLStyle_get_overflow(style, &sOverflowDefault);
1070     ok(hres == S_OK, "get_overflow failed: %08x\n", hres);
1071
1072     str = a2bstr("test");
1073     hres = IHTMLStyle_put_overflow(style, str);
1074     ok(hres == E_INVALIDARG, "put_overflow failed: %08x\n", hres);
1075     SysFreeString(str);
1076
1077     str = a2bstr("visible");
1078     hres = IHTMLStyle_put_overflow(style, str);
1079     ok(hres == S_OK, "put_overflow failed: %08x\n", hres);
1080     SysFreeString(str);
1081
1082     str = a2bstr("scroll");
1083     hres = IHTMLStyle_put_overflow(style, str);
1084     ok(hres == S_OK, "put_overflow failed: %08x\n", hres);
1085     SysFreeString(str);
1086
1087     str = a2bstr("hidden");
1088     hres = IHTMLStyle_put_overflow(style, str);
1089     ok(hres == S_OK, "put_overflow failed: %08x\n", hres);
1090     SysFreeString(str);
1091
1092     str = a2bstr("auto");
1093     hres = IHTMLStyle_put_overflow(style, str);
1094     ok(hres == S_OK, "put_overflow failed: %08x\n", hres);
1095     SysFreeString(str);
1096
1097     hres = IHTMLStyle_get_overflow(style, &str);
1098     ok(hres == S_OK, "get_overflow failed: %08x\n", hres);
1099     ok(!strcmp_wa(str, "auto"), "str=%s\n", wine_dbgstr_w(str));
1100     SysFreeString(str);
1101
1102     str = a2bstr("");
1103     hres = IHTMLStyle_put_overflow(style, str);
1104     ok(hres == S_OK, "put_overflow failed: %08x\n", hres);
1105     SysFreeString(str);
1106
1107     hres = IHTMLStyle_get_overflow(style, &str);
1108     ok(hres == S_OK, "get_overflow failed: %08x\n", hres);
1109     ok(!str, "str=%s\n", wine_dbgstr_w(str));
1110     SysFreeString(str);
1111
1112     /* restore overflow default */
1113     hres = IHTMLStyle_put_overflow(style, sOverflowDefault);
1114     ok(hres == S_OK, "put_overflow failed: %08x\n", hres);
1115     SysFreeString(sOverflowDefault);
1116
1117     /* Attribute Tests*/
1118     hres = IHTMLStyle_getAttribute(style, NULL, 1, &v);
1119     ok(hres == E_INVALIDARG, "getAttribute failed: %08x\n", hres);
1120
1121     str = a2bstr("position");
1122     hres = IHTMLStyle_getAttribute(style, str, 1, NULL);
1123     ok(hres == E_INVALIDARG, "getAttribute failed: %08x\n", hres);
1124
1125     hres = IHTMLStyle_getAttribute(style, str, 1, &v);
1126     ok(hres == S_OK, "getAttribute failed: %08x\n", hres);
1127     ok(V_VT(&v) == VT_BSTR, "type failed: %d\n", V_VT(&v));
1128     VariantClear(&v);
1129
1130     hres = IHTMLStyle_setAttribute(style, NULL, v, 1);
1131     ok(hres == E_INVALIDARG, "setAttribute failed: %08x\n", hres);
1132
1133     V_VT(&v) = VT_BSTR;
1134     V_BSTR(&v) = a2bstr("absolute");
1135     hres = IHTMLStyle_setAttribute(style, str, v, 1);
1136     ok(hres == S_OK, "setAttribute failed: %08x\n", hres);
1137     VariantClear(&v);
1138
1139     hres = IHTMLStyle_getAttribute(style, str, 1, &v);
1140     ok(hres == S_OK, "getAttribute failed: %08x\n", hres);
1141     ok(V_VT(&v) == VT_BSTR, "type failed: %d\n", V_VT(&v));
1142     ok(!strcmp_wa(V_BSTR(&v), "absolute"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
1143     VariantClear(&v);
1144
1145     V_VT(&v) = VT_BSTR;
1146     V_BSTR(&v) = NULL;
1147     hres = IHTMLStyle_setAttribute(style, str, v, 1);
1148     ok(hres == S_OK, "setAttribute failed: %08x\n", hres);
1149     VariantClear(&v);
1150
1151     SysFreeString(str);
1152
1153     str = a2bstr("borderLeftStyle");
1154     test_border_styles(style, str);
1155     SysFreeString(str);
1156
1157     str = a2bstr("borderbottomstyle");
1158     test_border_styles(style, str);
1159     SysFreeString(str);
1160
1161     str = a2bstr("borderrightstyle");
1162     test_border_styles(style, str);
1163     SysFreeString(str);
1164
1165     str = a2bstr("bordertopstyle");
1166     test_border_styles(style, str);
1167     SysFreeString(str);
1168
1169     hres = IHTMLStyle_get_borderStyle(style, &sDefault);
1170     ok(hres == S_OK, "get_borderStyle failed: %08x\n", hres);
1171
1172     str = a2bstr("none dotted dashed solid");
1173     hres = IHTMLStyle_put_borderStyle(style, str);
1174     ok(hres == S_OK, "put_borderStyle failed: %08x\n", hres);
1175     SysFreeString(str);
1176
1177     str = a2bstr("none dotted dashed solid");
1178     hres = IHTMLStyle_get_borderStyle(style, &str);
1179     ok(hres == S_OK, "get_borderStyle failed: %08x\n", hres);
1180     ok(!strcmp_wa(str, "none dotted dashed solid"),
1181         "expected (none dotted dashed solid) = (%s)\n", wine_dbgstr_w(V_BSTR(&v)));
1182     SysFreeString(str);
1183
1184     str = a2bstr("double groove ridge inset");
1185     hres = IHTMLStyle_put_borderStyle(style, str);
1186     ok(hres == S_OK, "put_borderStyle failed: %08x\n", hres);
1187     SysFreeString(str);
1188
1189     str = a2bstr("window-inset outset ridge inset");
1190     hres = IHTMLStyle_put_borderStyle(style, str);
1191     ok(hres == S_OK, "put_borderStyle failed: %08x\n", hres);
1192     SysFreeString(str);
1193
1194     str = a2bstr("window-inset");
1195     hres = IHTMLStyle_put_borderStyle(style, str);
1196     ok(hres == S_OK, "put_borderStyle failed: %08x\n", hres);
1197     SysFreeString(str);
1198
1199     str = a2bstr("none none none none none");
1200     hres = IHTMLStyle_put_borderStyle(style, str);
1201     ok(hres == S_OK, "put_borderStyle failed: %08x\n", hres);
1202     SysFreeString(str);
1203
1204     str = a2bstr("invalid none none none");
1205     hres = IHTMLStyle_put_borderStyle(style, str);
1206     ok(hres == E_INVALIDARG, "put_borderStyle failed: %08x\n", hres);
1207     SysFreeString(str);
1208
1209     str = a2bstr("none invalid none none");
1210     hres = IHTMLStyle_put_borderStyle(style, str);
1211     ok(hres == E_INVALIDARG, "put_borderStyle failed: %08x\n", hres);
1212     SysFreeString(str);
1213
1214     hres = IHTMLStyle_put_borderStyle(style, sDefault);
1215     ok(hres == S_OK, "put_borderStyle failed: %08x\n", hres);
1216     SysFreeString(sDefault);
1217
1218     /* backgoundColor */
1219     hres = IHTMLStyle_get_backgroundColor(style, &v);
1220     ok(hres == S_OK, "get_backgroundColor: %08x\n", hres);
1221     ok(V_VT(&v) == VT_BSTR, "type failed: %d\n", V_VT(&v));
1222     ok(!V_BSTR(&v), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
1223     VariantClear(&v);
1224
1225     /* padding */
1226     hres = IHTMLStyle_get_padding(style, &str);
1227     ok(hres == S_OK, "get_padding failed: %08x\n", hres);
1228     ok(!str, "padding = %s\n", wine_dbgstr_w(str));
1229     SysFreeString(str);
1230
1231     hres = IHTMLStyle_get_paddingTop(style, &v);
1232     ok(hres == S_OK, "get_paddingTop: %08x\n", hres);
1233     ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
1234     ok(!V_BSTR(&v), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1235
1236     V_VT(&v) = VT_I4;
1237     V_I4(&v) = 6;
1238     hres = IHTMLStyle_put_paddingTop(style, v);
1239     ok(hres == S_OK, "put_paddingTop failed: %08x\n", hres);
1240
1241     hres = IHTMLStyle_get_paddingTop(style, &v);
1242     ok(hres == S_OK, "get_paddingTop: %08x\n", hres);
1243     ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
1244     ok(!strcmp_wa(V_BSTR(&v), "6px"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1245     VariantClear(&v);
1246
1247     hres = IHTMLStyle_get_paddingRight(style, &v);
1248     ok(hres == S_OK, "get_paddingRight: %08x\n", hres);
1249     ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
1250     ok(!V_BSTR(&v), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1251
1252     V_VT(&v) = VT_I4;
1253     V_I4(&v) = 6;
1254     hres = IHTMLStyle_put_paddingRight(style, v);
1255     ok(hres == S_OK, "put_paddingRight failed: %08x\n", hres);
1256
1257     hres = IHTMLStyle_get_paddingRight(style, &v);
1258     ok(hres == S_OK, "get_paddingRight: %08x\n", hres);
1259     ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
1260     ok(!strcmp_wa(V_BSTR(&v), "6px"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1261     VariantClear(&v);
1262
1263     hres = IHTMLStyle_get_paddingBottom(style, &v);
1264     ok(hres == S_OK, "get_paddingBottom: %08x\n", hres);
1265     ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
1266     ok(!V_BSTR(&v), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1267
1268     V_VT(&v) = VT_I4;
1269     V_I4(&v) = 6;
1270     hres = IHTMLStyle_put_paddingBottom(style, v);
1271     ok(hres == S_OK, "put_paddingBottom failed: %08x\n", hres);
1272
1273     hres = IHTMLStyle_get_paddingBottom(style, &v);
1274     ok(hres == S_OK, "get_paddingBottom: %08x\n", hres);
1275     ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
1276     ok(!strcmp_wa(V_BSTR(&v), "6px"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1277     VariantClear(&v);
1278
1279     str = a2bstr("1");
1280     hres = IHTMLStyle_put_padding(style, str);
1281     ok(hres == S_OK, "put_padding failed: %08x\n", hres);
1282     SysFreeString(str);
1283
1284     hres = IHTMLStyle_get_padding(style, &str);
1285     ok(hres == S_OK, "get_padding failed: %08x\n", hres);
1286     ok(!strcmp_wa(str, "1px"), "padding = %s\n", wine_dbgstr_w(str));
1287     SysFreeString(str);
1288
1289     /* PaddingLeft */
1290     hres = IHTMLStyle_get_paddingLeft(style, &vDefault);
1291     ok(hres == S_OK, "get_paddingLeft: %08x\n", hres);
1292     ok(V_VT(&vDefault) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&vDefault));
1293     ok(!strcmp_wa(V_BSTR(&vDefault), "1px"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&vDefault)));
1294
1295     V_VT(&v) = VT_BSTR;
1296     V_BSTR(&v) = a2bstr("10");
1297     hres = IHTMLStyle_put_paddingLeft(style, v);
1298     ok(hres == S_OK, "put_paddingLeft: %08x\n", hres);
1299     VariantClear(&v);
1300
1301     hres = IHTMLStyle_get_paddingLeft(style, &v);
1302     ok(hres == S_OK, "get_paddingLeft: %08x\n", hres);
1303     ok(!strcmp_wa(V_BSTR(&v), "10px"), "expecte 10 = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1304     VariantClear(&v);
1305
1306     hres = IHTMLStyle_put_paddingLeft(style, vDefault);
1307     ok(hres == S_OK, "put_paddingLeft: %08x\n", hres);
1308
1309     /* BackgroundRepeat */
1310     hres = IHTMLStyle_get_backgroundRepeat(style, &sDefault);
1311     ok(hres == S_OK, "get_backgroundRepeat failed: %08x\n", hres);
1312
1313     str = a2bstr("invalid");
1314     hres = IHTMLStyle_put_backgroundRepeat(style, str);
1315     ok(hres == E_INVALIDARG, "put_backgroundRepeat failed: %08x\n", hres);
1316     SysFreeString(str);
1317
1318     str = a2bstr("repeat");
1319     hres = IHTMLStyle_put_backgroundRepeat(style, str);
1320     ok(hres == S_OK, "put_backgroundRepeat failed: %08x\n", hres);
1321     SysFreeString(str);
1322
1323     str = a2bstr("no-repeat");
1324     hres = IHTMLStyle_put_backgroundRepeat(style, str);
1325     ok(hres == S_OK, "put_backgroundRepeat failed: %08x\n", hres);
1326     SysFreeString(str);
1327
1328     str = a2bstr("repeat-x");
1329     hres = IHTMLStyle_put_backgroundRepeat(style, str);
1330     ok(hres == S_OK, "put_backgroundRepeat failed: %08x\n", hres);
1331     SysFreeString(str);
1332
1333     str = a2bstr("repeat-y");
1334     hres = IHTMLStyle_put_backgroundRepeat(style, str);
1335     ok(hres == S_OK, "put_backgroundRepeat failed: %08x\n", hres);
1336     SysFreeString(str);
1337
1338     hres = IHTMLStyle_get_backgroundRepeat(style, &str);
1339     ok(hres == S_OK, "get_backgroundRepeat failed: %08x\n", hres);
1340     ok(!strcmp_wa(str, "repeat-y"), "str=%s\n", wine_dbgstr_w(str));
1341     SysFreeString(str);
1342
1343     hres = IHTMLStyle_put_backgroundRepeat(style, sDefault);
1344     ok(hres == S_OK, "put_backgroundRepeat failed: %08x\n", hres);
1345     SysFreeString(sDefault);
1346
1347     /* BorderColor */
1348     hres = IHTMLStyle_get_borderColor(style, &sDefault);
1349     ok(hres == S_OK, "get_borderColor failed: %08x\n", hres);
1350
1351     str = a2bstr("red green red blue");
1352     hres = IHTMLStyle_put_borderColor(style, str);
1353     ok(hres == S_OK, "put_borderColor failed: %08x\n", hres);
1354     SysFreeString(str);
1355
1356     hres = IHTMLStyle_get_borderColor(style, &str);
1357     ok(hres == S_OK, "get_borderColor failed: %08x\n", hres);
1358     ok(!strcmp_wa(str, "red green red blue"), "str=%s\n", wine_dbgstr_w(str));
1359     SysFreeString(str);
1360
1361     hres = IHTMLStyle_put_borderColor(style, sDefault);
1362     ok(hres == S_OK, "put_borderColor failed: %08x\n", hres);
1363     SysFreeString(sDefault);
1364
1365     /* BorderRight */
1366     hres = IHTMLStyle_get_borderRight(style, &sDefault);
1367     ok(hres == S_OK, "get_borderRight failed: %08x\n", hres);
1368
1369     str = a2bstr("thick dotted red");
1370     hres = IHTMLStyle_put_borderRight(style, str);
1371     ok(hres == S_OK, "put_borderRight failed: %08x\n", hres);
1372     SysFreeString(str);
1373
1374     /* IHTMLStyle_get_borderRight appears to have a bug where
1375         it returns the first letter of the color.  So we check
1376         each style individually.
1377      */
1378     V_BSTR(&v) = NULL;
1379     hres = IHTMLStyle_get_borderRightColor(style, &v);
1380     ok(hres == S_OK, "get_borderRightColor failed: %08x\n", hres);
1381     ok(!strcmp_wa(V_BSTR(&v), "red"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
1382     VariantClear(&v);
1383
1384     V_BSTR(&v) = NULL;
1385     hres = IHTMLStyle_get_borderRightWidth(style, &v);
1386     ok(hres == S_OK, "get_borderRightWidth failed: %08x\n", hres);
1387     ok(!strcmp_wa(V_BSTR(&v), "thick"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
1388     VariantClear(&v);
1389
1390     hres = IHTMLStyle_get_borderRightStyle(style, &str);
1391     ok(hres == S_OK, "get_borderRightStyle failed: %08x\n", hres);
1392     ok(!strcmp_wa(str, "dotted"), "str=%s\n", wine_dbgstr_w(str));
1393     SysFreeString(str);
1394
1395     hres = IHTMLStyle_put_borderRight(style, sDefault);
1396     ok(hres == S_OK, "put_borderRight failed: %08x\n", hres);
1397     SysFreeString(sDefault);
1398
1399     /* BorderTop */
1400     hres = IHTMLStyle_get_borderTop(style, &sDefault);
1401     ok(hres == S_OK, "get_borderTop failed: %08x\n", hres);
1402
1403     str = a2bstr("thick dotted red");
1404     hres = IHTMLStyle_put_borderTop(style, str);
1405     ok(hres == S_OK, "put_borderTop failed: %08x\n", hres);
1406     SysFreeString(str);
1407
1408     /* IHTMLStyle_get_borderTop appears to have a bug where
1409         it returns the first letter of the color.  So we check
1410         each style individually.
1411      */
1412     V_BSTR(&v) = NULL;
1413     hres = IHTMLStyle_get_borderTopColor(style, &v);
1414     ok(hres == S_OK, "get_borderTopColor failed: %08x\n", hres);
1415     ok(!strcmp_wa(V_BSTR(&v), "red"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
1416     VariantClear(&v);
1417
1418     V_BSTR(&v) = NULL;
1419     hres = IHTMLStyle_get_borderTopWidth(style, &v);
1420     ok(hres == S_OK, "get_borderTopWidth failed: %08x\n", hres);
1421     ok(!strcmp_wa(V_BSTR(&v), "thick"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
1422     VariantClear(&v);
1423
1424     hres = IHTMLStyle_get_borderTopStyle(style, &str);
1425     ok(hres == S_OK, "get_borderTopStyle failed: %08x\n", hres);
1426     ok(!strcmp_wa(str, "dotted"), "str=%s\n", wine_dbgstr_w(str));
1427     SysFreeString(str);
1428
1429     hres = IHTMLStyle_put_borderTop(style, sDefault);
1430     ok(hres == S_OK, "put_borderTop failed: %08x\n", hres);
1431     SysFreeString(sDefault);
1432
1433     /* BorderBottom */
1434     hres = IHTMLStyle_get_borderBottom(style, &sDefault);
1435     ok(hres == S_OK, "get_borderBottom failed: %08x\n", hres);
1436
1437     str = a2bstr("thick dotted red");
1438     hres = IHTMLStyle_put_borderBottom(style, str);
1439     ok(hres == S_OK, "put_borderBottom failed: %08x\n", hres);
1440     SysFreeString(str);
1441
1442     /* IHTMLStyle_get_borderBottom appears to have a bug where
1443         it returns the first letter of the color.  So we check
1444         each style individually.
1445      */
1446     V_BSTR(&v) = NULL;
1447     hres = IHTMLStyle_get_borderBottomColor(style, &v);
1448     ok(hres == S_OK, "get_borderBottomColor failed: %08x\n", hres);
1449     ok(!strcmp_wa(V_BSTR(&v), "red"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
1450     VariantClear(&v);
1451
1452     V_BSTR(&v) = NULL;
1453     hres = IHTMLStyle_get_borderBottomWidth(style, &v);
1454     ok(hres == S_OK, "get_borderBottomWidth failed: %08x\n", hres);
1455     ok(!strcmp_wa(V_BSTR(&v), "thick"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
1456     VariantClear(&v);
1457
1458     hres = IHTMLStyle_get_borderBottomStyle(style, &str);
1459     ok(hres == S_OK, "get_borderBottomStyle failed: %08x\n", hres);
1460     ok(!strcmp_wa(str, "dotted"), "str=%s\n", wine_dbgstr_w(str));
1461     SysFreeString(str);
1462
1463     hres = IHTMLStyle_put_borderBottom(style, sDefault);
1464     ok(hres == S_OK, "put_borderBottom failed: %08x\n", hres);
1465     SysFreeString(sDefault);
1466
1467     /* BorderLeft */
1468     hres = IHTMLStyle_get_borderLeft(style, &sDefault);
1469     ok(hres == S_OK, "get_borderLeft failed: %08x\n", hres);
1470
1471     str = a2bstr("thick dotted red");
1472     hres = IHTMLStyle_put_borderLeft(style, str);
1473     ok(hres == S_OK, "put_borderLeft failed: %08x\n", hres);
1474     SysFreeString(str);
1475
1476     /* IHTMLStyle_get_borderLeft appears to have a bug where
1477         it returns the first letter of the color.  So we check
1478         each style individually.
1479      */
1480     V_BSTR(&v) = NULL;
1481     hres = IHTMLStyle_get_borderLeftColor(style, &v);
1482     ok(hres == S_OK, "get_borderLeftColor failed: %08x\n", hres);
1483     ok(!strcmp_wa(V_BSTR(&v), "red"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
1484     VariantClear(&v);
1485
1486     V_BSTR(&v) = NULL;
1487     hres = IHTMLStyle_get_borderLeftWidth(style, &v);
1488     ok(hres == S_OK, "get_borderLeftWidth failed: %08x\n", hres);
1489     ok(!strcmp_wa(V_BSTR(&v), "thick"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
1490     VariantClear(&v);
1491
1492     hres = IHTMLStyle_get_borderLeftStyle(style, &str);
1493     ok(hres == S_OK, "get_borderLeftStyle failed: %08x\n", hres);
1494     ok(!strcmp_wa(str, "dotted"), "str=%s\n", wine_dbgstr_w(str));
1495     SysFreeString(str);
1496
1497     hres = IHTMLStyle_put_borderLeft(style, sDefault);
1498     ok(hres == S_OK, "put_borderLeft failed: %08x\n", hres);
1499     SysFreeString(sDefault);
1500
1501     /* backgroundPositionX */
1502     hres = IHTMLStyle_get_backgroundPositionX(style, &v);
1503     ok(hres == S_OK, "get_backgroundPositionX failed: %08x\n", hres);
1504     ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
1505     ok(!V_BSTR(&v), "backgroundPositionX = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1506     VariantClear(&v);
1507
1508     V_VT(&v) = VT_BSTR;
1509     V_BSTR(&v) = a2bstr("10px");
1510     hres = IHTMLStyle_put_backgroundPositionX(style, v);
1511     ok(hres == S_OK, "put_backgroundPositionX failed: %08x\n", hres);
1512     VariantClear(&v);
1513
1514     hres = IHTMLStyle_get_backgroundPositionX(style, &v);
1515     ok(hres == S_OK, "get_backgroundPositionX failed: %08x\n", hres);
1516     ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
1517     ok(!strcmp_wa(V_BSTR(&v), "10px"), "backgroundPositionX = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1518     VariantClear(&v);
1519
1520     /* backgroundPositionY */
1521     hres = IHTMLStyle_get_backgroundPositionY(style, &v);
1522     ok(hres == S_OK, "get_backgroundPositionY failed: %08x\n", hres);
1523     ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
1524     VariantClear(&v);
1525
1526     V_VT(&v) = VT_BSTR;
1527     V_BSTR(&v) = a2bstr("15px");
1528     hres = IHTMLStyle_put_backgroundPositionY(style, v);
1529     ok(hres == S_OK, "put_backgroundPositionY failed: %08x\n", hres);
1530     VariantClear(&v);
1531
1532     hres = IHTMLStyle_get_backgroundPositionY(style, &v);
1533     ok(hres == S_OK, "get_backgroundPositionY failed: %08x\n", hres);
1534     ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
1535     ok(!strcmp_wa(V_BSTR(&v), "15px"), "backgroundPositionY = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1536     VariantClear(&v);
1537
1538     /* backgroundPosition */
1539     str = NULL;
1540     hres = IHTMLStyle_get_backgroundPosition(style, &str);
1541     ok(hres == S_OK, "get_backgroundPosition failed: %08x\n", hres);
1542     ok(!strcmp_wa(str, "10px 15px"), "backgroundPosition = %s\n", wine_dbgstr_w(str));
1543     SysFreeString(str);
1544
1545     str = a2bstr("center 20%");
1546     hres = IHTMLStyle_put_backgroundPosition(style, str);
1547     ok(hres == S_OK, "put_backgroundPosition failed: %08x\n", hres);
1548     SysFreeString(str);
1549
1550     str = NULL;
1551     hres = IHTMLStyle_get_backgroundPosition(style, &str);
1552     ok(hres == S_OK, "get_backgroundPosition failed: %08x\n", hres);
1553     ok(!strcmp_wa(str, "center 20%"), "backgroundPosition = %s\n", wine_dbgstr_w(str));
1554     SysFreeString(str);
1555
1556     hres = IHTMLStyle_get_backgroundPositionX(style, &v);
1557     ok(hres == S_OK, "get_backgroundPositionX failed: %08x\n", hres);
1558     ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
1559     ok(!strcmp_wa(V_BSTR(&v), "center"), "backgroundPositionX = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1560     VariantClear(&v);
1561
1562     hres = IHTMLStyle_get_backgroundPositionY(style, &v);
1563     ok(hres == S_OK, "get_backgroundPositionY failed: %08x\n", hres);
1564     ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
1565     ok(!strcmp_wa(V_BSTR(&v), "20%"), "backgroundPositionY = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1566     VariantClear(&v);
1567
1568      /* borderTopWidth */
1569     hres = IHTMLStyle_get_borderTopWidth(style, &vDefault);
1570     ok(hres == S_OK, "get_borderTopWidth: %08x\n", hres);
1571
1572     V_VT(&v) = VT_BSTR;
1573     V_BSTR(&v) = a2bstr("10px");
1574     hres = IHTMLStyle_put_borderTopWidth(style, v);
1575     ok(hres == S_OK, "put_borderTopWidth: %08x\n", hres);
1576     VariantClear(&v);
1577
1578     hres = IHTMLStyle_get_borderTopWidth(style, &v);
1579     ok(hres == S_OK, "get_borderTopWidth: %08x\n", hres);
1580     ok(!strcmp_wa(V_BSTR(&v), "10px"), "expected 10px = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1581     VariantClear(&v);
1582
1583     hres = IHTMLStyle_put_borderTopWidth(style, vDefault);
1584     ok(hres == S_OK, "put_borderTopWidth: %08x\n", hres);
1585     VariantClear(&vDefault);
1586
1587     /* borderRightWidth */
1588     hres = IHTMLStyle_get_borderRightWidth(style, &vDefault);
1589     ok(hres == S_OK, "get_borderRightWidth: %08x\n", hres);
1590
1591     V_VT(&v) = VT_BSTR;
1592     V_BSTR(&v) = a2bstr("10");
1593     hres = IHTMLStyle_put_borderRightWidth(style, v);
1594     ok(hres == S_OK, "put_borderRightWidth: %08x\n", hres);
1595     VariantClear(&v);
1596
1597     hres = IHTMLStyle_get_borderRightWidth(style, &v);
1598     ok(hres == S_OK, "get_borderRightWidth: %08x\n", hres);
1599     ok(!strcmp_wa(V_BSTR(&v), "10px"), "expected 10px = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1600     VariantClear(&v);
1601
1602     hres = IHTMLStyle_put_borderRightWidth(style, vDefault);
1603     ok(hres == S_OK, "put_borderRightWidth: %08x\n", hres);
1604     VariantClear(&vDefault);
1605
1606     /* borderBottomWidth */
1607     hres = IHTMLStyle_get_borderBottomWidth(style, &vDefault);
1608     ok(hres == S_OK, "get_borderBottomWidth: %08x\n", hres);
1609
1610     V_VT(&v) = VT_BSTR;
1611     V_BSTR(&v) = a2bstr("10");
1612     hres = IHTMLStyle_put_borderBottomWidth(style, v);
1613     ok(hres == S_OK, "put_borderBottomWidth: %08x\n", hres);
1614     VariantClear(&v);
1615
1616     hres = IHTMLStyle_get_borderBottomWidth(style, &v);
1617     ok(hres == S_OK, "get_borderBottomWidth: %08x\n", hres);
1618     ok(!strcmp_wa(V_BSTR(&v), "10px"), "expected 10px = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1619     VariantClear(&v);
1620
1621     hres = IHTMLStyle_put_borderBottomWidth(style, vDefault);
1622     ok(hres == S_OK, "put_borderBottomWidth: %08x\n", hres);
1623     VariantClear(&vDefault);
1624
1625     /* borderLeftWidth */
1626     hres = IHTMLStyle_get_borderLeftWidth(style, &vDefault);
1627     ok(hres == S_OK, "get_borderLeftWidth: %08x\n", hres);
1628
1629     V_VT(&v) = VT_BSTR;
1630     V_BSTR(&v) = a2bstr("10");
1631     hres = IHTMLStyle_put_borderLeftWidth(style, v);
1632     ok(hres == S_OK, "put_borderLeftWidth: %08x\n", hres);
1633     VariantClear(&v);
1634
1635     hres = IHTMLStyle_get_borderLeftWidth(style, &v);
1636     ok(hres == S_OK, "get_borderLeftWidth: %08x\n", hres);
1637     ok(!strcmp_wa(V_BSTR(&v), "10px"), "expected 10px = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1638     VariantClear(&v);
1639
1640     hres = IHTMLStyle_put_borderLeftWidth(style, vDefault);
1641     ok(hres == S_OK, "put_borderLeftWidth: %08x\n", hres);
1642     VariantClear(&vDefault);
1643
1644     /* wordSpacing */
1645     hres = IHTMLStyle_get_wordSpacing(style, &vDefault);
1646     ok(hres == S_OK, "get_wordSpacing: %08x\n", hres);
1647
1648     V_VT(&v) = VT_BSTR;
1649     V_BSTR(&v) = a2bstr("10");
1650     hres = IHTMLStyle_put_wordSpacing(style, v);
1651     ok(hres == S_OK, "put_wordSpacing: %08x\n", hres);
1652     VariantClear(&v);
1653
1654     hres = IHTMLStyle_get_wordSpacing(style, &v);
1655     ok(hres == S_OK, "get_wordSpacing: %08x\n", hres);
1656     ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
1657     ok(!strcmp_wa(V_BSTR(&v), "10px"), "expected 10px = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1658     VariantClear(&v);
1659
1660     hres = IHTMLStyle_put_wordSpacing(style, vDefault);
1661     ok(hres == S_OK, "put_wordSpacing: %08x\n", hres);
1662     VariantClear(&vDefault);
1663
1664     /* letterSpacing */
1665     hres = IHTMLStyle_get_letterSpacing(style, &vDefault);
1666     ok(hres == S_OK, "get_letterSpacing: %08x\n", hres);
1667
1668     V_VT(&v) = VT_BSTR;
1669     V_BSTR(&v) = a2bstr("11");
1670     hres = IHTMLStyle_put_letterSpacing(style, v);
1671     ok(hres == S_OK, "put_letterSpacing: %08x\n", hres);
1672     VariantClear(&v);
1673
1674     hres = IHTMLStyle_get_letterSpacing(style, &v);
1675     ok(hres == S_OK, "get_letterSpacing: %08x\n", hres);
1676     ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
1677     ok(!strcmp_wa(V_BSTR(&v), "11px"), "expected 10px = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1678     VariantClear(&v);
1679
1680     hres = IHTMLStyle_put_letterSpacing(style, vDefault);
1681     ok(hres == S_OK, "put_letterSpacing: %08x\n", hres);
1682     VariantClear(&vDefault);
1683
1684     /* borderTopColor */
1685     hres = IHTMLStyle_get_borderTopColor(style, &vDefault);
1686     ok(hres == S_OK, "get_borderTopColor: %08x\n", hres);
1687
1688     V_VT(&v) = VT_BSTR;
1689     V_BSTR(&v) = a2bstr("red");
1690     hres = IHTMLStyle_put_borderTopColor(style, v);
1691     ok(hres == S_OK, "put_borderTopColor: %08x\n", hres);
1692     VariantClear(&v);
1693
1694     hres = IHTMLStyle_get_borderTopColor(style, &v);
1695     ok(hres == S_OK, "get_borderTopColor: %08x\n", hres);
1696     ok(!strcmp_wa(V_BSTR(&v), "red"), "expecte red = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1697     VariantClear(&v);
1698
1699     hres = IHTMLStyle_put_borderTopColor(style, vDefault);
1700     ok(hres == S_OK, "put_borderTopColor: %08x\n", hres);
1701
1702         /* borderRightColor */
1703     hres = IHTMLStyle_get_borderRightColor(style, &vDefault);
1704     ok(hres == S_OK, "get_borderRightColor: %08x\n", hres);
1705
1706     V_VT(&v) = VT_BSTR;
1707     V_BSTR(&v) = a2bstr("blue");
1708     hres = IHTMLStyle_put_borderRightColor(style, v);
1709     ok(hres == S_OK, "put_borderRightColor: %08x\n", hres);
1710     VariantClear(&v);
1711
1712     hres = IHTMLStyle_get_borderRightColor(style, &v);
1713     ok(hres == S_OK, "get_borderRightColor: %08x\n", hres);
1714     ok(!strcmp_wa(V_BSTR(&v), "blue"), "expected blue = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1715     VariantClear(&v);
1716
1717     hres = IHTMLStyle_put_borderRightColor(style, vDefault);
1718     ok(hres == S_OK, "putborderRightColorr: %08x\n", hres);
1719
1720     /* borderBottomColor */
1721     hres = IHTMLStyle_get_borderBottomColor(style, &vDefault);
1722     ok(hres == S_OK, "get_borderBottomColor: %08x\n", hres);
1723
1724     V_VT(&v) = VT_BSTR;
1725     V_BSTR(&v) = a2bstr("cyan");
1726     hres = IHTMLStyle_put_borderBottomColor(style, v);
1727     ok(hres == S_OK, "put_borderBottomColor: %08x\n", hres);
1728     VariantClear(&v);
1729
1730     hres = IHTMLStyle_get_borderBottomColor(style, &v);
1731     ok(hres == S_OK, "get_borderBottomColor: %08x\n", hres);
1732     ok(!strcmp_wa(V_BSTR(&v), "cyan"), "expected cyan = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1733     VariantClear(&v);
1734
1735     hres = IHTMLStyle_put_borderBottomColor(style, vDefault);
1736     ok(hres == S_OK, "put_borderBottomColor: %08x\n", hres);
1737
1738     /* borderLeftColor */
1739     hres = IHTMLStyle_get_borderLeftColor(style, &vDefault);
1740     ok(hres == S_OK, "get_borderLeftColor: %08x\n", hres);
1741
1742     V_VT(&v) = VT_BSTR;
1743     V_BSTR(&v) = a2bstr("cyan");
1744     hres = IHTMLStyle_put_borderLeftColor(style, v);
1745     ok(hres == S_OK, "put_borderLeftColor: %08x\n", hres);
1746     VariantClear(&v);
1747
1748     hres = IHTMLStyle_get_borderLeftColor(style, &v);
1749     ok(hres == S_OK, "get_borderLeftColor: %08x\n", hres);
1750     ok(!strcmp_wa(V_BSTR(&v), "cyan"), "expected cyan = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1751     VariantClear(&v);
1752
1753     hres = IHTMLStyle_put_borderLeftColor(style, vDefault);
1754     ok(hres == S_OK, "put_borderLeftColor: %08x\n", hres);
1755
1756     /* clip */
1757     hres = IHTMLStyle_get_clip(style, &str);
1758     ok(hres == S_OK, "get_clip failed: %08x\n", hres);
1759     ok(!str, "clip = %s\n", wine_dbgstr_w(str));
1760
1761     str = a2bstr("rect(0px 1px 500px 505px)");
1762     hres = IHTMLStyle_put_clip(style, str);
1763     ok(hres == S_OK, "put_clip failed: %08x\n", hres);
1764     SysFreeString(str);
1765
1766     hres = IHTMLStyle_get_clip(style, &str);
1767     ok(hres == S_OK, "get_clip failed: %08x\n", hres);
1768     ok(!strcmp_wa(str, "rect(0px 1px 500px 505px)"), "clip = %s\n", wine_dbgstr_w(str));
1769     SysFreeString(str);
1770
1771     /* pageBreakAfter */
1772     hres = IHTMLStyle_get_pageBreakAfter(style, &str);
1773     ok(hres == S_OK, "get_pageBreakAfter failed: %08x\n", hres);
1774     ok(!str, "pageBreakAfter = %s\n", wine_dbgstr_w(str));
1775
1776     str = a2bstr("always");
1777     hres = IHTMLStyle_put_pageBreakAfter(style, str);
1778     ok(hres == S_OK, "put_pageBreakAfter failed: %08x\n", hres);
1779     SysFreeString(str);
1780
1781     hres = IHTMLStyle_get_pageBreakAfter(style, &str);
1782     ok(hres == S_OK, "get_pageBreakAfter failed: %08x\n", hres);
1783     ok(!strcmp_wa(str, "always"), "pageBreakAfter = %s\n", wine_dbgstr_w(str));
1784     SysFreeString(str);
1785
1786     /* pageBreakBefore */
1787     hres = IHTMLStyle_get_pageBreakBefore(style, &str);
1788     ok(hres == S_OK, "get_pageBreakBefore failed: %08x\n", hres);
1789     ok(!str, "pageBreakBefore = %s\n", wine_dbgstr_w(str));
1790
1791     str = a2bstr("always");
1792     hres = IHTMLStyle_put_pageBreakBefore(style, str);
1793     ok(hres == S_OK, "put_pageBreakBefore failed: %08x\n", hres);
1794     SysFreeString(str);
1795
1796     hres = IHTMLStyle_get_pageBreakBefore(style, &str);
1797     ok(hres == S_OK, "get_pageBreakBefore failed: %08x\n", hres);
1798     ok(!strcmp_wa(str, "always"), "pageBreakBefore = %s\n", wine_dbgstr_w(str));
1799     SysFreeString(str);
1800
1801     hres = IHTMLStyle_QueryInterface(style, &IID_IHTMLStyle2, (void**)&style2);
1802     ok(hres == S_OK, "Could not get IHTMLStyle2 iface: %08x\n", hres);
1803     if(SUCCEEDED(hres)) {
1804         test_style2(style2);
1805         IHTMLStyle2_Release(style2);
1806     }
1807
1808     hres = IHTMLStyle_QueryInterface(style, &IID_IHTMLStyle3, (void**)&style3);
1809     ok(hres == S_OK, "Could not get IHTMLStyle3 iface: %08x\n", hres);
1810     if(SUCCEEDED(hres)) {
1811         test_style3(style3);
1812         IHTMLStyle3_Release(style3);
1813     }
1814
1815     hres = IHTMLStyle_QueryInterface(style, &IID_IHTMLStyle4, (void**)&style4);
1816     ok(hres == S_OK, "Could not get IHTMLStyle4 iface: %08x\n", hres);
1817     if(SUCCEEDED(hres)) {
1818         test_style4(style4);
1819         IHTMLStyle4_Release(style4);
1820     }
1821 }
1822
1823 #define test_style_filter(a,b) _test_style_filter(__LINE__,a,b)
1824 static void _test_style_filter(unsigned line, IHTMLStyle *style, const char *exval)
1825 {
1826     BSTR str;
1827     HRESULT hres;
1828
1829     str = (void*)0xdeadbeef;
1830     hres = IHTMLStyle_get_filter(style, &str);
1831     ok_(__FILE__,line)(hres == S_OK, "get_filter failed: %08x\n", hres);
1832     if(exval)
1833         ok_(__FILE__,line)(str && !strcmp_wa(str, exval), "filter = %s, expected %s\n", wine_dbgstr_w(str), exval);
1834     else
1835         ok_(__FILE__,line)(!str, "str = %s, expected NULL\n", wine_dbgstr_w(str));
1836
1837     SysFreeString(str);
1838 }
1839
1840 #define set_style_filter(a,b) _set_style_filter(__LINE__,a,b)
1841 static void _set_style_filter(unsigned line, IHTMLStyle *style, const char *val)
1842 {
1843     BSTR str = a2bstr(val);
1844     HRESULT hres;
1845
1846     hres = IHTMLStyle_put_filter(style, str);
1847     ok_(__FILE__,line)(hres == S_OK, "put_filter failed: %08x\n", hres);
1848     SysFreeString(str);
1849
1850     _test_style_filter(line, style, val);
1851 }
1852
1853 static void test_style_filters(IHTMLElement *elem)
1854 {
1855     IHTMLStyle *style;
1856     HRESULT hres;
1857
1858     hres = IHTMLElement_get_style(elem, &style);
1859     ok(hres == S_OK, "get_style failed: %08x\n", hres);
1860
1861     test_style_filter(style, NULL);
1862     set_style_filter(style, "alpha(opacity=50.0040)");
1863     set_style_filter(style, "alpha(opacity=100)");
1864
1865     IHTMLStyle_Release(style);
1866
1867     hres = IHTMLElement_get_style(elem, &style);
1868     ok(hres == S_OK, "get_style failed: %08x\n", hres);
1869
1870     test_style_filter(style, "alpha(opacity=100)");
1871     set_style_filter(style, "xxx(a,b,c) alpha(opacity=100)");
1872     set_style_filter(style, NULL);
1873
1874     IHTMLStyle_Release(style);
1875 }
1876
1877 static void test_current_style(IHTMLCurrentStyle *current_style)
1878 {
1879     BSTR str;
1880     HRESULT hres;
1881     VARIANT v;
1882
1883     hres = IHTMLCurrentStyle_get_display(current_style, &str);
1884     ok(hres == S_OK, "get_display failed: %08x\n", hres);
1885     ok(!strcmp_wa(str, "block"), "get_display returned %s\n", wine_dbgstr_w(str));
1886     SysFreeString(str);
1887
1888     hres = IHTMLCurrentStyle_get_position(current_style, &str);
1889     ok(hres == S_OK, "get_position failed: %08x\n", hres);
1890     ok(!strcmp_wa(str, "absolute"), "get_position returned %s\n", wine_dbgstr_w(str));
1891     SysFreeString(str);
1892
1893     hres = IHTMLCurrentStyle_get_fontFamily(current_style, &str);
1894     ok(hres == S_OK, "get_fontFamily failed: %08x\n", hres);
1895     SysFreeString(str);
1896
1897     hres = IHTMLCurrentStyle_get_fontStyle(current_style, &str);
1898     ok(hres == S_OK, "get_fontStyle failed: %08x\n", hres);
1899     ok(!strcmp_wa(str, "normal"), "get_fontStyle returned %s\n", wine_dbgstr_w(str));
1900     SysFreeString(str);
1901
1902     hres = IHTMLCurrentStyle_get_backgroundImage(current_style, &str);
1903     ok(hres == S_OK, "get_backgroundImage failed: %08x\n", hres);
1904     ok(!strcmp_wa(str, "none"), "get_backgroundImage returned %s\n", wine_dbgstr_w(str));
1905     SysFreeString(str);
1906
1907     hres = IHTMLCurrentStyle_get_fontVariant(current_style, &str);
1908     ok(hres == S_OK, "get_fontVariant failed: %08x\n", hres);
1909     ok(!strcmp_wa(str, "normal"), "get_fontVariant returned %s\n", wine_dbgstr_w(str));
1910     SysFreeString(str);
1911
1912     hres = IHTMLCurrentStyle_get_borderTopStyle(current_style, &str);
1913     ok(hres == S_OK, "get_borderTopStyle failed: %08x\n", hres);
1914     ok(!strcmp_wa(str, "none"), "get_borderTopStyle returned %s\n", wine_dbgstr_w(str));
1915     SysFreeString(str);
1916
1917     hres = IHTMLCurrentStyle_get_borderRightStyle(current_style, &str);
1918     ok(hres == S_OK, "get_borderRightStyle failed: %08x\n", hres);
1919     ok(!strcmp_wa(str, "none"), "get_borderRightStyle returned %s\n", wine_dbgstr_w(str));
1920     SysFreeString(str);
1921
1922     hres = IHTMLCurrentStyle_get_borderBottomStyle(current_style, &str);
1923     ok(hres == S_OK, "get_borderBottomStyle failed: %08x\n", hres);
1924     ok(!strcmp_wa(str, "none"), "get_borderBottomStyle returned %s\n", wine_dbgstr_w(str));
1925     SysFreeString(str);
1926
1927     hres = IHTMLCurrentStyle_get_borderLeftStyle(current_style, &str);
1928     ok(hres == S_OK, "get_borderLeftStyle failed: %08x\n", hres);
1929     ok(!strcmp_wa(str, "none"), "get_borderLeftStyle returned %s\n", wine_dbgstr_w(str));
1930     SysFreeString(str);
1931
1932     hres = IHTMLCurrentStyle_get_textAlign(current_style, &str);
1933     ok(hres == S_OK, "get_textAlign failed: %08x\n", hres);
1934     ok(!strcmp_wa(str, "center"), "get_textAlign returned %s\n", wine_dbgstr_w(str));
1935     SysFreeString(str);
1936
1937     hres = IHTMLCurrentStyle_get_textDecoration(current_style, &str);
1938     ok(hres == S_OK, "get_textDecoration failed: %08x\n", hres);
1939     ok(!strcmp_wa(str, "none"), "get_textDecoration returned %s\n", wine_dbgstr_w(str));
1940     SysFreeString(str);
1941
1942     hres = IHTMLCurrentStyle_get_cursor(current_style, &str);
1943     ok(hres == S_OK, "get_cursor failed: %08x\n", hres);
1944     ok(!strcmp_wa(str, "default"), "get_cursor returned %s\n", wine_dbgstr_w(str));
1945     SysFreeString(str);
1946
1947     hres = IHTMLCurrentStyle_get_backgroundRepeat(current_style, &str);
1948     ok(hres == S_OK, "get_backgroundRepeat failed: %08x\n", hres);
1949     ok(!strcmp_wa(str, "repeat"), "get_backgroundRepeat returned %s\n", wine_dbgstr_w(str));
1950     SysFreeString(str);
1951
1952     hres = IHTMLCurrentStyle_get_borderColor(current_style, &str);
1953     ok(hres == S_OK, "get_borderColor failed: %08x\n", hres);
1954     SysFreeString(str);
1955
1956     hres = IHTMLCurrentStyle_get_borderStyle(current_style, &str);
1957     ok(hres == S_OK, "get_borderStyle failed: %08x\n", hres);
1958     SysFreeString(str);
1959
1960     hres = IHTMLCurrentStyle_get_visibility(current_style, &str);
1961     ok(hres == S_OK, "get_visibility failed: %08x\n", hres);
1962     SysFreeString(str);
1963
1964     hres = IHTMLCurrentStyle_get_overflow(current_style, &str);
1965     ok(hres == S_OK, "get_overflow failed: %08x\n", hres);
1966     SysFreeString(str);
1967
1968     hres = IHTMLCurrentStyle_get_borderWidth(current_style, &str);
1969     ok(hres == S_OK, "get_borderWidth failed: %08x\n", hres);
1970     SysFreeString(str);
1971
1972     hres = IHTMLCurrentStyle_get_margin(current_style, &str);
1973     ok(hres == S_OK, "get_margin failed: %08x\n", hres);
1974     SysFreeString(str);
1975
1976     hres = IHTMLCurrentStyle_get_padding(current_style, &str);
1977     ok(hres == S_OK, "get_padding failed: %08x\n", hres);
1978     SysFreeString(str);
1979
1980     hres = IHTMLCurrentStyle_get_fontWeight(current_style, &v);
1981     ok(hres == S_OK, "get_fontWeight failed: %08x\n", hres);
1982     ok(V_VT(&v) == VT_I4, "V_VT(v) = %d\n", V_VT(&v));
1983     ok( V_I4(&v) == 400, "expect 400 got (%d)\n", V_I4(&v));
1984     VariantClear(&v);
1985
1986     hres = IHTMLCurrentStyle_get_fontSize(current_style, &v);
1987     ok(hres == S_OK, "get_fontSize failed: %08x\n", hres);
1988     ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
1989     VariantClear(&v);
1990
1991     hres = IHTMLCurrentStyle_get_left(current_style, &v);
1992     ok(hres == S_OK, "get_left failed: %08x\n", hres);
1993     ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
1994     VariantClear(&v);
1995
1996     hres = IHTMLCurrentStyle_get_top(current_style, &v);
1997     ok(hres == S_OK, "get_top failed: %08x\n", hres);
1998     ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
1999     VariantClear(&v);
2000
2001     hres = IHTMLCurrentStyle_get_width(current_style, &v);
2002     ok(hres == S_OK, "get_width failed: %08x\n", hres);
2003     ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2004     VariantClear(&v);
2005
2006     hres = IHTMLCurrentStyle_get_height(current_style, &v);
2007     ok(hres == S_OK, "get_height failed: %08x\n", hres);
2008     ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2009     VariantClear(&v);
2010
2011     hres = IHTMLCurrentStyle_get_paddingLeft(current_style, &v);
2012     ok(hres == S_OK, "get_paddingLeft failed: %08x\n", hres);
2013     ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2014     VariantClear(&v);
2015
2016     hres = IHTMLCurrentStyle_get_zIndex(current_style, &v);
2017     ok(hres == S_OK, "get_zIndex failed: %08x\n", hres);
2018     ok(V_VT(&v) == VT_I4, "V_VT(v) = %d\n", V_VT(&v));
2019     ok( V_I4(&v) == 1, "expect 1 got (%d)\n", V_I4(&v));
2020     VariantClear(&v);
2021
2022     hres = IHTMLCurrentStyle_get_verticalAlign(current_style, &v);
2023     ok(hres == S_OK, "get_verticalAlign failed: %08x\n", hres);
2024     ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2025     ok(!strcmp_wa(V_BSTR(&v), "middle"), "get_verticalAlign returned %s\n", wine_dbgstr_w(V_BSTR(&v)));
2026     VariantClear(&v);
2027
2028     hres = IHTMLCurrentStyle_get_marginRight(current_style, &v);
2029     ok(hres == S_OK, "get_marginRight failed: %08x\n", hres);
2030     ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2031     VariantClear(&v);
2032
2033     hres = IHTMLCurrentStyle_get_marginLeft(current_style, &v);
2034     ok(hres == S_OK, "get_marginLeft failed: %08x\n", hres);
2035     ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2036     VariantClear(&v);
2037
2038     hres = IHTMLCurrentStyle_get_borderLeftWidth(current_style, &v);
2039     ok(hres == S_OK, "get_borderLeftWidth failed: %08x\n", hres);
2040     ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2041     VariantClear(&v);
2042
2043     V_BSTR(&v) = NULL;
2044     hres = IHTMLCurrentStyle_get_borderRightWidth(current_style, &v);
2045     ok(hres == S_OK, "get_borderRightWidth failed: %08x\n", hres);
2046     ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2047     VariantClear(&v);
2048
2049     hres = IHTMLCurrentStyle_get_borderBottomWidth(current_style, &v);
2050     ok(hres == S_OK, "get_borderBottomWidth failed: %08x\n", hres);
2051     ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2052     VariantClear(&v);
2053
2054     hres = IHTMLCurrentStyle_get_borderTopWidth(current_style, &v);
2055     ok(hres == S_OK, "get_borderTopWidth failed: %08x\n", hres);
2056     ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2057     VariantClear(&v);
2058
2059     hres = IHTMLCurrentStyle_get_color(current_style, &v);
2060     ok(hres == S_OK, "get_color failed: %08x\n", hres);
2061     ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2062     VariantClear(&v);
2063
2064     hres = IHTMLCurrentStyle_get_backgroundColor(current_style, &v);
2065     ok(hres == S_OK, "get_backgroundColor failed: %08x\n", hres);
2066     ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2067     VariantClear(&v);
2068
2069     hres = IHTMLCurrentStyle_get_borderLeftColor(current_style, &v);
2070     ok(hres == S_OK, "get_borderLeftColor failed: %08x\n", hres);
2071     ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2072     VariantClear(&v);
2073
2074     hres = IHTMLCurrentStyle_get_borderTopColor(current_style, &v);
2075     ok(hres == S_OK, "get_borderTopColor failed: %08x\n", hres);
2076     ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2077     VariantClear(&v);
2078
2079     hres = IHTMLCurrentStyle_get_borderRightColor(current_style, &v);
2080     ok(hres == S_OK, "get_borderRightColor failed: %08x\n", hres);
2081     ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2082     VariantClear(&v);
2083
2084     hres = IHTMLCurrentStyle_get_borderBottomColor(current_style, &v);
2085     ok(hres == S_OK, "get_borderBottomColor failed: %08x\n", hres);
2086     ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2087     VariantClear(&v);
2088
2089     hres = IHTMLCurrentStyle_get_paddingTop(current_style, &v);
2090     ok(hres == S_OK, "get_paddingTop failed: %08x\n", hres);
2091     ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2092     VariantClear(&v);
2093
2094     hres = IHTMLCurrentStyle_get_paddingRight(current_style, &v);
2095     ok(hres == S_OK, "get_paddingRight failed: %08x\n", hres);
2096     ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2097     VariantClear(&v);
2098
2099     hres = IHTMLCurrentStyle_get_paddingBottom(current_style, &v);
2100     ok(hres == S_OK, "get_paddingRight failed: %08x\n", hres);
2101     ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2102     VariantClear(&v);
2103
2104     hres = IHTMLCurrentStyle_get_letterSpacing(current_style, &v);
2105     ok(hres == S_OK, "get_letterSpacing failed: %08x\n", hres);
2106     ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2107     VariantClear(&v);
2108
2109     hres = IHTMLCurrentStyle_get_marginTop(current_style, &v);
2110     ok(hres == S_OK, "get_marginTop failed: %08x\n", hres);
2111     ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2112     VariantClear(&v);
2113
2114     hres = IHTMLCurrentStyle_get_marginBottom(current_style, &v);
2115     ok(hres == S_OK, "get_marginBottom failed: %08x\n", hres);
2116     ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2117     VariantClear(&v);
2118
2119     hres = IHTMLCurrentStyle_get_right(current_style, &v);
2120     ok(hres == S_OK, "get_Right failed: %08x\n", hres);
2121     ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2122     VariantClear(&v);
2123
2124     hres = IHTMLCurrentStyle_get_bottom(current_style, &v);
2125     ok(hres == S_OK, "get_bottom failed: %08x\n", hres);
2126     ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2127     VariantClear(&v);
2128
2129     hres = IHTMLCurrentStyle_get_lineHeight(current_style, &v);
2130     ok(hres == S_OK, "get_lineHeight failed: %08x\n", hres);
2131     ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2132     VariantClear(&v);
2133
2134     hres = IHTMLCurrentStyle_get_textIndent(current_style, &v);
2135     ok(hres == S_OK, "get_textIndent failed: %08x\n", hres);
2136     ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2137     VariantClear(&v);
2138 }
2139
2140 static const char basic_test_str[] = "<html><body><div id=\"divid\"></div/</body></html>";
2141
2142 static void basic_style_test(IHTMLDocument2 *doc)
2143 {
2144     IHTMLCurrentStyle *cstyle;
2145     IHTMLElement *elem;
2146     IHTMLStyle *style;
2147     HRESULT hres;
2148
2149     hres = IHTMLDocument2_get_body(doc, &elem);
2150     ok(hres == S_OK, "get_body failed: %08x\n", hres);
2151
2152     hres = IHTMLElement_get_style(elem, &style);
2153     ok(hres == S_OK, "get_style failed: %08x\n", hres);
2154
2155     test_body_style(style);
2156
2157     cstyle = get_current_style(elem);
2158     test_current_style(cstyle);
2159     IHTMLCurrentStyle_Release(cstyle);
2160     IHTMLElement_Release(elem);
2161
2162     elem = get_element_by_id(doc, "divid");
2163     test_style_filters(elem);
2164
2165     test_set_csstext(style);
2166     IHTMLStyle_Release(style);
2167     IHTMLElement_Release(elem);
2168 }
2169
2170 static IHTMLDocument2 *notif_doc;
2171 static BOOL doc_complete;
2172
2173 static IHTMLDocument2 *create_document(void)
2174 {
2175     IHTMLDocument2 *doc;
2176     IHTMLDocument5 *doc5;
2177     HRESULT hres;
2178
2179     hres = CoCreateInstance(&CLSID_HTMLDocument, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
2180             &IID_IHTMLDocument2, (void**)&doc);
2181     ok(hres == S_OK, "CoCreateInstance failed: %08x\n", hres);
2182     if(FAILED(hres))
2183         return NULL;
2184
2185     hres = IHTMLDocument2_QueryInterface(doc, &IID_IHTMLDocument5, (void**)&doc5);
2186     if(FAILED(hres)) {
2187         win_skip("Could not get IHTMLDocument5, probably too old IE\n");
2188         IHTMLDocument2_Release(doc);
2189         return NULL;
2190     }
2191
2192     IHTMLDocument5_Release(doc5);
2193     return doc;
2194 }
2195
2196 static HRESULT WINAPI PropertyNotifySink_QueryInterface(IPropertyNotifySink *iface,
2197         REFIID riid, void**ppv)
2198 {
2199     if(IsEqualGUID(&IID_IPropertyNotifySink, riid)) {
2200         *ppv = iface;
2201         return S_OK;
2202     }
2203
2204     ok(0, "unexpected call\n");
2205     return E_NOINTERFACE;
2206 }
2207
2208 static ULONG WINAPI PropertyNotifySink_AddRef(IPropertyNotifySink *iface)
2209 {
2210     return 2;
2211 }
2212
2213 static ULONG WINAPI PropertyNotifySink_Release(IPropertyNotifySink *iface)
2214 {
2215     return 1;
2216 }
2217
2218 static HRESULT WINAPI PropertyNotifySink_OnChanged(IPropertyNotifySink *iface, DISPID dispID)
2219 {
2220     if(dispID == DISPID_READYSTATE){
2221         BSTR state;
2222         HRESULT hres;
2223
2224         hres = IHTMLDocument2_get_readyState(notif_doc, &state);
2225         ok(hres == S_OK, "get_readyState failed: %08x\n", hres);
2226
2227         if(!strcmp_wa(state, "complete"))
2228             doc_complete = TRUE;
2229
2230         SysFreeString(state);
2231     }
2232
2233     return S_OK;
2234 }
2235
2236 static HRESULT WINAPI PropertyNotifySink_OnRequestEdit(IPropertyNotifySink *iface, DISPID dispID)
2237 {
2238     ok(0, "unexpected call\n");
2239     return E_NOTIMPL;
2240 }
2241
2242 static IPropertyNotifySinkVtbl PropertyNotifySinkVtbl = {
2243     PropertyNotifySink_QueryInterface,
2244     PropertyNotifySink_AddRef,
2245     PropertyNotifySink_Release,
2246     PropertyNotifySink_OnChanged,
2247     PropertyNotifySink_OnRequestEdit
2248 };
2249
2250 static IPropertyNotifySink PropertyNotifySink = { &PropertyNotifySinkVtbl };
2251
2252 static IHTMLDocument2 *create_doc_with_string(const char *str)
2253 {
2254     IPersistStreamInit *init;
2255     IStream *stream;
2256     IHTMLDocument2 *doc;
2257     HGLOBAL mem;
2258     SIZE_T len;
2259
2260     notif_doc = doc = create_document();
2261     if(!doc)
2262         return NULL;
2263
2264     doc_complete = FALSE;
2265     len = strlen(str);
2266     mem = GlobalAlloc(0, len);
2267     memcpy(mem, str, len);
2268     CreateStreamOnHGlobal(mem, TRUE, &stream);
2269
2270     IHTMLDocument2_QueryInterface(doc, &IID_IPersistStreamInit, (void**)&init);
2271
2272     IPersistStreamInit_Load(init, stream);
2273     IPersistStreamInit_Release(init);
2274     IStream_Release(stream);
2275
2276     return doc;
2277 }
2278
2279 static void do_advise(IUnknown *unk, REFIID riid, IUnknown *unk_advise)
2280 {
2281     IConnectionPointContainer *container;
2282     IConnectionPoint *cp;
2283     DWORD cookie;
2284     HRESULT hres;
2285
2286     hres = IUnknown_QueryInterface(unk, &IID_IConnectionPointContainer, (void**)&container);
2287     ok(hres == S_OK, "QueryInterface(IID_IConnectionPointContainer) failed: %08x\n", hres);
2288
2289     hres = IConnectionPointContainer_FindConnectionPoint(container, riid, &cp);
2290     IConnectionPointContainer_Release(container);
2291     ok(hres == S_OK, "FindConnectionPoint failed: %08x\n", hres);
2292
2293     hres = IConnectionPoint_Advise(cp, unk_advise, &cookie);
2294     IConnectionPoint_Release(cp);
2295     ok(hres == S_OK, "Advise failed: %08x\n", hres);
2296 }
2297
2298 typedef void (*style_test_t)(IHTMLDocument2*);
2299
2300 static void run_test(const char *str, style_test_t test)
2301 {
2302     IHTMLDocument2 *doc;
2303     ULONG ref;
2304     MSG msg;
2305
2306     doc = create_doc_with_string(str);
2307     if(!doc)
2308         return;
2309
2310     do_advise((IUnknown*)doc, &IID_IPropertyNotifySink, (IUnknown*)&PropertyNotifySink);
2311
2312     while(!doc_complete && GetMessage(&msg, NULL, 0, 0)) {
2313         TranslateMessage(&msg);
2314         DispatchMessage(&msg);
2315     }
2316
2317     test(doc);
2318
2319     ref = IHTMLDocument2_Release(doc);
2320     ok(!ref || broken(ref == 1), /* Vista */
2321        "ref = %d\n", ref);
2322 }
2323
2324
2325 START_TEST(style)
2326 {
2327     CoInitialize(NULL);
2328
2329     run_test(basic_test_str, basic_style_test);
2330
2331     CoUninitialize();
2332 }