2 * Copyright 2007-2011 Jacek Caban for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #include <wine/test.h>
33 static BOOL is_ie9plus
;
38 } compat_mode
= COMPAT_NONE
;
40 static const char doc_blank
[] =
43 static const char doc_blank_ie9
[] =
47 " <meta http-equiv=\"x-ua-compatible\" content=\"IE=9\" />"
53 static int strcmp_wa(LPCWSTR strw
, const char *stra
)
58 WideCharToMultiByte(CP_ACP
, 0, strw
, -1, buf
, sizeof(buf
), NULL
, NULL
);
59 return lstrcmpA(stra
, buf
);
62 static BOOL
wstr_contains(const WCHAR
*strw
, const char *stra
)
65 WideCharToMultiByte(CP_ACP
, 0, strw
, -1, buf
, sizeof(buf
), NULL
, NULL
);
66 return strstr(buf
, stra
) != NULL
;
69 static BSTR
a2bstr(const char *str
)
77 len
= MultiByteToWideChar(CP_ACP
, 0, str
, -1, NULL
, 0);
78 ret
= SysAllocStringLen(NULL
, len
);
79 MultiByteToWideChar(CP_ACP
, 0, str
, -1, ret
, len
);
84 static const WCHAR
*strstr_wa(const WCHAR
*str
, const char *suba
)
87 const WCHAR
*ret
= NULL
;
91 const WCHAR
*p1
= str
, *p2
= sub
;
92 while (*p1
&& *p2
&& *p1
== *p2
) { p1
++; p2
++; }
93 if (!*p2
) {ret
= str
; break;}
100 #define test_var_bstr(a,b) _test_var_bstr(__LINE__,a,b)
101 static void _test_var_bstr(unsigned line
, const VARIANT
*v
, const char *expect
)
103 ok_(__FILE__
,line
)(V_VT(v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(v
));
105 ok_(__FILE__
,line
)(!strcmp_wa(V_BSTR(v
), expect
), "V_BSTR(v) = %s, expected %s\n", wine_dbgstr_w(V_BSTR(v
)), expect
);
107 ok_(__FILE__
,line
)(!V_BSTR(v
), "V_BSTR(v) = %s, expected NULL\n", wine_dbgstr_w(V_BSTR(v
)));
110 #define get_elem2_iface(u) _get_elem2_iface(__LINE__,u)
111 static IHTMLElement2
*_get_elem2_iface(unsigned line
, IUnknown
*unk
)
116 hres
= IUnknown_QueryInterface(unk
, &IID_IHTMLElement2
, (void**)&elem
);
117 ok_(__FILE__
,line
) (hres
== S_OK
, "Could not get IHTMLElement2: %08x\n", hres
);
121 #define get_current_style2_iface(u) _get_current_style2_iface(__LINE__,u)
122 static IHTMLCurrentStyle2
*_get_current_style2_iface(unsigned line
, IUnknown
*unk
)
124 IHTMLCurrentStyle2
*current_style2
;
127 hres
= IUnknown_QueryInterface(unk
, &IID_IHTMLCurrentStyle2
, (void**)¤t_style2
);
128 ok_(__FILE__
,line
) (hres
== S_OK
, "Could not get IHTMLElement2: %08x\n", hres
);
129 return current_style2
;
132 #define elem_set_innerhtml(e,t) _elem_set_innerhtml(__LINE__,e,t)
133 static void _elem_set_innerhtml(unsigned line
, IHTMLElement
*elem
, const char *inner_html
)
138 html
= a2bstr(inner_html
);
139 hres
= IHTMLElement_put_innerHTML(elem
, html
);
140 ok_(__FILE__
,line
)(hres
== S_OK
, "put_innerHTML failed: %08x\n", hres
);
144 static IHTMLElement
*get_element_by_id(IHTMLDocument2
*doc
, const char *id
)
147 IHTMLDocument3
*doc3
;
148 IHTMLElement
*result
;
149 BSTR idW
= a2bstr(id
);
151 hres
= IHTMLDocument2_QueryInterface(doc
, &IID_IHTMLDocument3
, (void**)&doc3
);
152 ok(hres
== S_OK
, "QueryInterface(IID_IHTMLDocument3) failed: %08x\n", hres
);
154 hres
= IHTMLDocument3_getElementById(doc3
, idW
, &result
);
155 ok(hres
== S_OK
, "getElementById failed: %08x\n", hres
);
156 ok(result
!= NULL
, "result == NULL\n");
159 IHTMLDocument3_Release(doc3
);
163 #define get_current_style(e) _get_current_style(__LINE__,e)
164 static IHTMLCurrentStyle
*_get_current_style(unsigned line
, IHTMLElement
*elem
)
166 IHTMLCurrentStyle
*cstyle
;
167 IHTMLElement2
*elem2
;
170 hres
= IHTMLElement_QueryInterface(elem
, &IID_IHTMLElement2
, (void**)&elem2
);
171 ok(hres
== S_OK
, "Could not get IHTMLElement2 iface: %08x\n", hres
);
174 hres
= IHTMLElement2_get_currentStyle(elem2
, &cstyle
);
175 ok(hres
== S_OK
, "get_currentStyle failed: %08x\n", hres
);
176 ok(cstyle
!= NULL
, "cstyle = %p\n", cstyle
);
178 IHTMLElement2_Release(elem2
);
182 #define test_border_styles(p, n) _test_border_styles(__LINE__, p, n)
183 static void _test_border_styles(unsigned line
, IHTMLStyle
*pStyle
, BSTR Name
)
188 hres
= IHTMLStyle_GetIDsOfNames(pStyle
, &IID_NULL
, &Name
, 1,
189 LOCALE_USER_DEFAULT
, &dispid
);
190 ok_(__FILE__
,line
) (hres
== S_OK
, "GetIDsOfNames: %08x\n", hres
);
193 DISPPARAMS params
= {NULL
,NULL
,0,0};
194 DISPID dispidNamed
= DISPID_PROPERTYPUT
;
199 hres
= IHTMLStyle_Invoke(pStyle
, dispid
, &IID_NULL
, LOCALE_SYSTEM_DEFAULT
,
200 DISPATCH_PROPERTYGET
, ¶ms
, &vDefault
, NULL
, NULL
);
201 ok_(__FILE__
,line
) (hres
== S_OK
, "get_default. ret: %08x\n", hres
);
204 params
.cNamedArgs
= 1;
205 params
.rgdispidNamedArgs
= &dispidNamed
;
206 V_VT(&arg
) = VT_BSTR
;
207 V_BSTR(&arg
) = a2bstr("none");
208 params
.rgvarg
= &arg
;
209 hres
= IHTMLStyle_Invoke(pStyle
, dispid
, &IID_NULL
, LOCALE_SYSTEM_DEFAULT
,
210 DISPATCH_PROPERTYPUT
, ¶ms
, &ret
, NULL
, NULL
);
211 ok_(__FILE__
,line
) (hres
== S_OK
, "none. ret: %08x\n", hres
);
214 V_VT(&arg
) = VT_BSTR
;
215 V_BSTR(&arg
) = a2bstr("dotted");
216 hres
= IHTMLStyle_Invoke(pStyle
, dispid
, &IID_NULL
, LOCALE_SYSTEM_DEFAULT
,
217 DISPATCH_PROPERTYPUT
, ¶ms
, &ret
, NULL
, NULL
);
218 ok_(__FILE__
,line
) (hres
== S_OK
, "dotted. ret: %08x\n", hres
);
221 V_VT(&arg
) = VT_BSTR
;
222 V_BSTR(&arg
) = a2bstr("dashed");
223 hres
= IHTMLStyle_Invoke(pStyle
, dispid
, &IID_NULL
, LOCALE_SYSTEM_DEFAULT
,
224 DISPATCH_PROPERTYPUT
, ¶ms
, &ret
, NULL
, NULL
);
225 ok_(__FILE__
,line
) (hres
== S_OK
, "dashed. ret: %08x\n", hres
);
228 V_VT(&arg
) = VT_BSTR
;
229 V_BSTR(&arg
) = a2bstr("solid");
230 hres
= IHTMLStyle_Invoke(pStyle
, dispid
, &IID_NULL
, LOCALE_SYSTEM_DEFAULT
,
231 DISPATCH_PROPERTYPUT
, ¶ms
, &ret
, NULL
, NULL
);
232 ok_(__FILE__
,line
) (hres
== S_OK
, "solid. ret: %08x\n", hres
);
235 V_VT(&arg
) = VT_BSTR
;
236 V_BSTR(&arg
) = a2bstr("double");
237 hres
= IHTMLStyle_Invoke(pStyle
, dispid
, &IID_NULL
, LOCALE_SYSTEM_DEFAULT
,
238 DISPATCH_PROPERTYPUT
, ¶ms
, &ret
, NULL
, NULL
);
239 ok_(__FILE__
,line
) (hres
== S_OK
, "double. ret: %08x\n", hres
);
242 V_VT(&arg
) = VT_BSTR
;
243 V_BSTR(&arg
) = a2bstr("groove");
244 hres
= IHTMLStyle_Invoke(pStyle
, dispid
, &IID_NULL
, LOCALE_SYSTEM_DEFAULT
,
245 DISPATCH_PROPERTYPUT
, ¶ms
, &ret
, NULL
, NULL
);
246 ok_(__FILE__
,line
) (hres
== S_OK
, "groove. ret: %08x\n", hres
);
249 V_VT(&arg
) = VT_BSTR
;
250 V_BSTR(&arg
) = a2bstr("ridge");
251 hres
= IHTMLStyle_Invoke(pStyle
, dispid
, &IID_NULL
, LOCALE_SYSTEM_DEFAULT
,
252 DISPATCH_PROPERTYPUT
, ¶ms
, &ret
, NULL
, NULL
);
253 ok_(__FILE__
,line
) (hres
== S_OK
, "ridge. ret: %08x\n", hres
);
256 V_VT(&arg
) = VT_BSTR
;
257 V_BSTR(&arg
) = a2bstr("inset");
258 hres
= IHTMLStyle_Invoke(pStyle
, dispid
, &IID_NULL
, LOCALE_SYSTEM_DEFAULT
,
259 DISPATCH_PROPERTYPUT
, ¶ms
, &ret
, NULL
, NULL
);
260 ok_(__FILE__
,line
) (hres
== S_OK
, "inset. ret: %08x\n", hres
);
263 V_VT(&arg
) = VT_BSTR
;
264 V_BSTR(&arg
) = a2bstr("outset");
265 hres
= IHTMLStyle_Invoke(pStyle
, dispid
, &IID_NULL
, LOCALE_SYSTEM_DEFAULT
,
266 DISPATCH_PROPERTYPUT
, ¶ms
, &ret
, NULL
, NULL
);
267 ok_(__FILE__
,line
) (hres
== S_OK
, "outset. ret: %08x\n", hres
);
270 V_VT(&arg
) = VT_BSTR
;
271 V_BSTR(&arg
) = a2bstr("invalid");
272 hres
= IHTMLStyle_Invoke(pStyle
, dispid
, &IID_NULL
, LOCALE_SYSTEM_DEFAULT
,
273 DISPATCH_PROPERTYPUT
, ¶ms
, &ret
, NULL
, NULL
);
274 if(compat_mode
< COMPAT_IE9
)
275 ok_(__FILE__
,line
) (FAILED(hres
), "invalid value passed.\n");
277 ok_(__FILE__
,line
) (hres
== S_OK
, "invalid value returned: %08x\n", hres
);
280 params
.rgvarg
= &vDefault
;
281 hres
= IHTMLStyle_Invoke(pStyle
, dispid
, &IID_NULL
, LOCALE_SYSTEM_DEFAULT
,
282 DISPATCH_PROPERTYPUT
, ¶ms
, &ret
, NULL
, NULL
);
283 ok_(__FILE__
,line
) (hres
== S_OK
, "default. ret: %08x\n", hres
);
284 VariantClear(&vDefault
);
288 #define test_style_csstext(s,t) _test_style_csstext(__LINE__,s,t)
289 static void _test_style_csstext(unsigned line
, IHTMLStyle
*style
, const char *extext
)
291 BSTR text
= (void*)0xdeadbeef;
294 hres
= IHTMLStyle_get_cssText(style
, &text
);
295 ok_(__FILE__
,line
)(hres
== S_OK
, "get_cssText failed: %08x\n", hres
);
297 ok_(__FILE__
,line
)(!strcmp_wa(text
, extext
), "cssText = %s\n", wine_dbgstr_w(text
));
299 ok_(__FILE__
,line
)(!text
, "cssText = %s\n", wine_dbgstr_w(text
));
304 #define test_style_set_csstext(s,t) _test_style_set_csstext(__LINE__,s,t)
305 static void _test_style_set_csstext(unsigned line
, IHTMLStyle
*style
, const char *text
)
311 hres
= IHTMLStyle_put_cssText(style
, tmp
);
312 ok_(__FILE__
,line
)(hres
== S_OK
, "put_cssText failed: %08x\n", hres
);
316 #define test_style_remove_attribute(a,b,c) _test_style_remove_attribute(__LINE__,a,b,c)
317 static void _test_style_remove_attribute(unsigned line
, IHTMLStyle
*style
, const char *attr
, VARIANT_BOOL exb
)
319 BSTR str
= a2bstr(attr
);
320 VARIANT_BOOL b
= 100;
323 hres
= IHTMLStyle_removeAttribute(style
, str
, 1, &b
);
325 ok_(__FILE__
,line
)(hres
== S_OK
, "removeAttribute failed: %08x\n", hres
);
326 ok_(__FILE__
,line
)(b
== exb
, "removeAttribute returned %x, expected %x\n", b
, exb
);
329 #define set_text_decoration(a,b) _set_text_decoration(__LINE__,a,b)
330 static void _set_text_decoration(unsigned line
, IHTMLStyle
*style
, const char *v
)
336 hres
= IHTMLStyle_put_textDecoration(style
, str
);
337 ok_(__FILE__
,line
)(hres
== S_OK
, "put_textDecoration failed: %08x\n", hres
);
341 #define test_text_decoration(a,b) _test_text_decoration(__LINE__,a,b)
342 static void _test_text_decoration(unsigned line
, IHTMLStyle
*style
, const char *exdec
)
347 hres
= IHTMLStyle_get_textDecoration(style
, &str
);
348 ok_(__FILE__
,line
)(hres
== S_OK
, "get_textDecoration failed: %08x\n", hres
);
350 ok_(__FILE__
,line
)(!strcmp_wa(str
, exdec
), "textDecoration = %s, expected %s\n", wine_dbgstr_w(str
), exdec
);
352 ok_(__FILE__
,line
)(!str
, "textDecoration = %s, expected NULL\n", wine_dbgstr_w(str
));
356 static void test_set_csstext(IHTMLStyle
*style
)
361 test_style_set_csstext(style
, "background-color: black;");
363 hres
= IHTMLStyle_get_backgroundColor(style
, &v
);
364 ok(hres
== S_OK
, "get_backgroundColor: %08x\n", hres
);
365 ok(V_VT(&v
) == VT_BSTR
, "type failed: %d\n", V_VT(&v
));
366 ok(!strcmp_wa(V_BSTR(&v
), "black"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v
)));
370 static void test_style2(IHTMLStyle2
*style2
)
376 str
= (void*)0xdeadbeef;
377 hres
= IHTMLStyle2_get_position(style2
, &str
);
378 ok(hres
== S_OK
, "get_position failed: %08x\n", hres
);
379 ok(!str
, "str != NULL\n");
381 str
= a2bstr("absolute");
382 hres
= IHTMLStyle2_put_position(style2
, str
);
383 ok(hres
== S_OK
, "put_position failed: %08x\n", hres
);
387 hres
= IHTMLStyle2_get_position(style2
, &str
);
388 ok(hres
== S_OK
, "get_position failed: %08x\n", hres
);
389 ok(!strcmp_wa(str
, "absolute"), "get_position returned %s\n", wine_dbgstr_w(str
));
394 hres
= IHTMLStyle2_get_right(style2
, &v
);
395 ok(hres
== S_OK
, "get_top failed: %08x\n", hres
);
396 ok(V_VT(&v
) == VT_BSTR
, "V_VT(right)=%d\n", V_VT(&v
));
397 ok(!V_BSTR(&v
), "V_BSTR(right) != NULL\n");
401 V_BSTR(&v
) = a2bstr("3px");
402 hres
= IHTMLStyle2_put_right(style2
, v
);
403 ok(hres
== S_OK
, "put_right failed: %08x\n", hres
);
407 hres
= IHTMLStyle2_get_right(style2
, &v
);
408 ok(hres
== S_OK
, "get_right failed: %08x\n", hres
);
409 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
410 ok(!strcmp_wa(V_BSTR(&v
), "3px"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
414 str
= (void*)0xdeadbeef;
415 hres
= IHTMLStyle2_get_direction(style2
, &str
);
416 ok(hres
== S_OK
, "get_direction failed: %08x\n", hres
);
417 ok(!str
, "str = %s\n", wine_dbgstr_w(str
));
420 hres
= IHTMLStyle2_put_direction(style2
, str
);
421 ok(hres
== S_OK
, "put_direction failed: %08x\n", hres
);
425 hres
= IHTMLStyle2_get_direction(style2
, &str
);
426 ok(hres
== S_OK
, "get_direction failed: %08x\n", hres
);
427 ok(!strcmp_wa(str
, "ltr"), "str = %s\n", wine_dbgstr_w(str
));
432 hres
= IHTMLStyle2_get_bottom(style2
, &v
);
433 ok(hres
== S_OK
, "get_bottom failed: %08x\n", hres
);
434 test_var_bstr(&v
, NULL
);
438 hres
= IHTMLStyle2_put_bottom(style2
, v
);
439 ok(hres
== S_OK
, "put_bottom failed: %08x\n", hres
);
442 hres
= IHTMLStyle2_get_bottom(style2
, &v
);
443 ok(hres
== S_OK
, "get_bottom failed: %08x\n", hres
);
444 test_var_bstr(&v
, compat_mode
< COMPAT_IE9
? "4px" : NULL
);
447 str
= (void*)0xdeadbeef;
448 hres
= IHTMLStyle2_get_overflowX(style2
, &str
);
449 ok(hres
== S_OK
, "get_overflowX failed: %08x\n", hres
);
450 ok(!str
, "overflowX = %s\n", wine_dbgstr_w(str
));
452 str
= a2bstr("hidden");
453 hres
= IHTMLStyle2_put_overflowX(style2
, str
);
454 ok(hres
== S_OK
, "put_overflowX failed: %08x\n", hres
);
458 hres
= IHTMLStyle2_get_overflowX(style2
, &str
);
459 ok(hres
== S_OK
, "get_overflowX failed: %08x\n", hres
);
460 ok(!strcmp_wa(str
, "hidden"), "overflowX = %s\n", wine_dbgstr_w(str
));
463 str
= (void*)0xdeadbeef;
464 hres
= IHTMLStyle2_get_overflowY(style2
, &str
);
465 ok(hres
== S_OK
, "get_overflowY failed: %08x\n", hres
);
466 ok(!str
, "overflowY = %s\n", wine_dbgstr_w(str
));
468 str
= a2bstr("hidden");
469 hres
= IHTMLStyle2_put_overflowY(style2
, str
);
470 ok(hres
== S_OK
, "put_overflowY failed: %08x\n", hres
);
474 hres
= IHTMLStyle2_get_overflowY(style2
, &str
);
475 ok(hres
== S_OK
, "get_overflowY failed: %08x\n", hres
);
476 ok(!strcmp_wa(str
, "hidden"), "overflowX = %s\n", wine_dbgstr_w(str
));
479 str
= a2bstr("fixed");
480 hres
= IHTMLStyle2_put_tableLayout(style2
, str
);
481 ok(hres
== S_OK
, "put_tableLayout failed: %08x\n", hres
);
484 str
= (void*)0xdeadbeef;
485 hres
= IHTMLStyle2_get_tableLayout(style2
, &str
);
486 ok(hres
== S_OK
, "get_tableLayout failed: %08x\n", hres
);
487 ok(!strcmp_wa(str
, "fixed"), "tableLayout = %s\n", wine_dbgstr_w(str
));
491 static void test_style3(IHTMLStyle3
*style3
)
497 str
= (void*)0xdeadbeef;
498 hres
= IHTMLStyle3_get_wordWrap(style3
, &str
);
499 ok(hres
== S_OK
, "get_wordWrap failed: %08x\n", hres
);
500 ok(!str
, "str != NULL\n");
502 str
= a2bstr("break-word");
503 hres
= IHTMLStyle3_put_wordWrap(style3
, str
);
504 ok(hres
== S_OK
, "put_wordWrap failed: %08x\n", hres
);
508 hres
= IHTMLStyle3_get_wordWrap(style3
, &str
);
509 ok(hres
== S_OK
, "get_wordWrap failed: %08x\n", hres
);
510 ok(!strcmp_wa(str
, "break-word"), "get_wordWrap returned %s\n", wine_dbgstr_w(str
));
514 hres
= IHTMLStyle3_get_zoom(style3
, &v
);
515 ok(hres
== S_OK
, "get_zoom failed: %08x\n", hres
);
516 ok(V_VT(&v
) == VT_BSTR
, "V_VT(zoom) = %d\n", V_VT(&v
));
517 ok(!V_BSTR(&v
), "V_BSTR(zoom) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
521 V_BSTR(&v
) = a2bstr("100%");
522 hres
= IHTMLStyle3_put_zoom(style3
, v
);
523 ok(hres
== S_OK
, "put_zoom failed: %08x\n", hres
);
526 hres
= IHTMLStyle3_get_zoom(style3
, &v
);
527 ok(hres
== S_OK
, "get_zoom failed: %08x\n", hres
);
528 ok(V_VT(&v
) == VT_BSTR
, "V_VT(zoom) = %d\n", V_VT(&v
));
529 ok(!strcmp_wa(V_BSTR(&v
), "100%"), "V_BSTR(zoom) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
534 hres
= IHTMLStyle3_put_zoom(style3
, v
);
535 ok(hres
== S_OK
, "put_zoom failed: %08x\n", hres
);
538 hres
= IHTMLStyle3_get_zoom(style3
, &v
);
539 ok(hres
== S_OK
, "get_zoom failed: %08x\n", hres
);
540 ok(V_VT(&v
) == VT_BSTR
, "V_VT(zoom) = %d\n", V_VT(&v
));
541 ok(!strcmp_wa(V_BSTR(&v
), "1"), "V_BSTR(zoom) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
545 static void test_style4(IHTMLStyle4
*style4
)
551 hres
= IHTMLStyle4_get_minHeight(style4
, &vdefault
);
552 ok(hres
== S_OK
, "get_minHeight failed: %08x\n", hres
);
555 V_BSTR(&v
) = a2bstr("10px");
556 hres
= IHTMLStyle4_put_minHeight(style4
, v
);
557 ok(hres
== S_OK
, "put_minHeight failed: %08x\n", hres
);
560 hres
= IHTMLStyle4_get_minHeight(style4
, &v
);
561 ok(hres
== S_OK
, "get_minHeight failed: %08x\n", hres
);
562 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
563 ok( !strcmp_wa(V_BSTR(&v
), "10px"), "expect 10px got (%s)\n", wine_dbgstr_w(V_BSTR(&v
)));
566 hres
= IHTMLStyle4_put_minHeight(style4
, vdefault
);
567 ok(hres
== S_OK
, "put_minHeight failed: %08x\n", hres
);
568 VariantClear(&vdefault
);
571 static void test_style5(IHTMLStyle5
*style5
)
578 hres
= IHTMLStyle5_get_minWidth(style5
, &vdefault
);
579 ok(hres
== S_OK
, "get_minWidth failed: %08x\n", hres
);
582 V_BSTR(&v
) = a2bstr("12px");
583 hres
= IHTMLStyle5_put_minWidth(style5
, v
);
584 ok(hres
== S_OK
, "put_minWidth failed: %08x\n", hres
);
587 hres
= IHTMLStyle5_get_minWidth(style5
, &v
);
588 ok(hres
== S_OK
, "get_minWidth failed: %08x\n", hres
);
589 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
590 ok(!strcmp_wa(V_BSTR(&v
), "12px"), "expect 12px got (%s)\n", wine_dbgstr_w(V_BSTR(&v
)));
594 V_BSTR(&v
) = a2bstr("10%");
595 hres
= IHTMLStyle5_put_minWidth(style5
, v
);
596 ok(hres
== S_OK
, "put_minWidth failed: %08x\n", hres
);
599 hres
= IHTMLStyle5_get_minWidth(style5
, &v
);
600 ok(hres
== S_OK
, "get_minWidth failed: %08x\n", hres
);
601 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
602 ok(!strcmp_wa(V_BSTR(&v
), "10%"), "expect 10%% got (%s)\n", wine_dbgstr_w(V_BSTR(&v
)));
606 V_BSTR(&v
) = a2bstr("10");
607 hres
= IHTMLStyle5_put_minWidth(style5
, v
);
608 ok(hres
== S_OK
, "put_minWidth failed: %08x\n", hres
);
611 hres
= IHTMLStyle5_get_minWidth(style5
, &v
);
612 ok(hres
== S_OK
, "get_minWidth failed: %08x\n", hres
);
613 test_var_bstr(&v
, compat_mode
< COMPAT_IE9
? "10px" : "10%");
616 hres
= IHTMLStyle5_put_minWidth(style5
, vdefault
);
617 ok(hres
== S_OK
, "put_minWidth failed: %08x\n", hres
);
618 VariantClear(&vdefault
);
621 hres
= IHTMLStyle5_get_maxWidth(style5
, &vdefault
);
622 ok(hres
== S_OK
, "get_maxWidth failed: %08x\n", hres
);
625 V_BSTR(&v
) = a2bstr("200px");
626 hres
= IHTMLStyle5_put_maxWidth(style5
, v
);
627 ok(hres
== S_OK
, "put_maxWidth failed: %08x\n", hres
);
630 hres
= IHTMLStyle5_get_maxWidth(style5
, &v
);
631 ok(hres
== S_OK
, "get_maxWidth failed: %08x\n", hres
);
632 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n",V_VT(&v
));
633 ok(!strcmp_wa(V_BSTR(&v
), "200px"), "expect 200px got (%s)\n", wine_dbgstr_w(V_BSTR(&v
)));
637 V_BSTR(&v
) = a2bstr("70%");
638 hres
= IHTMLStyle5_put_maxWidth(style5
, v
);
639 ok(hres
== S_OK
, "put_maxWidth failed: %08x\n", hres
);
642 hres
= IHTMLStyle5_get_maxWidth(style5
, &v
);
643 ok(hres
== S_OK
, "get maxWidth failed: %08x\n", hres
);
644 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
645 ok(!strcmp_wa(V_BSTR(&v
), "70%"), "expect 70%% got (%s)\n", wine_dbgstr_w(V_BSTR(&v
)));
648 hres
= IHTMLStyle5_put_maxWidth(style5
,vdefault
);
649 ok(hres
== S_OK
, "put_maxWidth failed: %08x\n", hres
);
650 VariantClear(&vdefault
);
653 hres
= IHTMLStyle5_get_maxHeight(style5
, &vdefault
);
654 ok(hres
== S_OK
, "get maxHeight failed: %08x\n", hres
);
657 V_BSTR(&v
) = a2bstr("200px");
658 hres
= IHTMLStyle5_put_maxHeight(style5
, v
);
659 ok(hres
== S_OK
, "put maxHeight failed: %08x\n", hres
);
662 hres
= IHTMLStyle5_get_maxHeight(style5
, &v
);
663 ok(hres
== S_OK
, "get maxHeight failed: %08x\n", hres
);
664 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
665 ok(!strcmp_wa(V_BSTR(&v
), "200px"), "expect 200px got (%s)\n", wine_dbgstr_w(V_BSTR(&v
)));
669 V_BSTR(&v
) = a2bstr("70%");
670 hres
= IHTMLStyle5_put_maxHeight(style5
, v
);
671 ok(hres
== S_OK
, "put maxHeight failed: %08x\n", hres
);
674 hres
= IHTMLStyle5_get_maxHeight(style5
, &v
);
675 ok(hres
== S_OK
, "get_maxHeight failed: %08x\n", hres
);
676 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
677 ok(!strcmp_wa(V_BSTR(&v
), "70%"), "expect 70%% got (%s)\n", wine_dbgstr_w(V_BSTR(&v
)));
681 V_BSTR(&v
) = a2bstr("100");
682 hres
= IHTMLStyle5_put_maxHeight(style5
, v
);
683 ok(hres
== S_OK
, "put maxHeight failed: %08x\n", hres
);
686 hres
= IHTMLStyle5_get_maxHeight(style5
, &v
);
687 ok(hres
== S_OK
, "get_maxHeight failed: %08x\n", hres
);
688 test_var_bstr(&v
, compat_mode
< COMPAT_IE9
? "100px" : "70%");
691 hres
= IHTMLStyle5_put_maxHeight(style5
, vdefault
);
692 ok(hres
== S_OK
, "put maxHeight failed:%08x\n", hres
);
693 VariantClear(&vdefault
);
696 static void test_style6(IHTMLStyle6
*style
)
701 str
= (void*)0xdeadbeef;
702 hres
= IHTMLStyle6_get_outline(style
, &str
);
703 ok(hres
== S_OK
, "get_outline failed: %08x\n", hres
);
704 if(compat_mode
< COMPAT_IE9
)
705 ok(str
&& !*str
, "outline = %s\n", wine_dbgstr_w(str
));
707 ok(!str
, "outline = %s\n", wine_dbgstr_w(str
));
711 hres
= IHTMLStyle6_put_outline(style
, str
);
712 ok(hres
== S_OK
, "put_outline failed: %08x\n", hres
);
715 str
= (void*)0xdeadbeef;
716 hres
= IHTMLStyle6_get_outline(style
, &str
);
717 ok(hres
== S_OK
, "get_outline failed: %08x\n", hres
);
718 ok(wstr_contains(str
, "1px"), "outline = %s\n", wine_dbgstr_w(str
));
721 str
= (void*)0xdeadbeef;
722 hres
= IHTMLStyle6_get_boxSizing(style
, &str
);
723 ok(hres
== S_OK
, "get_boxSizing failed: %08x\n", hres
);
724 ok(!str
, "boxSizing = %s\n", wine_dbgstr_w(str
));
727 str
= a2bstr("border-box");
728 hres
= IHTMLStyle6_put_boxSizing(style
, str
);
729 ok(hres
== S_OK
, "put_boxSizing failed: %08x\n", hres
);
733 hres
= IHTMLStyle6_get_boxSizing(style
, &str
);
734 ok(hres
== S_OK
, "get_boxSizing failed: %08x\n", hres
);
735 ok(!strcmp_wa(str
, "border-box"), "boxSizing = %s\n", wine_dbgstr_w(str
));
739 static void test_body_style(IHTMLStyle
*style
)
751 BSTR sOverflowDefault
;
756 test_style_csstext(style
, NULL
);
758 hres
= IHTMLStyle_get_position(style
, &str
);
759 ok(hres
== S_OK
, "get_position failed: %08x\n", hres
);
760 ok(!str
, "str=%s\n", wine_dbgstr_w(str
));
763 hres
= IHTMLStyle_get_marginRight(style
, &v
);
764 ok(hres
== S_OK
, "get_marginRight failed: %08x\n", hres
);
765 ok(V_VT(&v
) == VT_BSTR
, "V_VT(marginRight) = %d\n", V_VT(&v
));
766 ok(!V_BSTR(&v
), "V_BSTR(marginRight) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
770 hres
= IHTMLStyle_put_marginRight(style
, v
);
771 ok(hres
== S_OK
, "put_marginRight failed: %08x\n", hres
);
774 hres
= IHTMLStyle_get_marginRight(style
, &v
);
775 ok(hres
== S_OK
, "get_marginRight failed: %08x\n", hres
);
776 ok(V_VT(&v
) == VT_BSTR
, "V_VT(marginRight) = %d\n", V_VT(&v
));
777 if(compat_mode
< COMPAT_IE9
)
778 ok(!strcmp_wa(V_BSTR(&v
), "6px"), "V_BSTR(marginRight) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
780 ok(!V_BSTR(&v
), "mariginRight = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
783 hres
= IHTMLStyle_get_marginBottom(style
, &v
);
784 ok(hres
== S_OK
, "get_marginBottom failed: %08x\n", hres
);
785 ok(V_VT(&v
) == VT_BSTR
, "V_VT(marginBottom) = %d\n", V_VT(&v
));
786 ok(!V_BSTR(&v
), "V_BSTR(marginBottom) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
790 hres
= IHTMLStyle_put_marginBottom(style
, v
);
791 ok(hres
== S_OK
, "put_marginBottom failed: %08x\n", hres
);
794 hres
= IHTMLStyle_get_marginBottom(style
, &v
);
795 ok(hres
== S_OK
, "get_marginBottom failed: %08x\n", hres
);
796 ok(V_VT(&v
) == VT_BSTR
, "V_VT(marginBottom) = %d\n", V_VT(&v
));
797 if(compat_mode
< COMPAT_IE9
)
798 ok(!strcmp_wa(V_BSTR(&v
), "6px"), "V_BSTR(marginBottom) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
800 ok(!V_BSTR(&v
), "mariginBottom = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
803 hres
= IHTMLStyle_get_marginLeft(style
, &v
);
804 ok(hres
== S_OK
, "get_marginLeft failed: %08x\n", hres
);
805 ok(V_VT(&v
) == VT_BSTR
, "V_VT(marginLeft) = %d\n", V_VT(&v
));
806 ok(!V_BSTR(&v
), "V_BSTR(marginLeft) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
810 hres
= IHTMLStyle_put_marginLeft(style
, v
);
811 ok(hres
== S_OK
, "put_marginLeft failed: %08x\n", hres
);
814 hres
= IHTMLStyle_get_marginLeft(style
, &v
);
815 ok(hres
== S_OK
, "get_marginLeft failed: %08x\n", hres
);
816 ok(V_VT(&v
) == VT_BSTR
, "V_VT(marginLeft) = %d\n", V_VT(&v
));
817 if(compat_mode
< COMPAT_IE9
)
818 ok(!strcmp_wa(V_BSTR(&v
), "6px"), "V_BSTR(marginLeft) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
820 ok(!V_BSTR(&v
), "mariginLeft = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
822 str
= (void*)0xdeadbeef;
823 hres
= IHTMLStyle_get_fontFamily(style
, &str
);
824 ok(hres
== S_OK
, "get_fontFamily failed: %08x\n", hres
);
825 ok(!str
, "fontFamily = %s\n", wine_dbgstr_w(str
));
827 str
= (void*)0xdeadbeef;
828 hres
= IHTMLStyle_get_fontWeight(style
, &str
);
829 ok(hres
== S_OK
, "get_fontWeight failed: %08x\n", hres
);
830 ok(!str
, "fontWeight = %s\n", wine_dbgstr_w(str
));
832 hres
= IHTMLStyle_get_fontWeight(style
, &sDefault
);
833 ok(hres
== S_OK
, "get_fontWeight failed: %08x\n", hres
);
835 str
= a2bstr("test");
836 hres
= IHTMLStyle_put_fontWeight(style
, str
);
837 ok(hres
== (compat_mode
< COMPAT_IE9
? E_INVALIDARG
: S_OK
),
838 "put_fontWeight failed: %08x\n", hres
);
841 hres
= IHTMLStyle_get_fontWeight(style
, &str
);
842 ok(hres
== S_OK
, "get_fontWeight failed: %08x\n", hres
);
843 ok(!str
, "fontWeight = %s\n", wine_dbgstr_w(str
));
846 str
= a2bstr("bold");
847 hres
= IHTMLStyle_put_fontWeight(style
, str
);
848 ok(hres
== S_OK
, "put_fontWeight failed: %08x\n", hres
);
851 str
= a2bstr("bolder");
852 hres
= IHTMLStyle_put_fontWeight(style
, str
);
853 ok(hres
== S_OK
, "put_fontWeight failed: %08x\n", hres
);
856 str
= a2bstr("lighter");
857 hres
= IHTMLStyle_put_fontWeight(style
, str
);
858 ok(hres
== S_OK
, "put_fontWeight failed: %08x\n", hres
);
862 hres
= IHTMLStyle_put_fontWeight(style
, str
);
863 ok(hres
== S_OK
, "put_fontWeight failed: %08x\n", hres
);
867 hres
= IHTMLStyle_put_fontWeight(style
, str
);
868 ok(hres
== S_OK
, "put_fontWeight failed: %08x\n", hres
);
872 hres
= IHTMLStyle_put_fontWeight(style
, str
);
873 ok(hres
== S_OK
, "put_fontWeight failed: %08x\n", hres
);
877 hres
= IHTMLStyle_put_fontWeight(style
, str
);
878 ok(hres
== S_OK
, "put_fontWeight failed: %08x\n", hres
);
882 hres
= IHTMLStyle_put_fontWeight(style
, str
);
883 ok(hres
== S_OK
, "put_fontWeight failed: %08x\n", hres
);
887 hres
= IHTMLStyle_put_fontWeight(style
, str
);
888 ok(hres
== S_OK
, "put_fontWeight failed: %08x\n", hres
);
892 hres
= IHTMLStyle_put_fontWeight(style
, str
);
893 ok(hres
== S_OK
, "put_fontWeight failed: %08x\n", hres
);
897 hres
= IHTMLStyle_put_fontWeight(style
, str
);
898 ok(hres
== S_OK
, "put_fontWeight failed: %08x\n", hres
);
902 hres
= IHTMLStyle_put_fontWeight(style
, str
);
903 ok(hres
== S_OK
, "put_fontWeight failed: %08x\n", hres
);
906 hres
= IHTMLStyle_get_fontWeight(style
, &str
);
907 ok(hres
== S_OK
, "get_fontWeight failed: %08x\n", hres
);
908 ok(!strcmp_wa(str
, "900"), "str != style900\n");
912 hres
= IHTMLStyle_put_fontWeight(style
, str
);
913 ok(hres
== S_OK
, "put_fontWeight failed: %08x\n", hres
);
916 hres
= IHTMLStyle_get_fontWeight(style
, &str
);
917 ok(hres
== S_OK
, "get_fontWeight failed: %08x\n", hres
);
918 ok(!str
, "str != NULL\n");
921 hres
= IHTMLStyle_put_fontWeight(style
, sDefault
);
922 ok(hres
== S_OK
, "put_fontWeight failed: %08x\n", hres
);
923 SysFreeString(sDefault
);
926 hres
= IHTMLStyle_get_fontVariant(style
, NULL
);
927 ok(hres
== E_INVALIDARG
, "get_fontVariant failed: %08x\n", hres
);
929 hres
= IHTMLStyle_get_fontVariant(style
, &sDefault
);
930 ok(hres
== S_OK
, "get_fontVariant failed: %08x\n", hres
);
932 str
= a2bstr("test");
933 hres
= IHTMLStyle_put_fontVariant(style
, str
);
934 ok(hres
== (compat_mode
< COMPAT_IE9
? E_INVALIDARG
: S_OK
),
935 "fontVariant failed: %08x\n", hres
);
938 str
= a2bstr("small-caps");
939 hres
= IHTMLStyle_put_fontVariant(style
, str
);
940 ok(hres
== S_OK
, "fontVariant failed: %08x\n", hres
);
943 str
= a2bstr("normal");
944 hres
= IHTMLStyle_put_fontVariant(style
, str
);
945 ok(hres
== S_OK
, "fontVariant failed: %08x\n", hres
);
948 hres
= IHTMLStyle_put_fontVariant(style
, sDefault
);
949 ok(hres
== S_OK
, "fontVariant failed: %08x\n", hres
);
950 SysFreeString(sDefault
);
952 str
= (void*)0xdeadbeef;
953 hres
= IHTMLStyle_get_display(style
, &str
);
954 ok(hres
== S_OK
, "get_display failed: %08x\n", hres
);
955 ok(!str
, "display = %s\n", wine_dbgstr_w(str
));
957 str
= (void*)0xdeadbeef;
958 hres
= IHTMLStyle_get_visibility(style
, &str
);
959 ok(hres
== S_OK
, "get_visibility failed: %08x\n", hres
);
960 ok(!str
, "visibility = %s\n", wine_dbgstr_w(str
));
963 hres
= IHTMLStyle_get_fontSize(style
, &v
);
964 ok(hres
== S_OK
, "get_fontSize failed: %08x\n", hres
);
965 ok(V_VT(&v
) == VT_BSTR
, "V_VT(fontSize) = %d\n", V_VT(&v
));
966 ok(!V_BSTR(&v
), "V_BSTR(fontSize) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
970 hres
= IHTMLStyle_put_fontSize(style
, v
);
971 ok(hres
== S_OK
, "put_fontSize failed: %08x\n", hres
);
974 hres
= IHTMLStyle_get_fontSize(style
, &v
);
975 ok(hres
== S_OK
, "get_fontSize failed: %08x\n", hres
);
976 ok(V_VT(&v
) == VT_BSTR
, "V_VT(fontSize) = %d\n", V_VT(&v
));
977 if(compat_mode
< COMPAT_IE9
)
978 ok(!strcmp_wa(V_BSTR(&v
), "12px"), "fontSize = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
980 ok(!V_BSTR(&v
), "fontSize = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
983 hres
= IHTMLStyle_get_color(style
, &v
);
984 ok(hres
== S_OK
, "get_color failed: %08x\n", hres
);
985 ok(V_VT(&v
) == VT_BSTR
, "V_VT(color) = %d\n", V_VT(&v
));
986 ok(!V_BSTR(&v
), "V_BSTR(color) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
990 hres
= IHTMLStyle_put_color(style
, v
);
991 ok(hres
== S_OK
, "put_color failed: %08x\n", hres
);
994 hres
= IHTMLStyle_get_color(style
, &v
);
995 ok(hres
== S_OK
, "get_color failed: %08x\n", hres
);
996 ok(V_VT(&v
) == VT_BSTR
, "V_VT(color) = %d\n", V_VT(&v
));
998 ok(!strcmp_wa(V_BSTR(&v
), "#00fdfd"), "V_BSTR(color) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1002 hres
= IHTMLStyle_put_lineHeight(style
, v
);
1003 ok(hres
== S_OK
, "put_lineHeight failed: %08x\n", hres
);
1005 hres
= IHTMLStyle_get_lineHeight(style
, &v
);
1006 ok(hres
== S_OK
, "get_lineHeight failed: %08x\n", hres
);
1007 ok(V_VT(&v
) == VT_BSTR
, "V_VT(lineHeight) = %d, expect VT_BSTR\n", V_VT(&v
));
1008 ok(!strcmp_wa(V_BSTR(&v
), "3"), "V_BSTR(lineHeight) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1011 V_BSTR(&v
) = a2bstr("300%");
1012 hres
= IHTMLStyle_put_lineHeight(style
, v
);
1013 ok(hres
== S_OK
, "put_lineHeight failed: %08x\n", hres
);
1016 hres
= IHTMLStyle_get_lineHeight(style
, &v
);
1017 ok(hres
== S_OK
, "get_lineHeight failed: %08x\n", hres
);
1018 ok(V_VT(&v
) == VT_BSTR
, "V_VT(lineHeight) = %d, expect VT_BSTR\n", V_VT(&v
));
1019 ok(!strcmp_wa(V_BSTR(&v
), "300%"), "V_BSTR(lineHeight) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1023 hres
= IHTMLStyle_get_textDecorationUnderline(style
, &b
);
1024 ok(hres
== S_OK
, "get_textDecorationUnderline failed: %08x\n", hres
);
1025 ok(b
== VARIANT_FALSE
, "textDecorationUnderline = %x\n", b
);
1027 hres
= IHTMLStyle_put_textDecorationUnderline(style
, VARIANT_TRUE
);
1028 ok(hres
== S_OK
, "put_textDecorationUnderline failed: %08x\n", hres
);
1030 hres
= IHTMLStyle_get_textDecorationUnderline(style
, &b
);
1031 ok(hres
== S_OK
, "get_textDecorationUnderline failed: %08x\n", hres
);
1032 ok(b
== VARIANT_TRUE
, "textDecorationUnderline = %x\n", b
);
1034 hres
= IHTMLStyle_put_textDecorationUnderline(style
, VARIANT_FALSE
);
1035 ok(hres
== S_OK
, "put_textDecorationUnderline failed: %08x\n", hres
);
1038 hres
= IHTMLStyle_get_textDecorationLineThrough(style
, &b
);
1039 ok(hres
== S_OK
, "get_textDecorationLineThrough failed: %08x\n", hres
);
1040 ok(b
== VARIANT_FALSE
, "textDecorationLineThrough = %x\n", b
);
1042 hres
= IHTMLStyle_put_textDecorationLineThrough(style
, VARIANT_TRUE
);
1043 ok(hres
== S_OK
, "put_textDecorationLineThrough failed: %08x\n", hres
);
1045 hres
= IHTMLStyle_get_textDecorationLineThrough(style
, &b
);
1046 ok(hres
== S_OK
, "get_textDecorationLineThrough failed: %08x\n", hres
);
1047 ok(b
== VARIANT_TRUE
, "textDecorationLineThrough = %x\n", b
);
1049 hres
= IHTMLStyle_put_textDecorationLineThrough(style
, VARIANT_FALSE
);
1050 ok(hres
== S_OK
, "put_textDecorationLineThrough failed: %08x\n", hres
);
1053 hres
= IHTMLStyle_get_textDecorationNone(style
, &b
);
1054 ok(hres
== S_OK
, "get_textDecorationNone failed: %08x\n", hres
);
1055 ok(b
== VARIANT_FALSE
, "textDecorationNone = %x\n", b
);
1057 hres
= IHTMLStyle_put_textDecorationNone(style
, VARIANT_TRUE
);
1058 ok(hres
== S_OK
, "put_textDecorationNone failed: %08x\n", hres
);
1060 hres
= IHTMLStyle_get_textDecorationNone(style
, &b
);
1061 ok(hres
== S_OK
, "get_textDecorationNone failed: %08x\n", hres
);
1062 ok(b
== VARIANT_TRUE
, "textDecorationNone = %x\n", b
);
1064 hres
= IHTMLStyle_put_textDecorationNone(style
, VARIANT_FALSE
);
1065 ok(hres
== S_OK
, "put_textDecorationNone failed: %08x\n", hres
);
1068 hres
= IHTMLStyle_get_textDecorationOverline(style
, &b
);
1069 ok(hres
== S_OK
, "get_textDecorationOverline failed: %08x\n", hres
);
1070 ok(b
== VARIANT_FALSE
, "textDecorationOverline = %x\n", b
);
1072 hres
= IHTMLStyle_put_textDecorationOverline(style
, VARIANT_TRUE
);
1073 ok(hres
== S_OK
, "put_textDecorationOverline failed: %08x\n", hres
);
1075 hres
= IHTMLStyle_get_textDecorationOverline(style
, &b
);
1076 ok(hres
== S_OK
, "get_textDecorationOverline failed: %08x\n", hres
);
1077 ok(b
== VARIANT_TRUE
, "textDecorationOverline = %x\n", b
);
1079 hres
= IHTMLStyle_put_textDecorationOverline(style
, VARIANT_FALSE
);
1080 ok(hres
== S_OK
, "put_textDecorationOverline failed: %08x\n", hres
);
1083 hres
= IHTMLStyle_get_textDecorationBlink(style
, &b
);
1084 ok(hres
== S_OK
, "get_textDecorationBlink failed: %08x\n", hres
);
1085 ok(b
== VARIANT_FALSE
, "textDecorationBlink = %x\n", b
);
1087 hres
= IHTMLStyle_put_textDecorationBlink(style
, VARIANT_TRUE
);
1088 ok(hres
== S_OK
, "put_textDecorationBlink failed: %08x\n", hres
);
1090 hres
= IHTMLStyle_get_textDecorationBlink(style
, &b
);
1091 ok(hres
== S_OK
, "get_textDecorationBlink failed: %08x\n", hres
);
1092 ok(b
== VARIANT_TRUE
, "textDecorationBlink = %x\n", b
);
1094 hres
= IHTMLStyle_put_textDecorationBlink(style
, VARIANT_FALSE
);
1095 ok(hres
== S_OK
, "textDecorationBlink failed: %08x\n", hres
);
1097 hres
= IHTMLStyle_get_textDecoration(style
, &sDefault
);
1098 ok(hres
== S_OK
, "get_textDecoration failed: %08x\n", hres
);
1100 str
= a2bstr("invalid");
1101 hres
= IHTMLStyle_put_textDecoration(style
, str
);
1102 ok(hres
== (compat_mode
< COMPAT_IE9
? E_INVALIDARG
: S_OK
),
1103 "put_textDecoration failed: %08x\n", hres
);
1106 set_text_decoration(style
, "none");
1107 test_text_decoration(style
, "none");
1108 set_text_decoration(style
, "underline");
1109 set_text_decoration(style
, "overline");
1110 set_text_decoration(style
, "line-through");
1111 set_text_decoration(style
, "blink");
1112 set_text_decoration(style
, "overline");
1113 set_text_decoration(style
, "blink");
1114 test_text_decoration(style
, "blink");
1116 str
= a2bstr("invalid");
1117 hres
= IHTMLStyle_put_textDecoration(style
, str
);
1118 ok(hres
== (compat_mode
< COMPAT_IE9
? E_INVALIDARG
: S_OK
),
1119 "put_textDecoration failed: %08x\n", hres
);
1121 test_text_decoration(style
, compat_mode
< COMPAT_IE9
? NULL
: "blink");
1123 hres
= IHTMLStyle_put_textDecoration(style
, sDefault
);
1124 ok(hres
== S_OK
, "put_textDecoration failed: %08x\n", hres
);
1125 SysFreeString(sDefault
);
1127 hres
= IHTMLStyle_get_posWidth(style
, NULL
);
1128 ok(hres
== E_POINTER
, "get_posWidth failed: %08x\n", hres
);
1130 hres
= IHTMLStyle_get_posWidth(style
, &f
);
1131 ok(hres
== S_OK
, "get_posWidth failed: %08x\n", hres
);
1132 ok(f
== 0.0f
, "f = %f\n", f
);
1134 V_VT(&v
) = VT_EMPTY
;
1135 hres
= IHTMLStyle_get_width(style
, &v
);
1136 ok(hres
== S_OK
, "get_width failed: %08x\n", hres
);
1137 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
1138 ok(!V_BSTR(&v
), "V_BSTR(v)=%p\n", V_BSTR(&v
));
1140 hres
= IHTMLStyle_put_posWidth(style
, 2.2);
1141 ok(hres
== S_OK
, "put_posWidth failed: %08x\n", hres
);
1143 hres
= IHTMLStyle_get_posWidth(style
, &f
);
1144 ok(hres
== S_OK
, "get_posWidth failed: %08x\n", hres
);
1146 f
== 2.2f
, /* IE8 */
1150 hres
= IHTMLStyle_get_pixelWidth(style
, &l
);
1151 ok(hres
== S_OK
, "get_pixelWidth failed: %08x\n", hres
);
1152 ok(l
== 2, "pixelWidth = %d\n", l
);
1155 V_BSTR(&v
) = a2bstr("auto");
1156 hres
= IHTMLStyle_put_width(style
, v
);
1157 ok(hres
== S_OK
, "put_width failed: %08x\n", hres
);
1160 V_VT(&v
) = VT_EMPTY
;
1161 hres
= IHTMLStyle_get_width(style
, &v
);
1162 ok(hres
== S_OK
, "get_width failed: %08x\n", hres
);
1163 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
1164 ok(!strcmp_wa(V_BSTR(&v
), "auto"), "V_BSTR(v)=%s\n", wine_dbgstr_w(V_BSTR(&v
)));
1168 hres
= IHTMLStyle_get_pixelWidth(style
, &l
);
1169 ok(hres
== S_OK
, "get_pixelWidth failed: %08x\n", hres
);
1170 ok(!l
, "pixelWidth = %d\n", l
);
1174 hres
= IHTMLStyle_put_width(style
, v
);
1175 ok(hres
== S_OK
, "put_width failed: %08x\n", hres
);
1177 hres
= IHTMLStyle_get_width(style
, &v
);
1178 ok(hres
== S_OK
, "get_width failed: %08x\n", hres
);
1179 test_var_bstr(&v
, compat_mode
< COMPAT_IE9
? "100px" : "auto");
1183 hres
= IHTMLStyle_get_pixelWidth(style
, &l
);
1184 ok(hres
== S_OK
, "get_pixelWidth failed: %08x\n", hres
);
1185 ok(l
== (compat_mode
< COMPAT_IE9
? 100 : 0), "pixelWidth = %d\n", l
);
1187 V_VT(&v
) = VT_EMPTY
;
1188 hres
= IHTMLStyle_get_width(style
, &v
);
1189 ok(hres
== S_OK
, "get_width failed: %08x\n", hres
);
1190 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
1191 ok(!strcmp_wa(V_BSTR(&v
), compat_mode
< COMPAT_IE9
? "100px" : "auto"), "V_BSTR(v)=%s\n",
1192 wine_dbgstr_w(V_BSTR(&v
)));
1195 hres
= IHTMLStyle_put_pixelWidth(style
, 50);
1196 ok(hres
== S_OK
, "put_pixelWidth failed: %08x\n", hres
);
1199 hres
= IHTMLStyle_get_pixelWidth(style
, &l
);
1200 ok(hres
== S_OK
, "get_pixelWidth failed: %08x\n", hres
);
1201 ok(l
== 50, "pixelWidth = %d\n", l
);
1203 hres
= IHTMLStyle_get_pixelWidth(style
, NULL
);
1204 ok(hres
== E_POINTER
, "get_pixelWidth failed: %08x\n", hres
);
1206 V_VT(&v
) = VT_EMPTY
;
1207 hres
= IHTMLStyle_get_width(style
, &v
);
1208 ok(hres
== S_OK
, "get_width failed: %08x\n", hres
);
1209 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
1210 ok(!strcmp_wa(V_BSTR(&v
), "50px"), "V_BSTR(v)=%s\n", wine_dbgstr_w(V_BSTR(&v
)));
1214 str
= (void*)0xdeadbeef;
1215 hres
= IHTMLStyle_get_margin(style
, &str
);
1216 ok(hres
== S_OK
, "get_margin failed: %08x\n", hres
);
1217 ok(!str
, "margin = %s\n", wine_dbgstr_w(str
));
1220 hres
= IHTMLStyle_put_margin(style
, str
);
1221 ok(hres
== S_OK
, "put_margin failed: %08x\n", hres
);
1224 hres
= IHTMLStyle_get_margin(style
, &str
);
1225 ok(hres
== S_OK
, "get_margin failed: %08x\n", hres
);
1226 if(compat_mode
< COMPAT_IE9
)
1227 ok(!strcmp_wa(str
, "1px"), "margin = %s\n", wine_dbgstr_w(str
));
1229 ok(!str
, "margin = %s\n", wine_dbgstr_w(str
));
1232 str
= a2bstr("2px");
1233 hres
= IHTMLStyle_put_margin(style
, str
);
1234 ok(hres
== S_OK
, "put_margin failed: %08x\n", hres
);
1237 hres
= IHTMLStyle_get_margin(style
, &str
);
1238 ok(hres
== S_OK
, "get_margin failed: %08x\n", hres
);
1239 ok(!strcmp_wa(str
, "2px"), "margin = %s\n", wine_dbgstr_w(str
));
1242 hres
= IHTMLStyle_put_margin(style
, NULL
);
1243 ok(hres
== S_OK
, "put_margin failed: %08x\n", hres
);
1245 str
= (void*)0xdeadbeef;
1246 hres
= IHTMLStyle_get_marginTop(style
, &v
);
1247 ok(hres
== S_OK
, "get_marginTop failed: %08x\n", hres
);
1248 ok(V_VT(&v
) == VT_BSTR
, "V_VT(marginTop) = %d\n", V_VT(&v
));
1249 ok(!V_BSTR(&v
), "V_BSTR(marginTop) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1252 V_BSTR(&v
) = a2bstr("6px");
1253 hres
= IHTMLStyle_put_marginTop(style
, v
);
1254 SysFreeString(V_BSTR(&v
));
1255 ok(hres
== S_OK
, "put_marginTop failed: %08x\n", hres
);
1257 str
= (void*)0xdeadbeef;
1258 hres
= IHTMLStyle_get_marginTop(style
, &v
);
1259 ok(hres
== S_OK
, "get_marginTop failed: %08x\n", hres
);
1260 ok(V_VT(&v
) == VT_BSTR
, "V_VT(marginTop) = %d\n", V_VT(&v
));
1261 ok(!strcmp_wa(V_BSTR(&v
), "6px"), "V_BSTR(marginTop) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1266 hres
= IHTMLStyle_put_marginTop(style
, v
);
1267 ok(hres
== S_OK
, "put_marginTop failed: %08x\n", hres
);
1269 str
= (void*)0xdeadbeef;
1270 hres
= IHTMLStyle_get_marginTop(style
, &v
);
1271 ok(hres
== S_OK
, "get_marginTop failed: %08x\n", hres
);
1272 ok(V_VT(&v
) == VT_BSTR
, "V_VT(marginTop) = %d\n", V_VT(&v
));
1273 ok(!strcmp_wa(V_BSTR(&v
), compat_mode
< COMPAT_IE9
? "5px" : "6px"),
1274 "V_BSTR(marginTop) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1278 hres
= IHTMLStyle_get_border(style
, &str
);
1279 ok(hres
== S_OK
, "get_border failed: %08x\n", hres
);
1280 ok(!str
|| !*str
, "str is not empty\n");
1283 str
= a2bstr("1px");
1284 hres
= IHTMLStyle_put_border(style
, str
);
1285 ok(hres
== S_OK
, "put_border failed: %08x\n", hres
);
1288 V_VT(&v
) = VT_EMPTY
;
1289 hres
= IHTMLStyle_get_left(style
, &v
);
1290 ok(hres
== S_OK
, "get_left failed: %08x\n", hres
);
1291 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
1292 ok(!V_BSTR(&v
), "V_BSTR(v) != NULL\n");
1296 hres
= IHTMLStyle_get_pixelLeft(style
, &l
);
1297 ok(hres
== S_OK
, "get_pixelLeft failed: %08x\n", hres
);
1298 ok(!l
, "pixelLeft = %d\n", l
);
1301 hres
= IHTMLStyle_get_posLeft(style
, NULL
);
1302 ok(hres
== E_POINTER
, "get_posLeft failed: %08x\n", hres
);
1305 hres
= IHTMLStyle_get_posLeft(style
, &f
);
1306 ok(hres
== S_OK
, "get_posLeft failed: %08x\n", hres
);
1307 ok(f
== 0.0, "expected 0.0 got %f\n", f
);
1309 hres
= IHTMLStyle_put_posLeft(style
, 4.9f
);
1310 ok(hres
== S_OK
, "put_posLeft failed: %08x\n", hres
);
1312 hres
= IHTMLStyle_get_posLeft(style
, &f
);
1313 ok(hres
== S_OK
, "get_posLeft failed: %08x\n", hres
);
1315 f
== 4.9f
, /* IE8 */
1316 "expected 4.0 or 4.9 (IE8) got %f\n", f
);
1318 /* Ensure left is updated correctly. */
1319 V_VT(&v
) = VT_EMPTY
;
1320 hres
= IHTMLStyle_get_left(style
, &v
);
1321 ok(hres
== S_OK
, "get_left failed: %08x\n", hres
);
1322 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
1323 ok(!strcmp_wa(V_BSTR(&v
), "4px") ||
1324 !strcmp_wa(V_BSTR(&v
), "4.9px"), /* IE8 */
1325 "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1330 V_BSTR(&v
) = a2bstr("3px");
1331 hres
= IHTMLStyle_put_left(style
, v
);
1332 ok(hres
== S_OK
, "put_left failed: %08x\n", hres
);
1335 hres
= IHTMLStyle_get_posLeft(style
, &f
);
1336 ok(hres
== S_OK
, "get_posLeft failed: %08x\n", hres
);
1337 ok(f
== 3.0, "expected 3.0 got %f\n", f
);
1340 hres
= IHTMLStyle_get_pixelLeft(style
, &l
);
1341 ok(hres
== S_OK
, "get_pixelLeft failed: %08x\n", hres
);
1342 ok(l
== 3, "pixelLeft = %d\n", l
);
1344 V_VT(&v
) = VT_EMPTY
;
1345 hres
= IHTMLStyle_get_left(style
, &v
);
1346 ok(hres
== S_OK
, "get_left failed: %08x\n", hres
);
1347 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
1348 ok(!strcmp_wa(V_BSTR(&v
), "3px"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1352 V_BSTR(&v
) = a2bstr("4.99");
1353 hres
= IHTMLStyle_put_left(style
, v
);
1354 ok(hres
== S_OK
, "put_left failed: %08x\n", hres
);
1358 hres
= IHTMLStyle_get_pixelLeft(style
, &l
);
1359 ok(hres
== S_OK
, "get_pixelLeft failed: %08x\n", hres
);
1360 ok(l
== (compat_mode
< COMPAT_IE9
? 4 : 3), "pixelLeft = %d\n", l
);
1363 hres
= IHTMLStyle_put_left(style
, v
);
1364 ok(hres
== S_OK
, "put_left failed: %08x\n", hres
);
1366 V_VT(&v
) = VT_EMPTY
;
1367 hres
= IHTMLStyle_get_left(style
, &v
);
1368 ok(hres
== S_OK
, "get_left failed: %08x\n", hres
);
1369 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
1370 ok(!V_BSTR(&v
), "V_BSTR(v) != NULL\n");
1373 V_VT(&v
) = VT_EMPTY
;
1374 hres
= IHTMLStyle_get_top(style
, &v
);
1375 ok(hres
== S_OK
, "get_top failed: %08x\n", hres
);
1376 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
1377 ok(!V_BSTR(&v
), "V_BSTR(v) != NULL\n");
1381 hres
= IHTMLStyle_get_pixelLeft(style
, &l
);
1382 ok(hres
== S_OK
, "get_pixelLeft failed: %08x\n", hres
);
1383 ok(!l
, "pixelLeft = %d\n", l
);
1385 hres
= IHTMLStyle_put_pixelLeft(style
, 6);
1386 ok(hres
== S_OK
, "put_pixelLeft failed: %08x\n", hres
);
1389 hres
= IHTMLStyle_get_pixelLeft(style
, &l
);
1390 ok(hres
== S_OK
, "get_pixelLeft failed: %08x\n", hres
);
1391 ok(l
== 6, "pixelLeft = %d\n", l
);
1393 hres
= IHTMLStyle_get_pixelLeft(style
, NULL
);
1394 ok(hres
== E_POINTER
, "get_pixelLeft failed: %08x\n", hres
);
1396 V_VT(&v
) = VT_EMPTY
;
1397 hres
= IHTMLStyle_get_left(style
, &v
);
1398 ok(hres
== S_OK
, "get_left failed: %08x\n", hres
);
1399 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
1400 ok(!strcmp_wa(V_BSTR(&v
), "6px"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1404 hres
= IHTMLStyle_get_posTop(style
, NULL
);
1405 ok(hres
== E_POINTER
, "get_posTop failed: %08x\n", hres
);
1408 hres
= IHTMLStyle_get_posTop(style
, &f
);
1409 ok(hres
== S_OK
, "get_posTop failed: %08x\n", hres
);
1410 ok(f
== 0.0, "expected 0.0 got %f\n", f
);
1412 hres
= IHTMLStyle_put_posTop(style
, 4.9f
);
1413 ok(hres
== S_OK
, "put_posTop failed: %08x\n", hres
);
1415 hres
= IHTMLStyle_get_posTop(style
, &f
);
1416 ok(hres
== S_OK
, "get_posTop failed: %08x\n", hres
);
1418 f
== 4.9f
, /* IE8 */
1419 "expected 4.0 or 4.9 (IE8) got %f\n", f
);
1421 hres
= IHTMLStyle_put_pixelTop(style
, 6);
1422 ok(hres
== S_OK
, "put_pixelTop failed: %08x\n", hres
);
1425 hres
= IHTMLStyle_get_pixelTop(style
, &l
);
1426 ok(hres
== S_OK
, "get_pixelTop failed: %08x\n", hres
);
1427 ok(l
== 6, "pixelTop = %d\n", l
);
1429 hres
= IHTMLStyle_get_pixelTop(style
, NULL
);
1430 ok(hres
== E_POINTER
, "get_pixelTop failed: %08x\n", hres
);
1433 V_BSTR(&v
) = a2bstr("3px");
1434 hres
= IHTMLStyle_put_top(style
, v
);
1435 ok(hres
== S_OK
, "put_top failed: %08x\n", hres
);
1438 V_VT(&v
) = VT_EMPTY
;
1439 hres
= IHTMLStyle_get_top(style
, &v
);
1440 ok(hres
== S_OK
, "get_top failed: %08x\n", hres
);
1441 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
1442 ok(!strcmp_wa(V_BSTR(&v
), "3px"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1445 hres
= IHTMLStyle_get_posTop(style
, &f
);
1446 ok(hres
== S_OK
, "get_posTop failed: %08x\n", hres
);
1447 ok(f
== 3.0, "expected 3.0 got %f\n", f
);
1450 hres
= IHTMLStyle_get_pixelTop(style
, &l
);
1451 ok(hres
== S_OK
, "get_pixelTop failed: %08x\n", hres
);
1452 ok(l
== 3, "pixelTop = %d\n", l
);
1455 V_BSTR(&v
) = a2bstr("100%");
1456 hres
= IHTMLStyle_put_top(style
, v
);
1457 ok(hres
== S_OK
, "put_top failed: %08x\n", hres
);
1461 hres
= IHTMLStyle_get_pixelTop(style
, &l
);
1462 ok(hres
== S_OK
, "get_pixelTop failed: %08x\n", hres
);
1463 ok(!l
, "pixelTop = %d\n", l
);
1466 hres
= IHTMLStyle_put_top(style
, v
);
1467 ok(hres
== S_OK
, "put_top failed: %08x\n", hres
);
1469 V_VT(&v
) = VT_EMPTY
;
1470 hres
= IHTMLStyle_get_top(style
, &v
);
1471 ok(hres
== S_OK
, "get_top failed: %08x\n", hres
);
1472 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
1473 ok(!V_BSTR(&v
), "V_BSTR(v) != NULL\n");
1477 hres
= IHTMLStyle_get_pixelTop(style
, &l
);
1478 ok(hres
== S_OK
, "get_pixelTop failed: %08x\n", hres
);
1479 ok(!l
, "pixelTop = %d\n", l
);
1481 /* Test posHeight */
1482 hres
= IHTMLStyle_get_posHeight(style
, NULL
);
1483 ok(hres
== E_POINTER
, "get_posHeight failed: %08x\n", hres
);
1485 V_VT(&v
) = VT_EMPTY
;
1486 hres
= IHTMLStyle_get_height(style
, &v
);
1487 ok(hres
== S_OK
, "get_height failed: %08x\n", hres
);
1488 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
1489 ok(!V_BSTR(&v
), "V_BSTR(v) != NULL\n");
1493 hres
= IHTMLStyle_get_posHeight(style
, &f
);
1494 ok(hres
== S_OK
, "get_posHeight failed: %08x\n", hres
);
1495 ok(f
== 0.0, "expected 0.0 got %f\n", f
);
1498 hres
= IHTMLStyle_get_pixelHeight(style
, &l
);
1499 ok(hres
== S_OK
, "get_pixelHeight failed: %08x\n", hres
);
1500 ok(!l
, "pixelHeight = %d\n", l
);
1502 hres
= IHTMLStyle_put_posHeight(style
, 4.9f
);
1503 ok(hres
== S_OK
, "put_posHeight failed: %08x\n", hres
);
1505 hres
= IHTMLStyle_get_posHeight(style
, &f
);
1506 ok(hres
== S_OK
, "get_posHeight failed: %08x\n", hres
);
1508 f
== 4.9f
, /* IE8 */
1509 "expected 4.0 or 4.9 (IE8) got %f\n", f
);
1512 hres
= IHTMLStyle_get_pixelHeight(style
, &l
);
1513 ok(hres
== S_OK
, "get_pixelHeight failed: %08x\n", hres
);
1516 "pixelHeight = %d\n", l
);
1519 V_BSTR(&v
) = a2bstr("70px");
1520 hres
= IHTMLStyle_put_height(style
, v
);
1521 ok(hres
== S_OK
, "put_height failed: %08x\n", hres
);
1524 V_VT(&v
) = VT_EMPTY
;
1525 hres
= IHTMLStyle_get_height(style
, &v
);
1526 ok(hres
== S_OK
, "get_height failed: %08x\n", hres
);
1527 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
1528 ok(!strcmp_wa(V_BSTR(&v
), "70px"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1532 hres
= IHTMLStyle_get_pixelHeight(style
, &l
);
1533 ok(hres
== S_OK
, "get_pixelHeight failed: %08x\n", hres
);
1534 ok(l
== 70, "pixelHeight = %d\n", l
);
1537 V_BSTR(&v
) = a2bstr("50%");
1538 hres
= IHTMLStyle_put_height(style
, v
);
1539 ok(hres
== S_OK
, "put_height failed: %08x\n", hres
);
1543 hres
= IHTMLStyle_get_pixelHeight(style
, &l
);
1544 ok(hres
== S_OK
, "get_pixelHeight failed: %08x\n", hres
);
1545 ok(!l
, "pixelHeight = %d\n", l
);
1549 hres
= IHTMLStyle_put_height(style
, v
);
1550 ok(hres
== S_OK
, "put_height failed: %08x\n", hres
);
1553 V_VT(&v
) = VT_EMPTY
;
1554 hres
= IHTMLStyle_get_height(style
, &v
);
1555 ok(hres
== S_OK
, "get_height failed: %08x\n", hres
);
1556 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
1557 ok(!V_BSTR(&v
), "V_BSTR(v) = %s, expected NULL\n", wine_dbgstr_w(V_BSTR(&v
)));
1561 hres
= IHTMLStyle_get_pixelHeight(style
, &l
);
1562 ok(hres
== S_OK
, "get_pixelHeight failed: %08x\n", hres
);
1563 ok(!l
, "pixelHeight = %d\n", l
);
1565 hres
= IHTMLStyle_put_pixelHeight(style
, 50);
1566 ok(hres
== S_OK
, "put_pixelHeight failed: %08x\n", hres
);
1569 hres
= IHTMLStyle_get_pixelHeight(style
, &l
);
1570 ok(hres
== S_OK
, "get_pixelHeight failed: %08x\n", hres
);
1571 ok(l
== 50, "pixelHeight = %d\n", l
);
1573 hres
= IHTMLStyle_get_pixelHeight(style
, NULL
);
1574 ok(hres
== E_POINTER
, "get_pixelHeight failed: %08x\n", hres
);
1578 hres
= IHTMLStyle_put_height(style
, v
);
1579 ok(hres
== S_OK
, "put_height failed: %08x\n", hres
);
1581 V_VT(&v
) = VT_EMPTY
;
1582 hres
= IHTMLStyle_get_height(style
, &v
);
1583 ok(hres
== S_OK
, "get_height failed: %08x\n", hres
);
1584 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
1585 ok(!strcmp_wa(V_BSTR(&v
), compat_mode
< COMPAT_IE9
? "64px" : "50px"),
1586 "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1589 hres
= IHTMLStyle_get_posHeight(style
, &f
);
1590 ok(hres
== S_OK
, "get_posHeight failed: %08x\n", hres
);
1591 ok(f
== (compat_mode
< COMPAT_IE9
? 64.0 : 50), "expected 64.0 got %f\n", f
);
1594 hres
= IHTMLStyle_get_pixelHeight(style
, &l
);
1595 ok(hres
== S_OK
, "get_pixelHeight failed: %08x\n", hres
);
1596 ok(l
== (compat_mode
< COMPAT_IE9
? 64 : 50), "pixelHeight = %d\n", l
);
1598 str
= (void*)0xdeadbeef;
1599 hres
= IHTMLStyle_get_cursor(style
, &str
);
1600 ok(hres
== S_OK
, "get_cursor failed: %08x\n", hres
);
1601 ok(!str
, "get_cursor != NULL\n");
1604 str
= a2bstr("default");
1605 hres
= IHTMLStyle_put_cursor(style
, str
);
1606 ok(hres
== S_OK
, "put_cursor failed: %08x\n", hres
);
1610 hres
= IHTMLStyle_get_cursor(style
, &str
);
1611 ok(hres
== S_OK
, "get_cursor failed: %08x\n", hres
);
1612 ok(!strcmp_wa(str
, "default"), "get_cursor returned %s\n", wine_dbgstr_w(str
));
1615 V_VT(&v
) = VT_EMPTY
;
1616 hres
= IHTMLStyle_get_verticalAlign(style
, &v
);
1617 ok(hres
== S_OK
, "get_vertivalAlign failed: %08x\n", hres
);
1618 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
1619 ok(!V_BSTR(&v
), "V_BSTR(v) != NULL\n");
1623 V_BSTR(&v
) = a2bstr("middle");
1624 hres
= IHTMLStyle_put_verticalAlign(style
, v
);
1625 ok(hres
== S_OK
, "put_vertivalAlign failed: %08x\n", hres
);
1628 V_VT(&v
) = VT_EMPTY
;
1629 hres
= IHTMLStyle_get_verticalAlign(style
, &v
);
1630 ok(hres
== S_OK
, "get_verticalAlign failed: %08x\n", hres
);
1631 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
1632 ok(!strcmp_wa(V_BSTR(&v
), "middle"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1637 hres
= IHTMLStyle_put_verticalAlign(style
, v
);
1638 ok(hres
== S_OK
, "put_vertivalAlign failed: %08x\n", hres
);
1641 V_VT(&v
) = VT_EMPTY
;
1642 hres
= IHTMLStyle_get_verticalAlign(style
, &v
);
1643 ok(hres
== S_OK
, "get_verticalAlign failed: %08x\n", hres
);
1644 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
1645 ok(!strcmp_wa(V_BSTR(&v
), compat_mode
< COMPAT_IE9
? "100px" : "middle"),
1646 "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1649 str
= (void*)0xdeadbeef;
1650 hres
= IHTMLStyle_get_textAlign(style
, &str
);
1651 ok(hres
== S_OK
, "get_textAlign failed: %08x\n", hres
);
1652 ok(!str
, "textAlign != NULL\n");
1654 str
= a2bstr("center");
1655 hres
= IHTMLStyle_put_textAlign(style
, str
);
1656 ok(hres
== S_OK
, "put_textAlign failed: %08x\n", hres
);
1660 hres
= IHTMLStyle_get_textAlign(style
, &str
);
1661 ok(hres
== S_OK
, "get_textAlign failed: %08x\n", hres
);
1662 ok(!strcmp_wa(str
, "center"), "textAlign = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1666 hres
= IHTMLStyle_get_textIndent(style
, &v
);
1667 ok(hres
== S_OK
, "get_textIndent failed: %08x\n", hres
);
1668 ok(V_VT(&v
) == VT_BSTR
, "V_VT(textIndent) = %d\n", V_VT(&v
));
1669 ok(!V_BSTR(&v
), "V_BSTR(textIndent) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1673 hres
= IHTMLStyle_put_textIndent(style
, v
);
1674 ok(hres
== S_OK
, "put_textIndent failed: %08x\n", hres
);
1677 hres
= IHTMLStyle_get_textIndent(style
, &v
);
1678 ok(hres
== S_OK
, "get_textIndent failed: %08x\n", hres
);
1679 ok(V_VT(&v
) == VT_BSTR
, "V_VT(textIndent) = %d\n", V_VT(&v
));
1680 if(compat_mode
< COMPAT_IE9
)
1681 ok(!strcmp_wa(V_BSTR(&v
), "6px"), "textIndent = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1683 ok(!V_BSTR(&v
), "textIndent = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1685 str
= (void*)0xdeadbeef;
1686 hres
= IHTMLStyle_get_textTransform(style
, &str
);
1687 ok(hres
== S_OK
, "get_textTransform failed: %08x\n", hres
);
1688 ok(!str
, "textTransform != NULL\n");
1690 str
= a2bstr("lowercase");
1691 hres
= IHTMLStyle_put_textTransform(style
, str
);
1692 ok(hres
== S_OK
, "put_textTransform failed: %08x\n", hres
);
1696 hres
= IHTMLStyle_get_textTransform(style
, &str
);
1697 ok(hres
== S_OK
, "get_textTransform failed: %08x\n", hres
);
1698 ok(!strcmp_wa(str
, "lowercase"), "textTransform = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1701 str
= (void*)0xdeadbeef;
1702 hres
= IHTMLStyle_get_filter(style
, &str
);
1703 ok(hres
== S_OK
, "get_filter failed: %08x\n", hres
);
1704 ok(!str
, "filter != NULL\n");
1706 str
= a2bstr("alpha(opacity=100)");
1707 hres
= IHTMLStyle_put_filter(style
, str
);
1708 ok(hres
== S_OK
, "put_filter failed: %08x\n", hres
);
1711 V_VT(&v
) = VT_EMPTY
;
1712 hres
= IHTMLStyle_get_zIndex(style
, &v
);
1713 ok(hres
== S_OK
, "get_zIndex failed: %08x\n", hres
);
1714 if(compat_mode
< COMPAT_IE9
) {
1715 ok(V_VT(&v
) == VT_I4
, "V_VT(v)=%d\n", V_VT(&v
));
1716 ok(!V_I4(&v
), "V_I4(v) != 0\n");
1719 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
1720 if(V_VT(&v
) == VT_BSTR
) todo_wine
1721 ok(!V_BSTR(&v
), "zIndex = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1726 V_BSTR(&v
) = a2bstr("1");
1727 hres
= IHTMLStyle_put_zIndex(style
, v
);
1728 ok(hres
== S_OK
, "put_zIndex failed: %08x\n", hres
);
1731 V_VT(&v
) = VT_EMPTY
;
1732 hres
= IHTMLStyle_get_zIndex(style
, &v
);
1733 ok(hres
== S_OK
, "get_zIndex failed: %08x\n", hres
);
1734 ok(V_VT(&v
) == VT_I4
, "V_VT(v)=%d\n", V_VT(&v
));
1735 ok(V_I4(&v
) == 1, "V_I4(v) = %d\n", V_I4(&v
));
1739 hres
= IHTMLStyle_get_fontStyle(style
, &sDefault
);
1740 ok(hres
== S_OK
, "get_fontStyle failed: %08x\n", hres
);
1742 str
= a2bstr("test");
1743 hres
= IHTMLStyle_put_fontStyle(style
, str
);
1744 ok(hres
== (compat_mode
< COMPAT_IE9
? E_INVALIDARG
: S_OK
),
1745 "put_fontStyle failed: %08x\n", hres
);
1748 str
= a2bstr("italic");
1749 hres
= IHTMLStyle_put_fontStyle(style
, str
);
1750 ok(hres
== S_OK
, "put_fontStyle failed: %08x\n", hres
);
1753 str
= a2bstr("oblique");
1754 hres
= IHTMLStyle_put_fontStyle(style
, str
);
1755 ok(hres
== S_OK
, "put_fontStyle failed: %08x\n", hres
);
1758 str
= a2bstr("normal");
1759 hres
= IHTMLStyle_put_fontStyle(style
, str
);
1760 ok(hres
== S_OK
, "put_fontStyle failed: %08x\n", hres
);
1763 hres
= IHTMLStyle_put_fontStyle(style
, sDefault
);
1764 ok(hres
== S_OK
, "put_fontStyle failed: %08x\n", hres
);
1765 SysFreeString(sDefault
);
1768 hres
= IHTMLStyle_get_overflow(style
, NULL
);
1769 ok(hres
== E_INVALIDARG
, "get_overflow failed: %08x\n", hres
);
1771 hres
= IHTMLStyle_get_overflow(style
, &sOverflowDefault
);
1772 ok(hres
== S_OK
, "get_overflow failed: %08x\n", hres
);
1774 str
= a2bstr("test");
1775 hres
= IHTMLStyle_put_overflow(style
, str
);
1776 ok(hres
== (compat_mode
< COMPAT_IE9
? E_INVALIDARG
: S_OK
),
1777 "put_overflow failed: %08x\n", hres
);
1780 str
= a2bstr("visible");
1781 hres
= IHTMLStyle_put_overflow(style
, str
);
1782 ok(hres
== S_OK
, "put_overflow failed: %08x\n", hres
);
1785 str
= a2bstr("scroll");
1786 hres
= IHTMLStyle_put_overflow(style
, str
);
1787 ok(hres
== S_OK
, "put_overflow failed: %08x\n", hres
);
1790 str
= a2bstr("hidden");
1791 hres
= IHTMLStyle_put_overflow(style
, str
);
1792 ok(hres
== S_OK
, "put_overflow failed: %08x\n", hres
);
1795 str
= a2bstr("auto");
1796 hres
= IHTMLStyle_put_overflow(style
, str
);
1797 ok(hres
== S_OK
, "put_overflow failed: %08x\n", hres
);
1800 hres
= IHTMLStyle_get_overflow(style
, &str
);
1801 ok(hres
== S_OK
, "get_overflow failed: %08x\n", hres
);
1802 ok(!strcmp_wa(str
, "auto"), "str=%s\n", wine_dbgstr_w(str
));
1806 hres
= IHTMLStyle_put_overflow(style
, str
);
1807 ok(hres
== S_OK
, "put_overflow failed: %08x\n", hres
);
1810 hres
= IHTMLStyle_get_overflow(style
, &str
);
1811 ok(hres
== S_OK
, "get_overflow failed: %08x\n", hres
);
1812 ok(!str
, "str=%s\n", wine_dbgstr_w(str
));
1815 /* restore overflow default */
1816 hres
= IHTMLStyle_put_overflow(style
, sOverflowDefault
);
1817 ok(hres
== S_OK
, "put_overflow failed: %08x\n", hres
);
1818 SysFreeString(sOverflowDefault
);
1820 /* Attribute Tests*/
1821 hres
= IHTMLStyle_getAttribute(style
, NULL
, 1, &v
);
1822 ok(hres
== E_INVALIDARG
, "getAttribute failed: %08x\n", hres
);
1824 str
= a2bstr("position");
1825 hres
= IHTMLStyle_getAttribute(style
, str
, 1, NULL
);
1826 ok(hres
== E_INVALIDARG
, "getAttribute failed: %08x\n", hres
);
1828 hres
= IHTMLStyle_getAttribute(style
, str
, 1, &v
);
1829 ok(hres
== S_OK
, "getAttribute failed: %08x\n", hres
);
1830 ok(V_VT(&v
) == VT_BSTR
, "type failed: %d\n", V_VT(&v
));
1833 hres
= IHTMLStyle_setAttribute(style
, NULL
, v
, 1);
1834 ok(hres
== E_INVALIDARG
, "setAttribute failed: %08x\n", hres
);
1837 V_BSTR(&v
) = a2bstr("absolute");
1838 hres
= IHTMLStyle_setAttribute(style
, str
, v
, 1);
1839 ok(hres
== S_OK
, "setAttribute failed: %08x\n", hres
);
1842 hres
= IHTMLStyle_getAttribute(style
, str
, 1, &v
);
1843 ok(hres
== S_OK
, "getAttribute failed: %08x\n", hres
);
1844 ok(V_VT(&v
) == VT_BSTR
, "type failed: %d\n", V_VT(&v
));
1845 ok(!strcmp_wa(V_BSTR(&v
), "absolute"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v
)));
1850 hres
= IHTMLStyle_setAttribute(style
, str
, v
, 1);
1851 ok(hres
== S_OK
, "setAttribute failed: %08x\n", hres
);
1856 str
= a2bstr("borderLeftStyle");
1857 test_border_styles(style
, str
);
1860 str
= a2bstr("borderbottomstyle");
1861 test_border_styles(style
, str
);
1864 str
= a2bstr("borderrightstyle");
1865 test_border_styles(style
, str
);
1868 str
= a2bstr("bordertopstyle");
1869 test_border_styles(style
, str
);
1872 hres
= IHTMLStyle_get_borderStyle(style
, &sDefault
);
1873 ok(hres
== S_OK
, "get_borderStyle failed: %08x\n", hres
);
1875 str
= a2bstr("none dotted dashed solid");
1876 hres
= IHTMLStyle_put_borderStyle(style
, str
);
1877 ok(hres
== S_OK
, "put_borderStyle failed: %08x\n", hres
);
1880 str
= a2bstr("none dotted dashed solid");
1881 hres
= IHTMLStyle_get_borderStyle(style
, &str
);
1882 ok(hres
== S_OK
, "get_borderStyle failed: %08x\n", hres
);
1883 ok(!strcmp_wa(str
, "none dotted dashed solid"),
1884 "expected (none dotted dashed solid) = (%s)\n", wine_dbgstr_w(V_BSTR(&v
)));
1887 str
= a2bstr("double groove ridge inset");
1888 hres
= IHTMLStyle_put_borderStyle(style
, str
);
1889 ok(hres
== S_OK
, "put_borderStyle failed: %08x\n", hres
);
1892 str
= a2bstr("window-inset outset ridge inset");
1893 hres
= IHTMLStyle_put_borderStyle(style
, str
);
1894 ok(hres
== S_OK
, "put_borderStyle failed: %08x\n", hres
);
1897 str
= a2bstr("window-inset");
1898 hres
= IHTMLStyle_put_borderStyle(style
, str
);
1899 ok(hres
== S_OK
, "put_borderStyle failed: %08x\n", hres
);
1902 str
= a2bstr("none none none none none");
1903 hres
= IHTMLStyle_put_borderStyle(style
, str
);
1904 ok(hres
== S_OK
, "put_borderStyle failed: %08x\n", hres
);
1907 str
= a2bstr("invalid none none none");
1908 hres
= IHTMLStyle_put_borderStyle(style
, str
);
1909 todo_wine_if(compat_mode
>= COMPAT_IE9
)
1910 ok(hres
== (compat_mode
< COMPAT_IE9
? E_INVALIDARG
: S_OK
),
1911 "put_borderStyle failed: %08x\n", hres
);
1914 str
= a2bstr("none invalid none none");
1915 hres
= IHTMLStyle_put_borderStyle(style
, str
);
1916 todo_wine_if(compat_mode
>= COMPAT_IE9
)
1917 ok(hres
== (compat_mode
< COMPAT_IE9
? E_INVALIDARG
: S_OK
),
1918 "put_borderStyle failed: %08x\n", hres
);
1921 hres
= IHTMLStyle_put_borderStyle(style
, sDefault
);
1922 ok(hres
== S_OK
, "put_borderStyle failed: %08x\n", hres
);
1923 SysFreeString(sDefault
);
1925 /* backgroundColor */
1926 hres
= IHTMLStyle_get_backgroundColor(style
, &v
);
1927 ok(hres
== S_OK
, "get_backgroundColor: %08x\n", hres
);
1928 ok(V_VT(&v
) == VT_BSTR
, "type failed: %d\n", V_VT(&v
));
1929 ok(!V_BSTR(&v
), "str=%s\n", wine_dbgstr_w(V_BSTR(&v
)));
1933 V_BSTR(&v
) = a2bstr("red");
1934 hres
= IHTMLStyle_put_backgroundColor(style
, v
);
1935 ok(hres
== S_OK
, "put_backgroundColor failed: %08x\n", hres
);
1938 hres
= IHTMLStyle_get_backgroundColor(style
, &v
);
1939 ok(hres
== S_OK
, "get_backgroundColor: %08x\n", hres
);
1940 ok(V_VT(&v
) == VT_BSTR
, "type failed: %d\n", V_VT(&v
));
1941 ok(!strcmp_wa(V_BSTR(&v
), "red"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v
)));
1944 str
= a2bstr("fixed");
1945 hres
= IHTMLStyle_put_backgroundAttachment(style
, str
);
1946 ok(hres
== S_OK
, "put_backgroundAttachment failed: %08x\n", hres
);
1949 hres
= IHTMLStyle_get_backgroundAttachment(style
, &str
);
1950 ok(hres
== S_OK
, "get_backgroundAttachment failed: %08x\n", hres
);
1951 ok(!strcmp_wa(str
, "fixed"), "ret = %s\n", wine_dbgstr_w(str
));
1955 hres
= IHTMLStyle_get_padding(style
, &str
);
1956 ok(hres
== S_OK
, "get_padding failed: %08x\n", hres
);
1957 ok(!str
, "padding = %s\n", wine_dbgstr_w(str
));
1960 hres
= IHTMLStyle_get_paddingTop(style
, &v
);
1961 ok(hres
== S_OK
, "get_paddingTop: %08x\n", hres
);
1962 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
1963 ok(!V_BSTR(&v
), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1967 hres
= IHTMLStyle_put_paddingTop(style
, v
);
1968 ok(hres
== S_OK
, "put_paddingTop failed: %08x\n", hres
);
1970 hres
= IHTMLStyle_get_paddingTop(style
, &v
);
1971 ok(hres
== S_OK
, "get_paddingTop: %08x\n", hres
);
1972 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
1973 if(compat_mode
< COMPAT_IE9
)
1974 ok(!strcmp_wa(V_BSTR(&v
), "6px"), "paddingTop = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1976 ok(!V_BSTR(&v
), "paddingTop = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1979 hres
= IHTMLStyle_get_paddingRight(style
, &v
);
1980 ok(hres
== S_OK
, "get_paddingRight: %08x\n", hres
);
1981 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
1982 ok(!V_BSTR(&v
), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1986 hres
= IHTMLStyle_put_paddingRight(style
, v
);
1987 ok(hres
== S_OK
, "put_paddingRight failed: %08x\n", hres
);
1989 hres
= IHTMLStyle_get_paddingRight(style
, &v
);
1990 ok(hres
== S_OK
, "get_paddingRight: %08x\n", hres
);
1991 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
1992 if(compat_mode
< COMPAT_IE9
)
1993 ok(!strcmp_wa(V_BSTR(&v
), "6px"), "paddingRight = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1995 ok(!V_BSTR(&v
), "paddingRight = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1998 hres
= IHTMLStyle_get_paddingBottom(style
, &v
);
1999 ok(hres
== S_OK
, "get_paddingBottom: %08x\n", hres
);
2000 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
2001 ok(!V_BSTR(&v
), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2005 hres
= IHTMLStyle_put_paddingBottom(style
, v
);
2006 ok(hres
== S_OK
, "put_paddingBottom failed: %08x\n", hres
);
2008 hres
= IHTMLStyle_get_paddingBottom(style
, &v
);
2009 ok(hres
== S_OK
, "get_paddingBottom: %08x\n", hres
);
2010 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
2011 if(compat_mode
< COMPAT_IE9
)
2012 ok(!strcmp_wa(V_BSTR(&v
), "6px"), "paddingBottom = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2014 ok(!V_BSTR(&v
), "paddingBottom = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2018 hres
= IHTMLStyle_put_padding(style
, str
);
2019 ok(hres
== S_OK
, "put_padding failed: %08x\n", hres
);
2022 hres
= IHTMLStyle_get_padding(style
, &str
);
2023 ok(hres
== S_OK
, "get_padding failed: %08x\n", hres
);
2024 if(compat_mode
< COMPAT_IE9
)
2025 ok(!strcmp_wa(str
, "1px"), "padding = %s\n", wine_dbgstr_w(str
));
2027 ok(!str
, "padding = %s\n", wine_dbgstr_w(str
));
2031 hres
= IHTMLStyle_get_paddingLeft(style
, &vDefault
);
2032 ok(hres
== S_OK
, "get_paddingLeft: %08x\n", hres
);
2033 ok(V_VT(&vDefault
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&vDefault
));
2034 if(compat_mode
< COMPAT_IE9
)
2035 ok(!strcmp_wa(V_BSTR(&vDefault
), "1px"), "paddingLeft = %s\n",
2036 wine_dbgstr_w(V_BSTR(&vDefault
)));
2038 ok(!V_BSTR(&vDefault
), "paddingLeft = %s\n", wine_dbgstr_w(V_BSTR(&vDefault
)));
2041 V_BSTR(&v
) = a2bstr("10");
2042 hres
= IHTMLStyle_put_paddingLeft(style
, v
);
2043 ok(hres
== S_OK
, "put_paddingLeft: %08x\n", hres
);
2046 hres
= IHTMLStyle_get_paddingLeft(style
, &v
);
2047 ok(hres
== S_OK
, "get_paddingLeft: %08x\n", hres
);
2048 if(compat_mode
< COMPAT_IE9
)
2049 ok(!strcmp_wa(V_BSTR(&v
), "10px"), "paddingLeft = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2051 ok(!V_BSTR(&v
), "paddingLeft = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2054 hres
= IHTMLStyle_put_paddingLeft(style
, vDefault
);
2055 ok(hres
== S_OK
, "put_paddingLeft: %08x\n", hres
);
2057 /* BackgroundRepeat */
2058 hres
= IHTMLStyle_get_backgroundRepeat(style
, &sDefault
);
2059 ok(hres
== S_OK
, "get_backgroundRepeat failed: %08x\n", hres
);
2061 str
= a2bstr("invalid");
2062 hres
= IHTMLStyle_put_backgroundRepeat(style
, str
);
2063 ok(hres
== (compat_mode
< COMPAT_IE9
? E_INVALIDARG
: S_OK
),
2064 "put_backgroundRepeat failed: %08x\n", hres
);
2067 str
= a2bstr("repeat");
2068 hres
= IHTMLStyle_put_backgroundRepeat(style
, str
);
2069 ok(hres
== S_OK
, "put_backgroundRepeat failed: %08x\n", hres
);
2072 str
= a2bstr("no-repeat");
2073 hres
= IHTMLStyle_put_backgroundRepeat(style
, str
);
2074 ok(hres
== S_OK
, "put_backgroundRepeat failed: %08x\n", hres
);
2077 str
= a2bstr("repeat-x");
2078 hres
= IHTMLStyle_put_backgroundRepeat(style
, str
);
2079 ok(hres
== S_OK
, "put_backgroundRepeat failed: %08x\n", hres
);
2082 str
= a2bstr("repeat-y");
2083 hres
= IHTMLStyle_put_backgroundRepeat(style
, str
);
2084 ok(hres
== S_OK
, "put_backgroundRepeat failed: %08x\n", hres
);
2087 hres
= IHTMLStyle_get_backgroundRepeat(style
, &str
);
2088 ok(hres
== S_OK
, "get_backgroundRepeat failed: %08x\n", hres
);
2089 ok(!strcmp_wa(str
, "repeat-y"), "str=%s\n", wine_dbgstr_w(str
));
2092 hres
= IHTMLStyle_put_backgroundRepeat(style
, sDefault
);
2093 ok(hres
== S_OK
, "put_backgroundRepeat failed: %08x\n", hres
);
2094 SysFreeString(sDefault
);
2097 hres
= IHTMLStyle_get_borderColor(style
, &sDefault
);
2098 ok(hres
== S_OK
, "get_borderColor failed: %08x\n", hres
);
2100 str
= a2bstr("red green red blue");
2101 hres
= IHTMLStyle_put_borderColor(style
, str
);
2102 ok(hres
== S_OK
, "put_borderColor failed: %08x\n", hres
);
2105 hres
= IHTMLStyle_get_borderColor(style
, &str
);
2106 ok(hres
== S_OK
, "get_borderColor failed: %08x\n", hres
);
2107 ok(!strcmp_wa(str
, "red green red blue"), "str=%s\n", wine_dbgstr_w(str
));
2110 hres
= IHTMLStyle_put_borderColor(style
, sDefault
);
2111 ok(hres
== S_OK
, "put_borderColor failed: %08x\n", hres
);
2112 SysFreeString(sDefault
);
2115 hres
= IHTMLStyle_get_borderRight(style
, &sDefault
);
2116 ok(hres
== S_OK
, "get_borderRight failed: %08x\n", hres
);
2118 str
= a2bstr("thick dotted red");
2119 hres
= IHTMLStyle_put_borderRight(style
, str
);
2120 ok(hres
== S_OK
, "put_borderRight failed: %08x\n", hres
);
2123 /* IHTMLStyle_get_borderRight appears to have a bug where
2124 it returns the first letter of the color. So we check
2125 each style individually.
2128 hres
= IHTMLStyle_get_borderRightColor(style
, &v
);
2129 ok(hres
== S_OK
, "get_borderRightColor failed: %08x\n", hres
);
2130 ok(!strcmp_wa(V_BSTR(&v
), "red"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v
)));
2134 hres
= IHTMLStyle_get_borderRightWidth(style
, &v
);
2135 ok(hres
== S_OK
, "get_borderRightWidth failed: %08x\n", hres
);
2136 ok(!strcmp_wa(V_BSTR(&v
), "thick"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v
)));
2139 hres
= IHTMLStyle_get_borderRightStyle(style
, &str
);
2140 ok(hres
== S_OK
, "get_borderRightStyle failed: %08x\n", hres
);
2141 ok(!strcmp_wa(str
, "dotted"), "str=%s\n", wine_dbgstr_w(str
));
2144 hres
= IHTMLStyle_put_borderRight(style
, sDefault
);
2145 ok(hres
== S_OK
, "put_borderRight failed: %08x\n", hres
);
2146 SysFreeString(sDefault
);
2149 hres
= IHTMLStyle_get_borderTop(style
, &sDefault
);
2150 ok(hres
== S_OK
, "get_borderTop failed: %08x\n", hres
);
2152 str
= a2bstr("thick dotted red");
2153 hres
= IHTMLStyle_put_borderTop(style
, str
);
2154 ok(hres
== S_OK
, "put_borderTop failed: %08x\n", hres
);
2157 /* IHTMLStyle_get_borderTop appears to have a bug where
2158 it returns the first letter of the color. So we check
2159 each style individually.
2162 hres
= IHTMLStyle_get_borderTopColor(style
, &v
);
2163 ok(hres
== S_OK
, "get_borderTopColor failed: %08x\n", hres
);
2164 ok(!strcmp_wa(V_BSTR(&v
), "red"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v
)));
2168 hres
= IHTMLStyle_get_borderTopWidth(style
, &v
);
2169 ok(hres
== S_OK
, "get_borderTopWidth failed: %08x\n", hres
);
2170 ok(!strcmp_wa(V_BSTR(&v
), "thick"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v
)));
2173 hres
= IHTMLStyle_get_borderTopStyle(style
, &str
);
2174 ok(hres
== S_OK
, "get_borderTopStyle failed: %08x\n", hres
);
2175 ok(!strcmp_wa(str
, "dotted"), "str=%s\n", wine_dbgstr_w(str
));
2178 hres
= IHTMLStyle_put_borderTop(style
, sDefault
);
2179 ok(hres
== S_OK
, "put_borderTop failed: %08x\n", hres
);
2180 SysFreeString(sDefault
);
2183 hres
= IHTMLStyle_get_borderBottom(style
, &sDefault
);
2184 ok(hres
== S_OK
, "get_borderBottom failed: %08x\n", hres
);
2186 str
= a2bstr("thick dotted red");
2187 hres
= IHTMLStyle_put_borderBottom(style
, str
);
2188 ok(hres
== S_OK
, "put_borderBottom failed: %08x\n", hres
);
2191 /* IHTMLStyle_get_borderBottom appears to have a bug where
2192 it returns the first letter of the color. So we check
2193 each style individually.
2196 hres
= IHTMLStyle_get_borderBottomColor(style
, &v
);
2197 ok(hres
== S_OK
, "get_borderBottomColor failed: %08x\n", hres
);
2198 ok(!strcmp_wa(V_BSTR(&v
), "red"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v
)));
2202 hres
= IHTMLStyle_get_borderBottomWidth(style
, &v
);
2203 ok(hres
== S_OK
, "get_borderBottomWidth failed: %08x\n", hres
);
2204 ok(!strcmp_wa(V_BSTR(&v
), "thick"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v
)));
2207 hres
= IHTMLStyle_get_borderBottomStyle(style
, &str
);
2208 ok(hres
== S_OK
, "get_borderBottomStyle failed: %08x\n", hres
);
2209 ok(!strcmp_wa(str
, "dotted"), "str=%s\n", wine_dbgstr_w(str
));
2212 hres
= IHTMLStyle_put_borderBottom(style
, sDefault
);
2213 ok(hres
== S_OK
, "put_borderBottom failed: %08x\n", hres
);
2214 SysFreeString(sDefault
);
2217 hres
= IHTMLStyle_get_borderLeft(style
, &sDefault
);
2218 ok(hres
== S_OK
, "get_borderLeft failed: %08x\n", hres
);
2220 str
= a2bstr("thick dotted red");
2221 hres
= IHTMLStyle_put_borderLeft(style
, str
);
2222 ok(hres
== S_OK
, "put_borderLeft failed: %08x\n", hres
);
2225 /* IHTMLStyle_get_borderLeft appears to have a bug where
2226 it returns the first letter of the color. So we check
2227 each style individually.
2230 hres
= IHTMLStyle_get_borderLeftColor(style
, &v
);
2231 ok(hres
== S_OK
, "get_borderLeftColor failed: %08x\n", hres
);
2232 ok(!strcmp_wa(V_BSTR(&v
), "red"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v
)));
2236 hres
= IHTMLStyle_get_borderLeftWidth(style
, &v
);
2237 ok(hres
== S_OK
, "get_borderLeftWidth failed: %08x\n", hres
);
2238 ok(!strcmp_wa(V_BSTR(&v
), "thick"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v
)));
2241 hres
= IHTMLStyle_get_borderLeftStyle(style
, &str
);
2242 ok(hres
== S_OK
, "get_borderLeftStyle failed: %08x\n", hres
);
2243 ok(!strcmp_wa(str
, "dotted"), "str=%s\n", wine_dbgstr_w(str
));
2246 hres
= IHTMLStyle_put_borderLeft(style
, sDefault
);
2247 ok(hres
== S_OK
, "put_borderLeft failed: %08x\n", hres
);
2248 SysFreeString(sDefault
);
2250 /* backgroundPositionX */
2251 hres
= IHTMLStyle_get_backgroundPositionX(style
, &v
);
2252 ok(hres
== S_OK
, "get_backgroundPositionX failed: %08x\n", hres
);
2253 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
2254 ok(!V_BSTR(&v
), "backgroundPositionX = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2258 V_BSTR(&v
) = a2bstr("10px");
2259 hres
= IHTMLStyle_put_backgroundPositionX(style
, v
);
2260 ok(hres
== S_OK
, "put_backgroundPositionX failed: %08x\n", hres
);
2263 hres
= IHTMLStyle_get_backgroundPositionX(style
, &v
);
2264 ok(hres
== S_OK
, "get_backgroundPositionX failed: %08x\n", hres
);
2265 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
2266 ok(!strcmp_wa(V_BSTR(&v
), "10px"), "backgroundPositionX = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2269 /* backgroundPositionY */
2270 hres
= IHTMLStyle_get_backgroundPositionY(style
, &v
);
2271 ok(hres
== S_OK
, "get_backgroundPositionY failed: %08x\n", hres
);
2272 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
2276 V_BSTR(&v
) = a2bstr("15px");
2277 hres
= IHTMLStyle_put_backgroundPositionY(style
, v
);
2278 ok(hres
== S_OK
, "put_backgroundPositionY failed: %08x\n", hres
);
2281 hres
= IHTMLStyle_get_backgroundPositionY(style
, &v
);
2282 ok(hres
== S_OK
, "get_backgroundPositionY failed: %08x\n", hres
);
2283 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
2284 ok(!strcmp_wa(V_BSTR(&v
), "15px"), "backgroundPositionY = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2287 /* backgroundPosition */
2289 hres
= IHTMLStyle_get_backgroundPosition(style
, &str
);
2290 ok(hres
== S_OK
, "get_backgroundPosition failed: %08x\n", hres
);
2291 ok(!strcmp_wa(str
, "10px 15px"), "backgroundPosition = %s\n", wine_dbgstr_w(str
));
2294 str
= a2bstr("center 20%");
2295 hres
= IHTMLStyle_put_backgroundPosition(style
, str
);
2296 ok(hres
== S_OK
, "put_backgroundPosition failed: %08x\n", hres
);
2300 hres
= IHTMLStyle_get_backgroundPosition(style
, &str
);
2301 ok(hres
== S_OK
, "get_backgroundPosition failed: %08x\n", hres
);
2302 ok(!strcmp_wa(str
, "center 20%"), "backgroundPosition = %s\n", wine_dbgstr_w(str
));
2305 hres
= IHTMLStyle_get_backgroundPositionX(style
, &v
);
2306 ok(hres
== S_OK
, "get_backgroundPositionX failed: %08x\n", hres
);
2307 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
2308 ok(!strcmp_wa(V_BSTR(&v
), "center"), "backgroundPositionX = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2311 hres
= IHTMLStyle_get_backgroundPositionY(style
, &v
);
2312 ok(hres
== S_OK
, "get_backgroundPositionY failed: %08x\n", hres
);
2313 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
2314 ok(!strcmp_wa(V_BSTR(&v
), "20%"), "backgroundPositionY = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2317 /* borderTopWidth */
2318 hres
= IHTMLStyle_get_borderTopWidth(style
, &vDefault
);
2319 ok(hres
== S_OK
, "get_borderTopWidth: %08x\n", hres
);
2322 V_BSTR(&v
) = a2bstr("10px");
2323 hres
= IHTMLStyle_put_borderTopWidth(style
, v
);
2324 ok(hres
== S_OK
, "put_borderTopWidth: %08x\n", hres
);
2327 hres
= IHTMLStyle_get_borderTopWidth(style
, &v
);
2328 ok(hres
== S_OK
, "get_borderTopWidth: %08x\n", hres
);
2329 ok(!strcmp_wa(V_BSTR(&v
), "10px"), "expected 10px = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2332 hres
= IHTMLStyle_put_borderTopWidth(style
, vDefault
);
2333 ok(hres
== S_OK
, "put_borderTopWidth: %08x\n", hres
);
2334 VariantClear(&vDefault
);
2336 /* borderRightWidth */
2337 hres
= IHTMLStyle_get_borderRightWidth(style
, &vDefault
);
2338 ok(hres
== S_OK
, "get_borderRightWidth: %08x\n", hres
);
2341 V_BSTR(&v
) = a2bstr("10");
2342 hres
= IHTMLStyle_put_borderRightWidth(style
, v
);
2343 ok(hres
== S_OK
, "put_borderRightWidth: %08x\n", hres
);
2346 hres
= IHTMLStyle_get_borderRightWidth(style
, &v
);
2347 ok(hres
== S_OK
, "get_borderRightWidth: %08x\n", hres
);
2348 ok(!strcmp_wa(V_BSTR(&v
), compat_mode
< COMPAT_IE9
? "10px" : "1px"),
2349 "borderRightWidth = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2352 hres
= IHTMLStyle_put_borderRightWidth(style
, vDefault
);
2353 ok(hres
== S_OK
, "put_borderRightWidth: %08x\n", hres
);
2354 VariantClear(&vDefault
);
2356 /* borderBottomWidth */
2357 hres
= IHTMLStyle_get_borderBottomWidth(style
, &vDefault
);
2358 ok(hres
== S_OK
, "get_borderBottomWidth: %08x\n", hres
);
2361 V_BSTR(&v
) = a2bstr("10");
2362 hres
= IHTMLStyle_put_borderBottomWidth(style
, v
);
2363 ok(hres
== S_OK
, "put_borderBottomWidth: %08x\n", hres
);
2366 hres
= IHTMLStyle_get_borderBottomWidth(style
, &v
);
2367 ok(hres
== S_OK
, "get_borderBottomWidth: %08x\n", hres
);
2368 ok(!strcmp_wa(V_BSTR(&v
), compat_mode
< COMPAT_IE9
? "10px" : "1px"),
2369 "borderBottomWidth = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2372 hres
= IHTMLStyle_put_borderBottomWidth(style
, vDefault
);
2373 ok(hres
== S_OK
, "put_borderBottomWidth: %08x\n", hres
);
2374 VariantClear(&vDefault
);
2376 /* borderLeftWidth */
2377 hres
= IHTMLStyle_get_borderLeftWidth(style
, &vDefault
);
2378 ok(hres
== S_OK
, "get_borderLeftWidth: %08x\n", hres
);
2381 V_BSTR(&v
) = a2bstr("10");
2382 hres
= IHTMLStyle_put_borderLeftWidth(style
, v
);
2383 ok(hres
== S_OK
, "put_borderLeftWidth: %08x\n", hres
);
2386 hres
= IHTMLStyle_get_borderLeftWidth(style
, &v
);
2387 ok(hres
== S_OK
, "get_borderLeftWidth: %08x\n", hres
);
2388 ok(!strcmp_wa(V_BSTR(&v
), compat_mode
< COMPAT_IE9
? "10px" : "1px"),
2389 "expected 10px = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2392 hres
= IHTMLStyle_put_borderLeftWidth(style
, vDefault
);
2393 ok(hres
== S_OK
, "put_borderLeftWidth: %08x\n", hres
);
2394 VariantClear(&vDefault
);
2397 hres
= IHTMLStyle_get_wordSpacing(style
, &vDefault
);
2398 ok(hres
== S_OK
, "get_wordSpacing: %08x\n", hres
);
2401 V_BSTR(&v
) = a2bstr("10");
2402 hres
= IHTMLStyle_put_wordSpacing(style
, v
);
2403 ok(hres
== S_OK
, "put_wordSpacing: %08x\n", hres
);
2406 hres
= IHTMLStyle_get_wordSpacing(style
, &v
);
2407 ok(hres
== S_OK
, "get_wordSpacing: %08x\n", hres
);
2408 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
2409 if(compat_mode
< COMPAT_IE9
)
2410 ok(!strcmp_wa(V_BSTR(&v
), "10px"), "expected 10px = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2412 ok(!V_BSTR(&v
), "expected 10px = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2415 hres
= IHTMLStyle_put_wordSpacing(style
, vDefault
);
2416 ok(hres
== S_OK
, "put_wordSpacing: %08x\n", hres
);
2417 VariantClear(&vDefault
);
2420 hres
= IHTMLStyle_get_letterSpacing(style
, &vDefault
);
2421 ok(hres
== S_OK
, "get_letterSpacing: %08x\n", hres
);
2424 V_BSTR(&v
) = a2bstr("11");
2425 hres
= IHTMLStyle_put_letterSpacing(style
, v
);
2426 ok(hres
== S_OK
, "put_letterSpacing: %08x\n", hres
);
2429 hres
= IHTMLStyle_get_letterSpacing(style
, &v
);
2430 ok(hres
== S_OK
, "get_letterSpacing: %08x\n", hres
);
2431 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
2432 if(compat_mode
< COMPAT_IE9
)
2433 ok(!strcmp_wa(V_BSTR(&v
), "11px"), "letterSpacing = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2435 ok(!V_BSTR(&v
), "letterSpacing = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2438 hres
= IHTMLStyle_put_letterSpacing(style
, vDefault
);
2439 ok(hres
== S_OK
, "put_letterSpacing: %08x\n", hres
);
2440 VariantClear(&vDefault
);
2442 /* borderTopColor */
2443 hres
= IHTMLStyle_get_borderTopColor(style
, &vDefault
);
2444 ok(hres
== S_OK
, "get_borderTopColor: %08x\n", hres
);
2447 V_BSTR(&v
) = a2bstr("red");
2448 hres
= IHTMLStyle_put_borderTopColor(style
, v
);
2449 ok(hres
== S_OK
, "put_borderTopColor: %08x\n", hres
);
2452 hres
= IHTMLStyle_get_borderTopColor(style
, &v
);
2453 ok(hres
== S_OK
, "get_borderTopColor: %08x\n", hres
);
2454 ok(!strcmp_wa(V_BSTR(&v
), "red"), "expecte red = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2457 hres
= IHTMLStyle_put_borderTopColor(style
, vDefault
);
2458 ok(hres
== S_OK
, "put_borderTopColor: %08x\n", hres
);
2460 /* borderRightColor */
2461 hres
= IHTMLStyle_get_borderRightColor(style
, &vDefault
);
2462 ok(hres
== S_OK
, "get_borderRightColor: %08x\n", hres
);
2465 V_BSTR(&v
) = a2bstr("blue");
2466 hres
= IHTMLStyle_put_borderRightColor(style
, v
);
2467 ok(hres
== S_OK
, "put_borderRightColor: %08x\n", hres
);
2470 hres
= IHTMLStyle_get_borderRightColor(style
, &v
);
2471 ok(hres
== S_OK
, "get_borderRightColor: %08x\n", hres
);
2472 ok(!strcmp_wa(V_BSTR(&v
), "blue"), "expected blue = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2475 hres
= IHTMLStyle_put_borderRightColor(style
, vDefault
);
2476 ok(hres
== S_OK
, "putborderRightColorr: %08x\n", hres
);
2478 /* borderBottomColor */
2479 hres
= IHTMLStyle_get_borderBottomColor(style
, &vDefault
);
2480 ok(hres
== S_OK
, "get_borderBottomColor: %08x\n", hres
);
2483 V_BSTR(&v
) = a2bstr("cyan");
2484 hres
= IHTMLStyle_put_borderBottomColor(style
, v
);
2485 ok(hres
== S_OK
, "put_borderBottomColor: %08x\n", hres
);
2488 hres
= IHTMLStyle_get_borderBottomColor(style
, &v
);
2489 ok(hres
== S_OK
, "get_borderBottomColor: %08x\n", hres
);
2490 ok(!strcmp_wa(V_BSTR(&v
), "cyan"), "expected cyan = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2493 hres
= IHTMLStyle_put_borderBottomColor(style
, vDefault
);
2494 ok(hres
== S_OK
, "put_borderBottomColor: %08x\n", hres
);
2496 /* borderLeftColor */
2497 hres
= IHTMLStyle_get_borderLeftColor(style
, &vDefault
);
2498 ok(hres
== S_OK
, "get_borderLeftColor: %08x\n", hres
);
2501 V_BSTR(&v
) = a2bstr("cyan");
2502 hres
= IHTMLStyle_put_borderLeftColor(style
, v
);
2503 ok(hres
== S_OK
, "put_borderLeftColor: %08x\n", hres
);
2506 hres
= IHTMLStyle_get_borderLeftColor(style
, &v
);
2507 ok(hres
== S_OK
, "get_borderLeftColor: %08x\n", hres
);
2508 ok(!strcmp_wa(V_BSTR(&v
), "cyan"), "expected cyan = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2511 hres
= IHTMLStyle_put_borderLeftColor(style
, vDefault
);
2512 ok(hres
== S_OK
, "put_borderLeftColor: %08x\n", hres
);
2515 hres
= IHTMLStyle_get_clip(style
, &str
);
2516 ok(hres
== S_OK
, "get_clip failed: %08x\n", hres
);
2517 ok(!str
, "clip = %s\n", wine_dbgstr_w(str
));
2519 str
= a2bstr("rect(0px 1px 500px 505px)");
2520 hres
= IHTMLStyle_put_clip(style
, str
);
2521 ok(hres
== S_OK
, "put_clip failed: %08x\n", hres
);
2524 hres
= IHTMLStyle_get_clip(style
, &str
);
2525 ok(hres
== S_OK
, "get_clip failed: %08x\n", hres
);
2526 ok(!strcmp_wa(str
, compat_mode
< COMPAT_IE9
? "rect(0px 1px 500px 505px)" : "rect(0px, 1px, 500px, 505px)"),
2527 "clip = %s\n", wine_dbgstr_w(str
));
2531 hres
= IHTMLStyle_get_clear(style
, &str
);
2532 ok(hres
== S_OK
, "get_clear failed: %08x\n", hres
);
2533 ok(!str
, "clear = %s\n", wine_dbgstr_w(str
));
2535 str
= a2bstr("both");
2536 hres
= IHTMLStyle_put_clear(style
, str
);
2537 ok(hres
== S_OK
, "put_clear failed: %08x\n", hres
);
2540 hres
= IHTMLStyle_get_clear(style
, &str
);
2541 ok(hres
== S_OK
, "get_clear failed: %08x\n", hres
);
2542 ok(!strcmp_wa(str
, "both"), "clear = %s\n", wine_dbgstr_w(str
));
2545 /* pageBreakAfter */
2546 hres
= IHTMLStyle_get_pageBreakAfter(style
, &str
);
2547 ok(hres
== S_OK
, "get_pageBreakAfter failed: %08x\n", hres
);
2548 ok(!str
, "pageBreakAfter = %s\n", wine_dbgstr_w(str
));
2550 str
= a2bstr("always");
2551 hres
= IHTMLStyle_put_pageBreakAfter(style
, str
);
2552 ok(hres
== S_OK
, "put_pageBreakAfter failed: %08x\n", hres
);
2555 hres
= IHTMLStyle_get_pageBreakAfter(style
, &str
);
2556 ok(hres
== S_OK
, "get_pageBreakAfter failed: %08x\n", hres
);
2557 ok(!strcmp_wa(str
, "always"), "pageBreakAfter = %s\n", wine_dbgstr_w(str
));
2560 /* pageBreakBefore */
2561 hres
= IHTMLStyle_get_pageBreakBefore(style
, &str
);
2562 ok(hres
== S_OK
, "get_pageBreakBefore failed: %08x\n", hres
);
2563 ok(!str
, "pageBreakBefore = %s\n", wine_dbgstr_w(str
));
2565 str
= a2bstr("always");
2566 hres
= IHTMLStyle_put_pageBreakBefore(style
, str
);
2567 ok(hres
== S_OK
, "put_pageBreakBefore failed: %08x\n", hres
);
2570 hres
= IHTMLStyle_get_pageBreakBefore(style
, &str
);
2571 ok(hres
== S_OK
, "get_pageBreakBefore failed: %08x\n", hres
);
2572 ok(!strcmp_wa(str
, "always"), "pageBreakBefore = %s\n", wine_dbgstr_w(str
));
2575 test_style_remove_attribute(style
, "pageBreakBefore", VARIANT_TRUE
);
2576 test_style_remove_attribute(style
, "pageBreakBefore", VARIANT_FALSE
);
2578 hres
= IHTMLStyle_get_pageBreakBefore(style
, &str
);
2579 ok(hres
== S_OK
, "get_pageBreakBefore failed: %08x\n", hres
);
2580 ok(!str
, "pageBreakBefore = %s\n", wine_dbgstr_w(str
));
2582 str
= (void*)0xdeadbeef;
2583 hres
= IHTMLStyle_get_whiteSpace(style
, &str
);
2584 ok(hres
== S_OK
, "get_whiteSpace failed: %08x\n", hres
);
2585 ok(!str
, "whiteSpace = %s\n", wine_dbgstr_w(str
));
2587 str
= a2bstr("nowrap");
2588 hres
= IHTMLStyle_put_whiteSpace(style
, str
);
2590 ok(hres
== S_OK
, "put_whiteSpace failed: %08x\n", hres
);
2593 hres
= IHTMLStyle_get_whiteSpace(style
, &str
);
2594 ok(hres
== S_OK
, "get_whiteSpace failed: %08x\n", hres
);
2595 ok(!strcmp_wa(str
, "nowrap"), "whiteSpace = %s\n", wine_dbgstr_w(str
));
2598 str
= a2bstr("normal");
2599 hres
= IHTMLStyle_put_whiteSpace(style
, str
);
2601 ok(hres
== S_OK
, "put_whiteSpace failed: %08x\n", hres
);
2604 hres
= IHTMLStyle_get_whiteSpace(style
, &str
);
2605 ok(hres
== S_OK
, "get_whiteSpace failed: %08x\n", hres
);
2606 ok(!strcmp_wa(str
, "normal"), "whiteSpace = %s\n", wine_dbgstr_w(str
));
2610 hres
= IHTMLStyle_get_listStyleType(style
, &str
);
2611 ok(hres
== S_OK
, "get_listStyleType failed: %08x\n", hres
);
2612 ok(!str
, "listStyleType = %s\n", wine_dbgstr_w(str
));
2614 str
= a2bstr("square");
2615 hres
= IHTMLStyle_put_listStyleType(style
, str
);
2616 ok(hres
== S_OK
, "put_listStyleType failed: %08x\n", hres
);
2620 hres
= IHTMLStyle_get_listStyleType(style
, &str
);
2621 ok(hres
== S_OK
, "get_listStyleType failed: %08x\n", hres
);
2622 ok(!strcmp_wa(str
, "square"), "listStyleType = %s\n", wine_dbgstr_w(str
));
2624 str
= a2bstr("inside");
2625 hres
= IHTMLStyle_put_listStylePosition(style
, str
);
2626 ok(hres
== S_OK
, "put_listStylePosition failed: %08x\n", hres
);
2629 hres
= IHTMLStyle_get_listStylePosition(style
, &str
);
2630 ok(hres
== S_OK
, "get_listStylePosition failed: %08x\n", hres
);
2631 ok(!strcmp_wa(str
, "inside"), "listStyleType = %s\n", wine_dbgstr_w(str
));
2634 str
= a2bstr("decimal-leading-zero none inside");
2635 hres
= IHTMLStyle_put_listStyle(style
, str
);
2636 ok(hres
== S_OK
|| broken(hres
== E_INVALIDARG
), /* win 2000 */
2637 "put_listStyle(%s) failed: %08x\n", wine_dbgstr_w(str
), hres
);
2640 if (hres
!= E_INVALIDARG
) {
2641 hres
= IHTMLStyle_get_listStyle(style
, &str
);
2642 ok(hres
== S_OK
, "get_listStyle failed: %08x\n", hres
);
2643 ok(strstr_wa(str
, "decimal-leading-zero") &&
2644 strstr_wa(str
, "inside") != NULL
,
2645 "listStyle = %s\n", wine_dbgstr_w(str
));
2646 if(compat_mode
< COMPAT_IE9
)
2647 ok(strstr_wa(str
, "none") != NULL
, "listStyle = %s\n", wine_dbgstr_w(str
));
2650 ok(!strstr_wa(str
, "none"), "listStyle = %s\n", wine_dbgstr_w(str
));
2654 win_skip("IHTMLStyle_put_listStyle already failed\n");
2657 str
= (void*)0xdeadbeef;
2658 hres
= IHTMLStyle_get_styleFloat(style
, &str
);
2659 ok(hres
== S_OK
, "get_styleFloat failed: %08x\n", hres
);
2660 ok(!str
, "styleFloat = %s\n", wine_dbgstr_w(str
));
2662 str
= a2bstr("left");
2663 hres
= IHTMLStyle_put_styleFloat(style
, str
);
2664 ok(hres
== S_OK
, "put_styleFloat failed: %08x\n", hres
);
2668 hres
= IHTMLStyle_get_styleFloat(style
, &str
);
2669 ok(hres
== S_OK
, "get_styleFloat failed: %08x\n", hres
);
2670 ok(!strcmp_wa(str
, "left"), "styleFloat = %s\n", wine_dbgstr_w(str
));
2672 hres
= IHTMLStyle_QueryInterface(style
, &IID_IHTMLStyle2
, (void**)&style2
);
2673 ok(hres
== S_OK
, "Could not get IHTMLStyle2 iface: %08x\n", hres
);
2674 if(SUCCEEDED(hres
)) {
2675 test_style2(style2
);
2676 IHTMLStyle2_Release(style2
);
2679 hres
= IHTMLStyle_QueryInterface(style
, &IID_IHTMLStyle3
, (void**)&style3
);
2680 ok(hres
== S_OK
, "Could not get IHTMLStyle3 iface: %08x\n", hres
);
2681 if(SUCCEEDED(hres
)) {
2682 test_style3(style3
);
2683 IHTMLStyle3_Release(style3
);
2686 hres
= IHTMLStyle_QueryInterface(style
, &IID_IHTMLStyle4
, (void**)&style4
);
2687 ok(hres
== S_OK
, "Could not get IHTMLStyle4 iface: %08x\n", hres
);
2688 if(SUCCEEDED(hres
)) {
2689 test_style4(style4
);
2690 IHTMLStyle4_Release(style4
);
2693 hres
= IHTMLStyle_QueryInterface(style
, &IID_IHTMLStyle5
, (void**)&style5
);
2694 if(SUCCEEDED(hres
)) {
2695 test_style5(style5
);
2696 IHTMLStyle5_Release(style5
);
2698 win_skip("IHTMLStyle5 not available\n");
2701 hres
= IHTMLStyle_QueryInterface(style
, &IID_IHTMLStyle6
, (void**)&style6
);
2702 if(SUCCEEDED(hres
)) {
2703 test_style6(style6
);
2704 IHTMLStyle6_Release(style6
);
2706 win_skip("IHTMLStyle6 not available\n");
2710 #define test_style_filter(a,b) _test_style_filter(__LINE__,a,b)
2711 static void _test_style_filter(unsigned line
, IHTMLStyle
*style
, const char *exval
)
2716 str
= (void*)0xdeadbeef;
2717 hres
= IHTMLStyle_get_filter(style
, &str
);
2718 ok_(__FILE__
,line
)(hres
== S_OK
, "get_filter failed: %08x\n", hres
);
2720 ok_(__FILE__
,line
)(str
&& !strcmp_wa(str
, exval
), "filter = %s, expected %s\n", wine_dbgstr_w(str
), exval
);
2722 ok_(__FILE__
,line
)(!str
, "str = %s, expected NULL\n", wine_dbgstr_w(str
));
2727 #define test_current_style_filter(a,b) _test_current_style_filter(__LINE__,a,b)
2728 static void _test_current_style_filter(unsigned line
, IHTMLCurrentStyle2
*style
, const char *exval
)
2733 str
= (void*)0xdeadbeef;
2734 hres
= IHTMLCurrentStyle2_get_filter(style
, &str
);
2735 ok_(__FILE__
,line
)(hres
== S_OK
, "get_filter failed: %08x\n", hres
);
2737 ok_(__FILE__
,line
)(str
&& !strcmp_wa(str
, exval
), "filter = %s, expected %s\n", wine_dbgstr_w(str
), exval
);
2739 ok_(__FILE__
,line
)(!str
, "str = %s, expected NULL\n", wine_dbgstr_w(str
));
2744 #define set_style_filter(a,b) _set_style_filter(__LINE__,a,b)
2745 static void _set_style_filter(unsigned line
, IHTMLStyle
*style
, const char *val
)
2747 BSTR str
= a2bstr(val
);
2750 hres
= IHTMLStyle_put_filter(style
, str
);
2751 ok_(__FILE__
,line
)(hres
== S_OK
, "put_filter failed: %08x\n", hres
);
2754 _test_style_filter(line
, style
, val
);
2757 static void test_style_filters(IHTMLElement
*elem
)
2759 IHTMLElement2
*elem2
= get_elem2_iface((IUnknown
*)elem
);
2760 IHTMLCurrentStyle2
*current_style2
;
2761 IHTMLCurrentStyle
*current_style
;
2765 hres
= IHTMLElement_get_style(elem
, &style
);
2766 ok(hres
== S_OK
, "get_style failed: %08x\n", hres
);
2768 hres
= IHTMLElement2_get_currentStyle(elem2
, ¤t_style
);
2769 ok(hres
== S_OK
, "get_style failed: %08x\n", hres
);
2771 current_style2
= get_current_style2_iface((IUnknown
*)current_style
);
2773 test_style_filter(style
, NULL
);
2774 test_current_style_filter(current_style2
, NULL
);
2775 set_style_filter(style
, "alpha(opacity=50.0040)");
2776 test_current_style_filter(current_style2
, "alpha(opacity=50.0040)");
2777 set_style_filter(style
, "alpha(opacity=100)");
2779 IHTMLStyle_Release(style
);
2781 hres
= IHTMLElement_get_style(elem
, &style
);
2782 ok(hres
== S_OK
, "get_style failed: %08x\n", hres
);
2784 test_style_filter(style
, "alpha(opacity=100)");
2785 set_style_filter(style
, "xxx(a,b,c) alpha(opacity=100)");
2786 set_style_filter(style
, NULL
);
2787 set_style_filter(style
, "alpha(opacity=100)");
2788 test_style_remove_attribute(style
, "filter", VARIANT_TRUE
);
2789 test_style_remove_attribute(style
, "filter", VARIANT_FALSE
);
2790 test_style_filter(style
, NULL
);
2793 IHTMLCurrentStyle2_Release(current_style2
);
2794 IHTMLStyle_Release(style
);
2795 IHTMLElement2_Release(elem2
);
2798 static void test_current_style(IHTMLCurrentStyle
*current_style
)
2800 IHTMLCurrentStyle2
*current_style2
;
2801 IHTMLCurrentStyle3
*current_style3
;
2802 IHTMLCurrentStyle4
*current_style4
;
2808 hres
= IHTMLCurrentStyle_get_display(current_style
, &str
);
2809 ok(hres
== S_OK
, "get_display failed: %08x\n", hres
);
2810 ok(!strcmp_wa(str
, "block"), "get_display returned %s\n", wine_dbgstr_w(str
));
2813 hres
= IHTMLCurrentStyle_get_position(current_style
, &str
);
2814 ok(hres
== S_OK
, "get_position failed: %08x\n", hres
);
2815 ok(!strcmp_wa(str
, "absolute"), "get_position returned %s\n", wine_dbgstr_w(str
));
2818 hres
= IHTMLCurrentStyle_get_fontFamily(current_style
, &str
);
2819 ok(hres
== S_OK
, "get_fontFamily failed: %08x\n", hres
);
2822 hres
= IHTMLCurrentStyle_get_fontStyle(current_style
, &str
);
2823 ok(hres
== S_OK
, "get_fontStyle failed: %08x\n", hres
);
2824 ok(!strcmp_wa(str
, "normal"), "get_fontStyle returned %s\n", wine_dbgstr_w(str
));
2827 hres
= IHTMLCurrentStyle_get_backgroundImage(current_style
, &str
);
2828 ok(hres
== S_OK
, "get_backgroundImage failed: %08x\n", hres
);
2829 ok(!strcmp_wa(str
, "none"), "get_backgroundImage returned %s\n", wine_dbgstr_w(str
));
2832 hres
= IHTMLCurrentStyle_get_fontVariant(current_style
, &str
);
2833 ok(hres
== S_OK
, "get_fontVariant failed: %08x\n", hres
);
2834 ok(!strcmp_wa(str
, "normal"), "get_fontVariant returned %s\n", wine_dbgstr_w(str
));
2837 hres
= IHTMLCurrentStyle_get_borderTopStyle(current_style
, &str
);
2838 ok(hres
== S_OK
, "get_borderTopStyle failed: %08x\n", hres
);
2839 ok(!strcmp_wa(str
, "none"), "get_borderTopStyle returned %s\n", wine_dbgstr_w(str
));
2842 hres
= IHTMLCurrentStyle_get_borderRightStyle(current_style
, &str
);
2843 ok(hres
== S_OK
, "get_borderRightStyle failed: %08x\n", hres
);
2844 ok(!strcmp_wa(str
, "none"), "get_borderRightStyle returned %s\n", wine_dbgstr_w(str
));
2847 hres
= IHTMLCurrentStyle_get_borderBottomStyle(current_style
, &str
);
2848 ok(hres
== S_OK
, "get_borderBottomStyle failed: %08x\n", hres
);
2849 ok(!strcmp_wa(str
, "none"), "get_borderBottomStyle returned %s\n", wine_dbgstr_w(str
));
2852 hres
= IHTMLCurrentStyle_get_borderLeftStyle(current_style
, &str
);
2853 ok(hres
== S_OK
, "get_borderLeftStyle failed: %08x\n", hres
);
2854 ok(!strcmp_wa(str
, "none"), "get_borderLeftStyle returned %s\n", wine_dbgstr_w(str
));
2857 hres
= IHTMLCurrentStyle_get_textAlign(current_style
, &str
);
2858 ok(hres
== S_OK
, "get_textAlign failed: %08x\n", hres
);
2859 ok(!strcmp_wa(str
, "center"), "get_textAlign returned %s\n", wine_dbgstr_w(str
));
2862 hres
= IHTMLCurrentStyle_get_textDecoration(current_style
, &str
);
2863 ok(hres
== S_OK
, "get_textDecoration failed: %08x\n", hres
);
2864 ok(!strcmp_wa(str
, "none"), "get_textDecoration returned %s\n", wine_dbgstr_w(str
));
2867 hres
= IHTMLCurrentStyle_get_cursor(current_style
, &str
);
2868 ok(hres
== S_OK
, "get_cursor failed: %08x\n", hres
);
2869 ok(!strcmp_wa(str
, "default"), "get_cursor returned %s\n", wine_dbgstr_w(str
));
2872 hres
= IHTMLCurrentStyle_get_backgroundRepeat(current_style
, &str
);
2873 ok(hres
== S_OK
, "get_backgroundRepeat failed: %08x\n", hres
);
2874 ok(!strcmp_wa(str
, "repeat"), "get_backgroundRepeat returned %s\n", wine_dbgstr_w(str
));
2877 hres
= IHTMLCurrentStyle_get_borderColor(current_style
, &str
);
2878 ok(hres
== S_OK
, "get_borderColor failed: %08x\n", hres
);
2881 hres
= IHTMLCurrentStyle_get_borderStyle(current_style
, &str
);
2882 ok(hres
== S_OK
, "get_borderStyle failed: %08x\n", hres
);
2885 hres
= IHTMLCurrentStyle_get_visibility(current_style
, &str
);
2886 ok(hres
== S_OK
, "get_visibility failed: %08x\n", hres
);
2889 hres
= IHTMLCurrentStyle_get_overflow(current_style
, &str
);
2890 ok(hres
== S_OK
, "get_overflow failed: %08x\n", hres
);
2893 hres
= IHTMLCurrentStyle_get_borderWidth(current_style
, &str
);
2894 ok(hres
== S_OK
, "get_borderWidth failed: %08x\n", hres
);
2897 hres
= IHTMLCurrentStyle_get_margin(current_style
, &str
);
2898 ok(hres
== S_OK
, "get_margin failed: %08x\n", hres
);
2901 hres
= IHTMLCurrentStyle_get_padding(current_style
, &str
);
2902 ok(hres
== S_OK
, "get_padding failed: %08x\n", hres
);
2905 hres
= IHTMLCurrentStyle_get_fontWeight(current_style
, &v
);
2906 ok(hres
== S_OK
, "get_fontWeight failed: %08x\n", hres
);
2907 ok(V_VT(&v
) == VT_I4
, "V_VT(v) = %d\n", V_VT(&v
));
2908 ok( V_I4(&v
) == 400, "expect 400 got (%d)\n", V_I4(&v
));
2911 hres
= IHTMLCurrentStyle_get_fontSize(current_style
, &v
);
2912 ok(hres
== S_OK
, "get_fontSize failed: %08x\n", hres
);
2913 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
2916 hres
= IHTMLCurrentStyle_get_left(current_style
, &v
);
2917 ok(hres
== S_OK
, "get_left failed: %08x\n", hres
);
2918 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
2921 hres
= IHTMLCurrentStyle_get_top(current_style
, &v
);
2922 ok(hres
== S_OK
, "get_top failed: %08x\n", hres
);
2923 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
2926 hres
= IHTMLCurrentStyle_get_width(current_style
, &v
);
2927 ok(hres
== S_OK
, "get_width failed: %08x\n", hres
);
2928 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
2931 hres
= IHTMLCurrentStyle_get_height(current_style
, &v
);
2932 ok(hres
== S_OK
, "get_height failed: %08x\n", hres
);
2933 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
2936 hres
= IHTMLCurrentStyle_get_paddingLeft(current_style
, &v
);
2937 ok(hres
== S_OK
, "get_paddingLeft failed: %08x\n", hres
);
2938 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
2941 hres
= IHTMLCurrentStyle_get_zIndex(current_style
, &v
);
2942 ok(hres
== S_OK
, "get_zIndex failed: %08x\n", hres
);
2943 ok(V_VT(&v
) == VT_I4
, "V_VT(v) = %d\n", V_VT(&v
));
2944 ok( V_I4(&v
) == 1, "expect 1 got (%d)\n", V_I4(&v
));
2947 hres
= IHTMLCurrentStyle_get_verticalAlign(current_style
, &v
);
2948 ok(hres
== S_OK
, "get_verticalAlign failed: %08x\n", hres
);
2949 test_var_bstr(&v
, compat_mode
< COMPAT_IE9
? "100px" : "middle");
2952 hres
= IHTMLCurrentStyle_get_marginRight(current_style
, &v
);
2953 ok(hres
== S_OK
, "get_marginRight failed: %08x\n", hres
);
2954 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
2957 hres
= IHTMLCurrentStyle_get_marginLeft(current_style
, &v
);
2958 ok(hres
== S_OK
, "get_marginLeft failed: %08x\n", hres
);
2959 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
2962 hres
= IHTMLCurrentStyle_get_borderLeftWidth(current_style
, &v
);
2963 ok(hres
== S_OK
, "get_borderLeftWidth failed: %08x\n", hres
);
2964 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
2968 hres
= IHTMLCurrentStyle_get_borderRightWidth(current_style
, &v
);
2969 ok(hres
== S_OK
, "get_borderRightWidth failed: %08x\n", hres
);
2970 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
2973 hres
= IHTMLCurrentStyle_get_borderBottomWidth(current_style
, &v
);
2974 ok(hres
== S_OK
, "get_borderBottomWidth failed: %08x\n", hres
);
2975 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
2978 hres
= IHTMLCurrentStyle_get_borderTopWidth(current_style
, &v
);
2979 ok(hres
== S_OK
, "get_borderTopWidth failed: %08x\n", hres
);
2980 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
2983 hres
= IHTMLCurrentStyle_get_color(current_style
, &v
);
2984 ok(hres
== S_OK
, "get_color failed: %08x\n", hres
);
2985 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
2988 hres
= IHTMLCurrentStyle_get_backgroundColor(current_style
, &v
);
2989 ok(hres
== S_OK
, "get_backgroundColor failed: %08x\n", hres
);
2990 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
2993 hres
= IHTMLCurrentStyle_get_borderLeftColor(current_style
, &v
);
2994 ok(hres
== S_OK
, "get_borderLeftColor failed: %08x\n", hres
);
2995 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
2998 hres
= IHTMLCurrentStyle_get_borderTopColor(current_style
, &v
);
2999 ok(hres
== S_OK
, "get_borderTopColor failed: %08x\n", hres
);
3000 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
3003 hres
= IHTMLCurrentStyle_get_borderRightColor(current_style
, &v
);
3004 ok(hres
== S_OK
, "get_borderRightColor failed: %08x\n", hres
);
3005 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
3008 hres
= IHTMLCurrentStyle_get_borderBottomColor(current_style
, &v
);
3009 ok(hres
== S_OK
, "get_borderBottomColor failed: %08x\n", hres
);
3010 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
3013 hres
= IHTMLCurrentStyle_get_paddingTop(current_style
, &v
);
3014 ok(hres
== S_OK
, "get_paddingTop failed: %08x\n", hres
);
3015 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
3018 hres
= IHTMLCurrentStyle_get_paddingRight(current_style
, &v
);
3019 ok(hres
== S_OK
, "get_paddingRight failed: %08x\n", hres
);
3020 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
3023 hres
= IHTMLCurrentStyle_get_paddingBottom(current_style
, &v
);
3024 ok(hres
== S_OK
, "get_paddingRight failed: %08x\n", hres
);
3025 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
3028 hres
= IHTMLCurrentStyle_get_letterSpacing(current_style
, &v
);
3029 ok(hres
== S_OK
, "get_letterSpacing failed: %08x\n", hres
);
3030 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
3033 hres
= IHTMLCurrentStyle_get_marginTop(current_style
, &v
);
3034 ok(hres
== S_OK
, "get_marginTop failed: %08x\n", hres
);
3035 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
3038 hres
= IHTMLCurrentStyle_get_marginBottom(current_style
, &v
);
3039 ok(hres
== S_OK
, "get_marginBottom failed: %08x\n", hres
);
3040 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
3043 hres
= IHTMLCurrentStyle_get_right(current_style
, &v
);
3044 ok(hres
== S_OK
, "get_Right failed: %08x\n", hres
);
3045 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
3048 hres
= IHTMLCurrentStyle_get_bottom(current_style
, &v
);
3049 ok(hres
== S_OK
, "get_bottom failed: %08x\n", hres
);
3050 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
3053 hres
= IHTMLCurrentStyle_get_lineHeight(current_style
, &v
);
3054 ok(hres
== S_OK
, "get_lineHeight failed: %08x\n", hres
);
3055 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
3058 hres
= IHTMLCurrentStyle_get_textIndent(current_style
, &v
);
3059 ok(hres
== S_OK
, "get_textIndent failed: %08x\n", hres
);
3060 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
3063 hres
= IHTMLCurrentStyle_get_textTransform(current_style
, &str
);
3064 ok(hres
== S_OK
, "get_textTransform failed: %08x\n", hres
);
3067 hres
= IHTMLCurrentStyle_get_styleFloat(current_style
, &str
);
3068 ok(hres
== S_OK
, "get_styleFloat failed: %08x\n", hres
);
3069 ok(!strcmp_wa(str
, "none"), "styleFloat = %s\n", wine_dbgstr_w(str
));
3072 hres
= IHTMLCurrentStyle_get_overflowX(current_style
, &str
);
3073 ok(hres
== S_OK
, "get_overflowX failed: %08x\n", hres
);
3074 ok(!strcmp_wa(str
, "hidden"), "overflowX = %s\n", wine_dbgstr_w(str
));
3077 hres
= IHTMLCurrentStyle_get_overflowY(current_style
, &str
);
3078 ok(hres
== S_OK
, "get_overflowY failed: %08x\n", hres
);
3079 ok(!strcmp_wa(str
, "hidden"), "overflowY = %s\n", wine_dbgstr_w(str
));
3082 hres
= IHTMLCurrentStyle_get_direction(current_style
, &str
);
3083 ok(hres
== S_OK
, "get_direction failed: %08x\n", hres
);
3084 ok(!strcmp_wa(str
, "ltr"), "direction = %s\n", wine_dbgstr_w(str
));
3087 current_style2
= get_current_style2_iface((IUnknown
*)current_style
);
3090 hres
= IHTMLCurrentStyle2_get_hasLayout(current_style2
, &b
);
3091 ok(hres
== S_OK
, "get_hasLayout failed: %08x\n", hres
);
3092 ok(b
== VARIANT_TRUE
, "hasLayout = %x\n", b
);
3094 IHTMLCurrentStyle2_Release(current_style2
);
3096 hres
= IHTMLCurrentStyle_QueryInterface(current_style
, &IID_IHTMLCurrentStyle3
, (void**)¤t_style3
);
3097 ok(hres
== S_OK
, "Could not get IHTMLCurrentStyle3 iface: %08x\n", hres
);
3099 hres
= IHTMLCurrentStyle3_get_whiteSpace(current_style3
, &str
);
3100 ok(hres
== S_OK
, "get_whiteSpace failed: %08x\n", hres
);
3101 ok(!strcmp_wa(str
, "normal"), "whiteSpace = %s\n", wine_dbgstr_w(str
));
3104 IHTMLCurrentStyle3_Release(current_style3
);
3106 hres
= IHTMLCurrentStyle_QueryInterface(current_style
, &IID_IHTMLCurrentStyle4
, (void**)¤t_style4
);
3107 ok(hres
== S_OK
|| broken(hres
== E_NOINTERFACE
), "Could not get IHTMLCurrentStyle4 iface: %08x\n", hres
);
3108 if(SUCCEEDED(hres
)) {
3109 hres
= IHTMLCurrentStyle4_get_minWidth(current_style4
, &v
);
3110 ok(hres
== S_OK
, "get_minWidth failed: %08x\n", hres
);
3111 ok(V_VT(&v
) == VT_BSTR
, "V_VT(minWidth) = %d\n", V_VT(&v
));
3114 IHTMLCurrentStyle4_Release(current_style4
);
3116 win_skip("IHTMLCurrentStyle4 not supported.\n");
3120 static void basic_style_test(IHTMLDocument2
*doc
)
3122 IHTMLCurrentStyle
*cstyle
;
3127 hres
= IHTMLDocument2_get_body(doc
, &elem
);
3128 ok(hres
== S_OK
, "get_body failed: %08x\n", hres
);
3130 elem_set_innerhtml(elem
, "<div id=\"divid\"></div>");
3132 hres
= IHTMLElement_get_style(elem
, &style
);
3133 ok(hres
== S_OK
, "get_style failed: %08x\n", hres
);
3135 test_body_style(style
);
3137 cstyle
= get_current_style(elem
);
3138 test_current_style(cstyle
);
3139 IHTMLCurrentStyle_Release(cstyle
);
3140 IHTMLElement_Release(elem
);
3142 elem
= get_element_by_id(doc
, "divid");
3143 test_style_filters(elem
);
3145 test_set_csstext(style
);
3146 IHTMLStyle_Release(style
);
3147 IHTMLElement_Release(elem
);
3150 static const char runtimestyle_test_str
[] =
3151 "<html><head><style>body {text-decoration: auto}</style></head><body></body></html>";
3153 static const char runtimestyle_ie9_test_str
[] =
3157 " <meta http-equiv=\"x-ua-compatible\" content=\"IE=9\" />"
3158 " <style>body {text-decoration: auto}</style>"
3164 static void runtimestyle_test(IHTMLDocument2
*doc
)
3166 IHTMLStyle
*style
, *runtime_style
;
3167 IHTMLElement2
*elem2
;
3172 hres
= IHTMLDocument2_get_body(doc
, &elem
);
3173 ok(hres
== S_OK
, "get_body failed: %08x\n", hres
);
3175 elem2
= get_elem2_iface((IUnknown
*)elem
);
3177 hres
= IHTMLElement2_get_runtimeStyle(elem2
, &runtime_style
);
3178 ok(hres
== S_OK
, "get_runtimeStyle failed: %08x\n", hres
);
3180 hres
= IHTMLElement_get_style(elem
, &style
);
3181 ok(hres
== S_OK
, "get_style failed: %08x\n", hres
);
3183 test_text_decoration(style
, NULL
);
3184 test_text_decoration(runtime_style
, NULL
);
3185 set_text_decoration(style
, "underline");
3186 test_text_decoration(style
, "underline");
3188 hres
= IHTMLStyle_get_textDecoration(style
, &str
);
3189 ok(hres
== S_OK
, "get_textDecoration failed: %08x\n", hres
);
3190 ok(broken(!str
) || !strcmp_wa(str
, "underline"), "textDecoration = %s\n", wine_dbgstr_w(str
));
3193 set_text_decoration(runtime_style
, "blink");
3194 test_text_decoration(runtime_style
, "blink");
3196 hres
= IHTMLStyle_get_textDecoration(style
, &str
);
3197 ok(hres
== S_OK
, "get_textDecoration failed: %08x\n", hres
);
3199 ok(!strcmp_wa(str
, "underline"), "textDecoration = %s\n", wine_dbgstr_w(str
));
3202 IHTMLStyle_Release(runtime_style
);
3203 IHTMLStyle_Release(style
);
3204 IHTMLElement2_Release(elem2
);
3205 IHTMLElement_Release(elem
);
3208 static IHTMLDocument2
*notif_doc
;
3209 static BOOL doc_complete
;
3211 static IHTMLDocument2
*create_document(void)
3213 IHTMLDocument2
*doc
;
3214 IHTMLDocument5
*doc5
;
3217 hres
= CoCreateInstance(&CLSID_HTMLDocument
, NULL
, CLSCTX_INPROC_SERVER
|CLSCTX_INPROC_HANDLER
,
3218 &IID_IHTMLDocument2
, (void**)&doc
);
3219 ok(hres
== S_OK
, "CoCreateInstance failed: %08x\n", hres
);
3223 hres
= IHTMLDocument2_QueryInterface(doc
, &IID_IHTMLDocument5
, (void**)&doc5
);
3225 win_skip("Could not get IHTMLDocument5, probably too old IE\n");
3226 IHTMLDocument2_Release(doc
);
3230 IHTMLDocument5_Release(doc5
);
3234 static HRESULT WINAPI
PropertyNotifySink_QueryInterface(IPropertyNotifySink
*iface
,
3235 REFIID riid
, void**ppv
)
3237 if(IsEqualGUID(&IID_IPropertyNotifySink
, riid
)) {
3242 ok(0, "unexpected call\n");
3243 return E_NOINTERFACE
;
3246 static ULONG WINAPI
PropertyNotifySink_AddRef(IPropertyNotifySink
*iface
)
3251 static ULONG WINAPI
PropertyNotifySink_Release(IPropertyNotifySink
*iface
)
3256 static HRESULT WINAPI
PropertyNotifySink_OnChanged(IPropertyNotifySink
*iface
, DISPID dispID
)
3258 if(dispID
== DISPID_READYSTATE
){
3262 hres
= IHTMLDocument2_get_readyState(notif_doc
, &state
);
3263 ok(hres
== S_OK
, "get_readyState failed: %08x\n", hres
);
3265 if(!strcmp_wa(state
, "complete"))
3266 doc_complete
= TRUE
;
3268 SysFreeString(state
);
3274 static HRESULT WINAPI
PropertyNotifySink_OnRequestEdit(IPropertyNotifySink
*iface
, DISPID dispID
)
3276 ok(0, "unexpected call\n");
3280 static IPropertyNotifySinkVtbl PropertyNotifySinkVtbl
= {
3281 PropertyNotifySink_QueryInterface
,
3282 PropertyNotifySink_AddRef
,
3283 PropertyNotifySink_Release
,
3284 PropertyNotifySink_OnChanged
,
3285 PropertyNotifySink_OnRequestEdit
3288 static IPropertyNotifySink PropertyNotifySink
= { &PropertyNotifySinkVtbl
};
3290 static IHTMLDocument2
*create_doc_with_string(const char *str
)
3292 IPersistStreamInit
*init
;
3294 IHTMLDocument2
*doc
;
3299 notif_doc
= doc
= create_document();
3303 doc_complete
= FALSE
;
3305 mem
= GlobalAlloc(0, len
);
3306 memcpy(mem
, str
, len
);
3307 hres
= CreateStreamOnHGlobal(mem
, TRUE
, &stream
);
3308 ok(hres
== S_OK
, "Failed to create a stream, hr %#x.\n", hres
);
3310 hres
= IHTMLDocument2_QueryInterface(doc
, &IID_IPersistStreamInit
, (void**)&init
);
3311 ok(hres
== S_OK
, "Failed to get IPersistStreamInit, hr %#x.\n", hres
);
3313 IPersistStreamInit_Load(init
, stream
);
3314 IPersistStreamInit_Release(init
);
3315 IStream_Release(stream
);
3320 static void do_advise(IUnknown
*unk
, REFIID riid
, IUnknown
*unk_advise
)
3322 IConnectionPointContainer
*container
;
3323 IConnectionPoint
*cp
;
3327 hres
= IUnknown_QueryInterface(unk
, &IID_IConnectionPointContainer
, (void**)&container
);
3328 ok(hres
== S_OK
, "QueryInterface(IID_IConnectionPointContainer) failed: %08x\n", hres
);
3330 hres
= IConnectionPointContainer_FindConnectionPoint(container
, riid
, &cp
);
3331 IConnectionPointContainer_Release(container
);
3332 ok(hres
== S_OK
, "FindConnectionPoint failed: %08x\n", hres
);
3334 hres
= IConnectionPoint_Advise(cp
, unk_advise
, &cookie
);
3335 IConnectionPoint_Release(cp
);
3336 ok(hres
== S_OK
, "Advise failed: %08x\n", hres
);
3339 typedef void (*style_test_t
)(IHTMLDocument2
*);
3341 static void run_test(const char *str
, style_test_t test
)
3343 IHTMLDocument2
*doc
;
3347 doc
= create_doc_with_string(str
);
3351 do_advise((IUnknown
*)doc
, &IID_IPropertyNotifySink
, (IUnknown
*)&PropertyNotifySink
);
3353 while(!doc_complete
&& GetMessageW(&msg
, NULL
, 0, 0)) {
3354 TranslateMessage(&msg
);
3355 DispatchMessageW(&msg
);
3360 ref
= IHTMLDocument2_Release(doc
);
3361 ok(!ref
|| broken(ref
== 1), /* Vista */
3365 static BOOL
check_ie(void)
3367 IHTMLDocument2
*doc
;
3368 IHTMLDocument7
*doc7
;
3371 doc
= create_document();
3375 hres
= IHTMLDocument2_QueryInterface(doc
, &IID_IHTMLDocument7
, (void**)&doc7
);
3376 if(SUCCEEDED(hres
)) {
3378 IHTMLDocument7_Release(doc7
);
3381 trace("is_ie9plus %x\n", is_ie9plus
);
3383 IHTMLDocument2_Release(doc
);
3392 trace("Running tests in quirks mode...\n");
3393 run_test(doc_blank
, basic_style_test
);
3394 run_test(runtimestyle_test_str
, runtimestyle_test
);
3396 trace("Running tests in IE9 mode...\n");
3397 compat_mode
= COMPAT_IE9
;
3398 run_test(doc_blank_ie9
, basic_style_test
);
3399 run_test(runtimestyle_ie9_test_str
, runtimestyle_test
);