mshtml: Skip fixups in get_nsstyle_property in IE9+ mode.
[wine.git] / dlls / mshtml / htmlstyle.c
blob4ec24a3a5c21598b4c2fa6baa8eb08507a654583
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 autoW[] = {'a','u','t','o',0};
211 static const WCHAR blinkW[] = {'b','l','i','n','k',0};
212 static const WCHAR boldW[] = {'b','o','l','d',0};
213 static const WCHAR bolderW[] = {'b','o','l','d','e','r',0};
214 static const WCHAR capsW[] = {'s','m','a','l','l','-','c','a','p','s',0};
215 static const WCHAR dashedW[] = {'d','a','s','h','e','d',0};
216 static const WCHAR dottedW[] = {'d','o','t','t','e','d',0};
217 static const WCHAR doubleW[] = {'d','o','u','b','l','e',0};
218 static const WCHAR grooveW[] = {'g','r','o','o','v','e',0};
219 static const WCHAR hiddenW[] = {'h','i','d','d','e','n',0};
220 static const WCHAR insetW[] = {'i','n','s','e','t',0};
221 static const WCHAR italicW[] = {'i','t','a','l','i','c',0};
222 static const WCHAR lighterW[] = {'l','i','g','h','t','e','r',0};
223 static const WCHAR line_throughW[] = {'l','i','n','e','-','t','h','r','o','u','g','h',0};
224 static const WCHAR no_repeatW[] = {'n','o','-','r','e','p','e','a','t',0};
225 static const WCHAR noneW[] = {'n','o','n','e',0};
226 static const WCHAR normalW[] = {'n','o','r','m','a','l',0};
227 static const WCHAR obliqueW[] = {'o','b','l','i','q','u','e',0};
228 static const WCHAR outsetW[] = {'o','u','t','s','e','t',0};
229 static const WCHAR overlineW[] = {'o','v','e','r','l','i','n','e',0};
230 static const WCHAR repeatW[] = {'r','e','p','e','a','t',0};
231 static const WCHAR repeat_xW[] = {'r','e','p','e','a','t','-','x',0};
232 static const WCHAR repeat_yW[] = {'r','e','p','e','a','t','-','y',0};
233 static const WCHAR ridgeW[] = {'r','i','d','g','e',0};
234 static const WCHAR scrollW[] = {'s','c','r','o','l','l',0};
235 static const WCHAR solidW[] = {'s','o','l','i','d',0};
236 static const WCHAR underlineW[] = {'u','n','d','e','r','l','i','n','e',0};
237 static const WCHAR visibleW[] = {'v','i','s','i','b','l','e',0};
239 static const WCHAR style100W[] = {'1','0','0',0};
240 static const WCHAR style200W[] = {'2','0','0',0};
241 static const WCHAR style300W[] = {'3','0','0',0};
242 static const WCHAR style400W[] = {'4','0','0',0};
243 static const WCHAR style500W[] = {'5','0','0',0};
244 static const WCHAR style600W[] = {'6','0','0',0};
245 static const WCHAR style700W[] = {'7','0','0',0};
246 static const WCHAR style800W[] = {'8','0','0',0};
247 static const WCHAR style900W[] = {'9','0','0',0};
249 static const WCHAR *font_style_values[] = {
250 italicW,
251 normalW,
252 obliqueW,
253 NULL
256 static const WCHAR *font_variant_values[] = {
257 capsW,
258 normalW,
259 NULL
262 static const WCHAR *font_weight_values[] = {
263 style100W,
264 style200W,
265 style300W,
266 style400W,
267 style500W,
268 style600W,
269 style700W,
270 style800W,
271 style900W,
272 boldW,
273 bolderW,
274 lighterW,
275 normalW,
276 NULL
279 static const WCHAR *background_repeat_values[] = {
280 no_repeatW,
281 repeatW,
282 repeat_xW,
283 repeat_yW,
284 NULL
287 static const WCHAR *text_decoration_values[] = {
288 blinkW,
289 line_throughW,
290 noneW,
291 overlineW,
292 underlineW,
293 NULL
296 static const WCHAR *border_style_values[] = {
297 dashedW,
298 dottedW,
299 doubleW,
300 grooveW,
301 insetW,
302 noneW,
303 outsetW,
304 ridgeW,
305 solidW,
306 NULL
309 static const WCHAR *overflow_values[] = {
310 autoW,
311 hiddenW,
312 scrollW,
313 visibleW,
314 NULL
317 #define ATTR_FIX_PX 0x0001
318 #define ATTR_FIX_URL 0x0002
319 #define ATTR_STR_TO_INT 0x0004
320 #define ATTR_HEX_INT 0x0008
321 #define ATTR_REMOVE_COMMA 0x0010
322 #define ATTR_NO_NULL 0x0020
324 static const WCHAR pxW[] = {'p','x',0};
326 typedef struct {
327 const WCHAR *name;
328 DISPID dispid;
329 unsigned flags;
330 const WCHAR **allowed_values;
331 } style_tbl_entry_t;
333 static const style_tbl_entry_t style_tbl[] = {
334 {backgroundW, DISPID_IHTMLSTYLE_BACKGROUND},
335 {background_attachmentW, DISPID_IHTMLSTYLE_BACKGROUNDATTACHMENT},
336 {background_colorW, DISPID_IHTMLSTYLE_BACKGROUNDCOLOR, ATTR_HEX_INT},
337 {background_imageW, DISPID_IHTMLSTYLE_BACKGROUNDIMAGE, ATTR_FIX_URL},
338 {background_positionW, DISPID_IHTMLSTYLE_BACKGROUNDPOSITION},
339 {background_position_xW, DISPID_IHTMLSTYLE_BACKGROUNDPOSITIONX, ATTR_FIX_PX},
340 {background_position_yW, DISPID_IHTMLSTYLE_BACKGROUNDPOSITIONY, ATTR_FIX_PX},
341 {background_repeatW, DISPID_IHTMLSTYLE_BACKGROUNDREPEAT, 0, background_repeat_values},
342 {borderW, DISPID_IHTMLSTYLE_BORDER},
343 {border_bottomW, DISPID_IHTMLSTYLE_BORDERBOTTOM, ATTR_FIX_PX},
344 {border_bottom_colorW, DISPID_IHTMLSTYLE_BORDERBOTTOMCOLOR, ATTR_HEX_INT},
345 {border_bottom_styleW, DISPID_IHTMLSTYLE_BORDERBOTTOMSTYLE, 0, border_style_values},
346 {border_bottom_widthW, DISPID_IHTMLSTYLE_BORDERBOTTOMWIDTH, ATTR_FIX_PX},
347 {border_colorW, DISPID_IHTMLSTYLE_BORDERCOLOR},
348 {border_leftW, DISPID_IHTMLSTYLE_BORDERLEFT, ATTR_FIX_PX},
349 {border_left_colorW, DISPID_IHTMLSTYLE_BORDERLEFTCOLOR, ATTR_HEX_INT},
350 {border_left_styleW, DISPID_IHTMLSTYLE_BORDERLEFTSTYLE, 0, border_style_values},
351 {border_left_widthW, DISPID_IHTMLSTYLE_BORDERLEFTWIDTH, ATTR_FIX_PX},
352 {border_rightW, DISPID_IHTMLSTYLE_BORDERRIGHT, ATTR_FIX_PX},
353 {border_right_colorW, DISPID_IHTMLSTYLE_BORDERRIGHTCOLOR, ATTR_HEX_INT},
354 {border_right_styleW, DISPID_IHTMLSTYLE_BORDERRIGHTSTYLE, 0, border_style_values},
355 {border_right_widthW, DISPID_IHTMLSTYLE_BORDERRIGHTWIDTH, ATTR_FIX_PX},
356 {border_styleW, DISPID_IHTMLSTYLE_BORDERSTYLE},
357 {border_topW, DISPID_IHTMLSTYLE_BORDERTOP, ATTR_FIX_PX},
358 {border_top_colorW, DISPID_IHTMLSTYLE_BORDERTOPCOLOR, ATTR_HEX_INT},
359 {border_top_styleW, DISPID_IHTMLSTYLE_BORDERTOPSTYLE, 0, border_style_values},
360 {border_top_widthW, DISPID_IHTMLSTYLE_BORDERTOPWIDTH},
361 {border_widthW, DISPID_IHTMLSTYLE_BORDERWIDTH},
362 {bottomW, DISPID_IHTMLSTYLE2_BOTTOM, ATTR_FIX_PX},
363 {box_sizingW, DISPID_IHTMLSTYLE6_BOXSIZING},
364 {clearW, DISPID_IHTMLSTYLE_CLEAR},
365 {clipW, DISPID_IHTMLSTYLE_CLIP, ATTR_REMOVE_COMMA},
366 {colorW, DISPID_IHTMLSTYLE_COLOR, ATTR_HEX_INT},
367 {cursorW, DISPID_IHTMLSTYLE_CURSOR},
368 {directionW, DISPID_IHTMLSTYLE2_DIRECTION},
369 {displayW, DISPID_IHTMLSTYLE_DISPLAY},
370 {filterW, DISPID_IHTMLSTYLE_FILTER},
371 {floatW, DISPID_IHTMLSTYLE_STYLEFLOAT},
372 {font_familyW, DISPID_IHTMLSTYLE_FONTFAMILY},
373 {font_sizeW, DISPID_IHTMLSTYLE_FONTSIZE, ATTR_FIX_PX},
374 {font_styleW, DISPID_IHTMLSTYLE_FONTSTYLE, 0, font_style_values},
375 {font_variantW, DISPID_IHTMLSTYLE_FONTVARIANT, 0, font_variant_values},
376 {font_weightW, DISPID_IHTMLSTYLE_FONTWEIGHT, ATTR_STR_TO_INT, font_weight_values},
377 {heightW, DISPID_IHTMLSTYLE_HEIGHT, ATTR_FIX_PX},
378 {leftW, DISPID_IHTMLSTYLE_LEFT},
379 {letter_spacingW, DISPID_IHTMLSTYLE_LETTERSPACING},
380 {line_heightW, DISPID_IHTMLSTYLE_LINEHEIGHT},
381 {list_styleW, DISPID_IHTMLSTYLE_LISTSTYLE},
382 {list_style_positionW, DISPID_IHTMLSTYLE_LISTSTYLEPOSITION},
383 {list_style_typeW, DISPID_IHTMLSTYLE_LISTSTYLETYPE},
384 {marginW, DISPID_IHTMLSTYLE_MARGIN},
385 {margin_bottomW, DISPID_IHTMLSTYLE_MARGINBOTTOM, ATTR_FIX_PX},
386 {margin_leftW, DISPID_IHTMLSTYLE_MARGINLEFT, ATTR_FIX_PX},
387 {margin_rightW, DISPID_IHTMLSTYLE_MARGINRIGHT, ATTR_FIX_PX},
388 {margin_topW, DISPID_IHTMLSTYLE_MARGINTOP, ATTR_FIX_PX},
389 {max_heightW, DISPID_IHTMLSTYLE5_MAXHEIGHT, ATTR_FIX_PX},
390 {max_widthW, DISPID_IHTMLSTYLE5_MAXWIDTH, ATTR_FIX_PX},
391 {min_heightW, DISPID_IHTMLSTYLE4_MINHEIGHT},
392 {min_widthW, DISPID_IHTMLSTYLE5_MINWIDTH, ATTR_FIX_PX},
393 {outlineW, DISPID_IHTMLSTYLE6_OUTLINE, ATTR_NO_NULL},
394 {overflowW, DISPID_IHTMLSTYLE_OVERFLOW, 0, overflow_values},
395 {overflow_xW, DISPID_IHTMLSTYLE2_OVERFLOWX},
396 {overflow_yW, DISPID_IHTMLSTYLE2_OVERFLOWY},
397 {paddingW, DISPID_IHTMLSTYLE_PADDING},
398 {padding_bottomW, DISPID_IHTMLSTYLE_PADDINGBOTTOM, ATTR_FIX_PX},
399 {padding_leftW, DISPID_IHTMLSTYLE_PADDINGLEFT, ATTR_FIX_PX},
400 {padding_rightW, DISPID_IHTMLSTYLE_PADDINGRIGHT, ATTR_FIX_PX},
401 {padding_topW, DISPID_IHTMLSTYLE_PADDINGTOP, ATTR_FIX_PX},
402 {page_break_afterW, DISPID_IHTMLSTYLE_PAGEBREAKAFTER},
403 {page_break_beforeW, DISPID_IHTMLSTYLE_PAGEBREAKBEFORE},
404 {positionW, DISPID_IHTMLSTYLE2_POSITION},
405 {rightW, DISPID_IHTMLSTYLE2_RIGHT},
406 {table_layoutW, DISPID_IHTMLSTYLE2_TABLELAYOUT},
407 {text_alignW, DISPID_IHTMLSTYLE_TEXTALIGN},
408 {text_decorationW, DISPID_IHTMLSTYLE_TEXTDECORATION, 0, text_decoration_values},
409 {text_indentW, DISPID_IHTMLSTYLE_TEXTINDENT, ATTR_FIX_PX},
410 {text_transformW, DISPID_IHTMLSTYLE_TEXTTRANSFORM},
411 {topW, DISPID_IHTMLSTYLE_TOP},
412 {vertical_alignW, DISPID_IHTMLSTYLE_VERTICALALIGN, ATTR_FIX_PX},
413 {visibilityW, DISPID_IHTMLSTYLE_VISIBILITY},
414 {white_spaceW, DISPID_IHTMLSTYLE_WHITESPACE},
415 {widthW, DISPID_IHTMLSTYLE_WIDTH, ATTR_FIX_PX},
416 {word_spacingW, DISPID_IHTMLSTYLE_WORDSPACING},
417 {word_wrapW, DISPID_IHTMLSTYLE3_WORDWRAP},
418 {z_indexW, DISPID_IHTMLSTYLE_ZINDEX, ATTR_STR_TO_INT}
421 C_ASSERT(ARRAY_SIZE(style_tbl) == STYLEID_MAX_VALUE);
423 static const WCHAR px_formatW[] = {'%','d','p','x',0};
424 static const WCHAR emptyW[] = {0};
426 static const style_tbl_entry_t *lookup_style_tbl(const WCHAR *name)
428 int c, i, min = 0, max = ARRAY_SIZE(style_tbl)-1;
430 while(min <= max) {
431 i = (min+max)/2;
433 c = strcmpW(style_tbl[i].name, name);
434 if(!c)
435 return style_tbl+i;
437 if(c > 0)
438 max = i-1;
439 else
440 min = i+1;
443 return NULL;
446 static inline compat_mode_t get_style_compat_mode(HTMLStyle *style)
448 return style->elem && style->elem->node.doc ? style->elem->node.doc->document_mode : COMPAT_MODE_QUIRKS;
451 static LPWSTR fix_px_value(LPCWSTR val)
453 LPCWSTR ptr = val;
455 while(*ptr) {
456 while(*ptr && isspaceW(*ptr))
457 ptr++;
458 if(!*ptr)
459 break;
461 while(*ptr && isdigitW(*ptr))
462 ptr++;
464 if(!*ptr || isspaceW(*ptr)) {
465 LPWSTR ret, p;
466 int len = strlenW(val)+1;
468 ret = heap_alloc((len+2)*sizeof(WCHAR));
469 memcpy(ret, val, (ptr-val)*sizeof(WCHAR));
470 p = ret + (ptr-val);
471 *p++ = 'p';
472 *p++ = 'x';
473 strcpyW(p, ptr);
475 TRACE("fixed %s -> %s\n", debugstr_w(val), debugstr_w(ret));
477 return ret;
480 while(*ptr && !isspaceW(*ptr))
481 ptr++;
484 return NULL;
487 static LPWSTR fix_url_value(LPCWSTR val)
489 WCHAR *ret, *ptr;
491 static const WCHAR urlW[] = {'u','r','l','('};
493 if(strncmpW(val, urlW, ARRAY_SIZE(urlW)) || !strchrW(val, '\\'))
494 return NULL;
496 ret = heap_strdupW(val);
498 for(ptr = ret; *ptr; ptr++) {
499 if(*ptr == '\\')
500 *ptr = '/';
503 return ret;
506 static HRESULT set_nsstyle_property(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, const WCHAR *value)
508 nsAString str_name, str_value, str_empty;
509 nsresult nsres;
511 nsAString_InitDepend(&str_name, style_tbl[sid].name);
512 nsAString_InitDepend(&str_value, value);
513 nsAString_InitDepend(&str_empty, emptyW);
515 nsres = nsIDOMCSSStyleDeclaration_SetProperty(nsstyle, &str_name, &str_value, &str_empty);
516 if(NS_FAILED(nsres))
517 ERR("SetProperty failed: %08x\n", nsres);
519 nsAString_Finish(&str_name);
520 nsAString_Finish(&str_value);
521 nsAString_Finish(&str_empty);
523 return S_OK;
526 static HRESULT var_to_styleval(HTMLStyle *style, const VARIANT *v, styleid_t sid, WCHAR *buf, const WCHAR **ret)
528 switch(V_VT(v)) {
529 case VT_NULL:
530 *ret = emptyW;
531 return S_OK;
533 case VT_BSTR:
534 *ret = V_BSTR(v);
535 return S_OK;
537 case VT_BSTR|VT_BYREF:
538 *ret = *V_BSTRREF(v);
539 return S_OK;
541 case VT_I4: {
542 unsigned flags = dispex_compat_mode(&style->dispex) < COMPAT_MODE_IE9 ? style_tbl[sid].flags : 0;
543 static const WCHAR formatW[] = {'%','d',0};
544 static const WCHAR hex_formatW[] = {'#','%','0','6','x',0};
546 if(flags & ATTR_HEX_INT)
547 wsprintfW(buf, hex_formatW, V_I4(v));
548 else if(flags & ATTR_FIX_PX)
549 wsprintfW(buf, px_formatW, V_I4(v));
550 else
551 wsprintfW(buf, formatW, V_I4(v));
553 *ret = buf;
554 return S_OK;
556 default:
557 FIXME("not implemented for %s\n", debugstr_variant(v));
558 return E_NOTIMPL;
563 static inline HRESULT set_style_property(HTMLStyle *style, styleid_t sid, const WCHAR *value)
565 WCHAR *val = NULL;
566 HRESULT hres;
568 if(value && *value && dispex_compat_mode(&style->dispex) < COMPAT_MODE_IE9) {
569 unsigned flags = style_tbl[sid].flags;
571 if(style_tbl[sid].allowed_values) {
572 const WCHAR **iter;
573 for(iter = style_tbl[sid].allowed_values; *iter; iter++) {
574 if(!strcmpiW(*iter, value))
575 break;
577 if(!*iter) {
578 WARN("invalid value %s\n", debugstr_w(value));
579 set_nsstyle_property(style->nsstyle, sid, emptyW);
580 return E_INVALIDARG;
584 if(flags & ATTR_FIX_PX)
585 val = fix_px_value(value);
586 else if(flags & ATTR_FIX_URL)
587 val = fix_url_value(value);
590 hres = set_nsstyle_property(style->nsstyle, sid, val ? val : value);
591 heap_free(val);
592 return hres;
595 static HRESULT set_style_property_var(HTMLStyle *style, styleid_t sid, VARIANT *value)
597 const WCHAR *val;
598 WCHAR buf[14];
599 HRESULT hres;
601 hres = var_to_styleval(style, value, sid, buf, &val);
602 if(FAILED(hres))
603 return hres;
605 return set_style_property(style, sid, val);
608 static HRESULT get_nsstyle_attr_nsval(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, nsAString *value)
610 nsAString str_name;
611 nsresult nsres;
613 nsAString_InitDepend(&str_name, style_tbl[sid].name);
614 nsres = nsIDOMCSSStyleDeclaration_GetPropertyValue(nsstyle, &str_name, value);
615 nsAString_Finish(&str_name);
616 if(NS_FAILED(nsres)) {
617 ERR("SetProperty failed: %08x\n", nsres);
618 return E_FAIL;
621 return S_OK;
624 static HRESULT nsstyle_to_bstr(const WCHAR *val, DWORD flags, BSTR *p)
626 BSTR ret;
627 DWORD len;
629 if(!*val) {
630 *p = (flags & ATTR_NO_NULL) ? SysAllocStringLen(NULL, 0) : NULL;
631 return S_OK;
634 ret = SysAllocString(val);
635 if(!ret)
636 return E_OUTOFMEMORY;
638 len = SysStringLen(ret);
640 if(flags & ATTR_REMOVE_COMMA) {
641 DWORD new_len = len;
642 WCHAR *ptr, *ptr2;
644 for(ptr = ret; (ptr = strchrW(ptr, ',')); ptr++)
645 new_len--;
647 if(new_len != len) {
648 BSTR new_ret;
650 new_ret = SysAllocStringLen(NULL, new_len);
651 if(!new_ret) {
652 SysFreeString(ret);
653 return E_OUTOFMEMORY;
656 for(ptr2 = new_ret, ptr = ret; *ptr; ptr++) {
657 if(*ptr != ',')
658 *ptr2++ = *ptr;
661 SysFreeString(ret);
662 ret = new_ret;
666 *p = ret;
667 return S_OK;
670 HRESULT get_nsstyle_property(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, compat_mode_t compat_mode, BSTR *p)
672 nsAString str_value;
673 const PRUnichar *value;
674 HRESULT hres;
676 nsAString_Init(&str_value, NULL);
678 get_nsstyle_attr_nsval(nsstyle, sid, &str_value);
680 nsAString_GetData(&str_value, &value);
681 hres = nsstyle_to_bstr(value, compat_mode < COMPAT_MODE_IE9 ? style_tbl[sid].flags : 0, p);
682 nsAString_Finish(&str_value);
684 TRACE("%s -> %s\n", debugstr_w(style_tbl[sid].name), debugstr_w(*p));
685 return hres;
688 HRESULT get_nsstyle_property_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, VARIANT *p)
690 nsAString str_value;
691 const PRUnichar *value;
692 BOOL set = FALSE;
693 unsigned flags;
694 HRESULT hres = S_OK;
696 flags = style_tbl[sid].flags;
697 nsAString_Init(&str_value, NULL);
699 get_nsstyle_attr_nsval(nsstyle, sid, &str_value);
701 nsAString_GetData(&str_value, &value);
703 if(flags & ATTR_STR_TO_INT) {
704 const PRUnichar *ptr = value;
705 BOOL neg = FALSE;
706 INT i = 0;
708 if(*ptr == '-') {
709 neg = TRUE;
710 ptr++;
713 while(isdigitW(*ptr))
714 i = i*10 + (*ptr++ - '0');
716 if(!*ptr) {
717 V_VT(p) = VT_I4;
718 V_I4(p) = neg ? -i : i;
719 set = TRUE;
723 if(!set) {
724 BSTR str;
726 hres = nsstyle_to_bstr(value, flags, &str);
727 if(SUCCEEDED(hres)) {
728 V_VT(p) = VT_BSTR;
729 V_BSTR(p) = str;
733 nsAString_Finish(&str_value);
735 TRACE("%s -> %s\n", debugstr_w(style_tbl[sid].name), debugstr_variant(p));
736 return S_OK;
739 static inline HRESULT get_style_property(HTMLStyle *This, styleid_t sid, BSTR *p)
741 return get_nsstyle_property(This->nsstyle, sid, dispex_compat_mode(&This->dispex), p);
744 static inline HRESULT get_style_property_var(HTMLStyle *This, styleid_t sid, VARIANT *v)
746 return get_nsstyle_property_var(This->nsstyle, sid, v);
749 static HRESULT check_style_attr_value(HTMLStyle *This, styleid_t sid, LPCWSTR exval, VARIANT_BOOL *p)
751 nsAString str_value;
752 const PRUnichar *value;
754 nsAString_Init(&str_value, NULL);
756 get_nsstyle_attr_nsval(This->nsstyle, sid, &str_value);
758 nsAString_GetData(&str_value, &value);
759 *p = variant_bool(!strcmpW(value, exval));
760 nsAString_Finish(&str_value);
762 TRACE("%s -> %x\n", debugstr_w(style_tbl[sid].name), *p);
763 return S_OK;
766 static inline HRESULT set_style_pos(HTMLStyle *This, styleid_t sid, float value)
768 WCHAR szValue[25];
769 WCHAR szFormat[] = {'%','.','0','f','p','x',0};
771 value = floor(value);
773 sprintfW(szValue, szFormat, value);
775 return set_style_property(This, sid, szValue);
778 static HRESULT set_style_pxattr(HTMLStyle *style, styleid_t sid, LONG value)
780 WCHAR value_str[16];
782 sprintfW(value_str, px_formatW, value);
784 return set_style_property(style, sid, value_str);
787 static HRESULT get_nsstyle_pos(HTMLStyle *This, styleid_t sid, float *p)
789 nsAString str_value;
790 HRESULT hres;
792 TRACE("%p %d %p\n", This, sid, p);
794 *p = 0.0f;
796 nsAString_Init(&str_value, NULL);
798 hres = get_nsstyle_attr_nsval(This->nsstyle, sid, &str_value);
799 if(hres == S_OK)
801 WCHAR *ptr;
802 const PRUnichar *value;
804 nsAString_GetData(&str_value, &value);
805 if(value)
807 *p = strtolW(value, &ptr, 10);
809 if(*ptr && strcmpW(ptr, pxW))
811 nsAString_Finish(&str_value);
812 FIXME("only px values are currently supported\n");
813 hres = E_FAIL;
818 TRACE("ret %f\n", *p);
820 nsAString_Finish(&str_value);
821 return hres;
824 static HRESULT get_nsstyle_pixel_val(HTMLStyle *This, styleid_t sid, LONG *p)
826 nsAString str_value;
827 HRESULT hres;
829 if(!p)
830 return E_POINTER;
832 nsAString_Init(&str_value, NULL);
834 hres = get_nsstyle_attr_nsval(This->nsstyle, sid, &str_value);
835 if(hres == S_OK) {
836 WCHAR *ptr = NULL;
837 const PRUnichar *value;
839 nsAString_GetData(&str_value, &value);
840 if(value) {
841 *p = strtolW(value, &ptr, 10);
843 if(*ptr == '.') {
844 /* Skip all digits. We have tests showing that we should not round the value. */
845 while(isdigitW(*++ptr));
849 if(!ptr || (*ptr && strcmpW(ptr, pxW)))
850 *p = 0;
853 nsAString_Finish(&str_value);
854 return hres;
857 static BOOL is_valid_border_style(BSTR v)
859 return !v || strcmpiW(v, noneW) == 0 || strcmpiW(v, dottedW) == 0 ||
860 strcmpiW(v, dashedW) == 0 || strcmpiW(v, solidW) == 0 ||
861 strcmpiW(v, doubleW) == 0 || strcmpiW(v, grooveW) == 0 ||
862 strcmpiW(v, ridgeW) == 0 || strcmpiW(v, insetW) == 0 ||
863 strcmpiW(v, outsetW) == 0;
866 static inline HTMLStyle *impl_from_IHTMLStyle(IHTMLStyle *iface)
868 return CONTAINING_RECORD(iface, HTMLStyle, IHTMLStyle_iface);
871 static HRESULT WINAPI HTMLStyle_QueryInterface(IHTMLStyle *iface, REFIID riid, void **ppv)
873 HTMLStyle *This = impl_from_IHTMLStyle(iface);
875 TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
877 if(IsEqualGUID(&IID_IUnknown, riid)) {
878 *ppv = &This->IHTMLStyle_iface;
879 }else if(IsEqualGUID(&IID_IHTMLStyle, riid)) {
880 *ppv = &This->IHTMLStyle_iface;
881 }else if(IsEqualGUID(&IID_IHTMLStyle2, riid)) {
882 *ppv = &This->IHTMLStyle2_iface;
883 }else if(IsEqualGUID(&IID_IHTMLStyle3, riid)) {
884 *ppv = &This->IHTMLStyle3_iface;
885 }else if(IsEqualGUID(&IID_IHTMLStyle4, riid)) {
886 *ppv = &This->IHTMLStyle4_iface;
887 }else if(IsEqualGUID(&IID_IHTMLStyle5, riid)) {
888 *ppv = &This->IHTMLStyle5_iface;
889 }else if(IsEqualGUID(&IID_IHTMLStyle6, riid)) {
890 *ppv = &This->IHTMLStyle6_iface;
891 }else if(dispex_query_interface(&This->dispex, riid, ppv)) {
892 return *ppv ? S_OK : E_NOINTERFACE;
893 }else {
894 *ppv = NULL;
895 WARN("unsupported iface %s\n", debugstr_mshtml_guid(riid));
896 return E_NOINTERFACE;
899 IUnknown_AddRef((IUnknown*)*ppv);
900 return S_OK;
903 static ULONG WINAPI HTMLStyle_AddRef(IHTMLStyle *iface)
905 HTMLStyle *This = impl_from_IHTMLStyle(iface);
906 LONG ref = InterlockedIncrement(&This->ref);
908 TRACE("(%p) ref=%d\n", This, ref);
910 return ref;
913 static ULONG WINAPI HTMLStyle_Release(IHTMLStyle *iface)
915 HTMLStyle *This = impl_from_IHTMLStyle(iface);
916 LONG ref = InterlockedDecrement(&This->ref);
918 TRACE("(%p) ref=%d\n", This, ref);
920 if(!ref) {
921 assert(!This->elem);
922 if(This->nsstyle)
923 nsIDOMCSSStyleDeclaration_Release(This->nsstyle);
924 release_dispex(&This->dispex);
925 heap_free(This);
928 return ref;
931 static HRESULT WINAPI HTMLStyle_GetTypeInfoCount(IHTMLStyle *iface, UINT *pctinfo)
933 HTMLStyle *This = impl_from_IHTMLStyle(iface);
934 return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
937 static HRESULT WINAPI HTMLStyle_GetTypeInfo(IHTMLStyle *iface, UINT iTInfo,
938 LCID lcid, ITypeInfo **ppTInfo)
940 HTMLStyle *This = impl_from_IHTMLStyle(iface);
941 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
944 static HRESULT WINAPI HTMLStyle_GetIDsOfNames(IHTMLStyle *iface, REFIID riid,
945 LPOLESTR *rgszNames, UINT cNames,
946 LCID lcid, DISPID *rgDispId)
948 HTMLStyle *This = impl_from_IHTMLStyle(iface);
949 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
950 lcid, rgDispId);
953 static HRESULT WINAPI HTMLStyle_Invoke(IHTMLStyle *iface, DISPID dispIdMember,
954 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
955 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
957 HTMLStyle *This = impl_from_IHTMLStyle(iface);
958 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
959 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
962 static HRESULT WINAPI HTMLStyle_put_fontFamily(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_FAMILY, v);
971 static HRESULT WINAPI HTMLStyle_get_fontFamily(IHTMLStyle *iface, BSTR *p)
973 HTMLStyle *This = impl_from_IHTMLStyle(iface);
975 TRACE("(%p)->(%p)\n", This, p);
977 return get_style_property(This, STYLEID_FONT_FAMILY, p);
980 static HRESULT WINAPI HTMLStyle_put_fontStyle(IHTMLStyle *iface, BSTR v)
982 HTMLStyle *This = impl_from_IHTMLStyle(iface);
984 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
986 return set_style_property(This, STYLEID_FONT_STYLE, v);
989 static HRESULT WINAPI HTMLStyle_get_fontStyle(IHTMLStyle *iface, BSTR *p)
991 HTMLStyle *This = impl_from_IHTMLStyle(iface);
993 TRACE("(%p)->(%p)\n", This, p);
995 return get_style_property(This, STYLEID_FONT_STYLE, p);
998 static HRESULT WINAPI HTMLStyle_put_fontVariant(IHTMLStyle *iface, BSTR v)
1000 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1002 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1004 return set_style_property(This, STYLEID_FONT_VARIANT, v);
1007 static HRESULT WINAPI HTMLStyle_get_fontVariant(IHTMLStyle *iface, BSTR *p)
1009 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1010 TRACE("(%p)->(%p)\n", This, p);
1012 if(!p)
1013 return E_INVALIDARG;
1015 return get_style_property(This, STYLEID_FONT_VARIANT, p);
1018 static HRESULT WINAPI HTMLStyle_put_fontWeight(IHTMLStyle *iface, BSTR v)
1020 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1022 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1024 return set_style_property(This, STYLEID_FONT_WEIGHT, v);
1027 static HRESULT WINAPI HTMLStyle_get_fontWeight(IHTMLStyle *iface, BSTR *p)
1029 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1031 TRACE("(%p)->(%p)\n", This, p);
1033 return get_style_property(This, STYLEID_FONT_WEIGHT, p);
1036 static HRESULT WINAPI HTMLStyle_put_fontSize(IHTMLStyle *iface, VARIANT v)
1038 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1040 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1042 return set_style_property_var(This, STYLEID_FONT_SIZE, &v);
1045 static HRESULT WINAPI HTMLStyle_get_fontSize(IHTMLStyle *iface, VARIANT *p)
1047 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1049 TRACE("(%p)->(%p)\n", This, p);
1051 return get_style_property_var(This, STYLEID_FONT_SIZE, p);
1054 static HRESULT WINAPI HTMLStyle_put_font(IHTMLStyle *iface, BSTR v)
1056 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1057 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1058 return E_NOTIMPL;
1061 static HRESULT WINAPI HTMLStyle_get_font(IHTMLStyle *iface, BSTR *p)
1063 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1064 FIXME("(%p)->(%p)\n", This, p);
1065 return E_NOTIMPL;
1068 static HRESULT WINAPI HTMLStyle_put_color(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_COLOR, &v);
1077 static HRESULT WINAPI HTMLStyle_get_color(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_COLOR, p);
1086 static HRESULT WINAPI HTMLStyle_put_background(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, v);
1095 static HRESULT WINAPI HTMLStyle_get_background(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, p);
1104 static HRESULT WINAPI HTMLStyle_put_backgroundColor(IHTMLStyle *iface, VARIANT v)
1106 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1108 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1110 return set_style_property_var(This, STYLEID_BACKGROUND_COLOR, &v);
1113 static HRESULT WINAPI HTMLStyle_get_backgroundColor(IHTMLStyle *iface, VARIANT *p)
1115 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1117 TRACE("(%p)->(%p)\n", This, p);
1119 return get_style_property_var(This, STYLEID_BACKGROUND_COLOR, p);
1122 static HRESULT WINAPI HTMLStyle_put_backgroundImage(IHTMLStyle *iface, BSTR v)
1124 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1126 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1128 return set_style_property(This, STYLEID_BACKGROUND_IMAGE, v);
1131 static HRESULT WINAPI HTMLStyle_get_backgroundImage(IHTMLStyle *iface, BSTR *p)
1133 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1135 TRACE("(%p)->(%p)\n", This, p);
1137 return get_style_property(This, STYLEID_BACKGROUND_IMAGE, p);
1140 static HRESULT WINAPI HTMLStyle_put_backgroundRepeat(IHTMLStyle *iface, BSTR v)
1142 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1144 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1146 return set_style_property(This, STYLEID_BACKGROUND_REPEAT , v);
1149 static HRESULT WINAPI HTMLStyle_get_backgroundRepeat(IHTMLStyle *iface, BSTR *p)
1151 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1153 TRACE("(%p)->(%p)\n", This, p);
1155 return get_style_property(This, STYLEID_BACKGROUND_REPEAT, p);
1158 static HRESULT WINAPI HTMLStyle_put_backgroundAttachment(IHTMLStyle *iface, BSTR v)
1160 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1162 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1164 return set_style_property(This, STYLEID_BACKGROUND_ATTACHMENT, v);
1167 static HRESULT WINAPI HTMLStyle_get_backgroundAttachment(IHTMLStyle *iface, BSTR *p)
1169 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1171 TRACE("(%p)->(%p)\n", This, p);
1173 return get_style_property(This, STYLEID_BACKGROUND_ATTACHMENT, p);
1176 static HRESULT WINAPI HTMLStyle_put_backgroundPosition(IHTMLStyle *iface, BSTR v)
1178 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1180 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1182 return set_style_property(This, STYLEID_BACKGROUND_POSITION, v);
1185 static HRESULT WINAPI HTMLStyle_get_backgroundPosition(IHTMLStyle *iface, BSTR *p)
1187 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1189 TRACE("(%p)->(%p)\n", This, p);
1191 return get_style_property(This, STYLEID_BACKGROUND_POSITION, p);
1194 static HRESULT WINAPI HTMLStyle_put_backgroundPositionX(IHTMLStyle *iface, VARIANT v)
1196 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1197 WCHAR buf[14], *pos_val;
1198 nsAString pos_str;
1199 const WCHAR *val;
1200 DWORD val_len;
1201 HRESULT hres;
1203 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1205 hres = var_to_styleval(This, &v, STYLEID_BACKGROUND_POSITION_X, buf, &val);
1206 if(FAILED(hres))
1207 return hres;
1209 val_len = val ? strlenW(val) : 0;
1211 nsAString_Init(&pos_str, NULL);
1212 hres = get_nsstyle_attr_nsval(This->nsstyle, STYLEID_BACKGROUND_POSITION, &pos_str);
1213 if(SUCCEEDED(hres)) {
1214 const PRUnichar *pos, *posy;
1215 DWORD posy_len;
1217 nsAString_GetData(&pos_str, &pos);
1218 posy = strchrW(pos, ' ');
1219 if(!posy) {
1220 static const WCHAR zero_pxW[] = {' ','0','p','x',0};
1222 TRACE("no space in %s\n", debugstr_w(pos));
1223 posy = zero_pxW;
1226 posy_len = strlenW(posy);
1227 pos_val = heap_alloc((val_len+posy_len+1)*sizeof(WCHAR));
1228 if(pos_val) {
1229 if(val_len)
1230 memcpy(pos_val, val, val_len*sizeof(WCHAR));
1231 if(posy_len)
1232 memcpy(pos_val+val_len, posy, posy_len*sizeof(WCHAR));
1233 pos_val[val_len+posy_len] = 0;
1234 }else {
1235 hres = E_OUTOFMEMORY;
1238 nsAString_Finish(&pos_str);
1239 if(FAILED(hres))
1240 return hres;
1242 TRACE("setting position to %s\n", debugstr_w(pos_val));
1243 hres = set_style_property(This, STYLEID_BACKGROUND_POSITION, pos_val);
1244 heap_free(pos_val);
1245 return hres;
1248 static HRESULT WINAPI HTMLStyle_get_backgroundPositionX(IHTMLStyle *iface, VARIANT *p)
1250 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1251 nsAString pos_str;
1252 BSTR ret;
1253 HRESULT hres;
1255 TRACE("(%p)->(%p)\n", This, p);
1257 nsAString_Init(&pos_str, NULL);
1258 hres = get_nsstyle_attr_nsval(This->nsstyle, STYLEID_BACKGROUND_POSITION, &pos_str);
1259 if(SUCCEEDED(hres)) {
1260 const PRUnichar *pos, *space;
1262 nsAString_GetData(&pos_str, &pos);
1263 space = strchrW(pos, ' ');
1264 if(!space) {
1265 WARN("no space in %s\n", debugstr_w(pos));
1266 space = pos + strlenW(pos);
1269 if(space != pos) {
1270 ret = SysAllocStringLen(pos, space-pos);
1271 if(!ret)
1272 hres = E_OUTOFMEMORY;
1273 }else {
1274 ret = NULL;
1277 nsAString_Finish(&pos_str);
1278 if(FAILED(hres))
1279 return hres;
1281 TRACE("returning %s\n", debugstr_w(ret));
1282 V_VT(p) = VT_BSTR;
1283 V_BSTR(p) = ret;
1284 return S_OK;
1287 static HRESULT WINAPI HTMLStyle_put_backgroundPositionY(IHTMLStyle *iface, VARIANT v)
1289 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1290 WCHAR buf[14], *pos_val;
1291 nsAString pos_str;
1292 const WCHAR *val;
1293 DWORD val_len;
1294 HRESULT hres;
1296 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1298 hres = var_to_styleval(This, &v, STYLEID_BACKGROUND_POSITION, buf, &val);
1299 if(FAILED(hres))
1300 return hres;
1302 val_len = val ? strlenW(val) : 0;
1304 nsAString_Init(&pos_str, NULL);
1305 hres = get_nsstyle_attr_nsval(This->nsstyle, STYLEID_BACKGROUND_POSITION, &pos_str);
1306 if(SUCCEEDED(hres)) {
1307 const PRUnichar *pos, *space;
1308 DWORD posx_len;
1310 nsAString_GetData(&pos_str, &pos);
1311 space = strchrW(pos, ' ');
1312 if(space) {
1313 space++;
1314 }else {
1315 static const WCHAR zero_pxW[] = {'0','p','x',' ',0};
1317 TRACE("no space in %s\n", debugstr_w(pos));
1318 pos = zero_pxW;
1319 space = pos + ARRAY_SIZE(zero_pxW)-1;
1322 posx_len = space-pos;
1324 pos_val = heap_alloc((posx_len+val_len+1)*sizeof(WCHAR));
1325 if(pos_val) {
1326 memcpy(pos_val, pos, posx_len*sizeof(WCHAR));
1327 if(val_len)
1328 memcpy(pos_val+posx_len, val, val_len*sizeof(WCHAR));
1329 pos_val[posx_len+val_len] = 0;
1330 }else {
1331 hres = E_OUTOFMEMORY;
1334 nsAString_Finish(&pos_str);
1335 if(FAILED(hres))
1336 return hres;
1338 TRACE("setting position to %s\n", debugstr_w(pos_val));
1339 hres = set_style_property(This, STYLEID_BACKGROUND_POSITION, pos_val);
1340 heap_free(pos_val);
1341 return hres;
1344 static HRESULT WINAPI HTMLStyle_get_backgroundPositionY(IHTMLStyle *iface, VARIANT *p)
1346 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1347 nsAString pos_str;
1348 BSTR ret;
1349 HRESULT hres;
1351 TRACE("(%p)->(%p)\n", This, p);
1353 nsAString_Init(&pos_str, NULL);
1354 hres = get_nsstyle_attr_nsval(This->nsstyle, STYLEID_BACKGROUND_POSITION, &pos_str);
1355 if(SUCCEEDED(hres)) {
1356 const PRUnichar *pos, *posy;
1358 nsAString_GetData(&pos_str, &pos);
1359 posy = strchrW(pos, ' ');
1360 if(posy) {
1361 ret = SysAllocString(posy+1);
1362 if(!ret)
1363 hres = E_OUTOFMEMORY;
1364 }else {
1365 ret = NULL;
1368 nsAString_Finish(&pos_str);
1369 if(FAILED(hres))
1370 return hres;
1372 TRACE("returning %s\n", debugstr_w(ret));
1373 V_VT(p) = VT_BSTR;
1374 V_BSTR(p) = ret;
1375 return S_OK;
1378 static HRESULT WINAPI HTMLStyle_put_wordSpacing(IHTMLStyle *iface, VARIANT v)
1380 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1382 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1384 return set_style_property_var(This, STYLEID_WORD_SPACING, &v);
1387 static HRESULT WINAPI HTMLStyle_get_wordSpacing(IHTMLStyle *iface, VARIANT *p)
1389 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1390 TRACE("(%p)->(%p)\n", This, p);
1391 return get_style_property_var(This, STYLEID_WORD_SPACING, p);
1394 static HRESULT WINAPI HTMLStyle_put_letterSpacing(IHTMLStyle *iface, VARIANT v)
1396 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1398 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1400 return set_style_property_var(This, STYLEID_LETTER_SPACING, &v);
1403 static HRESULT WINAPI HTMLStyle_get_letterSpacing(IHTMLStyle *iface, VARIANT *p)
1405 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1406 TRACE("(%p)->(%p)\n", This, p);
1407 return get_style_property_var(This, STYLEID_LETTER_SPACING, p);
1410 static HRESULT WINAPI HTMLStyle_put_textDecoration(IHTMLStyle *iface, BSTR v)
1412 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1414 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1416 return set_style_property(This, STYLEID_TEXT_DECORATION , v);
1419 static HRESULT WINAPI HTMLStyle_get_textDecoration(IHTMLStyle *iface, BSTR *p)
1421 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1423 TRACE("(%p)->(%p)\n", This, p);
1425 return get_style_property(This, STYLEID_TEXT_DECORATION, p);
1428 static HRESULT WINAPI HTMLStyle_put_textDecorationNone(IHTMLStyle *iface, VARIANT_BOOL v)
1430 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1432 TRACE("(%p)->(%x)\n", This, v);
1434 return set_style_property(This, STYLEID_TEXT_DECORATION, v ? noneW : emptyW);
1437 static HRESULT WINAPI HTMLStyle_get_textDecorationNone(IHTMLStyle *iface, VARIANT_BOOL *p)
1439 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1441 TRACE("(%p)->(%p)\n", This, p);
1443 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, noneW, p);
1446 static HRESULT WINAPI HTMLStyle_put_textDecorationUnderline(IHTMLStyle *iface, VARIANT_BOOL v)
1448 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1450 TRACE("(%p)->(%x)\n", This, v);
1452 return set_style_property(This, STYLEID_TEXT_DECORATION, v ? underlineW : emptyW);
1455 static HRESULT WINAPI HTMLStyle_get_textDecorationUnderline(IHTMLStyle *iface, VARIANT_BOOL *p)
1457 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1459 TRACE("(%p)->(%p)\n", This, p);
1461 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, underlineW, p);
1464 static HRESULT WINAPI HTMLStyle_put_textDecorationOverline(IHTMLStyle *iface, VARIANT_BOOL v)
1466 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1468 TRACE("(%p)->(%x)\n", This, v);
1470 return set_style_property(This, STYLEID_TEXT_DECORATION, v ? overlineW : emptyW);
1473 static HRESULT WINAPI HTMLStyle_get_textDecorationOverline(IHTMLStyle *iface, VARIANT_BOOL *p)
1475 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1477 TRACE("(%p)->(%p)\n", This, p);
1479 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, overlineW, p);
1482 static HRESULT WINAPI HTMLStyle_put_textDecorationLineThrough(IHTMLStyle *iface, VARIANT_BOOL v)
1484 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1486 TRACE("(%p)->(%x)\n", This, v);
1488 return set_style_property(This, STYLEID_TEXT_DECORATION, v ? line_throughW : emptyW);
1491 static HRESULT WINAPI HTMLStyle_get_textDecorationLineThrough(IHTMLStyle *iface, VARIANT_BOOL *p)
1493 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1495 TRACE("(%p)->(%p)\n", This, p);
1497 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, line_throughW, p);
1500 static HRESULT WINAPI HTMLStyle_put_textDecorationBlink(IHTMLStyle *iface, VARIANT_BOOL v)
1502 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1504 TRACE("(%p)->(%x)\n", This, v);
1506 return set_style_property(This, STYLEID_TEXT_DECORATION, v ? blinkW : emptyW);
1509 static HRESULT WINAPI HTMLStyle_get_textDecorationBlink(IHTMLStyle *iface, VARIANT_BOOL *p)
1511 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1513 TRACE("(%p)->(%p)\n", This, p);
1515 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, blinkW, p);
1518 static HRESULT WINAPI HTMLStyle_put_verticalAlign(IHTMLStyle *iface, VARIANT v)
1520 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1522 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1524 return set_style_property_var(This, STYLEID_VERTICAL_ALIGN, &v);
1527 static HRESULT WINAPI HTMLStyle_get_verticalAlign(IHTMLStyle *iface, VARIANT *p)
1529 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1531 TRACE("(%p)->(%p)\n", This, p);
1533 return get_style_property_var(This, STYLEID_VERTICAL_ALIGN, p);
1536 static HRESULT WINAPI HTMLStyle_put_textTransform(IHTMLStyle *iface, BSTR v)
1538 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1540 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1542 return set_style_property(This, STYLEID_TEXT_TRANSFORM, v);
1545 static HRESULT WINAPI HTMLStyle_get_textTransform(IHTMLStyle *iface, BSTR *p)
1547 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1549 TRACE("(%p)->(%p)\n", This, p);
1551 return get_style_property(This, STYLEID_TEXT_TRANSFORM, p);
1554 static HRESULT WINAPI HTMLStyle_put_textAlign(IHTMLStyle *iface, BSTR v)
1556 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1558 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1560 return set_style_property(This, STYLEID_TEXT_ALIGN, v);
1563 static HRESULT WINAPI HTMLStyle_get_textAlign(IHTMLStyle *iface, BSTR *p)
1565 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1567 TRACE("(%p)->(%p)\n", This, p);
1569 return get_style_property(This, STYLEID_TEXT_ALIGN, p);
1572 static HRESULT WINAPI HTMLStyle_put_textIndent(IHTMLStyle *iface, VARIANT v)
1574 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1576 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1578 return set_style_property_var(This, STYLEID_TEXT_INDENT, &v);
1581 static HRESULT WINAPI HTMLStyle_get_textIndent(IHTMLStyle *iface, VARIANT *p)
1583 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1585 TRACE("(%p)->(%p)\n", This, p);
1587 return get_style_property_var(This, STYLEID_TEXT_INDENT, p);
1590 static HRESULT WINAPI HTMLStyle_put_lineHeight(IHTMLStyle *iface, VARIANT v)
1592 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1594 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1596 return set_style_property_var(This, STYLEID_LINE_HEIGHT, &v);
1599 static HRESULT WINAPI HTMLStyle_get_lineHeight(IHTMLStyle *iface, VARIANT *p)
1601 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1603 TRACE("(%p)->(%p)\n", This, p);
1605 return get_style_property_var(This, STYLEID_LINE_HEIGHT, p);
1608 static HRESULT WINAPI HTMLStyle_put_marginTop(IHTMLStyle *iface, VARIANT v)
1610 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1612 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1614 return set_style_property_var(This, STYLEID_MARGIN_TOP, &v);
1617 static HRESULT WINAPI HTMLStyle_get_marginTop(IHTMLStyle *iface, VARIANT *p)
1619 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1621 TRACE("(%p)->(%p)\n", This, p);
1623 return get_style_property_var(This, STYLEID_MARGIN_TOP, p);
1626 static HRESULT WINAPI HTMLStyle_put_marginRight(IHTMLStyle *iface, VARIANT v)
1628 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1630 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1632 return set_style_property_var(This, STYLEID_MARGIN_RIGHT, &v);
1635 static HRESULT WINAPI HTMLStyle_get_marginRight(IHTMLStyle *iface, VARIANT *p)
1637 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1638 TRACE("(%p)->(%p)\n", This, p);
1639 return get_style_property_var(This, STYLEID_MARGIN_RIGHT, p);
1642 static HRESULT WINAPI HTMLStyle_put_marginBottom(IHTMLStyle *iface, VARIANT v)
1644 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1646 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1648 return set_style_property_var(This, STYLEID_MARGIN_BOTTOM, &v);
1651 static HRESULT WINAPI HTMLStyle_get_marginBottom(IHTMLStyle *iface, VARIANT *p)
1653 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1655 TRACE("(%p)->(%p)\n", This, p);
1657 return get_style_property_var(This, STYLEID_MARGIN_BOTTOM, p);
1660 static HRESULT WINAPI HTMLStyle_put_marginLeft(IHTMLStyle *iface, VARIANT v)
1662 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1664 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1666 return set_style_property_var(This, STYLEID_MARGIN_LEFT, &v);
1669 static HRESULT WINAPI HTMLStyle_put_margin(IHTMLStyle *iface, BSTR v)
1671 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1673 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1675 return set_style_property(This, STYLEID_MARGIN, v);
1678 static HRESULT WINAPI HTMLStyle_get_margin(IHTMLStyle *iface, BSTR *p)
1680 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1682 TRACE("(%p)->(%p)\n", This, p);
1684 return get_style_property(This, STYLEID_MARGIN, p);
1687 static HRESULT WINAPI HTMLStyle_get_marginLeft(IHTMLStyle *iface, VARIANT *p)
1689 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1690 TRACE("(%p)->(%p)\n", This, p);
1691 return get_style_property_var(This, STYLEID_MARGIN_LEFT, p);
1694 static HRESULT WINAPI HTMLStyle_put_paddingTop(IHTMLStyle *iface, VARIANT v)
1696 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1698 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1700 return set_style_property_var(This, STYLEID_PADDING_TOP, &v);
1703 static HRESULT WINAPI HTMLStyle_get_paddingTop(IHTMLStyle *iface, VARIANT *p)
1705 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1707 TRACE("(%p)->(%p)\n", This, p);
1709 return get_style_property_var(This, STYLEID_PADDING_TOP, p);
1712 static HRESULT WINAPI HTMLStyle_put_paddingRight(IHTMLStyle *iface, VARIANT v)
1714 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1716 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1718 return set_style_property_var(This, STYLEID_PADDING_RIGHT, &v);
1721 static HRESULT WINAPI HTMLStyle_get_paddingRight(IHTMLStyle *iface, VARIANT *p)
1723 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1725 TRACE("(%p)->(%p)\n", This, p);
1727 return get_style_property_var(This, STYLEID_PADDING_RIGHT, p);
1730 static HRESULT WINAPI HTMLStyle_put_paddingBottom(IHTMLStyle *iface, VARIANT v)
1732 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1734 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1736 return set_style_property_var(This, STYLEID_PADDING_BOTTOM, &v);
1739 static HRESULT WINAPI HTMLStyle_get_paddingBottom(IHTMLStyle *iface, VARIANT *p)
1741 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1743 TRACE("(%p)->(%p)\n", This, p);
1745 return get_style_property_var(This, STYLEID_PADDING_BOTTOM, p);
1748 static HRESULT WINAPI HTMLStyle_put_paddingLeft(IHTMLStyle *iface, VARIANT v)
1750 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1752 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1754 return set_style_property_var(This, STYLEID_PADDING_LEFT, &v);
1757 static HRESULT WINAPI HTMLStyle_get_paddingLeft(IHTMLStyle *iface, VARIANT *p)
1759 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1761 TRACE("(%p)->(%p)\n", This, p);
1763 return get_style_property_var(This, STYLEID_PADDING_LEFT, p);
1766 static HRESULT WINAPI HTMLStyle_put_padding(IHTMLStyle *iface, BSTR v)
1768 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1770 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1772 return set_style_property(This, STYLEID_PADDING, v);
1775 static HRESULT WINAPI HTMLStyle_get_padding(IHTMLStyle *iface, BSTR *p)
1777 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1779 TRACE("(%p)->(%p)\n", This, p);
1781 return get_style_property(This, STYLEID_PADDING, p);
1784 static HRESULT WINAPI HTMLStyle_put_border(IHTMLStyle *iface, BSTR v)
1786 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1788 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1790 return set_style_property(This, STYLEID_BORDER, v);
1793 static HRESULT WINAPI HTMLStyle_get_border(IHTMLStyle *iface, BSTR *p)
1795 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1797 TRACE("(%p)->(%p)\n", This, p);
1799 return get_style_property(This, STYLEID_BORDER, p);
1802 static HRESULT WINAPI HTMLStyle_put_borderTop(IHTMLStyle *iface, BSTR v)
1804 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1805 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1806 return set_style_property(This, STYLEID_BORDER_TOP, v);
1809 static HRESULT WINAPI HTMLStyle_get_borderTop(IHTMLStyle *iface, BSTR *p)
1811 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1812 TRACE("(%p)->(%p)\n", This, p);
1813 return get_style_property(This, STYLEID_BORDER_TOP, p);
1816 static HRESULT WINAPI HTMLStyle_put_borderRight(IHTMLStyle *iface, BSTR v)
1818 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1819 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1820 return set_style_property(This, STYLEID_BORDER_RIGHT, v);
1823 static HRESULT WINAPI HTMLStyle_get_borderRight(IHTMLStyle *iface, BSTR *p)
1825 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1826 TRACE("(%p)->(%p)\n", This, p);
1827 return get_style_property(This, STYLEID_BORDER_RIGHT, p);
1830 static HRESULT WINAPI HTMLStyle_put_borderBottom(IHTMLStyle *iface, BSTR v)
1832 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1833 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1834 return set_style_property(This, STYLEID_BORDER_BOTTOM, v);
1837 static HRESULT WINAPI HTMLStyle_get_borderBottom(IHTMLStyle *iface, BSTR *p)
1839 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1840 TRACE("(%p)->(%p)\n", This, p);
1841 return get_style_property(This, STYLEID_BORDER_BOTTOM, p);
1844 static HRESULT WINAPI HTMLStyle_put_borderLeft(IHTMLStyle *iface, BSTR v)
1846 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1848 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1850 return set_style_property(This, STYLEID_BORDER_LEFT, v);
1853 static HRESULT WINAPI HTMLStyle_get_borderLeft(IHTMLStyle *iface, BSTR *p)
1855 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1857 TRACE("(%p)->(%p)\n", This, p);
1859 return get_style_property(This, STYLEID_BORDER_LEFT, p);
1862 static HRESULT WINAPI HTMLStyle_put_borderColor(IHTMLStyle *iface, BSTR v)
1864 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1866 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1868 return set_style_property(This, STYLEID_BORDER_COLOR, v);
1871 static HRESULT WINAPI HTMLStyle_get_borderColor(IHTMLStyle *iface, BSTR *p)
1873 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1875 TRACE("(%p)->(%p)\n", This, p);
1877 return get_style_property(This, STYLEID_BORDER_COLOR, p);
1880 static HRESULT WINAPI HTMLStyle_put_borderTopColor(IHTMLStyle *iface, VARIANT v)
1882 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1884 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1886 return set_style_property_var(This, STYLEID_BORDER_TOP_COLOR, &v);
1889 static HRESULT WINAPI HTMLStyle_get_borderTopColor(IHTMLStyle *iface, VARIANT *p)
1891 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1893 TRACE("(%p)->(%p)\n", This, p);
1895 return get_style_property_var(This, STYLEID_BORDER_TOP_COLOR, p);
1898 static HRESULT WINAPI HTMLStyle_put_borderRightColor(IHTMLStyle *iface, VARIANT v)
1900 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1902 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1904 return set_style_property_var(This, STYLEID_BORDER_RIGHT_COLOR, &v);
1907 static HRESULT WINAPI HTMLStyle_get_borderRightColor(IHTMLStyle *iface, VARIANT *p)
1909 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1911 TRACE("(%p)->(%p)\n", This, p);
1913 return get_style_property_var(This, STYLEID_BORDER_RIGHT_COLOR, p);
1916 static HRESULT WINAPI HTMLStyle_put_borderBottomColor(IHTMLStyle *iface, VARIANT v)
1918 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1920 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1922 return set_style_property_var(This, STYLEID_BORDER_BOTTOM_COLOR, &v);
1925 static HRESULT WINAPI HTMLStyle_get_borderBottomColor(IHTMLStyle *iface, VARIANT *p)
1927 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1929 TRACE("(%p)->(%p)\n", This, p);
1931 return get_style_property_var(This, STYLEID_BORDER_BOTTOM_COLOR, p);
1934 static HRESULT WINAPI HTMLStyle_put_borderLeftColor(IHTMLStyle *iface, VARIANT v)
1936 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1938 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1940 return set_style_property_var(This, STYLEID_BORDER_LEFT_COLOR, &v);
1943 static HRESULT WINAPI HTMLStyle_get_borderLeftColor(IHTMLStyle *iface, VARIANT *p)
1945 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1947 TRACE("(%p)->(%p)\n", This, p);
1949 return get_style_property_var(This, STYLEID_BORDER_LEFT_COLOR, p);
1952 static HRESULT WINAPI HTMLStyle_put_borderWidth(IHTMLStyle *iface, BSTR v)
1954 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1955 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1956 return set_style_property(This, STYLEID_BORDER_WIDTH, v);
1959 static HRESULT WINAPI HTMLStyle_get_borderWidth(IHTMLStyle *iface, BSTR *p)
1961 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1962 TRACE("(%p)->(%p)\n", This, p);
1963 return get_style_property(This, STYLEID_BORDER_WIDTH, p);
1966 static HRESULT WINAPI HTMLStyle_put_borderTopWidth(IHTMLStyle *iface, VARIANT v)
1968 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1970 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1972 return set_style_property_var(This, STYLEID_BORDER_TOP_WIDTH, &v);
1975 static HRESULT WINAPI HTMLStyle_get_borderTopWidth(IHTMLStyle *iface, VARIANT *p)
1977 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1979 TRACE("(%p)->(%p)\n", This, p);
1981 return get_style_property_var(This, STYLEID_BORDER_TOP_WIDTH, p);
1984 static HRESULT WINAPI HTMLStyle_put_borderRightWidth(IHTMLStyle *iface, VARIANT v)
1986 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1988 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1990 return set_style_property_var(This, STYLEID_BORDER_RIGHT_WIDTH, &v);
1993 static HRESULT WINAPI HTMLStyle_get_borderRightWidth(IHTMLStyle *iface, VARIANT *p)
1995 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1997 TRACE("(%p)->(%p)\n", This, p);
1999 return get_style_property_var(This, STYLEID_BORDER_RIGHT_WIDTH, p);
2002 static HRESULT WINAPI HTMLStyle_put_borderBottomWidth(IHTMLStyle *iface, VARIANT v)
2004 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2006 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
2008 return set_style_property_var(This, STYLEID_BORDER_BOTTOM_WIDTH, &v);
2011 static HRESULT WINAPI HTMLStyle_get_borderBottomWidth(IHTMLStyle *iface, VARIANT *p)
2013 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2014 TRACE("(%p)->(%p)\n", This, p);
2015 return get_style_property_var(This, STYLEID_BORDER_BOTTOM_WIDTH, p);
2018 static HRESULT WINAPI HTMLStyle_put_borderLeftWidth(IHTMLStyle *iface, VARIANT v)
2020 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2022 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
2024 return set_style_property_var(This, STYLEID_BORDER_LEFT_WIDTH, &v);
2027 static HRESULT WINAPI HTMLStyle_get_borderLeftWidth(IHTMLStyle *iface, VARIANT *p)
2029 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2030 TRACE("(%p)->(%p)\n", This, p);
2031 return get_style_property_var(This, STYLEID_BORDER_LEFT_WIDTH, p);
2034 static HRESULT WINAPI HTMLStyle_put_borderStyle(IHTMLStyle *iface, BSTR v)
2036 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2037 static const WCHAR styleWindowInset[] = {'w','i','n','d','o','w','-','i','n','s','e','t',0};
2038 HRESULT hres = S_OK;
2039 BSTR pstyle;
2040 int i=0;
2041 int last = 0;
2043 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2045 while(v[i] && hres == S_OK)
2047 if(v[i] == (WCHAR)' ')
2049 pstyle = SysAllocStringLen(&v[last], (i-last));
2050 if( !(is_valid_border_style(pstyle) || strcmpiW(styleWindowInset, pstyle) == 0))
2052 TRACE("1. Invalid style (%s)\n", debugstr_w(pstyle));
2053 hres = E_INVALIDARG;
2055 SysFreeString(pstyle);
2056 last = i+1;
2058 i++;
2061 if(hres == S_OK)
2063 pstyle = SysAllocStringLen(&v[last], i-last);
2064 if( !(is_valid_border_style(pstyle) || strcmpiW(styleWindowInset, pstyle) == 0))
2066 TRACE("2. Invalid style (%s)\n", debugstr_w(pstyle));
2067 hres = E_INVALIDARG;
2069 SysFreeString(pstyle);
2072 if(hres == S_OK)
2073 hres = set_style_property(This, STYLEID_BORDER_STYLE, v);
2075 return hres;
2078 static HRESULT WINAPI HTMLStyle_get_borderStyle(IHTMLStyle *iface, BSTR *p)
2080 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2081 TRACE("(%p)->(%p)\n", This, p);
2082 return get_style_property(This, STYLEID_BORDER_STYLE, p);
2085 static HRESULT WINAPI HTMLStyle_put_borderTopStyle(IHTMLStyle *iface, BSTR v)
2087 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2088 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2089 return set_style_property(This, STYLEID_BORDER_TOP_STYLE, v);
2092 static HRESULT WINAPI HTMLStyle_get_borderTopStyle(IHTMLStyle *iface, BSTR *p)
2094 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2095 TRACE("(%p)->(%p)\n", This, p);
2096 return get_style_property(This, STYLEID_BORDER_TOP_STYLE, p);
2099 static HRESULT WINAPI HTMLStyle_put_borderRightStyle(IHTMLStyle *iface, BSTR v)
2101 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2102 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2103 return set_style_property(This, STYLEID_BORDER_RIGHT_STYLE, v);
2106 static HRESULT WINAPI HTMLStyle_get_borderRightStyle(IHTMLStyle *iface, BSTR *p)
2108 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2109 TRACE("(%p)->(%p)\n", This, p);
2110 return get_style_property(This, STYLEID_BORDER_RIGHT_STYLE, p);
2113 static HRESULT WINAPI HTMLStyle_put_borderBottomStyle(IHTMLStyle *iface, BSTR v)
2115 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2116 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2117 return set_style_property(This, STYLEID_BORDER_BOTTOM_STYLE, v);
2120 static HRESULT WINAPI HTMLStyle_get_borderBottomStyle(IHTMLStyle *iface, BSTR *p)
2122 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2123 TRACE("(%p)->(%p)\n", This, p);
2124 return get_style_property(This, STYLEID_BORDER_BOTTOM_STYLE, p);
2127 static HRESULT WINAPI HTMLStyle_put_borderLeftStyle(IHTMLStyle *iface, BSTR v)
2129 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2130 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2131 return set_style_property(This, STYLEID_BORDER_LEFT_STYLE, v);
2134 static HRESULT WINAPI HTMLStyle_get_borderLeftStyle(IHTMLStyle *iface, BSTR *p)
2136 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2137 TRACE("(%p)->(%p)\n", This, p);
2138 return get_style_property(This, STYLEID_BORDER_LEFT_STYLE, p);
2141 static HRESULT WINAPI HTMLStyle_put_width(IHTMLStyle *iface, VARIANT v)
2143 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2145 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
2147 return set_style_property_var(This, STYLEID_WIDTH, &v);
2150 static HRESULT WINAPI HTMLStyle_get_width(IHTMLStyle *iface, VARIANT *p)
2152 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2154 TRACE("(%p)->(%p)\n", This, p);
2156 return get_style_property_var(This, STYLEID_WIDTH, p);
2159 static HRESULT WINAPI HTMLStyle_put_height(IHTMLStyle *iface, VARIANT v)
2161 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2163 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
2165 return set_style_property_var(This, STYLEID_HEIGHT, &v);
2168 static HRESULT WINAPI HTMLStyle_get_height(IHTMLStyle *iface, VARIANT *p)
2170 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2172 TRACE("(%p)->(%p)\n", This, p);
2174 return get_style_property_var(This, STYLEID_HEIGHT, p);
2177 static HRESULT WINAPI HTMLStyle_put_styleFloat(IHTMLStyle *iface, BSTR v)
2179 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2181 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2183 return set_style_property(This, STYLEID_FLOAT, v);
2186 static HRESULT WINAPI HTMLStyle_get_styleFloat(IHTMLStyle *iface, BSTR *p)
2188 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2190 TRACE("(%p)->(%p)\n", This, p);
2192 return get_style_property(This, STYLEID_FLOAT, p);
2195 static HRESULT WINAPI HTMLStyle_put_clear(IHTMLStyle *iface, BSTR v)
2197 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2199 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2201 return set_style_property(This, STYLEID_CLEAR, v);
2204 static HRESULT WINAPI HTMLStyle_get_clear(IHTMLStyle *iface, BSTR *p)
2206 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2208 TRACE("(%p)->(%p)\n", This, p);
2210 return get_style_property(This, STYLEID_CLEAR, p);
2213 static HRESULT WINAPI HTMLStyle_put_display(IHTMLStyle *iface, BSTR v)
2215 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2217 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2219 return set_style_property(This, STYLEID_DISPLAY, v);
2222 static HRESULT WINAPI HTMLStyle_get_display(IHTMLStyle *iface, BSTR *p)
2224 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2226 TRACE("(%p)->(%p)\n", This, p);
2228 return get_style_property(This, STYLEID_DISPLAY, p);
2231 static HRESULT WINAPI HTMLStyle_put_visibility(IHTMLStyle *iface, BSTR v)
2233 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2235 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2237 return set_style_property(This, STYLEID_VISIBILITY, v);
2240 static HRESULT WINAPI HTMLStyle_get_visibility(IHTMLStyle *iface, BSTR *p)
2242 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2244 TRACE("(%p)->(%p)\n", This, p);
2246 return get_style_property(This, STYLEID_VISIBILITY, p);
2249 static HRESULT WINAPI HTMLStyle_put_listStyleType(IHTMLStyle *iface, BSTR v)
2251 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2253 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2255 return set_style_property(This, STYLEID_LISTSTYLETYPE, v);
2258 static HRESULT WINAPI HTMLStyle_get_listStyleType(IHTMLStyle *iface, BSTR *p)
2260 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2262 TRACE("(%p)->(%p)\n", This, p);
2264 return get_style_property(This, STYLEID_LISTSTYLETYPE, p);
2267 static HRESULT WINAPI HTMLStyle_put_listStylePosition(IHTMLStyle *iface, BSTR v)
2269 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2271 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2273 return set_style_property(This, STYLEID_LISTSTYLEPOSITION, v);
2276 static HRESULT WINAPI HTMLStyle_get_listStylePosition(IHTMLStyle *iface, BSTR *p)
2278 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2280 TRACE("(%p)->(%p)\n", This, p);
2282 return get_style_property(This, STYLEID_LISTSTYLEPOSITION, p);
2285 static HRESULT WINAPI HTMLStyle_put_listStyleImage(IHTMLStyle *iface, BSTR v)
2287 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2288 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
2289 return E_NOTIMPL;
2292 static HRESULT WINAPI HTMLStyle_get_listStyleImage(IHTMLStyle *iface, BSTR *p)
2294 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2295 FIXME("(%p)->(%p)\n", This, p);
2296 return E_NOTIMPL;
2299 static HRESULT WINAPI HTMLStyle_put_listStyle(IHTMLStyle *iface, BSTR v)
2301 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2303 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2305 return set_style_property(This, STYLEID_LIST_STYLE, v);
2308 static HRESULT WINAPI HTMLStyle_get_listStyle(IHTMLStyle *iface, BSTR *p)
2310 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2312 TRACE("(%p)->(%p)\n", This, p);
2314 return get_style_property(This, STYLEID_LIST_STYLE, p);
2317 static HRESULT WINAPI HTMLStyle_put_whiteSpace(IHTMLStyle *iface, BSTR v)
2319 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2321 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2323 return set_style_property(This, STYLEID_WHITE_SPACE, v);
2326 static HRESULT WINAPI HTMLStyle_get_whiteSpace(IHTMLStyle *iface, BSTR *p)
2328 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2330 TRACE("(%p)->(%p)\n", This, p);
2332 return get_style_property(This, STYLEID_WHITE_SPACE, p);
2335 static HRESULT WINAPI HTMLStyle_put_top(IHTMLStyle *iface, VARIANT v)
2337 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2339 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
2341 return set_style_property_var(This, STYLEID_TOP, &v);
2344 static HRESULT WINAPI HTMLStyle_get_top(IHTMLStyle *iface, VARIANT *p)
2346 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2348 TRACE("(%p)->(%p)\n", This, p);
2350 return get_style_property_var(This, STYLEID_TOP, p);
2353 static HRESULT WINAPI HTMLStyle_put_left(IHTMLStyle *iface, VARIANT v)
2355 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2357 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
2359 return set_style_property_var(This, STYLEID_LEFT, &v);
2362 static HRESULT WINAPI HTMLStyle_get_left(IHTMLStyle *iface, VARIANT *p)
2364 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2366 TRACE("(%p)->(%p)\n", This, p);
2368 return get_style_property_var(This, STYLEID_LEFT, p);
2371 static HRESULT WINAPI HTMLStyle_get_position(IHTMLStyle *iface, BSTR *p)
2373 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2374 TRACE("(%p)->(%p)\n", This, p);
2375 return IHTMLStyle2_get_position(&This->IHTMLStyle2_iface, p);
2378 static HRESULT WINAPI HTMLStyle_put_zIndex(IHTMLStyle *iface, VARIANT v)
2380 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2382 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
2384 return set_style_property_var(This, STYLEID_Z_INDEX, &v);
2387 static HRESULT WINAPI HTMLStyle_get_zIndex(IHTMLStyle *iface, VARIANT *p)
2389 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2391 TRACE("(%p)->(%p)\n", This, p);
2393 return get_style_property_var(This, STYLEID_Z_INDEX, p);
2396 static HRESULT WINAPI HTMLStyle_put_overflow(IHTMLStyle *iface, BSTR v)
2398 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2400 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2402 return set_style_property(This, STYLEID_OVERFLOW, v);
2406 static HRESULT WINAPI HTMLStyle_get_overflow(IHTMLStyle *iface, BSTR *p)
2408 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2410 TRACE("(%p)->(%p)\n", This, p);
2412 if(!p)
2413 return E_INVALIDARG;
2415 return get_style_property(This, STYLEID_OVERFLOW, p);
2418 static HRESULT WINAPI HTMLStyle_put_pageBreakBefore(IHTMLStyle *iface, BSTR v)
2420 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2422 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2424 return set_style_property(This, STYLEID_PAGE_BREAK_BEFORE, v);
2427 static HRESULT WINAPI HTMLStyle_get_pageBreakBefore(IHTMLStyle *iface, BSTR *p)
2429 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2431 TRACE("(%p)->(%p)\n", This, p);
2433 return get_style_property(This, STYLEID_PAGE_BREAK_BEFORE, p);
2436 static HRESULT WINAPI HTMLStyle_put_pageBreakAfter(IHTMLStyle *iface, BSTR v)
2438 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2440 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2442 return set_style_property(This, STYLEID_PAGE_BREAK_AFTER, v);
2445 static HRESULT WINAPI HTMLStyle_get_pageBreakAfter(IHTMLStyle *iface, BSTR *p)
2447 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2449 TRACE("(%p)->(%p)\n", This, p);
2451 return get_style_property(This, STYLEID_PAGE_BREAK_AFTER, p);
2454 static HRESULT WINAPI HTMLStyle_put_cssText(IHTMLStyle *iface, BSTR v)
2456 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2457 nsAString text_str;
2458 nsresult nsres;
2460 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2462 nsAString_InitDepend(&text_str, v);
2463 nsres = nsIDOMCSSStyleDeclaration_SetCssText(This->nsstyle, &text_str);
2464 nsAString_Finish(&text_str);
2465 if(NS_FAILED(nsres)) {
2466 FIXME("SetCssStyle failed: %08x\n", nsres);
2467 return E_FAIL;
2470 return S_OK;
2473 static HRESULT WINAPI HTMLStyle_get_cssText(IHTMLStyle *iface, BSTR *p)
2475 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2476 nsAString text_str;
2477 nsresult nsres;
2479 TRACE("(%p)->(%p)\n", This, p);
2481 /* FIXME: Gecko style formatting is different than IE (uppercase). */
2482 nsAString_Init(&text_str, NULL);
2483 nsres = nsIDOMCSSStyleDeclaration_GetCssText(This->nsstyle, &text_str);
2484 if(NS_SUCCEEDED(nsres)) {
2485 const PRUnichar *text;
2487 nsAString_GetData(&text_str, &text);
2488 *p = *text ? SysAllocString(text) : NULL;
2489 }else {
2490 FIXME("GetCssStyle failed: %08x\n", nsres);
2491 *p = NULL;
2494 nsAString_Finish(&text_str);
2495 return S_OK;
2498 static HRESULT WINAPI HTMLStyle_put_pixelTop(IHTMLStyle *iface, LONG v)
2500 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2502 TRACE("(%p)->(%d)\n", This, v);
2504 return set_style_pxattr(This, STYLEID_TOP, v);
2507 static HRESULT WINAPI HTMLStyle_get_pixelTop(IHTMLStyle *iface, LONG *p)
2509 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2511 TRACE("(%p)->(%p)\n", This, p);
2513 return get_nsstyle_pixel_val(This, STYLEID_TOP, p);
2516 static HRESULT WINAPI HTMLStyle_put_pixelLeft(IHTMLStyle *iface, LONG v)
2518 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2520 TRACE("(%p)->(%d)\n", This, v);
2522 return set_style_pxattr(This, STYLEID_LEFT, v);
2525 static HRESULT WINAPI HTMLStyle_get_pixelLeft(IHTMLStyle *iface, LONG *p)
2527 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2529 TRACE("(%p)->(%p)\n", This, p);
2531 return get_nsstyle_pixel_val(This, STYLEID_LEFT, p);
2534 static HRESULT WINAPI HTMLStyle_put_pixelWidth(IHTMLStyle *iface, LONG v)
2536 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2538 TRACE("(%p)->()\n", This);
2540 return set_style_pxattr(This, STYLEID_WIDTH, v);
2543 static HRESULT WINAPI HTMLStyle_get_pixelWidth(IHTMLStyle *iface, LONG *p)
2545 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2547 TRACE("(%p)->(%p)\n", This, p);
2549 return get_nsstyle_pixel_val(This, STYLEID_WIDTH, p);
2552 static HRESULT WINAPI HTMLStyle_put_pixelHeight(IHTMLStyle *iface, LONG v)
2554 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2556 TRACE("(%p)->(%d)\n", This, v);
2558 return set_style_pxattr(This, STYLEID_HEIGHT, v);
2561 static HRESULT WINAPI HTMLStyle_get_pixelHeight(IHTMLStyle *iface, LONG *p)
2563 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2565 TRACE("(%p)->(%p)\n", This, p);
2567 return get_nsstyle_pixel_val(This, STYLEID_HEIGHT, p);
2570 static HRESULT WINAPI HTMLStyle_put_posTop(IHTMLStyle *iface, float v)
2572 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2574 TRACE("(%p)->(%f)\n", This, v);
2576 return set_style_pos(This, STYLEID_TOP, v);
2579 static HRESULT WINAPI HTMLStyle_get_posTop(IHTMLStyle *iface, float *p)
2581 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2583 TRACE("(%p)->(%p)\n", This, p);
2585 if(!p)
2586 return E_POINTER;
2588 return get_nsstyle_pos(This, STYLEID_TOP, p);
2591 static HRESULT WINAPI HTMLStyle_put_posLeft(IHTMLStyle *iface, float v)
2593 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2595 TRACE("(%p)->(%f)\n", This, v);
2597 return set_style_pos(This, STYLEID_LEFT, v);
2600 static HRESULT WINAPI HTMLStyle_get_posLeft(IHTMLStyle *iface, float *p)
2602 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2604 TRACE("(%p)->(%p)\n", This, p);
2606 if(!p)
2607 return E_POINTER;
2609 return get_nsstyle_pos(This, STYLEID_LEFT, p);
2612 static HRESULT WINAPI HTMLStyle_put_posWidth(IHTMLStyle *iface, float v)
2614 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2616 TRACE("(%p)->(%f)\n", This, v);
2618 return set_style_pos(This, STYLEID_WIDTH, v);
2621 static HRESULT WINAPI HTMLStyle_get_posWidth(IHTMLStyle *iface, float *p)
2623 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2625 TRACE("(%p)->(%p)\n", This, p);
2627 if(!p)
2628 return E_POINTER;
2630 if(get_nsstyle_pos(This, STYLEID_WIDTH, p) != S_OK)
2631 *p = 0.0f;
2633 return S_OK;
2636 static HRESULT WINAPI HTMLStyle_put_posHeight(IHTMLStyle *iface, float v)
2638 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2640 TRACE("(%p)->(%f)\n", This, v);
2642 return set_style_pos(This, STYLEID_HEIGHT, v);
2645 static HRESULT WINAPI HTMLStyle_get_posHeight(IHTMLStyle *iface, float *p)
2647 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2649 TRACE("(%p)->(%p)\n", This, p);
2651 if(!p)
2652 return E_POINTER;
2654 if(get_nsstyle_pos(This, STYLEID_HEIGHT, p) != S_OK)
2655 *p = 0.0f;
2657 return S_OK;
2660 static HRESULT WINAPI HTMLStyle_put_cursor(IHTMLStyle *iface, BSTR v)
2662 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2664 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2666 return set_style_property(This, STYLEID_CURSOR, v);
2669 static HRESULT WINAPI HTMLStyle_get_cursor(IHTMLStyle *iface, BSTR *p)
2671 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2673 TRACE("(%p)->(%p)\n", This, p);
2675 return get_style_property(This, STYLEID_CURSOR, p);
2678 static HRESULT WINAPI HTMLStyle_put_clip(IHTMLStyle *iface, BSTR v)
2680 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2682 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2684 return set_style_property(This, STYLEID_CLIP, v);
2687 static HRESULT WINAPI HTMLStyle_get_clip(IHTMLStyle *iface, BSTR *p)
2689 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2691 TRACE("(%p)->(%p)\n", This, p);
2693 return get_style_property(This, STYLEID_CLIP, p);
2696 static void set_opacity(HTMLStyle *This, const WCHAR *val)
2698 nsAString name_str, val_str, empty_str;
2699 nsresult nsres;
2701 static const WCHAR opacityW[] = {'o','p','a','c','i','t','y',0};
2703 TRACE("%s\n", debugstr_w(val));
2705 nsAString_InitDepend(&name_str, opacityW);
2706 nsAString_InitDepend(&val_str, val);
2707 nsAString_InitDepend(&empty_str, emptyW);
2709 nsres = nsIDOMCSSStyleDeclaration_SetProperty(This->nsstyle, &name_str, &val_str, &empty_str);
2710 if(NS_FAILED(nsres))
2711 ERR("SetProperty failed: %08x\n", nsres);
2713 nsAString_Finish(&name_str);
2714 nsAString_Finish(&val_str);
2715 nsAString_Finish(&empty_str);
2718 static void update_filter(HTMLStyle *This)
2720 const WCHAR *ptr, *ptr2;
2722 static const WCHAR alphaW[] = {'a','l','p','h','a'};
2724 if(get_style_compat_mode(This) >= COMPAT_MODE_IE10)
2725 return;
2727 ptr = This->elem->filter;
2728 TRACE("%s\n", debugstr_w(ptr));
2729 if(!ptr) {
2730 set_opacity(This, emptyW);
2731 return;
2734 while(1) {
2735 while(isspaceW(*ptr))
2736 ptr++;
2737 if(!*ptr)
2738 break;
2740 ptr2 = ptr;
2741 while(isalnumW(*ptr))
2742 ptr++;
2743 if(ptr == ptr2) {
2744 WARN("unexpected char '%c'\n", *ptr);
2745 break;
2747 if(*ptr != '(') {
2748 WARN("expected '('\n");
2749 continue;
2752 if(ptr2 + ARRAY_SIZE(alphaW) == ptr && !memcmp(ptr2, alphaW, sizeof(alphaW))) {
2753 static const WCHAR formatW[] = {'%','f',0};
2754 static const WCHAR opacityW[] = {'o','p','a','c','i','t','y','='};
2756 ptr++;
2757 do {
2758 while(isspaceW(*ptr))
2759 ptr++;
2761 ptr2 = ptr;
2762 while(*ptr && *ptr != ',' && *ptr != ')')
2763 ptr++;
2764 if(!*ptr) {
2765 WARN("unexpected end of string\n");
2766 break;
2769 if(ptr-ptr2 > ARRAY_SIZE(opacityW) && !memcmp(ptr2, opacityW, sizeof(opacityW))) {
2770 float fval = 0.0f, e = 0.1f;
2771 WCHAR buf[32];
2773 ptr2 += ARRAY_SIZE(opacityW);
2775 while(isdigitW(*ptr2))
2776 fval = fval*10.0f + (float)(*ptr2++ - '0');
2778 if(*ptr2 == '.') {
2779 while(isdigitW(*++ptr2)) {
2780 fval += e * (float)(*ptr2++ - '0');
2781 e *= 0.1f;
2785 sprintfW(buf, formatW, fval * 0.01f);
2786 set_opacity(This, buf);
2787 }else {
2788 FIXME("unknown param %s\n", debugstr_wn(ptr2, ptr-ptr2));
2791 if(*ptr == ',')
2792 ptr++;
2793 }while(*ptr != ')');
2794 }else {
2795 FIXME("unknown filter %s\n", debugstr_wn(ptr2, ptr-ptr2));
2796 ptr = strchrW(ptr, ')');
2797 if(!ptr)
2798 break;
2799 ptr++;
2804 static HRESULT WINAPI HTMLStyle_put_filter(IHTMLStyle *iface, BSTR v)
2806 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2807 WCHAR *new_filter = NULL;
2809 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2811 if(!This->elem) {
2812 FIXME("Element already destroyed\n");
2813 return E_UNEXPECTED;
2816 if(v) {
2817 new_filter = heap_strdupW(v);
2818 if(!new_filter)
2819 return E_OUTOFMEMORY;
2822 heap_free(This->elem->filter);
2823 This->elem->filter = new_filter;
2825 update_filter(This);
2826 return S_OK;
2829 static HRESULT WINAPI HTMLStyle_get_filter(IHTMLStyle *iface, BSTR *p)
2831 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2833 TRACE("(%p)->(%p)\n", This, p);
2835 if(!This->elem) {
2836 FIXME("Element already destroyed\n");
2837 return E_UNEXPECTED;
2840 if(This->elem->filter) {
2841 *p = SysAllocString(This->elem->filter);
2842 if(!*p)
2843 return E_OUTOFMEMORY;
2844 }else {
2845 *p = NULL;
2848 return S_OK;
2851 static HRESULT WINAPI HTMLStyle_setAttribute(IHTMLStyle *iface, BSTR strAttributeName,
2852 VARIANT AttributeValue, LONG lFlags)
2854 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2855 HRESULT hres;
2856 DISPID dispid;
2858 TRACE("(%p)->(%s %s %08x)\n", This, debugstr_w(strAttributeName),
2859 debugstr_variant(&AttributeValue), lFlags);
2861 if(!strAttributeName)
2862 return E_INVALIDARG;
2864 if(lFlags == 1)
2865 FIXME("Parameter lFlags ignored\n");
2867 hres = HTMLStyle_GetIDsOfNames(iface, &IID_NULL, &strAttributeName, 1,
2868 LOCALE_USER_DEFAULT, &dispid);
2869 if(hres == S_OK)
2871 VARIANT ret;
2872 DISPID dispidNamed = DISPID_PROPERTYPUT;
2873 DISPPARAMS params;
2875 params.cArgs = 1;
2876 params.rgvarg = &AttributeValue;
2877 params.cNamedArgs = 1;
2878 params.rgdispidNamedArgs = &dispidNamed;
2880 hres = HTMLStyle_Invoke(iface, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
2881 DISPATCH_PROPERTYPUT, &params, &ret, NULL, NULL);
2883 else
2885 FIXME("Custom attributes not supported.\n");
2888 TRACE("ret: %08x\n", hres);
2890 return hres;
2893 static HRESULT WINAPI HTMLStyle_getAttribute(IHTMLStyle *iface, BSTR strAttributeName,
2894 LONG lFlags, VARIANT *AttributeValue)
2896 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2897 HRESULT hres;
2898 DISPID dispid;
2900 TRACE("(%p)->(%s v%p %08x)\n", This, debugstr_w(strAttributeName),
2901 AttributeValue, lFlags);
2903 if(!AttributeValue || !strAttributeName)
2904 return E_INVALIDARG;
2906 if(lFlags == 1)
2907 FIXME("Parameter lFlags ignored\n");
2909 hres = HTMLStyle_GetIDsOfNames(iface, &IID_NULL, &strAttributeName, 1,
2910 LOCALE_USER_DEFAULT, &dispid);
2911 if(hres == S_OK)
2913 DISPPARAMS params = {NULL, NULL, 0, 0 };
2915 hres = HTMLStyle_Invoke(iface, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
2916 DISPATCH_PROPERTYGET, &params, AttributeValue, NULL, NULL);
2918 else
2920 FIXME("Custom attributes not supported.\n");
2923 return hres;
2926 static HRESULT WINAPI HTMLStyle_removeAttribute(IHTMLStyle *iface, BSTR strAttributeName,
2927 LONG lFlags, VARIANT_BOOL *pfSuccess)
2929 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2930 const style_tbl_entry_t *style_entry;
2931 nsAString name_str, ret_str;
2932 nsresult nsres;
2933 HRESULT hres;
2935 TRACE("(%p)->(%s %08x %p)\n", This, debugstr_w(strAttributeName), lFlags, pfSuccess);
2937 style_entry = lookup_style_tbl(strAttributeName);
2938 if(!style_entry) {
2939 DISPID dispid;
2940 unsigned i;
2942 hres = IDispatchEx_GetDispID(&This->dispex.IDispatchEx_iface, strAttributeName,
2943 (lFlags&1) ? fdexNameCaseSensitive : fdexNameCaseInsensitive, &dispid);
2944 if(hres != S_OK) {
2945 *pfSuccess = VARIANT_FALSE;
2946 return S_OK;
2949 for(i=0; i < ARRAY_SIZE(style_tbl); i++) {
2950 if(dispid == style_tbl[i].dispid)
2951 break;
2954 if(i == ARRAY_SIZE(style_tbl))
2955 return remove_attribute(&This->dispex, dispid, pfSuccess);
2956 style_entry = style_tbl+i;
2959 /* filter property is a special case */
2960 if(style_entry->dispid == DISPID_IHTMLSTYLE_FILTER) {
2961 *pfSuccess = variant_bool(This->elem->filter && *This->elem->filter);
2962 heap_free(This->elem->filter);
2963 This->elem->filter = NULL;
2964 update_filter(This);
2965 return S_OK;
2968 nsAString_InitDepend(&name_str, style_entry->name);
2969 nsAString_Init(&ret_str, NULL);
2970 nsres = nsIDOMCSSStyleDeclaration_RemoveProperty(This->nsstyle, &name_str, &ret_str);
2971 if(NS_SUCCEEDED(nsres)) {
2972 const PRUnichar *ret;
2973 nsAString_GetData(&ret_str, &ret);
2974 *pfSuccess = variant_bool(*ret);
2975 }else {
2976 ERR("RemoveProperty failed: %08x\n", nsres);
2978 nsAString_Finish(&name_str);
2979 nsAString_Finish(&ret_str);
2980 return NS_SUCCEEDED(nsres) ? S_OK : E_FAIL;
2983 static HRESULT WINAPI HTMLStyle_toString(IHTMLStyle *iface, BSTR *String)
2985 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2986 FIXME("(%p)->(%p)\n", This, String);
2987 return E_NOTIMPL;
2990 static const IHTMLStyleVtbl HTMLStyleVtbl = {
2991 HTMLStyle_QueryInterface,
2992 HTMLStyle_AddRef,
2993 HTMLStyle_Release,
2994 HTMLStyle_GetTypeInfoCount,
2995 HTMLStyle_GetTypeInfo,
2996 HTMLStyle_GetIDsOfNames,
2997 HTMLStyle_Invoke,
2998 HTMLStyle_put_fontFamily,
2999 HTMLStyle_get_fontFamily,
3000 HTMLStyle_put_fontStyle,
3001 HTMLStyle_get_fontStyle,
3002 HTMLStyle_put_fontVariant,
3003 HTMLStyle_get_fontVariant,
3004 HTMLStyle_put_fontWeight,
3005 HTMLStyle_get_fontWeight,
3006 HTMLStyle_put_fontSize,
3007 HTMLStyle_get_fontSize,
3008 HTMLStyle_put_font,
3009 HTMLStyle_get_font,
3010 HTMLStyle_put_color,
3011 HTMLStyle_get_color,
3012 HTMLStyle_put_background,
3013 HTMLStyle_get_background,
3014 HTMLStyle_put_backgroundColor,
3015 HTMLStyle_get_backgroundColor,
3016 HTMLStyle_put_backgroundImage,
3017 HTMLStyle_get_backgroundImage,
3018 HTMLStyle_put_backgroundRepeat,
3019 HTMLStyle_get_backgroundRepeat,
3020 HTMLStyle_put_backgroundAttachment,
3021 HTMLStyle_get_backgroundAttachment,
3022 HTMLStyle_put_backgroundPosition,
3023 HTMLStyle_get_backgroundPosition,
3024 HTMLStyle_put_backgroundPositionX,
3025 HTMLStyle_get_backgroundPositionX,
3026 HTMLStyle_put_backgroundPositionY,
3027 HTMLStyle_get_backgroundPositionY,
3028 HTMLStyle_put_wordSpacing,
3029 HTMLStyle_get_wordSpacing,
3030 HTMLStyle_put_letterSpacing,
3031 HTMLStyle_get_letterSpacing,
3032 HTMLStyle_put_textDecoration,
3033 HTMLStyle_get_textDecoration,
3034 HTMLStyle_put_textDecorationNone,
3035 HTMLStyle_get_textDecorationNone,
3036 HTMLStyle_put_textDecorationUnderline,
3037 HTMLStyle_get_textDecorationUnderline,
3038 HTMLStyle_put_textDecorationOverline,
3039 HTMLStyle_get_textDecorationOverline,
3040 HTMLStyle_put_textDecorationLineThrough,
3041 HTMLStyle_get_textDecorationLineThrough,
3042 HTMLStyle_put_textDecorationBlink,
3043 HTMLStyle_get_textDecorationBlink,
3044 HTMLStyle_put_verticalAlign,
3045 HTMLStyle_get_verticalAlign,
3046 HTMLStyle_put_textTransform,
3047 HTMLStyle_get_textTransform,
3048 HTMLStyle_put_textAlign,
3049 HTMLStyle_get_textAlign,
3050 HTMLStyle_put_textIndent,
3051 HTMLStyle_get_textIndent,
3052 HTMLStyle_put_lineHeight,
3053 HTMLStyle_get_lineHeight,
3054 HTMLStyle_put_marginTop,
3055 HTMLStyle_get_marginTop,
3056 HTMLStyle_put_marginRight,
3057 HTMLStyle_get_marginRight,
3058 HTMLStyle_put_marginBottom,
3059 HTMLStyle_get_marginBottom,
3060 HTMLStyle_put_marginLeft,
3061 HTMLStyle_get_marginLeft,
3062 HTMLStyle_put_margin,
3063 HTMLStyle_get_margin,
3064 HTMLStyle_put_paddingTop,
3065 HTMLStyle_get_paddingTop,
3066 HTMLStyle_put_paddingRight,
3067 HTMLStyle_get_paddingRight,
3068 HTMLStyle_put_paddingBottom,
3069 HTMLStyle_get_paddingBottom,
3070 HTMLStyle_put_paddingLeft,
3071 HTMLStyle_get_paddingLeft,
3072 HTMLStyle_put_padding,
3073 HTMLStyle_get_padding,
3074 HTMLStyle_put_border,
3075 HTMLStyle_get_border,
3076 HTMLStyle_put_borderTop,
3077 HTMLStyle_get_borderTop,
3078 HTMLStyle_put_borderRight,
3079 HTMLStyle_get_borderRight,
3080 HTMLStyle_put_borderBottom,
3081 HTMLStyle_get_borderBottom,
3082 HTMLStyle_put_borderLeft,
3083 HTMLStyle_get_borderLeft,
3084 HTMLStyle_put_borderColor,
3085 HTMLStyle_get_borderColor,
3086 HTMLStyle_put_borderTopColor,
3087 HTMLStyle_get_borderTopColor,
3088 HTMLStyle_put_borderRightColor,
3089 HTMLStyle_get_borderRightColor,
3090 HTMLStyle_put_borderBottomColor,
3091 HTMLStyle_get_borderBottomColor,
3092 HTMLStyle_put_borderLeftColor,
3093 HTMLStyle_get_borderLeftColor,
3094 HTMLStyle_put_borderWidth,
3095 HTMLStyle_get_borderWidth,
3096 HTMLStyle_put_borderTopWidth,
3097 HTMLStyle_get_borderTopWidth,
3098 HTMLStyle_put_borderRightWidth,
3099 HTMLStyle_get_borderRightWidth,
3100 HTMLStyle_put_borderBottomWidth,
3101 HTMLStyle_get_borderBottomWidth,
3102 HTMLStyle_put_borderLeftWidth,
3103 HTMLStyle_get_borderLeftWidth,
3104 HTMLStyle_put_borderStyle,
3105 HTMLStyle_get_borderStyle,
3106 HTMLStyle_put_borderTopStyle,
3107 HTMLStyle_get_borderTopStyle,
3108 HTMLStyle_put_borderRightStyle,
3109 HTMLStyle_get_borderRightStyle,
3110 HTMLStyle_put_borderBottomStyle,
3111 HTMLStyle_get_borderBottomStyle,
3112 HTMLStyle_put_borderLeftStyle,
3113 HTMLStyle_get_borderLeftStyle,
3114 HTMLStyle_put_width,
3115 HTMLStyle_get_width,
3116 HTMLStyle_put_height,
3117 HTMLStyle_get_height,
3118 HTMLStyle_put_styleFloat,
3119 HTMLStyle_get_styleFloat,
3120 HTMLStyle_put_clear,
3121 HTMLStyle_get_clear,
3122 HTMLStyle_put_display,
3123 HTMLStyle_get_display,
3124 HTMLStyle_put_visibility,
3125 HTMLStyle_get_visibility,
3126 HTMLStyle_put_listStyleType,
3127 HTMLStyle_get_listStyleType,
3128 HTMLStyle_put_listStylePosition,
3129 HTMLStyle_get_listStylePosition,
3130 HTMLStyle_put_listStyleImage,
3131 HTMLStyle_get_listStyleImage,
3132 HTMLStyle_put_listStyle,
3133 HTMLStyle_get_listStyle,
3134 HTMLStyle_put_whiteSpace,
3135 HTMLStyle_get_whiteSpace,
3136 HTMLStyle_put_top,
3137 HTMLStyle_get_top,
3138 HTMLStyle_put_left,
3139 HTMLStyle_get_left,
3140 HTMLStyle_get_position,
3141 HTMLStyle_put_zIndex,
3142 HTMLStyle_get_zIndex,
3143 HTMLStyle_put_overflow,
3144 HTMLStyle_get_overflow,
3145 HTMLStyle_put_pageBreakBefore,
3146 HTMLStyle_get_pageBreakBefore,
3147 HTMLStyle_put_pageBreakAfter,
3148 HTMLStyle_get_pageBreakAfter,
3149 HTMLStyle_put_cssText,
3150 HTMLStyle_get_cssText,
3151 HTMLStyle_put_pixelTop,
3152 HTMLStyle_get_pixelTop,
3153 HTMLStyle_put_pixelLeft,
3154 HTMLStyle_get_pixelLeft,
3155 HTMLStyle_put_pixelWidth,
3156 HTMLStyle_get_pixelWidth,
3157 HTMLStyle_put_pixelHeight,
3158 HTMLStyle_get_pixelHeight,
3159 HTMLStyle_put_posTop,
3160 HTMLStyle_get_posTop,
3161 HTMLStyle_put_posLeft,
3162 HTMLStyle_get_posLeft,
3163 HTMLStyle_put_posWidth,
3164 HTMLStyle_get_posWidth,
3165 HTMLStyle_put_posHeight,
3166 HTMLStyle_get_posHeight,
3167 HTMLStyle_put_cursor,
3168 HTMLStyle_get_cursor,
3169 HTMLStyle_put_clip,
3170 HTMLStyle_get_clip,
3171 HTMLStyle_put_filter,
3172 HTMLStyle_get_filter,
3173 HTMLStyle_setAttribute,
3174 HTMLStyle_getAttribute,
3175 HTMLStyle_removeAttribute,
3176 HTMLStyle_toString
3179 static inline HTMLStyle *impl_from_IHTMLStyle2(IHTMLStyle2 *iface)
3181 return CONTAINING_RECORD(iface, HTMLStyle, IHTMLStyle2_iface);
3184 static HRESULT WINAPI HTMLStyle2_QueryInterface(IHTMLStyle2 *iface, REFIID riid, void **ppv)
3186 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3188 return IHTMLStyle_QueryInterface(&This->IHTMLStyle_iface, riid, ppv);
3191 static ULONG WINAPI HTMLStyle2_AddRef(IHTMLStyle2 *iface)
3193 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3195 return IHTMLStyle_AddRef(&This->IHTMLStyle_iface);
3198 static ULONG WINAPI HTMLStyle2_Release(IHTMLStyle2 *iface)
3200 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3202 return IHTMLStyle_Release(&This->IHTMLStyle_iface);
3205 static HRESULT WINAPI HTMLStyle2_GetTypeInfoCount(IHTMLStyle2 *iface, UINT *pctinfo)
3207 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3208 return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
3211 static HRESULT WINAPI HTMLStyle2_GetTypeInfo(IHTMLStyle2 *iface, UINT iTInfo,
3212 LCID lcid, ITypeInfo **ppTInfo)
3214 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3215 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
3218 static HRESULT WINAPI HTMLStyle2_GetIDsOfNames(IHTMLStyle2 *iface, REFIID riid,
3219 LPOLESTR *rgszNames, UINT cNames,
3220 LCID lcid, DISPID *rgDispId)
3222 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3223 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
3224 lcid, rgDispId);
3227 static HRESULT WINAPI HTMLStyle2_Invoke(IHTMLStyle2 *iface, DISPID dispIdMember,
3228 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
3229 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
3231 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3232 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
3233 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
3236 static HRESULT WINAPI HTMLStyle2_put_tableLayout(IHTMLStyle2 *iface, BSTR v)
3238 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3240 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
3242 return set_style_property(This, STYLEID_TABLE_LAYOUT, v);
3245 static HRESULT WINAPI HTMLStyle2_get_tableLayout(IHTMLStyle2 *iface, BSTR *p)
3247 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3249 TRACE("(%p)->(%p)\n", This, p);
3251 return get_style_property(This, STYLEID_TABLE_LAYOUT, p);
3254 static HRESULT WINAPI HTMLStyle2_put_borderCollapse(IHTMLStyle2 *iface, BSTR v)
3256 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3257 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3258 return E_NOTIMPL;
3261 static HRESULT WINAPI HTMLStyle2_get_borderCollapse(IHTMLStyle2 *iface, BSTR *p)
3263 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3264 FIXME("(%p)->(%p)\n", This, p);
3265 return E_NOTIMPL;
3268 static HRESULT WINAPI HTMLStyle2_put_direction(IHTMLStyle2 *iface, BSTR v)
3270 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3272 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
3274 return set_style_property(This, STYLEID_DIRECTION, v);
3277 static HRESULT WINAPI HTMLStyle2_get_direction(IHTMLStyle2 *iface, BSTR *p)
3279 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3281 TRACE("(%p)->(%p)\n", This, p);
3283 return get_style_property(This, STYLEID_DIRECTION, p);
3286 static HRESULT WINAPI HTMLStyle2_put_behavior(IHTMLStyle2 *iface, BSTR v)
3288 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3289 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3290 return S_OK;
3293 static HRESULT WINAPI HTMLStyle2_get_behavior(IHTMLStyle2 *iface, BSTR *p)
3295 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3296 FIXME("(%p)->(%p)\n", This, p);
3297 return E_NOTIMPL;
3300 static HRESULT WINAPI HTMLStyle2_setExpression(IHTMLStyle2 *iface, BSTR propname, BSTR expression, BSTR language)
3302 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3303 FIXME("(%p)->(%s %s %s)\n", This, debugstr_w(propname), debugstr_w(expression), debugstr_w(language));
3304 return E_NOTIMPL;
3307 static HRESULT WINAPI HTMLStyle2_getExpression(IHTMLStyle2 *iface, BSTR propname, VARIANT *expression)
3309 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3310 FIXME("(%p)->(%s %p)\n", This, debugstr_w(propname), expression);
3311 return E_NOTIMPL;
3314 static HRESULT WINAPI HTMLStyle2_removeExpression(IHTMLStyle2 *iface, BSTR propname, VARIANT_BOOL *pfSuccess)
3316 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3317 FIXME("(%p)->(%s %p)\n", This, debugstr_w(propname), pfSuccess);
3318 return E_NOTIMPL;
3321 static HRESULT WINAPI HTMLStyle2_put_position(IHTMLStyle2 *iface, BSTR v)
3323 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3325 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
3327 return set_style_property(This, STYLEID_POSITION, v);
3330 static HRESULT WINAPI HTMLStyle2_get_position(IHTMLStyle2 *iface, BSTR *p)
3332 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3334 TRACE("(%p)->(%p)\n", This, p);
3336 return get_style_property(This, STYLEID_POSITION, p);
3339 static HRESULT WINAPI HTMLStyle2_put_unicodeBidi(IHTMLStyle2 *iface, BSTR v)
3341 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3342 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3343 return E_NOTIMPL;
3346 static HRESULT WINAPI HTMLStyle2_get_unicodeBidi(IHTMLStyle2 *iface, BSTR *p)
3348 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3349 FIXME("(%p)->(%p)\n", This, p);
3350 return E_NOTIMPL;
3353 static HRESULT WINAPI HTMLStyle2_put_bottom(IHTMLStyle2 *iface, VARIANT v)
3355 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3357 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
3359 return set_style_property_var(This, STYLEID_BOTTOM, &v);
3362 static HRESULT WINAPI HTMLStyle2_get_bottom(IHTMLStyle2 *iface, VARIANT *p)
3364 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3366 TRACE("(%p)->(%p)\n", This, p);
3368 return get_style_property_var(This, STYLEID_BOTTOM, p);
3371 static HRESULT WINAPI HTMLStyle2_put_right(IHTMLStyle2 *iface, VARIANT v)
3373 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3375 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
3377 return set_style_property_var(This, STYLEID_RIGHT, &v);
3380 static HRESULT WINAPI HTMLStyle2_get_right(IHTMLStyle2 *iface, VARIANT *p)
3382 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3384 TRACE("(%p)->(%p)\n", This, p);
3386 return get_style_property_var(This, STYLEID_RIGHT, p);
3389 static HRESULT WINAPI HTMLStyle2_put_pixelBottom(IHTMLStyle2 *iface, LONG v)
3391 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3392 FIXME("(%p)->(%d)\n", This, v);
3393 return E_NOTIMPL;
3396 static HRESULT WINAPI HTMLStyle2_get_pixelBottom(IHTMLStyle2 *iface, LONG *p)
3398 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3399 FIXME("(%p)->(%p)\n", This, p);
3400 return E_NOTIMPL;
3403 static HRESULT WINAPI HTMLStyle2_put_pixelRight(IHTMLStyle2 *iface, LONG v)
3405 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3406 FIXME("(%p)->(%d)\n", This, v);
3407 return E_NOTIMPL;
3410 static HRESULT WINAPI HTMLStyle2_get_pixelRight(IHTMLStyle2 *iface, LONG *p)
3412 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3413 FIXME("(%p)->(%p)\n", This, p);
3414 return E_NOTIMPL;
3417 static HRESULT WINAPI HTMLStyle2_put_posBottom(IHTMLStyle2 *iface, float v)
3419 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3420 FIXME("(%p)->(%f)\n", This, v);
3421 return E_NOTIMPL;
3424 static HRESULT WINAPI HTMLStyle2_get_posBottom(IHTMLStyle2 *iface, float *p)
3426 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3427 FIXME("(%p)->(%p)\n", This, p);
3428 return E_NOTIMPL;
3431 static HRESULT WINAPI HTMLStyle2_put_posRight(IHTMLStyle2 *iface, float v)
3433 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3434 FIXME("(%p)->(%f)\n", This, v);
3435 return E_NOTIMPL;
3438 static HRESULT WINAPI HTMLStyle2_get_posRight(IHTMLStyle2 *iface, float *p)
3440 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3441 FIXME("(%p)->(%p)\n", This, p);
3442 return E_NOTIMPL;
3445 static HRESULT WINAPI HTMLStyle2_put_imeMode(IHTMLStyle2 *iface, BSTR v)
3447 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3448 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3449 return E_NOTIMPL;
3452 static HRESULT WINAPI HTMLStyle2_get_imeMode(IHTMLStyle2 *iface, BSTR *p)
3454 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3455 FIXME("(%p)->(%p)\n", This, p);
3456 return E_NOTIMPL;
3459 static HRESULT WINAPI HTMLStyle2_put_rubyAlign(IHTMLStyle2 *iface, BSTR v)
3461 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3462 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3463 return E_NOTIMPL;
3466 static HRESULT WINAPI HTMLStyle2_get_rubyAlign(IHTMLStyle2 *iface, BSTR *p)
3468 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3469 FIXME("(%p)->(%p)\n", This, p);
3470 return E_NOTIMPL;
3473 static HRESULT WINAPI HTMLStyle2_put_rubyPosition(IHTMLStyle2 *iface, BSTR v)
3475 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3476 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3477 return E_NOTIMPL;
3480 static HRESULT WINAPI HTMLStyle2_get_rubyPosition(IHTMLStyle2 *iface, BSTR *p)
3482 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3483 FIXME("(%p)->(%p)\n", This, p);
3484 return E_NOTIMPL;
3487 static HRESULT WINAPI HTMLStyle2_put_rubyOverhang(IHTMLStyle2 *iface, BSTR v)
3489 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3490 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3491 return E_NOTIMPL;
3494 static HRESULT WINAPI HTMLStyle2_get_rubyOverhang(IHTMLStyle2 *iface, BSTR *p)
3496 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3497 FIXME("(%p)->(%p)\n", This, p);
3498 return E_NOTIMPL;
3501 static HRESULT WINAPI HTMLStyle2_put_layoutGridChar(IHTMLStyle2 *iface, VARIANT v)
3503 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3504 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3505 return E_NOTIMPL;
3508 static HRESULT WINAPI HTMLStyle2_get_layoutGridChar(IHTMLStyle2 *iface, VARIANT *p)
3510 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3511 FIXME("(%p)->(%p)\n", This, p);
3512 return E_NOTIMPL;
3515 static HRESULT WINAPI HTMLStyle2_put_layoutGridLine(IHTMLStyle2 *iface, VARIANT v)
3517 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3518 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3519 return E_NOTIMPL;
3522 static HRESULT WINAPI HTMLStyle2_get_layoutGridLine(IHTMLStyle2 *iface, VARIANT *p)
3524 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3525 FIXME("(%p)->(%p)\n", This, p);
3526 return E_NOTIMPL;
3529 static HRESULT WINAPI HTMLStyle2_put_layoutGridMode(IHTMLStyle2 *iface, BSTR v)
3531 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3532 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3533 return E_NOTIMPL;
3536 static HRESULT WINAPI HTMLStyle2_get_layoutGridMode(IHTMLStyle2 *iface, BSTR *p)
3538 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3539 FIXME("(%p)->(%p)\n", This, p);
3540 return E_NOTIMPL;
3543 static HRESULT WINAPI HTMLStyle2_put_layoutGridType(IHTMLStyle2 *iface, BSTR v)
3545 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3546 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3547 return E_NOTIMPL;
3550 static HRESULT WINAPI HTMLStyle2_get_layoutGridType(IHTMLStyle2 *iface, BSTR *p)
3552 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3553 FIXME("(%p)->(%p)\n", This, p);
3554 return E_NOTIMPL;
3557 static HRESULT WINAPI HTMLStyle2_put_layoutGrid(IHTMLStyle2 *iface, BSTR v)
3559 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3560 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3561 return E_NOTIMPL;
3564 static HRESULT WINAPI HTMLStyle2_get_layoutGrid(IHTMLStyle2 *iface, BSTR *p)
3566 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3567 FIXME("(%p)->(%p)\n", This, p);
3568 return E_NOTIMPL;
3571 static HRESULT WINAPI HTMLStyle2_put_wordBreak(IHTMLStyle2 *iface, BSTR v)
3573 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3574 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3575 return E_NOTIMPL;
3578 static HRESULT WINAPI HTMLStyle2_get_wordBreak(IHTMLStyle2 *iface, BSTR *p)
3580 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3581 FIXME("(%p)->(%p)\n", This, p);
3582 return E_NOTIMPL;
3585 static HRESULT WINAPI HTMLStyle2_put_lineBreak(IHTMLStyle2 *iface, BSTR v)
3587 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3588 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3589 return E_NOTIMPL;
3592 static HRESULT WINAPI HTMLStyle2_get_lineBreak(IHTMLStyle2 *iface, BSTR *p)
3594 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3595 FIXME("(%p)->(%p)\n", This, p);
3596 return E_NOTIMPL;
3599 static HRESULT WINAPI HTMLStyle2_put_textJustify(IHTMLStyle2 *iface, BSTR v)
3601 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3602 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3603 return E_NOTIMPL;
3606 static HRESULT WINAPI HTMLStyle2_get_textJustify(IHTMLStyle2 *iface, BSTR *p)
3608 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3609 FIXME("(%p)->(%p)\n", This, p);
3610 return E_NOTIMPL;
3613 static HRESULT WINAPI HTMLStyle2_put_textJustifyTrim(IHTMLStyle2 *iface, BSTR v)
3615 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3616 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3617 return E_NOTIMPL;
3620 static HRESULT WINAPI HTMLStyle2_get_textJustifyTrim(IHTMLStyle2 *iface, BSTR *p)
3622 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3623 FIXME("(%p)->(%p)\n", This, p);
3624 return E_NOTIMPL;
3627 static HRESULT WINAPI HTMLStyle2_put_textKashida(IHTMLStyle2 *iface, VARIANT v)
3629 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3630 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3631 return E_NOTIMPL;
3634 static HRESULT WINAPI HTMLStyle2_get_textKashida(IHTMLStyle2 *iface, VARIANT *p)
3636 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3637 FIXME("(%p)->(%p)\n", This, p);
3638 return E_NOTIMPL;
3641 static HRESULT WINAPI HTMLStyle2_put_textAutospace(IHTMLStyle2 *iface, BSTR v)
3643 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3644 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3645 return E_NOTIMPL;
3648 static HRESULT WINAPI HTMLStyle2_get_textAutospace(IHTMLStyle2 *iface, BSTR *p)
3650 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3651 FIXME("(%p)->(%p)\n", This, p);
3652 return E_NOTIMPL;
3655 static HRESULT WINAPI HTMLStyle2_put_overflowX(IHTMLStyle2 *iface, BSTR v)
3657 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3659 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
3661 return set_style_property(This, STYLEID_OVERFLOW_X, v);
3664 static HRESULT WINAPI HTMLStyle2_get_overflowX(IHTMLStyle2 *iface, BSTR *p)
3666 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3668 TRACE("(%p)->(%p)\n", This, p);
3670 return get_style_property(This, STYLEID_OVERFLOW_X, p);
3673 static HRESULT WINAPI HTMLStyle2_put_overflowY(IHTMLStyle2 *iface, BSTR v)
3675 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3677 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
3679 return set_style_property(This, STYLEID_OVERFLOW_Y, v);
3682 static HRESULT WINAPI HTMLStyle2_get_overflowY(IHTMLStyle2 *iface, BSTR *p)
3684 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3686 TRACE("(%p)->(%p)\n", This, p);
3688 return get_style_property(This, STYLEID_OVERFLOW_Y, p);
3691 static HRESULT WINAPI HTMLStyle2_put_accelerator(IHTMLStyle2 *iface, BSTR v)
3693 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3694 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3695 return E_NOTIMPL;
3698 static HRESULT WINAPI HTMLStyle2_get_accelerator(IHTMLStyle2 *iface, BSTR *p)
3700 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3701 FIXME("(%p)->(%p)\n", This, p);
3702 return E_NOTIMPL;
3705 static const IHTMLStyle2Vtbl HTMLStyle2Vtbl = {
3706 HTMLStyle2_QueryInterface,
3707 HTMLStyle2_AddRef,
3708 HTMLStyle2_Release,
3709 HTMLStyle2_GetTypeInfoCount,
3710 HTMLStyle2_GetTypeInfo,
3711 HTMLStyle2_GetIDsOfNames,
3712 HTMLStyle2_Invoke,
3713 HTMLStyle2_put_tableLayout,
3714 HTMLStyle2_get_tableLayout,
3715 HTMLStyle2_put_borderCollapse,
3716 HTMLStyle2_get_borderCollapse,
3717 HTMLStyle2_put_direction,
3718 HTMLStyle2_get_direction,
3719 HTMLStyle2_put_behavior,
3720 HTMLStyle2_get_behavior,
3721 HTMLStyle2_setExpression,
3722 HTMLStyle2_getExpression,
3723 HTMLStyle2_removeExpression,
3724 HTMLStyle2_put_position,
3725 HTMLStyle2_get_position,
3726 HTMLStyle2_put_unicodeBidi,
3727 HTMLStyle2_get_unicodeBidi,
3728 HTMLStyle2_put_bottom,
3729 HTMLStyle2_get_bottom,
3730 HTMLStyle2_put_right,
3731 HTMLStyle2_get_right,
3732 HTMLStyle2_put_pixelBottom,
3733 HTMLStyle2_get_pixelBottom,
3734 HTMLStyle2_put_pixelRight,
3735 HTMLStyle2_get_pixelRight,
3736 HTMLStyle2_put_posBottom,
3737 HTMLStyle2_get_posBottom,
3738 HTMLStyle2_put_posRight,
3739 HTMLStyle2_get_posRight,
3740 HTMLStyle2_put_imeMode,
3741 HTMLStyle2_get_imeMode,
3742 HTMLStyle2_put_rubyAlign,
3743 HTMLStyle2_get_rubyAlign,
3744 HTMLStyle2_put_rubyPosition,
3745 HTMLStyle2_get_rubyPosition,
3746 HTMLStyle2_put_rubyOverhang,
3747 HTMLStyle2_get_rubyOverhang,
3748 HTMLStyle2_put_layoutGridChar,
3749 HTMLStyle2_get_layoutGridChar,
3750 HTMLStyle2_put_layoutGridLine,
3751 HTMLStyle2_get_layoutGridLine,
3752 HTMLStyle2_put_layoutGridMode,
3753 HTMLStyle2_get_layoutGridMode,
3754 HTMLStyle2_put_layoutGridType,
3755 HTMLStyle2_get_layoutGridType,
3756 HTMLStyle2_put_layoutGrid,
3757 HTMLStyle2_get_layoutGrid,
3758 HTMLStyle2_put_wordBreak,
3759 HTMLStyle2_get_wordBreak,
3760 HTMLStyle2_put_lineBreak,
3761 HTMLStyle2_get_lineBreak,
3762 HTMLStyle2_put_textJustify,
3763 HTMLStyle2_get_textJustify,
3764 HTMLStyle2_put_textJustifyTrim,
3765 HTMLStyle2_get_textJustifyTrim,
3766 HTMLStyle2_put_textKashida,
3767 HTMLStyle2_get_textKashida,
3768 HTMLStyle2_put_textAutospace,
3769 HTMLStyle2_get_textAutospace,
3770 HTMLStyle2_put_overflowX,
3771 HTMLStyle2_get_overflowX,
3772 HTMLStyle2_put_overflowY,
3773 HTMLStyle2_get_overflowY,
3774 HTMLStyle2_put_accelerator,
3775 HTMLStyle2_get_accelerator
3778 static inline HTMLStyle *impl_from_IHTMLStyle3(IHTMLStyle3 *iface)
3780 return CONTAINING_RECORD(iface, HTMLStyle, IHTMLStyle3_iface);
3783 static HRESULT WINAPI HTMLStyle3_QueryInterface(IHTMLStyle3 *iface, REFIID riid, void **ppv)
3785 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3787 return IHTMLStyle_QueryInterface(&This->IHTMLStyle_iface, riid, ppv);
3790 static ULONG WINAPI HTMLStyle3_AddRef(IHTMLStyle3 *iface)
3792 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3794 return IHTMLStyle_AddRef(&This->IHTMLStyle_iface);
3797 static ULONG WINAPI HTMLStyle3_Release(IHTMLStyle3 *iface)
3799 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3801 return IHTMLStyle_Release(&This->IHTMLStyle_iface);
3804 static HRESULT WINAPI HTMLStyle3_GetTypeInfoCount(IHTMLStyle3 *iface, UINT *pctinfo)
3806 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3807 return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
3810 static HRESULT WINAPI HTMLStyle3_GetTypeInfo(IHTMLStyle3 *iface, UINT iTInfo,
3811 LCID lcid, ITypeInfo **ppTInfo)
3813 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3814 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
3817 static HRESULT WINAPI HTMLStyle3_GetIDsOfNames(IHTMLStyle3 *iface, REFIID riid,
3818 LPOLESTR *rgszNames, UINT cNames,
3819 LCID lcid, DISPID *rgDispId)
3821 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3822 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
3823 lcid, rgDispId);
3826 static HRESULT WINAPI HTMLStyle3_Invoke(IHTMLStyle3 *iface, DISPID dispIdMember,
3827 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
3828 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
3830 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3831 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
3832 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
3835 static HRESULT WINAPI HTMLStyle3_put_layoutFlow(IHTMLStyle3 *iface, BSTR v)
3837 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3838 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3839 return E_NOTIMPL;
3842 static HRESULT WINAPI HTMLStyle3_get_layoutFlow(IHTMLStyle3 *iface, BSTR *p)
3844 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3845 FIXME("(%p)->(%p)\n", This, p);
3846 return E_NOTIMPL;
3849 static const WCHAR zoomW[] = {'z','o','o','m',0};
3851 static HRESULT WINAPI HTMLStyle3_put_zoom(IHTMLStyle3 *iface, VARIANT v)
3853 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3854 VARIANT *var;
3855 HRESULT hres;
3857 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
3859 /* zoom property is IE CSS extension that is mostly used as a hack to workaround IE bugs.
3860 * The value is set to 1 then. We can safely ignore setting zoom to 1. */
3861 if(V_VT(&v) != VT_I4 || V_I4(&v) != 1)
3862 WARN("stub for %s\n", debugstr_variant(&v));
3864 hres = dispex_get_dprop_ref(&This->dispex, zoomW, TRUE, &var);
3865 if(FAILED(hres))
3866 return hres;
3868 return VariantChangeType(var, &v, 0, VT_BSTR);
3871 static HRESULT WINAPI HTMLStyle3_get_zoom(IHTMLStyle3 *iface, VARIANT *p)
3873 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3874 VARIANT *var;
3875 HRESULT hres;
3877 TRACE("(%p)->(%p)\n", This, p);
3879 hres = dispex_get_dprop_ref(&This->dispex, zoomW, FALSE, &var);
3880 if(hres == DISP_E_UNKNOWNNAME) {
3881 V_VT(p) = VT_BSTR;
3882 V_BSTR(p) = NULL;
3883 return S_OK;
3885 if(FAILED(hres))
3886 return hres;
3888 return VariantCopy(p, var);
3891 static HRESULT WINAPI HTMLStyle3_put_wordWrap(IHTMLStyle3 *iface, BSTR v)
3893 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3895 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
3897 return set_style_property(This, STYLEID_WORD_WRAP, v);
3900 static HRESULT WINAPI HTMLStyle3_get_wordWrap(IHTMLStyle3 *iface, BSTR *p)
3902 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3904 TRACE("(%p)->(%p)\n", This, p);
3906 return get_style_property(This, STYLEID_WORD_WRAP, p);
3909 static HRESULT WINAPI HTMLStyle3_put_textUnderlinePosition(IHTMLStyle3 *iface, BSTR v)
3911 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3912 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3913 return E_NOTIMPL;
3916 static HRESULT WINAPI HTMLStyle3_get_textUnderlinePosition(IHTMLStyle3 *iface, BSTR *p)
3918 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3919 FIXME("(%p)->(%p)\n", This, p);
3920 return E_NOTIMPL;
3923 static HRESULT WINAPI HTMLStyle3_put_scrollbarBaseColor(IHTMLStyle3 *iface, VARIANT v)
3925 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3926 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3927 return E_NOTIMPL;
3930 static HRESULT WINAPI HTMLStyle3_get_scrollbarBaseColor(IHTMLStyle3 *iface, VARIANT *p)
3932 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3933 FIXME("(%p)->(%p)\n", This, p);
3934 return E_NOTIMPL;
3937 static HRESULT WINAPI HTMLStyle3_put_scrollbarFaceColor(IHTMLStyle3 *iface, VARIANT v)
3939 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3940 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3941 return E_NOTIMPL;
3944 static HRESULT WINAPI HTMLStyle3_get_scrollbarFaceColor(IHTMLStyle3 *iface, VARIANT *p)
3946 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3947 FIXME("(%p)->(%p)\n", This, p);
3948 return E_NOTIMPL;
3951 static HRESULT WINAPI HTMLStyle3_put_scrollbar3dLightColor(IHTMLStyle3 *iface, VARIANT v)
3953 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3954 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3955 return E_NOTIMPL;
3958 static HRESULT WINAPI HTMLStyle3_get_scrollbar3dLightColor(IHTMLStyle3 *iface, VARIANT *p)
3960 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3961 FIXME("(%p)->(%p)\n", This, p);
3962 return E_NOTIMPL;
3965 static HRESULT WINAPI HTMLStyle3_put_scrollbarShadowColor(IHTMLStyle3 *iface, VARIANT v)
3967 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3968 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3969 return E_NOTIMPL;
3972 static HRESULT WINAPI HTMLStyle3_get_scrollbarShadowColor(IHTMLStyle3 *iface, VARIANT *p)
3974 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3975 FIXME("(%p)->(%p)\n", This, p);
3976 return E_NOTIMPL;
3979 static HRESULT WINAPI HTMLStyle3_put_scrollbarHighlightColor(IHTMLStyle3 *iface, VARIANT v)
3981 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3982 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3983 return E_NOTIMPL;
3986 static HRESULT WINAPI HTMLStyle3_get_scrollbarHighlightColor(IHTMLStyle3 *iface, VARIANT *p)
3988 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3989 FIXME("(%p)->(%p)\n", This, p);
3990 return E_NOTIMPL;
3993 static HRESULT WINAPI HTMLStyle3_put_scrollbarDarkShadowColor(IHTMLStyle3 *iface, VARIANT v)
3995 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3996 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3997 return E_NOTIMPL;
4000 static HRESULT WINAPI HTMLStyle3_get_scrollbarDarkShadowColor(IHTMLStyle3 *iface, VARIANT *p)
4002 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
4003 FIXME("(%p)->(%p)\n", This, p);
4004 return E_NOTIMPL;
4007 static HRESULT WINAPI HTMLStyle3_put_scrollbarArrowColor(IHTMLStyle3 *iface, VARIANT v)
4009 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
4010 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
4011 return E_NOTIMPL;
4014 static HRESULT WINAPI HTMLStyle3_get_scrollbarArrowColor(IHTMLStyle3 *iface, VARIANT *p)
4016 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
4017 FIXME("(%p)->(%p)\n", This, p);
4018 return E_NOTIMPL;
4021 static HRESULT WINAPI HTMLStyle3_put_scrollbarTrackColor(IHTMLStyle3 *iface, VARIANT v)
4023 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
4024 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
4025 return E_NOTIMPL;
4028 static HRESULT WINAPI HTMLStyle3_get_scrollbarTrackColor(IHTMLStyle3 *iface, VARIANT *p)
4030 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
4031 FIXME("(%p)->(%p)\n", This, p);
4032 return E_NOTIMPL;
4035 static HRESULT WINAPI HTMLStyle3_put_writingMode(IHTMLStyle3 *iface, BSTR v)
4037 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
4038 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4039 return E_NOTIMPL;
4042 static HRESULT WINAPI HTMLStyle3_get_writingMode(IHTMLStyle3 *iface, BSTR *p)
4044 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
4045 FIXME("(%p)->(%p)\n", This, p);
4046 return E_NOTIMPL;
4049 static HRESULT WINAPI HTMLStyle3_put_textAlignLast(IHTMLStyle3 *iface, BSTR v)
4051 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
4052 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4053 return E_NOTIMPL;
4056 static HRESULT WINAPI HTMLStyle3_get_textAlignLast(IHTMLStyle3 *iface, BSTR *p)
4058 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
4059 FIXME("(%p)->(%p)\n", This, p);
4060 return E_NOTIMPL;
4063 static HRESULT WINAPI HTMLStyle3_put_textKashidaSpace(IHTMLStyle3 *iface, VARIANT v)
4065 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
4066 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
4067 return E_NOTIMPL;
4070 static HRESULT WINAPI HTMLStyle3_get_textKashidaSpace(IHTMLStyle3 *iface, VARIANT *p)
4072 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
4073 FIXME("(%p)->(%p)\n", This, p);
4074 return E_NOTIMPL;
4077 static const IHTMLStyle3Vtbl HTMLStyle3Vtbl = {
4078 HTMLStyle3_QueryInterface,
4079 HTMLStyle3_AddRef,
4080 HTMLStyle3_Release,
4081 HTMLStyle3_GetTypeInfoCount,
4082 HTMLStyle3_GetTypeInfo,
4083 HTMLStyle3_GetIDsOfNames,
4084 HTMLStyle3_Invoke,
4085 HTMLStyle3_put_layoutFlow,
4086 HTMLStyle3_get_layoutFlow,
4087 HTMLStyle3_put_zoom,
4088 HTMLStyle3_get_zoom,
4089 HTMLStyle3_put_wordWrap,
4090 HTMLStyle3_get_wordWrap,
4091 HTMLStyle3_put_textUnderlinePosition,
4092 HTMLStyle3_get_textUnderlinePosition,
4093 HTMLStyle3_put_scrollbarBaseColor,
4094 HTMLStyle3_get_scrollbarBaseColor,
4095 HTMLStyle3_put_scrollbarFaceColor,
4096 HTMLStyle3_get_scrollbarFaceColor,
4097 HTMLStyle3_put_scrollbar3dLightColor,
4098 HTMLStyle3_get_scrollbar3dLightColor,
4099 HTMLStyle3_put_scrollbarShadowColor,
4100 HTMLStyle3_get_scrollbarShadowColor,
4101 HTMLStyle3_put_scrollbarHighlightColor,
4102 HTMLStyle3_get_scrollbarHighlightColor,
4103 HTMLStyle3_put_scrollbarDarkShadowColor,
4104 HTMLStyle3_get_scrollbarDarkShadowColor,
4105 HTMLStyle3_put_scrollbarArrowColor,
4106 HTMLStyle3_get_scrollbarArrowColor,
4107 HTMLStyle3_put_scrollbarTrackColor,
4108 HTMLStyle3_get_scrollbarTrackColor,
4109 HTMLStyle3_put_writingMode,
4110 HTMLStyle3_get_writingMode,
4111 HTMLStyle3_put_textAlignLast,
4112 HTMLStyle3_get_textAlignLast,
4113 HTMLStyle3_put_textKashidaSpace,
4114 HTMLStyle3_get_textKashidaSpace
4118 * IHTMLStyle4 Interface
4120 static inline HTMLStyle *impl_from_IHTMLStyle4(IHTMLStyle4 *iface)
4122 return CONTAINING_RECORD(iface, HTMLStyle, IHTMLStyle4_iface);
4125 static HRESULT WINAPI HTMLStyle4_QueryInterface(IHTMLStyle4 *iface, REFIID riid, void **ppv)
4127 HTMLStyle *This = impl_from_IHTMLStyle4(iface);
4129 return IHTMLStyle_QueryInterface(&This->IHTMLStyle_iface, riid, ppv);
4132 static ULONG WINAPI HTMLStyle4_AddRef(IHTMLStyle4 *iface)
4134 HTMLStyle *This = impl_from_IHTMLStyle4(iface);
4136 return IHTMLStyle_AddRef(&This->IHTMLStyle_iface);
4139 static ULONG WINAPI HTMLStyle4_Release(IHTMLStyle4 *iface)
4141 HTMLStyle *This = impl_from_IHTMLStyle4(iface);
4143 return IHTMLStyle_Release(&This->IHTMLStyle_iface);
4146 static HRESULT WINAPI HTMLStyle4_GetTypeInfoCount(IHTMLStyle4 *iface, UINT *pctinfo)
4148 HTMLStyle *This = impl_from_IHTMLStyle4(iface);
4149 return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
4152 static HRESULT WINAPI HTMLStyle4_GetTypeInfo(IHTMLStyle4 *iface, UINT iTInfo,
4153 LCID lcid, ITypeInfo **ppTInfo)
4155 HTMLStyle *This = impl_from_IHTMLStyle4(iface);
4156 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
4159 static HRESULT WINAPI HTMLStyle4_GetIDsOfNames(IHTMLStyle4 *iface, REFIID riid,
4160 LPOLESTR *rgszNames, UINT cNames,
4161 LCID lcid, DISPID *rgDispId)
4163 HTMLStyle *This = impl_from_IHTMLStyle4(iface);
4164 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
4165 lcid, rgDispId);
4168 static HRESULT WINAPI HTMLStyle4_Invoke(IHTMLStyle4 *iface, DISPID dispIdMember,
4169 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
4170 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
4172 HTMLStyle *This = impl_from_IHTMLStyle4(iface);
4173 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
4174 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
4177 static HRESULT WINAPI HTMLStyle4_put_textOverflow(IHTMLStyle4 *iface, BSTR v)
4179 HTMLStyle *This = impl_from_IHTMLStyle4(iface);
4180 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4181 return E_NOTIMPL;
4184 static HRESULT WINAPI HTMLStyle4_get_textOverflow(IHTMLStyle4 *iface, BSTR *p)
4186 HTMLStyle *This = impl_from_IHTMLStyle4(iface);
4187 FIXME("(%p)->(%p)\n", This, p);
4188 return E_NOTIMPL;
4191 static HRESULT WINAPI HTMLStyle4_put_minHeight(IHTMLStyle4 *iface, VARIANT v)
4193 HTMLStyle *This = impl_from_IHTMLStyle4(iface);
4195 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
4197 return set_style_property_var(This, STYLEID_MIN_HEIGHT, &v);
4200 static HRESULT WINAPI HTMLStyle4_get_minHeight(IHTMLStyle4 *iface, VARIANT *p)
4202 HTMLStyle *This = impl_from_IHTMLStyle4(iface);
4204 TRACE("(%p)->(%p)\n", This, p);
4206 return get_style_property_var(This, STYLEID_MIN_HEIGHT, p);
4209 static const IHTMLStyle4Vtbl HTMLStyle4Vtbl = {
4210 HTMLStyle4_QueryInterface,
4211 HTMLStyle4_AddRef,
4212 HTMLStyle4_Release,
4213 HTMLStyle4_GetTypeInfoCount,
4214 HTMLStyle4_GetTypeInfo,
4215 HTMLStyle4_GetIDsOfNames,
4216 HTMLStyle4_Invoke,
4217 HTMLStyle4_put_textOverflow,
4218 HTMLStyle4_get_textOverflow,
4219 HTMLStyle4_put_minHeight,
4220 HTMLStyle4_get_minHeight
4223 static inline HTMLStyle *impl_from_IHTMLStyle5(IHTMLStyle5 *iface)
4225 return CONTAINING_RECORD(iface, HTMLStyle, IHTMLStyle5_iface);
4228 static HRESULT WINAPI HTMLStyle5_QueryInterface(IHTMLStyle5 *iface, REFIID riid, void **ppv)
4230 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4232 return IHTMLStyle_QueryInterface(&This->IHTMLStyle_iface, riid, ppv);
4235 static ULONG WINAPI HTMLStyle5_AddRef(IHTMLStyle5 *iface)
4237 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4239 return IHTMLStyle_AddRef(&This->IHTMLStyle_iface);
4242 static ULONG WINAPI HTMLStyle5_Release(IHTMLStyle5 *iface)
4244 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4246 return IHTMLStyle_Release(&This->IHTMLStyle_iface);
4249 static HRESULT WINAPI HTMLStyle5_GetTypeInfoCount(IHTMLStyle5 *iface, UINT *pctinfo)
4251 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4252 return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
4255 static HRESULT WINAPI HTMLStyle5_GetTypeInfo(IHTMLStyle5 *iface, UINT iTInfo,
4256 LCID lcid, ITypeInfo **ppTInfo)
4258 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4259 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
4262 static HRESULT WINAPI HTMLStyle5_GetIDsOfNames(IHTMLStyle5 *iface, REFIID riid,
4263 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
4265 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4266 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
4267 lcid, rgDispId);
4270 static HRESULT WINAPI HTMLStyle5_Invoke(IHTMLStyle5 *iface, DISPID dispIdMember,
4271 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
4272 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
4274 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4275 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
4276 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
4279 static HRESULT WINAPI HTMLStyle5_put_msInterpolationMode(IHTMLStyle5 *iface, BSTR v)
4281 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4282 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4283 return E_NOTIMPL;
4286 static HRESULT WINAPI HTMLStyle5_get_msInterpolationMode(IHTMLStyle5 *iface, BSTR *p)
4288 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4289 FIXME("(%p)->(%p)\n", This, p);
4290 return E_NOTIMPL;
4293 static HRESULT WINAPI HTMLStyle5_put_maxHeight(IHTMLStyle5 *iface, VARIANT v)
4295 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4297 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
4299 return set_style_property_var(This, STYLEID_MAX_HEIGHT, &v);
4302 static HRESULT WINAPI HTMLStyle5_get_maxHeight(IHTMLStyle5 *iface, VARIANT *p)
4304 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4306 TRACE("(%p)->(%s)\n", This, debugstr_variant(p));
4308 return get_style_property_var(This, STYLEID_MAX_HEIGHT, p);
4311 static HRESULT WINAPI HTMLStyle5_put_minWidth(IHTMLStyle5 *iface, VARIANT v)
4313 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4315 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
4317 return set_style_property_var(This, STYLEID_MIN_WIDTH, &v);
4320 static HRESULT WINAPI HTMLStyle5_get_minWidth(IHTMLStyle5 *iface, VARIANT *p)
4322 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4324 TRACE("(%p)->(%p)\n", This, p);
4326 return get_style_property_var(This, STYLEID_MIN_WIDTH, p);
4329 static HRESULT WINAPI HTMLStyle5_put_maxWidth(IHTMLStyle5 *iface, VARIANT v)
4331 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4333 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
4335 return set_style_property_var(This, STYLEID_MAX_WIDTH, &v);
4338 static HRESULT WINAPI HTMLStyle5_get_maxWidth(IHTMLStyle5 *iface, VARIANT *p)
4340 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4342 TRACE("(%p)->(%p)\n", This, p);
4344 return get_style_property_var(This, STYLEID_MAX_WIDTH, p);
4347 static const IHTMLStyle5Vtbl HTMLStyle5Vtbl = {
4348 HTMLStyle5_QueryInterface,
4349 HTMLStyle5_AddRef,
4350 HTMLStyle5_Release,
4351 HTMLStyle5_GetTypeInfoCount,
4352 HTMLStyle5_GetTypeInfo,
4353 HTMLStyle5_GetIDsOfNames,
4354 HTMLStyle5_Invoke,
4355 HTMLStyle5_put_msInterpolationMode,
4356 HTMLStyle5_get_msInterpolationMode,
4357 HTMLStyle5_put_maxHeight,
4358 HTMLStyle5_get_maxHeight,
4359 HTMLStyle5_put_minWidth,
4360 HTMLStyle5_get_minWidth,
4361 HTMLStyle5_put_maxWidth,
4362 HTMLStyle5_get_maxWidth
4365 static inline HTMLStyle *impl_from_IHTMLStyle6(IHTMLStyle6 *iface)
4367 return CONTAINING_RECORD(iface, HTMLStyle, IHTMLStyle6_iface);
4370 static HRESULT WINAPI HTMLStyle6_QueryInterface(IHTMLStyle6 *iface, REFIID riid, void **ppv)
4372 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4374 return IHTMLStyle_QueryInterface(&This->IHTMLStyle_iface, riid, ppv);
4377 static ULONG WINAPI HTMLStyle6_AddRef(IHTMLStyle6 *iface)
4379 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4381 return IHTMLStyle_AddRef(&This->IHTMLStyle_iface);
4384 static ULONG WINAPI HTMLStyle6_Release(IHTMLStyle6 *iface)
4386 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4388 return IHTMLStyle_Release(&This->IHTMLStyle_iface);
4391 static HRESULT WINAPI HTMLStyle6_GetTypeInfoCount(IHTMLStyle6 *iface, UINT *pctinfo)
4393 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4394 return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
4397 static HRESULT WINAPI HTMLStyle6_GetTypeInfo(IHTMLStyle6 *iface, UINT iTInfo,
4398 LCID lcid, ITypeInfo **ppTInfo)
4400 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4401 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
4404 static HRESULT WINAPI HTMLStyle6_GetIDsOfNames(IHTMLStyle6 *iface, REFIID riid,
4405 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
4407 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4408 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
4409 lcid, rgDispId);
4412 static HRESULT WINAPI HTMLStyle6_Invoke(IHTMLStyle6 *iface, DISPID dispIdMember,
4413 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
4414 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
4416 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4417 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
4418 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
4421 static HRESULT WINAPI HTMLStyle6_put_content(IHTMLStyle6 *iface, BSTR v)
4423 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4424 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4425 return E_NOTIMPL;
4428 static HRESULT WINAPI HTMLStyle6_get_content(IHTMLStyle6 *iface, BSTR *p)
4430 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4431 FIXME("(%p)->(%p)\n", This, p);
4432 return E_NOTIMPL;
4435 static HRESULT WINAPI HTMLStyle6_put_contentSide(IHTMLStyle6 *iface, BSTR v)
4437 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4438 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4439 return E_NOTIMPL;
4442 static HRESULT WINAPI HTMLStyle6_get_contentSide(IHTMLStyle6 *iface, BSTR *p)
4444 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4445 FIXME("(%p)->(%p)\n", This, p);
4446 return E_NOTIMPL;
4449 static HRESULT WINAPI HTMLStyle6_put_counterIncrement(IHTMLStyle6 *iface, BSTR v)
4451 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4452 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4453 return E_NOTIMPL;
4456 static HRESULT WINAPI HTMLStyle6_get_counterIncrement(IHTMLStyle6 *iface, BSTR *p)
4458 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4459 FIXME("(%p)->(%p)\n", This, p);
4460 return E_NOTIMPL;
4463 static HRESULT WINAPI HTMLStyle6_put_counterReset(IHTMLStyle6 *iface, BSTR v)
4465 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4466 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4467 return E_NOTIMPL;
4470 static HRESULT WINAPI HTMLStyle6_get_counterReset(IHTMLStyle6 *iface, BSTR *p)
4472 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4473 FIXME("(%p)->(%p)\n", This, p);
4474 return E_NOTIMPL;
4477 static HRESULT WINAPI HTMLStyle6_put_outline(IHTMLStyle6 *iface, BSTR v)
4479 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4481 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
4483 return set_style_property(This, STYLEID_OUTLINE, v);
4486 static HRESULT WINAPI HTMLStyle6_get_outline(IHTMLStyle6 *iface, BSTR *p)
4488 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4490 TRACE("(%p)->(%p)\n", This, p);
4492 return get_style_property(This, STYLEID_OUTLINE, p);
4495 static HRESULT WINAPI HTMLStyle6_put_outlineWidth(IHTMLStyle6 *iface, VARIANT v)
4497 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4498 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
4499 return E_NOTIMPL;
4502 static HRESULT WINAPI HTMLStyle6_get_outlineWidth(IHTMLStyle6 *iface, VARIANT *p)
4504 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4505 FIXME("(%p)->(%p)\n", This, p);
4506 return E_NOTIMPL;
4509 static HRESULT WINAPI HTMLStyle6_put_outlineStyle(IHTMLStyle6 *iface, BSTR v)
4511 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4512 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4513 return E_NOTIMPL;
4516 static HRESULT WINAPI HTMLStyle6_get_outlineStyle(IHTMLStyle6 *iface, BSTR *p)
4518 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4519 FIXME("(%p)->(%p)\n", This, p);
4520 return E_NOTIMPL;
4523 static HRESULT WINAPI HTMLStyle6_put_outlineColor(IHTMLStyle6 *iface, VARIANT v)
4525 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4526 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
4527 return E_NOTIMPL;
4530 static HRESULT WINAPI HTMLStyle6_get_outlineColor(IHTMLStyle6 *iface, VARIANT *p)
4532 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4533 FIXME("(%p)->(%p)\n", This, p);
4534 return E_NOTIMPL;
4537 static HRESULT WINAPI HTMLStyle6_put_boxSizing(IHTMLStyle6 *iface, BSTR v)
4539 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4541 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
4543 return set_style_property(This, STYLEID_BOX_SIZING, v);
4546 static HRESULT WINAPI HTMLStyle6_get_boxSizing(IHTMLStyle6 *iface, BSTR *p)
4548 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4550 TRACE("(%p)->(%p)\n", This, p);
4552 return get_style_property(This, STYLEID_BOX_SIZING, p);
4555 static HRESULT WINAPI HTMLStyle6_put_boxSpacing(IHTMLStyle6 *iface, BSTR v)
4557 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4558 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4559 return E_NOTIMPL;
4562 static HRESULT WINAPI HTMLStyle6_get_boxSpacing(IHTMLStyle6 *iface, BSTR *p)
4564 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4565 FIXME("(%p)->(%p)\n", This, p);
4566 return E_NOTIMPL;
4569 static HRESULT WINAPI HTMLStyle6_put_orphans(IHTMLStyle6 *iface, VARIANT v)
4571 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4572 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
4573 return E_NOTIMPL;
4576 static HRESULT WINAPI HTMLStyle6_get_orphans(IHTMLStyle6 *iface, VARIANT *p)
4578 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4579 FIXME("(%p)->(%p)\n", This, p);
4580 return E_NOTIMPL;
4583 static HRESULT WINAPI HTMLStyle6_put_windows(IHTMLStyle6 *iface, VARIANT v)
4585 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4586 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
4587 return E_NOTIMPL;
4590 static HRESULT WINAPI HTMLStyle6_get_windows(IHTMLStyle6 *iface, VARIANT *p)
4592 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4593 FIXME("(%p)->(%p)\n", This, p);
4594 return E_NOTIMPL;
4597 static HRESULT WINAPI HTMLStyle6_put_pageBreakInside(IHTMLStyle6 *iface, BSTR v)
4599 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4600 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4601 return E_NOTIMPL;
4604 static HRESULT WINAPI HTMLStyle6_get_pageBreakInside(IHTMLStyle6 *iface, BSTR *p)
4606 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4607 FIXME("(%p)->(%p)\n", This, p);
4608 return E_NOTIMPL;
4611 static HRESULT WINAPI HTMLStyle6_put_emptyCells(IHTMLStyle6 *iface, BSTR v)
4613 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4614 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4615 return E_NOTIMPL;
4618 static HRESULT WINAPI HTMLStyle6_get_emptyCells(IHTMLStyle6 *iface, BSTR *p)
4620 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4621 FIXME("(%p)->(%p)\n", This, p);
4622 return E_NOTIMPL;
4625 static HRESULT WINAPI HTMLStyle6_put_msBlockProgression(IHTMLStyle6 *iface, BSTR v)
4627 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4628 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4629 return E_NOTIMPL;
4632 static HRESULT WINAPI HTMLStyle6_get_msBlockProgression(IHTMLStyle6 *iface, BSTR *p)
4634 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4635 FIXME("(%p)->(%p)\n", This, p);
4636 return E_NOTIMPL;
4639 static HRESULT WINAPI HTMLStyle6_put_quotes(IHTMLStyle6 *iface, BSTR v)
4641 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4642 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4643 return E_NOTIMPL;
4646 static HRESULT WINAPI HTMLStyle6_get_quotes(IHTMLStyle6 *iface, BSTR *p)
4648 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4649 FIXME("(%p)->(%p)\n", This, p);
4650 return E_NOTIMPL;
4653 static const IHTMLStyle6Vtbl HTMLStyle6Vtbl = {
4654 HTMLStyle6_QueryInterface,
4655 HTMLStyle6_AddRef,
4656 HTMLStyle6_Release,
4657 HTMLStyle6_GetTypeInfoCount,
4658 HTMLStyle6_GetTypeInfo,
4659 HTMLStyle6_GetIDsOfNames,
4660 HTMLStyle6_Invoke,
4661 HTMLStyle6_put_content,
4662 HTMLStyle6_get_content,
4663 HTMLStyle6_put_contentSide,
4664 HTMLStyle6_get_contentSide,
4665 HTMLStyle6_put_counterIncrement,
4666 HTMLStyle6_get_counterIncrement,
4667 HTMLStyle6_put_counterReset,
4668 HTMLStyle6_get_counterReset,
4669 HTMLStyle6_put_outline,
4670 HTMLStyle6_get_outline,
4671 HTMLStyle6_put_outlineWidth,
4672 HTMLStyle6_get_outlineWidth,
4673 HTMLStyle6_put_outlineStyle,
4674 HTMLStyle6_get_outlineStyle,
4675 HTMLStyle6_put_outlineColor,
4676 HTMLStyle6_get_outlineColor,
4677 HTMLStyle6_put_boxSizing,
4678 HTMLStyle6_get_boxSizing,
4679 HTMLStyle6_put_boxSpacing,
4680 HTMLStyle6_get_boxSpacing,
4681 HTMLStyle6_put_orphans,
4682 HTMLStyle6_get_orphans,
4683 HTMLStyle6_put_windows,
4684 HTMLStyle6_get_windows,
4685 HTMLStyle6_put_pageBreakInside,
4686 HTMLStyle6_get_pageBreakInside,
4687 HTMLStyle6_put_emptyCells,
4688 HTMLStyle6_get_emptyCells,
4689 HTMLStyle6_put_msBlockProgression,
4690 HTMLStyle6_get_msBlockProgression,
4691 HTMLStyle6_put_quotes,
4692 HTMLStyle6_get_quotes
4695 static HRESULT HTMLStyle_get_dispid(DispatchEx *dispex, BSTR name, DWORD flags, DISPID *dispid)
4697 const style_tbl_entry_t *style_entry;
4699 style_entry = lookup_style_tbl(name);
4700 if(style_entry) {
4701 *dispid = style_entry->dispid;
4702 return S_OK;
4705 return DISP_E_UNKNOWNNAME;
4708 static const dispex_static_data_vtbl_t HTMLStyle_dispex_vtbl = {
4709 NULL,
4710 HTMLStyle_get_dispid,
4711 NULL,
4712 NULL
4715 static const tid_t HTMLStyle_iface_tids[] = {
4716 IHTMLStyle6_tid,
4717 IHTMLStyle5_tid,
4718 IHTMLStyle4_tid,
4719 IHTMLStyle3_tid,
4720 IHTMLStyle2_tid,
4721 IHTMLStyle_tid,
4724 static dispex_static_data_t HTMLStyle_dispex = {
4725 &HTMLStyle_dispex_vtbl,
4726 DispHTMLStyle_tid,
4727 HTMLStyle_iface_tids
4730 static HRESULT get_style_from_elem(HTMLElement *elem, nsIDOMCSSStyleDeclaration **ret)
4732 nsIDOMElementCSSInlineStyle *nselemstyle;
4733 nsresult nsres;
4735 if(!elem->dom_element) {
4736 FIXME("comment element\n");
4737 return E_NOTIMPL;
4740 nsres = nsIDOMElement_QueryInterface(elem->dom_element, &IID_nsIDOMElementCSSInlineStyle,
4741 (void**)&nselemstyle);
4742 assert(nsres == NS_OK);
4744 nsres = nsIDOMElementCSSInlineStyle_GetStyle(nselemstyle, ret);
4745 nsIDOMElementCSSInlineStyle_Release(nselemstyle);
4746 if(NS_FAILED(nsres)) {
4747 ERR("GetStyle failed: %08x\n", nsres);
4748 return E_FAIL;
4751 return S_OK;
4754 HRESULT HTMLStyle_Create(HTMLElement *elem, HTMLStyle **ret)
4756 nsIDOMCSSStyleDeclaration *nsstyle;
4757 HTMLStyle *style;
4758 HRESULT hres;
4760 hres = get_style_from_elem(elem, &nsstyle);
4761 if(FAILED(hres))
4762 return hres;
4764 style = heap_alloc_zero(sizeof(HTMLStyle));
4765 if(!style) {
4766 nsIDOMCSSStyleDeclaration_Release(nsstyle);
4767 return E_OUTOFMEMORY;
4770 style->IHTMLStyle_iface.lpVtbl = &HTMLStyleVtbl;
4771 style->IHTMLStyle2_iface.lpVtbl = &HTMLStyle2Vtbl;
4772 style->IHTMLStyle3_iface.lpVtbl = &HTMLStyle3Vtbl;
4773 style->IHTMLStyle4_iface.lpVtbl = &HTMLStyle4Vtbl;
4774 style->IHTMLStyle5_iface.lpVtbl = &HTMLStyle5Vtbl;
4775 style->IHTMLStyle6_iface.lpVtbl = &HTMLStyle6Vtbl;
4777 style->ref = 1;
4778 style->nsstyle = nsstyle;
4779 style->elem = elem;
4781 nsIDOMCSSStyleDeclaration_AddRef(nsstyle);
4783 init_dispex_with_compat_mode(&style->dispex, (IUnknown*)&style->IHTMLStyle_iface, &HTMLStyle_dispex,
4784 dispex_compat_mode(&elem->node.event_target.dispex));
4786 *ret = style;
4787 return S_OK;
4790 HRESULT get_elem_style(HTMLElement *elem, styleid_t styleid, BSTR *ret)
4792 nsIDOMCSSStyleDeclaration *style;
4793 HRESULT hres;
4795 hres = get_style_from_elem(elem, &style);
4796 if(FAILED(hres))
4797 return hres;
4799 hres = get_nsstyle_property(style, styleid, COMPAT_MODE_IE11, ret);
4800 nsIDOMCSSStyleDeclaration_Release(style);
4801 return hres;
4804 HRESULT set_elem_style(HTMLElement *elem, styleid_t styleid, const WCHAR *val)
4806 nsIDOMCSSStyleDeclaration *style;
4807 HRESULT hres;
4809 hres = get_style_from_elem(elem, &style);
4810 if(FAILED(hres))
4811 return hres;
4813 hres = set_nsstyle_property(style, styleid, val);
4814 nsIDOMCSSStyleDeclaration_Release(style);
4815 return hres;