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