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