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_css_style_declaration(IHTMLCSSStyleDeclaration
*css_style
)
745 hres
= IHTMLCSSStyleDeclaration_get_backgroundClip(css_style
, &str
);
746 ok(hres
== S_OK
, "get_backgroundClip failed: %08x\n", hres
);
747 ok(!str
, "backgroundClip = %s\n", wine_dbgstr_w(str
));
749 str
= a2bstr("border-box");
750 hres
= IHTMLCSSStyleDeclaration_put_backgroundClip(css_style
, str
);
751 ok(hres
== S_OK
, "put_backgroundClip failed: %08x\n", hres
);
754 hres
= IHTMLCSSStyleDeclaration_get_backgroundClip(css_style
, &str
);
755 ok(hres
== S_OK
, "get_backgroundClip failed: %08x\n", hres
);
756 ok(!strcmp_wa(str
, "border-box"), "backgroundClip = %s\n", wine_dbgstr_w(str
));
759 hres
= IHTMLCSSStyleDeclaration_get_opacity(css_style
, &v
);
760 ok(hres
== S_OK
, "get_opacity failed: %08x\n", hres
);
761 test_var_bstr(&v
, NULL
);
765 hres
= IHTMLCSSStyleDeclaration_put_opacity(css_style
, v
);
766 ok(hres
== S_OK
, "put_opacity failed: %08x\n", hres
);
768 hres
= IHTMLCSSStyleDeclaration_get_opacity(css_style
, &v
);
769 ok(hres
== S_OK
, "get_opacity failed: %08x\n", hres
);
770 test_var_bstr(&v
, "0");
774 V_BSTR(&v
) = a2bstr("1");
775 hres
= IHTMLCSSStyleDeclaration_put_opacity(css_style
, v
);
776 ok(hres
== S_OK
, "put_opacity failed: %08x\n", hres
);
779 hres
= IHTMLCSSStyleDeclaration_get_opacity(css_style
, &v
);
780 ok(hres
== S_OK
, "get_opacity failed: %08x\n", hres
);
781 test_var_bstr(&v
, "1");
785 static void test_body_style(IHTMLStyle
*style
)
787 IHTMLCSSStyleDeclaration
*css_style
;
798 BSTR sOverflowDefault
;
803 hres
= IHTMLStyle_QueryInterface(style
, &IID_IHTMLCSSStyleDeclaration
, (void**)&css_style
);
804 ok(hres
== S_OK
|| broken(!is_ie9plus
&& hres
== E_NOINTERFACE
),
805 "Could not get IHTMLCSSStyleDeclaration interface: %08x\n", hres
);
807 test_style_csstext(style
, NULL
);
809 hres
= IHTMLStyle_get_position(style
, &str
);
810 ok(hres
== S_OK
, "get_position failed: %08x\n", hres
);
811 ok(!str
, "str=%s\n", wine_dbgstr_w(str
));
814 hres
= IHTMLStyle_get_marginRight(style
, &v
);
815 ok(hres
== S_OK
, "get_marginRight failed: %08x\n", hres
);
816 ok(V_VT(&v
) == VT_BSTR
, "V_VT(marginRight) = %d\n", V_VT(&v
));
817 ok(!V_BSTR(&v
), "V_BSTR(marginRight) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
821 hres
= IHTMLStyle_put_marginRight(style
, v
);
822 ok(hres
== S_OK
, "put_marginRight failed: %08x\n", hres
);
825 hres
= IHTMLStyle_get_marginRight(style
, &v
);
826 ok(hres
== S_OK
, "get_marginRight failed: %08x\n", hres
);
827 ok(V_VT(&v
) == VT_BSTR
, "V_VT(marginRight) = %d\n", V_VT(&v
));
828 if(compat_mode
< COMPAT_IE9
)
829 ok(!strcmp_wa(V_BSTR(&v
), "6px"), "V_BSTR(marginRight) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
831 ok(!V_BSTR(&v
), "mariginRight = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
835 hres
= IHTMLCSSStyleDeclaration_get_marginRight(css_style
, &v
);
836 ok(hres
== S_OK
, "get_marginRight failed: %08x\n", hres
);
837 ok(V_VT(&v
) == VT_BSTR
, "V_VT(marginRight) = %d\n", V_VT(&v
));
838 if(compat_mode
< COMPAT_IE9
)
839 ok(!strcmp_wa(V_BSTR(&v
), "6px"), "V_BSTR(marginRight) = %s\n",
840 wine_dbgstr_w(V_BSTR(&v
)));
842 ok(!V_BSTR(&v
), "mariginRight = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
846 hres
= IHTMLCSSStyleDeclaration_put_marginRight(css_style
, v
);
847 ok(hres
== S_OK
, "put_marginRight failed: %08x\n", hres
);
850 hres
= IHTMLCSSStyleDeclaration_get_marginRight(css_style
, &v
);
851 ok(hres
== S_OK
, "get_marginRight failed: %08x\n", hres
);
852 ok(V_VT(&v
) == VT_BSTR
, "V_VT(marginRight) = %d\n", V_VT(&v
));
853 if(compat_mode
< COMPAT_IE9
)
854 ok(!strcmp_wa(V_BSTR(&v
), "7px"), "V_BSTR(marginRight) = %s\n",
855 wine_dbgstr_w(V_BSTR(&v
)));
857 ok(!V_BSTR(&v
), "mariginRight = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
860 V_BSTR(&v
) = a2bstr("8");
861 hres
= IHTMLCSSStyleDeclaration_put_marginRight(css_style
, v
);
862 ok(hres
== S_OK
, "put_marginRight failed: %08x\n", hres
);
863 SysFreeString(V_BSTR(&v
));
866 hres
= IHTMLCSSStyleDeclaration_get_marginRight(css_style
, &v
);
867 ok(hres
== S_OK
, "get_marginRight failed: %08x\n", hres
);
868 ok(V_VT(&v
) == VT_BSTR
, "V_VT(marginRight) = %d\n", V_VT(&v
));
869 if(compat_mode
< COMPAT_IE9
)
870 ok(!strcmp_wa(V_BSTR(&v
), "8px"), "V_BSTR(marginRight) = %s\n",
871 wine_dbgstr_w(V_BSTR(&v
)));
873 ok(!V_BSTR(&v
), "mariginRight = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
876 V_BSTR(&v
) = a2bstr("9px");
877 hres
= IHTMLCSSStyleDeclaration_put_marginRight(css_style
, v
);
878 ok(hres
== S_OK
, "put_marginRight failed: %08x\n", hres
);
879 SysFreeString(V_BSTR(&v
));
882 hres
= IHTMLCSSStyleDeclaration_get_marginRight(css_style
, &v
);
883 ok(hres
== S_OK
, "get_marginRight failed: %08x\n", hres
);
884 ok(V_VT(&v
) == VT_BSTR
, "V_VT(marginRight) = %d\n", V_VT(&v
));
885 ok(!strcmp_wa(V_BSTR(&v
), "9px"), "V_BSTR(marginRight) = %s\n",
886 wine_dbgstr_w(V_BSTR(&v
)));
887 SysFreeString(V_BSTR(&v
));
891 hres
= IHTMLStyle_get_marginBottom(style
, &v
);
892 ok(hres
== S_OK
, "get_marginBottom failed: %08x\n", hres
);
893 ok(V_VT(&v
) == VT_BSTR
, "V_VT(marginBottom) = %d\n", V_VT(&v
));
894 ok(!V_BSTR(&v
), "V_BSTR(marginBottom) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
898 hres
= IHTMLStyle_put_marginBottom(style
, v
);
899 ok(hres
== S_OK
, "put_marginBottom failed: %08x\n", hres
);
902 hres
= IHTMLStyle_get_marginBottom(style
, &v
);
903 ok(hres
== S_OK
, "get_marginBottom failed: %08x\n", hres
);
904 ok(V_VT(&v
) == VT_BSTR
, "V_VT(marginBottom) = %d\n", V_VT(&v
));
905 if(compat_mode
< COMPAT_IE9
)
906 ok(!strcmp_wa(V_BSTR(&v
), "6px"), "V_BSTR(marginBottom) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
908 ok(!V_BSTR(&v
), "mariginBottom = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
911 hres
= IHTMLStyle_get_marginLeft(style
, &v
);
912 ok(hres
== S_OK
, "get_marginLeft failed: %08x\n", hres
);
913 ok(V_VT(&v
) == VT_BSTR
, "V_VT(marginLeft) = %d\n", V_VT(&v
));
914 ok(!V_BSTR(&v
), "V_BSTR(marginLeft) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
918 hres
= IHTMLStyle_put_marginLeft(style
, v
);
919 ok(hres
== S_OK
, "put_marginLeft failed: %08x\n", hres
);
922 hres
= IHTMLStyle_get_marginLeft(style
, &v
);
923 ok(hres
== S_OK
, "get_marginLeft failed: %08x\n", hres
);
924 ok(V_VT(&v
) == VT_BSTR
, "V_VT(marginLeft) = %d\n", V_VT(&v
));
925 if(compat_mode
< COMPAT_IE9
)
926 ok(!strcmp_wa(V_BSTR(&v
), "6px"), "V_BSTR(marginLeft) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
928 ok(!V_BSTR(&v
), "mariginLeft = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
930 str
= (void*)0xdeadbeef;
931 hres
= IHTMLStyle_get_fontFamily(style
, &str
);
932 ok(hres
== S_OK
, "get_fontFamily failed: %08x\n", hres
);
933 ok(!str
, "fontFamily = %s\n", wine_dbgstr_w(str
));
935 str
= (void*)0xdeadbeef;
936 hres
= IHTMLStyle_get_fontWeight(style
, &str
);
937 ok(hres
== S_OK
, "get_fontWeight failed: %08x\n", hres
);
938 ok(!str
, "fontWeight = %s\n", wine_dbgstr_w(str
));
940 hres
= IHTMLStyle_get_fontWeight(style
, &sDefault
);
941 ok(hres
== S_OK
, "get_fontWeight failed: %08x\n", hres
);
943 str
= a2bstr("test");
944 hres
= IHTMLStyle_put_fontWeight(style
, str
);
945 ok(hres
== (compat_mode
< COMPAT_IE9
? E_INVALIDARG
: S_OK
),
946 "put_fontWeight failed: %08x\n", hres
);
949 hres
= IHTMLStyle_get_fontWeight(style
, &str
);
950 ok(hres
== S_OK
, "get_fontWeight failed: %08x\n", hres
);
951 ok(!str
, "fontWeight = %s\n", wine_dbgstr_w(str
));
954 str
= a2bstr("bold");
955 hres
= IHTMLStyle_put_fontWeight(style
, str
);
956 ok(hres
== S_OK
, "put_fontWeight failed: %08x\n", hres
);
959 str
= a2bstr("bolder");
960 hres
= IHTMLStyle_put_fontWeight(style
, str
);
961 ok(hres
== S_OK
, "put_fontWeight failed: %08x\n", hres
);
964 str
= a2bstr("lighter");
965 hres
= IHTMLStyle_put_fontWeight(style
, str
);
966 ok(hres
== S_OK
, "put_fontWeight failed: %08x\n", hres
);
970 hres
= IHTMLStyle_put_fontWeight(style
, str
);
971 ok(hres
== S_OK
, "put_fontWeight failed: %08x\n", hres
);
975 hres
= IHTMLStyle_put_fontWeight(style
, str
);
976 ok(hres
== S_OK
, "put_fontWeight failed: %08x\n", hres
);
980 hres
= IHTMLStyle_put_fontWeight(style
, str
);
981 ok(hres
== S_OK
, "put_fontWeight failed: %08x\n", hres
);
985 hres
= IHTMLStyle_put_fontWeight(style
, str
);
986 ok(hres
== S_OK
, "put_fontWeight failed: %08x\n", hres
);
990 hres
= IHTMLStyle_put_fontWeight(style
, str
);
991 ok(hres
== S_OK
, "put_fontWeight failed: %08x\n", hres
);
995 hres
= IHTMLStyle_put_fontWeight(style
, str
);
996 ok(hres
== S_OK
, "put_fontWeight failed: %08x\n", hres
);
1000 hres
= IHTMLStyle_put_fontWeight(style
, str
);
1001 ok(hres
== S_OK
, "put_fontWeight failed: %08x\n", hres
);
1004 str
= a2bstr("800");
1005 hres
= IHTMLStyle_put_fontWeight(style
, str
);
1006 ok(hres
== S_OK
, "put_fontWeight failed: %08x\n", hres
);
1009 str
= a2bstr("900");
1010 hres
= IHTMLStyle_put_fontWeight(style
, str
);
1011 ok(hres
== S_OK
, "put_fontWeight failed: %08x\n", hres
);
1014 hres
= IHTMLStyle_get_fontWeight(style
, &str
);
1015 ok(hres
== S_OK
, "get_fontWeight failed: %08x\n", hres
);
1016 ok(!strcmp_wa(str
, "900"), "str != style900\n");
1020 hres
= IHTMLStyle_put_fontWeight(style
, str
);
1021 ok(hres
== S_OK
, "put_fontWeight failed: %08x\n", hres
);
1024 hres
= IHTMLStyle_get_fontWeight(style
, &str
);
1025 ok(hres
== S_OK
, "get_fontWeight failed: %08x\n", hres
);
1026 ok(!str
, "str != NULL\n");
1029 hres
= IHTMLStyle_put_fontWeight(style
, sDefault
);
1030 ok(hres
== S_OK
, "put_fontWeight failed: %08x\n", hres
);
1031 SysFreeString(sDefault
);
1034 hres
= IHTMLStyle_get_fontVariant(style
, NULL
);
1035 ok(hres
== E_INVALIDARG
, "get_fontVariant failed: %08x\n", hres
);
1037 hres
= IHTMLStyle_get_fontVariant(style
, &sDefault
);
1038 ok(hres
== S_OK
, "get_fontVariant failed: %08x\n", hres
);
1040 str
= a2bstr("test");
1041 hres
= IHTMLStyle_put_fontVariant(style
, str
);
1042 ok(hres
== (compat_mode
< COMPAT_IE9
? E_INVALIDARG
: S_OK
),
1043 "fontVariant failed: %08x\n", hres
);
1046 str
= a2bstr("small-caps");
1047 hres
= IHTMLStyle_put_fontVariant(style
, str
);
1048 ok(hres
== S_OK
, "fontVariant failed: %08x\n", hres
);
1051 str
= a2bstr("normal");
1052 hres
= IHTMLStyle_put_fontVariant(style
, str
);
1053 ok(hres
== S_OK
, "fontVariant failed: %08x\n", hres
);
1056 hres
= IHTMLStyle_put_fontVariant(style
, sDefault
);
1057 ok(hres
== S_OK
, "fontVariant failed: %08x\n", hres
);
1058 SysFreeString(sDefault
);
1060 str
= (void*)0xdeadbeef;
1061 hres
= IHTMLStyle_get_display(style
, &str
);
1062 ok(hres
== S_OK
, "get_display failed: %08x\n", hres
);
1063 ok(!str
, "display = %s\n", wine_dbgstr_w(str
));
1065 str
= (void*)0xdeadbeef;
1066 hres
= IHTMLStyle_get_visibility(style
, &str
);
1067 ok(hres
== S_OK
, "get_visibility failed: %08x\n", hres
);
1068 ok(!str
, "visibility = %s\n", wine_dbgstr_w(str
));
1071 hres
= IHTMLStyle_get_fontSize(style
, &v
);
1072 ok(hres
== S_OK
, "get_fontSize failed: %08x\n", hres
);
1073 ok(V_VT(&v
) == VT_BSTR
, "V_VT(fontSize) = %d\n", V_VT(&v
));
1074 ok(!V_BSTR(&v
), "V_BSTR(fontSize) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1078 hres
= IHTMLStyle_put_fontSize(style
, v
);
1079 ok(hres
== S_OK
, "put_fontSize failed: %08x\n", hres
);
1082 hres
= IHTMLStyle_get_fontSize(style
, &v
);
1083 ok(hres
== S_OK
, "get_fontSize failed: %08x\n", hres
);
1084 ok(V_VT(&v
) == VT_BSTR
, "V_VT(fontSize) = %d\n", V_VT(&v
));
1085 if(compat_mode
< COMPAT_IE9
)
1086 ok(!strcmp_wa(V_BSTR(&v
), "12px"), "fontSize = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1088 ok(!V_BSTR(&v
), "fontSize = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1091 hres
= IHTMLStyle_get_color(style
, &v
);
1092 ok(hres
== S_OK
, "get_color failed: %08x\n", hres
);
1093 ok(V_VT(&v
) == VT_BSTR
, "V_VT(color) = %d\n", V_VT(&v
));
1094 ok(!V_BSTR(&v
), "V_BSTR(color) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1098 hres
= IHTMLStyle_put_color(style
, v
);
1099 ok(hres
== S_OK
, "put_color failed: %08x\n", hres
);
1102 hres
= IHTMLStyle_get_color(style
, &v
);
1103 ok(hres
== S_OK
, "get_color failed: %08x\n", hres
);
1104 ok(V_VT(&v
) == VT_BSTR
, "V_VT(color) = %d\n", V_VT(&v
));
1106 ok(!strcmp_wa(V_BSTR(&v
), "#00fdfd"), "V_BSTR(color) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1110 hres
= IHTMLStyle_put_lineHeight(style
, v
);
1111 ok(hres
== S_OK
, "put_lineHeight failed: %08x\n", hres
);
1113 hres
= IHTMLStyle_get_lineHeight(style
, &v
);
1114 ok(hres
== S_OK
, "get_lineHeight failed: %08x\n", hres
);
1115 ok(V_VT(&v
) == VT_BSTR
, "V_VT(lineHeight) = %d, expect VT_BSTR\n", V_VT(&v
));
1116 ok(!strcmp_wa(V_BSTR(&v
), "3"), "V_BSTR(lineHeight) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1119 V_BSTR(&v
) = a2bstr("300%");
1120 hres
= IHTMLStyle_put_lineHeight(style
, v
);
1121 ok(hres
== S_OK
, "put_lineHeight failed: %08x\n", hres
);
1124 hres
= IHTMLStyle_get_lineHeight(style
, &v
);
1125 ok(hres
== S_OK
, "get_lineHeight failed: %08x\n", hres
);
1126 ok(V_VT(&v
) == VT_BSTR
, "V_VT(lineHeight) = %d, expect VT_BSTR\n", V_VT(&v
));
1127 ok(!strcmp_wa(V_BSTR(&v
), "300%"), "V_BSTR(lineHeight) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1131 hres
= IHTMLStyle_get_textDecorationUnderline(style
, &b
);
1132 ok(hres
== S_OK
, "get_textDecorationUnderline failed: %08x\n", hres
);
1133 ok(b
== VARIANT_FALSE
, "textDecorationUnderline = %x\n", b
);
1135 hres
= IHTMLStyle_put_textDecorationUnderline(style
, VARIANT_TRUE
);
1136 ok(hres
== S_OK
, "put_textDecorationUnderline failed: %08x\n", hres
);
1138 hres
= IHTMLStyle_get_textDecorationUnderline(style
, &b
);
1139 ok(hres
== S_OK
, "get_textDecorationUnderline failed: %08x\n", hres
);
1140 ok(b
== VARIANT_TRUE
, "textDecorationUnderline = %x\n", b
);
1142 hres
= IHTMLStyle_put_textDecorationUnderline(style
, VARIANT_FALSE
);
1143 ok(hres
== S_OK
, "put_textDecorationUnderline failed: %08x\n", hres
);
1146 hres
= IHTMLStyle_get_textDecorationLineThrough(style
, &b
);
1147 ok(hres
== S_OK
, "get_textDecorationLineThrough failed: %08x\n", hres
);
1148 ok(b
== VARIANT_FALSE
, "textDecorationLineThrough = %x\n", b
);
1150 hres
= IHTMLStyle_put_textDecorationLineThrough(style
, VARIANT_TRUE
);
1151 ok(hres
== S_OK
, "put_textDecorationLineThrough failed: %08x\n", hres
);
1153 hres
= IHTMLStyle_get_textDecorationLineThrough(style
, &b
);
1154 ok(hres
== S_OK
, "get_textDecorationLineThrough failed: %08x\n", hres
);
1155 ok(b
== VARIANT_TRUE
, "textDecorationLineThrough = %x\n", b
);
1157 hres
= IHTMLStyle_put_textDecorationLineThrough(style
, VARIANT_FALSE
);
1158 ok(hres
== S_OK
, "put_textDecorationLineThrough failed: %08x\n", hres
);
1161 hres
= IHTMLStyle_get_textDecorationNone(style
, &b
);
1162 ok(hres
== S_OK
, "get_textDecorationNone failed: %08x\n", hres
);
1163 ok(b
== VARIANT_FALSE
, "textDecorationNone = %x\n", b
);
1165 hres
= IHTMLStyle_put_textDecorationNone(style
, VARIANT_TRUE
);
1166 ok(hres
== S_OK
, "put_textDecorationNone failed: %08x\n", hres
);
1168 hres
= IHTMLStyle_get_textDecorationNone(style
, &b
);
1169 ok(hres
== S_OK
, "get_textDecorationNone failed: %08x\n", hres
);
1170 ok(b
== VARIANT_TRUE
, "textDecorationNone = %x\n", b
);
1172 hres
= IHTMLStyle_put_textDecorationNone(style
, VARIANT_FALSE
);
1173 ok(hres
== S_OK
, "put_textDecorationNone failed: %08x\n", hres
);
1176 hres
= IHTMLStyle_get_textDecorationOverline(style
, &b
);
1177 ok(hres
== S_OK
, "get_textDecorationOverline failed: %08x\n", hres
);
1178 ok(b
== VARIANT_FALSE
, "textDecorationOverline = %x\n", b
);
1180 hres
= IHTMLStyle_put_textDecorationOverline(style
, VARIANT_TRUE
);
1181 ok(hres
== S_OK
, "put_textDecorationOverline failed: %08x\n", hres
);
1183 hres
= IHTMLStyle_get_textDecorationOverline(style
, &b
);
1184 ok(hres
== S_OK
, "get_textDecorationOverline failed: %08x\n", hres
);
1185 ok(b
== VARIANT_TRUE
, "textDecorationOverline = %x\n", b
);
1187 hres
= IHTMLStyle_put_textDecorationOverline(style
, VARIANT_FALSE
);
1188 ok(hres
== S_OK
, "put_textDecorationOverline failed: %08x\n", hres
);
1191 hres
= IHTMLStyle_get_textDecorationBlink(style
, &b
);
1192 ok(hres
== S_OK
, "get_textDecorationBlink failed: %08x\n", hres
);
1193 ok(b
== VARIANT_FALSE
, "textDecorationBlink = %x\n", b
);
1195 hres
= IHTMLStyle_put_textDecorationBlink(style
, VARIANT_TRUE
);
1196 ok(hres
== S_OK
, "put_textDecorationBlink failed: %08x\n", hres
);
1198 hres
= IHTMLStyle_get_textDecorationBlink(style
, &b
);
1199 ok(hres
== S_OK
, "get_textDecorationBlink failed: %08x\n", hres
);
1200 ok(b
== VARIANT_TRUE
, "textDecorationBlink = %x\n", b
);
1202 hres
= IHTMLStyle_put_textDecorationBlink(style
, VARIANT_FALSE
);
1203 ok(hres
== S_OK
, "textDecorationBlink failed: %08x\n", hres
);
1205 hres
= IHTMLStyle_get_textDecoration(style
, &sDefault
);
1206 ok(hres
== S_OK
, "get_textDecoration failed: %08x\n", hres
);
1208 str
= a2bstr("invalid");
1209 hres
= IHTMLStyle_put_textDecoration(style
, str
);
1210 ok(hres
== (compat_mode
< COMPAT_IE9
? E_INVALIDARG
: S_OK
),
1211 "put_textDecoration failed: %08x\n", hres
);
1214 set_text_decoration(style
, "none");
1215 test_text_decoration(style
, "none");
1216 set_text_decoration(style
, "underline");
1217 set_text_decoration(style
, "overline");
1218 set_text_decoration(style
, "line-through");
1219 set_text_decoration(style
, "blink");
1220 set_text_decoration(style
, "overline");
1221 set_text_decoration(style
, "blink");
1222 test_text_decoration(style
, "blink");
1224 str
= a2bstr("invalid");
1225 hres
= IHTMLStyle_put_textDecoration(style
, str
);
1226 ok(hres
== (compat_mode
< COMPAT_IE9
? E_INVALIDARG
: S_OK
),
1227 "put_textDecoration failed: %08x\n", hres
);
1229 test_text_decoration(style
, compat_mode
< COMPAT_IE9
? NULL
: "blink");
1231 hres
= IHTMLStyle_put_textDecoration(style
, sDefault
);
1232 ok(hres
== S_OK
, "put_textDecoration failed: %08x\n", hres
);
1233 SysFreeString(sDefault
);
1235 hres
= IHTMLStyle_get_posWidth(style
, NULL
);
1236 ok(hres
== E_POINTER
, "get_posWidth failed: %08x\n", hres
);
1238 hres
= IHTMLStyle_get_posWidth(style
, &f
);
1239 ok(hres
== S_OK
, "get_posWidth failed: %08x\n", hres
);
1240 ok(f
== 0.0f
, "f = %f\n", f
);
1242 V_VT(&v
) = VT_EMPTY
;
1243 hres
= IHTMLStyle_get_width(style
, &v
);
1244 ok(hres
== S_OK
, "get_width failed: %08x\n", hres
);
1245 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
1246 ok(!V_BSTR(&v
), "V_BSTR(v)=%p\n", V_BSTR(&v
));
1248 hres
= IHTMLStyle_put_posWidth(style
, 2.2);
1249 ok(hres
== S_OK
, "put_posWidth failed: %08x\n", hres
);
1251 hres
= IHTMLStyle_get_posWidth(style
, &f
);
1252 ok(hres
== S_OK
, "get_posWidth failed: %08x\n", hres
);
1254 f
== 2.2f
, /* IE8 */
1258 hres
= IHTMLStyle_get_pixelWidth(style
, &l
);
1259 ok(hres
== S_OK
, "get_pixelWidth failed: %08x\n", hres
);
1260 ok(l
== 2, "pixelWidth = %d\n", l
);
1263 V_BSTR(&v
) = a2bstr("auto");
1264 hres
= IHTMLStyle_put_width(style
, v
);
1265 ok(hres
== S_OK
, "put_width failed: %08x\n", hres
);
1268 V_VT(&v
) = VT_EMPTY
;
1269 hres
= IHTMLStyle_get_width(style
, &v
);
1270 ok(hres
== S_OK
, "get_width failed: %08x\n", hres
);
1271 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
1272 ok(!strcmp_wa(V_BSTR(&v
), "auto"), "V_BSTR(v)=%s\n", wine_dbgstr_w(V_BSTR(&v
)));
1276 hres
= IHTMLStyle_get_pixelWidth(style
, &l
);
1277 ok(hres
== S_OK
, "get_pixelWidth failed: %08x\n", hres
);
1278 ok(!l
, "pixelWidth = %d\n", l
);
1282 hres
= IHTMLStyle_put_width(style
, v
);
1283 ok(hres
== S_OK
, "put_width failed: %08x\n", hres
);
1285 hres
= IHTMLStyle_get_width(style
, &v
);
1286 ok(hres
== S_OK
, "get_width failed: %08x\n", hres
);
1287 test_var_bstr(&v
, compat_mode
< COMPAT_IE9
? "100px" : "auto");
1291 hres
= IHTMLStyle_get_pixelWidth(style
, &l
);
1292 ok(hres
== S_OK
, "get_pixelWidth failed: %08x\n", hres
);
1293 ok(l
== (compat_mode
< COMPAT_IE9
? 100 : 0), "pixelWidth = %d\n", l
);
1295 V_VT(&v
) = VT_EMPTY
;
1296 hres
= IHTMLStyle_get_width(style
, &v
);
1297 ok(hres
== S_OK
, "get_width failed: %08x\n", hres
);
1298 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
1299 ok(!strcmp_wa(V_BSTR(&v
), compat_mode
< COMPAT_IE9
? "100px" : "auto"), "V_BSTR(v)=%s\n",
1300 wine_dbgstr_w(V_BSTR(&v
)));
1303 hres
= IHTMLStyle_put_pixelWidth(style
, 50);
1304 ok(hres
== S_OK
, "put_pixelWidth failed: %08x\n", hres
);
1307 hres
= IHTMLStyle_get_pixelWidth(style
, &l
);
1308 ok(hres
== S_OK
, "get_pixelWidth failed: %08x\n", hres
);
1309 ok(l
== 50, "pixelWidth = %d\n", l
);
1311 hres
= IHTMLStyle_get_pixelWidth(style
, NULL
);
1312 ok(hres
== E_POINTER
, "get_pixelWidth failed: %08x\n", hres
);
1314 V_VT(&v
) = VT_EMPTY
;
1315 hres
= IHTMLStyle_get_width(style
, &v
);
1316 ok(hres
== S_OK
, "get_width failed: %08x\n", hres
);
1317 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
1318 ok(!strcmp_wa(V_BSTR(&v
), "50px"), "V_BSTR(v)=%s\n", wine_dbgstr_w(V_BSTR(&v
)));
1322 str
= (void*)0xdeadbeef;
1323 hres
= IHTMLStyle_get_margin(style
, &str
);
1324 ok(hres
== S_OK
, "get_margin failed: %08x\n", hres
);
1325 ok(!str
, "margin = %s\n", wine_dbgstr_w(str
));
1328 hres
= IHTMLStyle_put_margin(style
, str
);
1329 ok(hres
== S_OK
, "put_margin failed: %08x\n", hres
);
1332 hres
= IHTMLStyle_get_margin(style
, &str
);
1333 ok(hres
== S_OK
, "get_margin failed: %08x\n", hres
);
1334 if(compat_mode
< COMPAT_IE9
)
1335 ok(!strcmp_wa(str
, "1px"), "margin = %s\n", wine_dbgstr_w(str
));
1337 ok(!str
, "margin = %s\n", wine_dbgstr_w(str
));
1340 str
= a2bstr("2px");
1341 hres
= IHTMLStyle_put_margin(style
, str
);
1342 ok(hres
== S_OK
, "put_margin failed: %08x\n", hres
);
1345 hres
= IHTMLStyle_get_margin(style
, &str
);
1346 ok(hres
== S_OK
, "get_margin failed: %08x\n", hres
);
1347 ok(!strcmp_wa(str
, "2px"), "margin = %s\n", wine_dbgstr_w(str
));
1350 hres
= IHTMLStyle_put_margin(style
, NULL
);
1351 ok(hres
== S_OK
, "put_margin failed: %08x\n", hres
);
1353 str
= (void*)0xdeadbeef;
1354 hres
= IHTMLStyle_get_marginTop(style
, &v
);
1355 ok(hres
== S_OK
, "get_marginTop failed: %08x\n", hres
);
1356 ok(V_VT(&v
) == VT_BSTR
, "V_VT(marginTop) = %d\n", V_VT(&v
));
1357 ok(!V_BSTR(&v
), "V_BSTR(marginTop) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1360 V_BSTR(&v
) = a2bstr("6px");
1361 hres
= IHTMLStyle_put_marginTop(style
, v
);
1362 SysFreeString(V_BSTR(&v
));
1363 ok(hres
== S_OK
, "put_marginTop failed: %08x\n", hres
);
1365 str
= (void*)0xdeadbeef;
1366 hres
= IHTMLStyle_get_marginTop(style
, &v
);
1367 ok(hres
== S_OK
, "get_marginTop failed: %08x\n", hres
);
1368 ok(V_VT(&v
) == VT_BSTR
, "V_VT(marginTop) = %d\n", V_VT(&v
));
1369 ok(!strcmp_wa(V_BSTR(&v
), "6px"), "V_BSTR(marginTop) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1374 hres
= IHTMLStyle_put_marginTop(style
, v
);
1375 ok(hres
== S_OK
, "put_marginTop failed: %08x\n", hres
);
1377 str
= (void*)0xdeadbeef;
1378 hres
= IHTMLStyle_get_marginTop(style
, &v
);
1379 ok(hres
== S_OK
, "get_marginTop failed: %08x\n", hres
);
1380 ok(V_VT(&v
) == VT_BSTR
, "V_VT(marginTop) = %d\n", V_VT(&v
));
1381 ok(!strcmp_wa(V_BSTR(&v
), compat_mode
< COMPAT_IE9
? "5px" : "6px"),
1382 "V_BSTR(marginTop) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1386 hres
= IHTMLStyle_get_border(style
, &str
);
1387 ok(hres
== S_OK
, "get_border failed: %08x\n", hres
);
1388 ok(!str
|| !*str
, "str is not empty\n");
1391 str
= a2bstr("1px");
1392 hres
= IHTMLStyle_put_border(style
, str
);
1393 ok(hres
== S_OK
, "put_border 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(!V_BSTR(&v
), "V_BSTR(v) != NULL\n");
1404 hres
= IHTMLStyle_get_pixelLeft(style
, &l
);
1405 ok(hres
== S_OK
, "get_pixelLeft failed: %08x\n", hres
);
1406 ok(!l
, "pixelLeft = %d\n", l
);
1409 hres
= IHTMLStyle_get_posLeft(style
, NULL
);
1410 ok(hres
== E_POINTER
, "get_posLeft failed: %08x\n", hres
);
1413 hres
= IHTMLStyle_get_posLeft(style
, &f
);
1414 ok(hres
== S_OK
, "get_posLeft failed: %08x\n", hres
);
1415 ok(f
== 0.0, "expected 0.0 got %f\n", f
);
1417 hres
= IHTMLStyle_put_posLeft(style
, 4.9f
);
1418 ok(hres
== S_OK
, "put_posLeft failed: %08x\n", hres
);
1420 hres
= IHTMLStyle_get_posLeft(style
, &f
);
1421 ok(hres
== S_OK
, "get_posLeft failed: %08x\n", hres
);
1423 f
== 4.9f
, /* IE8 */
1424 "expected 4.0 or 4.9 (IE8) got %f\n", f
);
1426 /* Ensure left is updated correctly. */
1427 V_VT(&v
) = VT_EMPTY
;
1428 hres
= IHTMLStyle_get_left(style
, &v
);
1429 ok(hres
== S_OK
, "get_left failed: %08x\n", hres
);
1430 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
1431 ok(!strcmp_wa(V_BSTR(&v
), "4px") ||
1432 !strcmp_wa(V_BSTR(&v
), "4.9px"), /* IE8 */
1433 "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1438 V_BSTR(&v
) = a2bstr("3px");
1439 hres
= IHTMLStyle_put_left(style
, v
);
1440 ok(hres
== S_OK
, "put_left failed: %08x\n", hres
);
1443 hres
= IHTMLStyle_get_posLeft(style
, &f
);
1444 ok(hres
== S_OK
, "get_posLeft failed: %08x\n", hres
);
1445 ok(f
== 3.0, "expected 3.0 got %f\n", f
);
1448 hres
= IHTMLStyle_get_pixelLeft(style
, &l
);
1449 ok(hres
== S_OK
, "get_pixelLeft failed: %08x\n", hres
);
1450 ok(l
== 3, "pixelLeft = %d\n", l
);
1452 V_VT(&v
) = VT_EMPTY
;
1453 hres
= IHTMLStyle_get_left(style
, &v
);
1454 ok(hres
== S_OK
, "get_left failed: %08x\n", hres
);
1455 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
1456 ok(!strcmp_wa(V_BSTR(&v
), "3px"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1460 V_BSTR(&v
) = a2bstr("4.99");
1461 hres
= IHTMLStyle_put_left(style
, v
);
1462 ok(hres
== S_OK
, "put_left failed: %08x\n", hres
);
1466 hres
= IHTMLStyle_get_pixelLeft(style
, &l
);
1467 ok(hres
== S_OK
, "get_pixelLeft failed: %08x\n", hres
);
1468 ok(l
== (compat_mode
< COMPAT_IE9
? 4 : 3), "pixelLeft = %d\n", l
);
1471 hres
= IHTMLStyle_put_left(style
, v
);
1472 ok(hres
== S_OK
, "put_left failed: %08x\n", hres
);
1474 V_VT(&v
) = VT_EMPTY
;
1475 hres
= IHTMLStyle_get_left(style
, &v
);
1476 ok(hres
== S_OK
, "get_left failed: %08x\n", hres
);
1477 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
1478 ok(!V_BSTR(&v
), "V_BSTR(v) != NULL\n");
1481 V_VT(&v
) = VT_EMPTY
;
1482 hres
= IHTMLStyle_get_top(style
, &v
);
1483 ok(hres
== S_OK
, "get_top failed: %08x\n", hres
);
1484 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
1485 ok(!V_BSTR(&v
), "V_BSTR(v) != NULL\n");
1489 hres
= IHTMLStyle_get_pixelLeft(style
, &l
);
1490 ok(hres
== S_OK
, "get_pixelLeft failed: %08x\n", hres
);
1491 ok(!l
, "pixelLeft = %d\n", l
);
1493 hres
= IHTMLStyle_put_pixelLeft(style
, 6);
1494 ok(hres
== S_OK
, "put_pixelLeft failed: %08x\n", hres
);
1497 hres
= IHTMLStyle_get_pixelLeft(style
, &l
);
1498 ok(hres
== S_OK
, "get_pixelLeft failed: %08x\n", hres
);
1499 ok(l
== 6, "pixelLeft = %d\n", l
);
1501 hres
= IHTMLStyle_get_pixelLeft(style
, NULL
);
1502 ok(hres
== E_POINTER
, "get_pixelLeft failed: %08x\n", hres
);
1504 V_VT(&v
) = VT_EMPTY
;
1505 hres
= IHTMLStyle_get_left(style
, &v
);
1506 ok(hres
== S_OK
, "get_left failed: %08x\n", hres
);
1507 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
1508 ok(!strcmp_wa(V_BSTR(&v
), "6px"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1512 hres
= IHTMLStyle_get_posTop(style
, NULL
);
1513 ok(hres
== E_POINTER
, "get_posTop failed: %08x\n", hres
);
1516 hres
= IHTMLStyle_get_posTop(style
, &f
);
1517 ok(hres
== S_OK
, "get_posTop failed: %08x\n", hres
);
1518 ok(f
== 0.0, "expected 0.0 got %f\n", f
);
1520 hres
= IHTMLStyle_put_posTop(style
, 4.9f
);
1521 ok(hres
== S_OK
, "put_posTop failed: %08x\n", hres
);
1523 hres
= IHTMLStyle_get_posTop(style
, &f
);
1524 ok(hres
== S_OK
, "get_posTop failed: %08x\n", hres
);
1526 f
== 4.9f
, /* IE8 */
1527 "expected 4.0 or 4.9 (IE8) got %f\n", f
);
1529 hres
= IHTMLStyle_put_pixelTop(style
, 6);
1530 ok(hres
== S_OK
, "put_pixelTop failed: %08x\n", hres
);
1533 hres
= IHTMLStyle_get_pixelTop(style
, &l
);
1534 ok(hres
== S_OK
, "get_pixelTop failed: %08x\n", hres
);
1535 ok(l
== 6, "pixelTop = %d\n", l
);
1537 hres
= IHTMLStyle_get_pixelTop(style
, NULL
);
1538 ok(hres
== E_POINTER
, "get_pixelTop failed: %08x\n", hres
);
1541 V_BSTR(&v
) = a2bstr("3px");
1542 hres
= IHTMLStyle_put_top(style
, v
);
1543 ok(hres
== S_OK
, "put_top failed: %08x\n", hres
);
1546 V_VT(&v
) = VT_EMPTY
;
1547 hres
= IHTMLStyle_get_top(style
, &v
);
1548 ok(hres
== S_OK
, "get_top failed: %08x\n", hres
);
1549 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
1550 ok(!strcmp_wa(V_BSTR(&v
), "3px"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1553 hres
= IHTMLStyle_get_posTop(style
, &f
);
1554 ok(hres
== S_OK
, "get_posTop failed: %08x\n", hres
);
1555 ok(f
== 3.0, "expected 3.0 got %f\n", f
);
1558 hres
= IHTMLStyle_get_pixelTop(style
, &l
);
1559 ok(hres
== S_OK
, "get_pixelTop failed: %08x\n", hres
);
1560 ok(l
== 3, "pixelTop = %d\n", l
);
1563 V_BSTR(&v
) = a2bstr("100%");
1564 hres
= IHTMLStyle_put_top(style
, v
);
1565 ok(hres
== S_OK
, "put_top failed: %08x\n", hres
);
1569 hres
= IHTMLStyle_get_pixelTop(style
, &l
);
1570 ok(hres
== S_OK
, "get_pixelTop failed: %08x\n", hres
);
1571 ok(!l
, "pixelTop = %d\n", l
);
1574 hres
= IHTMLStyle_put_top(style
, v
);
1575 ok(hres
== S_OK
, "put_top failed: %08x\n", hres
);
1577 V_VT(&v
) = VT_EMPTY
;
1578 hres
= IHTMLStyle_get_top(style
, &v
);
1579 ok(hres
== S_OK
, "get_top failed: %08x\n", hres
);
1580 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
1581 ok(!V_BSTR(&v
), "V_BSTR(v) != NULL\n");
1585 hres
= IHTMLStyle_get_pixelTop(style
, &l
);
1586 ok(hres
== S_OK
, "get_pixelTop failed: %08x\n", hres
);
1587 ok(!l
, "pixelTop = %d\n", l
);
1589 /* Test posHeight */
1590 hres
= IHTMLStyle_get_posHeight(style
, NULL
);
1591 ok(hres
== E_POINTER
, "get_posHeight failed: %08x\n", hres
);
1593 V_VT(&v
) = VT_EMPTY
;
1594 hres
= IHTMLStyle_get_height(style
, &v
);
1595 ok(hres
== S_OK
, "get_height failed: %08x\n", hres
);
1596 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
1597 ok(!V_BSTR(&v
), "V_BSTR(v) != NULL\n");
1601 hres
= IHTMLStyle_get_posHeight(style
, &f
);
1602 ok(hres
== S_OK
, "get_posHeight failed: %08x\n", hres
);
1603 ok(f
== 0.0, "expected 0.0 got %f\n", f
);
1606 hres
= IHTMLStyle_get_pixelHeight(style
, &l
);
1607 ok(hres
== S_OK
, "get_pixelHeight failed: %08x\n", hres
);
1608 ok(!l
, "pixelHeight = %d\n", l
);
1610 hres
= IHTMLStyle_put_posHeight(style
, 4.9f
);
1611 ok(hres
== S_OK
, "put_posHeight failed: %08x\n", hres
);
1613 hres
= IHTMLStyle_get_posHeight(style
, &f
);
1614 ok(hres
== S_OK
, "get_posHeight failed: %08x\n", hres
);
1616 f
== 4.9f
, /* IE8 */
1617 "expected 4.0 or 4.9 (IE8) got %f\n", f
);
1620 hres
= IHTMLStyle_get_pixelHeight(style
, &l
);
1621 ok(hres
== S_OK
, "get_pixelHeight failed: %08x\n", hres
);
1624 "pixelHeight = %d\n", l
);
1627 V_BSTR(&v
) = a2bstr("70px");
1628 hres
= IHTMLStyle_put_height(style
, v
);
1629 ok(hres
== S_OK
, "put_height failed: %08x\n", hres
);
1632 V_VT(&v
) = VT_EMPTY
;
1633 hres
= IHTMLStyle_get_height(style
, &v
);
1634 ok(hres
== S_OK
, "get_height failed: %08x\n", hres
);
1635 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
1636 ok(!strcmp_wa(V_BSTR(&v
), "70px"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1640 hres
= IHTMLStyle_get_pixelHeight(style
, &l
);
1641 ok(hres
== S_OK
, "get_pixelHeight failed: %08x\n", hres
);
1642 ok(l
== 70, "pixelHeight = %d\n", l
);
1645 V_BSTR(&v
) = a2bstr("50%");
1646 hres
= IHTMLStyle_put_height(style
, v
);
1647 ok(hres
== S_OK
, "put_height failed: %08x\n", hres
);
1651 hres
= IHTMLStyle_get_pixelHeight(style
, &l
);
1652 ok(hres
== S_OK
, "get_pixelHeight failed: %08x\n", hres
);
1653 ok(!l
, "pixelHeight = %d\n", l
);
1657 hres
= IHTMLStyle_put_height(style
, v
);
1658 ok(hres
== S_OK
, "put_height failed: %08x\n", hres
);
1661 V_VT(&v
) = VT_EMPTY
;
1662 hres
= IHTMLStyle_get_height(style
, &v
);
1663 ok(hres
== S_OK
, "get_height failed: %08x\n", hres
);
1664 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
1665 ok(!V_BSTR(&v
), "V_BSTR(v) = %s, expected NULL\n", wine_dbgstr_w(V_BSTR(&v
)));
1669 hres
= IHTMLStyle_get_pixelHeight(style
, &l
);
1670 ok(hres
== S_OK
, "get_pixelHeight failed: %08x\n", hres
);
1671 ok(!l
, "pixelHeight = %d\n", l
);
1673 hres
= IHTMLStyle_put_pixelHeight(style
, 50);
1674 ok(hres
== S_OK
, "put_pixelHeight failed: %08x\n", hres
);
1677 hres
= IHTMLStyle_get_pixelHeight(style
, &l
);
1678 ok(hres
== S_OK
, "get_pixelHeight failed: %08x\n", hres
);
1679 ok(l
== 50, "pixelHeight = %d\n", l
);
1681 hres
= IHTMLStyle_get_pixelHeight(style
, NULL
);
1682 ok(hres
== E_POINTER
, "get_pixelHeight failed: %08x\n", hres
);
1686 hres
= IHTMLStyle_put_height(style
, v
);
1687 ok(hres
== S_OK
, "put_height failed: %08x\n", hres
);
1689 V_VT(&v
) = VT_EMPTY
;
1690 hres
= IHTMLStyle_get_height(style
, &v
);
1691 ok(hres
== S_OK
, "get_height failed: %08x\n", hres
);
1692 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
1693 ok(!strcmp_wa(V_BSTR(&v
), compat_mode
< COMPAT_IE9
? "64px" : "50px"),
1694 "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1697 hres
= IHTMLStyle_get_posHeight(style
, &f
);
1698 ok(hres
== S_OK
, "get_posHeight failed: %08x\n", hres
);
1699 ok(f
== (compat_mode
< COMPAT_IE9
? 64.0 : 50), "expected 64.0 got %f\n", f
);
1702 hres
= IHTMLStyle_get_pixelHeight(style
, &l
);
1703 ok(hres
== S_OK
, "get_pixelHeight failed: %08x\n", hres
);
1704 ok(l
== (compat_mode
< COMPAT_IE9
? 64 : 50), "pixelHeight = %d\n", l
);
1706 str
= (void*)0xdeadbeef;
1707 hres
= IHTMLStyle_get_cursor(style
, &str
);
1708 ok(hres
== S_OK
, "get_cursor failed: %08x\n", hres
);
1709 ok(!str
, "get_cursor != NULL\n");
1712 str
= a2bstr("default");
1713 hres
= IHTMLStyle_put_cursor(style
, str
);
1714 ok(hres
== S_OK
, "put_cursor failed: %08x\n", hres
);
1718 hres
= IHTMLStyle_get_cursor(style
, &str
);
1719 ok(hres
== S_OK
, "get_cursor failed: %08x\n", hres
);
1720 ok(!strcmp_wa(str
, "default"), "get_cursor returned %s\n", wine_dbgstr_w(str
));
1723 V_VT(&v
) = VT_EMPTY
;
1724 hres
= IHTMLStyle_get_verticalAlign(style
, &v
);
1725 ok(hres
== S_OK
, "get_vertivalAlign failed: %08x\n", hres
);
1726 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
1727 ok(!V_BSTR(&v
), "V_BSTR(v) != NULL\n");
1731 V_BSTR(&v
) = a2bstr("middle");
1732 hres
= IHTMLStyle_put_verticalAlign(style
, v
);
1733 ok(hres
== S_OK
, "put_vertivalAlign failed: %08x\n", hres
);
1736 V_VT(&v
) = VT_EMPTY
;
1737 hres
= IHTMLStyle_get_verticalAlign(style
, &v
);
1738 ok(hres
== S_OK
, "get_verticalAlign failed: %08x\n", hres
);
1739 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
1740 ok(!strcmp_wa(V_BSTR(&v
), "middle"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1745 hres
= IHTMLStyle_put_verticalAlign(style
, v
);
1746 ok(hres
== S_OK
, "put_vertivalAlign failed: %08x\n", hres
);
1749 V_VT(&v
) = VT_EMPTY
;
1750 hres
= IHTMLStyle_get_verticalAlign(style
, &v
);
1751 ok(hres
== S_OK
, "get_verticalAlign failed: %08x\n", hres
);
1752 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
1753 ok(!strcmp_wa(V_BSTR(&v
), compat_mode
< COMPAT_IE9
? "100px" : "middle"),
1754 "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1757 str
= (void*)0xdeadbeef;
1758 hres
= IHTMLStyle_get_textAlign(style
, &str
);
1759 ok(hres
== S_OK
, "get_textAlign failed: %08x\n", hres
);
1760 ok(!str
, "textAlign != NULL\n");
1762 str
= a2bstr("center");
1763 hres
= IHTMLStyle_put_textAlign(style
, str
);
1764 ok(hres
== S_OK
, "put_textAlign failed: %08x\n", hres
);
1768 hres
= IHTMLStyle_get_textAlign(style
, &str
);
1769 ok(hres
== S_OK
, "get_textAlign failed: %08x\n", hres
);
1770 ok(!strcmp_wa(str
, "center"), "textAlign = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1774 hres
= IHTMLStyle_get_textIndent(style
, &v
);
1775 ok(hres
== S_OK
, "get_textIndent failed: %08x\n", hres
);
1776 ok(V_VT(&v
) == VT_BSTR
, "V_VT(textIndent) = %d\n", V_VT(&v
));
1777 ok(!V_BSTR(&v
), "V_BSTR(textIndent) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1781 hres
= IHTMLStyle_put_textIndent(style
, v
);
1782 ok(hres
== S_OK
, "put_textIndent failed: %08x\n", hres
);
1785 hres
= IHTMLStyle_get_textIndent(style
, &v
);
1786 ok(hres
== S_OK
, "get_textIndent failed: %08x\n", hres
);
1787 ok(V_VT(&v
) == VT_BSTR
, "V_VT(textIndent) = %d\n", V_VT(&v
));
1788 if(compat_mode
< COMPAT_IE9
)
1789 ok(!strcmp_wa(V_BSTR(&v
), "6px"), "textIndent = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1791 ok(!V_BSTR(&v
), "textIndent = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1793 str
= (void*)0xdeadbeef;
1794 hres
= IHTMLStyle_get_textTransform(style
, &str
);
1795 ok(hres
== S_OK
, "get_textTransform failed: %08x\n", hres
);
1796 ok(!str
, "textTransform != NULL\n");
1798 str
= a2bstr("lowercase");
1799 hres
= IHTMLStyle_put_textTransform(style
, str
);
1800 ok(hres
== S_OK
, "put_textTransform failed: %08x\n", hres
);
1804 hres
= IHTMLStyle_get_textTransform(style
, &str
);
1805 ok(hres
== S_OK
, "get_textTransform failed: %08x\n", hres
);
1806 ok(!strcmp_wa(str
, "lowercase"), "textTransform = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1809 str
= (void*)0xdeadbeef;
1810 hres
= IHTMLStyle_get_filter(style
, &str
);
1811 ok(hres
== S_OK
, "get_filter failed: %08x\n", hres
);
1812 ok(!str
, "filter != NULL\n");
1814 str
= a2bstr("alpha(opacity=100)");
1815 hres
= IHTMLStyle_put_filter(style
, str
);
1816 ok(hres
== S_OK
, "put_filter failed: %08x\n", hres
);
1819 hres
= IHTMLStyle_put_filter(style
, NULL
);
1820 ok(hres
== S_OK
, "put_filter failed: %08x\n", hres
);
1822 str
= (void*)0xdeadbeef;
1823 hres
= IHTMLStyle_get_filter(style
, &str
);
1824 ok(hres
== S_OK
, "get_filter failed: %08x\n", hres
);
1825 ok(!str
, "filter != NULL\n");
1827 V_VT(&v
) = VT_EMPTY
;
1828 hres
= IHTMLStyle_get_zIndex(style
, &v
);
1829 ok(hres
== S_OK
, "get_zIndex failed: %08x\n", hres
);
1830 if(compat_mode
< COMPAT_IE9
) {
1831 ok(V_VT(&v
) == VT_I4
, "V_VT(v)=%d\n", V_VT(&v
));
1832 ok(!V_I4(&v
), "V_I4(v) != 0\n");
1834 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
1835 ok(!V_BSTR(&v
), "zIndex = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1840 hres
= IHTMLCSSStyleDeclaration_get_zIndex(css_style
, &v
);
1841 ok(hres
== S_OK
, "get_zIndex failed: %08x\n", hres
);
1842 if(compat_mode
< COMPAT_IE9
) {
1843 ok(V_VT(&v
) == VT_I4
, "V_VT(v)=%d\n", V_VT(&v
));
1844 ok(!V_I4(&v
), "V_I4(v) != 0\n");
1846 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
1847 ok(!V_BSTR(&v
), "zIndex = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
1852 V_BSTR(&v
) = a2bstr("1");
1853 hres
= IHTMLStyle_put_zIndex(style
, v
);
1854 ok(hres
== S_OK
, "put_zIndex failed: %08x\n", hres
);
1857 V_VT(&v
) = VT_EMPTY
;
1858 hres
= IHTMLStyle_get_zIndex(style
, &v
);
1859 ok(hres
== S_OK
, "get_zIndex failed: %08x\n", hres
);
1860 ok(V_VT(&v
) == VT_I4
, "V_VT(v)=%d\n", V_VT(&v
));
1861 ok(V_I4(&v
) == 1, "V_I4(v) = %d\n", V_I4(&v
));
1865 hres
= IHTMLStyle_get_fontStyle(style
, &sDefault
);
1866 ok(hres
== S_OK
, "get_fontStyle failed: %08x\n", hres
);
1868 str
= a2bstr("test");
1869 hres
= IHTMLStyle_put_fontStyle(style
, str
);
1870 ok(hres
== (compat_mode
< COMPAT_IE9
? E_INVALIDARG
: S_OK
),
1871 "put_fontStyle failed: %08x\n", hres
);
1874 str
= a2bstr("italic");
1875 hres
= IHTMLStyle_put_fontStyle(style
, str
);
1876 ok(hres
== S_OK
, "put_fontStyle failed: %08x\n", hres
);
1879 str
= a2bstr("oblique");
1880 hres
= IHTMLStyle_put_fontStyle(style
, str
);
1881 ok(hres
== S_OK
, "put_fontStyle failed: %08x\n", hres
);
1884 str
= a2bstr("normal");
1885 hres
= IHTMLStyle_put_fontStyle(style
, str
);
1886 ok(hres
== S_OK
, "put_fontStyle failed: %08x\n", hres
);
1889 hres
= IHTMLStyle_put_fontStyle(style
, sDefault
);
1890 ok(hres
== S_OK
, "put_fontStyle failed: %08x\n", hres
);
1891 SysFreeString(sDefault
);
1894 hres
= IHTMLStyle_get_overflow(style
, NULL
);
1895 ok(hres
== E_INVALIDARG
, "get_overflow failed: %08x\n", hres
);
1897 hres
= IHTMLStyle_get_overflow(style
, &sOverflowDefault
);
1898 ok(hres
== S_OK
, "get_overflow failed: %08x\n", hres
);
1900 str
= a2bstr("test");
1901 hres
= IHTMLStyle_put_overflow(style
, str
);
1902 ok(hres
== (compat_mode
< COMPAT_IE9
? E_INVALIDARG
: S_OK
),
1903 "put_overflow failed: %08x\n", hres
);
1906 str
= a2bstr("visible");
1907 hres
= IHTMLStyle_put_overflow(style
, str
);
1908 ok(hres
== S_OK
, "put_overflow failed: %08x\n", hres
);
1911 str
= a2bstr("scroll");
1912 hres
= IHTMLStyle_put_overflow(style
, str
);
1913 ok(hres
== S_OK
, "put_overflow failed: %08x\n", hres
);
1916 str
= a2bstr("hidden");
1917 hres
= IHTMLStyle_put_overflow(style
, str
);
1918 ok(hres
== S_OK
, "put_overflow failed: %08x\n", hres
);
1921 str
= a2bstr("auto");
1922 hres
= IHTMLStyle_put_overflow(style
, str
);
1923 ok(hres
== S_OK
, "put_overflow failed: %08x\n", hres
);
1926 hres
= IHTMLStyle_get_overflow(style
, &str
);
1927 ok(hres
== S_OK
, "get_overflow failed: %08x\n", hres
);
1928 ok(!strcmp_wa(str
, "auto"), "str=%s\n", wine_dbgstr_w(str
));
1932 hres
= IHTMLStyle_put_overflow(style
, str
);
1933 ok(hres
== S_OK
, "put_overflow failed: %08x\n", hres
);
1936 hres
= IHTMLStyle_get_overflow(style
, &str
);
1937 ok(hres
== S_OK
, "get_overflow failed: %08x\n", hres
);
1938 ok(!str
, "str=%s\n", wine_dbgstr_w(str
));
1941 /* restore overflow default */
1942 hres
= IHTMLStyle_put_overflow(style
, sOverflowDefault
);
1943 ok(hres
== S_OK
, "put_overflow failed: %08x\n", hres
);
1944 SysFreeString(sOverflowDefault
);
1946 /* Attribute Tests*/
1947 hres
= IHTMLStyle_getAttribute(style
, NULL
, 1, &v
);
1948 ok(hres
== E_INVALIDARG
, "getAttribute failed: %08x\n", hres
);
1950 str
= a2bstr("position");
1951 hres
= IHTMLStyle_getAttribute(style
, str
, 1, NULL
);
1952 ok(hres
== E_INVALIDARG
, "getAttribute failed: %08x\n", hres
);
1954 hres
= IHTMLStyle_getAttribute(style
, str
, 1, &v
);
1955 ok(hres
== S_OK
, "getAttribute failed: %08x\n", hres
);
1956 ok(V_VT(&v
) == VT_BSTR
, "type failed: %d\n", V_VT(&v
));
1959 hres
= IHTMLStyle_setAttribute(style
, NULL
, v
, 1);
1960 ok(hres
== E_INVALIDARG
, "setAttribute failed: %08x\n", hres
);
1963 V_BSTR(&v
) = a2bstr("absolute");
1964 hres
= IHTMLStyle_setAttribute(style
, str
, v
, 1);
1965 ok(hres
== S_OK
, "setAttribute failed: %08x\n", hres
);
1968 hres
= IHTMLStyle_getAttribute(style
, str
, 1, &v
);
1969 ok(hres
== S_OK
, "getAttribute failed: %08x\n", hres
);
1970 ok(V_VT(&v
) == VT_BSTR
, "type failed: %d\n", V_VT(&v
));
1971 ok(!strcmp_wa(V_BSTR(&v
), "absolute"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v
)));
1976 hres
= IHTMLStyle_setAttribute(style
, str
, v
, 1);
1977 ok(hres
== S_OK
, "setAttribute failed: %08x\n", hres
);
1982 str
= a2bstr("borderLeftStyle");
1983 test_border_styles(style
, str
);
1986 str
= a2bstr("borderbottomstyle");
1987 test_border_styles(style
, str
);
1990 str
= a2bstr("borderrightstyle");
1991 test_border_styles(style
, str
);
1994 str
= a2bstr("bordertopstyle");
1995 test_border_styles(style
, str
);
1998 hres
= IHTMLStyle_get_borderStyle(style
, &sDefault
);
1999 ok(hres
== S_OK
, "get_borderStyle failed: %08x\n", hres
);
2001 str
= a2bstr("none dotted dashed solid");
2002 hres
= IHTMLStyle_put_borderStyle(style
, str
);
2003 ok(hres
== S_OK
, "put_borderStyle failed: %08x\n", hres
);
2006 str
= a2bstr("none dotted dashed solid");
2007 hres
= IHTMLStyle_get_borderStyle(style
, &str
);
2008 ok(hres
== S_OK
, "get_borderStyle failed: %08x\n", hres
);
2009 ok(!strcmp_wa(str
, "none dotted dashed solid"),
2010 "expected (none dotted dashed solid) = (%s)\n", wine_dbgstr_w(V_BSTR(&v
)));
2013 str
= a2bstr("double groove ridge inset");
2014 hres
= IHTMLStyle_put_borderStyle(style
, str
);
2015 ok(hres
== S_OK
, "put_borderStyle failed: %08x\n", hres
);
2018 str
= a2bstr("window-inset outset ridge inset");
2019 hres
= IHTMLStyle_put_borderStyle(style
, str
);
2020 ok(hres
== S_OK
, "put_borderStyle failed: %08x\n", hres
);
2023 str
= a2bstr("window-inset");
2024 hres
= IHTMLStyle_put_borderStyle(style
, str
);
2025 ok(hres
== S_OK
, "put_borderStyle failed: %08x\n", hres
);
2028 str
= a2bstr("none none none none none");
2029 hres
= IHTMLStyle_put_borderStyle(style
, str
);
2030 ok(hres
== S_OK
, "put_borderStyle failed: %08x\n", hres
);
2033 str
= a2bstr("invalid none none none");
2034 hres
= IHTMLStyle_put_borderStyle(style
, str
);
2035 todo_wine_if(compat_mode
>= COMPAT_IE9
)
2036 ok(hres
== (compat_mode
< COMPAT_IE9
? E_INVALIDARG
: S_OK
),
2037 "put_borderStyle failed: %08x\n", hres
);
2040 str
= a2bstr("none invalid none none");
2041 hres
= IHTMLStyle_put_borderStyle(style
, str
);
2042 todo_wine_if(compat_mode
>= COMPAT_IE9
)
2043 ok(hres
== (compat_mode
< COMPAT_IE9
? E_INVALIDARG
: S_OK
),
2044 "put_borderStyle failed: %08x\n", hres
);
2047 hres
= IHTMLStyle_put_borderStyle(style
, sDefault
);
2048 ok(hres
== S_OK
, "put_borderStyle failed: %08x\n", hres
);
2049 SysFreeString(sDefault
);
2051 /* backgroundColor */
2052 hres
= IHTMLStyle_get_backgroundColor(style
, &v
);
2053 ok(hres
== S_OK
, "get_backgroundColor: %08x\n", hres
);
2054 ok(V_VT(&v
) == VT_BSTR
, "type failed: %d\n", V_VT(&v
));
2055 ok(!V_BSTR(&v
), "str=%s\n", wine_dbgstr_w(V_BSTR(&v
)));
2059 V_BSTR(&v
) = a2bstr("red");
2060 hres
= IHTMLStyle_put_backgroundColor(style
, v
);
2061 ok(hres
== S_OK
, "put_backgroundColor failed: %08x\n", hres
);
2064 hres
= IHTMLStyle_get_backgroundColor(style
, &v
);
2065 ok(hres
== S_OK
, "get_backgroundColor: %08x\n", hres
);
2066 ok(V_VT(&v
) == VT_BSTR
, "type failed: %d\n", V_VT(&v
));
2067 ok(!strcmp_wa(V_BSTR(&v
), "red"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v
)));
2070 str
= a2bstr("fixed");
2071 hres
= IHTMLStyle_put_backgroundAttachment(style
, str
);
2072 ok(hres
== S_OK
, "put_backgroundAttachment failed: %08x\n", hres
);
2075 hres
= IHTMLStyle_get_backgroundAttachment(style
, &str
);
2076 ok(hres
== S_OK
, "get_backgroundAttachment failed: %08x\n", hres
);
2077 ok(!strcmp_wa(str
, "fixed"), "ret = %s\n", wine_dbgstr_w(str
));
2081 hres
= IHTMLStyle_get_padding(style
, &str
);
2082 ok(hres
== S_OK
, "get_padding failed: %08x\n", hres
);
2083 ok(!str
, "padding = %s\n", wine_dbgstr_w(str
));
2086 hres
= IHTMLStyle_get_paddingTop(style
, &v
);
2087 ok(hres
== S_OK
, "get_paddingTop: %08x\n", hres
);
2088 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
2089 ok(!V_BSTR(&v
), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2093 hres
= IHTMLStyle_put_paddingTop(style
, v
);
2094 ok(hres
== S_OK
, "put_paddingTop failed: %08x\n", hres
);
2096 hres
= IHTMLStyle_get_paddingTop(style
, &v
);
2097 ok(hres
== S_OK
, "get_paddingTop: %08x\n", hres
);
2098 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
2099 if(compat_mode
< COMPAT_IE9
)
2100 ok(!strcmp_wa(V_BSTR(&v
), "6px"), "paddingTop = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2102 ok(!V_BSTR(&v
), "paddingTop = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2105 hres
= IHTMLStyle_get_paddingRight(style
, &v
);
2106 ok(hres
== S_OK
, "get_paddingRight: %08x\n", hres
);
2107 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
2108 ok(!V_BSTR(&v
), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2112 hres
= IHTMLStyle_put_paddingRight(style
, v
);
2113 ok(hres
== S_OK
, "put_paddingRight failed: %08x\n", hres
);
2115 hres
= IHTMLStyle_get_paddingRight(style
, &v
);
2116 ok(hres
== S_OK
, "get_paddingRight: %08x\n", hres
);
2117 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
2118 if(compat_mode
< COMPAT_IE9
)
2119 ok(!strcmp_wa(V_BSTR(&v
), "6px"), "paddingRight = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2121 ok(!V_BSTR(&v
), "paddingRight = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2124 hres
= IHTMLStyle_get_paddingBottom(style
, &v
);
2125 ok(hres
== S_OK
, "get_paddingBottom: %08x\n", hres
);
2126 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
2127 ok(!V_BSTR(&v
), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2131 hres
= IHTMLStyle_put_paddingBottom(style
, v
);
2132 ok(hres
== S_OK
, "put_paddingBottom failed: %08x\n", hres
);
2134 hres
= IHTMLStyle_get_paddingBottom(style
, &v
);
2135 ok(hres
== S_OK
, "get_paddingBottom: %08x\n", hres
);
2136 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
2137 if(compat_mode
< COMPAT_IE9
)
2138 ok(!strcmp_wa(V_BSTR(&v
), "6px"), "paddingBottom = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2140 ok(!V_BSTR(&v
), "paddingBottom = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2144 hres
= IHTMLStyle_put_padding(style
, str
);
2145 ok(hres
== S_OK
, "put_padding failed: %08x\n", hres
);
2148 hres
= IHTMLStyle_get_padding(style
, &str
);
2149 ok(hres
== S_OK
, "get_padding failed: %08x\n", hres
);
2150 if(compat_mode
< COMPAT_IE9
)
2151 ok(!strcmp_wa(str
, "1px"), "padding = %s\n", wine_dbgstr_w(str
));
2153 ok(!str
, "padding = %s\n", wine_dbgstr_w(str
));
2157 hres
= IHTMLStyle_get_paddingLeft(style
, &vDefault
);
2158 ok(hres
== S_OK
, "get_paddingLeft: %08x\n", hres
);
2159 ok(V_VT(&vDefault
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&vDefault
));
2160 if(compat_mode
< COMPAT_IE9
)
2161 ok(!strcmp_wa(V_BSTR(&vDefault
), "1px"), "paddingLeft = %s\n",
2162 wine_dbgstr_w(V_BSTR(&vDefault
)));
2164 ok(!V_BSTR(&vDefault
), "paddingLeft = %s\n", wine_dbgstr_w(V_BSTR(&vDefault
)));
2167 V_BSTR(&v
) = a2bstr("10");
2168 hres
= IHTMLStyle_put_paddingLeft(style
, v
);
2169 ok(hres
== S_OK
, "put_paddingLeft: %08x\n", hres
);
2172 hres
= IHTMLStyle_get_paddingLeft(style
, &v
);
2173 ok(hres
== S_OK
, "get_paddingLeft: %08x\n", hres
);
2174 if(compat_mode
< COMPAT_IE9
)
2175 ok(!strcmp_wa(V_BSTR(&v
), "10px"), "paddingLeft = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2177 ok(!V_BSTR(&v
), "paddingLeft = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2180 hres
= IHTMLStyle_put_paddingLeft(style
, vDefault
);
2181 ok(hres
== S_OK
, "put_paddingLeft: %08x\n", hres
);
2183 /* BackgroundRepeat */
2184 hres
= IHTMLStyle_get_backgroundRepeat(style
, &sDefault
);
2185 ok(hres
== S_OK
, "get_backgroundRepeat failed: %08x\n", hres
);
2187 str
= a2bstr("invalid");
2188 hres
= IHTMLStyle_put_backgroundRepeat(style
, str
);
2189 ok(hres
== (compat_mode
< COMPAT_IE9
? E_INVALIDARG
: S_OK
),
2190 "put_backgroundRepeat failed: %08x\n", hres
);
2193 str
= a2bstr("repeat");
2194 hres
= IHTMLStyle_put_backgroundRepeat(style
, str
);
2195 ok(hres
== S_OK
, "put_backgroundRepeat failed: %08x\n", hres
);
2198 str
= a2bstr("no-repeat");
2199 hres
= IHTMLStyle_put_backgroundRepeat(style
, str
);
2200 ok(hres
== S_OK
, "put_backgroundRepeat failed: %08x\n", hres
);
2203 str
= a2bstr("repeat-x");
2204 hres
= IHTMLStyle_put_backgroundRepeat(style
, str
);
2205 ok(hres
== S_OK
, "put_backgroundRepeat failed: %08x\n", hres
);
2208 str
= a2bstr("repeat-y");
2209 hres
= IHTMLStyle_put_backgroundRepeat(style
, str
);
2210 ok(hres
== S_OK
, "put_backgroundRepeat failed: %08x\n", hres
);
2213 hres
= IHTMLStyle_get_backgroundRepeat(style
, &str
);
2214 ok(hres
== S_OK
, "get_backgroundRepeat failed: %08x\n", hres
);
2215 ok(!strcmp_wa(str
, "repeat-y"), "str=%s\n", wine_dbgstr_w(str
));
2218 hres
= IHTMLStyle_put_backgroundRepeat(style
, sDefault
);
2219 ok(hres
== S_OK
, "put_backgroundRepeat failed: %08x\n", hres
);
2220 SysFreeString(sDefault
);
2223 hres
= IHTMLStyle_get_borderColor(style
, &sDefault
);
2224 ok(hres
== S_OK
, "get_borderColor failed: %08x\n", hres
);
2226 str
= a2bstr("red green red blue");
2227 hres
= IHTMLStyle_put_borderColor(style
, str
);
2228 ok(hres
== S_OK
, "put_borderColor failed: %08x\n", hres
);
2231 hres
= IHTMLStyle_get_borderColor(style
, &str
);
2232 ok(hres
== S_OK
, "get_borderColor failed: %08x\n", hres
);
2233 ok(!strcmp_wa(str
, "red green red blue"), "str=%s\n", wine_dbgstr_w(str
));
2236 hres
= IHTMLStyle_put_borderColor(style
, sDefault
);
2237 ok(hres
== S_OK
, "put_borderColor failed: %08x\n", hres
);
2238 SysFreeString(sDefault
);
2241 hres
= IHTMLStyle_get_borderRight(style
, &sDefault
);
2242 ok(hres
== S_OK
, "get_borderRight failed: %08x\n", hres
);
2244 str
= a2bstr("thick dotted red");
2245 hres
= IHTMLStyle_put_borderRight(style
, str
);
2246 ok(hres
== S_OK
, "put_borderRight failed: %08x\n", hres
);
2249 /* IHTMLStyle_get_borderRight appears to have a bug where
2250 it returns the first letter of the color. So we check
2251 each style individually.
2254 hres
= IHTMLStyle_get_borderRightColor(style
, &v
);
2255 ok(hres
== S_OK
, "get_borderRightColor failed: %08x\n", hres
);
2256 ok(!strcmp_wa(V_BSTR(&v
), "red"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v
)));
2260 hres
= IHTMLStyle_get_borderRightWidth(style
, &v
);
2261 ok(hres
== S_OK
, "get_borderRightWidth failed: %08x\n", hres
);
2262 ok(!strcmp_wa(V_BSTR(&v
), "thick"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v
)));
2265 hres
= IHTMLStyle_get_borderRightStyle(style
, &str
);
2266 ok(hres
== S_OK
, "get_borderRightStyle failed: %08x\n", hres
);
2267 ok(!strcmp_wa(str
, "dotted"), "str=%s\n", wine_dbgstr_w(str
));
2270 hres
= IHTMLStyle_put_borderRight(style
, sDefault
);
2271 ok(hres
== S_OK
, "put_borderRight failed: %08x\n", hres
);
2272 SysFreeString(sDefault
);
2275 hres
= IHTMLStyle_get_borderTop(style
, &sDefault
);
2276 ok(hres
== S_OK
, "get_borderTop failed: %08x\n", hres
);
2278 str
= a2bstr("thick dotted red");
2279 hres
= IHTMLStyle_put_borderTop(style
, str
);
2280 ok(hres
== S_OK
, "put_borderTop failed: %08x\n", hres
);
2283 /* IHTMLStyle_get_borderTop appears to have a bug where
2284 it returns the first letter of the color. So we check
2285 each style individually.
2288 hres
= IHTMLStyle_get_borderTopColor(style
, &v
);
2289 ok(hres
== S_OK
, "get_borderTopColor failed: %08x\n", hres
);
2290 ok(!strcmp_wa(V_BSTR(&v
), "red"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v
)));
2294 hres
= IHTMLStyle_get_borderTopWidth(style
, &v
);
2295 ok(hres
== S_OK
, "get_borderTopWidth failed: %08x\n", hres
);
2296 ok(!strcmp_wa(V_BSTR(&v
), "thick"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v
)));
2299 hres
= IHTMLStyle_get_borderTopStyle(style
, &str
);
2300 ok(hres
== S_OK
, "get_borderTopStyle failed: %08x\n", hres
);
2301 ok(!strcmp_wa(str
, "dotted"), "str=%s\n", wine_dbgstr_w(str
));
2304 hres
= IHTMLStyle_put_borderTop(style
, sDefault
);
2305 ok(hres
== S_OK
, "put_borderTop failed: %08x\n", hres
);
2306 SysFreeString(sDefault
);
2309 hres
= IHTMLStyle_get_borderBottom(style
, &sDefault
);
2310 ok(hres
== S_OK
, "get_borderBottom failed: %08x\n", hres
);
2312 str
= a2bstr("thick dotted red");
2313 hres
= IHTMLStyle_put_borderBottom(style
, str
);
2314 ok(hres
== S_OK
, "put_borderBottom failed: %08x\n", hres
);
2317 /* IHTMLStyle_get_borderBottom appears to have a bug where
2318 it returns the first letter of the color. So we check
2319 each style individually.
2322 hres
= IHTMLStyle_get_borderBottomColor(style
, &v
);
2323 ok(hres
== S_OK
, "get_borderBottomColor failed: %08x\n", hres
);
2324 ok(!strcmp_wa(V_BSTR(&v
), "red"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v
)));
2328 hres
= IHTMLStyle_get_borderBottomWidth(style
, &v
);
2329 ok(hres
== S_OK
, "get_borderBottomWidth failed: %08x\n", hres
);
2330 ok(!strcmp_wa(V_BSTR(&v
), "thick"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v
)));
2333 hres
= IHTMLStyle_get_borderBottomStyle(style
, &str
);
2334 ok(hres
== S_OK
, "get_borderBottomStyle failed: %08x\n", hres
);
2335 ok(!strcmp_wa(str
, "dotted"), "str=%s\n", wine_dbgstr_w(str
));
2338 hres
= IHTMLStyle_put_borderBottom(style
, sDefault
);
2339 ok(hres
== S_OK
, "put_borderBottom failed: %08x\n", hres
);
2340 SysFreeString(sDefault
);
2343 hres
= IHTMLStyle_get_borderLeft(style
, &sDefault
);
2344 ok(hres
== S_OK
, "get_borderLeft failed: %08x\n", hres
);
2346 str
= a2bstr("thick dotted red");
2347 hres
= IHTMLStyle_put_borderLeft(style
, str
);
2348 ok(hres
== S_OK
, "put_borderLeft failed: %08x\n", hres
);
2351 /* IHTMLStyle_get_borderLeft appears to have a bug where
2352 it returns the first letter of the color. So we check
2353 each style individually.
2356 hres
= IHTMLStyle_get_borderLeftColor(style
, &v
);
2357 ok(hres
== S_OK
, "get_borderLeftColor failed: %08x\n", hres
);
2358 ok(!strcmp_wa(V_BSTR(&v
), "red"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v
)));
2362 hres
= IHTMLStyle_get_borderLeftWidth(style
, &v
);
2363 ok(hres
== S_OK
, "get_borderLeftWidth failed: %08x\n", hres
);
2364 ok(!strcmp_wa(V_BSTR(&v
), "thick"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v
)));
2367 hres
= IHTMLStyle_get_borderLeftStyle(style
, &str
);
2368 ok(hres
== S_OK
, "get_borderLeftStyle failed: %08x\n", hres
);
2369 ok(!strcmp_wa(str
, "dotted"), "str=%s\n", wine_dbgstr_w(str
));
2372 hres
= IHTMLStyle_put_borderLeft(style
, sDefault
);
2373 ok(hres
== S_OK
, "put_borderLeft failed: %08x\n", hres
);
2374 SysFreeString(sDefault
);
2376 /* backgroundPositionX */
2377 hres
= IHTMLStyle_get_backgroundPositionX(style
, &v
);
2378 ok(hres
== S_OK
, "get_backgroundPositionX failed: %08x\n", hres
);
2379 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
2380 ok(!V_BSTR(&v
), "backgroundPositionX = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2385 V_BSTR(&v
) = a2bstr("11px");
2386 hres
= IHTMLCSSStyleDeclaration_put_backgroundPositionX(css_style
, v
);
2387 ok(hres
== S_OK
, "put_backgroundPositionX failed: %08x\n", hres
);
2390 hres
= IHTMLCSSStyleDeclaration_get_backgroundPositionX(css_style
, &v
);
2391 ok(hres
== S_OK
, "get_backgroundPositionX failed: %08x\n", hres
);
2392 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
2393 ok(!strcmp_wa(V_BSTR(&v
), "11px"), "backgroundPositionX = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2398 V_BSTR(&v
) = a2bstr("10px");
2399 hres
= IHTMLStyle_put_backgroundPositionX(style
, v
);
2400 ok(hres
== S_OK
, "put_backgroundPositionX failed: %08x\n", hres
);
2403 hres
= IHTMLStyle_get_backgroundPositionX(style
, &v
);
2404 ok(hres
== S_OK
, "get_backgroundPositionX failed: %08x\n", hres
);
2405 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
2406 ok(!strcmp_wa(V_BSTR(&v
), "10px"), "backgroundPositionX = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2409 /* backgroundPositionY */
2410 hres
= IHTMLStyle_get_backgroundPositionY(style
, &v
);
2411 ok(hres
== S_OK
, "get_backgroundPositionY failed: %08x\n", hres
);
2412 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
2416 V_BSTR(&v
) = a2bstr("15px");
2417 hres
= IHTMLStyle_put_backgroundPositionY(style
, v
);
2418 ok(hres
== S_OK
, "put_backgroundPositionY failed: %08x\n", hres
);
2421 hres
= IHTMLStyle_get_backgroundPositionY(style
, &v
);
2422 ok(hres
== S_OK
, "get_backgroundPositionY failed: %08x\n", hres
);
2423 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
2424 ok(!strcmp_wa(V_BSTR(&v
), "15px"), "backgroundPositionY = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2427 /* backgroundPosition */
2429 hres
= IHTMLStyle_get_backgroundPosition(style
, &str
);
2430 ok(hres
== S_OK
, "get_backgroundPosition failed: %08x\n", hres
);
2431 ok(!strcmp_wa(str
, "10px 15px"), "backgroundPosition = %s\n", wine_dbgstr_w(str
));
2434 str
= a2bstr("center 20%");
2435 hres
= IHTMLStyle_put_backgroundPosition(style
, str
);
2436 ok(hres
== S_OK
, "put_backgroundPosition failed: %08x\n", hres
);
2440 hres
= IHTMLStyle_get_backgroundPosition(style
, &str
);
2441 ok(hres
== S_OK
, "get_backgroundPosition failed: %08x\n", hres
);
2442 ok(!strcmp_wa(str
, "center 20%"), "backgroundPosition = %s\n", wine_dbgstr_w(str
));
2445 hres
= IHTMLStyle_get_backgroundPositionX(style
, &v
);
2446 ok(hres
== S_OK
, "get_backgroundPositionX failed: %08x\n", hres
);
2447 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
2448 ok(!strcmp_wa(V_BSTR(&v
), "center"), "backgroundPositionX = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2451 hres
= IHTMLStyle_get_backgroundPositionY(style
, &v
);
2452 ok(hres
== S_OK
, "get_backgroundPositionY failed: %08x\n", hres
);
2453 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
2454 ok(!strcmp_wa(V_BSTR(&v
), "20%"), "backgroundPositionY = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2458 str
= a2bstr("left 21%");
2459 hres
= IHTMLCSSStyleDeclaration_put_backgroundPosition(css_style
, str
);
2460 ok(hres
== S_OK
, "put_backgroundPosition failed: %08x\n", hres
);
2464 hres
= IHTMLCSSStyleDeclaration_get_backgroundPosition(css_style
, &str
);
2465 ok(hres
== S_OK
, "get_backgroundPosition failed: %08x\n", hres
);
2466 ok(!strcmp_wa(str
, "left 21%"), "backgroundPosition = %s\n", wine_dbgstr_w(str
));
2470 /* borderTopWidth */
2471 hres
= IHTMLStyle_get_borderTopWidth(style
, &vDefault
);
2472 ok(hres
== S_OK
, "get_borderTopWidth: %08x\n", hres
);
2475 V_BSTR(&v
) = a2bstr("10px");
2476 hres
= IHTMLStyle_put_borderTopWidth(style
, v
);
2477 ok(hres
== S_OK
, "put_borderTopWidth: %08x\n", hres
);
2480 hres
= IHTMLStyle_get_borderTopWidth(style
, &v
);
2481 ok(hres
== S_OK
, "get_borderTopWidth: %08x\n", hres
);
2482 ok(!strcmp_wa(V_BSTR(&v
), "10px"), "expected 10px = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2485 hres
= IHTMLStyle_put_borderTopWidth(style
, vDefault
);
2486 ok(hres
== S_OK
, "put_borderTopWidth: %08x\n", hres
);
2487 VariantClear(&vDefault
);
2489 /* borderRightWidth */
2490 hres
= IHTMLStyle_get_borderRightWidth(style
, &vDefault
);
2491 ok(hres
== S_OK
, "get_borderRightWidth: %08x\n", hres
);
2494 V_BSTR(&v
) = a2bstr("10");
2495 hres
= IHTMLStyle_put_borderRightWidth(style
, v
);
2496 ok(hres
== S_OK
, "put_borderRightWidth: %08x\n", hres
);
2499 hres
= IHTMLStyle_get_borderRightWidth(style
, &v
);
2500 ok(hres
== S_OK
, "get_borderRightWidth: %08x\n", hres
);
2501 ok(!strcmp_wa(V_BSTR(&v
), compat_mode
< COMPAT_IE9
? "10px" : "1px"),
2502 "borderRightWidth = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2505 hres
= IHTMLStyle_put_borderRightWidth(style
, vDefault
);
2506 ok(hres
== S_OK
, "put_borderRightWidth: %08x\n", hres
);
2507 VariantClear(&vDefault
);
2509 /* borderBottomWidth */
2510 hres
= IHTMLStyle_get_borderBottomWidth(style
, &vDefault
);
2511 ok(hres
== S_OK
, "get_borderBottomWidth: %08x\n", hres
);
2514 V_BSTR(&v
) = a2bstr("10");
2515 hres
= IHTMLStyle_put_borderBottomWidth(style
, v
);
2516 ok(hres
== S_OK
, "put_borderBottomWidth: %08x\n", hres
);
2519 hres
= IHTMLStyle_get_borderBottomWidth(style
, &v
);
2520 ok(hres
== S_OK
, "get_borderBottomWidth: %08x\n", hres
);
2521 ok(!strcmp_wa(V_BSTR(&v
), compat_mode
< COMPAT_IE9
? "10px" : "1px"),
2522 "borderBottomWidth = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2525 hres
= IHTMLStyle_put_borderBottomWidth(style
, vDefault
);
2526 ok(hres
== S_OK
, "put_borderBottomWidth: %08x\n", hres
);
2527 VariantClear(&vDefault
);
2529 /* borderLeftWidth */
2530 hres
= IHTMLStyle_get_borderLeftWidth(style
, &vDefault
);
2531 ok(hres
== S_OK
, "get_borderLeftWidth: %08x\n", hres
);
2534 V_BSTR(&v
) = a2bstr("10");
2535 hres
= IHTMLStyle_put_borderLeftWidth(style
, v
);
2536 ok(hres
== S_OK
, "put_borderLeftWidth: %08x\n", hres
);
2539 hres
= IHTMLStyle_get_borderLeftWidth(style
, &v
);
2540 ok(hres
== S_OK
, "get_borderLeftWidth: %08x\n", hres
);
2541 ok(!strcmp_wa(V_BSTR(&v
), compat_mode
< COMPAT_IE9
? "10px" : "1px"),
2542 "expected 10px = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2545 hres
= IHTMLStyle_put_borderLeftWidth(style
, vDefault
);
2546 ok(hres
== S_OK
, "put_borderLeftWidth: %08x\n", hres
);
2547 VariantClear(&vDefault
);
2550 hres
= IHTMLStyle_get_wordSpacing(style
, &vDefault
);
2551 ok(hres
== S_OK
, "get_wordSpacing: %08x\n", hres
);
2554 V_BSTR(&v
) = a2bstr("10");
2555 hres
= IHTMLStyle_put_wordSpacing(style
, v
);
2556 ok(hres
== S_OK
, "put_wordSpacing: %08x\n", hres
);
2559 hres
= IHTMLStyle_get_wordSpacing(style
, &v
);
2560 ok(hres
== S_OK
, "get_wordSpacing: %08x\n", hres
);
2561 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
2562 if(compat_mode
< COMPAT_IE9
)
2563 ok(!strcmp_wa(V_BSTR(&v
), "10px"), "expected 10px = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2565 ok(!V_BSTR(&v
), "expected 10px = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2568 hres
= IHTMLStyle_put_wordSpacing(style
, vDefault
);
2569 ok(hres
== S_OK
, "put_wordSpacing: %08x\n", hres
);
2570 VariantClear(&vDefault
);
2573 hres
= IHTMLStyle_get_letterSpacing(style
, &vDefault
);
2574 ok(hres
== S_OK
, "get_letterSpacing: %08x\n", hres
);
2577 V_BSTR(&v
) = a2bstr("11");
2578 hres
= IHTMLStyle_put_letterSpacing(style
, v
);
2579 ok(hres
== S_OK
, "put_letterSpacing: %08x\n", hres
);
2582 hres
= IHTMLStyle_get_letterSpacing(style
, &v
);
2583 ok(hres
== S_OK
, "get_letterSpacing: %08x\n", hres
);
2584 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v)=%d\n", V_VT(&v
));
2585 if(compat_mode
< COMPAT_IE9
)
2586 ok(!strcmp_wa(V_BSTR(&v
), "11px"), "letterSpacing = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2588 ok(!V_BSTR(&v
), "letterSpacing = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2591 hres
= IHTMLStyle_put_letterSpacing(style
, vDefault
);
2592 ok(hres
== S_OK
, "put_letterSpacing: %08x\n", hres
);
2593 VariantClear(&vDefault
);
2595 /* borderTopColor */
2596 hres
= IHTMLStyle_get_borderTopColor(style
, &vDefault
);
2597 ok(hres
== S_OK
, "get_borderTopColor: %08x\n", hres
);
2600 V_BSTR(&v
) = a2bstr("red");
2601 hres
= IHTMLStyle_put_borderTopColor(style
, v
);
2602 ok(hres
== S_OK
, "put_borderTopColor: %08x\n", hres
);
2605 hres
= IHTMLStyle_get_borderTopColor(style
, &v
);
2606 ok(hres
== S_OK
, "get_borderTopColor: %08x\n", hres
);
2607 ok(!strcmp_wa(V_BSTR(&v
), "red"), "expecte red = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2610 hres
= IHTMLStyle_put_borderTopColor(style
, vDefault
);
2611 ok(hres
== S_OK
, "put_borderTopColor: %08x\n", hres
);
2613 /* borderRightColor */
2614 hres
= IHTMLStyle_get_borderRightColor(style
, &vDefault
);
2615 ok(hres
== S_OK
, "get_borderRightColor: %08x\n", hres
);
2618 V_BSTR(&v
) = a2bstr("blue");
2619 hres
= IHTMLStyle_put_borderRightColor(style
, v
);
2620 ok(hres
== S_OK
, "put_borderRightColor: %08x\n", hres
);
2623 hres
= IHTMLStyle_get_borderRightColor(style
, &v
);
2624 ok(hres
== S_OK
, "get_borderRightColor: %08x\n", hres
);
2625 ok(!strcmp_wa(V_BSTR(&v
), "blue"), "expected blue = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2628 hres
= IHTMLStyle_put_borderRightColor(style
, vDefault
);
2629 ok(hres
== S_OK
, "putborderRightColorr: %08x\n", hres
);
2631 /* borderBottomColor */
2632 hres
= IHTMLStyle_get_borderBottomColor(style
, &vDefault
);
2633 ok(hres
== S_OK
, "get_borderBottomColor: %08x\n", hres
);
2636 V_BSTR(&v
) = a2bstr("cyan");
2637 hres
= IHTMLStyle_put_borderBottomColor(style
, v
);
2638 ok(hres
== S_OK
, "put_borderBottomColor: %08x\n", hres
);
2641 hres
= IHTMLStyle_get_borderBottomColor(style
, &v
);
2642 ok(hres
== S_OK
, "get_borderBottomColor: %08x\n", hres
);
2643 ok(!strcmp_wa(V_BSTR(&v
), "cyan"), "expected cyan = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2646 hres
= IHTMLStyle_put_borderBottomColor(style
, vDefault
);
2647 ok(hres
== S_OK
, "put_borderBottomColor: %08x\n", hres
);
2649 /* borderLeftColor */
2650 hres
= IHTMLStyle_get_borderLeftColor(style
, &vDefault
);
2651 ok(hres
== S_OK
, "get_borderLeftColor: %08x\n", hres
);
2654 V_BSTR(&v
) = a2bstr("cyan");
2655 hres
= IHTMLStyle_put_borderLeftColor(style
, v
);
2656 ok(hres
== S_OK
, "put_borderLeftColor: %08x\n", hres
);
2659 hres
= IHTMLStyle_get_borderLeftColor(style
, &v
);
2660 ok(hres
== S_OK
, "get_borderLeftColor: %08x\n", hres
);
2661 ok(!strcmp_wa(V_BSTR(&v
), "cyan"), "expected cyan = %s\n", wine_dbgstr_w(V_BSTR(&v
)));
2664 hres
= IHTMLStyle_put_borderLeftColor(style
, vDefault
);
2665 ok(hres
== S_OK
, "put_borderLeftColor: %08x\n", hres
);
2668 hres
= IHTMLStyle_get_clip(style
, &str
);
2669 ok(hres
== S_OK
, "get_clip failed: %08x\n", hres
);
2670 ok(!str
, "clip = %s\n", wine_dbgstr_w(str
));
2672 str
= a2bstr("rect(0px 1px 500px 505px)");
2673 hres
= IHTMLStyle_put_clip(style
, str
);
2674 ok(hres
== S_OK
, "put_clip failed: %08x\n", hres
);
2677 hres
= IHTMLStyle_get_clip(style
, &str
);
2678 ok(hres
== S_OK
, "get_clip failed: %08x\n", hres
);
2679 ok(!strcmp_wa(str
, compat_mode
< COMPAT_IE9
? "rect(0px 1px 500px 505px)" : "rect(0px, 1px, 500px, 505px)"),
2680 "clip = %s\n", wine_dbgstr_w(str
));
2684 hres
= IHTMLStyle_get_clear(style
, &str
);
2685 ok(hres
== S_OK
, "get_clear failed: %08x\n", hres
);
2686 ok(!str
, "clear = %s\n", wine_dbgstr_w(str
));
2688 str
= a2bstr("both");
2689 hres
= IHTMLStyle_put_clear(style
, str
);
2690 ok(hres
== S_OK
, "put_clear failed: %08x\n", hres
);
2693 hres
= IHTMLStyle_get_clear(style
, &str
);
2694 ok(hres
== S_OK
, "get_clear failed: %08x\n", hres
);
2695 ok(!strcmp_wa(str
, "both"), "clear = %s\n", wine_dbgstr_w(str
));
2698 /* pageBreakAfter */
2699 hres
= IHTMLStyle_get_pageBreakAfter(style
, &str
);
2700 ok(hres
== S_OK
, "get_pageBreakAfter failed: %08x\n", hres
);
2701 ok(!str
, "pageBreakAfter = %s\n", wine_dbgstr_w(str
));
2704 str
= a2bstr("right");
2705 hres
= IHTMLCSSStyleDeclaration_put_pageBreakAfter(css_style
, str
);
2706 ok(hres
== S_OK
, "put_pageBreakAfter failed: %08x\n", hres
);
2709 hres
= IHTMLCSSStyleDeclaration_get_pageBreakAfter(css_style
, &str
);
2710 ok(hres
== S_OK
, "get_pageBreakAfter failed: %08x\n", hres
);
2711 ok(!strcmp_wa(str
, "right"), "pageBreakAfter = %s\n", wine_dbgstr_w(str
));
2715 str
= a2bstr("always");
2716 hres
= IHTMLStyle_put_pageBreakAfter(style
, str
);
2717 ok(hres
== S_OK
, "put_pageBreakAfter failed: %08x\n", hres
);
2720 hres
= IHTMLStyle_get_pageBreakAfter(style
, &str
);
2721 ok(hres
== S_OK
, "get_pageBreakAfter failed: %08x\n", hres
);
2722 ok(!strcmp_wa(str
, "always"), "pageBreakAfter = %s\n", wine_dbgstr_w(str
));
2725 /* pageBreakBefore */
2726 hres
= IHTMLStyle_get_pageBreakBefore(style
, &str
);
2727 ok(hres
== S_OK
, "get_pageBreakBefore failed: %08x\n", hres
);
2728 ok(!str
, "pageBreakBefore = %s\n", wine_dbgstr_w(str
));
2730 str
= a2bstr("always");
2731 hres
= IHTMLStyle_put_pageBreakBefore(style
, str
);
2732 ok(hres
== S_OK
, "put_pageBreakBefore failed: %08x\n", hres
);
2735 hres
= IHTMLStyle_get_pageBreakBefore(style
, &str
);
2736 ok(hres
== S_OK
, "get_pageBreakBefore failed: %08x\n", hres
);
2737 ok(!strcmp_wa(str
, "always"), "pageBreakBefore = %s\n", wine_dbgstr_w(str
));
2740 test_style_remove_attribute(style
, "pageBreakBefore", VARIANT_TRUE
);
2741 test_style_remove_attribute(style
, "pageBreakBefore", VARIANT_FALSE
);
2743 hres
= IHTMLStyle_get_pageBreakBefore(style
, &str
);
2744 ok(hres
== S_OK
, "get_pageBreakBefore failed: %08x\n", hres
);
2745 ok(!str
, "pageBreakBefore = %s\n", wine_dbgstr_w(str
));
2747 str
= (void*)0xdeadbeef;
2748 hres
= IHTMLStyle_get_whiteSpace(style
, &str
);
2749 ok(hres
== S_OK
, "get_whiteSpace failed: %08x\n", hres
);
2750 ok(!str
, "whiteSpace = %s\n", wine_dbgstr_w(str
));
2752 str
= a2bstr("nowrap");
2753 hres
= IHTMLStyle_put_whiteSpace(style
, str
);
2755 ok(hres
== S_OK
, "put_whiteSpace failed: %08x\n", hres
);
2758 hres
= IHTMLStyle_get_whiteSpace(style
, &str
);
2759 ok(hres
== S_OK
, "get_whiteSpace failed: %08x\n", hres
);
2760 ok(!strcmp_wa(str
, "nowrap"), "whiteSpace = %s\n", wine_dbgstr_w(str
));
2763 str
= a2bstr("normal");
2764 hres
= IHTMLStyle_put_whiteSpace(style
, str
);
2766 ok(hres
== S_OK
, "put_whiteSpace failed: %08x\n", hres
);
2769 hres
= IHTMLStyle_get_whiteSpace(style
, &str
);
2770 ok(hres
== S_OK
, "get_whiteSpace failed: %08x\n", hres
);
2771 ok(!strcmp_wa(str
, "normal"), "whiteSpace = %s\n", wine_dbgstr_w(str
));
2775 hres
= IHTMLStyle_get_listStyleType(style
, &str
);
2776 ok(hres
== S_OK
, "get_listStyleType failed: %08x\n", hres
);
2777 ok(!str
, "listStyleType = %s\n", wine_dbgstr_w(str
));
2779 str
= a2bstr("square");
2780 hres
= IHTMLStyle_put_listStyleType(style
, str
);
2781 ok(hres
== S_OK
, "put_listStyleType failed: %08x\n", hres
);
2785 hres
= IHTMLStyle_get_listStyleType(style
, &str
);
2786 ok(hres
== S_OK
, "get_listStyleType failed: %08x\n", hres
);
2787 ok(!strcmp_wa(str
, "square"), "listStyleType = %s\n", wine_dbgstr_w(str
));
2789 str
= a2bstr("inside");
2790 hres
= IHTMLStyle_put_listStylePosition(style
, str
);
2791 ok(hres
== S_OK
, "put_listStylePosition failed: %08x\n", hres
);
2794 hres
= IHTMLStyle_get_listStylePosition(style
, &str
);
2795 ok(hres
== S_OK
, "get_listStylePosition failed: %08x\n", hres
);
2796 ok(!strcmp_wa(str
, "inside"), "listStyleType = %s\n", wine_dbgstr_w(str
));
2799 str
= a2bstr("decimal-leading-zero none inside");
2800 hres
= IHTMLStyle_put_listStyle(style
, str
);
2801 ok(hres
== S_OK
|| broken(hres
== E_INVALIDARG
), /* win 2000 */
2802 "put_listStyle(%s) failed: %08x\n", wine_dbgstr_w(str
), hres
);
2805 if (hres
!= E_INVALIDARG
) {
2806 hres
= IHTMLStyle_get_listStyle(style
, &str
);
2807 ok(hres
== S_OK
, "get_listStyle failed: %08x\n", hres
);
2808 ok(strstr_wa(str
, "decimal-leading-zero") &&
2809 strstr_wa(str
, "inside") != NULL
,
2810 "listStyle = %s\n", wine_dbgstr_w(str
));
2811 if(compat_mode
< COMPAT_IE9
)
2812 ok(strstr_wa(str
, "none") != NULL
, "listStyle = %s\n", wine_dbgstr_w(str
));
2815 ok(!strstr_wa(str
, "none"), "listStyle = %s\n", wine_dbgstr_w(str
));
2819 win_skip("IHTMLStyle_put_listStyle already failed\n");
2822 str
= (void*)0xdeadbeef;
2823 hres
= IHTMLStyle_get_styleFloat(style
, &str
);
2824 ok(hres
== S_OK
, "get_styleFloat failed: %08x\n", hres
);
2825 ok(!str
, "styleFloat = %s\n", wine_dbgstr_w(str
));
2827 str
= a2bstr("left");
2828 hres
= IHTMLStyle_put_styleFloat(style
, str
);
2829 ok(hres
== S_OK
, "put_styleFloat failed: %08x\n", hres
);
2833 hres
= IHTMLStyle_get_styleFloat(style
, &str
);
2834 ok(hres
== S_OK
, "get_styleFloat failed: %08x\n", hres
);
2835 ok(!strcmp_wa(str
, "left"), "styleFloat = %s\n", wine_dbgstr_w(str
));
2837 hres
= IHTMLStyle_QueryInterface(style
, &IID_IHTMLStyle2
, (void**)&style2
);
2838 ok(hres
== S_OK
, "Could not get IHTMLStyle2 iface: %08x\n", hres
);
2839 if(SUCCEEDED(hres
)) {
2840 test_style2(style2
);
2841 IHTMLStyle2_Release(style2
);
2844 hres
= IHTMLStyle_QueryInterface(style
, &IID_IHTMLStyle3
, (void**)&style3
);
2845 ok(hres
== S_OK
, "Could not get IHTMLStyle3 iface: %08x\n", hres
);
2846 if(SUCCEEDED(hres
)) {
2847 test_style3(style3
);
2848 IHTMLStyle3_Release(style3
);
2851 hres
= IHTMLStyle_QueryInterface(style
, &IID_IHTMLStyle4
, (void**)&style4
);
2852 ok(hres
== S_OK
, "Could not get IHTMLStyle4 iface: %08x\n", hres
);
2853 if(SUCCEEDED(hres
)) {
2854 test_style4(style4
);
2855 IHTMLStyle4_Release(style4
);
2858 hres
= IHTMLStyle_QueryInterface(style
, &IID_IHTMLStyle5
, (void**)&style5
);
2859 if(SUCCEEDED(hres
)) {
2860 test_style5(style5
);
2861 IHTMLStyle5_Release(style5
);
2863 win_skip("IHTMLStyle5 not available\n");
2866 hres
= IHTMLStyle_QueryInterface(style
, &IID_IHTMLStyle6
, (void**)&style6
);
2867 if(SUCCEEDED(hres
)) {
2868 test_style6(style6
);
2869 IHTMLStyle6_Release(style6
);
2871 win_skip("IHTMLStyle6 not available\n");
2874 if(compat_mode
>= COMPAT_IE9
)
2875 test_css_style_declaration(css_style
);
2878 IHTMLCSSStyleDeclaration_Release(css_style
);
2881 #define test_style_filter(a,b) _test_style_filter(__LINE__,a,b)
2882 static void _test_style_filter(unsigned line
, IHTMLStyle
*style
, const char *exval
)
2887 str
= (void*)0xdeadbeef;
2888 hres
= IHTMLStyle_get_filter(style
, &str
);
2889 ok_(__FILE__
,line
)(hres
== S_OK
, "get_filter failed: %08x\n", hres
);
2891 ok_(__FILE__
,line
)(str
&& !strcmp_wa(str
, exval
), "filter = %s, expected %s\n", wine_dbgstr_w(str
), exval
);
2893 ok_(__FILE__
,line
)(!str
, "str = %s, expected NULL\n", wine_dbgstr_w(str
));
2898 #define test_current_style_filter(a,b) _test_current_style_filter(__LINE__,a,b)
2899 static void _test_current_style_filter(unsigned line
, IHTMLCurrentStyle2
*style
, const char *exval
)
2904 str
= (void*)0xdeadbeef;
2905 hres
= IHTMLCurrentStyle2_get_filter(style
, &str
);
2906 ok_(__FILE__
,line
)(hres
== S_OK
, "get_filter failed: %08x\n", hres
);
2908 ok_(__FILE__
,line
)(str
&& !strcmp_wa(str
, exval
), "filter = %s, expected %s\n", wine_dbgstr_w(str
), exval
);
2910 ok_(__FILE__
,line
)(!str
, "str = %s, expected NULL\n", wine_dbgstr_w(str
));
2915 #define set_style_filter(a,b) _set_style_filter(__LINE__,a,b)
2916 static void _set_style_filter(unsigned line
, IHTMLStyle
*style
, const char *val
)
2918 BSTR str
= a2bstr(val
);
2921 hres
= IHTMLStyle_put_filter(style
, str
);
2922 ok_(__FILE__
,line
)(hres
== S_OK
, "put_filter failed: %08x\n", hres
);
2925 _test_style_filter(line
, style
, val
);
2928 static void test_style_filters(IHTMLElement
*elem
)
2930 IHTMLElement2
*elem2
= get_elem2_iface((IUnknown
*)elem
);
2931 IHTMLCurrentStyle2
*current_style2
;
2932 IHTMLCurrentStyle
*current_style
;
2936 hres
= IHTMLElement_get_style(elem
, &style
);
2937 ok(hres
== S_OK
, "get_style failed: %08x\n", hres
);
2939 hres
= IHTMLElement2_get_currentStyle(elem2
, ¤t_style
);
2940 ok(hres
== S_OK
, "get_style failed: %08x\n", hres
);
2942 current_style2
= get_current_style2_iface((IUnknown
*)current_style
);
2944 test_style_filter(style
, NULL
);
2945 test_current_style_filter(current_style2
, NULL
);
2946 set_style_filter(style
, "alpha(opacity=50.0040)");
2947 test_current_style_filter(current_style2
, "alpha(opacity=50.0040)");
2948 set_style_filter(style
, "alpha(opacity=100)");
2950 IHTMLStyle_Release(style
);
2952 hres
= IHTMLElement_get_style(elem
, &style
);
2953 ok(hres
== S_OK
, "get_style failed: %08x\n", hres
);
2955 test_style_filter(style
, "alpha(opacity=100)");
2956 set_style_filter(style
, "xxx(a,b,c) alpha(opacity=100)");
2957 set_style_filter(style
, NULL
);
2958 set_style_filter(style
, "alpha(opacity=100)");
2959 test_style_remove_attribute(style
, "filter", VARIANT_TRUE
);
2960 test_style_remove_attribute(style
, "filter", VARIANT_FALSE
);
2961 test_style_filter(style
, NULL
);
2964 IHTMLCurrentStyle2_Release(current_style2
);
2965 IHTMLStyle_Release(style
);
2966 IHTMLElement2_Release(elem2
);
2969 static void test_current_style(IHTMLCurrentStyle
*current_style
)
2971 IHTMLCurrentStyle2
*current_style2
;
2972 IHTMLCurrentStyle3
*current_style3
;
2973 IHTMLCurrentStyle4
*current_style4
;
2979 hres
= IHTMLCurrentStyle_get_display(current_style
, &str
);
2980 ok(hres
== S_OK
, "get_display failed: %08x\n", hres
);
2981 ok(!strcmp_wa(str
, "block"), "get_display returned %s\n", wine_dbgstr_w(str
));
2984 hres
= IHTMLCurrentStyle_get_position(current_style
, &str
);
2985 ok(hres
== S_OK
, "get_position failed: %08x\n", hres
);
2986 ok(!strcmp_wa(str
, "absolute"), "get_position returned %s\n", wine_dbgstr_w(str
));
2989 hres
= IHTMLCurrentStyle_get_fontFamily(current_style
, &str
);
2990 ok(hres
== S_OK
, "get_fontFamily failed: %08x\n", hres
);
2993 hres
= IHTMLCurrentStyle_get_fontStyle(current_style
, &str
);
2994 ok(hres
== S_OK
, "get_fontStyle failed: %08x\n", hres
);
2995 ok(!strcmp_wa(str
, "normal"), "get_fontStyle returned %s\n", wine_dbgstr_w(str
));
2998 hres
= IHTMLCurrentStyle_get_backgroundImage(current_style
, &str
);
2999 ok(hres
== S_OK
, "get_backgroundImage failed: %08x\n", hres
);
3000 ok(!strcmp_wa(str
, "none"), "get_backgroundImage returned %s\n", wine_dbgstr_w(str
));
3003 hres
= IHTMLCurrentStyle_get_fontVariant(current_style
, &str
);
3004 ok(hres
== S_OK
, "get_fontVariant failed: %08x\n", hres
);
3005 ok(!strcmp_wa(str
, "normal"), "get_fontVariant returned %s\n", wine_dbgstr_w(str
));
3008 hres
= IHTMLCurrentStyle_get_borderTopStyle(current_style
, &str
);
3009 ok(hres
== S_OK
, "get_borderTopStyle failed: %08x\n", hres
);
3010 ok(!strcmp_wa(str
, "none"), "get_borderTopStyle returned %s\n", wine_dbgstr_w(str
));
3013 hres
= IHTMLCurrentStyle_get_borderRightStyle(current_style
, &str
);
3014 ok(hres
== S_OK
, "get_borderRightStyle failed: %08x\n", hres
);
3015 ok(!strcmp_wa(str
, "none"), "get_borderRightStyle returned %s\n", wine_dbgstr_w(str
));
3018 hres
= IHTMLCurrentStyle_get_borderBottomStyle(current_style
, &str
);
3019 ok(hres
== S_OK
, "get_borderBottomStyle failed: %08x\n", hres
);
3020 ok(!strcmp_wa(str
, "none"), "get_borderBottomStyle returned %s\n", wine_dbgstr_w(str
));
3023 hres
= IHTMLCurrentStyle_get_borderLeftStyle(current_style
, &str
);
3024 ok(hres
== S_OK
, "get_borderLeftStyle failed: %08x\n", hres
);
3025 ok(!strcmp_wa(str
, "none"), "get_borderLeftStyle returned %s\n", wine_dbgstr_w(str
));
3028 hres
= IHTMLCurrentStyle_get_textAlign(current_style
, &str
);
3029 ok(hres
== S_OK
, "get_textAlign failed: %08x\n", hres
);
3030 ok(!strcmp_wa(str
, "center"), "get_textAlign returned %s\n", wine_dbgstr_w(str
));
3033 hres
= IHTMLCurrentStyle_get_textDecoration(current_style
, &str
);
3034 ok(hres
== S_OK
, "get_textDecoration failed: %08x\n", hres
);
3035 ok(!strcmp_wa(str
, "none"), "get_textDecoration returned %s\n", wine_dbgstr_w(str
));
3038 hres
= IHTMLCurrentStyle_get_cursor(current_style
, &str
);
3039 ok(hres
== S_OK
, "get_cursor failed: %08x\n", hres
);
3040 ok(!strcmp_wa(str
, "default"), "get_cursor returned %s\n", wine_dbgstr_w(str
));
3043 hres
= IHTMLCurrentStyle_get_backgroundRepeat(current_style
, &str
);
3044 ok(hres
== S_OK
, "get_backgroundRepeat failed: %08x\n", hres
);
3045 ok(!strcmp_wa(str
, "repeat"), "get_backgroundRepeat returned %s\n", wine_dbgstr_w(str
));
3048 hres
= IHTMLCurrentStyle_get_borderColor(current_style
, &str
);
3049 ok(hres
== S_OK
, "get_borderColor failed: %08x\n", hres
);
3052 hres
= IHTMLCurrentStyle_get_borderStyle(current_style
, &str
);
3053 ok(hres
== S_OK
, "get_borderStyle failed: %08x\n", hres
);
3056 hres
= IHTMLCurrentStyle_get_visibility(current_style
, &str
);
3057 ok(hres
== S_OK
, "get_visibility failed: %08x\n", hres
);
3060 hres
= IHTMLCurrentStyle_get_overflow(current_style
, &str
);
3061 ok(hres
== S_OK
, "get_overflow failed: %08x\n", hres
);
3064 hres
= IHTMLCurrentStyle_get_borderWidth(current_style
, &str
);
3065 ok(hres
== S_OK
, "get_borderWidth failed: %08x\n", hres
);
3068 hres
= IHTMLCurrentStyle_get_margin(current_style
, &str
);
3069 ok(hres
== S_OK
, "get_margin failed: %08x\n", hres
);
3072 hres
= IHTMLCurrentStyle_get_padding(current_style
, &str
);
3073 ok(hres
== S_OK
, "get_padding failed: %08x\n", hres
);
3076 hres
= IHTMLCurrentStyle_get_fontWeight(current_style
, &v
);
3077 ok(hres
== S_OK
, "get_fontWeight failed: %08x\n", hres
);
3078 ok(V_VT(&v
) == VT_I4
, "V_VT(v) = %d\n", V_VT(&v
));
3079 ok( V_I4(&v
) == 400, "expect 400 got (%d)\n", V_I4(&v
));
3082 hres
= IHTMLCurrentStyle_get_fontSize(current_style
, &v
);
3083 ok(hres
== S_OK
, "get_fontSize failed: %08x\n", hres
);
3084 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
3087 hres
= IHTMLCurrentStyle_get_left(current_style
, &v
);
3088 ok(hres
== S_OK
, "get_left failed: %08x\n", hres
);
3089 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
3092 hres
= IHTMLCurrentStyle_get_top(current_style
, &v
);
3093 ok(hres
== S_OK
, "get_top failed: %08x\n", hres
);
3094 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
3097 hres
= IHTMLCurrentStyle_get_width(current_style
, &v
);
3098 ok(hres
== S_OK
, "get_width failed: %08x\n", hres
);
3099 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
3102 hres
= IHTMLCurrentStyle_get_height(current_style
, &v
);
3103 ok(hres
== S_OK
, "get_height failed: %08x\n", hres
);
3104 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
3107 hres
= IHTMLCurrentStyle_get_paddingLeft(current_style
, &v
);
3108 ok(hres
== S_OK
, "get_paddingLeft failed: %08x\n", hres
);
3109 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
3112 hres
= IHTMLCurrentStyle_get_zIndex(current_style
, &v
);
3113 ok(hres
== S_OK
, "get_zIndex failed: %08x\n", hres
);
3114 ok(V_VT(&v
) == VT_I4
, "V_VT(v) = %d\n", V_VT(&v
));
3115 ok( V_I4(&v
) == 1, "expect 1 got (%d)\n", V_I4(&v
));
3118 hres
= IHTMLCurrentStyle_get_verticalAlign(current_style
, &v
);
3119 ok(hres
== S_OK
, "get_verticalAlign failed: %08x\n", hres
);
3120 test_var_bstr(&v
, compat_mode
< COMPAT_IE9
? "100px" : "middle");
3123 hres
= IHTMLCurrentStyle_get_marginRight(current_style
, &v
);
3124 ok(hres
== S_OK
, "get_marginRight failed: %08x\n", hres
);
3125 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
3128 hres
= IHTMLCurrentStyle_get_marginLeft(current_style
, &v
);
3129 ok(hres
== S_OK
, "get_marginLeft failed: %08x\n", hres
);
3130 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
3133 hres
= IHTMLCurrentStyle_get_borderLeftWidth(current_style
, &v
);
3134 ok(hres
== S_OK
, "get_borderLeftWidth failed: %08x\n", hres
);
3135 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
3139 hres
= IHTMLCurrentStyle_get_borderRightWidth(current_style
, &v
);
3140 ok(hres
== S_OK
, "get_borderRightWidth failed: %08x\n", hres
);
3141 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
3144 hres
= IHTMLCurrentStyle_get_borderBottomWidth(current_style
, &v
);
3145 ok(hres
== S_OK
, "get_borderBottomWidth failed: %08x\n", hres
);
3146 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
3149 hres
= IHTMLCurrentStyle_get_borderTopWidth(current_style
, &v
);
3150 ok(hres
== S_OK
, "get_borderTopWidth failed: %08x\n", hres
);
3151 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
3154 hres
= IHTMLCurrentStyle_get_color(current_style
, &v
);
3155 ok(hres
== S_OK
, "get_color failed: %08x\n", hres
);
3156 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
3159 hres
= IHTMLCurrentStyle_get_backgroundColor(current_style
, &v
);
3160 ok(hres
== S_OK
, "get_backgroundColor failed: %08x\n", hres
);
3161 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
3164 hres
= IHTMLCurrentStyle_get_borderLeftColor(current_style
, &v
);
3165 ok(hres
== S_OK
, "get_borderLeftColor failed: %08x\n", hres
);
3166 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
3169 hres
= IHTMLCurrentStyle_get_borderTopColor(current_style
, &v
);
3170 ok(hres
== S_OK
, "get_borderTopColor failed: %08x\n", hres
);
3171 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
3174 hres
= IHTMLCurrentStyle_get_borderRightColor(current_style
, &v
);
3175 ok(hres
== S_OK
, "get_borderRightColor failed: %08x\n", hres
);
3176 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
3179 hres
= IHTMLCurrentStyle_get_borderBottomColor(current_style
, &v
);
3180 ok(hres
== S_OK
, "get_borderBottomColor failed: %08x\n", hres
);
3181 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
3184 hres
= IHTMLCurrentStyle_get_paddingTop(current_style
, &v
);
3185 ok(hres
== S_OK
, "get_paddingTop failed: %08x\n", hres
);
3186 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
3189 hres
= IHTMLCurrentStyle_get_paddingRight(current_style
, &v
);
3190 ok(hres
== S_OK
, "get_paddingRight failed: %08x\n", hres
);
3191 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
3194 hres
= IHTMLCurrentStyle_get_paddingBottom(current_style
, &v
);
3195 ok(hres
== S_OK
, "get_paddingRight failed: %08x\n", hres
);
3196 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
3199 hres
= IHTMLCurrentStyle_get_letterSpacing(current_style
, &v
);
3200 ok(hres
== S_OK
, "get_letterSpacing failed: %08x\n", hres
);
3201 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
3204 hres
= IHTMLCurrentStyle_get_marginTop(current_style
, &v
);
3205 ok(hres
== S_OK
, "get_marginTop failed: %08x\n", hres
);
3206 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
3209 hres
= IHTMLCurrentStyle_get_marginBottom(current_style
, &v
);
3210 ok(hres
== S_OK
, "get_marginBottom failed: %08x\n", hres
);
3211 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
3214 hres
= IHTMLCurrentStyle_get_right(current_style
, &v
);
3215 ok(hres
== S_OK
, "get_Right failed: %08x\n", hres
);
3216 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
3219 hres
= IHTMLCurrentStyle_get_bottom(current_style
, &v
);
3220 ok(hres
== S_OK
, "get_bottom failed: %08x\n", hres
);
3221 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
3224 hres
= IHTMLCurrentStyle_get_lineHeight(current_style
, &v
);
3225 ok(hres
== S_OK
, "get_lineHeight failed: %08x\n", hres
);
3226 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
3229 hres
= IHTMLCurrentStyle_get_textIndent(current_style
, &v
);
3230 ok(hres
== S_OK
, "get_textIndent failed: %08x\n", hres
);
3231 ok(V_VT(&v
) == VT_BSTR
, "V_VT(v) = %d\n", V_VT(&v
));
3234 hres
= IHTMLCurrentStyle_get_textTransform(current_style
, &str
);
3235 ok(hres
== S_OK
, "get_textTransform failed: %08x\n", hres
);
3238 hres
= IHTMLCurrentStyle_get_styleFloat(current_style
, &str
);
3239 ok(hres
== S_OK
, "get_styleFloat failed: %08x\n", hres
);
3240 ok(!strcmp_wa(str
, "none"), "styleFloat = %s\n", wine_dbgstr_w(str
));
3243 hres
= IHTMLCurrentStyle_get_overflowX(current_style
, &str
);
3244 ok(hres
== S_OK
, "get_overflowX failed: %08x\n", hres
);
3245 ok(!strcmp_wa(str
, "hidden"), "overflowX = %s\n", wine_dbgstr_w(str
));
3248 hres
= IHTMLCurrentStyle_get_overflowY(current_style
, &str
);
3249 ok(hres
== S_OK
, "get_overflowY failed: %08x\n", hres
);
3250 ok(!strcmp_wa(str
, "hidden"), "overflowY = %s\n", wine_dbgstr_w(str
));
3253 hres
= IHTMLCurrentStyle_get_direction(current_style
, &str
);
3254 ok(hres
== S_OK
, "get_direction failed: %08x\n", hres
);
3255 ok(!strcmp_wa(str
, "ltr"), "direction = %s\n", wine_dbgstr_w(str
));
3258 current_style2
= get_current_style2_iface((IUnknown
*)current_style
);
3261 hres
= IHTMLCurrentStyle2_get_hasLayout(current_style2
, &b
);
3262 ok(hres
== S_OK
, "get_hasLayout failed: %08x\n", hres
);
3263 ok(b
== VARIANT_TRUE
, "hasLayout = %x\n", b
);
3265 IHTMLCurrentStyle2_Release(current_style2
);
3267 hres
= IHTMLCurrentStyle_QueryInterface(current_style
, &IID_IHTMLCurrentStyle3
, (void**)¤t_style3
);
3268 ok(hres
== S_OK
, "Could not get IHTMLCurrentStyle3 iface: %08x\n", hres
);
3270 hres
= IHTMLCurrentStyle3_get_whiteSpace(current_style3
, &str
);
3271 ok(hres
== S_OK
, "get_whiteSpace failed: %08x\n", hres
);
3272 ok(!strcmp_wa(str
, "normal"), "whiteSpace = %s\n", wine_dbgstr_w(str
));
3275 IHTMLCurrentStyle3_Release(current_style3
);
3277 hres
= IHTMLCurrentStyle_QueryInterface(current_style
, &IID_IHTMLCurrentStyle4
, (void**)¤t_style4
);
3278 ok(hres
== S_OK
|| broken(hres
== E_NOINTERFACE
), "Could not get IHTMLCurrentStyle4 iface: %08x\n", hres
);
3279 if(SUCCEEDED(hres
)) {
3280 hres
= IHTMLCurrentStyle4_get_minWidth(current_style4
, &v
);
3281 ok(hres
== S_OK
, "get_minWidth failed: %08x\n", hres
);
3282 ok(V_VT(&v
) == VT_BSTR
, "V_VT(minWidth) = %d\n", V_VT(&v
));
3285 IHTMLCurrentStyle4_Release(current_style4
);
3287 win_skip("IHTMLCurrentStyle4 not supported.\n");
3291 static void basic_style_test(IHTMLDocument2
*doc
)
3293 IHTMLCurrentStyle
*cstyle
;
3298 hres
= IHTMLDocument2_get_body(doc
, &elem
);
3299 ok(hres
== S_OK
, "get_body failed: %08x\n", hres
);
3301 elem_set_innerhtml(elem
, "<div id=\"divid\"></div>");
3303 hres
= IHTMLElement_get_style(elem
, &style
);
3304 ok(hres
== S_OK
, "get_style failed: %08x\n", hres
);
3306 test_body_style(style
);
3308 cstyle
= get_current_style(elem
);
3309 test_current_style(cstyle
);
3310 IHTMLCurrentStyle_Release(cstyle
);
3311 IHTMLElement_Release(elem
);
3313 elem
= get_element_by_id(doc
, "divid");
3314 test_style_filters(elem
);
3316 test_set_csstext(style
);
3317 IHTMLStyle_Release(style
);
3318 IHTMLElement_Release(elem
);
3321 static const char runtimestyle_test_str
[] =
3322 "<html><head><style>body {text-decoration: auto}</style></head><body></body></html>";
3324 static const char runtimestyle_ie9_test_str
[] =
3328 " <meta http-equiv=\"x-ua-compatible\" content=\"IE=9\" />"
3329 " <style>body {text-decoration: auto}</style>"
3335 static void runtimestyle_test(IHTMLDocument2
*doc
)
3337 IHTMLStyle
*style
, *runtime_style
;
3338 IHTMLElement2
*elem2
;
3343 hres
= IHTMLDocument2_get_body(doc
, &elem
);
3344 ok(hres
== S_OK
, "get_body failed: %08x\n", hres
);
3346 elem2
= get_elem2_iface((IUnknown
*)elem
);
3348 hres
= IHTMLElement2_get_runtimeStyle(elem2
, &runtime_style
);
3349 ok(hres
== S_OK
, "get_runtimeStyle failed: %08x\n", hres
);
3351 hres
= IHTMLElement_get_style(elem
, &style
);
3352 ok(hres
== S_OK
, "get_style failed: %08x\n", hres
);
3354 test_text_decoration(style
, NULL
);
3355 test_text_decoration(runtime_style
, NULL
);
3356 set_text_decoration(style
, "underline");
3357 test_text_decoration(style
, "underline");
3359 hres
= IHTMLStyle_get_textDecoration(style
, &str
);
3360 ok(hres
== S_OK
, "get_textDecoration failed: %08x\n", hres
);
3361 ok(broken(!str
) || !strcmp_wa(str
, "underline"), "textDecoration = %s\n", wine_dbgstr_w(str
));
3364 set_text_decoration(runtime_style
, "blink");
3365 test_text_decoration(runtime_style
, "blink");
3367 hres
= IHTMLStyle_get_textDecoration(style
, &str
);
3368 ok(hres
== S_OK
, "get_textDecoration failed: %08x\n", hres
);
3370 ok(!strcmp_wa(str
, "underline"), "textDecoration = %s\n", wine_dbgstr_w(str
));
3373 IHTMLStyle_Release(runtime_style
);
3374 IHTMLStyle_Release(style
);
3375 IHTMLElement2_Release(elem2
);
3376 IHTMLElement_Release(elem
);
3379 static IHTMLDocument2
*notif_doc
;
3380 static BOOL doc_complete
;
3382 static IHTMLDocument2
*create_document(void)
3384 IHTMLDocument2
*doc
;
3385 IHTMLDocument5
*doc5
;
3388 hres
= CoCreateInstance(&CLSID_HTMLDocument
, NULL
, CLSCTX_INPROC_SERVER
|CLSCTX_INPROC_HANDLER
,
3389 &IID_IHTMLDocument2
, (void**)&doc
);
3390 ok(hres
== S_OK
, "CoCreateInstance failed: %08x\n", hres
);
3394 hres
= IHTMLDocument2_QueryInterface(doc
, &IID_IHTMLDocument5
, (void**)&doc5
);
3396 win_skip("Could not get IHTMLDocument5, probably too old IE\n");
3397 IHTMLDocument2_Release(doc
);
3401 IHTMLDocument5_Release(doc5
);
3405 static HRESULT WINAPI
PropertyNotifySink_QueryInterface(IPropertyNotifySink
*iface
,
3406 REFIID riid
, void**ppv
)
3408 if(IsEqualGUID(&IID_IPropertyNotifySink
, riid
)) {
3413 ok(0, "unexpected call\n");
3414 return E_NOINTERFACE
;
3417 static ULONG WINAPI
PropertyNotifySink_AddRef(IPropertyNotifySink
*iface
)
3422 static ULONG WINAPI
PropertyNotifySink_Release(IPropertyNotifySink
*iface
)
3427 static HRESULT WINAPI
PropertyNotifySink_OnChanged(IPropertyNotifySink
*iface
, DISPID dispID
)
3429 if(dispID
== DISPID_READYSTATE
){
3433 hres
= IHTMLDocument2_get_readyState(notif_doc
, &state
);
3434 ok(hres
== S_OK
, "get_readyState failed: %08x\n", hres
);
3436 if(!strcmp_wa(state
, "complete"))
3437 doc_complete
= TRUE
;
3439 SysFreeString(state
);
3445 static HRESULT WINAPI
PropertyNotifySink_OnRequestEdit(IPropertyNotifySink
*iface
, DISPID dispID
)
3447 ok(0, "unexpected call\n");
3451 static IPropertyNotifySinkVtbl PropertyNotifySinkVtbl
= {
3452 PropertyNotifySink_QueryInterface
,
3453 PropertyNotifySink_AddRef
,
3454 PropertyNotifySink_Release
,
3455 PropertyNotifySink_OnChanged
,
3456 PropertyNotifySink_OnRequestEdit
3459 static IPropertyNotifySink PropertyNotifySink
= { &PropertyNotifySinkVtbl
};
3461 static IHTMLDocument2
*create_doc_with_string(const char *str
)
3463 IPersistStreamInit
*init
;
3465 IHTMLDocument2
*doc
;
3470 notif_doc
= doc
= create_document();
3474 doc_complete
= FALSE
;
3476 mem
= GlobalAlloc(0, len
);
3477 memcpy(mem
, str
, len
);
3478 hres
= CreateStreamOnHGlobal(mem
, TRUE
, &stream
);
3479 ok(hres
== S_OK
, "Failed to create a stream, hr %#x.\n", hres
);
3481 hres
= IHTMLDocument2_QueryInterface(doc
, &IID_IPersistStreamInit
, (void**)&init
);
3482 ok(hres
== S_OK
, "Failed to get IPersistStreamInit, hr %#x.\n", hres
);
3484 IPersistStreamInit_Load(init
, stream
);
3485 IPersistStreamInit_Release(init
);
3486 IStream_Release(stream
);
3491 static void do_advise(IUnknown
*unk
, REFIID riid
, IUnknown
*unk_advise
)
3493 IConnectionPointContainer
*container
;
3494 IConnectionPoint
*cp
;
3498 hres
= IUnknown_QueryInterface(unk
, &IID_IConnectionPointContainer
, (void**)&container
);
3499 ok(hres
== S_OK
, "QueryInterface(IID_IConnectionPointContainer) failed: %08x\n", hres
);
3501 hres
= IConnectionPointContainer_FindConnectionPoint(container
, riid
, &cp
);
3502 IConnectionPointContainer_Release(container
);
3503 ok(hres
== S_OK
, "FindConnectionPoint failed: %08x\n", hres
);
3505 hres
= IConnectionPoint_Advise(cp
, unk_advise
, &cookie
);
3506 IConnectionPoint_Release(cp
);
3507 ok(hres
== S_OK
, "Advise failed: %08x\n", hres
);
3510 typedef void (*style_test_t
)(IHTMLDocument2
*);
3512 static void run_test(const char *str
, style_test_t test
)
3514 IHTMLDocument2
*doc
;
3518 doc
= create_doc_with_string(str
);
3522 do_advise((IUnknown
*)doc
, &IID_IPropertyNotifySink
, (IUnknown
*)&PropertyNotifySink
);
3524 while(!doc_complete
&& GetMessageW(&msg
, NULL
, 0, 0)) {
3525 TranslateMessage(&msg
);
3526 DispatchMessageW(&msg
);
3531 ref
= IHTMLDocument2_Release(doc
);
3532 ok(!ref
|| broken(ref
== 1), /* Vista */
3536 static BOOL
check_ie(void)
3538 IHTMLDocument2
*doc
;
3539 IHTMLDocument7
*doc7
;
3542 doc
= create_document();
3546 hres
= IHTMLDocument2_QueryInterface(doc
, &IID_IHTMLDocument7
, (void**)&doc7
);
3547 if(SUCCEEDED(hres
)) {
3549 IHTMLDocument7_Release(doc7
);
3552 trace("is_ie9plus %x\n", is_ie9plus
);
3554 IHTMLDocument2_Release(doc
);
3563 trace("Running tests in quirks mode...\n");
3564 run_test(doc_blank
, basic_style_test
);
3565 run_test(runtimestyle_test_str
, runtimestyle_test
);
3567 trace("Running tests in IE9 mode...\n");
3568 compat_mode
= COMPAT_IE9
;
3569 run_test(doc_blank_ie9
, basic_style_test
);
3570 run_test(runtimestyle_ie9_test_str
, runtimestyle_test
);