push 818f085f73990f577927aeb76c81fa65ee9c5568
[wine/hacks.git] / dlls / mshtml / htmlstyle.c
blob705f44a4638cbdc2fb6bf056c6131e6607ad6152
1 /*
2 * Copyright 2006 Jacek Caban for CodeWeavers
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.
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.
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
19 #include <stdarg.h>
20 #include <math.h>
22 #define COBJMACROS
24 #include "windef.h"
25 #include "winbase.h"
26 #include "winuser.h"
27 #include "ole2.h"
28 #include "mshtmdid.h"
30 #include "mshtml_private.h"
31 #include "htmlstyle.h"
33 #include "wine/debug.h"
34 #include "wine/unicode.h"
36 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
38 static const WCHAR attrBackground[] =
39 {'b','a','c','k','g','r','o','u','n','d',0};
40 static const WCHAR attrBackgroundColor[] =
41 {'b','a','c','k','g','r','o','u','n','d','-','c','o','l','o','r',0};
42 static const WCHAR attrBackgroundImage[] =
43 {'b','a','c','k','g','r','o','u','n','d','-','i','m','a','g','e',0};
44 static const WCHAR attrBorder[] =
45 {'b','o','r','d','e','r',0};
46 static const WCHAR attrBorderLeft[] =
47 {'b','o','r','d','e','r','-','l','e','f','t',0};
48 static const WCHAR attrBorderWidth[] =
49 {'b','o','r','d','e','r','-','w','i','d','t','h',0};
50 static const WCHAR attrColor[] =
51 {'c','o','l','o','r',0};
52 static const WCHAR attrCursor[] =
53 {'c','u','r','s','o','r',0};
54 static const WCHAR attrDisplay[] =
55 {'d','i','s','p','l','a','y',0};
56 static const WCHAR attrFilter[] =
57 {'f','i','l','e','t','e','r',0};
58 static const WCHAR attrFontFamily[] =
59 {'f','o','n','t','-','f','a','m','i','l','y',0};
60 static const WCHAR attrFontSize[] =
61 {'f','o','n','t','-','s','i','z','e',0};
62 static const WCHAR attrFontStyle[] =
63 {'f','o','n','t','-','s','t','y','l','e',0};
64 static const WCHAR attrFontVariant[] =
65 {'f','o','n','t','-','v','a','r','i','a','n','t',0};
66 static const WCHAR attrFontWeight[] =
67 {'f','o','n','t','-','w','e','i','g','h','t',0};
68 static const WCHAR attrHeight[] =
69 {'h','e','i','g','h','t',0};
70 static const WCHAR attrLeft[] =
71 {'l','e','f','t',0};
72 static const WCHAR attrMargin[] =
73 {'m','a','r','g','i','n',0};
74 static const WCHAR attrMarginLeft[] =
75 {'m','a','r','g','i','n','-','l','e','f','t',0};
76 static const WCHAR attrMarginRight[] =
77 {'m','a','r','g','i','n','-','r','i','g','h','t',0};
78 static const WCHAR attrOverflow[] =
79 {'o','v','e','r','f','l','o','w',0};
80 static const WCHAR attrPaddingLeft[] =
81 {'p','a','d','d','i','n','g','-','l','e','f','t',0};
82 static const WCHAR attrPosition[] =
83 {'p','o','s','i','t','i','o','n',0};
84 static const WCHAR attrTextAlign[] =
85 {'t','e','x','t','-','a','l','i','g','n',0};
86 static const WCHAR attrTextDecoration[] =
87 {'t','e','x','t','-','d','e','c','o','r','a','t','i','o','n',0};
88 static const WCHAR attrTop[] =
89 {'t','o','p',0};
90 static const WCHAR attrVerticalAlign[] =
91 {'v','e','r','t','i','c','a','l','-','a','l','i','g','n',0};
92 static const WCHAR attrVisibility[] =
93 {'v','i','s','i','b','i','l','i','t','y',0};
94 static const WCHAR attrWidth[] =
95 {'w','i','d','t','h',0};
96 static const WCHAR attrZIndex[] =
97 {'z','-','i','n','d','e','x',0};
99 static const struct{
100 const WCHAR *name;
101 DISPID dispid;
102 } style_tbl[] = {
103 {attrBackground, DISPID_IHTMLSTYLE_BACKGROUND},
104 {attrBackgroundColor, DISPID_IHTMLSTYLE_BACKGROUNDCOLOR},
105 {attrBackgroundImage, DISPID_IHTMLSTYLE_BACKGROUNDIMAGE},
106 {attrBorder, DISPID_IHTMLSTYLE_BORDER},
107 {attrBorderLeft, DISPID_IHTMLSTYLE_BORDERLEFT},
108 {attrBorderWidth, DISPID_IHTMLSTYLE_BORDERWIDTH},
109 {attrColor, DISPID_IHTMLSTYLE_COLOR},
110 {attrCursor, DISPID_IHTMLSTYLE_CURSOR},
111 {attrDisplay, DISPID_IHTMLSTYLE_DISPLAY},
112 {attrFilter, DISPID_IHTMLSTYLE_FILTER},
113 {attrFontFamily, DISPID_IHTMLSTYLE_FONTFAMILY},
114 {attrFontSize, DISPID_IHTMLSTYLE_FONTSIZE},
115 {attrFontStyle, DISPID_IHTMLSTYLE_FONTSTYLE},
116 {attrFontVariant, DISPID_IHTMLSTYLE_FONTVARIANT},
117 {attrFontWeight, DISPID_IHTMLSTYLE_FONTWEIGHT},
118 {attrHeight, DISPID_IHTMLSTYLE_HEIGHT},
119 {attrLeft, DISPID_IHTMLSTYLE_LEFT},
120 {attrMargin, DISPID_IHTMLSTYLE_MARGIN},
121 {attrMarginLeft, DISPID_IHTMLSTYLE_MARGINLEFT},
122 {attrMarginRight, DISPID_IHTMLSTYLE_MARGINRIGHT},
123 {attrOverflow, DISPID_IHTMLSTYLE_OVERFLOW},
124 {attrPaddingLeft, DISPID_IHTMLSTYLE_PADDINGLEFT},
125 {attrPosition, DISPID_IHTMLSTYLE2_POSITION},
126 {attrTextAlign, DISPID_IHTMLSTYLE_TEXTALIGN},
127 {attrTextDecoration, DISPID_IHTMLSTYLE_TEXTDECORATION},
128 {attrTop, DISPID_IHTMLSTYLE_TOP},
129 {attrVerticalAlign, DISPID_IHTMLSTYLE_VERTICALALIGN},
130 {attrVisibility, DISPID_IHTMLSTYLE_VISIBILITY},
131 {attrWidth, DISPID_IHTMLSTYLE_WIDTH},
132 {attrZIndex, DISPID_IHTMLSTYLE_ZINDEX}
135 static const WCHAR valLineThrough[] =
136 {'l','i','n','e','-','t','h','r','o','u','g','h',0};
137 static const WCHAR valUnderline[] =
138 {'u','n','d','e','r','l','i','n','e',0};
139 static const WCHAR szNormal[] =
140 {'n','o','r','m','a','l',0};
142 static const WCHAR px_formatW[] = {'%','d','p','x',0};
143 static const WCHAR emptyW[] = {0};
145 static LPWSTR fix_px_value(LPCWSTR val)
147 LPCWSTR ptr = val;
149 while(*ptr) {
150 while(*ptr && isspaceW(*ptr))
151 ptr++;
152 if(!*ptr)
153 break;
155 while(*ptr && isdigitW(*ptr))
156 ptr++;
158 if(!*ptr || isspaceW(*ptr)) {
159 LPWSTR ret, p;
160 int len = strlenW(val)+1;
162 ret = heap_alloc((len+2)*sizeof(WCHAR));
163 memcpy(ret, val, (ptr-val)*sizeof(WCHAR));
164 p = ret + (ptr-val);
165 *p++ = 'p';
166 *p++ = 'x';
167 strcpyW(p, ptr);
169 TRACE("fixed %s -> %s\n", debugstr_w(val), debugstr_w(ret));
171 return ret;
174 while(*ptr && !isspaceW(*ptr))
175 ptr++;
178 return NULL;
181 static LPWSTR fix_url_value(LPCWSTR val)
183 WCHAR *ret, *ptr;
185 static const WCHAR urlW[] = {'u','r','l','('};
187 if(strncmpW(val, urlW, sizeof(urlW)/sizeof(WCHAR)) || !strchrW(val, '\\'))
188 return NULL;
190 ret = heap_strdupW(val);
192 for(ptr = ret; *ptr; ptr++) {
193 if(*ptr == '\\')
194 *ptr = '/';
197 return ret;
200 #define ATTR_FIX_PX 1
201 #define ATTR_FIX_URL 2
202 #define ATTR_STR_TO_INT 4
204 HRESULT set_nsstyle_attr(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, LPCWSTR value, DWORD flags)
206 nsAString str_name, str_value, str_empty;
207 LPWSTR val = NULL;
208 nsresult nsres;
210 static const PRUnichar wszEmpty[] = {0};
212 if(flags & ATTR_FIX_PX)
213 val = fix_px_value(value);
214 if(flags & ATTR_FIX_URL)
215 val = fix_url_value(value);
217 nsAString_Init(&str_name, style_tbl[sid].name);
218 nsAString_Init(&str_value, val ? val : value);
219 nsAString_Init(&str_empty, wszEmpty);
220 heap_free(val);
222 nsres = nsIDOMCSSStyleDeclaration_SetProperty(nsstyle, &str_name, &str_value, &str_empty);
223 if(NS_FAILED(nsres))
224 ERR("SetProperty failed: %08x\n", nsres);
226 nsAString_Finish(&str_name);
227 nsAString_Finish(&str_value);
228 nsAString_Finish(&str_empty);
230 return S_OK;
233 static HRESULT set_nsstyle_attr_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, VARIANT *value, DWORD flags)
235 switch(V_VT(value)) {
236 case VT_NULL:
237 return set_nsstyle_attr(nsstyle, sid, emptyW, flags);
239 case VT_BSTR:
240 return set_nsstyle_attr(nsstyle, sid, V_BSTR(value), flags);
242 default:
243 FIXME("not implemented vt %d\n", V_VT(value));
244 return E_NOTIMPL;
248 return S_OK;
251 static inline HRESULT set_style_attr(HTMLStyle *This, styleid_t sid, LPCWSTR value, DWORD flags)
253 return set_nsstyle_attr(This->nsstyle, sid, value, flags);
256 static HRESULT get_nsstyle_attr_nsval(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, nsAString *value)
258 nsAString str_name;
259 nsresult nsres;
261 nsAString_Init(&str_name, style_tbl[sid].name);
263 nsres = nsIDOMCSSStyleDeclaration_GetPropertyValue(nsstyle, &str_name, value);
264 if(NS_FAILED(nsres)) {
265 ERR("SetProperty failed: %08x\n", nsres);
266 return E_FAIL;
269 nsAString_Finish(&str_name);
271 return NS_OK;
274 HRESULT get_nsstyle_attr(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, BSTR *p)
276 nsAString str_value;
277 const PRUnichar *value;
279 nsAString_Init(&str_value, NULL);
281 get_nsstyle_attr_nsval(nsstyle, sid, &str_value);
283 nsAString_GetData(&str_value, &value);
284 *p = *value ? SysAllocString(value) : NULL;
286 nsAString_Finish(&str_value);
288 TRACE("%s -> %s\n", debugstr_w(style_tbl[sid].name), debugstr_w(*p));
289 return S_OK;
292 static HRESULT get_nsstyle_attr_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, VARIANT *p, DWORD flags)
294 nsAString str_value;
295 const PRUnichar *value;
296 BOOL set = FALSE;
298 nsAString_Init(&str_value, NULL);
300 get_nsstyle_attr_nsval(nsstyle, sid, &str_value);
302 nsAString_GetData(&str_value, &value);
304 if(flags & ATTR_STR_TO_INT) {
305 const PRUnichar *ptr = value;
306 BOOL neg = FALSE;
307 INT i = 0;
309 if(*ptr == '-') {
310 neg = TRUE;
311 ptr++;
314 while(isdigitW(*ptr))
315 i = i*10 + (*ptr++ - '0');
317 if(!*ptr) {
318 V_VT(p) = VT_I4;
319 V_I4(p) = neg ? -i : i;
320 set = TRUE;
324 if(!set) {
325 BSTR str = NULL;
327 if(*value) {
328 str = SysAllocString(value);
329 if(!str)
330 return E_OUTOFMEMORY;
333 V_VT(p) = VT_BSTR;
334 V_BSTR(p) = str;
337 nsAString_Finish(&str_value);
339 TRACE("%s -> %s\n", debugstr_w(style_tbl[sid].name), debugstr_variant(p));
340 return S_OK;
343 static inline HRESULT get_style_attr(HTMLStyle *This, styleid_t sid, BSTR *p)
345 return get_nsstyle_attr(This->nsstyle, sid, p);
348 static HRESULT check_style_attr_value(HTMLStyle *This, styleid_t sid, LPCWSTR exval, VARIANT_BOOL *p)
350 nsAString str_value;
351 const PRUnichar *value;
353 nsAString_Init(&str_value, NULL);
355 get_nsstyle_attr_nsval(This->nsstyle, sid, &str_value);
357 nsAString_GetData(&str_value, &value);
358 *p = strcmpW(value, exval) ? VARIANT_FALSE : VARIANT_TRUE;
359 nsAString_Finish(&str_value);
361 TRACE("%s -> %x\n", debugstr_w(style_tbl[sid].name), *p);
362 return S_OK;
365 static inline HRESULT set_style_pos(HTMLStyle *This, styleid_t sid, float value)
367 WCHAR szValue[25];
368 WCHAR szFormat[] = {'%','.','0','f','p','x',0};
370 value = floor(value);
372 sprintfW(szValue, szFormat, value);
374 return set_style_attr(This, sid, szValue, 0);
377 static HRESULT get_nsstyle_pos(HTMLStyle *This, styleid_t sid, float *p)
379 nsAString str_value;
380 HRESULT hres;
381 WCHAR pxW[] = {'p','x',0};
383 TRACE("%p %d %p\n", This, sid, p);
385 *p = 0.0f;
387 nsAString_Init(&str_value, NULL);
389 hres = get_nsstyle_attr_nsval(This->nsstyle, sid, &str_value);
390 if(hres == S_OK)
392 WCHAR *ptr;
393 const PRUnichar *value;
395 nsAString_GetData(&str_value, &value);
396 if(value)
398 *p = strtolW(value, &ptr, 10);
400 if(*ptr && strcmpW(ptr, pxW))
402 nsAString_Finish(&str_value);
403 FIXME("only px values are currently supported\n");
404 return E_FAIL;
409 TRACE("ret %f\n", *p);
411 nsAString_Finish(&str_value);
413 return hres;
416 #define HTMLSTYLE_THIS(iface) DEFINE_THIS(HTMLStyle, HTMLStyle, iface)
418 static HRESULT WINAPI HTMLStyle_QueryInterface(IHTMLStyle *iface, REFIID riid, void **ppv)
420 HTMLStyle *This = HTMLSTYLE_THIS(iface);
422 *ppv = NULL;
424 if(IsEqualGUID(&IID_IUnknown, riid)) {
425 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
426 *ppv = HTMLSTYLE(This);
427 }else if(IsEqualGUID(&IID_IHTMLStyle, riid)) {
428 TRACE("(%p)->(IID_IHTMLStyle %p)\n", This, ppv);
429 *ppv = HTMLSTYLE(This);
430 }else if(IsEqualGUID(&IID_IHTMLStyle2, riid)) {
431 TRACE("(%p)->(IID_IHTMLStyle2 %p)\n", This, ppv);
432 *ppv = HTMLSTYLE2(This);
433 }else if(dispex_query_interface(&This->dispex, riid, ppv)) {
434 return *ppv ? S_OK : E_NOINTERFACE;
437 if(*ppv) {
438 IUnknown_AddRef((IUnknown*)*ppv);
439 return S_OK;
442 WARN("unsupported %s\n", debugstr_guid(riid));
443 return E_NOINTERFACE;
446 static ULONG WINAPI HTMLStyle_AddRef(IHTMLStyle *iface)
448 HTMLStyle *This = HTMLSTYLE_THIS(iface);
449 LONG ref = InterlockedIncrement(&This->ref);
451 TRACE("(%p) ref=%d\n", This, ref);
453 return ref;
456 static ULONG WINAPI HTMLStyle_Release(IHTMLStyle *iface)
458 HTMLStyle *This = HTMLSTYLE_THIS(iface);
459 LONG ref = InterlockedDecrement(&This->ref);
461 TRACE("(%p) ref=%d\n", This, ref);
463 if(!ref) {
464 if(This->nsstyle)
465 nsIDOMCSSStyleDeclaration_Release(This->nsstyle);
466 heap_free(This);
469 return ref;
472 static HRESULT WINAPI HTMLStyle_GetTypeInfoCount(IHTMLStyle *iface, UINT *pctinfo)
474 HTMLStyle *This = HTMLSTYLE_THIS(iface);
475 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->dispex), pctinfo);
478 static HRESULT WINAPI HTMLStyle_GetTypeInfo(IHTMLStyle *iface, UINT iTInfo,
479 LCID lcid, ITypeInfo **ppTInfo)
481 HTMLStyle *This = HTMLSTYLE_THIS(iface);
482 return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->dispex), iTInfo, lcid, ppTInfo);
485 static HRESULT WINAPI HTMLStyle_GetIDsOfNames(IHTMLStyle *iface, REFIID riid,
486 LPOLESTR *rgszNames, UINT cNames,
487 LCID lcid, DISPID *rgDispId)
489 HTMLStyle *This = HTMLSTYLE_THIS(iface);
490 return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->dispex), riid, rgszNames, cNames, lcid, rgDispId);
493 static HRESULT WINAPI HTMLStyle_Invoke(IHTMLStyle *iface, DISPID dispIdMember,
494 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
495 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
497 HTMLStyle *This = HTMLSTYLE_THIS(iface);
498 return IDispatchEx_Invoke(DISPATCHEX(&This->dispex), dispIdMember, riid, lcid,
499 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
502 static HRESULT WINAPI HTMLStyle_put_fontFamily(IHTMLStyle *iface, BSTR v)
504 HTMLStyle *This = HTMLSTYLE_THIS(iface);
506 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
508 return set_style_attr(This, STYLEID_FONT_FAMILY, v, 0);
511 static HRESULT WINAPI HTMLStyle_get_fontFamily(IHTMLStyle *iface, BSTR *p)
513 HTMLStyle *This = HTMLSTYLE_THIS(iface);
515 TRACE("(%p)->(%p)\n", This, p);
517 return get_style_attr(This, STYLEID_FONT_FAMILY, p);
520 static HRESULT WINAPI HTMLStyle_put_fontStyle(IHTMLStyle *iface, BSTR v)
522 HTMLStyle *This = HTMLSTYLE_THIS(iface);
523 static const WCHAR szItalic[] = {'i','t','a','l','i','c',0};
524 static const WCHAR szOblique[] = {'o','b','l','i','q','u','e',0};
526 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
528 /* fontStyle can only be one of the follow values. */
529 if(!v || strcmpiW(szNormal, v) == 0 || strcmpiW(szItalic, v) == 0 ||
530 strcmpiW(szOblique, v) == 0)
532 return set_nsstyle_attr(This->nsstyle, STYLEID_FONT_STYLE, v, 0);
535 return E_INVALIDARG;
538 static HRESULT WINAPI HTMLStyle_get_fontStyle(IHTMLStyle *iface, BSTR *p)
540 HTMLStyle *This = HTMLSTYLE_THIS(iface);
542 TRACE("(%p)->(%p)\n", This, p);
544 return get_style_attr(This, STYLEID_FONT_STYLE, p);
547 static HRESULT WINAPI HTMLStyle_put_fontVariant(IHTMLStyle *iface, BSTR v)
549 HTMLStyle *This = HTMLSTYLE_THIS(iface);
550 static const WCHAR szCaps[] = {'s','m','a','l','l','-','c','a','p','s',0};
552 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
554 /* fontVariant can only be one of the follow values. */
555 if(!v || strcmpiW(szNormal, v) == 0 || strcmpiW(szCaps, v) == 0)
557 return set_nsstyle_attr(This->nsstyle, STYLEID_FONT_VARIANT, v, 0);
560 return E_INVALIDARG;
563 static HRESULT WINAPI HTMLStyle_get_fontVariant(IHTMLStyle *iface, BSTR *p)
565 HTMLStyle *This = HTMLSTYLE_THIS(iface);
566 TRACE("(%p)->(%p)\n", This, p);
568 if(!p)
569 return E_INVALIDARG;
571 return get_style_attr(This, STYLEID_FONT_VARIANT, p);
574 static HRESULT WINAPI HTMLStyle_put_fontWeight(IHTMLStyle *iface, BSTR v)
576 HTMLStyle *This = HTMLSTYLE_THIS(iface);
577 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
578 return E_NOTIMPL;
581 static HRESULT WINAPI HTMLStyle_get_fontWeight(IHTMLStyle *iface, BSTR *p)
583 HTMLStyle *This = HTMLSTYLE_THIS(iface);
585 TRACE("(%p)->(%p)\n", This, p);
587 return get_style_attr(This, STYLEID_FONT_WEIGHT, p);
590 static HRESULT WINAPI HTMLStyle_put_fontSize(IHTMLStyle *iface, VARIANT v)
592 HTMLStyle *This = HTMLSTYLE_THIS(iface);
594 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
596 switch(V_VT(&v)) {
597 case VT_BSTR:
598 return set_style_attr(This, STYLEID_FONT_SIZE, V_BSTR(&v), 0);
599 default:
600 FIXME("not supported vt %d\n", V_VT(&v));
603 return S_OK;
606 static HRESULT WINAPI HTMLStyle_get_fontSize(IHTMLStyle *iface, VARIANT *p)
608 HTMLStyle *This = HTMLSTYLE_THIS(iface);
610 TRACE("(%p)->(%p)\n", This, p);
612 V_VT(p) = VT_BSTR;
613 return get_style_attr(This, STYLEID_FONT_SIZE, &V_BSTR(p));
616 static HRESULT WINAPI HTMLStyle_put_font(IHTMLStyle *iface, BSTR v)
618 HTMLStyle *This = HTMLSTYLE_THIS(iface);
619 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
620 return E_NOTIMPL;
623 static HRESULT WINAPI HTMLStyle_get_font(IHTMLStyle *iface, BSTR *p)
625 HTMLStyle *This = HTMLSTYLE_THIS(iface);
626 FIXME("(%p)->(%p)\n", This, p);
627 return E_NOTIMPL;
630 static HRESULT WINAPI HTMLStyle_put_color(IHTMLStyle *iface, VARIANT v)
632 HTMLStyle *This = HTMLSTYLE_THIS(iface);
634 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
636 switch(V_VT(&v)) {
637 case VT_BSTR:
638 TRACE("%s\n", debugstr_w(V_BSTR(&v)));
639 return set_style_attr(This, STYLEID_COLOR, V_BSTR(&v), 0);
641 default:
642 FIXME("unsupported vt=%d\n", V_VT(&v));
645 return E_NOTIMPL;
648 static HRESULT WINAPI HTMLStyle_get_color(IHTMLStyle *iface, VARIANT *p)
650 HTMLStyle *This = HTMLSTYLE_THIS(iface);
652 TRACE("(%p)->(%p)\n", This, p);
654 V_VT(p) = VT_BSTR;
655 return get_style_attr(This, STYLEID_COLOR, &V_BSTR(p));
658 static HRESULT WINAPI HTMLStyle_put_background(IHTMLStyle *iface, BSTR v)
660 HTMLStyle *This = HTMLSTYLE_THIS(iface);
662 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
664 return set_style_attr(This, STYLEID_BACKGROUND, v, 0);
667 static HRESULT WINAPI HTMLStyle_get_background(IHTMLStyle *iface, BSTR *p)
669 HTMLStyle *This = HTMLSTYLE_THIS(iface);
671 TRACE("(%p)->(%p)\n", This, p);
673 return get_style_attr(This, STYLEID_BACKGROUND, p);
676 static HRESULT WINAPI HTMLStyle_put_backgroundColor(IHTMLStyle *iface, VARIANT v)
678 HTMLStyle *This = HTMLSTYLE_THIS(iface);
680 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
682 switch(V_VT(&v)) {
683 case VT_BSTR:
684 return set_style_attr(This, STYLEID_BACKGROUND_COLOR, V_BSTR(&v), 0);
685 case VT_I4: {
686 WCHAR value[10];
687 static const WCHAR format[] = {'#','%','0','6','x',0};
689 wsprintfW(value, format, V_I4(&v));
690 return set_style_attr(This, STYLEID_BACKGROUND_COLOR, value, 0);
692 default:
693 FIXME("unsupported vt %d\n", V_VT(&v));
696 return S_OK;
699 static HRESULT WINAPI HTMLStyle_get_backgroundColor(IHTMLStyle *iface, VARIANT *p)
701 HTMLStyle *This = HTMLSTYLE_THIS(iface);
702 FIXME("(%p)->(%p)\n", This, p);
703 return E_NOTIMPL;
706 static HRESULT WINAPI HTMLStyle_put_backgroundImage(IHTMLStyle *iface, BSTR v)
708 HTMLStyle *This = HTMLSTYLE_THIS(iface);
710 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
712 return set_style_attr(This, STYLEID_BACKGROUND_IMAGE, v, ATTR_FIX_URL);
715 static HRESULT WINAPI HTMLStyle_get_backgroundImage(IHTMLStyle *iface, BSTR *p)
717 HTMLStyle *This = HTMLSTYLE_THIS(iface);
719 TRACE("(%p)->(%p)\n", This, p);
721 return get_style_attr(This, STYLEID_BACKGROUND_IMAGE, p);
724 static HRESULT WINAPI HTMLStyle_put_backgroundRepeat(IHTMLStyle *iface, BSTR v)
726 HTMLStyle *This = HTMLSTYLE_THIS(iface);
727 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
728 return E_NOTIMPL;
731 static HRESULT WINAPI HTMLStyle_get_backgroundRepeat(IHTMLStyle *iface, BSTR *p)
733 HTMLStyle *This = HTMLSTYLE_THIS(iface);
734 FIXME("(%p)->(%p)\n", This, p);
735 return E_NOTIMPL;
738 static HRESULT WINAPI HTMLStyle_put_backgroundAttachment(IHTMLStyle *iface, BSTR v)
740 HTMLStyle *This = HTMLSTYLE_THIS(iface);
741 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
742 return E_NOTIMPL;
745 static HRESULT WINAPI HTMLStyle_get_backgroundAttachment(IHTMLStyle *iface, BSTR *p)
747 HTMLStyle *This = HTMLSTYLE_THIS(iface);
748 FIXME("(%p)->(%p)\n", This, p);
749 return E_NOTIMPL;
752 static HRESULT WINAPI HTMLStyle_put_backgroundPosition(IHTMLStyle *iface, BSTR v)
754 HTMLStyle *This = HTMLSTYLE_THIS(iface);
755 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
756 return E_NOTIMPL;
759 static HRESULT WINAPI HTMLStyle_get_backgroundPosition(IHTMLStyle *iface, BSTR *p)
761 HTMLStyle *This = HTMLSTYLE_THIS(iface);
762 FIXME("(%p)->(%p)\n", This, p);
763 return E_NOTIMPL;
766 static HRESULT WINAPI HTMLStyle_put_backgroundPositionX(IHTMLStyle *iface, VARIANT v)
768 HTMLStyle *This = HTMLSTYLE_THIS(iface);
769 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
770 return E_NOTIMPL;
773 static HRESULT WINAPI HTMLStyle_get_backgroundPositionX(IHTMLStyle *iface, VARIANT *p)
775 HTMLStyle *This = HTMLSTYLE_THIS(iface);
776 FIXME("(%p)->(%p)\n", This, p);
777 return E_NOTIMPL;
780 static HRESULT WINAPI HTMLStyle_put_backgroundPositionY(IHTMLStyle *iface, VARIANT v)
782 HTMLStyle *This = HTMLSTYLE_THIS(iface);
783 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
784 return E_NOTIMPL;
787 static HRESULT WINAPI HTMLStyle_get_backgroundPositionY(IHTMLStyle *iface, VARIANT *p)
789 HTMLStyle *This = HTMLSTYLE_THIS(iface);
790 FIXME("(%p)->(%p)\n", This, p);
791 return E_NOTIMPL;
794 static HRESULT WINAPI HTMLStyle_put_wordSpacing(IHTMLStyle *iface, VARIANT v)
796 HTMLStyle *This = HTMLSTYLE_THIS(iface);
797 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
798 return E_NOTIMPL;
801 static HRESULT WINAPI HTMLStyle_get_wordSpacing(IHTMLStyle *iface, VARIANT *p)
803 HTMLStyle *This = HTMLSTYLE_THIS(iface);
804 FIXME("(%p)->(%p)\n", This, p);
805 return E_NOTIMPL;
808 static HRESULT WINAPI HTMLStyle_put_letterSpacing(IHTMLStyle *iface, VARIANT v)
810 HTMLStyle *This = HTMLSTYLE_THIS(iface);
811 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
812 return E_NOTIMPL;
815 static HRESULT WINAPI HTMLStyle_get_letterSpacing(IHTMLStyle *iface, VARIANT *p)
817 HTMLStyle *This = HTMLSTYLE_THIS(iface);
818 FIXME("(%p)->(%p)\n", This, p);
819 return E_NOTIMPL;
822 static HRESULT WINAPI HTMLStyle_put_textDecoration(IHTMLStyle *iface, BSTR v)
824 HTMLStyle *This = HTMLSTYLE_THIS(iface);
825 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
826 return E_NOTIMPL;
829 static HRESULT WINAPI HTMLStyle_get_textDecoration(IHTMLStyle *iface, BSTR *p)
831 HTMLStyle *This = HTMLSTYLE_THIS(iface);
833 TRACE("(%p)->(%p)\n", This, p);
835 return get_style_attr(This, STYLEID_TEXT_DECORATION, p);
838 static HRESULT WINAPI HTMLStyle_put_textDecorationNone(IHTMLStyle *iface, VARIANT_BOOL v)
840 HTMLStyle *This = HTMLSTYLE_THIS(iface);
841 FIXME("(%p)->(%x)\n", This, v);
842 return E_NOTIMPL;
845 static HRESULT WINAPI HTMLStyle_get_textDecorationNone(IHTMLStyle *iface, VARIANT_BOOL *p)
847 HTMLStyle *This = HTMLSTYLE_THIS(iface);
848 FIXME("(%p)->(%p)\n", This, p);
849 return E_NOTIMPL;
852 static HRESULT WINAPI HTMLStyle_put_textDecorationUnderline(IHTMLStyle *iface, VARIANT_BOOL v)
854 HTMLStyle *This = HTMLSTYLE_THIS(iface);
855 FIXME("(%p)->(%x)\n", This, v);
856 return E_NOTIMPL;
859 static HRESULT WINAPI HTMLStyle_get_textDecorationUnderline(IHTMLStyle *iface, VARIANT_BOOL *p)
861 HTMLStyle *This = HTMLSTYLE_THIS(iface);
863 TRACE("(%p)->(%p)\n", This, p);
865 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, valUnderline, p);
868 static HRESULT WINAPI HTMLStyle_put_textDecorationOverline(IHTMLStyle *iface, VARIANT_BOOL v)
870 HTMLStyle *This = HTMLSTYLE_THIS(iface);
871 FIXME("(%p)->(%x)\n", This, v);
872 return E_NOTIMPL;
875 static HRESULT WINAPI HTMLStyle_get_textDecorationOverline(IHTMLStyle *iface, VARIANT_BOOL *p)
877 HTMLStyle *This = HTMLSTYLE_THIS(iface);
878 FIXME("(%p)->(%p)\n", This, p);
879 return E_NOTIMPL;
882 static HRESULT WINAPI HTMLStyle_put_textDecorationLineThrough(IHTMLStyle *iface, VARIANT_BOOL v)
884 HTMLStyle *This = HTMLSTYLE_THIS(iface);
885 FIXME("(%p)->(%x)\n", This, v);
886 return E_NOTIMPL;
889 static HRESULT WINAPI HTMLStyle_get_textDecorationLineThrough(IHTMLStyle *iface, VARIANT_BOOL *p)
891 HTMLStyle *This = HTMLSTYLE_THIS(iface);
893 TRACE("(%p)->(%p)\n", This, p);
895 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, valLineThrough, p);
898 static HRESULT WINAPI HTMLStyle_put_textDecorationBlink(IHTMLStyle *iface, VARIANT_BOOL v)
900 HTMLStyle *This = HTMLSTYLE_THIS(iface);
901 FIXME("(%p)->(%x)\n", This, v);
902 return E_NOTIMPL;
905 static HRESULT WINAPI HTMLStyle_get_textDecorationBlink(IHTMLStyle *iface, VARIANT_BOOL *p)
907 HTMLStyle *This = HTMLSTYLE_THIS(iface);
908 FIXME("(%p)->(%p)\n", This, p);
909 return E_NOTIMPL;
912 static HRESULT WINAPI HTMLStyle_put_verticalAlign(IHTMLStyle *iface, VARIANT v)
914 HTMLStyle *This = HTMLSTYLE_THIS(iface);
916 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
918 switch(V_VT(&v)) {
919 case VT_BSTR:
920 return set_style_attr(This, STYLEID_VERTICAL_ALIGN, V_BSTR(&v), 0);
921 default:
922 FIXME("not implemented vt %d\n", V_VT(&v));
923 return E_NOTIMPL;
926 return S_OK;
929 static HRESULT WINAPI HTMLStyle_get_verticalAlign(IHTMLStyle *iface, VARIANT *p)
931 HTMLStyle *This = HTMLSTYLE_THIS(iface);
932 BSTR ret;
933 HRESULT hres;
935 TRACE("(%p)->(%p)\n", This, p);
937 hres = get_style_attr(This, STYLEID_VERTICAL_ALIGN, &ret);
938 if(FAILED(hres))
939 return hres;
941 V_VT(p) = VT_BSTR;
942 V_BSTR(p) = ret;
943 return S_OK;
946 static HRESULT WINAPI HTMLStyle_put_textTransform(IHTMLStyle *iface, BSTR v)
948 HTMLStyle *This = HTMLSTYLE_THIS(iface);
949 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
950 return E_NOTIMPL;
953 static HRESULT WINAPI HTMLStyle_get_textTransform(IHTMLStyle *iface, BSTR *p)
955 HTMLStyle *This = HTMLSTYLE_THIS(iface);
956 FIXME("(%p)->(%p)\n", This, p);
957 return E_NOTIMPL;
960 static HRESULT WINAPI HTMLStyle_put_textAlign(IHTMLStyle *iface, BSTR v)
962 HTMLStyle *This = HTMLSTYLE_THIS(iface);
964 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
966 return set_style_attr(This, STYLEID_TEXT_ALIGN, v, 0);
969 static HRESULT WINAPI HTMLStyle_get_textAlign(IHTMLStyle *iface, BSTR *p)
971 HTMLStyle *This = HTMLSTYLE_THIS(iface);
973 TRACE("(%p)->(%p)\n", This, p);
975 return get_style_attr(This, STYLEID_TEXT_ALIGN, p);
978 static HRESULT WINAPI HTMLStyle_put_textIndent(IHTMLStyle *iface, VARIANT v)
980 HTMLStyle *This = HTMLSTYLE_THIS(iface);
981 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
982 return E_NOTIMPL;
985 static HRESULT WINAPI HTMLStyle_get_textIndent(IHTMLStyle *iface, VARIANT *p)
987 HTMLStyle *This = HTMLSTYLE_THIS(iface);
988 FIXME("(%p)->(%p)\n", This, p);
989 return E_NOTIMPL;
992 static HRESULT WINAPI HTMLStyle_put_lineHeight(IHTMLStyle *iface, VARIANT v)
994 HTMLStyle *This = HTMLSTYLE_THIS(iface);
995 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
996 return E_NOTIMPL;
999 static HRESULT WINAPI HTMLStyle_get_lineHeight(IHTMLStyle *iface, VARIANT *p)
1001 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1002 FIXME("(%p)->(%p)\n", This, p);
1003 return E_NOTIMPL;
1006 static HRESULT WINAPI HTMLStyle_put_marginTop(IHTMLStyle *iface, VARIANT v)
1008 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1009 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1010 return E_NOTIMPL;
1013 static HRESULT WINAPI HTMLStyle_get_marginTop(IHTMLStyle *iface, VARIANT *p)
1015 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1016 FIXME("(%p)->(%p)\n", This, p);
1017 return E_NOTIMPL;
1020 static HRESULT WINAPI HTMLStyle_put_marginRight(IHTMLStyle *iface, VARIANT v)
1022 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1024 TRACE("(%p)->(v(%d))\n", This, V_VT(&v));
1026 switch(V_VT(&v)) {
1027 case VT_NULL:
1028 return set_style_attr(This, STYLEID_MARGIN_RIGHT, emptyW, 0);
1029 case VT_I4: {
1030 WCHAR buf[14];
1032 wsprintfW(buf, px_formatW, V_I4(&v));
1033 return set_style_attr(This, STYLEID_MARGIN_RIGHT, buf, 0);
1035 case VT_BSTR:
1036 return set_style_attr(This, STYLEID_MARGIN_RIGHT, V_BSTR(&v), 0);
1037 default:
1038 FIXME("Unsupported vt=%d\n", V_VT(&v));
1041 return E_NOTIMPL;
1044 static HRESULT WINAPI HTMLStyle_get_marginRight(IHTMLStyle *iface, VARIANT *p)
1046 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1047 FIXME("(%p)->(%p)\n", This, p);
1048 return E_NOTIMPL;
1051 static HRESULT WINAPI HTMLStyle_put_marginBottom(IHTMLStyle *iface, VARIANT v)
1053 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1054 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1055 return E_NOTIMPL;
1058 static HRESULT WINAPI HTMLStyle_get_marginBottom(IHTMLStyle *iface, VARIANT *p)
1060 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1061 FIXME("(%p)->(%p)\n", This, p);
1062 return E_NOTIMPL;
1065 static HRESULT WINAPI HTMLStyle_put_marginLeft(IHTMLStyle *iface, VARIANT v)
1067 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1069 switch(V_VT(&v)) {
1070 case VT_NULL:
1071 TRACE("(%p)->(NULL)\n", This);
1072 return set_style_attr(This, STYLEID_MARGIN_LEFT, emptyW, 0);
1073 case VT_I4: {
1074 WCHAR buf[14];
1076 TRACE("(%p)->(%d)\n", This, V_I4(&v));
1078 wsprintfW(buf, px_formatW, V_I4(&v));
1079 return set_style_attr(This, STYLEID_MARGIN_LEFT, buf, 0);
1081 case VT_BSTR:
1082 TRACE("(%p)->(%s)\n", This, debugstr_w(V_BSTR(&v)));
1083 return set_style_attr(This, STYLEID_MARGIN_LEFT, V_BSTR(&v), 0);
1084 default:
1085 FIXME("Unsupported vt=%d\n", V_VT(&v));
1088 return E_NOTIMPL;
1091 static HRESULT WINAPI HTMLStyle_put_margin(IHTMLStyle *iface, BSTR v)
1093 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1095 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1097 return set_style_attr(This, STYLEID_MARGIN, v, 0);
1100 static HRESULT WINAPI HTMLStyle_get_margin(IHTMLStyle *iface, BSTR *p)
1102 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1104 TRACE("(%p)->(%p)\n", This, p);
1106 return get_style_attr(This, STYLEID_MARGIN, p);
1109 static HRESULT WINAPI HTMLStyle_get_marginLeft(IHTMLStyle *iface, VARIANT *p)
1111 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1112 FIXME("(%p)->(%p)\n", This, p);
1113 return E_NOTIMPL;
1116 static HRESULT WINAPI HTMLStyle_put_paddingTop(IHTMLStyle *iface, VARIANT v)
1118 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1119 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1120 return E_NOTIMPL;
1123 static HRESULT WINAPI HTMLStyle_get_paddingTop(IHTMLStyle *iface, VARIANT *p)
1125 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1126 FIXME("(%p)->(%p)\n", This, p);
1127 return E_NOTIMPL;
1130 static HRESULT WINAPI HTMLStyle_put_paddingRight(IHTMLStyle *iface, VARIANT v)
1132 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1133 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1134 return E_NOTIMPL;
1137 static HRESULT WINAPI HTMLStyle_get_paddingRight(IHTMLStyle *iface, VARIANT *p)
1139 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1140 FIXME("(%p)->(%p)\n", This, p);
1141 return E_NOTIMPL;
1144 static HRESULT WINAPI HTMLStyle_put_paddingBottom(IHTMLStyle *iface, VARIANT v)
1146 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1147 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1148 return E_NOTIMPL;
1151 static HRESULT WINAPI HTMLStyle_get_paddingBottom(IHTMLStyle *iface, VARIANT *p)
1153 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1154 FIXME("(%p)->(%p)\n", This, p);
1155 return E_NOTIMPL;
1158 static HRESULT WINAPI HTMLStyle_put_paddingLeft(IHTMLStyle *iface, VARIANT v)
1160 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1162 TRACE("(%p)->(vt=%d)\n", This, V_VT(&v));
1164 switch(V_VT(&v)) {
1165 case VT_I4: {
1166 WCHAR buf[14];
1168 wsprintfW(buf, px_formatW, V_I4(&v));
1169 return set_style_attr(This, STYLEID_PADDING_LEFT, buf, 0);
1171 case VT_BSTR:
1172 return set_style_attr(This, STYLEID_PADDING_LEFT, V_BSTR(&v), 0);
1173 default:
1174 FIXME("unsupported vt=%d\n", V_VT(&v));
1177 return E_NOTIMPL;
1180 static HRESULT WINAPI HTMLStyle_get_paddingLeft(IHTMLStyle *iface, VARIANT *p)
1182 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1183 FIXME("(%p)->(%p)\n", This, p);
1184 return E_NOTIMPL;
1187 static HRESULT WINAPI HTMLStyle_put_padding(IHTMLStyle *iface, BSTR v)
1189 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1190 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1191 return E_NOTIMPL;
1194 static HRESULT WINAPI HTMLStyle_get_padding(IHTMLStyle *iface, BSTR *p)
1196 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1197 FIXME("(%p)->(%p)\n", This, p);
1198 return E_NOTIMPL;
1201 static HRESULT WINAPI HTMLStyle_put_border(IHTMLStyle *iface, BSTR v)
1203 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1205 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1207 return set_style_attr(This, STYLEID_BORDER, v, 0);
1210 static HRESULT WINAPI HTMLStyle_get_border(IHTMLStyle *iface, BSTR *p)
1212 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1214 TRACE("(%p)->(%p)\n", This, p);
1216 return get_style_attr(This, STYLEID_BORDER, p);
1219 static HRESULT WINAPI HTMLStyle_put_borderTop(IHTMLStyle *iface, BSTR v)
1221 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1222 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1223 return E_NOTIMPL;
1226 static HRESULT WINAPI HTMLStyle_get_borderTop(IHTMLStyle *iface, BSTR *p)
1228 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1229 FIXME("(%p)->(%p)\n", This, p);
1230 return E_NOTIMPL;
1233 static HRESULT WINAPI HTMLStyle_put_borderRight(IHTMLStyle *iface, BSTR v)
1235 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1236 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1237 return E_NOTIMPL;
1240 static HRESULT WINAPI HTMLStyle_get_borderRight(IHTMLStyle *iface, BSTR *p)
1242 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1243 FIXME("(%p)->(%p)\n", This, p);
1244 return E_NOTIMPL;
1247 static HRESULT WINAPI HTMLStyle_put_borderBottom(IHTMLStyle *iface, BSTR v)
1249 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1250 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1251 return E_NOTIMPL;
1254 static HRESULT WINAPI HTMLStyle_get_borderBottom(IHTMLStyle *iface, BSTR *p)
1256 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1257 FIXME("(%p)->(%p)\n", This, p);
1258 return E_NOTIMPL;
1261 static HRESULT WINAPI HTMLStyle_put_borderLeft(IHTMLStyle *iface, BSTR v)
1263 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1265 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1267 return set_style_attr(This, STYLEID_BORDER_LEFT, v, ATTR_FIX_PX);
1270 static HRESULT WINAPI HTMLStyle_get_borderLeft(IHTMLStyle *iface, BSTR *p)
1272 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1273 FIXME("(%p)->(%p)\n", This, p);
1274 return E_NOTIMPL;
1277 static HRESULT WINAPI HTMLStyle_put_borderColor(IHTMLStyle *iface, BSTR v)
1279 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1280 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1281 return E_NOTIMPL;
1284 static HRESULT WINAPI HTMLStyle_get_borderColor(IHTMLStyle *iface, BSTR *p)
1286 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1287 FIXME("(%p)->(%p)\n", This, p);
1288 return E_NOTIMPL;
1291 static HRESULT WINAPI HTMLStyle_put_borderTopColor(IHTMLStyle *iface, VARIANT v)
1293 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1294 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1295 return E_NOTIMPL;
1298 static HRESULT WINAPI HTMLStyle_get_borderTopColor(IHTMLStyle *iface, VARIANT *p)
1300 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1301 FIXME("(%p)->(%p)\n", This, p);
1302 return E_NOTIMPL;
1305 static HRESULT WINAPI HTMLStyle_put_borderRightColor(IHTMLStyle *iface, VARIANT v)
1307 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1308 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1309 return E_NOTIMPL;
1312 static HRESULT WINAPI HTMLStyle_get_borderRightColor(IHTMLStyle *iface, VARIANT *p)
1314 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1315 FIXME("(%p)->(%p)\n", This, p);
1316 return E_NOTIMPL;
1319 static HRESULT WINAPI HTMLStyle_put_borderBottomColor(IHTMLStyle *iface, VARIANT v)
1321 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1322 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1323 return E_NOTIMPL;
1326 static HRESULT WINAPI HTMLStyle_get_borderBottomColor(IHTMLStyle *iface, VARIANT *p)
1328 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1329 FIXME("(%p)->(%p)\n", This, p);
1330 return E_NOTIMPL;
1333 static HRESULT WINAPI HTMLStyle_put_borderLeftColor(IHTMLStyle *iface, VARIANT v)
1335 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1336 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1337 return E_NOTIMPL;
1340 static HRESULT WINAPI HTMLStyle_get_borderLeftColor(IHTMLStyle *iface, VARIANT *p)
1342 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1343 FIXME("(%p)->(%p)\n", This, p);
1344 return E_NOTIMPL;
1347 static HRESULT WINAPI HTMLStyle_put_borderWidth(IHTMLStyle *iface, BSTR v)
1349 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1350 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1351 return set_style_attr(This, STYLEID_BORDER_WIDTH, v, ATTR_FIX_PX);
1354 static HRESULT WINAPI HTMLStyle_get_borderWidth(IHTMLStyle *iface, BSTR *p)
1356 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1357 TRACE("(%p)->(%p)\n", This, p);
1358 return get_style_attr(This, STYLEID_BORDER_WIDTH, p);
1361 static HRESULT WINAPI HTMLStyle_put_borderTopWidth(IHTMLStyle *iface, VARIANT v)
1363 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1364 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1365 return E_NOTIMPL;
1368 static HRESULT WINAPI HTMLStyle_get_borderTopWidth(IHTMLStyle *iface, VARIANT *p)
1370 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1371 FIXME("(%p)->(%p)\n", This, p);
1372 return E_NOTIMPL;
1375 static HRESULT WINAPI HTMLStyle_put_borderRightWidth(IHTMLStyle *iface, VARIANT v)
1377 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1378 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1379 return E_NOTIMPL;
1382 static HRESULT WINAPI HTMLStyle_get_borderRightWidth(IHTMLStyle *iface, VARIANT *p)
1384 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1385 FIXME("(%p)->(%p)\n", This, p);
1386 return E_NOTIMPL;
1389 static HRESULT WINAPI HTMLStyle_put_borderBottomWidth(IHTMLStyle *iface, VARIANT v)
1391 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1392 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1393 return E_NOTIMPL;
1396 static HRESULT WINAPI HTMLStyle_get_borderBottomWidth(IHTMLStyle *iface, VARIANT *p)
1398 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1399 FIXME("(%p)->(%p)\n", This, p);
1400 return E_NOTIMPL;
1403 static HRESULT WINAPI HTMLStyle_put_borderLeftWidth(IHTMLStyle *iface, VARIANT v)
1405 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1406 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1407 return E_NOTIMPL;
1410 static HRESULT WINAPI HTMLStyle_get_borderLeftWidth(IHTMLStyle *iface, VARIANT *p)
1412 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1413 FIXME("(%p)->(%p)\n", This, p);
1414 return E_NOTIMPL;
1417 static HRESULT WINAPI HTMLStyle_put_borderStyle(IHTMLStyle *iface, BSTR v)
1419 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1420 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1421 return E_NOTIMPL;
1424 static HRESULT WINAPI HTMLStyle_get_borderStyle(IHTMLStyle *iface, BSTR *p)
1426 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1427 FIXME("(%p)->(%p)\n", This, p);
1428 return E_NOTIMPL;
1431 static HRESULT WINAPI HTMLStyle_put_borderTopStyle(IHTMLStyle *iface, BSTR v)
1433 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1434 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1435 return E_NOTIMPL;
1438 static HRESULT WINAPI HTMLStyle_get_borderTopStyle(IHTMLStyle *iface, BSTR *p)
1440 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1441 FIXME("(%p)->(%p)\n", This, p);
1442 return E_NOTIMPL;
1445 static HRESULT WINAPI HTMLStyle_put_borderRightStyle(IHTMLStyle *iface, BSTR v)
1447 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1448 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1449 return E_NOTIMPL;
1452 static HRESULT WINAPI HTMLStyle_get_borderRightStyle(IHTMLStyle *iface, BSTR *p)
1454 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1455 FIXME("(%p)->(%p)\n", This, p);
1456 return E_NOTIMPL;
1459 static HRESULT WINAPI HTMLStyle_put_borderBottomStyle(IHTMLStyle *iface, BSTR v)
1461 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1462 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1463 return E_NOTIMPL;
1466 static HRESULT WINAPI HTMLStyle_get_borderBottomStyle(IHTMLStyle *iface, BSTR *p)
1468 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1469 FIXME("(%p)->(%p)\n", This, p);
1470 return E_NOTIMPL;
1473 static HRESULT WINAPI HTMLStyle_put_borderLeftStyle(IHTMLStyle *iface, BSTR v)
1475 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1476 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1477 return E_NOTIMPL;
1480 static HRESULT WINAPI HTMLStyle_get_borderLeftStyle(IHTMLStyle *iface, BSTR *p)
1482 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1483 FIXME("(%p)->(%p)\n", This, p);
1484 return E_NOTIMPL;
1487 static HRESULT WINAPI HTMLStyle_put_width(IHTMLStyle *iface, VARIANT v)
1489 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1491 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
1493 switch(V_VT(&v)) {
1494 case VT_BSTR:
1495 TRACE("%s\n", debugstr_w(V_BSTR(&v)));
1496 return set_style_attr(This, STYLEID_WIDTH, V_BSTR(&v), 0);
1497 default:
1498 FIXME("unsupported vt %d\n", V_VT(&v));
1501 return E_NOTIMPL;
1504 static HRESULT WINAPI HTMLStyle_get_width(IHTMLStyle *iface, VARIANT *p)
1506 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1508 TRACE("(%p)->(%p)\n", This, p);
1510 V_VT(p) = VT_BSTR;
1511 return get_style_attr(This, STYLEID_WIDTH, &V_BSTR(p));
1514 static HRESULT WINAPI HTMLStyle_put_height(IHTMLStyle *iface, VARIANT v)
1516 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1518 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1520 switch(V_VT(&v)) {
1521 case VT_BSTR:
1522 return set_style_attr(This, STYLEID_HEIGHT, V_BSTR(&v), 0);
1523 default:
1524 FIXME("unimplemented vt %d\n", V_VT(&v));
1525 return E_NOTIMPL;
1528 return S_OK;
1531 static HRESULT WINAPI HTMLStyle_get_height(IHTMLStyle *iface, VARIANT *p)
1533 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1534 BSTR ret;
1535 HRESULT hres;
1537 TRACE("(%p)->(%p)\n", This, p);
1539 hres = get_style_attr(This, STYLEID_HEIGHT, &ret);
1540 if(FAILED(hres))
1541 return hres;
1543 V_VT(p) = VT_BSTR;
1544 V_BSTR(p) = ret;
1545 return S_OK;
1548 static HRESULT WINAPI HTMLStyle_put_styleFloat(IHTMLStyle *iface, BSTR v)
1550 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1551 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1552 return E_NOTIMPL;
1555 static HRESULT WINAPI HTMLStyle_get_styleFloat(IHTMLStyle *iface, BSTR *p)
1557 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1558 FIXME("(%p)->(%p)\n", This, p);
1559 return E_NOTIMPL;
1562 static HRESULT WINAPI HTMLStyle_put_clear(IHTMLStyle *iface, BSTR v)
1564 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1565 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1566 return E_NOTIMPL;
1569 static HRESULT WINAPI HTMLStyle_get_clear(IHTMLStyle *iface, BSTR *p)
1571 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1572 FIXME("(%p)->(%p)\n", This, p);
1573 return E_NOTIMPL;
1576 static HRESULT WINAPI HTMLStyle_put_display(IHTMLStyle *iface, BSTR v)
1578 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1580 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1582 return set_style_attr(This, STYLEID_DISPLAY, v, 0);
1585 static HRESULT WINAPI HTMLStyle_get_display(IHTMLStyle *iface, BSTR *p)
1587 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1589 TRACE("(%p)->(%p)\n", This, p);
1591 return get_style_attr(This, STYLEID_DISPLAY, p);
1594 static HRESULT WINAPI HTMLStyle_put_visibility(IHTMLStyle *iface, BSTR v)
1596 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1598 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1600 return set_style_attr(This, STYLEID_VISIBILITY, v, 0);
1603 static HRESULT WINAPI HTMLStyle_get_visibility(IHTMLStyle *iface, BSTR *p)
1605 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1607 TRACE("(%p)->(%p)\n", This, p);
1609 return get_style_attr(This, STYLEID_VISIBILITY, p);
1612 static HRESULT WINAPI HTMLStyle_put_listStyleType(IHTMLStyle *iface, BSTR v)
1614 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1615 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1616 return E_NOTIMPL;
1619 static HRESULT WINAPI HTMLStyle_get_listStyleType(IHTMLStyle *iface, BSTR *p)
1621 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1622 FIXME("(%p)->(%p)\n", This, p);
1623 return E_NOTIMPL;
1626 static HRESULT WINAPI HTMLStyle_put_listStylePosition(IHTMLStyle *iface, BSTR v)
1628 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1629 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1630 return E_NOTIMPL;
1633 static HRESULT WINAPI HTMLStyle_get_listStylePosition(IHTMLStyle *iface, BSTR *p)
1635 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1636 FIXME("(%p)->(%p)\n", This, p);
1637 return E_NOTIMPL;
1640 static HRESULT WINAPI HTMLStyle_put_listStyleImage(IHTMLStyle *iface, BSTR v)
1642 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1643 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1644 return E_NOTIMPL;
1647 static HRESULT WINAPI HTMLStyle_get_listStyleImage(IHTMLStyle *iface, BSTR *p)
1649 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1650 FIXME("(%p)->(%p)\n", This, p);
1651 return E_NOTIMPL;
1654 static HRESULT WINAPI HTMLStyle_put_listStyle(IHTMLStyle *iface, BSTR v)
1656 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1657 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1658 return E_NOTIMPL;
1661 static HRESULT WINAPI HTMLStyle_get_listStyle(IHTMLStyle *iface, BSTR *p)
1663 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1664 FIXME("(%p)->(%p)\n", This, p);
1665 return E_NOTIMPL;
1668 static HRESULT WINAPI HTMLStyle_put_whiteSpace(IHTMLStyle *iface, BSTR v)
1670 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1671 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1672 return E_NOTIMPL;
1675 static HRESULT WINAPI HTMLStyle_get_whiteSpace(IHTMLStyle *iface, BSTR *p)
1677 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1678 FIXME("(%p)->(%p)\n", This, p);
1679 return E_NOTIMPL;
1682 static HRESULT WINAPI HTMLStyle_put_top(IHTMLStyle *iface, VARIANT v)
1684 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1686 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1688 return set_nsstyle_attr_var(This->nsstyle, STYLEID_TOP, &v, 0);
1691 static HRESULT WINAPI HTMLStyle_get_top(IHTMLStyle *iface, VARIANT *p)
1693 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1694 BSTR ret;
1695 HRESULT hres;
1697 TRACE("(%p)->(%p)\n", This, p);
1699 hres = get_style_attr(This, STYLEID_TOP, &ret);
1700 if(FAILED(hres))
1701 return hres;
1703 V_VT(p) = VT_BSTR;
1704 V_BSTR(p) = ret;
1705 return S_OK;
1708 static HRESULT WINAPI HTMLStyle_put_left(IHTMLStyle *iface, VARIANT v)
1710 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1712 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1714 return set_nsstyle_attr_var(This->nsstyle, STYLEID_LEFT, &v, 0);
1717 static HRESULT WINAPI HTMLStyle_get_left(IHTMLStyle *iface, VARIANT *p)
1719 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1720 BSTR ret;
1721 HRESULT hres;
1723 TRACE("(%p)->(%p)\n", This, p);
1725 hres = get_style_attr(This, STYLEID_LEFT, &ret);
1726 if(FAILED(hres))
1727 return hres;
1729 V_VT(p) = VT_BSTR;
1730 V_BSTR(p) = ret;
1731 return S_OK;
1734 static HRESULT WINAPI HTMLStyle_get_position(IHTMLStyle *iface, BSTR *p)
1736 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1737 FIXME("(%p)->(%p)\n", This, p);
1738 return E_NOTIMPL;
1741 static HRESULT WINAPI HTMLStyle_put_zIndex(IHTMLStyle *iface, VARIANT v)
1743 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1745 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1747 switch(V_VT(&v)) {
1748 case VT_BSTR:
1749 return set_style_attr(This, STYLEID_Z_INDEX, V_BSTR(&v), 0);
1750 case VT_I4: {
1751 WCHAR value[14];
1752 static const WCHAR format[] = {'%','d',0};
1754 wsprintfW(value, format, V_I4(&v));
1755 return set_style_attr(This, STYLEID_Z_INDEX, value, 0);
1757 default:
1758 FIXME("unimplemented vt %d\n", V_VT(&v));
1759 return E_NOTIMPL;
1762 return S_OK;
1765 static HRESULT WINAPI HTMLStyle_get_zIndex(IHTMLStyle *iface, VARIANT *p)
1767 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1769 TRACE("(%p)->(%p)\n", This, p);
1771 return get_nsstyle_attr_var(This->nsstyle, STYLEID_Z_INDEX, p, ATTR_STR_TO_INT);
1774 static HRESULT WINAPI HTMLStyle_put_overflow(IHTMLStyle *iface, BSTR v)
1776 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1777 static const WCHAR szVisible[] = {'v','i','s','i','b','l','e',0};
1778 static const WCHAR szScroll[] = {'s','c','r','o','l','l',0};
1779 static const WCHAR szHidden[] = {'h','i','d','d','e','n',0};
1780 static const WCHAR szAuto[] = {'a','u','t','o',0};
1782 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1784 /* overflow can only be one of the follow values. */
1785 if(!v || strcmpiW(szVisible, v) == 0 || strcmpiW(szScroll, v) == 0 ||
1786 strcmpiW(szHidden, v) == 0 || strcmpiW(szAuto, v) == 0)
1788 return set_nsstyle_attr(This->nsstyle, STYLEID_OVERFLOW, v, 0);
1791 return E_INVALIDARG;
1795 static HRESULT WINAPI HTMLStyle_get_overflow(IHTMLStyle *iface, BSTR *p)
1797 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1799 TRACE("(%p)->(%p)\n", This, p);
1801 if(!p)
1802 return E_INVALIDARG;
1804 return get_style_attr(This, STYLEID_OVERFLOW, p);
1807 static HRESULT WINAPI HTMLStyle_put_pageBreakBefore(IHTMLStyle *iface, BSTR v)
1809 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1810 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1811 return E_NOTIMPL;
1814 static HRESULT WINAPI HTMLStyle_get_pageBreakBefore(IHTMLStyle *iface, BSTR *p)
1816 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1817 FIXME("(%p)->(%p)\n", This, p);
1818 return E_NOTIMPL;
1821 static HRESULT WINAPI HTMLStyle_put_pageBreakAfter(IHTMLStyle *iface, BSTR v)
1823 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1824 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1825 return E_NOTIMPL;
1828 static HRESULT WINAPI HTMLStyle_get_pageBreakAfter(IHTMLStyle *iface, BSTR *p)
1830 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1831 FIXME("(%p)->(%p)\n", This, p);
1832 return E_NOTIMPL;
1835 static HRESULT WINAPI HTMLStyle_put_cssText(IHTMLStyle *iface, BSTR v)
1837 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1838 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1839 return E_NOTIMPL;
1842 static HRESULT WINAPI HTMLStyle_get_cssText(IHTMLStyle *iface, BSTR *p)
1844 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1845 FIXME("(%p)->(%p)\n", This, p);
1846 return E_NOTIMPL;
1849 static HRESULT WINAPI HTMLStyle_put_pixelTop(IHTMLStyle *iface, long v)
1851 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1852 FIXME("(%p)->()\n", This);
1853 return E_NOTIMPL;
1856 static HRESULT WINAPI HTMLStyle_get_pixelTop(IHTMLStyle *iface, long *p)
1858 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1859 FIXME("(%p)->()\n", This);
1860 return E_NOTIMPL;
1863 static HRESULT WINAPI HTMLStyle_put_pixelLeft(IHTMLStyle *iface, long v)
1865 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1866 FIXME("(%p)->()\n", This);
1867 return E_NOTIMPL;
1870 static HRESULT WINAPI HTMLStyle_get_pixelLeft(IHTMLStyle *iface, long *p)
1872 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1873 FIXME("(%p)->()\n", This);
1874 return E_NOTIMPL;
1877 static HRESULT WINAPI HTMLStyle_put_pixelWidth(IHTMLStyle *iface, long v)
1879 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1880 FIXME("(%p)->()\n", This);
1881 return E_NOTIMPL;
1884 static HRESULT WINAPI HTMLStyle_get_pixelWidth(IHTMLStyle *iface, long *p)
1886 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1887 FIXME("(%p)->()\n", This);
1888 return E_NOTIMPL;
1891 static HRESULT WINAPI HTMLStyle_put_pixelHeight(IHTMLStyle *iface, long v)
1893 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1894 FIXME("(%p)->()\n", This);
1895 return E_NOTIMPL;
1898 static HRESULT WINAPI HTMLStyle_get_pixelHeight(IHTMLStyle *iface, long *p)
1900 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1901 FIXME("(%p)->()\n", This);
1902 return E_NOTIMPL;
1905 static HRESULT WINAPI HTMLStyle_put_posTop(IHTMLStyle *iface, float v)
1907 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1909 TRACE("(%p)->(%f)\n", This, v);
1911 return set_style_pos(This, STYLEID_TOP, v);
1914 static HRESULT WINAPI HTMLStyle_get_posTop(IHTMLStyle *iface, float *p)
1916 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1918 TRACE("(%p)->(%p)\n", This, p);
1920 if(!p)
1921 return E_POINTER;
1923 return get_nsstyle_pos(This, STYLEID_TOP, p);
1926 static HRESULT WINAPI HTMLStyle_put_posLeft(IHTMLStyle *iface, float v)
1928 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1930 TRACE("(%p)->(%f)\n", This, v);
1932 return set_style_pos(This, STYLEID_LEFT, v);
1935 static HRESULT WINAPI HTMLStyle_get_posLeft(IHTMLStyle *iface, float *p)
1937 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1939 TRACE("(%p)->(%p)\n", This, p);
1941 if(!p)
1942 return E_POINTER;
1944 return get_nsstyle_pos(This, STYLEID_LEFT, p);
1947 static HRESULT WINAPI HTMLStyle_put_posWidth(IHTMLStyle *iface, float v)
1949 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1951 TRACE("(%p)->(%f)\n", This, v);
1953 return set_style_pos(This, STYLEID_WIDTH, v);
1956 static HRESULT WINAPI HTMLStyle_get_posWidth(IHTMLStyle *iface, float *p)
1958 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1960 TRACE("(%p)->(%p)\n", This, p);
1962 if(!p)
1963 return E_POINTER;
1965 if(get_nsstyle_pos(This, STYLEID_WIDTH, p) != S_OK)
1966 *p = 0.0f;
1968 return S_OK;
1971 static HRESULT WINAPI HTMLStyle_put_posHeight(IHTMLStyle *iface, float v)
1973 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1975 TRACE("(%p)->(%f)\n", This, v);
1977 return set_style_pos(This, STYLEID_HEIGHT, v);
1980 static HRESULT WINAPI HTMLStyle_get_posHeight(IHTMLStyle *iface, float *p)
1982 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1984 TRACE("(%p)->(%p)\n", This, p);
1986 if(!p)
1987 return E_POINTER;
1989 if(get_nsstyle_pos(This, STYLEID_HEIGHT, p) != S_OK)
1990 *p = 0.0f;
1992 return S_OK;
1995 static HRESULT WINAPI HTMLStyle_put_cursor(IHTMLStyle *iface, BSTR v)
1997 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1999 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2001 return set_style_attr(This, STYLEID_CURSOR, v, 0);
2004 static HRESULT WINAPI HTMLStyle_get_cursor(IHTMLStyle *iface, BSTR *p)
2006 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2008 TRACE("(%p)->(%p)\n", This, p);
2010 return get_style_attr(This, STYLEID_CURSOR, p);
2013 static HRESULT WINAPI HTMLStyle_put_clip(IHTMLStyle *iface, BSTR v)
2015 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2016 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
2017 return E_NOTIMPL;
2020 static HRESULT WINAPI HTMLStyle_get_clip(IHTMLStyle *iface, BSTR *p)
2022 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2023 FIXME("(%p)->(%p)\n", This, p);
2024 return E_NOTIMPL;
2027 static HRESULT WINAPI HTMLStyle_put_filter(IHTMLStyle *iface, BSTR v)
2029 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2031 WARN("(%p)->(%s)\n", This, debugstr_w(v));
2033 /* FIXME: Handle MS-style filters */
2034 return set_style_attr(This, STYLEID_FILTER, v, 0);
2037 static HRESULT WINAPI HTMLStyle_get_filter(IHTMLStyle *iface, BSTR *p)
2039 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2041 WARN("(%p)->(%p)\n", This, p);
2043 /* FIXME: Handle MS-style filters */
2044 return get_style_attr(This, STYLEID_FILTER, p);
2047 static HRESULT WINAPI HTMLStyle_setAttribute(IHTMLStyle *iface, BSTR strAttributeName,
2048 VARIANT AttributeValue, LONG lFlags)
2050 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2051 FIXME("(%p)->(%s v%d %08x)\n", This, debugstr_w(strAttributeName),
2052 V_VT(&AttributeValue), lFlags);
2053 return E_NOTIMPL;
2056 static HRESULT WINAPI HTMLStyle_getAttribute(IHTMLStyle *iface, BSTR strAttributeName,
2057 LONG lFlags, VARIANT *AttributeValue)
2059 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2060 FIXME("(%p)->(%s %08x %p)\n", This, debugstr_w(strAttributeName),
2061 lFlags, AttributeValue);
2062 return E_NOTIMPL;
2065 static HRESULT WINAPI HTMLStyle_removeAttribute(IHTMLStyle *iface, BSTR strAttributeName,
2066 LONG lFlags, VARIANT_BOOL *pfSuccess)
2068 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2069 FIXME("(%p)->(%s %08x %p)\n", This, debugstr_w(strAttributeName),
2070 lFlags, pfSuccess);
2071 return E_NOTIMPL;
2074 static HRESULT WINAPI HTMLStyle_toString(IHTMLStyle *iface, BSTR *String)
2076 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2077 FIXME("(%p)->(%p)\n", This, String);
2078 return E_NOTIMPL;
2081 static HRESULT HTMLStyle_get_dispid(IUnknown *iface, BSTR name, DWORD flags, DISPID *dispid)
2083 int c, i, min=0, max = sizeof(style_tbl)/sizeof(*style_tbl)-1;
2085 while(min <= max) {
2086 i = (min+max)/2;
2088 c = strcmpW(style_tbl[i].name, name);
2089 if(!c) {
2090 *dispid = style_tbl[i].dispid;
2091 return S_OK;
2094 if(c > 0)
2095 max = i-1;
2096 else
2097 min = i+1;
2100 return DISP_E_UNKNOWNNAME;
2103 static const IHTMLStyleVtbl HTMLStyleVtbl = {
2104 HTMLStyle_QueryInterface,
2105 HTMLStyle_AddRef,
2106 HTMLStyle_Release,
2107 HTMLStyle_GetTypeInfoCount,
2108 HTMLStyle_GetTypeInfo,
2109 HTMLStyle_GetIDsOfNames,
2110 HTMLStyle_Invoke,
2111 HTMLStyle_put_fontFamily,
2112 HTMLStyle_get_fontFamily,
2113 HTMLStyle_put_fontStyle,
2114 HTMLStyle_get_fontStyle,
2115 HTMLStyle_put_fontVariant,
2116 HTMLStyle_get_fontVariant,
2117 HTMLStyle_put_fontWeight,
2118 HTMLStyle_get_fontWeight,
2119 HTMLStyle_put_fontSize,
2120 HTMLStyle_get_fontSize,
2121 HTMLStyle_put_font,
2122 HTMLStyle_get_font,
2123 HTMLStyle_put_color,
2124 HTMLStyle_get_color,
2125 HTMLStyle_put_background,
2126 HTMLStyle_get_background,
2127 HTMLStyle_put_backgroundColor,
2128 HTMLStyle_get_backgroundColor,
2129 HTMLStyle_put_backgroundImage,
2130 HTMLStyle_get_backgroundImage,
2131 HTMLStyle_put_backgroundRepeat,
2132 HTMLStyle_get_backgroundRepeat,
2133 HTMLStyle_put_backgroundAttachment,
2134 HTMLStyle_get_backgroundAttachment,
2135 HTMLStyle_put_backgroundPosition,
2136 HTMLStyle_get_backgroundPosition,
2137 HTMLStyle_put_backgroundPositionX,
2138 HTMLStyle_get_backgroundPositionX,
2139 HTMLStyle_put_backgroundPositionY,
2140 HTMLStyle_get_backgroundPositionY,
2141 HTMLStyle_put_wordSpacing,
2142 HTMLStyle_get_wordSpacing,
2143 HTMLStyle_put_letterSpacing,
2144 HTMLStyle_get_letterSpacing,
2145 HTMLStyle_put_textDecoration,
2146 HTMLStyle_get_textDecoration,
2147 HTMLStyle_put_textDecorationNone,
2148 HTMLStyle_get_textDecorationNone,
2149 HTMLStyle_put_textDecorationUnderline,
2150 HTMLStyle_get_textDecorationUnderline,
2151 HTMLStyle_put_textDecorationOverline,
2152 HTMLStyle_get_textDecorationOverline,
2153 HTMLStyle_put_textDecorationLineThrough,
2154 HTMLStyle_get_textDecorationLineThrough,
2155 HTMLStyle_put_textDecorationBlink,
2156 HTMLStyle_get_textDecorationBlink,
2157 HTMLStyle_put_verticalAlign,
2158 HTMLStyle_get_verticalAlign,
2159 HTMLStyle_put_textTransform,
2160 HTMLStyle_get_textTransform,
2161 HTMLStyle_put_textAlign,
2162 HTMLStyle_get_textAlign,
2163 HTMLStyle_put_textIndent,
2164 HTMLStyle_get_textIndent,
2165 HTMLStyle_put_lineHeight,
2166 HTMLStyle_get_lineHeight,
2167 HTMLStyle_put_marginTop,
2168 HTMLStyle_get_marginTop,
2169 HTMLStyle_put_marginRight,
2170 HTMLStyle_get_marginRight,
2171 HTMLStyle_put_marginBottom,
2172 HTMLStyle_get_marginBottom,
2173 HTMLStyle_put_marginLeft,
2174 HTMLStyle_get_marginLeft,
2175 HTMLStyle_put_margin,
2176 HTMLStyle_get_margin,
2177 HTMLStyle_put_paddingTop,
2178 HTMLStyle_get_paddingTop,
2179 HTMLStyle_put_paddingRight,
2180 HTMLStyle_get_paddingRight,
2181 HTMLStyle_put_paddingBottom,
2182 HTMLStyle_get_paddingBottom,
2183 HTMLStyle_put_paddingLeft,
2184 HTMLStyle_get_paddingLeft,
2185 HTMLStyle_put_padding,
2186 HTMLStyle_get_padding,
2187 HTMLStyle_put_border,
2188 HTMLStyle_get_border,
2189 HTMLStyle_put_borderTop,
2190 HTMLStyle_get_borderTop,
2191 HTMLStyle_put_borderRight,
2192 HTMLStyle_get_borderRight,
2193 HTMLStyle_put_borderBottom,
2194 HTMLStyle_get_borderBottom,
2195 HTMLStyle_put_borderLeft,
2196 HTMLStyle_get_borderLeft,
2197 HTMLStyle_put_borderColor,
2198 HTMLStyle_get_borderColor,
2199 HTMLStyle_put_borderTopColor,
2200 HTMLStyle_get_borderTopColor,
2201 HTMLStyle_put_borderRightColor,
2202 HTMLStyle_get_borderRightColor,
2203 HTMLStyle_put_borderBottomColor,
2204 HTMLStyle_get_borderBottomColor,
2205 HTMLStyle_put_borderLeftColor,
2206 HTMLStyle_get_borderLeftColor,
2207 HTMLStyle_put_borderWidth,
2208 HTMLStyle_get_borderWidth,
2209 HTMLStyle_put_borderTopWidth,
2210 HTMLStyle_get_borderTopWidth,
2211 HTMLStyle_put_borderRightWidth,
2212 HTMLStyle_get_borderRightWidth,
2213 HTMLStyle_put_borderBottomWidth,
2214 HTMLStyle_get_borderBottomWidth,
2215 HTMLStyle_put_borderLeftWidth,
2216 HTMLStyle_get_borderLeftWidth,
2217 HTMLStyle_put_borderStyle,
2218 HTMLStyle_get_borderStyle,
2219 HTMLStyle_put_borderTopStyle,
2220 HTMLStyle_get_borderTopStyle,
2221 HTMLStyle_put_borderRightStyle,
2222 HTMLStyle_get_borderRightStyle,
2223 HTMLStyle_put_borderBottomStyle,
2224 HTMLStyle_get_borderBottomStyle,
2225 HTMLStyle_put_borderLeftStyle,
2226 HTMLStyle_get_borderLeftStyle,
2227 HTMLStyle_put_width,
2228 HTMLStyle_get_width,
2229 HTMLStyle_put_height,
2230 HTMLStyle_get_height,
2231 HTMLStyle_put_styleFloat,
2232 HTMLStyle_get_styleFloat,
2233 HTMLStyle_put_clear,
2234 HTMLStyle_get_clear,
2235 HTMLStyle_put_display,
2236 HTMLStyle_get_display,
2237 HTMLStyle_put_visibility,
2238 HTMLStyle_get_visibility,
2239 HTMLStyle_put_listStyleType,
2240 HTMLStyle_get_listStyleType,
2241 HTMLStyle_put_listStylePosition,
2242 HTMLStyle_get_listStylePosition,
2243 HTMLStyle_put_listStyleImage,
2244 HTMLStyle_get_listStyleImage,
2245 HTMLStyle_put_listStyle,
2246 HTMLStyle_get_listStyle,
2247 HTMLStyle_put_whiteSpace,
2248 HTMLStyle_get_whiteSpace,
2249 HTMLStyle_put_top,
2250 HTMLStyle_get_top,
2251 HTMLStyle_put_left,
2252 HTMLStyle_get_left,
2253 HTMLStyle_get_position,
2254 HTMLStyle_put_zIndex,
2255 HTMLStyle_get_zIndex,
2256 HTMLStyle_put_overflow,
2257 HTMLStyle_get_overflow,
2258 HTMLStyle_put_pageBreakBefore,
2259 HTMLStyle_get_pageBreakBefore,
2260 HTMLStyle_put_pageBreakAfter,
2261 HTMLStyle_get_pageBreakAfter,
2262 HTMLStyle_put_cssText,
2263 HTMLStyle_get_cssText,
2264 HTMLStyle_put_pixelTop,
2265 HTMLStyle_get_pixelTop,
2266 HTMLStyle_put_pixelLeft,
2267 HTMLStyle_get_pixelLeft,
2268 HTMLStyle_put_pixelWidth,
2269 HTMLStyle_get_pixelWidth,
2270 HTMLStyle_put_pixelHeight,
2271 HTMLStyle_get_pixelHeight,
2272 HTMLStyle_put_posTop,
2273 HTMLStyle_get_posTop,
2274 HTMLStyle_put_posLeft,
2275 HTMLStyle_get_posLeft,
2276 HTMLStyle_put_posWidth,
2277 HTMLStyle_get_posWidth,
2278 HTMLStyle_put_posHeight,
2279 HTMLStyle_get_posHeight,
2280 HTMLStyle_put_cursor,
2281 HTMLStyle_get_cursor,
2282 HTMLStyle_put_clip,
2283 HTMLStyle_get_clip,
2284 HTMLStyle_put_filter,
2285 HTMLStyle_get_filter,
2286 HTMLStyle_setAttribute,
2287 HTMLStyle_getAttribute,
2288 HTMLStyle_removeAttribute,
2289 HTMLStyle_toString
2292 static const dispex_static_data_vtbl_t HTMLStyle_dispex_vtbl = {
2293 HTMLStyle_get_dispid,
2294 NULL
2297 static const tid_t HTMLStyle_iface_tids[] = {
2298 IHTMLStyle_tid,
2299 IHTMLStyle2_tid,
2302 static dispex_static_data_t HTMLStyle_dispex = {
2303 &HTMLStyle_dispex_vtbl,
2304 DispHTMLStyle_tid,
2305 NULL,
2306 HTMLStyle_iface_tids
2309 IHTMLStyle *HTMLStyle_Create(nsIDOMCSSStyleDeclaration *nsstyle)
2311 HTMLStyle *ret = heap_alloc_zero(sizeof(HTMLStyle));
2313 ret->lpHTMLStyleVtbl = &HTMLStyleVtbl;
2314 ret->ref = 1;
2315 ret->nsstyle = nsstyle;
2316 HTMLStyle2_Init(ret);
2318 nsIDOMCSSStyleDeclaration_AddRef(nsstyle);
2320 init_dispex(&ret->dispex, (IUnknown*)HTMLSTYLE(ret), &HTMLStyle_dispex);
2322 return HTMLSTYLE(ret);