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