shell32: Add remaining Internet icons.
[wine.git] / dlls / mshtml / htmlstyle.c
blob6fc57790b2392230fadb98df7b3228ff391be5f4
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, compat_mode_t compat_mode, VARIANT *p)
690 unsigned flags = style_tbl[sid].flags;
691 nsAString str_value;
692 const PRUnichar *value;
693 BOOL set = FALSE;
694 HRESULT hres = S_OK;
696 nsAString_Init(&str_value, NULL);
698 get_nsstyle_attr_nsval(nsstyle, sid, &str_value);
700 nsAString_GetData(&str_value, &value);
702 if((flags & ATTR_STR_TO_INT) && (*value || compat_mode < COMPAT_MODE_IE9)) {
703 const PRUnichar *ptr = value;
704 BOOL neg = FALSE;
705 INT i = 0;
707 if(*ptr == '-') {
708 neg = TRUE;
709 ptr++;
712 while(isdigitW(*ptr))
713 i = i*10 + (*ptr++ - '0');
715 if(!*ptr) {
716 V_VT(p) = VT_I4;
717 V_I4(p) = neg ? -i : i;
718 set = TRUE;
722 if(!set) {
723 BSTR str;
725 hres = nsstyle_to_bstr(value, compat_mode < COMPAT_MODE_IE9 ? flags : 0, &str);
726 if(SUCCEEDED(hres)) {
727 V_VT(p) = VT_BSTR;
728 V_BSTR(p) = str;
732 nsAString_Finish(&str_value);
734 TRACE("%s -> %s\n", debugstr_w(style_tbl[sid].name), debugstr_variant(p));
735 return S_OK;
738 static inline HRESULT get_style_property(HTMLStyle *This, styleid_t sid, BSTR *p)
740 return get_nsstyle_property(This->nsstyle, sid, dispex_compat_mode(&This->dispex), p);
743 static inline HRESULT get_style_property_var(HTMLStyle *This, styleid_t sid, VARIANT *v)
745 return get_nsstyle_property_var(This->nsstyle, sid, dispex_compat_mode(&This->dispex), v);
748 static HRESULT check_style_attr_value(HTMLStyle *This, styleid_t sid, LPCWSTR exval, VARIANT_BOOL *p)
750 nsAString str_value;
751 const PRUnichar *value;
753 nsAString_Init(&str_value, NULL);
755 get_nsstyle_attr_nsval(This->nsstyle, sid, &str_value);
757 nsAString_GetData(&str_value, &value);
758 *p = variant_bool(!strcmpW(value, exval));
759 nsAString_Finish(&str_value);
761 TRACE("%s -> %x\n", debugstr_w(style_tbl[sid].name), *p);
762 return S_OK;
765 static inline HRESULT set_style_pos(HTMLStyle *This, styleid_t sid, float value)
767 WCHAR szValue[25];
768 WCHAR szFormat[] = {'%','.','0','f','p','x',0};
770 value = floor(value);
772 sprintfW(szValue, szFormat, value);
774 return set_style_property(This, sid, szValue);
777 static HRESULT set_style_pxattr(HTMLStyle *style, styleid_t sid, LONG value)
779 WCHAR value_str[16];
781 sprintfW(value_str, px_formatW, value);
783 return set_style_property(style, sid, value_str);
786 static HRESULT get_nsstyle_pos(HTMLStyle *This, styleid_t sid, float *p)
788 nsAString str_value;
789 HRESULT hres;
791 TRACE("%p %d %p\n", This, sid, p);
793 *p = 0.0f;
795 nsAString_Init(&str_value, NULL);
797 hres = get_nsstyle_attr_nsval(This->nsstyle, sid, &str_value);
798 if(hres == S_OK)
800 WCHAR *ptr;
801 const PRUnichar *value;
803 nsAString_GetData(&str_value, &value);
804 if(value)
806 *p = strtolW(value, &ptr, 10);
808 if(*ptr && strcmpW(ptr, pxW))
810 nsAString_Finish(&str_value);
811 FIXME("only px values are currently supported\n");
812 hres = E_FAIL;
817 TRACE("ret %f\n", *p);
819 nsAString_Finish(&str_value);
820 return hres;
823 static HRESULT get_nsstyle_pixel_val(HTMLStyle *This, styleid_t sid, LONG *p)
825 nsAString str_value;
826 HRESULT hres;
828 if(!p)
829 return E_POINTER;
831 nsAString_Init(&str_value, NULL);
833 hres = get_nsstyle_attr_nsval(This->nsstyle, sid, &str_value);
834 if(hres == S_OK) {
835 WCHAR *ptr = NULL;
836 const PRUnichar *value;
838 nsAString_GetData(&str_value, &value);
839 if(value) {
840 *p = strtolW(value, &ptr, 10);
842 if(*ptr == '.') {
843 /* Skip all digits. We have tests showing that we should not round the value. */
844 while(isdigitW(*++ptr));
848 if(!ptr || (*ptr && strcmpW(ptr, pxW)))
849 *p = 0;
852 nsAString_Finish(&str_value);
853 return hres;
856 static BOOL is_valid_border_style(BSTR v)
858 return !v || strcmpiW(v, noneW) == 0 || strcmpiW(v, dottedW) == 0 ||
859 strcmpiW(v, dashedW) == 0 || strcmpiW(v, solidW) == 0 ||
860 strcmpiW(v, doubleW) == 0 || strcmpiW(v, grooveW) == 0 ||
861 strcmpiW(v, ridgeW) == 0 || strcmpiW(v, insetW) == 0 ||
862 strcmpiW(v, outsetW) == 0;
865 static inline HTMLStyle *impl_from_IHTMLStyle(IHTMLStyle *iface)
867 return CONTAINING_RECORD(iface, HTMLStyle, IHTMLStyle_iface);
870 static HRESULT WINAPI HTMLStyle_QueryInterface(IHTMLStyle *iface, REFIID riid, void **ppv)
872 HTMLStyle *This = impl_from_IHTMLStyle(iface);
874 TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
876 if(IsEqualGUID(&IID_IUnknown, riid)) {
877 *ppv = &This->IHTMLStyle_iface;
878 }else if(IsEqualGUID(&IID_IHTMLStyle, riid)) {
879 *ppv = &This->IHTMLStyle_iface;
880 }else if(IsEqualGUID(&IID_IHTMLStyle2, riid)) {
881 *ppv = &This->IHTMLStyle2_iface;
882 }else if(IsEqualGUID(&IID_IHTMLStyle3, riid)) {
883 *ppv = &This->IHTMLStyle3_iface;
884 }else if(IsEqualGUID(&IID_IHTMLStyle4, riid)) {
885 *ppv = &This->IHTMLStyle4_iface;
886 }else if(IsEqualGUID(&IID_IHTMLStyle5, riid)) {
887 *ppv = &This->IHTMLStyle5_iface;
888 }else if(IsEqualGUID(&IID_IHTMLStyle6, riid)) {
889 *ppv = &This->IHTMLStyle6_iface;
890 }else if(dispex_query_interface(&This->dispex, riid, ppv)) {
891 return *ppv ? S_OK : E_NOINTERFACE;
892 }else {
893 *ppv = NULL;
894 WARN("unsupported iface %s\n", debugstr_mshtml_guid(riid));
895 return E_NOINTERFACE;
898 IUnknown_AddRef((IUnknown*)*ppv);
899 return S_OK;
902 static ULONG WINAPI HTMLStyle_AddRef(IHTMLStyle *iface)
904 HTMLStyle *This = impl_from_IHTMLStyle(iface);
905 LONG ref = InterlockedIncrement(&This->ref);
907 TRACE("(%p) ref=%d\n", This, ref);
909 return ref;
912 static ULONG WINAPI HTMLStyle_Release(IHTMLStyle *iface)
914 HTMLStyle *This = impl_from_IHTMLStyle(iface);
915 LONG ref = InterlockedDecrement(&This->ref);
917 TRACE("(%p) ref=%d\n", This, ref);
919 if(!ref) {
920 assert(!This->elem);
921 if(This->nsstyle)
922 nsIDOMCSSStyleDeclaration_Release(This->nsstyle);
923 release_dispex(&This->dispex);
924 heap_free(This);
927 return ref;
930 static HRESULT WINAPI HTMLStyle_GetTypeInfoCount(IHTMLStyle *iface, UINT *pctinfo)
932 HTMLStyle *This = impl_from_IHTMLStyle(iface);
933 return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
936 static HRESULT WINAPI HTMLStyle_GetTypeInfo(IHTMLStyle *iface, UINT iTInfo,
937 LCID lcid, ITypeInfo **ppTInfo)
939 HTMLStyle *This = impl_from_IHTMLStyle(iface);
940 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
943 static HRESULT WINAPI HTMLStyle_GetIDsOfNames(IHTMLStyle *iface, REFIID riid,
944 LPOLESTR *rgszNames, UINT cNames,
945 LCID lcid, DISPID *rgDispId)
947 HTMLStyle *This = impl_from_IHTMLStyle(iface);
948 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
949 lcid, rgDispId);
952 static HRESULT WINAPI HTMLStyle_Invoke(IHTMLStyle *iface, DISPID dispIdMember,
953 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
954 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
956 HTMLStyle *This = impl_from_IHTMLStyle(iface);
957 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
958 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
961 static HRESULT WINAPI HTMLStyle_put_fontFamily(IHTMLStyle *iface, BSTR v)
963 HTMLStyle *This = impl_from_IHTMLStyle(iface);
965 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
967 return set_style_property(This, STYLEID_FONT_FAMILY, v);
970 static HRESULT WINAPI HTMLStyle_get_fontFamily(IHTMLStyle *iface, BSTR *p)
972 HTMLStyle *This = impl_from_IHTMLStyle(iface);
974 TRACE("(%p)->(%p)\n", This, p);
976 return get_style_property(This, STYLEID_FONT_FAMILY, p);
979 static HRESULT WINAPI HTMLStyle_put_fontStyle(IHTMLStyle *iface, BSTR v)
981 HTMLStyle *This = impl_from_IHTMLStyle(iface);
983 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
985 return set_style_property(This, STYLEID_FONT_STYLE, v);
988 static HRESULT WINAPI HTMLStyle_get_fontStyle(IHTMLStyle *iface, BSTR *p)
990 HTMLStyle *This = impl_from_IHTMLStyle(iface);
992 TRACE("(%p)->(%p)\n", This, p);
994 return get_style_property(This, STYLEID_FONT_STYLE, p);
997 static HRESULT WINAPI HTMLStyle_put_fontVariant(IHTMLStyle *iface, BSTR v)
999 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1001 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1003 return set_style_property(This, STYLEID_FONT_VARIANT, v);
1006 static HRESULT WINAPI HTMLStyle_get_fontVariant(IHTMLStyle *iface, BSTR *p)
1008 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1009 TRACE("(%p)->(%p)\n", This, p);
1011 if(!p)
1012 return E_INVALIDARG;
1014 return get_style_property(This, STYLEID_FONT_VARIANT, p);
1017 static HRESULT WINAPI HTMLStyle_put_fontWeight(IHTMLStyle *iface, BSTR v)
1019 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1021 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1023 return set_style_property(This, STYLEID_FONT_WEIGHT, v);
1026 static HRESULT WINAPI HTMLStyle_get_fontWeight(IHTMLStyle *iface, BSTR *p)
1028 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1030 TRACE("(%p)->(%p)\n", This, p);
1032 return get_style_property(This, STYLEID_FONT_WEIGHT, p);
1035 static HRESULT WINAPI HTMLStyle_put_fontSize(IHTMLStyle *iface, VARIANT v)
1037 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1039 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1041 return set_style_property_var(This, STYLEID_FONT_SIZE, &v);
1044 static HRESULT WINAPI HTMLStyle_get_fontSize(IHTMLStyle *iface, VARIANT *p)
1046 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1048 TRACE("(%p)->(%p)\n", This, p);
1050 return get_style_property_var(This, STYLEID_FONT_SIZE, p);
1053 static HRESULT WINAPI HTMLStyle_put_font(IHTMLStyle *iface, BSTR v)
1055 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1056 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1057 return E_NOTIMPL;
1060 static HRESULT WINAPI HTMLStyle_get_font(IHTMLStyle *iface, BSTR *p)
1062 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1063 FIXME("(%p)->(%p)\n", This, p);
1064 return E_NOTIMPL;
1067 static HRESULT WINAPI HTMLStyle_put_color(IHTMLStyle *iface, VARIANT v)
1069 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1071 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1073 return set_style_property_var(This, STYLEID_COLOR, &v);
1076 static HRESULT WINAPI HTMLStyle_get_color(IHTMLStyle *iface, VARIANT *p)
1078 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1080 TRACE("(%p)->(%p)\n", This, p);
1082 return get_style_property_var(This, STYLEID_COLOR, p);
1085 static HRESULT WINAPI HTMLStyle_put_background(IHTMLStyle *iface, BSTR v)
1087 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1089 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1091 return set_style_property(This, STYLEID_BACKGROUND, v);
1094 static HRESULT WINAPI HTMLStyle_get_background(IHTMLStyle *iface, BSTR *p)
1096 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1098 TRACE("(%p)->(%p)\n", This, p);
1100 return get_style_property(This, STYLEID_BACKGROUND, p);
1103 static HRESULT WINAPI HTMLStyle_put_backgroundColor(IHTMLStyle *iface, VARIANT v)
1105 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1107 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1109 return set_style_property_var(This, STYLEID_BACKGROUND_COLOR, &v);
1112 static HRESULT WINAPI HTMLStyle_get_backgroundColor(IHTMLStyle *iface, VARIANT *p)
1114 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1116 TRACE("(%p)->(%p)\n", This, p);
1118 return get_style_property_var(This, STYLEID_BACKGROUND_COLOR, p);
1121 static HRESULT WINAPI HTMLStyle_put_backgroundImage(IHTMLStyle *iface, BSTR v)
1123 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1125 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1127 return set_style_property(This, STYLEID_BACKGROUND_IMAGE, v);
1130 static HRESULT WINAPI HTMLStyle_get_backgroundImage(IHTMLStyle *iface, BSTR *p)
1132 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1134 TRACE("(%p)->(%p)\n", This, p);
1136 return get_style_property(This, STYLEID_BACKGROUND_IMAGE, p);
1139 static HRESULT WINAPI HTMLStyle_put_backgroundRepeat(IHTMLStyle *iface, BSTR v)
1141 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1143 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1145 return set_style_property(This, STYLEID_BACKGROUND_REPEAT , v);
1148 static HRESULT WINAPI HTMLStyle_get_backgroundRepeat(IHTMLStyle *iface, BSTR *p)
1150 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1152 TRACE("(%p)->(%p)\n", This, p);
1154 return get_style_property(This, STYLEID_BACKGROUND_REPEAT, p);
1157 static HRESULT WINAPI HTMLStyle_put_backgroundAttachment(IHTMLStyle *iface, BSTR v)
1159 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1161 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1163 return set_style_property(This, STYLEID_BACKGROUND_ATTACHMENT, v);
1166 static HRESULT WINAPI HTMLStyle_get_backgroundAttachment(IHTMLStyle *iface, BSTR *p)
1168 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1170 TRACE("(%p)->(%p)\n", This, p);
1172 return get_style_property(This, STYLEID_BACKGROUND_ATTACHMENT, p);
1175 static HRESULT WINAPI HTMLStyle_put_backgroundPosition(IHTMLStyle *iface, BSTR v)
1177 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1179 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1181 return set_style_property(This, STYLEID_BACKGROUND_POSITION, v);
1184 static HRESULT WINAPI HTMLStyle_get_backgroundPosition(IHTMLStyle *iface, BSTR *p)
1186 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1188 TRACE("(%p)->(%p)\n", This, p);
1190 return get_style_property(This, STYLEID_BACKGROUND_POSITION, p);
1193 static HRESULT WINAPI HTMLStyle_put_backgroundPositionX(IHTMLStyle *iface, VARIANT v)
1195 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1196 WCHAR buf[14], *pos_val;
1197 nsAString pos_str;
1198 const WCHAR *val;
1199 DWORD val_len;
1200 HRESULT hres;
1202 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1204 hres = var_to_styleval(This, &v, STYLEID_BACKGROUND_POSITION_X, buf, &val);
1205 if(FAILED(hres))
1206 return hres;
1208 val_len = val ? strlenW(val) : 0;
1210 nsAString_Init(&pos_str, NULL);
1211 hres = get_nsstyle_attr_nsval(This->nsstyle, STYLEID_BACKGROUND_POSITION, &pos_str);
1212 if(SUCCEEDED(hres)) {
1213 const PRUnichar *pos, *posy;
1214 DWORD posy_len;
1216 nsAString_GetData(&pos_str, &pos);
1217 posy = strchrW(pos, ' ');
1218 if(!posy) {
1219 static const WCHAR zero_pxW[] = {' ','0','p','x',0};
1221 TRACE("no space in %s\n", debugstr_w(pos));
1222 posy = zero_pxW;
1225 posy_len = strlenW(posy);
1226 pos_val = heap_alloc((val_len+posy_len+1)*sizeof(WCHAR));
1227 if(pos_val) {
1228 if(val_len)
1229 memcpy(pos_val, val, val_len*sizeof(WCHAR));
1230 if(posy_len)
1231 memcpy(pos_val+val_len, posy, posy_len*sizeof(WCHAR));
1232 pos_val[val_len+posy_len] = 0;
1233 }else {
1234 hres = E_OUTOFMEMORY;
1237 nsAString_Finish(&pos_str);
1238 if(FAILED(hres))
1239 return hres;
1241 TRACE("setting position to %s\n", debugstr_w(pos_val));
1242 hres = set_style_property(This, STYLEID_BACKGROUND_POSITION, pos_val);
1243 heap_free(pos_val);
1244 return hres;
1247 static HRESULT WINAPI HTMLStyle_get_backgroundPositionX(IHTMLStyle *iface, VARIANT *p)
1249 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1250 nsAString pos_str;
1251 BSTR ret;
1252 HRESULT hres;
1254 TRACE("(%p)->(%p)\n", This, p);
1256 nsAString_Init(&pos_str, NULL);
1257 hres = get_nsstyle_attr_nsval(This->nsstyle, STYLEID_BACKGROUND_POSITION, &pos_str);
1258 if(SUCCEEDED(hres)) {
1259 const PRUnichar *pos, *space;
1261 nsAString_GetData(&pos_str, &pos);
1262 space = strchrW(pos, ' ');
1263 if(!space) {
1264 WARN("no space in %s\n", debugstr_w(pos));
1265 space = pos + strlenW(pos);
1268 if(space != pos) {
1269 ret = SysAllocStringLen(pos, space-pos);
1270 if(!ret)
1271 hres = E_OUTOFMEMORY;
1272 }else {
1273 ret = NULL;
1276 nsAString_Finish(&pos_str);
1277 if(FAILED(hres))
1278 return hres;
1280 TRACE("returning %s\n", debugstr_w(ret));
1281 V_VT(p) = VT_BSTR;
1282 V_BSTR(p) = ret;
1283 return S_OK;
1286 static HRESULT WINAPI HTMLStyle_put_backgroundPositionY(IHTMLStyle *iface, VARIANT v)
1288 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1289 WCHAR buf[14], *pos_val;
1290 nsAString pos_str;
1291 const WCHAR *val;
1292 DWORD val_len;
1293 HRESULT hres;
1295 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1297 hres = var_to_styleval(This, &v, STYLEID_BACKGROUND_POSITION, buf, &val);
1298 if(FAILED(hres))
1299 return hres;
1301 val_len = val ? strlenW(val) : 0;
1303 nsAString_Init(&pos_str, NULL);
1304 hres = get_nsstyle_attr_nsval(This->nsstyle, STYLEID_BACKGROUND_POSITION, &pos_str);
1305 if(SUCCEEDED(hres)) {
1306 const PRUnichar *pos, *space;
1307 DWORD posx_len;
1309 nsAString_GetData(&pos_str, &pos);
1310 space = strchrW(pos, ' ');
1311 if(space) {
1312 space++;
1313 }else {
1314 static const WCHAR zero_pxW[] = {'0','p','x',' ',0};
1316 TRACE("no space in %s\n", debugstr_w(pos));
1317 pos = zero_pxW;
1318 space = pos + ARRAY_SIZE(zero_pxW)-1;
1321 posx_len = space-pos;
1323 pos_val = heap_alloc((posx_len+val_len+1)*sizeof(WCHAR));
1324 if(pos_val) {
1325 memcpy(pos_val, pos, posx_len*sizeof(WCHAR));
1326 if(val_len)
1327 memcpy(pos_val+posx_len, val, val_len*sizeof(WCHAR));
1328 pos_val[posx_len+val_len] = 0;
1329 }else {
1330 hres = E_OUTOFMEMORY;
1333 nsAString_Finish(&pos_str);
1334 if(FAILED(hres))
1335 return hres;
1337 TRACE("setting position to %s\n", debugstr_w(pos_val));
1338 hres = set_style_property(This, STYLEID_BACKGROUND_POSITION, pos_val);
1339 heap_free(pos_val);
1340 return hres;
1343 static HRESULT WINAPI HTMLStyle_get_backgroundPositionY(IHTMLStyle *iface, VARIANT *p)
1345 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1346 nsAString pos_str;
1347 BSTR ret;
1348 HRESULT hres;
1350 TRACE("(%p)->(%p)\n", This, p);
1352 nsAString_Init(&pos_str, NULL);
1353 hres = get_nsstyle_attr_nsval(This->nsstyle, STYLEID_BACKGROUND_POSITION, &pos_str);
1354 if(SUCCEEDED(hres)) {
1355 const PRUnichar *pos, *posy;
1357 nsAString_GetData(&pos_str, &pos);
1358 posy = strchrW(pos, ' ');
1359 if(posy) {
1360 ret = SysAllocString(posy+1);
1361 if(!ret)
1362 hres = E_OUTOFMEMORY;
1363 }else {
1364 ret = NULL;
1367 nsAString_Finish(&pos_str);
1368 if(FAILED(hres))
1369 return hres;
1371 TRACE("returning %s\n", debugstr_w(ret));
1372 V_VT(p) = VT_BSTR;
1373 V_BSTR(p) = ret;
1374 return S_OK;
1377 static HRESULT WINAPI HTMLStyle_put_wordSpacing(IHTMLStyle *iface, VARIANT v)
1379 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1381 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1383 return set_style_property_var(This, STYLEID_WORD_SPACING, &v);
1386 static HRESULT WINAPI HTMLStyle_get_wordSpacing(IHTMLStyle *iface, VARIANT *p)
1388 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1389 TRACE("(%p)->(%p)\n", This, p);
1390 return get_style_property_var(This, STYLEID_WORD_SPACING, p);
1393 static HRESULT WINAPI HTMLStyle_put_letterSpacing(IHTMLStyle *iface, VARIANT v)
1395 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1397 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1399 return set_style_property_var(This, STYLEID_LETTER_SPACING, &v);
1402 static HRESULT WINAPI HTMLStyle_get_letterSpacing(IHTMLStyle *iface, VARIANT *p)
1404 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1405 TRACE("(%p)->(%p)\n", This, p);
1406 return get_style_property_var(This, STYLEID_LETTER_SPACING, p);
1409 static HRESULT WINAPI HTMLStyle_put_textDecoration(IHTMLStyle *iface, BSTR v)
1411 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1413 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1415 return set_style_property(This, STYLEID_TEXT_DECORATION , v);
1418 static HRESULT WINAPI HTMLStyle_get_textDecoration(IHTMLStyle *iface, BSTR *p)
1420 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1422 TRACE("(%p)->(%p)\n", This, p);
1424 return get_style_property(This, STYLEID_TEXT_DECORATION, p);
1427 static HRESULT WINAPI HTMLStyle_put_textDecorationNone(IHTMLStyle *iface, VARIANT_BOOL v)
1429 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1431 TRACE("(%p)->(%x)\n", This, v);
1433 return set_style_property(This, STYLEID_TEXT_DECORATION, v ? noneW : emptyW);
1436 static HRESULT WINAPI HTMLStyle_get_textDecorationNone(IHTMLStyle *iface, VARIANT_BOOL *p)
1438 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1440 TRACE("(%p)->(%p)\n", This, p);
1442 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, noneW, p);
1445 static HRESULT WINAPI HTMLStyle_put_textDecorationUnderline(IHTMLStyle *iface, VARIANT_BOOL v)
1447 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1449 TRACE("(%p)->(%x)\n", This, v);
1451 return set_style_property(This, STYLEID_TEXT_DECORATION, v ? underlineW : emptyW);
1454 static HRESULT WINAPI HTMLStyle_get_textDecorationUnderline(IHTMLStyle *iface, VARIANT_BOOL *p)
1456 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1458 TRACE("(%p)->(%p)\n", This, p);
1460 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, underlineW, p);
1463 static HRESULT WINAPI HTMLStyle_put_textDecorationOverline(IHTMLStyle *iface, VARIANT_BOOL v)
1465 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1467 TRACE("(%p)->(%x)\n", This, v);
1469 return set_style_property(This, STYLEID_TEXT_DECORATION, v ? overlineW : emptyW);
1472 static HRESULT WINAPI HTMLStyle_get_textDecorationOverline(IHTMLStyle *iface, VARIANT_BOOL *p)
1474 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1476 TRACE("(%p)->(%p)\n", This, p);
1478 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, overlineW, p);
1481 static HRESULT WINAPI HTMLStyle_put_textDecorationLineThrough(IHTMLStyle *iface, VARIANT_BOOL v)
1483 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1485 TRACE("(%p)->(%x)\n", This, v);
1487 return set_style_property(This, STYLEID_TEXT_DECORATION, v ? line_throughW : emptyW);
1490 static HRESULT WINAPI HTMLStyle_get_textDecorationLineThrough(IHTMLStyle *iface, VARIANT_BOOL *p)
1492 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1494 TRACE("(%p)->(%p)\n", This, p);
1496 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, line_throughW, p);
1499 static HRESULT WINAPI HTMLStyle_put_textDecorationBlink(IHTMLStyle *iface, VARIANT_BOOL v)
1501 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1503 TRACE("(%p)->(%x)\n", This, v);
1505 return set_style_property(This, STYLEID_TEXT_DECORATION, v ? blinkW : emptyW);
1508 static HRESULT WINAPI HTMLStyle_get_textDecorationBlink(IHTMLStyle *iface, VARIANT_BOOL *p)
1510 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1512 TRACE("(%p)->(%p)\n", This, p);
1514 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, blinkW, p);
1517 static HRESULT WINAPI HTMLStyle_put_verticalAlign(IHTMLStyle *iface, VARIANT v)
1519 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1521 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1523 return set_style_property_var(This, STYLEID_VERTICAL_ALIGN, &v);
1526 static HRESULT WINAPI HTMLStyle_get_verticalAlign(IHTMLStyle *iface, VARIANT *p)
1528 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1530 TRACE("(%p)->(%p)\n", This, p);
1532 return get_style_property_var(This, STYLEID_VERTICAL_ALIGN, p);
1535 static HRESULT WINAPI HTMLStyle_put_textTransform(IHTMLStyle *iface, BSTR v)
1537 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1539 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1541 return set_style_property(This, STYLEID_TEXT_TRANSFORM, v);
1544 static HRESULT WINAPI HTMLStyle_get_textTransform(IHTMLStyle *iface, BSTR *p)
1546 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1548 TRACE("(%p)->(%p)\n", This, p);
1550 return get_style_property(This, STYLEID_TEXT_TRANSFORM, p);
1553 static HRESULT WINAPI HTMLStyle_put_textAlign(IHTMLStyle *iface, BSTR v)
1555 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1557 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1559 return set_style_property(This, STYLEID_TEXT_ALIGN, v);
1562 static HRESULT WINAPI HTMLStyle_get_textAlign(IHTMLStyle *iface, BSTR *p)
1564 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1566 TRACE("(%p)->(%p)\n", This, p);
1568 return get_style_property(This, STYLEID_TEXT_ALIGN, p);
1571 static HRESULT WINAPI HTMLStyle_put_textIndent(IHTMLStyle *iface, VARIANT v)
1573 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1575 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1577 return set_style_property_var(This, STYLEID_TEXT_INDENT, &v);
1580 static HRESULT WINAPI HTMLStyle_get_textIndent(IHTMLStyle *iface, VARIANT *p)
1582 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1584 TRACE("(%p)->(%p)\n", This, p);
1586 return get_style_property_var(This, STYLEID_TEXT_INDENT, p);
1589 static HRESULT WINAPI HTMLStyle_put_lineHeight(IHTMLStyle *iface, VARIANT v)
1591 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1593 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1595 return set_style_property_var(This, STYLEID_LINE_HEIGHT, &v);
1598 static HRESULT WINAPI HTMLStyle_get_lineHeight(IHTMLStyle *iface, VARIANT *p)
1600 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1602 TRACE("(%p)->(%p)\n", This, p);
1604 return get_style_property_var(This, STYLEID_LINE_HEIGHT, p);
1607 static HRESULT WINAPI HTMLStyle_put_marginTop(IHTMLStyle *iface, VARIANT v)
1609 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1611 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1613 return set_style_property_var(This, STYLEID_MARGIN_TOP, &v);
1616 static HRESULT WINAPI HTMLStyle_get_marginTop(IHTMLStyle *iface, VARIANT *p)
1618 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1620 TRACE("(%p)->(%p)\n", This, p);
1622 return get_style_property_var(This, STYLEID_MARGIN_TOP, p);
1625 static HRESULT WINAPI HTMLStyle_put_marginRight(IHTMLStyle *iface, VARIANT v)
1627 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1629 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1631 return set_style_property_var(This, STYLEID_MARGIN_RIGHT, &v);
1634 static HRESULT WINAPI HTMLStyle_get_marginRight(IHTMLStyle *iface, VARIANT *p)
1636 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1637 TRACE("(%p)->(%p)\n", This, p);
1638 return get_style_property_var(This, STYLEID_MARGIN_RIGHT, p);
1641 static HRESULT WINAPI HTMLStyle_put_marginBottom(IHTMLStyle *iface, VARIANT v)
1643 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1645 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1647 return set_style_property_var(This, STYLEID_MARGIN_BOTTOM, &v);
1650 static HRESULT WINAPI HTMLStyle_get_marginBottom(IHTMLStyle *iface, VARIANT *p)
1652 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1654 TRACE("(%p)->(%p)\n", This, p);
1656 return get_style_property_var(This, STYLEID_MARGIN_BOTTOM, p);
1659 static HRESULT WINAPI HTMLStyle_put_marginLeft(IHTMLStyle *iface, VARIANT v)
1661 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1663 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1665 return set_style_property_var(This, STYLEID_MARGIN_LEFT, &v);
1668 static HRESULT WINAPI HTMLStyle_put_margin(IHTMLStyle *iface, BSTR v)
1670 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1672 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1674 return set_style_property(This, STYLEID_MARGIN, v);
1677 static HRESULT WINAPI HTMLStyle_get_margin(IHTMLStyle *iface, BSTR *p)
1679 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1681 TRACE("(%p)->(%p)\n", This, p);
1683 return get_style_property(This, STYLEID_MARGIN, p);
1686 static HRESULT WINAPI HTMLStyle_get_marginLeft(IHTMLStyle *iface, VARIANT *p)
1688 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1689 TRACE("(%p)->(%p)\n", This, p);
1690 return get_style_property_var(This, STYLEID_MARGIN_LEFT, p);
1693 static HRESULT WINAPI HTMLStyle_put_paddingTop(IHTMLStyle *iface, VARIANT v)
1695 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1697 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1699 return set_style_property_var(This, STYLEID_PADDING_TOP, &v);
1702 static HRESULT WINAPI HTMLStyle_get_paddingTop(IHTMLStyle *iface, VARIANT *p)
1704 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1706 TRACE("(%p)->(%p)\n", This, p);
1708 return get_style_property_var(This, STYLEID_PADDING_TOP, p);
1711 static HRESULT WINAPI HTMLStyle_put_paddingRight(IHTMLStyle *iface, VARIANT v)
1713 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1715 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1717 return set_style_property_var(This, STYLEID_PADDING_RIGHT, &v);
1720 static HRESULT WINAPI HTMLStyle_get_paddingRight(IHTMLStyle *iface, VARIANT *p)
1722 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1724 TRACE("(%p)->(%p)\n", This, p);
1726 return get_style_property_var(This, STYLEID_PADDING_RIGHT, p);
1729 static HRESULT WINAPI HTMLStyle_put_paddingBottom(IHTMLStyle *iface, VARIANT v)
1731 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1733 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1735 return set_style_property_var(This, STYLEID_PADDING_BOTTOM, &v);
1738 static HRESULT WINAPI HTMLStyle_get_paddingBottom(IHTMLStyle *iface, VARIANT *p)
1740 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1742 TRACE("(%p)->(%p)\n", This, p);
1744 return get_style_property_var(This, STYLEID_PADDING_BOTTOM, p);
1747 static HRESULT WINAPI HTMLStyle_put_paddingLeft(IHTMLStyle *iface, VARIANT v)
1749 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1751 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1753 return set_style_property_var(This, STYLEID_PADDING_LEFT, &v);
1756 static HRESULT WINAPI HTMLStyle_get_paddingLeft(IHTMLStyle *iface, VARIANT *p)
1758 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1760 TRACE("(%p)->(%p)\n", This, p);
1762 return get_style_property_var(This, STYLEID_PADDING_LEFT, p);
1765 static HRESULT WINAPI HTMLStyle_put_padding(IHTMLStyle *iface, BSTR v)
1767 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1769 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1771 return set_style_property(This, STYLEID_PADDING, v);
1774 static HRESULT WINAPI HTMLStyle_get_padding(IHTMLStyle *iface, BSTR *p)
1776 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1778 TRACE("(%p)->(%p)\n", This, p);
1780 return get_style_property(This, STYLEID_PADDING, p);
1783 static HRESULT WINAPI HTMLStyle_put_border(IHTMLStyle *iface, BSTR v)
1785 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1787 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1789 return set_style_property(This, STYLEID_BORDER, v);
1792 static HRESULT WINAPI HTMLStyle_get_border(IHTMLStyle *iface, BSTR *p)
1794 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1796 TRACE("(%p)->(%p)\n", This, p);
1798 return get_style_property(This, STYLEID_BORDER, p);
1801 static HRESULT WINAPI HTMLStyle_put_borderTop(IHTMLStyle *iface, BSTR v)
1803 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1804 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1805 return set_style_property(This, STYLEID_BORDER_TOP, v);
1808 static HRESULT WINAPI HTMLStyle_get_borderTop(IHTMLStyle *iface, BSTR *p)
1810 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1811 TRACE("(%p)->(%p)\n", This, p);
1812 return get_style_property(This, STYLEID_BORDER_TOP, p);
1815 static HRESULT WINAPI HTMLStyle_put_borderRight(IHTMLStyle *iface, BSTR v)
1817 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1818 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1819 return set_style_property(This, STYLEID_BORDER_RIGHT, v);
1822 static HRESULT WINAPI HTMLStyle_get_borderRight(IHTMLStyle *iface, BSTR *p)
1824 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1825 TRACE("(%p)->(%p)\n", This, p);
1826 return get_style_property(This, STYLEID_BORDER_RIGHT, p);
1829 static HRESULT WINAPI HTMLStyle_put_borderBottom(IHTMLStyle *iface, BSTR v)
1831 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1832 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1833 return set_style_property(This, STYLEID_BORDER_BOTTOM, v);
1836 static HRESULT WINAPI HTMLStyle_get_borderBottom(IHTMLStyle *iface, BSTR *p)
1838 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1839 TRACE("(%p)->(%p)\n", This, p);
1840 return get_style_property(This, STYLEID_BORDER_BOTTOM, p);
1843 static HRESULT WINAPI HTMLStyle_put_borderLeft(IHTMLStyle *iface, BSTR v)
1845 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1847 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1849 return set_style_property(This, STYLEID_BORDER_LEFT, v);
1852 static HRESULT WINAPI HTMLStyle_get_borderLeft(IHTMLStyle *iface, BSTR *p)
1854 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1856 TRACE("(%p)->(%p)\n", This, p);
1858 return get_style_property(This, STYLEID_BORDER_LEFT, p);
1861 static HRESULT WINAPI HTMLStyle_put_borderColor(IHTMLStyle *iface, BSTR v)
1863 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1865 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1867 return set_style_property(This, STYLEID_BORDER_COLOR, v);
1870 static HRESULT WINAPI HTMLStyle_get_borderColor(IHTMLStyle *iface, BSTR *p)
1872 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1874 TRACE("(%p)->(%p)\n", This, p);
1876 return get_style_property(This, STYLEID_BORDER_COLOR, p);
1879 static HRESULT WINAPI HTMLStyle_put_borderTopColor(IHTMLStyle *iface, VARIANT v)
1881 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1883 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1885 return set_style_property_var(This, STYLEID_BORDER_TOP_COLOR, &v);
1888 static HRESULT WINAPI HTMLStyle_get_borderTopColor(IHTMLStyle *iface, VARIANT *p)
1890 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1892 TRACE("(%p)->(%p)\n", This, p);
1894 return get_style_property_var(This, STYLEID_BORDER_TOP_COLOR, p);
1897 static HRESULT WINAPI HTMLStyle_put_borderRightColor(IHTMLStyle *iface, VARIANT v)
1899 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1901 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1903 return set_style_property_var(This, STYLEID_BORDER_RIGHT_COLOR, &v);
1906 static HRESULT WINAPI HTMLStyle_get_borderRightColor(IHTMLStyle *iface, VARIANT *p)
1908 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1910 TRACE("(%p)->(%p)\n", This, p);
1912 return get_style_property_var(This, STYLEID_BORDER_RIGHT_COLOR, p);
1915 static HRESULT WINAPI HTMLStyle_put_borderBottomColor(IHTMLStyle *iface, VARIANT v)
1917 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1919 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1921 return set_style_property_var(This, STYLEID_BORDER_BOTTOM_COLOR, &v);
1924 static HRESULT WINAPI HTMLStyle_get_borderBottomColor(IHTMLStyle *iface, VARIANT *p)
1926 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1928 TRACE("(%p)->(%p)\n", This, p);
1930 return get_style_property_var(This, STYLEID_BORDER_BOTTOM_COLOR, p);
1933 static HRESULT WINAPI HTMLStyle_put_borderLeftColor(IHTMLStyle *iface, VARIANT v)
1935 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1937 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1939 return set_style_property_var(This, STYLEID_BORDER_LEFT_COLOR, &v);
1942 static HRESULT WINAPI HTMLStyle_get_borderLeftColor(IHTMLStyle *iface, VARIANT *p)
1944 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1946 TRACE("(%p)->(%p)\n", This, p);
1948 return get_style_property_var(This, STYLEID_BORDER_LEFT_COLOR, p);
1951 static HRESULT WINAPI HTMLStyle_put_borderWidth(IHTMLStyle *iface, BSTR v)
1953 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1954 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1955 return set_style_property(This, STYLEID_BORDER_WIDTH, v);
1958 static HRESULT WINAPI HTMLStyle_get_borderWidth(IHTMLStyle *iface, BSTR *p)
1960 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1961 TRACE("(%p)->(%p)\n", This, p);
1962 return get_style_property(This, STYLEID_BORDER_WIDTH, p);
1965 static HRESULT WINAPI HTMLStyle_put_borderTopWidth(IHTMLStyle *iface, VARIANT v)
1967 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1969 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1971 return set_style_property_var(This, STYLEID_BORDER_TOP_WIDTH, &v);
1974 static HRESULT WINAPI HTMLStyle_get_borderTopWidth(IHTMLStyle *iface, VARIANT *p)
1976 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1978 TRACE("(%p)->(%p)\n", This, p);
1980 return get_style_property_var(This, STYLEID_BORDER_TOP_WIDTH, p);
1983 static HRESULT WINAPI HTMLStyle_put_borderRightWidth(IHTMLStyle *iface, VARIANT v)
1985 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1987 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1989 return set_style_property_var(This, STYLEID_BORDER_RIGHT_WIDTH, &v);
1992 static HRESULT WINAPI HTMLStyle_get_borderRightWidth(IHTMLStyle *iface, VARIANT *p)
1994 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1996 TRACE("(%p)->(%p)\n", This, p);
1998 return get_style_property_var(This, STYLEID_BORDER_RIGHT_WIDTH, p);
2001 static HRESULT WINAPI HTMLStyle_put_borderBottomWidth(IHTMLStyle *iface, VARIANT v)
2003 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2005 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
2007 return set_style_property_var(This, STYLEID_BORDER_BOTTOM_WIDTH, &v);
2010 static HRESULT WINAPI HTMLStyle_get_borderBottomWidth(IHTMLStyle *iface, VARIANT *p)
2012 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2013 TRACE("(%p)->(%p)\n", This, p);
2014 return get_style_property_var(This, STYLEID_BORDER_BOTTOM_WIDTH, p);
2017 static HRESULT WINAPI HTMLStyle_put_borderLeftWidth(IHTMLStyle *iface, VARIANT v)
2019 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2021 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
2023 return set_style_property_var(This, STYLEID_BORDER_LEFT_WIDTH, &v);
2026 static HRESULT WINAPI HTMLStyle_get_borderLeftWidth(IHTMLStyle *iface, VARIANT *p)
2028 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2029 TRACE("(%p)->(%p)\n", This, p);
2030 return get_style_property_var(This, STYLEID_BORDER_LEFT_WIDTH, p);
2033 static HRESULT WINAPI HTMLStyle_put_borderStyle(IHTMLStyle *iface, BSTR v)
2035 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2036 static const WCHAR styleWindowInset[] = {'w','i','n','d','o','w','-','i','n','s','e','t',0};
2037 HRESULT hres = S_OK;
2038 BSTR pstyle;
2039 int i=0;
2040 int last = 0;
2042 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2044 while(v[i] && hres == S_OK)
2046 if(v[i] == (WCHAR)' ')
2048 pstyle = SysAllocStringLen(&v[last], (i-last));
2049 if( !(is_valid_border_style(pstyle) || strcmpiW(styleWindowInset, pstyle) == 0))
2051 TRACE("1. Invalid style (%s)\n", debugstr_w(pstyle));
2052 hres = E_INVALIDARG;
2054 SysFreeString(pstyle);
2055 last = i+1;
2057 i++;
2060 if(hres == S_OK)
2062 pstyle = SysAllocStringLen(&v[last], i-last);
2063 if( !(is_valid_border_style(pstyle) || strcmpiW(styleWindowInset, pstyle) == 0))
2065 TRACE("2. Invalid style (%s)\n", debugstr_w(pstyle));
2066 hres = E_INVALIDARG;
2068 SysFreeString(pstyle);
2071 if(hres == S_OK)
2072 hres = set_style_property(This, STYLEID_BORDER_STYLE, v);
2074 return hres;
2077 static HRESULT WINAPI HTMLStyle_get_borderStyle(IHTMLStyle *iface, BSTR *p)
2079 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2080 TRACE("(%p)->(%p)\n", This, p);
2081 return get_style_property(This, STYLEID_BORDER_STYLE, p);
2084 static HRESULT WINAPI HTMLStyle_put_borderTopStyle(IHTMLStyle *iface, BSTR v)
2086 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2087 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2088 return set_style_property(This, STYLEID_BORDER_TOP_STYLE, v);
2091 static HRESULT WINAPI HTMLStyle_get_borderTopStyle(IHTMLStyle *iface, BSTR *p)
2093 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2094 TRACE("(%p)->(%p)\n", This, p);
2095 return get_style_property(This, STYLEID_BORDER_TOP_STYLE, p);
2098 static HRESULT WINAPI HTMLStyle_put_borderRightStyle(IHTMLStyle *iface, BSTR v)
2100 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2101 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2102 return set_style_property(This, STYLEID_BORDER_RIGHT_STYLE, v);
2105 static HRESULT WINAPI HTMLStyle_get_borderRightStyle(IHTMLStyle *iface, BSTR *p)
2107 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2108 TRACE("(%p)->(%p)\n", This, p);
2109 return get_style_property(This, STYLEID_BORDER_RIGHT_STYLE, p);
2112 static HRESULT WINAPI HTMLStyle_put_borderBottomStyle(IHTMLStyle *iface, BSTR v)
2114 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2115 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2116 return set_style_property(This, STYLEID_BORDER_BOTTOM_STYLE, v);
2119 static HRESULT WINAPI HTMLStyle_get_borderBottomStyle(IHTMLStyle *iface, BSTR *p)
2121 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2122 TRACE("(%p)->(%p)\n", This, p);
2123 return get_style_property(This, STYLEID_BORDER_BOTTOM_STYLE, p);
2126 static HRESULT WINAPI HTMLStyle_put_borderLeftStyle(IHTMLStyle *iface, BSTR v)
2128 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2129 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2130 return set_style_property(This, STYLEID_BORDER_LEFT_STYLE, v);
2133 static HRESULT WINAPI HTMLStyle_get_borderLeftStyle(IHTMLStyle *iface, BSTR *p)
2135 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2136 TRACE("(%p)->(%p)\n", This, p);
2137 return get_style_property(This, STYLEID_BORDER_LEFT_STYLE, p);
2140 static HRESULT WINAPI HTMLStyle_put_width(IHTMLStyle *iface, VARIANT v)
2142 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2144 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
2146 return set_style_property_var(This, STYLEID_WIDTH, &v);
2149 static HRESULT WINAPI HTMLStyle_get_width(IHTMLStyle *iface, VARIANT *p)
2151 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2153 TRACE("(%p)->(%p)\n", This, p);
2155 return get_style_property_var(This, STYLEID_WIDTH, p);
2158 static HRESULT WINAPI HTMLStyle_put_height(IHTMLStyle *iface, VARIANT v)
2160 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2162 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
2164 return set_style_property_var(This, STYLEID_HEIGHT, &v);
2167 static HRESULT WINAPI HTMLStyle_get_height(IHTMLStyle *iface, VARIANT *p)
2169 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2171 TRACE("(%p)->(%p)\n", This, p);
2173 return get_style_property_var(This, STYLEID_HEIGHT, p);
2176 static HRESULT WINAPI HTMLStyle_put_styleFloat(IHTMLStyle *iface, BSTR v)
2178 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2180 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2182 return set_style_property(This, STYLEID_FLOAT, v);
2185 static HRESULT WINAPI HTMLStyle_get_styleFloat(IHTMLStyle *iface, BSTR *p)
2187 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2189 TRACE("(%p)->(%p)\n", This, p);
2191 return get_style_property(This, STYLEID_FLOAT, p);
2194 static HRESULT WINAPI HTMLStyle_put_clear(IHTMLStyle *iface, BSTR v)
2196 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2198 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2200 return set_style_property(This, STYLEID_CLEAR, v);
2203 static HRESULT WINAPI HTMLStyle_get_clear(IHTMLStyle *iface, BSTR *p)
2205 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2207 TRACE("(%p)->(%p)\n", This, p);
2209 return get_style_property(This, STYLEID_CLEAR, p);
2212 static HRESULT WINAPI HTMLStyle_put_display(IHTMLStyle *iface, BSTR v)
2214 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2216 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2218 return set_style_property(This, STYLEID_DISPLAY, v);
2221 static HRESULT WINAPI HTMLStyle_get_display(IHTMLStyle *iface, BSTR *p)
2223 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2225 TRACE("(%p)->(%p)\n", This, p);
2227 return get_style_property(This, STYLEID_DISPLAY, p);
2230 static HRESULT WINAPI HTMLStyle_put_visibility(IHTMLStyle *iface, BSTR v)
2232 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2234 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2236 return set_style_property(This, STYLEID_VISIBILITY, v);
2239 static HRESULT WINAPI HTMLStyle_get_visibility(IHTMLStyle *iface, BSTR *p)
2241 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2243 TRACE("(%p)->(%p)\n", This, p);
2245 return get_style_property(This, STYLEID_VISIBILITY, p);
2248 static HRESULT WINAPI HTMLStyle_put_listStyleType(IHTMLStyle *iface, BSTR v)
2250 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2252 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2254 return set_style_property(This, STYLEID_LISTSTYLETYPE, v);
2257 static HRESULT WINAPI HTMLStyle_get_listStyleType(IHTMLStyle *iface, BSTR *p)
2259 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2261 TRACE("(%p)->(%p)\n", This, p);
2263 return get_style_property(This, STYLEID_LISTSTYLETYPE, p);
2266 static HRESULT WINAPI HTMLStyle_put_listStylePosition(IHTMLStyle *iface, BSTR v)
2268 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2270 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2272 return set_style_property(This, STYLEID_LISTSTYLEPOSITION, v);
2275 static HRESULT WINAPI HTMLStyle_get_listStylePosition(IHTMLStyle *iface, BSTR *p)
2277 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2279 TRACE("(%p)->(%p)\n", This, p);
2281 return get_style_property(This, STYLEID_LISTSTYLEPOSITION, p);
2284 static HRESULT WINAPI HTMLStyle_put_listStyleImage(IHTMLStyle *iface, BSTR v)
2286 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2287 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
2288 return E_NOTIMPL;
2291 static HRESULT WINAPI HTMLStyle_get_listStyleImage(IHTMLStyle *iface, BSTR *p)
2293 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2294 FIXME("(%p)->(%p)\n", This, p);
2295 return E_NOTIMPL;
2298 static HRESULT WINAPI HTMLStyle_put_listStyle(IHTMLStyle *iface, BSTR v)
2300 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2302 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2304 return set_style_property(This, STYLEID_LIST_STYLE, v);
2307 static HRESULT WINAPI HTMLStyle_get_listStyle(IHTMLStyle *iface, BSTR *p)
2309 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2311 TRACE("(%p)->(%p)\n", This, p);
2313 return get_style_property(This, STYLEID_LIST_STYLE, p);
2316 static HRESULT WINAPI HTMLStyle_put_whiteSpace(IHTMLStyle *iface, BSTR v)
2318 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2320 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2322 return set_style_property(This, STYLEID_WHITE_SPACE, v);
2325 static HRESULT WINAPI HTMLStyle_get_whiteSpace(IHTMLStyle *iface, BSTR *p)
2327 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2329 TRACE("(%p)->(%p)\n", This, p);
2331 return get_style_property(This, STYLEID_WHITE_SPACE, p);
2334 static HRESULT WINAPI HTMLStyle_put_top(IHTMLStyle *iface, VARIANT v)
2336 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2338 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
2340 return set_style_property_var(This, STYLEID_TOP, &v);
2343 static HRESULT WINAPI HTMLStyle_get_top(IHTMLStyle *iface, VARIANT *p)
2345 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2347 TRACE("(%p)->(%p)\n", This, p);
2349 return get_style_property_var(This, STYLEID_TOP, p);
2352 static HRESULT WINAPI HTMLStyle_put_left(IHTMLStyle *iface, VARIANT v)
2354 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2356 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
2358 return set_style_property_var(This, STYLEID_LEFT, &v);
2361 static HRESULT WINAPI HTMLStyle_get_left(IHTMLStyle *iface, VARIANT *p)
2363 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2365 TRACE("(%p)->(%p)\n", This, p);
2367 return get_style_property_var(This, STYLEID_LEFT, p);
2370 static HRESULT WINAPI HTMLStyle_get_position(IHTMLStyle *iface, BSTR *p)
2372 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2373 TRACE("(%p)->(%p)\n", This, p);
2374 return IHTMLStyle2_get_position(&This->IHTMLStyle2_iface, p);
2377 static HRESULT WINAPI HTMLStyle_put_zIndex(IHTMLStyle *iface, VARIANT v)
2379 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2381 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
2383 return set_style_property_var(This, STYLEID_Z_INDEX, &v);
2386 static HRESULT WINAPI HTMLStyle_get_zIndex(IHTMLStyle *iface, VARIANT *p)
2388 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2390 TRACE("(%p)->(%p)\n", This, p);
2392 return get_style_property_var(This, STYLEID_Z_INDEX, p);
2395 static HRESULT WINAPI HTMLStyle_put_overflow(IHTMLStyle *iface, BSTR v)
2397 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2399 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2401 return set_style_property(This, STYLEID_OVERFLOW, v);
2405 static HRESULT WINAPI HTMLStyle_get_overflow(IHTMLStyle *iface, BSTR *p)
2407 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2409 TRACE("(%p)->(%p)\n", This, p);
2411 if(!p)
2412 return E_INVALIDARG;
2414 return get_style_property(This, STYLEID_OVERFLOW, p);
2417 static HRESULT WINAPI HTMLStyle_put_pageBreakBefore(IHTMLStyle *iface, BSTR v)
2419 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2421 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2423 return set_style_property(This, STYLEID_PAGE_BREAK_BEFORE, v);
2426 static HRESULT WINAPI HTMLStyle_get_pageBreakBefore(IHTMLStyle *iface, BSTR *p)
2428 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2430 TRACE("(%p)->(%p)\n", This, p);
2432 return get_style_property(This, STYLEID_PAGE_BREAK_BEFORE, p);
2435 static HRESULT WINAPI HTMLStyle_put_pageBreakAfter(IHTMLStyle *iface, BSTR v)
2437 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2439 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2441 return set_style_property(This, STYLEID_PAGE_BREAK_AFTER, v);
2444 static HRESULT WINAPI HTMLStyle_get_pageBreakAfter(IHTMLStyle *iface, BSTR *p)
2446 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2448 TRACE("(%p)->(%p)\n", This, p);
2450 return get_style_property(This, STYLEID_PAGE_BREAK_AFTER, p);
2453 static HRESULT WINAPI HTMLStyle_put_cssText(IHTMLStyle *iface, BSTR v)
2455 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2456 nsAString text_str;
2457 nsresult nsres;
2459 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2461 nsAString_InitDepend(&text_str, v);
2462 nsres = nsIDOMCSSStyleDeclaration_SetCssText(This->nsstyle, &text_str);
2463 nsAString_Finish(&text_str);
2464 if(NS_FAILED(nsres)) {
2465 FIXME("SetCssStyle failed: %08x\n", nsres);
2466 return E_FAIL;
2469 return S_OK;
2472 static HRESULT WINAPI HTMLStyle_get_cssText(IHTMLStyle *iface, BSTR *p)
2474 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2475 nsAString text_str;
2476 nsresult nsres;
2478 TRACE("(%p)->(%p)\n", This, p);
2480 /* FIXME: Gecko style formatting is different than IE (uppercase). */
2481 nsAString_Init(&text_str, NULL);
2482 nsres = nsIDOMCSSStyleDeclaration_GetCssText(This->nsstyle, &text_str);
2483 if(NS_SUCCEEDED(nsres)) {
2484 const PRUnichar *text;
2486 nsAString_GetData(&text_str, &text);
2487 *p = *text ? SysAllocString(text) : NULL;
2488 }else {
2489 FIXME("GetCssStyle failed: %08x\n", nsres);
2490 *p = NULL;
2493 nsAString_Finish(&text_str);
2494 return S_OK;
2497 static HRESULT WINAPI HTMLStyle_put_pixelTop(IHTMLStyle *iface, LONG v)
2499 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2501 TRACE("(%p)->(%d)\n", This, v);
2503 return set_style_pxattr(This, STYLEID_TOP, v);
2506 static HRESULT WINAPI HTMLStyle_get_pixelTop(IHTMLStyle *iface, LONG *p)
2508 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2510 TRACE("(%p)->(%p)\n", This, p);
2512 return get_nsstyle_pixel_val(This, STYLEID_TOP, p);
2515 static HRESULT WINAPI HTMLStyle_put_pixelLeft(IHTMLStyle *iface, LONG v)
2517 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2519 TRACE("(%p)->(%d)\n", This, v);
2521 return set_style_pxattr(This, STYLEID_LEFT, v);
2524 static HRESULT WINAPI HTMLStyle_get_pixelLeft(IHTMLStyle *iface, LONG *p)
2526 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2528 TRACE("(%p)->(%p)\n", This, p);
2530 return get_nsstyle_pixel_val(This, STYLEID_LEFT, p);
2533 static HRESULT WINAPI HTMLStyle_put_pixelWidth(IHTMLStyle *iface, LONG v)
2535 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2537 TRACE("(%p)->()\n", This);
2539 return set_style_pxattr(This, STYLEID_WIDTH, v);
2542 static HRESULT WINAPI HTMLStyle_get_pixelWidth(IHTMLStyle *iface, LONG *p)
2544 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2546 TRACE("(%p)->(%p)\n", This, p);
2548 return get_nsstyle_pixel_val(This, STYLEID_WIDTH, p);
2551 static HRESULT WINAPI HTMLStyle_put_pixelHeight(IHTMLStyle *iface, LONG v)
2553 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2555 TRACE("(%p)->(%d)\n", This, v);
2557 return set_style_pxattr(This, STYLEID_HEIGHT, v);
2560 static HRESULT WINAPI HTMLStyle_get_pixelHeight(IHTMLStyle *iface, LONG *p)
2562 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2564 TRACE("(%p)->(%p)\n", This, p);
2566 return get_nsstyle_pixel_val(This, STYLEID_HEIGHT, p);
2569 static HRESULT WINAPI HTMLStyle_put_posTop(IHTMLStyle *iface, float v)
2571 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2573 TRACE("(%p)->(%f)\n", This, v);
2575 return set_style_pos(This, STYLEID_TOP, v);
2578 static HRESULT WINAPI HTMLStyle_get_posTop(IHTMLStyle *iface, float *p)
2580 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2582 TRACE("(%p)->(%p)\n", This, p);
2584 if(!p)
2585 return E_POINTER;
2587 return get_nsstyle_pos(This, STYLEID_TOP, p);
2590 static HRESULT WINAPI HTMLStyle_put_posLeft(IHTMLStyle *iface, float v)
2592 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2594 TRACE("(%p)->(%f)\n", This, v);
2596 return set_style_pos(This, STYLEID_LEFT, v);
2599 static HRESULT WINAPI HTMLStyle_get_posLeft(IHTMLStyle *iface, float *p)
2601 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2603 TRACE("(%p)->(%p)\n", This, p);
2605 if(!p)
2606 return E_POINTER;
2608 return get_nsstyle_pos(This, STYLEID_LEFT, p);
2611 static HRESULT WINAPI HTMLStyle_put_posWidth(IHTMLStyle *iface, float v)
2613 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2615 TRACE("(%p)->(%f)\n", This, v);
2617 return set_style_pos(This, STYLEID_WIDTH, v);
2620 static HRESULT WINAPI HTMLStyle_get_posWidth(IHTMLStyle *iface, float *p)
2622 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2624 TRACE("(%p)->(%p)\n", This, p);
2626 if(!p)
2627 return E_POINTER;
2629 if(get_nsstyle_pos(This, STYLEID_WIDTH, p) != S_OK)
2630 *p = 0.0f;
2632 return S_OK;
2635 static HRESULT WINAPI HTMLStyle_put_posHeight(IHTMLStyle *iface, float v)
2637 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2639 TRACE("(%p)->(%f)\n", This, v);
2641 return set_style_pos(This, STYLEID_HEIGHT, v);
2644 static HRESULT WINAPI HTMLStyle_get_posHeight(IHTMLStyle *iface, float *p)
2646 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2648 TRACE("(%p)->(%p)\n", This, p);
2650 if(!p)
2651 return E_POINTER;
2653 if(get_nsstyle_pos(This, STYLEID_HEIGHT, p) != S_OK)
2654 *p = 0.0f;
2656 return S_OK;
2659 static HRESULT WINAPI HTMLStyle_put_cursor(IHTMLStyle *iface, BSTR v)
2661 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2663 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2665 return set_style_property(This, STYLEID_CURSOR, v);
2668 static HRESULT WINAPI HTMLStyle_get_cursor(IHTMLStyle *iface, BSTR *p)
2670 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2672 TRACE("(%p)->(%p)\n", This, p);
2674 return get_style_property(This, STYLEID_CURSOR, p);
2677 static HRESULT WINAPI HTMLStyle_put_clip(IHTMLStyle *iface, BSTR v)
2679 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2681 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2683 return set_style_property(This, STYLEID_CLIP, v);
2686 static HRESULT WINAPI HTMLStyle_get_clip(IHTMLStyle *iface, BSTR *p)
2688 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2690 TRACE("(%p)->(%p)\n", This, p);
2692 return get_style_property(This, STYLEID_CLIP, p);
2695 static void set_opacity(HTMLStyle *This, const WCHAR *val)
2697 nsAString name_str, val_str, empty_str;
2698 nsresult nsres;
2700 static const WCHAR opacityW[] = {'o','p','a','c','i','t','y',0};
2702 TRACE("%s\n", debugstr_w(val));
2704 nsAString_InitDepend(&name_str, opacityW);
2705 nsAString_InitDepend(&val_str, val);
2706 nsAString_InitDepend(&empty_str, emptyW);
2708 nsres = nsIDOMCSSStyleDeclaration_SetProperty(This->nsstyle, &name_str, &val_str, &empty_str);
2709 if(NS_FAILED(nsres))
2710 ERR("SetProperty failed: %08x\n", nsres);
2712 nsAString_Finish(&name_str);
2713 nsAString_Finish(&val_str);
2714 nsAString_Finish(&empty_str);
2717 static void update_filter(HTMLStyle *This)
2719 const WCHAR *ptr, *ptr2;
2721 static const WCHAR alphaW[] = {'a','l','p','h','a'};
2723 if(get_style_compat_mode(This) >= COMPAT_MODE_IE10)
2724 return;
2726 ptr = This->elem->filter;
2727 TRACE("%s\n", debugstr_w(ptr));
2728 if(!ptr) {
2729 set_opacity(This, emptyW);
2730 return;
2733 while(1) {
2734 while(isspaceW(*ptr))
2735 ptr++;
2736 if(!*ptr)
2737 break;
2739 ptr2 = ptr;
2740 while(isalnumW(*ptr))
2741 ptr++;
2742 if(ptr == ptr2) {
2743 WARN("unexpected char '%c'\n", *ptr);
2744 break;
2746 if(*ptr != '(') {
2747 WARN("expected '('\n");
2748 continue;
2751 if(ptr2 + ARRAY_SIZE(alphaW) == ptr && !memcmp(ptr2, alphaW, sizeof(alphaW))) {
2752 static const WCHAR formatW[] = {'%','f',0};
2753 static const WCHAR opacityW[] = {'o','p','a','c','i','t','y','='};
2755 ptr++;
2756 do {
2757 while(isspaceW(*ptr))
2758 ptr++;
2760 ptr2 = ptr;
2761 while(*ptr && *ptr != ',' && *ptr != ')')
2762 ptr++;
2763 if(!*ptr) {
2764 WARN("unexpected end of string\n");
2765 break;
2768 if(ptr-ptr2 > ARRAY_SIZE(opacityW) && !memcmp(ptr2, opacityW, sizeof(opacityW))) {
2769 float fval = 0.0f, e = 0.1f;
2770 WCHAR buf[32];
2772 ptr2 += ARRAY_SIZE(opacityW);
2774 while(isdigitW(*ptr2))
2775 fval = fval*10.0f + (float)(*ptr2++ - '0');
2777 if(*ptr2 == '.') {
2778 while(isdigitW(*++ptr2)) {
2779 fval += e * (float)(*ptr2++ - '0');
2780 e *= 0.1f;
2784 sprintfW(buf, formatW, fval * 0.01f);
2785 set_opacity(This, buf);
2786 }else {
2787 FIXME("unknown param %s\n", debugstr_wn(ptr2, ptr-ptr2));
2790 if(*ptr == ',')
2791 ptr++;
2792 }while(*ptr != ')');
2793 }else {
2794 FIXME("unknown filter %s\n", debugstr_wn(ptr2, ptr-ptr2));
2795 ptr = strchrW(ptr, ')');
2796 if(!ptr)
2797 break;
2798 ptr++;
2803 static HRESULT WINAPI HTMLStyle_put_filter(IHTMLStyle *iface, BSTR v)
2805 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2806 WCHAR *new_filter = NULL;
2808 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2810 if(!This->elem) {
2811 FIXME("Element already destroyed\n");
2812 return E_UNEXPECTED;
2815 if(v) {
2816 new_filter = heap_strdupW(v);
2817 if(!new_filter)
2818 return E_OUTOFMEMORY;
2821 heap_free(This->elem->filter);
2822 This->elem->filter = new_filter;
2824 update_filter(This);
2825 return S_OK;
2828 static HRESULT WINAPI HTMLStyle_get_filter(IHTMLStyle *iface, BSTR *p)
2830 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2832 TRACE("(%p)->(%p)\n", This, p);
2834 if(!This->elem) {
2835 FIXME("Element already destroyed\n");
2836 return E_UNEXPECTED;
2839 if(This->elem->filter) {
2840 *p = SysAllocString(This->elem->filter);
2841 if(!*p)
2842 return E_OUTOFMEMORY;
2843 }else {
2844 *p = NULL;
2847 return S_OK;
2850 static HRESULT WINAPI HTMLStyle_setAttribute(IHTMLStyle *iface, BSTR strAttributeName,
2851 VARIANT AttributeValue, LONG lFlags)
2853 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2854 HRESULT hres;
2855 DISPID dispid;
2857 TRACE("(%p)->(%s %s %08x)\n", This, debugstr_w(strAttributeName),
2858 debugstr_variant(&AttributeValue), lFlags);
2860 if(!strAttributeName)
2861 return E_INVALIDARG;
2863 if(lFlags == 1)
2864 FIXME("Parameter lFlags ignored\n");
2866 hres = HTMLStyle_GetIDsOfNames(iface, &IID_NULL, &strAttributeName, 1,
2867 LOCALE_USER_DEFAULT, &dispid);
2868 if(hres == S_OK)
2870 VARIANT ret;
2871 DISPID dispidNamed = DISPID_PROPERTYPUT;
2872 DISPPARAMS params;
2874 params.cArgs = 1;
2875 params.rgvarg = &AttributeValue;
2876 params.cNamedArgs = 1;
2877 params.rgdispidNamedArgs = &dispidNamed;
2879 hres = HTMLStyle_Invoke(iface, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
2880 DISPATCH_PROPERTYPUT, &params, &ret, NULL, NULL);
2882 else
2884 FIXME("Custom attributes not supported.\n");
2887 TRACE("ret: %08x\n", hres);
2889 return hres;
2892 static HRESULT WINAPI HTMLStyle_getAttribute(IHTMLStyle *iface, BSTR strAttributeName,
2893 LONG lFlags, VARIANT *AttributeValue)
2895 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2896 HRESULT hres;
2897 DISPID dispid;
2899 TRACE("(%p)->(%s v%p %08x)\n", This, debugstr_w(strAttributeName),
2900 AttributeValue, lFlags);
2902 if(!AttributeValue || !strAttributeName)
2903 return E_INVALIDARG;
2905 if(lFlags == 1)
2906 FIXME("Parameter lFlags ignored\n");
2908 hres = HTMLStyle_GetIDsOfNames(iface, &IID_NULL, &strAttributeName, 1,
2909 LOCALE_USER_DEFAULT, &dispid);
2910 if(hres == S_OK)
2912 DISPPARAMS params = {NULL, NULL, 0, 0 };
2914 hres = HTMLStyle_Invoke(iface, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
2915 DISPATCH_PROPERTYGET, &params, AttributeValue, NULL, NULL);
2917 else
2919 FIXME("Custom attributes not supported.\n");
2922 return hres;
2925 static HRESULT WINAPI HTMLStyle_removeAttribute(IHTMLStyle *iface, BSTR strAttributeName,
2926 LONG lFlags, VARIANT_BOOL *pfSuccess)
2928 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2929 const style_tbl_entry_t *style_entry;
2930 nsAString name_str, ret_str;
2931 nsresult nsres;
2932 HRESULT hres;
2934 TRACE("(%p)->(%s %08x %p)\n", This, debugstr_w(strAttributeName), lFlags, pfSuccess);
2936 style_entry = lookup_style_tbl(strAttributeName);
2937 if(!style_entry) {
2938 DISPID dispid;
2939 unsigned i;
2941 hres = IDispatchEx_GetDispID(&This->dispex.IDispatchEx_iface, strAttributeName,
2942 (lFlags&1) ? fdexNameCaseSensitive : fdexNameCaseInsensitive, &dispid);
2943 if(hres != S_OK) {
2944 *pfSuccess = VARIANT_FALSE;
2945 return S_OK;
2948 for(i=0; i < ARRAY_SIZE(style_tbl); i++) {
2949 if(dispid == style_tbl[i].dispid)
2950 break;
2953 if(i == ARRAY_SIZE(style_tbl))
2954 return remove_attribute(&This->dispex, dispid, pfSuccess);
2955 style_entry = style_tbl+i;
2958 /* filter property is a special case */
2959 if(style_entry->dispid == DISPID_IHTMLSTYLE_FILTER) {
2960 *pfSuccess = variant_bool(This->elem->filter && *This->elem->filter);
2961 heap_free(This->elem->filter);
2962 This->elem->filter = NULL;
2963 update_filter(This);
2964 return S_OK;
2967 nsAString_InitDepend(&name_str, style_entry->name);
2968 nsAString_Init(&ret_str, NULL);
2969 nsres = nsIDOMCSSStyleDeclaration_RemoveProperty(This->nsstyle, &name_str, &ret_str);
2970 if(NS_SUCCEEDED(nsres)) {
2971 const PRUnichar *ret;
2972 nsAString_GetData(&ret_str, &ret);
2973 *pfSuccess = variant_bool(*ret);
2974 }else {
2975 ERR("RemoveProperty failed: %08x\n", nsres);
2977 nsAString_Finish(&name_str);
2978 nsAString_Finish(&ret_str);
2979 return NS_SUCCEEDED(nsres) ? S_OK : E_FAIL;
2982 static HRESULT WINAPI HTMLStyle_toString(IHTMLStyle *iface, BSTR *String)
2984 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2985 FIXME("(%p)->(%p)\n", This, String);
2986 return E_NOTIMPL;
2989 static const IHTMLStyleVtbl HTMLStyleVtbl = {
2990 HTMLStyle_QueryInterface,
2991 HTMLStyle_AddRef,
2992 HTMLStyle_Release,
2993 HTMLStyle_GetTypeInfoCount,
2994 HTMLStyle_GetTypeInfo,
2995 HTMLStyle_GetIDsOfNames,
2996 HTMLStyle_Invoke,
2997 HTMLStyle_put_fontFamily,
2998 HTMLStyle_get_fontFamily,
2999 HTMLStyle_put_fontStyle,
3000 HTMLStyle_get_fontStyle,
3001 HTMLStyle_put_fontVariant,
3002 HTMLStyle_get_fontVariant,
3003 HTMLStyle_put_fontWeight,
3004 HTMLStyle_get_fontWeight,
3005 HTMLStyle_put_fontSize,
3006 HTMLStyle_get_fontSize,
3007 HTMLStyle_put_font,
3008 HTMLStyle_get_font,
3009 HTMLStyle_put_color,
3010 HTMLStyle_get_color,
3011 HTMLStyle_put_background,
3012 HTMLStyle_get_background,
3013 HTMLStyle_put_backgroundColor,
3014 HTMLStyle_get_backgroundColor,
3015 HTMLStyle_put_backgroundImage,
3016 HTMLStyle_get_backgroundImage,
3017 HTMLStyle_put_backgroundRepeat,
3018 HTMLStyle_get_backgroundRepeat,
3019 HTMLStyle_put_backgroundAttachment,
3020 HTMLStyle_get_backgroundAttachment,
3021 HTMLStyle_put_backgroundPosition,
3022 HTMLStyle_get_backgroundPosition,
3023 HTMLStyle_put_backgroundPositionX,
3024 HTMLStyle_get_backgroundPositionX,
3025 HTMLStyle_put_backgroundPositionY,
3026 HTMLStyle_get_backgroundPositionY,
3027 HTMLStyle_put_wordSpacing,
3028 HTMLStyle_get_wordSpacing,
3029 HTMLStyle_put_letterSpacing,
3030 HTMLStyle_get_letterSpacing,
3031 HTMLStyle_put_textDecoration,
3032 HTMLStyle_get_textDecoration,
3033 HTMLStyle_put_textDecorationNone,
3034 HTMLStyle_get_textDecorationNone,
3035 HTMLStyle_put_textDecorationUnderline,
3036 HTMLStyle_get_textDecorationUnderline,
3037 HTMLStyle_put_textDecorationOverline,
3038 HTMLStyle_get_textDecorationOverline,
3039 HTMLStyle_put_textDecorationLineThrough,
3040 HTMLStyle_get_textDecorationLineThrough,
3041 HTMLStyle_put_textDecorationBlink,
3042 HTMLStyle_get_textDecorationBlink,
3043 HTMLStyle_put_verticalAlign,
3044 HTMLStyle_get_verticalAlign,
3045 HTMLStyle_put_textTransform,
3046 HTMLStyle_get_textTransform,
3047 HTMLStyle_put_textAlign,
3048 HTMLStyle_get_textAlign,
3049 HTMLStyle_put_textIndent,
3050 HTMLStyle_get_textIndent,
3051 HTMLStyle_put_lineHeight,
3052 HTMLStyle_get_lineHeight,
3053 HTMLStyle_put_marginTop,
3054 HTMLStyle_get_marginTop,
3055 HTMLStyle_put_marginRight,
3056 HTMLStyle_get_marginRight,
3057 HTMLStyle_put_marginBottom,
3058 HTMLStyle_get_marginBottom,
3059 HTMLStyle_put_marginLeft,
3060 HTMLStyle_get_marginLeft,
3061 HTMLStyle_put_margin,
3062 HTMLStyle_get_margin,
3063 HTMLStyle_put_paddingTop,
3064 HTMLStyle_get_paddingTop,
3065 HTMLStyle_put_paddingRight,
3066 HTMLStyle_get_paddingRight,
3067 HTMLStyle_put_paddingBottom,
3068 HTMLStyle_get_paddingBottom,
3069 HTMLStyle_put_paddingLeft,
3070 HTMLStyle_get_paddingLeft,
3071 HTMLStyle_put_padding,
3072 HTMLStyle_get_padding,
3073 HTMLStyle_put_border,
3074 HTMLStyle_get_border,
3075 HTMLStyle_put_borderTop,
3076 HTMLStyle_get_borderTop,
3077 HTMLStyle_put_borderRight,
3078 HTMLStyle_get_borderRight,
3079 HTMLStyle_put_borderBottom,
3080 HTMLStyle_get_borderBottom,
3081 HTMLStyle_put_borderLeft,
3082 HTMLStyle_get_borderLeft,
3083 HTMLStyle_put_borderColor,
3084 HTMLStyle_get_borderColor,
3085 HTMLStyle_put_borderTopColor,
3086 HTMLStyle_get_borderTopColor,
3087 HTMLStyle_put_borderRightColor,
3088 HTMLStyle_get_borderRightColor,
3089 HTMLStyle_put_borderBottomColor,
3090 HTMLStyle_get_borderBottomColor,
3091 HTMLStyle_put_borderLeftColor,
3092 HTMLStyle_get_borderLeftColor,
3093 HTMLStyle_put_borderWidth,
3094 HTMLStyle_get_borderWidth,
3095 HTMLStyle_put_borderTopWidth,
3096 HTMLStyle_get_borderTopWidth,
3097 HTMLStyle_put_borderRightWidth,
3098 HTMLStyle_get_borderRightWidth,
3099 HTMLStyle_put_borderBottomWidth,
3100 HTMLStyle_get_borderBottomWidth,
3101 HTMLStyle_put_borderLeftWidth,
3102 HTMLStyle_get_borderLeftWidth,
3103 HTMLStyle_put_borderStyle,
3104 HTMLStyle_get_borderStyle,
3105 HTMLStyle_put_borderTopStyle,
3106 HTMLStyle_get_borderTopStyle,
3107 HTMLStyle_put_borderRightStyle,
3108 HTMLStyle_get_borderRightStyle,
3109 HTMLStyle_put_borderBottomStyle,
3110 HTMLStyle_get_borderBottomStyle,
3111 HTMLStyle_put_borderLeftStyle,
3112 HTMLStyle_get_borderLeftStyle,
3113 HTMLStyle_put_width,
3114 HTMLStyle_get_width,
3115 HTMLStyle_put_height,
3116 HTMLStyle_get_height,
3117 HTMLStyle_put_styleFloat,
3118 HTMLStyle_get_styleFloat,
3119 HTMLStyle_put_clear,
3120 HTMLStyle_get_clear,
3121 HTMLStyle_put_display,
3122 HTMLStyle_get_display,
3123 HTMLStyle_put_visibility,
3124 HTMLStyle_get_visibility,
3125 HTMLStyle_put_listStyleType,
3126 HTMLStyle_get_listStyleType,
3127 HTMLStyle_put_listStylePosition,
3128 HTMLStyle_get_listStylePosition,
3129 HTMLStyle_put_listStyleImage,
3130 HTMLStyle_get_listStyleImage,
3131 HTMLStyle_put_listStyle,
3132 HTMLStyle_get_listStyle,
3133 HTMLStyle_put_whiteSpace,
3134 HTMLStyle_get_whiteSpace,
3135 HTMLStyle_put_top,
3136 HTMLStyle_get_top,
3137 HTMLStyle_put_left,
3138 HTMLStyle_get_left,
3139 HTMLStyle_get_position,
3140 HTMLStyle_put_zIndex,
3141 HTMLStyle_get_zIndex,
3142 HTMLStyle_put_overflow,
3143 HTMLStyle_get_overflow,
3144 HTMLStyle_put_pageBreakBefore,
3145 HTMLStyle_get_pageBreakBefore,
3146 HTMLStyle_put_pageBreakAfter,
3147 HTMLStyle_get_pageBreakAfter,
3148 HTMLStyle_put_cssText,
3149 HTMLStyle_get_cssText,
3150 HTMLStyle_put_pixelTop,
3151 HTMLStyle_get_pixelTop,
3152 HTMLStyle_put_pixelLeft,
3153 HTMLStyle_get_pixelLeft,
3154 HTMLStyle_put_pixelWidth,
3155 HTMLStyle_get_pixelWidth,
3156 HTMLStyle_put_pixelHeight,
3157 HTMLStyle_get_pixelHeight,
3158 HTMLStyle_put_posTop,
3159 HTMLStyle_get_posTop,
3160 HTMLStyle_put_posLeft,
3161 HTMLStyle_get_posLeft,
3162 HTMLStyle_put_posWidth,
3163 HTMLStyle_get_posWidth,
3164 HTMLStyle_put_posHeight,
3165 HTMLStyle_get_posHeight,
3166 HTMLStyle_put_cursor,
3167 HTMLStyle_get_cursor,
3168 HTMLStyle_put_clip,
3169 HTMLStyle_get_clip,
3170 HTMLStyle_put_filter,
3171 HTMLStyle_get_filter,
3172 HTMLStyle_setAttribute,
3173 HTMLStyle_getAttribute,
3174 HTMLStyle_removeAttribute,
3175 HTMLStyle_toString
3178 static inline HTMLStyle *impl_from_IHTMLStyle2(IHTMLStyle2 *iface)
3180 return CONTAINING_RECORD(iface, HTMLStyle, IHTMLStyle2_iface);
3183 static HRESULT WINAPI HTMLStyle2_QueryInterface(IHTMLStyle2 *iface, REFIID riid, void **ppv)
3185 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3187 return IHTMLStyle_QueryInterface(&This->IHTMLStyle_iface, riid, ppv);
3190 static ULONG WINAPI HTMLStyle2_AddRef(IHTMLStyle2 *iface)
3192 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3194 return IHTMLStyle_AddRef(&This->IHTMLStyle_iface);
3197 static ULONG WINAPI HTMLStyle2_Release(IHTMLStyle2 *iface)
3199 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3201 return IHTMLStyle_Release(&This->IHTMLStyle_iface);
3204 static HRESULT WINAPI HTMLStyle2_GetTypeInfoCount(IHTMLStyle2 *iface, UINT *pctinfo)
3206 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3207 return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
3210 static HRESULT WINAPI HTMLStyle2_GetTypeInfo(IHTMLStyle2 *iface, UINT iTInfo,
3211 LCID lcid, ITypeInfo **ppTInfo)
3213 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3214 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
3217 static HRESULT WINAPI HTMLStyle2_GetIDsOfNames(IHTMLStyle2 *iface, REFIID riid,
3218 LPOLESTR *rgszNames, UINT cNames,
3219 LCID lcid, DISPID *rgDispId)
3221 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3222 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
3223 lcid, rgDispId);
3226 static HRESULT WINAPI HTMLStyle2_Invoke(IHTMLStyle2 *iface, DISPID dispIdMember,
3227 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
3228 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
3230 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3231 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
3232 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
3235 static HRESULT WINAPI HTMLStyle2_put_tableLayout(IHTMLStyle2 *iface, BSTR v)
3237 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3239 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
3241 return set_style_property(This, STYLEID_TABLE_LAYOUT, v);
3244 static HRESULT WINAPI HTMLStyle2_get_tableLayout(IHTMLStyle2 *iface, BSTR *p)
3246 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3248 TRACE("(%p)->(%p)\n", This, p);
3250 return get_style_property(This, STYLEID_TABLE_LAYOUT, p);
3253 static HRESULT WINAPI HTMLStyle2_put_borderCollapse(IHTMLStyle2 *iface, BSTR v)
3255 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3256 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3257 return E_NOTIMPL;
3260 static HRESULT WINAPI HTMLStyle2_get_borderCollapse(IHTMLStyle2 *iface, BSTR *p)
3262 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3263 FIXME("(%p)->(%p)\n", This, p);
3264 return E_NOTIMPL;
3267 static HRESULT WINAPI HTMLStyle2_put_direction(IHTMLStyle2 *iface, BSTR v)
3269 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3271 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
3273 return set_style_property(This, STYLEID_DIRECTION, v);
3276 static HRESULT WINAPI HTMLStyle2_get_direction(IHTMLStyle2 *iface, BSTR *p)
3278 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3280 TRACE("(%p)->(%p)\n", This, p);
3282 return get_style_property(This, STYLEID_DIRECTION, p);
3285 static HRESULT WINAPI HTMLStyle2_put_behavior(IHTMLStyle2 *iface, BSTR v)
3287 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3288 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3289 return S_OK;
3292 static HRESULT WINAPI HTMLStyle2_get_behavior(IHTMLStyle2 *iface, BSTR *p)
3294 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3295 FIXME("(%p)->(%p)\n", This, p);
3296 return E_NOTIMPL;
3299 static HRESULT WINAPI HTMLStyle2_setExpression(IHTMLStyle2 *iface, BSTR propname, BSTR expression, BSTR language)
3301 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3302 FIXME("(%p)->(%s %s %s)\n", This, debugstr_w(propname), debugstr_w(expression), debugstr_w(language));
3303 return E_NOTIMPL;
3306 static HRESULT WINAPI HTMLStyle2_getExpression(IHTMLStyle2 *iface, BSTR propname, VARIANT *expression)
3308 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3309 FIXME("(%p)->(%s %p)\n", This, debugstr_w(propname), expression);
3310 return E_NOTIMPL;
3313 static HRESULT WINAPI HTMLStyle2_removeExpression(IHTMLStyle2 *iface, BSTR propname, VARIANT_BOOL *pfSuccess)
3315 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3316 FIXME("(%p)->(%s %p)\n", This, debugstr_w(propname), pfSuccess);
3317 return E_NOTIMPL;
3320 static HRESULT WINAPI HTMLStyle2_put_position(IHTMLStyle2 *iface, BSTR v)
3322 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3324 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
3326 return set_style_property(This, STYLEID_POSITION, v);
3329 static HRESULT WINAPI HTMLStyle2_get_position(IHTMLStyle2 *iface, BSTR *p)
3331 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3333 TRACE("(%p)->(%p)\n", This, p);
3335 return get_style_property(This, STYLEID_POSITION, p);
3338 static HRESULT WINAPI HTMLStyle2_put_unicodeBidi(IHTMLStyle2 *iface, BSTR v)
3340 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3341 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3342 return E_NOTIMPL;
3345 static HRESULT WINAPI HTMLStyle2_get_unicodeBidi(IHTMLStyle2 *iface, BSTR *p)
3347 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3348 FIXME("(%p)->(%p)\n", This, p);
3349 return E_NOTIMPL;
3352 static HRESULT WINAPI HTMLStyle2_put_bottom(IHTMLStyle2 *iface, VARIANT v)
3354 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3356 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
3358 return set_style_property_var(This, STYLEID_BOTTOM, &v);
3361 static HRESULT WINAPI HTMLStyle2_get_bottom(IHTMLStyle2 *iface, VARIANT *p)
3363 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3365 TRACE("(%p)->(%p)\n", This, p);
3367 return get_style_property_var(This, STYLEID_BOTTOM, p);
3370 static HRESULT WINAPI HTMLStyle2_put_right(IHTMLStyle2 *iface, VARIANT v)
3372 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3374 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
3376 return set_style_property_var(This, STYLEID_RIGHT, &v);
3379 static HRESULT WINAPI HTMLStyle2_get_right(IHTMLStyle2 *iface, VARIANT *p)
3381 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3383 TRACE("(%p)->(%p)\n", This, p);
3385 return get_style_property_var(This, STYLEID_RIGHT, p);
3388 static HRESULT WINAPI HTMLStyle2_put_pixelBottom(IHTMLStyle2 *iface, LONG v)
3390 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3391 FIXME("(%p)->(%d)\n", This, v);
3392 return E_NOTIMPL;
3395 static HRESULT WINAPI HTMLStyle2_get_pixelBottom(IHTMLStyle2 *iface, LONG *p)
3397 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3398 FIXME("(%p)->(%p)\n", This, p);
3399 return E_NOTIMPL;
3402 static HRESULT WINAPI HTMLStyle2_put_pixelRight(IHTMLStyle2 *iface, LONG v)
3404 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3405 FIXME("(%p)->(%d)\n", This, v);
3406 return E_NOTIMPL;
3409 static HRESULT WINAPI HTMLStyle2_get_pixelRight(IHTMLStyle2 *iface, LONG *p)
3411 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3412 FIXME("(%p)->(%p)\n", This, p);
3413 return E_NOTIMPL;
3416 static HRESULT WINAPI HTMLStyle2_put_posBottom(IHTMLStyle2 *iface, float v)
3418 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3419 FIXME("(%p)->(%f)\n", This, v);
3420 return E_NOTIMPL;
3423 static HRESULT WINAPI HTMLStyle2_get_posBottom(IHTMLStyle2 *iface, float *p)
3425 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3426 FIXME("(%p)->(%p)\n", This, p);
3427 return E_NOTIMPL;
3430 static HRESULT WINAPI HTMLStyle2_put_posRight(IHTMLStyle2 *iface, float v)
3432 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3433 FIXME("(%p)->(%f)\n", This, v);
3434 return E_NOTIMPL;
3437 static HRESULT WINAPI HTMLStyle2_get_posRight(IHTMLStyle2 *iface, float *p)
3439 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3440 FIXME("(%p)->(%p)\n", This, p);
3441 return E_NOTIMPL;
3444 static HRESULT WINAPI HTMLStyle2_put_imeMode(IHTMLStyle2 *iface, BSTR v)
3446 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3447 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3448 return E_NOTIMPL;
3451 static HRESULT WINAPI HTMLStyle2_get_imeMode(IHTMLStyle2 *iface, BSTR *p)
3453 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3454 FIXME("(%p)->(%p)\n", This, p);
3455 return E_NOTIMPL;
3458 static HRESULT WINAPI HTMLStyle2_put_rubyAlign(IHTMLStyle2 *iface, BSTR v)
3460 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3461 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3462 return E_NOTIMPL;
3465 static HRESULT WINAPI HTMLStyle2_get_rubyAlign(IHTMLStyle2 *iface, BSTR *p)
3467 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3468 FIXME("(%p)->(%p)\n", This, p);
3469 return E_NOTIMPL;
3472 static HRESULT WINAPI HTMLStyle2_put_rubyPosition(IHTMLStyle2 *iface, BSTR v)
3474 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3475 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3476 return E_NOTIMPL;
3479 static HRESULT WINAPI HTMLStyle2_get_rubyPosition(IHTMLStyle2 *iface, BSTR *p)
3481 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3482 FIXME("(%p)->(%p)\n", This, p);
3483 return E_NOTIMPL;
3486 static HRESULT WINAPI HTMLStyle2_put_rubyOverhang(IHTMLStyle2 *iface, BSTR v)
3488 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3489 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3490 return E_NOTIMPL;
3493 static HRESULT WINAPI HTMLStyle2_get_rubyOverhang(IHTMLStyle2 *iface, BSTR *p)
3495 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3496 FIXME("(%p)->(%p)\n", This, p);
3497 return E_NOTIMPL;
3500 static HRESULT WINAPI HTMLStyle2_put_layoutGridChar(IHTMLStyle2 *iface, VARIANT v)
3502 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3503 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3504 return E_NOTIMPL;
3507 static HRESULT WINAPI HTMLStyle2_get_layoutGridChar(IHTMLStyle2 *iface, VARIANT *p)
3509 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3510 FIXME("(%p)->(%p)\n", This, p);
3511 return E_NOTIMPL;
3514 static HRESULT WINAPI HTMLStyle2_put_layoutGridLine(IHTMLStyle2 *iface, VARIANT v)
3516 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3517 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3518 return E_NOTIMPL;
3521 static HRESULT WINAPI HTMLStyle2_get_layoutGridLine(IHTMLStyle2 *iface, VARIANT *p)
3523 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3524 FIXME("(%p)->(%p)\n", This, p);
3525 return E_NOTIMPL;
3528 static HRESULT WINAPI HTMLStyle2_put_layoutGridMode(IHTMLStyle2 *iface, BSTR v)
3530 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3531 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3532 return E_NOTIMPL;
3535 static HRESULT WINAPI HTMLStyle2_get_layoutGridMode(IHTMLStyle2 *iface, BSTR *p)
3537 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3538 FIXME("(%p)->(%p)\n", This, p);
3539 return E_NOTIMPL;
3542 static HRESULT WINAPI HTMLStyle2_put_layoutGridType(IHTMLStyle2 *iface, BSTR v)
3544 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3545 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3546 return E_NOTIMPL;
3549 static HRESULT WINAPI HTMLStyle2_get_layoutGridType(IHTMLStyle2 *iface, BSTR *p)
3551 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3552 FIXME("(%p)->(%p)\n", This, p);
3553 return E_NOTIMPL;
3556 static HRESULT WINAPI HTMLStyle2_put_layoutGrid(IHTMLStyle2 *iface, BSTR v)
3558 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3559 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3560 return E_NOTIMPL;
3563 static HRESULT WINAPI HTMLStyle2_get_layoutGrid(IHTMLStyle2 *iface, BSTR *p)
3565 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3566 FIXME("(%p)->(%p)\n", This, p);
3567 return E_NOTIMPL;
3570 static HRESULT WINAPI HTMLStyle2_put_wordBreak(IHTMLStyle2 *iface, BSTR v)
3572 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3573 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3574 return E_NOTIMPL;
3577 static HRESULT WINAPI HTMLStyle2_get_wordBreak(IHTMLStyle2 *iface, BSTR *p)
3579 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3580 FIXME("(%p)->(%p)\n", This, p);
3581 return E_NOTIMPL;
3584 static HRESULT WINAPI HTMLStyle2_put_lineBreak(IHTMLStyle2 *iface, BSTR v)
3586 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3587 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3588 return E_NOTIMPL;
3591 static HRESULT WINAPI HTMLStyle2_get_lineBreak(IHTMLStyle2 *iface, BSTR *p)
3593 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3594 FIXME("(%p)->(%p)\n", This, p);
3595 return E_NOTIMPL;
3598 static HRESULT WINAPI HTMLStyle2_put_textJustify(IHTMLStyle2 *iface, BSTR v)
3600 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3601 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3602 return E_NOTIMPL;
3605 static HRESULT WINAPI HTMLStyle2_get_textJustify(IHTMLStyle2 *iface, BSTR *p)
3607 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3608 FIXME("(%p)->(%p)\n", This, p);
3609 return E_NOTIMPL;
3612 static HRESULT WINAPI HTMLStyle2_put_textJustifyTrim(IHTMLStyle2 *iface, BSTR v)
3614 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3615 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3616 return E_NOTIMPL;
3619 static HRESULT WINAPI HTMLStyle2_get_textJustifyTrim(IHTMLStyle2 *iface, BSTR *p)
3621 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3622 FIXME("(%p)->(%p)\n", This, p);
3623 return E_NOTIMPL;
3626 static HRESULT WINAPI HTMLStyle2_put_textKashida(IHTMLStyle2 *iface, VARIANT v)
3628 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3629 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3630 return E_NOTIMPL;
3633 static HRESULT WINAPI HTMLStyle2_get_textKashida(IHTMLStyle2 *iface, VARIANT *p)
3635 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3636 FIXME("(%p)->(%p)\n", This, p);
3637 return E_NOTIMPL;
3640 static HRESULT WINAPI HTMLStyle2_put_textAutospace(IHTMLStyle2 *iface, BSTR v)
3642 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3643 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3644 return E_NOTIMPL;
3647 static HRESULT WINAPI HTMLStyle2_get_textAutospace(IHTMLStyle2 *iface, BSTR *p)
3649 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3650 FIXME("(%p)->(%p)\n", This, p);
3651 return E_NOTIMPL;
3654 static HRESULT WINAPI HTMLStyle2_put_overflowX(IHTMLStyle2 *iface, BSTR v)
3656 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3658 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
3660 return set_style_property(This, STYLEID_OVERFLOW_X, v);
3663 static HRESULT WINAPI HTMLStyle2_get_overflowX(IHTMLStyle2 *iface, BSTR *p)
3665 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3667 TRACE("(%p)->(%p)\n", This, p);
3669 return get_style_property(This, STYLEID_OVERFLOW_X, p);
3672 static HRESULT WINAPI HTMLStyle2_put_overflowY(IHTMLStyle2 *iface, BSTR v)
3674 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3676 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
3678 return set_style_property(This, STYLEID_OVERFLOW_Y, v);
3681 static HRESULT WINAPI HTMLStyle2_get_overflowY(IHTMLStyle2 *iface, BSTR *p)
3683 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3685 TRACE("(%p)->(%p)\n", This, p);
3687 return get_style_property(This, STYLEID_OVERFLOW_Y, p);
3690 static HRESULT WINAPI HTMLStyle2_put_accelerator(IHTMLStyle2 *iface, BSTR v)
3692 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3693 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3694 return E_NOTIMPL;
3697 static HRESULT WINAPI HTMLStyle2_get_accelerator(IHTMLStyle2 *iface, BSTR *p)
3699 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3700 FIXME("(%p)->(%p)\n", This, p);
3701 return E_NOTIMPL;
3704 static const IHTMLStyle2Vtbl HTMLStyle2Vtbl = {
3705 HTMLStyle2_QueryInterface,
3706 HTMLStyle2_AddRef,
3707 HTMLStyle2_Release,
3708 HTMLStyle2_GetTypeInfoCount,
3709 HTMLStyle2_GetTypeInfo,
3710 HTMLStyle2_GetIDsOfNames,
3711 HTMLStyle2_Invoke,
3712 HTMLStyle2_put_tableLayout,
3713 HTMLStyle2_get_tableLayout,
3714 HTMLStyle2_put_borderCollapse,
3715 HTMLStyle2_get_borderCollapse,
3716 HTMLStyle2_put_direction,
3717 HTMLStyle2_get_direction,
3718 HTMLStyle2_put_behavior,
3719 HTMLStyle2_get_behavior,
3720 HTMLStyle2_setExpression,
3721 HTMLStyle2_getExpression,
3722 HTMLStyle2_removeExpression,
3723 HTMLStyle2_put_position,
3724 HTMLStyle2_get_position,
3725 HTMLStyle2_put_unicodeBidi,
3726 HTMLStyle2_get_unicodeBidi,
3727 HTMLStyle2_put_bottom,
3728 HTMLStyle2_get_bottom,
3729 HTMLStyle2_put_right,
3730 HTMLStyle2_get_right,
3731 HTMLStyle2_put_pixelBottom,
3732 HTMLStyle2_get_pixelBottom,
3733 HTMLStyle2_put_pixelRight,
3734 HTMLStyle2_get_pixelRight,
3735 HTMLStyle2_put_posBottom,
3736 HTMLStyle2_get_posBottom,
3737 HTMLStyle2_put_posRight,
3738 HTMLStyle2_get_posRight,
3739 HTMLStyle2_put_imeMode,
3740 HTMLStyle2_get_imeMode,
3741 HTMLStyle2_put_rubyAlign,
3742 HTMLStyle2_get_rubyAlign,
3743 HTMLStyle2_put_rubyPosition,
3744 HTMLStyle2_get_rubyPosition,
3745 HTMLStyle2_put_rubyOverhang,
3746 HTMLStyle2_get_rubyOverhang,
3747 HTMLStyle2_put_layoutGridChar,
3748 HTMLStyle2_get_layoutGridChar,
3749 HTMLStyle2_put_layoutGridLine,
3750 HTMLStyle2_get_layoutGridLine,
3751 HTMLStyle2_put_layoutGridMode,
3752 HTMLStyle2_get_layoutGridMode,
3753 HTMLStyle2_put_layoutGridType,
3754 HTMLStyle2_get_layoutGridType,
3755 HTMLStyle2_put_layoutGrid,
3756 HTMLStyle2_get_layoutGrid,
3757 HTMLStyle2_put_wordBreak,
3758 HTMLStyle2_get_wordBreak,
3759 HTMLStyle2_put_lineBreak,
3760 HTMLStyle2_get_lineBreak,
3761 HTMLStyle2_put_textJustify,
3762 HTMLStyle2_get_textJustify,
3763 HTMLStyle2_put_textJustifyTrim,
3764 HTMLStyle2_get_textJustifyTrim,
3765 HTMLStyle2_put_textKashida,
3766 HTMLStyle2_get_textKashida,
3767 HTMLStyle2_put_textAutospace,
3768 HTMLStyle2_get_textAutospace,
3769 HTMLStyle2_put_overflowX,
3770 HTMLStyle2_get_overflowX,
3771 HTMLStyle2_put_overflowY,
3772 HTMLStyle2_get_overflowY,
3773 HTMLStyle2_put_accelerator,
3774 HTMLStyle2_get_accelerator
3777 static inline HTMLStyle *impl_from_IHTMLStyle3(IHTMLStyle3 *iface)
3779 return CONTAINING_RECORD(iface, HTMLStyle, IHTMLStyle3_iface);
3782 static HRESULT WINAPI HTMLStyle3_QueryInterface(IHTMLStyle3 *iface, REFIID riid, void **ppv)
3784 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3786 return IHTMLStyle_QueryInterface(&This->IHTMLStyle_iface, riid, ppv);
3789 static ULONG WINAPI HTMLStyle3_AddRef(IHTMLStyle3 *iface)
3791 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3793 return IHTMLStyle_AddRef(&This->IHTMLStyle_iface);
3796 static ULONG WINAPI HTMLStyle3_Release(IHTMLStyle3 *iface)
3798 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3800 return IHTMLStyle_Release(&This->IHTMLStyle_iface);
3803 static HRESULT WINAPI HTMLStyle3_GetTypeInfoCount(IHTMLStyle3 *iface, UINT *pctinfo)
3805 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3806 return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
3809 static HRESULT WINAPI HTMLStyle3_GetTypeInfo(IHTMLStyle3 *iface, UINT iTInfo,
3810 LCID lcid, ITypeInfo **ppTInfo)
3812 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3813 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
3816 static HRESULT WINAPI HTMLStyle3_GetIDsOfNames(IHTMLStyle3 *iface, REFIID riid,
3817 LPOLESTR *rgszNames, UINT cNames,
3818 LCID lcid, DISPID *rgDispId)
3820 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3821 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
3822 lcid, rgDispId);
3825 static HRESULT WINAPI HTMLStyle3_Invoke(IHTMLStyle3 *iface, DISPID dispIdMember,
3826 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
3827 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
3829 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3830 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
3831 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
3834 static HRESULT WINAPI HTMLStyle3_put_layoutFlow(IHTMLStyle3 *iface, BSTR v)
3836 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3837 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3838 return E_NOTIMPL;
3841 static HRESULT WINAPI HTMLStyle3_get_layoutFlow(IHTMLStyle3 *iface, BSTR *p)
3843 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3844 FIXME("(%p)->(%p)\n", This, p);
3845 return E_NOTIMPL;
3848 static const WCHAR zoomW[] = {'z','o','o','m',0};
3850 static HRESULT WINAPI HTMLStyle3_put_zoom(IHTMLStyle3 *iface, VARIANT v)
3852 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3853 VARIANT *var;
3854 HRESULT hres;
3856 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
3858 /* zoom property is IE CSS extension that is mostly used as a hack to workaround IE bugs.
3859 * The value is set to 1 then. We can safely ignore setting zoom to 1. */
3860 if(V_VT(&v) != VT_I4 || V_I4(&v) != 1)
3861 WARN("stub for %s\n", debugstr_variant(&v));
3863 hres = dispex_get_dprop_ref(&This->dispex, zoomW, TRUE, &var);
3864 if(FAILED(hres))
3865 return hres;
3867 return VariantChangeType(var, &v, 0, VT_BSTR);
3870 static HRESULT WINAPI HTMLStyle3_get_zoom(IHTMLStyle3 *iface, VARIANT *p)
3872 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3873 VARIANT *var;
3874 HRESULT hres;
3876 TRACE("(%p)->(%p)\n", This, p);
3878 hres = dispex_get_dprop_ref(&This->dispex, zoomW, FALSE, &var);
3879 if(hres == DISP_E_UNKNOWNNAME) {
3880 V_VT(p) = VT_BSTR;
3881 V_BSTR(p) = NULL;
3882 return S_OK;
3884 if(FAILED(hres))
3885 return hres;
3887 return VariantCopy(p, var);
3890 static HRESULT WINAPI HTMLStyle3_put_wordWrap(IHTMLStyle3 *iface, BSTR v)
3892 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3894 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
3896 return set_style_property(This, STYLEID_WORD_WRAP, v);
3899 static HRESULT WINAPI HTMLStyle3_get_wordWrap(IHTMLStyle3 *iface, BSTR *p)
3901 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3903 TRACE("(%p)->(%p)\n", This, p);
3905 return get_style_property(This, STYLEID_WORD_WRAP, p);
3908 static HRESULT WINAPI HTMLStyle3_put_textUnderlinePosition(IHTMLStyle3 *iface, BSTR v)
3910 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3911 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3912 return E_NOTIMPL;
3915 static HRESULT WINAPI HTMLStyle3_get_textUnderlinePosition(IHTMLStyle3 *iface, BSTR *p)
3917 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3918 FIXME("(%p)->(%p)\n", This, p);
3919 return E_NOTIMPL;
3922 static HRESULT WINAPI HTMLStyle3_put_scrollbarBaseColor(IHTMLStyle3 *iface, VARIANT v)
3924 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3925 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3926 return E_NOTIMPL;
3929 static HRESULT WINAPI HTMLStyle3_get_scrollbarBaseColor(IHTMLStyle3 *iface, VARIANT *p)
3931 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3932 FIXME("(%p)->(%p)\n", This, p);
3933 return E_NOTIMPL;
3936 static HRESULT WINAPI HTMLStyle3_put_scrollbarFaceColor(IHTMLStyle3 *iface, VARIANT v)
3938 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3939 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3940 return E_NOTIMPL;
3943 static HRESULT WINAPI HTMLStyle3_get_scrollbarFaceColor(IHTMLStyle3 *iface, VARIANT *p)
3945 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3946 FIXME("(%p)->(%p)\n", This, p);
3947 return E_NOTIMPL;
3950 static HRESULT WINAPI HTMLStyle3_put_scrollbar3dLightColor(IHTMLStyle3 *iface, VARIANT v)
3952 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3953 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3954 return E_NOTIMPL;
3957 static HRESULT WINAPI HTMLStyle3_get_scrollbar3dLightColor(IHTMLStyle3 *iface, VARIANT *p)
3959 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3960 FIXME("(%p)->(%p)\n", This, p);
3961 return E_NOTIMPL;
3964 static HRESULT WINAPI HTMLStyle3_put_scrollbarShadowColor(IHTMLStyle3 *iface, VARIANT v)
3966 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3967 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3968 return E_NOTIMPL;
3971 static HRESULT WINAPI HTMLStyle3_get_scrollbarShadowColor(IHTMLStyle3 *iface, VARIANT *p)
3973 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3974 FIXME("(%p)->(%p)\n", This, p);
3975 return E_NOTIMPL;
3978 static HRESULT WINAPI HTMLStyle3_put_scrollbarHighlightColor(IHTMLStyle3 *iface, VARIANT v)
3980 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3981 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3982 return E_NOTIMPL;
3985 static HRESULT WINAPI HTMLStyle3_get_scrollbarHighlightColor(IHTMLStyle3 *iface, VARIANT *p)
3987 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3988 FIXME("(%p)->(%p)\n", This, p);
3989 return E_NOTIMPL;
3992 static HRESULT WINAPI HTMLStyle3_put_scrollbarDarkShadowColor(IHTMLStyle3 *iface, VARIANT v)
3994 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3995 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3996 return E_NOTIMPL;
3999 static HRESULT WINAPI HTMLStyle3_get_scrollbarDarkShadowColor(IHTMLStyle3 *iface, VARIANT *p)
4001 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
4002 FIXME("(%p)->(%p)\n", This, p);
4003 return E_NOTIMPL;
4006 static HRESULT WINAPI HTMLStyle3_put_scrollbarArrowColor(IHTMLStyle3 *iface, VARIANT v)
4008 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
4009 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
4010 return E_NOTIMPL;
4013 static HRESULT WINAPI HTMLStyle3_get_scrollbarArrowColor(IHTMLStyle3 *iface, VARIANT *p)
4015 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
4016 FIXME("(%p)->(%p)\n", This, p);
4017 return E_NOTIMPL;
4020 static HRESULT WINAPI HTMLStyle3_put_scrollbarTrackColor(IHTMLStyle3 *iface, VARIANT v)
4022 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
4023 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
4024 return E_NOTIMPL;
4027 static HRESULT WINAPI HTMLStyle3_get_scrollbarTrackColor(IHTMLStyle3 *iface, VARIANT *p)
4029 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
4030 FIXME("(%p)->(%p)\n", This, p);
4031 return E_NOTIMPL;
4034 static HRESULT WINAPI HTMLStyle3_put_writingMode(IHTMLStyle3 *iface, BSTR v)
4036 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
4037 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4038 return E_NOTIMPL;
4041 static HRESULT WINAPI HTMLStyle3_get_writingMode(IHTMLStyle3 *iface, BSTR *p)
4043 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
4044 FIXME("(%p)->(%p)\n", This, p);
4045 return E_NOTIMPL;
4048 static HRESULT WINAPI HTMLStyle3_put_textAlignLast(IHTMLStyle3 *iface, BSTR v)
4050 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
4051 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4052 return E_NOTIMPL;
4055 static HRESULT WINAPI HTMLStyle3_get_textAlignLast(IHTMLStyle3 *iface, BSTR *p)
4057 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
4058 FIXME("(%p)->(%p)\n", This, p);
4059 return E_NOTIMPL;
4062 static HRESULT WINAPI HTMLStyle3_put_textKashidaSpace(IHTMLStyle3 *iface, VARIANT v)
4064 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
4065 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
4066 return E_NOTIMPL;
4069 static HRESULT WINAPI HTMLStyle3_get_textKashidaSpace(IHTMLStyle3 *iface, VARIANT *p)
4071 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
4072 FIXME("(%p)->(%p)\n", This, p);
4073 return E_NOTIMPL;
4076 static const IHTMLStyle3Vtbl HTMLStyle3Vtbl = {
4077 HTMLStyle3_QueryInterface,
4078 HTMLStyle3_AddRef,
4079 HTMLStyle3_Release,
4080 HTMLStyle3_GetTypeInfoCount,
4081 HTMLStyle3_GetTypeInfo,
4082 HTMLStyle3_GetIDsOfNames,
4083 HTMLStyle3_Invoke,
4084 HTMLStyle3_put_layoutFlow,
4085 HTMLStyle3_get_layoutFlow,
4086 HTMLStyle3_put_zoom,
4087 HTMLStyle3_get_zoom,
4088 HTMLStyle3_put_wordWrap,
4089 HTMLStyle3_get_wordWrap,
4090 HTMLStyle3_put_textUnderlinePosition,
4091 HTMLStyle3_get_textUnderlinePosition,
4092 HTMLStyle3_put_scrollbarBaseColor,
4093 HTMLStyle3_get_scrollbarBaseColor,
4094 HTMLStyle3_put_scrollbarFaceColor,
4095 HTMLStyle3_get_scrollbarFaceColor,
4096 HTMLStyle3_put_scrollbar3dLightColor,
4097 HTMLStyle3_get_scrollbar3dLightColor,
4098 HTMLStyle3_put_scrollbarShadowColor,
4099 HTMLStyle3_get_scrollbarShadowColor,
4100 HTMLStyle3_put_scrollbarHighlightColor,
4101 HTMLStyle3_get_scrollbarHighlightColor,
4102 HTMLStyle3_put_scrollbarDarkShadowColor,
4103 HTMLStyle3_get_scrollbarDarkShadowColor,
4104 HTMLStyle3_put_scrollbarArrowColor,
4105 HTMLStyle3_get_scrollbarArrowColor,
4106 HTMLStyle3_put_scrollbarTrackColor,
4107 HTMLStyle3_get_scrollbarTrackColor,
4108 HTMLStyle3_put_writingMode,
4109 HTMLStyle3_get_writingMode,
4110 HTMLStyle3_put_textAlignLast,
4111 HTMLStyle3_get_textAlignLast,
4112 HTMLStyle3_put_textKashidaSpace,
4113 HTMLStyle3_get_textKashidaSpace
4117 * IHTMLStyle4 Interface
4119 static inline HTMLStyle *impl_from_IHTMLStyle4(IHTMLStyle4 *iface)
4121 return CONTAINING_RECORD(iface, HTMLStyle, IHTMLStyle4_iface);
4124 static HRESULT WINAPI HTMLStyle4_QueryInterface(IHTMLStyle4 *iface, REFIID riid, void **ppv)
4126 HTMLStyle *This = impl_from_IHTMLStyle4(iface);
4128 return IHTMLStyle_QueryInterface(&This->IHTMLStyle_iface, riid, ppv);
4131 static ULONG WINAPI HTMLStyle4_AddRef(IHTMLStyle4 *iface)
4133 HTMLStyle *This = impl_from_IHTMLStyle4(iface);
4135 return IHTMLStyle_AddRef(&This->IHTMLStyle_iface);
4138 static ULONG WINAPI HTMLStyle4_Release(IHTMLStyle4 *iface)
4140 HTMLStyle *This = impl_from_IHTMLStyle4(iface);
4142 return IHTMLStyle_Release(&This->IHTMLStyle_iface);
4145 static HRESULT WINAPI HTMLStyle4_GetTypeInfoCount(IHTMLStyle4 *iface, UINT *pctinfo)
4147 HTMLStyle *This = impl_from_IHTMLStyle4(iface);
4148 return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
4151 static HRESULT WINAPI HTMLStyle4_GetTypeInfo(IHTMLStyle4 *iface, UINT iTInfo,
4152 LCID lcid, ITypeInfo **ppTInfo)
4154 HTMLStyle *This = impl_from_IHTMLStyle4(iface);
4155 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
4158 static HRESULT WINAPI HTMLStyle4_GetIDsOfNames(IHTMLStyle4 *iface, REFIID riid,
4159 LPOLESTR *rgszNames, UINT cNames,
4160 LCID lcid, DISPID *rgDispId)
4162 HTMLStyle *This = impl_from_IHTMLStyle4(iface);
4163 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
4164 lcid, rgDispId);
4167 static HRESULT WINAPI HTMLStyle4_Invoke(IHTMLStyle4 *iface, DISPID dispIdMember,
4168 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
4169 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
4171 HTMLStyle *This = impl_from_IHTMLStyle4(iface);
4172 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
4173 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
4176 static HRESULT WINAPI HTMLStyle4_put_textOverflow(IHTMLStyle4 *iface, BSTR v)
4178 HTMLStyle *This = impl_from_IHTMLStyle4(iface);
4179 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4180 return E_NOTIMPL;
4183 static HRESULT WINAPI HTMLStyle4_get_textOverflow(IHTMLStyle4 *iface, BSTR *p)
4185 HTMLStyle *This = impl_from_IHTMLStyle4(iface);
4186 FIXME("(%p)->(%p)\n", This, p);
4187 return E_NOTIMPL;
4190 static HRESULT WINAPI HTMLStyle4_put_minHeight(IHTMLStyle4 *iface, VARIANT v)
4192 HTMLStyle *This = impl_from_IHTMLStyle4(iface);
4194 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
4196 return set_style_property_var(This, STYLEID_MIN_HEIGHT, &v);
4199 static HRESULT WINAPI HTMLStyle4_get_minHeight(IHTMLStyle4 *iface, VARIANT *p)
4201 HTMLStyle *This = impl_from_IHTMLStyle4(iface);
4203 TRACE("(%p)->(%p)\n", This, p);
4205 return get_style_property_var(This, STYLEID_MIN_HEIGHT, p);
4208 static const IHTMLStyle4Vtbl HTMLStyle4Vtbl = {
4209 HTMLStyle4_QueryInterface,
4210 HTMLStyle4_AddRef,
4211 HTMLStyle4_Release,
4212 HTMLStyle4_GetTypeInfoCount,
4213 HTMLStyle4_GetTypeInfo,
4214 HTMLStyle4_GetIDsOfNames,
4215 HTMLStyle4_Invoke,
4216 HTMLStyle4_put_textOverflow,
4217 HTMLStyle4_get_textOverflow,
4218 HTMLStyle4_put_minHeight,
4219 HTMLStyle4_get_minHeight
4222 static inline HTMLStyle *impl_from_IHTMLStyle5(IHTMLStyle5 *iface)
4224 return CONTAINING_RECORD(iface, HTMLStyle, IHTMLStyle5_iface);
4227 static HRESULT WINAPI HTMLStyle5_QueryInterface(IHTMLStyle5 *iface, REFIID riid, void **ppv)
4229 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4231 return IHTMLStyle_QueryInterface(&This->IHTMLStyle_iface, riid, ppv);
4234 static ULONG WINAPI HTMLStyle5_AddRef(IHTMLStyle5 *iface)
4236 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4238 return IHTMLStyle_AddRef(&This->IHTMLStyle_iface);
4241 static ULONG WINAPI HTMLStyle5_Release(IHTMLStyle5 *iface)
4243 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4245 return IHTMLStyle_Release(&This->IHTMLStyle_iface);
4248 static HRESULT WINAPI HTMLStyle5_GetTypeInfoCount(IHTMLStyle5 *iface, UINT *pctinfo)
4250 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4251 return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
4254 static HRESULT WINAPI HTMLStyle5_GetTypeInfo(IHTMLStyle5 *iface, UINT iTInfo,
4255 LCID lcid, ITypeInfo **ppTInfo)
4257 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4258 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
4261 static HRESULT WINAPI HTMLStyle5_GetIDsOfNames(IHTMLStyle5 *iface, REFIID riid,
4262 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
4264 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4265 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
4266 lcid, rgDispId);
4269 static HRESULT WINAPI HTMLStyle5_Invoke(IHTMLStyle5 *iface, DISPID dispIdMember,
4270 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
4271 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
4273 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4274 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
4275 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
4278 static HRESULT WINAPI HTMLStyle5_put_msInterpolationMode(IHTMLStyle5 *iface, BSTR v)
4280 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4281 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4282 return E_NOTIMPL;
4285 static HRESULT WINAPI HTMLStyle5_get_msInterpolationMode(IHTMLStyle5 *iface, BSTR *p)
4287 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4288 FIXME("(%p)->(%p)\n", This, p);
4289 return E_NOTIMPL;
4292 static HRESULT WINAPI HTMLStyle5_put_maxHeight(IHTMLStyle5 *iface, VARIANT v)
4294 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4296 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
4298 return set_style_property_var(This, STYLEID_MAX_HEIGHT, &v);
4301 static HRESULT WINAPI HTMLStyle5_get_maxHeight(IHTMLStyle5 *iface, VARIANT *p)
4303 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4305 TRACE("(%p)->(%s)\n", This, debugstr_variant(p));
4307 return get_style_property_var(This, STYLEID_MAX_HEIGHT, p);
4310 static HRESULT WINAPI HTMLStyle5_put_minWidth(IHTMLStyle5 *iface, VARIANT v)
4312 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4314 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
4316 return set_style_property_var(This, STYLEID_MIN_WIDTH, &v);
4319 static HRESULT WINAPI HTMLStyle5_get_minWidth(IHTMLStyle5 *iface, VARIANT *p)
4321 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4323 TRACE("(%p)->(%p)\n", This, p);
4325 return get_style_property_var(This, STYLEID_MIN_WIDTH, p);
4328 static HRESULT WINAPI HTMLStyle5_put_maxWidth(IHTMLStyle5 *iface, VARIANT v)
4330 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4332 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
4334 return set_style_property_var(This, STYLEID_MAX_WIDTH, &v);
4337 static HRESULT WINAPI HTMLStyle5_get_maxWidth(IHTMLStyle5 *iface, VARIANT *p)
4339 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4341 TRACE("(%p)->(%p)\n", This, p);
4343 return get_style_property_var(This, STYLEID_MAX_WIDTH, p);
4346 static const IHTMLStyle5Vtbl HTMLStyle5Vtbl = {
4347 HTMLStyle5_QueryInterface,
4348 HTMLStyle5_AddRef,
4349 HTMLStyle5_Release,
4350 HTMLStyle5_GetTypeInfoCount,
4351 HTMLStyle5_GetTypeInfo,
4352 HTMLStyle5_GetIDsOfNames,
4353 HTMLStyle5_Invoke,
4354 HTMLStyle5_put_msInterpolationMode,
4355 HTMLStyle5_get_msInterpolationMode,
4356 HTMLStyle5_put_maxHeight,
4357 HTMLStyle5_get_maxHeight,
4358 HTMLStyle5_put_minWidth,
4359 HTMLStyle5_get_minWidth,
4360 HTMLStyle5_put_maxWidth,
4361 HTMLStyle5_get_maxWidth
4364 static inline HTMLStyle *impl_from_IHTMLStyle6(IHTMLStyle6 *iface)
4366 return CONTAINING_RECORD(iface, HTMLStyle, IHTMLStyle6_iface);
4369 static HRESULT WINAPI HTMLStyle6_QueryInterface(IHTMLStyle6 *iface, REFIID riid, void **ppv)
4371 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4373 return IHTMLStyle_QueryInterface(&This->IHTMLStyle_iface, riid, ppv);
4376 static ULONG WINAPI HTMLStyle6_AddRef(IHTMLStyle6 *iface)
4378 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4380 return IHTMLStyle_AddRef(&This->IHTMLStyle_iface);
4383 static ULONG WINAPI HTMLStyle6_Release(IHTMLStyle6 *iface)
4385 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4387 return IHTMLStyle_Release(&This->IHTMLStyle_iface);
4390 static HRESULT WINAPI HTMLStyle6_GetTypeInfoCount(IHTMLStyle6 *iface, UINT *pctinfo)
4392 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4393 return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
4396 static HRESULT WINAPI HTMLStyle6_GetTypeInfo(IHTMLStyle6 *iface, UINT iTInfo,
4397 LCID lcid, ITypeInfo **ppTInfo)
4399 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4400 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
4403 static HRESULT WINAPI HTMLStyle6_GetIDsOfNames(IHTMLStyle6 *iface, REFIID riid,
4404 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
4406 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4407 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
4408 lcid, rgDispId);
4411 static HRESULT WINAPI HTMLStyle6_Invoke(IHTMLStyle6 *iface, DISPID dispIdMember,
4412 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
4413 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
4415 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4416 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
4417 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
4420 static HRESULT WINAPI HTMLStyle6_put_content(IHTMLStyle6 *iface, BSTR v)
4422 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4423 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4424 return E_NOTIMPL;
4427 static HRESULT WINAPI HTMLStyle6_get_content(IHTMLStyle6 *iface, BSTR *p)
4429 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4430 FIXME("(%p)->(%p)\n", This, p);
4431 return E_NOTIMPL;
4434 static HRESULT WINAPI HTMLStyle6_put_contentSide(IHTMLStyle6 *iface, BSTR v)
4436 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4437 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4438 return E_NOTIMPL;
4441 static HRESULT WINAPI HTMLStyle6_get_contentSide(IHTMLStyle6 *iface, BSTR *p)
4443 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4444 FIXME("(%p)->(%p)\n", This, p);
4445 return E_NOTIMPL;
4448 static HRESULT WINAPI HTMLStyle6_put_counterIncrement(IHTMLStyle6 *iface, BSTR v)
4450 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4451 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4452 return E_NOTIMPL;
4455 static HRESULT WINAPI HTMLStyle6_get_counterIncrement(IHTMLStyle6 *iface, BSTR *p)
4457 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4458 FIXME("(%p)->(%p)\n", This, p);
4459 return E_NOTIMPL;
4462 static HRESULT WINAPI HTMLStyle6_put_counterReset(IHTMLStyle6 *iface, BSTR v)
4464 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4465 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4466 return E_NOTIMPL;
4469 static HRESULT WINAPI HTMLStyle6_get_counterReset(IHTMLStyle6 *iface, BSTR *p)
4471 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4472 FIXME("(%p)->(%p)\n", This, p);
4473 return E_NOTIMPL;
4476 static HRESULT WINAPI HTMLStyle6_put_outline(IHTMLStyle6 *iface, BSTR v)
4478 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4480 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
4482 return set_style_property(This, STYLEID_OUTLINE, v);
4485 static HRESULT WINAPI HTMLStyle6_get_outline(IHTMLStyle6 *iface, BSTR *p)
4487 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4489 TRACE("(%p)->(%p)\n", This, p);
4491 return get_style_property(This, STYLEID_OUTLINE, p);
4494 static HRESULT WINAPI HTMLStyle6_put_outlineWidth(IHTMLStyle6 *iface, VARIANT v)
4496 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4497 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
4498 return E_NOTIMPL;
4501 static HRESULT WINAPI HTMLStyle6_get_outlineWidth(IHTMLStyle6 *iface, VARIANT *p)
4503 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4504 FIXME("(%p)->(%p)\n", This, p);
4505 return E_NOTIMPL;
4508 static HRESULT WINAPI HTMLStyle6_put_outlineStyle(IHTMLStyle6 *iface, BSTR v)
4510 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4511 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4512 return E_NOTIMPL;
4515 static HRESULT WINAPI HTMLStyle6_get_outlineStyle(IHTMLStyle6 *iface, BSTR *p)
4517 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4518 FIXME("(%p)->(%p)\n", This, p);
4519 return E_NOTIMPL;
4522 static HRESULT WINAPI HTMLStyle6_put_outlineColor(IHTMLStyle6 *iface, VARIANT v)
4524 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4525 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
4526 return E_NOTIMPL;
4529 static HRESULT WINAPI HTMLStyle6_get_outlineColor(IHTMLStyle6 *iface, VARIANT *p)
4531 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4532 FIXME("(%p)->(%p)\n", This, p);
4533 return E_NOTIMPL;
4536 static HRESULT WINAPI HTMLStyle6_put_boxSizing(IHTMLStyle6 *iface, BSTR v)
4538 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4540 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
4542 return set_style_property(This, STYLEID_BOX_SIZING, v);
4545 static HRESULT WINAPI HTMLStyle6_get_boxSizing(IHTMLStyle6 *iface, BSTR *p)
4547 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4549 TRACE("(%p)->(%p)\n", This, p);
4551 return get_style_property(This, STYLEID_BOX_SIZING, p);
4554 static HRESULT WINAPI HTMLStyle6_put_boxSpacing(IHTMLStyle6 *iface, BSTR v)
4556 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4557 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4558 return E_NOTIMPL;
4561 static HRESULT WINAPI HTMLStyle6_get_boxSpacing(IHTMLStyle6 *iface, BSTR *p)
4563 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4564 FIXME("(%p)->(%p)\n", This, p);
4565 return E_NOTIMPL;
4568 static HRESULT WINAPI HTMLStyle6_put_orphans(IHTMLStyle6 *iface, VARIANT v)
4570 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4571 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
4572 return E_NOTIMPL;
4575 static HRESULT WINAPI HTMLStyle6_get_orphans(IHTMLStyle6 *iface, VARIANT *p)
4577 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4578 FIXME("(%p)->(%p)\n", This, p);
4579 return E_NOTIMPL;
4582 static HRESULT WINAPI HTMLStyle6_put_windows(IHTMLStyle6 *iface, VARIANT v)
4584 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4585 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
4586 return E_NOTIMPL;
4589 static HRESULT WINAPI HTMLStyle6_get_windows(IHTMLStyle6 *iface, VARIANT *p)
4591 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4592 FIXME("(%p)->(%p)\n", This, p);
4593 return E_NOTIMPL;
4596 static HRESULT WINAPI HTMLStyle6_put_pageBreakInside(IHTMLStyle6 *iface, BSTR v)
4598 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4599 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4600 return E_NOTIMPL;
4603 static HRESULT WINAPI HTMLStyle6_get_pageBreakInside(IHTMLStyle6 *iface, BSTR *p)
4605 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4606 FIXME("(%p)->(%p)\n", This, p);
4607 return E_NOTIMPL;
4610 static HRESULT WINAPI HTMLStyle6_put_emptyCells(IHTMLStyle6 *iface, BSTR v)
4612 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4613 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4614 return E_NOTIMPL;
4617 static HRESULT WINAPI HTMLStyle6_get_emptyCells(IHTMLStyle6 *iface, BSTR *p)
4619 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4620 FIXME("(%p)->(%p)\n", This, p);
4621 return E_NOTIMPL;
4624 static HRESULT WINAPI HTMLStyle6_put_msBlockProgression(IHTMLStyle6 *iface, BSTR v)
4626 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4627 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4628 return E_NOTIMPL;
4631 static HRESULT WINAPI HTMLStyle6_get_msBlockProgression(IHTMLStyle6 *iface, BSTR *p)
4633 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4634 FIXME("(%p)->(%p)\n", This, p);
4635 return E_NOTIMPL;
4638 static HRESULT WINAPI HTMLStyle6_put_quotes(IHTMLStyle6 *iface, BSTR v)
4640 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4641 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4642 return E_NOTIMPL;
4645 static HRESULT WINAPI HTMLStyle6_get_quotes(IHTMLStyle6 *iface, BSTR *p)
4647 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4648 FIXME("(%p)->(%p)\n", This, p);
4649 return E_NOTIMPL;
4652 static const IHTMLStyle6Vtbl HTMLStyle6Vtbl = {
4653 HTMLStyle6_QueryInterface,
4654 HTMLStyle6_AddRef,
4655 HTMLStyle6_Release,
4656 HTMLStyle6_GetTypeInfoCount,
4657 HTMLStyle6_GetTypeInfo,
4658 HTMLStyle6_GetIDsOfNames,
4659 HTMLStyle6_Invoke,
4660 HTMLStyle6_put_content,
4661 HTMLStyle6_get_content,
4662 HTMLStyle6_put_contentSide,
4663 HTMLStyle6_get_contentSide,
4664 HTMLStyle6_put_counterIncrement,
4665 HTMLStyle6_get_counterIncrement,
4666 HTMLStyle6_put_counterReset,
4667 HTMLStyle6_get_counterReset,
4668 HTMLStyle6_put_outline,
4669 HTMLStyle6_get_outline,
4670 HTMLStyle6_put_outlineWidth,
4671 HTMLStyle6_get_outlineWidth,
4672 HTMLStyle6_put_outlineStyle,
4673 HTMLStyle6_get_outlineStyle,
4674 HTMLStyle6_put_outlineColor,
4675 HTMLStyle6_get_outlineColor,
4676 HTMLStyle6_put_boxSizing,
4677 HTMLStyle6_get_boxSizing,
4678 HTMLStyle6_put_boxSpacing,
4679 HTMLStyle6_get_boxSpacing,
4680 HTMLStyle6_put_orphans,
4681 HTMLStyle6_get_orphans,
4682 HTMLStyle6_put_windows,
4683 HTMLStyle6_get_windows,
4684 HTMLStyle6_put_pageBreakInside,
4685 HTMLStyle6_get_pageBreakInside,
4686 HTMLStyle6_put_emptyCells,
4687 HTMLStyle6_get_emptyCells,
4688 HTMLStyle6_put_msBlockProgression,
4689 HTMLStyle6_get_msBlockProgression,
4690 HTMLStyle6_put_quotes,
4691 HTMLStyle6_get_quotes
4694 static HRESULT HTMLStyle_get_dispid(DispatchEx *dispex, BSTR name, DWORD flags, DISPID *dispid)
4696 const style_tbl_entry_t *style_entry;
4698 style_entry = lookup_style_tbl(name);
4699 if(style_entry) {
4700 *dispid = style_entry->dispid;
4701 return S_OK;
4704 return DISP_E_UNKNOWNNAME;
4707 static const dispex_static_data_vtbl_t HTMLStyle_dispex_vtbl = {
4708 NULL,
4709 HTMLStyle_get_dispid,
4710 NULL,
4711 NULL
4714 static const tid_t HTMLStyle_iface_tids[] = {
4715 IHTMLStyle6_tid,
4716 IHTMLStyle5_tid,
4717 IHTMLStyle4_tid,
4718 IHTMLStyle3_tid,
4719 IHTMLStyle2_tid,
4720 IHTMLStyle_tid,
4723 static dispex_static_data_t HTMLStyle_dispex = {
4724 &HTMLStyle_dispex_vtbl,
4725 DispHTMLStyle_tid,
4726 HTMLStyle_iface_tids
4729 static HRESULT get_style_from_elem(HTMLElement *elem, nsIDOMCSSStyleDeclaration **ret)
4731 nsIDOMElementCSSInlineStyle *nselemstyle;
4732 nsresult nsres;
4734 if(!elem->dom_element) {
4735 FIXME("comment element\n");
4736 return E_NOTIMPL;
4739 nsres = nsIDOMElement_QueryInterface(elem->dom_element, &IID_nsIDOMElementCSSInlineStyle,
4740 (void**)&nselemstyle);
4741 assert(nsres == NS_OK);
4743 nsres = nsIDOMElementCSSInlineStyle_GetStyle(nselemstyle, ret);
4744 nsIDOMElementCSSInlineStyle_Release(nselemstyle);
4745 if(NS_FAILED(nsres)) {
4746 ERR("GetStyle failed: %08x\n", nsres);
4747 return E_FAIL;
4750 return S_OK;
4753 HRESULT HTMLStyle_Create(HTMLElement *elem, HTMLStyle **ret)
4755 nsIDOMCSSStyleDeclaration *nsstyle;
4756 HTMLStyle *style;
4757 HRESULT hres;
4759 hres = get_style_from_elem(elem, &nsstyle);
4760 if(FAILED(hres))
4761 return hres;
4763 style = heap_alloc_zero(sizeof(HTMLStyle));
4764 if(!style) {
4765 nsIDOMCSSStyleDeclaration_Release(nsstyle);
4766 return E_OUTOFMEMORY;
4769 style->IHTMLStyle_iface.lpVtbl = &HTMLStyleVtbl;
4770 style->IHTMLStyle2_iface.lpVtbl = &HTMLStyle2Vtbl;
4771 style->IHTMLStyle3_iface.lpVtbl = &HTMLStyle3Vtbl;
4772 style->IHTMLStyle4_iface.lpVtbl = &HTMLStyle4Vtbl;
4773 style->IHTMLStyle5_iface.lpVtbl = &HTMLStyle5Vtbl;
4774 style->IHTMLStyle6_iface.lpVtbl = &HTMLStyle6Vtbl;
4776 style->ref = 1;
4777 style->nsstyle = nsstyle;
4778 style->elem = elem;
4780 nsIDOMCSSStyleDeclaration_AddRef(nsstyle);
4782 init_dispex_with_compat_mode(&style->dispex, (IUnknown*)&style->IHTMLStyle_iface, &HTMLStyle_dispex,
4783 dispex_compat_mode(&elem->node.event_target.dispex));
4785 *ret = style;
4786 return S_OK;
4789 HRESULT get_elem_style(HTMLElement *elem, styleid_t styleid, BSTR *ret)
4791 nsIDOMCSSStyleDeclaration *style;
4792 HRESULT hres;
4794 hres = get_style_from_elem(elem, &style);
4795 if(FAILED(hres))
4796 return hres;
4798 hres = get_nsstyle_property(style, styleid, COMPAT_MODE_IE11, ret);
4799 nsIDOMCSSStyleDeclaration_Release(style);
4800 return hres;
4803 HRESULT set_elem_style(HTMLElement *elem, styleid_t styleid, const WCHAR *val)
4805 nsIDOMCSSStyleDeclaration *style;
4806 HRESULT hres;
4808 hres = get_style_from_elem(elem, &style);
4809 if(FAILED(hres))
4810 return hres;
4812 hres = set_nsstyle_property(style, styleid, val);
4813 nsIDOMCSSStyleDeclaration_Release(style);
4814 return hres;