mapi32/tests: Fix typo.
[wine] / dlls / mshtml / htmlstyle.c
1 /*
2  * Copyright 2006 Jacek Caban for CodeWeavers
3  *
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.
8  *
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.
13  *
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
17  */
18
19 #include <stdarg.h>
20 #include <math.h>
21
22 #define COBJMACROS
23
24 #include "windef.h"
25 #include "winbase.h"
26 #include "winuser.h"
27 #include "ole2.h"
28 #include "mshtmdid.h"
29
30 #include "mshtml_private.h"
31 #include "htmlstyle.h"
32
33 #include "wine/debug.h"
34 #include "wine/unicode.h"
35
36 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
37
38 static const WCHAR attrBackground[] =
39     {'b','a','c','k','g','r','o','u','n','d',0};
40 static const WCHAR attrBackgroundColor[] =
41     {'b','a','c','k','g','r','o','u','n','d','-','c','o','l','o','r',0};
42 static const WCHAR attrBackgroundImage[] =
43     {'b','a','c','k','g','r','o','u','n','d','-','i','m','a','g','e',0};
44 static const WCHAR attrBorder[] =
45     {'b','o','r','d','e','r',0};
46 static const WCHAR attrBorderBottomStyle[] =
47     {'b','o','r','d','e','r','-','b','o','t','t','o','m','-','s','t','y','l','e',0};
48 static const WCHAR attrBorderLeft[] =
49     {'b','o','r','d','e','r','-','l','e','f','t',0};
50 static const WCHAR attrBorderLeftStyle[] =
51     {'b','o','r','d','e','r','-','l','e','f','t','-','s','t','y','l','e',0};
52 static const WCHAR attrBorderRightStyle[] =
53     {'b','o','r','d','e','r','-','r','i','g','h','t','-','s','t','y','l','e',0};
54 static const WCHAR attrBorderTopStyle[] =
55     {'b','o','r','d','e','r','-','t','o','p','-','s','t','y','l','e',0};
56 static const WCHAR attrBorderWidth[] =
57     {'b','o','r','d','e','r','-','w','i','d','t','h',0};
58 static const WCHAR attrColor[] =
59     {'c','o','l','o','r',0};
60 static const WCHAR attrCursor[] =
61     {'c','u','r','s','o','r',0};
62 static const WCHAR attrDisplay[] =
63     {'d','i','s','p','l','a','y',0};
64 static const WCHAR attrFilter[] =
65     {'f','i','l','e','t','e','r',0};
66 static const WCHAR attrFontFamily[] =
67     {'f','o','n','t','-','f','a','m','i','l','y',0};
68 static const WCHAR attrFontSize[] =
69     {'f','o','n','t','-','s','i','z','e',0};
70 static const WCHAR attrFontStyle[] =
71     {'f','o','n','t','-','s','t','y','l','e',0};
72 static const WCHAR attrFontVariant[] =
73     {'f','o','n','t','-','v','a','r','i','a','n','t',0};
74 static const WCHAR attrFontWeight[] =
75     {'f','o','n','t','-','w','e','i','g','h','t',0};
76 static const WCHAR attrHeight[] =
77     {'h','e','i','g','h','t',0};
78 static const WCHAR attrLeft[] =
79     {'l','e','f','t',0};
80 static const WCHAR attrMargin[] =
81     {'m','a','r','g','i','n',0};
82 static const WCHAR attrMarginLeft[] =
83     {'m','a','r','g','i','n','-','l','e','f','t',0};
84 static const WCHAR attrMarginRight[] =
85     {'m','a','r','g','i','n','-','r','i','g','h','t',0};
86 static const WCHAR attrOverflow[] =
87     {'o','v','e','r','f','l','o','w',0};
88 static const WCHAR attrPaddingLeft[] =
89     {'p','a','d','d','i','n','g','-','l','e','f','t',0};
90 static const WCHAR attrPosition[] =
91     {'p','o','s','i','t','i','o','n',0};
92 static const WCHAR attrTextAlign[] =
93     {'t','e','x','t','-','a','l','i','g','n',0};
94 static const WCHAR attrTextDecoration[] =
95     {'t','e','x','t','-','d','e','c','o','r','a','t','i','o','n',0};
96 static const WCHAR attrTop[] =
97     {'t','o','p',0};
98 static const WCHAR attrVerticalAlign[] =
99     {'v','e','r','t','i','c','a','l','-','a','l','i','g','n',0};
100 static const WCHAR attrVisibility[] =
101     {'v','i','s','i','b','i','l','i','t','y',0};
102 static const WCHAR attrWidth[] =
103     {'w','i','d','t','h',0};
104 static const WCHAR attrZIndex[] =
105     {'z','-','i','n','d','e','x',0};
106
107 static const struct{
108     const WCHAR *name;
109     DISPID dispid;
110 } style_tbl[] = {
111     {attrBackground,           DISPID_IHTMLSTYLE_BACKGROUND},
112     {attrBackgroundColor,      DISPID_IHTMLSTYLE_BACKGROUNDCOLOR},
113     {attrBackgroundImage,      DISPID_IHTMLSTYLE_BACKGROUNDIMAGE},
114     {attrBorder,               DISPID_IHTMLSTYLE_BORDER},
115     {attrBorderBottomStyle,    DISPID_IHTMLSTYLE_BORDERBOTTOMSTYLE},
116     {attrBorderLeft,           DISPID_IHTMLSTYLE_BORDERLEFT},
117     {attrBorderLeftStyle,      DISPID_IHTMLSTYLE_BORDERLEFTSTYLE},
118     {attrBorderRightStyle,     DISPID_IHTMLSTYLE_BORDERRIGHTSTYLE},
119     {attrBorderTopStyle,       DISPID_IHTMLSTYLE_BORDERTOPSTYLE},
120     {attrBorderWidth,          DISPID_IHTMLSTYLE_BORDERWIDTH},
121     {attrColor,                DISPID_IHTMLSTYLE_COLOR},
122     {attrCursor,               DISPID_IHTMLSTYLE_CURSOR},
123     {attrDisplay,              DISPID_IHTMLSTYLE_DISPLAY},
124     {attrFilter,               DISPID_IHTMLSTYLE_FILTER},
125     {attrFontFamily,           DISPID_IHTMLSTYLE_FONTFAMILY},
126     {attrFontSize,             DISPID_IHTMLSTYLE_FONTSIZE},
127     {attrFontStyle,            DISPID_IHTMLSTYLE_FONTSTYLE},
128     {attrFontVariant,          DISPID_IHTMLSTYLE_FONTVARIANT},
129     {attrFontWeight,           DISPID_IHTMLSTYLE_FONTWEIGHT},
130     {attrHeight,               DISPID_IHTMLSTYLE_HEIGHT},
131     {attrLeft,                 DISPID_IHTMLSTYLE_LEFT},
132     {attrMargin,               DISPID_IHTMLSTYLE_MARGIN},
133     {attrMarginLeft,           DISPID_IHTMLSTYLE_MARGINLEFT},
134     {attrMarginRight,          DISPID_IHTMLSTYLE_MARGINRIGHT},
135     {attrOverflow,             DISPID_IHTMLSTYLE_OVERFLOW},
136     {attrPaddingLeft,          DISPID_IHTMLSTYLE_PADDINGLEFT},
137     {attrPosition,             DISPID_IHTMLSTYLE2_POSITION},
138     {attrTextAlign,            DISPID_IHTMLSTYLE_TEXTALIGN},
139     {attrTextDecoration,       DISPID_IHTMLSTYLE_TEXTDECORATION},
140     {attrTop,                  DISPID_IHTMLSTYLE_TOP},
141     {attrVerticalAlign,        DISPID_IHTMLSTYLE_VERTICALALIGN},
142     {attrVisibility,           DISPID_IHTMLSTYLE_VISIBILITY},
143     {attrWidth,                DISPID_IHTMLSTYLE_WIDTH},
144     {attrZIndex,               DISPID_IHTMLSTYLE_ZINDEX}
145 };
146
147 static const WCHAR valLineThrough[] =
148     {'l','i','n','e','-','t','h','r','o','u','g','h',0};
149 static const WCHAR valUnderline[] =
150     {'u','n','d','e','r','l','i','n','e',0};
151 static const WCHAR szNormal[] =
152     {'n','o','r','m','a','l',0};
153
154 static const WCHAR px_formatW[] = {'%','d','p','x',0};
155 static const WCHAR emptyW[] = {0};
156
157 static LPWSTR fix_px_value(LPCWSTR val)
158 {
159     LPCWSTR ptr = val;
160
161     while(*ptr) {
162         while(*ptr && isspaceW(*ptr))
163             ptr++;
164         if(!*ptr)
165             break;
166
167         while(*ptr && isdigitW(*ptr))
168             ptr++;
169
170         if(!*ptr || isspaceW(*ptr)) {
171             LPWSTR ret, p;
172             int len = strlenW(val)+1;
173
174             ret = heap_alloc((len+2)*sizeof(WCHAR));
175             memcpy(ret, val, (ptr-val)*sizeof(WCHAR));
176             p = ret + (ptr-val);
177             *p++ = 'p';
178             *p++ = 'x';
179             strcpyW(p, ptr);
180
181             TRACE("fixed %s -> %s\n", debugstr_w(val), debugstr_w(ret));
182
183             return ret;
184         }
185
186         while(*ptr && !isspaceW(*ptr))
187             ptr++;
188     }
189
190     return NULL;
191 }
192
193 static LPWSTR fix_url_value(LPCWSTR val)
194 {
195     WCHAR *ret, *ptr;
196
197     static const WCHAR urlW[] = {'u','r','l','('};
198
199     if(strncmpW(val, urlW, sizeof(urlW)/sizeof(WCHAR)) || !strchrW(val, '\\'))
200         return NULL;
201
202     ret = heap_strdupW(val);
203
204     for(ptr = ret; *ptr; ptr++) {
205         if(*ptr == '\\')
206             *ptr = '/';
207     }
208
209     return ret;
210 }
211
212 #define ATTR_FIX_PX      1
213 #define ATTR_FIX_URL     2
214 #define ATTR_STR_TO_INT  4
215
216 HRESULT set_nsstyle_attr(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, LPCWSTR value, DWORD flags)
217 {
218     nsAString str_name, str_value, str_empty;
219     LPWSTR val = NULL;
220     nsresult nsres;
221
222     static const PRUnichar wszEmpty[] = {0};
223
224     if(flags & ATTR_FIX_PX)
225         val = fix_px_value(value);
226     if(flags & ATTR_FIX_URL)
227         val = fix_url_value(value);
228
229     nsAString_Init(&str_name, style_tbl[sid].name);
230     nsAString_Init(&str_value, val ? val : value);
231     nsAString_Init(&str_empty, wszEmpty);
232     heap_free(val);
233
234     nsres = nsIDOMCSSStyleDeclaration_SetProperty(nsstyle, &str_name, &str_value, &str_empty);
235     if(NS_FAILED(nsres))
236         ERR("SetProperty failed: %08x\n", nsres);
237
238     nsAString_Finish(&str_name);
239     nsAString_Finish(&str_value);
240     nsAString_Finish(&str_empty);
241
242     return S_OK;
243 }
244
245 static HRESULT set_nsstyle_attr_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, VARIANT *value, DWORD flags)
246 {
247     switch(V_VT(value)) {
248     case VT_NULL:
249         return set_nsstyle_attr(nsstyle, sid, emptyW, flags);
250
251     case VT_BSTR:
252         return set_nsstyle_attr(nsstyle, sid, V_BSTR(value), flags);
253
254     default:
255         FIXME("not implemented vt %d\n", V_VT(value));
256         return E_NOTIMPL;
257
258     }
259
260     return S_OK;
261 }
262
263 static inline HRESULT set_style_attr(HTMLStyle *This, styleid_t sid, LPCWSTR value, DWORD flags)
264 {
265     return set_nsstyle_attr(This->nsstyle, sid, value, flags);
266 }
267
268 static HRESULT get_nsstyle_attr_nsval(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, nsAString *value)
269 {
270     nsAString str_name;
271     nsresult nsres;
272
273     nsAString_Init(&str_name, style_tbl[sid].name);
274
275     nsres = nsIDOMCSSStyleDeclaration_GetPropertyValue(nsstyle, &str_name, value);
276     if(NS_FAILED(nsres)) {
277         ERR("SetProperty failed: %08x\n", nsres);
278         return E_FAIL;
279     }
280
281     nsAString_Finish(&str_name);
282
283     return NS_OK;
284 }
285
286 HRESULT get_nsstyle_attr(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, BSTR *p)
287 {
288     nsAString str_value;
289     const PRUnichar *value;
290
291     nsAString_Init(&str_value, NULL);
292
293     get_nsstyle_attr_nsval(nsstyle, sid, &str_value);
294
295     nsAString_GetData(&str_value, &value);
296     *p = *value ? SysAllocString(value) : NULL;
297
298     nsAString_Finish(&str_value);
299
300     TRACE("%s -> %s\n", debugstr_w(style_tbl[sid].name), debugstr_w(*p));
301     return S_OK;
302 }
303
304 static HRESULT get_nsstyle_attr_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, VARIANT *p, DWORD flags)
305 {
306     nsAString str_value;
307     const PRUnichar *value;
308     BOOL set = FALSE;
309
310     nsAString_Init(&str_value, NULL);
311
312     get_nsstyle_attr_nsval(nsstyle, sid, &str_value);
313
314     nsAString_GetData(&str_value, &value);
315
316     if(flags & ATTR_STR_TO_INT) {
317         const PRUnichar *ptr = value;
318         BOOL neg = FALSE;
319         INT i = 0;
320
321         if(*ptr == '-') {
322             neg = TRUE;
323             ptr++;
324         }
325
326         while(isdigitW(*ptr))
327             i = i*10 + (*ptr++ - '0');
328
329         if(!*ptr) {
330             V_VT(p) = VT_I4;
331             V_I4(p) = neg ? -i : i;
332             set = TRUE;
333         }
334     }
335
336     if(!set) {
337         BSTR str = NULL;
338
339         if(*value) {
340             str = SysAllocString(value);
341             if(!str)
342                 return E_OUTOFMEMORY;
343         }
344
345         V_VT(p) = VT_BSTR;
346         V_BSTR(p) = str;
347     }
348
349     nsAString_Finish(&str_value);
350
351     TRACE("%s -> %s\n", debugstr_w(style_tbl[sid].name), debugstr_variant(p));
352     return S_OK;
353 }
354
355 static inline HRESULT get_style_attr(HTMLStyle *This, styleid_t sid, BSTR *p)
356 {
357     return get_nsstyle_attr(This->nsstyle, sid, p);
358 }
359
360 static HRESULT check_style_attr_value(HTMLStyle *This, styleid_t sid, LPCWSTR exval, VARIANT_BOOL *p)
361 {
362     nsAString str_value;
363     const PRUnichar *value;
364
365     nsAString_Init(&str_value, NULL);
366
367     get_nsstyle_attr_nsval(This->nsstyle, sid, &str_value);
368
369     nsAString_GetData(&str_value, &value);
370     *p = strcmpW(value, exval) ? VARIANT_FALSE : VARIANT_TRUE;
371     nsAString_Finish(&str_value);
372
373     TRACE("%s -> %x\n", debugstr_w(style_tbl[sid].name), *p);
374     return S_OK;
375 }
376
377 static inline HRESULT set_style_pos(HTMLStyle *This, styleid_t sid, float value)
378 {
379     WCHAR szValue[25];
380     WCHAR szFormat[] = {'%','.','0','f','p','x',0};
381
382     value = floor(value);
383
384     sprintfW(szValue, szFormat, value);
385
386     return set_style_attr(This, sid, szValue, 0);
387 }
388
389 static HRESULT get_nsstyle_pos(HTMLStyle *This, styleid_t sid, float *p)
390 {
391     nsAString str_value;
392     HRESULT hres;
393     WCHAR pxW[] = {'p','x',0};
394
395     TRACE("%p %d %p\n", This, sid, p);
396
397     *p = 0.0f;
398
399     nsAString_Init(&str_value, NULL);
400
401     hres = get_nsstyle_attr_nsval(This->nsstyle, sid, &str_value);
402     if(hres == S_OK)
403     {
404         WCHAR *ptr;
405         const PRUnichar *value;
406
407         nsAString_GetData(&str_value, &value);
408         if(value)
409         {
410             *p = strtolW(value, &ptr, 10);
411
412             if(*ptr && strcmpW(ptr, pxW))
413             {
414                 nsAString_Finish(&str_value);
415                 FIXME("only px values are currently supported\n");
416                 return E_FAIL;
417             }
418         }
419     }
420
421     TRACE("ret %f\n", *p);
422
423     nsAString_Finish(&str_value);
424
425     return hres;
426 }
427
428 static BOOL is_valid_border_style(BSTR v)
429 {
430     static const WCHAR styleNone[]   = {'n','o','n','e',0};
431     static const WCHAR styleDotted[] = {'d','o','t','t','e','d',0};
432     static const WCHAR styleDashed[] = {'d','a','s','h','e','d',0};
433     static const WCHAR styleSolid[]  = {'s','o','l','i','d',0};
434     static const WCHAR styleDouble[] = {'d','o','u','b','l','e',0};
435     static const WCHAR styleGroove[] = {'g','r','o','o','v','e',0};
436     static const WCHAR styleRidge[]  = {'r','i','d','g','e',0};
437     static const WCHAR styleInset[]  = {'i','n','s','e','t',0};
438     static const WCHAR styleOutset[] = {'o','u','t','s','e','t',0};
439
440     TRACE("%s\n", debugstr_w(v));
441
442     if(!v || strcmpiW(v, styleNone)   == 0 || strcmpiW(v, styleDotted) == 0 ||
443              strcmpiW(v, styleDashed) == 0 || strcmpiW(v, styleSolid)  == 0 ||
444              strcmpiW(v, styleDouble) == 0 || strcmpiW(v, styleGroove) == 0 ||
445              strcmpiW(v, styleRidge)  == 0 || strcmpiW(v, styleInset)  == 0 ||
446              strcmpiW(v, styleOutset) == 0 )
447     {
448         return TRUE;
449     }
450
451     return FALSE;
452 }
453
454 #define HTMLSTYLE_THIS(iface) DEFINE_THIS(HTMLStyle, HTMLStyle, iface)
455
456 static HRESULT WINAPI HTMLStyle_QueryInterface(IHTMLStyle *iface, REFIID riid, void **ppv)
457 {
458     HTMLStyle *This = HTMLSTYLE_THIS(iface);
459
460     *ppv = NULL;
461
462     if(IsEqualGUID(&IID_IUnknown, riid)) {
463         TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
464         *ppv = HTMLSTYLE(This);
465     }else if(IsEqualGUID(&IID_IHTMLStyle, riid)) {
466         TRACE("(%p)->(IID_IHTMLStyle %p)\n", This, ppv);
467         *ppv = HTMLSTYLE(This);
468     }else if(IsEqualGUID(&IID_IHTMLStyle2, riid)) {
469         TRACE("(%p)->(IID_IHTMLStyle2 %p)\n", This, ppv);
470         *ppv = HTMLSTYLE2(This);
471     }else if(IsEqualGUID(&IID_IHTMLStyle3, riid)) {
472         TRACE("(%p)->(IID_IHTMLStyle3 %p)\n", This, ppv);
473         *ppv = HTMLSTYLE3(This);
474     }else if(IsEqualGUID(&IID_IHTMLStyle4, riid)) {
475         TRACE("(%p)->(IID_IHTMLStyle4 %p)\n", This, ppv);
476         *ppv = HTMLSTYLE4(This);
477     }else if(dispex_query_interface(&This->dispex, riid, ppv)) {
478         return *ppv ? S_OK : E_NOINTERFACE;
479     }
480
481     if(*ppv) {
482         IUnknown_AddRef((IUnknown*)*ppv);
483         return S_OK;
484     }
485
486     WARN("unsupported %s\n", debugstr_guid(riid));
487     return E_NOINTERFACE;
488 }
489
490 static ULONG WINAPI HTMLStyle_AddRef(IHTMLStyle *iface)
491 {
492     HTMLStyle *This = HTMLSTYLE_THIS(iface);
493     LONG ref = InterlockedIncrement(&This->ref);
494
495     TRACE("(%p) ref=%d\n", This, ref);
496
497     return ref;
498 }
499
500 static ULONG WINAPI HTMLStyle_Release(IHTMLStyle *iface)
501 {
502     HTMLStyle *This = HTMLSTYLE_THIS(iface);
503     LONG ref = InterlockedDecrement(&This->ref);
504
505     TRACE("(%p) ref=%d\n", This, ref);
506
507     if(!ref) {
508         if(This->nsstyle)
509             nsIDOMCSSStyleDeclaration_Release(This->nsstyle);
510         heap_free(This);
511     }
512
513     return ref;
514 }
515
516 static HRESULT WINAPI HTMLStyle_GetTypeInfoCount(IHTMLStyle *iface, UINT *pctinfo)
517 {
518     HTMLStyle *This = HTMLSTYLE_THIS(iface);
519     return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->dispex), pctinfo);
520 }
521
522 static HRESULT WINAPI HTMLStyle_GetTypeInfo(IHTMLStyle *iface, UINT iTInfo,
523                                               LCID lcid, ITypeInfo **ppTInfo)
524 {
525     HTMLStyle *This = HTMLSTYLE_THIS(iface);
526     return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->dispex), iTInfo, lcid, ppTInfo);
527 }
528
529 static HRESULT WINAPI HTMLStyle_GetIDsOfNames(IHTMLStyle *iface, REFIID riid,
530                                                 LPOLESTR *rgszNames, UINT cNames,
531                                                 LCID lcid, DISPID *rgDispId)
532 {
533     HTMLStyle *This = HTMLSTYLE_THIS(iface);
534     return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->dispex), riid, rgszNames, cNames, lcid, rgDispId);
535 }
536
537 static HRESULT WINAPI HTMLStyle_Invoke(IHTMLStyle *iface, DISPID dispIdMember,
538                             REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
539                             VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
540 {
541     HTMLStyle *This = HTMLSTYLE_THIS(iface);
542     return IDispatchEx_Invoke(DISPATCHEX(&This->dispex), dispIdMember, riid, lcid,
543             wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
544 }
545
546 static HRESULT WINAPI HTMLStyle_put_fontFamily(IHTMLStyle *iface, BSTR v)
547 {
548     HTMLStyle *This = HTMLSTYLE_THIS(iface);
549
550     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
551
552     return set_style_attr(This, STYLEID_FONT_FAMILY, v, 0);
553 }
554
555 static HRESULT WINAPI HTMLStyle_get_fontFamily(IHTMLStyle *iface, BSTR *p)
556 {
557     HTMLStyle *This = HTMLSTYLE_THIS(iface);
558
559     TRACE("(%p)->(%p)\n", This, p);
560
561     return get_style_attr(This, STYLEID_FONT_FAMILY, p);
562 }
563
564 static HRESULT WINAPI HTMLStyle_put_fontStyle(IHTMLStyle *iface, BSTR v)
565 {
566     HTMLStyle *This = HTMLSTYLE_THIS(iface);
567     static const WCHAR szItalic[]  = {'i','t','a','l','i','c',0};
568     static const WCHAR szOblique[]  = {'o','b','l','i','q','u','e',0};
569
570     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
571
572     /* fontStyle can only be one of the follow values. */
573     if(!v || strcmpiW(szNormal, v) == 0 || strcmpiW(szItalic, v) == 0 ||
574              strcmpiW(szOblique, v) == 0)
575     {
576         return set_nsstyle_attr(This->nsstyle, STYLEID_FONT_STYLE, v, 0);
577     }
578
579     return E_INVALIDARG;
580 }
581
582 static HRESULT WINAPI HTMLStyle_get_fontStyle(IHTMLStyle *iface, BSTR *p)
583 {
584     HTMLStyle *This = HTMLSTYLE_THIS(iface);
585
586     TRACE("(%p)->(%p)\n", This, p);
587
588     return get_style_attr(This, STYLEID_FONT_STYLE, p);
589 }
590
591 static HRESULT WINAPI HTMLStyle_put_fontVariant(IHTMLStyle *iface, BSTR v)
592 {
593     HTMLStyle *This = HTMLSTYLE_THIS(iface);
594     static const WCHAR szCaps[]  = {'s','m','a','l','l','-','c','a','p','s',0};
595
596     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
597
598     /* fontVariant can only be one of the follow values. */
599     if(!v || strcmpiW(szNormal, v) == 0 || strcmpiW(szCaps, v) == 0)
600     {
601         return set_nsstyle_attr(This->nsstyle, STYLEID_FONT_VARIANT, v, 0);
602     }
603
604     return E_INVALIDARG;
605 }
606
607 static HRESULT WINAPI HTMLStyle_get_fontVariant(IHTMLStyle *iface, BSTR *p)
608 {
609     HTMLStyle *This = HTMLSTYLE_THIS(iface);
610     TRACE("(%p)->(%p)\n", This, p);
611
612     if(!p)
613        return E_INVALIDARG;
614
615     return get_style_attr(This, STYLEID_FONT_VARIANT, p);
616 }
617
618 static HRESULT WINAPI HTMLStyle_put_fontWeight(IHTMLStyle *iface, BSTR v)
619 {
620     HTMLStyle *This = HTMLSTYLE_THIS(iface);
621     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
622     return E_NOTIMPL;
623 }
624
625 static HRESULT WINAPI HTMLStyle_get_fontWeight(IHTMLStyle *iface, BSTR *p)
626 {
627     HTMLStyle *This = HTMLSTYLE_THIS(iface);
628
629     TRACE("(%p)->(%p)\n", This, p);
630
631     return get_style_attr(This, STYLEID_FONT_WEIGHT, p);
632 }
633
634 static HRESULT WINAPI HTMLStyle_put_fontSize(IHTMLStyle *iface, VARIANT v)
635 {
636     HTMLStyle *This = HTMLSTYLE_THIS(iface);
637
638     TRACE("(%p)->(v%d)\n", This, V_VT(&v));
639
640     switch(V_VT(&v)) {
641     case VT_BSTR:
642         return set_style_attr(This, STYLEID_FONT_SIZE, V_BSTR(&v), 0);
643     default:
644         FIXME("not supported vt %d\n", V_VT(&v));
645     }
646
647     return S_OK;
648 }
649
650 static HRESULT WINAPI HTMLStyle_get_fontSize(IHTMLStyle *iface, VARIANT *p)
651 {
652     HTMLStyle *This = HTMLSTYLE_THIS(iface);
653
654     TRACE("(%p)->(%p)\n", This, p);
655
656     V_VT(p) = VT_BSTR;
657     return get_style_attr(This, STYLEID_FONT_SIZE, &V_BSTR(p));
658 }
659
660 static HRESULT WINAPI HTMLStyle_put_font(IHTMLStyle *iface, BSTR v)
661 {
662     HTMLStyle *This = HTMLSTYLE_THIS(iface);
663     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
664     return E_NOTIMPL;
665 }
666
667 static HRESULT WINAPI HTMLStyle_get_font(IHTMLStyle *iface, BSTR *p)
668 {
669     HTMLStyle *This = HTMLSTYLE_THIS(iface);
670     FIXME("(%p)->(%p)\n", This, p);
671     return E_NOTIMPL;
672 }
673
674 static HRESULT WINAPI HTMLStyle_put_color(IHTMLStyle *iface, VARIANT v)
675 {
676     HTMLStyle *This = HTMLSTYLE_THIS(iface);
677
678     TRACE("(%p)->(v%d)\n", This, V_VT(&v));
679
680     switch(V_VT(&v)) {
681     case VT_BSTR:
682         TRACE("%s\n", debugstr_w(V_BSTR(&v)));
683         return set_style_attr(This, STYLEID_COLOR, V_BSTR(&v), 0);
684
685     default:
686         FIXME("unsupported vt=%d\n", V_VT(&v));
687     }
688
689     return E_NOTIMPL;
690 }
691
692 static HRESULT WINAPI HTMLStyle_get_color(IHTMLStyle *iface, VARIANT *p)
693 {
694     HTMLStyle *This = HTMLSTYLE_THIS(iface);
695
696     TRACE("(%p)->(%p)\n", This, p);
697
698     V_VT(p) = VT_BSTR;
699     return get_style_attr(This, STYLEID_COLOR, &V_BSTR(p));
700 }
701
702 static HRESULT WINAPI HTMLStyle_put_background(IHTMLStyle *iface, BSTR v)
703 {
704     HTMLStyle *This = HTMLSTYLE_THIS(iface);
705
706     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
707
708     return set_style_attr(This, STYLEID_BACKGROUND, v, 0);
709 }
710
711 static HRESULT WINAPI HTMLStyle_get_background(IHTMLStyle *iface, BSTR *p)
712 {
713     HTMLStyle *This = HTMLSTYLE_THIS(iface);
714
715     TRACE("(%p)->(%p)\n", This, p);
716
717     return get_style_attr(This, STYLEID_BACKGROUND, p);
718 }
719
720 static HRESULT WINAPI HTMLStyle_put_backgroundColor(IHTMLStyle *iface, VARIANT v)
721 {
722     HTMLStyle *This = HTMLSTYLE_THIS(iface);
723
724     TRACE("(%p)->(v%d)\n", This, V_VT(&v));
725
726     switch(V_VT(&v)) {
727     case VT_BSTR:
728         return set_style_attr(This, STYLEID_BACKGROUND_COLOR, V_BSTR(&v), 0);
729     case VT_I4: {
730         WCHAR value[10];
731         static const WCHAR format[] = {'#','%','0','6','x',0};
732
733         wsprintfW(value, format, V_I4(&v));
734         return set_style_attr(This, STYLEID_BACKGROUND_COLOR, value, 0);
735     }
736     default:
737         FIXME("unsupported vt %d\n", V_VT(&v));
738     }
739
740     return S_OK;
741 }
742
743 static HRESULT WINAPI HTMLStyle_get_backgroundColor(IHTMLStyle *iface, VARIANT *p)
744 {
745     HTMLStyle *This = HTMLSTYLE_THIS(iface);
746     FIXME("(%p)->(%p)\n", This, p);
747     return E_NOTIMPL;
748 }
749
750 static HRESULT WINAPI HTMLStyle_put_backgroundImage(IHTMLStyle *iface, BSTR v)
751 {
752     HTMLStyle *This = HTMLSTYLE_THIS(iface);
753
754     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
755
756     return set_style_attr(This, STYLEID_BACKGROUND_IMAGE, v, ATTR_FIX_URL);
757 }
758
759 static HRESULT WINAPI HTMLStyle_get_backgroundImage(IHTMLStyle *iface, BSTR *p)
760 {
761     HTMLStyle *This = HTMLSTYLE_THIS(iface);
762
763     TRACE("(%p)->(%p)\n", This, p);
764
765     return get_style_attr(This, STYLEID_BACKGROUND_IMAGE, p);
766 }
767
768 static HRESULT WINAPI HTMLStyle_put_backgroundRepeat(IHTMLStyle *iface, BSTR v)
769 {
770     HTMLStyle *This = HTMLSTYLE_THIS(iface);
771     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
772     return E_NOTIMPL;
773 }
774
775 static HRESULT WINAPI HTMLStyle_get_backgroundRepeat(IHTMLStyle *iface, BSTR *p)
776 {
777     HTMLStyle *This = HTMLSTYLE_THIS(iface);
778     FIXME("(%p)->(%p)\n", This, p);
779     return E_NOTIMPL;
780 }
781
782 static HRESULT WINAPI HTMLStyle_put_backgroundAttachment(IHTMLStyle *iface, BSTR v)
783 {
784     HTMLStyle *This = HTMLSTYLE_THIS(iface);
785     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
786     return E_NOTIMPL;
787 }
788
789 static HRESULT WINAPI HTMLStyle_get_backgroundAttachment(IHTMLStyle *iface, BSTR *p)
790 {
791     HTMLStyle *This = HTMLSTYLE_THIS(iface);
792     FIXME("(%p)->(%p)\n", This, p);
793     return E_NOTIMPL;
794 }
795
796 static HRESULT WINAPI HTMLStyle_put_backgroundPosition(IHTMLStyle *iface, BSTR v)
797 {
798     HTMLStyle *This = HTMLSTYLE_THIS(iface);
799     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
800     return E_NOTIMPL;
801 }
802
803 static HRESULT WINAPI HTMLStyle_get_backgroundPosition(IHTMLStyle *iface, BSTR *p)
804 {
805     HTMLStyle *This = HTMLSTYLE_THIS(iface);
806     FIXME("(%p)->(%p)\n", This, p);
807     return E_NOTIMPL;
808 }
809
810 static HRESULT WINAPI HTMLStyle_put_backgroundPositionX(IHTMLStyle *iface, VARIANT v)
811 {
812     HTMLStyle *This = HTMLSTYLE_THIS(iface);
813     FIXME("(%p)->(v%d)\n", This, V_VT(&v));
814     return E_NOTIMPL;
815 }
816
817 static HRESULT WINAPI HTMLStyle_get_backgroundPositionX(IHTMLStyle *iface, VARIANT *p)
818 {
819     HTMLStyle *This = HTMLSTYLE_THIS(iface);
820     FIXME("(%p)->(%p)\n", This, p);
821     return E_NOTIMPL;
822 }
823
824 static HRESULT WINAPI HTMLStyle_put_backgroundPositionY(IHTMLStyle *iface, VARIANT v)
825 {
826     HTMLStyle *This = HTMLSTYLE_THIS(iface);
827     FIXME("(%p)->(v%d)\n", This, V_VT(&v));
828     return E_NOTIMPL;
829 }
830
831 static HRESULT WINAPI HTMLStyle_get_backgroundPositionY(IHTMLStyle *iface, VARIANT *p)
832 {
833     HTMLStyle *This = HTMLSTYLE_THIS(iface);
834     FIXME("(%p)->(%p)\n", This, p);
835     return E_NOTIMPL;
836 }
837
838 static HRESULT WINAPI HTMLStyle_put_wordSpacing(IHTMLStyle *iface, VARIANT v)
839 {
840     HTMLStyle *This = HTMLSTYLE_THIS(iface);
841     FIXME("(%p)->(v%d)\n", This, V_VT(&v));
842     return E_NOTIMPL;
843 }
844
845 static HRESULT WINAPI HTMLStyle_get_wordSpacing(IHTMLStyle *iface, VARIANT *p)
846 {
847     HTMLStyle *This = HTMLSTYLE_THIS(iface);
848     FIXME("(%p)->(%p)\n", This, p);
849     return E_NOTIMPL;
850 }
851
852 static HRESULT WINAPI HTMLStyle_put_letterSpacing(IHTMLStyle *iface, VARIANT v)
853 {
854     HTMLStyle *This = HTMLSTYLE_THIS(iface);
855     FIXME("(%p)->(v%d)\n", This, V_VT(&v));
856     return E_NOTIMPL;
857 }
858
859 static HRESULT WINAPI HTMLStyle_get_letterSpacing(IHTMLStyle *iface, VARIANT *p)
860 {
861     HTMLStyle *This = HTMLSTYLE_THIS(iface);
862     FIXME("(%p)->(%p)\n", This, p);
863     return E_NOTIMPL;
864 }
865
866 static HRESULT WINAPI HTMLStyle_put_textDecoration(IHTMLStyle *iface, BSTR v)
867 {
868     HTMLStyle *This = HTMLSTYLE_THIS(iface);
869     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
870     return E_NOTIMPL;
871 }
872
873 static HRESULT WINAPI HTMLStyle_get_textDecoration(IHTMLStyle *iface, BSTR *p)
874 {
875     HTMLStyle *This = HTMLSTYLE_THIS(iface);
876
877     TRACE("(%p)->(%p)\n", This, p);
878
879     return get_style_attr(This, STYLEID_TEXT_DECORATION, p);
880 }
881
882 static HRESULT WINAPI HTMLStyle_put_textDecorationNone(IHTMLStyle *iface, VARIANT_BOOL v)
883 {
884     HTMLStyle *This = HTMLSTYLE_THIS(iface);
885     FIXME("(%p)->(%x)\n", This, v);
886     return E_NOTIMPL;
887 }
888
889 static HRESULT WINAPI HTMLStyle_get_textDecorationNone(IHTMLStyle *iface, VARIANT_BOOL *p)
890 {
891     HTMLStyle *This = HTMLSTYLE_THIS(iface);
892     FIXME("(%p)->(%p)\n", This, p);
893     return E_NOTIMPL;
894 }
895
896 static HRESULT WINAPI HTMLStyle_put_textDecorationUnderline(IHTMLStyle *iface, VARIANT_BOOL v)
897 {
898     HTMLStyle *This = HTMLSTYLE_THIS(iface);
899     FIXME("(%p)->(%x)\n", This, v);
900     return E_NOTIMPL;
901 }
902
903 static HRESULT WINAPI HTMLStyle_get_textDecorationUnderline(IHTMLStyle *iface, VARIANT_BOOL *p)
904 {
905     HTMLStyle *This = HTMLSTYLE_THIS(iface);
906
907     TRACE("(%p)->(%p)\n", This, p);
908
909     return check_style_attr_value(This, STYLEID_TEXT_DECORATION, valUnderline, p);
910 }
911
912 static HRESULT WINAPI HTMLStyle_put_textDecorationOverline(IHTMLStyle *iface, VARIANT_BOOL v)
913 {
914     HTMLStyle *This = HTMLSTYLE_THIS(iface);
915     FIXME("(%p)->(%x)\n", This, v);
916     return E_NOTIMPL;
917 }
918
919 static HRESULT WINAPI HTMLStyle_get_textDecorationOverline(IHTMLStyle *iface, VARIANT_BOOL *p)
920 {
921     HTMLStyle *This = HTMLSTYLE_THIS(iface);
922     FIXME("(%p)->(%p)\n", This, p);
923     return E_NOTIMPL;
924 }
925
926 static HRESULT WINAPI HTMLStyle_put_textDecorationLineThrough(IHTMLStyle *iface, VARIANT_BOOL v)
927 {
928     HTMLStyle *This = HTMLSTYLE_THIS(iface);
929     FIXME("(%p)->(%x)\n", This, v);
930     return E_NOTIMPL;
931 }
932
933 static HRESULT WINAPI HTMLStyle_get_textDecorationLineThrough(IHTMLStyle *iface, VARIANT_BOOL *p)
934 {
935     HTMLStyle *This = HTMLSTYLE_THIS(iface);
936
937     TRACE("(%p)->(%p)\n", This, p);
938
939     return check_style_attr_value(This, STYLEID_TEXT_DECORATION, valLineThrough, p);
940 }
941
942 static HRESULT WINAPI HTMLStyle_put_textDecorationBlink(IHTMLStyle *iface, VARIANT_BOOL v)
943 {
944     HTMLStyle *This = HTMLSTYLE_THIS(iface);
945     FIXME("(%p)->(%x)\n", This, v);
946     return E_NOTIMPL;
947 }
948
949 static HRESULT WINAPI HTMLStyle_get_textDecorationBlink(IHTMLStyle *iface, VARIANT_BOOL *p)
950 {
951     HTMLStyle *This = HTMLSTYLE_THIS(iface);
952     FIXME("(%p)->(%p)\n", This, p);
953     return E_NOTIMPL;
954 }
955
956 static HRESULT WINAPI HTMLStyle_put_verticalAlign(IHTMLStyle *iface, VARIANT v)
957 {
958     HTMLStyle *This = HTMLSTYLE_THIS(iface);
959
960     TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
961
962     switch(V_VT(&v)) {
963     case VT_BSTR:
964         return set_style_attr(This, STYLEID_VERTICAL_ALIGN, V_BSTR(&v), 0);
965     default:
966         FIXME("not implemented vt %d\n", V_VT(&v));
967         return E_NOTIMPL;
968     }
969
970     return S_OK;
971 }
972
973 static HRESULT WINAPI HTMLStyle_get_verticalAlign(IHTMLStyle *iface, VARIANT *p)
974 {
975     HTMLStyle *This = HTMLSTYLE_THIS(iface);
976     BSTR ret;
977     HRESULT hres;
978
979     TRACE("(%p)->(%p)\n", This, p);
980
981     hres = get_style_attr(This, STYLEID_VERTICAL_ALIGN, &ret);
982     if(FAILED(hres))
983         return hres;
984
985     V_VT(p) = VT_BSTR;
986     V_BSTR(p) = ret;
987     return S_OK;
988 }
989
990 static HRESULT WINAPI HTMLStyle_put_textTransform(IHTMLStyle *iface, BSTR v)
991 {
992     HTMLStyle *This = HTMLSTYLE_THIS(iface);
993     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
994     return E_NOTIMPL;
995 }
996
997 static HRESULT WINAPI HTMLStyle_get_textTransform(IHTMLStyle *iface, BSTR *p)
998 {
999     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1000     FIXME("(%p)->(%p)\n", This, p);
1001     return E_NOTIMPL;
1002 }
1003
1004 static HRESULT WINAPI HTMLStyle_put_textAlign(IHTMLStyle *iface, BSTR v)
1005 {
1006     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1007
1008     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1009
1010     return set_style_attr(This, STYLEID_TEXT_ALIGN, v, 0);
1011 }
1012
1013 static HRESULT WINAPI HTMLStyle_get_textAlign(IHTMLStyle *iface, BSTR *p)
1014 {
1015     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1016
1017     TRACE("(%p)->(%p)\n", This, p);
1018
1019     return get_style_attr(This, STYLEID_TEXT_ALIGN, p);
1020 }
1021
1022 static HRESULT WINAPI HTMLStyle_put_textIndent(IHTMLStyle *iface, VARIANT v)
1023 {
1024     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1025     FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1026     return E_NOTIMPL;
1027 }
1028
1029 static HRESULT WINAPI HTMLStyle_get_textIndent(IHTMLStyle *iface, VARIANT *p)
1030 {
1031     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1032     FIXME("(%p)->(%p)\n", This, p);
1033     return E_NOTIMPL;
1034 }
1035
1036 static HRESULT WINAPI HTMLStyle_put_lineHeight(IHTMLStyle *iface, VARIANT v)
1037 {
1038     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1039     FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1040     return E_NOTIMPL;
1041 }
1042
1043 static HRESULT WINAPI HTMLStyle_get_lineHeight(IHTMLStyle *iface, VARIANT *p)
1044 {
1045     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1046     FIXME("(%p)->(%p)\n", This, p);
1047     return E_NOTIMPL;
1048 }
1049
1050 static HRESULT WINAPI HTMLStyle_put_marginTop(IHTMLStyle *iface, VARIANT v)
1051 {
1052     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1053     FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1054     return E_NOTIMPL;
1055 }
1056
1057 static HRESULT WINAPI HTMLStyle_get_marginTop(IHTMLStyle *iface, VARIANT *p)
1058 {
1059     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1060     FIXME("(%p)->(%p)\n", This, p);
1061     return E_NOTIMPL;
1062 }
1063
1064 static HRESULT WINAPI HTMLStyle_put_marginRight(IHTMLStyle *iface, VARIANT v)
1065 {
1066     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1067
1068     TRACE("(%p)->(v(%d))\n", This, V_VT(&v));
1069
1070     switch(V_VT(&v)) {
1071     case VT_NULL:
1072         return set_style_attr(This, STYLEID_MARGIN_RIGHT, emptyW, 0);
1073     case VT_I4: {
1074         WCHAR buf[14];
1075
1076         wsprintfW(buf, px_formatW, V_I4(&v));
1077         return set_style_attr(This, STYLEID_MARGIN_RIGHT, buf, 0);
1078     }
1079     case VT_BSTR:
1080         return set_style_attr(This, STYLEID_MARGIN_RIGHT, V_BSTR(&v), 0);
1081     default:
1082         FIXME("Unsupported vt=%d\n", V_VT(&v));
1083     }
1084
1085     return E_NOTIMPL;
1086 }
1087
1088 static HRESULT WINAPI HTMLStyle_get_marginRight(IHTMLStyle *iface, VARIANT *p)
1089 {
1090     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1091     FIXME("(%p)->(%p)\n", This, p);
1092     return E_NOTIMPL;
1093 }
1094
1095 static HRESULT WINAPI HTMLStyle_put_marginBottom(IHTMLStyle *iface, VARIANT v)
1096 {
1097     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1098     FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1099     return E_NOTIMPL;
1100 }
1101
1102 static HRESULT WINAPI HTMLStyle_get_marginBottom(IHTMLStyle *iface, VARIANT *p)
1103 {
1104     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1105     FIXME("(%p)->(%p)\n", This, p);
1106     return E_NOTIMPL;
1107 }
1108
1109 static HRESULT WINAPI HTMLStyle_put_marginLeft(IHTMLStyle *iface, VARIANT v)
1110 {
1111     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1112
1113     switch(V_VT(&v)) {
1114     case VT_NULL:
1115         TRACE("(%p)->(NULL)\n", This);
1116         return set_style_attr(This, STYLEID_MARGIN_LEFT, emptyW, 0);
1117     case VT_I4: {
1118         WCHAR buf[14];
1119
1120         TRACE("(%p)->(%d)\n", This, V_I4(&v));
1121
1122         wsprintfW(buf, px_formatW, V_I4(&v));
1123         return set_style_attr(This, STYLEID_MARGIN_LEFT, buf, 0);
1124     }
1125     case VT_BSTR:
1126         TRACE("(%p)->(%s)\n", This, debugstr_w(V_BSTR(&v)));
1127         return set_style_attr(This, STYLEID_MARGIN_LEFT, V_BSTR(&v), 0);
1128     default:
1129         FIXME("Unsupported vt=%d\n", V_VT(&v));
1130     }
1131
1132     return E_NOTIMPL;
1133 }
1134
1135 static HRESULT WINAPI HTMLStyle_put_margin(IHTMLStyle *iface, BSTR v)
1136 {
1137     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1138
1139     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1140
1141     return set_style_attr(This, STYLEID_MARGIN, v, 0);
1142 }
1143
1144 static HRESULT WINAPI HTMLStyle_get_margin(IHTMLStyle *iface, BSTR *p)
1145 {
1146     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1147
1148     TRACE("(%p)->(%p)\n", This, p);
1149
1150     return get_style_attr(This, STYLEID_MARGIN, p);
1151 }
1152
1153 static HRESULT WINAPI HTMLStyle_get_marginLeft(IHTMLStyle *iface, VARIANT *p)
1154 {
1155     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1156     FIXME("(%p)->(%p)\n", This, p);
1157     return E_NOTIMPL;
1158 }
1159
1160 static HRESULT WINAPI HTMLStyle_put_paddingTop(IHTMLStyle *iface, VARIANT v)
1161 {
1162     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1163     FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1164     return E_NOTIMPL;
1165 }
1166
1167 static HRESULT WINAPI HTMLStyle_get_paddingTop(IHTMLStyle *iface, VARIANT *p)
1168 {
1169     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1170     FIXME("(%p)->(%p)\n", This, p);
1171     return E_NOTIMPL;
1172 }
1173
1174 static HRESULT WINAPI HTMLStyle_put_paddingRight(IHTMLStyle *iface, VARIANT v)
1175 {
1176     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1177     FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1178     return E_NOTIMPL;
1179 }
1180
1181 static HRESULT WINAPI HTMLStyle_get_paddingRight(IHTMLStyle *iface, VARIANT *p)
1182 {
1183     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1184     FIXME("(%p)->(%p)\n", This, p);
1185     return E_NOTIMPL;
1186 }
1187
1188 static HRESULT WINAPI HTMLStyle_put_paddingBottom(IHTMLStyle *iface, VARIANT v)
1189 {
1190     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1191     FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1192     return E_NOTIMPL;
1193 }
1194
1195 static HRESULT WINAPI HTMLStyle_get_paddingBottom(IHTMLStyle *iface, VARIANT *p)
1196 {
1197     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1198     FIXME("(%p)->(%p)\n", This, p);
1199     return E_NOTIMPL;
1200 }
1201
1202 static HRESULT WINAPI HTMLStyle_put_paddingLeft(IHTMLStyle *iface, VARIANT v)
1203 {
1204     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1205
1206     TRACE("(%p)->(vt=%d)\n", This, V_VT(&v));
1207
1208     switch(V_VT(&v)) {
1209     case VT_I4: {
1210         WCHAR buf[14];
1211
1212         wsprintfW(buf, px_formatW, V_I4(&v));
1213         return set_style_attr(This, STYLEID_PADDING_LEFT, buf, 0);
1214     }
1215     case VT_BSTR:
1216         return set_style_attr(This, STYLEID_PADDING_LEFT, V_BSTR(&v), 0);
1217     default:
1218         FIXME("unsupported vt=%d\n", V_VT(&v));
1219     }
1220
1221     return E_NOTIMPL;
1222 }
1223
1224 static HRESULT WINAPI HTMLStyle_get_paddingLeft(IHTMLStyle *iface, VARIANT *p)
1225 {
1226     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1227     FIXME("(%p)->(%p)\n", This, p);
1228     return E_NOTIMPL;
1229 }
1230
1231 static HRESULT WINAPI HTMLStyle_put_padding(IHTMLStyle *iface, BSTR v)
1232 {
1233     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1234     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1235     return E_NOTIMPL;
1236 }
1237
1238 static HRESULT WINAPI HTMLStyle_get_padding(IHTMLStyle *iface, BSTR *p)
1239 {
1240     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1241     FIXME("(%p)->(%p)\n", This, p);
1242     return E_NOTIMPL;
1243 }
1244
1245 static HRESULT WINAPI HTMLStyle_put_border(IHTMLStyle *iface, BSTR v)
1246 {
1247     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1248
1249     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1250
1251     return set_style_attr(This, STYLEID_BORDER, v, 0);
1252 }
1253
1254 static HRESULT WINAPI HTMLStyle_get_border(IHTMLStyle *iface, BSTR *p)
1255 {
1256     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1257
1258     TRACE("(%p)->(%p)\n", This, p);
1259
1260     return get_style_attr(This, STYLEID_BORDER, p);
1261 }
1262
1263 static HRESULT WINAPI HTMLStyle_put_borderTop(IHTMLStyle *iface, BSTR v)
1264 {
1265     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1266     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1267     return E_NOTIMPL;
1268 }
1269
1270 static HRESULT WINAPI HTMLStyle_get_borderTop(IHTMLStyle *iface, BSTR *p)
1271 {
1272     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1273     FIXME("(%p)->(%p)\n", This, p);
1274     return E_NOTIMPL;
1275 }
1276
1277 static HRESULT WINAPI HTMLStyle_put_borderRight(IHTMLStyle *iface, BSTR v)
1278 {
1279     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1280     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1281     return E_NOTIMPL;
1282 }
1283
1284 static HRESULT WINAPI HTMLStyle_get_borderRight(IHTMLStyle *iface, BSTR *p)
1285 {
1286     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1287     FIXME("(%p)->(%p)\n", This, p);
1288     return E_NOTIMPL;
1289 }
1290
1291 static HRESULT WINAPI HTMLStyle_put_borderBottom(IHTMLStyle *iface, BSTR v)
1292 {
1293     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1294     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1295     return E_NOTIMPL;
1296 }
1297
1298 static HRESULT WINAPI HTMLStyle_get_borderBottom(IHTMLStyle *iface, BSTR *p)
1299 {
1300     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1301     FIXME("(%p)->(%p)\n", This, p);
1302     return E_NOTIMPL;
1303 }
1304
1305 static HRESULT WINAPI HTMLStyle_put_borderLeft(IHTMLStyle *iface, BSTR v)
1306 {
1307     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1308
1309     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1310
1311     return set_style_attr(This, STYLEID_BORDER_LEFT, v, ATTR_FIX_PX);
1312 }
1313
1314 static HRESULT WINAPI HTMLStyle_get_borderLeft(IHTMLStyle *iface, BSTR *p)
1315 {
1316     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1317     FIXME("(%p)->(%p)\n", This, p);
1318     return E_NOTIMPL;
1319 }
1320
1321 static HRESULT WINAPI HTMLStyle_put_borderColor(IHTMLStyle *iface, BSTR v)
1322 {
1323     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1324     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1325     return E_NOTIMPL;
1326 }
1327
1328 static HRESULT WINAPI HTMLStyle_get_borderColor(IHTMLStyle *iface, BSTR *p)
1329 {
1330     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1331     FIXME("(%p)->(%p)\n", This, p);
1332     return E_NOTIMPL;
1333 }
1334
1335 static HRESULT WINAPI HTMLStyle_put_borderTopColor(IHTMLStyle *iface, VARIANT v)
1336 {
1337     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1338     FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1339     return E_NOTIMPL;
1340 }
1341
1342 static HRESULT WINAPI HTMLStyle_get_borderTopColor(IHTMLStyle *iface, VARIANT *p)
1343 {
1344     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1345     FIXME("(%p)->(%p)\n", This, p);
1346     return E_NOTIMPL;
1347 }
1348
1349 static HRESULT WINAPI HTMLStyle_put_borderRightColor(IHTMLStyle *iface, VARIANT v)
1350 {
1351     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1352     FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1353     return E_NOTIMPL;
1354 }
1355
1356 static HRESULT WINAPI HTMLStyle_get_borderRightColor(IHTMLStyle *iface, VARIANT *p)
1357 {
1358     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1359     FIXME("(%p)->(%p)\n", This, p);
1360     return E_NOTIMPL;
1361 }
1362
1363 static HRESULT WINAPI HTMLStyle_put_borderBottomColor(IHTMLStyle *iface, VARIANT v)
1364 {
1365     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1366     FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1367     return E_NOTIMPL;
1368 }
1369
1370 static HRESULT WINAPI HTMLStyle_get_borderBottomColor(IHTMLStyle *iface, VARIANT *p)
1371 {
1372     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1373     FIXME("(%p)->(%p)\n", This, p);
1374     return E_NOTIMPL;
1375 }
1376
1377 static HRESULT WINAPI HTMLStyle_put_borderLeftColor(IHTMLStyle *iface, VARIANT v)
1378 {
1379     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1380     FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1381     return E_NOTIMPL;
1382 }
1383
1384 static HRESULT WINAPI HTMLStyle_get_borderLeftColor(IHTMLStyle *iface, VARIANT *p)
1385 {
1386     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1387     FIXME("(%p)->(%p)\n", This, p);
1388     return E_NOTIMPL;
1389 }
1390
1391 static HRESULT WINAPI HTMLStyle_put_borderWidth(IHTMLStyle *iface, BSTR v)
1392 {
1393     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1394     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1395     return set_style_attr(This, STYLEID_BORDER_WIDTH, v, ATTR_FIX_PX);
1396 }
1397
1398 static HRESULT WINAPI HTMLStyle_get_borderWidth(IHTMLStyle *iface, BSTR *p)
1399 {
1400     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1401     TRACE("(%p)->(%p)\n", This, p);
1402     return get_style_attr(This, STYLEID_BORDER_WIDTH, p);
1403 }
1404
1405 static HRESULT WINAPI HTMLStyle_put_borderTopWidth(IHTMLStyle *iface, VARIANT v)
1406 {
1407     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1408     FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1409     return E_NOTIMPL;
1410 }
1411
1412 static HRESULT WINAPI HTMLStyle_get_borderTopWidth(IHTMLStyle *iface, VARIANT *p)
1413 {
1414     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1415     FIXME("(%p)->(%p)\n", This, p);
1416     return E_NOTIMPL;
1417 }
1418
1419 static HRESULT WINAPI HTMLStyle_put_borderRightWidth(IHTMLStyle *iface, VARIANT v)
1420 {
1421     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1422     FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1423     return E_NOTIMPL;
1424 }
1425
1426 static HRESULT WINAPI HTMLStyle_get_borderRightWidth(IHTMLStyle *iface, VARIANT *p)
1427 {
1428     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1429     FIXME("(%p)->(%p)\n", This, p);
1430     return E_NOTIMPL;
1431 }
1432
1433 static HRESULT WINAPI HTMLStyle_put_borderBottomWidth(IHTMLStyle *iface, VARIANT v)
1434 {
1435     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1436     FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1437     return E_NOTIMPL;
1438 }
1439
1440 static HRESULT WINAPI HTMLStyle_get_borderBottomWidth(IHTMLStyle *iface, VARIANT *p)
1441 {
1442     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1443     FIXME("(%p)->(%p)\n", This, p);
1444     return E_NOTIMPL;
1445 }
1446
1447 static HRESULT WINAPI HTMLStyle_put_borderLeftWidth(IHTMLStyle *iface, VARIANT v)
1448 {
1449     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1450     FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1451     return E_NOTIMPL;
1452 }
1453
1454 static HRESULT WINAPI HTMLStyle_get_borderLeftWidth(IHTMLStyle *iface, VARIANT *p)
1455 {
1456     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1457     FIXME("(%p)->(%p)\n", This, p);
1458     return E_NOTIMPL;
1459 }
1460
1461 static HRESULT WINAPI HTMLStyle_put_borderStyle(IHTMLStyle *iface, BSTR v)
1462 {
1463     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1464     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1465     return E_NOTIMPL;
1466 }
1467
1468 static HRESULT WINAPI HTMLStyle_get_borderStyle(IHTMLStyle *iface, BSTR *p)
1469 {
1470     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1471     FIXME("(%p)->(%p)\n", This, p);
1472     return E_NOTIMPL;
1473 }
1474
1475 static HRESULT WINAPI HTMLStyle_put_borderTopStyle(IHTMLStyle *iface, BSTR v)
1476 {
1477     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1478     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1479
1480     if(!is_valid_border_style(v))
1481         return E_INVALIDARG;
1482
1483     return set_style_attr(This, STYLEID_BORDER_TOP_STYLE, v, 0);
1484 }
1485
1486 static HRESULT WINAPI HTMLStyle_get_borderTopStyle(IHTMLStyle *iface, BSTR *p)
1487 {
1488     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1489     TRACE("(%p)->(%p)\n", This, p);
1490     return get_style_attr(This, STYLEID_BORDER_TOP_STYLE, p);
1491 }
1492
1493 static HRESULT WINAPI HTMLStyle_put_borderRightStyle(IHTMLStyle *iface, BSTR v)
1494 {
1495     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1496     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1497
1498     if(!is_valid_border_style(v))
1499         return E_INVALIDARG;
1500
1501     return set_style_attr(This, STYLEID_BORDER_RIGHT_STYLE, v, 0);
1502 }
1503
1504 static HRESULT WINAPI HTMLStyle_get_borderRightStyle(IHTMLStyle *iface, BSTR *p)
1505 {
1506     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1507     TRACE("(%p)->(%p)\n", This, p);
1508     return get_style_attr(This, STYLEID_BORDER_RIGHT_STYLE, p);
1509 }
1510
1511 static HRESULT WINAPI HTMLStyle_put_borderBottomStyle(IHTMLStyle *iface, BSTR v)
1512 {
1513     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1514     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1515
1516     if(!is_valid_border_style(v))
1517         return E_INVALIDARG;
1518
1519     return set_style_attr(This, STYLEID_BORDER_BOTTOM_STYLE, v, 0);
1520 }
1521
1522 static HRESULT WINAPI HTMLStyle_get_borderBottomStyle(IHTMLStyle *iface, BSTR *p)
1523 {
1524     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1525     TRACE("(%p)->(%p)\n", This, p);
1526     return get_style_attr(This, STYLEID_BORDER_BOTTOM_STYLE, p);
1527 }
1528
1529 static HRESULT WINAPI HTMLStyle_put_borderLeftStyle(IHTMLStyle *iface, BSTR v)
1530 {
1531     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1532     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1533
1534     if(!is_valid_border_style(v))
1535         return E_INVALIDARG;
1536
1537     return set_style_attr(This, STYLEID_BORDER_LEFT_STYLE, v, 0);
1538 }
1539
1540 static HRESULT WINAPI HTMLStyle_get_borderLeftStyle(IHTMLStyle *iface, BSTR *p)
1541 {
1542     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1543     TRACE("(%p)->(%p)\n", This, p);
1544     return get_style_attr(This, STYLEID_BORDER_LEFT_STYLE, p);
1545 }
1546
1547 static HRESULT WINAPI HTMLStyle_put_width(IHTMLStyle *iface, VARIANT v)
1548 {
1549     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1550
1551     TRACE("(%p)->(v%d)\n", This, V_VT(&v));
1552
1553     switch(V_VT(&v)) {
1554     case VT_BSTR:
1555         TRACE("%s\n", debugstr_w(V_BSTR(&v)));
1556         return set_style_attr(This, STYLEID_WIDTH, V_BSTR(&v), 0);
1557     default:
1558         FIXME("unsupported vt %d\n", V_VT(&v));
1559     }
1560
1561     return E_NOTIMPL;
1562 }
1563
1564 static HRESULT WINAPI HTMLStyle_get_width(IHTMLStyle *iface, VARIANT *p)
1565 {
1566     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1567
1568     TRACE("(%p)->(%p)\n", This, p);
1569
1570     V_VT(p) = VT_BSTR;
1571     return get_style_attr(This, STYLEID_WIDTH, &V_BSTR(p));
1572 }
1573
1574 static HRESULT WINAPI HTMLStyle_put_height(IHTMLStyle *iface, VARIANT v)
1575 {
1576     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1577
1578     TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1579
1580     switch(V_VT(&v)) {
1581     case VT_BSTR:
1582         return set_style_attr(This, STYLEID_HEIGHT, V_BSTR(&v), 0);
1583     default:
1584         FIXME("unimplemented vt %d\n", V_VT(&v));
1585         return E_NOTIMPL;
1586     }
1587
1588     return S_OK;
1589 }
1590
1591 static HRESULT WINAPI HTMLStyle_get_height(IHTMLStyle *iface, VARIANT *p)
1592 {
1593     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1594     BSTR ret;
1595     HRESULT hres;
1596
1597     TRACE("(%p)->(%p)\n", This, p);
1598
1599     hres = get_style_attr(This, STYLEID_HEIGHT, &ret);
1600     if(FAILED(hres))
1601         return hres;
1602
1603     V_VT(p) = VT_BSTR;
1604     V_BSTR(p) = ret;
1605     return S_OK;
1606 }
1607
1608 static HRESULT WINAPI HTMLStyle_put_styleFloat(IHTMLStyle *iface, BSTR v)
1609 {
1610     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1611     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1612     return E_NOTIMPL;
1613 }
1614
1615 static HRESULT WINAPI HTMLStyle_get_styleFloat(IHTMLStyle *iface, BSTR *p)
1616 {
1617     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1618     FIXME("(%p)->(%p)\n", This, p);
1619     return E_NOTIMPL;
1620 }
1621
1622 static HRESULT WINAPI HTMLStyle_put_clear(IHTMLStyle *iface, BSTR v)
1623 {
1624     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1625     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1626     return E_NOTIMPL;
1627 }
1628
1629 static HRESULT WINAPI HTMLStyle_get_clear(IHTMLStyle *iface, BSTR *p)
1630 {
1631     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1632     FIXME("(%p)->(%p)\n", This, p);
1633     return E_NOTIMPL;
1634 }
1635
1636 static HRESULT WINAPI HTMLStyle_put_display(IHTMLStyle *iface, BSTR v)
1637 {
1638     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1639
1640     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1641
1642     return set_style_attr(This, STYLEID_DISPLAY, v, 0);
1643 }
1644
1645 static HRESULT WINAPI HTMLStyle_get_display(IHTMLStyle *iface, BSTR *p)
1646 {
1647     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1648
1649     TRACE("(%p)->(%p)\n", This, p);
1650
1651     return get_style_attr(This, STYLEID_DISPLAY, p);
1652 }
1653
1654 static HRESULT WINAPI HTMLStyle_put_visibility(IHTMLStyle *iface, BSTR v)
1655 {
1656     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1657
1658     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1659
1660     return set_style_attr(This, STYLEID_VISIBILITY, v, 0);
1661 }
1662
1663 static HRESULT WINAPI HTMLStyle_get_visibility(IHTMLStyle *iface, BSTR *p)
1664 {
1665     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1666
1667     TRACE("(%p)->(%p)\n", This, p);
1668
1669     return get_style_attr(This, STYLEID_VISIBILITY, p);
1670 }
1671
1672 static HRESULT WINAPI HTMLStyle_put_listStyleType(IHTMLStyle *iface, BSTR v)
1673 {
1674     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1675     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1676     return E_NOTIMPL;
1677 }
1678
1679 static HRESULT WINAPI HTMLStyle_get_listStyleType(IHTMLStyle *iface, BSTR *p)
1680 {
1681     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1682     FIXME("(%p)->(%p)\n", This, p);
1683     return E_NOTIMPL;
1684 }
1685
1686 static HRESULT WINAPI HTMLStyle_put_listStylePosition(IHTMLStyle *iface, BSTR v)
1687 {
1688     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1689     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1690     return E_NOTIMPL;
1691 }
1692
1693 static HRESULT WINAPI HTMLStyle_get_listStylePosition(IHTMLStyle *iface, BSTR *p)
1694 {
1695     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1696     FIXME("(%p)->(%p)\n", This, p);
1697     return E_NOTIMPL;
1698 }
1699
1700 static HRESULT WINAPI HTMLStyle_put_listStyleImage(IHTMLStyle *iface, BSTR v)
1701 {
1702     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1703     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1704     return E_NOTIMPL;
1705 }
1706
1707 static HRESULT WINAPI HTMLStyle_get_listStyleImage(IHTMLStyle *iface, BSTR *p)
1708 {
1709     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1710     FIXME("(%p)->(%p)\n", This, p);
1711     return E_NOTIMPL;
1712 }
1713
1714 static HRESULT WINAPI HTMLStyle_put_listStyle(IHTMLStyle *iface, BSTR v)
1715 {
1716     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1717     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1718     return E_NOTIMPL;
1719 }
1720
1721 static HRESULT WINAPI HTMLStyle_get_listStyle(IHTMLStyle *iface, BSTR *p)
1722 {
1723     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1724     FIXME("(%p)->(%p)\n", This, p);
1725     return E_NOTIMPL;
1726 }
1727
1728 static HRESULT WINAPI HTMLStyle_put_whiteSpace(IHTMLStyle *iface, BSTR v)
1729 {
1730     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1731     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1732     return E_NOTIMPL;
1733 }
1734
1735 static HRESULT WINAPI HTMLStyle_get_whiteSpace(IHTMLStyle *iface, BSTR *p)
1736 {
1737     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1738     FIXME("(%p)->(%p)\n", This, p);
1739     return E_NOTIMPL;
1740 }
1741
1742 static HRESULT WINAPI HTMLStyle_put_top(IHTMLStyle *iface, VARIANT v)
1743 {
1744     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1745
1746     TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1747
1748     return set_nsstyle_attr_var(This->nsstyle, STYLEID_TOP, &v, 0);
1749 }
1750
1751 static HRESULT WINAPI HTMLStyle_get_top(IHTMLStyle *iface, VARIANT *p)
1752 {
1753     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1754     BSTR ret;
1755     HRESULT hres;
1756
1757     TRACE("(%p)->(%p)\n", This, p);
1758
1759     hres = get_style_attr(This, STYLEID_TOP, &ret);
1760     if(FAILED(hres))
1761         return hres;
1762
1763     V_VT(p) = VT_BSTR;
1764     V_BSTR(p) = ret;
1765     return S_OK;
1766 }
1767
1768 static HRESULT WINAPI HTMLStyle_put_left(IHTMLStyle *iface, VARIANT v)
1769 {
1770     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1771
1772     TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1773
1774     return set_nsstyle_attr_var(This->nsstyle, STYLEID_LEFT, &v, 0);
1775 }
1776
1777 static HRESULT WINAPI HTMLStyle_get_left(IHTMLStyle *iface, VARIANT *p)
1778 {
1779     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1780     BSTR ret;
1781     HRESULT hres;
1782
1783     TRACE("(%p)->(%p)\n", This, p);
1784
1785     hres = get_style_attr(This, STYLEID_LEFT, &ret);
1786     if(FAILED(hres))
1787         return hres;
1788
1789     V_VT(p) = VT_BSTR;
1790     V_BSTR(p) = ret;
1791     return S_OK;
1792 }
1793
1794 static HRESULT WINAPI HTMLStyle_get_position(IHTMLStyle *iface, BSTR *p)
1795 {
1796     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1797     TRACE("(%p)->(%p)\n", This, p);
1798     return IHTMLStyle2_get_position(HTMLSTYLE2(This), p);
1799 }
1800
1801 static HRESULT WINAPI HTMLStyle_put_zIndex(IHTMLStyle *iface, VARIANT v)
1802 {
1803     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1804
1805     TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1806
1807     switch(V_VT(&v)) {
1808     case VT_BSTR:
1809         return set_style_attr(This, STYLEID_Z_INDEX, V_BSTR(&v), 0);
1810     case VT_I4: {
1811         WCHAR value[14];
1812         static const WCHAR format[] = {'%','d',0};
1813
1814         wsprintfW(value, format, V_I4(&v));
1815         return set_style_attr(This, STYLEID_Z_INDEX, value, 0);
1816     }
1817     default:
1818         FIXME("unimplemented vt %d\n", V_VT(&v));
1819         return E_NOTIMPL;
1820     }
1821
1822     return S_OK;
1823 }
1824
1825 static HRESULT WINAPI HTMLStyle_get_zIndex(IHTMLStyle *iface, VARIANT *p)
1826 {
1827     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1828
1829     TRACE("(%p)->(%p)\n", This, p);
1830
1831     return get_nsstyle_attr_var(This->nsstyle, STYLEID_Z_INDEX, p, ATTR_STR_TO_INT);
1832 }
1833
1834 static HRESULT WINAPI HTMLStyle_put_overflow(IHTMLStyle *iface, BSTR v)
1835 {
1836     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1837     static const WCHAR szVisible[] = {'v','i','s','i','b','l','e',0};
1838     static const WCHAR szScroll[]  = {'s','c','r','o','l','l',0};
1839     static const WCHAR szHidden[]  = {'h','i','d','d','e','n',0};
1840     static const WCHAR szAuto[]    = {'a','u','t','o',0};
1841
1842     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1843
1844     /* overflow can only be one of the follow values. */
1845     if(!v || strcmpiW(szVisible, v) == 0 || strcmpiW(szScroll, v) == 0 ||
1846              strcmpiW(szHidden, v) == 0  || strcmpiW(szAuto, v) == 0)
1847     {
1848         return set_nsstyle_attr(This->nsstyle, STYLEID_OVERFLOW, v, 0);
1849     }
1850
1851     return E_INVALIDARG;
1852 }
1853
1854
1855 static HRESULT WINAPI HTMLStyle_get_overflow(IHTMLStyle *iface, BSTR *p)
1856 {
1857     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1858
1859     TRACE("(%p)->(%p)\n", This, p);
1860
1861     if(!p)
1862        return E_INVALIDARG;
1863
1864     return get_style_attr(This, STYLEID_OVERFLOW, p);
1865 }
1866
1867 static HRESULT WINAPI HTMLStyle_put_pageBreakBefore(IHTMLStyle *iface, BSTR v)
1868 {
1869     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1870     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1871     return E_NOTIMPL;
1872 }
1873
1874 static HRESULT WINAPI HTMLStyle_get_pageBreakBefore(IHTMLStyle *iface, BSTR *p)
1875 {
1876     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1877     FIXME("(%p)->(%p)\n", This, p);
1878     return E_NOTIMPL;
1879 }
1880
1881 static HRESULT WINAPI HTMLStyle_put_pageBreakAfter(IHTMLStyle *iface, BSTR v)
1882 {
1883     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1884     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1885     return E_NOTIMPL;
1886 }
1887
1888 static HRESULT WINAPI HTMLStyle_get_pageBreakAfter(IHTMLStyle *iface, BSTR *p)
1889 {
1890     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1891     FIXME("(%p)->(%p)\n", This, p);
1892     return E_NOTIMPL;
1893 }
1894
1895 static HRESULT WINAPI HTMLStyle_put_cssText(IHTMLStyle *iface, BSTR v)
1896 {
1897     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1898     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1899     return E_NOTIMPL;
1900 }
1901
1902 static HRESULT WINAPI HTMLStyle_get_cssText(IHTMLStyle *iface, BSTR *p)
1903 {
1904     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1905     FIXME("(%p)->(%p)\n", This, p);
1906     return E_NOTIMPL;
1907 }
1908
1909 static HRESULT WINAPI HTMLStyle_put_pixelTop(IHTMLStyle *iface, long v)
1910 {
1911     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1912     FIXME("(%p)->()\n", This);
1913     return E_NOTIMPL;
1914 }
1915
1916 static HRESULT WINAPI HTMLStyle_get_pixelTop(IHTMLStyle *iface, long *p)
1917 {
1918     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1919     FIXME("(%p)->()\n", This);
1920     return E_NOTIMPL;
1921 }
1922
1923 static HRESULT WINAPI HTMLStyle_put_pixelLeft(IHTMLStyle *iface, long v)
1924 {
1925     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1926     FIXME("(%p)->()\n", This);
1927     return E_NOTIMPL;
1928 }
1929
1930 static HRESULT WINAPI HTMLStyle_get_pixelLeft(IHTMLStyle *iface, long *p)
1931 {
1932     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1933     FIXME("(%p)->()\n", This);
1934     return E_NOTIMPL;
1935 }
1936
1937 static HRESULT WINAPI HTMLStyle_put_pixelWidth(IHTMLStyle *iface, long v)
1938 {
1939     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1940     FIXME("(%p)->()\n", This);
1941     return E_NOTIMPL;
1942 }
1943
1944 static HRESULT WINAPI HTMLStyle_get_pixelWidth(IHTMLStyle *iface, long *p)
1945 {
1946     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1947     FIXME("(%p)->()\n", This);
1948     return E_NOTIMPL;
1949 }
1950
1951 static HRESULT WINAPI HTMLStyle_put_pixelHeight(IHTMLStyle *iface, long v)
1952 {
1953     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1954     FIXME("(%p)->()\n", This);
1955     return E_NOTIMPL;
1956 }
1957
1958 static HRESULT WINAPI HTMLStyle_get_pixelHeight(IHTMLStyle *iface, long *p)
1959 {
1960     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1961     FIXME("(%p)->()\n", This);
1962     return E_NOTIMPL;
1963 }
1964
1965 static HRESULT WINAPI HTMLStyle_put_posTop(IHTMLStyle *iface, float v)
1966 {
1967     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1968
1969     TRACE("(%p)->(%f)\n", This, v);
1970
1971     return set_style_pos(This, STYLEID_TOP, v);
1972 }
1973
1974 static HRESULT WINAPI HTMLStyle_get_posTop(IHTMLStyle *iface, float *p)
1975 {
1976     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1977
1978     TRACE("(%p)->(%p)\n", This, p);
1979
1980     if(!p)
1981         return E_POINTER;
1982
1983     return get_nsstyle_pos(This, STYLEID_TOP, p);
1984 }
1985
1986 static HRESULT WINAPI HTMLStyle_put_posLeft(IHTMLStyle *iface, float v)
1987 {
1988     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1989
1990     TRACE("(%p)->(%f)\n", This, v);
1991
1992     return set_style_pos(This, STYLEID_LEFT, v);
1993 }
1994
1995 static HRESULT WINAPI HTMLStyle_get_posLeft(IHTMLStyle *iface, float *p)
1996 {
1997     HTMLStyle *This = HTMLSTYLE_THIS(iface);
1998
1999     TRACE("(%p)->(%p)\n", This, p);
2000
2001     if(!p)
2002         return E_POINTER;
2003
2004     return get_nsstyle_pos(This, STYLEID_LEFT, p);
2005 }
2006
2007 static HRESULT WINAPI HTMLStyle_put_posWidth(IHTMLStyle *iface, float v)
2008 {
2009     HTMLStyle *This = HTMLSTYLE_THIS(iface);
2010
2011     TRACE("(%p)->(%f)\n", This, v);
2012
2013     return set_style_pos(This, STYLEID_WIDTH, v);
2014 }
2015
2016 static HRESULT WINAPI HTMLStyle_get_posWidth(IHTMLStyle *iface, float *p)
2017 {
2018     HTMLStyle *This = HTMLSTYLE_THIS(iface);
2019
2020     TRACE("(%p)->(%p)\n", This, p);
2021
2022     if(!p)
2023         return E_POINTER;
2024
2025     if(get_nsstyle_pos(This, STYLEID_WIDTH, p) != S_OK)
2026         *p = 0.0f;
2027
2028     return S_OK;
2029 }
2030
2031 static HRESULT WINAPI HTMLStyle_put_posHeight(IHTMLStyle *iface, float v)
2032 {
2033     HTMLStyle *This = HTMLSTYLE_THIS(iface);
2034
2035     TRACE("(%p)->(%f)\n", This, v);
2036
2037     return set_style_pos(This, STYLEID_HEIGHT, v);
2038 }
2039
2040 static HRESULT WINAPI HTMLStyle_get_posHeight(IHTMLStyle *iface, float *p)
2041 {
2042     HTMLStyle *This = HTMLSTYLE_THIS(iface);
2043
2044     TRACE("(%p)->(%p)\n", This, p);
2045
2046     if(!p)
2047         return E_POINTER;
2048
2049     if(get_nsstyle_pos(This, STYLEID_HEIGHT, p) != S_OK)
2050         *p = 0.0f;
2051
2052     return S_OK;
2053 }
2054
2055 static HRESULT WINAPI HTMLStyle_put_cursor(IHTMLStyle *iface, BSTR v)
2056 {
2057     HTMLStyle *This = HTMLSTYLE_THIS(iface);
2058
2059     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2060
2061     return set_style_attr(This, STYLEID_CURSOR, v, 0);
2062 }
2063
2064 static HRESULT WINAPI HTMLStyle_get_cursor(IHTMLStyle *iface, BSTR *p)
2065 {
2066     HTMLStyle *This = HTMLSTYLE_THIS(iface);
2067
2068     TRACE("(%p)->(%p)\n", This, p);
2069
2070     return get_style_attr(This, STYLEID_CURSOR, p);
2071 }
2072
2073 static HRESULT WINAPI HTMLStyle_put_clip(IHTMLStyle *iface, BSTR v)
2074 {
2075     HTMLStyle *This = HTMLSTYLE_THIS(iface);
2076     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
2077     return E_NOTIMPL;
2078 }
2079
2080 static HRESULT WINAPI HTMLStyle_get_clip(IHTMLStyle *iface, BSTR *p)
2081 {
2082     HTMLStyle *This = HTMLSTYLE_THIS(iface);
2083     FIXME("(%p)->(%p)\n", This, p);
2084     return E_NOTIMPL;
2085 }
2086
2087 static HRESULT WINAPI HTMLStyle_put_filter(IHTMLStyle *iface, BSTR v)
2088 {
2089     HTMLStyle *This = HTMLSTYLE_THIS(iface);
2090
2091     WARN("(%p)->(%s)\n", This, debugstr_w(v));
2092
2093     /* FIXME: Handle MS-style filters */
2094     return set_style_attr(This, STYLEID_FILTER, v, 0);
2095 }
2096
2097 static HRESULT WINAPI HTMLStyle_get_filter(IHTMLStyle *iface, BSTR *p)
2098 {
2099     HTMLStyle *This = HTMLSTYLE_THIS(iface);
2100
2101     WARN("(%p)->(%p)\n", This, p);
2102
2103     /* FIXME: Handle MS-style filters */
2104     return get_style_attr(This, STYLEID_FILTER, p);
2105 }
2106
2107 static HRESULT WINAPI HTMLStyle_setAttribute(IHTMLStyle *iface, BSTR strAttributeName,
2108         VARIANT AttributeValue, LONG lFlags)
2109 {
2110     HTMLStyle *This = HTMLSTYLE_THIS(iface);
2111     HRESULT hres;
2112     DISPID dispid;
2113
2114     TRACE("(%p)->(%s v%d %08x)\n", This, debugstr_w(strAttributeName),
2115            V_VT(&AttributeValue), lFlags);
2116
2117     if(!strAttributeName)
2118         return E_INVALIDARG;
2119
2120     if(lFlags == 1)
2121         FIXME("Parameter lFlags ignored\n");
2122
2123     hres = HTMLStyle_GetIDsOfNames(iface, &IID_NULL, (LPOLESTR*)&strAttributeName, 1,
2124                         LOCALE_USER_DEFAULT, &dispid);
2125     if(hres == S_OK)
2126     {
2127         VARIANT ret;
2128         DISPID dispidNamed = DISPID_PROPERTYPUT;
2129         DISPPARAMS params;
2130
2131         params.cArgs = 1;
2132         params.rgvarg = &AttributeValue;
2133         params.cNamedArgs = 1;
2134         params.rgdispidNamedArgs = &dispidNamed;
2135
2136         hres = HTMLStyle_Invoke(iface, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
2137             DISPATCH_PROPERTYPUT, &params, &ret, NULL, NULL);
2138     }
2139     else
2140     {
2141         FIXME("Custom attributes not supported.\n");
2142     }
2143
2144     TRACE("ret: %08x\n", hres);
2145
2146     return hres;
2147 }
2148
2149 static HRESULT WINAPI HTMLStyle_getAttribute(IHTMLStyle *iface, BSTR strAttributeName,
2150         LONG lFlags, VARIANT *AttributeValue)
2151 {
2152     HTMLStyle *This = HTMLSTYLE_THIS(iface);
2153     HRESULT hres;
2154     DISPID dispid;
2155
2156     TRACE("(%p)->(%s v%p %08x)\n", This, debugstr_w(strAttributeName),
2157           AttributeValue, lFlags);
2158
2159     if(!AttributeValue || !strAttributeName)
2160         return E_INVALIDARG;
2161
2162     if(lFlags == 1)
2163         FIXME("Parameter lFlags ignored\n");
2164
2165     hres = HTMLStyle_GetIDsOfNames(iface, &IID_NULL, (LPOLESTR*)&strAttributeName, 1,
2166                         LOCALE_USER_DEFAULT, &dispid);
2167     if(hres == S_OK)
2168     {
2169         DISPPARAMS params = {NULL, NULL, 0, 0 };
2170
2171         hres = HTMLStyle_Invoke(iface, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
2172             DISPATCH_PROPERTYGET, &params, AttributeValue, NULL, NULL);
2173     }
2174     else
2175     {
2176         FIXME("Custom attributes not supported.\n");
2177     }
2178
2179     return hres;
2180 }
2181
2182 static HRESULT WINAPI HTMLStyle_removeAttribute(IHTMLStyle *iface, BSTR strAttributeName,
2183                                                 LONG lFlags, VARIANT_BOOL *pfSuccess)
2184 {
2185     HTMLStyle *This = HTMLSTYLE_THIS(iface);
2186     FIXME("(%p)->(%s %08x %p)\n", This, debugstr_w(strAttributeName),
2187          lFlags, pfSuccess);
2188     return E_NOTIMPL;
2189 }
2190
2191 static HRESULT WINAPI HTMLStyle_toString(IHTMLStyle *iface, BSTR *String)
2192 {
2193     HTMLStyle *This = HTMLSTYLE_THIS(iface);
2194     FIXME("(%p)->(%p)\n", This, String);
2195     return E_NOTIMPL;
2196 }
2197
2198 static HRESULT HTMLStyle_get_dispid(IUnknown *iface, BSTR name, DWORD flags, DISPID *dispid)
2199 {
2200     int c, i, min=0, max = sizeof(style_tbl)/sizeof(*style_tbl)-1;
2201
2202     while(min <= max) {
2203         i = (min+max)/2;
2204
2205         c = strcmpW(style_tbl[i].name, name);
2206         if(!c) {
2207             *dispid = style_tbl[i].dispid;
2208             return S_OK;
2209         }
2210
2211         if(c > 0)
2212             max = i-1;
2213         else
2214             min = i+1;
2215     }
2216
2217     return DISP_E_UNKNOWNNAME;
2218 }
2219
2220 static const IHTMLStyleVtbl HTMLStyleVtbl = {
2221     HTMLStyle_QueryInterface,
2222     HTMLStyle_AddRef,
2223     HTMLStyle_Release,
2224     HTMLStyle_GetTypeInfoCount,
2225     HTMLStyle_GetTypeInfo,
2226     HTMLStyle_GetIDsOfNames,
2227     HTMLStyle_Invoke,
2228     HTMLStyle_put_fontFamily,
2229     HTMLStyle_get_fontFamily,
2230     HTMLStyle_put_fontStyle,
2231     HTMLStyle_get_fontStyle,
2232     HTMLStyle_put_fontVariant,
2233     HTMLStyle_get_fontVariant,
2234     HTMLStyle_put_fontWeight,
2235     HTMLStyle_get_fontWeight,
2236     HTMLStyle_put_fontSize,
2237     HTMLStyle_get_fontSize,
2238     HTMLStyle_put_font,
2239     HTMLStyle_get_font,
2240     HTMLStyle_put_color,
2241     HTMLStyle_get_color,
2242     HTMLStyle_put_background,
2243     HTMLStyle_get_background,
2244     HTMLStyle_put_backgroundColor,
2245     HTMLStyle_get_backgroundColor,
2246     HTMLStyle_put_backgroundImage,
2247     HTMLStyle_get_backgroundImage,
2248     HTMLStyle_put_backgroundRepeat,
2249     HTMLStyle_get_backgroundRepeat,
2250     HTMLStyle_put_backgroundAttachment,
2251     HTMLStyle_get_backgroundAttachment,
2252     HTMLStyle_put_backgroundPosition,
2253     HTMLStyle_get_backgroundPosition,
2254     HTMLStyle_put_backgroundPositionX,
2255     HTMLStyle_get_backgroundPositionX,
2256     HTMLStyle_put_backgroundPositionY,
2257     HTMLStyle_get_backgroundPositionY,
2258     HTMLStyle_put_wordSpacing,
2259     HTMLStyle_get_wordSpacing,
2260     HTMLStyle_put_letterSpacing,
2261     HTMLStyle_get_letterSpacing,
2262     HTMLStyle_put_textDecoration,
2263     HTMLStyle_get_textDecoration,
2264     HTMLStyle_put_textDecorationNone,
2265     HTMLStyle_get_textDecorationNone,
2266     HTMLStyle_put_textDecorationUnderline,
2267     HTMLStyle_get_textDecorationUnderline,
2268     HTMLStyle_put_textDecorationOverline,
2269     HTMLStyle_get_textDecorationOverline,
2270     HTMLStyle_put_textDecorationLineThrough,
2271     HTMLStyle_get_textDecorationLineThrough,
2272     HTMLStyle_put_textDecorationBlink,
2273     HTMLStyle_get_textDecorationBlink,
2274     HTMLStyle_put_verticalAlign,
2275     HTMLStyle_get_verticalAlign,
2276     HTMLStyle_put_textTransform,
2277     HTMLStyle_get_textTransform,
2278     HTMLStyle_put_textAlign,
2279     HTMLStyle_get_textAlign,
2280     HTMLStyle_put_textIndent,
2281     HTMLStyle_get_textIndent,
2282     HTMLStyle_put_lineHeight,
2283     HTMLStyle_get_lineHeight,
2284     HTMLStyle_put_marginTop,
2285     HTMLStyle_get_marginTop,
2286     HTMLStyle_put_marginRight,
2287     HTMLStyle_get_marginRight,
2288     HTMLStyle_put_marginBottom,
2289     HTMLStyle_get_marginBottom,
2290     HTMLStyle_put_marginLeft,
2291     HTMLStyle_get_marginLeft,
2292     HTMLStyle_put_margin,
2293     HTMLStyle_get_margin,
2294     HTMLStyle_put_paddingTop,
2295     HTMLStyle_get_paddingTop,
2296     HTMLStyle_put_paddingRight,
2297     HTMLStyle_get_paddingRight,
2298     HTMLStyle_put_paddingBottom,
2299     HTMLStyle_get_paddingBottom,
2300     HTMLStyle_put_paddingLeft,
2301     HTMLStyle_get_paddingLeft,
2302     HTMLStyle_put_padding,
2303     HTMLStyle_get_padding,
2304     HTMLStyle_put_border,
2305     HTMLStyle_get_border,
2306     HTMLStyle_put_borderTop,
2307     HTMLStyle_get_borderTop,
2308     HTMLStyle_put_borderRight,
2309     HTMLStyle_get_borderRight,
2310     HTMLStyle_put_borderBottom,
2311     HTMLStyle_get_borderBottom,
2312     HTMLStyle_put_borderLeft,
2313     HTMLStyle_get_borderLeft,
2314     HTMLStyle_put_borderColor,
2315     HTMLStyle_get_borderColor,
2316     HTMLStyle_put_borderTopColor,
2317     HTMLStyle_get_borderTopColor,
2318     HTMLStyle_put_borderRightColor,
2319     HTMLStyle_get_borderRightColor,
2320     HTMLStyle_put_borderBottomColor,
2321     HTMLStyle_get_borderBottomColor,
2322     HTMLStyle_put_borderLeftColor,
2323     HTMLStyle_get_borderLeftColor,
2324     HTMLStyle_put_borderWidth,
2325     HTMLStyle_get_borderWidth,
2326     HTMLStyle_put_borderTopWidth,
2327     HTMLStyle_get_borderTopWidth,
2328     HTMLStyle_put_borderRightWidth,
2329     HTMLStyle_get_borderRightWidth,
2330     HTMLStyle_put_borderBottomWidth,
2331     HTMLStyle_get_borderBottomWidth,
2332     HTMLStyle_put_borderLeftWidth,
2333     HTMLStyle_get_borderLeftWidth,
2334     HTMLStyle_put_borderStyle,
2335     HTMLStyle_get_borderStyle,
2336     HTMLStyle_put_borderTopStyle,
2337     HTMLStyle_get_borderTopStyle,
2338     HTMLStyle_put_borderRightStyle,
2339     HTMLStyle_get_borderRightStyle,
2340     HTMLStyle_put_borderBottomStyle,
2341     HTMLStyle_get_borderBottomStyle,
2342     HTMLStyle_put_borderLeftStyle,
2343     HTMLStyle_get_borderLeftStyle,
2344     HTMLStyle_put_width,
2345     HTMLStyle_get_width,
2346     HTMLStyle_put_height,
2347     HTMLStyle_get_height,
2348     HTMLStyle_put_styleFloat,
2349     HTMLStyle_get_styleFloat,
2350     HTMLStyle_put_clear,
2351     HTMLStyle_get_clear,
2352     HTMLStyle_put_display,
2353     HTMLStyle_get_display,
2354     HTMLStyle_put_visibility,
2355     HTMLStyle_get_visibility,
2356     HTMLStyle_put_listStyleType,
2357     HTMLStyle_get_listStyleType,
2358     HTMLStyle_put_listStylePosition,
2359     HTMLStyle_get_listStylePosition,
2360     HTMLStyle_put_listStyleImage,
2361     HTMLStyle_get_listStyleImage,
2362     HTMLStyle_put_listStyle,
2363     HTMLStyle_get_listStyle,
2364     HTMLStyle_put_whiteSpace,
2365     HTMLStyle_get_whiteSpace,
2366     HTMLStyle_put_top,
2367     HTMLStyle_get_top,
2368     HTMLStyle_put_left,
2369     HTMLStyle_get_left,
2370     HTMLStyle_get_position,
2371     HTMLStyle_put_zIndex,
2372     HTMLStyle_get_zIndex,
2373     HTMLStyle_put_overflow,
2374     HTMLStyle_get_overflow,
2375     HTMLStyle_put_pageBreakBefore,
2376     HTMLStyle_get_pageBreakBefore,
2377     HTMLStyle_put_pageBreakAfter,
2378     HTMLStyle_get_pageBreakAfter,
2379     HTMLStyle_put_cssText,
2380     HTMLStyle_get_cssText,
2381     HTMLStyle_put_pixelTop,
2382     HTMLStyle_get_pixelTop,
2383     HTMLStyle_put_pixelLeft,
2384     HTMLStyle_get_pixelLeft,
2385     HTMLStyle_put_pixelWidth,
2386     HTMLStyle_get_pixelWidth,
2387     HTMLStyle_put_pixelHeight,
2388     HTMLStyle_get_pixelHeight,
2389     HTMLStyle_put_posTop,
2390     HTMLStyle_get_posTop,
2391     HTMLStyle_put_posLeft,
2392     HTMLStyle_get_posLeft,
2393     HTMLStyle_put_posWidth,
2394     HTMLStyle_get_posWidth,
2395     HTMLStyle_put_posHeight,
2396     HTMLStyle_get_posHeight,
2397     HTMLStyle_put_cursor,
2398     HTMLStyle_get_cursor,
2399     HTMLStyle_put_clip,
2400     HTMLStyle_get_clip,
2401     HTMLStyle_put_filter,
2402     HTMLStyle_get_filter,
2403     HTMLStyle_setAttribute,
2404     HTMLStyle_getAttribute,
2405     HTMLStyle_removeAttribute,
2406     HTMLStyle_toString
2407 };
2408
2409 static const dispex_static_data_vtbl_t HTMLStyle_dispex_vtbl = {
2410     HTMLStyle_get_dispid,
2411     NULL
2412 };
2413
2414 static const tid_t HTMLStyle_iface_tids[] = {
2415     IHTMLStyle_tid,
2416     IHTMLStyle2_tid,
2417     0
2418 };
2419 static dispex_static_data_t HTMLStyle_dispex = {
2420     &HTMLStyle_dispex_vtbl,
2421     DispHTMLStyle_tid,
2422     NULL,
2423     HTMLStyle_iface_tids
2424 };
2425
2426 IHTMLStyle *HTMLStyle_Create(nsIDOMCSSStyleDeclaration *nsstyle)
2427 {
2428     HTMLStyle *ret = heap_alloc_zero(sizeof(HTMLStyle));
2429
2430     ret->lpHTMLStyleVtbl = &HTMLStyleVtbl;
2431     ret->ref = 1;
2432     ret->nsstyle = nsstyle;
2433     HTMLStyle2_Init(ret);
2434     HTMLStyle3_Init(ret);
2435
2436     nsIDOMCSSStyleDeclaration_AddRef(nsstyle);
2437
2438     init_dispex(&ret->dispex, (IUnknown*)HTMLSTYLE(ret),  &HTMLStyle_dispex);
2439
2440     return HTMLSTYLE(ret);
2441 }