mshtml: Use generic value checks for IHTMLStyle::put_fontWeight implementation.
[wine.git] / dlls / mshtml / htmlstyle.c
blobb7aeaeac59f71b3c5732ed33d8cefd78ec5034ef
1 /*
2 * Copyright 2006 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
19 #include <stdarg.h>
20 #include <assert.h>
21 #include <math.h>
23 #define COBJMACROS
25 #include "windef.h"
26 #include "winbase.h"
27 #include "winuser.h"
28 #include "ole2.h"
29 #include "mshtmdid.h"
31 #include "mshtml_private.h"
32 #include "htmlstyle.h"
34 #include "wine/debug.h"
36 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
38 static const WCHAR backgroundW[] =
39 {'b','a','c','k','g','r','o','u','n','d',0};
40 static const WCHAR background_attachmentW[] =
41 {'b','a','c','k','g','r','o','u','n','d','-','a','t','t','a','c','h','m','e','n','t',0};
42 static const WCHAR background_colorW[] =
43 {'b','a','c','k','g','r','o','u','n','d','-','c','o','l','o','r',0};
44 static const WCHAR background_imageW[] =
45 {'b','a','c','k','g','r','o','u','n','d','-','i','m','a','g','e',0};
46 static const WCHAR background_positionW[] =
47 {'b','a','c','k','g','r','o','u','n','d','-','p','o','s','i','t','i','o','n',0};
48 static const WCHAR background_position_xW[] =
49 {'b','a','c','k','g','r','o','u','n','d','-','p','o','s','i','t','i','o','n','-','x',0};
50 static const WCHAR background_position_yW[] =
51 {'b','a','c','k','g','r','o','u','n','d','-','p','o','s','i','t','i','o','n','-','y',0};
52 static const WCHAR background_repeatW[] =
53 {'b','a','c','k','g','r','o','u','n','d','-','r','e','p','e','a','t',0};
54 static const WCHAR borderW[] =
55 {'b','o','r','d','e','r',0};
56 static const WCHAR border_bottomW[] =
57 {'b','o','r','d','e','r','-','b','o','t','t','o','m',0};
58 static const WCHAR border_bottom_colorW[] =
59 {'b','o','r','d','e','r','-','b','o','t','t','o','m','-','c','o','l','o','r',0};
60 static const WCHAR border_bottom_styleW[] =
61 {'b','o','r','d','e','r','-','b','o','t','t','o','m','-','s','t','y','l','e',0};
62 static const WCHAR border_bottom_widthW[] =
63 {'b','o','r','d','e','r','-','b','o','t','t','o','m','-','w','i','d','t','h',0};
64 static const WCHAR border_colorW[] =
65 {'b','o','r','d','e','r','-','c','o','l','o','r',0};
66 static const WCHAR border_leftW[] =
67 {'b','o','r','d','e','r','-','l','e','f','t',0};
68 static const WCHAR border_left_colorW[] =
69 {'b','o','r','d','e','r','-','l','e','f','t','-','c','o','l','o','r',0};
70 static const WCHAR border_left_styleW[] =
71 {'b','o','r','d','e','r','-','l','e','f','t','-','s','t','y','l','e',0};
72 static const WCHAR border_left_widthW[] =
73 {'b','o','r','d','e','r','-','l','e','f','t','-','w','i','d','t','h',0};
74 static const WCHAR border_rightW[] =
75 {'b','o','r','d','e','r','-','r','i','g','h','t',0};
76 static const WCHAR border_right_colorW[] =
77 {'b','o','r','d','e','r','-','r','i','g','h','t','-','c','o','l','o','r',0};
78 static const WCHAR border_right_styleW[] =
79 {'b','o','r','d','e','r','-','r','i','g','h','t','-','s','t','y','l','e',0};
80 static const WCHAR border_right_widthW[] =
81 {'b','o','r','d','e','r','-','r','i','g','h','t','-','w','i','d','t','h',0};
82 static const WCHAR border_topW[] =
83 {'b','o','r','d','e','r','-','t','o','p',0};
84 static const WCHAR border_top_colorW[] =
85 {'b','o','r','d','e','r','-','t','o','p','-','c','o','l','o','r',0};
86 static const WCHAR border_styleW[] =
87 {'b','o','r','d','e','r','-','s','t','y','l','e',0};
88 static const WCHAR border_top_styleW[] =
89 {'b','o','r','d','e','r','-','t','o','p','-','s','t','y','l','e',0};
90 static const WCHAR border_top_widthW[] =
91 {'b','o','r','d','e','r','-','t','o','p','-','w','i','d','t','h',0};
92 static const WCHAR border_widthW[] =
93 {'b','o','r','d','e','r','-','w','i','d','t','h',0};
94 static const WCHAR bottomW[] =
95 {'b','o','t','t','o','m',0};
96 /* FIXME: Use unprefixed version (requires Gecko changes). */
97 static const WCHAR box_sizingW[] =
98 {'-','m','o','z','-','b','o','x','-','s','i','z','i','n','g',0};
99 static const WCHAR clearW[] =
100 {'c','l','e','a','r',0};
101 static const WCHAR clipW[] =
102 {'c','l','i','p',0};
103 static const WCHAR colorW[] =
104 {'c','o','l','o','r',0};
105 static const WCHAR cursorW[] =
106 {'c','u','r','s','o','r',0};
107 static const WCHAR directionW[] =
108 {'d','i','r','e','c','t','i','o','n',0};
109 static const WCHAR displayW[] =
110 {'d','i','s','p','l','a','y',0};
111 static const WCHAR filterW[] =
112 {'f','i','l','e','t','e','r',0};
113 static const WCHAR floatW[] =
114 {'f','l','o','a','t',0};
115 static const WCHAR font_familyW[] =
116 {'f','o','n','t','-','f','a','m','i','l','y',0};
117 static const WCHAR font_sizeW[] =
118 {'f','o','n','t','-','s','i','z','e',0};
119 static const WCHAR font_styleW[] =
120 {'f','o','n','t','-','s','t','y','l','e',0};
121 static const WCHAR font_variantW[] =
122 {'f','o','n','t','-','v','a','r','i','a','n','t',0};
123 static const WCHAR font_weightW[] =
124 {'f','o','n','t','-','w','e','i','g','h','t',0};
125 static const WCHAR heightW[] =
126 {'h','e','i','g','h','t',0};
127 static const WCHAR leftW[] =
128 {'l','e','f','t',0};
129 static const WCHAR letter_spacingW[] =
130 {'l','e','t','t','e','r','-','s','p','a','c','i','n','g',0};
131 static const WCHAR line_heightW[] =
132 {'l','i','n','e','-','h','e','i','g','h','t',0};
133 static const WCHAR list_styleW[] =
134 {'l','i','s','t','-','s','t','y','l','e',0};
135 static const WCHAR list_style_typeW[] =
136 {'l','i','s','t','-','s','t','y','l','e','-','t','y','p','e',0};
137 static const WCHAR list_style_positionW[] =
138 {'l','i','s','t','-','s','t','y','l','e','-','p','o','s','i','t','i','o','n',0};
139 static const WCHAR marginW[] =
140 {'m','a','r','g','i','n',0};
141 static const WCHAR margin_bottomW[] =
142 {'m','a','r','g','i','n','-','b','o','t','t','o','m',0};
143 static const WCHAR margin_leftW[] =
144 {'m','a','r','g','i','n','-','l','e','f','t',0};
145 static const WCHAR margin_rightW[] =
146 {'m','a','r','g','i','n','-','r','i','g','h','t',0};
147 static const WCHAR margin_topW[] =
148 {'m','a','r','g','i','n','-','t','o','p',0};
149 static const WCHAR max_heightW[] =
150 {'m','a','x','-','h','e','i','g','h','t',0};
151 static const WCHAR max_widthW[] =
152 {'m','a','x','-','w','i','d','t','h',0};
153 static const WCHAR min_heightW[] =
154 {'m','i','n','-','h','e','i','g','h','t',0};
155 static const WCHAR min_widthW[] =
156 {'m','i','n','-','w','i','d','t','h',0};
157 static const WCHAR outlineW[] =
158 {'o','u','t','l','i','n','e',0};
159 static const WCHAR overflowW[] =
160 {'o','v','e','r','f','l','o','w',0};
161 static const WCHAR overflow_xW[] =
162 {'o','v','e','r','f','l','o','w','-','x',0};
163 static const WCHAR overflow_yW[] =
164 {'o','v','e','r','f','l','o','w','-','y',0};
165 static const WCHAR paddingW[] =
166 {'p','a','d','d','i','n','g',0};
167 static const WCHAR padding_bottomW[] =
168 {'p','a','d','d','i','n','g','-','b','o','t','t','o','m',0};
169 static const WCHAR padding_leftW[] =
170 {'p','a','d','d','i','n','g','-','l','e','f','t',0};
171 static const WCHAR padding_rightW[] =
172 {'p','a','d','d','i','n','g','-','r','i','g','h','t',0};
173 static const WCHAR padding_topW[] =
174 {'p','a','d','d','i','n','g','-','t','o','p',0};
175 static const WCHAR page_break_afterW[] =
176 {'p','a','g','e','-','b','r','e','a','k','-','a','f','t','e','r',0};
177 static const WCHAR page_break_beforeW[] =
178 {'p','a','g','e','-','b','r','e','a','k','-','b','e','f','o','r','e',0};
179 static const WCHAR positionW[] =
180 {'p','o','s','i','t','i','o','n',0};
181 static const WCHAR rightW[] =
182 {'r','i','g','h','t',0};
183 static const WCHAR table_layoutW[] =
184 {'t','a','b','l','e','-','l','a','y','o','u','t',0};
185 static const WCHAR text_alignW[] =
186 {'t','e','x','t','-','a','l','i','g','n',0};
187 static const WCHAR text_decorationW[] =
188 {'t','e','x','t','-','d','e','c','o','r','a','t','i','o','n',0};
189 static const WCHAR text_indentW[] =
190 {'t','e','x','t','-','i','n','d','e','n','t',0};
191 static const WCHAR text_transformW[] =
192 {'t','e','x','t','-','t','r','a','n','s','f','o','r','m',0};
193 static const WCHAR topW[] =
194 {'t','o','p',0};
195 static const WCHAR vertical_alignW[] =
196 {'v','e','r','t','i','c','a','l','-','a','l','i','g','n',0};
197 static const WCHAR visibilityW[] =
198 {'v','i','s','i','b','i','l','i','t','y',0};
199 static const WCHAR white_spaceW[] =
200 {'w','h','i','t','e','-','s','p','a','c','e',0};
201 static const WCHAR widthW[] =
202 {'w','i','d','t','h',0};
203 static const WCHAR word_spacingW[] =
204 {'w','o','r','d','-','s','p','a','c','i','n','g',0};
205 static const WCHAR word_wrapW[] =
206 {'w','o','r','d','-','w','r','a','p',0};
207 static const WCHAR z_indexW[] =
208 {'z','-','i','n','d','e','x',0};
210 static const WCHAR boldW[] = {'b','o','l','d',0};
211 static const WCHAR bolderW[] = {'b','o','l','d','e','r',0};
212 static const WCHAR capsW[] = {'s','m','a','l','l','-','c','a','p','s',0};
213 static const WCHAR italicW[] = {'i','t','a','l','i','c',0};
214 static const WCHAR lighterW[] = {'l','i','g','h','t','e','r',0};
215 static const WCHAR normalW[] = {'n','o','r','m','a','l',0};
216 static const WCHAR obliqueW[] = {'o','b','l','i','q','u','e',0};
218 static const WCHAR style100W[] = {'1','0','0',0};
219 static const WCHAR style200W[] = {'2','0','0',0};
220 static const WCHAR style300W[] = {'3','0','0',0};
221 static const WCHAR style400W[] = {'4','0','0',0};
222 static const WCHAR style500W[] = {'5','0','0',0};
223 static const WCHAR style600W[] = {'6','0','0',0};
224 static const WCHAR style700W[] = {'7','0','0',0};
225 static const WCHAR style800W[] = {'8','0','0',0};
226 static const WCHAR style900W[] = {'9','0','0',0};
228 static const WCHAR *font_style_values[] = {
229 italicW,
230 normalW,
231 obliqueW,
232 NULL
235 static const WCHAR *font_variant_values[] = {
236 capsW,
237 normalW,
238 NULL
241 static const WCHAR *font_weight_values[] = {
242 style100W,
243 style200W,
244 style300W,
245 style400W,
246 style500W,
247 style600W,
248 style700W,
249 style800W,
250 style900W,
251 boldW,
252 bolderW,
253 lighterW,
254 normalW,
255 NULL
258 #define ATTR_FIX_PX 0x0001
259 #define ATTR_FIX_URL 0x0002
260 #define ATTR_STR_TO_INT 0x0004
261 #define ATTR_HEX_INT 0x0008
262 #define ATTR_REMOVE_COMMA 0x0010
263 #define ATTR_NO_NULL 0x0020
265 static const WCHAR pxW[] = {'p','x',0};
267 typedef struct {
268 const WCHAR *name;
269 DISPID dispid;
270 unsigned flags;
271 const WCHAR **allowed_values;
272 } style_tbl_entry_t;
274 static const style_tbl_entry_t style_tbl[] = {
275 {backgroundW, DISPID_IHTMLSTYLE_BACKGROUND},
276 {background_attachmentW, DISPID_IHTMLSTYLE_BACKGROUNDATTACHMENT},
277 {background_colorW, DISPID_IHTMLSTYLE_BACKGROUNDCOLOR, ATTR_HEX_INT},
278 {background_imageW, DISPID_IHTMLSTYLE_BACKGROUNDIMAGE, ATTR_FIX_URL},
279 {background_positionW, DISPID_IHTMLSTYLE_BACKGROUNDPOSITION},
280 {background_position_xW, DISPID_IHTMLSTYLE_BACKGROUNDPOSITIONX, ATTR_FIX_PX},
281 {background_position_yW, DISPID_IHTMLSTYLE_BACKGROUNDPOSITIONY, ATTR_FIX_PX},
282 {background_repeatW, DISPID_IHTMLSTYLE_BACKGROUNDREPEAT},
283 {borderW, DISPID_IHTMLSTYLE_BORDER},
284 {border_bottomW, DISPID_IHTMLSTYLE_BORDERBOTTOM, ATTR_FIX_PX},
285 {border_bottom_colorW, DISPID_IHTMLSTYLE_BORDERBOTTOMCOLOR, ATTR_HEX_INT},
286 {border_bottom_styleW, DISPID_IHTMLSTYLE_BORDERBOTTOMSTYLE},
287 {border_bottom_widthW, DISPID_IHTMLSTYLE_BORDERBOTTOMWIDTH, ATTR_FIX_PX},
288 {border_colorW, DISPID_IHTMLSTYLE_BORDERCOLOR},
289 {border_leftW, DISPID_IHTMLSTYLE_BORDERLEFT, ATTR_FIX_PX},
290 {border_left_colorW, DISPID_IHTMLSTYLE_BORDERLEFTCOLOR, ATTR_HEX_INT},
291 {border_left_styleW, DISPID_IHTMLSTYLE_BORDERLEFTSTYLE},
292 {border_left_widthW, DISPID_IHTMLSTYLE_BORDERLEFTWIDTH, ATTR_FIX_PX},
293 {border_rightW, DISPID_IHTMLSTYLE_BORDERRIGHT, ATTR_FIX_PX},
294 {border_right_colorW, DISPID_IHTMLSTYLE_BORDERRIGHTCOLOR, ATTR_HEX_INT},
295 {border_right_styleW, DISPID_IHTMLSTYLE_BORDERRIGHTSTYLE},
296 {border_right_widthW, DISPID_IHTMLSTYLE_BORDERRIGHTWIDTH, ATTR_FIX_PX},
297 {border_styleW, DISPID_IHTMLSTYLE_BORDERSTYLE},
298 {border_topW, DISPID_IHTMLSTYLE_BORDERTOP, ATTR_FIX_PX},
299 {border_top_colorW, DISPID_IHTMLSTYLE_BORDERTOPCOLOR, ATTR_HEX_INT},
300 {border_top_styleW, DISPID_IHTMLSTYLE_BORDERTOPSTYLE},
301 {border_top_widthW, DISPID_IHTMLSTYLE_BORDERTOPWIDTH},
302 {border_widthW, DISPID_IHTMLSTYLE_BORDERWIDTH},
303 {bottomW, DISPID_IHTMLSTYLE2_BOTTOM, ATTR_FIX_PX},
304 {box_sizingW, DISPID_IHTMLSTYLE6_BOXSIZING},
305 {clearW, DISPID_IHTMLSTYLE_CLEAR},
306 {clipW, DISPID_IHTMLSTYLE_CLIP, ATTR_REMOVE_COMMA},
307 {colorW, DISPID_IHTMLSTYLE_COLOR, ATTR_HEX_INT},
308 {cursorW, DISPID_IHTMLSTYLE_CURSOR},
309 {directionW, DISPID_IHTMLSTYLE2_DIRECTION},
310 {displayW, DISPID_IHTMLSTYLE_DISPLAY},
311 {filterW, DISPID_IHTMLSTYLE_FILTER},
312 {floatW, DISPID_IHTMLSTYLE_STYLEFLOAT},
313 {font_familyW, DISPID_IHTMLSTYLE_FONTFAMILY},
314 {font_sizeW, DISPID_IHTMLSTYLE_FONTSIZE, ATTR_FIX_PX},
315 {font_styleW, DISPID_IHTMLSTYLE_FONTSTYLE, 0, font_style_values},
316 {font_variantW, DISPID_IHTMLSTYLE_FONTVARIANT, 0, font_variant_values},
317 {font_weightW, DISPID_IHTMLSTYLE_FONTWEIGHT, ATTR_STR_TO_INT, font_weight_values},
318 {heightW, DISPID_IHTMLSTYLE_HEIGHT, ATTR_FIX_PX},
319 {leftW, DISPID_IHTMLSTYLE_LEFT},
320 {letter_spacingW, DISPID_IHTMLSTYLE_LETTERSPACING},
321 {line_heightW, DISPID_IHTMLSTYLE_LINEHEIGHT},
322 {list_styleW, DISPID_IHTMLSTYLE_LISTSTYLE},
323 {list_style_positionW, DISPID_IHTMLSTYLE_LISTSTYLEPOSITION},
324 {list_style_typeW, DISPID_IHTMLSTYLE_LISTSTYLETYPE},
325 {marginW, DISPID_IHTMLSTYLE_MARGIN},
326 {margin_bottomW, DISPID_IHTMLSTYLE_MARGINBOTTOM, ATTR_FIX_PX},
327 {margin_leftW, DISPID_IHTMLSTYLE_MARGINLEFT, ATTR_FIX_PX},
328 {margin_rightW, DISPID_IHTMLSTYLE_MARGINRIGHT, ATTR_FIX_PX},
329 {margin_topW, DISPID_IHTMLSTYLE_MARGINTOP, ATTR_FIX_PX},
330 {max_heightW, DISPID_IHTMLSTYLE5_MAXHEIGHT, ATTR_FIX_PX},
331 {max_widthW, DISPID_IHTMLSTYLE5_MAXWIDTH, ATTR_FIX_PX},
332 {min_heightW, DISPID_IHTMLSTYLE4_MINHEIGHT},
333 {min_widthW, DISPID_IHTMLSTYLE5_MINWIDTH, ATTR_FIX_PX},
334 {outlineW, DISPID_IHTMLSTYLE6_OUTLINE, ATTR_NO_NULL},
335 {overflowW, DISPID_IHTMLSTYLE_OVERFLOW},
336 {overflow_xW, DISPID_IHTMLSTYLE2_OVERFLOWX},
337 {overflow_yW, DISPID_IHTMLSTYLE2_OVERFLOWY},
338 {paddingW, DISPID_IHTMLSTYLE_PADDING},
339 {padding_bottomW, DISPID_IHTMLSTYLE_PADDINGBOTTOM, ATTR_FIX_PX},
340 {padding_leftW, DISPID_IHTMLSTYLE_PADDINGLEFT, ATTR_FIX_PX},
341 {padding_rightW, DISPID_IHTMLSTYLE_PADDINGRIGHT, ATTR_FIX_PX},
342 {padding_topW, DISPID_IHTMLSTYLE_PADDINGTOP, ATTR_FIX_PX},
343 {page_break_afterW, DISPID_IHTMLSTYLE_PAGEBREAKAFTER},
344 {page_break_beforeW, DISPID_IHTMLSTYLE_PAGEBREAKBEFORE},
345 {positionW, DISPID_IHTMLSTYLE2_POSITION},
346 {rightW, DISPID_IHTMLSTYLE2_RIGHT},
347 {table_layoutW, DISPID_IHTMLSTYLE2_TABLELAYOUT},
348 {text_alignW, DISPID_IHTMLSTYLE_TEXTALIGN},
349 {text_decorationW, DISPID_IHTMLSTYLE_TEXTDECORATION},
350 {text_indentW, DISPID_IHTMLSTYLE_TEXTINDENT, ATTR_FIX_PX},
351 {text_transformW, DISPID_IHTMLSTYLE_TEXTTRANSFORM},
352 {topW, DISPID_IHTMLSTYLE_TOP},
353 {vertical_alignW, DISPID_IHTMLSTYLE_VERTICALALIGN, ATTR_FIX_PX},
354 {visibilityW, DISPID_IHTMLSTYLE_VISIBILITY},
355 {white_spaceW, DISPID_IHTMLSTYLE_WHITESPACE},
356 {widthW, DISPID_IHTMLSTYLE_WIDTH, ATTR_FIX_PX},
357 {word_spacingW, DISPID_IHTMLSTYLE_WORDSPACING},
358 {word_wrapW, DISPID_IHTMLSTYLE3_WORDWRAP},
359 {z_indexW, DISPID_IHTMLSTYLE_ZINDEX, ATTR_STR_TO_INT}
362 C_ASSERT(ARRAY_SIZE(style_tbl) == STYLEID_MAX_VALUE);
364 static const WCHAR valLineThrough[] =
365 {'l','i','n','e','-','t','h','r','o','u','g','h',0};
366 static const WCHAR valUnderline[] =
367 {'u','n','d','e','r','l','i','n','e',0};
368 static const WCHAR styleNone[] =
369 {'n','o','n','e',0};
370 static const WCHAR valOverline[] =
371 {'o','v','e','r','l','i','n','e',0};
372 static const WCHAR valBlink[] =
373 {'b','l','i','n','k',0};
375 static const WCHAR px_formatW[] = {'%','d','p','x',0};
376 static const WCHAR emptyW[] = {0};
378 static const style_tbl_entry_t *lookup_style_tbl(const WCHAR *name)
380 int c, i, min = 0, max = ARRAY_SIZE(style_tbl)-1;
382 while(min <= max) {
383 i = (min+max)/2;
385 c = strcmpW(style_tbl[i].name, name);
386 if(!c)
387 return style_tbl+i;
389 if(c > 0)
390 max = i-1;
391 else
392 min = i+1;
395 return NULL;
398 static inline compat_mode_t get_style_compat_mode(HTMLStyle *style)
400 return style->elem && style->elem->node.doc ? style->elem->node.doc->document_mode : COMPAT_MODE_QUIRKS;
403 static LPWSTR fix_px_value(LPCWSTR val)
405 LPCWSTR ptr = val;
407 while(*ptr) {
408 while(*ptr && isspaceW(*ptr))
409 ptr++;
410 if(!*ptr)
411 break;
413 while(*ptr && isdigitW(*ptr))
414 ptr++;
416 if(!*ptr || isspaceW(*ptr)) {
417 LPWSTR ret, p;
418 int len = strlenW(val)+1;
420 ret = heap_alloc((len+2)*sizeof(WCHAR));
421 memcpy(ret, val, (ptr-val)*sizeof(WCHAR));
422 p = ret + (ptr-val);
423 *p++ = 'p';
424 *p++ = 'x';
425 strcpyW(p, ptr);
427 TRACE("fixed %s -> %s\n", debugstr_w(val), debugstr_w(ret));
429 return ret;
432 while(*ptr && !isspaceW(*ptr))
433 ptr++;
436 return NULL;
439 static LPWSTR fix_url_value(LPCWSTR val)
441 WCHAR *ret, *ptr;
443 static const WCHAR urlW[] = {'u','r','l','('};
445 if(strncmpW(val, urlW, ARRAY_SIZE(urlW)) || !strchrW(val, '\\'))
446 return NULL;
448 ret = heap_strdupW(val);
450 for(ptr = ret; *ptr; ptr++) {
451 if(*ptr == '\\')
452 *ptr = '/';
455 return ret;
458 static HRESULT set_nsstyle_property(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, const WCHAR *value)
460 nsAString str_name, str_value, str_empty;
461 LPWSTR val = NULL;
462 nsresult nsres;
463 HRESULT hres = S_OK;
465 if(value && *value) {
466 unsigned flags = style_tbl[sid].flags;
467 if(flags & ATTR_FIX_PX)
468 val = fix_px_value(value);
469 else if(flags & ATTR_FIX_URL)
470 val = fix_url_value(value);
472 if(style_tbl[sid].allowed_values) {
473 const WCHAR **iter;
474 for(iter = style_tbl[sid].allowed_values; *iter; iter++) {
475 if(!strcmpiW(*iter, value))
476 break;
478 if(!*iter) {
479 hres = E_INVALIDARG;
480 value = emptyW;
485 nsAString_InitDepend(&str_name, style_tbl[sid].name);
486 nsAString_InitDepend(&str_value, val ? val : value);
487 nsAString_InitDepend(&str_empty, emptyW);
489 nsres = nsIDOMCSSStyleDeclaration_SetProperty(nsstyle, &str_name, &str_value, &str_empty);
490 if(NS_FAILED(nsres))
491 ERR("SetProperty failed: %08x\n", nsres);
493 nsAString_Finish(&str_name);
494 nsAString_Finish(&str_value);
495 nsAString_Finish(&str_empty);
496 heap_free(val);
498 return hres;
501 static HRESULT var_to_styleval(const VARIANT *v, styleid_t sid, WCHAR *buf, const WCHAR **ret)
503 switch(V_VT(v)) {
504 case VT_NULL:
505 *ret = emptyW;
506 return S_OK;
508 case VT_BSTR:
509 *ret = V_BSTR(v);
510 return S_OK;
512 case VT_BSTR|VT_BYREF:
513 *ret = *V_BSTRREF(v);
514 return S_OK;
516 case VT_I4: {
517 unsigned flags = style_tbl[sid].flags;
518 static const WCHAR formatW[] = {'%','d',0};
519 static const WCHAR hex_formatW[] = {'#','%','0','6','x',0};
521 if(flags & ATTR_HEX_INT)
522 wsprintfW(buf, hex_formatW, V_I4(v));
523 else if(flags & ATTR_FIX_PX)
524 wsprintfW(buf, px_formatW, V_I4(v));
525 else
526 wsprintfW(buf, formatW, V_I4(v));
528 *ret = buf;
529 return S_OK;
531 default:
532 FIXME("not implemented for %s\n", debugstr_variant(v));
533 return E_NOTIMPL;
538 static HRESULT set_style_property_var(HTMLStyle *style, styleid_t sid, VARIANT *value)
540 const WCHAR *val;
541 WCHAR buf[14];
542 HRESULT hres;
544 hres = var_to_styleval(value, sid, buf, &val);
545 if(FAILED(hres))
546 return hres;
548 return set_nsstyle_property(style->nsstyle, sid, val);
551 static inline HRESULT set_style_property(HTMLStyle *style, styleid_t sid, const WCHAR *value)
553 return set_nsstyle_property(style->nsstyle, sid, value);
556 static HRESULT get_nsstyle_attr_nsval(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, nsAString *value)
558 nsAString str_name;
559 nsresult nsres;
561 nsAString_InitDepend(&str_name, style_tbl[sid].name);
562 nsres = nsIDOMCSSStyleDeclaration_GetPropertyValue(nsstyle, &str_name, value);
563 nsAString_Finish(&str_name);
564 if(NS_FAILED(nsres)) {
565 ERR("SetProperty failed: %08x\n", nsres);
566 return E_FAIL;
569 return S_OK;
572 static HRESULT nsstyle_to_bstr(const WCHAR *val, DWORD flags, BSTR *p)
574 BSTR ret;
575 DWORD len;
577 if(!*val) {
578 *p = (flags & ATTR_NO_NULL) ? SysAllocStringLen(NULL, 0) : NULL;
579 return S_OK;
582 ret = SysAllocString(val);
583 if(!ret)
584 return E_OUTOFMEMORY;
586 len = SysStringLen(ret);
588 if(flags & ATTR_REMOVE_COMMA) {
589 DWORD new_len = len;
590 WCHAR *ptr, *ptr2;
592 for(ptr = ret; (ptr = strchrW(ptr, ',')); ptr++)
593 new_len--;
595 if(new_len != len) {
596 BSTR new_ret;
598 new_ret = SysAllocStringLen(NULL, new_len);
599 if(!new_ret) {
600 SysFreeString(ret);
601 return E_OUTOFMEMORY;
604 for(ptr2 = new_ret, ptr = ret; *ptr; ptr++) {
605 if(*ptr != ',')
606 *ptr2++ = *ptr;
609 SysFreeString(ret);
610 ret = new_ret;
614 *p = ret;
615 return S_OK;
618 HRESULT get_nsstyle_property(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, BSTR *p)
620 nsAString str_value;
621 const PRUnichar *value;
622 HRESULT hres;
624 nsAString_Init(&str_value, NULL);
626 get_nsstyle_attr_nsval(nsstyle, sid, &str_value);
628 nsAString_GetData(&str_value, &value);
629 hres = nsstyle_to_bstr(value, style_tbl[sid].flags, p);
630 nsAString_Finish(&str_value);
632 TRACE("%s -> %s\n", debugstr_w(style_tbl[sid].name), debugstr_w(*p));
633 return hres;
636 HRESULT get_nsstyle_property_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, VARIANT *p)
638 nsAString str_value;
639 const PRUnichar *value;
640 BOOL set = FALSE;
641 unsigned flags;
642 HRESULT hres = S_OK;
644 flags = style_tbl[sid].flags;
645 nsAString_Init(&str_value, NULL);
647 get_nsstyle_attr_nsval(nsstyle, sid, &str_value);
649 nsAString_GetData(&str_value, &value);
651 if(flags & ATTR_STR_TO_INT) {
652 const PRUnichar *ptr = value;
653 BOOL neg = FALSE;
654 INT i = 0;
656 if(*ptr == '-') {
657 neg = TRUE;
658 ptr++;
661 while(isdigitW(*ptr))
662 i = i*10 + (*ptr++ - '0');
664 if(!*ptr) {
665 V_VT(p) = VT_I4;
666 V_I4(p) = neg ? -i : i;
667 set = TRUE;
671 if(!set) {
672 BSTR str;
674 hres = nsstyle_to_bstr(value, flags, &str);
675 if(SUCCEEDED(hres)) {
676 V_VT(p) = VT_BSTR;
677 V_BSTR(p) = str;
681 nsAString_Finish(&str_value);
683 TRACE("%s -> %s\n", debugstr_w(style_tbl[sid].name), debugstr_variant(p));
684 return S_OK;
687 static inline HRESULT get_style_property(HTMLStyle *This, styleid_t sid, BSTR *p)
689 return get_nsstyle_property(This->nsstyle, sid, p);
692 static inline HRESULT get_style_property_var(HTMLStyle *This, styleid_t sid, VARIANT *v)
694 return get_nsstyle_property_var(This->nsstyle, sid, v);
697 static HRESULT check_style_attr_value(HTMLStyle *This, styleid_t sid, LPCWSTR exval, VARIANT_BOOL *p)
699 nsAString str_value;
700 const PRUnichar *value;
702 nsAString_Init(&str_value, NULL);
704 get_nsstyle_attr_nsval(This->nsstyle, sid, &str_value);
706 nsAString_GetData(&str_value, &value);
707 *p = variant_bool(!strcmpW(value, exval));
708 nsAString_Finish(&str_value);
710 TRACE("%s -> %x\n", debugstr_w(style_tbl[sid].name), *p);
711 return S_OK;
714 static inline HRESULT set_style_pos(HTMLStyle *This, styleid_t sid, float value)
716 WCHAR szValue[25];
717 WCHAR szFormat[] = {'%','.','0','f','p','x',0};
719 value = floor(value);
721 sprintfW(szValue, szFormat, value);
723 return set_style_property(This, sid, szValue);
726 static HRESULT set_style_pxattr(HTMLStyle *style, styleid_t sid, LONG value)
728 WCHAR value_str[16];
730 sprintfW(value_str, px_formatW, value);
732 return set_style_property(style, sid, value_str);
735 static HRESULT get_nsstyle_pos(HTMLStyle *This, styleid_t sid, float *p)
737 nsAString str_value;
738 HRESULT hres;
740 TRACE("%p %d %p\n", This, sid, p);
742 *p = 0.0f;
744 nsAString_Init(&str_value, NULL);
746 hres = get_nsstyle_attr_nsval(This->nsstyle, sid, &str_value);
747 if(hres == S_OK)
749 WCHAR *ptr;
750 const PRUnichar *value;
752 nsAString_GetData(&str_value, &value);
753 if(value)
755 *p = strtolW(value, &ptr, 10);
757 if(*ptr && strcmpW(ptr, pxW))
759 nsAString_Finish(&str_value);
760 FIXME("only px values are currently supported\n");
761 hres = E_FAIL;
766 TRACE("ret %f\n", *p);
768 nsAString_Finish(&str_value);
769 return hres;
772 static HRESULT get_nsstyle_pixel_val(HTMLStyle *This, styleid_t sid, LONG *p)
774 nsAString str_value;
775 HRESULT hres;
777 if(!p)
778 return E_POINTER;
780 nsAString_Init(&str_value, NULL);
782 hres = get_nsstyle_attr_nsval(This->nsstyle, sid, &str_value);
783 if(hres == S_OK) {
784 WCHAR *ptr = NULL;
785 const PRUnichar *value;
787 nsAString_GetData(&str_value, &value);
788 if(value) {
789 *p = strtolW(value, &ptr, 10);
791 if(*ptr == '.') {
792 /* Skip all digits. We have tests showing that we should not round the value. */
793 while(isdigitW(*++ptr));
797 if(!ptr || (*ptr && strcmpW(ptr, pxW)))
798 *p = 0;
801 nsAString_Finish(&str_value);
802 return hres;
805 static BOOL is_valid_border_style(BSTR v)
807 static const WCHAR styleDotted[] = {'d','o','t','t','e','d',0};
808 static const WCHAR styleDashed[] = {'d','a','s','h','e','d',0};
809 static const WCHAR styleSolid[] = {'s','o','l','i','d',0};
810 static const WCHAR styleDouble[] = {'d','o','u','b','l','e',0};
811 static const WCHAR styleGroove[] = {'g','r','o','o','v','e',0};
812 static const WCHAR styleRidge[] = {'r','i','d','g','e',0};
813 static const WCHAR styleInset[] = {'i','n','s','e','t',0};
814 static const WCHAR styleOutset[] = {'o','u','t','s','e','t',0};
816 TRACE("%s\n", debugstr_w(v));
818 if(!v || strcmpiW(v, styleNone) == 0 || strcmpiW(v, styleDotted) == 0 ||
819 strcmpiW(v, styleDashed) == 0 || strcmpiW(v, styleSolid) == 0 ||
820 strcmpiW(v, styleDouble) == 0 || strcmpiW(v, styleGroove) == 0 ||
821 strcmpiW(v, styleRidge) == 0 || strcmpiW(v, styleInset) == 0 ||
822 strcmpiW(v, styleOutset) == 0 )
824 return TRUE;
827 return FALSE;
830 static inline HTMLStyle *impl_from_IHTMLStyle(IHTMLStyle *iface)
832 return CONTAINING_RECORD(iface, HTMLStyle, IHTMLStyle_iface);
835 static HRESULT WINAPI HTMLStyle_QueryInterface(IHTMLStyle *iface, REFIID riid, void **ppv)
837 HTMLStyle *This = impl_from_IHTMLStyle(iface);
839 TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
841 if(IsEqualGUID(&IID_IUnknown, riid)) {
842 *ppv = &This->IHTMLStyle_iface;
843 }else if(IsEqualGUID(&IID_IHTMLStyle, riid)) {
844 *ppv = &This->IHTMLStyle_iface;
845 }else if(IsEqualGUID(&IID_IHTMLStyle2, riid)) {
846 *ppv = &This->IHTMLStyle2_iface;
847 }else if(IsEqualGUID(&IID_IHTMLStyle3, riid)) {
848 *ppv = &This->IHTMLStyle3_iface;
849 }else if(IsEqualGUID(&IID_IHTMLStyle4, riid)) {
850 *ppv = &This->IHTMLStyle4_iface;
851 }else if(IsEqualGUID(&IID_IHTMLStyle5, riid)) {
852 *ppv = &This->IHTMLStyle5_iface;
853 }else if(IsEqualGUID(&IID_IHTMLStyle6, riid)) {
854 *ppv = &This->IHTMLStyle6_iface;
855 }else if(dispex_query_interface(&This->dispex, riid, ppv)) {
856 return *ppv ? S_OK : E_NOINTERFACE;
857 }else {
858 *ppv = NULL;
859 WARN("unsupported iface %s\n", debugstr_mshtml_guid(riid));
860 return E_NOINTERFACE;
863 IUnknown_AddRef((IUnknown*)*ppv);
864 return S_OK;
867 static ULONG WINAPI HTMLStyle_AddRef(IHTMLStyle *iface)
869 HTMLStyle *This = impl_from_IHTMLStyle(iface);
870 LONG ref = InterlockedIncrement(&This->ref);
872 TRACE("(%p) ref=%d\n", This, ref);
874 return ref;
877 static ULONG WINAPI HTMLStyle_Release(IHTMLStyle *iface)
879 HTMLStyle *This = impl_from_IHTMLStyle(iface);
880 LONG ref = InterlockedDecrement(&This->ref);
882 TRACE("(%p) ref=%d\n", This, ref);
884 if(!ref) {
885 assert(!This->elem);
886 if(This->nsstyle)
887 nsIDOMCSSStyleDeclaration_Release(This->nsstyle);
888 release_dispex(&This->dispex);
889 heap_free(This);
892 return ref;
895 static HRESULT WINAPI HTMLStyle_GetTypeInfoCount(IHTMLStyle *iface, UINT *pctinfo)
897 HTMLStyle *This = impl_from_IHTMLStyle(iface);
898 return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
901 static HRESULT WINAPI HTMLStyle_GetTypeInfo(IHTMLStyle *iface, UINT iTInfo,
902 LCID lcid, ITypeInfo **ppTInfo)
904 HTMLStyle *This = impl_from_IHTMLStyle(iface);
905 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
908 static HRESULT WINAPI HTMLStyle_GetIDsOfNames(IHTMLStyle *iface, REFIID riid,
909 LPOLESTR *rgszNames, UINT cNames,
910 LCID lcid, DISPID *rgDispId)
912 HTMLStyle *This = impl_from_IHTMLStyle(iface);
913 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
914 lcid, rgDispId);
917 static HRESULT WINAPI HTMLStyle_Invoke(IHTMLStyle *iface, DISPID dispIdMember,
918 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
919 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
921 HTMLStyle *This = impl_from_IHTMLStyle(iface);
922 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
923 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
926 static HRESULT WINAPI HTMLStyle_put_fontFamily(IHTMLStyle *iface, BSTR v)
928 HTMLStyle *This = impl_from_IHTMLStyle(iface);
930 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
932 return set_style_property(This, STYLEID_FONT_FAMILY, v);
935 static HRESULT WINAPI HTMLStyle_get_fontFamily(IHTMLStyle *iface, BSTR *p)
937 HTMLStyle *This = impl_from_IHTMLStyle(iface);
939 TRACE("(%p)->(%p)\n", This, p);
941 return get_style_property(This, STYLEID_FONT_FAMILY, p);
944 static HRESULT WINAPI HTMLStyle_put_fontStyle(IHTMLStyle *iface, BSTR v)
946 HTMLStyle *This = impl_from_IHTMLStyle(iface);
948 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
950 return set_style_property(This, STYLEID_FONT_STYLE, v);
953 static HRESULT WINAPI HTMLStyle_get_fontStyle(IHTMLStyle *iface, BSTR *p)
955 HTMLStyle *This = impl_from_IHTMLStyle(iface);
957 TRACE("(%p)->(%p)\n", This, p);
959 return get_style_property(This, STYLEID_FONT_STYLE, p);
962 static HRESULT WINAPI HTMLStyle_put_fontVariant(IHTMLStyle *iface, BSTR v)
964 HTMLStyle *This = impl_from_IHTMLStyle(iface);
966 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
968 return set_style_property(This, STYLEID_FONT_VARIANT, v);
971 static HRESULT WINAPI HTMLStyle_get_fontVariant(IHTMLStyle *iface, BSTR *p)
973 HTMLStyle *This = impl_from_IHTMLStyle(iface);
974 TRACE("(%p)->(%p)\n", This, p);
976 if(!p)
977 return E_INVALIDARG;
979 return get_style_property(This, STYLEID_FONT_VARIANT, p);
982 static HRESULT WINAPI HTMLStyle_put_fontWeight(IHTMLStyle *iface, BSTR v)
984 HTMLStyle *This = impl_from_IHTMLStyle(iface);
986 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
988 return set_style_property(This, STYLEID_FONT_WEIGHT, v);
991 static HRESULT WINAPI HTMLStyle_get_fontWeight(IHTMLStyle *iface, BSTR *p)
993 HTMLStyle *This = impl_from_IHTMLStyle(iface);
995 TRACE("(%p)->(%p)\n", This, p);
997 return get_style_property(This, STYLEID_FONT_WEIGHT, p);
1000 static HRESULT WINAPI HTMLStyle_put_fontSize(IHTMLStyle *iface, VARIANT v)
1002 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1004 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1006 return set_style_property_var(This, STYLEID_FONT_SIZE, &v);
1009 static HRESULT WINAPI HTMLStyle_get_fontSize(IHTMLStyle *iface, VARIANT *p)
1011 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1013 TRACE("(%p)->(%p)\n", This, p);
1015 return get_style_property_var(This, STYLEID_FONT_SIZE, p);
1018 static HRESULT WINAPI HTMLStyle_put_font(IHTMLStyle *iface, BSTR v)
1020 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1021 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1022 return E_NOTIMPL;
1025 static HRESULT WINAPI HTMLStyle_get_font(IHTMLStyle *iface, BSTR *p)
1027 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1028 FIXME("(%p)->(%p)\n", This, p);
1029 return E_NOTIMPL;
1032 static HRESULT WINAPI HTMLStyle_put_color(IHTMLStyle *iface, VARIANT v)
1034 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1036 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1038 return set_style_property_var(This, STYLEID_COLOR, &v);
1041 static HRESULT WINAPI HTMLStyle_get_color(IHTMLStyle *iface, VARIANT *p)
1043 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1045 TRACE("(%p)->(%p)\n", This, p);
1047 return get_style_property_var(This, STYLEID_COLOR, p);
1050 static HRESULT WINAPI HTMLStyle_put_background(IHTMLStyle *iface, BSTR v)
1052 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1054 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1056 return set_style_property(This, STYLEID_BACKGROUND, v);
1059 static HRESULT WINAPI HTMLStyle_get_background(IHTMLStyle *iface, BSTR *p)
1061 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1063 TRACE("(%p)->(%p)\n", This, p);
1065 return get_style_property(This, STYLEID_BACKGROUND, p);
1068 static HRESULT WINAPI HTMLStyle_put_backgroundColor(IHTMLStyle *iface, VARIANT v)
1070 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1072 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1074 return set_style_property_var(This, STYLEID_BACKGROUND_COLOR, &v);
1077 static HRESULT WINAPI HTMLStyle_get_backgroundColor(IHTMLStyle *iface, VARIANT *p)
1079 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1081 TRACE("(%p)->(%p)\n", This, p);
1083 return get_style_property_var(This, STYLEID_BACKGROUND_COLOR, p);
1086 static HRESULT WINAPI HTMLStyle_put_backgroundImage(IHTMLStyle *iface, BSTR v)
1088 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1090 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1092 return set_style_property(This, STYLEID_BACKGROUND_IMAGE, v);
1095 static HRESULT WINAPI HTMLStyle_get_backgroundImage(IHTMLStyle *iface, BSTR *p)
1097 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1099 TRACE("(%p)->(%p)\n", This, p);
1101 return get_style_property(This, STYLEID_BACKGROUND_IMAGE, p);
1104 static HRESULT WINAPI HTMLStyle_put_backgroundRepeat(IHTMLStyle *iface, BSTR v)
1106 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1107 static const WCHAR styleRepeat[] = {'r','e','p','e','a','t',0};
1108 static const WCHAR styleNoRepeat[] = {'n','o','-','r','e','p','e','a','t',0};
1109 static const WCHAR styleRepeatX[] = {'r','e','p','e','a','t','-','x',0};
1110 static const WCHAR styleRepeatY[] = {'r','e','p','e','a','t','-','y',0};
1112 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1114 /* fontWeight can only be one of the following */
1115 if(!v || strcmpiW(styleRepeat, v) == 0 || strcmpiW(styleNoRepeat, v) == 0 ||
1116 strcmpiW(styleRepeatX, v) == 0 || strcmpiW(styleRepeatY, v) == 0 )
1118 return set_style_property(This, STYLEID_BACKGROUND_REPEAT , v);
1121 return E_INVALIDARG;
1124 static HRESULT WINAPI HTMLStyle_get_backgroundRepeat(IHTMLStyle *iface, BSTR *p)
1126 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1128 TRACE("(%p)->(%p)\n", This, p);
1130 return get_style_property(This, STYLEID_BACKGROUND_REPEAT, p);
1133 static HRESULT WINAPI HTMLStyle_put_backgroundAttachment(IHTMLStyle *iface, BSTR v)
1135 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1137 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1139 return set_style_property(This, STYLEID_BACKGROUND_ATTACHMENT, v);
1142 static HRESULT WINAPI HTMLStyle_get_backgroundAttachment(IHTMLStyle *iface, BSTR *p)
1144 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1146 TRACE("(%p)->(%p)\n", This, p);
1148 return get_style_property(This, STYLEID_BACKGROUND_ATTACHMENT, p);
1151 static HRESULT WINAPI HTMLStyle_put_backgroundPosition(IHTMLStyle *iface, BSTR v)
1153 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1155 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1157 return set_style_property(This, STYLEID_BACKGROUND_POSITION, v);
1160 static HRESULT WINAPI HTMLStyle_get_backgroundPosition(IHTMLStyle *iface, BSTR *p)
1162 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1164 TRACE("(%p)->(%p)\n", This, p);
1166 return get_style_property(This, STYLEID_BACKGROUND_POSITION, p);
1169 static HRESULT WINAPI HTMLStyle_put_backgroundPositionX(IHTMLStyle *iface, VARIANT v)
1171 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1172 WCHAR buf[14], *pos_val;
1173 nsAString pos_str;
1174 const WCHAR *val;
1175 DWORD val_len;
1176 HRESULT hres;
1178 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1180 hres = var_to_styleval(&v, STYLEID_BACKGROUND_POSITION_X, buf, &val);
1181 if(FAILED(hres))
1182 return hres;
1184 val_len = val ? strlenW(val) : 0;
1186 nsAString_Init(&pos_str, NULL);
1187 hres = get_nsstyle_attr_nsval(This->nsstyle, STYLEID_BACKGROUND_POSITION, &pos_str);
1188 if(SUCCEEDED(hres)) {
1189 const PRUnichar *pos, *posy;
1190 DWORD posy_len;
1192 nsAString_GetData(&pos_str, &pos);
1193 posy = strchrW(pos, ' ');
1194 if(!posy) {
1195 static const WCHAR zero_pxW[] = {' ','0','p','x',0};
1197 TRACE("no space in %s\n", debugstr_w(pos));
1198 posy = zero_pxW;
1201 posy_len = strlenW(posy);
1202 pos_val = heap_alloc((val_len+posy_len+1)*sizeof(WCHAR));
1203 if(pos_val) {
1204 if(val_len)
1205 memcpy(pos_val, val, val_len*sizeof(WCHAR));
1206 if(posy_len)
1207 memcpy(pos_val+val_len, posy, posy_len*sizeof(WCHAR));
1208 pos_val[val_len+posy_len] = 0;
1209 }else {
1210 hres = E_OUTOFMEMORY;
1213 nsAString_Finish(&pos_str);
1214 if(FAILED(hres))
1215 return hres;
1217 TRACE("setting position to %s\n", debugstr_w(pos_val));
1218 hres = set_style_property(This, STYLEID_BACKGROUND_POSITION, pos_val);
1219 heap_free(pos_val);
1220 return hres;
1223 static HRESULT WINAPI HTMLStyle_get_backgroundPositionX(IHTMLStyle *iface, VARIANT *p)
1225 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1226 nsAString pos_str;
1227 BSTR ret;
1228 HRESULT hres;
1230 TRACE("(%p)->(%p)\n", This, p);
1232 nsAString_Init(&pos_str, NULL);
1233 hres = get_nsstyle_attr_nsval(This->nsstyle, STYLEID_BACKGROUND_POSITION, &pos_str);
1234 if(SUCCEEDED(hres)) {
1235 const PRUnichar *pos, *space;
1237 nsAString_GetData(&pos_str, &pos);
1238 space = strchrW(pos, ' ');
1239 if(!space) {
1240 WARN("no space in %s\n", debugstr_w(pos));
1241 space = pos + strlenW(pos);
1244 if(space != pos) {
1245 ret = SysAllocStringLen(pos, space-pos);
1246 if(!ret)
1247 hres = E_OUTOFMEMORY;
1248 }else {
1249 ret = NULL;
1252 nsAString_Finish(&pos_str);
1253 if(FAILED(hres))
1254 return hres;
1256 TRACE("returning %s\n", debugstr_w(ret));
1257 V_VT(p) = VT_BSTR;
1258 V_BSTR(p) = ret;
1259 return S_OK;
1262 static HRESULT WINAPI HTMLStyle_put_backgroundPositionY(IHTMLStyle *iface, VARIANT v)
1264 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1265 WCHAR buf[14], *pos_val;
1266 nsAString pos_str;
1267 const WCHAR *val;
1268 DWORD val_len;
1269 HRESULT hres;
1271 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1273 hres = var_to_styleval(&v, STYLEID_BACKGROUND_POSITION_Y, buf, &val);
1274 if(FAILED(hres))
1275 return hres;
1277 val_len = val ? strlenW(val) : 0;
1279 nsAString_Init(&pos_str, NULL);
1280 hres = get_nsstyle_attr_nsval(This->nsstyle, STYLEID_BACKGROUND_POSITION, &pos_str);
1281 if(SUCCEEDED(hres)) {
1282 const PRUnichar *pos, *space;
1283 DWORD posx_len;
1285 nsAString_GetData(&pos_str, &pos);
1286 space = strchrW(pos, ' ');
1287 if(space) {
1288 space++;
1289 }else {
1290 static const WCHAR zero_pxW[] = {'0','p','x',' ',0};
1292 TRACE("no space in %s\n", debugstr_w(pos));
1293 pos = zero_pxW;
1294 space = pos + ARRAY_SIZE(zero_pxW)-1;
1297 posx_len = space-pos;
1299 pos_val = heap_alloc((posx_len+val_len+1)*sizeof(WCHAR));
1300 if(pos_val) {
1301 memcpy(pos_val, pos, posx_len*sizeof(WCHAR));
1302 if(val_len)
1303 memcpy(pos_val+posx_len, val, val_len*sizeof(WCHAR));
1304 pos_val[posx_len+val_len] = 0;
1305 }else {
1306 hres = E_OUTOFMEMORY;
1309 nsAString_Finish(&pos_str);
1310 if(FAILED(hres))
1311 return hres;
1313 TRACE("setting position to %s\n", debugstr_w(pos_val));
1314 hres = set_style_property(This, STYLEID_BACKGROUND_POSITION, pos_val);
1315 heap_free(pos_val);
1316 return hres;
1319 static HRESULT WINAPI HTMLStyle_get_backgroundPositionY(IHTMLStyle *iface, VARIANT *p)
1321 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1322 nsAString pos_str;
1323 BSTR ret;
1324 HRESULT hres;
1326 TRACE("(%p)->(%p)\n", This, p);
1328 nsAString_Init(&pos_str, NULL);
1329 hres = get_nsstyle_attr_nsval(This->nsstyle, STYLEID_BACKGROUND_POSITION, &pos_str);
1330 if(SUCCEEDED(hres)) {
1331 const PRUnichar *pos, *posy;
1333 nsAString_GetData(&pos_str, &pos);
1334 posy = strchrW(pos, ' ');
1335 if(posy) {
1336 ret = SysAllocString(posy+1);
1337 if(!ret)
1338 hres = E_OUTOFMEMORY;
1339 }else {
1340 ret = NULL;
1343 nsAString_Finish(&pos_str);
1344 if(FAILED(hres))
1345 return hres;
1347 TRACE("returning %s\n", debugstr_w(ret));
1348 V_VT(p) = VT_BSTR;
1349 V_BSTR(p) = ret;
1350 return S_OK;
1353 static HRESULT WINAPI HTMLStyle_put_wordSpacing(IHTMLStyle *iface, VARIANT v)
1355 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1357 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1359 return set_style_property_var(This, STYLEID_WORD_SPACING, &v);
1362 static HRESULT WINAPI HTMLStyle_get_wordSpacing(IHTMLStyle *iface, VARIANT *p)
1364 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1365 TRACE("(%p)->(%p)\n", This, p);
1366 return get_style_property_var(This, STYLEID_WORD_SPACING, p);
1369 static HRESULT WINAPI HTMLStyle_put_letterSpacing(IHTMLStyle *iface, VARIANT v)
1371 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1373 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1375 return set_style_property_var(This, STYLEID_LETTER_SPACING, &v);
1378 static HRESULT WINAPI HTMLStyle_get_letterSpacing(IHTMLStyle *iface, VARIANT *p)
1380 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1381 TRACE("(%p)->(%p)\n", This, p);
1382 return get_style_property_var(This, STYLEID_LETTER_SPACING, p);
1385 static HRESULT WINAPI HTMLStyle_put_textDecoration(IHTMLStyle *iface, BSTR v)
1387 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1389 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1391 /* textDecoration can only be one of the following */
1392 if(!v || strcmpiW(styleNone, v) == 0 || strcmpiW(valUnderline, v) == 0 ||
1393 strcmpiW(valOverline, v) == 0 || strcmpiW(valLineThrough, v) == 0 ||
1394 strcmpiW(valBlink, v) == 0)
1396 return set_style_property(This, STYLEID_TEXT_DECORATION , v);
1399 return E_INVALIDARG;
1402 static HRESULT WINAPI HTMLStyle_get_textDecoration(IHTMLStyle *iface, BSTR *p)
1404 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1406 TRACE("(%p)->(%p)\n", This, p);
1408 return get_style_property(This, STYLEID_TEXT_DECORATION, p);
1411 static HRESULT WINAPI HTMLStyle_put_textDecorationNone(IHTMLStyle *iface, VARIANT_BOOL v)
1413 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1415 TRACE("(%p)->(%x)\n", This, v);
1417 return set_style_property(This, STYLEID_TEXT_DECORATION, v ? styleNone : emptyW);
1420 static HRESULT WINAPI HTMLStyle_get_textDecorationNone(IHTMLStyle *iface, VARIANT_BOOL *p)
1422 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1424 TRACE("(%p)->(%p)\n", This, p);
1426 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, styleNone, p);
1429 static HRESULT WINAPI HTMLStyle_put_textDecorationUnderline(IHTMLStyle *iface, VARIANT_BOOL v)
1431 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1433 TRACE("(%p)->(%x)\n", This, v);
1435 return set_style_property(This, STYLEID_TEXT_DECORATION, v ? valUnderline : emptyW);
1438 static HRESULT WINAPI HTMLStyle_get_textDecorationUnderline(IHTMLStyle *iface, VARIANT_BOOL *p)
1440 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1442 TRACE("(%p)->(%p)\n", This, p);
1444 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, valUnderline, p);
1447 static HRESULT WINAPI HTMLStyle_put_textDecorationOverline(IHTMLStyle *iface, VARIANT_BOOL v)
1449 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1451 TRACE("(%p)->(%x)\n", This, v);
1453 return set_style_property(This, STYLEID_TEXT_DECORATION, v ? valOverline : emptyW);
1456 static HRESULT WINAPI HTMLStyle_get_textDecorationOverline(IHTMLStyle *iface, VARIANT_BOOL *p)
1458 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1460 TRACE("(%p)->(%p)\n", This, p);
1462 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, valOverline, p);
1465 static HRESULT WINAPI HTMLStyle_put_textDecorationLineThrough(IHTMLStyle *iface, VARIANT_BOOL v)
1467 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1469 TRACE("(%p)->(%x)\n", This, v);
1471 return set_style_property(This, STYLEID_TEXT_DECORATION, v ? valLineThrough : emptyW);
1474 static HRESULT WINAPI HTMLStyle_get_textDecorationLineThrough(IHTMLStyle *iface, VARIANT_BOOL *p)
1476 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1478 TRACE("(%p)->(%p)\n", This, p);
1480 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, valLineThrough, p);
1483 static HRESULT WINAPI HTMLStyle_put_textDecorationBlink(IHTMLStyle *iface, VARIANT_BOOL v)
1485 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1487 TRACE("(%p)->(%x)\n", This, v);
1489 return set_style_property(This, STYLEID_TEXT_DECORATION, v ? valBlink : emptyW);
1492 static HRESULT WINAPI HTMLStyle_get_textDecorationBlink(IHTMLStyle *iface, VARIANT_BOOL *p)
1494 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1496 TRACE("(%p)->(%p)\n", This, p);
1498 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, valBlink, p);
1501 static HRESULT WINAPI HTMLStyle_put_verticalAlign(IHTMLStyle *iface, VARIANT v)
1503 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1505 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1507 return set_style_property_var(This, STYLEID_VERTICAL_ALIGN, &v);
1510 static HRESULT WINAPI HTMLStyle_get_verticalAlign(IHTMLStyle *iface, VARIANT *p)
1512 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1514 TRACE("(%p)->(%p)\n", This, p);
1516 return get_style_property_var(This, STYLEID_VERTICAL_ALIGN, p);
1519 static HRESULT WINAPI HTMLStyle_put_textTransform(IHTMLStyle *iface, BSTR v)
1521 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1523 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1525 return set_style_property(This, STYLEID_TEXT_TRANSFORM, v);
1528 static HRESULT WINAPI HTMLStyle_get_textTransform(IHTMLStyle *iface, BSTR *p)
1530 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1532 TRACE("(%p)->(%p)\n", This, p);
1534 return get_style_property(This, STYLEID_TEXT_TRANSFORM, p);
1537 static HRESULT WINAPI HTMLStyle_put_textAlign(IHTMLStyle *iface, BSTR v)
1539 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1541 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1543 return set_style_property(This, STYLEID_TEXT_ALIGN, v);
1546 static HRESULT WINAPI HTMLStyle_get_textAlign(IHTMLStyle *iface, BSTR *p)
1548 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1550 TRACE("(%p)->(%p)\n", This, p);
1552 return get_style_property(This, STYLEID_TEXT_ALIGN, p);
1555 static HRESULT WINAPI HTMLStyle_put_textIndent(IHTMLStyle *iface, VARIANT v)
1557 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1559 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1561 return set_style_property_var(This, STYLEID_TEXT_INDENT, &v);
1564 static HRESULT WINAPI HTMLStyle_get_textIndent(IHTMLStyle *iface, VARIANT *p)
1566 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1568 TRACE("(%p)->(%p)\n", This, p);
1570 return get_style_property_var(This, STYLEID_TEXT_INDENT, p);
1573 static HRESULT WINAPI HTMLStyle_put_lineHeight(IHTMLStyle *iface, VARIANT v)
1575 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1577 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1579 return set_style_property_var(This, STYLEID_LINE_HEIGHT, &v);
1582 static HRESULT WINAPI HTMLStyle_get_lineHeight(IHTMLStyle *iface, VARIANT *p)
1584 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1586 TRACE("(%p)->(%p)\n", This, p);
1588 return get_style_property_var(This, STYLEID_LINE_HEIGHT, p);
1591 static HRESULT WINAPI HTMLStyle_put_marginTop(IHTMLStyle *iface, VARIANT v)
1593 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1595 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1597 return set_style_property_var(This, STYLEID_MARGIN_TOP, &v);
1600 static HRESULT WINAPI HTMLStyle_get_marginTop(IHTMLStyle *iface, VARIANT *p)
1602 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1604 TRACE("(%p)->(%p)\n", This, p);
1606 return get_style_property_var(This, STYLEID_MARGIN_TOP, p);
1609 static HRESULT WINAPI HTMLStyle_put_marginRight(IHTMLStyle *iface, VARIANT v)
1611 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1613 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1615 return set_style_property_var(This, STYLEID_MARGIN_RIGHT, &v);
1618 static HRESULT WINAPI HTMLStyle_get_marginRight(IHTMLStyle *iface, VARIANT *p)
1620 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1621 TRACE("(%p)->(%p)\n", This, p);
1622 return get_style_property_var(This, STYLEID_MARGIN_RIGHT, p);
1625 static HRESULT WINAPI HTMLStyle_put_marginBottom(IHTMLStyle *iface, VARIANT v)
1627 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1629 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1631 return set_style_property_var(This, STYLEID_MARGIN_BOTTOM, &v);
1634 static HRESULT WINAPI HTMLStyle_get_marginBottom(IHTMLStyle *iface, VARIANT *p)
1636 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1638 TRACE("(%p)->(%p)\n", This, p);
1640 return get_style_property_var(This, STYLEID_MARGIN_BOTTOM, p);
1643 static HRESULT WINAPI HTMLStyle_put_marginLeft(IHTMLStyle *iface, VARIANT v)
1645 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1647 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1649 return set_style_property_var(This, STYLEID_MARGIN_LEFT, &v);
1652 static HRESULT WINAPI HTMLStyle_put_margin(IHTMLStyle *iface, BSTR v)
1654 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1656 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1658 return set_style_property(This, STYLEID_MARGIN, v);
1661 static HRESULT WINAPI HTMLStyle_get_margin(IHTMLStyle *iface, BSTR *p)
1663 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1665 TRACE("(%p)->(%p)\n", This, p);
1667 return get_style_property(This, STYLEID_MARGIN, p);
1670 static HRESULT WINAPI HTMLStyle_get_marginLeft(IHTMLStyle *iface, VARIANT *p)
1672 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1673 TRACE("(%p)->(%p)\n", This, p);
1674 return get_style_property_var(This, STYLEID_MARGIN_LEFT, p);
1677 static HRESULT WINAPI HTMLStyle_put_paddingTop(IHTMLStyle *iface, VARIANT v)
1679 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1681 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1683 return set_style_property_var(This, STYLEID_PADDING_TOP, &v);
1686 static HRESULT WINAPI HTMLStyle_get_paddingTop(IHTMLStyle *iface, VARIANT *p)
1688 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1690 TRACE("(%p)->(%p)\n", This, p);
1692 return get_style_property_var(This, STYLEID_PADDING_TOP, p);
1695 static HRESULT WINAPI HTMLStyle_put_paddingRight(IHTMLStyle *iface, VARIANT v)
1697 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1699 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1701 return set_style_property_var(This, STYLEID_PADDING_RIGHT, &v);
1704 static HRESULT WINAPI HTMLStyle_get_paddingRight(IHTMLStyle *iface, VARIANT *p)
1706 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1708 TRACE("(%p)->(%p)\n", This, p);
1710 return get_style_property_var(This, STYLEID_PADDING_RIGHT, p);
1713 static HRESULT WINAPI HTMLStyle_put_paddingBottom(IHTMLStyle *iface, VARIANT v)
1715 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1717 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1719 return set_style_property_var(This, STYLEID_PADDING_BOTTOM, &v);
1722 static HRESULT WINAPI HTMLStyle_get_paddingBottom(IHTMLStyle *iface, VARIANT *p)
1724 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1726 TRACE("(%p)->(%p)\n", This, p);
1728 return get_style_property_var(This, STYLEID_PADDING_BOTTOM, p);
1731 static HRESULT WINAPI HTMLStyle_put_paddingLeft(IHTMLStyle *iface, VARIANT v)
1733 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1735 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1737 return set_style_property_var(This, STYLEID_PADDING_LEFT, &v);
1740 static HRESULT WINAPI HTMLStyle_get_paddingLeft(IHTMLStyle *iface, VARIANT *p)
1742 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1744 TRACE("(%p)->(%p)\n", This, p);
1746 return get_style_property_var(This, STYLEID_PADDING_LEFT, p);
1749 static HRESULT WINAPI HTMLStyle_put_padding(IHTMLStyle *iface, BSTR v)
1751 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1753 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1755 return set_style_property(This, STYLEID_PADDING, v);
1758 static HRESULT WINAPI HTMLStyle_get_padding(IHTMLStyle *iface, BSTR *p)
1760 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1762 TRACE("(%p)->(%p)\n", This, p);
1764 return get_style_property(This, STYLEID_PADDING, p);
1767 static HRESULT WINAPI HTMLStyle_put_border(IHTMLStyle *iface, BSTR v)
1769 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1771 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1773 return set_style_property(This, STYLEID_BORDER, v);
1776 static HRESULT WINAPI HTMLStyle_get_border(IHTMLStyle *iface, BSTR *p)
1778 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1780 TRACE("(%p)->(%p)\n", This, p);
1782 return get_style_property(This, STYLEID_BORDER, p);
1785 static HRESULT WINAPI HTMLStyle_put_borderTop(IHTMLStyle *iface, BSTR v)
1787 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1788 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1789 return set_style_property(This, STYLEID_BORDER_TOP, v);
1792 static HRESULT WINAPI HTMLStyle_get_borderTop(IHTMLStyle *iface, BSTR *p)
1794 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1795 TRACE("(%p)->(%p)\n", This, p);
1796 return get_style_property(This, STYLEID_BORDER_TOP, p);
1799 static HRESULT WINAPI HTMLStyle_put_borderRight(IHTMLStyle *iface, BSTR v)
1801 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1802 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1803 return set_style_property(This, STYLEID_BORDER_RIGHT, v);
1806 static HRESULT WINAPI HTMLStyle_get_borderRight(IHTMLStyle *iface, BSTR *p)
1808 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1809 TRACE("(%p)->(%p)\n", This, p);
1810 return get_style_property(This, STYLEID_BORDER_RIGHT, p);
1813 static HRESULT WINAPI HTMLStyle_put_borderBottom(IHTMLStyle *iface, BSTR v)
1815 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1816 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1817 return set_style_property(This, STYLEID_BORDER_BOTTOM, v);
1820 static HRESULT WINAPI HTMLStyle_get_borderBottom(IHTMLStyle *iface, BSTR *p)
1822 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1823 TRACE("(%p)->(%p)\n", This, p);
1824 return get_style_property(This, STYLEID_BORDER_BOTTOM, p);
1827 static HRESULT WINAPI HTMLStyle_put_borderLeft(IHTMLStyle *iface, BSTR v)
1829 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1831 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1833 return set_style_property(This, STYLEID_BORDER_LEFT, v);
1836 static HRESULT WINAPI HTMLStyle_get_borderLeft(IHTMLStyle *iface, BSTR *p)
1838 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1840 TRACE("(%p)->(%p)\n", This, p);
1842 return get_style_property(This, STYLEID_BORDER_LEFT, p);
1845 static HRESULT WINAPI HTMLStyle_put_borderColor(IHTMLStyle *iface, BSTR v)
1847 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1849 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1851 return set_style_property(This, STYLEID_BORDER_COLOR, v);
1854 static HRESULT WINAPI HTMLStyle_get_borderColor(IHTMLStyle *iface, BSTR *p)
1856 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1858 TRACE("(%p)->(%p)\n", This, p);
1860 return get_style_property(This, STYLEID_BORDER_COLOR, p);
1863 static HRESULT WINAPI HTMLStyle_put_borderTopColor(IHTMLStyle *iface, VARIANT v)
1865 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1867 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1869 return set_style_property_var(This, STYLEID_BORDER_TOP_COLOR, &v);
1872 static HRESULT WINAPI HTMLStyle_get_borderTopColor(IHTMLStyle *iface, VARIANT *p)
1874 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1876 TRACE("(%p)->(%p)\n", This, p);
1878 return get_style_property_var(This, STYLEID_BORDER_TOP_COLOR, p);
1881 static HRESULT WINAPI HTMLStyle_put_borderRightColor(IHTMLStyle *iface, VARIANT v)
1883 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1885 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1887 return set_style_property_var(This, STYLEID_BORDER_RIGHT_COLOR, &v);
1890 static HRESULT WINAPI HTMLStyle_get_borderRightColor(IHTMLStyle *iface, VARIANT *p)
1892 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1894 TRACE("(%p)->(%p)\n", This, p);
1896 return get_style_property_var(This, STYLEID_BORDER_RIGHT_COLOR, p);
1899 static HRESULT WINAPI HTMLStyle_put_borderBottomColor(IHTMLStyle *iface, VARIANT v)
1901 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1903 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1905 return set_style_property_var(This, STYLEID_BORDER_BOTTOM_COLOR, &v);
1908 static HRESULT WINAPI HTMLStyle_get_borderBottomColor(IHTMLStyle *iface, VARIANT *p)
1910 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1912 TRACE("(%p)->(%p)\n", This, p);
1914 return get_style_property_var(This, STYLEID_BORDER_BOTTOM_COLOR, p);
1917 static HRESULT WINAPI HTMLStyle_put_borderLeftColor(IHTMLStyle *iface, VARIANT v)
1919 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1921 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1923 return set_style_property_var(This, STYLEID_BORDER_LEFT_COLOR, &v);
1926 static HRESULT WINAPI HTMLStyle_get_borderLeftColor(IHTMLStyle *iface, VARIANT *p)
1928 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1930 TRACE("(%p)->(%p)\n", This, p);
1932 return get_style_property_var(This, STYLEID_BORDER_LEFT_COLOR, p);
1935 static HRESULT WINAPI HTMLStyle_put_borderWidth(IHTMLStyle *iface, BSTR v)
1937 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1938 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1939 return set_style_property(This, STYLEID_BORDER_WIDTH, v);
1942 static HRESULT WINAPI HTMLStyle_get_borderWidth(IHTMLStyle *iface, BSTR *p)
1944 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1945 TRACE("(%p)->(%p)\n", This, p);
1946 return get_style_property(This, STYLEID_BORDER_WIDTH, p);
1949 static HRESULT WINAPI HTMLStyle_put_borderTopWidth(IHTMLStyle *iface, VARIANT v)
1951 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1953 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1955 return set_style_property_var(This, STYLEID_BORDER_TOP_WIDTH, &v);
1958 static HRESULT WINAPI HTMLStyle_get_borderTopWidth(IHTMLStyle *iface, VARIANT *p)
1960 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1962 TRACE("(%p)->(%p)\n", This, p);
1964 return get_style_property_var(This, STYLEID_BORDER_TOP_WIDTH, p);
1967 static HRESULT WINAPI HTMLStyle_put_borderRightWidth(IHTMLStyle *iface, VARIANT v)
1969 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1971 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1973 return set_style_property_var(This, STYLEID_BORDER_RIGHT_WIDTH, &v);
1976 static HRESULT WINAPI HTMLStyle_get_borderRightWidth(IHTMLStyle *iface, VARIANT *p)
1978 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1980 TRACE("(%p)->(%p)\n", This, p);
1982 return get_style_property_var(This, STYLEID_BORDER_RIGHT_WIDTH, p);
1985 static HRESULT WINAPI HTMLStyle_put_borderBottomWidth(IHTMLStyle *iface, VARIANT v)
1987 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1989 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1991 return set_style_property_var(This, STYLEID_BORDER_BOTTOM_WIDTH, &v);
1994 static HRESULT WINAPI HTMLStyle_get_borderBottomWidth(IHTMLStyle *iface, VARIANT *p)
1996 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1997 TRACE("(%p)->(%p)\n", This, p);
1998 return get_style_property_var(This, STYLEID_BORDER_BOTTOM_WIDTH, p);
2001 static HRESULT WINAPI HTMLStyle_put_borderLeftWidth(IHTMLStyle *iface, VARIANT v)
2003 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2005 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
2007 return set_style_property_var(This, STYLEID_BORDER_LEFT_WIDTH, &v);
2010 static HRESULT WINAPI HTMLStyle_get_borderLeftWidth(IHTMLStyle *iface, VARIANT *p)
2012 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2013 TRACE("(%p)->(%p)\n", This, p);
2014 return get_style_property_var(This, STYLEID_BORDER_LEFT_WIDTH, p);
2017 static HRESULT WINAPI HTMLStyle_put_borderStyle(IHTMLStyle *iface, BSTR v)
2019 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2020 static const WCHAR styleWindowInset[] = {'w','i','n','d','o','w','-','i','n','s','e','t',0};
2021 HRESULT hres = S_OK;
2022 BSTR pstyle;
2023 int i=0;
2024 int last = 0;
2026 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2028 while(v[i] && hres == S_OK)
2030 if(v[i] == (WCHAR)' ')
2032 pstyle = SysAllocStringLen(&v[last], (i-last));
2033 if( !(is_valid_border_style(pstyle) || strcmpiW(styleWindowInset, pstyle) == 0))
2035 TRACE("1. Invalid style (%s)\n", debugstr_w(pstyle));
2036 hres = E_INVALIDARG;
2038 SysFreeString(pstyle);
2039 last = i+1;
2041 i++;
2044 if(hres == S_OK)
2046 pstyle = SysAllocStringLen(&v[last], i-last);
2047 if( !(is_valid_border_style(pstyle) || strcmpiW(styleWindowInset, pstyle) == 0))
2049 TRACE("2. Invalid style (%s)\n", debugstr_w(pstyle));
2050 hres = E_INVALIDARG;
2052 SysFreeString(pstyle);
2055 if(hres == S_OK)
2056 hres = set_style_property(This, STYLEID_BORDER_STYLE, v);
2058 return hres;
2061 static HRESULT WINAPI HTMLStyle_get_borderStyle(IHTMLStyle *iface, BSTR *p)
2063 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2064 TRACE("(%p)->(%p)\n", This, p);
2065 return get_style_property(This, STYLEID_BORDER_STYLE, p);
2068 static HRESULT WINAPI HTMLStyle_put_borderTopStyle(IHTMLStyle *iface, BSTR v)
2070 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2071 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2073 if(!is_valid_border_style(v))
2074 return E_INVALIDARG;
2076 return set_style_property(This, STYLEID_BORDER_TOP_STYLE, v);
2079 static HRESULT WINAPI HTMLStyle_get_borderTopStyle(IHTMLStyle *iface, BSTR *p)
2081 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2082 TRACE("(%p)->(%p)\n", This, p);
2083 return get_style_property(This, STYLEID_BORDER_TOP_STYLE, p);
2086 static HRESULT WINAPI HTMLStyle_put_borderRightStyle(IHTMLStyle *iface, BSTR v)
2088 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2089 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2091 if(!is_valid_border_style(v))
2092 return E_INVALIDARG;
2094 return set_style_property(This, STYLEID_BORDER_RIGHT_STYLE, v);
2097 static HRESULT WINAPI HTMLStyle_get_borderRightStyle(IHTMLStyle *iface, BSTR *p)
2099 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2100 TRACE("(%p)->(%p)\n", This, p);
2101 return get_style_property(This, STYLEID_BORDER_RIGHT_STYLE, p);
2104 static HRESULT WINAPI HTMLStyle_put_borderBottomStyle(IHTMLStyle *iface, BSTR v)
2106 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2107 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2109 if(!is_valid_border_style(v))
2110 return E_INVALIDARG;
2112 return set_style_property(This, STYLEID_BORDER_BOTTOM_STYLE, v);
2115 static HRESULT WINAPI HTMLStyle_get_borderBottomStyle(IHTMLStyle *iface, BSTR *p)
2117 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2118 TRACE("(%p)->(%p)\n", This, p);
2119 return get_style_property(This, STYLEID_BORDER_BOTTOM_STYLE, p);
2122 static HRESULT WINAPI HTMLStyle_put_borderLeftStyle(IHTMLStyle *iface, BSTR v)
2124 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2125 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2127 if(!is_valid_border_style(v))
2128 return E_INVALIDARG;
2130 return set_style_property(This, STYLEID_BORDER_LEFT_STYLE, v);
2133 static HRESULT WINAPI HTMLStyle_get_borderLeftStyle(IHTMLStyle *iface, BSTR *p)
2135 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2136 TRACE("(%p)->(%p)\n", This, p);
2137 return get_style_property(This, STYLEID_BORDER_LEFT_STYLE, p);
2140 static HRESULT WINAPI HTMLStyle_put_width(IHTMLStyle *iface, VARIANT v)
2142 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2144 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
2146 return set_style_property_var(This, STYLEID_WIDTH, &v);
2149 static HRESULT WINAPI HTMLStyle_get_width(IHTMLStyle *iface, VARIANT *p)
2151 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2153 TRACE("(%p)->(%p)\n", This, p);
2155 return get_style_property_var(This, STYLEID_WIDTH, p);
2158 static HRESULT WINAPI HTMLStyle_put_height(IHTMLStyle *iface, VARIANT v)
2160 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2162 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
2164 return set_style_property_var(This, STYLEID_HEIGHT, &v);
2167 static HRESULT WINAPI HTMLStyle_get_height(IHTMLStyle *iface, VARIANT *p)
2169 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2171 TRACE("(%p)->(%p)\n", This, p);
2173 return get_style_property_var(This, STYLEID_HEIGHT, p);
2176 static HRESULT WINAPI HTMLStyle_put_styleFloat(IHTMLStyle *iface, BSTR v)
2178 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2180 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2182 return set_style_property(This, STYLEID_FLOAT, v);
2185 static HRESULT WINAPI HTMLStyle_get_styleFloat(IHTMLStyle *iface, BSTR *p)
2187 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2189 TRACE("(%p)->(%p)\n", This, p);
2191 return get_style_property(This, STYLEID_FLOAT, p);
2194 static HRESULT WINAPI HTMLStyle_put_clear(IHTMLStyle *iface, BSTR v)
2196 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2198 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2200 return set_style_property(This, STYLEID_CLEAR, v);
2203 static HRESULT WINAPI HTMLStyle_get_clear(IHTMLStyle *iface, BSTR *p)
2205 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2207 TRACE("(%p)->(%p)\n", This, p);
2209 return get_style_property(This, STYLEID_CLEAR, p);
2212 static HRESULT WINAPI HTMLStyle_put_display(IHTMLStyle *iface, BSTR v)
2214 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2216 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2218 return set_style_property(This, STYLEID_DISPLAY, v);
2221 static HRESULT WINAPI HTMLStyle_get_display(IHTMLStyle *iface, BSTR *p)
2223 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2225 TRACE("(%p)->(%p)\n", This, p);
2227 return get_style_property(This, STYLEID_DISPLAY, p);
2230 static HRESULT WINAPI HTMLStyle_put_visibility(IHTMLStyle *iface, BSTR v)
2232 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2234 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2236 return set_style_property(This, STYLEID_VISIBILITY, v);
2239 static HRESULT WINAPI HTMLStyle_get_visibility(IHTMLStyle *iface, BSTR *p)
2241 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2243 TRACE("(%p)->(%p)\n", This, p);
2245 return get_style_property(This, STYLEID_VISIBILITY, p);
2248 static HRESULT WINAPI HTMLStyle_put_listStyleType(IHTMLStyle *iface, BSTR v)
2250 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2252 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2254 return set_style_property(This, STYLEID_LISTSTYLETYPE, v);
2257 static HRESULT WINAPI HTMLStyle_get_listStyleType(IHTMLStyle *iface, BSTR *p)
2259 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2261 TRACE("(%p)->(%p)\n", This, p);
2263 return get_style_property(This, STYLEID_LISTSTYLETYPE, p);
2266 static HRESULT WINAPI HTMLStyle_put_listStylePosition(IHTMLStyle *iface, BSTR v)
2268 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2270 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2272 return set_style_property(This, STYLEID_LISTSTYLEPOSITION, v);
2275 static HRESULT WINAPI HTMLStyle_get_listStylePosition(IHTMLStyle *iface, BSTR *p)
2277 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2279 TRACE("(%p)->(%p)\n", This, p);
2281 return get_style_property(This, STYLEID_LISTSTYLEPOSITION, p);
2284 static HRESULT WINAPI HTMLStyle_put_listStyleImage(IHTMLStyle *iface, BSTR v)
2286 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2287 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
2288 return E_NOTIMPL;
2291 static HRESULT WINAPI HTMLStyle_get_listStyleImage(IHTMLStyle *iface, BSTR *p)
2293 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2294 FIXME("(%p)->(%p)\n", This, p);
2295 return E_NOTIMPL;
2298 static HRESULT WINAPI HTMLStyle_put_listStyle(IHTMLStyle *iface, BSTR v)
2300 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2302 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2304 return set_style_property(This, STYLEID_LIST_STYLE, v);
2307 static HRESULT WINAPI HTMLStyle_get_listStyle(IHTMLStyle *iface, BSTR *p)
2309 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2311 TRACE("(%p)->(%p)\n", This, p);
2313 return get_style_property(This, STYLEID_LIST_STYLE, p);
2316 static HRESULT WINAPI HTMLStyle_put_whiteSpace(IHTMLStyle *iface, BSTR v)
2318 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2320 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2322 return set_style_property(This, STYLEID_WHITE_SPACE, v);
2325 static HRESULT WINAPI HTMLStyle_get_whiteSpace(IHTMLStyle *iface, BSTR *p)
2327 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2329 TRACE("(%p)->(%p)\n", This, p);
2331 return get_style_property(This, STYLEID_WHITE_SPACE, p);
2334 static HRESULT WINAPI HTMLStyle_put_top(IHTMLStyle *iface, VARIANT v)
2336 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2338 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
2340 return set_style_property_var(This, STYLEID_TOP, &v);
2343 static HRESULT WINAPI HTMLStyle_get_top(IHTMLStyle *iface, VARIANT *p)
2345 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2347 TRACE("(%p)->(%p)\n", This, p);
2349 return get_style_property_var(This, STYLEID_TOP, p);
2352 static HRESULT WINAPI HTMLStyle_put_left(IHTMLStyle *iface, VARIANT v)
2354 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2356 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
2358 return set_style_property_var(This, STYLEID_LEFT, &v);
2361 static HRESULT WINAPI HTMLStyle_get_left(IHTMLStyle *iface, VARIANT *p)
2363 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2365 TRACE("(%p)->(%p)\n", This, p);
2367 return get_style_property_var(This, STYLEID_LEFT, p);
2370 static HRESULT WINAPI HTMLStyle_get_position(IHTMLStyle *iface, BSTR *p)
2372 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2373 TRACE("(%p)->(%p)\n", This, p);
2374 return IHTMLStyle2_get_position(&This->IHTMLStyle2_iface, p);
2377 static HRESULT WINAPI HTMLStyle_put_zIndex(IHTMLStyle *iface, VARIANT v)
2379 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2381 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
2383 return set_style_property_var(This, STYLEID_Z_INDEX, &v);
2386 static HRESULT WINAPI HTMLStyle_get_zIndex(IHTMLStyle *iface, VARIANT *p)
2388 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2390 TRACE("(%p)->(%p)\n", This, p);
2392 return get_style_property_var(This, STYLEID_Z_INDEX, p);
2395 static HRESULT WINAPI HTMLStyle_put_overflow(IHTMLStyle *iface, BSTR v)
2397 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2398 static const WCHAR szVisible[] = {'v','i','s','i','b','l','e',0};
2399 static const WCHAR szScroll[] = {'s','c','r','o','l','l',0};
2400 static const WCHAR szHidden[] = {'h','i','d','d','e','n',0};
2401 static const WCHAR szAuto[] = {'a','u','t','o',0};
2403 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2405 /* overflow can only be one of the follow values. */
2406 if(!v || !*v || strcmpiW(szVisible, v) == 0 || strcmpiW(szScroll, v) == 0 ||
2407 strcmpiW(szHidden, v) == 0 || strcmpiW(szAuto, v) == 0)
2409 return set_style_property(This, STYLEID_OVERFLOW, v);
2412 return E_INVALIDARG;
2416 static HRESULT WINAPI HTMLStyle_get_overflow(IHTMLStyle *iface, BSTR *p)
2418 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2420 TRACE("(%p)->(%p)\n", This, p);
2422 if(!p)
2423 return E_INVALIDARG;
2425 return get_style_property(This, STYLEID_OVERFLOW, p);
2428 static HRESULT WINAPI HTMLStyle_put_pageBreakBefore(IHTMLStyle *iface, BSTR v)
2430 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2432 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2434 return set_style_property(This, STYLEID_PAGE_BREAK_BEFORE, v);
2437 static HRESULT WINAPI HTMLStyle_get_pageBreakBefore(IHTMLStyle *iface, BSTR *p)
2439 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2441 TRACE("(%p)->(%p)\n", This, p);
2443 return get_style_property(This, STYLEID_PAGE_BREAK_BEFORE, p);
2446 static HRESULT WINAPI HTMLStyle_put_pageBreakAfter(IHTMLStyle *iface, BSTR v)
2448 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2450 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2452 return set_style_property(This, STYLEID_PAGE_BREAK_AFTER, v);
2455 static HRESULT WINAPI HTMLStyle_get_pageBreakAfter(IHTMLStyle *iface, BSTR *p)
2457 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2459 TRACE("(%p)->(%p)\n", This, p);
2461 return get_style_property(This, STYLEID_PAGE_BREAK_AFTER, p);
2464 static HRESULT WINAPI HTMLStyle_put_cssText(IHTMLStyle *iface, BSTR v)
2466 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2467 nsAString text_str;
2468 nsresult nsres;
2470 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2472 nsAString_InitDepend(&text_str, v);
2473 nsres = nsIDOMCSSStyleDeclaration_SetCssText(This->nsstyle, &text_str);
2474 nsAString_Finish(&text_str);
2475 if(NS_FAILED(nsres)) {
2476 FIXME("SetCssStyle failed: %08x\n", nsres);
2477 return E_FAIL;
2480 return S_OK;
2483 static HRESULT WINAPI HTMLStyle_get_cssText(IHTMLStyle *iface, BSTR *p)
2485 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2486 nsAString text_str;
2487 nsresult nsres;
2489 TRACE("(%p)->(%p)\n", This, p);
2491 /* FIXME: Gecko style formatting is different than IE (uppercase). */
2492 nsAString_Init(&text_str, NULL);
2493 nsres = nsIDOMCSSStyleDeclaration_GetCssText(This->nsstyle, &text_str);
2494 if(NS_SUCCEEDED(nsres)) {
2495 const PRUnichar *text;
2497 nsAString_GetData(&text_str, &text);
2498 *p = *text ? SysAllocString(text) : NULL;
2499 }else {
2500 FIXME("GetCssStyle failed: %08x\n", nsres);
2501 *p = NULL;
2504 nsAString_Finish(&text_str);
2505 return S_OK;
2508 static HRESULT WINAPI HTMLStyle_put_pixelTop(IHTMLStyle *iface, LONG v)
2510 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2512 TRACE("(%p)->(%d)\n", This, v);
2514 return set_style_pxattr(This, STYLEID_TOP, v);
2517 static HRESULT WINAPI HTMLStyle_get_pixelTop(IHTMLStyle *iface, LONG *p)
2519 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2521 TRACE("(%p)->(%p)\n", This, p);
2523 return get_nsstyle_pixel_val(This, STYLEID_TOP, p);
2526 static HRESULT WINAPI HTMLStyle_put_pixelLeft(IHTMLStyle *iface, LONG v)
2528 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2530 TRACE("(%p)->(%d)\n", This, v);
2532 return set_style_pxattr(This, STYLEID_LEFT, v);
2535 static HRESULT WINAPI HTMLStyle_get_pixelLeft(IHTMLStyle *iface, LONG *p)
2537 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2539 TRACE("(%p)->(%p)\n", This, p);
2541 return get_nsstyle_pixel_val(This, STYLEID_LEFT, p);
2544 static HRESULT WINAPI HTMLStyle_put_pixelWidth(IHTMLStyle *iface, LONG v)
2546 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2548 TRACE("(%p)->()\n", This);
2550 return set_style_pxattr(This, STYLEID_WIDTH, v);
2553 static HRESULT WINAPI HTMLStyle_get_pixelWidth(IHTMLStyle *iface, LONG *p)
2555 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2557 TRACE("(%p)->(%p)\n", This, p);
2559 return get_nsstyle_pixel_val(This, STYLEID_WIDTH, p);
2562 static HRESULT WINAPI HTMLStyle_put_pixelHeight(IHTMLStyle *iface, LONG v)
2564 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2566 TRACE("(%p)->(%d)\n", This, v);
2568 return set_style_pxattr(This, STYLEID_HEIGHT, v);
2571 static HRESULT WINAPI HTMLStyle_get_pixelHeight(IHTMLStyle *iface, LONG *p)
2573 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2575 TRACE("(%p)->(%p)\n", This, p);
2577 return get_nsstyle_pixel_val(This, STYLEID_HEIGHT, p);
2580 static HRESULT WINAPI HTMLStyle_put_posTop(IHTMLStyle *iface, float v)
2582 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2584 TRACE("(%p)->(%f)\n", This, v);
2586 return set_style_pos(This, STYLEID_TOP, v);
2589 static HRESULT WINAPI HTMLStyle_get_posTop(IHTMLStyle *iface, float *p)
2591 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2593 TRACE("(%p)->(%p)\n", This, p);
2595 if(!p)
2596 return E_POINTER;
2598 return get_nsstyle_pos(This, STYLEID_TOP, p);
2601 static HRESULT WINAPI HTMLStyle_put_posLeft(IHTMLStyle *iface, float v)
2603 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2605 TRACE("(%p)->(%f)\n", This, v);
2607 return set_style_pos(This, STYLEID_LEFT, v);
2610 static HRESULT WINAPI HTMLStyle_get_posLeft(IHTMLStyle *iface, float *p)
2612 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2614 TRACE("(%p)->(%p)\n", This, p);
2616 if(!p)
2617 return E_POINTER;
2619 return get_nsstyle_pos(This, STYLEID_LEFT, p);
2622 static HRESULT WINAPI HTMLStyle_put_posWidth(IHTMLStyle *iface, float v)
2624 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2626 TRACE("(%p)->(%f)\n", This, v);
2628 return set_style_pos(This, STYLEID_WIDTH, v);
2631 static HRESULT WINAPI HTMLStyle_get_posWidth(IHTMLStyle *iface, float *p)
2633 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2635 TRACE("(%p)->(%p)\n", This, p);
2637 if(!p)
2638 return E_POINTER;
2640 if(get_nsstyle_pos(This, STYLEID_WIDTH, p) != S_OK)
2641 *p = 0.0f;
2643 return S_OK;
2646 static HRESULT WINAPI HTMLStyle_put_posHeight(IHTMLStyle *iface, float v)
2648 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2650 TRACE("(%p)->(%f)\n", This, v);
2652 return set_style_pos(This, STYLEID_HEIGHT, v);
2655 static HRESULT WINAPI HTMLStyle_get_posHeight(IHTMLStyle *iface, float *p)
2657 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2659 TRACE("(%p)->(%p)\n", This, p);
2661 if(!p)
2662 return E_POINTER;
2664 if(get_nsstyle_pos(This, STYLEID_HEIGHT, p) != S_OK)
2665 *p = 0.0f;
2667 return S_OK;
2670 static HRESULT WINAPI HTMLStyle_put_cursor(IHTMLStyle *iface, BSTR v)
2672 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2674 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2676 return set_style_property(This, STYLEID_CURSOR, v);
2679 static HRESULT WINAPI HTMLStyle_get_cursor(IHTMLStyle *iface, BSTR *p)
2681 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2683 TRACE("(%p)->(%p)\n", This, p);
2685 return get_style_property(This, STYLEID_CURSOR, p);
2688 static HRESULT WINAPI HTMLStyle_put_clip(IHTMLStyle *iface, BSTR v)
2690 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2692 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2694 return set_style_property(This, STYLEID_CLIP, v);
2697 static HRESULT WINAPI HTMLStyle_get_clip(IHTMLStyle *iface, BSTR *p)
2699 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2701 TRACE("(%p)->(%p)\n", This, p);
2703 return get_style_property(This, STYLEID_CLIP, p);
2706 static void set_opacity(HTMLStyle *This, const WCHAR *val)
2708 nsAString name_str, val_str, empty_str;
2709 nsresult nsres;
2711 static const WCHAR opacityW[] = {'o','p','a','c','i','t','y',0};
2713 TRACE("%s\n", debugstr_w(val));
2715 nsAString_InitDepend(&name_str, opacityW);
2716 nsAString_InitDepend(&val_str, val);
2717 nsAString_InitDepend(&empty_str, emptyW);
2719 nsres = nsIDOMCSSStyleDeclaration_SetProperty(This->nsstyle, &name_str, &val_str, &empty_str);
2720 if(NS_FAILED(nsres))
2721 ERR("SetProperty failed: %08x\n", nsres);
2723 nsAString_Finish(&name_str);
2724 nsAString_Finish(&val_str);
2725 nsAString_Finish(&empty_str);
2728 static void update_filter(HTMLStyle *This)
2730 const WCHAR *ptr, *ptr2;
2732 static const WCHAR alphaW[] = {'a','l','p','h','a'};
2734 if(get_style_compat_mode(This) >= COMPAT_MODE_IE10)
2735 return;
2737 ptr = This->elem->filter;
2738 TRACE("%s\n", debugstr_w(ptr));
2739 if(!ptr) {
2740 set_opacity(This, emptyW);
2741 return;
2744 while(1) {
2745 while(isspaceW(*ptr))
2746 ptr++;
2747 if(!*ptr)
2748 break;
2750 ptr2 = ptr;
2751 while(isalnumW(*ptr))
2752 ptr++;
2753 if(ptr == ptr2) {
2754 WARN("unexpected char '%c'\n", *ptr);
2755 break;
2757 if(*ptr != '(') {
2758 WARN("expected '('\n");
2759 continue;
2762 if(ptr2 + ARRAY_SIZE(alphaW) == ptr && !memcmp(ptr2, alphaW, sizeof(alphaW))) {
2763 static const WCHAR formatW[] = {'%','f',0};
2764 static const WCHAR opacityW[] = {'o','p','a','c','i','t','y','='};
2766 ptr++;
2767 do {
2768 while(isspaceW(*ptr))
2769 ptr++;
2771 ptr2 = ptr;
2772 while(*ptr && *ptr != ',' && *ptr != ')')
2773 ptr++;
2774 if(!*ptr) {
2775 WARN("unexpected end of string\n");
2776 break;
2779 if(ptr-ptr2 > ARRAY_SIZE(opacityW) && !memcmp(ptr2, opacityW, sizeof(opacityW))) {
2780 float fval = 0.0f, e = 0.1f;
2781 WCHAR buf[32];
2783 ptr2 += ARRAY_SIZE(opacityW);
2785 while(isdigitW(*ptr2))
2786 fval = fval*10.0f + (float)(*ptr2++ - '0');
2788 if(*ptr2 == '.') {
2789 while(isdigitW(*++ptr2)) {
2790 fval += e * (float)(*ptr2++ - '0');
2791 e *= 0.1f;
2795 sprintfW(buf, formatW, fval * 0.01f);
2796 set_opacity(This, buf);
2797 }else {
2798 FIXME("unknown param %s\n", debugstr_wn(ptr2, ptr-ptr2));
2801 if(*ptr == ',')
2802 ptr++;
2803 }while(*ptr != ')');
2804 }else {
2805 FIXME("unknown filter %s\n", debugstr_wn(ptr2, ptr-ptr2));
2806 ptr = strchrW(ptr, ')');
2807 if(!ptr)
2808 break;
2809 ptr++;
2814 static HRESULT WINAPI HTMLStyle_put_filter(IHTMLStyle *iface, BSTR v)
2816 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2817 WCHAR *new_filter = NULL;
2819 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2821 if(!This->elem) {
2822 FIXME("Element already destroyed\n");
2823 return E_UNEXPECTED;
2826 if(v) {
2827 new_filter = heap_strdupW(v);
2828 if(!new_filter)
2829 return E_OUTOFMEMORY;
2832 heap_free(This->elem->filter);
2833 This->elem->filter = new_filter;
2835 update_filter(This);
2836 return S_OK;
2839 static HRESULT WINAPI HTMLStyle_get_filter(IHTMLStyle *iface, BSTR *p)
2841 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2843 TRACE("(%p)->(%p)\n", This, p);
2845 if(!This->elem) {
2846 FIXME("Element already destroyed\n");
2847 return E_UNEXPECTED;
2850 if(This->elem->filter) {
2851 *p = SysAllocString(This->elem->filter);
2852 if(!*p)
2853 return E_OUTOFMEMORY;
2854 }else {
2855 *p = NULL;
2858 return S_OK;
2861 static HRESULT WINAPI HTMLStyle_setAttribute(IHTMLStyle *iface, BSTR strAttributeName,
2862 VARIANT AttributeValue, LONG lFlags)
2864 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2865 HRESULT hres;
2866 DISPID dispid;
2868 TRACE("(%p)->(%s %s %08x)\n", This, debugstr_w(strAttributeName),
2869 debugstr_variant(&AttributeValue), lFlags);
2871 if(!strAttributeName)
2872 return E_INVALIDARG;
2874 if(lFlags == 1)
2875 FIXME("Parameter lFlags ignored\n");
2877 hres = HTMLStyle_GetIDsOfNames(iface, &IID_NULL, &strAttributeName, 1,
2878 LOCALE_USER_DEFAULT, &dispid);
2879 if(hres == S_OK)
2881 VARIANT ret;
2882 DISPID dispidNamed = DISPID_PROPERTYPUT;
2883 DISPPARAMS params;
2885 params.cArgs = 1;
2886 params.rgvarg = &AttributeValue;
2887 params.cNamedArgs = 1;
2888 params.rgdispidNamedArgs = &dispidNamed;
2890 hres = HTMLStyle_Invoke(iface, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
2891 DISPATCH_PROPERTYPUT, &params, &ret, NULL, NULL);
2893 else
2895 FIXME("Custom attributes not supported.\n");
2898 TRACE("ret: %08x\n", hres);
2900 return hres;
2903 static HRESULT WINAPI HTMLStyle_getAttribute(IHTMLStyle *iface, BSTR strAttributeName,
2904 LONG lFlags, VARIANT *AttributeValue)
2906 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2907 HRESULT hres;
2908 DISPID dispid;
2910 TRACE("(%p)->(%s v%p %08x)\n", This, debugstr_w(strAttributeName),
2911 AttributeValue, lFlags);
2913 if(!AttributeValue || !strAttributeName)
2914 return E_INVALIDARG;
2916 if(lFlags == 1)
2917 FIXME("Parameter lFlags ignored\n");
2919 hres = HTMLStyle_GetIDsOfNames(iface, &IID_NULL, &strAttributeName, 1,
2920 LOCALE_USER_DEFAULT, &dispid);
2921 if(hres == S_OK)
2923 DISPPARAMS params = {NULL, NULL, 0, 0 };
2925 hres = HTMLStyle_Invoke(iface, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
2926 DISPATCH_PROPERTYGET, &params, AttributeValue, NULL, NULL);
2928 else
2930 FIXME("Custom attributes not supported.\n");
2933 return hres;
2936 static HRESULT WINAPI HTMLStyle_removeAttribute(IHTMLStyle *iface, BSTR strAttributeName,
2937 LONG lFlags, VARIANT_BOOL *pfSuccess)
2939 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2940 const style_tbl_entry_t *style_entry;
2941 nsAString name_str, ret_str;
2942 nsresult nsres;
2943 HRESULT hres;
2945 TRACE("(%p)->(%s %08x %p)\n", This, debugstr_w(strAttributeName), lFlags, pfSuccess);
2947 style_entry = lookup_style_tbl(strAttributeName);
2948 if(!style_entry) {
2949 DISPID dispid;
2950 unsigned i;
2952 hres = IDispatchEx_GetDispID(&This->dispex.IDispatchEx_iface, strAttributeName,
2953 (lFlags&1) ? fdexNameCaseSensitive : fdexNameCaseInsensitive, &dispid);
2954 if(hres != S_OK) {
2955 *pfSuccess = VARIANT_FALSE;
2956 return S_OK;
2959 for(i=0; i < ARRAY_SIZE(style_tbl); i++) {
2960 if(dispid == style_tbl[i].dispid)
2961 break;
2964 if(i == ARRAY_SIZE(style_tbl))
2965 return remove_attribute(&This->dispex, dispid, pfSuccess);
2966 style_entry = style_tbl+i;
2969 /* filter property is a special case */
2970 if(style_entry->dispid == DISPID_IHTMLSTYLE_FILTER) {
2971 *pfSuccess = variant_bool(This->elem->filter && *This->elem->filter);
2972 heap_free(This->elem->filter);
2973 This->elem->filter = NULL;
2974 update_filter(This);
2975 return S_OK;
2978 nsAString_InitDepend(&name_str, style_entry->name);
2979 nsAString_Init(&ret_str, NULL);
2980 nsres = nsIDOMCSSStyleDeclaration_RemoveProperty(This->nsstyle, &name_str, &ret_str);
2981 if(NS_SUCCEEDED(nsres)) {
2982 const PRUnichar *ret;
2983 nsAString_GetData(&ret_str, &ret);
2984 *pfSuccess = variant_bool(*ret);
2985 }else {
2986 ERR("RemoveProperty failed: %08x\n", nsres);
2988 nsAString_Finish(&name_str);
2989 nsAString_Finish(&ret_str);
2990 return NS_SUCCEEDED(nsres) ? S_OK : E_FAIL;
2993 static HRESULT WINAPI HTMLStyle_toString(IHTMLStyle *iface, BSTR *String)
2995 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2996 FIXME("(%p)->(%p)\n", This, String);
2997 return E_NOTIMPL;
3000 static const IHTMLStyleVtbl HTMLStyleVtbl = {
3001 HTMLStyle_QueryInterface,
3002 HTMLStyle_AddRef,
3003 HTMLStyle_Release,
3004 HTMLStyle_GetTypeInfoCount,
3005 HTMLStyle_GetTypeInfo,
3006 HTMLStyle_GetIDsOfNames,
3007 HTMLStyle_Invoke,
3008 HTMLStyle_put_fontFamily,
3009 HTMLStyle_get_fontFamily,
3010 HTMLStyle_put_fontStyle,
3011 HTMLStyle_get_fontStyle,
3012 HTMLStyle_put_fontVariant,
3013 HTMLStyle_get_fontVariant,
3014 HTMLStyle_put_fontWeight,
3015 HTMLStyle_get_fontWeight,
3016 HTMLStyle_put_fontSize,
3017 HTMLStyle_get_fontSize,
3018 HTMLStyle_put_font,
3019 HTMLStyle_get_font,
3020 HTMLStyle_put_color,
3021 HTMLStyle_get_color,
3022 HTMLStyle_put_background,
3023 HTMLStyle_get_background,
3024 HTMLStyle_put_backgroundColor,
3025 HTMLStyle_get_backgroundColor,
3026 HTMLStyle_put_backgroundImage,
3027 HTMLStyle_get_backgroundImage,
3028 HTMLStyle_put_backgroundRepeat,
3029 HTMLStyle_get_backgroundRepeat,
3030 HTMLStyle_put_backgroundAttachment,
3031 HTMLStyle_get_backgroundAttachment,
3032 HTMLStyle_put_backgroundPosition,
3033 HTMLStyle_get_backgroundPosition,
3034 HTMLStyle_put_backgroundPositionX,
3035 HTMLStyle_get_backgroundPositionX,
3036 HTMLStyle_put_backgroundPositionY,
3037 HTMLStyle_get_backgroundPositionY,
3038 HTMLStyle_put_wordSpacing,
3039 HTMLStyle_get_wordSpacing,
3040 HTMLStyle_put_letterSpacing,
3041 HTMLStyle_get_letterSpacing,
3042 HTMLStyle_put_textDecoration,
3043 HTMLStyle_get_textDecoration,
3044 HTMLStyle_put_textDecorationNone,
3045 HTMLStyle_get_textDecorationNone,
3046 HTMLStyle_put_textDecorationUnderline,
3047 HTMLStyle_get_textDecorationUnderline,
3048 HTMLStyle_put_textDecorationOverline,
3049 HTMLStyle_get_textDecorationOverline,
3050 HTMLStyle_put_textDecorationLineThrough,
3051 HTMLStyle_get_textDecorationLineThrough,
3052 HTMLStyle_put_textDecorationBlink,
3053 HTMLStyle_get_textDecorationBlink,
3054 HTMLStyle_put_verticalAlign,
3055 HTMLStyle_get_verticalAlign,
3056 HTMLStyle_put_textTransform,
3057 HTMLStyle_get_textTransform,
3058 HTMLStyle_put_textAlign,
3059 HTMLStyle_get_textAlign,
3060 HTMLStyle_put_textIndent,
3061 HTMLStyle_get_textIndent,
3062 HTMLStyle_put_lineHeight,
3063 HTMLStyle_get_lineHeight,
3064 HTMLStyle_put_marginTop,
3065 HTMLStyle_get_marginTop,
3066 HTMLStyle_put_marginRight,
3067 HTMLStyle_get_marginRight,
3068 HTMLStyle_put_marginBottom,
3069 HTMLStyle_get_marginBottom,
3070 HTMLStyle_put_marginLeft,
3071 HTMLStyle_get_marginLeft,
3072 HTMLStyle_put_margin,
3073 HTMLStyle_get_margin,
3074 HTMLStyle_put_paddingTop,
3075 HTMLStyle_get_paddingTop,
3076 HTMLStyle_put_paddingRight,
3077 HTMLStyle_get_paddingRight,
3078 HTMLStyle_put_paddingBottom,
3079 HTMLStyle_get_paddingBottom,
3080 HTMLStyle_put_paddingLeft,
3081 HTMLStyle_get_paddingLeft,
3082 HTMLStyle_put_padding,
3083 HTMLStyle_get_padding,
3084 HTMLStyle_put_border,
3085 HTMLStyle_get_border,
3086 HTMLStyle_put_borderTop,
3087 HTMLStyle_get_borderTop,
3088 HTMLStyle_put_borderRight,
3089 HTMLStyle_get_borderRight,
3090 HTMLStyle_put_borderBottom,
3091 HTMLStyle_get_borderBottom,
3092 HTMLStyle_put_borderLeft,
3093 HTMLStyle_get_borderLeft,
3094 HTMLStyle_put_borderColor,
3095 HTMLStyle_get_borderColor,
3096 HTMLStyle_put_borderTopColor,
3097 HTMLStyle_get_borderTopColor,
3098 HTMLStyle_put_borderRightColor,
3099 HTMLStyle_get_borderRightColor,
3100 HTMLStyle_put_borderBottomColor,
3101 HTMLStyle_get_borderBottomColor,
3102 HTMLStyle_put_borderLeftColor,
3103 HTMLStyle_get_borderLeftColor,
3104 HTMLStyle_put_borderWidth,
3105 HTMLStyle_get_borderWidth,
3106 HTMLStyle_put_borderTopWidth,
3107 HTMLStyle_get_borderTopWidth,
3108 HTMLStyle_put_borderRightWidth,
3109 HTMLStyle_get_borderRightWidth,
3110 HTMLStyle_put_borderBottomWidth,
3111 HTMLStyle_get_borderBottomWidth,
3112 HTMLStyle_put_borderLeftWidth,
3113 HTMLStyle_get_borderLeftWidth,
3114 HTMLStyle_put_borderStyle,
3115 HTMLStyle_get_borderStyle,
3116 HTMLStyle_put_borderTopStyle,
3117 HTMLStyle_get_borderTopStyle,
3118 HTMLStyle_put_borderRightStyle,
3119 HTMLStyle_get_borderRightStyle,
3120 HTMLStyle_put_borderBottomStyle,
3121 HTMLStyle_get_borderBottomStyle,
3122 HTMLStyle_put_borderLeftStyle,
3123 HTMLStyle_get_borderLeftStyle,
3124 HTMLStyle_put_width,
3125 HTMLStyle_get_width,
3126 HTMLStyle_put_height,
3127 HTMLStyle_get_height,
3128 HTMLStyle_put_styleFloat,
3129 HTMLStyle_get_styleFloat,
3130 HTMLStyle_put_clear,
3131 HTMLStyle_get_clear,
3132 HTMLStyle_put_display,
3133 HTMLStyle_get_display,
3134 HTMLStyle_put_visibility,
3135 HTMLStyle_get_visibility,
3136 HTMLStyle_put_listStyleType,
3137 HTMLStyle_get_listStyleType,
3138 HTMLStyle_put_listStylePosition,
3139 HTMLStyle_get_listStylePosition,
3140 HTMLStyle_put_listStyleImage,
3141 HTMLStyle_get_listStyleImage,
3142 HTMLStyle_put_listStyle,
3143 HTMLStyle_get_listStyle,
3144 HTMLStyle_put_whiteSpace,
3145 HTMLStyle_get_whiteSpace,
3146 HTMLStyle_put_top,
3147 HTMLStyle_get_top,
3148 HTMLStyle_put_left,
3149 HTMLStyle_get_left,
3150 HTMLStyle_get_position,
3151 HTMLStyle_put_zIndex,
3152 HTMLStyle_get_zIndex,
3153 HTMLStyle_put_overflow,
3154 HTMLStyle_get_overflow,
3155 HTMLStyle_put_pageBreakBefore,
3156 HTMLStyle_get_pageBreakBefore,
3157 HTMLStyle_put_pageBreakAfter,
3158 HTMLStyle_get_pageBreakAfter,
3159 HTMLStyle_put_cssText,
3160 HTMLStyle_get_cssText,
3161 HTMLStyle_put_pixelTop,
3162 HTMLStyle_get_pixelTop,
3163 HTMLStyle_put_pixelLeft,
3164 HTMLStyle_get_pixelLeft,
3165 HTMLStyle_put_pixelWidth,
3166 HTMLStyle_get_pixelWidth,
3167 HTMLStyle_put_pixelHeight,
3168 HTMLStyle_get_pixelHeight,
3169 HTMLStyle_put_posTop,
3170 HTMLStyle_get_posTop,
3171 HTMLStyle_put_posLeft,
3172 HTMLStyle_get_posLeft,
3173 HTMLStyle_put_posWidth,
3174 HTMLStyle_get_posWidth,
3175 HTMLStyle_put_posHeight,
3176 HTMLStyle_get_posHeight,
3177 HTMLStyle_put_cursor,
3178 HTMLStyle_get_cursor,
3179 HTMLStyle_put_clip,
3180 HTMLStyle_get_clip,
3181 HTMLStyle_put_filter,
3182 HTMLStyle_get_filter,
3183 HTMLStyle_setAttribute,
3184 HTMLStyle_getAttribute,
3185 HTMLStyle_removeAttribute,
3186 HTMLStyle_toString
3189 static inline HTMLStyle *impl_from_IHTMLStyle2(IHTMLStyle2 *iface)
3191 return CONTAINING_RECORD(iface, HTMLStyle, IHTMLStyle2_iface);
3194 static HRESULT WINAPI HTMLStyle2_QueryInterface(IHTMLStyle2 *iface, REFIID riid, void **ppv)
3196 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3198 return IHTMLStyle_QueryInterface(&This->IHTMLStyle_iface, riid, ppv);
3201 static ULONG WINAPI HTMLStyle2_AddRef(IHTMLStyle2 *iface)
3203 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3205 return IHTMLStyle_AddRef(&This->IHTMLStyle_iface);
3208 static ULONG WINAPI HTMLStyle2_Release(IHTMLStyle2 *iface)
3210 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3212 return IHTMLStyle_Release(&This->IHTMLStyle_iface);
3215 static HRESULT WINAPI HTMLStyle2_GetTypeInfoCount(IHTMLStyle2 *iface, UINT *pctinfo)
3217 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3218 return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
3221 static HRESULT WINAPI HTMLStyle2_GetTypeInfo(IHTMLStyle2 *iface, UINT iTInfo,
3222 LCID lcid, ITypeInfo **ppTInfo)
3224 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3225 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
3228 static HRESULT WINAPI HTMLStyle2_GetIDsOfNames(IHTMLStyle2 *iface, REFIID riid,
3229 LPOLESTR *rgszNames, UINT cNames,
3230 LCID lcid, DISPID *rgDispId)
3232 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3233 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
3234 lcid, rgDispId);
3237 static HRESULT WINAPI HTMLStyle2_Invoke(IHTMLStyle2 *iface, DISPID dispIdMember,
3238 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
3239 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
3241 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3242 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
3243 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
3246 static HRESULT WINAPI HTMLStyle2_put_tableLayout(IHTMLStyle2 *iface, BSTR v)
3248 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3250 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
3252 return set_style_property(This, STYLEID_TABLE_LAYOUT, v);
3255 static HRESULT WINAPI HTMLStyle2_get_tableLayout(IHTMLStyle2 *iface, BSTR *p)
3257 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3259 TRACE("(%p)->(%p)\n", This, p);
3261 return get_style_property(This, STYLEID_TABLE_LAYOUT, p);
3264 static HRESULT WINAPI HTMLStyle2_put_borderCollapse(IHTMLStyle2 *iface, BSTR v)
3266 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3267 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3268 return E_NOTIMPL;
3271 static HRESULT WINAPI HTMLStyle2_get_borderCollapse(IHTMLStyle2 *iface, BSTR *p)
3273 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3274 FIXME("(%p)->(%p)\n", This, p);
3275 return E_NOTIMPL;
3278 static HRESULT WINAPI HTMLStyle2_put_direction(IHTMLStyle2 *iface, BSTR v)
3280 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3282 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
3284 return set_style_property(This, STYLEID_DIRECTION, v);
3287 static HRESULT WINAPI HTMLStyle2_get_direction(IHTMLStyle2 *iface, BSTR *p)
3289 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3291 TRACE("(%p)->(%p)\n", This, p);
3293 return get_style_property(This, STYLEID_DIRECTION, p);
3296 static HRESULT WINAPI HTMLStyle2_put_behavior(IHTMLStyle2 *iface, BSTR v)
3298 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3299 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3300 return S_OK;
3303 static HRESULT WINAPI HTMLStyle2_get_behavior(IHTMLStyle2 *iface, BSTR *p)
3305 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3306 FIXME("(%p)->(%p)\n", This, p);
3307 return E_NOTIMPL;
3310 static HRESULT WINAPI HTMLStyle2_setExpression(IHTMLStyle2 *iface, BSTR propname, BSTR expression, BSTR language)
3312 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3313 FIXME("(%p)->(%s %s %s)\n", This, debugstr_w(propname), debugstr_w(expression), debugstr_w(language));
3314 return E_NOTIMPL;
3317 static HRESULT WINAPI HTMLStyle2_getExpression(IHTMLStyle2 *iface, BSTR propname, VARIANT *expression)
3319 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3320 FIXME("(%p)->(%s %p)\n", This, debugstr_w(propname), expression);
3321 return E_NOTIMPL;
3324 static HRESULT WINAPI HTMLStyle2_removeExpression(IHTMLStyle2 *iface, BSTR propname, VARIANT_BOOL *pfSuccess)
3326 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3327 FIXME("(%p)->(%s %p)\n", This, debugstr_w(propname), pfSuccess);
3328 return E_NOTIMPL;
3331 static HRESULT WINAPI HTMLStyle2_put_position(IHTMLStyle2 *iface, BSTR v)
3333 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3335 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
3337 return set_style_property(This, STYLEID_POSITION, v);
3340 static HRESULT WINAPI HTMLStyle2_get_position(IHTMLStyle2 *iface, BSTR *p)
3342 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3344 TRACE("(%p)->(%p)\n", This, p);
3346 return get_style_property(This, STYLEID_POSITION, p);
3349 static HRESULT WINAPI HTMLStyle2_put_unicodeBidi(IHTMLStyle2 *iface, BSTR v)
3351 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3352 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3353 return E_NOTIMPL;
3356 static HRESULT WINAPI HTMLStyle2_get_unicodeBidi(IHTMLStyle2 *iface, BSTR *p)
3358 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3359 FIXME("(%p)->(%p)\n", This, p);
3360 return E_NOTIMPL;
3363 static HRESULT WINAPI HTMLStyle2_put_bottom(IHTMLStyle2 *iface, VARIANT v)
3365 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3367 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
3369 return set_style_property_var(This, STYLEID_BOTTOM, &v);
3372 static HRESULT WINAPI HTMLStyle2_get_bottom(IHTMLStyle2 *iface, VARIANT *p)
3374 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3376 TRACE("(%p)->(%p)\n", This, p);
3378 return get_style_property_var(This, STYLEID_BOTTOM, p);
3381 static HRESULT WINAPI HTMLStyle2_put_right(IHTMLStyle2 *iface, VARIANT v)
3383 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3385 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
3387 return set_style_property_var(This, STYLEID_RIGHT, &v);
3390 static HRESULT WINAPI HTMLStyle2_get_right(IHTMLStyle2 *iface, VARIANT *p)
3392 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3394 TRACE("(%p)->(%p)\n", This, p);
3396 return get_style_property_var(This, STYLEID_RIGHT, p);
3399 static HRESULT WINAPI HTMLStyle2_put_pixelBottom(IHTMLStyle2 *iface, LONG v)
3401 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3402 FIXME("(%p)->(%d)\n", This, v);
3403 return E_NOTIMPL;
3406 static HRESULT WINAPI HTMLStyle2_get_pixelBottom(IHTMLStyle2 *iface, LONG *p)
3408 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3409 FIXME("(%p)->(%p)\n", This, p);
3410 return E_NOTIMPL;
3413 static HRESULT WINAPI HTMLStyle2_put_pixelRight(IHTMLStyle2 *iface, LONG v)
3415 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3416 FIXME("(%p)->(%d)\n", This, v);
3417 return E_NOTIMPL;
3420 static HRESULT WINAPI HTMLStyle2_get_pixelRight(IHTMLStyle2 *iface, LONG *p)
3422 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3423 FIXME("(%p)->(%p)\n", This, p);
3424 return E_NOTIMPL;
3427 static HRESULT WINAPI HTMLStyle2_put_posBottom(IHTMLStyle2 *iface, float v)
3429 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3430 FIXME("(%p)->(%f)\n", This, v);
3431 return E_NOTIMPL;
3434 static HRESULT WINAPI HTMLStyle2_get_posBottom(IHTMLStyle2 *iface, float *p)
3436 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3437 FIXME("(%p)->(%p)\n", This, p);
3438 return E_NOTIMPL;
3441 static HRESULT WINAPI HTMLStyle2_put_posRight(IHTMLStyle2 *iface, float v)
3443 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3444 FIXME("(%p)->(%f)\n", This, v);
3445 return E_NOTIMPL;
3448 static HRESULT WINAPI HTMLStyle2_get_posRight(IHTMLStyle2 *iface, float *p)
3450 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3451 FIXME("(%p)->(%p)\n", This, p);
3452 return E_NOTIMPL;
3455 static HRESULT WINAPI HTMLStyle2_put_imeMode(IHTMLStyle2 *iface, BSTR v)
3457 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3458 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3459 return E_NOTIMPL;
3462 static HRESULT WINAPI HTMLStyle2_get_imeMode(IHTMLStyle2 *iface, BSTR *p)
3464 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3465 FIXME("(%p)->(%p)\n", This, p);
3466 return E_NOTIMPL;
3469 static HRESULT WINAPI HTMLStyle2_put_rubyAlign(IHTMLStyle2 *iface, BSTR v)
3471 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3472 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3473 return E_NOTIMPL;
3476 static HRESULT WINAPI HTMLStyle2_get_rubyAlign(IHTMLStyle2 *iface, BSTR *p)
3478 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3479 FIXME("(%p)->(%p)\n", This, p);
3480 return E_NOTIMPL;
3483 static HRESULT WINAPI HTMLStyle2_put_rubyPosition(IHTMLStyle2 *iface, BSTR v)
3485 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3486 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3487 return E_NOTIMPL;
3490 static HRESULT WINAPI HTMLStyle2_get_rubyPosition(IHTMLStyle2 *iface, BSTR *p)
3492 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3493 FIXME("(%p)->(%p)\n", This, p);
3494 return E_NOTIMPL;
3497 static HRESULT WINAPI HTMLStyle2_put_rubyOverhang(IHTMLStyle2 *iface, BSTR v)
3499 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3500 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3501 return E_NOTIMPL;
3504 static HRESULT WINAPI HTMLStyle2_get_rubyOverhang(IHTMLStyle2 *iface, BSTR *p)
3506 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3507 FIXME("(%p)->(%p)\n", This, p);
3508 return E_NOTIMPL;
3511 static HRESULT WINAPI HTMLStyle2_put_layoutGridChar(IHTMLStyle2 *iface, VARIANT v)
3513 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3514 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3515 return E_NOTIMPL;
3518 static HRESULT WINAPI HTMLStyle2_get_layoutGridChar(IHTMLStyle2 *iface, VARIANT *p)
3520 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3521 FIXME("(%p)->(%p)\n", This, p);
3522 return E_NOTIMPL;
3525 static HRESULT WINAPI HTMLStyle2_put_layoutGridLine(IHTMLStyle2 *iface, VARIANT v)
3527 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3528 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3529 return E_NOTIMPL;
3532 static HRESULT WINAPI HTMLStyle2_get_layoutGridLine(IHTMLStyle2 *iface, VARIANT *p)
3534 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3535 FIXME("(%p)->(%p)\n", This, p);
3536 return E_NOTIMPL;
3539 static HRESULT WINAPI HTMLStyle2_put_layoutGridMode(IHTMLStyle2 *iface, BSTR v)
3541 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3542 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3543 return E_NOTIMPL;
3546 static HRESULT WINAPI HTMLStyle2_get_layoutGridMode(IHTMLStyle2 *iface, BSTR *p)
3548 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3549 FIXME("(%p)->(%p)\n", This, p);
3550 return E_NOTIMPL;
3553 static HRESULT WINAPI HTMLStyle2_put_layoutGridType(IHTMLStyle2 *iface, BSTR v)
3555 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3556 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3557 return E_NOTIMPL;
3560 static HRESULT WINAPI HTMLStyle2_get_layoutGridType(IHTMLStyle2 *iface, BSTR *p)
3562 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3563 FIXME("(%p)->(%p)\n", This, p);
3564 return E_NOTIMPL;
3567 static HRESULT WINAPI HTMLStyle2_put_layoutGrid(IHTMLStyle2 *iface, BSTR v)
3569 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3570 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3571 return E_NOTIMPL;
3574 static HRESULT WINAPI HTMLStyle2_get_layoutGrid(IHTMLStyle2 *iface, BSTR *p)
3576 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3577 FIXME("(%p)->(%p)\n", This, p);
3578 return E_NOTIMPL;
3581 static HRESULT WINAPI HTMLStyle2_put_wordBreak(IHTMLStyle2 *iface, BSTR v)
3583 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3584 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3585 return E_NOTIMPL;
3588 static HRESULT WINAPI HTMLStyle2_get_wordBreak(IHTMLStyle2 *iface, BSTR *p)
3590 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3591 FIXME("(%p)->(%p)\n", This, p);
3592 return E_NOTIMPL;
3595 static HRESULT WINAPI HTMLStyle2_put_lineBreak(IHTMLStyle2 *iface, BSTR v)
3597 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3598 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3599 return E_NOTIMPL;
3602 static HRESULT WINAPI HTMLStyle2_get_lineBreak(IHTMLStyle2 *iface, BSTR *p)
3604 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3605 FIXME("(%p)->(%p)\n", This, p);
3606 return E_NOTIMPL;
3609 static HRESULT WINAPI HTMLStyle2_put_textJustify(IHTMLStyle2 *iface, BSTR v)
3611 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3612 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3613 return E_NOTIMPL;
3616 static HRESULT WINAPI HTMLStyle2_get_textJustify(IHTMLStyle2 *iface, BSTR *p)
3618 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3619 FIXME("(%p)->(%p)\n", This, p);
3620 return E_NOTIMPL;
3623 static HRESULT WINAPI HTMLStyle2_put_textJustifyTrim(IHTMLStyle2 *iface, BSTR v)
3625 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3626 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3627 return E_NOTIMPL;
3630 static HRESULT WINAPI HTMLStyle2_get_textJustifyTrim(IHTMLStyle2 *iface, BSTR *p)
3632 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3633 FIXME("(%p)->(%p)\n", This, p);
3634 return E_NOTIMPL;
3637 static HRESULT WINAPI HTMLStyle2_put_textKashida(IHTMLStyle2 *iface, VARIANT v)
3639 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3640 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3641 return E_NOTIMPL;
3644 static HRESULT WINAPI HTMLStyle2_get_textKashida(IHTMLStyle2 *iface, VARIANT *p)
3646 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3647 FIXME("(%p)->(%p)\n", This, p);
3648 return E_NOTIMPL;
3651 static HRESULT WINAPI HTMLStyle2_put_textAutospace(IHTMLStyle2 *iface, BSTR v)
3653 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3654 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3655 return E_NOTIMPL;
3658 static HRESULT WINAPI HTMLStyle2_get_textAutospace(IHTMLStyle2 *iface, BSTR *p)
3660 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3661 FIXME("(%p)->(%p)\n", This, p);
3662 return E_NOTIMPL;
3665 static HRESULT WINAPI HTMLStyle2_put_overflowX(IHTMLStyle2 *iface, BSTR v)
3667 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3669 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
3671 return set_style_property(This, STYLEID_OVERFLOW_X, v);
3674 static HRESULT WINAPI HTMLStyle2_get_overflowX(IHTMLStyle2 *iface, BSTR *p)
3676 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3678 TRACE("(%p)->(%p)\n", This, p);
3680 return get_style_property(This, STYLEID_OVERFLOW_X, p);
3683 static HRESULT WINAPI HTMLStyle2_put_overflowY(IHTMLStyle2 *iface, BSTR v)
3685 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3687 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
3689 return set_style_property(This, STYLEID_OVERFLOW_Y, v);
3692 static HRESULT WINAPI HTMLStyle2_get_overflowY(IHTMLStyle2 *iface, BSTR *p)
3694 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3696 TRACE("(%p)->(%p)\n", This, p);
3698 return get_style_property(This, STYLEID_OVERFLOW_Y, p);
3701 static HRESULT WINAPI HTMLStyle2_put_accelerator(IHTMLStyle2 *iface, BSTR v)
3703 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3704 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3705 return E_NOTIMPL;
3708 static HRESULT WINAPI HTMLStyle2_get_accelerator(IHTMLStyle2 *iface, BSTR *p)
3710 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3711 FIXME("(%p)->(%p)\n", This, p);
3712 return E_NOTIMPL;
3715 static const IHTMLStyle2Vtbl HTMLStyle2Vtbl = {
3716 HTMLStyle2_QueryInterface,
3717 HTMLStyle2_AddRef,
3718 HTMLStyle2_Release,
3719 HTMLStyle2_GetTypeInfoCount,
3720 HTMLStyle2_GetTypeInfo,
3721 HTMLStyle2_GetIDsOfNames,
3722 HTMLStyle2_Invoke,
3723 HTMLStyle2_put_tableLayout,
3724 HTMLStyle2_get_tableLayout,
3725 HTMLStyle2_put_borderCollapse,
3726 HTMLStyle2_get_borderCollapse,
3727 HTMLStyle2_put_direction,
3728 HTMLStyle2_get_direction,
3729 HTMLStyle2_put_behavior,
3730 HTMLStyle2_get_behavior,
3731 HTMLStyle2_setExpression,
3732 HTMLStyle2_getExpression,
3733 HTMLStyle2_removeExpression,
3734 HTMLStyle2_put_position,
3735 HTMLStyle2_get_position,
3736 HTMLStyle2_put_unicodeBidi,
3737 HTMLStyle2_get_unicodeBidi,
3738 HTMLStyle2_put_bottom,
3739 HTMLStyle2_get_bottom,
3740 HTMLStyle2_put_right,
3741 HTMLStyle2_get_right,
3742 HTMLStyle2_put_pixelBottom,
3743 HTMLStyle2_get_pixelBottom,
3744 HTMLStyle2_put_pixelRight,
3745 HTMLStyle2_get_pixelRight,
3746 HTMLStyle2_put_posBottom,
3747 HTMLStyle2_get_posBottom,
3748 HTMLStyle2_put_posRight,
3749 HTMLStyle2_get_posRight,
3750 HTMLStyle2_put_imeMode,
3751 HTMLStyle2_get_imeMode,
3752 HTMLStyle2_put_rubyAlign,
3753 HTMLStyle2_get_rubyAlign,
3754 HTMLStyle2_put_rubyPosition,
3755 HTMLStyle2_get_rubyPosition,
3756 HTMLStyle2_put_rubyOverhang,
3757 HTMLStyle2_get_rubyOverhang,
3758 HTMLStyle2_put_layoutGridChar,
3759 HTMLStyle2_get_layoutGridChar,
3760 HTMLStyle2_put_layoutGridLine,
3761 HTMLStyle2_get_layoutGridLine,
3762 HTMLStyle2_put_layoutGridMode,
3763 HTMLStyle2_get_layoutGridMode,
3764 HTMLStyle2_put_layoutGridType,
3765 HTMLStyle2_get_layoutGridType,
3766 HTMLStyle2_put_layoutGrid,
3767 HTMLStyle2_get_layoutGrid,
3768 HTMLStyle2_put_wordBreak,
3769 HTMLStyle2_get_wordBreak,
3770 HTMLStyle2_put_lineBreak,
3771 HTMLStyle2_get_lineBreak,
3772 HTMLStyle2_put_textJustify,
3773 HTMLStyle2_get_textJustify,
3774 HTMLStyle2_put_textJustifyTrim,
3775 HTMLStyle2_get_textJustifyTrim,
3776 HTMLStyle2_put_textKashida,
3777 HTMLStyle2_get_textKashida,
3778 HTMLStyle2_put_textAutospace,
3779 HTMLStyle2_get_textAutospace,
3780 HTMLStyle2_put_overflowX,
3781 HTMLStyle2_get_overflowX,
3782 HTMLStyle2_put_overflowY,
3783 HTMLStyle2_get_overflowY,
3784 HTMLStyle2_put_accelerator,
3785 HTMLStyle2_get_accelerator
3788 static inline HTMLStyle *impl_from_IHTMLStyle3(IHTMLStyle3 *iface)
3790 return CONTAINING_RECORD(iface, HTMLStyle, IHTMLStyle3_iface);
3793 static HRESULT WINAPI HTMLStyle3_QueryInterface(IHTMLStyle3 *iface, REFIID riid, void **ppv)
3795 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3797 return IHTMLStyle_QueryInterface(&This->IHTMLStyle_iface, riid, ppv);
3800 static ULONG WINAPI HTMLStyle3_AddRef(IHTMLStyle3 *iface)
3802 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3804 return IHTMLStyle_AddRef(&This->IHTMLStyle_iface);
3807 static ULONG WINAPI HTMLStyle3_Release(IHTMLStyle3 *iface)
3809 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3811 return IHTMLStyle_Release(&This->IHTMLStyle_iface);
3814 static HRESULT WINAPI HTMLStyle3_GetTypeInfoCount(IHTMLStyle3 *iface, UINT *pctinfo)
3816 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3817 return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
3820 static HRESULT WINAPI HTMLStyle3_GetTypeInfo(IHTMLStyle3 *iface, UINT iTInfo,
3821 LCID lcid, ITypeInfo **ppTInfo)
3823 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3824 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
3827 static HRESULT WINAPI HTMLStyle3_GetIDsOfNames(IHTMLStyle3 *iface, REFIID riid,
3828 LPOLESTR *rgszNames, UINT cNames,
3829 LCID lcid, DISPID *rgDispId)
3831 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3832 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
3833 lcid, rgDispId);
3836 static HRESULT WINAPI HTMLStyle3_Invoke(IHTMLStyle3 *iface, DISPID dispIdMember,
3837 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
3838 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
3840 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3841 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
3842 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
3845 static HRESULT WINAPI HTMLStyle3_put_layoutFlow(IHTMLStyle3 *iface, BSTR v)
3847 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3848 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3849 return E_NOTIMPL;
3852 static HRESULT WINAPI HTMLStyle3_get_layoutFlow(IHTMLStyle3 *iface, BSTR *p)
3854 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3855 FIXME("(%p)->(%p)\n", This, p);
3856 return E_NOTIMPL;
3859 static const WCHAR zoomW[] = {'z','o','o','m',0};
3861 static HRESULT WINAPI HTMLStyle3_put_zoom(IHTMLStyle3 *iface, VARIANT v)
3863 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3864 VARIANT *var;
3865 HRESULT hres;
3867 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
3869 /* zoom property is IE CSS extension that is mostly used as a hack to workaround IE bugs.
3870 * The value is set to 1 then. We can safely ignore setting zoom to 1. */
3871 if(V_VT(&v) != VT_I4 || V_I4(&v) != 1)
3872 WARN("stub for %s\n", debugstr_variant(&v));
3874 hres = dispex_get_dprop_ref(&This->dispex, zoomW, TRUE, &var);
3875 if(FAILED(hres))
3876 return hres;
3878 return VariantChangeType(var, &v, 0, VT_BSTR);
3881 static HRESULT WINAPI HTMLStyle3_get_zoom(IHTMLStyle3 *iface, VARIANT *p)
3883 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3884 VARIANT *var;
3885 HRESULT hres;
3887 TRACE("(%p)->(%p)\n", This, p);
3889 hres = dispex_get_dprop_ref(&This->dispex, zoomW, FALSE, &var);
3890 if(hres == DISP_E_UNKNOWNNAME) {
3891 V_VT(p) = VT_BSTR;
3892 V_BSTR(p) = NULL;
3893 return S_OK;
3895 if(FAILED(hres))
3896 return hres;
3898 return VariantCopy(p, var);
3901 static HRESULT WINAPI HTMLStyle3_put_wordWrap(IHTMLStyle3 *iface, BSTR v)
3903 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3905 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
3907 return set_style_property(This, STYLEID_WORD_WRAP, v);
3910 static HRESULT WINAPI HTMLStyle3_get_wordWrap(IHTMLStyle3 *iface, BSTR *p)
3912 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3914 TRACE("(%p)->(%p)\n", This, p);
3916 return get_style_property(This, STYLEID_WORD_WRAP, p);
3919 static HRESULT WINAPI HTMLStyle3_put_textUnderlinePosition(IHTMLStyle3 *iface, BSTR v)
3921 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3922 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3923 return E_NOTIMPL;
3926 static HRESULT WINAPI HTMLStyle3_get_textUnderlinePosition(IHTMLStyle3 *iface, BSTR *p)
3928 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3929 FIXME("(%p)->(%p)\n", This, p);
3930 return E_NOTIMPL;
3933 static HRESULT WINAPI HTMLStyle3_put_scrollbarBaseColor(IHTMLStyle3 *iface, VARIANT v)
3935 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3936 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3937 return E_NOTIMPL;
3940 static HRESULT WINAPI HTMLStyle3_get_scrollbarBaseColor(IHTMLStyle3 *iface, VARIANT *p)
3942 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3943 FIXME("(%p)->(%p)\n", This, p);
3944 return E_NOTIMPL;
3947 static HRESULT WINAPI HTMLStyle3_put_scrollbarFaceColor(IHTMLStyle3 *iface, VARIANT v)
3949 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3950 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3951 return E_NOTIMPL;
3954 static HRESULT WINAPI HTMLStyle3_get_scrollbarFaceColor(IHTMLStyle3 *iface, VARIANT *p)
3956 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3957 FIXME("(%p)->(%p)\n", This, p);
3958 return E_NOTIMPL;
3961 static HRESULT WINAPI HTMLStyle3_put_scrollbar3dLightColor(IHTMLStyle3 *iface, VARIANT v)
3963 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3964 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3965 return E_NOTIMPL;
3968 static HRESULT WINAPI HTMLStyle3_get_scrollbar3dLightColor(IHTMLStyle3 *iface, VARIANT *p)
3970 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3971 FIXME("(%p)->(%p)\n", This, p);
3972 return E_NOTIMPL;
3975 static HRESULT WINAPI HTMLStyle3_put_scrollbarShadowColor(IHTMLStyle3 *iface, VARIANT v)
3977 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3978 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3979 return E_NOTIMPL;
3982 static HRESULT WINAPI HTMLStyle3_get_scrollbarShadowColor(IHTMLStyle3 *iface, VARIANT *p)
3984 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3985 FIXME("(%p)->(%p)\n", This, p);
3986 return E_NOTIMPL;
3989 static HRESULT WINAPI HTMLStyle3_put_scrollbarHighlightColor(IHTMLStyle3 *iface, VARIANT v)
3991 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3992 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3993 return E_NOTIMPL;
3996 static HRESULT WINAPI HTMLStyle3_get_scrollbarHighlightColor(IHTMLStyle3 *iface, VARIANT *p)
3998 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3999 FIXME("(%p)->(%p)\n", This, p);
4000 return E_NOTIMPL;
4003 static HRESULT WINAPI HTMLStyle3_put_scrollbarDarkShadowColor(IHTMLStyle3 *iface, VARIANT v)
4005 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
4006 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
4007 return E_NOTIMPL;
4010 static HRESULT WINAPI HTMLStyle3_get_scrollbarDarkShadowColor(IHTMLStyle3 *iface, VARIANT *p)
4012 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
4013 FIXME("(%p)->(%p)\n", This, p);
4014 return E_NOTIMPL;
4017 static HRESULT WINAPI HTMLStyle3_put_scrollbarArrowColor(IHTMLStyle3 *iface, VARIANT v)
4019 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
4020 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
4021 return E_NOTIMPL;
4024 static HRESULT WINAPI HTMLStyle3_get_scrollbarArrowColor(IHTMLStyle3 *iface, VARIANT *p)
4026 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
4027 FIXME("(%p)->(%p)\n", This, p);
4028 return E_NOTIMPL;
4031 static HRESULT WINAPI HTMLStyle3_put_scrollbarTrackColor(IHTMLStyle3 *iface, VARIANT v)
4033 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
4034 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
4035 return E_NOTIMPL;
4038 static HRESULT WINAPI HTMLStyle3_get_scrollbarTrackColor(IHTMLStyle3 *iface, VARIANT *p)
4040 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
4041 FIXME("(%p)->(%p)\n", This, p);
4042 return E_NOTIMPL;
4045 static HRESULT WINAPI HTMLStyle3_put_writingMode(IHTMLStyle3 *iface, BSTR v)
4047 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
4048 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4049 return E_NOTIMPL;
4052 static HRESULT WINAPI HTMLStyle3_get_writingMode(IHTMLStyle3 *iface, BSTR *p)
4054 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
4055 FIXME("(%p)->(%p)\n", This, p);
4056 return E_NOTIMPL;
4059 static HRESULT WINAPI HTMLStyle3_put_textAlignLast(IHTMLStyle3 *iface, BSTR v)
4061 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
4062 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4063 return E_NOTIMPL;
4066 static HRESULT WINAPI HTMLStyle3_get_textAlignLast(IHTMLStyle3 *iface, BSTR *p)
4068 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
4069 FIXME("(%p)->(%p)\n", This, p);
4070 return E_NOTIMPL;
4073 static HRESULT WINAPI HTMLStyle3_put_textKashidaSpace(IHTMLStyle3 *iface, VARIANT v)
4075 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
4076 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
4077 return E_NOTIMPL;
4080 static HRESULT WINAPI HTMLStyle3_get_textKashidaSpace(IHTMLStyle3 *iface, VARIANT *p)
4082 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
4083 FIXME("(%p)->(%p)\n", This, p);
4084 return E_NOTIMPL;
4087 static const IHTMLStyle3Vtbl HTMLStyle3Vtbl = {
4088 HTMLStyle3_QueryInterface,
4089 HTMLStyle3_AddRef,
4090 HTMLStyle3_Release,
4091 HTMLStyle3_GetTypeInfoCount,
4092 HTMLStyle3_GetTypeInfo,
4093 HTMLStyle3_GetIDsOfNames,
4094 HTMLStyle3_Invoke,
4095 HTMLStyle3_put_layoutFlow,
4096 HTMLStyle3_get_layoutFlow,
4097 HTMLStyle3_put_zoom,
4098 HTMLStyle3_get_zoom,
4099 HTMLStyle3_put_wordWrap,
4100 HTMLStyle3_get_wordWrap,
4101 HTMLStyle3_put_textUnderlinePosition,
4102 HTMLStyle3_get_textUnderlinePosition,
4103 HTMLStyle3_put_scrollbarBaseColor,
4104 HTMLStyle3_get_scrollbarBaseColor,
4105 HTMLStyle3_put_scrollbarFaceColor,
4106 HTMLStyle3_get_scrollbarFaceColor,
4107 HTMLStyle3_put_scrollbar3dLightColor,
4108 HTMLStyle3_get_scrollbar3dLightColor,
4109 HTMLStyle3_put_scrollbarShadowColor,
4110 HTMLStyle3_get_scrollbarShadowColor,
4111 HTMLStyle3_put_scrollbarHighlightColor,
4112 HTMLStyle3_get_scrollbarHighlightColor,
4113 HTMLStyle3_put_scrollbarDarkShadowColor,
4114 HTMLStyle3_get_scrollbarDarkShadowColor,
4115 HTMLStyle3_put_scrollbarArrowColor,
4116 HTMLStyle3_get_scrollbarArrowColor,
4117 HTMLStyle3_put_scrollbarTrackColor,
4118 HTMLStyle3_get_scrollbarTrackColor,
4119 HTMLStyle3_put_writingMode,
4120 HTMLStyle3_get_writingMode,
4121 HTMLStyle3_put_textAlignLast,
4122 HTMLStyle3_get_textAlignLast,
4123 HTMLStyle3_put_textKashidaSpace,
4124 HTMLStyle3_get_textKashidaSpace
4128 * IHTMLStyle4 Interface
4130 static inline HTMLStyle *impl_from_IHTMLStyle4(IHTMLStyle4 *iface)
4132 return CONTAINING_RECORD(iface, HTMLStyle, IHTMLStyle4_iface);
4135 static HRESULT WINAPI HTMLStyle4_QueryInterface(IHTMLStyle4 *iface, REFIID riid, void **ppv)
4137 HTMLStyle *This = impl_from_IHTMLStyle4(iface);
4139 return IHTMLStyle_QueryInterface(&This->IHTMLStyle_iface, riid, ppv);
4142 static ULONG WINAPI HTMLStyle4_AddRef(IHTMLStyle4 *iface)
4144 HTMLStyle *This = impl_from_IHTMLStyle4(iface);
4146 return IHTMLStyle_AddRef(&This->IHTMLStyle_iface);
4149 static ULONG WINAPI HTMLStyle4_Release(IHTMLStyle4 *iface)
4151 HTMLStyle *This = impl_from_IHTMLStyle4(iface);
4153 return IHTMLStyle_Release(&This->IHTMLStyle_iface);
4156 static HRESULT WINAPI HTMLStyle4_GetTypeInfoCount(IHTMLStyle4 *iface, UINT *pctinfo)
4158 HTMLStyle *This = impl_from_IHTMLStyle4(iface);
4159 return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
4162 static HRESULT WINAPI HTMLStyle4_GetTypeInfo(IHTMLStyle4 *iface, UINT iTInfo,
4163 LCID lcid, ITypeInfo **ppTInfo)
4165 HTMLStyle *This = impl_from_IHTMLStyle4(iface);
4166 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
4169 static HRESULT WINAPI HTMLStyle4_GetIDsOfNames(IHTMLStyle4 *iface, REFIID riid,
4170 LPOLESTR *rgszNames, UINT cNames,
4171 LCID lcid, DISPID *rgDispId)
4173 HTMLStyle *This = impl_from_IHTMLStyle4(iface);
4174 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
4175 lcid, rgDispId);
4178 static HRESULT WINAPI HTMLStyle4_Invoke(IHTMLStyle4 *iface, DISPID dispIdMember,
4179 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
4180 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
4182 HTMLStyle *This = impl_from_IHTMLStyle4(iface);
4183 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
4184 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
4187 static HRESULT WINAPI HTMLStyle4_put_textOverflow(IHTMLStyle4 *iface, BSTR v)
4189 HTMLStyle *This = impl_from_IHTMLStyle4(iface);
4190 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4191 return E_NOTIMPL;
4194 static HRESULT WINAPI HTMLStyle4_get_textOverflow(IHTMLStyle4 *iface, BSTR *p)
4196 HTMLStyle *This = impl_from_IHTMLStyle4(iface);
4197 FIXME("(%p)->(%p)\n", This, p);
4198 return E_NOTIMPL;
4201 static HRESULT WINAPI HTMLStyle4_put_minHeight(IHTMLStyle4 *iface, VARIANT v)
4203 HTMLStyle *This = impl_from_IHTMLStyle4(iface);
4205 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
4207 return set_style_property_var(This, STYLEID_MIN_HEIGHT, &v);
4210 static HRESULT WINAPI HTMLStyle4_get_minHeight(IHTMLStyle4 *iface, VARIANT *p)
4212 HTMLStyle *This = impl_from_IHTMLStyle4(iface);
4214 TRACE("(%p)->(%p)\n", This, p);
4216 return get_style_property_var(This, STYLEID_MIN_HEIGHT, p);
4219 static const IHTMLStyle4Vtbl HTMLStyle4Vtbl = {
4220 HTMLStyle4_QueryInterface,
4221 HTMLStyle4_AddRef,
4222 HTMLStyle4_Release,
4223 HTMLStyle4_GetTypeInfoCount,
4224 HTMLStyle4_GetTypeInfo,
4225 HTMLStyle4_GetIDsOfNames,
4226 HTMLStyle4_Invoke,
4227 HTMLStyle4_put_textOverflow,
4228 HTMLStyle4_get_textOverflow,
4229 HTMLStyle4_put_minHeight,
4230 HTMLStyle4_get_minHeight
4233 static inline HTMLStyle *impl_from_IHTMLStyle5(IHTMLStyle5 *iface)
4235 return CONTAINING_RECORD(iface, HTMLStyle, IHTMLStyle5_iface);
4238 static HRESULT WINAPI HTMLStyle5_QueryInterface(IHTMLStyle5 *iface, REFIID riid, void **ppv)
4240 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4242 return IHTMLStyle_QueryInterface(&This->IHTMLStyle_iface, riid, ppv);
4245 static ULONG WINAPI HTMLStyle5_AddRef(IHTMLStyle5 *iface)
4247 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4249 return IHTMLStyle_AddRef(&This->IHTMLStyle_iface);
4252 static ULONG WINAPI HTMLStyle5_Release(IHTMLStyle5 *iface)
4254 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4256 return IHTMLStyle_Release(&This->IHTMLStyle_iface);
4259 static HRESULT WINAPI HTMLStyle5_GetTypeInfoCount(IHTMLStyle5 *iface, UINT *pctinfo)
4261 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4262 return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
4265 static HRESULT WINAPI HTMLStyle5_GetTypeInfo(IHTMLStyle5 *iface, UINT iTInfo,
4266 LCID lcid, ITypeInfo **ppTInfo)
4268 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4269 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
4272 static HRESULT WINAPI HTMLStyle5_GetIDsOfNames(IHTMLStyle5 *iface, REFIID riid,
4273 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
4275 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4276 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
4277 lcid, rgDispId);
4280 static HRESULT WINAPI HTMLStyle5_Invoke(IHTMLStyle5 *iface, DISPID dispIdMember,
4281 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
4282 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
4284 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4285 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
4286 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
4289 static HRESULT WINAPI HTMLStyle5_put_msInterpolationMode(IHTMLStyle5 *iface, BSTR v)
4291 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4292 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4293 return E_NOTIMPL;
4296 static HRESULT WINAPI HTMLStyle5_get_msInterpolationMode(IHTMLStyle5 *iface, BSTR *p)
4298 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4299 FIXME("(%p)->(%p)\n", This, p);
4300 return E_NOTIMPL;
4303 static HRESULT WINAPI HTMLStyle5_put_maxHeight(IHTMLStyle5 *iface, VARIANT v)
4305 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4307 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
4309 return set_style_property_var(This, STYLEID_MAX_HEIGHT, &v);
4312 static HRESULT WINAPI HTMLStyle5_get_maxHeight(IHTMLStyle5 *iface, VARIANT *p)
4314 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4316 TRACE("(%p)->(%s)\n", This, debugstr_variant(p));
4318 return get_style_property_var(This, STYLEID_MAX_HEIGHT, p);
4321 static HRESULT WINAPI HTMLStyle5_put_minWidth(IHTMLStyle5 *iface, VARIANT v)
4323 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4325 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
4327 return set_style_property_var(This, STYLEID_MIN_WIDTH, &v);
4330 static HRESULT WINAPI HTMLStyle5_get_minWidth(IHTMLStyle5 *iface, VARIANT *p)
4332 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4334 TRACE("(%p)->(%p)\n", This, p);
4336 return get_style_property_var(This, STYLEID_MIN_WIDTH, p);
4339 static HRESULT WINAPI HTMLStyle5_put_maxWidth(IHTMLStyle5 *iface, VARIANT v)
4341 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4343 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
4345 return set_style_property_var(This, STYLEID_MAX_WIDTH, &v);
4348 static HRESULT WINAPI HTMLStyle5_get_maxWidth(IHTMLStyle5 *iface, VARIANT *p)
4350 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4352 TRACE("(%p)->(%p)\n", This, p);
4354 return get_style_property_var(This, STYLEID_MAX_WIDTH, p);
4357 static const IHTMLStyle5Vtbl HTMLStyle5Vtbl = {
4358 HTMLStyle5_QueryInterface,
4359 HTMLStyle5_AddRef,
4360 HTMLStyle5_Release,
4361 HTMLStyle5_GetTypeInfoCount,
4362 HTMLStyle5_GetTypeInfo,
4363 HTMLStyle5_GetIDsOfNames,
4364 HTMLStyle5_Invoke,
4365 HTMLStyle5_put_msInterpolationMode,
4366 HTMLStyle5_get_msInterpolationMode,
4367 HTMLStyle5_put_maxHeight,
4368 HTMLStyle5_get_maxHeight,
4369 HTMLStyle5_put_minWidth,
4370 HTMLStyle5_get_minWidth,
4371 HTMLStyle5_put_maxWidth,
4372 HTMLStyle5_get_maxWidth
4375 static inline HTMLStyle *impl_from_IHTMLStyle6(IHTMLStyle6 *iface)
4377 return CONTAINING_RECORD(iface, HTMLStyle, IHTMLStyle6_iface);
4380 static HRESULT WINAPI HTMLStyle6_QueryInterface(IHTMLStyle6 *iface, REFIID riid, void **ppv)
4382 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4384 return IHTMLStyle_QueryInterface(&This->IHTMLStyle_iface, riid, ppv);
4387 static ULONG WINAPI HTMLStyle6_AddRef(IHTMLStyle6 *iface)
4389 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4391 return IHTMLStyle_AddRef(&This->IHTMLStyle_iface);
4394 static ULONG WINAPI HTMLStyle6_Release(IHTMLStyle6 *iface)
4396 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4398 return IHTMLStyle_Release(&This->IHTMLStyle_iface);
4401 static HRESULT WINAPI HTMLStyle6_GetTypeInfoCount(IHTMLStyle6 *iface, UINT *pctinfo)
4403 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4404 return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
4407 static HRESULT WINAPI HTMLStyle6_GetTypeInfo(IHTMLStyle6 *iface, UINT iTInfo,
4408 LCID lcid, ITypeInfo **ppTInfo)
4410 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4411 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
4414 static HRESULT WINAPI HTMLStyle6_GetIDsOfNames(IHTMLStyle6 *iface, REFIID riid,
4415 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
4417 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4418 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
4419 lcid, rgDispId);
4422 static HRESULT WINAPI HTMLStyle6_Invoke(IHTMLStyle6 *iface, DISPID dispIdMember,
4423 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
4424 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
4426 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4427 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
4428 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
4431 static HRESULT WINAPI HTMLStyle6_put_content(IHTMLStyle6 *iface, BSTR v)
4433 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4434 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4435 return E_NOTIMPL;
4438 static HRESULT WINAPI HTMLStyle6_get_content(IHTMLStyle6 *iface, BSTR *p)
4440 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4441 FIXME("(%p)->(%p)\n", This, p);
4442 return E_NOTIMPL;
4445 static HRESULT WINAPI HTMLStyle6_put_contentSide(IHTMLStyle6 *iface, BSTR v)
4447 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4448 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4449 return E_NOTIMPL;
4452 static HRESULT WINAPI HTMLStyle6_get_contentSide(IHTMLStyle6 *iface, BSTR *p)
4454 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4455 FIXME("(%p)->(%p)\n", This, p);
4456 return E_NOTIMPL;
4459 static HRESULT WINAPI HTMLStyle6_put_counterIncrement(IHTMLStyle6 *iface, BSTR v)
4461 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4462 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4463 return E_NOTIMPL;
4466 static HRESULT WINAPI HTMLStyle6_get_counterIncrement(IHTMLStyle6 *iface, BSTR *p)
4468 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4469 FIXME("(%p)->(%p)\n", This, p);
4470 return E_NOTIMPL;
4473 static HRESULT WINAPI HTMLStyle6_put_counterReset(IHTMLStyle6 *iface, BSTR v)
4475 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4476 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4477 return E_NOTIMPL;
4480 static HRESULT WINAPI HTMLStyle6_get_counterReset(IHTMLStyle6 *iface, BSTR *p)
4482 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4483 FIXME("(%p)->(%p)\n", This, p);
4484 return E_NOTIMPL;
4487 static HRESULT WINAPI HTMLStyle6_put_outline(IHTMLStyle6 *iface, BSTR v)
4489 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4491 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
4493 return set_style_property(This, STYLEID_OUTLINE, v);
4496 static HRESULT WINAPI HTMLStyle6_get_outline(IHTMLStyle6 *iface, BSTR *p)
4498 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4500 TRACE("(%p)->(%p)\n", This, p);
4502 return get_style_property(This, STYLEID_OUTLINE, p);
4505 static HRESULT WINAPI HTMLStyle6_put_outlineWidth(IHTMLStyle6 *iface, VARIANT v)
4507 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4508 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
4509 return E_NOTIMPL;
4512 static HRESULT WINAPI HTMLStyle6_get_outlineWidth(IHTMLStyle6 *iface, VARIANT *p)
4514 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4515 FIXME("(%p)->(%p)\n", This, p);
4516 return E_NOTIMPL;
4519 static HRESULT WINAPI HTMLStyle6_put_outlineStyle(IHTMLStyle6 *iface, BSTR v)
4521 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4522 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4523 return E_NOTIMPL;
4526 static HRESULT WINAPI HTMLStyle6_get_outlineStyle(IHTMLStyle6 *iface, BSTR *p)
4528 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4529 FIXME("(%p)->(%p)\n", This, p);
4530 return E_NOTIMPL;
4533 static HRESULT WINAPI HTMLStyle6_put_outlineColor(IHTMLStyle6 *iface, VARIANT v)
4535 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4536 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
4537 return E_NOTIMPL;
4540 static HRESULT WINAPI HTMLStyle6_get_outlineColor(IHTMLStyle6 *iface, VARIANT *p)
4542 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4543 FIXME("(%p)->(%p)\n", This, p);
4544 return E_NOTIMPL;
4547 static HRESULT WINAPI HTMLStyle6_put_boxSizing(IHTMLStyle6 *iface, BSTR v)
4549 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4551 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
4553 return set_style_property(This, STYLEID_BOX_SIZING, v);
4556 static HRESULT WINAPI HTMLStyle6_get_boxSizing(IHTMLStyle6 *iface, BSTR *p)
4558 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4560 TRACE("(%p)->(%p)\n", This, p);
4562 return get_style_property(This, STYLEID_BOX_SIZING, p);
4565 static HRESULT WINAPI HTMLStyle6_put_boxSpacing(IHTMLStyle6 *iface, BSTR v)
4567 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4568 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4569 return E_NOTIMPL;
4572 static HRESULT WINAPI HTMLStyle6_get_boxSpacing(IHTMLStyle6 *iface, BSTR *p)
4574 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4575 FIXME("(%p)->(%p)\n", This, p);
4576 return E_NOTIMPL;
4579 static HRESULT WINAPI HTMLStyle6_put_orphans(IHTMLStyle6 *iface, VARIANT v)
4581 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4582 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
4583 return E_NOTIMPL;
4586 static HRESULT WINAPI HTMLStyle6_get_orphans(IHTMLStyle6 *iface, VARIANT *p)
4588 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4589 FIXME("(%p)->(%p)\n", This, p);
4590 return E_NOTIMPL;
4593 static HRESULT WINAPI HTMLStyle6_put_windows(IHTMLStyle6 *iface, VARIANT v)
4595 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4596 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
4597 return E_NOTIMPL;
4600 static HRESULT WINAPI HTMLStyle6_get_windows(IHTMLStyle6 *iface, VARIANT *p)
4602 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4603 FIXME("(%p)->(%p)\n", This, p);
4604 return E_NOTIMPL;
4607 static HRESULT WINAPI HTMLStyle6_put_pageBreakInside(IHTMLStyle6 *iface, BSTR v)
4609 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4610 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4611 return E_NOTIMPL;
4614 static HRESULT WINAPI HTMLStyle6_get_pageBreakInside(IHTMLStyle6 *iface, BSTR *p)
4616 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4617 FIXME("(%p)->(%p)\n", This, p);
4618 return E_NOTIMPL;
4621 static HRESULT WINAPI HTMLStyle6_put_emptyCells(IHTMLStyle6 *iface, BSTR v)
4623 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4624 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4625 return E_NOTIMPL;
4628 static HRESULT WINAPI HTMLStyle6_get_emptyCells(IHTMLStyle6 *iface, BSTR *p)
4630 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4631 FIXME("(%p)->(%p)\n", This, p);
4632 return E_NOTIMPL;
4635 static HRESULT WINAPI HTMLStyle6_put_msBlockProgression(IHTMLStyle6 *iface, BSTR v)
4637 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4638 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4639 return E_NOTIMPL;
4642 static HRESULT WINAPI HTMLStyle6_get_msBlockProgression(IHTMLStyle6 *iface, BSTR *p)
4644 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4645 FIXME("(%p)->(%p)\n", This, p);
4646 return E_NOTIMPL;
4649 static HRESULT WINAPI HTMLStyle6_put_quotes(IHTMLStyle6 *iface, BSTR v)
4651 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4652 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4653 return E_NOTIMPL;
4656 static HRESULT WINAPI HTMLStyle6_get_quotes(IHTMLStyle6 *iface, BSTR *p)
4658 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4659 FIXME("(%p)->(%p)\n", This, p);
4660 return E_NOTIMPL;
4663 static const IHTMLStyle6Vtbl HTMLStyle6Vtbl = {
4664 HTMLStyle6_QueryInterface,
4665 HTMLStyle6_AddRef,
4666 HTMLStyle6_Release,
4667 HTMLStyle6_GetTypeInfoCount,
4668 HTMLStyle6_GetTypeInfo,
4669 HTMLStyle6_GetIDsOfNames,
4670 HTMLStyle6_Invoke,
4671 HTMLStyle6_put_content,
4672 HTMLStyle6_get_content,
4673 HTMLStyle6_put_contentSide,
4674 HTMLStyle6_get_contentSide,
4675 HTMLStyle6_put_counterIncrement,
4676 HTMLStyle6_get_counterIncrement,
4677 HTMLStyle6_put_counterReset,
4678 HTMLStyle6_get_counterReset,
4679 HTMLStyle6_put_outline,
4680 HTMLStyle6_get_outline,
4681 HTMLStyle6_put_outlineWidth,
4682 HTMLStyle6_get_outlineWidth,
4683 HTMLStyle6_put_outlineStyle,
4684 HTMLStyle6_get_outlineStyle,
4685 HTMLStyle6_put_outlineColor,
4686 HTMLStyle6_get_outlineColor,
4687 HTMLStyle6_put_boxSizing,
4688 HTMLStyle6_get_boxSizing,
4689 HTMLStyle6_put_boxSpacing,
4690 HTMLStyle6_get_boxSpacing,
4691 HTMLStyle6_put_orphans,
4692 HTMLStyle6_get_orphans,
4693 HTMLStyle6_put_windows,
4694 HTMLStyle6_get_windows,
4695 HTMLStyle6_put_pageBreakInside,
4696 HTMLStyle6_get_pageBreakInside,
4697 HTMLStyle6_put_emptyCells,
4698 HTMLStyle6_get_emptyCells,
4699 HTMLStyle6_put_msBlockProgression,
4700 HTMLStyle6_get_msBlockProgression,
4701 HTMLStyle6_put_quotes,
4702 HTMLStyle6_get_quotes
4705 static HRESULT HTMLStyle_get_dispid(DispatchEx *dispex, BSTR name, DWORD flags, DISPID *dispid)
4707 const style_tbl_entry_t *style_entry;
4709 style_entry = lookup_style_tbl(name);
4710 if(style_entry) {
4711 *dispid = style_entry->dispid;
4712 return S_OK;
4715 return DISP_E_UNKNOWNNAME;
4718 static const dispex_static_data_vtbl_t HTMLStyle_dispex_vtbl = {
4719 NULL,
4720 HTMLStyle_get_dispid,
4721 NULL,
4722 NULL
4725 static const tid_t HTMLStyle_iface_tids[] = {
4726 IHTMLStyle6_tid,
4727 IHTMLStyle5_tid,
4728 IHTMLStyle4_tid,
4729 IHTMLStyle3_tid,
4730 IHTMLStyle2_tid,
4731 IHTMLStyle_tid,
4734 static dispex_static_data_t HTMLStyle_dispex = {
4735 &HTMLStyle_dispex_vtbl,
4736 DispHTMLStyle_tid,
4737 HTMLStyle_iface_tids
4740 static HRESULT get_style_from_elem(HTMLElement *elem, nsIDOMCSSStyleDeclaration **ret)
4742 nsIDOMElementCSSInlineStyle *nselemstyle;
4743 nsresult nsres;
4745 if(!elem->dom_element) {
4746 FIXME("comment element\n");
4747 return E_NOTIMPL;
4750 nsres = nsIDOMElement_QueryInterface(elem->dom_element, &IID_nsIDOMElementCSSInlineStyle,
4751 (void**)&nselemstyle);
4752 assert(nsres == NS_OK);
4754 nsres = nsIDOMElementCSSInlineStyle_GetStyle(nselemstyle, ret);
4755 nsIDOMElementCSSInlineStyle_Release(nselemstyle);
4756 if(NS_FAILED(nsres)) {
4757 ERR("GetStyle failed: %08x\n", nsres);
4758 return E_FAIL;
4761 return S_OK;
4764 HRESULT HTMLStyle_Create(HTMLElement *elem, HTMLStyle **ret)
4766 nsIDOMCSSStyleDeclaration *nsstyle;
4767 HTMLStyle *style;
4768 HRESULT hres;
4770 hres = get_style_from_elem(elem, &nsstyle);
4771 if(FAILED(hres))
4772 return hres;
4774 style = heap_alloc_zero(sizeof(HTMLStyle));
4775 if(!style) {
4776 nsIDOMCSSStyleDeclaration_Release(nsstyle);
4777 return E_OUTOFMEMORY;
4780 style->IHTMLStyle_iface.lpVtbl = &HTMLStyleVtbl;
4781 style->IHTMLStyle2_iface.lpVtbl = &HTMLStyle2Vtbl;
4782 style->IHTMLStyle3_iface.lpVtbl = &HTMLStyle3Vtbl;
4783 style->IHTMLStyle4_iface.lpVtbl = &HTMLStyle4Vtbl;
4784 style->IHTMLStyle5_iface.lpVtbl = &HTMLStyle5Vtbl;
4785 style->IHTMLStyle6_iface.lpVtbl = &HTMLStyle6Vtbl;
4787 style->ref = 1;
4788 style->nsstyle = nsstyle;
4789 style->elem = elem;
4791 nsIDOMCSSStyleDeclaration_AddRef(nsstyle);
4793 init_dispex(&style->dispex, (IUnknown*)&style->IHTMLStyle_iface, &HTMLStyle_dispex);
4795 *ret = style;
4796 return S_OK;
4799 HRESULT get_elem_style(HTMLElement *elem, styleid_t styleid, BSTR *ret)
4801 nsIDOMCSSStyleDeclaration *style;
4802 HRESULT hres;
4804 hres = get_style_from_elem(elem, &style);
4805 if(FAILED(hres))
4806 return hres;
4808 hres = get_nsstyle_property(style, styleid, ret);
4809 nsIDOMCSSStyleDeclaration_Release(style);
4810 return hres;
4813 HRESULT set_elem_style(HTMLElement *elem, styleid_t styleid, const WCHAR *val)
4815 nsIDOMCSSStyleDeclaration *style;
4816 HRESULT hres;
4818 hres = get_style_from_elem(elem, &style);
4819 if(FAILED(hres))
4820 return hres;
4822 hres = set_nsstyle_property(style, styleid, val);
4823 nsIDOMCSSStyleDeclaration_Release(style);
4824 return hres;