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