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