msxml3/tests: Added invalid host XHR tests.
[wine.git] / dlls / mshtml / htmlstyle.c
blobb99ea08318d18dfdbc3f4bae72948e1a0e508554
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 attrBackground[] =
39 {'b','a','c','k','g','r','o','u','n','d',0};
40 static const WCHAR attrBackgroundAttachment[] =
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 attrBackgroundColor[] =
43 {'b','a','c','k','g','r','o','u','n','d','-','c','o','l','o','r',0};
44 static const WCHAR attrBackgroundImage[] =
45 {'b','a','c','k','g','r','o','u','n','d','-','i','m','a','g','e',0};
46 static const WCHAR attrBackgroundPosition[] =
47 {'b','a','c','k','g','r','o','u','n','d','-','p','o','s','i','t','i','o','n',0};
48 static const WCHAR attrBackgroundPositionX[] =
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 attrBackgroundPositionY[] =
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 attrBackgroundRepeat[] =
53 {'b','a','c','k','g','r','o','u','n','d','-','r','e','p','e','a','t',0};
54 static const WCHAR attrBorder[] =
55 {'b','o','r','d','e','r',0};
56 static const WCHAR attrBorderBottom[] =
57 {'b','o','r','d','e','r','-','b','o','t','t','o','m',0};
58 static const WCHAR attrBorderBottomColor[] =
59 {'b','o','r','d','e','r','-','b','o','t','t','o','m','-','c','o','l','o','r',0};
60 static const WCHAR attrBorderBottomStyle[] =
61 {'b','o','r','d','e','r','-','b','o','t','t','o','m','-','s','t','y','l','e',0};
62 static const WCHAR attrBorderBottomWidth[] =
63 {'b','o','r','d','e','r','-','b','o','t','t','o','m','-','w','i','d','t','h',0};
64 static const WCHAR attrBorderColor[] =
65 {'b','o','r','d','e','r','-','c','o','l','o','r',0};
66 static const WCHAR attrBorderLeft[] =
67 {'b','o','r','d','e','r','-','l','e','f','t',0};
68 static const WCHAR attrBorderLeftColor[] =
69 {'b','o','r','d','e','r','-','l','e','f','t','-','c','o','l','o','r',0};
70 static const WCHAR attrBorderLeftStyle[] =
71 {'b','o','r','d','e','r','-','l','e','f','t','-','s','t','y','l','e',0};
72 static const WCHAR attrBorderLeftWidth[] =
73 {'b','o','r','d','e','r','-','l','e','f','t','-','w','i','d','t','h',0};
74 static const WCHAR attrBorderRight[] =
75 {'b','o','r','d','e','r','-','r','i','g','h','t',0};
76 static const WCHAR attrBorderRightColor[] =
77 {'b','o','r','d','e','r','-','r','i','g','h','t','-','c','o','l','o','r',0};
78 static const WCHAR attrBorderRightStyle[] =
79 {'b','o','r','d','e','r','-','r','i','g','h','t','-','s','t','y','l','e',0};
80 static const WCHAR attrBorderRightWidth[] =
81 {'b','o','r','d','e','r','-','r','i','g','h','t','-','w','i','d','t','h',0};
82 static const WCHAR attrBorderTop[] =
83 {'b','o','r','d','e','r','-','t','o','p',0};
84 static const WCHAR attrBorderTopColor[] =
85 {'b','o','r','d','e','r','-','t','o','p','-','c','o','l','o','r',0};
86 static const WCHAR attrBorderStyle[] =
87 {'b','o','r','d','e','r','-','s','t','y','l','e',0};
88 static const WCHAR attrBorderTopStyle[] =
89 {'b','o','r','d','e','r','-','t','o','p','-','s','t','y','l','e',0};
90 static const WCHAR attrBorderTopWidth[] =
91 {'b','o','r','d','e','r','-','t','o','p','-','w','i','d','t','h',0};
92 static const WCHAR attrBorderWidth[] =
93 {'b','o','r','d','e','r','-','w','i','d','t','h',0};
94 static const WCHAR attrBottom[] =
95 {'b','o','t','t','o','m',0};
96 /* FIXME: Use unprefixed version (requires Gecko changes). */
97 static const WCHAR attrBoxSizing[] =
98 {'-','m','o','z','-','b','o','x','-','s','i','z','i','n','g',0};
99 static const WCHAR attrClear[] =
100 {'c','l','e','a','r',0};
101 static const WCHAR attrClip[] =
102 {'c','l','i','p',0};
103 static const WCHAR attrColor[] =
104 {'c','o','l','o','r',0};
105 static const WCHAR attrCursor[] =
106 {'c','u','r','s','o','r',0};
107 static const WCHAR attrDirection[] =
108 {'d','i','r','e','c','t','i','o','n',0};
109 static const WCHAR attrDisplay[] =
110 {'d','i','s','p','l','a','y',0};
111 static const WCHAR attrFilter[] =
112 {'f','i','l','e','t','e','r',0};
113 static const WCHAR attrFloat[] =
114 {'f','l','o','a','t',0};
115 static const WCHAR attrFontFamily[] =
116 {'f','o','n','t','-','f','a','m','i','l','y',0};
117 static const WCHAR attrFontSize[] =
118 {'f','o','n','t','-','s','i','z','e',0};
119 static const WCHAR attrFontStyle[] =
120 {'f','o','n','t','-','s','t','y','l','e',0};
121 static const WCHAR attrFontVariant[] =
122 {'f','o','n','t','-','v','a','r','i','a','n','t',0};
123 static const WCHAR attrFontWeight[] =
124 {'f','o','n','t','-','w','e','i','g','h','t',0};
125 static const WCHAR attrHeight[] =
126 {'h','e','i','g','h','t',0};
127 static const WCHAR attrLeft[] =
128 {'l','e','f','t',0};
129 static const WCHAR attrLetterSpacing[] =
130 {'l','e','t','t','e','r','-','s','p','a','c','i','n','g',0};
131 static const WCHAR attrLineHeight[] =
132 {'l','i','n','e','-','h','e','i','g','h','t',0};
133 static const WCHAR attrListStyle[] =
134 {'l','i','s','t','-','s','t','y','l','e',0};
135 static const WCHAR attrListStyleType[] =
136 {'l','i','s','t','-','s','t','y','l','e','-','t','y','p','e',0};
137 static const WCHAR attrListStylePosition[] =
138 {'l','i','s','t','-','s','t','y','l','e','-','p','o','s','i','t','i','o','n',0};
139 static const WCHAR attrMargin[] =
140 {'m','a','r','g','i','n',0};
141 static const WCHAR attrMarginBottom[] =
142 {'m','a','r','g','i','n','-','b','o','t','t','o','m',0};
143 static const WCHAR attrMarginLeft[] =
144 {'m','a','r','g','i','n','-','l','e','f','t',0};
145 static const WCHAR attrMarginRight[] =
146 {'m','a','r','g','i','n','-','r','i','g','h','t',0};
147 static const WCHAR attrMarginTop[] =
148 {'m','a','r','g','i','n','-','t','o','p',0};
149 static const WCHAR attrMaxHeight[] =
150 {'m','a','x','-','h','e','i','g','h','t',0};
151 static const WCHAR attrMaxWidth[] =
152 {'m','a','x','-','w','i','d','t','h',0};
153 static const WCHAR attrMinHeight[] =
154 {'m','i','n','-','h','e','i','g','h','t',0};
155 static const WCHAR attrMinWidth[] =
156 {'m','i','n','-','w','i','d','t','h',0};
157 static const WCHAR attrOutline[] =
158 {'o','u','t','l','i','n','e',0};
159 static const WCHAR attrOverflow[] =
160 {'o','v','e','r','f','l','o','w',0};
161 static const WCHAR attrOverflowX[] =
162 {'o','v','e','r','f','l','o','w','-','x',0};
163 static const WCHAR attrOverflowY[] =
164 {'o','v','e','r','f','l','o','w','-','y',0};
165 static const WCHAR attrPadding[] =
166 {'p','a','d','d','i','n','g',0};
167 static const WCHAR attrPaddingBottom[] =
168 {'p','a','d','d','i','n','g','-','b','o','t','t','o','m',0};
169 static const WCHAR attrPaddingLeft[] =
170 {'p','a','d','d','i','n','g','-','l','e','f','t',0};
171 static const WCHAR attrPaddingRight[] =
172 {'p','a','d','d','i','n','g','-','r','i','g','h','t',0};
173 static const WCHAR attrPaddingTop[] =
174 {'p','a','d','d','i','n','g','-','t','o','p',0};
175 static const WCHAR attrPageBreakAfter[] =
176 {'p','a','g','e','-','b','r','e','a','k','-','a','f','t','e','r',0};
177 static const WCHAR attrPageBreakBefore[] =
178 {'p','a','g','e','-','b','r','e','a','k','-','b','e','f','o','r','e',0};
179 static const WCHAR attrPosition[] =
180 {'p','o','s','i','t','i','o','n',0};
181 static const WCHAR attrRight[] =
182 {'r','i','g','h','t',0};
183 static const WCHAR attrTableLayout[] =
184 {'t','a','b','l','e','-','l','a','y','o','u','t',0};
185 static const WCHAR attrTextAlign[] =
186 {'t','e','x','t','-','a','l','i','g','n',0};
187 static const WCHAR attrTextDecoration[] =
188 {'t','e','x','t','-','d','e','c','o','r','a','t','i','o','n',0};
189 static const WCHAR attrTextIndent[] =
190 {'t','e','x','t','-','i','n','d','e','n','t',0};
191 static const WCHAR attrTextTransform[] =
192 {'t','e','x','t','-','t','r','a','n','s','f','o','r','m',0};
193 static const WCHAR attrTop[] =
194 {'t','o','p',0};
195 static const WCHAR attrVerticalAlign[] =
196 {'v','e','r','t','i','c','a','l','-','a','l','i','g','n',0};
197 static const WCHAR attrVisibility[] =
198 {'v','i','s','i','b','i','l','i','t','y',0};
199 static const WCHAR attrWhiteSpace[] =
200 {'w','h','i','t','e','-','s','p','a','c','e',0};
201 static const WCHAR attrWidth[] =
202 {'w','i','d','t','h',0};
203 static const WCHAR attrWordSpacing[] =
204 {'w','o','r','d','-','s','p','a','c','i','n','g',0};
205 static const WCHAR attrWordWrap[] =
206 {'w','o','r','d','-','w','r','a','p',0};
207 static const WCHAR attrZIndex[] =
208 {'z','-','i','n','d','e','x',0};
211 static const WCHAR pxW[] = {'p','x',0};
213 typedef struct {
214 const WCHAR *name;
215 DISPID dispid;
216 } style_tbl_entry_t;
218 static const style_tbl_entry_t style_tbl[] = {
219 {attrBackground, DISPID_IHTMLSTYLE_BACKGROUND},
220 {attrBackgroundAttachment, DISPID_IHTMLSTYLE_BACKGROUNDATTACHMENT},
221 {attrBackgroundColor, DISPID_IHTMLSTYLE_BACKGROUNDCOLOR},
222 {attrBackgroundImage, DISPID_IHTMLSTYLE_BACKGROUNDIMAGE},
223 {attrBackgroundPosition, DISPID_IHTMLSTYLE_BACKGROUNDPOSITION},
224 {attrBackgroundPositionX, DISPID_IHTMLSTYLE_BACKGROUNDPOSITIONX},
225 {attrBackgroundPositionY, DISPID_IHTMLSTYLE_BACKGROUNDPOSITIONY},
226 {attrBackgroundRepeat, DISPID_IHTMLSTYLE_BACKGROUNDREPEAT},
227 {attrBorder, DISPID_IHTMLSTYLE_BORDER},
228 {attrBorderBottom, DISPID_IHTMLSTYLE_BORDERBOTTOM},
229 {attrBorderBottomColor, DISPID_IHTMLSTYLE_BORDERBOTTOMCOLOR},
230 {attrBorderBottomStyle, DISPID_IHTMLSTYLE_BORDERBOTTOMSTYLE},
231 {attrBorderBottomWidth, DISPID_IHTMLSTYLE_BORDERBOTTOMWIDTH},
232 {attrBorderColor, DISPID_IHTMLSTYLE_BORDERCOLOR},
233 {attrBorderLeft, DISPID_IHTMLSTYLE_BORDERLEFT},
234 {attrBorderLeftColor, DISPID_IHTMLSTYLE_BORDERLEFTCOLOR},
235 {attrBorderLeftStyle, DISPID_IHTMLSTYLE_BORDERLEFTSTYLE},
236 {attrBorderLeftWidth, DISPID_IHTMLSTYLE_BORDERLEFTWIDTH},
237 {attrBorderRight, DISPID_IHTMLSTYLE_BORDERRIGHT},
238 {attrBorderRightColor, DISPID_IHTMLSTYLE_BORDERRIGHTCOLOR},
239 {attrBorderRightStyle, DISPID_IHTMLSTYLE_BORDERRIGHTSTYLE},
240 {attrBorderRightWidth, DISPID_IHTMLSTYLE_BORDERRIGHTWIDTH},
241 {attrBorderStyle, DISPID_IHTMLSTYLE_BORDERSTYLE},
242 {attrBorderTop, DISPID_IHTMLSTYLE_BORDERTOP},
243 {attrBorderTopColor, DISPID_IHTMLSTYLE_BORDERTOPCOLOR},
244 {attrBorderTopStyle, DISPID_IHTMLSTYLE_BORDERTOPSTYLE},
245 {attrBorderTopWidth, DISPID_IHTMLSTYLE_BORDERTOPWIDTH},
246 {attrBorderWidth, DISPID_IHTMLSTYLE_BORDERWIDTH},
247 {attrBottom, DISPID_IHTMLSTYLE2_BOTTOM},
248 {attrBoxSizing, DISPID_IHTMLSTYLE6_BOXSIZING},
249 {attrClear, DISPID_IHTMLSTYLE_CLEAR},
250 {attrClip, DISPID_IHTMLSTYLE_CLIP},
251 {attrColor, DISPID_IHTMLSTYLE_COLOR},
252 {attrCursor, DISPID_IHTMLSTYLE_CURSOR},
253 {attrDirection, DISPID_IHTMLSTYLE2_DIRECTION},
254 {attrDisplay, DISPID_IHTMLSTYLE_DISPLAY},
255 {attrFilter, DISPID_IHTMLSTYLE_FILTER},
256 {attrFloat, DISPID_IHTMLSTYLE_STYLEFLOAT},
257 {attrFontFamily, DISPID_IHTMLSTYLE_FONTFAMILY},
258 {attrFontSize, DISPID_IHTMLSTYLE_FONTSIZE},
259 {attrFontStyle, DISPID_IHTMLSTYLE_FONTSTYLE},
260 {attrFontVariant, DISPID_IHTMLSTYLE_FONTVARIANT},
261 {attrFontWeight, DISPID_IHTMLSTYLE_FONTWEIGHT},
262 {attrHeight, DISPID_IHTMLSTYLE_HEIGHT},
263 {attrLeft, DISPID_IHTMLSTYLE_LEFT},
264 {attrLetterSpacing, DISPID_IHTMLSTYLE_LETTERSPACING},
265 {attrLineHeight, DISPID_IHTMLSTYLE_LINEHEIGHT},
266 {attrListStyle, DISPID_IHTMLSTYLE_LISTSTYLE},
267 {attrListStylePosition, DISPID_IHTMLSTYLE_LISTSTYLEPOSITION},
268 {attrListStyleType, DISPID_IHTMLSTYLE_LISTSTYLETYPE},
269 {attrMargin, DISPID_IHTMLSTYLE_MARGIN},
270 {attrMarginBottom, DISPID_IHTMLSTYLE_MARGINBOTTOM},
271 {attrMarginLeft, DISPID_IHTMLSTYLE_MARGINLEFT},
272 {attrMarginRight, DISPID_IHTMLSTYLE_MARGINRIGHT},
273 {attrMarginTop, DISPID_IHTMLSTYLE_MARGINTOP},
274 {attrMaxHeight, DISPID_IHTMLSTYLE5_MAXHEIGHT},
275 {attrMaxWidth, DISPID_IHTMLSTYLE5_MAXWIDTH},
276 {attrMinHeight, DISPID_IHTMLSTYLE4_MINHEIGHT},
277 {attrMinWidth, DISPID_IHTMLSTYLE5_MINWIDTH},
278 {attrOutline, DISPID_IHTMLSTYLE6_OUTLINE},
279 {attrOverflow, DISPID_IHTMLSTYLE_OVERFLOW},
280 {attrOverflowX, DISPID_IHTMLSTYLE2_OVERFLOWX},
281 {attrOverflowY, DISPID_IHTMLSTYLE2_OVERFLOWY},
282 {attrPadding, DISPID_IHTMLSTYLE_PADDING},
283 {attrPaddingBottom, DISPID_IHTMLSTYLE_PADDINGBOTTOM},
284 {attrPaddingLeft, DISPID_IHTMLSTYLE_PADDINGLEFT},
285 {attrPaddingRight, DISPID_IHTMLSTYLE_PADDINGRIGHT},
286 {attrPaddingTop, DISPID_IHTMLSTYLE_PADDINGTOP},
287 {attrPageBreakAfter, DISPID_IHTMLSTYLE_PAGEBREAKAFTER},
288 {attrPageBreakBefore, DISPID_IHTMLSTYLE_PAGEBREAKBEFORE},
289 {attrPosition, DISPID_IHTMLSTYLE2_POSITION},
290 {attrRight, DISPID_IHTMLSTYLE2_RIGHT},
291 {attrTableLayout, DISPID_IHTMLSTYLE2_TABLELAYOUT},
292 {attrTextAlign, DISPID_IHTMLSTYLE_TEXTALIGN},
293 {attrTextDecoration, DISPID_IHTMLSTYLE_TEXTDECORATION},
294 {attrTextIndent, DISPID_IHTMLSTYLE_TEXTINDENT},
295 {attrTextTransform, DISPID_IHTMLSTYLE_TEXTTRANSFORM},
296 {attrTop, DISPID_IHTMLSTYLE_TOP},
297 {attrVerticalAlign, DISPID_IHTMLSTYLE_VERTICALALIGN},
298 {attrVisibility, DISPID_IHTMLSTYLE_VISIBILITY},
299 {attrWhiteSpace, DISPID_IHTMLSTYLE_WHITESPACE},
300 {attrWidth, DISPID_IHTMLSTYLE_WIDTH},
301 {attrWordSpacing, DISPID_IHTMLSTYLE_WORDSPACING},
302 {attrWordWrap, DISPID_IHTMLSTYLE3_WORDWRAP},
303 {attrZIndex, DISPID_IHTMLSTYLE_ZINDEX}
306 C_ASSERT(sizeof(style_tbl)/sizeof(*style_tbl) == STYLEID_MAX_VALUE);
308 static const WCHAR valLineThrough[] =
309 {'l','i','n','e','-','t','h','r','o','u','g','h',0};
310 static const WCHAR valUnderline[] =
311 {'u','n','d','e','r','l','i','n','e',0};
312 static const WCHAR szNormal[] =
313 {'n','o','r','m','a','l',0};
314 static const WCHAR styleNone[] =
315 {'n','o','n','e',0};
316 static const WCHAR valOverline[] =
317 {'o','v','e','r','l','i','n','e',0};
318 static const WCHAR valBlink[] =
319 {'b','l','i','n','k',0};
321 static const WCHAR px_formatW[] = {'%','d','p','x',0};
322 static const WCHAR emptyW[] = {0};
324 static const style_tbl_entry_t *lookup_style_tbl(const WCHAR *name)
326 int c, i, min = 0, max = sizeof(style_tbl)/sizeof(*style_tbl)-1;
328 while(min <= max) {
329 i = (min+max)/2;
331 c = strcmpW(style_tbl[i].name, name);
332 if(!c)
333 return style_tbl+i;
335 if(c > 0)
336 max = i-1;
337 else
338 min = i+1;
341 return NULL;
344 static inline compat_mode_t get_style_compat_mode(HTMLStyle *style)
346 return style->elem && style->elem->node.doc ? style->elem->node.doc->document_mode : COMPAT_MODE_QUIRKS;
349 static LPWSTR fix_px_value(LPCWSTR val)
351 LPCWSTR ptr = val;
353 while(*ptr) {
354 while(*ptr && isspaceW(*ptr))
355 ptr++;
356 if(!*ptr)
357 break;
359 while(*ptr && isdigitW(*ptr))
360 ptr++;
362 if(!*ptr || isspaceW(*ptr)) {
363 LPWSTR ret, p;
364 int len = strlenW(val)+1;
366 ret = heap_alloc((len+2)*sizeof(WCHAR));
367 memcpy(ret, val, (ptr-val)*sizeof(WCHAR));
368 p = ret + (ptr-val);
369 *p++ = 'p';
370 *p++ = 'x';
371 strcpyW(p, ptr);
373 TRACE("fixed %s -> %s\n", debugstr_w(val), debugstr_w(ret));
375 return ret;
378 while(*ptr && !isspaceW(*ptr))
379 ptr++;
382 return NULL;
385 static LPWSTR fix_url_value(LPCWSTR val)
387 WCHAR *ret, *ptr;
389 static const WCHAR urlW[] = {'u','r','l','('};
391 if(strncmpW(val, urlW, sizeof(urlW)/sizeof(WCHAR)) || !strchrW(val, '\\'))
392 return NULL;
394 ret = heap_strdupW(val);
396 for(ptr = ret; *ptr; ptr++) {
397 if(*ptr == '\\')
398 *ptr = '/';
401 return ret;
404 static HRESULT set_nsstyle_attr(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, const WCHAR *value, DWORD flags)
406 nsAString str_name, str_value, str_empty;
407 LPWSTR val = NULL;
408 nsresult nsres;
410 if(value) {
411 if(flags & ATTR_FIX_PX)
412 val = fix_px_value(value);
413 else if(flags & ATTR_FIX_URL)
414 val = fix_url_value(value);
417 nsAString_InitDepend(&str_name, style_tbl[sid].name);
418 nsAString_InitDepend(&str_value, val ? val : value);
419 nsAString_InitDepend(&str_empty, emptyW);
421 nsres = nsIDOMCSSStyleDeclaration_SetProperty(nsstyle, &str_name, &str_value, &str_empty);
422 if(NS_FAILED(nsres))
423 ERR("SetProperty failed: %08x\n", nsres);
425 nsAString_Finish(&str_name);
426 nsAString_Finish(&str_value);
427 nsAString_Finish(&str_empty);
428 heap_free(val);
430 return S_OK;
433 static HRESULT var_to_styleval(const VARIANT *v, WCHAR *buf, DWORD flags, const WCHAR **ret)
435 switch(V_VT(v)) {
436 case VT_NULL:
437 *ret = emptyW;
438 return S_OK;
440 case VT_BSTR:
441 *ret = V_BSTR(v);
442 return S_OK;
444 case VT_BSTR|VT_BYREF:
445 *ret = *V_BSTRREF(v);
446 return S_OK;
448 case VT_I4: {
449 static const WCHAR formatW[] = {'%','d',0};
450 static const WCHAR hex_formatW[] = {'#','%','0','6','x',0};
452 if(flags & ATTR_HEX_INT)
453 wsprintfW(buf, hex_formatW, V_I4(v));
454 else if(flags & ATTR_FIX_PX)
455 wsprintfW(buf, px_formatW, V_I4(v));
456 else
457 wsprintfW(buf, formatW, V_I4(v));
459 *ret = buf;
460 return S_OK;
462 default:
463 FIXME("not implemented for %s\n", debugstr_variant(v));
464 return E_NOTIMPL;
469 static HRESULT set_nsstyle_attr_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, VARIANT *value, DWORD flags)
471 const WCHAR *val;
472 WCHAR buf[14];
473 HRESULT hres;
475 hres = var_to_styleval(value, buf, flags, &val);
476 if(FAILED(hres))
477 return hres;
479 return set_nsstyle_attr(nsstyle, sid, val, flags);
482 static inline HRESULT set_style_attr(HTMLStyle *This, styleid_t sid, LPCWSTR value, DWORD flags)
484 return set_nsstyle_attr(This->nsstyle, sid, value, flags);
487 static HRESULT get_nsstyle_attr_nsval(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, nsAString *value)
489 nsAString str_name;
490 nsresult nsres;
492 nsAString_InitDepend(&str_name, style_tbl[sid].name);
493 nsres = nsIDOMCSSStyleDeclaration_GetPropertyValue(nsstyle, &str_name, value);
494 nsAString_Finish(&str_name);
495 if(NS_FAILED(nsres)) {
496 ERR("SetProperty failed: %08x\n", nsres);
497 return E_FAIL;
500 return S_OK;
503 static HRESULT nsstyle_to_bstr(const WCHAR *val, DWORD flags, BSTR *p)
505 BSTR ret;
506 DWORD len;
508 if(!*val) {
509 *p = (flags & ATTR_NO_NULL) ? SysAllocStringLen(NULL, 0) : NULL;
510 return S_OK;
513 ret = SysAllocString(val);
514 if(!ret)
515 return E_OUTOFMEMORY;
517 len = SysStringLen(ret);
519 if(flags & ATTR_REMOVE_COMMA) {
520 DWORD new_len = len;
521 WCHAR *ptr, *ptr2;
523 for(ptr = ret; (ptr = strchrW(ptr, ',')); ptr++)
524 new_len--;
526 if(new_len != len) {
527 BSTR new_ret;
529 new_ret = SysAllocStringLen(NULL, new_len);
530 if(!new_ret) {
531 SysFreeString(ret);
532 return E_OUTOFMEMORY;
535 for(ptr2 = new_ret, ptr = ret; *ptr; ptr++) {
536 if(*ptr != ',')
537 *ptr2++ = *ptr;
540 SysFreeString(ret);
541 ret = new_ret;
545 *p = ret;
546 return S_OK;
549 HRESULT get_nsstyle_attr(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, BSTR *p, DWORD flags)
551 nsAString str_value;
552 const PRUnichar *value;
553 HRESULT hres;
555 nsAString_Init(&str_value, NULL);
557 get_nsstyle_attr_nsval(nsstyle, sid, &str_value);
559 nsAString_GetData(&str_value, &value);
560 hres = nsstyle_to_bstr(value, flags, p);
561 nsAString_Finish(&str_value);
563 TRACE("%s -> %s\n", debugstr_w(style_tbl[sid].name), debugstr_w(*p));
564 return hres;
567 HRESULT get_nsstyle_attr_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, VARIANT *p, DWORD flags)
569 nsAString str_value;
570 const PRUnichar *value;
571 BOOL set = FALSE;
572 HRESULT hres = S_OK;
574 nsAString_Init(&str_value, NULL);
576 get_nsstyle_attr_nsval(nsstyle, sid, &str_value);
578 nsAString_GetData(&str_value, &value);
580 if(flags & ATTR_STR_TO_INT) {
581 const PRUnichar *ptr = value;
582 BOOL neg = FALSE;
583 INT i = 0;
585 if(*ptr == '-') {
586 neg = TRUE;
587 ptr++;
590 while(isdigitW(*ptr))
591 i = i*10 + (*ptr++ - '0');
593 if(!*ptr) {
594 V_VT(p) = VT_I4;
595 V_I4(p) = neg ? -i : i;
596 set = TRUE;
600 if(!set) {
601 BSTR str;
603 hres = nsstyle_to_bstr(value, flags, &str);
604 if(SUCCEEDED(hres)) {
605 V_VT(p) = VT_BSTR;
606 V_BSTR(p) = str;
610 nsAString_Finish(&str_value);
612 TRACE("%s -> %s\n", debugstr_w(style_tbl[sid].name), debugstr_variant(p));
613 return S_OK;
616 static inline HRESULT get_style_attr(HTMLStyle *This, styleid_t sid, BSTR *p)
618 return get_nsstyle_attr(This->nsstyle, sid, p, 0);
621 static HRESULT check_style_attr_value(HTMLStyle *This, styleid_t sid, LPCWSTR exval, VARIANT_BOOL *p)
623 nsAString str_value;
624 const PRUnichar *value;
626 nsAString_Init(&str_value, NULL);
628 get_nsstyle_attr_nsval(This->nsstyle, sid, &str_value);
630 nsAString_GetData(&str_value, &value);
631 *p = variant_bool(!strcmpW(value, exval));
632 nsAString_Finish(&str_value);
634 TRACE("%s -> %x\n", debugstr_w(style_tbl[sid].name), *p);
635 return S_OK;
638 static inline HRESULT set_style_pos(HTMLStyle *This, styleid_t sid, float value)
640 WCHAR szValue[25];
641 WCHAR szFormat[] = {'%','.','0','f','p','x',0};
643 value = floor(value);
645 sprintfW(szValue, szFormat, value);
647 return set_style_attr(This, sid, szValue, 0);
650 static HRESULT set_style_pxattr(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, LONG value)
652 WCHAR value_str[16];
654 sprintfW(value_str, px_formatW, value);
656 return set_nsstyle_attr(nsstyle, sid, value_str, 0);
659 static HRESULT get_nsstyle_pos(HTMLStyle *This, styleid_t sid, float *p)
661 nsAString str_value;
662 HRESULT hres;
664 TRACE("%p %d %p\n", This, sid, p);
666 *p = 0.0f;
668 nsAString_Init(&str_value, NULL);
670 hres = get_nsstyle_attr_nsval(This->nsstyle, sid, &str_value);
671 if(hres == S_OK)
673 WCHAR *ptr;
674 const PRUnichar *value;
676 nsAString_GetData(&str_value, &value);
677 if(value)
679 *p = strtolW(value, &ptr, 10);
681 if(*ptr && strcmpW(ptr, pxW))
683 nsAString_Finish(&str_value);
684 FIXME("only px values are currently supported\n");
685 hres = E_FAIL;
690 TRACE("ret %f\n", *p);
692 nsAString_Finish(&str_value);
693 return hres;
696 static HRESULT get_nsstyle_pixel_val(HTMLStyle *This, styleid_t sid, LONG *p)
698 nsAString str_value;
699 HRESULT hres;
701 if(!p)
702 return E_POINTER;
704 nsAString_Init(&str_value, NULL);
706 hres = get_nsstyle_attr_nsval(This->nsstyle, sid, &str_value);
707 if(hres == S_OK) {
708 WCHAR *ptr = NULL;
709 const PRUnichar *value;
711 nsAString_GetData(&str_value, &value);
712 if(value) {
713 *p = strtolW(value, &ptr, 10);
715 if(*ptr == '.') {
716 /* Skip all digits. We have tests showing that we should not round the value. */
717 while(isdigitW(*++ptr));
721 if(!ptr || (*ptr && strcmpW(ptr, pxW)))
722 *p = 0;
725 nsAString_Finish(&str_value);
726 return hres;
729 static BOOL is_valid_border_style(BSTR v)
731 static const WCHAR styleDotted[] = {'d','o','t','t','e','d',0};
732 static const WCHAR styleDashed[] = {'d','a','s','h','e','d',0};
733 static const WCHAR styleSolid[] = {'s','o','l','i','d',0};
734 static const WCHAR styleDouble[] = {'d','o','u','b','l','e',0};
735 static const WCHAR styleGroove[] = {'g','r','o','o','v','e',0};
736 static const WCHAR styleRidge[] = {'r','i','d','g','e',0};
737 static const WCHAR styleInset[] = {'i','n','s','e','t',0};
738 static const WCHAR styleOutset[] = {'o','u','t','s','e','t',0};
740 TRACE("%s\n", debugstr_w(v));
742 if(!v || strcmpiW(v, styleNone) == 0 || strcmpiW(v, styleDotted) == 0 ||
743 strcmpiW(v, styleDashed) == 0 || strcmpiW(v, styleSolid) == 0 ||
744 strcmpiW(v, styleDouble) == 0 || strcmpiW(v, styleGroove) == 0 ||
745 strcmpiW(v, styleRidge) == 0 || strcmpiW(v, styleInset) == 0 ||
746 strcmpiW(v, styleOutset) == 0 )
748 return TRUE;
751 return FALSE;
754 static inline HTMLStyle *impl_from_IHTMLStyle(IHTMLStyle *iface)
756 return CONTAINING_RECORD(iface, HTMLStyle, IHTMLStyle_iface);
759 static HRESULT WINAPI HTMLStyle_QueryInterface(IHTMLStyle *iface, REFIID riid, void **ppv)
761 HTMLStyle *This = impl_from_IHTMLStyle(iface);
763 TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
765 if(IsEqualGUID(&IID_IUnknown, riid)) {
766 *ppv = &This->IHTMLStyle_iface;
767 }else if(IsEqualGUID(&IID_IHTMLStyle, riid)) {
768 *ppv = &This->IHTMLStyle_iface;
769 }else if(IsEqualGUID(&IID_IHTMLStyle2, riid)) {
770 *ppv = &This->IHTMLStyle2_iface;
771 }else if(IsEqualGUID(&IID_IHTMLStyle3, riid)) {
772 *ppv = &This->IHTMLStyle3_iface;
773 }else if(IsEqualGUID(&IID_IHTMLStyle4, riid)) {
774 *ppv = &This->IHTMLStyle4_iface;
775 }else if(IsEqualGUID(&IID_IHTMLStyle5, riid)) {
776 *ppv = &This->IHTMLStyle5_iface;
777 }else if(IsEqualGUID(&IID_IHTMLStyle6, riid)) {
778 *ppv = &This->IHTMLStyle6_iface;
779 }else if(dispex_query_interface(&This->dispex, riid, ppv)) {
780 return *ppv ? S_OK : E_NOINTERFACE;
781 }else {
782 *ppv = NULL;
783 WARN("unsupported iface %s\n", debugstr_mshtml_guid(riid));
784 return E_NOINTERFACE;
787 IUnknown_AddRef((IUnknown*)*ppv);
788 return S_OK;
791 static ULONG WINAPI HTMLStyle_AddRef(IHTMLStyle *iface)
793 HTMLStyle *This = impl_from_IHTMLStyle(iface);
794 LONG ref = InterlockedIncrement(&This->ref);
796 TRACE("(%p) ref=%d\n", This, ref);
798 return ref;
801 static ULONG WINAPI HTMLStyle_Release(IHTMLStyle *iface)
803 HTMLStyle *This = impl_from_IHTMLStyle(iface);
804 LONG ref = InterlockedDecrement(&This->ref);
806 TRACE("(%p) ref=%d\n", This, ref);
808 if(!ref) {
809 assert(!This->elem);
810 if(This->nsstyle)
811 nsIDOMCSSStyleDeclaration_Release(This->nsstyle);
812 release_dispex(&This->dispex);
813 heap_free(This);
816 return ref;
819 static HRESULT WINAPI HTMLStyle_GetTypeInfoCount(IHTMLStyle *iface, UINT *pctinfo)
821 HTMLStyle *This = impl_from_IHTMLStyle(iface);
822 return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
825 static HRESULT WINAPI HTMLStyle_GetTypeInfo(IHTMLStyle *iface, UINT iTInfo,
826 LCID lcid, ITypeInfo **ppTInfo)
828 HTMLStyle *This = impl_from_IHTMLStyle(iface);
829 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
832 static HRESULT WINAPI HTMLStyle_GetIDsOfNames(IHTMLStyle *iface, REFIID riid,
833 LPOLESTR *rgszNames, UINT cNames,
834 LCID lcid, DISPID *rgDispId)
836 HTMLStyle *This = impl_from_IHTMLStyle(iface);
837 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
838 lcid, rgDispId);
841 static HRESULT WINAPI HTMLStyle_Invoke(IHTMLStyle *iface, DISPID dispIdMember,
842 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
843 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
845 HTMLStyle *This = impl_from_IHTMLStyle(iface);
846 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
847 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
850 static HRESULT WINAPI HTMLStyle_put_fontFamily(IHTMLStyle *iface, BSTR v)
852 HTMLStyle *This = impl_from_IHTMLStyle(iface);
854 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
856 return set_style_attr(This, STYLEID_FONT_FAMILY, v, 0);
859 static HRESULT WINAPI HTMLStyle_get_fontFamily(IHTMLStyle *iface, BSTR *p)
861 HTMLStyle *This = impl_from_IHTMLStyle(iface);
863 TRACE("(%p)->(%p)\n", This, p);
865 return get_style_attr(This, STYLEID_FONT_FAMILY, p);
868 static HRESULT WINAPI HTMLStyle_put_fontStyle(IHTMLStyle *iface, BSTR v)
870 HTMLStyle *This = impl_from_IHTMLStyle(iface);
871 static const WCHAR szItalic[] = {'i','t','a','l','i','c',0};
872 static const WCHAR szOblique[] = {'o','b','l','i','q','u','e',0};
874 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
876 /* fontStyle can only be one of the follow values. */
877 if(!v || strcmpiW(szNormal, v) == 0 || strcmpiW(szItalic, v) == 0 ||
878 strcmpiW(szOblique, v) == 0)
880 return set_nsstyle_attr(This->nsstyle, STYLEID_FONT_STYLE, v, 0);
883 return E_INVALIDARG;
886 static HRESULT WINAPI HTMLStyle_get_fontStyle(IHTMLStyle *iface, BSTR *p)
888 HTMLStyle *This = impl_from_IHTMLStyle(iface);
890 TRACE("(%p)->(%p)\n", This, p);
892 return get_style_attr(This, STYLEID_FONT_STYLE, p);
895 static HRESULT WINAPI HTMLStyle_put_fontVariant(IHTMLStyle *iface, BSTR v)
897 HTMLStyle *This = impl_from_IHTMLStyle(iface);
898 static const WCHAR szCaps[] = {'s','m','a','l','l','-','c','a','p','s',0};
900 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
902 /* fontVariant can only be one of the follow values. */
903 if(!v || strcmpiW(szNormal, v) == 0 || strcmpiW(szCaps, v) == 0)
905 return set_nsstyle_attr(This->nsstyle, STYLEID_FONT_VARIANT, v, 0);
908 return E_INVALIDARG;
911 static HRESULT WINAPI HTMLStyle_get_fontVariant(IHTMLStyle *iface, BSTR *p)
913 HTMLStyle *This = impl_from_IHTMLStyle(iface);
914 TRACE("(%p)->(%p)\n", This, p);
916 if(!p)
917 return E_INVALIDARG;
919 return get_style_attr(This, STYLEID_FONT_VARIANT, p);
922 static HRESULT WINAPI HTMLStyle_put_fontWeight(IHTMLStyle *iface, BSTR v)
924 HTMLStyle *This = impl_from_IHTMLStyle(iface);
925 static const WCHAR styleBold[] = {'b','o','l','d',0};
926 static const WCHAR styleBolder[] = {'b','o','l','d','e','r',0};
927 static const WCHAR styleLighter[] = {'l','i','g','h','t','e','r',0};
928 static const WCHAR style100[] = {'1','0','0',0};
929 static const WCHAR style200[] = {'2','0','0',0};
930 static const WCHAR style300[] = {'3','0','0',0};
931 static const WCHAR style400[] = {'4','0','0',0};
932 static const WCHAR style500[] = {'5','0','0',0};
933 static const WCHAR style600[] = {'6','0','0',0};
934 static const WCHAR style700[] = {'7','0','0',0};
935 static const WCHAR style800[] = {'8','0','0',0};
936 static const WCHAR style900[] = {'9','0','0',0};
938 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
940 /* fontWeight can only be one of the following */
941 if(v && *v && strcmpiW(szNormal, v) && strcmpiW(styleBold, v) && strcmpiW(styleBolder, v)
942 && strcmpiW(styleLighter, v) && strcmpiW(style100, v) && strcmpiW(style200, v)
943 && strcmpiW(style300, v) && strcmpiW(style400, v) && strcmpiW(style500, v) && strcmpiW(style600, v)
944 && strcmpiW(style700, v) && strcmpiW(style800, v) && strcmpiW(style900, v))
945 return E_INVALIDARG;
947 return set_nsstyle_attr(This->nsstyle, STYLEID_FONT_WEIGHT, v, 0);
950 static HRESULT WINAPI HTMLStyle_get_fontWeight(IHTMLStyle *iface, BSTR *p)
952 HTMLStyle *This = impl_from_IHTMLStyle(iface);
954 TRACE("(%p)->(%p)\n", This, p);
956 return get_style_attr(This, STYLEID_FONT_WEIGHT, p);
959 static HRESULT WINAPI HTMLStyle_put_fontSize(IHTMLStyle *iface, VARIANT v)
961 HTMLStyle *This = impl_from_IHTMLStyle(iface);
963 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
965 return set_nsstyle_attr_var(This->nsstyle, STYLEID_FONT_SIZE, &v, ATTR_FIX_PX);
968 static HRESULT WINAPI HTMLStyle_get_fontSize(IHTMLStyle *iface, VARIANT *p)
970 HTMLStyle *This = impl_from_IHTMLStyle(iface);
972 TRACE("(%p)->(%p)\n", This, p);
974 return get_nsstyle_attr_var(This->nsstyle, STYLEID_FONT_SIZE, p, 0);
977 static HRESULT WINAPI HTMLStyle_put_font(IHTMLStyle *iface, BSTR v)
979 HTMLStyle *This = impl_from_IHTMLStyle(iface);
980 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
981 return E_NOTIMPL;
984 static HRESULT WINAPI HTMLStyle_get_font(IHTMLStyle *iface, BSTR *p)
986 HTMLStyle *This = impl_from_IHTMLStyle(iface);
987 FIXME("(%p)->(%p)\n", This, p);
988 return E_NOTIMPL;
991 static HRESULT WINAPI HTMLStyle_put_color(IHTMLStyle *iface, VARIANT v)
993 HTMLStyle *This = impl_from_IHTMLStyle(iface);
995 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
997 return set_nsstyle_attr_var(This->nsstyle, STYLEID_COLOR, &v, ATTR_HEX_INT);
1000 static HRESULT WINAPI HTMLStyle_get_color(IHTMLStyle *iface, VARIANT *p)
1002 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1004 TRACE("(%p)->(%p)\n", This, p);
1006 return get_nsstyle_attr_var(This->nsstyle, STYLEID_COLOR, p, 0);
1009 static HRESULT WINAPI HTMLStyle_put_background(IHTMLStyle *iface, BSTR v)
1011 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1013 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1015 return set_style_attr(This, STYLEID_BACKGROUND, v, 0);
1018 static HRESULT WINAPI HTMLStyle_get_background(IHTMLStyle *iface, BSTR *p)
1020 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1022 TRACE("(%p)->(%p)\n", This, p);
1024 return get_style_attr(This, STYLEID_BACKGROUND, p);
1027 static HRESULT WINAPI HTMLStyle_put_backgroundColor(IHTMLStyle *iface, VARIANT v)
1029 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1031 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1033 return set_nsstyle_attr_var(This->nsstyle, STYLEID_BACKGROUND_COLOR, &v, ATTR_HEX_INT);
1036 static HRESULT WINAPI HTMLStyle_get_backgroundColor(IHTMLStyle *iface, VARIANT *p)
1038 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1040 TRACE("(%p)->(%p)\n", This, p);
1042 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BACKGROUND_COLOR, p, 0);
1045 static HRESULT WINAPI HTMLStyle_put_backgroundImage(IHTMLStyle *iface, BSTR v)
1047 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1049 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1051 return set_style_attr(This, STYLEID_BACKGROUND_IMAGE, v, ATTR_FIX_URL);
1054 static HRESULT WINAPI HTMLStyle_get_backgroundImage(IHTMLStyle *iface, BSTR *p)
1056 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1058 TRACE("(%p)->(%p)\n", This, p);
1060 return get_style_attr(This, STYLEID_BACKGROUND_IMAGE, p);
1063 static HRESULT WINAPI HTMLStyle_put_backgroundRepeat(IHTMLStyle *iface, BSTR v)
1065 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1066 static const WCHAR styleRepeat[] = {'r','e','p','e','a','t',0};
1067 static const WCHAR styleNoRepeat[] = {'n','o','-','r','e','p','e','a','t',0};
1068 static const WCHAR styleRepeatX[] = {'r','e','p','e','a','t','-','x',0};
1069 static const WCHAR styleRepeatY[] = {'r','e','p','e','a','t','-','y',0};
1071 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1073 /* fontWeight can only be one of the following */
1074 if(!v || strcmpiW(styleRepeat, v) == 0 || strcmpiW(styleNoRepeat, v) == 0 ||
1075 strcmpiW(styleRepeatX, v) == 0 || strcmpiW(styleRepeatY, v) == 0 )
1077 return set_style_attr(This, STYLEID_BACKGROUND_REPEAT , v, 0);
1080 return E_INVALIDARG;
1083 static HRESULT WINAPI HTMLStyle_get_backgroundRepeat(IHTMLStyle *iface, BSTR *p)
1085 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1087 TRACE("(%p)->(%p)\n", This, p);
1089 return get_style_attr(This, STYLEID_BACKGROUND_REPEAT, p);
1092 static HRESULT WINAPI HTMLStyle_put_backgroundAttachment(IHTMLStyle *iface, BSTR v)
1094 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1096 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1098 return set_style_attr(This, STYLEID_BACKGROUND_ATTACHMENT, v, 0);
1101 static HRESULT WINAPI HTMLStyle_get_backgroundAttachment(IHTMLStyle *iface, BSTR *p)
1103 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1105 TRACE("(%p)->(%p)\n", This, p);
1107 return get_style_attr(This, STYLEID_BACKGROUND_ATTACHMENT, p);
1110 static HRESULT WINAPI HTMLStyle_put_backgroundPosition(IHTMLStyle *iface, BSTR v)
1112 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1114 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1116 return set_style_attr(This, STYLEID_BACKGROUND_POSITION, v, 0);
1119 static HRESULT WINAPI HTMLStyle_get_backgroundPosition(IHTMLStyle *iface, BSTR *p)
1121 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1123 TRACE("(%p)->(%p)\n", This, p);
1125 return get_style_attr(This, STYLEID_BACKGROUND_POSITION, p);
1128 static HRESULT WINAPI HTMLStyle_put_backgroundPositionX(IHTMLStyle *iface, VARIANT v)
1130 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1131 WCHAR buf[14], *pos_val;
1132 nsAString pos_str;
1133 const WCHAR *val;
1134 DWORD val_len;
1135 HRESULT hres;
1137 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1139 hres = var_to_styleval(&v, buf, ATTR_FIX_PX, &val);
1140 if(FAILED(hres))
1141 return hres;
1143 val_len = val ? strlenW(val) : 0;
1145 nsAString_Init(&pos_str, NULL);
1146 hres = get_nsstyle_attr_nsval(This->nsstyle, STYLEID_BACKGROUND_POSITION, &pos_str);
1147 if(SUCCEEDED(hres)) {
1148 const PRUnichar *pos, *posy;
1149 DWORD posy_len;
1151 nsAString_GetData(&pos_str, &pos);
1152 posy = strchrW(pos, ' ');
1153 if(!posy) {
1154 static const WCHAR zero_pxW[] = {' ','0','p','x',0};
1156 TRACE("no space in %s\n", debugstr_w(pos));
1157 posy = zero_pxW;
1160 posy_len = strlenW(posy);
1161 pos_val = heap_alloc((val_len+posy_len+1)*sizeof(WCHAR));
1162 if(pos_val) {
1163 if(val_len)
1164 memcpy(pos_val, val, val_len*sizeof(WCHAR));
1165 if(posy_len)
1166 memcpy(pos_val+val_len, posy, posy_len*sizeof(WCHAR));
1167 pos_val[val_len+posy_len] = 0;
1168 }else {
1169 hres = E_OUTOFMEMORY;
1172 nsAString_Finish(&pos_str);
1173 if(FAILED(hres))
1174 return hres;
1176 TRACE("setting position to %s\n", debugstr_w(pos_val));
1177 hres = set_nsstyle_attr(This->nsstyle, STYLEID_BACKGROUND_POSITION, pos_val, ATTR_FIX_PX);
1178 heap_free(pos_val);
1179 return hres;
1182 static HRESULT WINAPI HTMLStyle_get_backgroundPositionX(IHTMLStyle *iface, VARIANT *p)
1184 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1185 nsAString pos_str;
1186 BSTR ret;
1187 HRESULT hres;
1189 TRACE("(%p)->(%p)\n", This, p);
1191 nsAString_Init(&pos_str, NULL);
1192 hres = get_nsstyle_attr_nsval(This->nsstyle, STYLEID_BACKGROUND_POSITION, &pos_str);
1193 if(SUCCEEDED(hres)) {
1194 const PRUnichar *pos, *space;
1196 nsAString_GetData(&pos_str, &pos);
1197 space = strchrW(pos, ' ');
1198 if(!space) {
1199 WARN("no space in %s\n", debugstr_w(pos));
1200 space = pos + strlenW(pos);
1203 if(space != pos) {
1204 ret = SysAllocStringLen(pos, space-pos);
1205 if(!ret)
1206 hres = E_OUTOFMEMORY;
1207 }else {
1208 ret = NULL;
1211 nsAString_Finish(&pos_str);
1212 if(FAILED(hres))
1213 return hres;
1215 TRACE("returning %s\n", debugstr_w(ret));
1216 V_VT(p) = VT_BSTR;
1217 V_BSTR(p) = ret;
1218 return S_OK;
1221 static HRESULT WINAPI HTMLStyle_put_backgroundPositionY(IHTMLStyle *iface, VARIANT v)
1223 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1224 WCHAR buf[14], *pos_val;
1225 nsAString pos_str;
1226 const WCHAR *val;
1227 DWORD val_len;
1228 HRESULT hres;
1230 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1232 hres = var_to_styleval(&v, buf, ATTR_FIX_PX, &val);
1233 if(FAILED(hres))
1234 return hres;
1236 val_len = val ? strlenW(val) : 0;
1238 nsAString_Init(&pos_str, NULL);
1239 hres = get_nsstyle_attr_nsval(This->nsstyle, STYLEID_BACKGROUND_POSITION, &pos_str);
1240 if(SUCCEEDED(hres)) {
1241 const PRUnichar *pos, *space;
1242 DWORD posx_len;
1244 nsAString_GetData(&pos_str, &pos);
1245 space = strchrW(pos, ' ');
1246 if(space) {
1247 space++;
1248 }else {
1249 static const WCHAR zero_pxW[] = {'0','p','x',' ',0};
1251 TRACE("no space in %s\n", debugstr_w(pos));
1252 pos = zero_pxW;
1253 space = pos + sizeof(zero_pxW)/sizeof(WCHAR)-1;
1256 posx_len = space-pos;
1258 pos_val = heap_alloc((posx_len+val_len+1)*sizeof(WCHAR));
1259 if(pos_val) {
1260 memcpy(pos_val, pos, posx_len*sizeof(WCHAR));
1261 if(val_len)
1262 memcpy(pos_val+posx_len, val, val_len*sizeof(WCHAR));
1263 pos_val[posx_len+val_len] = 0;
1264 }else {
1265 hres = E_OUTOFMEMORY;
1268 nsAString_Finish(&pos_str);
1269 if(FAILED(hres))
1270 return hres;
1272 TRACE("setting position to %s\n", debugstr_w(pos_val));
1273 hres = set_nsstyle_attr(This->nsstyle, STYLEID_BACKGROUND_POSITION, pos_val, ATTR_FIX_PX);
1274 heap_free(pos_val);
1275 return hres;
1278 static HRESULT WINAPI HTMLStyle_get_backgroundPositionY(IHTMLStyle *iface, VARIANT *p)
1280 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1281 nsAString pos_str;
1282 BSTR ret;
1283 HRESULT hres;
1285 TRACE("(%p)->(%p)\n", This, p);
1287 nsAString_Init(&pos_str, NULL);
1288 hres = get_nsstyle_attr_nsval(This->nsstyle, STYLEID_BACKGROUND_POSITION, &pos_str);
1289 if(SUCCEEDED(hres)) {
1290 const PRUnichar *pos, *posy;
1292 nsAString_GetData(&pos_str, &pos);
1293 posy = strchrW(pos, ' ');
1294 if(posy) {
1295 ret = SysAllocString(posy+1);
1296 if(!ret)
1297 hres = E_OUTOFMEMORY;
1298 }else {
1299 ret = NULL;
1302 nsAString_Finish(&pos_str);
1303 if(FAILED(hres))
1304 return hres;
1306 TRACE("returning %s\n", debugstr_w(ret));
1307 V_VT(p) = VT_BSTR;
1308 V_BSTR(p) = ret;
1309 return S_OK;
1312 static HRESULT WINAPI HTMLStyle_put_wordSpacing(IHTMLStyle *iface, VARIANT v)
1314 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1316 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1318 return set_nsstyle_attr_var(This->nsstyle, STYLEID_WORD_SPACING, &v, 0);
1321 static HRESULT WINAPI HTMLStyle_get_wordSpacing(IHTMLStyle *iface, VARIANT *p)
1323 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1324 TRACE("(%p)->(%p)\n", This, p);
1325 return get_nsstyle_attr_var(This->nsstyle, STYLEID_WORD_SPACING, p, 0);
1328 static HRESULT WINAPI HTMLStyle_put_letterSpacing(IHTMLStyle *iface, VARIANT v)
1330 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1332 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1334 return set_nsstyle_attr_var(This->nsstyle, STYLEID_LETTER_SPACING, &v, 0);
1337 static HRESULT WINAPI HTMLStyle_get_letterSpacing(IHTMLStyle *iface, VARIANT *p)
1339 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1340 TRACE("(%p)->(%p)\n", This, p);
1341 return get_nsstyle_attr_var(This->nsstyle, STYLEID_LETTER_SPACING, p, 0);
1344 static HRESULT WINAPI HTMLStyle_put_textDecoration(IHTMLStyle *iface, BSTR v)
1346 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1348 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1350 /* textDecoration can only be one of the following */
1351 if(!v || strcmpiW(styleNone, v) == 0 || strcmpiW(valUnderline, v) == 0 ||
1352 strcmpiW(valOverline, v) == 0 || strcmpiW(valLineThrough, v) == 0 ||
1353 strcmpiW(valBlink, v) == 0)
1355 return set_style_attr(This, STYLEID_TEXT_DECORATION , v, 0);
1358 return E_INVALIDARG;
1361 static HRESULT WINAPI HTMLStyle_get_textDecoration(IHTMLStyle *iface, BSTR *p)
1363 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1365 TRACE("(%p)->(%p)\n", This, p);
1367 return get_style_attr(This, STYLEID_TEXT_DECORATION, p);
1370 static HRESULT WINAPI HTMLStyle_put_textDecorationNone(IHTMLStyle *iface, VARIANT_BOOL v)
1372 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1374 TRACE("(%p)->(%x)\n", This, v);
1376 return set_style_attr(This, STYLEID_TEXT_DECORATION, v ? styleNone : emptyW, 0);
1379 static HRESULT WINAPI HTMLStyle_get_textDecorationNone(IHTMLStyle *iface, VARIANT_BOOL *p)
1381 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1383 TRACE("(%p)->(%p)\n", This, p);
1385 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, styleNone, p);
1388 static HRESULT WINAPI HTMLStyle_put_textDecorationUnderline(IHTMLStyle *iface, VARIANT_BOOL v)
1390 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1392 TRACE("(%p)->(%x)\n", This, v);
1394 return set_style_attr(This, STYLEID_TEXT_DECORATION, v ? valUnderline : emptyW, 0);
1397 static HRESULT WINAPI HTMLStyle_get_textDecorationUnderline(IHTMLStyle *iface, VARIANT_BOOL *p)
1399 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1401 TRACE("(%p)->(%p)\n", This, p);
1403 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, valUnderline, p);
1406 static HRESULT WINAPI HTMLStyle_put_textDecorationOverline(IHTMLStyle *iface, VARIANT_BOOL v)
1408 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1410 TRACE("(%p)->(%x)\n", This, v);
1412 return set_style_attr(This, STYLEID_TEXT_DECORATION, v ? valOverline : emptyW, 0);
1415 static HRESULT WINAPI HTMLStyle_get_textDecorationOverline(IHTMLStyle *iface, VARIANT_BOOL *p)
1417 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1419 TRACE("(%p)->(%p)\n", This, p);
1421 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, valOverline, p);
1424 static HRESULT WINAPI HTMLStyle_put_textDecorationLineThrough(IHTMLStyle *iface, VARIANT_BOOL v)
1426 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1428 TRACE("(%p)->(%x)\n", This, v);
1430 return set_style_attr(This, STYLEID_TEXT_DECORATION, v ? valLineThrough : emptyW, 0);
1433 static HRESULT WINAPI HTMLStyle_get_textDecorationLineThrough(IHTMLStyle *iface, VARIANT_BOOL *p)
1435 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1437 TRACE("(%p)->(%p)\n", This, p);
1439 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, valLineThrough, p);
1442 static HRESULT WINAPI HTMLStyle_put_textDecorationBlink(IHTMLStyle *iface, VARIANT_BOOL v)
1444 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1446 TRACE("(%p)->(%x)\n", This, v);
1448 return set_style_attr(This, STYLEID_TEXT_DECORATION, v ? valBlink : emptyW, 0);
1451 static HRESULT WINAPI HTMLStyle_get_textDecorationBlink(IHTMLStyle *iface, VARIANT_BOOL *p)
1453 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1455 TRACE("(%p)->(%p)\n", This, p);
1457 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, valBlink, p);
1460 static HRESULT WINAPI HTMLStyle_put_verticalAlign(IHTMLStyle *iface, VARIANT v)
1462 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1464 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1466 return set_nsstyle_attr_var(This->nsstyle, STYLEID_VERTICAL_ALIGN, &v, ATTR_FIX_PX);
1469 static HRESULT WINAPI HTMLStyle_get_verticalAlign(IHTMLStyle *iface, VARIANT *p)
1471 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1473 TRACE("(%p)->(%p)\n", This, p);
1475 return get_nsstyle_attr_var(This->nsstyle, STYLEID_VERTICAL_ALIGN, p, 0);
1478 static HRESULT WINAPI HTMLStyle_put_textTransform(IHTMLStyle *iface, BSTR v)
1480 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1482 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1484 return set_style_attr(This, STYLEID_TEXT_TRANSFORM, v, 0);
1487 static HRESULT WINAPI HTMLStyle_get_textTransform(IHTMLStyle *iface, BSTR *p)
1489 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1491 TRACE("(%p)->(%p)\n", This, p);
1493 return get_style_attr(This, STYLEID_TEXT_TRANSFORM, p);
1496 static HRESULT WINAPI HTMLStyle_put_textAlign(IHTMLStyle *iface, BSTR v)
1498 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1500 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1502 return set_style_attr(This, STYLEID_TEXT_ALIGN, v, 0);
1505 static HRESULT WINAPI HTMLStyle_get_textAlign(IHTMLStyle *iface, BSTR *p)
1507 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1509 TRACE("(%p)->(%p)\n", This, p);
1511 return get_style_attr(This, STYLEID_TEXT_ALIGN, p);
1514 static HRESULT WINAPI HTMLStyle_put_textIndent(IHTMLStyle *iface, VARIANT v)
1516 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1518 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1520 return set_nsstyle_attr_var(This->nsstyle, STYLEID_TEXT_INDENT, &v, ATTR_FIX_PX);
1523 static HRESULT WINAPI HTMLStyle_get_textIndent(IHTMLStyle *iface, VARIANT *p)
1525 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1527 TRACE("(%p)->(%p)\n", This, p);
1529 return get_nsstyle_attr_var(This->nsstyle, STYLEID_TEXT_INDENT, p, 0);
1532 static HRESULT WINAPI HTMLStyle_put_lineHeight(IHTMLStyle *iface, VARIANT v)
1534 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1536 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1538 return set_nsstyle_attr_var(This->nsstyle, STYLEID_LINE_HEIGHT, &v, 0);
1541 static HRESULT WINAPI HTMLStyle_get_lineHeight(IHTMLStyle *iface, VARIANT *p)
1543 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1545 TRACE("(%p)->(%p)\n", This, p);
1547 return get_nsstyle_attr_var(This->nsstyle, STYLEID_LINE_HEIGHT, p, 0);
1550 static HRESULT WINAPI HTMLStyle_put_marginTop(IHTMLStyle *iface, VARIANT v)
1552 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1554 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1556 return set_nsstyle_attr_var(This->nsstyle, STYLEID_MARGIN_TOP, &v, ATTR_FIX_PX);
1559 static HRESULT WINAPI HTMLStyle_get_marginTop(IHTMLStyle *iface, VARIANT *p)
1561 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1563 TRACE("(%p)->(%p)\n", This, p);
1565 return get_nsstyle_attr_var(This->nsstyle, STYLEID_MARGIN_TOP, p, 0);
1568 static HRESULT WINAPI HTMLStyle_put_marginRight(IHTMLStyle *iface, VARIANT v)
1570 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1572 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1574 return set_nsstyle_attr_var(This->nsstyle, STYLEID_MARGIN_RIGHT, &v, ATTR_FIX_PX);
1577 static HRESULT WINAPI HTMLStyle_get_marginRight(IHTMLStyle *iface, VARIANT *p)
1579 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1580 TRACE("(%p)->(%p)\n", This, p);
1581 return get_nsstyle_attr_var(This->nsstyle, STYLEID_MARGIN_RIGHT, p, 0);
1584 static HRESULT WINAPI HTMLStyle_put_marginBottom(IHTMLStyle *iface, VARIANT v)
1586 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1588 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1590 return set_nsstyle_attr_var(This->nsstyle, STYLEID_MARGIN_BOTTOM, &v, ATTR_FIX_PX);
1593 static HRESULT WINAPI HTMLStyle_get_marginBottom(IHTMLStyle *iface, VARIANT *p)
1595 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1597 TRACE("(%p)->(%p)\n", This, p);
1599 return get_nsstyle_attr_var(This->nsstyle, STYLEID_MARGIN_BOTTOM, p, 0);
1602 static HRESULT WINAPI HTMLStyle_put_marginLeft(IHTMLStyle *iface, VARIANT v)
1604 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1606 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1608 return set_nsstyle_attr_var(This->nsstyle, STYLEID_MARGIN_LEFT, &v, ATTR_FIX_PX);
1611 static HRESULT WINAPI HTMLStyle_put_margin(IHTMLStyle *iface, BSTR v)
1613 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1615 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1617 return set_style_attr(This, STYLEID_MARGIN, v, 0);
1620 static HRESULT WINAPI HTMLStyle_get_margin(IHTMLStyle *iface, BSTR *p)
1622 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1624 TRACE("(%p)->(%p)\n", This, p);
1626 return get_style_attr(This, STYLEID_MARGIN, p);
1629 static HRESULT WINAPI HTMLStyle_get_marginLeft(IHTMLStyle *iface, VARIANT *p)
1631 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1632 TRACE("(%p)->(%p)\n", This, p);
1633 return get_nsstyle_attr_var(This->nsstyle, STYLEID_MARGIN_LEFT, p, 0);
1636 static HRESULT WINAPI HTMLStyle_put_paddingTop(IHTMLStyle *iface, VARIANT v)
1638 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1640 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1642 return set_nsstyle_attr_var(This->nsstyle, STYLEID_PADDING_TOP, &v, ATTR_FIX_PX);
1645 static HRESULT WINAPI HTMLStyle_get_paddingTop(IHTMLStyle *iface, VARIANT *p)
1647 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1649 TRACE("(%p)->(%p)\n", This, p);
1651 return get_nsstyle_attr_var(This->nsstyle, STYLEID_PADDING_TOP, p, 0);
1654 static HRESULT WINAPI HTMLStyle_put_paddingRight(IHTMLStyle *iface, VARIANT v)
1656 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1658 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1660 return set_nsstyle_attr_var(This->nsstyle, STYLEID_PADDING_RIGHT, &v, ATTR_FIX_PX);
1663 static HRESULT WINAPI HTMLStyle_get_paddingRight(IHTMLStyle *iface, VARIANT *p)
1665 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1667 TRACE("(%p)->(%p)\n", This, p);
1669 return get_nsstyle_attr_var(This->nsstyle, STYLEID_PADDING_RIGHT, p, 0);
1672 static HRESULT WINAPI HTMLStyle_put_paddingBottom(IHTMLStyle *iface, VARIANT v)
1674 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1676 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1678 return set_nsstyle_attr_var(This->nsstyle, STYLEID_PADDING_BOTTOM, &v, ATTR_FIX_PX);
1681 static HRESULT WINAPI HTMLStyle_get_paddingBottom(IHTMLStyle *iface, VARIANT *p)
1683 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1685 TRACE("(%p)->(%p)\n", This, p);
1687 return get_nsstyle_attr_var(This->nsstyle, STYLEID_PADDING_BOTTOM, p, 0);
1690 static HRESULT WINAPI HTMLStyle_put_paddingLeft(IHTMLStyle *iface, VARIANT v)
1692 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1694 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1696 return set_nsstyle_attr_var(This->nsstyle, STYLEID_PADDING_LEFT, &v, ATTR_FIX_PX);
1699 static HRESULT WINAPI HTMLStyle_get_paddingLeft(IHTMLStyle *iface, VARIANT *p)
1701 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1703 TRACE("(%p)->(%p)\n", This, p);
1705 return get_nsstyle_attr_var(This->nsstyle, STYLEID_PADDING_LEFT, p, 0);
1708 static HRESULT WINAPI HTMLStyle_put_padding(IHTMLStyle *iface, BSTR v)
1710 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1712 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1714 return set_style_attr(This, STYLEID_PADDING, v, 0);
1717 static HRESULT WINAPI HTMLStyle_get_padding(IHTMLStyle *iface, BSTR *p)
1719 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1721 TRACE("(%p)->(%p)\n", This, p);
1723 return get_style_attr(This, STYLEID_PADDING, p);
1726 static HRESULT WINAPI HTMLStyle_put_border(IHTMLStyle *iface, BSTR v)
1728 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1730 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1732 return set_style_attr(This, STYLEID_BORDER, v, 0);
1735 static HRESULT WINAPI HTMLStyle_get_border(IHTMLStyle *iface, BSTR *p)
1737 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1739 TRACE("(%p)->(%p)\n", This, p);
1741 return get_style_attr(This, STYLEID_BORDER, p);
1744 static HRESULT WINAPI HTMLStyle_put_borderTop(IHTMLStyle *iface, BSTR v)
1746 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1747 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1748 return set_style_attr(This, STYLEID_BORDER_TOP, v, ATTR_FIX_PX);
1751 static HRESULT WINAPI HTMLStyle_get_borderTop(IHTMLStyle *iface, BSTR *p)
1753 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1754 TRACE("(%p)->(%p)\n", This, p);
1755 return get_style_attr(This, STYLEID_BORDER_TOP, p);
1758 static HRESULT WINAPI HTMLStyle_put_borderRight(IHTMLStyle *iface, BSTR v)
1760 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1761 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1762 return set_style_attr(This, STYLEID_BORDER_RIGHT, v, ATTR_FIX_PX);
1765 static HRESULT WINAPI HTMLStyle_get_borderRight(IHTMLStyle *iface, BSTR *p)
1767 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1768 TRACE("(%p)->(%p)\n", This, p);
1769 return get_style_attr(This, STYLEID_BORDER_RIGHT, p);
1772 static HRESULT WINAPI HTMLStyle_put_borderBottom(IHTMLStyle *iface, BSTR v)
1774 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1775 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1776 return set_style_attr(This, STYLEID_BORDER_BOTTOM, v, ATTR_FIX_PX);
1779 static HRESULT WINAPI HTMLStyle_get_borderBottom(IHTMLStyle *iface, BSTR *p)
1781 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1782 TRACE("(%p)->(%p)\n", This, p);
1783 return get_style_attr(This, STYLEID_BORDER_BOTTOM, p);
1786 static HRESULT WINAPI HTMLStyle_put_borderLeft(IHTMLStyle *iface, BSTR v)
1788 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1790 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1792 return set_style_attr(This, STYLEID_BORDER_LEFT, v, ATTR_FIX_PX);
1795 static HRESULT WINAPI HTMLStyle_get_borderLeft(IHTMLStyle *iface, BSTR *p)
1797 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1799 TRACE("(%p)->(%p)\n", This, p);
1801 return get_style_attr(This, STYLEID_BORDER_LEFT, p);
1804 static HRESULT WINAPI HTMLStyle_put_borderColor(IHTMLStyle *iface, BSTR v)
1806 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1808 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1810 return set_style_attr(This, STYLEID_BORDER_COLOR, v, 0);
1813 static HRESULT WINAPI HTMLStyle_get_borderColor(IHTMLStyle *iface, BSTR *p)
1815 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1817 TRACE("(%p)->(%p)\n", This, p);
1819 return get_style_attr(This, STYLEID_BORDER_COLOR, p);
1822 static HRESULT WINAPI HTMLStyle_put_borderTopColor(IHTMLStyle *iface, VARIANT v)
1824 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1826 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1828 return set_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_TOP_COLOR, &v, ATTR_HEX_INT);
1831 static HRESULT WINAPI HTMLStyle_get_borderTopColor(IHTMLStyle *iface, VARIANT *p)
1833 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1835 TRACE("(%p)->(%p)\n", This, p);
1837 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_TOP_COLOR, p, 0);
1840 static HRESULT WINAPI HTMLStyle_put_borderRightColor(IHTMLStyle *iface, VARIANT v)
1842 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1844 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1846 return set_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_RIGHT_COLOR, &v, ATTR_HEX_INT);
1849 static HRESULT WINAPI HTMLStyle_get_borderRightColor(IHTMLStyle *iface, VARIANT *p)
1851 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1853 TRACE("(%p)->(%p)\n", This, p);
1855 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_RIGHT_COLOR, p, 0);
1858 static HRESULT WINAPI HTMLStyle_put_borderBottomColor(IHTMLStyle *iface, VARIANT v)
1860 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1862 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1864 return set_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_BOTTOM_COLOR, &v, ATTR_HEX_INT);
1867 static HRESULT WINAPI HTMLStyle_get_borderBottomColor(IHTMLStyle *iface, VARIANT *p)
1869 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1871 TRACE("(%p)->(%p)\n", This, p);
1873 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_BOTTOM_COLOR, p, 0);
1876 static HRESULT WINAPI HTMLStyle_put_borderLeftColor(IHTMLStyle *iface, VARIANT v)
1878 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1880 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1882 return set_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_LEFT_COLOR, &v, ATTR_HEX_INT);
1885 static HRESULT WINAPI HTMLStyle_get_borderLeftColor(IHTMLStyle *iface, VARIANT *p)
1887 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1889 TRACE("(%p)->(%p)\n", This, p);
1891 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_LEFT_COLOR, p, 0);
1894 static HRESULT WINAPI HTMLStyle_put_borderWidth(IHTMLStyle *iface, BSTR v)
1896 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1897 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1898 return set_style_attr(This, STYLEID_BORDER_WIDTH, v, ATTR_FIX_PX);
1901 static HRESULT WINAPI HTMLStyle_get_borderWidth(IHTMLStyle *iface, BSTR *p)
1903 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1904 TRACE("(%p)->(%p)\n", This, p);
1905 return get_style_attr(This, STYLEID_BORDER_WIDTH, p);
1908 static HRESULT WINAPI HTMLStyle_put_borderTopWidth(IHTMLStyle *iface, VARIANT v)
1910 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1912 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1914 return set_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_TOP_WIDTH, &v, 0);
1917 static HRESULT WINAPI HTMLStyle_get_borderTopWidth(IHTMLStyle *iface, VARIANT *p)
1919 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1921 TRACE("(%p)->(%p)\n", This, p);
1923 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_TOP_WIDTH, p, 0);
1926 static HRESULT WINAPI HTMLStyle_put_borderRightWidth(IHTMLStyle *iface, VARIANT v)
1928 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1930 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1932 return set_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_RIGHT_WIDTH, &v, 0);
1935 static HRESULT WINAPI HTMLStyle_get_borderRightWidth(IHTMLStyle *iface, VARIANT *p)
1937 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1939 TRACE("(%p)->(%p)\n", This, p);
1941 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_RIGHT_WIDTH, p, 0);
1944 static HRESULT WINAPI HTMLStyle_put_borderBottomWidth(IHTMLStyle *iface, VARIANT v)
1946 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1948 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1950 return set_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_BOTTOM_WIDTH, &v, 0);
1953 static HRESULT WINAPI HTMLStyle_get_borderBottomWidth(IHTMLStyle *iface, VARIANT *p)
1955 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1956 TRACE("(%p)->(%p)\n", This, p);
1957 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_BOTTOM_WIDTH, p, 0);
1960 static HRESULT WINAPI HTMLStyle_put_borderLeftWidth(IHTMLStyle *iface, VARIANT v)
1962 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1964 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1966 return set_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_LEFT_WIDTH, &v, 0);
1969 static HRESULT WINAPI HTMLStyle_get_borderLeftWidth(IHTMLStyle *iface, VARIANT *p)
1971 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1972 TRACE("(%p)->(%p)\n", This, p);
1973 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_LEFT_WIDTH, p, 0);
1976 static HRESULT WINAPI HTMLStyle_put_borderStyle(IHTMLStyle *iface, BSTR v)
1978 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1979 static const WCHAR styleWindowInset[] = {'w','i','n','d','o','w','-','i','n','s','e','t',0};
1980 HRESULT hres = S_OK;
1981 BSTR pstyle;
1982 int i=0;
1983 int last = 0;
1985 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1987 while(v[i] && hres == S_OK)
1989 if(v[i] == (WCHAR)' ')
1991 pstyle = SysAllocStringLen(&v[last], (i-last));
1992 if( !(is_valid_border_style(pstyle) || strcmpiW(styleWindowInset, pstyle) == 0))
1994 TRACE("1. Invalid style (%s)\n", debugstr_w(pstyle));
1995 hres = E_INVALIDARG;
1997 SysFreeString(pstyle);
1998 last = i+1;
2000 i++;
2003 if(hres == S_OK)
2005 pstyle = SysAllocStringLen(&v[last], i-last);
2006 if( !(is_valid_border_style(pstyle) || strcmpiW(styleWindowInset, pstyle) == 0))
2008 TRACE("2. Invalid style (%s)\n", debugstr_w(pstyle));
2009 hres = E_INVALIDARG;
2011 SysFreeString(pstyle);
2014 if(hres == S_OK)
2015 hres = set_nsstyle_attr(This->nsstyle, STYLEID_BORDER_STYLE, v, 0);
2017 return hres;
2020 static HRESULT WINAPI HTMLStyle_get_borderStyle(IHTMLStyle *iface, BSTR *p)
2022 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2023 TRACE("(%p)->(%p)\n", This, p);
2024 return get_style_attr(This, STYLEID_BORDER_STYLE, p);
2027 static HRESULT WINAPI HTMLStyle_put_borderTopStyle(IHTMLStyle *iface, BSTR v)
2029 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2030 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2032 if(!is_valid_border_style(v))
2033 return E_INVALIDARG;
2035 return set_style_attr(This, STYLEID_BORDER_TOP_STYLE, v, 0);
2038 static HRESULT WINAPI HTMLStyle_get_borderTopStyle(IHTMLStyle *iface, BSTR *p)
2040 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2041 TRACE("(%p)->(%p)\n", This, p);
2042 return get_style_attr(This, STYLEID_BORDER_TOP_STYLE, p);
2045 static HRESULT WINAPI HTMLStyle_put_borderRightStyle(IHTMLStyle *iface, BSTR v)
2047 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2048 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2050 if(!is_valid_border_style(v))
2051 return E_INVALIDARG;
2053 return set_style_attr(This, STYLEID_BORDER_RIGHT_STYLE, v, 0);
2056 static HRESULT WINAPI HTMLStyle_get_borderRightStyle(IHTMLStyle *iface, BSTR *p)
2058 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2059 TRACE("(%p)->(%p)\n", This, p);
2060 return get_style_attr(This, STYLEID_BORDER_RIGHT_STYLE, p);
2063 static HRESULT WINAPI HTMLStyle_put_borderBottomStyle(IHTMLStyle *iface, BSTR v)
2065 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2066 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2068 if(!is_valid_border_style(v))
2069 return E_INVALIDARG;
2071 return set_style_attr(This, STYLEID_BORDER_BOTTOM_STYLE, v, 0);
2074 static HRESULT WINAPI HTMLStyle_get_borderBottomStyle(IHTMLStyle *iface, BSTR *p)
2076 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2077 TRACE("(%p)->(%p)\n", This, p);
2078 return get_style_attr(This, STYLEID_BORDER_BOTTOM_STYLE, p);
2081 static HRESULT WINAPI HTMLStyle_put_borderLeftStyle(IHTMLStyle *iface, BSTR v)
2083 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2084 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2086 if(!is_valid_border_style(v))
2087 return E_INVALIDARG;
2089 return set_style_attr(This, STYLEID_BORDER_LEFT_STYLE, v, 0);
2092 static HRESULT WINAPI HTMLStyle_get_borderLeftStyle(IHTMLStyle *iface, BSTR *p)
2094 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2095 TRACE("(%p)->(%p)\n", This, p);
2096 return get_style_attr(This, STYLEID_BORDER_LEFT_STYLE, p);
2099 static HRESULT WINAPI HTMLStyle_put_width(IHTMLStyle *iface, VARIANT v)
2101 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2103 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
2105 return set_nsstyle_attr_var(This->nsstyle, STYLEID_WIDTH, &v, ATTR_FIX_PX);
2108 static HRESULT WINAPI HTMLStyle_get_width(IHTMLStyle *iface, VARIANT *p)
2110 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2112 TRACE("(%p)->(%p)\n", This, p);
2114 return get_nsstyle_attr_var(This->nsstyle, STYLEID_WIDTH, p, 0);
2117 static HRESULT WINAPI HTMLStyle_put_height(IHTMLStyle *iface, VARIANT v)
2119 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2121 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
2123 return set_nsstyle_attr_var(This->nsstyle, STYLEID_HEIGHT, &v, ATTR_FIX_PX);
2126 static HRESULT WINAPI HTMLStyle_get_height(IHTMLStyle *iface, VARIANT *p)
2128 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2130 TRACE("(%p)->(%p)\n", This, p);
2132 return get_nsstyle_attr_var(This->nsstyle, STYLEID_HEIGHT, p, 0);
2135 static HRESULT WINAPI HTMLStyle_put_styleFloat(IHTMLStyle *iface, BSTR v)
2137 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2139 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2141 return set_style_attr(This, STYLEID_FLOAT, v, 0);
2144 static HRESULT WINAPI HTMLStyle_get_styleFloat(IHTMLStyle *iface, BSTR *p)
2146 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2148 TRACE("(%p)->(%p)\n", This, p);
2150 return get_style_attr(This, STYLEID_FLOAT, p);
2153 static HRESULT WINAPI HTMLStyle_put_clear(IHTMLStyle *iface, BSTR v)
2155 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2157 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2159 return set_style_attr(This, STYLEID_CLEAR, v, 0);
2162 static HRESULT WINAPI HTMLStyle_get_clear(IHTMLStyle *iface, BSTR *p)
2164 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2166 TRACE("(%p)->(%p)\n", This, p);
2168 return get_style_attr(This, STYLEID_CLEAR, p);
2171 static HRESULT WINAPI HTMLStyle_put_display(IHTMLStyle *iface, BSTR v)
2173 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2175 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2177 return set_style_attr(This, STYLEID_DISPLAY, v, 0);
2180 static HRESULT WINAPI HTMLStyle_get_display(IHTMLStyle *iface, BSTR *p)
2182 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2184 TRACE("(%p)->(%p)\n", This, p);
2186 return get_style_attr(This, STYLEID_DISPLAY, p);
2189 static HRESULT WINAPI HTMLStyle_put_visibility(IHTMLStyle *iface, BSTR v)
2191 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2193 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2195 return set_style_attr(This, STYLEID_VISIBILITY, v, 0);
2198 static HRESULT WINAPI HTMLStyle_get_visibility(IHTMLStyle *iface, BSTR *p)
2200 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2202 TRACE("(%p)->(%p)\n", This, p);
2204 return get_style_attr(This, STYLEID_VISIBILITY, p);
2207 static HRESULT WINAPI HTMLStyle_put_listStyleType(IHTMLStyle *iface, BSTR v)
2209 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2211 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2213 return set_style_attr(This, STYLEID_LISTSTYLETYPE, v, 0);
2216 static HRESULT WINAPI HTMLStyle_get_listStyleType(IHTMLStyle *iface, BSTR *p)
2218 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2220 TRACE("(%p)->(%p)\n", This, p);
2222 return get_style_attr(This, STYLEID_LISTSTYLETYPE, p);
2225 static HRESULT WINAPI HTMLStyle_put_listStylePosition(IHTMLStyle *iface, BSTR v)
2227 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2229 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2231 return set_style_attr(This, STYLEID_LISTSTYLEPOSITION, v, 0);
2234 static HRESULT WINAPI HTMLStyle_get_listStylePosition(IHTMLStyle *iface, BSTR *p)
2236 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2238 TRACE("(%p)->(%p)\n", This, p);
2240 return get_style_attr(This, STYLEID_LISTSTYLEPOSITION, p);
2243 static HRESULT WINAPI HTMLStyle_put_listStyleImage(IHTMLStyle *iface, BSTR v)
2245 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2246 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
2247 return E_NOTIMPL;
2250 static HRESULT WINAPI HTMLStyle_get_listStyleImage(IHTMLStyle *iface, BSTR *p)
2252 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2253 FIXME("(%p)->(%p)\n", This, p);
2254 return E_NOTIMPL;
2257 static HRESULT WINAPI HTMLStyle_put_listStyle(IHTMLStyle *iface, BSTR v)
2259 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2261 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2263 return set_style_attr(This, STYLEID_LIST_STYLE, v, 0);
2266 static HRESULT WINAPI HTMLStyle_get_listStyle(IHTMLStyle *iface, BSTR *p)
2268 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2270 TRACE("(%p)->(%p)\n", This, p);
2272 return get_style_attr(This, STYLEID_LIST_STYLE, p);
2275 static HRESULT WINAPI HTMLStyle_put_whiteSpace(IHTMLStyle *iface, BSTR v)
2277 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2279 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2281 return set_nsstyle_attr(This->nsstyle, STYLEID_WHITE_SPACE, v, 0);
2284 static HRESULT WINAPI HTMLStyle_get_whiteSpace(IHTMLStyle *iface, BSTR *p)
2286 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2288 TRACE("(%p)->(%p)\n", This, p);
2290 return get_nsstyle_attr(This->nsstyle, STYLEID_WHITE_SPACE, p, 0);
2293 static HRESULT WINAPI HTMLStyle_put_top(IHTMLStyle *iface, VARIANT v)
2295 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2297 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
2299 return set_nsstyle_attr_var(This->nsstyle, STYLEID_TOP, &v, 0);
2302 static HRESULT WINAPI HTMLStyle_get_top(IHTMLStyle *iface, VARIANT *p)
2304 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2306 TRACE("(%p)->(%p)\n", This, p);
2308 return get_nsstyle_attr_var(This->nsstyle, STYLEID_TOP, p, 0);
2311 static HRESULT WINAPI HTMLStyle_put_left(IHTMLStyle *iface, VARIANT v)
2313 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2315 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
2317 return set_nsstyle_attr_var(This->nsstyle, STYLEID_LEFT, &v, 0);
2320 static HRESULT WINAPI HTMLStyle_get_left(IHTMLStyle *iface, VARIANT *p)
2322 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2324 TRACE("(%p)->(%p)\n", This, p);
2326 return get_nsstyle_attr_var(This->nsstyle, STYLEID_LEFT, p, 0);
2329 static HRESULT WINAPI HTMLStyle_get_position(IHTMLStyle *iface, BSTR *p)
2331 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2332 TRACE("(%p)->(%p)\n", This, p);
2333 return IHTMLStyle2_get_position(&This->IHTMLStyle2_iface, p);
2336 static HRESULT WINAPI HTMLStyle_put_zIndex(IHTMLStyle *iface, VARIANT v)
2338 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2340 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
2342 return set_nsstyle_attr_var(This->nsstyle, STYLEID_Z_INDEX, &v, 0);
2345 static HRESULT WINAPI HTMLStyle_get_zIndex(IHTMLStyle *iface, VARIANT *p)
2347 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2349 TRACE("(%p)->(%p)\n", This, p);
2351 return get_nsstyle_attr_var(This->nsstyle, STYLEID_Z_INDEX, p, ATTR_STR_TO_INT);
2354 static HRESULT WINAPI HTMLStyle_put_overflow(IHTMLStyle *iface, BSTR v)
2356 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2357 static const WCHAR szVisible[] = {'v','i','s','i','b','l','e',0};
2358 static const WCHAR szScroll[] = {'s','c','r','o','l','l',0};
2359 static const WCHAR szHidden[] = {'h','i','d','d','e','n',0};
2360 static const WCHAR szAuto[] = {'a','u','t','o',0};
2362 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2364 /* overflow can only be one of the follow values. */
2365 if(!v || !*v || strcmpiW(szVisible, v) == 0 || strcmpiW(szScroll, v) == 0 ||
2366 strcmpiW(szHidden, v) == 0 || strcmpiW(szAuto, v) == 0)
2368 return set_nsstyle_attr(This->nsstyle, STYLEID_OVERFLOW, v, 0);
2371 return E_INVALIDARG;
2375 static HRESULT WINAPI HTMLStyle_get_overflow(IHTMLStyle *iface, BSTR *p)
2377 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2379 TRACE("(%p)->(%p)\n", This, p);
2381 if(!p)
2382 return E_INVALIDARG;
2384 return get_style_attr(This, STYLEID_OVERFLOW, p);
2387 static HRESULT WINAPI HTMLStyle_put_pageBreakBefore(IHTMLStyle *iface, BSTR v)
2389 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2391 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2393 return set_nsstyle_attr(This->nsstyle, STYLEID_PAGE_BREAK_BEFORE, v, 0);
2396 static HRESULT WINAPI HTMLStyle_get_pageBreakBefore(IHTMLStyle *iface, BSTR *p)
2398 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2400 TRACE("(%p)->(%p)\n", This, p);
2402 return get_nsstyle_attr(This->nsstyle, STYLEID_PAGE_BREAK_BEFORE, p, 0);
2405 static HRESULT WINAPI HTMLStyle_put_pageBreakAfter(IHTMLStyle *iface, BSTR v)
2407 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2409 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2411 return set_nsstyle_attr(This->nsstyle, STYLEID_PAGE_BREAK_AFTER, v, 0);
2414 static HRESULT WINAPI HTMLStyle_get_pageBreakAfter(IHTMLStyle *iface, BSTR *p)
2416 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2418 TRACE("(%p)->(%p)\n", This, p);
2420 return get_nsstyle_attr(This->nsstyle, STYLEID_PAGE_BREAK_AFTER, p, 0);
2423 static HRESULT WINAPI HTMLStyle_put_cssText(IHTMLStyle *iface, BSTR v)
2425 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2426 nsAString text_str;
2427 nsresult nsres;
2429 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2431 nsAString_InitDepend(&text_str, v);
2432 nsres = nsIDOMCSSStyleDeclaration_SetCssText(This->nsstyle, &text_str);
2433 nsAString_Finish(&text_str);
2434 if(NS_FAILED(nsres)) {
2435 FIXME("SetCssStyle failed: %08x\n", nsres);
2436 return E_FAIL;
2439 return S_OK;
2442 static HRESULT WINAPI HTMLStyle_get_cssText(IHTMLStyle *iface, BSTR *p)
2444 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2445 nsAString text_str;
2446 nsresult nsres;
2448 TRACE("(%p)->(%p)\n", This, p);
2450 /* FIXME: Gecko style formatting is different than IE (uppercase). */
2451 nsAString_Init(&text_str, NULL);
2452 nsres = nsIDOMCSSStyleDeclaration_GetCssText(This->nsstyle, &text_str);
2453 if(NS_SUCCEEDED(nsres)) {
2454 const PRUnichar *text;
2456 nsAString_GetData(&text_str, &text);
2457 *p = *text ? SysAllocString(text) : NULL;
2458 }else {
2459 FIXME("GetCssStyle failed: %08x\n", nsres);
2460 *p = NULL;
2463 nsAString_Finish(&text_str);
2464 return S_OK;
2467 static HRESULT WINAPI HTMLStyle_put_pixelTop(IHTMLStyle *iface, LONG v)
2469 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2471 TRACE("(%p)->(%d)\n", This, v);
2473 return set_style_pxattr(This->nsstyle, STYLEID_TOP, v);
2476 static HRESULT WINAPI HTMLStyle_get_pixelTop(IHTMLStyle *iface, LONG *p)
2478 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2480 TRACE("(%p)->(%p)\n", This, p);
2482 return get_nsstyle_pixel_val(This, STYLEID_TOP, p);
2485 static HRESULT WINAPI HTMLStyle_put_pixelLeft(IHTMLStyle *iface, LONG v)
2487 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2489 TRACE("(%p)->(%d)\n", This, v);
2491 return set_style_pxattr(This->nsstyle, STYLEID_LEFT, v);
2494 static HRESULT WINAPI HTMLStyle_get_pixelLeft(IHTMLStyle *iface, LONG *p)
2496 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2498 TRACE("(%p)->(%p)\n", This, p);
2500 return get_nsstyle_pixel_val(This, STYLEID_LEFT, p);
2503 static HRESULT WINAPI HTMLStyle_put_pixelWidth(IHTMLStyle *iface, LONG v)
2505 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2507 TRACE("(%p)->()\n", This);
2509 return set_style_pxattr(This->nsstyle, STYLEID_WIDTH, v);
2512 static HRESULT WINAPI HTMLStyle_get_pixelWidth(IHTMLStyle *iface, LONG *p)
2514 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2516 TRACE("(%p)->(%p)\n", This, p);
2518 return get_nsstyle_pixel_val(This, STYLEID_WIDTH, p);
2521 static HRESULT WINAPI HTMLStyle_put_pixelHeight(IHTMLStyle *iface, LONG v)
2523 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2525 TRACE("(%p)->(%d)\n", This, v);
2527 return set_style_pxattr(This->nsstyle, STYLEID_HEIGHT, v);
2530 static HRESULT WINAPI HTMLStyle_get_pixelHeight(IHTMLStyle *iface, LONG *p)
2532 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2534 TRACE("(%p)->(%p)\n", This, p);
2536 return get_nsstyle_pixel_val(This, STYLEID_HEIGHT, p);
2539 static HRESULT WINAPI HTMLStyle_put_posTop(IHTMLStyle *iface, float v)
2541 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2543 TRACE("(%p)->(%f)\n", This, v);
2545 return set_style_pos(This, STYLEID_TOP, v);
2548 static HRESULT WINAPI HTMLStyle_get_posTop(IHTMLStyle *iface, float *p)
2550 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2552 TRACE("(%p)->(%p)\n", This, p);
2554 if(!p)
2555 return E_POINTER;
2557 return get_nsstyle_pos(This, STYLEID_TOP, p);
2560 static HRESULT WINAPI HTMLStyle_put_posLeft(IHTMLStyle *iface, float v)
2562 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2564 TRACE("(%p)->(%f)\n", This, v);
2566 return set_style_pos(This, STYLEID_LEFT, v);
2569 static HRESULT WINAPI HTMLStyle_get_posLeft(IHTMLStyle *iface, float *p)
2571 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2573 TRACE("(%p)->(%p)\n", This, p);
2575 if(!p)
2576 return E_POINTER;
2578 return get_nsstyle_pos(This, STYLEID_LEFT, p);
2581 static HRESULT WINAPI HTMLStyle_put_posWidth(IHTMLStyle *iface, float v)
2583 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2585 TRACE("(%p)->(%f)\n", This, v);
2587 return set_style_pos(This, STYLEID_WIDTH, v);
2590 static HRESULT WINAPI HTMLStyle_get_posWidth(IHTMLStyle *iface, float *p)
2592 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2594 TRACE("(%p)->(%p)\n", This, p);
2596 if(!p)
2597 return E_POINTER;
2599 if(get_nsstyle_pos(This, STYLEID_WIDTH, p) != S_OK)
2600 *p = 0.0f;
2602 return S_OK;
2605 static HRESULT WINAPI HTMLStyle_put_posHeight(IHTMLStyle *iface, float v)
2607 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2609 TRACE("(%p)->(%f)\n", This, v);
2611 return set_style_pos(This, STYLEID_HEIGHT, v);
2614 static HRESULT WINAPI HTMLStyle_get_posHeight(IHTMLStyle *iface, float *p)
2616 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2618 TRACE("(%p)->(%p)\n", This, p);
2620 if(!p)
2621 return E_POINTER;
2623 if(get_nsstyle_pos(This, STYLEID_HEIGHT, p) != S_OK)
2624 *p = 0.0f;
2626 return S_OK;
2629 static HRESULT WINAPI HTMLStyle_put_cursor(IHTMLStyle *iface, BSTR v)
2631 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2633 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2635 return set_style_attr(This, STYLEID_CURSOR, v, 0);
2638 static HRESULT WINAPI HTMLStyle_get_cursor(IHTMLStyle *iface, BSTR *p)
2640 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2642 TRACE("(%p)->(%p)\n", This, p);
2644 return get_style_attr(This, STYLEID_CURSOR, p);
2647 static HRESULT WINAPI HTMLStyle_put_clip(IHTMLStyle *iface, BSTR v)
2649 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2651 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2653 return set_style_attr(This, STYLEID_CLIP, v, 0);
2656 static HRESULT WINAPI HTMLStyle_get_clip(IHTMLStyle *iface, BSTR *p)
2658 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2660 TRACE("(%p)->(%p)\n", This, p);
2662 return get_nsstyle_attr(This->nsstyle, STYLEID_CLIP, p, ATTR_REMOVE_COMMA);
2665 static void set_opacity(HTMLStyle *This, const WCHAR *val)
2667 nsAString name_str, val_str, empty_str;
2668 nsresult nsres;
2670 static const WCHAR opacityW[] = {'o','p','a','c','i','t','y',0};
2672 TRACE("%s\n", debugstr_w(val));
2674 nsAString_InitDepend(&name_str, opacityW);
2675 nsAString_InitDepend(&val_str, val);
2676 nsAString_InitDepend(&empty_str, emptyW);
2678 nsres = nsIDOMCSSStyleDeclaration_SetProperty(This->nsstyle, &name_str, &val_str, &empty_str);
2679 if(NS_FAILED(nsres))
2680 ERR("SetProperty failed: %08x\n", nsres);
2682 nsAString_Finish(&name_str);
2683 nsAString_Finish(&val_str);
2684 nsAString_Finish(&empty_str);
2687 static void update_filter(HTMLStyle *This)
2689 const WCHAR *ptr, *ptr2;
2691 static const WCHAR alphaW[] = {'a','l','p','h','a'};
2693 if(get_style_compat_mode(This) >= COMPAT_MODE_IE10)
2694 return;
2696 ptr = This->elem->filter;
2697 TRACE("%s\n", debugstr_w(ptr));
2698 if(!ptr) {
2699 set_opacity(This, emptyW);
2700 return;
2703 while(1) {
2704 while(isspaceW(*ptr))
2705 ptr++;
2706 if(!*ptr)
2707 break;
2709 ptr2 = ptr;
2710 while(isalnumW(*ptr))
2711 ptr++;
2712 if(ptr == ptr2) {
2713 WARN("unexpected char '%c'\n", *ptr);
2714 break;
2716 if(*ptr != '(') {
2717 WARN("expected '('\n");
2718 continue;
2721 if(ptr2 + sizeof(alphaW)/sizeof(WCHAR) == ptr && !memcmp(ptr2, alphaW, sizeof(alphaW))) {
2722 static const WCHAR formatW[] = {'%','f',0};
2723 static const WCHAR opacityW[] = {'o','p','a','c','i','t','y','='};
2725 ptr++;
2726 do {
2727 while(isspaceW(*ptr))
2728 ptr++;
2730 ptr2 = ptr;
2731 while(*ptr && *ptr != ',' && *ptr != ')')
2732 ptr++;
2733 if(!*ptr) {
2734 WARN("unexpected end of string\n");
2735 break;
2738 if(ptr-ptr2 > sizeof(opacityW)/sizeof(WCHAR) && !memcmp(ptr2, opacityW, sizeof(opacityW))) {
2739 float fval = 0.0f, e = 0.1f;
2740 WCHAR buf[32];
2742 ptr2 += sizeof(opacityW)/sizeof(WCHAR);
2744 while(isdigitW(*ptr2))
2745 fval = fval*10.0f + (float)(*ptr2++ - '0');
2747 if(*ptr2 == '.') {
2748 while(isdigitW(*++ptr2)) {
2749 fval += e * (float)(*ptr2++ - '0');
2750 e *= 0.1f;
2754 sprintfW(buf, formatW, fval * 0.01f);
2755 set_opacity(This, buf);
2756 }else {
2757 FIXME("unknown param %s\n", debugstr_wn(ptr2, ptr-ptr2));
2760 if(*ptr == ',')
2761 ptr++;
2762 }while(*ptr != ')');
2763 }else {
2764 FIXME("unknown filter %s\n", debugstr_wn(ptr2, ptr-ptr2));
2765 ptr = strchrW(ptr, ')');
2766 if(!ptr)
2767 break;
2768 ptr++;
2773 static HRESULT WINAPI HTMLStyle_put_filter(IHTMLStyle *iface, BSTR v)
2775 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2776 WCHAR *new_filter = NULL;
2778 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2780 if(!This->elem) {
2781 FIXME("Element already destroyed\n");
2782 return E_UNEXPECTED;
2785 if(v) {
2786 new_filter = heap_strdupW(v);
2787 if(!new_filter)
2788 return E_OUTOFMEMORY;
2791 heap_free(This->elem->filter);
2792 This->elem->filter = new_filter;
2794 update_filter(This);
2795 return S_OK;
2798 static HRESULT WINAPI HTMLStyle_get_filter(IHTMLStyle *iface, BSTR *p)
2800 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2802 TRACE("(%p)->(%p)\n", This, p);
2804 if(!This->elem) {
2805 FIXME("Element already destroyed\n");
2806 return E_UNEXPECTED;
2809 if(This->elem->filter) {
2810 *p = SysAllocString(This->elem->filter);
2811 if(!*p)
2812 return E_OUTOFMEMORY;
2813 }else {
2814 *p = NULL;
2817 return S_OK;
2820 static HRESULT WINAPI HTMLStyle_setAttribute(IHTMLStyle *iface, BSTR strAttributeName,
2821 VARIANT AttributeValue, LONG lFlags)
2823 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2824 HRESULT hres;
2825 DISPID dispid;
2827 TRACE("(%p)->(%s %s %08x)\n", This, debugstr_w(strAttributeName),
2828 debugstr_variant(&AttributeValue), lFlags);
2830 if(!strAttributeName)
2831 return E_INVALIDARG;
2833 if(lFlags == 1)
2834 FIXME("Parameter lFlags ignored\n");
2836 hres = HTMLStyle_GetIDsOfNames(iface, &IID_NULL, &strAttributeName, 1,
2837 LOCALE_USER_DEFAULT, &dispid);
2838 if(hres == S_OK)
2840 VARIANT ret;
2841 DISPID dispidNamed = DISPID_PROPERTYPUT;
2842 DISPPARAMS params;
2844 params.cArgs = 1;
2845 params.rgvarg = &AttributeValue;
2846 params.cNamedArgs = 1;
2847 params.rgdispidNamedArgs = &dispidNamed;
2849 hres = HTMLStyle_Invoke(iface, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
2850 DISPATCH_PROPERTYPUT, &params, &ret, NULL, NULL);
2852 else
2854 FIXME("Custom attributes not supported.\n");
2857 TRACE("ret: %08x\n", hres);
2859 return hres;
2862 static HRESULT WINAPI HTMLStyle_getAttribute(IHTMLStyle *iface, BSTR strAttributeName,
2863 LONG lFlags, VARIANT *AttributeValue)
2865 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2866 HRESULT hres;
2867 DISPID dispid;
2869 TRACE("(%p)->(%s v%p %08x)\n", This, debugstr_w(strAttributeName),
2870 AttributeValue, lFlags);
2872 if(!AttributeValue || !strAttributeName)
2873 return E_INVALIDARG;
2875 if(lFlags == 1)
2876 FIXME("Parameter lFlags ignored\n");
2878 hres = HTMLStyle_GetIDsOfNames(iface, &IID_NULL, &strAttributeName, 1,
2879 LOCALE_USER_DEFAULT, &dispid);
2880 if(hres == S_OK)
2882 DISPPARAMS params = {NULL, NULL, 0, 0 };
2884 hres = HTMLStyle_Invoke(iface, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
2885 DISPATCH_PROPERTYGET, &params, AttributeValue, NULL, NULL);
2887 else
2889 FIXME("Custom attributes not supported.\n");
2892 return hres;
2895 static HRESULT WINAPI HTMLStyle_removeAttribute(IHTMLStyle *iface, BSTR strAttributeName,
2896 LONG lFlags, VARIANT_BOOL *pfSuccess)
2898 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2899 const style_tbl_entry_t *style_entry;
2900 nsAString name_str, ret_str;
2901 nsresult nsres;
2902 HRESULT hres;
2904 TRACE("(%p)->(%s %08x %p)\n", This, debugstr_w(strAttributeName), lFlags, pfSuccess);
2906 style_entry = lookup_style_tbl(strAttributeName);
2907 if(!style_entry) {
2908 DISPID dispid;
2909 unsigned i;
2911 hres = IDispatchEx_GetDispID(&This->dispex.IDispatchEx_iface, strAttributeName,
2912 (lFlags&1) ? fdexNameCaseSensitive : fdexNameCaseInsensitive, &dispid);
2913 if(hres != S_OK) {
2914 *pfSuccess = VARIANT_FALSE;
2915 return S_OK;
2918 for(i=0; i < sizeof(style_tbl)/sizeof(*style_tbl); i++) {
2919 if(dispid == style_tbl[i].dispid)
2920 break;
2923 if(i == sizeof(style_tbl)/sizeof(*style_tbl))
2924 return remove_attribute(&This->dispex, dispid, pfSuccess);
2925 style_entry = style_tbl+i;
2928 /* filter property is a special case */
2929 if(style_entry->dispid == DISPID_IHTMLSTYLE_FILTER) {
2930 *pfSuccess = variant_bool(This->elem->filter && *This->elem->filter);
2931 heap_free(This->elem->filter);
2932 This->elem->filter = NULL;
2933 update_filter(This);
2934 return S_OK;
2937 nsAString_InitDepend(&name_str, style_entry->name);
2938 nsAString_Init(&ret_str, NULL);
2939 nsres = nsIDOMCSSStyleDeclaration_RemoveProperty(This->nsstyle, &name_str, &ret_str);
2940 if(NS_SUCCEEDED(nsres)) {
2941 const PRUnichar *ret;
2942 nsAString_GetData(&ret_str, &ret);
2943 *pfSuccess = variant_bool(*ret);
2944 }else {
2945 ERR("RemoveProperty failed: %08x\n", nsres);
2947 nsAString_Finish(&name_str);
2948 nsAString_Finish(&ret_str);
2949 return NS_SUCCEEDED(nsres) ? S_OK : E_FAIL;
2952 static HRESULT WINAPI HTMLStyle_toString(IHTMLStyle *iface, BSTR *String)
2954 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2955 FIXME("(%p)->(%p)\n", This, String);
2956 return E_NOTIMPL;
2959 static const IHTMLStyleVtbl HTMLStyleVtbl = {
2960 HTMLStyle_QueryInterface,
2961 HTMLStyle_AddRef,
2962 HTMLStyle_Release,
2963 HTMLStyle_GetTypeInfoCount,
2964 HTMLStyle_GetTypeInfo,
2965 HTMLStyle_GetIDsOfNames,
2966 HTMLStyle_Invoke,
2967 HTMLStyle_put_fontFamily,
2968 HTMLStyle_get_fontFamily,
2969 HTMLStyle_put_fontStyle,
2970 HTMLStyle_get_fontStyle,
2971 HTMLStyle_put_fontVariant,
2972 HTMLStyle_get_fontVariant,
2973 HTMLStyle_put_fontWeight,
2974 HTMLStyle_get_fontWeight,
2975 HTMLStyle_put_fontSize,
2976 HTMLStyle_get_fontSize,
2977 HTMLStyle_put_font,
2978 HTMLStyle_get_font,
2979 HTMLStyle_put_color,
2980 HTMLStyle_get_color,
2981 HTMLStyle_put_background,
2982 HTMLStyle_get_background,
2983 HTMLStyle_put_backgroundColor,
2984 HTMLStyle_get_backgroundColor,
2985 HTMLStyle_put_backgroundImage,
2986 HTMLStyle_get_backgroundImage,
2987 HTMLStyle_put_backgroundRepeat,
2988 HTMLStyle_get_backgroundRepeat,
2989 HTMLStyle_put_backgroundAttachment,
2990 HTMLStyle_get_backgroundAttachment,
2991 HTMLStyle_put_backgroundPosition,
2992 HTMLStyle_get_backgroundPosition,
2993 HTMLStyle_put_backgroundPositionX,
2994 HTMLStyle_get_backgroundPositionX,
2995 HTMLStyle_put_backgroundPositionY,
2996 HTMLStyle_get_backgroundPositionY,
2997 HTMLStyle_put_wordSpacing,
2998 HTMLStyle_get_wordSpacing,
2999 HTMLStyle_put_letterSpacing,
3000 HTMLStyle_get_letterSpacing,
3001 HTMLStyle_put_textDecoration,
3002 HTMLStyle_get_textDecoration,
3003 HTMLStyle_put_textDecorationNone,
3004 HTMLStyle_get_textDecorationNone,
3005 HTMLStyle_put_textDecorationUnderline,
3006 HTMLStyle_get_textDecorationUnderline,
3007 HTMLStyle_put_textDecorationOverline,
3008 HTMLStyle_get_textDecorationOverline,
3009 HTMLStyle_put_textDecorationLineThrough,
3010 HTMLStyle_get_textDecorationLineThrough,
3011 HTMLStyle_put_textDecorationBlink,
3012 HTMLStyle_get_textDecorationBlink,
3013 HTMLStyle_put_verticalAlign,
3014 HTMLStyle_get_verticalAlign,
3015 HTMLStyle_put_textTransform,
3016 HTMLStyle_get_textTransform,
3017 HTMLStyle_put_textAlign,
3018 HTMLStyle_get_textAlign,
3019 HTMLStyle_put_textIndent,
3020 HTMLStyle_get_textIndent,
3021 HTMLStyle_put_lineHeight,
3022 HTMLStyle_get_lineHeight,
3023 HTMLStyle_put_marginTop,
3024 HTMLStyle_get_marginTop,
3025 HTMLStyle_put_marginRight,
3026 HTMLStyle_get_marginRight,
3027 HTMLStyle_put_marginBottom,
3028 HTMLStyle_get_marginBottom,
3029 HTMLStyle_put_marginLeft,
3030 HTMLStyle_get_marginLeft,
3031 HTMLStyle_put_margin,
3032 HTMLStyle_get_margin,
3033 HTMLStyle_put_paddingTop,
3034 HTMLStyle_get_paddingTop,
3035 HTMLStyle_put_paddingRight,
3036 HTMLStyle_get_paddingRight,
3037 HTMLStyle_put_paddingBottom,
3038 HTMLStyle_get_paddingBottom,
3039 HTMLStyle_put_paddingLeft,
3040 HTMLStyle_get_paddingLeft,
3041 HTMLStyle_put_padding,
3042 HTMLStyle_get_padding,
3043 HTMLStyle_put_border,
3044 HTMLStyle_get_border,
3045 HTMLStyle_put_borderTop,
3046 HTMLStyle_get_borderTop,
3047 HTMLStyle_put_borderRight,
3048 HTMLStyle_get_borderRight,
3049 HTMLStyle_put_borderBottom,
3050 HTMLStyle_get_borderBottom,
3051 HTMLStyle_put_borderLeft,
3052 HTMLStyle_get_borderLeft,
3053 HTMLStyle_put_borderColor,
3054 HTMLStyle_get_borderColor,
3055 HTMLStyle_put_borderTopColor,
3056 HTMLStyle_get_borderTopColor,
3057 HTMLStyle_put_borderRightColor,
3058 HTMLStyle_get_borderRightColor,
3059 HTMLStyle_put_borderBottomColor,
3060 HTMLStyle_get_borderBottomColor,
3061 HTMLStyle_put_borderLeftColor,
3062 HTMLStyle_get_borderLeftColor,
3063 HTMLStyle_put_borderWidth,
3064 HTMLStyle_get_borderWidth,
3065 HTMLStyle_put_borderTopWidth,
3066 HTMLStyle_get_borderTopWidth,
3067 HTMLStyle_put_borderRightWidth,
3068 HTMLStyle_get_borderRightWidth,
3069 HTMLStyle_put_borderBottomWidth,
3070 HTMLStyle_get_borderBottomWidth,
3071 HTMLStyle_put_borderLeftWidth,
3072 HTMLStyle_get_borderLeftWidth,
3073 HTMLStyle_put_borderStyle,
3074 HTMLStyle_get_borderStyle,
3075 HTMLStyle_put_borderTopStyle,
3076 HTMLStyle_get_borderTopStyle,
3077 HTMLStyle_put_borderRightStyle,
3078 HTMLStyle_get_borderRightStyle,
3079 HTMLStyle_put_borderBottomStyle,
3080 HTMLStyle_get_borderBottomStyle,
3081 HTMLStyle_put_borderLeftStyle,
3082 HTMLStyle_get_borderLeftStyle,
3083 HTMLStyle_put_width,
3084 HTMLStyle_get_width,
3085 HTMLStyle_put_height,
3086 HTMLStyle_get_height,
3087 HTMLStyle_put_styleFloat,
3088 HTMLStyle_get_styleFloat,
3089 HTMLStyle_put_clear,
3090 HTMLStyle_get_clear,
3091 HTMLStyle_put_display,
3092 HTMLStyle_get_display,
3093 HTMLStyle_put_visibility,
3094 HTMLStyle_get_visibility,
3095 HTMLStyle_put_listStyleType,
3096 HTMLStyle_get_listStyleType,
3097 HTMLStyle_put_listStylePosition,
3098 HTMLStyle_get_listStylePosition,
3099 HTMLStyle_put_listStyleImage,
3100 HTMLStyle_get_listStyleImage,
3101 HTMLStyle_put_listStyle,
3102 HTMLStyle_get_listStyle,
3103 HTMLStyle_put_whiteSpace,
3104 HTMLStyle_get_whiteSpace,
3105 HTMLStyle_put_top,
3106 HTMLStyle_get_top,
3107 HTMLStyle_put_left,
3108 HTMLStyle_get_left,
3109 HTMLStyle_get_position,
3110 HTMLStyle_put_zIndex,
3111 HTMLStyle_get_zIndex,
3112 HTMLStyle_put_overflow,
3113 HTMLStyle_get_overflow,
3114 HTMLStyle_put_pageBreakBefore,
3115 HTMLStyle_get_pageBreakBefore,
3116 HTMLStyle_put_pageBreakAfter,
3117 HTMLStyle_get_pageBreakAfter,
3118 HTMLStyle_put_cssText,
3119 HTMLStyle_get_cssText,
3120 HTMLStyle_put_pixelTop,
3121 HTMLStyle_get_pixelTop,
3122 HTMLStyle_put_pixelLeft,
3123 HTMLStyle_get_pixelLeft,
3124 HTMLStyle_put_pixelWidth,
3125 HTMLStyle_get_pixelWidth,
3126 HTMLStyle_put_pixelHeight,
3127 HTMLStyle_get_pixelHeight,
3128 HTMLStyle_put_posTop,
3129 HTMLStyle_get_posTop,
3130 HTMLStyle_put_posLeft,
3131 HTMLStyle_get_posLeft,
3132 HTMLStyle_put_posWidth,
3133 HTMLStyle_get_posWidth,
3134 HTMLStyle_put_posHeight,
3135 HTMLStyle_get_posHeight,
3136 HTMLStyle_put_cursor,
3137 HTMLStyle_get_cursor,
3138 HTMLStyle_put_clip,
3139 HTMLStyle_get_clip,
3140 HTMLStyle_put_filter,
3141 HTMLStyle_get_filter,
3142 HTMLStyle_setAttribute,
3143 HTMLStyle_getAttribute,
3144 HTMLStyle_removeAttribute,
3145 HTMLStyle_toString
3148 static inline HTMLStyle *impl_from_IHTMLStyle2(IHTMLStyle2 *iface)
3150 return CONTAINING_RECORD(iface, HTMLStyle, IHTMLStyle2_iface);
3153 static HRESULT WINAPI HTMLStyle2_QueryInterface(IHTMLStyle2 *iface, REFIID riid, void **ppv)
3155 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3157 return IHTMLStyle_QueryInterface(&This->IHTMLStyle_iface, riid, ppv);
3160 static ULONG WINAPI HTMLStyle2_AddRef(IHTMLStyle2 *iface)
3162 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3164 return IHTMLStyle_AddRef(&This->IHTMLStyle_iface);
3167 static ULONG WINAPI HTMLStyle2_Release(IHTMLStyle2 *iface)
3169 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3171 return IHTMLStyle_Release(&This->IHTMLStyle_iface);
3174 static HRESULT WINAPI HTMLStyle2_GetTypeInfoCount(IHTMLStyle2 *iface, UINT *pctinfo)
3176 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3177 return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
3180 static HRESULT WINAPI HTMLStyle2_GetTypeInfo(IHTMLStyle2 *iface, UINT iTInfo,
3181 LCID lcid, ITypeInfo **ppTInfo)
3183 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3184 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
3187 static HRESULT WINAPI HTMLStyle2_GetIDsOfNames(IHTMLStyle2 *iface, REFIID riid,
3188 LPOLESTR *rgszNames, UINT cNames,
3189 LCID lcid, DISPID *rgDispId)
3191 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3192 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
3193 lcid, rgDispId);
3196 static HRESULT WINAPI HTMLStyle2_Invoke(IHTMLStyle2 *iface, DISPID dispIdMember,
3197 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
3198 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
3200 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3201 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
3202 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
3205 static HRESULT WINAPI HTMLStyle2_put_tableLayout(IHTMLStyle2 *iface, BSTR v)
3207 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3209 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
3211 return set_nsstyle_attr(This->nsstyle, STYLEID_TABLE_LAYOUT, v, 0);
3214 static HRESULT WINAPI HTMLStyle2_get_tableLayout(IHTMLStyle2 *iface, BSTR *p)
3216 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3218 TRACE("(%p)->(%p)\n", This, p);
3220 return get_nsstyle_attr(This->nsstyle, STYLEID_TABLE_LAYOUT, p, 0);
3223 static HRESULT WINAPI HTMLStyle2_put_borderCollapse(IHTMLStyle2 *iface, BSTR v)
3225 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3226 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3227 return E_NOTIMPL;
3230 static HRESULT WINAPI HTMLStyle2_get_borderCollapse(IHTMLStyle2 *iface, BSTR *p)
3232 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3233 FIXME("(%p)->(%p)\n", This, p);
3234 return E_NOTIMPL;
3237 static HRESULT WINAPI HTMLStyle2_put_direction(IHTMLStyle2 *iface, BSTR v)
3239 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3241 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
3243 return set_nsstyle_attr(This->nsstyle, STYLEID_DIRECTION, v, 0);
3246 static HRESULT WINAPI HTMLStyle2_get_direction(IHTMLStyle2 *iface, BSTR *p)
3248 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3250 TRACE("(%p)->(%p)\n", This, p);
3252 return get_nsstyle_attr(This->nsstyle, STYLEID_DIRECTION, p, 0);
3255 static HRESULT WINAPI HTMLStyle2_put_behavior(IHTMLStyle2 *iface, BSTR v)
3257 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3258 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3259 return S_OK;
3262 static HRESULT WINAPI HTMLStyle2_get_behavior(IHTMLStyle2 *iface, BSTR *p)
3264 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3265 FIXME("(%p)->(%p)\n", This, p);
3266 return E_NOTIMPL;
3269 static HRESULT WINAPI HTMLStyle2_setExpression(IHTMLStyle2 *iface, BSTR propname, BSTR expression, BSTR language)
3271 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3272 FIXME("(%p)->(%s %s %s)\n", This, debugstr_w(propname), debugstr_w(expression), debugstr_w(language));
3273 return E_NOTIMPL;
3276 static HRESULT WINAPI HTMLStyle2_getExpression(IHTMLStyle2 *iface, BSTR propname, VARIANT *expression)
3278 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3279 FIXME("(%p)->(%s %p)\n", This, debugstr_w(propname), expression);
3280 return E_NOTIMPL;
3283 static HRESULT WINAPI HTMLStyle2_removeExpression(IHTMLStyle2 *iface, BSTR propname, VARIANT_BOOL *pfSuccess)
3285 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3286 FIXME("(%p)->(%s %p)\n", This, debugstr_w(propname), pfSuccess);
3287 return E_NOTIMPL;
3290 static HRESULT WINAPI HTMLStyle2_put_position(IHTMLStyle2 *iface, BSTR v)
3292 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3294 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
3296 return set_nsstyle_attr(This->nsstyle, STYLEID_POSITION, v, 0);
3299 static HRESULT WINAPI HTMLStyle2_get_position(IHTMLStyle2 *iface, BSTR *p)
3301 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3303 TRACE("(%p)->(%p)\n", This, p);
3305 return get_nsstyle_attr(This->nsstyle, STYLEID_POSITION, p, 0);
3308 static HRESULT WINAPI HTMLStyle2_put_unicodeBidi(IHTMLStyle2 *iface, BSTR v)
3310 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3311 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3312 return E_NOTIMPL;
3315 static HRESULT WINAPI HTMLStyle2_get_unicodeBidi(IHTMLStyle2 *iface, BSTR *p)
3317 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3318 FIXME("(%p)->(%p)\n", This, p);
3319 return E_NOTIMPL;
3322 static HRESULT WINAPI HTMLStyle2_put_bottom(IHTMLStyle2 *iface, VARIANT v)
3324 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3326 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
3328 return set_nsstyle_attr_var(This->nsstyle, STYLEID_BOTTOM, &v, ATTR_FIX_PX);
3331 static HRESULT WINAPI HTMLStyle2_get_bottom(IHTMLStyle2 *iface, VARIANT *p)
3333 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3335 TRACE("(%p)->(%p)\n", This, p);
3337 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BOTTOM, p, 0);
3340 static HRESULT WINAPI HTMLStyle2_put_right(IHTMLStyle2 *iface, VARIANT v)
3342 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3344 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
3346 return set_nsstyle_attr_var(This->nsstyle, STYLEID_RIGHT, &v, 0);
3349 static HRESULT WINAPI HTMLStyle2_get_right(IHTMLStyle2 *iface, VARIANT *p)
3351 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3353 TRACE("(%p)->(%p)\n", This, p);
3355 return get_nsstyle_attr_var(This->nsstyle, STYLEID_RIGHT, p, 0);
3358 static HRESULT WINAPI HTMLStyle2_put_pixelBottom(IHTMLStyle2 *iface, LONG v)
3360 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3361 FIXME("(%p)->(%d)\n", This, v);
3362 return E_NOTIMPL;
3365 static HRESULT WINAPI HTMLStyle2_get_pixelBottom(IHTMLStyle2 *iface, LONG *p)
3367 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3368 FIXME("(%p)->(%p)\n", This, p);
3369 return E_NOTIMPL;
3372 static HRESULT WINAPI HTMLStyle2_put_pixelRight(IHTMLStyle2 *iface, LONG v)
3374 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3375 FIXME("(%p)->(%d)\n", This, v);
3376 return E_NOTIMPL;
3379 static HRESULT WINAPI HTMLStyle2_get_pixelRight(IHTMLStyle2 *iface, LONG *p)
3381 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3382 FIXME("(%p)->(%p)\n", This, p);
3383 return E_NOTIMPL;
3386 static HRESULT WINAPI HTMLStyle2_put_posBottom(IHTMLStyle2 *iface, float v)
3388 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3389 FIXME("(%p)->(%f)\n", This, v);
3390 return E_NOTIMPL;
3393 static HRESULT WINAPI HTMLStyle2_get_posBottom(IHTMLStyle2 *iface, float *p)
3395 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3396 FIXME("(%p)->(%p)\n", This, p);
3397 return E_NOTIMPL;
3400 static HRESULT WINAPI HTMLStyle2_put_posRight(IHTMLStyle2 *iface, float v)
3402 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3403 FIXME("(%p)->(%f)\n", This, v);
3404 return E_NOTIMPL;
3407 static HRESULT WINAPI HTMLStyle2_get_posRight(IHTMLStyle2 *iface, float *p)
3409 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3410 FIXME("(%p)->(%p)\n", This, p);
3411 return E_NOTIMPL;
3414 static HRESULT WINAPI HTMLStyle2_put_imeMode(IHTMLStyle2 *iface, BSTR v)
3416 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3417 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3418 return E_NOTIMPL;
3421 static HRESULT WINAPI HTMLStyle2_get_imeMode(IHTMLStyle2 *iface, BSTR *p)
3423 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3424 FIXME("(%p)->(%p)\n", This, p);
3425 return E_NOTIMPL;
3428 static HRESULT WINAPI HTMLStyle2_put_rubyAlign(IHTMLStyle2 *iface, BSTR v)
3430 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3431 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3432 return E_NOTIMPL;
3435 static HRESULT WINAPI HTMLStyle2_get_rubyAlign(IHTMLStyle2 *iface, BSTR *p)
3437 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3438 FIXME("(%p)->(%p)\n", This, p);
3439 return E_NOTIMPL;
3442 static HRESULT WINAPI HTMLStyle2_put_rubyPosition(IHTMLStyle2 *iface, BSTR v)
3444 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3445 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3446 return E_NOTIMPL;
3449 static HRESULT WINAPI HTMLStyle2_get_rubyPosition(IHTMLStyle2 *iface, BSTR *p)
3451 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3452 FIXME("(%p)->(%p)\n", This, p);
3453 return E_NOTIMPL;
3456 static HRESULT WINAPI HTMLStyle2_put_rubyOverhang(IHTMLStyle2 *iface, BSTR v)
3458 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3459 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3460 return E_NOTIMPL;
3463 static HRESULT WINAPI HTMLStyle2_get_rubyOverhang(IHTMLStyle2 *iface, BSTR *p)
3465 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3466 FIXME("(%p)->(%p)\n", This, p);
3467 return E_NOTIMPL;
3470 static HRESULT WINAPI HTMLStyle2_put_layoutGridChar(IHTMLStyle2 *iface, VARIANT v)
3472 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3473 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3474 return E_NOTIMPL;
3477 static HRESULT WINAPI HTMLStyle2_get_layoutGridChar(IHTMLStyle2 *iface, VARIANT *p)
3479 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3480 FIXME("(%p)->(%p)\n", This, p);
3481 return E_NOTIMPL;
3484 static HRESULT WINAPI HTMLStyle2_put_layoutGridLine(IHTMLStyle2 *iface, VARIANT v)
3486 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3487 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3488 return E_NOTIMPL;
3491 static HRESULT WINAPI HTMLStyle2_get_layoutGridLine(IHTMLStyle2 *iface, VARIANT *p)
3493 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3494 FIXME("(%p)->(%p)\n", This, p);
3495 return E_NOTIMPL;
3498 static HRESULT WINAPI HTMLStyle2_put_layoutGridMode(IHTMLStyle2 *iface, BSTR v)
3500 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3501 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3502 return E_NOTIMPL;
3505 static HRESULT WINAPI HTMLStyle2_get_layoutGridMode(IHTMLStyle2 *iface, BSTR *p)
3507 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3508 FIXME("(%p)->(%p)\n", This, p);
3509 return E_NOTIMPL;
3512 static HRESULT WINAPI HTMLStyle2_put_layoutGridType(IHTMLStyle2 *iface, BSTR v)
3514 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3515 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3516 return E_NOTIMPL;
3519 static HRESULT WINAPI HTMLStyle2_get_layoutGridType(IHTMLStyle2 *iface, BSTR *p)
3521 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3522 FIXME("(%p)->(%p)\n", This, p);
3523 return E_NOTIMPL;
3526 static HRESULT WINAPI HTMLStyle2_put_layoutGrid(IHTMLStyle2 *iface, BSTR v)
3528 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3529 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3530 return E_NOTIMPL;
3533 static HRESULT WINAPI HTMLStyle2_get_layoutGrid(IHTMLStyle2 *iface, BSTR *p)
3535 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3536 FIXME("(%p)->(%p)\n", This, p);
3537 return E_NOTIMPL;
3540 static HRESULT WINAPI HTMLStyle2_put_wordBreak(IHTMLStyle2 *iface, BSTR v)
3542 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3543 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3544 return E_NOTIMPL;
3547 static HRESULT WINAPI HTMLStyle2_get_wordBreak(IHTMLStyle2 *iface, BSTR *p)
3549 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3550 FIXME("(%p)->(%p)\n", This, p);
3551 return E_NOTIMPL;
3554 static HRESULT WINAPI HTMLStyle2_put_lineBreak(IHTMLStyle2 *iface, BSTR v)
3556 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3557 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3558 return E_NOTIMPL;
3561 static HRESULT WINAPI HTMLStyle2_get_lineBreak(IHTMLStyle2 *iface, BSTR *p)
3563 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3564 FIXME("(%p)->(%p)\n", This, p);
3565 return E_NOTIMPL;
3568 static HRESULT WINAPI HTMLStyle2_put_textJustify(IHTMLStyle2 *iface, BSTR v)
3570 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3571 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3572 return E_NOTIMPL;
3575 static HRESULT WINAPI HTMLStyle2_get_textJustify(IHTMLStyle2 *iface, BSTR *p)
3577 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3578 FIXME("(%p)->(%p)\n", This, p);
3579 return E_NOTIMPL;
3582 static HRESULT WINAPI HTMLStyle2_put_textJustifyTrim(IHTMLStyle2 *iface, BSTR v)
3584 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3585 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3586 return E_NOTIMPL;
3589 static HRESULT WINAPI HTMLStyle2_get_textJustifyTrim(IHTMLStyle2 *iface, BSTR *p)
3591 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3592 FIXME("(%p)->(%p)\n", This, p);
3593 return E_NOTIMPL;
3596 static HRESULT WINAPI HTMLStyle2_put_textKashida(IHTMLStyle2 *iface, VARIANT v)
3598 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3599 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3600 return E_NOTIMPL;
3603 static HRESULT WINAPI HTMLStyle2_get_textKashida(IHTMLStyle2 *iface, VARIANT *p)
3605 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3606 FIXME("(%p)->(%p)\n", This, p);
3607 return E_NOTIMPL;
3610 static HRESULT WINAPI HTMLStyle2_put_textAutospace(IHTMLStyle2 *iface, BSTR v)
3612 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3613 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3614 return E_NOTIMPL;
3617 static HRESULT WINAPI HTMLStyle2_get_textAutospace(IHTMLStyle2 *iface, BSTR *p)
3619 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3620 FIXME("(%p)->(%p)\n", This, p);
3621 return E_NOTIMPL;
3624 static HRESULT WINAPI HTMLStyle2_put_overflowX(IHTMLStyle2 *iface, BSTR v)
3626 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3628 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
3630 return set_nsstyle_attr(This->nsstyle, STYLEID_OVERFLOW_X, v, 0);
3633 static HRESULT WINAPI HTMLStyle2_get_overflowX(IHTMLStyle2 *iface, BSTR *p)
3635 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3637 TRACE("(%p)->(%p)\n", This, p);
3639 return get_nsstyle_attr(This->nsstyle, STYLEID_OVERFLOW_X, p, 0);
3642 static HRESULT WINAPI HTMLStyle2_put_overflowY(IHTMLStyle2 *iface, BSTR v)
3644 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3646 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
3648 return set_nsstyle_attr(This->nsstyle, STYLEID_OVERFLOW_Y, v, 0);
3651 static HRESULT WINAPI HTMLStyle2_get_overflowY(IHTMLStyle2 *iface, BSTR *p)
3653 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3655 TRACE("(%p)->(%p)\n", This, p);
3657 return get_nsstyle_attr(This->nsstyle, STYLEID_OVERFLOW_Y, p, 0);
3660 static HRESULT WINAPI HTMLStyle2_put_accelerator(IHTMLStyle2 *iface, BSTR v)
3662 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3663 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3664 return E_NOTIMPL;
3667 static HRESULT WINAPI HTMLStyle2_get_accelerator(IHTMLStyle2 *iface, BSTR *p)
3669 HTMLStyle *This = impl_from_IHTMLStyle2(iface);
3670 FIXME("(%p)->(%p)\n", This, p);
3671 return E_NOTIMPL;
3674 static const IHTMLStyle2Vtbl HTMLStyle2Vtbl = {
3675 HTMLStyle2_QueryInterface,
3676 HTMLStyle2_AddRef,
3677 HTMLStyle2_Release,
3678 HTMLStyle2_GetTypeInfoCount,
3679 HTMLStyle2_GetTypeInfo,
3680 HTMLStyle2_GetIDsOfNames,
3681 HTMLStyle2_Invoke,
3682 HTMLStyle2_put_tableLayout,
3683 HTMLStyle2_get_tableLayout,
3684 HTMLStyle2_put_borderCollapse,
3685 HTMLStyle2_get_borderCollapse,
3686 HTMLStyle2_put_direction,
3687 HTMLStyle2_get_direction,
3688 HTMLStyle2_put_behavior,
3689 HTMLStyle2_get_behavior,
3690 HTMLStyle2_setExpression,
3691 HTMLStyle2_getExpression,
3692 HTMLStyle2_removeExpression,
3693 HTMLStyle2_put_position,
3694 HTMLStyle2_get_position,
3695 HTMLStyle2_put_unicodeBidi,
3696 HTMLStyle2_get_unicodeBidi,
3697 HTMLStyle2_put_bottom,
3698 HTMLStyle2_get_bottom,
3699 HTMLStyle2_put_right,
3700 HTMLStyle2_get_right,
3701 HTMLStyle2_put_pixelBottom,
3702 HTMLStyle2_get_pixelBottom,
3703 HTMLStyle2_put_pixelRight,
3704 HTMLStyle2_get_pixelRight,
3705 HTMLStyle2_put_posBottom,
3706 HTMLStyle2_get_posBottom,
3707 HTMLStyle2_put_posRight,
3708 HTMLStyle2_get_posRight,
3709 HTMLStyle2_put_imeMode,
3710 HTMLStyle2_get_imeMode,
3711 HTMLStyle2_put_rubyAlign,
3712 HTMLStyle2_get_rubyAlign,
3713 HTMLStyle2_put_rubyPosition,
3714 HTMLStyle2_get_rubyPosition,
3715 HTMLStyle2_put_rubyOverhang,
3716 HTMLStyle2_get_rubyOverhang,
3717 HTMLStyle2_put_layoutGridChar,
3718 HTMLStyle2_get_layoutGridChar,
3719 HTMLStyle2_put_layoutGridLine,
3720 HTMLStyle2_get_layoutGridLine,
3721 HTMLStyle2_put_layoutGridMode,
3722 HTMLStyle2_get_layoutGridMode,
3723 HTMLStyle2_put_layoutGridType,
3724 HTMLStyle2_get_layoutGridType,
3725 HTMLStyle2_put_layoutGrid,
3726 HTMLStyle2_get_layoutGrid,
3727 HTMLStyle2_put_wordBreak,
3728 HTMLStyle2_get_wordBreak,
3729 HTMLStyle2_put_lineBreak,
3730 HTMLStyle2_get_lineBreak,
3731 HTMLStyle2_put_textJustify,
3732 HTMLStyle2_get_textJustify,
3733 HTMLStyle2_put_textJustifyTrim,
3734 HTMLStyle2_get_textJustifyTrim,
3735 HTMLStyle2_put_textKashida,
3736 HTMLStyle2_get_textKashida,
3737 HTMLStyle2_put_textAutospace,
3738 HTMLStyle2_get_textAutospace,
3739 HTMLStyle2_put_overflowX,
3740 HTMLStyle2_get_overflowX,
3741 HTMLStyle2_put_overflowY,
3742 HTMLStyle2_get_overflowY,
3743 HTMLStyle2_put_accelerator,
3744 HTMLStyle2_get_accelerator
3747 static inline HTMLStyle *impl_from_IHTMLStyle3(IHTMLStyle3 *iface)
3749 return CONTAINING_RECORD(iface, HTMLStyle, IHTMLStyle3_iface);
3752 static HRESULT WINAPI HTMLStyle3_QueryInterface(IHTMLStyle3 *iface, REFIID riid, void **ppv)
3754 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3756 return IHTMLStyle_QueryInterface(&This->IHTMLStyle_iface, riid, ppv);
3759 static ULONG WINAPI HTMLStyle3_AddRef(IHTMLStyle3 *iface)
3761 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3763 return IHTMLStyle_AddRef(&This->IHTMLStyle_iface);
3766 static ULONG WINAPI HTMLStyle3_Release(IHTMLStyle3 *iface)
3768 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3770 return IHTMLStyle_Release(&This->IHTMLStyle_iface);
3773 static HRESULT WINAPI HTMLStyle3_GetTypeInfoCount(IHTMLStyle3 *iface, UINT *pctinfo)
3775 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3776 return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
3779 static HRESULT WINAPI HTMLStyle3_GetTypeInfo(IHTMLStyle3 *iface, UINT iTInfo,
3780 LCID lcid, ITypeInfo **ppTInfo)
3782 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3783 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
3786 static HRESULT WINAPI HTMLStyle3_GetIDsOfNames(IHTMLStyle3 *iface, REFIID riid,
3787 LPOLESTR *rgszNames, UINT cNames,
3788 LCID lcid, DISPID *rgDispId)
3790 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3791 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
3792 lcid, rgDispId);
3795 static HRESULT WINAPI HTMLStyle3_Invoke(IHTMLStyle3 *iface, DISPID dispIdMember,
3796 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
3797 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
3799 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3800 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
3801 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
3804 static HRESULT WINAPI HTMLStyle3_put_layoutFlow(IHTMLStyle3 *iface, BSTR v)
3806 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3807 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3808 return E_NOTIMPL;
3811 static HRESULT WINAPI HTMLStyle3_get_layoutFlow(IHTMLStyle3 *iface, BSTR *p)
3813 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3814 FIXME("(%p)->(%p)\n", This, p);
3815 return E_NOTIMPL;
3818 static const WCHAR zoomW[] = {'z','o','o','m',0};
3820 static HRESULT WINAPI HTMLStyle3_put_zoom(IHTMLStyle3 *iface, VARIANT v)
3822 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3823 VARIANT *var;
3824 HRESULT hres;
3826 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
3828 /* zoom property is IE CSS extension that is mostly used as a hack to workaround IE bugs.
3829 * The value is set to 1 then. We can safely ignore setting zoom to 1. */
3830 if(V_VT(&v) != VT_I4 || V_I4(&v) != 1)
3831 WARN("stub for %s\n", debugstr_variant(&v));
3833 hres = dispex_get_dprop_ref(&This->dispex, zoomW, TRUE, &var);
3834 if(FAILED(hres))
3835 return hres;
3837 return VariantChangeType(var, &v, 0, VT_BSTR);
3840 static HRESULT WINAPI HTMLStyle3_get_zoom(IHTMLStyle3 *iface, VARIANT *p)
3842 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3843 VARIANT *var;
3844 HRESULT hres;
3846 TRACE("(%p)->(%p)\n", This, p);
3848 hres = dispex_get_dprop_ref(&This->dispex, zoomW, FALSE, &var);
3849 if(hres == DISP_E_UNKNOWNNAME) {
3850 V_VT(p) = VT_BSTR;
3851 V_BSTR(p) = NULL;
3852 return S_OK;
3854 if(FAILED(hres))
3855 return hres;
3857 return VariantCopy(p, var);
3860 static HRESULT WINAPI HTMLStyle3_put_wordWrap(IHTMLStyle3 *iface, BSTR v)
3862 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3864 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
3866 return set_nsstyle_attr(This->nsstyle, STYLEID_WORD_WRAP, v, 0);
3869 static HRESULT WINAPI HTMLStyle3_get_wordWrap(IHTMLStyle3 *iface, BSTR *p)
3871 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3873 TRACE("(%p)->(%p)\n", This, p);
3875 return get_nsstyle_attr(This->nsstyle, STYLEID_WORD_WRAP, p, 0);
3878 static HRESULT WINAPI HTMLStyle3_put_textUnderlinePosition(IHTMLStyle3 *iface, BSTR v)
3880 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3881 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3882 return E_NOTIMPL;
3885 static HRESULT WINAPI HTMLStyle3_get_textUnderlinePosition(IHTMLStyle3 *iface, BSTR *p)
3887 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3888 FIXME("(%p)->(%p)\n", This, p);
3889 return E_NOTIMPL;
3892 static HRESULT WINAPI HTMLStyle3_put_scrollbarBaseColor(IHTMLStyle3 *iface, VARIANT v)
3894 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3895 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3896 return E_NOTIMPL;
3899 static HRESULT WINAPI HTMLStyle3_get_scrollbarBaseColor(IHTMLStyle3 *iface, VARIANT *p)
3901 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3902 FIXME("(%p)->(%p)\n", This, p);
3903 return E_NOTIMPL;
3906 static HRESULT WINAPI HTMLStyle3_put_scrollbarFaceColor(IHTMLStyle3 *iface, VARIANT v)
3908 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3909 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3910 return E_NOTIMPL;
3913 static HRESULT WINAPI HTMLStyle3_get_scrollbarFaceColor(IHTMLStyle3 *iface, VARIANT *p)
3915 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3916 FIXME("(%p)->(%p)\n", This, p);
3917 return E_NOTIMPL;
3920 static HRESULT WINAPI HTMLStyle3_put_scrollbar3dLightColor(IHTMLStyle3 *iface, VARIANT v)
3922 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3923 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3924 return E_NOTIMPL;
3927 static HRESULT WINAPI HTMLStyle3_get_scrollbar3dLightColor(IHTMLStyle3 *iface, VARIANT *p)
3929 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3930 FIXME("(%p)->(%p)\n", This, p);
3931 return E_NOTIMPL;
3934 static HRESULT WINAPI HTMLStyle3_put_scrollbarShadowColor(IHTMLStyle3 *iface, VARIANT v)
3936 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3937 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3938 return E_NOTIMPL;
3941 static HRESULT WINAPI HTMLStyle3_get_scrollbarShadowColor(IHTMLStyle3 *iface, VARIANT *p)
3943 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3944 FIXME("(%p)->(%p)\n", This, p);
3945 return E_NOTIMPL;
3948 static HRESULT WINAPI HTMLStyle3_put_scrollbarHighlightColor(IHTMLStyle3 *iface, VARIANT v)
3950 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3951 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3952 return E_NOTIMPL;
3955 static HRESULT WINAPI HTMLStyle3_get_scrollbarHighlightColor(IHTMLStyle3 *iface, VARIANT *p)
3957 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3958 FIXME("(%p)->(%p)\n", This, p);
3959 return E_NOTIMPL;
3962 static HRESULT WINAPI HTMLStyle3_put_scrollbarDarkShadowColor(IHTMLStyle3 *iface, VARIANT v)
3964 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3965 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3966 return E_NOTIMPL;
3969 static HRESULT WINAPI HTMLStyle3_get_scrollbarDarkShadowColor(IHTMLStyle3 *iface, VARIANT *p)
3971 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3972 FIXME("(%p)->(%p)\n", This, p);
3973 return E_NOTIMPL;
3976 static HRESULT WINAPI HTMLStyle3_put_scrollbarArrowColor(IHTMLStyle3 *iface, VARIANT v)
3978 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3979 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3980 return E_NOTIMPL;
3983 static HRESULT WINAPI HTMLStyle3_get_scrollbarArrowColor(IHTMLStyle3 *iface, VARIANT *p)
3985 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3986 FIXME("(%p)->(%p)\n", This, p);
3987 return E_NOTIMPL;
3990 static HRESULT WINAPI HTMLStyle3_put_scrollbarTrackColor(IHTMLStyle3 *iface, VARIANT v)
3992 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
3993 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3994 return E_NOTIMPL;
3997 static HRESULT WINAPI HTMLStyle3_get_scrollbarTrackColor(IHTMLStyle3 *iface, VARIANT *p)
3999 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
4000 FIXME("(%p)->(%p)\n", This, p);
4001 return E_NOTIMPL;
4004 static HRESULT WINAPI HTMLStyle3_put_writingMode(IHTMLStyle3 *iface, BSTR v)
4006 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
4007 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4008 return E_NOTIMPL;
4011 static HRESULT WINAPI HTMLStyle3_get_writingMode(IHTMLStyle3 *iface, BSTR *p)
4013 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
4014 FIXME("(%p)->(%p)\n", This, p);
4015 return E_NOTIMPL;
4018 static HRESULT WINAPI HTMLStyle3_put_textAlignLast(IHTMLStyle3 *iface, BSTR v)
4020 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
4021 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4022 return E_NOTIMPL;
4025 static HRESULT WINAPI HTMLStyle3_get_textAlignLast(IHTMLStyle3 *iface, BSTR *p)
4027 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
4028 FIXME("(%p)->(%p)\n", This, p);
4029 return E_NOTIMPL;
4032 static HRESULT WINAPI HTMLStyle3_put_textKashidaSpace(IHTMLStyle3 *iface, VARIANT v)
4034 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
4035 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
4036 return E_NOTIMPL;
4039 static HRESULT WINAPI HTMLStyle3_get_textKashidaSpace(IHTMLStyle3 *iface, VARIANT *p)
4041 HTMLStyle *This = impl_from_IHTMLStyle3(iface);
4042 FIXME("(%p)->(%p)\n", This, p);
4043 return E_NOTIMPL;
4046 static const IHTMLStyle3Vtbl HTMLStyle3Vtbl = {
4047 HTMLStyle3_QueryInterface,
4048 HTMLStyle3_AddRef,
4049 HTMLStyle3_Release,
4050 HTMLStyle3_GetTypeInfoCount,
4051 HTMLStyle3_GetTypeInfo,
4052 HTMLStyle3_GetIDsOfNames,
4053 HTMLStyle3_Invoke,
4054 HTMLStyle3_put_layoutFlow,
4055 HTMLStyle3_get_layoutFlow,
4056 HTMLStyle3_put_zoom,
4057 HTMLStyle3_get_zoom,
4058 HTMLStyle3_put_wordWrap,
4059 HTMLStyle3_get_wordWrap,
4060 HTMLStyle3_put_textUnderlinePosition,
4061 HTMLStyle3_get_textUnderlinePosition,
4062 HTMLStyle3_put_scrollbarBaseColor,
4063 HTMLStyle3_get_scrollbarBaseColor,
4064 HTMLStyle3_put_scrollbarFaceColor,
4065 HTMLStyle3_get_scrollbarFaceColor,
4066 HTMLStyle3_put_scrollbar3dLightColor,
4067 HTMLStyle3_get_scrollbar3dLightColor,
4068 HTMLStyle3_put_scrollbarShadowColor,
4069 HTMLStyle3_get_scrollbarShadowColor,
4070 HTMLStyle3_put_scrollbarHighlightColor,
4071 HTMLStyle3_get_scrollbarHighlightColor,
4072 HTMLStyle3_put_scrollbarDarkShadowColor,
4073 HTMLStyle3_get_scrollbarDarkShadowColor,
4074 HTMLStyle3_put_scrollbarArrowColor,
4075 HTMLStyle3_get_scrollbarArrowColor,
4076 HTMLStyle3_put_scrollbarTrackColor,
4077 HTMLStyle3_get_scrollbarTrackColor,
4078 HTMLStyle3_put_writingMode,
4079 HTMLStyle3_get_writingMode,
4080 HTMLStyle3_put_textAlignLast,
4081 HTMLStyle3_get_textAlignLast,
4082 HTMLStyle3_put_textKashidaSpace,
4083 HTMLStyle3_get_textKashidaSpace
4087 * IHTMLStyle4 Interface
4089 static inline HTMLStyle *impl_from_IHTMLStyle4(IHTMLStyle4 *iface)
4091 return CONTAINING_RECORD(iface, HTMLStyle, IHTMLStyle4_iface);
4094 static HRESULT WINAPI HTMLStyle4_QueryInterface(IHTMLStyle4 *iface, REFIID riid, void **ppv)
4096 HTMLStyle *This = impl_from_IHTMLStyle4(iface);
4098 return IHTMLStyle_QueryInterface(&This->IHTMLStyle_iface, riid, ppv);
4101 static ULONG WINAPI HTMLStyle4_AddRef(IHTMLStyle4 *iface)
4103 HTMLStyle *This = impl_from_IHTMLStyle4(iface);
4105 return IHTMLStyle_AddRef(&This->IHTMLStyle_iface);
4108 static ULONG WINAPI HTMLStyle4_Release(IHTMLStyle4 *iface)
4110 HTMLStyle *This = impl_from_IHTMLStyle4(iface);
4112 return IHTMLStyle_Release(&This->IHTMLStyle_iface);
4115 static HRESULT WINAPI HTMLStyle4_GetTypeInfoCount(IHTMLStyle4 *iface, UINT *pctinfo)
4117 HTMLStyle *This = impl_from_IHTMLStyle4(iface);
4118 return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
4121 static HRESULT WINAPI HTMLStyle4_GetTypeInfo(IHTMLStyle4 *iface, UINT iTInfo,
4122 LCID lcid, ITypeInfo **ppTInfo)
4124 HTMLStyle *This = impl_from_IHTMLStyle4(iface);
4125 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
4128 static HRESULT WINAPI HTMLStyle4_GetIDsOfNames(IHTMLStyle4 *iface, REFIID riid,
4129 LPOLESTR *rgszNames, UINT cNames,
4130 LCID lcid, DISPID *rgDispId)
4132 HTMLStyle *This = impl_from_IHTMLStyle4(iface);
4133 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
4134 lcid, rgDispId);
4137 static HRESULT WINAPI HTMLStyle4_Invoke(IHTMLStyle4 *iface, DISPID dispIdMember,
4138 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
4139 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
4141 HTMLStyle *This = impl_from_IHTMLStyle4(iface);
4142 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
4143 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
4146 static HRESULT WINAPI HTMLStyle4_put_textOverflow(IHTMLStyle4 *iface, BSTR v)
4148 HTMLStyle *This = impl_from_IHTMLStyle4(iface);
4149 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4150 return E_NOTIMPL;
4153 static HRESULT WINAPI HTMLStyle4_get_textOverflow(IHTMLStyle4 *iface, BSTR *p)
4155 HTMLStyle *This = impl_from_IHTMLStyle4(iface);
4156 FIXME("(%p)->(%p)\n", This, p);
4157 return E_NOTIMPL;
4160 static HRESULT WINAPI HTMLStyle4_put_minHeight(IHTMLStyle4 *iface, VARIANT v)
4162 HTMLStyle *This = impl_from_IHTMLStyle4(iface);
4164 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
4166 return set_nsstyle_attr_var(This->nsstyle, STYLEID_MIN_HEIGHT, &v, 0);
4169 static HRESULT WINAPI HTMLStyle4_get_minHeight(IHTMLStyle4 *iface, VARIANT *p)
4171 HTMLStyle *This = impl_from_IHTMLStyle4(iface);
4173 TRACE("(%p)->(%p)\n", This, p);
4175 return get_nsstyle_attr_var(This->nsstyle, STYLEID_MIN_HEIGHT, p, 0);
4178 static const IHTMLStyle4Vtbl HTMLStyle4Vtbl = {
4179 HTMLStyle4_QueryInterface,
4180 HTMLStyle4_AddRef,
4181 HTMLStyle4_Release,
4182 HTMLStyle4_GetTypeInfoCount,
4183 HTMLStyle4_GetTypeInfo,
4184 HTMLStyle4_GetIDsOfNames,
4185 HTMLStyle4_Invoke,
4186 HTMLStyle4_put_textOverflow,
4187 HTMLStyle4_get_textOverflow,
4188 HTMLStyle4_put_minHeight,
4189 HTMLStyle4_get_minHeight
4192 static inline HTMLStyle *impl_from_IHTMLStyle5(IHTMLStyle5 *iface)
4194 return CONTAINING_RECORD(iface, HTMLStyle, IHTMLStyle5_iface);
4197 static HRESULT WINAPI HTMLStyle5_QueryInterface(IHTMLStyle5 *iface, REFIID riid, void **ppv)
4199 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4201 return IHTMLStyle_QueryInterface(&This->IHTMLStyle_iface, riid, ppv);
4204 static ULONG WINAPI HTMLStyle5_AddRef(IHTMLStyle5 *iface)
4206 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4208 return IHTMLStyle_AddRef(&This->IHTMLStyle_iface);
4211 static ULONG WINAPI HTMLStyle5_Release(IHTMLStyle5 *iface)
4213 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4215 return IHTMLStyle_Release(&This->IHTMLStyle_iface);
4218 static HRESULT WINAPI HTMLStyle5_GetTypeInfoCount(IHTMLStyle5 *iface, UINT *pctinfo)
4220 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4221 return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
4224 static HRESULT WINAPI HTMLStyle5_GetTypeInfo(IHTMLStyle5 *iface, UINT iTInfo,
4225 LCID lcid, ITypeInfo **ppTInfo)
4227 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4228 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
4231 static HRESULT WINAPI HTMLStyle5_GetIDsOfNames(IHTMLStyle5 *iface, REFIID riid,
4232 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
4234 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4235 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
4236 lcid, rgDispId);
4239 static HRESULT WINAPI HTMLStyle5_Invoke(IHTMLStyle5 *iface, DISPID dispIdMember,
4240 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
4241 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
4243 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4244 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
4245 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
4248 static HRESULT WINAPI HTMLStyle5_put_msInterpolationMode(IHTMLStyle5 *iface, BSTR v)
4250 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4251 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4252 return E_NOTIMPL;
4255 static HRESULT WINAPI HTMLStyle5_get_msInterpolationMode(IHTMLStyle5 *iface, BSTR *p)
4257 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4258 FIXME("(%p)->(%p)\n", This, p);
4259 return E_NOTIMPL;
4262 static HRESULT WINAPI HTMLStyle5_put_maxHeight(IHTMLStyle5 *iface, VARIANT v)
4264 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4266 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
4268 return set_nsstyle_attr_var(This->nsstyle, STYLEID_MAX_HEIGHT, &v, ATTR_FIX_PX);
4271 static HRESULT WINAPI HTMLStyle5_get_maxHeight(IHTMLStyle5 *iface, VARIANT *p)
4273 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4275 TRACE("(%p)->(%s)\n", This, debugstr_variant(p));
4277 return get_nsstyle_attr_var(This->nsstyle, STYLEID_MAX_HEIGHT, p, 0);
4280 static HRESULT WINAPI HTMLStyle5_put_minWidth(IHTMLStyle5 *iface, VARIANT v)
4282 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4284 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
4286 return set_nsstyle_attr_var(This->nsstyle, STYLEID_MIN_WIDTH, &v, ATTR_FIX_PX);
4289 static HRESULT WINAPI HTMLStyle5_get_minWidth(IHTMLStyle5 *iface, VARIANT *p)
4291 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4293 TRACE("(%p)->(%p)\n", This, p);
4295 return get_nsstyle_attr_var(This->nsstyle, STYLEID_MIN_WIDTH, p, 0);
4298 static HRESULT WINAPI HTMLStyle5_put_maxWidth(IHTMLStyle5 *iface, VARIANT v)
4300 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4302 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
4304 return set_nsstyle_attr_var(This->nsstyle, STYLEID_MAX_WIDTH, &v, ATTR_FIX_PX);
4307 static HRESULT WINAPI HTMLStyle5_get_maxWidth(IHTMLStyle5 *iface, VARIANT *p)
4309 HTMLStyle *This = impl_from_IHTMLStyle5(iface);
4311 TRACE("(%p)->(%p)\n", This, p);
4313 return get_nsstyle_attr_var(This->nsstyle, STYLEID_MAX_WIDTH, p, 0);
4316 static const IHTMLStyle5Vtbl HTMLStyle5Vtbl = {
4317 HTMLStyle5_QueryInterface,
4318 HTMLStyle5_AddRef,
4319 HTMLStyle5_Release,
4320 HTMLStyle5_GetTypeInfoCount,
4321 HTMLStyle5_GetTypeInfo,
4322 HTMLStyle5_GetIDsOfNames,
4323 HTMLStyle5_Invoke,
4324 HTMLStyle5_put_msInterpolationMode,
4325 HTMLStyle5_get_msInterpolationMode,
4326 HTMLStyle5_put_maxHeight,
4327 HTMLStyle5_get_maxHeight,
4328 HTMLStyle5_put_minWidth,
4329 HTMLStyle5_get_minWidth,
4330 HTMLStyle5_put_maxWidth,
4331 HTMLStyle5_get_maxWidth
4334 static inline HTMLStyle *impl_from_IHTMLStyle6(IHTMLStyle6 *iface)
4336 return CONTAINING_RECORD(iface, HTMLStyle, IHTMLStyle6_iface);
4339 static HRESULT WINAPI HTMLStyle6_QueryInterface(IHTMLStyle6 *iface, REFIID riid, void **ppv)
4341 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4343 return IHTMLStyle_QueryInterface(&This->IHTMLStyle_iface, riid, ppv);
4346 static ULONG WINAPI HTMLStyle6_AddRef(IHTMLStyle6 *iface)
4348 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4350 return IHTMLStyle_AddRef(&This->IHTMLStyle_iface);
4353 static ULONG WINAPI HTMLStyle6_Release(IHTMLStyle6 *iface)
4355 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4357 return IHTMLStyle_Release(&This->IHTMLStyle_iface);
4360 static HRESULT WINAPI HTMLStyle6_GetTypeInfoCount(IHTMLStyle6 *iface, UINT *pctinfo)
4362 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4363 return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
4366 static HRESULT WINAPI HTMLStyle6_GetTypeInfo(IHTMLStyle6 *iface, UINT iTInfo,
4367 LCID lcid, ITypeInfo **ppTInfo)
4369 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4370 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
4373 static HRESULT WINAPI HTMLStyle6_GetIDsOfNames(IHTMLStyle6 *iface, REFIID riid,
4374 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
4376 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4377 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
4378 lcid, rgDispId);
4381 static HRESULT WINAPI HTMLStyle6_Invoke(IHTMLStyle6 *iface, DISPID dispIdMember,
4382 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
4383 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
4385 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4386 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
4387 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
4390 static HRESULT WINAPI HTMLStyle6_put_content(IHTMLStyle6 *iface, BSTR v)
4392 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4393 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4394 return E_NOTIMPL;
4397 static HRESULT WINAPI HTMLStyle6_get_content(IHTMLStyle6 *iface, BSTR *p)
4399 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4400 FIXME("(%p)->(%p)\n", This, p);
4401 return E_NOTIMPL;
4404 static HRESULT WINAPI HTMLStyle6_put_contentSide(IHTMLStyle6 *iface, BSTR v)
4406 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4407 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4408 return E_NOTIMPL;
4411 static HRESULT WINAPI HTMLStyle6_get_contentSide(IHTMLStyle6 *iface, BSTR *p)
4413 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4414 FIXME("(%p)->(%p)\n", This, p);
4415 return E_NOTIMPL;
4418 static HRESULT WINAPI HTMLStyle6_put_counterIncrement(IHTMLStyle6 *iface, BSTR v)
4420 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4421 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4422 return E_NOTIMPL;
4425 static HRESULT WINAPI HTMLStyle6_get_counterIncrement(IHTMLStyle6 *iface, BSTR *p)
4427 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4428 FIXME("(%p)->(%p)\n", This, p);
4429 return E_NOTIMPL;
4432 static HRESULT WINAPI HTMLStyle6_put_counterReset(IHTMLStyle6 *iface, BSTR v)
4434 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4435 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4436 return E_NOTIMPL;
4439 static HRESULT WINAPI HTMLStyle6_get_counterReset(IHTMLStyle6 *iface, BSTR *p)
4441 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4442 FIXME("(%p)->(%p)\n", This, p);
4443 return E_NOTIMPL;
4446 static HRESULT WINAPI HTMLStyle6_put_outline(IHTMLStyle6 *iface, BSTR v)
4448 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4450 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
4452 return set_nsstyle_attr(This->nsstyle, STYLEID_OUTLINE, v, 0);
4455 static HRESULT WINAPI HTMLStyle6_get_outline(IHTMLStyle6 *iface, BSTR *p)
4457 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4459 TRACE("(%p)->(%p)\n", This, p);
4461 return get_nsstyle_attr(This->nsstyle, STYLEID_OUTLINE, p, ATTR_NO_NULL);
4464 static HRESULT WINAPI HTMLStyle6_put_outlineWidth(IHTMLStyle6 *iface, VARIANT v)
4466 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4467 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
4468 return E_NOTIMPL;
4471 static HRESULT WINAPI HTMLStyle6_get_outlineWidth(IHTMLStyle6 *iface, VARIANT *p)
4473 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4474 FIXME("(%p)->(%p)\n", This, p);
4475 return E_NOTIMPL;
4478 static HRESULT WINAPI HTMLStyle6_put_outlineStyle(IHTMLStyle6 *iface, BSTR v)
4480 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4481 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4482 return E_NOTIMPL;
4485 static HRESULT WINAPI HTMLStyle6_get_outlineStyle(IHTMLStyle6 *iface, BSTR *p)
4487 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4488 FIXME("(%p)->(%p)\n", This, p);
4489 return E_NOTIMPL;
4492 static HRESULT WINAPI HTMLStyle6_put_outlineColor(IHTMLStyle6 *iface, VARIANT v)
4494 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4495 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
4496 return E_NOTIMPL;
4499 static HRESULT WINAPI HTMLStyle6_get_outlineColor(IHTMLStyle6 *iface, VARIANT *p)
4501 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4502 FIXME("(%p)->(%p)\n", This, p);
4503 return E_NOTIMPL;
4506 static HRESULT WINAPI HTMLStyle6_put_boxSizing(IHTMLStyle6 *iface, BSTR v)
4508 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4510 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
4512 return set_nsstyle_attr(This->nsstyle, STYLEID_BOX_SIZING, v, 0);
4515 static HRESULT WINAPI HTMLStyle6_get_boxSizing(IHTMLStyle6 *iface, BSTR *p)
4517 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4519 TRACE("(%p)->(%p)\n", This, p);
4521 return get_nsstyle_attr(This->nsstyle, STYLEID_BOX_SIZING, p, 0);
4524 static HRESULT WINAPI HTMLStyle6_put_boxSpacing(IHTMLStyle6 *iface, BSTR v)
4526 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4527 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4528 return E_NOTIMPL;
4531 static HRESULT WINAPI HTMLStyle6_get_boxSpacing(IHTMLStyle6 *iface, BSTR *p)
4533 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4534 FIXME("(%p)->(%p)\n", This, p);
4535 return E_NOTIMPL;
4538 static HRESULT WINAPI HTMLStyle6_put_orphans(IHTMLStyle6 *iface, VARIANT v)
4540 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4541 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
4542 return E_NOTIMPL;
4545 static HRESULT WINAPI HTMLStyle6_get_orphans(IHTMLStyle6 *iface, VARIANT *p)
4547 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4548 FIXME("(%p)->(%p)\n", This, p);
4549 return E_NOTIMPL;
4552 static HRESULT WINAPI HTMLStyle6_put_windows(IHTMLStyle6 *iface, VARIANT v)
4554 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4555 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
4556 return E_NOTIMPL;
4559 static HRESULT WINAPI HTMLStyle6_get_windows(IHTMLStyle6 *iface, VARIANT *p)
4561 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4562 FIXME("(%p)->(%p)\n", This, p);
4563 return E_NOTIMPL;
4566 static HRESULT WINAPI HTMLStyle6_put_pageBreakInside(IHTMLStyle6 *iface, BSTR v)
4568 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4569 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4570 return E_NOTIMPL;
4573 static HRESULT WINAPI HTMLStyle6_get_pageBreakInside(IHTMLStyle6 *iface, BSTR *p)
4575 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4576 FIXME("(%p)->(%p)\n", This, p);
4577 return E_NOTIMPL;
4580 static HRESULT WINAPI HTMLStyle6_put_emptyCells(IHTMLStyle6 *iface, BSTR v)
4582 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4583 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4584 return E_NOTIMPL;
4587 static HRESULT WINAPI HTMLStyle6_get_emptyCells(IHTMLStyle6 *iface, BSTR *p)
4589 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4590 FIXME("(%p)->(%p)\n", This, p);
4591 return E_NOTIMPL;
4594 static HRESULT WINAPI HTMLStyle6_put_msBlockProgression(IHTMLStyle6 *iface, BSTR v)
4596 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4597 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4598 return E_NOTIMPL;
4601 static HRESULT WINAPI HTMLStyle6_get_msBlockProgression(IHTMLStyle6 *iface, BSTR *p)
4603 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4604 FIXME("(%p)->(%p)\n", This, p);
4605 return E_NOTIMPL;
4608 static HRESULT WINAPI HTMLStyle6_put_quotes(IHTMLStyle6 *iface, BSTR v)
4610 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4611 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
4612 return E_NOTIMPL;
4615 static HRESULT WINAPI HTMLStyle6_get_quotes(IHTMLStyle6 *iface, BSTR *p)
4617 HTMLStyle *This = impl_from_IHTMLStyle6(iface);
4618 FIXME("(%p)->(%p)\n", This, p);
4619 return E_NOTIMPL;
4622 static const IHTMLStyle6Vtbl HTMLStyle6Vtbl = {
4623 HTMLStyle6_QueryInterface,
4624 HTMLStyle6_AddRef,
4625 HTMLStyle6_Release,
4626 HTMLStyle6_GetTypeInfoCount,
4627 HTMLStyle6_GetTypeInfo,
4628 HTMLStyle6_GetIDsOfNames,
4629 HTMLStyle6_Invoke,
4630 HTMLStyle6_put_content,
4631 HTMLStyle6_get_content,
4632 HTMLStyle6_put_contentSide,
4633 HTMLStyle6_get_contentSide,
4634 HTMLStyle6_put_counterIncrement,
4635 HTMLStyle6_get_counterIncrement,
4636 HTMLStyle6_put_counterReset,
4637 HTMLStyle6_get_counterReset,
4638 HTMLStyle6_put_outline,
4639 HTMLStyle6_get_outline,
4640 HTMLStyle6_put_outlineWidth,
4641 HTMLStyle6_get_outlineWidth,
4642 HTMLStyle6_put_outlineStyle,
4643 HTMLStyle6_get_outlineStyle,
4644 HTMLStyle6_put_outlineColor,
4645 HTMLStyle6_get_outlineColor,
4646 HTMLStyle6_put_boxSizing,
4647 HTMLStyle6_get_boxSizing,
4648 HTMLStyle6_put_boxSpacing,
4649 HTMLStyle6_get_boxSpacing,
4650 HTMLStyle6_put_orphans,
4651 HTMLStyle6_get_orphans,
4652 HTMLStyle6_put_windows,
4653 HTMLStyle6_get_windows,
4654 HTMLStyle6_put_pageBreakInside,
4655 HTMLStyle6_get_pageBreakInside,
4656 HTMLStyle6_put_emptyCells,
4657 HTMLStyle6_get_emptyCells,
4658 HTMLStyle6_put_msBlockProgression,
4659 HTMLStyle6_get_msBlockProgression,
4660 HTMLStyle6_put_quotes,
4661 HTMLStyle6_get_quotes
4664 static HRESULT HTMLStyle_get_dispid(DispatchEx *dispex, BSTR name, DWORD flags, DISPID *dispid)
4666 const style_tbl_entry_t *style_entry;
4668 style_entry = lookup_style_tbl(name);
4669 if(style_entry) {
4670 *dispid = style_entry->dispid;
4671 return S_OK;
4674 return DISP_E_UNKNOWNNAME;
4677 static const dispex_static_data_vtbl_t HTMLStyle_dispex_vtbl = {
4678 NULL,
4679 HTMLStyle_get_dispid,
4680 NULL,
4681 NULL
4684 static const tid_t HTMLStyle_iface_tids[] = {
4685 IHTMLStyle6_tid,
4686 IHTMLStyle5_tid,
4687 IHTMLStyle4_tid,
4688 IHTMLStyle3_tid,
4689 IHTMLStyle2_tid,
4690 IHTMLStyle_tid,
4693 static dispex_static_data_t HTMLStyle_dispex = {
4694 &HTMLStyle_dispex_vtbl,
4695 DispHTMLStyle_tid,
4696 HTMLStyle_iface_tids
4699 static HRESULT get_style_from_elem(HTMLElement *elem, nsIDOMCSSStyleDeclaration **ret)
4701 nsIDOMElementCSSInlineStyle *nselemstyle;
4702 nsresult nsres;
4704 if(!elem->dom_element) {
4705 FIXME("comment element\n");
4706 return E_NOTIMPL;
4709 nsres = nsIDOMElement_QueryInterface(elem->dom_element, &IID_nsIDOMElementCSSInlineStyle,
4710 (void**)&nselemstyle);
4711 assert(nsres == NS_OK);
4713 nsres = nsIDOMElementCSSInlineStyle_GetStyle(nselemstyle, ret);
4714 nsIDOMElementCSSInlineStyle_Release(nselemstyle);
4715 if(NS_FAILED(nsres)) {
4716 ERR("GetStyle failed: %08x\n", nsres);
4717 return E_FAIL;
4720 return S_OK;
4723 HRESULT HTMLStyle_Create(HTMLElement *elem, HTMLStyle **ret)
4725 nsIDOMCSSStyleDeclaration *nsstyle;
4726 HTMLStyle *style;
4727 HRESULT hres;
4729 hres = get_style_from_elem(elem, &nsstyle);
4730 if(FAILED(hres))
4731 return hres;
4733 style = heap_alloc_zero(sizeof(HTMLStyle));
4734 if(!style) {
4735 nsIDOMCSSStyleDeclaration_Release(nsstyle);
4736 return E_OUTOFMEMORY;
4739 style->IHTMLStyle_iface.lpVtbl = &HTMLStyleVtbl;
4740 style->IHTMLStyle2_iface.lpVtbl = &HTMLStyle2Vtbl;
4741 style->IHTMLStyle3_iface.lpVtbl = &HTMLStyle3Vtbl;
4742 style->IHTMLStyle4_iface.lpVtbl = &HTMLStyle4Vtbl;
4743 style->IHTMLStyle5_iface.lpVtbl = &HTMLStyle5Vtbl;
4744 style->IHTMLStyle6_iface.lpVtbl = &HTMLStyle6Vtbl;
4746 style->ref = 1;
4747 style->nsstyle = nsstyle;
4748 style->elem = elem;
4750 nsIDOMCSSStyleDeclaration_AddRef(nsstyle);
4752 init_dispex(&style->dispex, (IUnknown*)&style->IHTMLStyle_iface, &HTMLStyle_dispex);
4754 *ret = style;
4755 return S_OK;
4758 HRESULT get_elem_style(HTMLElement *elem, styleid_t styleid, BSTR *ret)
4760 nsIDOMCSSStyleDeclaration *style;
4761 HRESULT hres;
4763 hres = get_style_from_elem(elem, &style);
4764 if(FAILED(hres))
4765 return hres;
4767 hres = get_nsstyle_attr(style, styleid, ret, 0);
4768 nsIDOMCSSStyleDeclaration_Release(style);
4769 return hres;
4772 HRESULT set_elem_style(HTMLElement *elem, styleid_t styleid, const WCHAR *val)
4774 nsIDOMCSSStyleDeclaration *style;
4775 HRESULT hres;
4777 hres = get_style_from_elem(elem, &style);
4778 if(FAILED(hres))
4779 return hres;
4781 hres = set_nsstyle_attr(style, styleid, val, 0);
4782 nsIDOMCSSStyleDeclaration_Release(style);
4783 return hres;