1c2c66affSColin Finck /*
2c2c66affSColin Finck * Copyright 2007-2011 Jacek Caban for CodeWeavers
3c2c66affSColin Finck *
4c2c66affSColin Finck * This library is free software; you can redistribute it and/or
5c2c66affSColin Finck * modify it under the terms of the GNU Lesser General Public
6c2c66affSColin Finck * License as published by the Free Software Foundation; either
7c2c66affSColin Finck * version 2.1 of the License, or (at your option) any later version.
8c2c66affSColin Finck *
9c2c66affSColin Finck * This library is distributed in the hope that it will be useful,
10c2c66affSColin Finck * but WITHOUT ANY WARRANTY; without even the implied warranty of
11c2c66affSColin Finck * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12c2c66affSColin Finck * Lesser General Public License for more details.
13c2c66affSColin Finck *
14c2c66affSColin Finck * You should have received a copy of the GNU Lesser General Public
15c2c66affSColin Finck * License along with this library; if not, write to the Free Software
16c2c66affSColin Finck * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17c2c66affSColin Finck */
18c2c66affSColin Finck
19*ba54c564SAmine Khaldi #include "precomp.h"
20c2c66affSColin Finck
strcmp_wa(LPCWSTR strw,const char * stra)21c2c66affSColin Finck static int strcmp_wa(LPCWSTR strw, const char *stra)
22c2c66affSColin Finck {
23c2c66affSColin Finck CHAR buf[512];
24c2c66affSColin Finck WideCharToMultiByte(CP_ACP, 0, strw, -1, buf, sizeof(buf), NULL, NULL);
25c2c66affSColin Finck return lstrcmpA(stra, buf);
26c2c66affSColin Finck }
27c2c66affSColin Finck
wstr_contains(const WCHAR * strw,const char * stra)28c2c66affSColin Finck static BOOL wstr_contains(const WCHAR *strw, const char *stra)
29c2c66affSColin Finck {
30c2c66affSColin Finck CHAR buf[512];
31c2c66affSColin Finck WideCharToMultiByte(CP_ACP, 0, strw, -1, buf, sizeof(buf), NULL, NULL);
32c2c66affSColin Finck return strstr(buf, stra) != NULL;
33c2c66affSColin Finck }
34c2c66affSColin Finck
a2bstr(const char * str)35c2c66affSColin Finck static BSTR a2bstr(const char *str)
36c2c66affSColin Finck {
37c2c66affSColin Finck BSTR ret;
38c2c66affSColin Finck int len;
39c2c66affSColin Finck
40c2c66affSColin Finck if(!str)
41c2c66affSColin Finck return NULL;
42c2c66affSColin Finck
43c2c66affSColin Finck len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
44c2c66affSColin Finck ret = SysAllocStringLen(NULL, len);
45c2c66affSColin Finck MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
46c2c66affSColin Finck
47c2c66affSColin Finck return ret;
48c2c66affSColin Finck }
49c2c66affSColin Finck
strstr_wa(const WCHAR * str,const char * suba)50c2c66affSColin Finck static const WCHAR *strstr_wa(const WCHAR *str, const char *suba)
51c2c66affSColin Finck {
52c2c66affSColin Finck BSTR sub;
53c2c66affSColin Finck const WCHAR *ret = NULL;
54c2c66affSColin Finck sub = a2bstr(suba);
55c2c66affSColin Finck while (*str)
56c2c66affSColin Finck {
57c2c66affSColin Finck const WCHAR *p1 = str, *p2 = sub;
58c2c66affSColin Finck while (*p1 && *p2 && *p1 == *p2) { p1++; p2++; }
59c2c66affSColin Finck if (!*p2) {ret = str; break;}
60c2c66affSColin Finck str++;
61c2c66affSColin Finck }
62c2c66affSColin Finck SysFreeString(sub);
63c2c66affSColin Finck return ret;
64c2c66affSColin Finck }
65c2c66affSColin Finck
66c2c66affSColin Finck #define test_var_bstr(a,b) _test_var_bstr(__LINE__,a,b)
_test_var_bstr(unsigned line,const VARIANT * v,const char * expect)67c2c66affSColin Finck static void _test_var_bstr(unsigned line, const VARIANT *v, const char *expect)
68c2c66affSColin Finck {
69c2c66affSColin Finck ok_(__FILE__,line)(V_VT(v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(v));
70c2c66affSColin Finck if(expect)
71c2c66affSColin Finck ok_(__FILE__,line)(!strcmp_wa(V_BSTR(v), expect), "V_BSTR(v) = %s, expected %s\n", wine_dbgstr_w(V_BSTR(v)), expect);
72c2c66affSColin Finck else
73c2c66affSColin Finck ok_(__FILE__,line)(!V_BSTR(v), "V_BSTR(v) = %s, expected NULL\n", wine_dbgstr_w(V_BSTR(v)));
74c2c66affSColin Finck }
75c2c66affSColin Finck
76c2c66affSColin Finck #define get_elem2_iface(u) _get_elem2_iface(__LINE__,u)
_get_elem2_iface(unsigned line,IUnknown * unk)77c2c66affSColin Finck static IHTMLElement2 *_get_elem2_iface(unsigned line, IUnknown *unk)
78c2c66affSColin Finck {
79c2c66affSColin Finck IHTMLElement2 *elem;
80c2c66affSColin Finck HRESULT hres;
81c2c66affSColin Finck
82c2c66affSColin Finck hres = IUnknown_QueryInterface(unk, &IID_IHTMLElement2, (void**)&elem);
83c2c66affSColin Finck ok_(__FILE__,line) (hres == S_OK, "Could not get IHTMLElement2: %08x\n", hres);
84c2c66affSColin Finck return elem;
85c2c66affSColin Finck }
86c2c66affSColin Finck
87c2c66affSColin Finck #define get_current_style2_iface(u) _get_current_style2_iface(__LINE__,u)
_get_current_style2_iface(unsigned line,IUnknown * unk)88c2c66affSColin Finck static IHTMLCurrentStyle2 *_get_current_style2_iface(unsigned line, IUnknown *unk)
89c2c66affSColin Finck {
90c2c66affSColin Finck IHTMLCurrentStyle2 *current_style2;
91c2c66affSColin Finck HRESULT hres;
92c2c66affSColin Finck
93c2c66affSColin Finck hres = IUnknown_QueryInterface(unk, &IID_IHTMLCurrentStyle2, (void**)¤t_style2);
94c2c66affSColin Finck ok_(__FILE__,line) (hres == S_OK, "Could not get IHTMLElement2: %08x\n", hres);
95c2c66affSColin Finck return current_style2;
96c2c66affSColin Finck }
97c2c66affSColin Finck
get_element_by_id(IHTMLDocument2 * doc,const char * id)98c2c66affSColin Finck static IHTMLElement *get_element_by_id(IHTMLDocument2 *doc, const char *id)
99c2c66affSColin Finck {
100c2c66affSColin Finck HRESULT hres;
101c2c66affSColin Finck IHTMLDocument3 *doc3;
102c2c66affSColin Finck IHTMLElement *result;
103c2c66affSColin Finck BSTR idW = a2bstr(id);
104c2c66affSColin Finck
105c2c66affSColin Finck hres = IHTMLDocument2_QueryInterface(doc, &IID_IHTMLDocument3, (void**)&doc3);
106c2c66affSColin Finck ok(hres == S_OK, "QueryInterface(IID_IHTMLDocument3) failed: %08x\n", hres);
107c2c66affSColin Finck
108c2c66affSColin Finck hres = IHTMLDocument3_getElementById(doc3, idW, &result);
109c2c66affSColin Finck ok(hres == S_OK, "getElementById failed: %08x\n", hres);
110c2c66affSColin Finck ok(result != NULL, "result == NULL\n");
111c2c66affSColin Finck SysFreeString(idW);
112c2c66affSColin Finck
113c2c66affSColin Finck IHTMLDocument3_Release(doc3);
114c2c66affSColin Finck return result;
115c2c66affSColin Finck }
116c2c66affSColin Finck
117c2c66affSColin Finck #define get_current_style(e) _get_current_style(__LINE__,e)
_get_current_style(unsigned line,IHTMLElement * elem)118c2c66affSColin Finck static IHTMLCurrentStyle *_get_current_style(unsigned line, IHTMLElement *elem)
119c2c66affSColin Finck {
120c2c66affSColin Finck IHTMLCurrentStyle *cstyle;
121c2c66affSColin Finck IHTMLElement2 *elem2;
122c2c66affSColin Finck HRESULT hres;
123c2c66affSColin Finck
124c2c66affSColin Finck hres = IHTMLElement_QueryInterface(elem, &IID_IHTMLElement2, (void**)&elem2);
125c2c66affSColin Finck ok(hres == S_OK, "Could not get IHTMLElement2 iface: %08x\n", hres);
126c2c66affSColin Finck
127c2c66affSColin Finck cstyle = NULL;
128c2c66affSColin Finck hres = IHTMLElement2_get_currentStyle(elem2, &cstyle);
129c2c66affSColin Finck ok(hres == S_OK, "get_currentStyle failed: %08x\n", hres);
130c2c66affSColin Finck ok(cstyle != NULL, "cstyle = %p\n", cstyle);
131c2c66affSColin Finck
132c2c66affSColin Finck IHTMLElement2_Release(elem2);
133c2c66affSColin Finck return cstyle;
134c2c66affSColin Finck }
135c2c66affSColin Finck
136c2c66affSColin Finck #define test_border_styles(p, n) _test_border_styles(__LINE__, p, n)
_test_border_styles(unsigned line,IHTMLStyle * pStyle,BSTR Name)137c2c66affSColin Finck static void _test_border_styles(unsigned line, IHTMLStyle *pStyle, BSTR Name)
138c2c66affSColin Finck {
139c2c66affSColin Finck HRESULT hres;
140c2c66affSColin Finck DISPID dispid;
141c2c66affSColin Finck
142c2c66affSColin Finck hres = IHTMLStyle_GetIDsOfNames(pStyle, &IID_NULL, &Name, 1,
143c2c66affSColin Finck LOCALE_USER_DEFAULT, &dispid);
144c2c66affSColin Finck ok_(__FILE__,line) (hres == S_OK, "GetIDsOfNames: %08x\n", hres);
145c2c66affSColin Finck if(hres == S_OK)
146c2c66affSColin Finck {
147c2c66affSColin Finck DISPPARAMS params = {NULL,NULL,0,0};
148c2c66affSColin Finck DISPID dispidNamed = DISPID_PROPERTYPUT;
149c2c66affSColin Finck VARIANT ret;
150c2c66affSColin Finck VARIANT vDefault;
151c2c66affSColin Finck VARIANTARG arg;
152c2c66affSColin Finck
153c2c66affSColin Finck hres = IHTMLStyle_Invoke(pStyle, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
154c2c66affSColin Finck DISPATCH_PROPERTYGET, ¶ms, &vDefault, NULL, NULL);
155c2c66affSColin Finck ok_(__FILE__,line) (hres == S_OK, "get_default. ret: %08x\n", hres);
156c2c66affSColin Finck
157c2c66affSColin Finck params.cArgs = 1;
158c2c66affSColin Finck params.cNamedArgs = 1;
159c2c66affSColin Finck params.rgdispidNamedArgs = &dispidNamed;
160c2c66affSColin Finck V_VT(&arg) = VT_BSTR;
161c2c66affSColin Finck V_BSTR(&arg) = a2bstr("none");
162c2c66affSColin Finck params.rgvarg = &arg;
163c2c66affSColin Finck hres = IHTMLStyle_Invoke(pStyle, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
164c2c66affSColin Finck DISPATCH_PROPERTYPUT, ¶ms, &ret, NULL, NULL);
165c2c66affSColin Finck ok_(__FILE__,line) (hres == S_OK, "none. ret: %08x\n", hres);
166c2c66affSColin Finck VariantClear(&arg);
167c2c66affSColin Finck
168c2c66affSColin Finck V_VT(&arg) = VT_BSTR;
169c2c66affSColin Finck V_BSTR(&arg) = a2bstr("dotted");
170c2c66affSColin Finck hres = IHTMLStyle_Invoke(pStyle, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
171c2c66affSColin Finck DISPATCH_PROPERTYPUT, ¶ms, &ret, NULL, NULL);
172c2c66affSColin Finck ok_(__FILE__,line) (hres == S_OK, "dotted. ret: %08x\n", hres);
173c2c66affSColin Finck VariantClear(&arg);
174c2c66affSColin Finck
175c2c66affSColin Finck V_VT(&arg) = VT_BSTR;
176c2c66affSColin Finck V_BSTR(&arg) = a2bstr("dashed");
177c2c66affSColin Finck hres = IHTMLStyle_Invoke(pStyle, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
178c2c66affSColin Finck DISPATCH_PROPERTYPUT, ¶ms, &ret, NULL, NULL);
179c2c66affSColin Finck ok_(__FILE__,line) (hres == S_OK, "dashed. ret: %08x\n", hres);
180c2c66affSColin Finck VariantClear(&arg);
181c2c66affSColin Finck
182c2c66affSColin Finck V_VT(&arg) = VT_BSTR;
183c2c66affSColin Finck V_BSTR(&arg) = a2bstr("solid");
184c2c66affSColin Finck hres = IHTMLStyle_Invoke(pStyle, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
185c2c66affSColin Finck DISPATCH_PROPERTYPUT, ¶ms, &ret, NULL, NULL);
186c2c66affSColin Finck ok_(__FILE__,line) (hres == S_OK, "solid. ret: %08x\n", hres);
187c2c66affSColin Finck VariantClear(&arg);
188c2c66affSColin Finck
189c2c66affSColin Finck V_VT(&arg) = VT_BSTR;
190c2c66affSColin Finck V_BSTR(&arg) = a2bstr("double");
191c2c66affSColin Finck hres = IHTMLStyle_Invoke(pStyle, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
192c2c66affSColin Finck DISPATCH_PROPERTYPUT, ¶ms, &ret, NULL, NULL);
193c2c66affSColin Finck ok_(__FILE__,line) (hres == S_OK, "double. ret: %08x\n", hres);
194c2c66affSColin Finck VariantClear(&arg);
195c2c66affSColin Finck
196c2c66affSColin Finck V_VT(&arg) = VT_BSTR;
197c2c66affSColin Finck V_BSTR(&arg) = a2bstr("groove");
198c2c66affSColin Finck hres = IHTMLStyle_Invoke(pStyle, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
199c2c66affSColin Finck DISPATCH_PROPERTYPUT, ¶ms, &ret, NULL, NULL);
200c2c66affSColin Finck ok_(__FILE__,line) (hres == S_OK, "groove. ret: %08x\n", hres);
201c2c66affSColin Finck VariantClear(&arg);
202c2c66affSColin Finck
203c2c66affSColin Finck V_VT(&arg) = VT_BSTR;
204c2c66affSColin Finck V_BSTR(&arg) = a2bstr("ridge");
205c2c66affSColin Finck hres = IHTMLStyle_Invoke(pStyle, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
206c2c66affSColin Finck DISPATCH_PROPERTYPUT, ¶ms, &ret, NULL, NULL);
207c2c66affSColin Finck ok_(__FILE__,line) (hres == S_OK, "ridge. ret: %08x\n", hres);
208c2c66affSColin Finck VariantClear(&arg);
209c2c66affSColin Finck
210c2c66affSColin Finck V_VT(&arg) = VT_BSTR;
211c2c66affSColin Finck V_BSTR(&arg) = a2bstr("inset");
212c2c66affSColin Finck hres = IHTMLStyle_Invoke(pStyle, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
213c2c66affSColin Finck DISPATCH_PROPERTYPUT, ¶ms, &ret, NULL, NULL);
214c2c66affSColin Finck ok_(__FILE__,line) (hres == S_OK, "inset. ret: %08x\n", hres);
215c2c66affSColin Finck VariantClear(&arg);
216c2c66affSColin Finck
217c2c66affSColin Finck V_VT(&arg) = VT_BSTR;
218c2c66affSColin Finck V_BSTR(&arg) = a2bstr("outset");
219c2c66affSColin Finck hres = IHTMLStyle_Invoke(pStyle, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
220c2c66affSColin Finck DISPATCH_PROPERTYPUT, ¶ms, &ret, NULL, NULL);
221c2c66affSColin Finck ok_(__FILE__,line) (hres == S_OK, "outset. ret: %08x\n", hres);
222c2c66affSColin Finck VariantClear(&arg);
223c2c66affSColin Finck
224c2c66affSColin Finck V_VT(&arg) = VT_BSTR;
225c2c66affSColin Finck V_BSTR(&arg) = a2bstr("invalid");
226c2c66affSColin Finck hres = IHTMLStyle_Invoke(pStyle, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
227c2c66affSColin Finck DISPATCH_PROPERTYPUT, ¶ms, &ret, NULL, NULL);
228c2c66affSColin Finck ok_(__FILE__,line) (FAILED(hres), "invalid value passed.\n");
229c2c66affSColin Finck VariantClear(&arg);
230c2c66affSColin Finck
231c2c66affSColin Finck params.rgvarg = &vDefault;
232c2c66affSColin Finck hres = IHTMLStyle_Invoke(pStyle, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
233c2c66affSColin Finck DISPATCH_PROPERTYPUT, ¶ms, &ret, NULL, NULL);
234c2c66affSColin Finck ok_(__FILE__,line) (hres == S_OK, "default. ret: %08x\n", hres);
235c2c66affSColin Finck VariantClear(&vDefault);
236c2c66affSColin Finck }
237c2c66affSColin Finck }
238c2c66affSColin Finck
239c2c66affSColin Finck #define test_style_csstext(s,t) _test_style_csstext(__LINE__,s,t)
_test_style_csstext(unsigned line,IHTMLStyle * style,const char * extext)240c2c66affSColin Finck static void _test_style_csstext(unsigned line, IHTMLStyle *style, const char *extext)
241c2c66affSColin Finck {
242c2c66affSColin Finck BSTR text = (void*)0xdeadbeef;
243c2c66affSColin Finck HRESULT hres;
244c2c66affSColin Finck
245c2c66affSColin Finck hres = IHTMLStyle_get_cssText(style, &text);
246c2c66affSColin Finck ok_(__FILE__,line)(hres == S_OK, "get_cssText failed: %08x\n", hres);
247c2c66affSColin Finck if(extext)
248c2c66affSColin Finck ok_(__FILE__,line)(!strcmp_wa(text, extext), "cssText = %s\n", wine_dbgstr_w(text));
249c2c66affSColin Finck else
250c2c66affSColin Finck ok_(__FILE__,line)(!text, "cssText = %s\n", wine_dbgstr_w(text));
251c2c66affSColin Finck
252c2c66affSColin Finck SysFreeString(text);
253c2c66affSColin Finck }
254c2c66affSColin Finck
255c2c66affSColin Finck #define test_style_set_csstext(s,t) _test_style_set_csstext(__LINE__,s,t)
_test_style_set_csstext(unsigned line,IHTMLStyle * style,const char * text)256c2c66affSColin Finck static void _test_style_set_csstext(unsigned line, IHTMLStyle *style, const char *text)
257c2c66affSColin Finck {
258c2c66affSColin Finck BSTR tmp;
259c2c66affSColin Finck HRESULT hres;
260c2c66affSColin Finck
261c2c66affSColin Finck tmp = a2bstr(text);
262c2c66affSColin Finck hres = IHTMLStyle_put_cssText(style, tmp);
263c2c66affSColin Finck ok_(__FILE__,line)(hres == S_OK, "put_cssText failed: %08x\n", hres);
264c2c66affSColin Finck SysFreeString(tmp);
265c2c66affSColin Finck }
266c2c66affSColin Finck
267c2c66affSColin Finck #define test_style_remove_attribute(a,b,c) _test_style_remove_attribute(__LINE__,a,b,c)
_test_style_remove_attribute(unsigned line,IHTMLStyle * style,const char * attr,VARIANT_BOOL exb)268c2c66affSColin Finck static void _test_style_remove_attribute(unsigned line, IHTMLStyle *style, const char *attr, VARIANT_BOOL exb)
269c2c66affSColin Finck {
270c2c66affSColin Finck BSTR str = a2bstr(attr);
271c2c66affSColin Finck VARIANT_BOOL b = 100;
272c2c66affSColin Finck HRESULT hres;
273c2c66affSColin Finck
274c2c66affSColin Finck hres = IHTMLStyle_removeAttribute(style, str, 1, &b);
275c2c66affSColin Finck SysFreeString(str);
276c2c66affSColin Finck ok_(__FILE__,line)(hres == S_OK, "removeAttribute failed: %08x\n", hres);
277c2c66affSColin Finck ok_(__FILE__,line)(b == exb, "removeAttribute returned %x, expected %x\n", b, exb);
278c2c66affSColin Finck }
279c2c66affSColin Finck
280c2c66affSColin Finck #define set_text_decoration(a,b) _set_text_decoration(__LINE__,a,b)
_set_text_decoration(unsigned line,IHTMLStyle * style,const char * v)281c2c66affSColin Finck static void _set_text_decoration(unsigned line, IHTMLStyle *style, const char *v)
282c2c66affSColin Finck {
283c2c66affSColin Finck BSTR str;
284c2c66affSColin Finck HRESULT hres;
285c2c66affSColin Finck
286c2c66affSColin Finck str = a2bstr(v);
287c2c66affSColin Finck hres = IHTMLStyle_put_textDecoration(style, str);
288c2c66affSColin Finck ok_(__FILE__,line)(hres == S_OK, "put_textDecoration failed: %08x\n", hres);
289c2c66affSColin Finck SysFreeString(str);
290c2c66affSColin Finck }
291c2c66affSColin Finck
292c2c66affSColin Finck #define test_text_decoration(a,b) _test_text_decoration(__LINE__,a,b)
_test_text_decoration(unsigned line,IHTMLStyle * style,const char * exdec)293c2c66affSColin Finck static void _test_text_decoration(unsigned line, IHTMLStyle *style, const char *exdec)
294c2c66affSColin Finck {
295c2c66affSColin Finck BSTR str;
296c2c66affSColin Finck HRESULT hres;
297c2c66affSColin Finck
298c2c66affSColin Finck hres = IHTMLStyle_get_textDecoration(style, &str);
299c2c66affSColin Finck ok_(__FILE__,line)(hres == S_OK, "get_textDecoration failed: %08x\n", hres);
300c2c66affSColin Finck if(exdec)
301c2c66affSColin Finck ok_(__FILE__,line)(!strcmp_wa(str, exdec), "textDecoration = %s, expected %s\n", wine_dbgstr_w(str), exdec);
302c2c66affSColin Finck else
303c2c66affSColin Finck ok_(__FILE__,line)(!str, "textDecoration = %s, expected NULL\n", wine_dbgstr_w(str));
304c2c66affSColin Finck SysFreeString(str);
305c2c66affSColin Finck }
306c2c66affSColin Finck
test_set_csstext(IHTMLStyle * style)307c2c66affSColin Finck static void test_set_csstext(IHTMLStyle *style)
308c2c66affSColin Finck {
309c2c66affSColin Finck VARIANT v;
310c2c66affSColin Finck HRESULT hres;
311c2c66affSColin Finck
312c2c66affSColin Finck test_style_set_csstext(style, "background-color: black;");
313c2c66affSColin Finck
314c2c66affSColin Finck hres = IHTMLStyle_get_backgroundColor(style, &v);
315c2c66affSColin Finck ok(hres == S_OK, "get_backgroundColor: %08x\n", hres);
316c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "type failed: %d\n", V_VT(&v));
317c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "black"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
318c2c66affSColin Finck VariantClear(&v);
319c2c66affSColin Finck }
320c2c66affSColin Finck
test_style2(IHTMLStyle2 * style2)321c2c66affSColin Finck static void test_style2(IHTMLStyle2 *style2)
322c2c66affSColin Finck {
323c2c66affSColin Finck VARIANT v;
324c2c66affSColin Finck BSTR str;
325c2c66affSColin Finck HRESULT hres;
326c2c66affSColin Finck
327c2c66affSColin Finck str = (void*)0xdeadbeef;
328c2c66affSColin Finck hres = IHTMLStyle2_get_position(style2, &str);
329c2c66affSColin Finck ok(hres == S_OK, "get_position failed: %08x\n", hres);
330c2c66affSColin Finck ok(!str, "str != NULL\n");
331c2c66affSColin Finck
332c2c66affSColin Finck str = a2bstr("absolute");
333c2c66affSColin Finck hres = IHTMLStyle2_put_position(style2, str);
334c2c66affSColin Finck ok(hres == S_OK, "put_position failed: %08x\n", hres);
335c2c66affSColin Finck SysFreeString(str);
336c2c66affSColin Finck
337c2c66affSColin Finck str = NULL;
338c2c66affSColin Finck hres = IHTMLStyle2_get_position(style2, &str);
339c2c66affSColin Finck ok(hres == S_OK, "get_position failed: %08x\n", hres);
340c2c66affSColin Finck ok(!strcmp_wa(str, "absolute"), "get_position returned %s\n", wine_dbgstr_w(str));
341c2c66affSColin Finck SysFreeString(str);
342c2c66affSColin Finck
343c2c66affSColin Finck /* Test right */
344c2c66affSColin Finck V_VT(&v) = VT_EMPTY;
345c2c66affSColin Finck hres = IHTMLStyle2_get_right(style2, &v);
346c2c66affSColin Finck ok(hres == S_OK, "get_top failed: %08x\n", hres);
347c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(right)=%d\n", V_VT(&v));
348c2c66affSColin Finck ok(!V_BSTR(&v), "V_BSTR(right) != NULL\n");
349c2c66affSColin Finck VariantClear(&v);
350c2c66affSColin Finck
351c2c66affSColin Finck V_VT(&v) = VT_BSTR;
352c2c66affSColin Finck V_BSTR(&v) = a2bstr("3px");
353c2c66affSColin Finck hres = IHTMLStyle2_put_right(style2, v);
354c2c66affSColin Finck ok(hres == S_OK, "put_right failed: %08x\n", hres);
355c2c66affSColin Finck VariantClear(&v);
356c2c66affSColin Finck
357c2c66affSColin Finck V_VT(&v) = VT_EMPTY;
358c2c66affSColin Finck hres = IHTMLStyle2_get_right(style2, &v);
359c2c66affSColin Finck ok(hres == S_OK, "get_right failed: %08x\n", hres);
360c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
361c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "3px"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
362c2c66affSColin Finck VariantClear(&v);
363c2c66affSColin Finck
364c2c66affSColin Finck /* direction */
365c2c66affSColin Finck str = (void*)0xdeadbeef;
366c2c66affSColin Finck hres = IHTMLStyle2_get_direction(style2, &str);
367c2c66affSColin Finck ok(hres == S_OK, "get_direction failed: %08x\n", hres);
368c2c66affSColin Finck ok(!str, "str = %s\n", wine_dbgstr_w(str));
369c2c66affSColin Finck
370c2c66affSColin Finck str = a2bstr("ltr");
371c2c66affSColin Finck hres = IHTMLStyle2_put_direction(style2, str);
372c2c66affSColin Finck ok(hres == S_OK, "put_direction failed: %08x\n", hres);
373c2c66affSColin Finck SysFreeString(str);
374c2c66affSColin Finck
375c2c66affSColin Finck str = NULL;
376c2c66affSColin Finck hres = IHTMLStyle2_get_direction(style2, &str);
377c2c66affSColin Finck ok(hres == S_OK, "get_direction failed: %08x\n", hres);
378c2c66affSColin Finck ok(!strcmp_wa(str, "ltr"), "str = %s\n", wine_dbgstr_w(str));
379c2c66affSColin Finck SysFreeString(str);
380c2c66affSColin Finck
381c2c66affSColin Finck /* bottom */
382c2c66affSColin Finck V_VT(&v) = VT_EMPTY;
383c2c66affSColin Finck hres = IHTMLStyle2_get_bottom(style2, &v);
384c2c66affSColin Finck ok(hres == S_OK, "get_bottom failed: %08x\n", hres);
385c2c66affSColin Finck test_var_bstr(&v, NULL);
386c2c66affSColin Finck
387c2c66affSColin Finck V_VT(&v) = VT_I4;
388c2c66affSColin Finck V_I4(&v) = 4;
389c2c66affSColin Finck hres = IHTMLStyle2_put_bottom(style2, v);
390c2c66affSColin Finck ok(hres == S_OK, "put_bottom failed: %08x\n", hres);
391c2c66affSColin Finck
392c2c66affSColin Finck V_VT(&v) = VT_EMPTY;
393c2c66affSColin Finck hres = IHTMLStyle2_get_bottom(style2, &v);
394c2c66affSColin Finck ok(hres == S_OK, "get_bottom failed: %08x\n", hres);
395c2c66affSColin Finck test_var_bstr(&v, "4px");
396c2c66affSColin Finck
397c2c66affSColin Finck /* overflowX */
398c2c66affSColin Finck str = (void*)0xdeadbeef;
399c2c66affSColin Finck hres = IHTMLStyle2_get_overflowX(style2, &str);
400c2c66affSColin Finck ok(hres == S_OK, "get_overflowX failed: %08x\n", hres);
401c2c66affSColin Finck ok(!str, "overflowX = %s\n", wine_dbgstr_w(str));
402c2c66affSColin Finck
403c2c66affSColin Finck str = a2bstr("hidden");
404c2c66affSColin Finck hres = IHTMLStyle2_put_overflowX(style2, str);
405c2c66affSColin Finck ok(hres == S_OK, "put_overflowX failed: %08x\n", hres);
406c2c66affSColin Finck SysFreeString(str);
407c2c66affSColin Finck
408c2c66affSColin Finck str = NULL;
409c2c66affSColin Finck hres = IHTMLStyle2_get_overflowX(style2, &str);
410c2c66affSColin Finck ok(hres == S_OK, "get_overflowX failed: %08x\n", hres);
411c2c66affSColin Finck ok(!strcmp_wa(str, "hidden"), "overflowX = %s\n", wine_dbgstr_w(str));
412c2c66affSColin Finck
413c2c66affSColin Finck /* overflowY */
414c2c66affSColin Finck str = (void*)0xdeadbeef;
415c2c66affSColin Finck hres = IHTMLStyle2_get_overflowY(style2, &str);
416c2c66affSColin Finck ok(hres == S_OK, "get_overflowY failed: %08x\n", hres);
417c2c66affSColin Finck ok(!str, "overflowY = %s\n", wine_dbgstr_w(str));
418c2c66affSColin Finck
419c2c66affSColin Finck str = a2bstr("hidden");
420c2c66affSColin Finck hres = IHTMLStyle2_put_overflowY(style2, str);
421c2c66affSColin Finck ok(hres == S_OK, "put_overflowY failed: %08x\n", hres);
422c2c66affSColin Finck SysFreeString(str);
423c2c66affSColin Finck
424c2c66affSColin Finck str = NULL;
425c2c66affSColin Finck hres = IHTMLStyle2_get_overflowY(style2, &str);
426c2c66affSColin Finck ok(hres == S_OK, "get_overflowY failed: %08x\n", hres);
427c2c66affSColin Finck ok(!strcmp_wa(str, "hidden"), "overflowX = %s\n", wine_dbgstr_w(str));
428c2c66affSColin Finck
429c2c66affSColin Finck /* tableLayout */
430c2c66affSColin Finck str = a2bstr("fixed");
431c2c66affSColin Finck hres = IHTMLStyle2_put_tableLayout(style2, str);
432c2c66affSColin Finck ok(hres == S_OK, "put_tableLayout failed: %08x\n", hres);
433c2c66affSColin Finck SysFreeString(str);
434c2c66affSColin Finck
435c2c66affSColin Finck str = (void*)0xdeadbeef;
436c2c66affSColin Finck hres = IHTMLStyle2_get_tableLayout(style2, &str);
437c2c66affSColin Finck ok(hres == S_OK, "get_tableLayout failed: %08x\n", hres);
438c2c66affSColin Finck ok(!strcmp_wa(str, "fixed"), "tableLayout = %s\n", wine_dbgstr_w(str));
439c2c66affSColin Finck SysFreeString(str);
440c2c66affSColin Finck }
441c2c66affSColin Finck
test_style3(IHTMLStyle3 * style3)442c2c66affSColin Finck static void test_style3(IHTMLStyle3 *style3)
443c2c66affSColin Finck {
444c2c66affSColin Finck VARIANT v;
445c2c66affSColin Finck BSTR str;
446c2c66affSColin Finck HRESULT hres;
447c2c66affSColin Finck
448c2c66affSColin Finck str = (void*)0xdeadbeef;
449c2c66affSColin Finck hres = IHTMLStyle3_get_wordWrap(style3, &str);
450c2c66affSColin Finck ok(hres == S_OK, "get_wordWrap failed: %08x\n", hres);
451c2c66affSColin Finck ok(!str, "str != NULL\n");
452c2c66affSColin Finck
453c2c66affSColin Finck str = a2bstr("break-word");
454c2c66affSColin Finck hres = IHTMLStyle3_put_wordWrap(style3, str);
455c2c66affSColin Finck ok(hres == S_OK, "put_wordWrap failed: %08x\n", hres);
456c2c66affSColin Finck SysFreeString(str);
457c2c66affSColin Finck
458c2c66affSColin Finck str = NULL;
459c2c66affSColin Finck hres = IHTMLStyle3_get_wordWrap(style3, &str);
460c2c66affSColin Finck ok(hres == S_OK, "get_wordWrap failed: %08x\n", hres);
461c2c66affSColin Finck ok(!strcmp_wa(str, "break-word"), "get_wordWrap returned %s\n", wine_dbgstr_w(str));
462c2c66affSColin Finck SysFreeString(str);
463c2c66affSColin Finck
464c2c66affSColin Finck V_VT(&v) = VT_ERROR;
465c2c66affSColin Finck hres = IHTMLStyle3_get_zoom(style3, &v);
466c2c66affSColin Finck ok(hres == S_OK, "get_zoom failed: %08x\n", hres);
467c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(zoom) = %d\n", V_VT(&v));
468c2c66affSColin Finck ok(!V_BSTR(&v), "V_BSTR(zoom) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
469c2c66affSColin Finck VariantClear(&v);
470c2c66affSColin Finck
471c2c66affSColin Finck V_VT(&v) = VT_BSTR;
472c2c66affSColin Finck V_BSTR(&v) = a2bstr("100%");
473c2c66affSColin Finck hres = IHTMLStyle3_put_zoom(style3, v);
474c2c66affSColin Finck ok(hres == S_OK, "put_zoom failed: %08x\n", hres);
475c2c66affSColin Finck
476c2c66affSColin Finck V_VT(&v) = VT_ERROR;
477c2c66affSColin Finck hres = IHTMLStyle3_get_zoom(style3, &v);
478c2c66affSColin Finck ok(hres == S_OK, "get_zoom failed: %08x\n", hres);
479c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(zoom) = %d\n", V_VT(&v));
480c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "100%"), "V_BSTR(zoom) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
481c2c66affSColin Finck VariantClear(&v);
482c2c66affSColin Finck
483c2c66affSColin Finck V_VT(&v) = VT_I4;
484c2c66affSColin Finck V_I4(&v) = 1;
485c2c66affSColin Finck hres = IHTMLStyle3_put_zoom(style3, v);
486c2c66affSColin Finck ok(hres == S_OK, "put_zoom failed: %08x\n", hres);
487c2c66affSColin Finck
488c2c66affSColin Finck V_VT(&v) = VT_ERROR;
489c2c66affSColin Finck hres = IHTMLStyle3_get_zoom(style3, &v);
490c2c66affSColin Finck ok(hres == S_OK, "get_zoom failed: %08x\n", hres);
491c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(zoom) = %d\n", V_VT(&v));
492c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "1"), "V_BSTR(zoom) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
493c2c66affSColin Finck VariantClear(&v);
494c2c66affSColin Finck }
495c2c66affSColin Finck
test_style4(IHTMLStyle4 * style4)496c2c66affSColin Finck static void test_style4(IHTMLStyle4 *style4)
497c2c66affSColin Finck {
498c2c66affSColin Finck HRESULT hres;
499c2c66affSColin Finck VARIANT v;
500c2c66affSColin Finck VARIANT vdefault;
501c2c66affSColin Finck
502c2c66affSColin Finck hres = IHTMLStyle4_get_minHeight(style4, &vdefault);
503c2c66affSColin Finck ok(hres == S_OK, "get_minHeight failed: %08x\n", hres);
504c2c66affSColin Finck
505c2c66affSColin Finck V_VT(&v) = VT_BSTR;
506c2c66affSColin Finck V_BSTR(&v) = a2bstr("10px");
507c2c66affSColin Finck hres = IHTMLStyle4_put_minHeight(style4, v);
508c2c66affSColin Finck ok(hres == S_OK, "put_minHeight failed: %08x\n", hres);
509c2c66affSColin Finck VariantClear(&v);
510c2c66affSColin Finck
511c2c66affSColin Finck hres = IHTMLStyle4_get_minHeight(style4, &v);
512c2c66affSColin Finck ok(hres == S_OK, "get_minHeight failed: %08x\n", hres);
513c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
514c2c66affSColin Finck ok( !strcmp_wa(V_BSTR(&v), "10px"), "expect 10px got (%s)\n", wine_dbgstr_w(V_BSTR(&v)));
515c2c66affSColin Finck VariantClear(&v);
516c2c66affSColin Finck
517c2c66affSColin Finck hres = IHTMLStyle4_put_minHeight(style4, vdefault);
518c2c66affSColin Finck ok(hres == S_OK, "put_minHeight failed: %08x\n", hres);
519c2c66affSColin Finck VariantClear(&vdefault);
520c2c66affSColin Finck }
521c2c66affSColin Finck
test_style5(IHTMLStyle5 * style5)522c2c66affSColin Finck static void test_style5(IHTMLStyle5 *style5)
523c2c66affSColin Finck {
524c2c66affSColin Finck HRESULT hres;
525c2c66affSColin Finck VARIANT v;
526c2c66affSColin Finck VARIANT vdefault;
527c2c66affSColin Finck
528c2c66affSColin Finck /* minWidth */
529c2c66affSColin Finck hres = IHTMLStyle5_get_minWidth(style5, &vdefault);
530c2c66affSColin Finck ok(hres == S_OK, "get_minWidth failed: %08x\n", hres);
531c2c66affSColin Finck
532c2c66affSColin Finck V_VT(&v) = VT_BSTR;
533c2c66affSColin Finck V_BSTR(&v) = a2bstr("12px");
534c2c66affSColin Finck hres = IHTMLStyle5_put_minWidth(style5, v);
535c2c66affSColin Finck ok(hres == S_OK, "put_minWidth failed: %08x\n", hres);
536c2c66affSColin Finck VariantClear(&v);
537c2c66affSColin Finck
538c2c66affSColin Finck hres = IHTMLStyle5_get_minWidth(style5, &v);
539c2c66affSColin Finck ok(hres == S_OK, "get_minWidth failed: %08x\n", hres);
540c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
541c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "12px"), "expect 12px got (%s)\n", wine_dbgstr_w(V_BSTR(&v)));
542c2c66affSColin Finck VariantClear(&v);
543c2c66affSColin Finck
544c2c66affSColin Finck V_VT(&v) = VT_BSTR;
545c2c66affSColin Finck V_BSTR(&v) = a2bstr("10%");
546c2c66affSColin Finck hres = IHTMLStyle5_put_minWidth(style5, v);
547c2c66affSColin Finck ok(hres == S_OK, "put_minWidth failed: %08x\n", hres);
548c2c66affSColin Finck VariantClear(&v);
549c2c66affSColin Finck
550c2c66affSColin Finck hres = IHTMLStyle5_get_minWidth(style5, &v);
551c2c66affSColin Finck ok(hres == S_OK, "get_minWidth failed: %08x\n", hres);
552c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
553c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "10%"), "expect 10%% got (%s)\n", wine_dbgstr_w(V_BSTR(&v)));
554c2c66affSColin Finck VariantClear(&v);
555c2c66affSColin Finck
556c2c66affSColin Finck V_VT(&v) = VT_BSTR;
557c2c66affSColin Finck V_BSTR(&v) = a2bstr("10");
558c2c66affSColin Finck hres = IHTMLStyle5_put_minWidth(style5, v);
559c2c66affSColin Finck ok(hres == S_OK, "put_minWidth failed: %08x\n", hres);
560c2c66affSColin Finck VariantClear(&v);
561c2c66affSColin Finck
562c2c66affSColin Finck hres = IHTMLStyle5_get_minWidth(style5, &v);
563c2c66affSColin Finck ok(hres == S_OK, "get_minWidth failed: %08x\n", hres);
564c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
565c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "10px"), "expect 10px got (%s)\n", wine_dbgstr_w(V_BSTR(&v)));
566c2c66affSColin Finck VariantClear(&v);
567c2c66affSColin Finck
568c2c66affSColin Finck hres = IHTMLStyle5_put_minWidth(style5, vdefault);
569c2c66affSColin Finck ok(hres == S_OK, "put_minWidth failed: %08x\n", hres);
570c2c66affSColin Finck VariantClear(&vdefault);
571c2c66affSColin Finck
572c2c66affSColin Finck /* maxWidth */
573c2c66affSColin Finck hres = IHTMLStyle5_get_maxWidth(style5, &vdefault);
574c2c66affSColin Finck ok(hres == S_OK, "get_maxWidth failed: %08x\n", hres);
575c2c66affSColin Finck
576c2c66affSColin Finck V_VT(&v) = VT_BSTR;
577c2c66affSColin Finck V_BSTR(&v) = a2bstr("200px");
578c2c66affSColin Finck hres = IHTMLStyle5_put_maxWidth(style5, v);
579c2c66affSColin Finck ok(hres == S_OK, "put_maxWidth failed: %08x\n", hres);
580c2c66affSColin Finck VariantClear(&v);
581c2c66affSColin Finck
582c2c66affSColin Finck hres = IHTMLStyle5_get_maxWidth(style5, &v);
583c2c66affSColin Finck ok(hres == S_OK, "get_maxWidth failed: %08x\n", hres);
584c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n",V_VT(&v));
585c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "200px"), "expect 200px got (%s)\n", wine_dbgstr_w(V_BSTR(&v)));
586c2c66affSColin Finck VariantClear(&v);
587c2c66affSColin Finck
588c2c66affSColin Finck V_VT(&v) = VT_BSTR;
589c2c66affSColin Finck V_BSTR(&v) = a2bstr("70%");
590c2c66affSColin Finck hres = IHTMLStyle5_put_maxWidth(style5, v);
591c2c66affSColin Finck ok(hres == S_OK, "put_maxWidth failed: %08x\n", hres);
592c2c66affSColin Finck VariantClear(&v);
593c2c66affSColin Finck
594c2c66affSColin Finck hres = IHTMLStyle5_get_maxWidth(style5, &v);
595c2c66affSColin Finck ok(hres == S_OK, "get maxWidth failed: %08x\n", hres);
596c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
597c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "70%"), "expect 70%% got (%s)\n", wine_dbgstr_w(V_BSTR(&v)));
598c2c66affSColin Finck VariantClear(&v);
599c2c66affSColin Finck
600c2c66affSColin Finck hres = IHTMLStyle5_put_maxWidth(style5,vdefault);
601c2c66affSColin Finck ok(hres == S_OK, "put_maxWidth failed: %08x\n", hres);
602c2c66affSColin Finck VariantClear(&vdefault);
603c2c66affSColin Finck
604c2c66affSColin Finck /* maxHeight */
605c2c66affSColin Finck hres = IHTMLStyle5_get_maxHeight(style5, &vdefault);
606c2c66affSColin Finck ok(hres == S_OK, "get maxHeight failed: %08x\n", hres);
607c2c66affSColin Finck
608c2c66affSColin Finck V_VT(&v) = VT_BSTR;
609c2c66affSColin Finck V_BSTR(&v) = a2bstr("200px");
610c2c66affSColin Finck hres = IHTMLStyle5_put_maxHeight(style5, v);
611c2c66affSColin Finck ok(hres == S_OK, "put maxHeight failed: %08x\n", hres);
612c2c66affSColin Finck VariantClear(&v);
613c2c66affSColin Finck
614c2c66affSColin Finck hres = IHTMLStyle5_get_maxHeight(style5, &v);
615c2c66affSColin Finck ok(hres == S_OK, "get maxHeight failed: %08x\n", hres);
616c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
617c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "200px"), "expect 200px got (%s)\n", wine_dbgstr_w(V_BSTR(&v)));
618c2c66affSColin Finck VariantClear(&v);
619c2c66affSColin Finck
620c2c66affSColin Finck V_VT(&v) = VT_BSTR;
621c2c66affSColin Finck V_BSTR(&v) = a2bstr("70%");
622c2c66affSColin Finck hres = IHTMLStyle5_put_maxHeight(style5, v);
623c2c66affSColin Finck ok(hres == S_OK, "put maxHeight failed: %08x\n", hres);
624c2c66affSColin Finck VariantClear(&v);
625c2c66affSColin Finck
626c2c66affSColin Finck hres = IHTMLStyle5_get_maxHeight(style5, &v);
627c2c66affSColin Finck ok(hres == S_OK, "get_maxHeight failed: %08x\n", hres);
628c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
629c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "70%"), "expect 70%% got (%s)\n", wine_dbgstr_w(V_BSTR(&v)));
630c2c66affSColin Finck VariantClear(&v);
631c2c66affSColin Finck
632c2c66affSColin Finck V_VT(&v) = VT_BSTR;
633c2c66affSColin Finck V_BSTR(&v) = a2bstr("100");
634c2c66affSColin Finck hres = IHTMLStyle5_put_maxHeight(style5, v);
635c2c66affSColin Finck ok(hres == S_OK, "put maxHeight failed: %08x\n", hres);
636c2c66affSColin Finck VariantClear(&v);
637c2c66affSColin Finck
638c2c66affSColin Finck hres = IHTMLStyle5_get_maxHeight(style5, &v);
639c2c66affSColin Finck ok(hres == S_OK, "get_maxHeight failed: %08x\n", hres);
640c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
641c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "100px"), "expect 100 got (%s)\n", wine_dbgstr_w(V_BSTR(&v)));
642c2c66affSColin Finck VariantClear(&v);
643c2c66affSColin Finck
644c2c66affSColin Finck hres = IHTMLStyle5_put_maxHeight(style5, vdefault);
645c2c66affSColin Finck ok(hres == S_OK, "put maxHeight failed:%08x\n", hres);
646c2c66affSColin Finck VariantClear(&vdefault);
647c2c66affSColin Finck }
648c2c66affSColin Finck
test_style6(IHTMLStyle6 * style)649c2c66affSColin Finck static void test_style6(IHTMLStyle6 *style)
650c2c66affSColin Finck {
651c2c66affSColin Finck BSTR str;
652c2c66affSColin Finck HRESULT hres;
653c2c66affSColin Finck
654c2c66affSColin Finck str = (void*)0xdeadbeef;
655c2c66affSColin Finck hres = IHTMLStyle6_get_outline(style, &str);
656c2c66affSColin Finck ok(hres == S_OK, "get_outline failed: %08x\n", hres);
657c2c66affSColin Finck ok(str && !*str, "outline = %s\n", wine_dbgstr_w(str));
658c2c66affSColin Finck SysFreeString(str);
659c2c66affSColin Finck
660c2c66affSColin Finck str = a2bstr("1px");
661c2c66affSColin Finck hres = IHTMLStyle6_put_outline(style, str);
662c2c66affSColin Finck ok(hres == S_OK, "put_outline failed: %08x\n", hres);
663c2c66affSColin Finck SysFreeString(str);
664c2c66affSColin Finck
665c2c66affSColin Finck str = (void*)0xdeadbeef;
666c2c66affSColin Finck hres = IHTMLStyle6_get_outline(style, &str);
667c2c66affSColin Finck ok(hres == S_OK, "get_outline failed: %08x\n", hres);
668c2c66affSColin Finck ok(wstr_contains(str, "1px"), "outline = %s\n", wine_dbgstr_w(str));
669c2c66affSColin Finck SysFreeString(str);
670c2c66affSColin Finck
671c2c66affSColin Finck str = (void*)0xdeadbeef;
672c2c66affSColin Finck hres = IHTMLStyle6_get_boxSizing(style, &str);
673c2c66affSColin Finck ok(hres == S_OK, "get_boxSizing failed: %08x\n", hres);
674c2c66affSColin Finck ok(!str, "boxSizing = %s\n", wine_dbgstr_w(str));
675c2c66affSColin Finck SysFreeString(str);
676c2c66affSColin Finck
677c2c66affSColin Finck str = a2bstr("border-box");
678c2c66affSColin Finck hres = IHTMLStyle6_put_boxSizing(style, str);
679c2c66affSColin Finck ok(hres == S_OK, "put_boxSizing failed: %08x\n", hres);
680c2c66affSColin Finck SysFreeString(str);
681c2c66affSColin Finck
682c2c66affSColin Finck str = NULL;
683c2c66affSColin Finck hres = IHTMLStyle6_get_boxSizing(style, &str);
684c2c66affSColin Finck ok(hres == S_OK, "get_boxSizing failed: %08x\n", hres);
685c2c66affSColin Finck ok(!strcmp_wa(str, "border-box"), "boxSizing = %s\n", wine_dbgstr_w(str));
686c2c66affSColin Finck SysFreeString(str);
687c2c66affSColin Finck }
688c2c66affSColin Finck
test_body_style(IHTMLStyle * style)689c2c66affSColin Finck static void test_body_style(IHTMLStyle *style)
690c2c66affSColin Finck {
691c2c66affSColin Finck IHTMLStyle2 *style2;
692c2c66affSColin Finck IHTMLStyle3 *style3;
693c2c66affSColin Finck IHTMLStyle4 *style4;
694c2c66affSColin Finck IHTMLStyle5 *style5;
695c2c66affSColin Finck IHTMLStyle6 *style6;
696c2c66affSColin Finck VARIANT_BOOL b;
697c2c66affSColin Finck VARIANT v;
698c2c66affSColin Finck BSTR str;
699c2c66affSColin Finck HRESULT hres;
700c2c66affSColin Finck float f;
701c2c66affSColin Finck BSTR sOverflowDefault;
702c2c66affSColin Finck BSTR sDefault;
703c2c66affSColin Finck LONG l;
704c2c66affSColin Finck VARIANT vDefault;
705c2c66affSColin Finck
706c2c66affSColin Finck test_style_csstext(style, NULL);
707c2c66affSColin Finck
708c2c66affSColin Finck hres = IHTMLStyle_get_position(style, &str);
709c2c66affSColin Finck ok(hres == S_OK, "get_position failed: %08x\n", hres);
710c2c66affSColin Finck ok(!str, "str=%s\n", wine_dbgstr_w(str));
711c2c66affSColin Finck
712c2c66affSColin Finck V_VT(&v) = VT_NULL;
713c2c66affSColin Finck hres = IHTMLStyle_get_marginRight(style, &v);
714c2c66affSColin Finck ok(hres == S_OK, "get_marginRight failed: %08x\n", hres);
715c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(marginRight) = %d\n", V_VT(&v));
716c2c66affSColin Finck ok(!V_BSTR(&v), "V_BSTR(marginRight) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
717c2c66affSColin Finck
718c2c66affSColin Finck V_VT(&v) = VT_I4;
719c2c66affSColin Finck V_I4(&v) = 6;
720c2c66affSColin Finck hres = IHTMLStyle_put_marginRight(style, v);
721c2c66affSColin Finck ok(hres == S_OK, "put_marginRight failed: %08x\n", hres);
722c2c66affSColin Finck
723c2c66affSColin Finck V_VT(&v) = VT_NULL;
724c2c66affSColin Finck hres = IHTMLStyle_get_marginRight(style, &v);
725c2c66affSColin Finck ok(hres == S_OK, "get_marginRight failed: %08x\n", hres);
726c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(marginRight) = %d\n", V_VT(&v));
727c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "6px"), "V_BSTR(marginRight) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
728c2c66affSColin Finck
729c2c66affSColin Finck V_VT(&v) = VT_NULL;
730c2c66affSColin Finck hres = IHTMLStyle_get_marginBottom(style, &v);
731c2c66affSColin Finck ok(hres == S_OK, "get_marginBottom failed: %08x\n", hres);
732c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(marginBottom) = %d\n", V_VT(&v));
733c2c66affSColin Finck ok(!V_BSTR(&v), "V_BSTR(marginBottom) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
734c2c66affSColin Finck
735c2c66affSColin Finck V_VT(&v) = VT_I4;
736c2c66affSColin Finck V_I4(&v) = 6;
737c2c66affSColin Finck hres = IHTMLStyle_put_marginBottom(style, v);
738c2c66affSColin Finck ok(hres == S_OK, "put_marginBottom failed: %08x\n", hres);
739c2c66affSColin Finck
740c2c66affSColin Finck V_VT(&v) = VT_NULL;
741c2c66affSColin Finck hres = IHTMLStyle_get_marginBottom(style, &v);
742c2c66affSColin Finck ok(hres == S_OK, "get_marginBottom failed: %08x\n", hres);
743c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(marginBottom) = %d\n", V_VT(&v));
744c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "6px"), "V_BSTR(marginBottom) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
745c2c66affSColin Finck
746c2c66affSColin Finck V_VT(&v) = VT_NULL;
747c2c66affSColin Finck hres = IHTMLStyle_get_marginLeft(style, &v);
748c2c66affSColin Finck ok(hres == S_OK, "get_marginLeft failed: %08x\n", hres);
749c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(marginLeft) = %d\n", V_VT(&v));
750c2c66affSColin Finck ok(!V_BSTR(&v), "V_BSTR(marginLeft) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
751c2c66affSColin Finck
752c2c66affSColin Finck V_VT(&v) = VT_I4;
753c2c66affSColin Finck V_I4(&v) = 6;
754c2c66affSColin Finck hres = IHTMLStyle_put_marginLeft(style, v);
755c2c66affSColin Finck ok(hres == S_OK, "put_marginLeft failed: %08x\n", hres);
756c2c66affSColin Finck
757c2c66affSColin Finck V_VT(&v) = VT_NULL;
758c2c66affSColin Finck hres = IHTMLStyle_get_marginLeft(style, &v);
759c2c66affSColin Finck ok(hres == S_OK, "get_marginLeft failed: %08x\n", hres);
760c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(marginLeft) = %d\n", V_VT(&v));
761c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "6px"), "V_BSTR(marginLeft) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
762c2c66affSColin Finck
763c2c66affSColin Finck str = (void*)0xdeadbeef;
764c2c66affSColin Finck hres = IHTMLStyle_get_fontFamily(style, &str);
765c2c66affSColin Finck ok(hres == S_OK, "get_fontFamily failed: %08x\n", hres);
766c2c66affSColin Finck ok(!str, "fontFamily = %s\n", wine_dbgstr_w(str));
767c2c66affSColin Finck
768c2c66affSColin Finck str = (void*)0xdeadbeef;
769c2c66affSColin Finck hres = IHTMLStyle_get_fontWeight(style, &str);
770c2c66affSColin Finck ok(hres == S_OK, "get_fontWeight failed: %08x\n", hres);
771c2c66affSColin Finck ok(!str, "fontWeight = %s\n", wine_dbgstr_w(str));
772c2c66affSColin Finck
773c2c66affSColin Finck hres = IHTMLStyle_get_fontWeight(style, &sDefault);
774c2c66affSColin Finck ok(hres == S_OK, "get_fontWeight failed: %08x\n", hres);
775c2c66affSColin Finck
776c2c66affSColin Finck str = a2bstr("test");
777c2c66affSColin Finck hres = IHTMLStyle_put_fontWeight(style, str);
778c2c66affSColin Finck ok(hres == E_INVALIDARG, "put_fontWeight failed: %08x\n", hres);
779c2c66affSColin Finck SysFreeString(str);
780c2c66affSColin Finck
781c2c66affSColin Finck str = a2bstr("bold");
782c2c66affSColin Finck hres = IHTMLStyle_put_fontWeight(style, str);
783c2c66affSColin Finck ok(hres == S_OK, "put_fontWeight failed: %08x\n", hres);
784c2c66affSColin Finck SysFreeString(str);
785c2c66affSColin Finck
786c2c66affSColin Finck str = a2bstr("bolder");
787c2c66affSColin Finck hres = IHTMLStyle_put_fontWeight(style, str);
788c2c66affSColin Finck ok(hres == S_OK, "put_fontWeight failed: %08x\n", hres);
789c2c66affSColin Finck SysFreeString(str);
790c2c66affSColin Finck
791c2c66affSColin Finck str = a2bstr("lighter");
792c2c66affSColin Finck hres = IHTMLStyle_put_fontWeight(style, str);
793c2c66affSColin Finck ok(hres == S_OK, "put_fontWeight failed: %08x\n", hres);
794c2c66affSColin Finck SysFreeString(str);
795c2c66affSColin Finck
796c2c66affSColin Finck str = a2bstr("100");
797c2c66affSColin Finck hres = IHTMLStyle_put_fontWeight(style, str);
798c2c66affSColin Finck ok(hres == S_OK, "put_fontWeight failed: %08x\n", hres);
799c2c66affSColin Finck SysFreeString(str);
800c2c66affSColin Finck
801c2c66affSColin Finck str = a2bstr("200");
802c2c66affSColin Finck hres = IHTMLStyle_put_fontWeight(style, str);
803c2c66affSColin Finck ok(hres == S_OK, "put_fontWeight failed: %08x\n", hres);
804c2c66affSColin Finck SysFreeString(str);
805c2c66affSColin Finck
806c2c66affSColin Finck str = a2bstr("300");
807c2c66affSColin Finck hres = IHTMLStyle_put_fontWeight(style, str);
808c2c66affSColin Finck ok(hres == S_OK, "put_fontWeight failed: %08x\n", hres);
809c2c66affSColin Finck SysFreeString(str);
810c2c66affSColin Finck
811c2c66affSColin Finck str = a2bstr("400");
812c2c66affSColin Finck hres = IHTMLStyle_put_fontWeight(style, str);
813c2c66affSColin Finck ok(hres == S_OK, "put_fontWeight failed: %08x\n", hres);
814c2c66affSColin Finck SysFreeString(str);
815c2c66affSColin Finck
816c2c66affSColin Finck str = a2bstr("500");
817c2c66affSColin Finck hres = IHTMLStyle_put_fontWeight(style, str);
818c2c66affSColin Finck ok(hres == S_OK, "put_fontWeight failed: %08x\n", hres);
819c2c66affSColin Finck SysFreeString(str);
820c2c66affSColin Finck
821c2c66affSColin Finck str = a2bstr("600");
822c2c66affSColin Finck hres = IHTMLStyle_put_fontWeight(style, str);
823c2c66affSColin Finck ok(hres == S_OK, "put_fontWeight failed: %08x\n", hres);
824c2c66affSColin Finck SysFreeString(str);
825c2c66affSColin Finck
826c2c66affSColin Finck str = a2bstr("700");
827c2c66affSColin Finck hres = IHTMLStyle_put_fontWeight(style, str);
828c2c66affSColin Finck ok(hres == S_OK, "put_fontWeight failed: %08x\n", hres);
829c2c66affSColin Finck SysFreeString(str);
830c2c66affSColin Finck
831c2c66affSColin Finck str = a2bstr("800");
832c2c66affSColin Finck hres = IHTMLStyle_put_fontWeight(style, str);
833c2c66affSColin Finck ok(hres == S_OK, "put_fontWeight failed: %08x\n", hres);
834c2c66affSColin Finck SysFreeString(str);
835c2c66affSColin Finck
836c2c66affSColin Finck str = a2bstr("900");
837c2c66affSColin Finck hres = IHTMLStyle_put_fontWeight(style, str);
838c2c66affSColin Finck ok(hres == S_OK, "put_fontWeight failed: %08x\n", hres);
839c2c66affSColin Finck SysFreeString(str);
840c2c66affSColin Finck
841c2c66affSColin Finck hres = IHTMLStyle_get_fontWeight(style, &str);
842c2c66affSColin Finck ok(hres == S_OK, "get_fontWeight failed: %08x\n", hres);
843c2c66affSColin Finck ok(!strcmp_wa(str, "900"), "str != style900\n");
844c2c66affSColin Finck SysFreeString(str);
845c2c66affSColin Finck
846c2c66affSColin Finck str = a2bstr("");
847c2c66affSColin Finck hres = IHTMLStyle_put_fontWeight(style, str);
848c2c66affSColin Finck ok(hres == S_OK, "put_fontWeight failed: %08x\n", hres);
849c2c66affSColin Finck SysFreeString(str);
850c2c66affSColin Finck
851c2c66affSColin Finck hres = IHTMLStyle_get_fontWeight(style, &str);
852c2c66affSColin Finck ok(hres == S_OK, "get_fontWeight failed: %08x\n", hres);
853c2c66affSColin Finck ok(!str, "str != NULL\n");
854c2c66affSColin Finck SysFreeString(str);
855c2c66affSColin Finck
856c2c66affSColin Finck hres = IHTMLStyle_put_fontWeight(style, sDefault);
857c2c66affSColin Finck ok(hres == S_OK, "put_fontWeight failed: %08x\n", hres);
858c2c66affSColin Finck SysFreeString(sDefault);
859c2c66affSColin Finck
860c2c66affSColin Finck /* font Variant */
861c2c66affSColin Finck hres = IHTMLStyle_get_fontVariant(style, NULL);
862c2c66affSColin Finck ok(hres == E_INVALIDARG, "get_fontVariant failed: %08x\n", hres);
863c2c66affSColin Finck
864c2c66affSColin Finck hres = IHTMLStyle_get_fontVariant(style, &sDefault);
865c2c66affSColin Finck ok(hres == S_OK, "get_fontVariant failed: %08x\n", hres);
866c2c66affSColin Finck
867c2c66affSColin Finck str = a2bstr("test");
868c2c66affSColin Finck hres = IHTMLStyle_put_fontVariant(style, str);
869c2c66affSColin Finck ok(hres == E_INVALIDARG, "fontVariant failed: %08x\n", hres);
870c2c66affSColin Finck SysFreeString(str);
871c2c66affSColin Finck
872c2c66affSColin Finck str = a2bstr("small-caps");
873c2c66affSColin Finck hres = IHTMLStyle_put_fontVariant(style, str);
874c2c66affSColin Finck ok(hres == S_OK, "fontVariant failed: %08x\n", hres);
875c2c66affSColin Finck SysFreeString(str);
876c2c66affSColin Finck
877c2c66affSColin Finck str = a2bstr("normal");
878c2c66affSColin Finck hres = IHTMLStyle_put_fontVariant(style, str);
879c2c66affSColin Finck ok(hres == S_OK, "fontVariant failed: %08x\n", hres);
880c2c66affSColin Finck SysFreeString(str);
881c2c66affSColin Finck
882c2c66affSColin Finck hres = IHTMLStyle_put_fontVariant(style, sDefault);
883c2c66affSColin Finck ok(hres == S_OK, "fontVariant failed: %08x\n", hres);
884c2c66affSColin Finck SysFreeString(sDefault);
885c2c66affSColin Finck
886c2c66affSColin Finck str = (void*)0xdeadbeef;
887c2c66affSColin Finck hres = IHTMLStyle_get_display(style, &str);
888c2c66affSColin Finck ok(hres == S_OK, "get_display failed: %08x\n", hres);
889c2c66affSColin Finck ok(!str, "display = %s\n", wine_dbgstr_w(str));
890c2c66affSColin Finck
891c2c66affSColin Finck str = (void*)0xdeadbeef;
892c2c66affSColin Finck hres = IHTMLStyle_get_visibility(style, &str);
893c2c66affSColin Finck ok(hres == S_OK, "get_visibility failed: %08x\n", hres);
894c2c66affSColin Finck ok(!str, "visibility = %s\n", wine_dbgstr_w(str));
895c2c66affSColin Finck
896c2c66affSColin Finck V_VT(&v) = VT_NULL;
897c2c66affSColin Finck hres = IHTMLStyle_get_fontSize(style, &v);
898c2c66affSColin Finck ok(hres == S_OK, "get_fontSize failed: %08x\n", hres);
899c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(fontSize) = %d\n", V_VT(&v));
900c2c66affSColin Finck ok(!V_BSTR(&v), "V_BSTR(fontSize) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
901c2c66affSColin Finck
902c2c66affSColin Finck V_VT(&v) = VT_I4;
903c2c66affSColin Finck V_I4(&v) = 12;
904c2c66affSColin Finck hres = IHTMLStyle_put_fontSize(style, v);
905c2c66affSColin Finck ok(hres == S_OK, "put_fontSize failed: %08x\n", hres);
906c2c66affSColin Finck
907c2c66affSColin Finck V_VT(&v) = VT_NULL;
908c2c66affSColin Finck hres = IHTMLStyle_get_fontSize(style, &v);
909c2c66affSColin Finck ok(hres == S_OK, "get_fontSize failed: %08x\n", hres);
910c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(fontSize) = %d\n", V_VT(&v));
911c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "12px"), "V_BSTR(fontSize) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
912c2c66affSColin Finck
913c2c66affSColin Finck V_VT(&v) = VT_NULL;
914c2c66affSColin Finck hres = IHTMLStyle_get_color(style, &v);
915c2c66affSColin Finck ok(hres == S_OK, "get_color failed: %08x\n", hres);
916c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(color) = %d\n", V_VT(&v));
917c2c66affSColin Finck ok(!V_BSTR(&v), "V_BSTR(color) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
918c2c66affSColin Finck
919c2c66affSColin Finck V_VT(&v) = VT_I4;
920c2c66affSColin Finck V_I4(&v) = 0xfdfd;
921c2c66affSColin Finck hres = IHTMLStyle_put_color(style, v);
922c2c66affSColin Finck ok(hres == S_OK, "put_color failed: %08x\n", hres);
923c2c66affSColin Finck
924c2c66affSColin Finck V_VT(&v) = VT_NULL;
925c2c66affSColin Finck hres = IHTMLStyle_get_color(style, &v);
926c2c66affSColin Finck ok(hres == S_OK, "get_color failed: %08x\n", hres);
927c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(color) = %d\n", V_VT(&v));
928c2c66affSColin Finck todo_wine
929c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "#00fdfd"), "V_BSTR(color) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
930c2c66affSColin Finck
931c2c66affSColin Finck V_VT(&v) = VT_I4;
932c2c66affSColin Finck V_I4(&v) = 3;
933c2c66affSColin Finck hres = IHTMLStyle_put_lineHeight(style, v);
934c2c66affSColin Finck ok(hres == S_OK, "put_lineHeight failed: %08x\n", hres);
935c2c66affSColin Finck
936c2c66affSColin Finck hres = IHTMLStyle_get_lineHeight(style, &v);
937c2c66affSColin Finck ok(hres == S_OK, "get_lineHeight failed: %08x\n", hres);
938c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(lineHeight) = %d, expect VT_BSTR\n", V_VT(&v));
939c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "3"), "V_BSTR(lineHeight) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
940c2c66affSColin Finck
941c2c66affSColin Finck V_VT(&v) = VT_BSTR;
942c2c66affSColin Finck V_BSTR(&v) = a2bstr("300%");
943c2c66affSColin Finck hres = IHTMLStyle_put_lineHeight(style, v);
944c2c66affSColin Finck ok(hres == S_OK, "put_lineHeight failed: %08x\n", hres);
945c2c66affSColin Finck VariantClear(&v);
946c2c66affSColin Finck
947c2c66affSColin Finck hres = IHTMLStyle_get_lineHeight(style, &v);
948c2c66affSColin Finck ok(hres == S_OK, "get_lineHeight failed: %08x\n", hres);
949c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(lineHeight) = %d, expect VT_BSTR\n", V_VT(&v));
950c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "300%"), "V_BSTR(lineHeight) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
951c2c66affSColin Finck VariantClear(&v);
952c2c66affSColin Finck
953c2c66affSColin Finck b = 0xfefe;
954c2c66affSColin Finck hres = IHTMLStyle_get_textDecorationUnderline(style, &b);
955c2c66affSColin Finck ok(hres == S_OK, "get_textDecorationUnderline failed: %08x\n", hres);
956c2c66affSColin Finck ok(b == VARIANT_FALSE, "textDecorationUnderline = %x\n", b);
957c2c66affSColin Finck
958c2c66affSColin Finck hres = IHTMLStyle_put_textDecorationUnderline(style, VARIANT_TRUE);
959c2c66affSColin Finck ok(hres == S_OK, "put_textDecorationUnderline failed: %08x\n", hres);
960c2c66affSColin Finck
961c2c66affSColin Finck hres = IHTMLStyle_get_textDecorationUnderline(style, &b);
962c2c66affSColin Finck ok(hres == S_OK, "get_textDecorationUnderline failed: %08x\n", hres);
963c2c66affSColin Finck ok(b == VARIANT_TRUE, "textDecorationUnderline = %x\n", b);
964c2c66affSColin Finck
965c2c66affSColin Finck hres = IHTMLStyle_put_textDecorationUnderline(style, VARIANT_FALSE);
966c2c66affSColin Finck ok(hres == S_OK, "put_textDecorationUnderline failed: %08x\n", hres);
967c2c66affSColin Finck
968c2c66affSColin Finck b = 0xfefe;
969c2c66affSColin Finck hres = IHTMLStyle_get_textDecorationLineThrough(style, &b);
970c2c66affSColin Finck ok(hres == S_OK, "get_textDecorationLineThrough failed: %08x\n", hres);
971c2c66affSColin Finck ok(b == VARIANT_FALSE, "textDecorationLineThrough = %x\n", b);
972c2c66affSColin Finck
973c2c66affSColin Finck hres = IHTMLStyle_put_textDecorationLineThrough(style, VARIANT_TRUE);
974c2c66affSColin Finck ok(hres == S_OK, "put_textDecorationLineThrough failed: %08x\n", hres);
975c2c66affSColin Finck
976c2c66affSColin Finck hres = IHTMLStyle_get_textDecorationLineThrough(style, &b);
977c2c66affSColin Finck ok(hres == S_OK, "get_textDecorationLineThrough failed: %08x\n", hres);
978c2c66affSColin Finck ok(b == VARIANT_TRUE, "textDecorationLineThrough = %x\n", b);
979c2c66affSColin Finck
980c2c66affSColin Finck hres = IHTMLStyle_put_textDecorationLineThrough(style, VARIANT_FALSE);
981c2c66affSColin Finck ok(hres == S_OK, "put_textDecorationLineThrough failed: %08x\n", hres);
982c2c66affSColin Finck
983c2c66affSColin Finck b = 0xfefe;
984c2c66affSColin Finck hres = IHTMLStyle_get_textDecorationNone(style, &b);
985c2c66affSColin Finck ok(hres == S_OK, "get_textDecorationNone failed: %08x\n", hres);
986c2c66affSColin Finck ok(b == VARIANT_FALSE, "textDecorationNone = %x\n", b);
987c2c66affSColin Finck
988c2c66affSColin Finck hres = IHTMLStyle_put_textDecorationNone(style, VARIANT_TRUE);
989c2c66affSColin Finck ok(hres == S_OK, "put_textDecorationNone failed: %08x\n", hres);
990c2c66affSColin Finck
991c2c66affSColin Finck hres = IHTMLStyle_get_textDecorationNone(style, &b);
992c2c66affSColin Finck ok(hres == S_OK, "get_textDecorationNone failed: %08x\n", hres);
993c2c66affSColin Finck ok(b == VARIANT_TRUE, "textDecorationNone = %x\n", b);
994c2c66affSColin Finck
995c2c66affSColin Finck hres = IHTMLStyle_put_textDecorationNone(style, VARIANT_FALSE);
996c2c66affSColin Finck ok(hres == S_OK, "put_textDecorationNone failed: %08x\n", hres);
997c2c66affSColin Finck
998c2c66affSColin Finck b = 0xfefe;
999c2c66affSColin Finck hres = IHTMLStyle_get_textDecorationOverline(style, &b);
1000c2c66affSColin Finck ok(hres == S_OK, "get_textDecorationOverline failed: %08x\n", hres);
1001c2c66affSColin Finck ok(b == VARIANT_FALSE, "textDecorationOverline = %x\n", b);
1002c2c66affSColin Finck
1003c2c66affSColin Finck hres = IHTMLStyle_put_textDecorationOverline(style, VARIANT_TRUE);
1004c2c66affSColin Finck ok(hres == S_OK, "put_textDecorationOverline failed: %08x\n", hres);
1005c2c66affSColin Finck
1006c2c66affSColin Finck hres = IHTMLStyle_get_textDecorationOverline(style, &b);
1007c2c66affSColin Finck ok(hres == S_OK, "get_textDecorationOverline failed: %08x\n", hres);
1008c2c66affSColin Finck ok(b == VARIANT_TRUE, "textDecorationOverline = %x\n", b);
1009c2c66affSColin Finck
1010c2c66affSColin Finck hres = IHTMLStyle_put_textDecorationOverline(style, VARIANT_FALSE);
1011c2c66affSColin Finck ok(hres == S_OK, "put_textDecorationOverline failed: %08x\n", hres);
1012c2c66affSColin Finck
1013c2c66affSColin Finck b = 0xfefe;
1014c2c66affSColin Finck hres = IHTMLStyle_get_textDecorationBlink(style, &b);
1015c2c66affSColin Finck ok(hres == S_OK, "get_textDecorationBlink failed: %08x\n", hres);
1016c2c66affSColin Finck ok(b == VARIANT_FALSE, "textDecorationBlink = %x\n", b);
1017c2c66affSColin Finck
1018c2c66affSColin Finck hres = IHTMLStyle_put_textDecorationBlink(style, VARIANT_TRUE);
1019c2c66affSColin Finck ok(hres == S_OK, "put_textDecorationBlink failed: %08x\n", hres);
1020c2c66affSColin Finck
1021c2c66affSColin Finck hres = IHTMLStyle_get_textDecorationBlink(style, &b);
1022c2c66affSColin Finck ok(hres == S_OK, "get_textDecorationBlink failed: %08x\n", hres);
1023c2c66affSColin Finck ok(b == VARIANT_TRUE, "textDecorationBlink = %x\n", b);
1024c2c66affSColin Finck
1025c2c66affSColin Finck hres = IHTMLStyle_put_textDecorationBlink(style, VARIANT_FALSE);
1026c2c66affSColin Finck ok(hres == S_OK, "textDecorationBlink failed: %08x\n", hres);
1027c2c66affSColin Finck
1028c2c66affSColin Finck hres = IHTMLStyle_get_textDecoration(style, &sDefault);
1029c2c66affSColin Finck ok(hres == S_OK, "get_textDecoration failed: %08x\n", hres);
1030c2c66affSColin Finck
1031c2c66affSColin Finck str = a2bstr("invalid");
1032c2c66affSColin Finck hres = IHTMLStyle_put_textDecoration(style, str);
1033c2c66affSColin Finck ok(hres == E_INVALIDARG, "put_textDecoration failed: %08x\n", hres);
1034c2c66affSColin Finck SysFreeString(str);
1035c2c66affSColin Finck
1036c2c66affSColin Finck set_text_decoration(style, "none");
1037c2c66affSColin Finck test_text_decoration(style, "none");
1038c2c66affSColin Finck set_text_decoration(style, "underline");
1039c2c66affSColin Finck set_text_decoration(style, "overline");
1040c2c66affSColin Finck set_text_decoration(style, "line-through");
1041c2c66affSColin Finck set_text_decoration(style, "blink");
1042c2c66affSColin Finck set_text_decoration(style, "overline");
1043c2c66affSColin Finck set_text_decoration(style, "blink");
1044c2c66affSColin Finck test_text_decoration(style, "blink");
1045c2c66affSColin Finck
1046c2c66affSColin Finck hres = IHTMLStyle_put_textDecoration(style, sDefault);
1047c2c66affSColin Finck ok(hres == S_OK, "put_textDecoration failed: %08x\n", hres);
1048c2c66affSColin Finck SysFreeString(sDefault);
1049c2c66affSColin Finck
1050c2c66affSColin Finck hres = IHTMLStyle_get_posWidth(style, NULL);
1051c2c66affSColin Finck ok(hres == E_POINTER, "get_posWidth failed: %08x\n", hres);
1052c2c66affSColin Finck
1053c2c66affSColin Finck hres = IHTMLStyle_get_posWidth(style, &f);
1054c2c66affSColin Finck ok(hres == S_OK, "get_posWidth failed: %08x\n", hres);
1055c2c66affSColin Finck ok(f == 0.0f, "f = %f\n", f);
1056c2c66affSColin Finck
1057c2c66affSColin Finck V_VT(&v) = VT_EMPTY;
1058c2c66affSColin Finck hres = IHTMLStyle_get_width(style, &v);
1059c2c66affSColin Finck ok(hres == S_OK, "get_width failed: %08x\n", hres);
1060c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
1061c2c66affSColin Finck ok(!V_BSTR(&v), "V_BSTR(v)=%p\n", V_BSTR(&v));
1062c2c66affSColin Finck
1063c2c66affSColin Finck hres = IHTMLStyle_put_posWidth(style, 2.2);
1064c2c66affSColin Finck ok(hres == S_OK, "put_posWidth failed: %08x\n", hres);
1065c2c66affSColin Finck
1066c2c66affSColin Finck hres = IHTMLStyle_get_posWidth(style, &f);
1067c2c66affSColin Finck ok(hres == S_OK, "get_posWidth failed: %08x\n", hres);
1068c2c66affSColin Finck ok(f == 2.0f ||
1069c2c66affSColin Finck f == 2.2f, /* IE8 */
1070c2c66affSColin Finck "f = %f\n", f);
1071c2c66affSColin Finck
1072c2c66affSColin Finck l = 0xdeadbeef;
1073c2c66affSColin Finck hres = IHTMLStyle_get_pixelWidth(style, &l);
1074c2c66affSColin Finck ok(hres == S_OK, "get_pixelWidth failed: %08x\n", hres);
1075c2c66affSColin Finck ok(l == 2, "pixelWidth = %d\n", l);
1076c2c66affSColin Finck
1077c2c66affSColin Finck V_VT(&v) = VT_BSTR;
1078c2c66affSColin Finck V_BSTR(&v) = a2bstr("auto");
1079c2c66affSColin Finck hres = IHTMLStyle_put_width(style, v);
1080c2c66affSColin Finck ok(hres == S_OK, "put_width failed: %08x\n", hres);
1081c2c66affSColin Finck VariantClear(&v);
1082c2c66affSColin Finck
1083c2c66affSColin Finck V_VT(&v) = VT_EMPTY;
1084c2c66affSColin Finck hres = IHTMLStyle_get_width(style, &v);
1085c2c66affSColin Finck ok(hres == S_OK, "get_width failed: %08x\n", hres);
1086c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
1087c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "auto"), "V_BSTR(v)=%s\n", wine_dbgstr_w(V_BSTR(&v)));
1088c2c66affSColin Finck VariantClear(&v);
1089c2c66affSColin Finck
1090c2c66affSColin Finck V_VT(&v) = VT_I4;
1091c2c66affSColin Finck V_I4(&v) = 100;
1092c2c66affSColin Finck hres = IHTMLStyle_put_width(style, v);
1093c2c66affSColin Finck ok(hres == S_OK, "put_width failed: %08x\n", hres);
1094c2c66affSColin Finck
1095c2c66affSColin Finck l = 0xdeadbeef;
1096c2c66affSColin Finck hres = IHTMLStyle_get_pixelWidth(style, &l);
1097c2c66affSColin Finck ok(hres == S_OK, "get_pixelWidth failed: %08x\n", hres);
1098c2c66affSColin Finck ok(l == 100, "pixelWidth = %d\n", l);
1099c2c66affSColin Finck
1100c2c66affSColin Finck V_VT(&v) = VT_EMPTY;
1101c2c66affSColin Finck hres = IHTMLStyle_get_width(style, &v);
1102c2c66affSColin Finck ok(hres == S_OK, "get_width failed: %08x\n", hres);
1103c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
1104c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "100px"), "V_BSTR(v)=%s\n", wine_dbgstr_w(V_BSTR(&v)));
1105c2c66affSColin Finck VariantClear(&v);
1106c2c66affSColin Finck
1107c2c66affSColin Finck hres = IHTMLStyle_put_pixelWidth(style, 50);
1108c2c66affSColin Finck ok(hres == S_OK, "put_pixelWidth failed: %08x\n", hres);
1109c2c66affSColin Finck
1110c2c66affSColin Finck l = 0xdeadbeef;
1111c2c66affSColin Finck hres = IHTMLStyle_get_pixelWidth(style, &l);
1112c2c66affSColin Finck ok(hres == S_OK, "get_pixelWidth failed: %08x\n", hres);
1113c2c66affSColin Finck ok(l == 50, "pixelWidth = %d\n", l);
1114c2c66affSColin Finck
1115c2c66affSColin Finck hres = IHTMLStyle_get_pixelWidth(style, NULL);
1116c2c66affSColin Finck ok(hres == E_POINTER, "get_pixelWidth failed: %08x\n", hres);
1117c2c66affSColin Finck
1118c2c66affSColin Finck V_VT(&v) = VT_EMPTY;
1119c2c66affSColin Finck hres = IHTMLStyle_get_width(style, &v);
1120c2c66affSColin Finck ok(hres == S_OK, "get_width failed: %08x\n", hres);
1121c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
1122c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "50px"), "V_BSTR(v)=%s\n", wine_dbgstr_w(V_BSTR(&v)));
1123c2c66affSColin Finck VariantClear(&v);
1124c2c66affSColin Finck
1125c2c66affSColin Finck /* margin tests */
1126c2c66affSColin Finck str = (void*)0xdeadbeef;
1127c2c66affSColin Finck hres = IHTMLStyle_get_margin(style, &str);
1128c2c66affSColin Finck ok(hres == S_OK, "get_margin failed: %08x\n", hres);
1129c2c66affSColin Finck ok(!str, "margin = %s\n", wine_dbgstr_w(str));
1130c2c66affSColin Finck
1131c2c66affSColin Finck str = a2bstr("1");
1132c2c66affSColin Finck hres = IHTMLStyle_put_margin(style, str);
1133c2c66affSColin Finck ok(hres == S_OK, "put_margin failed: %08x\n", hres);
1134c2c66affSColin Finck SysFreeString(str);
1135c2c66affSColin Finck
1136c2c66affSColin Finck hres = IHTMLStyle_get_margin(style, &str);
1137c2c66affSColin Finck ok(hres == S_OK, "get_margin failed: %08x\n", hres);
1138c2c66affSColin Finck ok(!strcmp_wa(str, "1px"), "margin = %s\n", wine_dbgstr_w(str));
1139c2c66affSColin Finck SysFreeString(str);
1140c2c66affSColin Finck
1141c2c66affSColin Finck hres = IHTMLStyle_put_margin(style, NULL);
1142c2c66affSColin Finck ok(hres == S_OK, "put_margin failed: %08x\n", hres);
1143c2c66affSColin Finck
1144c2c66affSColin Finck str = (void*)0xdeadbeef;
1145c2c66affSColin Finck hres = IHTMLStyle_get_marginTop(style, &v);
1146c2c66affSColin Finck ok(hres == S_OK, "get_marginTop failed: %08x\n", hres);
1147c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(marginTop) = %d\n", V_VT(&v));
1148c2c66affSColin Finck ok(!V_BSTR(&v), "V_BSTR(marginTop) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1149c2c66affSColin Finck
1150c2c66affSColin Finck V_VT(&v) = VT_BSTR;
1151c2c66affSColin Finck V_BSTR(&v) = a2bstr("6px");
1152c2c66affSColin Finck hres = IHTMLStyle_put_marginTop(style, v);
1153c2c66affSColin Finck SysFreeString(V_BSTR(&v));
1154c2c66affSColin Finck ok(hres == S_OK, "put_marginTop failed: %08x\n", hres);
1155c2c66affSColin Finck
1156c2c66affSColin Finck str = (void*)0xdeadbeef;
1157c2c66affSColin Finck hres = IHTMLStyle_get_marginTop(style, &v);
1158c2c66affSColin Finck ok(hres == S_OK, "get_marginTop failed: %08x\n", hres);
1159c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(marginTop) = %d\n", V_VT(&v));
1160c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "6px"), "V_BSTR(marginTop) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1161c2c66affSColin Finck VariantClear(&v);
1162c2c66affSColin Finck
1163c2c66affSColin Finck V_VT(&v) = VT_I4;
1164c2c66affSColin Finck V_I4(&v) = 5;
1165c2c66affSColin Finck hres = IHTMLStyle_put_marginTop(style, v);
1166c2c66affSColin Finck ok(hres == S_OK, "put_marginTop failed: %08x\n", hres);
1167c2c66affSColin Finck
1168c2c66affSColin Finck str = (void*)0xdeadbeef;
1169c2c66affSColin Finck hres = IHTMLStyle_get_marginTop(style, &v);
1170c2c66affSColin Finck ok(hres == S_OK, "get_marginTop failed: %08x\n", hres);
1171c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(marginTop) = %d\n", V_VT(&v));
1172c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "5px"), "V_BSTR(marginTop) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1173c2c66affSColin Finck VariantClear(&v);
1174c2c66affSColin Finck
1175c2c66affSColin Finck str = NULL;
1176c2c66affSColin Finck hres = IHTMLStyle_get_border(style, &str);
1177c2c66affSColin Finck ok(hres == S_OK, "get_border failed: %08x\n", hres);
1178c2c66affSColin Finck ok(!str || !*str, "str is not empty\n");
1179c2c66affSColin Finck SysFreeString(str);
1180c2c66affSColin Finck
1181c2c66affSColin Finck str = a2bstr("1px");
1182c2c66affSColin Finck hres = IHTMLStyle_put_border(style, str);
1183c2c66affSColin Finck ok(hres == S_OK, "put_border failed: %08x\n", hres);
1184c2c66affSColin Finck SysFreeString(str);
1185c2c66affSColin Finck
1186c2c66affSColin Finck V_VT(&v) = VT_EMPTY;
1187c2c66affSColin Finck hres = IHTMLStyle_get_left(style, &v);
1188c2c66affSColin Finck ok(hres == S_OK, "get_left failed: %08x\n", hres);
1189c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
1190c2c66affSColin Finck ok(!V_BSTR(&v), "V_BSTR(v) != NULL\n");
1191c2c66affSColin Finck VariantClear(&v);
1192c2c66affSColin Finck
1193c2c66affSColin Finck l = 0xdeadbeef;
1194c2c66affSColin Finck hres = IHTMLStyle_get_pixelLeft(style, &l);
1195c2c66affSColin Finck ok(hres == S_OK, "get_pixelLeft failed: %08x\n", hres);
1196c2c66affSColin Finck ok(!l, "pixelLeft = %d\n", l);
1197c2c66affSColin Finck
1198c2c66affSColin Finck /* Test posLeft */
1199c2c66affSColin Finck hres = IHTMLStyle_get_posLeft(style, NULL);
1200c2c66affSColin Finck ok(hres == E_POINTER, "get_posLeft failed: %08x\n", hres);
1201c2c66affSColin Finck
1202c2c66affSColin Finck f = 1.0f;
1203c2c66affSColin Finck hres = IHTMLStyle_get_posLeft(style, &f);
1204c2c66affSColin Finck ok(hres == S_OK, "get_posLeft failed: %08x\n", hres);
1205c2c66affSColin Finck ok(f == 0.0, "expected 0.0 got %f\n", f);
1206c2c66affSColin Finck
1207c2c66affSColin Finck hres = IHTMLStyle_put_posLeft(style, 4.9f);
1208c2c66affSColin Finck ok(hres == S_OK, "put_posLeft failed: %08x\n", hres);
1209c2c66affSColin Finck
1210c2c66affSColin Finck hres = IHTMLStyle_get_posLeft(style, &f);
1211c2c66affSColin Finck ok(hres == S_OK, "get_posLeft failed: %08x\n", hres);
1212c2c66affSColin Finck ok(f == 4.0 ||
1213c2c66affSColin Finck f == 4.9f, /* IE8 */
1214c2c66affSColin Finck "expected 4.0 or 4.9 (IE8) got %f\n", f);
1215c2c66affSColin Finck
1216c2c66affSColin Finck /* Ensure left is updated correctly. */
1217c2c66affSColin Finck V_VT(&v) = VT_EMPTY;
1218c2c66affSColin Finck hres = IHTMLStyle_get_left(style, &v);
1219c2c66affSColin Finck ok(hres == S_OK, "get_left failed: %08x\n", hres);
1220c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
1221c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "4px") ||
1222c2c66affSColin Finck !strcmp_wa(V_BSTR(&v), "4.9px"), /* IE8 */
1223c2c66affSColin Finck "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1224c2c66affSColin Finck VariantClear(&v);
1225c2c66affSColin Finck
1226c2c66affSColin Finck /* Test left */
1227c2c66affSColin Finck V_VT(&v) = VT_BSTR;
1228c2c66affSColin Finck V_BSTR(&v) = a2bstr("3px");
1229c2c66affSColin Finck hres = IHTMLStyle_put_left(style, v);
1230c2c66affSColin Finck ok(hres == S_OK, "put_left failed: %08x\n", hres);
1231c2c66affSColin Finck VariantClear(&v);
1232c2c66affSColin Finck
1233c2c66affSColin Finck hres = IHTMLStyle_get_posLeft(style, &f);
1234c2c66affSColin Finck ok(hres == S_OK, "get_posLeft failed: %08x\n", hres);
1235c2c66affSColin Finck ok(f == 3.0, "expected 3.0 got %f\n", f);
1236c2c66affSColin Finck
1237c2c66affSColin Finck l = 0xdeadbeef;
1238c2c66affSColin Finck hres = IHTMLStyle_get_pixelLeft(style, &l);
1239c2c66affSColin Finck ok(hres == S_OK, "get_pixelLeft failed: %08x\n", hres);
1240c2c66affSColin Finck ok(l == 3, "pixelLeft = %d\n", l);
1241c2c66affSColin Finck
1242c2c66affSColin Finck V_VT(&v) = VT_EMPTY;
1243c2c66affSColin Finck hres = IHTMLStyle_get_left(style, &v);
1244c2c66affSColin Finck ok(hres == S_OK, "get_left failed: %08x\n", hres);
1245c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
1246c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "3px"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1247c2c66affSColin Finck VariantClear(&v);
1248c2c66affSColin Finck
1249c2c66affSColin Finck V_VT(&v) = VT_BSTR;
1250c2c66affSColin Finck V_BSTR(&v) = a2bstr("4.99");
1251c2c66affSColin Finck hres = IHTMLStyle_put_left(style, v);
1252c2c66affSColin Finck ok(hres == S_OK, "put_left failed: %08x\n", hres);
1253c2c66affSColin Finck VariantClear(&v);
1254c2c66affSColin Finck
1255c2c66affSColin Finck l = 0xdeadbeef;
1256c2c66affSColin Finck hres = IHTMLStyle_get_pixelLeft(style, &l);
1257c2c66affSColin Finck ok(hres == S_OK, "get_pixelLeft failed: %08x\n", hres);
1258c2c66affSColin Finck ok(l == 4, "pixelLeft = %d\n", l);
1259c2c66affSColin Finck
1260c2c66affSColin Finck V_VT(&v) = VT_NULL;
1261c2c66affSColin Finck hres = IHTMLStyle_put_left(style, v);
1262c2c66affSColin Finck ok(hres == S_OK, "put_left failed: %08x\n", hres);
1263c2c66affSColin Finck
1264c2c66affSColin Finck V_VT(&v) = VT_EMPTY;
1265c2c66affSColin Finck hres = IHTMLStyle_get_left(style, &v);
1266c2c66affSColin Finck ok(hres == S_OK, "get_left failed: %08x\n", hres);
1267c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
1268c2c66affSColin Finck ok(!V_BSTR(&v), "V_BSTR(v) != NULL\n");
1269c2c66affSColin Finck VariantClear(&v);
1270c2c66affSColin Finck
1271c2c66affSColin Finck V_VT(&v) = VT_EMPTY;
1272c2c66affSColin Finck hres = IHTMLStyle_get_top(style, &v);
1273c2c66affSColin Finck ok(hres == S_OK, "get_top failed: %08x\n", hres);
1274c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
1275c2c66affSColin Finck ok(!V_BSTR(&v), "V_BSTR(v) != NULL\n");
1276c2c66affSColin Finck VariantClear(&v);
1277c2c66affSColin Finck
1278c2c66affSColin Finck l = 0xdeadbeef;
1279c2c66affSColin Finck hres = IHTMLStyle_get_pixelLeft(style, &l);
1280c2c66affSColin Finck ok(hres == S_OK, "get_pixelLeft failed: %08x\n", hres);
1281c2c66affSColin Finck ok(!l, "pixelLeft = %d\n", l);
1282c2c66affSColin Finck
1283c2c66affSColin Finck hres = IHTMLStyle_put_pixelLeft(style, 6);
1284c2c66affSColin Finck ok(hres == S_OK, "put_pixelLeft failed: %08x\n", hres);
1285c2c66affSColin Finck
1286c2c66affSColin Finck l = 0xdeadbeef;
1287c2c66affSColin Finck hres = IHTMLStyle_get_pixelLeft(style, &l);
1288c2c66affSColin Finck ok(hres == S_OK, "get_pixelLeft failed: %08x\n", hres);
1289c2c66affSColin Finck ok(l == 6, "pixelLeft = %d\n", l);
1290c2c66affSColin Finck
1291c2c66affSColin Finck hres = IHTMLStyle_get_pixelLeft(style, NULL);
1292c2c66affSColin Finck ok(hres == E_POINTER, "get_pixelLeft failed: %08x\n", hres);
1293c2c66affSColin Finck
1294c2c66affSColin Finck V_VT(&v) = VT_EMPTY;
1295c2c66affSColin Finck hres = IHTMLStyle_get_left(style, &v);
1296c2c66affSColin Finck ok(hres == S_OK, "get_left failed: %08x\n", hres);
1297c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
1298c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "6px"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1299c2c66affSColin Finck VariantClear(&v);
1300c2c66affSColin Finck
1301c2c66affSColin Finck /* Test posTop */
1302c2c66affSColin Finck hres = IHTMLStyle_get_posTop(style, NULL);
1303c2c66affSColin Finck ok(hres == E_POINTER, "get_posTop failed: %08x\n", hres);
1304c2c66affSColin Finck
1305c2c66affSColin Finck f = 1.0f;
1306c2c66affSColin Finck hres = IHTMLStyle_get_posTop(style, &f);
1307c2c66affSColin Finck ok(hres == S_OK, "get_posTop failed: %08x\n", hres);
1308c2c66affSColin Finck ok(f == 0.0, "expected 0.0 got %f\n", f);
1309c2c66affSColin Finck
1310c2c66affSColin Finck hres = IHTMLStyle_put_posTop(style, 4.9f);
1311c2c66affSColin Finck ok(hres == S_OK, "put_posTop failed: %08x\n", hres);
1312c2c66affSColin Finck
1313c2c66affSColin Finck hres = IHTMLStyle_get_posTop(style, &f);
1314c2c66affSColin Finck ok(hres == S_OK, "get_posTop failed: %08x\n", hres);
1315c2c66affSColin Finck ok(f == 4.0 ||
1316c2c66affSColin Finck f == 4.9f, /* IE8 */
1317c2c66affSColin Finck "expected 4.0 or 4.9 (IE8) got %f\n", f);
1318c2c66affSColin Finck
1319c2c66affSColin Finck hres = IHTMLStyle_put_pixelTop(style, 6);
1320c2c66affSColin Finck ok(hres == S_OK, "put_pixelTop failed: %08x\n", hres);
1321c2c66affSColin Finck
1322c2c66affSColin Finck l = 0xdeadbeef;
1323c2c66affSColin Finck hres = IHTMLStyle_get_pixelTop(style, &l);
1324c2c66affSColin Finck ok(hres == S_OK, "get_pixelTop failed: %08x\n", hres);
1325c2c66affSColin Finck ok(l == 6, "pixelTop = %d\n", l);
1326c2c66affSColin Finck
1327c2c66affSColin Finck hres = IHTMLStyle_get_pixelTop(style, NULL);
1328c2c66affSColin Finck ok(hres == E_POINTER, "get_pixelTop failed: %08x\n", hres);
1329c2c66affSColin Finck
1330c2c66affSColin Finck V_VT(&v) = VT_BSTR;
1331c2c66affSColin Finck V_BSTR(&v) = a2bstr("3px");
1332c2c66affSColin Finck hres = IHTMLStyle_put_top(style, v);
1333c2c66affSColin Finck ok(hres == S_OK, "put_top failed: %08x\n", hres);
1334c2c66affSColin Finck VariantClear(&v);
1335c2c66affSColin Finck
1336c2c66affSColin Finck V_VT(&v) = VT_EMPTY;
1337c2c66affSColin Finck hres = IHTMLStyle_get_top(style, &v);
1338c2c66affSColin Finck ok(hres == S_OK, "get_top failed: %08x\n", hres);
1339c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
1340c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "3px"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1341c2c66affSColin Finck VariantClear(&v);
1342c2c66affSColin Finck
1343c2c66affSColin Finck hres = IHTMLStyle_get_posTop(style, &f);
1344c2c66affSColin Finck ok(hres == S_OK, "get_posTop failed: %08x\n", hres);
1345c2c66affSColin Finck ok(f == 3.0, "expected 3.0 got %f\n", f);
1346c2c66affSColin Finck
1347c2c66affSColin Finck l = 0xdeadbeef;
1348c2c66affSColin Finck hres = IHTMLStyle_get_pixelTop(style, &l);
1349c2c66affSColin Finck ok(hres == S_OK, "get_pixelTop failed: %08x\n", hres);
1350c2c66affSColin Finck ok(l == 3, "pixelTop = %d\n", l);
1351c2c66affSColin Finck
1352c2c66affSColin Finck V_VT(&v) = VT_NULL;
1353c2c66affSColin Finck hres = IHTMLStyle_put_top(style, v);
1354c2c66affSColin Finck ok(hres == S_OK, "put_top failed: %08x\n", hres);
1355c2c66affSColin Finck
1356c2c66affSColin Finck V_VT(&v) = VT_EMPTY;
1357c2c66affSColin Finck hres = IHTMLStyle_get_top(style, &v);
1358c2c66affSColin Finck ok(hres == S_OK, "get_top failed: %08x\n", hres);
1359c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
1360c2c66affSColin Finck ok(!V_BSTR(&v), "V_BSTR(v) != NULL\n");
1361c2c66affSColin Finck VariantClear(&v);
1362c2c66affSColin Finck
1363c2c66affSColin Finck l = 0xdeadbeef;
1364c2c66affSColin Finck hres = IHTMLStyle_get_pixelTop(style, &l);
1365c2c66affSColin Finck ok(hres == S_OK, "get_pixelTop failed: %08x\n", hres);
1366c2c66affSColin Finck ok(!l, "pixelTop = %d\n", l);
1367c2c66affSColin Finck
1368c2c66affSColin Finck /* Test posHeight */
1369c2c66affSColin Finck hres = IHTMLStyle_get_posHeight(style, NULL);
1370c2c66affSColin Finck ok(hres == E_POINTER, "get_posHeight failed: %08x\n", hres);
1371c2c66affSColin Finck
1372c2c66affSColin Finck V_VT(&v) = VT_EMPTY;
1373c2c66affSColin Finck hres = IHTMLStyle_get_height(style, &v);
1374c2c66affSColin Finck ok(hres == S_OK, "get_height failed: %08x\n", hres);
1375c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
1376c2c66affSColin Finck ok(!V_BSTR(&v), "V_BSTR(v) != NULL\n");
1377c2c66affSColin Finck VariantClear(&v);
1378c2c66affSColin Finck
1379c2c66affSColin Finck f = 1.0f;
1380c2c66affSColin Finck hres = IHTMLStyle_get_posHeight(style, &f);
1381c2c66affSColin Finck ok(hres == S_OK, "get_posHeight failed: %08x\n", hres);
1382c2c66affSColin Finck ok(f == 0.0, "expected 0.0 got %f\n", f);
1383c2c66affSColin Finck
1384c2c66affSColin Finck l = 0xdeadbeef;
1385c2c66affSColin Finck hres = IHTMLStyle_get_pixelHeight(style, &l);
1386c2c66affSColin Finck ok(hres == S_OK, "get_pixelHeight failed: %08x\n", hres);
1387c2c66affSColin Finck ok(!l, "pixelHeight = %d\n", l);
1388c2c66affSColin Finck
1389c2c66affSColin Finck hres = IHTMLStyle_put_posHeight(style, 4.9f);
1390c2c66affSColin Finck ok(hres == S_OK, "put_posHeight failed: %08x\n", hres);
1391c2c66affSColin Finck
1392c2c66affSColin Finck hres = IHTMLStyle_get_posHeight(style, &f);
1393c2c66affSColin Finck ok(hres == S_OK, "get_posHeight failed: %08x\n", hres);
1394c2c66affSColin Finck ok(f == 4.0 ||
1395c2c66affSColin Finck f == 4.9f, /* IE8 */
1396c2c66affSColin Finck "expected 4.0 or 4.9 (IE8) got %f\n", f);
1397c2c66affSColin Finck
1398c2c66affSColin Finck l = 0xdeadbeef;
1399c2c66affSColin Finck hres = IHTMLStyle_get_pixelHeight(style, &l);
1400c2c66affSColin Finck ok(hres == S_OK, "get_pixelHeight failed: %08x\n", hres);
1401c2c66affSColin Finck ok(l == 4 ||
1402c2c66affSColin Finck l == 5, /* IE8 */
1403c2c66affSColin Finck "pixelHeight = %d\n", l);
1404c2c66affSColin Finck
1405c2c66affSColin Finck V_VT(&v) = VT_BSTR;
1406c2c66affSColin Finck V_BSTR(&v) = a2bstr("70px");
1407c2c66affSColin Finck hres = IHTMLStyle_put_height(style, v);
1408c2c66affSColin Finck ok(hres == S_OK, "put_height failed: %08x\n", hres);
1409c2c66affSColin Finck VariantClear(&v);
1410c2c66affSColin Finck
1411c2c66affSColin Finck V_VT(&v) = VT_EMPTY;
1412c2c66affSColin Finck hres = IHTMLStyle_get_height(style, &v);
1413c2c66affSColin Finck ok(hres == S_OK, "get_height failed: %08x\n", hres);
1414c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
1415c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "70px"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1416c2c66affSColin Finck VariantClear(&v);
1417c2c66affSColin Finck
1418c2c66affSColin Finck l = 0xdeadbeef;
1419c2c66affSColin Finck hres = IHTMLStyle_get_pixelHeight(style, &l);
1420c2c66affSColin Finck ok(hres == S_OK, "get_pixelHeight failed: %08x\n", hres);
1421c2c66affSColin Finck ok(l == 70, "pixelHeight = %d\n", l);
1422c2c66affSColin Finck
1423c2c66affSColin Finck V_VT(&v) = VT_BSTR;
1424c2c66affSColin Finck V_BSTR(&v) = NULL;
1425c2c66affSColin Finck hres = IHTMLStyle_put_height(style, v);
1426c2c66affSColin Finck ok(hres == S_OK, "put_height failed: %08x\n", hres);
1427c2c66affSColin Finck VariantClear(&v);
1428c2c66affSColin Finck
1429c2c66affSColin Finck V_VT(&v) = VT_EMPTY;
1430c2c66affSColin Finck hres = IHTMLStyle_get_height(style, &v);
1431c2c66affSColin Finck ok(hres == S_OK, "get_height failed: %08x\n", hres);
1432c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
1433c2c66affSColin Finck ok(!V_BSTR(&v), "V_BSTR(v) = %s, expected NULL\n", wine_dbgstr_w(V_BSTR(&v)));
1434c2c66affSColin Finck VariantClear(&v);
1435c2c66affSColin Finck
1436c2c66affSColin Finck l = 0xdeadbeef;
1437c2c66affSColin Finck hres = IHTMLStyle_get_pixelHeight(style, &l);
1438c2c66affSColin Finck ok(hres == S_OK, "get_pixelHeight failed: %08x\n", hres);
1439c2c66affSColin Finck ok(!l, "pixelHeight = %d\n", l);
1440c2c66affSColin Finck
1441c2c66affSColin Finck hres = IHTMLStyle_put_pixelHeight(style, 50);
1442c2c66affSColin Finck ok(hres == S_OK, "put_pixelHeight failed: %08x\n", hres);
1443c2c66affSColin Finck
1444c2c66affSColin Finck l = 0xdeadbeef;
1445c2c66affSColin Finck hres = IHTMLStyle_get_pixelHeight(style, &l);
1446c2c66affSColin Finck ok(hres == S_OK, "get_pixelHeight failed: %08x\n", hres);
1447c2c66affSColin Finck ok(l == 50, "pixelHeight = %d\n", l);
1448c2c66affSColin Finck
1449c2c66affSColin Finck hres = IHTMLStyle_get_pixelHeight(style, NULL);
1450c2c66affSColin Finck ok(hres == E_POINTER, "get_pixelHeight failed: %08x\n", hres);
1451c2c66affSColin Finck
1452c2c66affSColin Finck V_VT(&v) = VT_I4;
1453c2c66affSColin Finck V_I4(&v) = 64;
1454c2c66affSColin Finck hres = IHTMLStyle_put_height(style, v);
1455c2c66affSColin Finck ok(hres == S_OK, "put_height failed: %08x\n", hres);
1456c2c66affSColin Finck
1457c2c66affSColin Finck V_VT(&v) = VT_EMPTY;
1458c2c66affSColin Finck hres = IHTMLStyle_get_height(style, &v);
1459c2c66affSColin Finck ok(hres == S_OK, "get_height failed: %08x\n", hres);
1460c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
1461c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "64px"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1462c2c66affSColin Finck VariantClear(&v);
1463c2c66affSColin Finck
1464c2c66affSColin Finck hres = IHTMLStyle_get_posHeight(style, &f);
1465c2c66affSColin Finck ok(hres == S_OK, "get_posHeight failed: %08x\n", hres);
1466c2c66affSColin Finck ok(f == 64.0, "expected 64.0 got %f\n", f);
1467c2c66affSColin Finck
1468c2c66affSColin Finck l = 0xdeadbeef;
1469c2c66affSColin Finck hres = IHTMLStyle_get_pixelHeight(style, &l);
1470c2c66affSColin Finck ok(hres == S_OK, "get_pixelHeight failed: %08x\n", hres);
1471c2c66affSColin Finck ok(l == 64, "pixelHeight = %d\n", l);
1472c2c66affSColin Finck
1473c2c66affSColin Finck str = (void*)0xdeadbeef;
1474c2c66affSColin Finck hres = IHTMLStyle_get_cursor(style, &str);
1475c2c66affSColin Finck ok(hres == S_OK, "get_cursor failed: %08x\n", hres);
1476c2c66affSColin Finck ok(!str, "get_cursor != NULL\n");
1477c2c66affSColin Finck SysFreeString(str);
1478c2c66affSColin Finck
1479c2c66affSColin Finck str = a2bstr("default");
1480c2c66affSColin Finck hres = IHTMLStyle_put_cursor(style, str);
1481c2c66affSColin Finck ok(hres == S_OK, "put_cursor failed: %08x\n", hres);
1482c2c66affSColin Finck SysFreeString(str);
1483c2c66affSColin Finck
1484c2c66affSColin Finck str = NULL;
1485c2c66affSColin Finck hres = IHTMLStyle_get_cursor(style, &str);
1486c2c66affSColin Finck ok(hres == S_OK, "get_cursor failed: %08x\n", hres);
1487c2c66affSColin Finck ok(!strcmp_wa(str, "default"), "get_cursor returned %s\n", wine_dbgstr_w(str));
1488c2c66affSColin Finck SysFreeString(str);
1489c2c66affSColin Finck
1490c2c66affSColin Finck V_VT(&v) = VT_EMPTY;
1491c2c66affSColin Finck hres = IHTMLStyle_get_verticalAlign(style, &v);
1492c2c66affSColin Finck ok(hres == S_OK, "get_vertivalAlign failed: %08x\n", hres);
1493c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
1494c2c66affSColin Finck ok(!V_BSTR(&v), "V_BSTR(v) != NULL\n");
1495c2c66affSColin Finck VariantClear(&v);
1496c2c66affSColin Finck
1497c2c66affSColin Finck V_VT(&v) = VT_BSTR;
1498c2c66affSColin Finck V_BSTR(&v) = a2bstr("middle");
1499c2c66affSColin Finck hres = IHTMLStyle_put_verticalAlign(style, v);
1500c2c66affSColin Finck ok(hres == S_OK, "put_vertivalAlign failed: %08x\n", hres);
1501c2c66affSColin Finck VariantClear(&v);
1502c2c66affSColin Finck
1503c2c66affSColin Finck V_VT(&v) = VT_EMPTY;
1504c2c66affSColin Finck hres = IHTMLStyle_get_verticalAlign(style, &v);
1505c2c66affSColin Finck ok(hres == S_OK, "get_verticalAlign failed: %08x\n", hres);
1506c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
1507c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "middle"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1508c2c66affSColin Finck VariantClear(&v);
1509c2c66affSColin Finck
1510c2c66affSColin Finck V_VT(&v) = VT_I4;
1511c2c66affSColin Finck V_I4(&v) = 100;
1512c2c66affSColin Finck hres = IHTMLStyle_put_verticalAlign(style, v);
1513c2c66affSColin Finck ok(hres == S_OK, "put_vertivalAlign failed: %08x\n", hres);
1514c2c66affSColin Finck VariantClear(&v);
1515c2c66affSColin Finck
1516c2c66affSColin Finck V_VT(&v) = VT_EMPTY;
1517c2c66affSColin Finck hres = IHTMLStyle_get_verticalAlign(style, &v);
1518c2c66affSColin Finck ok(hres == S_OK, "get_verticalAlign failed: %08x\n", hres);
1519c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
1520c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "100px"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1521c2c66affSColin Finck VariantClear(&v);
1522c2c66affSColin Finck
1523c2c66affSColin Finck str = (void*)0xdeadbeef;
1524c2c66affSColin Finck hres = IHTMLStyle_get_textAlign(style, &str);
1525c2c66affSColin Finck ok(hres == S_OK, "get_textAlign failed: %08x\n", hres);
1526c2c66affSColin Finck ok(!str, "textAlign != NULL\n");
1527c2c66affSColin Finck
1528c2c66affSColin Finck str = a2bstr("center");
1529c2c66affSColin Finck hres = IHTMLStyle_put_textAlign(style, str);
1530c2c66affSColin Finck ok(hres == S_OK, "put_textAlign failed: %08x\n", hres);
1531c2c66affSColin Finck SysFreeString(str);
1532c2c66affSColin Finck
1533c2c66affSColin Finck str = NULL;
1534c2c66affSColin Finck hres = IHTMLStyle_get_textAlign(style, &str);
1535c2c66affSColin Finck ok(hres == S_OK, "get_textAlign failed: %08x\n", hres);
1536c2c66affSColin Finck ok(!strcmp_wa(str, "center"), "textAlign = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1537c2c66affSColin Finck SysFreeString(str);
1538c2c66affSColin Finck
1539c2c66affSColin Finck V_VT(&v) = VT_NULL;
1540c2c66affSColin Finck hres = IHTMLStyle_get_textIndent(style, &v);
1541c2c66affSColin Finck ok(hres == S_OK, "get_textIndent failed: %08x\n", hres);
1542c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(textIndent) = %d\n", V_VT(&v));
1543c2c66affSColin Finck ok(!V_BSTR(&v), "V_BSTR(textIndent) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1544c2c66affSColin Finck
1545c2c66affSColin Finck V_VT(&v) = VT_I4;
1546c2c66affSColin Finck V_I4(&v) = 6;
1547c2c66affSColin Finck hres = IHTMLStyle_put_textIndent(style, v);
1548c2c66affSColin Finck ok(hres == S_OK, "put_textIndent failed: %08x\n", hres);
1549c2c66affSColin Finck
1550c2c66affSColin Finck V_VT(&v) = VT_NULL;
1551c2c66affSColin Finck hres = IHTMLStyle_get_textIndent(style, &v);
1552c2c66affSColin Finck ok(hres == S_OK, "get_textIndent failed: %08x\n", hres);
1553c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(textIndent) = %d\n", V_VT(&v));
1554c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "6px"), "V_BSTR(textIndent) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1555c2c66affSColin Finck
1556c2c66affSColin Finck str = (void*)0xdeadbeef;
1557c2c66affSColin Finck hres = IHTMLStyle_get_textTransform(style, &str);
1558c2c66affSColin Finck ok(hres == S_OK, "get_textTransform failed: %08x\n", hres);
1559c2c66affSColin Finck ok(!str, "textTransform != NULL\n");
1560c2c66affSColin Finck
1561c2c66affSColin Finck str = a2bstr("lowercase");
1562c2c66affSColin Finck hres = IHTMLStyle_put_textTransform(style, str);
1563c2c66affSColin Finck ok(hres == S_OK, "put_textTransform failed: %08x\n", hres);
1564c2c66affSColin Finck SysFreeString(str);
1565c2c66affSColin Finck
1566c2c66affSColin Finck str = NULL;
1567c2c66affSColin Finck hres = IHTMLStyle_get_textTransform(style, &str);
1568c2c66affSColin Finck ok(hres == S_OK, "get_textTransform failed: %08x\n", hres);
1569c2c66affSColin Finck ok(!strcmp_wa(str, "lowercase"), "textTransform = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1570c2c66affSColin Finck SysFreeString(str);
1571c2c66affSColin Finck
1572c2c66affSColin Finck str = (void*)0xdeadbeef;
1573c2c66affSColin Finck hres = IHTMLStyle_get_filter(style, &str);
1574c2c66affSColin Finck ok(hres == S_OK, "get_filter failed: %08x\n", hres);
1575c2c66affSColin Finck ok(!str, "filter != NULL\n");
1576c2c66affSColin Finck
1577c2c66affSColin Finck str = a2bstr("alpha(opacity=100)");
1578c2c66affSColin Finck hres = IHTMLStyle_put_filter(style, str);
1579c2c66affSColin Finck ok(hres == S_OK, "put_filter failed: %08x\n", hres);
1580c2c66affSColin Finck SysFreeString(str);
1581c2c66affSColin Finck
1582c2c66affSColin Finck V_VT(&v) = VT_EMPTY;
1583c2c66affSColin Finck hres = IHTMLStyle_get_zIndex(style, &v);
1584c2c66affSColin Finck ok(hres == S_OK, "get_zIndex failed: %08x\n", hres);
1585c2c66affSColin Finck ok(V_VT(&v) == VT_I4, "V_VT(v)=%d\n", V_VT(&v));
1586c2c66affSColin Finck ok(!V_I4(&v), "V_I4(v) != 0\n");
1587c2c66affSColin Finck VariantClear(&v);
1588c2c66affSColin Finck
1589c2c66affSColin Finck V_VT(&v) = VT_BSTR;
1590c2c66affSColin Finck V_BSTR(&v) = a2bstr("1");
1591c2c66affSColin Finck hres = IHTMLStyle_put_zIndex(style, v);
1592c2c66affSColin Finck ok(hres == S_OK, "put_zIndex failed: %08x\n", hres);
1593c2c66affSColin Finck VariantClear(&v);
1594c2c66affSColin Finck
1595c2c66affSColin Finck V_VT(&v) = VT_EMPTY;
1596c2c66affSColin Finck hres = IHTMLStyle_get_zIndex(style, &v);
1597c2c66affSColin Finck ok(hres == S_OK, "get_zIndex failed: %08x\n", hres);
1598c2c66affSColin Finck ok(V_VT(&v) == VT_I4, "V_VT(v)=%d\n", V_VT(&v));
1599c2c66affSColin Finck ok(V_I4(&v) == 1, "V_I4(v) = %d\n", V_I4(&v));
1600c2c66affSColin Finck VariantClear(&v);
1601c2c66affSColin Finck
1602c2c66affSColin Finck /* fontStyle */
1603c2c66affSColin Finck hres = IHTMLStyle_get_fontStyle(style, &sDefault);
1604c2c66affSColin Finck ok(hres == S_OK, "get_fontStyle failed: %08x\n", hres);
1605c2c66affSColin Finck
1606c2c66affSColin Finck str = a2bstr("test");
1607c2c66affSColin Finck hres = IHTMLStyle_put_fontStyle(style, str);
1608c2c66affSColin Finck ok(hres == E_INVALIDARG, "put_fontStyle failed: %08x\n", hres);
1609c2c66affSColin Finck SysFreeString(str);
1610c2c66affSColin Finck
1611c2c66affSColin Finck str = a2bstr("italic");
1612c2c66affSColin Finck hres = IHTMLStyle_put_fontStyle(style, str);
1613c2c66affSColin Finck ok(hres == S_OK, "put_fontStyle failed: %08x\n", hres);
1614c2c66affSColin Finck SysFreeString(str);
1615c2c66affSColin Finck
1616c2c66affSColin Finck str = a2bstr("oblique");
1617c2c66affSColin Finck hres = IHTMLStyle_put_fontStyle(style, str);
1618c2c66affSColin Finck ok(hres == S_OK, "put_fontStyle failed: %08x\n", hres);
1619c2c66affSColin Finck SysFreeString(str);
1620c2c66affSColin Finck
1621c2c66affSColin Finck str = a2bstr("normal");
1622c2c66affSColin Finck hres = IHTMLStyle_put_fontStyle(style, str);
1623c2c66affSColin Finck ok(hres == S_OK, "put_fontStyle failed: %08x\n", hres);
1624c2c66affSColin Finck SysFreeString(str);
1625c2c66affSColin Finck
1626c2c66affSColin Finck hres = IHTMLStyle_put_fontStyle(style, sDefault);
1627c2c66affSColin Finck ok(hres == S_OK, "put_fontStyle failed: %08x\n", hres);
1628c2c66affSColin Finck SysFreeString(sDefault);
1629c2c66affSColin Finck
1630c2c66affSColin Finck /* overflow */
1631c2c66affSColin Finck hres = IHTMLStyle_get_overflow(style, NULL);
1632c2c66affSColin Finck ok(hres == E_INVALIDARG, "get_overflow failed: %08x\n", hres);
1633c2c66affSColin Finck
1634c2c66affSColin Finck hres = IHTMLStyle_get_overflow(style, &sOverflowDefault);
1635c2c66affSColin Finck ok(hres == S_OK, "get_overflow failed: %08x\n", hres);
1636c2c66affSColin Finck
1637c2c66affSColin Finck str = a2bstr("test");
1638c2c66affSColin Finck hres = IHTMLStyle_put_overflow(style, str);
1639c2c66affSColin Finck ok(hres == E_INVALIDARG, "put_overflow failed: %08x\n", hres);
1640c2c66affSColin Finck SysFreeString(str);
1641c2c66affSColin Finck
1642c2c66affSColin Finck str = a2bstr("visible");
1643c2c66affSColin Finck hres = IHTMLStyle_put_overflow(style, str);
1644c2c66affSColin Finck ok(hres == S_OK, "put_overflow failed: %08x\n", hres);
1645c2c66affSColin Finck SysFreeString(str);
1646c2c66affSColin Finck
1647c2c66affSColin Finck str = a2bstr("scroll");
1648c2c66affSColin Finck hres = IHTMLStyle_put_overflow(style, str);
1649c2c66affSColin Finck ok(hres == S_OK, "put_overflow failed: %08x\n", hres);
1650c2c66affSColin Finck SysFreeString(str);
1651c2c66affSColin Finck
1652c2c66affSColin Finck str = a2bstr("hidden");
1653c2c66affSColin Finck hres = IHTMLStyle_put_overflow(style, str);
1654c2c66affSColin Finck ok(hres == S_OK, "put_overflow failed: %08x\n", hres);
1655c2c66affSColin Finck SysFreeString(str);
1656c2c66affSColin Finck
1657c2c66affSColin Finck str = a2bstr("auto");
1658c2c66affSColin Finck hres = IHTMLStyle_put_overflow(style, str);
1659c2c66affSColin Finck ok(hres == S_OK, "put_overflow failed: %08x\n", hres);
1660c2c66affSColin Finck SysFreeString(str);
1661c2c66affSColin Finck
1662c2c66affSColin Finck hres = IHTMLStyle_get_overflow(style, &str);
1663c2c66affSColin Finck ok(hres == S_OK, "get_overflow failed: %08x\n", hres);
1664c2c66affSColin Finck ok(!strcmp_wa(str, "auto"), "str=%s\n", wine_dbgstr_w(str));
1665c2c66affSColin Finck SysFreeString(str);
1666c2c66affSColin Finck
1667c2c66affSColin Finck str = a2bstr("");
1668c2c66affSColin Finck hres = IHTMLStyle_put_overflow(style, str);
1669c2c66affSColin Finck ok(hres == S_OK, "put_overflow failed: %08x\n", hres);
1670c2c66affSColin Finck SysFreeString(str);
1671c2c66affSColin Finck
1672c2c66affSColin Finck hres = IHTMLStyle_get_overflow(style, &str);
1673c2c66affSColin Finck ok(hres == S_OK, "get_overflow failed: %08x\n", hres);
1674c2c66affSColin Finck ok(!str, "str=%s\n", wine_dbgstr_w(str));
1675c2c66affSColin Finck SysFreeString(str);
1676c2c66affSColin Finck
1677c2c66affSColin Finck /* restore overflow default */
1678c2c66affSColin Finck hres = IHTMLStyle_put_overflow(style, sOverflowDefault);
1679c2c66affSColin Finck ok(hres == S_OK, "put_overflow failed: %08x\n", hres);
1680c2c66affSColin Finck SysFreeString(sOverflowDefault);
1681c2c66affSColin Finck
1682c2c66affSColin Finck /* Attribute Tests*/
1683c2c66affSColin Finck hres = IHTMLStyle_getAttribute(style, NULL, 1, &v);
1684c2c66affSColin Finck ok(hres == E_INVALIDARG, "getAttribute failed: %08x\n", hres);
1685c2c66affSColin Finck
1686c2c66affSColin Finck str = a2bstr("position");
1687c2c66affSColin Finck hres = IHTMLStyle_getAttribute(style, str, 1, NULL);
1688c2c66affSColin Finck ok(hres == E_INVALIDARG, "getAttribute failed: %08x\n", hres);
1689c2c66affSColin Finck
1690c2c66affSColin Finck hres = IHTMLStyle_getAttribute(style, str, 1, &v);
1691c2c66affSColin Finck ok(hres == S_OK, "getAttribute failed: %08x\n", hres);
1692c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "type failed: %d\n", V_VT(&v));
1693c2c66affSColin Finck VariantClear(&v);
1694c2c66affSColin Finck
1695c2c66affSColin Finck hres = IHTMLStyle_setAttribute(style, NULL, v, 1);
1696c2c66affSColin Finck ok(hres == E_INVALIDARG, "setAttribute failed: %08x\n", hres);
1697c2c66affSColin Finck
1698c2c66affSColin Finck V_VT(&v) = VT_BSTR;
1699c2c66affSColin Finck V_BSTR(&v) = a2bstr("absolute");
1700c2c66affSColin Finck hres = IHTMLStyle_setAttribute(style, str, v, 1);
1701c2c66affSColin Finck ok(hres == S_OK, "setAttribute failed: %08x\n", hres);
1702c2c66affSColin Finck VariantClear(&v);
1703c2c66affSColin Finck
1704c2c66affSColin Finck hres = IHTMLStyle_getAttribute(style, str, 1, &v);
1705c2c66affSColin Finck ok(hres == S_OK, "getAttribute failed: %08x\n", hres);
1706c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "type failed: %d\n", V_VT(&v));
1707c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "absolute"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
1708c2c66affSColin Finck VariantClear(&v);
1709c2c66affSColin Finck
1710c2c66affSColin Finck V_VT(&v) = VT_BSTR;
1711c2c66affSColin Finck V_BSTR(&v) = NULL;
1712c2c66affSColin Finck hres = IHTMLStyle_setAttribute(style, str, v, 1);
1713c2c66affSColin Finck ok(hres == S_OK, "setAttribute failed: %08x\n", hres);
1714c2c66affSColin Finck VariantClear(&v);
1715c2c66affSColin Finck
1716c2c66affSColin Finck SysFreeString(str);
1717c2c66affSColin Finck
1718c2c66affSColin Finck str = a2bstr("borderLeftStyle");
1719c2c66affSColin Finck test_border_styles(style, str);
1720c2c66affSColin Finck SysFreeString(str);
1721c2c66affSColin Finck
1722c2c66affSColin Finck str = a2bstr("borderbottomstyle");
1723c2c66affSColin Finck test_border_styles(style, str);
1724c2c66affSColin Finck SysFreeString(str);
1725c2c66affSColin Finck
1726c2c66affSColin Finck str = a2bstr("borderrightstyle");
1727c2c66affSColin Finck test_border_styles(style, str);
1728c2c66affSColin Finck SysFreeString(str);
1729c2c66affSColin Finck
1730c2c66affSColin Finck str = a2bstr("bordertopstyle");
1731c2c66affSColin Finck test_border_styles(style, str);
1732c2c66affSColin Finck SysFreeString(str);
1733c2c66affSColin Finck
1734c2c66affSColin Finck hres = IHTMLStyle_get_borderStyle(style, &sDefault);
1735c2c66affSColin Finck ok(hres == S_OK, "get_borderStyle failed: %08x\n", hres);
1736c2c66affSColin Finck
1737c2c66affSColin Finck str = a2bstr("none dotted dashed solid");
1738c2c66affSColin Finck hres = IHTMLStyle_put_borderStyle(style, str);
1739c2c66affSColin Finck ok(hres == S_OK, "put_borderStyle failed: %08x\n", hres);
1740c2c66affSColin Finck SysFreeString(str);
1741c2c66affSColin Finck
1742c2c66affSColin Finck str = a2bstr("none dotted dashed solid");
1743c2c66affSColin Finck hres = IHTMLStyle_get_borderStyle(style, &str);
1744c2c66affSColin Finck ok(hres == S_OK, "get_borderStyle failed: %08x\n", hres);
1745c2c66affSColin Finck ok(!strcmp_wa(str, "none dotted dashed solid"),
1746c2c66affSColin Finck "expected (none dotted dashed solid) = (%s)\n", wine_dbgstr_w(V_BSTR(&v)));
1747c2c66affSColin Finck SysFreeString(str);
1748c2c66affSColin Finck
1749c2c66affSColin Finck str = a2bstr("double groove ridge inset");
1750c2c66affSColin Finck hres = IHTMLStyle_put_borderStyle(style, str);
1751c2c66affSColin Finck ok(hres == S_OK, "put_borderStyle failed: %08x\n", hres);
1752c2c66affSColin Finck SysFreeString(str);
1753c2c66affSColin Finck
1754c2c66affSColin Finck str = a2bstr("window-inset outset ridge inset");
1755c2c66affSColin Finck hres = IHTMLStyle_put_borderStyle(style, str);
1756c2c66affSColin Finck ok(hres == S_OK, "put_borderStyle failed: %08x\n", hres);
1757c2c66affSColin Finck SysFreeString(str);
1758c2c66affSColin Finck
1759c2c66affSColin Finck str = a2bstr("window-inset");
1760c2c66affSColin Finck hres = IHTMLStyle_put_borderStyle(style, str);
1761c2c66affSColin Finck ok(hres == S_OK, "put_borderStyle failed: %08x\n", hres);
1762c2c66affSColin Finck SysFreeString(str);
1763c2c66affSColin Finck
1764c2c66affSColin Finck str = a2bstr("none none none none none");
1765c2c66affSColin Finck hres = IHTMLStyle_put_borderStyle(style, str);
1766c2c66affSColin Finck ok(hres == S_OK, "put_borderStyle failed: %08x\n", hres);
1767c2c66affSColin Finck SysFreeString(str);
1768c2c66affSColin Finck
1769c2c66affSColin Finck str = a2bstr("invalid none none none");
1770c2c66affSColin Finck hres = IHTMLStyle_put_borderStyle(style, str);
1771c2c66affSColin Finck ok(hres == E_INVALIDARG, "put_borderStyle failed: %08x\n", hres);
1772c2c66affSColin Finck SysFreeString(str);
1773c2c66affSColin Finck
1774c2c66affSColin Finck str = a2bstr("none invalid none none");
1775c2c66affSColin Finck hres = IHTMLStyle_put_borderStyle(style, str);
1776c2c66affSColin Finck ok(hres == E_INVALIDARG, "put_borderStyle failed: %08x\n", hres);
1777c2c66affSColin Finck SysFreeString(str);
1778c2c66affSColin Finck
1779c2c66affSColin Finck hres = IHTMLStyle_put_borderStyle(style, sDefault);
1780c2c66affSColin Finck ok(hres == S_OK, "put_borderStyle failed: %08x\n", hres);
1781c2c66affSColin Finck SysFreeString(sDefault);
1782c2c66affSColin Finck
1783c2c66affSColin Finck /* backgoundColor */
1784c2c66affSColin Finck hres = IHTMLStyle_get_backgroundColor(style, &v);
1785c2c66affSColin Finck ok(hres == S_OK, "get_backgroundColor: %08x\n", hres);
1786c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "type failed: %d\n", V_VT(&v));
1787c2c66affSColin Finck ok(!V_BSTR(&v), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
1788c2c66affSColin Finck VariantClear(&v);
1789c2c66affSColin Finck
1790c2c66affSColin Finck V_VT(&v) = VT_BSTR;
1791c2c66affSColin Finck V_BSTR(&v) = a2bstr("red");
1792c2c66affSColin Finck hres = IHTMLStyle_put_backgroundColor(style, v);
1793c2c66affSColin Finck ok(hres == S_OK, "put_backgroundColor failed: %08x\n", hres);
1794c2c66affSColin Finck VariantClear(&v);
1795c2c66affSColin Finck
1796c2c66affSColin Finck hres = IHTMLStyle_get_backgroundColor(style, &v);
1797c2c66affSColin Finck ok(hres == S_OK, "get_backgroundColor: %08x\n", hres);
1798c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "type failed: %d\n", V_VT(&v));
1799c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "red"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
1800c2c66affSColin Finck VariantClear(&v);
1801c2c66affSColin Finck
1802c2c66affSColin Finck str = a2bstr("fixed");
1803c2c66affSColin Finck hres = IHTMLStyle_put_backgroundAttachment(style, str);
1804c2c66affSColin Finck ok(hres == S_OK, "put_backgroundAttachment failed: %08x\n", hres);
1805c2c66affSColin Finck SysFreeString(str);
1806c2c66affSColin Finck
1807c2c66affSColin Finck hres = IHTMLStyle_get_backgroundAttachment(style, &str);
1808c2c66affSColin Finck ok(hres == S_OK, "get_backgroundAttachment failed: %08x\n", hres);
1809c2c66affSColin Finck ok(!strcmp_wa(str, "fixed"), "ret = %s\n", wine_dbgstr_w(str));
1810c2c66affSColin Finck SysFreeString(str);
1811c2c66affSColin Finck
1812c2c66affSColin Finck /* padding */
1813c2c66affSColin Finck hres = IHTMLStyle_get_padding(style, &str);
1814c2c66affSColin Finck ok(hres == S_OK, "get_padding failed: %08x\n", hres);
1815c2c66affSColin Finck ok(!str, "padding = %s\n", wine_dbgstr_w(str));
1816c2c66affSColin Finck SysFreeString(str);
1817c2c66affSColin Finck
1818c2c66affSColin Finck hres = IHTMLStyle_get_paddingTop(style, &v);
1819c2c66affSColin Finck ok(hres == S_OK, "get_paddingTop: %08x\n", hres);
1820c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
1821c2c66affSColin Finck ok(!V_BSTR(&v), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1822c2c66affSColin Finck
1823c2c66affSColin Finck V_VT(&v) = VT_I4;
1824c2c66affSColin Finck V_I4(&v) = 6;
1825c2c66affSColin Finck hres = IHTMLStyle_put_paddingTop(style, v);
1826c2c66affSColin Finck ok(hres == S_OK, "put_paddingTop failed: %08x\n", hres);
1827c2c66affSColin Finck
1828c2c66affSColin Finck hres = IHTMLStyle_get_paddingTop(style, &v);
1829c2c66affSColin Finck ok(hres == S_OK, "get_paddingTop: %08x\n", hres);
1830c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
1831c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "6px"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1832c2c66affSColin Finck VariantClear(&v);
1833c2c66affSColin Finck
1834c2c66affSColin Finck hres = IHTMLStyle_get_paddingRight(style, &v);
1835c2c66affSColin Finck ok(hres == S_OK, "get_paddingRight: %08x\n", hres);
1836c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
1837c2c66affSColin Finck ok(!V_BSTR(&v), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1838c2c66affSColin Finck
1839c2c66affSColin Finck V_VT(&v) = VT_I4;
1840c2c66affSColin Finck V_I4(&v) = 6;
1841c2c66affSColin Finck hres = IHTMLStyle_put_paddingRight(style, v);
1842c2c66affSColin Finck ok(hres == S_OK, "put_paddingRight failed: %08x\n", hres);
1843c2c66affSColin Finck
1844c2c66affSColin Finck hres = IHTMLStyle_get_paddingRight(style, &v);
1845c2c66affSColin Finck ok(hres == S_OK, "get_paddingRight: %08x\n", hres);
1846c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
1847c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "6px"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1848c2c66affSColin Finck VariantClear(&v);
1849c2c66affSColin Finck
1850c2c66affSColin Finck hres = IHTMLStyle_get_paddingBottom(style, &v);
1851c2c66affSColin Finck ok(hres == S_OK, "get_paddingBottom: %08x\n", hres);
1852c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
1853c2c66affSColin Finck ok(!V_BSTR(&v), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1854c2c66affSColin Finck
1855c2c66affSColin Finck V_VT(&v) = VT_I4;
1856c2c66affSColin Finck V_I4(&v) = 6;
1857c2c66affSColin Finck hres = IHTMLStyle_put_paddingBottom(style, v);
1858c2c66affSColin Finck ok(hres == S_OK, "put_paddingBottom failed: %08x\n", hres);
1859c2c66affSColin Finck
1860c2c66affSColin Finck hres = IHTMLStyle_get_paddingBottom(style, &v);
1861c2c66affSColin Finck ok(hres == S_OK, "get_paddingBottom: %08x\n", hres);
1862c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
1863c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "6px"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1864c2c66affSColin Finck VariantClear(&v);
1865c2c66affSColin Finck
1866c2c66affSColin Finck str = a2bstr("1");
1867c2c66affSColin Finck hres = IHTMLStyle_put_padding(style, str);
1868c2c66affSColin Finck ok(hres == S_OK, "put_padding failed: %08x\n", hres);
1869c2c66affSColin Finck SysFreeString(str);
1870c2c66affSColin Finck
1871c2c66affSColin Finck hres = IHTMLStyle_get_padding(style, &str);
1872c2c66affSColin Finck ok(hres == S_OK, "get_padding failed: %08x\n", hres);
1873c2c66affSColin Finck ok(!strcmp_wa(str, "1px"), "padding = %s\n", wine_dbgstr_w(str));
1874c2c66affSColin Finck SysFreeString(str);
1875c2c66affSColin Finck
1876c2c66affSColin Finck /* PaddingLeft */
1877c2c66affSColin Finck hres = IHTMLStyle_get_paddingLeft(style, &vDefault);
1878c2c66affSColin Finck ok(hres == S_OK, "get_paddingLeft: %08x\n", hres);
1879c2c66affSColin Finck ok(V_VT(&vDefault) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&vDefault));
1880c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&vDefault), "1px"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&vDefault)));
1881c2c66affSColin Finck
1882c2c66affSColin Finck V_VT(&v) = VT_BSTR;
1883c2c66affSColin Finck V_BSTR(&v) = a2bstr("10");
1884c2c66affSColin Finck hres = IHTMLStyle_put_paddingLeft(style, v);
1885c2c66affSColin Finck ok(hres == S_OK, "put_paddingLeft: %08x\n", hres);
1886c2c66affSColin Finck VariantClear(&v);
1887c2c66affSColin Finck
1888c2c66affSColin Finck hres = IHTMLStyle_get_paddingLeft(style, &v);
1889c2c66affSColin Finck ok(hres == S_OK, "get_paddingLeft: %08x\n", hres);
1890c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "10px"), "expecte 10 = %s\n", wine_dbgstr_w(V_BSTR(&v)));
1891c2c66affSColin Finck VariantClear(&v);
1892c2c66affSColin Finck
1893c2c66affSColin Finck hres = IHTMLStyle_put_paddingLeft(style, vDefault);
1894c2c66affSColin Finck ok(hres == S_OK, "put_paddingLeft: %08x\n", hres);
1895c2c66affSColin Finck
1896c2c66affSColin Finck /* BackgroundRepeat */
1897c2c66affSColin Finck hres = IHTMLStyle_get_backgroundRepeat(style, &sDefault);
1898c2c66affSColin Finck ok(hres == S_OK, "get_backgroundRepeat failed: %08x\n", hres);
1899c2c66affSColin Finck
1900c2c66affSColin Finck str = a2bstr("invalid");
1901c2c66affSColin Finck hres = IHTMLStyle_put_backgroundRepeat(style, str);
1902c2c66affSColin Finck ok(hres == E_INVALIDARG, "put_backgroundRepeat failed: %08x\n", hres);
1903c2c66affSColin Finck SysFreeString(str);
1904c2c66affSColin Finck
1905c2c66affSColin Finck str = a2bstr("repeat");
1906c2c66affSColin Finck hres = IHTMLStyle_put_backgroundRepeat(style, str);
1907c2c66affSColin Finck ok(hres == S_OK, "put_backgroundRepeat failed: %08x\n", hres);
1908c2c66affSColin Finck SysFreeString(str);
1909c2c66affSColin Finck
1910c2c66affSColin Finck str = a2bstr("no-repeat");
1911c2c66affSColin Finck hres = IHTMLStyle_put_backgroundRepeat(style, str);
1912c2c66affSColin Finck ok(hres == S_OK, "put_backgroundRepeat failed: %08x\n", hres);
1913c2c66affSColin Finck SysFreeString(str);
1914c2c66affSColin Finck
1915c2c66affSColin Finck str = a2bstr("repeat-x");
1916c2c66affSColin Finck hres = IHTMLStyle_put_backgroundRepeat(style, str);
1917c2c66affSColin Finck ok(hres == S_OK, "put_backgroundRepeat failed: %08x\n", hres);
1918c2c66affSColin Finck SysFreeString(str);
1919c2c66affSColin Finck
1920c2c66affSColin Finck str = a2bstr("repeat-y");
1921c2c66affSColin Finck hres = IHTMLStyle_put_backgroundRepeat(style, str);
1922c2c66affSColin Finck ok(hres == S_OK, "put_backgroundRepeat failed: %08x\n", hres);
1923c2c66affSColin Finck SysFreeString(str);
1924c2c66affSColin Finck
1925c2c66affSColin Finck hres = IHTMLStyle_get_backgroundRepeat(style, &str);
1926c2c66affSColin Finck ok(hres == S_OK, "get_backgroundRepeat failed: %08x\n", hres);
1927c2c66affSColin Finck ok(!strcmp_wa(str, "repeat-y"), "str=%s\n", wine_dbgstr_w(str));
1928c2c66affSColin Finck SysFreeString(str);
1929c2c66affSColin Finck
1930c2c66affSColin Finck hres = IHTMLStyle_put_backgroundRepeat(style, sDefault);
1931c2c66affSColin Finck ok(hres == S_OK, "put_backgroundRepeat failed: %08x\n", hres);
1932c2c66affSColin Finck SysFreeString(sDefault);
1933c2c66affSColin Finck
1934c2c66affSColin Finck /* BorderColor */
1935c2c66affSColin Finck hres = IHTMLStyle_get_borderColor(style, &sDefault);
1936c2c66affSColin Finck ok(hres == S_OK, "get_borderColor failed: %08x\n", hres);
1937c2c66affSColin Finck
1938c2c66affSColin Finck str = a2bstr("red green red blue");
1939c2c66affSColin Finck hres = IHTMLStyle_put_borderColor(style, str);
1940c2c66affSColin Finck ok(hres == S_OK, "put_borderColor failed: %08x\n", hres);
1941c2c66affSColin Finck SysFreeString(str);
1942c2c66affSColin Finck
1943c2c66affSColin Finck hres = IHTMLStyle_get_borderColor(style, &str);
1944c2c66affSColin Finck ok(hres == S_OK, "get_borderColor failed: %08x\n", hres);
1945c2c66affSColin Finck ok(!strcmp_wa(str, "red green red blue"), "str=%s\n", wine_dbgstr_w(str));
1946c2c66affSColin Finck SysFreeString(str);
1947c2c66affSColin Finck
1948c2c66affSColin Finck hres = IHTMLStyle_put_borderColor(style, sDefault);
1949c2c66affSColin Finck ok(hres == S_OK, "put_borderColor failed: %08x\n", hres);
1950c2c66affSColin Finck SysFreeString(sDefault);
1951c2c66affSColin Finck
1952c2c66affSColin Finck /* BorderRight */
1953c2c66affSColin Finck hres = IHTMLStyle_get_borderRight(style, &sDefault);
1954c2c66affSColin Finck ok(hres == S_OK, "get_borderRight failed: %08x\n", hres);
1955c2c66affSColin Finck
1956c2c66affSColin Finck str = a2bstr("thick dotted red");
1957c2c66affSColin Finck hres = IHTMLStyle_put_borderRight(style, str);
1958c2c66affSColin Finck ok(hres == S_OK, "put_borderRight failed: %08x\n", hres);
1959c2c66affSColin Finck SysFreeString(str);
1960c2c66affSColin Finck
1961c2c66affSColin Finck /* IHTMLStyle_get_borderRight appears to have a bug where
1962c2c66affSColin Finck it returns the first letter of the color. So we check
1963c2c66affSColin Finck each style individually.
1964c2c66affSColin Finck */
1965c2c66affSColin Finck V_BSTR(&v) = NULL;
1966c2c66affSColin Finck hres = IHTMLStyle_get_borderRightColor(style, &v);
1967c2c66affSColin Finck ok(hres == S_OK, "get_borderRightColor failed: %08x\n", hres);
1968c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "red"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
1969c2c66affSColin Finck VariantClear(&v);
1970c2c66affSColin Finck
1971c2c66affSColin Finck V_BSTR(&v) = NULL;
1972c2c66affSColin Finck hres = IHTMLStyle_get_borderRightWidth(style, &v);
1973c2c66affSColin Finck ok(hres == S_OK, "get_borderRightWidth failed: %08x\n", hres);
1974c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "thick"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
1975c2c66affSColin Finck VariantClear(&v);
1976c2c66affSColin Finck
1977c2c66affSColin Finck hres = IHTMLStyle_get_borderRightStyle(style, &str);
1978c2c66affSColin Finck ok(hres == S_OK, "get_borderRightStyle failed: %08x\n", hres);
1979c2c66affSColin Finck ok(!strcmp_wa(str, "dotted"), "str=%s\n", wine_dbgstr_w(str));
1980c2c66affSColin Finck SysFreeString(str);
1981c2c66affSColin Finck
1982c2c66affSColin Finck hres = IHTMLStyle_put_borderRight(style, sDefault);
1983c2c66affSColin Finck ok(hres == S_OK, "put_borderRight failed: %08x\n", hres);
1984c2c66affSColin Finck SysFreeString(sDefault);
1985c2c66affSColin Finck
1986c2c66affSColin Finck /* BorderTop */
1987c2c66affSColin Finck hres = IHTMLStyle_get_borderTop(style, &sDefault);
1988c2c66affSColin Finck ok(hres == S_OK, "get_borderTop failed: %08x\n", hres);
1989c2c66affSColin Finck
1990c2c66affSColin Finck str = a2bstr("thick dotted red");
1991c2c66affSColin Finck hres = IHTMLStyle_put_borderTop(style, str);
1992c2c66affSColin Finck ok(hres == S_OK, "put_borderTop failed: %08x\n", hres);
1993c2c66affSColin Finck SysFreeString(str);
1994c2c66affSColin Finck
1995c2c66affSColin Finck /* IHTMLStyle_get_borderTop appears to have a bug where
1996c2c66affSColin Finck it returns the first letter of the color. So we check
1997c2c66affSColin Finck each style individually.
1998c2c66affSColin Finck */
1999c2c66affSColin Finck V_BSTR(&v) = NULL;
2000c2c66affSColin Finck hres = IHTMLStyle_get_borderTopColor(style, &v);
2001c2c66affSColin Finck ok(hres == S_OK, "get_borderTopColor failed: %08x\n", hres);
2002c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "red"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
2003c2c66affSColin Finck VariantClear(&v);
2004c2c66affSColin Finck
2005c2c66affSColin Finck V_BSTR(&v) = NULL;
2006c2c66affSColin Finck hres = IHTMLStyle_get_borderTopWidth(style, &v);
2007c2c66affSColin Finck ok(hres == S_OK, "get_borderTopWidth failed: %08x\n", hres);
2008c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "thick"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
2009c2c66affSColin Finck VariantClear(&v);
2010c2c66affSColin Finck
2011c2c66affSColin Finck hres = IHTMLStyle_get_borderTopStyle(style, &str);
2012c2c66affSColin Finck ok(hres == S_OK, "get_borderTopStyle failed: %08x\n", hres);
2013c2c66affSColin Finck ok(!strcmp_wa(str, "dotted"), "str=%s\n", wine_dbgstr_w(str));
2014c2c66affSColin Finck SysFreeString(str);
2015c2c66affSColin Finck
2016c2c66affSColin Finck hres = IHTMLStyle_put_borderTop(style, sDefault);
2017c2c66affSColin Finck ok(hres == S_OK, "put_borderTop failed: %08x\n", hres);
2018c2c66affSColin Finck SysFreeString(sDefault);
2019c2c66affSColin Finck
2020c2c66affSColin Finck /* BorderBottom */
2021c2c66affSColin Finck hres = IHTMLStyle_get_borderBottom(style, &sDefault);
2022c2c66affSColin Finck ok(hres == S_OK, "get_borderBottom failed: %08x\n", hres);
2023c2c66affSColin Finck
2024c2c66affSColin Finck str = a2bstr("thick dotted red");
2025c2c66affSColin Finck hres = IHTMLStyle_put_borderBottom(style, str);
2026c2c66affSColin Finck ok(hres == S_OK, "put_borderBottom failed: %08x\n", hres);
2027c2c66affSColin Finck SysFreeString(str);
2028c2c66affSColin Finck
2029c2c66affSColin Finck /* IHTMLStyle_get_borderBottom appears to have a bug where
2030c2c66affSColin Finck it returns the first letter of the color. So we check
2031c2c66affSColin Finck each style individually.
2032c2c66affSColin Finck */
2033c2c66affSColin Finck V_BSTR(&v) = NULL;
2034c2c66affSColin Finck hres = IHTMLStyle_get_borderBottomColor(style, &v);
2035c2c66affSColin Finck ok(hres == S_OK, "get_borderBottomColor failed: %08x\n", hres);
2036c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "red"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
2037c2c66affSColin Finck VariantClear(&v);
2038c2c66affSColin Finck
2039c2c66affSColin Finck V_BSTR(&v) = NULL;
2040c2c66affSColin Finck hres = IHTMLStyle_get_borderBottomWidth(style, &v);
2041c2c66affSColin Finck ok(hres == S_OK, "get_borderBottomWidth failed: %08x\n", hres);
2042c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "thick"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
2043c2c66affSColin Finck VariantClear(&v);
2044c2c66affSColin Finck
2045c2c66affSColin Finck hres = IHTMLStyle_get_borderBottomStyle(style, &str);
2046c2c66affSColin Finck ok(hres == S_OK, "get_borderBottomStyle failed: %08x\n", hres);
2047c2c66affSColin Finck ok(!strcmp_wa(str, "dotted"), "str=%s\n", wine_dbgstr_w(str));
2048c2c66affSColin Finck SysFreeString(str);
2049c2c66affSColin Finck
2050c2c66affSColin Finck hres = IHTMLStyle_put_borderBottom(style, sDefault);
2051c2c66affSColin Finck ok(hres == S_OK, "put_borderBottom failed: %08x\n", hres);
2052c2c66affSColin Finck SysFreeString(sDefault);
2053c2c66affSColin Finck
2054c2c66affSColin Finck /* BorderLeft */
2055c2c66affSColin Finck hres = IHTMLStyle_get_borderLeft(style, &sDefault);
2056c2c66affSColin Finck ok(hres == S_OK, "get_borderLeft failed: %08x\n", hres);
2057c2c66affSColin Finck
2058c2c66affSColin Finck str = a2bstr("thick dotted red");
2059c2c66affSColin Finck hres = IHTMLStyle_put_borderLeft(style, str);
2060c2c66affSColin Finck ok(hres == S_OK, "put_borderLeft failed: %08x\n", hres);
2061c2c66affSColin Finck SysFreeString(str);
2062c2c66affSColin Finck
2063c2c66affSColin Finck /* IHTMLStyle_get_borderLeft appears to have a bug where
2064c2c66affSColin Finck it returns the first letter of the color. So we check
2065c2c66affSColin Finck each style individually.
2066c2c66affSColin Finck */
2067c2c66affSColin Finck V_BSTR(&v) = NULL;
2068c2c66affSColin Finck hres = IHTMLStyle_get_borderLeftColor(style, &v);
2069c2c66affSColin Finck ok(hres == S_OK, "get_borderLeftColor failed: %08x\n", hres);
2070c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "red"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
2071c2c66affSColin Finck VariantClear(&v);
2072c2c66affSColin Finck
2073c2c66affSColin Finck V_BSTR(&v) = NULL;
2074c2c66affSColin Finck hres = IHTMLStyle_get_borderLeftWidth(style, &v);
2075c2c66affSColin Finck ok(hres == S_OK, "get_borderLeftWidth failed: %08x\n", hres);
2076c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "thick"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
2077c2c66affSColin Finck VariantClear(&v);
2078c2c66affSColin Finck
2079c2c66affSColin Finck hres = IHTMLStyle_get_borderLeftStyle(style, &str);
2080c2c66affSColin Finck ok(hres == S_OK, "get_borderLeftStyle failed: %08x\n", hres);
2081c2c66affSColin Finck ok(!strcmp_wa(str, "dotted"), "str=%s\n", wine_dbgstr_w(str));
2082c2c66affSColin Finck SysFreeString(str);
2083c2c66affSColin Finck
2084c2c66affSColin Finck hres = IHTMLStyle_put_borderLeft(style, sDefault);
2085c2c66affSColin Finck ok(hres == S_OK, "put_borderLeft failed: %08x\n", hres);
2086c2c66affSColin Finck SysFreeString(sDefault);
2087c2c66affSColin Finck
2088c2c66affSColin Finck /* backgroundPositionX */
2089c2c66affSColin Finck hres = IHTMLStyle_get_backgroundPositionX(style, &v);
2090c2c66affSColin Finck ok(hres == S_OK, "get_backgroundPositionX failed: %08x\n", hres);
2091c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
2092c2c66affSColin Finck ok(!V_BSTR(&v), "backgroundPositionX = %s\n", wine_dbgstr_w(V_BSTR(&v)));
2093c2c66affSColin Finck VariantClear(&v);
2094c2c66affSColin Finck
2095c2c66affSColin Finck V_VT(&v) = VT_BSTR;
2096c2c66affSColin Finck V_BSTR(&v) = a2bstr("10px");
2097c2c66affSColin Finck hres = IHTMLStyle_put_backgroundPositionX(style, v);
2098c2c66affSColin Finck ok(hres == S_OK, "put_backgroundPositionX failed: %08x\n", hres);
2099c2c66affSColin Finck VariantClear(&v);
2100c2c66affSColin Finck
2101c2c66affSColin Finck hres = IHTMLStyle_get_backgroundPositionX(style, &v);
2102c2c66affSColin Finck ok(hres == S_OK, "get_backgroundPositionX failed: %08x\n", hres);
2103c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
2104c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "10px"), "backgroundPositionX = %s\n", wine_dbgstr_w(V_BSTR(&v)));
2105c2c66affSColin Finck VariantClear(&v);
2106c2c66affSColin Finck
2107c2c66affSColin Finck /* backgroundPositionY */
2108c2c66affSColin Finck hres = IHTMLStyle_get_backgroundPositionY(style, &v);
2109c2c66affSColin Finck ok(hres == S_OK, "get_backgroundPositionY failed: %08x\n", hres);
2110c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
2111c2c66affSColin Finck VariantClear(&v);
2112c2c66affSColin Finck
2113c2c66affSColin Finck V_VT(&v) = VT_BSTR;
2114c2c66affSColin Finck V_BSTR(&v) = a2bstr("15px");
2115c2c66affSColin Finck hres = IHTMLStyle_put_backgroundPositionY(style, v);
2116c2c66affSColin Finck ok(hres == S_OK, "put_backgroundPositionY failed: %08x\n", hres);
2117c2c66affSColin Finck VariantClear(&v);
2118c2c66affSColin Finck
2119c2c66affSColin Finck hres = IHTMLStyle_get_backgroundPositionY(style, &v);
2120c2c66affSColin Finck ok(hres == S_OK, "get_backgroundPositionY failed: %08x\n", hres);
2121c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
2122c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "15px"), "backgroundPositionY = %s\n", wine_dbgstr_w(V_BSTR(&v)));
2123c2c66affSColin Finck VariantClear(&v);
2124c2c66affSColin Finck
2125c2c66affSColin Finck /* backgroundPosition */
2126c2c66affSColin Finck str = NULL;
2127c2c66affSColin Finck hres = IHTMLStyle_get_backgroundPosition(style, &str);
2128c2c66affSColin Finck ok(hres == S_OK, "get_backgroundPosition failed: %08x\n", hres);
2129c2c66affSColin Finck ok(!strcmp_wa(str, "10px 15px"), "backgroundPosition = %s\n", wine_dbgstr_w(str));
2130c2c66affSColin Finck SysFreeString(str);
2131c2c66affSColin Finck
2132c2c66affSColin Finck str = a2bstr("center 20%");
2133c2c66affSColin Finck hres = IHTMLStyle_put_backgroundPosition(style, str);
2134c2c66affSColin Finck ok(hres == S_OK, "put_backgroundPosition failed: %08x\n", hres);
2135c2c66affSColin Finck SysFreeString(str);
2136c2c66affSColin Finck
2137c2c66affSColin Finck str = NULL;
2138c2c66affSColin Finck hres = IHTMLStyle_get_backgroundPosition(style, &str);
2139c2c66affSColin Finck ok(hres == S_OK, "get_backgroundPosition failed: %08x\n", hres);
2140c2c66affSColin Finck ok(!strcmp_wa(str, "center 20%"), "backgroundPosition = %s\n", wine_dbgstr_w(str));
2141c2c66affSColin Finck SysFreeString(str);
2142c2c66affSColin Finck
2143c2c66affSColin Finck hres = IHTMLStyle_get_backgroundPositionX(style, &v);
2144c2c66affSColin Finck ok(hres == S_OK, "get_backgroundPositionX failed: %08x\n", hres);
2145c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
2146c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "center"), "backgroundPositionX = %s\n", wine_dbgstr_w(V_BSTR(&v)));
2147c2c66affSColin Finck VariantClear(&v);
2148c2c66affSColin Finck
2149c2c66affSColin Finck hres = IHTMLStyle_get_backgroundPositionY(style, &v);
2150c2c66affSColin Finck ok(hres == S_OK, "get_backgroundPositionY failed: %08x\n", hres);
2151c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
2152c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "20%"), "backgroundPositionY = %s\n", wine_dbgstr_w(V_BSTR(&v)));
2153c2c66affSColin Finck VariantClear(&v);
2154c2c66affSColin Finck
2155c2c66affSColin Finck /* borderTopWidth */
2156c2c66affSColin Finck hres = IHTMLStyle_get_borderTopWidth(style, &vDefault);
2157c2c66affSColin Finck ok(hres == S_OK, "get_borderTopWidth: %08x\n", hres);
2158c2c66affSColin Finck
2159c2c66affSColin Finck V_VT(&v) = VT_BSTR;
2160c2c66affSColin Finck V_BSTR(&v) = a2bstr("10px");
2161c2c66affSColin Finck hres = IHTMLStyle_put_borderTopWidth(style, v);
2162c2c66affSColin Finck ok(hres == S_OK, "put_borderTopWidth: %08x\n", hres);
2163c2c66affSColin Finck VariantClear(&v);
2164c2c66affSColin Finck
2165c2c66affSColin Finck hres = IHTMLStyle_get_borderTopWidth(style, &v);
2166c2c66affSColin Finck ok(hres == S_OK, "get_borderTopWidth: %08x\n", hres);
2167c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "10px"), "expected 10px = %s\n", wine_dbgstr_w(V_BSTR(&v)));
2168c2c66affSColin Finck VariantClear(&v);
2169c2c66affSColin Finck
2170c2c66affSColin Finck hres = IHTMLStyle_put_borderTopWidth(style, vDefault);
2171c2c66affSColin Finck ok(hres == S_OK, "put_borderTopWidth: %08x\n", hres);
2172c2c66affSColin Finck VariantClear(&vDefault);
2173c2c66affSColin Finck
2174c2c66affSColin Finck /* borderRightWidth */
2175c2c66affSColin Finck hres = IHTMLStyle_get_borderRightWidth(style, &vDefault);
2176c2c66affSColin Finck ok(hres == S_OK, "get_borderRightWidth: %08x\n", hres);
2177c2c66affSColin Finck
2178c2c66affSColin Finck V_VT(&v) = VT_BSTR;
2179c2c66affSColin Finck V_BSTR(&v) = a2bstr("10");
2180c2c66affSColin Finck hres = IHTMLStyle_put_borderRightWidth(style, v);
2181c2c66affSColin Finck ok(hres == S_OK, "put_borderRightWidth: %08x\n", hres);
2182c2c66affSColin Finck VariantClear(&v);
2183c2c66affSColin Finck
2184c2c66affSColin Finck hres = IHTMLStyle_get_borderRightWidth(style, &v);
2185c2c66affSColin Finck ok(hres == S_OK, "get_borderRightWidth: %08x\n", hres);
2186c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "10px"), "expected 10px = %s\n", wine_dbgstr_w(V_BSTR(&v)));
2187c2c66affSColin Finck VariantClear(&v);
2188c2c66affSColin Finck
2189c2c66affSColin Finck hres = IHTMLStyle_put_borderRightWidth(style, vDefault);
2190c2c66affSColin Finck ok(hres == S_OK, "put_borderRightWidth: %08x\n", hres);
2191c2c66affSColin Finck VariantClear(&vDefault);
2192c2c66affSColin Finck
2193c2c66affSColin Finck /* borderBottomWidth */
2194c2c66affSColin Finck hres = IHTMLStyle_get_borderBottomWidth(style, &vDefault);
2195c2c66affSColin Finck ok(hres == S_OK, "get_borderBottomWidth: %08x\n", hres);
2196c2c66affSColin Finck
2197c2c66affSColin Finck V_VT(&v) = VT_BSTR;
2198c2c66affSColin Finck V_BSTR(&v) = a2bstr("10");
2199c2c66affSColin Finck hres = IHTMLStyle_put_borderBottomWidth(style, v);
2200c2c66affSColin Finck ok(hres == S_OK, "put_borderBottomWidth: %08x\n", hres);
2201c2c66affSColin Finck VariantClear(&v);
2202c2c66affSColin Finck
2203c2c66affSColin Finck hres = IHTMLStyle_get_borderBottomWidth(style, &v);
2204c2c66affSColin Finck ok(hres == S_OK, "get_borderBottomWidth: %08x\n", hres);
2205c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "10px"), "expected 10px = %s\n", wine_dbgstr_w(V_BSTR(&v)));
2206c2c66affSColin Finck VariantClear(&v);
2207c2c66affSColin Finck
2208c2c66affSColin Finck hres = IHTMLStyle_put_borderBottomWidth(style, vDefault);
2209c2c66affSColin Finck ok(hres == S_OK, "put_borderBottomWidth: %08x\n", hres);
2210c2c66affSColin Finck VariantClear(&vDefault);
2211c2c66affSColin Finck
2212c2c66affSColin Finck /* borderLeftWidth */
2213c2c66affSColin Finck hres = IHTMLStyle_get_borderLeftWidth(style, &vDefault);
2214c2c66affSColin Finck ok(hres == S_OK, "get_borderLeftWidth: %08x\n", hres);
2215c2c66affSColin Finck
2216c2c66affSColin Finck V_VT(&v) = VT_BSTR;
2217c2c66affSColin Finck V_BSTR(&v) = a2bstr("10");
2218c2c66affSColin Finck hres = IHTMLStyle_put_borderLeftWidth(style, v);
2219c2c66affSColin Finck ok(hres == S_OK, "put_borderLeftWidth: %08x\n", hres);
2220c2c66affSColin Finck VariantClear(&v);
2221c2c66affSColin Finck
2222c2c66affSColin Finck hres = IHTMLStyle_get_borderLeftWidth(style, &v);
2223c2c66affSColin Finck ok(hres == S_OK, "get_borderLeftWidth: %08x\n", hres);
2224c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "10px"), "expected 10px = %s\n", wine_dbgstr_w(V_BSTR(&v)));
2225c2c66affSColin Finck VariantClear(&v);
2226c2c66affSColin Finck
2227c2c66affSColin Finck hres = IHTMLStyle_put_borderLeftWidth(style, vDefault);
2228c2c66affSColin Finck ok(hres == S_OK, "put_borderLeftWidth: %08x\n", hres);
2229c2c66affSColin Finck VariantClear(&vDefault);
2230c2c66affSColin Finck
2231c2c66affSColin Finck /* wordSpacing */
2232c2c66affSColin Finck hres = IHTMLStyle_get_wordSpacing(style, &vDefault);
2233c2c66affSColin Finck ok(hres == S_OK, "get_wordSpacing: %08x\n", hres);
2234c2c66affSColin Finck
2235c2c66affSColin Finck V_VT(&v) = VT_BSTR;
2236c2c66affSColin Finck V_BSTR(&v) = a2bstr("10");
2237c2c66affSColin Finck hres = IHTMLStyle_put_wordSpacing(style, v);
2238c2c66affSColin Finck ok(hres == S_OK, "put_wordSpacing: %08x\n", hres);
2239c2c66affSColin Finck VariantClear(&v);
2240c2c66affSColin Finck
2241c2c66affSColin Finck hres = IHTMLStyle_get_wordSpacing(style, &v);
2242c2c66affSColin Finck ok(hres == S_OK, "get_wordSpacing: %08x\n", hres);
2243c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
2244c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "10px"), "expected 10px = %s\n", wine_dbgstr_w(V_BSTR(&v)));
2245c2c66affSColin Finck VariantClear(&v);
2246c2c66affSColin Finck
2247c2c66affSColin Finck hres = IHTMLStyle_put_wordSpacing(style, vDefault);
2248c2c66affSColin Finck ok(hres == S_OK, "put_wordSpacing: %08x\n", hres);
2249c2c66affSColin Finck VariantClear(&vDefault);
2250c2c66affSColin Finck
2251c2c66affSColin Finck /* letterSpacing */
2252c2c66affSColin Finck hres = IHTMLStyle_get_letterSpacing(style, &vDefault);
2253c2c66affSColin Finck ok(hres == S_OK, "get_letterSpacing: %08x\n", hres);
2254c2c66affSColin Finck
2255c2c66affSColin Finck V_VT(&v) = VT_BSTR;
2256c2c66affSColin Finck V_BSTR(&v) = a2bstr("11");
2257c2c66affSColin Finck hres = IHTMLStyle_put_letterSpacing(style, v);
2258c2c66affSColin Finck ok(hres == S_OK, "put_letterSpacing: %08x\n", hres);
2259c2c66affSColin Finck VariantClear(&v);
2260c2c66affSColin Finck
2261c2c66affSColin Finck hres = IHTMLStyle_get_letterSpacing(style, &v);
2262c2c66affSColin Finck ok(hres == S_OK, "get_letterSpacing: %08x\n", hres);
2263c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
2264c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "11px"), "expected 10px = %s\n", wine_dbgstr_w(V_BSTR(&v)));
2265c2c66affSColin Finck VariantClear(&v);
2266c2c66affSColin Finck
2267c2c66affSColin Finck hres = IHTMLStyle_put_letterSpacing(style, vDefault);
2268c2c66affSColin Finck ok(hres == S_OK, "put_letterSpacing: %08x\n", hres);
2269c2c66affSColin Finck VariantClear(&vDefault);
2270c2c66affSColin Finck
2271c2c66affSColin Finck /* borderTopColor */
2272c2c66affSColin Finck hres = IHTMLStyle_get_borderTopColor(style, &vDefault);
2273c2c66affSColin Finck ok(hres == S_OK, "get_borderTopColor: %08x\n", hres);
2274c2c66affSColin Finck
2275c2c66affSColin Finck V_VT(&v) = VT_BSTR;
2276c2c66affSColin Finck V_BSTR(&v) = a2bstr("red");
2277c2c66affSColin Finck hres = IHTMLStyle_put_borderTopColor(style, v);
2278c2c66affSColin Finck ok(hres == S_OK, "put_borderTopColor: %08x\n", hres);
2279c2c66affSColin Finck VariantClear(&v);
2280c2c66affSColin Finck
2281c2c66affSColin Finck hres = IHTMLStyle_get_borderTopColor(style, &v);
2282c2c66affSColin Finck ok(hres == S_OK, "get_borderTopColor: %08x\n", hres);
2283c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "red"), "expecte red = %s\n", wine_dbgstr_w(V_BSTR(&v)));
2284c2c66affSColin Finck VariantClear(&v);
2285c2c66affSColin Finck
2286c2c66affSColin Finck hres = IHTMLStyle_put_borderTopColor(style, vDefault);
2287c2c66affSColin Finck ok(hres == S_OK, "put_borderTopColor: %08x\n", hres);
2288c2c66affSColin Finck
2289c2c66affSColin Finck /* borderRightColor */
2290c2c66affSColin Finck hres = IHTMLStyle_get_borderRightColor(style, &vDefault);
2291c2c66affSColin Finck ok(hres == S_OK, "get_borderRightColor: %08x\n", hres);
2292c2c66affSColin Finck
2293c2c66affSColin Finck V_VT(&v) = VT_BSTR;
2294c2c66affSColin Finck V_BSTR(&v) = a2bstr("blue");
2295c2c66affSColin Finck hres = IHTMLStyle_put_borderRightColor(style, v);
2296c2c66affSColin Finck ok(hres == S_OK, "put_borderRightColor: %08x\n", hres);
2297c2c66affSColin Finck VariantClear(&v);
2298c2c66affSColin Finck
2299c2c66affSColin Finck hres = IHTMLStyle_get_borderRightColor(style, &v);
2300c2c66affSColin Finck ok(hres == S_OK, "get_borderRightColor: %08x\n", hres);
2301c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "blue"), "expected blue = %s\n", wine_dbgstr_w(V_BSTR(&v)));
2302c2c66affSColin Finck VariantClear(&v);
2303c2c66affSColin Finck
2304c2c66affSColin Finck hres = IHTMLStyle_put_borderRightColor(style, vDefault);
2305c2c66affSColin Finck ok(hres == S_OK, "putborderRightColorr: %08x\n", hres);
2306c2c66affSColin Finck
2307c2c66affSColin Finck /* borderBottomColor */
2308c2c66affSColin Finck hres = IHTMLStyle_get_borderBottomColor(style, &vDefault);
2309c2c66affSColin Finck ok(hres == S_OK, "get_borderBottomColor: %08x\n", hres);
2310c2c66affSColin Finck
2311c2c66affSColin Finck V_VT(&v) = VT_BSTR;
2312c2c66affSColin Finck V_BSTR(&v) = a2bstr("cyan");
2313c2c66affSColin Finck hres = IHTMLStyle_put_borderBottomColor(style, v);
2314c2c66affSColin Finck ok(hres == S_OK, "put_borderBottomColor: %08x\n", hres);
2315c2c66affSColin Finck VariantClear(&v);
2316c2c66affSColin Finck
2317c2c66affSColin Finck hres = IHTMLStyle_get_borderBottomColor(style, &v);
2318c2c66affSColin Finck ok(hres == S_OK, "get_borderBottomColor: %08x\n", hres);
2319c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "cyan"), "expected cyan = %s\n", wine_dbgstr_w(V_BSTR(&v)));
2320c2c66affSColin Finck VariantClear(&v);
2321c2c66affSColin Finck
2322c2c66affSColin Finck hres = IHTMLStyle_put_borderBottomColor(style, vDefault);
2323c2c66affSColin Finck ok(hres == S_OK, "put_borderBottomColor: %08x\n", hres);
2324c2c66affSColin Finck
2325c2c66affSColin Finck /* borderLeftColor */
2326c2c66affSColin Finck hres = IHTMLStyle_get_borderLeftColor(style, &vDefault);
2327c2c66affSColin Finck ok(hres == S_OK, "get_borderLeftColor: %08x\n", hres);
2328c2c66affSColin Finck
2329c2c66affSColin Finck V_VT(&v) = VT_BSTR;
2330c2c66affSColin Finck V_BSTR(&v) = a2bstr("cyan");
2331c2c66affSColin Finck hres = IHTMLStyle_put_borderLeftColor(style, v);
2332c2c66affSColin Finck ok(hres == S_OK, "put_borderLeftColor: %08x\n", hres);
2333c2c66affSColin Finck VariantClear(&v);
2334c2c66affSColin Finck
2335c2c66affSColin Finck hres = IHTMLStyle_get_borderLeftColor(style, &v);
2336c2c66affSColin Finck ok(hres == S_OK, "get_borderLeftColor: %08x\n", hres);
2337c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "cyan"), "expected cyan = %s\n", wine_dbgstr_w(V_BSTR(&v)));
2338c2c66affSColin Finck VariantClear(&v);
2339c2c66affSColin Finck
2340c2c66affSColin Finck hres = IHTMLStyle_put_borderLeftColor(style, vDefault);
2341c2c66affSColin Finck ok(hres == S_OK, "put_borderLeftColor: %08x\n", hres);
2342c2c66affSColin Finck
2343c2c66affSColin Finck /* clip */
2344c2c66affSColin Finck hres = IHTMLStyle_get_clip(style, &str);
2345c2c66affSColin Finck ok(hres == S_OK, "get_clip failed: %08x\n", hres);
2346c2c66affSColin Finck ok(!str, "clip = %s\n", wine_dbgstr_w(str));
2347c2c66affSColin Finck
2348c2c66affSColin Finck str = a2bstr("rect(0px 1px 500px 505px)");
2349c2c66affSColin Finck hres = IHTMLStyle_put_clip(style, str);
2350c2c66affSColin Finck ok(hres == S_OK, "put_clip failed: %08x\n", hres);
2351c2c66affSColin Finck SysFreeString(str);
2352c2c66affSColin Finck
2353c2c66affSColin Finck hres = IHTMLStyle_get_clip(style, &str);
2354c2c66affSColin Finck ok(hres == S_OK, "get_clip failed: %08x\n", hres);
2355c2c66affSColin Finck ok(!strcmp_wa(str, "rect(0px 1px 500px 505px)"), "clip = %s\n", wine_dbgstr_w(str));
2356c2c66affSColin Finck SysFreeString(str);
2357c2c66affSColin Finck
2358c2c66affSColin Finck /* clear */
2359c2c66affSColin Finck hres = IHTMLStyle_get_clear(style, &str);
2360c2c66affSColin Finck ok(hres == S_OK, "get_clear failed: %08x\n", hres);
2361c2c66affSColin Finck ok(!str, "clear = %s\n", wine_dbgstr_w(str));
2362c2c66affSColin Finck
2363c2c66affSColin Finck str = a2bstr("both");
2364c2c66affSColin Finck hres = IHTMLStyle_put_clear(style, str);
2365c2c66affSColin Finck ok(hres == S_OK, "put_clear failed: %08x\n", hres);
2366c2c66affSColin Finck SysFreeString(str);
2367c2c66affSColin Finck
2368c2c66affSColin Finck hres = IHTMLStyle_get_clear(style, &str);
2369c2c66affSColin Finck ok(hres == S_OK, "get_clear failed: %08x\n", hres);
2370c2c66affSColin Finck ok(!strcmp_wa(str, "both"), "clear = %s\n", wine_dbgstr_w(str));
2371c2c66affSColin Finck SysFreeString(str);
2372c2c66affSColin Finck
2373c2c66affSColin Finck /* pageBreakAfter */
2374c2c66affSColin Finck hres = IHTMLStyle_get_pageBreakAfter(style, &str);
2375c2c66affSColin Finck ok(hres == S_OK, "get_pageBreakAfter failed: %08x\n", hres);
2376c2c66affSColin Finck ok(!str, "pageBreakAfter = %s\n", wine_dbgstr_w(str));
2377c2c66affSColin Finck
2378c2c66affSColin Finck str = a2bstr("always");
2379c2c66affSColin Finck hres = IHTMLStyle_put_pageBreakAfter(style, str);
2380c2c66affSColin Finck ok(hres == S_OK, "put_pageBreakAfter failed: %08x\n", hres);
2381c2c66affSColin Finck SysFreeString(str);
2382c2c66affSColin Finck
2383c2c66affSColin Finck hres = IHTMLStyle_get_pageBreakAfter(style, &str);
2384c2c66affSColin Finck ok(hres == S_OK, "get_pageBreakAfter failed: %08x\n", hres);
2385c2c66affSColin Finck ok(!strcmp_wa(str, "always"), "pageBreakAfter = %s\n", wine_dbgstr_w(str));
2386c2c66affSColin Finck SysFreeString(str);
2387c2c66affSColin Finck
2388c2c66affSColin Finck /* pageBreakBefore */
2389c2c66affSColin Finck hres = IHTMLStyle_get_pageBreakBefore(style, &str);
2390c2c66affSColin Finck ok(hres == S_OK, "get_pageBreakBefore failed: %08x\n", hres);
2391c2c66affSColin Finck ok(!str, "pageBreakBefore = %s\n", wine_dbgstr_w(str));
2392c2c66affSColin Finck
2393c2c66affSColin Finck str = a2bstr("always");
2394c2c66affSColin Finck hres = IHTMLStyle_put_pageBreakBefore(style, str);
2395c2c66affSColin Finck ok(hres == S_OK, "put_pageBreakBefore failed: %08x\n", hres);
2396c2c66affSColin Finck SysFreeString(str);
2397c2c66affSColin Finck
2398c2c66affSColin Finck hres = IHTMLStyle_get_pageBreakBefore(style, &str);
2399c2c66affSColin Finck ok(hres == S_OK, "get_pageBreakBefore failed: %08x\n", hres);
2400c2c66affSColin Finck ok(!strcmp_wa(str, "always"), "pageBreakBefore = %s\n", wine_dbgstr_w(str));
2401c2c66affSColin Finck SysFreeString(str);
2402c2c66affSColin Finck
2403c2c66affSColin Finck test_style_remove_attribute(style, "pageBreakBefore", VARIANT_TRUE);
2404c2c66affSColin Finck test_style_remove_attribute(style, "pageBreakBefore", VARIANT_FALSE);
2405c2c66affSColin Finck
2406c2c66affSColin Finck hres = IHTMLStyle_get_pageBreakBefore(style, &str);
2407c2c66affSColin Finck ok(hres == S_OK, "get_pageBreakBefore failed: %08x\n", hres);
2408c2c66affSColin Finck ok(!str, "pageBreakBefore = %s\n", wine_dbgstr_w(str));
2409c2c66affSColin Finck
2410c2c66affSColin Finck str = (void*)0xdeadbeef;
2411c2c66affSColin Finck hres = IHTMLStyle_get_whiteSpace(style, &str);
2412c2c66affSColin Finck ok(hres == S_OK, "get_whiteSpace failed: %08x\n", hres);
2413c2c66affSColin Finck ok(!str, "whiteSpace = %s\n", wine_dbgstr_w(str));
2414c2c66affSColin Finck
2415c2c66affSColin Finck str = a2bstr("nowrap");
2416c2c66affSColin Finck hres = IHTMLStyle_put_whiteSpace(style, str);
2417c2c66affSColin Finck SysFreeString(str);
2418c2c66affSColin Finck ok(hres == S_OK, "put_whiteSpace failed: %08x\n", hres);
2419c2c66affSColin Finck
2420c2c66affSColin Finck str = NULL;
2421c2c66affSColin Finck hres = IHTMLStyle_get_whiteSpace(style, &str);
2422c2c66affSColin Finck ok(hres == S_OK, "get_whiteSpace failed: %08x\n", hres);
2423c2c66affSColin Finck ok(!strcmp_wa(str, "nowrap"), "whiteSpace = %s\n", wine_dbgstr_w(str));
2424c2c66affSColin Finck SysFreeString(str);
2425c2c66affSColin Finck
2426c2c66affSColin Finck str = a2bstr("normal");
2427c2c66affSColin Finck hres = IHTMLStyle_put_whiteSpace(style, str);
2428c2c66affSColin Finck SysFreeString(str);
2429c2c66affSColin Finck ok(hres == S_OK, "put_whiteSpace failed: %08x\n", hres);
2430c2c66affSColin Finck
2431c2c66affSColin Finck str = NULL;
2432c2c66affSColin Finck hres = IHTMLStyle_get_whiteSpace(style, &str);
2433c2c66affSColin Finck ok(hres == S_OK, "get_whiteSpace failed: %08x\n", hres);
2434c2c66affSColin Finck ok(!strcmp_wa(str, "normal"), "whiteSpace = %s\n", wine_dbgstr_w(str));
2435c2c66affSColin Finck SysFreeString(str);
2436c2c66affSColin Finck
2437c2c66affSColin Finck /* listStyleType */
2438c2c66affSColin Finck hres = IHTMLStyle_get_listStyleType(style, &str);
2439c2c66affSColin Finck ok(hres == S_OK, "get_listStyleType failed: %08x\n", hres);
2440c2c66affSColin Finck ok(!str, "listStyleType = %s\n", wine_dbgstr_w(str));
2441c2c66affSColin Finck
2442c2c66affSColin Finck str = a2bstr("square");
2443c2c66affSColin Finck hres = IHTMLStyle_put_listStyleType(style, str);
2444c2c66affSColin Finck ok(hres == S_OK, "put_listStyleType failed: %08x\n", hres);
2445c2c66affSColin Finck SysFreeString(str);
2446c2c66affSColin Finck
2447c2c66affSColin Finck str = NULL;
2448c2c66affSColin Finck hres = IHTMLStyle_get_listStyleType(style, &str);
2449c2c66affSColin Finck ok(hres == S_OK, "get_listStyleType failed: %08x\n", hres);
2450c2c66affSColin Finck ok(!strcmp_wa(str, "square"), "listStyleType = %s\n", wine_dbgstr_w(str));
2451c2c66affSColin Finck
2452c2c66affSColin Finck str = a2bstr("inside");
2453c2c66affSColin Finck hres = IHTMLStyle_put_listStylePosition(style, str);
2454c2c66affSColin Finck ok(hres == S_OK, "put_listStylePosition failed: %08x\n", hres);
2455c2c66affSColin Finck SysFreeString(str);
2456c2c66affSColin Finck
2457c2c66affSColin Finck hres = IHTMLStyle_get_listStylePosition(style, &str);
2458c2c66affSColin Finck ok(hres == S_OK, "get_listStylePosition failed: %08x\n", hres);
2459c2c66affSColin Finck ok(!strcmp_wa(str, "inside"), "listStyleType = %s\n", wine_dbgstr_w(str));
2460c2c66affSColin Finck SysFreeString(str);
2461c2c66affSColin Finck
2462c2c66affSColin Finck str = a2bstr("decimal-leading-zero none inside");
2463c2c66affSColin Finck hres = IHTMLStyle_put_listStyle(style, str);
2464c2c66affSColin Finck ok(hres == S_OK || broken(hres == E_INVALIDARG), /* win 2000 */
2465c2c66affSColin Finck "put_listStyle(%s) failed: %08x\n", wine_dbgstr_w(str), hres);
2466c2c66affSColin Finck SysFreeString(str);
2467c2c66affSColin Finck
2468c2c66affSColin Finck if (hres != E_INVALIDARG) {
2469c2c66affSColin Finck hres = IHTMLStyle_get_listStyle(style, &str);
2470c2c66affSColin Finck ok(hres == S_OK, "get_listStyle failed: %08x\n", hres);
2471c2c66affSColin Finck ok(strstr_wa(str, "decimal-leading-zero") &&
2472c2c66affSColin Finck strstr_wa(str, "none") != NULL &&
2473c2c66affSColin Finck strstr_wa(str, "inside") != NULL,
2474c2c66affSColin Finck "listStyle = %s\n", wine_dbgstr_w(str));
2475c2c66affSColin Finck SysFreeString(str);
2476c2c66affSColin Finck } else {
2477c2c66affSColin Finck win_skip("IHTMLStyle_put_listStyle already failed\n");
2478c2c66affSColin Finck }
2479c2c66affSColin Finck
2480c2c66affSColin Finck str = (void*)0xdeadbeef;
2481c2c66affSColin Finck hres = IHTMLStyle_get_styleFloat(style, &str);
2482c2c66affSColin Finck ok(hres == S_OK, "get_styleFloat failed: %08x\n", hres);
2483c2c66affSColin Finck ok(!str, "styleFloat = %s\n", wine_dbgstr_w(str));
2484c2c66affSColin Finck
2485c2c66affSColin Finck str = a2bstr("left");
2486c2c66affSColin Finck hres = IHTMLStyle_put_styleFloat(style, str);
2487c2c66affSColin Finck ok(hres == S_OK, "put_styleFloat failed: %08x\n", hres);
2488c2c66affSColin Finck SysFreeString(str);
2489c2c66affSColin Finck
2490c2c66affSColin Finck str = NULL;
2491c2c66affSColin Finck hres = IHTMLStyle_get_styleFloat(style, &str);
2492c2c66affSColin Finck ok(hres == S_OK, "get_styleFloat failed: %08x\n", hres);
2493c2c66affSColin Finck ok(!strcmp_wa(str, "left"), "styleFloat = %s\n", wine_dbgstr_w(str));
2494c2c66affSColin Finck
2495c2c66affSColin Finck hres = IHTMLStyle_QueryInterface(style, &IID_IHTMLStyle2, (void**)&style2);
2496c2c66affSColin Finck ok(hres == S_OK, "Could not get IHTMLStyle2 iface: %08x\n", hres);
2497c2c66affSColin Finck if(SUCCEEDED(hres)) {
2498c2c66affSColin Finck test_style2(style2);
2499c2c66affSColin Finck IHTMLStyle2_Release(style2);
2500c2c66affSColin Finck }
2501c2c66affSColin Finck
2502c2c66affSColin Finck hres = IHTMLStyle_QueryInterface(style, &IID_IHTMLStyle3, (void**)&style3);
2503c2c66affSColin Finck ok(hres == S_OK, "Could not get IHTMLStyle3 iface: %08x\n", hres);
2504c2c66affSColin Finck if(SUCCEEDED(hres)) {
2505c2c66affSColin Finck test_style3(style3);
2506c2c66affSColin Finck IHTMLStyle3_Release(style3);
2507c2c66affSColin Finck }
2508c2c66affSColin Finck
2509c2c66affSColin Finck hres = IHTMLStyle_QueryInterface(style, &IID_IHTMLStyle4, (void**)&style4);
2510c2c66affSColin Finck ok(hres == S_OK, "Could not get IHTMLStyle4 iface: %08x\n", hres);
2511c2c66affSColin Finck if(SUCCEEDED(hres)) {
2512c2c66affSColin Finck test_style4(style4);
2513c2c66affSColin Finck IHTMLStyle4_Release(style4);
2514c2c66affSColin Finck }
2515c2c66affSColin Finck
2516c2c66affSColin Finck hres = IHTMLStyle_QueryInterface(style, &IID_IHTMLStyle5, (void**)&style5);
2517c2c66affSColin Finck if(SUCCEEDED(hres)) {
2518c2c66affSColin Finck test_style5(style5);
2519c2c66affSColin Finck IHTMLStyle5_Release(style5);
2520c2c66affSColin Finck }else {
2521c2c66affSColin Finck win_skip("IHTMLStyle5 not available\n");
2522c2c66affSColin Finck }
2523c2c66affSColin Finck
2524c2c66affSColin Finck hres = IHTMLStyle_QueryInterface(style, &IID_IHTMLStyle6, (void**)&style6);
2525c2c66affSColin Finck if(SUCCEEDED(hres)) {
2526c2c66affSColin Finck test_style6(style6);
2527c2c66affSColin Finck IHTMLStyle6_Release(style6);
2528c2c66affSColin Finck }else {
2529c2c66affSColin Finck win_skip("IHTMLStyle6 not available\n");
2530c2c66affSColin Finck }
2531c2c66affSColin Finck }
2532c2c66affSColin Finck
2533c2c66affSColin Finck #define test_style_filter(a,b) _test_style_filter(__LINE__,a,b)
_test_style_filter(unsigned line,IHTMLStyle * style,const char * exval)2534c2c66affSColin Finck static void _test_style_filter(unsigned line, IHTMLStyle *style, const char *exval)
2535c2c66affSColin Finck {
2536c2c66affSColin Finck BSTR str;
2537c2c66affSColin Finck HRESULT hres;
2538c2c66affSColin Finck
2539c2c66affSColin Finck str = (void*)0xdeadbeef;
2540c2c66affSColin Finck hres = IHTMLStyle_get_filter(style, &str);
2541c2c66affSColin Finck ok_(__FILE__,line)(hres == S_OK, "get_filter failed: %08x\n", hres);
2542c2c66affSColin Finck if(exval)
2543c2c66affSColin Finck ok_(__FILE__,line)(str && !strcmp_wa(str, exval), "filter = %s, expected %s\n", wine_dbgstr_w(str), exval);
2544c2c66affSColin Finck else
2545c2c66affSColin Finck ok_(__FILE__,line)(!str, "str = %s, expected NULL\n", wine_dbgstr_w(str));
2546c2c66affSColin Finck
2547c2c66affSColin Finck SysFreeString(str);
2548c2c66affSColin Finck }
2549c2c66affSColin Finck
2550c2c66affSColin Finck #define test_current_style_filter(a,b) _test_current_style_filter(__LINE__,a,b)
_test_current_style_filter(unsigned line,IHTMLCurrentStyle2 * style,const char * exval)2551c2c66affSColin Finck static void _test_current_style_filter(unsigned line, IHTMLCurrentStyle2 *style, const char *exval)
2552c2c66affSColin Finck {
2553c2c66affSColin Finck BSTR str;
2554c2c66affSColin Finck HRESULT hres;
2555c2c66affSColin Finck
2556c2c66affSColin Finck str = (void*)0xdeadbeef;
2557c2c66affSColin Finck hres = IHTMLCurrentStyle2_get_filter(style, &str);
2558c2c66affSColin Finck ok_(__FILE__,line)(hres == S_OK, "get_filter failed: %08x\n", hres);
2559c2c66affSColin Finck if(exval)
2560c2c66affSColin Finck ok_(__FILE__,line)(str && !strcmp_wa(str, exval), "filter = %s, expected %s\n", wine_dbgstr_w(str), exval);
2561c2c66affSColin Finck else
2562c2c66affSColin Finck ok_(__FILE__,line)(!str, "str = %s, expected NULL\n", wine_dbgstr_w(str));
2563c2c66affSColin Finck
2564c2c66affSColin Finck SysFreeString(str);
2565c2c66affSColin Finck }
2566c2c66affSColin Finck
2567c2c66affSColin Finck #define set_style_filter(a,b) _set_style_filter(__LINE__,a,b)
_set_style_filter(unsigned line,IHTMLStyle * style,const char * val)2568c2c66affSColin Finck static void _set_style_filter(unsigned line, IHTMLStyle *style, const char *val)
2569c2c66affSColin Finck {
2570c2c66affSColin Finck BSTR str = a2bstr(val);
2571c2c66affSColin Finck HRESULT hres;
2572c2c66affSColin Finck
2573c2c66affSColin Finck hres = IHTMLStyle_put_filter(style, str);
2574c2c66affSColin Finck ok_(__FILE__,line)(hres == S_OK, "put_filter failed: %08x\n", hres);
2575c2c66affSColin Finck SysFreeString(str);
2576c2c66affSColin Finck
2577c2c66affSColin Finck _test_style_filter(line, style, val);
2578c2c66affSColin Finck }
2579c2c66affSColin Finck
test_style_filters(IHTMLElement * elem)2580c2c66affSColin Finck static void test_style_filters(IHTMLElement *elem)
2581c2c66affSColin Finck {
2582c2c66affSColin Finck IHTMLElement2 *elem2 = get_elem2_iface((IUnknown*)elem);
2583c2c66affSColin Finck IHTMLCurrentStyle2 *current_style2;
2584c2c66affSColin Finck IHTMLCurrentStyle *current_style;
2585c2c66affSColin Finck IHTMLStyle *style;
2586c2c66affSColin Finck HRESULT hres;
2587c2c66affSColin Finck
2588c2c66affSColin Finck hres = IHTMLElement_get_style(elem, &style);
2589c2c66affSColin Finck ok(hres == S_OK, "get_style failed: %08x\n", hres);
2590c2c66affSColin Finck
2591c2c66affSColin Finck hres = IHTMLElement2_get_currentStyle(elem2, ¤t_style);
2592c2c66affSColin Finck ok(hres == S_OK, "get_style failed: %08x\n", hres);
2593c2c66affSColin Finck
2594c2c66affSColin Finck current_style2 = get_current_style2_iface((IUnknown*)current_style);
2595c2c66affSColin Finck
2596c2c66affSColin Finck test_style_filter(style, NULL);
2597c2c66affSColin Finck test_current_style_filter(current_style2, NULL);
2598c2c66affSColin Finck set_style_filter(style, "alpha(opacity=50.0040)");
2599c2c66affSColin Finck test_current_style_filter(current_style2, "alpha(opacity=50.0040)");
2600c2c66affSColin Finck set_style_filter(style, "alpha(opacity=100)");
2601c2c66affSColin Finck
2602c2c66affSColin Finck IHTMLStyle_Release(style);
2603c2c66affSColin Finck
2604c2c66affSColin Finck hres = IHTMLElement_get_style(elem, &style);
2605c2c66affSColin Finck ok(hres == S_OK, "get_style failed: %08x\n", hres);
2606c2c66affSColin Finck
2607c2c66affSColin Finck test_style_filter(style, "alpha(opacity=100)");
2608c2c66affSColin Finck set_style_filter(style, "xxx(a,b,c) alpha(opacity=100)");
2609c2c66affSColin Finck set_style_filter(style, NULL);
2610c2c66affSColin Finck set_style_filter(style, "alpha(opacity=100)");
2611c2c66affSColin Finck test_style_remove_attribute(style, "filter", VARIANT_TRUE);
2612c2c66affSColin Finck test_style_remove_attribute(style, "filter", VARIANT_FALSE);
2613c2c66affSColin Finck test_style_filter(style, NULL);
2614c2c66affSColin Finck
2615c2c66affSColin Finck
2616c2c66affSColin Finck IHTMLCurrentStyle2_Release(current_style2);
2617c2c66affSColin Finck IHTMLStyle_Release(style);
2618c2c66affSColin Finck IHTMLElement2_Release(elem2);
2619c2c66affSColin Finck }
2620c2c66affSColin Finck
test_current_style(IHTMLCurrentStyle * current_style)2621c2c66affSColin Finck static void test_current_style(IHTMLCurrentStyle *current_style)
2622c2c66affSColin Finck {
2623c2c66affSColin Finck IHTMLCurrentStyle2 *current_style2;
2624c2c66affSColin Finck IHTMLCurrentStyle3 *current_style3;
2625c2c66affSColin Finck VARIANT_BOOL b;
2626c2c66affSColin Finck BSTR str;
2627c2c66affSColin Finck HRESULT hres;
2628c2c66affSColin Finck VARIANT v;
2629c2c66affSColin Finck
2630c2c66affSColin Finck hres = IHTMLCurrentStyle_get_display(current_style, &str);
2631c2c66affSColin Finck ok(hres == S_OK, "get_display failed: %08x\n", hres);
2632c2c66affSColin Finck ok(!strcmp_wa(str, "block"), "get_display returned %s\n", wine_dbgstr_w(str));
2633c2c66affSColin Finck SysFreeString(str);
2634c2c66affSColin Finck
2635c2c66affSColin Finck hres = IHTMLCurrentStyle_get_position(current_style, &str);
2636c2c66affSColin Finck ok(hres == S_OK, "get_position failed: %08x\n", hres);
2637c2c66affSColin Finck ok(!strcmp_wa(str, "absolute"), "get_position returned %s\n", wine_dbgstr_w(str));
2638c2c66affSColin Finck SysFreeString(str);
2639c2c66affSColin Finck
2640c2c66affSColin Finck hres = IHTMLCurrentStyle_get_fontFamily(current_style, &str);
2641c2c66affSColin Finck ok(hres == S_OK, "get_fontFamily failed: %08x\n", hres);
2642c2c66affSColin Finck SysFreeString(str);
2643c2c66affSColin Finck
2644c2c66affSColin Finck hres = IHTMLCurrentStyle_get_fontStyle(current_style, &str);
2645c2c66affSColin Finck ok(hres == S_OK, "get_fontStyle failed: %08x\n", hres);
2646c2c66affSColin Finck ok(!strcmp_wa(str, "normal"), "get_fontStyle returned %s\n", wine_dbgstr_w(str));
2647c2c66affSColin Finck SysFreeString(str);
2648c2c66affSColin Finck
2649c2c66affSColin Finck hres = IHTMLCurrentStyle_get_backgroundImage(current_style, &str);
2650c2c66affSColin Finck ok(hres == S_OK, "get_backgroundImage failed: %08x\n", hres);
2651c2c66affSColin Finck ok(!strcmp_wa(str, "none"), "get_backgroundImage returned %s\n", wine_dbgstr_w(str));
2652c2c66affSColin Finck SysFreeString(str);
2653c2c66affSColin Finck
2654c2c66affSColin Finck hres = IHTMLCurrentStyle_get_fontVariant(current_style, &str);
2655c2c66affSColin Finck ok(hres == S_OK, "get_fontVariant failed: %08x\n", hres);
2656c2c66affSColin Finck ok(!strcmp_wa(str, "normal"), "get_fontVariant returned %s\n", wine_dbgstr_w(str));
2657c2c66affSColin Finck SysFreeString(str);
2658c2c66affSColin Finck
2659c2c66affSColin Finck hres = IHTMLCurrentStyle_get_borderTopStyle(current_style, &str);
2660c2c66affSColin Finck ok(hres == S_OK, "get_borderTopStyle failed: %08x\n", hres);
2661c2c66affSColin Finck ok(!strcmp_wa(str, "none"), "get_borderTopStyle returned %s\n", wine_dbgstr_w(str));
2662c2c66affSColin Finck SysFreeString(str);
2663c2c66affSColin Finck
2664c2c66affSColin Finck hres = IHTMLCurrentStyle_get_borderRightStyle(current_style, &str);
2665c2c66affSColin Finck ok(hres == S_OK, "get_borderRightStyle failed: %08x\n", hres);
2666c2c66affSColin Finck ok(!strcmp_wa(str, "none"), "get_borderRightStyle returned %s\n", wine_dbgstr_w(str));
2667c2c66affSColin Finck SysFreeString(str);
2668c2c66affSColin Finck
2669c2c66affSColin Finck hres = IHTMLCurrentStyle_get_borderBottomStyle(current_style, &str);
2670c2c66affSColin Finck ok(hres == S_OK, "get_borderBottomStyle failed: %08x\n", hres);
2671c2c66affSColin Finck ok(!strcmp_wa(str, "none"), "get_borderBottomStyle returned %s\n", wine_dbgstr_w(str));
2672c2c66affSColin Finck SysFreeString(str);
2673c2c66affSColin Finck
2674c2c66affSColin Finck hres = IHTMLCurrentStyle_get_borderLeftStyle(current_style, &str);
2675c2c66affSColin Finck ok(hres == S_OK, "get_borderLeftStyle failed: %08x\n", hres);
2676c2c66affSColin Finck ok(!strcmp_wa(str, "none"), "get_borderLeftStyle returned %s\n", wine_dbgstr_w(str));
2677c2c66affSColin Finck SysFreeString(str);
2678c2c66affSColin Finck
2679c2c66affSColin Finck hres = IHTMLCurrentStyle_get_textAlign(current_style, &str);
2680c2c66affSColin Finck ok(hres == S_OK, "get_textAlign failed: %08x\n", hres);
2681c2c66affSColin Finck ok(!strcmp_wa(str, "center"), "get_textAlign returned %s\n", wine_dbgstr_w(str));
2682c2c66affSColin Finck SysFreeString(str);
2683c2c66affSColin Finck
2684c2c66affSColin Finck hres = IHTMLCurrentStyle_get_textDecoration(current_style, &str);
2685c2c66affSColin Finck ok(hres == S_OK, "get_textDecoration failed: %08x\n", hres);
2686c2c66affSColin Finck ok(!strcmp_wa(str, "none"), "get_textDecoration returned %s\n", wine_dbgstr_w(str));
2687c2c66affSColin Finck SysFreeString(str);
2688c2c66affSColin Finck
2689c2c66affSColin Finck hres = IHTMLCurrentStyle_get_cursor(current_style, &str);
2690c2c66affSColin Finck ok(hres == S_OK, "get_cursor failed: %08x\n", hres);
2691c2c66affSColin Finck ok(!strcmp_wa(str, "default"), "get_cursor returned %s\n", wine_dbgstr_w(str));
2692c2c66affSColin Finck SysFreeString(str);
2693c2c66affSColin Finck
2694c2c66affSColin Finck hres = IHTMLCurrentStyle_get_backgroundRepeat(current_style, &str);
2695c2c66affSColin Finck ok(hres == S_OK, "get_backgroundRepeat failed: %08x\n", hres);
2696c2c66affSColin Finck ok(!strcmp_wa(str, "repeat"), "get_backgroundRepeat returned %s\n", wine_dbgstr_w(str));
2697c2c66affSColin Finck SysFreeString(str);
2698c2c66affSColin Finck
2699c2c66affSColin Finck hres = IHTMLCurrentStyle_get_borderColor(current_style, &str);
2700c2c66affSColin Finck ok(hres == S_OK, "get_borderColor failed: %08x\n", hres);
2701c2c66affSColin Finck SysFreeString(str);
2702c2c66affSColin Finck
2703c2c66affSColin Finck hres = IHTMLCurrentStyle_get_borderStyle(current_style, &str);
2704c2c66affSColin Finck ok(hres == S_OK, "get_borderStyle failed: %08x\n", hres);
2705c2c66affSColin Finck SysFreeString(str);
2706c2c66affSColin Finck
2707c2c66affSColin Finck hres = IHTMLCurrentStyle_get_visibility(current_style, &str);
2708c2c66affSColin Finck ok(hres == S_OK, "get_visibility failed: %08x\n", hres);
2709c2c66affSColin Finck SysFreeString(str);
2710c2c66affSColin Finck
2711c2c66affSColin Finck hres = IHTMLCurrentStyle_get_overflow(current_style, &str);
2712c2c66affSColin Finck ok(hres == S_OK, "get_overflow failed: %08x\n", hres);
2713c2c66affSColin Finck SysFreeString(str);
2714c2c66affSColin Finck
2715c2c66affSColin Finck hres = IHTMLCurrentStyle_get_borderWidth(current_style, &str);
2716c2c66affSColin Finck ok(hres == S_OK, "get_borderWidth failed: %08x\n", hres);
2717c2c66affSColin Finck SysFreeString(str);
2718c2c66affSColin Finck
2719c2c66affSColin Finck hres = IHTMLCurrentStyle_get_margin(current_style, &str);
2720c2c66affSColin Finck ok(hres == S_OK, "get_margin failed: %08x\n", hres);
2721c2c66affSColin Finck SysFreeString(str);
2722c2c66affSColin Finck
2723c2c66affSColin Finck hres = IHTMLCurrentStyle_get_padding(current_style, &str);
2724c2c66affSColin Finck ok(hres == S_OK, "get_padding failed: %08x\n", hres);
2725c2c66affSColin Finck SysFreeString(str);
2726c2c66affSColin Finck
2727c2c66affSColin Finck hres = IHTMLCurrentStyle_get_fontWeight(current_style, &v);
2728c2c66affSColin Finck ok(hres == S_OK, "get_fontWeight failed: %08x\n", hres);
2729c2c66affSColin Finck ok(V_VT(&v) == VT_I4, "V_VT(v) = %d\n", V_VT(&v));
2730c2c66affSColin Finck ok( V_I4(&v) == 400, "expect 400 got (%d)\n", V_I4(&v));
2731c2c66affSColin Finck VariantClear(&v);
2732c2c66affSColin Finck
2733c2c66affSColin Finck hres = IHTMLCurrentStyle_get_fontSize(current_style, &v);
2734c2c66affSColin Finck ok(hres == S_OK, "get_fontSize failed: %08x\n", hres);
2735c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2736c2c66affSColin Finck VariantClear(&v);
2737c2c66affSColin Finck
2738c2c66affSColin Finck hres = IHTMLCurrentStyle_get_left(current_style, &v);
2739c2c66affSColin Finck ok(hres == S_OK, "get_left failed: %08x\n", hres);
2740c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2741c2c66affSColin Finck VariantClear(&v);
2742c2c66affSColin Finck
2743c2c66affSColin Finck hres = IHTMLCurrentStyle_get_top(current_style, &v);
2744c2c66affSColin Finck ok(hres == S_OK, "get_top failed: %08x\n", hres);
2745c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2746c2c66affSColin Finck VariantClear(&v);
2747c2c66affSColin Finck
2748c2c66affSColin Finck hres = IHTMLCurrentStyle_get_width(current_style, &v);
2749c2c66affSColin Finck ok(hres == S_OK, "get_width failed: %08x\n", hres);
2750c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2751c2c66affSColin Finck VariantClear(&v);
2752c2c66affSColin Finck
2753c2c66affSColin Finck hres = IHTMLCurrentStyle_get_height(current_style, &v);
2754c2c66affSColin Finck ok(hres == S_OK, "get_height failed: %08x\n", hres);
2755c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2756c2c66affSColin Finck VariantClear(&v);
2757c2c66affSColin Finck
2758c2c66affSColin Finck hres = IHTMLCurrentStyle_get_paddingLeft(current_style, &v);
2759c2c66affSColin Finck ok(hres == S_OK, "get_paddingLeft failed: %08x\n", hres);
2760c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2761c2c66affSColin Finck VariantClear(&v);
2762c2c66affSColin Finck
2763c2c66affSColin Finck hres = IHTMLCurrentStyle_get_zIndex(current_style, &v);
2764c2c66affSColin Finck ok(hres == S_OK, "get_zIndex failed: %08x\n", hres);
2765c2c66affSColin Finck ok(V_VT(&v) == VT_I4, "V_VT(v) = %d\n", V_VT(&v));
2766c2c66affSColin Finck ok( V_I4(&v) == 1, "expect 1 got (%d)\n", V_I4(&v));
2767c2c66affSColin Finck VariantClear(&v);
2768c2c66affSColin Finck
2769c2c66affSColin Finck hres = IHTMLCurrentStyle_get_verticalAlign(current_style, &v);
2770c2c66affSColin Finck ok(hres == S_OK, "get_verticalAlign failed: %08x\n", hres);
2771c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2772c2c66affSColin Finck ok(!strcmp_wa(V_BSTR(&v), "100px"), "get_verticalAlign returned %s\n", wine_dbgstr_w(V_BSTR(&v)));
2773c2c66affSColin Finck VariantClear(&v);
2774c2c66affSColin Finck
2775c2c66affSColin Finck hres = IHTMLCurrentStyle_get_marginRight(current_style, &v);
2776c2c66affSColin Finck ok(hres == S_OK, "get_marginRight failed: %08x\n", hres);
2777c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2778c2c66affSColin Finck VariantClear(&v);
2779c2c66affSColin Finck
2780c2c66affSColin Finck hres = IHTMLCurrentStyle_get_marginLeft(current_style, &v);
2781c2c66affSColin Finck ok(hres == S_OK, "get_marginLeft failed: %08x\n", hres);
2782c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2783c2c66affSColin Finck VariantClear(&v);
2784c2c66affSColin Finck
2785c2c66affSColin Finck hres = IHTMLCurrentStyle_get_borderLeftWidth(current_style, &v);
2786c2c66affSColin Finck ok(hres == S_OK, "get_borderLeftWidth failed: %08x\n", hres);
2787c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2788c2c66affSColin Finck VariantClear(&v);
2789c2c66affSColin Finck
2790c2c66affSColin Finck V_BSTR(&v) = NULL;
2791c2c66affSColin Finck hres = IHTMLCurrentStyle_get_borderRightWidth(current_style, &v);
2792c2c66affSColin Finck ok(hres == S_OK, "get_borderRightWidth failed: %08x\n", hres);
2793c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2794c2c66affSColin Finck VariantClear(&v);
2795c2c66affSColin Finck
2796c2c66affSColin Finck hres = IHTMLCurrentStyle_get_borderBottomWidth(current_style, &v);
2797c2c66affSColin Finck ok(hres == S_OK, "get_borderBottomWidth failed: %08x\n", hres);
2798c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2799c2c66affSColin Finck VariantClear(&v);
2800c2c66affSColin Finck
2801c2c66affSColin Finck hres = IHTMLCurrentStyle_get_borderTopWidth(current_style, &v);
2802c2c66affSColin Finck ok(hres == S_OK, "get_borderTopWidth failed: %08x\n", hres);
2803c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2804c2c66affSColin Finck VariantClear(&v);
2805c2c66affSColin Finck
2806c2c66affSColin Finck hres = IHTMLCurrentStyle_get_color(current_style, &v);
2807c2c66affSColin Finck ok(hres == S_OK, "get_color failed: %08x\n", hres);
2808c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2809c2c66affSColin Finck VariantClear(&v);
2810c2c66affSColin Finck
2811c2c66affSColin Finck hres = IHTMLCurrentStyle_get_backgroundColor(current_style, &v);
2812c2c66affSColin Finck ok(hres == S_OK, "get_backgroundColor failed: %08x\n", hres);
2813c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2814c2c66affSColin Finck VariantClear(&v);
2815c2c66affSColin Finck
2816c2c66affSColin Finck hres = IHTMLCurrentStyle_get_borderLeftColor(current_style, &v);
2817c2c66affSColin Finck ok(hres == S_OK, "get_borderLeftColor failed: %08x\n", hres);
2818c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2819c2c66affSColin Finck VariantClear(&v);
2820c2c66affSColin Finck
2821c2c66affSColin Finck hres = IHTMLCurrentStyle_get_borderTopColor(current_style, &v);
2822c2c66affSColin Finck ok(hres == S_OK, "get_borderTopColor failed: %08x\n", hres);
2823c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2824c2c66affSColin Finck VariantClear(&v);
2825c2c66affSColin Finck
2826c2c66affSColin Finck hres = IHTMLCurrentStyle_get_borderRightColor(current_style, &v);
2827c2c66affSColin Finck ok(hres == S_OK, "get_borderRightColor failed: %08x\n", hres);
2828c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2829c2c66affSColin Finck VariantClear(&v);
2830c2c66affSColin Finck
2831c2c66affSColin Finck hres = IHTMLCurrentStyle_get_borderBottomColor(current_style, &v);
2832c2c66affSColin Finck ok(hres == S_OK, "get_borderBottomColor failed: %08x\n", hres);
2833c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2834c2c66affSColin Finck VariantClear(&v);
2835c2c66affSColin Finck
2836c2c66affSColin Finck hres = IHTMLCurrentStyle_get_paddingTop(current_style, &v);
2837c2c66affSColin Finck ok(hres == S_OK, "get_paddingTop failed: %08x\n", hres);
2838c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2839c2c66affSColin Finck VariantClear(&v);
2840c2c66affSColin Finck
2841c2c66affSColin Finck hres = IHTMLCurrentStyle_get_paddingRight(current_style, &v);
2842c2c66affSColin Finck ok(hres == S_OK, "get_paddingRight failed: %08x\n", hres);
2843c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2844c2c66affSColin Finck VariantClear(&v);
2845c2c66affSColin Finck
2846c2c66affSColin Finck hres = IHTMLCurrentStyle_get_paddingBottom(current_style, &v);
2847c2c66affSColin Finck ok(hres == S_OK, "get_paddingRight failed: %08x\n", hres);
2848c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2849c2c66affSColin Finck VariantClear(&v);
2850c2c66affSColin Finck
2851c2c66affSColin Finck hres = IHTMLCurrentStyle_get_letterSpacing(current_style, &v);
2852c2c66affSColin Finck ok(hres == S_OK, "get_letterSpacing failed: %08x\n", hres);
2853c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2854c2c66affSColin Finck VariantClear(&v);
2855c2c66affSColin Finck
2856c2c66affSColin Finck hres = IHTMLCurrentStyle_get_marginTop(current_style, &v);
2857c2c66affSColin Finck ok(hres == S_OK, "get_marginTop failed: %08x\n", hres);
2858c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2859c2c66affSColin Finck VariantClear(&v);
2860c2c66affSColin Finck
2861c2c66affSColin Finck hres = IHTMLCurrentStyle_get_marginBottom(current_style, &v);
2862c2c66affSColin Finck ok(hres == S_OK, "get_marginBottom failed: %08x\n", hres);
2863c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2864c2c66affSColin Finck VariantClear(&v);
2865c2c66affSColin Finck
2866c2c66affSColin Finck hres = IHTMLCurrentStyle_get_right(current_style, &v);
2867c2c66affSColin Finck ok(hres == S_OK, "get_Right failed: %08x\n", hres);
2868c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2869c2c66affSColin Finck VariantClear(&v);
2870c2c66affSColin Finck
2871c2c66affSColin Finck hres = IHTMLCurrentStyle_get_bottom(current_style, &v);
2872c2c66affSColin Finck ok(hres == S_OK, "get_bottom failed: %08x\n", hres);
2873c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2874c2c66affSColin Finck VariantClear(&v);
2875c2c66affSColin Finck
2876c2c66affSColin Finck hres = IHTMLCurrentStyle_get_lineHeight(current_style, &v);
2877c2c66affSColin Finck ok(hres == S_OK, "get_lineHeight failed: %08x\n", hres);
2878c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2879c2c66affSColin Finck VariantClear(&v);
2880c2c66affSColin Finck
2881c2c66affSColin Finck hres = IHTMLCurrentStyle_get_textIndent(current_style, &v);
2882c2c66affSColin Finck ok(hres == S_OK, "get_textIndent failed: %08x\n", hres);
2883c2c66affSColin Finck ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2884c2c66affSColin Finck VariantClear(&v);
2885c2c66affSColin Finck
2886c2c66affSColin Finck hres = IHTMLCurrentStyle_get_textTransform(current_style, &str);
2887c2c66affSColin Finck ok(hres == S_OK, "get_textTransform failed: %08x\n", hres);
2888c2c66affSColin Finck SysFreeString(str);
2889c2c66affSColin Finck
2890c2c66affSColin Finck current_style2 = get_current_style2_iface((IUnknown*)current_style);
2891c2c66affSColin Finck
2892c2c66affSColin Finck b = 100;
2893c2c66affSColin Finck hres = IHTMLCurrentStyle2_get_hasLayout(current_style2, &b);
2894c2c66affSColin Finck ok(hres == S_OK, "get_hasLayout failed: %08x\n", hres);
2895c2c66affSColin Finck ok(b == VARIANT_TRUE, "hasLayout = %x\n", b);
2896c2c66affSColin Finck
2897c2c66affSColin Finck IHTMLCurrentStyle2_Release(current_style2);
2898c2c66affSColin Finck
2899c2c66affSColin Finck hres = IHTMLCurrentStyle_QueryInterface(current_style, &IID_IHTMLCurrentStyle3, (void**)¤t_style3);
2900c2c66affSColin Finck ok(hres == S_OK, "Could not get IHTMLCurrentStyle3 iface: %08x\n", hres);
2901c2c66affSColin Finck
2902c2c66affSColin Finck hres = IHTMLCurrentStyle3_get_whiteSpace(current_style3, &str);
2903c2c66affSColin Finck ok(hres == S_OK, "get_whiteSpace failed: %08x\n", hres);
2904c2c66affSColin Finck ok(!strcmp_wa(str, "normal"), "whiteSpace = %s\n", wine_dbgstr_w(str));
2905c2c66affSColin Finck SysFreeString(str);
2906c2c66affSColin Finck
2907c2c66affSColin Finck IHTMLCurrentStyle3_Release(current_style3);
2908c2c66affSColin Finck }
2909c2c66affSColin Finck
2910c2c66affSColin Finck static const char basic_test_str[] = "<html><body><div id=\"divid\"></div/</body></html>";
2911c2c66affSColin Finck
basic_style_test(IHTMLDocument2 * doc)2912c2c66affSColin Finck static void basic_style_test(IHTMLDocument2 *doc)
2913c2c66affSColin Finck {
2914c2c66affSColin Finck IHTMLCurrentStyle *cstyle;
2915c2c66affSColin Finck IHTMLElement *elem;
2916c2c66affSColin Finck IHTMLStyle *style;
2917c2c66affSColin Finck HRESULT hres;
2918c2c66affSColin Finck
2919c2c66affSColin Finck hres = IHTMLDocument2_get_body(doc, &elem);
2920c2c66affSColin Finck ok(hres == S_OK, "get_body failed: %08x\n", hres);
2921c2c66affSColin Finck
2922c2c66affSColin Finck hres = IHTMLElement_get_style(elem, &style);
2923c2c66affSColin Finck ok(hres == S_OK, "get_style failed: %08x\n", hres);
2924c2c66affSColin Finck
2925c2c66affSColin Finck test_body_style(style);
2926c2c66affSColin Finck
2927c2c66affSColin Finck cstyle = get_current_style(elem);
2928c2c66affSColin Finck test_current_style(cstyle);
2929c2c66affSColin Finck IHTMLCurrentStyle_Release(cstyle);
2930c2c66affSColin Finck IHTMLElement_Release(elem);
2931c2c66affSColin Finck
2932c2c66affSColin Finck elem = get_element_by_id(doc, "divid");
2933c2c66affSColin Finck test_style_filters(elem);
2934c2c66affSColin Finck
2935c2c66affSColin Finck test_set_csstext(style);
2936c2c66affSColin Finck IHTMLStyle_Release(style);
2937c2c66affSColin Finck IHTMLElement_Release(elem);
2938c2c66affSColin Finck }
2939c2c66affSColin Finck
2940c2c66affSColin Finck static const char runtimestyle_test_str[] =
2941c2c66affSColin Finck "<html><head><style>body {text-decoration: auto}</style></head><body></body></html>";
2942c2c66affSColin Finck
runtimestyle_test(IHTMLDocument2 * doc)2943c2c66affSColin Finck static void runtimestyle_test(IHTMLDocument2 *doc)
2944c2c66affSColin Finck {
2945c2c66affSColin Finck IHTMLStyle *style, *runtime_style;
2946c2c66affSColin Finck IHTMLElement2 *elem2;
2947c2c66affSColin Finck IHTMLElement *elem;
2948c2c66affSColin Finck BSTR str;
2949c2c66affSColin Finck HRESULT hres;
2950c2c66affSColin Finck
2951c2c66affSColin Finck hres = IHTMLDocument2_get_body(doc, &elem);
2952c2c66affSColin Finck ok(hres == S_OK, "get_body failed: %08x\n", hres);
2953c2c66affSColin Finck
2954c2c66affSColin Finck elem2 = get_elem2_iface((IUnknown*)elem);
2955c2c66affSColin Finck
2956c2c66affSColin Finck hres = IHTMLElement2_get_runtimeStyle(elem2, &runtime_style);
2957c2c66affSColin Finck ok(hres == S_OK, "get_runtimeStyle failed: %08x\n", hres);
2958c2c66affSColin Finck
2959c2c66affSColin Finck hres = IHTMLElement_get_style(elem, &style);
2960c2c66affSColin Finck ok(hres == S_OK, "get_style failed: %08x\n", hres);
2961c2c66affSColin Finck
2962c2c66affSColin Finck test_text_decoration(style, NULL);
2963c2c66affSColin Finck test_text_decoration(runtime_style, NULL);
2964c2c66affSColin Finck set_text_decoration(style, "underline");
2965c2c66affSColin Finck test_text_decoration(style, "underline");
2966c2c66affSColin Finck
2967c2c66affSColin Finck hres = IHTMLStyle_get_textDecoration(style, &str);
2968c2c66affSColin Finck ok(hres == S_OK, "get_textDecoration failed: %08x\n", hres);
2969c2c66affSColin Finck ok(broken(!str) || !strcmp_wa(str, "underline"), "textDecoration = %s\n", wine_dbgstr_w(str));
2970c2c66affSColin Finck SysFreeString(str);
2971c2c66affSColin Finck
2972c2c66affSColin Finck set_text_decoration(runtime_style, "blink");
2973c2c66affSColin Finck test_text_decoration(runtime_style, "blink");
2974c2c66affSColin Finck
2975c2c66affSColin Finck hres = IHTMLStyle_get_textDecoration(style, &str);
2976c2c66affSColin Finck ok(hres == S_OK, "get_textDecoration failed: %08x\n", hres);
2977c2c66affSColin Finck todo_wine
2978c2c66affSColin Finck ok(!strcmp_wa(str, "underline"), "textDecoration = %s\n", wine_dbgstr_w(str));
2979c2c66affSColin Finck SysFreeString(str);
2980c2c66affSColin Finck
2981c2c66affSColin Finck IHTMLStyle_Release(runtime_style);
2982c2c66affSColin Finck IHTMLStyle_Release(style);
2983c2c66affSColin Finck IHTMLElement2_Release(elem2);
2984c2c66affSColin Finck IHTMLElement_Release(elem);
2985c2c66affSColin Finck }
2986c2c66affSColin Finck
2987c2c66affSColin Finck static IHTMLDocument2 *notif_doc;
2988c2c66affSColin Finck static BOOL doc_complete;
2989c2c66affSColin Finck
create_document(void)2990c2c66affSColin Finck static IHTMLDocument2 *create_document(void)
2991c2c66affSColin Finck {
2992c2c66affSColin Finck IHTMLDocument2 *doc;
2993c2c66affSColin Finck IHTMLDocument5 *doc5;
2994c2c66affSColin Finck HRESULT hres;
2995c2c66affSColin Finck
2996c2c66affSColin Finck hres = CoCreateInstance(&CLSID_HTMLDocument, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
2997c2c66affSColin Finck &IID_IHTMLDocument2, (void**)&doc);
2998c2c66affSColin Finck ok(hres == S_OK, "CoCreateInstance failed: %08x\n", hres);
2999c2c66affSColin Finck if(FAILED(hres))
3000c2c66affSColin Finck return NULL;
3001c2c66affSColin Finck
3002c2c66affSColin Finck hres = IHTMLDocument2_QueryInterface(doc, &IID_IHTMLDocument5, (void**)&doc5);
3003c2c66affSColin Finck if(FAILED(hres)) {
3004c2c66affSColin Finck win_skip("Could not get IHTMLDocument5, probably too old IE\n");
3005c2c66affSColin Finck IHTMLDocument2_Release(doc);
3006c2c66affSColin Finck return NULL;
3007c2c66affSColin Finck }
3008c2c66affSColin Finck
3009c2c66affSColin Finck IHTMLDocument5_Release(doc5);
3010c2c66affSColin Finck return doc;
3011c2c66affSColin Finck }
3012c2c66affSColin Finck
PropertyNotifySink_QueryInterface(IPropertyNotifySink * iface,REFIID riid,void ** ppv)3013c2c66affSColin Finck static HRESULT WINAPI PropertyNotifySink_QueryInterface(IPropertyNotifySink *iface,
3014c2c66affSColin Finck REFIID riid, void**ppv)
3015c2c66affSColin Finck {
3016c2c66affSColin Finck if(IsEqualGUID(&IID_IPropertyNotifySink, riid)) {
3017c2c66affSColin Finck *ppv = iface;
3018c2c66affSColin Finck return S_OK;
3019c2c66affSColin Finck }
3020c2c66affSColin Finck
3021c2c66affSColin Finck ok(0, "unexpected call\n");
3022c2c66affSColin Finck return E_NOINTERFACE;
3023c2c66affSColin Finck }
3024c2c66affSColin Finck
PropertyNotifySink_AddRef(IPropertyNotifySink * iface)3025c2c66affSColin Finck static ULONG WINAPI PropertyNotifySink_AddRef(IPropertyNotifySink *iface)
3026c2c66affSColin Finck {
3027c2c66affSColin Finck return 2;
3028c2c66affSColin Finck }
3029c2c66affSColin Finck
PropertyNotifySink_Release(IPropertyNotifySink * iface)3030c2c66affSColin Finck static ULONG WINAPI PropertyNotifySink_Release(IPropertyNotifySink *iface)
3031c2c66affSColin Finck {
3032c2c66affSColin Finck return 1;
3033c2c66affSColin Finck }
3034c2c66affSColin Finck
PropertyNotifySink_OnChanged(IPropertyNotifySink * iface,DISPID dispID)3035c2c66affSColin Finck static HRESULT WINAPI PropertyNotifySink_OnChanged(IPropertyNotifySink *iface, DISPID dispID)
3036c2c66affSColin Finck {
3037c2c66affSColin Finck if(dispID == DISPID_READYSTATE){
3038c2c66affSColin Finck BSTR state;
3039c2c66affSColin Finck HRESULT hres;
3040c2c66affSColin Finck
3041c2c66affSColin Finck hres = IHTMLDocument2_get_readyState(notif_doc, &state);
3042c2c66affSColin Finck ok(hres == S_OK, "get_readyState failed: %08x\n", hres);
3043c2c66affSColin Finck
3044c2c66affSColin Finck if(!strcmp_wa(state, "complete"))
3045c2c66affSColin Finck doc_complete = TRUE;
3046c2c66affSColin Finck
3047c2c66affSColin Finck SysFreeString(state);
3048c2c66affSColin Finck }
3049c2c66affSColin Finck
3050c2c66affSColin Finck return S_OK;
3051c2c66affSColin Finck }
3052c2c66affSColin Finck
PropertyNotifySink_OnRequestEdit(IPropertyNotifySink * iface,DISPID dispID)3053c2c66affSColin Finck static HRESULT WINAPI PropertyNotifySink_OnRequestEdit(IPropertyNotifySink *iface, DISPID dispID)
3054c2c66affSColin Finck {
3055c2c66affSColin Finck ok(0, "unexpected call\n");
3056c2c66affSColin Finck return E_NOTIMPL;
3057c2c66affSColin Finck }
3058c2c66affSColin Finck
3059c2c66affSColin Finck static IPropertyNotifySinkVtbl PropertyNotifySinkVtbl = {
3060c2c66affSColin Finck PropertyNotifySink_QueryInterface,
3061c2c66affSColin Finck PropertyNotifySink_AddRef,
3062c2c66affSColin Finck PropertyNotifySink_Release,
3063c2c66affSColin Finck PropertyNotifySink_OnChanged,
3064c2c66affSColin Finck PropertyNotifySink_OnRequestEdit
3065c2c66affSColin Finck };
3066c2c66affSColin Finck
3067c2c66affSColin Finck static IPropertyNotifySink PropertyNotifySink = { &PropertyNotifySinkVtbl };
3068c2c66affSColin Finck
create_doc_with_string(const char * str)3069c2c66affSColin Finck static IHTMLDocument2 *create_doc_with_string(const char *str)
3070c2c66affSColin Finck {
3071c2c66affSColin Finck IPersistStreamInit *init;
3072c2c66affSColin Finck IStream *stream;
3073c2c66affSColin Finck IHTMLDocument2 *doc;
3074c2c66affSColin Finck HGLOBAL mem;
3075c2c66affSColin Finck SIZE_T len;
3076c2c66affSColin Finck
3077c2c66affSColin Finck notif_doc = doc = create_document();
3078c2c66affSColin Finck if(!doc)
3079c2c66affSColin Finck return NULL;
3080c2c66affSColin Finck
3081c2c66affSColin Finck doc_complete = FALSE;
3082c2c66affSColin Finck len = strlen(str);
3083c2c66affSColin Finck mem = GlobalAlloc(0, len);
3084c2c66affSColin Finck memcpy(mem, str, len);
3085c2c66affSColin Finck CreateStreamOnHGlobal(mem, TRUE, &stream);
3086c2c66affSColin Finck
3087c2c66affSColin Finck IHTMLDocument2_QueryInterface(doc, &IID_IPersistStreamInit, (void**)&init);
3088c2c66affSColin Finck
3089c2c66affSColin Finck IPersistStreamInit_Load(init, stream);
3090c2c66affSColin Finck IPersistStreamInit_Release(init);
3091c2c66affSColin Finck IStream_Release(stream);
3092c2c66affSColin Finck
3093c2c66affSColin Finck return doc;
3094c2c66affSColin Finck }
3095c2c66affSColin Finck
do_advise(IUnknown * unk,REFIID riid,IUnknown * unk_advise)3096c2c66affSColin Finck static void do_advise(IUnknown *unk, REFIID riid, IUnknown *unk_advise)
3097c2c66affSColin Finck {
3098c2c66affSColin Finck IConnectionPointContainer *container;
3099c2c66affSColin Finck IConnectionPoint *cp;
3100c2c66affSColin Finck DWORD cookie;
3101c2c66affSColin Finck HRESULT hres;
3102c2c66affSColin Finck
3103c2c66affSColin Finck hres = IUnknown_QueryInterface(unk, &IID_IConnectionPointContainer, (void**)&container);
3104c2c66affSColin Finck ok(hres == S_OK, "QueryInterface(IID_IConnectionPointContainer) failed: %08x\n", hres);
3105c2c66affSColin Finck
3106c2c66affSColin Finck hres = IConnectionPointContainer_FindConnectionPoint(container, riid, &cp);
3107c2c66affSColin Finck IConnectionPointContainer_Release(container);
3108c2c66affSColin Finck ok(hres == S_OK, "FindConnectionPoint failed: %08x\n", hres);
3109c2c66affSColin Finck
3110c2c66affSColin Finck hres = IConnectionPoint_Advise(cp, unk_advise, &cookie);
3111c2c66affSColin Finck IConnectionPoint_Release(cp);
3112c2c66affSColin Finck ok(hres == S_OK, "Advise failed: %08x\n", hres);
3113c2c66affSColin Finck }
3114c2c66affSColin Finck
3115c2c66affSColin Finck typedef void (*style_test_t)(IHTMLDocument2*);
3116c2c66affSColin Finck
run_test(const char * str,style_test_t test)3117c2c66affSColin Finck static void run_test(const char *str, style_test_t test)
3118c2c66affSColin Finck {
3119c2c66affSColin Finck IHTMLDocument2 *doc;
3120c2c66affSColin Finck ULONG ref;
3121c2c66affSColin Finck MSG msg;
3122c2c66affSColin Finck
3123c2c66affSColin Finck doc = create_doc_with_string(str);
3124c2c66affSColin Finck if(!doc)
3125c2c66affSColin Finck return;
3126c2c66affSColin Finck
3127c2c66affSColin Finck do_advise((IUnknown*)doc, &IID_IPropertyNotifySink, (IUnknown*)&PropertyNotifySink);
3128c2c66affSColin Finck
3129c2c66affSColin Finck while(!doc_complete && GetMessageW(&msg, NULL, 0, 0)) {
3130c2c66affSColin Finck TranslateMessage(&msg);
3131c2c66affSColin Finck DispatchMessageW(&msg);
3132c2c66affSColin Finck }
3133c2c66affSColin Finck
3134c2c66affSColin Finck test(doc);
3135c2c66affSColin Finck
3136c2c66affSColin Finck ref = IHTMLDocument2_Release(doc);
3137c2c66affSColin Finck ok(!ref || broken(ref == 1), /* Vista */
3138c2c66affSColin Finck "ref = %d\n", ref);
3139c2c66affSColin Finck }
3140c2c66affSColin Finck
3141c2c66affSColin Finck
START_TEST(style)3142c2c66affSColin Finck START_TEST(style)
3143c2c66affSColin Finck {
3144c2c66affSColin Finck CoInitialize(NULL);
3145c2c66affSColin Finck
3146c2c66affSColin Finck run_test(basic_test_str, basic_style_test);
3147c2c66affSColin Finck run_test(runtimestyle_test_str, runtimestyle_test);
3148c2c66affSColin Finck
3149c2c66affSColin Finck CoUninitialize();
3150c2c66affSColin Finck }
3151