push(f) 25359c458b329fe03f66bef506b8062c200b9eb4
[wine/hacks.git] / dlls / mshtml / htmlstyle.c
blob6a225a6bffc997ac6eb68b2e729641065e727c32
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 attrBackgroundPositionX[] =
45 {'b','a','c','k','g','r','o','u','n','d','-','p','o','s','i','t','i','o','n','-','x',0};
46 static const WCHAR attrBackgroundPositionY[] =
47 {'b','a','c','k','g','r','o','u','n','d','-','p','o','s','i','t','i','o','n','-','y',0};
48 static const WCHAR attrBackgroundRepeat[] =
49 {'b','a','c','k','g','r','o','u','n','d','-','r','e','p','e','a','t',0};
50 static const WCHAR attrBorder[] =
51 {'b','o','r','d','e','r',0};
52 static const WCHAR attrBorderBottomStyle[] =
53 {'b','o','r','d','e','r','-','b','o','t','t','o','m','-','s','t','y','l','e',0};
54 static const WCHAR attrBorderBottomWidth[] =
55 {'b','o','r','d','e','r','-','b','o','t','t','o','m','-','w','i','d','t','h',0};
56 static const WCHAR attrBorderColor[] =
57 {'b','o','r','d','e','r','-','c','o','l','o','r',0};
58 static const WCHAR attrBorderLeft[] =
59 {'b','o','r','d','e','r','-','l','e','f','t',0};
60 static const WCHAR attrBorderLeftStyle[] =
61 {'b','o','r','d','e','r','-','l','e','f','t','-','s','t','y','l','e',0};
62 static const WCHAR attrBorderRightStyle[] =
63 {'b','o','r','d','e','r','-','r','i','g','h','t','-','s','t','y','l','e',0};
64 static const WCHAR attrBorderRightWidth[] =
65 {'b','o','r','d','e','r','-','r','i','g','h','t','-','w','i','d','t','h',0};
66 static const WCHAR attrBorderStyle[] =
67 {'b','o','r','d','e','r','-','s','t','y','l','e',0};
68 static const WCHAR attrBorderTopStyle[] =
69 {'b','o','r','d','e','r','-','t','o','p','-','s','t','y','l','e',0};
70 static const WCHAR attrBorderTopWidth[] =
71 {'b','o','r','d','e','r','-','t','o','p','-','w','i','d','t','h',0};
72 static const WCHAR attrBorderWidth[] =
73 {'b','o','r','d','e','r','-','w','i','d','t','h',0};
74 static const WCHAR attrColor[] =
75 {'c','o','l','o','r',0};
76 static const WCHAR attrCursor[] =
77 {'c','u','r','s','o','r',0};
78 static const WCHAR attrDisplay[] =
79 {'d','i','s','p','l','a','y',0};
80 static const WCHAR attrFilter[] =
81 {'f','i','l','e','t','e','r',0};
82 static const WCHAR attrFontFamily[] =
83 {'f','o','n','t','-','f','a','m','i','l','y',0};
84 static const WCHAR attrFontSize[] =
85 {'f','o','n','t','-','s','i','z','e',0};
86 static const WCHAR attrFontStyle[] =
87 {'f','o','n','t','-','s','t','y','l','e',0};
88 static const WCHAR attrFontVariant[] =
89 {'f','o','n','t','-','v','a','r','i','a','n','t',0};
90 static const WCHAR attrFontWeight[] =
91 {'f','o','n','t','-','w','e','i','g','h','t',0};
92 static const WCHAR attrHeight[] =
93 {'h','e','i','g','h','t',0};
94 static const WCHAR attrLeft[] =
95 {'l','e','f','t',0};
96 static const WCHAR attrMargin[] =
97 {'m','a','r','g','i','n',0};
98 static const WCHAR attrMarginLeft[] =
99 {'m','a','r','g','i','n','-','l','e','f','t',0};
100 static const WCHAR attrMarginRight[] =
101 {'m','a','r','g','i','n','-','r','i','g','h','t',0};
102 static const WCHAR attrMinHeight[] =
103 {'m','i','n','-','h','e','i','g','h','t',0};
104 static const WCHAR attrOverflow[] =
105 {'o','v','e','r','f','l','o','w',0};
106 static const WCHAR attrPaddingLeft[] =
107 {'p','a','d','d','i','n','g','-','l','e','f','t',0};
108 static const WCHAR attrPosition[] =
109 {'p','o','s','i','t','i','o','n',0};
110 static const WCHAR attrTextAlign[] =
111 {'t','e','x','t','-','a','l','i','g','n',0};
112 static const WCHAR attrTextDecoration[] =
113 {'t','e','x','t','-','d','e','c','o','r','a','t','i','o','n',0};
114 static const WCHAR attrTop[] =
115 {'t','o','p',0};
116 static const WCHAR attrVerticalAlign[] =
117 {'v','e','r','t','i','c','a','l','-','a','l','i','g','n',0};
118 static const WCHAR attrVisibility[] =
119 {'v','i','s','i','b','i','l','i','t','y',0};
120 static const WCHAR attrWidth[] =
121 {'w','i','d','t','h',0};
122 static const WCHAR attrZIndex[] =
123 {'z','-','i','n','d','e','x',0};
125 static const struct{
126 const WCHAR *name;
127 DISPID dispid;
128 } style_tbl[] = {
129 {attrBackground, DISPID_IHTMLSTYLE_BACKGROUND},
130 {attrBackgroundColor, DISPID_IHTMLSTYLE_BACKGROUNDCOLOR},
131 {attrBackgroundImage, DISPID_IHTMLSTYLE_BACKGROUNDIMAGE},
132 {attrBackgroundPositionX, DISPID_IHTMLSTYLE_BACKGROUNDPOSITIONX},
133 {attrBackgroundPositionY, DISPID_IHTMLSTYLE_BACKGROUNDPOSITIONY},
134 {attrBackgroundRepeat, DISPID_IHTMLSTYLE_BACKGROUNDREPEAT},
135 {attrBorder, DISPID_IHTMLSTYLE_BORDER},
136 {attrBorderBottomStyle, DISPID_IHTMLSTYLE_BORDERBOTTOMSTYLE},
137 {attrBorderBottomWidth, DISPID_IHTMLSTYLE_BORDERBOTTOMWIDTH},
138 {attrBorderColor, DISPID_IHTMLSTYLE_BORDERCOLOR},
139 {attrBorderLeft, DISPID_IHTMLSTYLE_BORDERLEFT},
140 {attrBorderLeftStyle, DISPID_IHTMLSTYLE_BORDERLEFTSTYLE},
141 {attrBorderRightStyle, DISPID_IHTMLSTYLE_BORDERRIGHTSTYLE},
142 {attrBorderRightWidth, DISPID_IHTMLSTYLE_BORDERRIGHTWIDTH},
143 {attrBorderStyle, DISPID_IHTMLSTYLE_BORDERSTYLE},
144 {attrBorderTopStyle, DISPID_IHTMLSTYLE_BORDERTOPSTYLE},
145 {attrBorderTopWidth, DISPID_IHTMLSTYLE_BORDERTOPWIDTH},
146 {attrBorderWidth, DISPID_IHTMLSTYLE_BORDERWIDTH},
147 {attrColor, DISPID_IHTMLSTYLE_COLOR},
148 {attrCursor, DISPID_IHTMLSTYLE_CURSOR},
149 {attrDisplay, DISPID_IHTMLSTYLE_DISPLAY},
150 {attrFilter, DISPID_IHTMLSTYLE_FILTER},
151 {attrFontFamily, DISPID_IHTMLSTYLE_FONTFAMILY},
152 {attrFontSize, DISPID_IHTMLSTYLE_FONTSIZE},
153 {attrFontStyle, DISPID_IHTMLSTYLE_FONTSTYLE},
154 {attrFontVariant, DISPID_IHTMLSTYLE_FONTVARIANT},
155 {attrFontWeight, DISPID_IHTMLSTYLE_FONTWEIGHT},
156 {attrHeight, DISPID_IHTMLSTYLE_HEIGHT},
157 {attrLeft, DISPID_IHTMLSTYLE_LEFT},
158 {attrMargin, DISPID_IHTMLSTYLE_MARGIN},
159 {attrMarginLeft, DISPID_IHTMLSTYLE_MARGINLEFT},
160 {attrMarginRight, DISPID_IHTMLSTYLE_MARGINRIGHT},
161 {attrMinHeight, DISPID_IHTMLSTYLE4_MINHEIGHT},
162 {attrOverflow, DISPID_IHTMLSTYLE_OVERFLOW},
163 {attrPaddingLeft, DISPID_IHTMLSTYLE_PADDINGLEFT},
164 {attrPosition, DISPID_IHTMLSTYLE2_POSITION},
165 {attrTextAlign, DISPID_IHTMLSTYLE_TEXTALIGN},
166 {attrTextDecoration, DISPID_IHTMLSTYLE_TEXTDECORATION},
167 {attrTop, DISPID_IHTMLSTYLE_TOP},
168 {attrVerticalAlign, DISPID_IHTMLSTYLE_VERTICALALIGN},
169 {attrVisibility, DISPID_IHTMLSTYLE_VISIBILITY},
170 {attrWidth, DISPID_IHTMLSTYLE_WIDTH},
171 {attrZIndex, DISPID_IHTMLSTYLE_ZINDEX}
174 static const WCHAR valLineThrough[] =
175 {'l','i','n','e','-','t','h','r','o','u','g','h',0};
176 static const WCHAR valUnderline[] =
177 {'u','n','d','e','r','l','i','n','e',0};
178 static const WCHAR szNormal[] =
179 {'n','o','r','m','a','l',0};
180 static const WCHAR styleNone[] =
181 {'n','o','n','e',0};
182 static const WCHAR valOverline[] =
183 {'o','v','e','r','l','i','n','e',0};
184 static const WCHAR valBlink[] =
185 {'b','l','i','n','k',0};
187 static const WCHAR px_formatW[] = {'%','d','p','x',0};
188 static const WCHAR emptyW[] = {0};
190 static LPWSTR fix_px_value(LPCWSTR val)
192 LPCWSTR ptr = val;
194 while(*ptr) {
195 while(*ptr && isspaceW(*ptr))
196 ptr++;
197 if(!*ptr)
198 break;
200 while(*ptr && isdigitW(*ptr))
201 ptr++;
203 if(!*ptr || isspaceW(*ptr)) {
204 LPWSTR ret, p;
205 int len = strlenW(val)+1;
207 ret = heap_alloc((len+2)*sizeof(WCHAR));
208 memcpy(ret, val, (ptr-val)*sizeof(WCHAR));
209 p = ret + (ptr-val);
210 *p++ = 'p';
211 *p++ = 'x';
212 strcpyW(p, ptr);
214 TRACE("fixed %s -> %s\n", debugstr_w(val), debugstr_w(ret));
216 return ret;
219 while(*ptr && !isspaceW(*ptr))
220 ptr++;
223 return NULL;
226 static LPWSTR fix_url_value(LPCWSTR val)
228 WCHAR *ret, *ptr;
230 static const WCHAR urlW[] = {'u','r','l','('};
232 if(strncmpW(val, urlW, sizeof(urlW)/sizeof(WCHAR)) || !strchrW(val, '\\'))
233 return NULL;
235 ret = heap_strdupW(val);
237 for(ptr = ret; *ptr; ptr++) {
238 if(*ptr == '\\')
239 *ptr = '/';
242 return ret;
245 HRESULT set_nsstyle_attr(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, LPCWSTR value, DWORD flags)
247 nsAString str_name, str_value, str_empty;
248 LPWSTR val = NULL;
249 nsresult nsres;
251 static const PRUnichar wszEmpty[] = {0};
253 if(flags & ATTR_FIX_PX)
254 val = fix_px_value(value);
255 if(flags & ATTR_FIX_URL)
256 val = fix_url_value(value);
258 nsAString_Init(&str_name, style_tbl[sid].name);
259 nsAString_Init(&str_value, val ? val : value);
260 nsAString_Init(&str_empty, wszEmpty);
261 heap_free(val);
263 nsres = nsIDOMCSSStyleDeclaration_SetProperty(nsstyle, &str_name, &str_value, &str_empty);
264 if(NS_FAILED(nsres))
265 ERR("SetProperty failed: %08x\n", nsres);
267 nsAString_Finish(&str_name);
268 nsAString_Finish(&str_value);
269 nsAString_Finish(&str_empty);
271 return S_OK;
274 HRESULT set_nsstyle_attr_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, VARIANT *value, DWORD flags)
276 switch(V_VT(value)) {
277 case VT_NULL:
278 return set_nsstyle_attr(nsstyle, sid, emptyW, flags);
280 case VT_BSTR:
281 return set_nsstyle_attr(nsstyle, sid, V_BSTR(value), flags);
283 case VT_I4: {
284 WCHAR str[14];
285 static const WCHAR format[] = {'%','d',0};
287 wsprintfW(str, format, V_I4(value));
288 return set_nsstyle_attr(nsstyle, sid, str, flags);
290 default:
291 FIXME("not implemented vt %d\n", V_VT(value));
292 return E_NOTIMPL;
296 return S_OK;
299 static inline HRESULT set_style_attr(HTMLStyle *This, styleid_t sid, LPCWSTR value, DWORD flags)
301 return set_nsstyle_attr(This->nsstyle, sid, value, flags);
304 static HRESULT get_nsstyle_attr_nsval(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, nsAString *value)
306 nsAString str_name;
307 nsresult nsres;
309 nsAString_Init(&str_name, style_tbl[sid].name);
311 nsres = nsIDOMCSSStyleDeclaration_GetPropertyValue(nsstyle, &str_name, value);
312 if(NS_FAILED(nsres)) {
313 ERR("SetProperty failed: %08x\n", nsres);
314 return E_FAIL;
317 nsAString_Finish(&str_name);
319 return NS_OK;
322 HRESULT get_nsstyle_attr(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, BSTR *p)
324 nsAString str_value;
325 const PRUnichar *value;
327 nsAString_Init(&str_value, NULL);
329 get_nsstyle_attr_nsval(nsstyle, sid, &str_value);
331 nsAString_GetData(&str_value, &value);
332 *p = *value ? SysAllocString(value) : NULL;
334 nsAString_Finish(&str_value);
336 TRACE("%s -> %s\n", debugstr_w(style_tbl[sid].name), debugstr_w(*p));
337 return S_OK;
340 HRESULT get_nsstyle_attr_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, VARIANT *p, DWORD flags)
342 nsAString str_value;
343 const PRUnichar *value;
344 BOOL set = FALSE;
346 nsAString_Init(&str_value, NULL);
348 get_nsstyle_attr_nsval(nsstyle, sid, &str_value);
350 nsAString_GetData(&str_value, &value);
352 if(flags & ATTR_STR_TO_INT) {
353 const PRUnichar *ptr = value;
354 BOOL neg = FALSE;
355 INT i = 0;
357 if(*ptr == '-') {
358 neg = TRUE;
359 ptr++;
362 while(isdigitW(*ptr))
363 i = i*10 + (*ptr++ - '0');
365 if(!*ptr) {
366 V_VT(p) = VT_I4;
367 V_I4(p) = neg ? -i : i;
368 set = TRUE;
372 if(!set) {
373 BSTR str = NULL;
375 if(*value) {
376 str = SysAllocString(value);
377 if(!str)
378 return E_OUTOFMEMORY;
381 V_VT(p) = VT_BSTR;
382 V_BSTR(p) = str;
385 nsAString_Finish(&str_value);
387 TRACE("%s -> %s\n", debugstr_w(style_tbl[sid].name), debugstr_variant(p));
388 return S_OK;
391 static inline HRESULT get_style_attr(HTMLStyle *This, styleid_t sid, BSTR *p)
393 return get_nsstyle_attr(This->nsstyle, sid, p);
396 static HRESULT check_style_attr_value(HTMLStyle *This, styleid_t sid, LPCWSTR exval, VARIANT_BOOL *p)
398 nsAString str_value;
399 const PRUnichar *value;
401 nsAString_Init(&str_value, NULL);
403 get_nsstyle_attr_nsval(This->nsstyle, sid, &str_value);
405 nsAString_GetData(&str_value, &value);
406 *p = strcmpW(value, exval) ? VARIANT_FALSE : VARIANT_TRUE;
407 nsAString_Finish(&str_value);
409 TRACE("%s -> %x\n", debugstr_w(style_tbl[sid].name), *p);
410 return S_OK;
413 static inline HRESULT set_style_pos(HTMLStyle *This, styleid_t sid, float value)
415 WCHAR szValue[25];
416 WCHAR szFormat[] = {'%','.','0','f','p','x',0};
418 value = floor(value);
420 sprintfW(szValue, szFormat, value);
422 return set_style_attr(This, sid, szValue, 0);
425 static HRESULT get_nsstyle_pos(HTMLStyle *This, styleid_t sid, float *p)
427 nsAString str_value;
428 HRESULT hres;
429 WCHAR pxW[] = {'p','x',0};
431 TRACE("%p %d %p\n", This, sid, p);
433 *p = 0.0f;
435 nsAString_Init(&str_value, NULL);
437 hres = get_nsstyle_attr_nsval(This->nsstyle, sid, &str_value);
438 if(hres == S_OK)
440 WCHAR *ptr;
441 const PRUnichar *value;
443 nsAString_GetData(&str_value, &value);
444 if(value)
446 *p = strtolW(value, &ptr, 10);
448 if(*ptr && strcmpW(ptr, pxW))
450 nsAString_Finish(&str_value);
451 FIXME("only px values are currently supported\n");
452 return E_FAIL;
457 TRACE("ret %f\n", *p);
459 nsAString_Finish(&str_value);
461 return hres;
464 static BOOL is_valid_border_style(BSTR v)
466 static const WCHAR styleDotted[] = {'d','o','t','t','e','d',0};
467 static const WCHAR styleDashed[] = {'d','a','s','h','e','d',0};
468 static const WCHAR styleSolid[] = {'s','o','l','i','d',0};
469 static const WCHAR styleDouble[] = {'d','o','u','b','l','e',0};
470 static const WCHAR styleGroove[] = {'g','r','o','o','v','e',0};
471 static const WCHAR styleRidge[] = {'r','i','d','g','e',0};
472 static const WCHAR styleInset[] = {'i','n','s','e','t',0};
473 static const WCHAR styleOutset[] = {'o','u','t','s','e','t',0};
475 TRACE("%s\n", debugstr_w(v));
477 if(!v || strcmpiW(v, styleNone) == 0 || strcmpiW(v, styleDotted) == 0 ||
478 strcmpiW(v, styleDashed) == 0 || strcmpiW(v, styleSolid) == 0 ||
479 strcmpiW(v, styleDouble) == 0 || strcmpiW(v, styleGroove) == 0 ||
480 strcmpiW(v, styleRidge) == 0 || strcmpiW(v, styleInset) == 0 ||
481 strcmpiW(v, styleOutset) == 0 )
483 return TRUE;
486 return FALSE;
489 #define HTMLSTYLE_THIS(iface) DEFINE_THIS(HTMLStyle, HTMLStyle, iface)
491 static HRESULT WINAPI HTMLStyle_QueryInterface(IHTMLStyle *iface, REFIID riid, void **ppv)
493 HTMLStyle *This = HTMLSTYLE_THIS(iface);
495 *ppv = NULL;
497 if(IsEqualGUID(&IID_IUnknown, riid)) {
498 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
499 *ppv = HTMLSTYLE(This);
500 }else if(IsEqualGUID(&IID_IHTMLStyle, riid)) {
501 TRACE("(%p)->(IID_IHTMLStyle %p)\n", This, ppv);
502 *ppv = HTMLSTYLE(This);
503 }else if(IsEqualGUID(&IID_IHTMLStyle2, riid)) {
504 TRACE("(%p)->(IID_IHTMLStyle2 %p)\n", This, ppv);
505 *ppv = HTMLSTYLE2(This);
506 }else if(IsEqualGUID(&IID_IHTMLStyle3, riid)) {
507 TRACE("(%p)->(IID_IHTMLStyle3 %p)\n", This, ppv);
508 *ppv = HTMLSTYLE3(This);
509 }else if(IsEqualGUID(&IID_IHTMLStyle4, riid)) {
510 TRACE("(%p)->(IID_IHTMLStyle4 %p)\n", This, ppv);
511 *ppv = HTMLSTYLE4(This);
512 }else if(dispex_query_interface(&This->dispex, riid, ppv)) {
513 return *ppv ? S_OK : E_NOINTERFACE;
516 if(*ppv) {
517 IUnknown_AddRef((IUnknown*)*ppv);
518 return S_OK;
521 WARN("unsupported %s\n", debugstr_guid(riid));
522 return E_NOINTERFACE;
525 static ULONG WINAPI HTMLStyle_AddRef(IHTMLStyle *iface)
527 HTMLStyle *This = HTMLSTYLE_THIS(iface);
528 LONG ref = InterlockedIncrement(&This->ref);
530 TRACE("(%p) ref=%d\n", This, ref);
532 return ref;
535 static ULONG WINAPI HTMLStyle_Release(IHTMLStyle *iface)
537 HTMLStyle *This = HTMLSTYLE_THIS(iface);
538 LONG ref = InterlockedDecrement(&This->ref);
540 TRACE("(%p) ref=%d\n", This, ref);
542 if(!ref) {
543 if(This->nsstyle)
544 nsIDOMCSSStyleDeclaration_Release(This->nsstyle);
545 heap_free(This);
548 return ref;
551 static HRESULT WINAPI HTMLStyle_GetTypeInfoCount(IHTMLStyle *iface, UINT *pctinfo)
553 HTMLStyle *This = HTMLSTYLE_THIS(iface);
554 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->dispex), pctinfo);
557 static HRESULT WINAPI HTMLStyle_GetTypeInfo(IHTMLStyle *iface, UINT iTInfo,
558 LCID lcid, ITypeInfo **ppTInfo)
560 HTMLStyle *This = HTMLSTYLE_THIS(iface);
561 return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->dispex), iTInfo, lcid, ppTInfo);
564 static HRESULT WINAPI HTMLStyle_GetIDsOfNames(IHTMLStyle *iface, REFIID riid,
565 LPOLESTR *rgszNames, UINT cNames,
566 LCID lcid, DISPID *rgDispId)
568 HTMLStyle *This = HTMLSTYLE_THIS(iface);
569 return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->dispex), riid, rgszNames, cNames, lcid, rgDispId);
572 static HRESULT WINAPI HTMLStyle_Invoke(IHTMLStyle *iface, DISPID dispIdMember,
573 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
574 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
576 HTMLStyle *This = HTMLSTYLE_THIS(iface);
577 return IDispatchEx_Invoke(DISPATCHEX(&This->dispex), dispIdMember, riid, lcid,
578 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
581 static HRESULT WINAPI HTMLStyle_put_fontFamily(IHTMLStyle *iface, BSTR v)
583 HTMLStyle *This = HTMLSTYLE_THIS(iface);
585 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
587 return set_style_attr(This, STYLEID_FONT_FAMILY, v, 0);
590 static HRESULT WINAPI HTMLStyle_get_fontFamily(IHTMLStyle *iface, BSTR *p)
592 HTMLStyle *This = HTMLSTYLE_THIS(iface);
594 TRACE("(%p)->(%p)\n", This, p);
596 return get_style_attr(This, STYLEID_FONT_FAMILY, p);
599 static HRESULT WINAPI HTMLStyle_put_fontStyle(IHTMLStyle *iface, BSTR v)
601 HTMLStyle *This = HTMLSTYLE_THIS(iface);
602 static const WCHAR szItalic[] = {'i','t','a','l','i','c',0};
603 static const WCHAR szOblique[] = {'o','b','l','i','q','u','e',0};
605 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
607 /* fontStyle can only be one of the follow values. */
608 if(!v || strcmpiW(szNormal, v) == 0 || strcmpiW(szItalic, v) == 0 ||
609 strcmpiW(szOblique, v) == 0)
611 return set_nsstyle_attr(This->nsstyle, STYLEID_FONT_STYLE, v, 0);
614 return E_INVALIDARG;
617 static HRESULT WINAPI HTMLStyle_get_fontStyle(IHTMLStyle *iface, BSTR *p)
619 HTMLStyle *This = HTMLSTYLE_THIS(iface);
621 TRACE("(%p)->(%p)\n", This, p);
623 return get_style_attr(This, STYLEID_FONT_STYLE, p);
626 static HRESULT WINAPI HTMLStyle_put_fontVariant(IHTMLStyle *iface, BSTR v)
628 HTMLStyle *This = HTMLSTYLE_THIS(iface);
629 static const WCHAR szCaps[] = {'s','m','a','l','l','-','c','a','p','s',0};
631 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
633 /* fontVariant can only be one of the follow values. */
634 if(!v || strcmpiW(szNormal, v) == 0 || strcmpiW(szCaps, v) == 0)
636 return set_nsstyle_attr(This->nsstyle, STYLEID_FONT_VARIANT, v, 0);
639 return E_INVALIDARG;
642 static HRESULT WINAPI HTMLStyle_get_fontVariant(IHTMLStyle *iface, BSTR *p)
644 HTMLStyle *This = HTMLSTYLE_THIS(iface);
645 TRACE("(%p)->(%p)\n", This, p);
647 if(!p)
648 return E_INVALIDARG;
650 return get_style_attr(This, STYLEID_FONT_VARIANT, p);
653 static HRESULT WINAPI HTMLStyle_put_fontWeight(IHTMLStyle *iface, BSTR v)
655 HTMLStyle *This = HTMLSTYLE_THIS(iface);
656 static const WCHAR styleBold[] = {'b','o','l','d',0};
657 static const WCHAR styleBolder[] = {'b','o','l','d','e','r',0};
658 static const WCHAR styleLighter[] = {'l','i','g','h','t','e','r',0};
659 static const WCHAR style100[] = {'1','0','0',0};
660 static const WCHAR style200[] = {'2','0','0',0};
661 static const WCHAR style300[] = {'3','0','0',0};
662 static const WCHAR style400[] = {'4','0','0',0};
663 static const WCHAR style500[] = {'5','0','0',0};
664 static const WCHAR style600[] = {'6','0','0',0};
665 static const WCHAR style700[] = {'7','0','0',0};
666 static const WCHAR style800[] = {'8','0','0',0};
667 static const WCHAR style900[] = {'9','0','0',0};
669 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
671 /* fontWeight can only be one of the following */
672 if(!v || strcmpiW(szNormal, v) == 0 || strcmpiW(styleBold, v) == 0 ||
673 strcmpiW(styleBolder, v) == 0 || strcmpiW(styleLighter, v) == 0 ||
674 strcmpiW(style100, v) == 0 || strcmpiW(style200, v) == 0 ||
675 strcmpiW(style300, v) == 0 || strcmpiW(style400, v) == 0 ||
676 strcmpiW(style500, v) == 0 || strcmpiW(style600, v) == 0 ||
677 strcmpiW(style700, v) == 0 || strcmpiW(style800, v) == 0 ||
678 strcmpiW(style900, v) == 0
681 return set_nsstyle_attr(This->nsstyle, STYLEID_FONT_WEIGHT, v, 0);
684 return E_INVALIDARG;
687 static HRESULT WINAPI HTMLStyle_get_fontWeight(IHTMLStyle *iface, BSTR *p)
689 HTMLStyle *This = HTMLSTYLE_THIS(iface);
691 TRACE("(%p)->(%p)\n", This, p);
693 return get_style_attr(This, STYLEID_FONT_WEIGHT, p);
696 static HRESULT WINAPI HTMLStyle_put_fontSize(IHTMLStyle *iface, VARIANT v)
698 HTMLStyle *This = HTMLSTYLE_THIS(iface);
700 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
702 switch(V_VT(&v)) {
703 case VT_BSTR:
704 return set_style_attr(This, STYLEID_FONT_SIZE, V_BSTR(&v), 0);
705 default:
706 FIXME("not supported vt %d\n", V_VT(&v));
709 return S_OK;
712 static HRESULT WINAPI HTMLStyle_get_fontSize(IHTMLStyle *iface, VARIANT *p)
714 HTMLStyle *This = HTMLSTYLE_THIS(iface);
716 TRACE("(%p)->(%p)\n", This, p);
718 V_VT(p) = VT_BSTR;
719 return get_style_attr(This, STYLEID_FONT_SIZE, &V_BSTR(p));
722 static HRESULT WINAPI HTMLStyle_put_font(IHTMLStyle *iface, BSTR v)
724 HTMLStyle *This = HTMLSTYLE_THIS(iface);
725 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
726 return E_NOTIMPL;
729 static HRESULT WINAPI HTMLStyle_get_font(IHTMLStyle *iface, BSTR *p)
731 HTMLStyle *This = HTMLSTYLE_THIS(iface);
732 FIXME("(%p)->(%p)\n", This, p);
733 return E_NOTIMPL;
736 static HRESULT WINAPI HTMLStyle_put_color(IHTMLStyle *iface, VARIANT v)
738 HTMLStyle *This = HTMLSTYLE_THIS(iface);
740 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
742 switch(V_VT(&v)) {
743 case VT_BSTR:
744 TRACE("%s\n", debugstr_w(V_BSTR(&v)));
745 return set_style_attr(This, STYLEID_COLOR, V_BSTR(&v), 0);
747 default:
748 FIXME("unsupported vt=%d\n", V_VT(&v));
751 return E_NOTIMPL;
754 static HRESULT WINAPI HTMLStyle_get_color(IHTMLStyle *iface, VARIANT *p)
756 HTMLStyle *This = HTMLSTYLE_THIS(iface);
758 TRACE("(%p)->(%p)\n", This, p);
760 V_VT(p) = VT_BSTR;
761 return get_style_attr(This, STYLEID_COLOR, &V_BSTR(p));
764 static HRESULT WINAPI HTMLStyle_put_background(IHTMLStyle *iface, BSTR v)
766 HTMLStyle *This = HTMLSTYLE_THIS(iface);
768 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
770 return set_style_attr(This, STYLEID_BACKGROUND, v, 0);
773 static HRESULT WINAPI HTMLStyle_get_background(IHTMLStyle *iface, BSTR *p)
775 HTMLStyle *This = HTMLSTYLE_THIS(iface);
777 TRACE("(%p)->(%p)\n", This, p);
779 return get_style_attr(This, STYLEID_BACKGROUND, p);
782 static HRESULT WINAPI HTMLStyle_put_backgroundColor(IHTMLStyle *iface, VARIANT v)
784 HTMLStyle *This = HTMLSTYLE_THIS(iface);
786 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
788 switch(V_VT(&v)) {
789 case VT_BSTR:
790 return set_style_attr(This, STYLEID_BACKGROUND_COLOR, V_BSTR(&v), 0);
791 case VT_I4: {
792 WCHAR value[10];
793 static const WCHAR format[] = {'#','%','0','6','x',0};
795 wsprintfW(value, format, V_I4(&v));
796 return set_style_attr(This, STYLEID_BACKGROUND_COLOR, value, 0);
798 default:
799 FIXME("unsupported vt %d\n", V_VT(&v));
802 return S_OK;
805 static HRESULT WINAPI HTMLStyle_get_backgroundColor(IHTMLStyle *iface, VARIANT *p)
807 HTMLStyle *This = HTMLSTYLE_THIS(iface);
808 TRACE("(%p)->(%p)\n", This, p);
810 V_VT(p) = VT_BSTR;
811 return get_style_attr(This, STYLEID_BACKGROUND_COLOR, &V_BSTR(p));
814 static HRESULT WINAPI HTMLStyle_put_backgroundImage(IHTMLStyle *iface, BSTR v)
816 HTMLStyle *This = HTMLSTYLE_THIS(iface);
818 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
820 return set_style_attr(This, STYLEID_BACKGROUND_IMAGE, v, ATTR_FIX_URL);
823 static HRESULT WINAPI HTMLStyle_get_backgroundImage(IHTMLStyle *iface, BSTR *p)
825 HTMLStyle *This = HTMLSTYLE_THIS(iface);
827 TRACE("(%p)->(%p)\n", This, p);
829 return get_style_attr(This, STYLEID_BACKGROUND_IMAGE, p);
832 static HRESULT WINAPI HTMLStyle_put_backgroundRepeat(IHTMLStyle *iface, BSTR v)
834 HTMLStyle *This = HTMLSTYLE_THIS(iface);
835 static const WCHAR styleRepeat[] = {'r','e','p','e','a','t',0};
836 static const WCHAR styleNoRepeat[] = {'n','o','-','r','e','p','e','a','t',0};
837 static const WCHAR styleRepeatX[] = {'r','e','p','e','a','t','-','x',0};
838 static const WCHAR styleRepeatY[] = {'r','e','p','e','a','t','-','y',0};
840 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
842 /* fontWeight can only be one of the following */
843 if(!v || strcmpiW(styleRepeat, v) == 0 || strcmpiW(styleNoRepeat, v) == 0 ||
844 strcmpiW(styleRepeatX, v) == 0 || strcmpiW(styleRepeatY, v) == 0 )
846 return set_style_attr(This, STYLEID_BACKGROUND_REPEAT , v, 0);
849 return E_INVALIDARG;
852 static HRESULT WINAPI HTMLStyle_get_backgroundRepeat(IHTMLStyle *iface, BSTR *p)
854 HTMLStyle *This = HTMLSTYLE_THIS(iface);
856 TRACE("(%p)->(%p)\n", This, p);
858 return get_style_attr(This, STYLEID_BACKGROUND_REPEAT, p);
861 static HRESULT WINAPI HTMLStyle_put_backgroundAttachment(IHTMLStyle *iface, BSTR v)
863 HTMLStyle *This = HTMLSTYLE_THIS(iface);
864 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
865 return E_NOTIMPL;
868 static HRESULT WINAPI HTMLStyle_get_backgroundAttachment(IHTMLStyle *iface, BSTR *p)
870 HTMLStyle *This = HTMLSTYLE_THIS(iface);
871 FIXME("(%p)->(%p)\n", This, p);
872 return E_NOTIMPL;
875 static HRESULT WINAPI HTMLStyle_put_backgroundPosition(IHTMLStyle *iface, BSTR v)
877 HTMLStyle *This = HTMLSTYLE_THIS(iface);
878 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
879 return E_NOTIMPL;
882 static HRESULT WINAPI HTMLStyle_get_backgroundPosition(IHTMLStyle *iface, BSTR *p)
884 HTMLStyle *This = HTMLSTYLE_THIS(iface);
885 FIXME("(%p)->(%p)\n", This, p);
886 return E_NOTIMPL;
889 static HRESULT WINAPI HTMLStyle_put_backgroundPositionX(IHTMLStyle *iface, VARIANT v)
891 HTMLStyle *This = HTMLSTYLE_THIS(iface);
892 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
893 return set_nsstyle_attr_var(This->nsstyle, STYLEID_BACKGROUND_POSITION_X, &v, 0);
896 static HRESULT WINAPI HTMLStyle_get_backgroundPositionX(IHTMLStyle *iface, VARIANT *p)
898 HTMLStyle *This = HTMLSTYLE_THIS(iface);
899 TRACE("(%p)->(%p)\n", This, p);
900 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BACKGROUND_POSITION_X, p, 0);
903 static HRESULT WINAPI HTMLStyle_put_backgroundPositionY(IHTMLStyle *iface, VARIANT v)
905 HTMLStyle *This = HTMLSTYLE_THIS(iface);
906 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
907 return set_nsstyle_attr_var(This->nsstyle, STYLEID_BACKGROUND_POSITION_Y, &v, 0);
910 static HRESULT WINAPI HTMLStyle_get_backgroundPositionY(IHTMLStyle *iface, VARIANT *p)
912 HTMLStyle *This = HTMLSTYLE_THIS(iface);
913 TRACE("(%p)->(%p)\n", This, p);
914 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BACKGROUND_POSITION_Y, p, 0);
917 static HRESULT WINAPI HTMLStyle_put_wordSpacing(IHTMLStyle *iface, VARIANT v)
919 HTMLStyle *This = HTMLSTYLE_THIS(iface);
920 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
921 return E_NOTIMPL;
924 static HRESULT WINAPI HTMLStyle_get_wordSpacing(IHTMLStyle *iface, VARIANT *p)
926 HTMLStyle *This = HTMLSTYLE_THIS(iface);
927 FIXME("(%p)->(%p)\n", This, p);
928 return E_NOTIMPL;
931 static HRESULT WINAPI HTMLStyle_put_letterSpacing(IHTMLStyle *iface, VARIANT v)
933 HTMLStyle *This = HTMLSTYLE_THIS(iface);
934 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
935 return E_NOTIMPL;
938 static HRESULT WINAPI HTMLStyle_get_letterSpacing(IHTMLStyle *iface, VARIANT *p)
940 HTMLStyle *This = HTMLSTYLE_THIS(iface);
941 FIXME("(%p)->(%p)\n", This, p);
942 return E_NOTIMPL;
945 static HRESULT WINAPI HTMLStyle_put_textDecoration(IHTMLStyle *iface, BSTR v)
947 HTMLStyle *This = HTMLSTYLE_THIS(iface);
949 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
951 /* textDecoration can only be one of the following */
952 if(!v || strcmpiW(styleNone, v) == 0 || strcmpiW(valUnderline, v) == 0 ||
953 strcmpiW(valOverline, v) == 0 || strcmpiW(valLineThrough, v) == 0 ||
954 strcmpiW(valBlink, v) == 0)
956 return set_style_attr(This, STYLEID_TEXT_DECORATION , v, 0);
959 return E_INVALIDARG;
962 static HRESULT WINAPI HTMLStyle_get_textDecoration(IHTMLStyle *iface, BSTR *p)
964 HTMLStyle *This = HTMLSTYLE_THIS(iface);
966 TRACE("(%p)->(%p)\n", This, p);
968 return get_style_attr(This, STYLEID_TEXT_DECORATION, p);
971 static HRESULT WINAPI HTMLStyle_put_textDecorationNone(IHTMLStyle *iface, VARIANT_BOOL v)
973 HTMLStyle *This = HTMLSTYLE_THIS(iface);
975 TRACE("(%p)->(%x)\n", This, v);
977 return set_style_attr(This, STYLEID_TEXT_DECORATION, v ? styleNone : emptyW, 0);
980 static HRESULT WINAPI HTMLStyle_get_textDecorationNone(IHTMLStyle *iface, VARIANT_BOOL *p)
982 HTMLStyle *This = HTMLSTYLE_THIS(iface);
984 TRACE("(%p)->(%p)\n", This, p);
986 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, styleNone, p);
989 static HRESULT WINAPI HTMLStyle_put_textDecorationUnderline(IHTMLStyle *iface, VARIANT_BOOL v)
991 HTMLStyle *This = HTMLSTYLE_THIS(iface);
993 TRACE("(%p)->(%x)\n", This, v);
995 return set_style_attr(This, STYLEID_TEXT_DECORATION, v ? valUnderline : emptyW, 0);
998 static HRESULT WINAPI HTMLStyle_get_textDecorationUnderline(IHTMLStyle *iface, VARIANT_BOOL *p)
1000 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1002 TRACE("(%p)->(%p)\n", This, p);
1004 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, valUnderline, p);
1007 static HRESULT WINAPI HTMLStyle_put_textDecorationOverline(IHTMLStyle *iface, VARIANT_BOOL v)
1009 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1011 TRACE("(%p)->(%x)\n", This, v);
1013 return set_style_attr(This, STYLEID_TEXT_DECORATION, v ? valOverline : emptyW, 0);
1016 static HRESULT WINAPI HTMLStyle_get_textDecorationOverline(IHTMLStyle *iface, VARIANT_BOOL *p)
1018 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1020 TRACE("(%p)->(%p)\n", This, p);
1022 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, valOverline, p);
1025 static HRESULT WINAPI HTMLStyle_put_textDecorationLineThrough(IHTMLStyle *iface, VARIANT_BOOL v)
1027 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1029 TRACE("(%p)->(%x)\n", This, v);
1031 return set_style_attr(This, STYLEID_TEXT_DECORATION, v ? valLineThrough : emptyW, 0);
1034 static HRESULT WINAPI HTMLStyle_get_textDecorationLineThrough(IHTMLStyle *iface, VARIANT_BOOL *p)
1036 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1038 TRACE("(%p)->(%p)\n", This, p);
1040 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, valLineThrough, p);
1043 static HRESULT WINAPI HTMLStyle_put_textDecorationBlink(IHTMLStyle *iface, VARIANT_BOOL v)
1045 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1047 TRACE("(%p)->(%x)\n", This, v);
1049 return set_style_attr(This, STYLEID_TEXT_DECORATION, v ? valBlink : emptyW, 0);
1052 static HRESULT WINAPI HTMLStyle_get_textDecorationBlink(IHTMLStyle *iface, VARIANT_BOOL *p)
1054 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1056 TRACE("(%p)->(%p)\n", This, p);
1058 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, valBlink, p);
1061 static HRESULT WINAPI HTMLStyle_put_verticalAlign(IHTMLStyle *iface, VARIANT v)
1063 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1065 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1067 switch(V_VT(&v)) {
1068 case VT_BSTR:
1069 return set_style_attr(This, STYLEID_VERTICAL_ALIGN, V_BSTR(&v), 0);
1070 default:
1071 FIXME("not implemented vt %d\n", V_VT(&v));
1072 return E_NOTIMPL;
1075 return S_OK;
1078 static HRESULT WINAPI HTMLStyle_get_verticalAlign(IHTMLStyle *iface, VARIANT *p)
1080 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1081 BSTR ret;
1082 HRESULT hres;
1084 TRACE("(%p)->(%p)\n", This, p);
1086 hres = get_style_attr(This, STYLEID_VERTICAL_ALIGN, &ret);
1087 if(FAILED(hres))
1088 return hres;
1090 V_VT(p) = VT_BSTR;
1091 V_BSTR(p) = ret;
1092 return S_OK;
1095 static HRESULT WINAPI HTMLStyle_put_textTransform(IHTMLStyle *iface, BSTR v)
1097 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1098 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1099 return E_NOTIMPL;
1102 static HRESULT WINAPI HTMLStyle_get_textTransform(IHTMLStyle *iface, BSTR *p)
1104 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1105 FIXME("(%p)->(%p)\n", This, p);
1106 return E_NOTIMPL;
1109 static HRESULT WINAPI HTMLStyle_put_textAlign(IHTMLStyle *iface, BSTR v)
1111 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1113 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1115 return set_style_attr(This, STYLEID_TEXT_ALIGN, v, 0);
1118 static HRESULT WINAPI HTMLStyle_get_textAlign(IHTMLStyle *iface, BSTR *p)
1120 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1122 TRACE("(%p)->(%p)\n", This, p);
1124 return get_style_attr(This, STYLEID_TEXT_ALIGN, p);
1127 static HRESULT WINAPI HTMLStyle_put_textIndent(IHTMLStyle *iface, VARIANT v)
1129 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1130 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1131 return E_NOTIMPL;
1134 static HRESULT WINAPI HTMLStyle_get_textIndent(IHTMLStyle *iface, VARIANT *p)
1136 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1137 FIXME("(%p)->(%p)\n", This, p);
1138 return E_NOTIMPL;
1141 static HRESULT WINAPI HTMLStyle_put_lineHeight(IHTMLStyle *iface, VARIANT v)
1143 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1144 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1145 return E_NOTIMPL;
1148 static HRESULT WINAPI HTMLStyle_get_lineHeight(IHTMLStyle *iface, VARIANT *p)
1150 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1151 FIXME("(%p)->(%p)\n", This, p);
1152 return E_NOTIMPL;
1155 static HRESULT WINAPI HTMLStyle_put_marginTop(IHTMLStyle *iface, VARIANT v)
1157 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1158 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1159 return E_NOTIMPL;
1162 static HRESULT WINAPI HTMLStyle_get_marginTop(IHTMLStyle *iface, VARIANT *p)
1164 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1165 FIXME("(%p)->(%p)\n", This, p);
1166 return E_NOTIMPL;
1169 static HRESULT WINAPI HTMLStyle_put_marginRight(IHTMLStyle *iface, VARIANT v)
1171 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1173 TRACE("(%p)->(v(%d))\n", This, V_VT(&v));
1175 switch(V_VT(&v)) {
1176 case VT_NULL:
1177 return set_style_attr(This, STYLEID_MARGIN_RIGHT, emptyW, 0);
1178 case VT_I4: {
1179 WCHAR buf[14];
1181 wsprintfW(buf, px_formatW, V_I4(&v));
1182 return set_style_attr(This, STYLEID_MARGIN_RIGHT, buf, 0);
1184 case VT_BSTR:
1185 return set_style_attr(This, STYLEID_MARGIN_RIGHT, V_BSTR(&v), 0);
1186 default:
1187 FIXME("Unsupported vt=%d\n", V_VT(&v));
1190 return E_NOTIMPL;
1193 static HRESULT WINAPI HTMLStyle_get_marginRight(IHTMLStyle *iface, VARIANT *p)
1195 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1196 TRACE("(%p)->(%p)\n", This, p);
1197 return get_nsstyle_attr_var(This->nsstyle, STYLEID_MARGIN_RIGHT, p, 0);
1200 static HRESULT WINAPI HTMLStyle_put_marginBottom(IHTMLStyle *iface, VARIANT v)
1202 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1203 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1204 return E_NOTIMPL;
1207 static HRESULT WINAPI HTMLStyle_get_marginBottom(IHTMLStyle *iface, VARIANT *p)
1209 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1210 FIXME("(%p)->(%p)\n", This, p);
1211 return E_NOTIMPL;
1214 static HRESULT WINAPI HTMLStyle_put_marginLeft(IHTMLStyle *iface, VARIANT v)
1216 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1218 switch(V_VT(&v)) {
1219 case VT_NULL:
1220 TRACE("(%p)->(NULL)\n", This);
1221 return set_style_attr(This, STYLEID_MARGIN_LEFT, emptyW, 0);
1222 case VT_I4: {
1223 WCHAR buf[14];
1225 TRACE("(%p)->(%d)\n", This, V_I4(&v));
1227 wsprintfW(buf, px_formatW, V_I4(&v));
1228 return set_style_attr(This, STYLEID_MARGIN_LEFT, buf, 0);
1230 case VT_BSTR:
1231 TRACE("(%p)->(%s)\n", This, debugstr_w(V_BSTR(&v)));
1232 return set_style_attr(This, STYLEID_MARGIN_LEFT, V_BSTR(&v), 0);
1233 default:
1234 FIXME("Unsupported vt=%d\n", V_VT(&v));
1237 return E_NOTIMPL;
1240 static HRESULT WINAPI HTMLStyle_put_margin(IHTMLStyle *iface, BSTR v)
1242 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1244 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1246 return set_style_attr(This, STYLEID_MARGIN, v, 0);
1249 static HRESULT WINAPI HTMLStyle_get_margin(IHTMLStyle *iface, BSTR *p)
1251 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1253 TRACE("(%p)->(%p)\n", This, p);
1255 return get_style_attr(This, STYLEID_MARGIN, p);
1258 static HRESULT WINAPI HTMLStyle_get_marginLeft(IHTMLStyle *iface, VARIANT *p)
1260 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1261 TRACE("(%p)->(%p)\n", This, p);
1262 return get_nsstyle_attr_var(This->nsstyle, STYLEID_MARGIN_LEFT, p, 0);
1265 static HRESULT WINAPI HTMLStyle_put_paddingTop(IHTMLStyle *iface, VARIANT v)
1267 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1268 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1269 return E_NOTIMPL;
1272 static HRESULT WINAPI HTMLStyle_get_paddingTop(IHTMLStyle *iface, VARIANT *p)
1274 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1275 FIXME("(%p)->(%p)\n", This, p);
1276 return E_NOTIMPL;
1279 static HRESULT WINAPI HTMLStyle_put_paddingRight(IHTMLStyle *iface, VARIANT v)
1281 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1282 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1283 return E_NOTIMPL;
1286 static HRESULT WINAPI HTMLStyle_get_paddingRight(IHTMLStyle *iface, VARIANT *p)
1288 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1289 FIXME("(%p)->(%p)\n", This, p);
1290 return E_NOTIMPL;
1293 static HRESULT WINAPI HTMLStyle_put_paddingBottom(IHTMLStyle *iface, VARIANT v)
1295 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1296 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1297 return E_NOTIMPL;
1300 static HRESULT WINAPI HTMLStyle_get_paddingBottom(IHTMLStyle *iface, VARIANT *p)
1302 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1303 FIXME("(%p)->(%p)\n", This, p);
1304 return E_NOTIMPL;
1307 static HRESULT WINAPI HTMLStyle_put_paddingLeft(IHTMLStyle *iface, VARIANT v)
1309 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1311 TRACE("(%p)->(vt=%d)\n", This, V_VT(&v));
1313 switch(V_VT(&v)) {
1314 case VT_I4: {
1315 WCHAR buf[14];
1317 wsprintfW(buf, px_formatW, V_I4(&v));
1318 return set_style_attr(This, STYLEID_PADDING_LEFT, buf, 0);
1320 case VT_BSTR:
1321 return set_style_attr(This, STYLEID_PADDING_LEFT, V_BSTR(&v), 0);
1322 default:
1323 FIXME("unsupported vt=%d\n", V_VT(&v));
1326 return E_NOTIMPL;
1329 static HRESULT WINAPI HTMLStyle_get_paddingLeft(IHTMLStyle *iface, VARIANT *p)
1331 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1332 BSTR ret;
1333 HRESULT hres;
1335 TRACE("(%p)->(%p)\n", This, p);
1337 hres = get_style_attr(This, STYLEID_PADDING_LEFT, &ret);
1338 if(FAILED(hres))
1339 return hres;
1341 V_VT(p) = VT_BSTR;
1342 V_BSTR(p) = ret;
1343 return S_OK;
1346 static HRESULT WINAPI HTMLStyle_put_padding(IHTMLStyle *iface, BSTR v)
1348 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1349 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1350 return E_NOTIMPL;
1353 static HRESULT WINAPI HTMLStyle_get_padding(IHTMLStyle *iface, BSTR *p)
1355 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1356 FIXME("(%p)->(%p)\n", This, p);
1357 return E_NOTIMPL;
1360 static HRESULT WINAPI HTMLStyle_put_border(IHTMLStyle *iface, BSTR v)
1362 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1364 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1366 return set_style_attr(This, STYLEID_BORDER, v, 0);
1369 static HRESULT WINAPI HTMLStyle_get_border(IHTMLStyle *iface, BSTR *p)
1371 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1373 TRACE("(%p)->(%p)\n", This, p);
1375 return get_style_attr(This, STYLEID_BORDER, p);
1378 static HRESULT WINAPI HTMLStyle_put_borderTop(IHTMLStyle *iface, BSTR v)
1380 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1381 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1382 return E_NOTIMPL;
1385 static HRESULT WINAPI HTMLStyle_get_borderTop(IHTMLStyle *iface, BSTR *p)
1387 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1388 FIXME("(%p)->(%p)\n", This, p);
1389 return E_NOTIMPL;
1392 static HRESULT WINAPI HTMLStyle_put_borderRight(IHTMLStyle *iface, BSTR v)
1394 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1395 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1396 return E_NOTIMPL;
1399 static HRESULT WINAPI HTMLStyle_get_borderRight(IHTMLStyle *iface, BSTR *p)
1401 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1402 FIXME("(%p)->(%p)\n", This, p);
1403 return E_NOTIMPL;
1406 static HRESULT WINAPI HTMLStyle_put_borderBottom(IHTMLStyle *iface, BSTR v)
1408 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1409 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1410 return E_NOTIMPL;
1413 static HRESULT WINAPI HTMLStyle_get_borderBottom(IHTMLStyle *iface, BSTR *p)
1415 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1416 FIXME("(%p)->(%p)\n", This, p);
1417 return E_NOTIMPL;
1420 static HRESULT WINAPI HTMLStyle_put_borderLeft(IHTMLStyle *iface, BSTR v)
1422 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1424 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1426 return set_style_attr(This, STYLEID_BORDER_LEFT, v, ATTR_FIX_PX);
1429 static HRESULT WINAPI HTMLStyle_get_borderLeft(IHTMLStyle *iface, BSTR *p)
1431 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1433 TRACE("(%p)->(%p)\n", This, p);
1435 return get_style_attr(This, STYLEID_BORDER_LEFT, p);
1438 static HRESULT WINAPI HTMLStyle_put_borderColor(IHTMLStyle *iface, BSTR v)
1440 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1442 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1444 return set_style_attr(This, STYLEID_BORDER_COLOR, v, 0);
1447 static HRESULT WINAPI HTMLStyle_get_borderColor(IHTMLStyle *iface, BSTR *p)
1449 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1451 TRACE("(%p)->(%p)\n", This, p);
1453 return get_style_attr(This, STYLEID_BORDER_COLOR, p);
1456 static HRESULT WINAPI HTMLStyle_put_borderTopColor(IHTMLStyle *iface, VARIANT v)
1458 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1459 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1460 return E_NOTIMPL;
1463 static HRESULT WINAPI HTMLStyle_get_borderTopColor(IHTMLStyle *iface, VARIANT *p)
1465 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1466 FIXME("(%p)->(%p)\n", This, p);
1467 return E_NOTIMPL;
1470 static HRESULT WINAPI HTMLStyle_put_borderRightColor(IHTMLStyle *iface, VARIANT v)
1472 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1473 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1474 return E_NOTIMPL;
1477 static HRESULT WINAPI HTMLStyle_get_borderRightColor(IHTMLStyle *iface, VARIANT *p)
1479 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1480 FIXME("(%p)->(%p)\n", This, p);
1481 return E_NOTIMPL;
1484 static HRESULT WINAPI HTMLStyle_put_borderBottomColor(IHTMLStyle *iface, VARIANT v)
1486 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1487 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1488 return E_NOTIMPL;
1491 static HRESULT WINAPI HTMLStyle_get_borderBottomColor(IHTMLStyle *iface, VARIANT *p)
1493 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1494 FIXME("(%p)->(%p)\n", This, p);
1495 return E_NOTIMPL;
1498 static HRESULT WINAPI HTMLStyle_put_borderLeftColor(IHTMLStyle *iface, VARIANT v)
1500 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1501 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1502 return E_NOTIMPL;
1505 static HRESULT WINAPI HTMLStyle_get_borderLeftColor(IHTMLStyle *iface, VARIANT *p)
1507 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1508 FIXME("(%p)->(%p)\n", This, p);
1509 return E_NOTIMPL;
1512 static HRESULT WINAPI HTMLStyle_put_borderWidth(IHTMLStyle *iface, BSTR v)
1514 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1515 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1516 return set_style_attr(This, STYLEID_BORDER_WIDTH, v, ATTR_FIX_PX);
1519 static HRESULT WINAPI HTMLStyle_get_borderWidth(IHTMLStyle *iface, BSTR *p)
1521 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1522 TRACE("(%p)->(%p)\n", This, p);
1523 return get_style_attr(This, STYLEID_BORDER_WIDTH, p);
1526 static HRESULT WINAPI HTMLStyle_put_borderTopWidth(IHTMLStyle *iface, VARIANT v)
1528 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1529 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
1530 return set_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_TOP_WIDTH, &v, 0);
1533 static HRESULT WINAPI HTMLStyle_get_borderTopWidth(IHTMLStyle *iface, VARIANT *p)
1535 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1537 TRACE("(%p)->(%p)\n", This, p);
1539 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_TOP_WIDTH, p, 0);
1542 static HRESULT WINAPI HTMLStyle_put_borderRightWidth(IHTMLStyle *iface, VARIANT v)
1544 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1545 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
1546 return set_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_RIGHT_WIDTH, &v, 0);
1549 static HRESULT WINAPI HTMLStyle_get_borderRightWidth(IHTMLStyle *iface, VARIANT *p)
1551 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1552 TRACE("(%p)->(%p)\n", This, p);
1553 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_RIGHT_WIDTH, p, 0);
1556 static HRESULT WINAPI HTMLStyle_put_borderBottomWidth(IHTMLStyle *iface, VARIANT v)
1558 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1560 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
1561 return set_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_BOTTOM_WIDTH, &v, 0);
1564 static HRESULT WINAPI HTMLStyle_get_borderBottomWidth(IHTMLStyle *iface, VARIANT *p)
1566 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1567 TRACE("(%p)->(%p)\n", This, p);
1568 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_BOTTOM_WIDTH, p, 0);
1571 static HRESULT WINAPI HTMLStyle_put_borderLeftWidth(IHTMLStyle *iface, VARIANT v)
1573 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1574 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1575 return E_NOTIMPL;
1578 static HRESULT WINAPI HTMLStyle_get_borderLeftWidth(IHTMLStyle *iface, VARIANT *p)
1580 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1581 FIXME("(%p)->(%p)\n", This, p);
1582 return E_NOTIMPL;
1585 static HRESULT WINAPI HTMLStyle_put_borderStyle(IHTMLStyle *iface, BSTR v)
1587 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1588 static const WCHAR styleWindowInset[] = {'w','i','n','d','o','w','-','i','n','s','e','t',0};
1589 HRESULT hres = S_OK;
1590 BSTR pstyle;
1591 int i=0;
1592 int last = 0;
1594 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1596 while(v[i] && hres == S_OK)
1598 if(v[i] == (WCHAR)' ')
1600 pstyle = SysAllocStringLen(&v[last], (i-last));
1601 if( !(is_valid_border_style(pstyle) || strcmpiW(styleWindowInset, pstyle) == 0))
1603 TRACE("1. Invalid style (%s)\n", debugstr_w(pstyle));
1604 hres = E_INVALIDARG;
1606 SysFreeString(pstyle);
1607 last = i+1;
1609 i++;
1612 if(hres == S_OK)
1614 pstyle = SysAllocStringLen(&v[last], i-last);
1615 if( !(is_valid_border_style(pstyle) || strcmpiW(styleWindowInset, pstyle) == 0))
1617 TRACE("2. Invalid style (%s)\n", debugstr_w(pstyle));
1618 hres = E_INVALIDARG;
1620 SysFreeString(pstyle);
1623 if(hres == S_OK)
1624 hres = set_nsstyle_attr(This->nsstyle, STYLEID_BORDER_STYLE, v, 0);
1626 return hres;
1629 static HRESULT WINAPI HTMLStyle_get_borderStyle(IHTMLStyle *iface, BSTR *p)
1631 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1632 TRACE("(%p)->(%p)\n", This, p);
1633 return get_style_attr(This, STYLEID_BORDER_STYLE, p);
1636 static HRESULT WINAPI HTMLStyle_put_borderTopStyle(IHTMLStyle *iface, BSTR v)
1638 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1639 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1641 if(!is_valid_border_style(v))
1642 return E_INVALIDARG;
1644 return set_style_attr(This, STYLEID_BORDER_TOP_STYLE, v, 0);
1647 static HRESULT WINAPI HTMLStyle_get_borderTopStyle(IHTMLStyle *iface, BSTR *p)
1649 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1650 TRACE("(%p)->(%p)\n", This, p);
1651 return get_style_attr(This, STYLEID_BORDER_TOP_STYLE, p);
1654 static HRESULT WINAPI HTMLStyle_put_borderRightStyle(IHTMLStyle *iface, BSTR v)
1656 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1657 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1659 if(!is_valid_border_style(v))
1660 return E_INVALIDARG;
1662 return set_style_attr(This, STYLEID_BORDER_RIGHT_STYLE, v, 0);
1665 static HRESULT WINAPI HTMLStyle_get_borderRightStyle(IHTMLStyle *iface, BSTR *p)
1667 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1668 TRACE("(%p)->(%p)\n", This, p);
1669 return get_style_attr(This, STYLEID_BORDER_RIGHT_STYLE, p);
1672 static HRESULT WINAPI HTMLStyle_put_borderBottomStyle(IHTMLStyle *iface, BSTR v)
1674 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1675 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1677 if(!is_valid_border_style(v))
1678 return E_INVALIDARG;
1680 return set_style_attr(This, STYLEID_BORDER_BOTTOM_STYLE, v, 0);
1683 static HRESULT WINAPI HTMLStyle_get_borderBottomStyle(IHTMLStyle *iface, BSTR *p)
1685 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1686 TRACE("(%p)->(%p)\n", This, p);
1687 return get_style_attr(This, STYLEID_BORDER_BOTTOM_STYLE, p);
1690 static HRESULT WINAPI HTMLStyle_put_borderLeftStyle(IHTMLStyle *iface, BSTR v)
1692 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1693 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1695 if(!is_valid_border_style(v))
1696 return E_INVALIDARG;
1698 return set_style_attr(This, STYLEID_BORDER_LEFT_STYLE, v, 0);
1701 static HRESULT WINAPI HTMLStyle_get_borderLeftStyle(IHTMLStyle *iface, BSTR *p)
1703 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1704 TRACE("(%p)->(%p)\n", This, p);
1705 return get_style_attr(This, STYLEID_BORDER_LEFT_STYLE, p);
1708 static HRESULT WINAPI HTMLStyle_put_width(IHTMLStyle *iface, VARIANT v)
1710 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1712 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
1714 switch(V_VT(&v)) {
1715 case VT_BSTR:
1716 TRACE("%s\n", debugstr_w(V_BSTR(&v)));
1717 return set_style_attr(This, STYLEID_WIDTH, V_BSTR(&v), 0);
1718 default:
1719 FIXME("unsupported vt %d\n", V_VT(&v));
1722 return E_NOTIMPL;
1725 static HRESULT WINAPI HTMLStyle_get_width(IHTMLStyle *iface, VARIANT *p)
1727 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1729 TRACE("(%p)->(%p)\n", This, p);
1731 V_VT(p) = VT_BSTR;
1732 return get_style_attr(This, STYLEID_WIDTH, &V_BSTR(p));
1735 static HRESULT WINAPI HTMLStyle_put_height(IHTMLStyle *iface, VARIANT v)
1737 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1739 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1741 switch(V_VT(&v)) {
1742 case VT_BSTR:
1743 return set_style_attr(This, STYLEID_HEIGHT, V_BSTR(&v), 0);
1744 default:
1745 FIXME("unimplemented vt %d\n", V_VT(&v));
1746 return E_NOTIMPL;
1749 return S_OK;
1752 static HRESULT WINAPI HTMLStyle_get_height(IHTMLStyle *iface, VARIANT *p)
1754 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1755 BSTR ret;
1756 HRESULT hres;
1758 TRACE("(%p)->(%p)\n", This, p);
1760 hres = get_style_attr(This, STYLEID_HEIGHT, &ret);
1761 if(FAILED(hres))
1762 return hres;
1764 V_VT(p) = VT_BSTR;
1765 V_BSTR(p) = ret;
1766 return S_OK;
1769 static HRESULT WINAPI HTMLStyle_put_styleFloat(IHTMLStyle *iface, BSTR v)
1771 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1772 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1773 return E_NOTIMPL;
1776 static HRESULT WINAPI HTMLStyle_get_styleFloat(IHTMLStyle *iface, BSTR *p)
1778 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1779 FIXME("(%p)->(%p)\n", This, p);
1780 return E_NOTIMPL;
1783 static HRESULT WINAPI HTMLStyle_put_clear(IHTMLStyle *iface, BSTR v)
1785 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1786 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1787 return E_NOTIMPL;
1790 static HRESULT WINAPI HTMLStyle_get_clear(IHTMLStyle *iface, BSTR *p)
1792 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1793 FIXME("(%p)->(%p)\n", This, p);
1794 return E_NOTIMPL;
1797 static HRESULT WINAPI HTMLStyle_put_display(IHTMLStyle *iface, BSTR v)
1799 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1801 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1803 return set_style_attr(This, STYLEID_DISPLAY, v, 0);
1806 static HRESULT WINAPI HTMLStyle_get_display(IHTMLStyle *iface, BSTR *p)
1808 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1810 TRACE("(%p)->(%p)\n", This, p);
1812 return get_style_attr(This, STYLEID_DISPLAY, p);
1815 static HRESULT WINAPI HTMLStyle_put_visibility(IHTMLStyle *iface, BSTR v)
1817 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1819 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1821 return set_style_attr(This, STYLEID_VISIBILITY, v, 0);
1824 static HRESULT WINAPI HTMLStyle_get_visibility(IHTMLStyle *iface, BSTR *p)
1826 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1828 TRACE("(%p)->(%p)\n", This, p);
1830 return get_style_attr(This, STYLEID_VISIBILITY, p);
1833 static HRESULT WINAPI HTMLStyle_put_listStyleType(IHTMLStyle *iface, BSTR v)
1835 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1836 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1837 return E_NOTIMPL;
1840 static HRESULT WINAPI HTMLStyle_get_listStyleType(IHTMLStyle *iface, BSTR *p)
1842 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1843 FIXME("(%p)->(%p)\n", This, p);
1844 return E_NOTIMPL;
1847 static HRESULT WINAPI HTMLStyle_put_listStylePosition(IHTMLStyle *iface, BSTR v)
1849 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1850 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1851 return E_NOTIMPL;
1854 static HRESULT WINAPI HTMLStyle_get_listStylePosition(IHTMLStyle *iface, BSTR *p)
1856 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1857 FIXME("(%p)->(%p)\n", This, p);
1858 return E_NOTIMPL;
1861 static HRESULT WINAPI HTMLStyle_put_listStyleImage(IHTMLStyle *iface, BSTR v)
1863 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1864 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1865 return E_NOTIMPL;
1868 static HRESULT WINAPI HTMLStyle_get_listStyleImage(IHTMLStyle *iface, BSTR *p)
1870 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1871 FIXME("(%p)->(%p)\n", This, p);
1872 return E_NOTIMPL;
1875 static HRESULT WINAPI HTMLStyle_put_listStyle(IHTMLStyle *iface, BSTR v)
1877 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1878 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1879 return E_NOTIMPL;
1882 static HRESULT WINAPI HTMLStyle_get_listStyle(IHTMLStyle *iface, BSTR *p)
1884 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1885 FIXME("(%p)->(%p)\n", This, p);
1886 return E_NOTIMPL;
1889 static HRESULT WINAPI HTMLStyle_put_whiteSpace(IHTMLStyle *iface, BSTR v)
1891 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1892 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1893 return E_NOTIMPL;
1896 static HRESULT WINAPI HTMLStyle_get_whiteSpace(IHTMLStyle *iface, BSTR *p)
1898 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1899 FIXME("(%p)->(%p)\n", This, p);
1900 return E_NOTIMPL;
1903 static HRESULT WINAPI HTMLStyle_put_top(IHTMLStyle *iface, VARIANT v)
1905 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1907 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1909 return set_nsstyle_attr_var(This->nsstyle, STYLEID_TOP, &v, 0);
1912 static HRESULT WINAPI HTMLStyle_get_top(IHTMLStyle *iface, VARIANT *p)
1914 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1915 BSTR ret;
1916 HRESULT hres;
1918 TRACE("(%p)->(%p)\n", This, p);
1920 hres = get_style_attr(This, STYLEID_TOP, &ret);
1921 if(FAILED(hres))
1922 return hres;
1924 V_VT(p) = VT_BSTR;
1925 V_BSTR(p) = ret;
1926 return S_OK;
1929 static HRESULT WINAPI HTMLStyle_put_left(IHTMLStyle *iface, VARIANT v)
1931 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1933 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1935 return set_nsstyle_attr_var(This->nsstyle, STYLEID_LEFT, &v, 0);
1938 static HRESULT WINAPI HTMLStyle_get_left(IHTMLStyle *iface, VARIANT *p)
1940 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1941 BSTR ret;
1942 HRESULT hres;
1944 TRACE("(%p)->(%p)\n", This, p);
1946 hres = get_style_attr(This, STYLEID_LEFT, &ret);
1947 if(FAILED(hres))
1948 return hres;
1950 V_VT(p) = VT_BSTR;
1951 V_BSTR(p) = ret;
1952 return S_OK;
1955 static HRESULT WINAPI HTMLStyle_get_position(IHTMLStyle *iface, BSTR *p)
1957 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1958 TRACE("(%p)->(%p)\n", This, p);
1959 return IHTMLStyle2_get_position(HTMLSTYLE2(This), p);
1962 static HRESULT WINAPI HTMLStyle_put_zIndex(IHTMLStyle *iface, VARIANT v)
1964 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1966 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1968 switch(V_VT(&v)) {
1969 case VT_BSTR:
1970 return set_style_attr(This, STYLEID_Z_INDEX, V_BSTR(&v), 0);
1971 case VT_I4: {
1972 WCHAR value[14];
1973 static const WCHAR format[] = {'%','d',0};
1975 wsprintfW(value, format, V_I4(&v));
1976 return set_style_attr(This, STYLEID_Z_INDEX, value, 0);
1978 default:
1979 FIXME("unimplemented vt %d\n", V_VT(&v));
1980 return E_NOTIMPL;
1983 return S_OK;
1986 static HRESULT WINAPI HTMLStyle_get_zIndex(IHTMLStyle *iface, VARIANT *p)
1988 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1990 TRACE("(%p)->(%p)\n", This, p);
1992 return get_nsstyle_attr_var(This->nsstyle, STYLEID_Z_INDEX, p, ATTR_STR_TO_INT);
1995 static HRESULT WINAPI HTMLStyle_put_overflow(IHTMLStyle *iface, BSTR v)
1997 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1998 static const WCHAR szVisible[] = {'v','i','s','i','b','l','e',0};
1999 static const WCHAR szScroll[] = {'s','c','r','o','l','l',0};
2000 static const WCHAR szHidden[] = {'h','i','d','d','e','n',0};
2001 static const WCHAR szAuto[] = {'a','u','t','o',0};
2003 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2005 /* overflow can only be one of the follow values. */
2006 if(!v || strcmpiW(szVisible, v) == 0 || strcmpiW(szScroll, v) == 0 ||
2007 strcmpiW(szHidden, v) == 0 || strcmpiW(szAuto, v) == 0)
2009 return set_nsstyle_attr(This->nsstyle, STYLEID_OVERFLOW, v, 0);
2012 return E_INVALIDARG;
2016 static HRESULT WINAPI HTMLStyle_get_overflow(IHTMLStyle *iface, BSTR *p)
2018 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2020 TRACE("(%p)->(%p)\n", This, p);
2022 if(!p)
2023 return E_INVALIDARG;
2025 return get_style_attr(This, STYLEID_OVERFLOW, p);
2028 static HRESULT WINAPI HTMLStyle_put_pageBreakBefore(IHTMLStyle *iface, BSTR v)
2030 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2031 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
2032 return E_NOTIMPL;
2035 static HRESULT WINAPI HTMLStyle_get_pageBreakBefore(IHTMLStyle *iface, BSTR *p)
2037 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2038 FIXME("(%p)->(%p)\n", This, p);
2039 return E_NOTIMPL;
2042 static HRESULT WINAPI HTMLStyle_put_pageBreakAfter(IHTMLStyle *iface, BSTR v)
2044 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2045 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
2046 return E_NOTIMPL;
2049 static HRESULT WINAPI HTMLStyle_get_pageBreakAfter(IHTMLStyle *iface, BSTR *p)
2051 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2052 FIXME("(%p)->(%p)\n", This, p);
2053 return E_NOTIMPL;
2056 static HRESULT WINAPI HTMLStyle_put_cssText(IHTMLStyle *iface, BSTR v)
2058 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2059 nsAString text_str;
2060 nsresult nsres;
2062 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2064 nsAString_Init(&text_str, v);
2065 nsres = nsIDOMCSSStyleDeclaration_SetCssText(This->nsstyle, &text_str);
2066 nsAString_Finish(&text_str);
2067 if(NS_FAILED(nsres)) {
2068 FIXME("SetCssStyle failed: %08x\n", nsres);
2069 return E_FAIL;
2072 return S_OK;
2075 static HRESULT WINAPI HTMLStyle_get_cssText(IHTMLStyle *iface, BSTR *p)
2077 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2078 nsAString text_str;
2079 nsresult nsres;
2081 TRACE("(%p)->(%p)\n", This, p);
2083 /* FIXME: Gecko style formatting is different than IE (uppercase). */
2084 nsAString_Init(&text_str, NULL);
2085 nsres = nsIDOMCSSStyleDeclaration_GetCssText(This->nsstyle, &text_str);
2086 if(NS_SUCCEEDED(nsres)) {
2087 const PRUnichar *text;
2089 nsAString_GetData(&text_str, &text);
2090 *p = *text ? SysAllocString(text) : NULL;
2091 }else {
2092 FIXME("GetCssStyle failed: %08x\n", nsres);
2093 *p = NULL;
2096 nsAString_Finish(&text_str);
2097 return S_OK;
2100 static HRESULT WINAPI HTMLStyle_put_pixelTop(IHTMLStyle *iface, LONG v)
2102 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2103 FIXME("(%p)->()\n", This);
2104 return E_NOTIMPL;
2107 static HRESULT WINAPI HTMLStyle_get_pixelTop(IHTMLStyle *iface, LONG *p)
2109 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2110 FIXME("(%p)->()\n", This);
2111 return E_NOTIMPL;
2114 static HRESULT WINAPI HTMLStyle_put_pixelLeft(IHTMLStyle *iface, LONG v)
2116 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2117 FIXME("(%p)->()\n", This);
2118 return E_NOTIMPL;
2121 static HRESULT WINAPI HTMLStyle_get_pixelLeft(IHTMLStyle *iface, LONG *p)
2123 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2124 FIXME("(%p)->()\n", This);
2125 return E_NOTIMPL;
2128 static HRESULT WINAPI HTMLStyle_put_pixelWidth(IHTMLStyle *iface, LONG v)
2130 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2131 FIXME("(%p)->()\n", This);
2132 return E_NOTIMPL;
2135 static HRESULT WINAPI HTMLStyle_get_pixelWidth(IHTMLStyle *iface, LONG *p)
2137 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2138 FIXME("(%p)->()\n", This);
2139 return E_NOTIMPL;
2142 static HRESULT WINAPI HTMLStyle_put_pixelHeight(IHTMLStyle *iface, LONG v)
2144 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2145 FIXME("(%p)->()\n", This);
2146 return E_NOTIMPL;
2149 static HRESULT WINAPI HTMLStyle_get_pixelHeight(IHTMLStyle *iface, LONG *p)
2151 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2152 FIXME("(%p)->()\n", This);
2153 return E_NOTIMPL;
2156 static HRESULT WINAPI HTMLStyle_put_posTop(IHTMLStyle *iface, float v)
2158 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2160 TRACE("(%p)->(%f)\n", This, v);
2162 return set_style_pos(This, STYLEID_TOP, v);
2165 static HRESULT WINAPI HTMLStyle_get_posTop(IHTMLStyle *iface, float *p)
2167 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2169 TRACE("(%p)->(%p)\n", This, p);
2171 if(!p)
2172 return E_POINTER;
2174 return get_nsstyle_pos(This, STYLEID_TOP, p);
2177 static HRESULT WINAPI HTMLStyle_put_posLeft(IHTMLStyle *iface, float v)
2179 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2181 TRACE("(%p)->(%f)\n", This, v);
2183 return set_style_pos(This, STYLEID_LEFT, v);
2186 static HRESULT WINAPI HTMLStyle_get_posLeft(IHTMLStyle *iface, float *p)
2188 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2190 TRACE("(%p)->(%p)\n", This, p);
2192 if(!p)
2193 return E_POINTER;
2195 return get_nsstyle_pos(This, STYLEID_LEFT, p);
2198 static HRESULT WINAPI HTMLStyle_put_posWidth(IHTMLStyle *iface, float v)
2200 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2202 TRACE("(%p)->(%f)\n", This, v);
2204 return set_style_pos(This, STYLEID_WIDTH, v);
2207 static HRESULT WINAPI HTMLStyle_get_posWidth(IHTMLStyle *iface, float *p)
2209 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2211 TRACE("(%p)->(%p)\n", This, p);
2213 if(!p)
2214 return E_POINTER;
2216 if(get_nsstyle_pos(This, STYLEID_WIDTH, p) != S_OK)
2217 *p = 0.0f;
2219 return S_OK;
2222 static HRESULT WINAPI HTMLStyle_put_posHeight(IHTMLStyle *iface, float v)
2224 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2226 TRACE("(%p)->(%f)\n", This, v);
2228 return set_style_pos(This, STYLEID_HEIGHT, v);
2231 static HRESULT WINAPI HTMLStyle_get_posHeight(IHTMLStyle *iface, float *p)
2233 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2235 TRACE("(%p)->(%p)\n", This, p);
2237 if(!p)
2238 return E_POINTER;
2240 if(get_nsstyle_pos(This, STYLEID_HEIGHT, p) != S_OK)
2241 *p = 0.0f;
2243 return S_OK;
2246 static HRESULT WINAPI HTMLStyle_put_cursor(IHTMLStyle *iface, BSTR v)
2248 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2250 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2252 return set_style_attr(This, STYLEID_CURSOR, v, 0);
2255 static HRESULT WINAPI HTMLStyle_get_cursor(IHTMLStyle *iface, BSTR *p)
2257 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2259 TRACE("(%p)->(%p)\n", This, p);
2261 return get_style_attr(This, STYLEID_CURSOR, p);
2264 static HRESULT WINAPI HTMLStyle_put_clip(IHTMLStyle *iface, BSTR v)
2266 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2267 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
2268 return E_NOTIMPL;
2271 static HRESULT WINAPI HTMLStyle_get_clip(IHTMLStyle *iface, BSTR *p)
2273 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2274 FIXME("(%p)->(%p)\n", This, p);
2275 return E_NOTIMPL;
2278 static HRESULT WINAPI HTMLStyle_put_filter(IHTMLStyle *iface, BSTR v)
2280 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2282 WARN("(%p)->(%s)\n", This, debugstr_w(v));
2284 /* FIXME: Handle MS-style filters */
2285 return set_style_attr(This, STYLEID_FILTER, v, 0);
2288 static HRESULT WINAPI HTMLStyle_get_filter(IHTMLStyle *iface, BSTR *p)
2290 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2292 WARN("(%p)->(%p)\n", This, p);
2294 /* FIXME: Handle MS-style filters */
2295 return get_style_attr(This, STYLEID_FILTER, p);
2298 static HRESULT WINAPI HTMLStyle_setAttribute(IHTMLStyle *iface, BSTR strAttributeName,
2299 VARIANT AttributeValue, LONG lFlags)
2301 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2302 HRESULT hres;
2303 DISPID dispid;
2305 TRACE("(%p)->(%s v%d %08x)\n", This, debugstr_w(strAttributeName),
2306 V_VT(&AttributeValue), lFlags);
2308 if(!strAttributeName)
2309 return E_INVALIDARG;
2311 if(lFlags == 1)
2312 FIXME("Parameter lFlags ignored\n");
2314 hres = HTMLStyle_GetIDsOfNames(iface, &IID_NULL, &strAttributeName, 1,
2315 LOCALE_USER_DEFAULT, &dispid);
2316 if(hres == S_OK)
2318 VARIANT ret;
2319 DISPID dispidNamed = DISPID_PROPERTYPUT;
2320 DISPPARAMS params;
2322 params.cArgs = 1;
2323 params.rgvarg = &AttributeValue;
2324 params.cNamedArgs = 1;
2325 params.rgdispidNamedArgs = &dispidNamed;
2327 hres = HTMLStyle_Invoke(iface, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
2328 DISPATCH_PROPERTYPUT, &params, &ret, NULL, NULL);
2330 else
2332 FIXME("Custom attributes not supported.\n");
2335 TRACE("ret: %08x\n", hres);
2337 return hres;
2340 static HRESULT WINAPI HTMLStyle_getAttribute(IHTMLStyle *iface, BSTR strAttributeName,
2341 LONG lFlags, VARIANT *AttributeValue)
2343 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2344 HRESULT hres;
2345 DISPID dispid;
2347 TRACE("(%p)->(%s v%p %08x)\n", This, debugstr_w(strAttributeName),
2348 AttributeValue, lFlags);
2350 if(!AttributeValue || !strAttributeName)
2351 return E_INVALIDARG;
2353 if(lFlags == 1)
2354 FIXME("Parameter lFlags ignored\n");
2356 hres = HTMLStyle_GetIDsOfNames(iface, &IID_NULL, &strAttributeName, 1,
2357 LOCALE_USER_DEFAULT, &dispid);
2358 if(hres == S_OK)
2360 DISPPARAMS params = {NULL, NULL, 0, 0 };
2362 hres = HTMLStyle_Invoke(iface, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
2363 DISPATCH_PROPERTYGET, &params, AttributeValue, NULL, NULL);
2365 else
2367 FIXME("Custom attributes not supported.\n");
2370 return hres;
2373 static HRESULT WINAPI HTMLStyle_removeAttribute(IHTMLStyle *iface, BSTR strAttributeName,
2374 LONG lFlags, VARIANT_BOOL *pfSuccess)
2376 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2377 FIXME("(%p)->(%s %08x %p)\n", This, debugstr_w(strAttributeName),
2378 lFlags, pfSuccess);
2379 return E_NOTIMPL;
2382 static HRESULT WINAPI HTMLStyle_toString(IHTMLStyle *iface, BSTR *String)
2384 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2385 FIXME("(%p)->(%p)\n", This, String);
2386 return E_NOTIMPL;
2389 static HRESULT HTMLStyle_get_dispid(IUnknown *iface, BSTR name, DWORD flags, DISPID *dispid)
2391 int c, i, min=0, max = sizeof(style_tbl)/sizeof(*style_tbl)-1;
2393 while(min <= max) {
2394 i = (min+max)/2;
2396 c = strcmpW(style_tbl[i].name, name);
2397 if(!c) {
2398 *dispid = style_tbl[i].dispid;
2399 return S_OK;
2402 if(c > 0)
2403 max = i-1;
2404 else
2405 min = i+1;
2408 return DISP_E_UNKNOWNNAME;
2411 static const IHTMLStyleVtbl HTMLStyleVtbl = {
2412 HTMLStyle_QueryInterface,
2413 HTMLStyle_AddRef,
2414 HTMLStyle_Release,
2415 HTMLStyle_GetTypeInfoCount,
2416 HTMLStyle_GetTypeInfo,
2417 HTMLStyle_GetIDsOfNames,
2418 HTMLStyle_Invoke,
2419 HTMLStyle_put_fontFamily,
2420 HTMLStyle_get_fontFamily,
2421 HTMLStyle_put_fontStyle,
2422 HTMLStyle_get_fontStyle,
2423 HTMLStyle_put_fontVariant,
2424 HTMLStyle_get_fontVariant,
2425 HTMLStyle_put_fontWeight,
2426 HTMLStyle_get_fontWeight,
2427 HTMLStyle_put_fontSize,
2428 HTMLStyle_get_fontSize,
2429 HTMLStyle_put_font,
2430 HTMLStyle_get_font,
2431 HTMLStyle_put_color,
2432 HTMLStyle_get_color,
2433 HTMLStyle_put_background,
2434 HTMLStyle_get_background,
2435 HTMLStyle_put_backgroundColor,
2436 HTMLStyle_get_backgroundColor,
2437 HTMLStyle_put_backgroundImage,
2438 HTMLStyle_get_backgroundImage,
2439 HTMLStyle_put_backgroundRepeat,
2440 HTMLStyle_get_backgroundRepeat,
2441 HTMLStyle_put_backgroundAttachment,
2442 HTMLStyle_get_backgroundAttachment,
2443 HTMLStyle_put_backgroundPosition,
2444 HTMLStyle_get_backgroundPosition,
2445 HTMLStyle_put_backgroundPositionX,
2446 HTMLStyle_get_backgroundPositionX,
2447 HTMLStyle_put_backgroundPositionY,
2448 HTMLStyle_get_backgroundPositionY,
2449 HTMLStyle_put_wordSpacing,
2450 HTMLStyle_get_wordSpacing,
2451 HTMLStyle_put_letterSpacing,
2452 HTMLStyle_get_letterSpacing,
2453 HTMLStyle_put_textDecoration,
2454 HTMLStyle_get_textDecoration,
2455 HTMLStyle_put_textDecorationNone,
2456 HTMLStyle_get_textDecorationNone,
2457 HTMLStyle_put_textDecorationUnderline,
2458 HTMLStyle_get_textDecorationUnderline,
2459 HTMLStyle_put_textDecorationOverline,
2460 HTMLStyle_get_textDecorationOverline,
2461 HTMLStyle_put_textDecorationLineThrough,
2462 HTMLStyle_get_textDecorationLineThrough,
2463 HTMLStyle_put_textDecorationBlink,
2464 HTMLStyle_get_textDecorationBlink,
2465 HTMLStyle_put_verticalAlign,
2466 HTMLStyle_get_verticalAlign,
2467 HTMLStyle_put_textTransform,
2468 HTMLStyle_get_textTransform,
2469 HTMLStyle_put_textAlign,
2470 HTMLStyle_get_textAlign,
2471 HTMLStyle_put_textIndent,
2472 HTMLStyle_get_textIndent,
2473 HTMLStyle_put_lineHeight,
2474 HTMLStyle_get_lineHeight,
2475 HTMLStyle_put_marginTop,
2476 HTMLStyle_get_marginTop,
2477 HTMLStyle_put_marginRight,
2478 HTMLStyle_get_marginRight,
2479 HTMLStyle_put_marginBottom,
2480 HTMLStyle_get_marginBottom,
2481 HTMLStyle_put_marginLeft,
2482 HTMLStyle_get_marginLeft,
2483 HTMLStyle_put_margin,
2484 HTMLStyle_get_margin,
2485 HTMLStyle_put_paddingTop,
2486 HTMLStyle_get_paddingTop,
2487 HTMLStyle_put_paddingRight,
2488 HTMLStyle_get_paddingRight,
2489 HTMLStyle_put_paddingBottom,
2490 HTMLStyle_get_paddingBottom,
2491 HTMLStyle_put_paddingLeft,
2492 HTMLStyle_get_paddingLeft,
2493 HTMLStyle_put_padding,
2494 HTMLStyle_get_padding,
2495 HTMLStyle_put_border,
2496 HTMLStyle_get_border,
2497 HTMLStyle_put_borderTop,
2498 HTMLStyle_get_borderTop,
2499 HTMLStyle_put_borderRight,
2500 HTMLStyle_get_borderRight,
2501 HTMLStyle_put_borderBottom,
2502 HTMLStyle_get_borderBottom,
2503 HTMLStyle_put_borderLeft,
2504 HTMLStyle_get_borderLeft,
2505 HTMLStyle_put_borderColor,
2506 HTMLStyle_get_borderColor,
2507 HTMLStyle_put_borderTopColor,
2508 HTMLStyle_get_borderTopColor,
2509 HTMLStyle_put_borderRightColor,
2510 HTMLStyle_get_borderRightColor,
2511 HTMLStyle_put_borderBottomColor,
2512 HTMLStyle_get_borderBottomColor,
2513 HTMLStyle_put_borderLeftColor,
2514 HTMLStyle_get_borderLeftColor,
2515 HTMLStyle_put_borderWidth,
2516 HTMLStyle_get_borderWidth,
2517 HTMLStyle_put_borderTopWidth,
2518 HTMLStyle_get_borderTopWidth,
2519 HTMLStyle_put_borderRightWidth,
2520 HTMLStyle_get_borderRightWidth,
2521 HTMLStyle_put_borderBottomWidth,
2522 HTMLStyle_get_borderBottomWidth,
2523 HTMLStyle_put_borderLeftWidth,
2524 HTMLStyle_get_borderLeftWidth,
2525 HTMLStyle_put_borderStyle,
2526 HTMLStyle_get_borderStyle,
2527 HTMLStyle_put_borderTopStyle,
2528 HTMLStyle_get_borderTopStyle,
2529 HTMLStyle_put_borderRightStyle,
2530 HTMLStyle_get_borderRightStyle,
2531 HTMLStyle_put_borderBottomStyle,
2532 HTMLStyle_get_borderBottomStyle,
2533 HTMLStyle_put_borderLeftStyle,
2534 HTMLStyle_get_borderLeftStyle,
2535 HTMLStyle_put_width,
2536 HTMLStyle_get_width,
2537 HTMLStyle_put_height,
2538 HTMLStyle_get_height,
2539 HTMLStyle_put_styleFloat,
2540 HTMLStyle_get_styleFloat,
2541 HTMLStyle_put_clear,
2542 HTMLStyle_get_clear,
2543 HTMLStyle_put_display,
2544 HTMLStyle_get_display,
2545 HTMLStyle_put_visibility,
2546 HTMLStyle_get_visibility,
2547 HTMLStyle_put_listStyleType,
2548 HTMLStyle_get_listStyleType,
2549 HTMLStyle_put_listStylePosition,
2550 HTMLStyle_get_listStylePosition,
2551 HTMLStyle_put_listStyleImage,
2552 HTMLStyle_get_listStyleImage,
2553 HTMLStyle_put_listStyle,
2554 HTMLStyle_get_listStyle,
2555 HTMLStyle_put_whiteSpace,
2556 HTMLStyle_get_whiteSpace,
2557 HTMLStyle_put_top,
2558 HTMLStyle_get_top,
2559 HTMLStyle_put_left,
2560 HTMLStyle_get_left,
2561 HTMLStyle_get_position,
2562 HTMLStyle_put_zIndex,
2563 HTMLStyle_get_zIndex,
2564 HTMLStyle_put_overflow,
2565 HTMLStyle_get_overflow,
2566 HTMLStyle_put_pageBreakBefore,
2567 HTMLStyle_get_pageBreakBefore,
2568 HTMLStyle_put_pageBreakAfter,
2569 HTMLStyle_get_pageBreakAfter,
2570 HTMLStyle_put_cssText,
2571 HTMLStyle_get_cssText,
2572 HTMLStyle_put_pixelTop,
2573 HTMLStyle_get_pixelTop,
2574 HTMLStyle_put_pixelLeft,
2575 HTMLStyle_get_pixelLeft,
2576 HTMLStyle_put_pixelWidth,
2577 HTMLStyle_get_pixelWidth,
2578 HTMLStyle_put_pixelHeight,
2579 HTMLStyle_get_pixelHeight,
2580 HTMLStyle_put_posTop,
2581 HTMLStyle_get_posTop,
2582 HTMLStyle_put_posLeft,
2583 HTMLStyle_get_posLeft,
2584 HTMLStyle_put_posWidth,
2585 HTMLStyle_get_posWidth,
2586 HTMLStyle_put_posHeight,
2587 HTMLStyle_get_posHeight,
2588 HTMLStyle_put_cursor,
2589 HTMLStyle_get_cursor,
2590 HTMLStyle_put_clip,
2591 HTMLStyle_get_clip,
2592 HTMLStyle_put_filter,
2593 HTMLStyle_get_filter,
2594 HTMLStyle_setAttribute,
2595 HTMLStyle_getAttribute,
2596 HTMLStyle_removeAttribute,
2597 HTMLStyle_toString
2600 static const dispex_static_data_vtbl_t HTMLStyle_dispex_vtbl = {
2601 HTMLStyle_get_dispid,
2602 NULL
2605 static const tid_t HTMLStyle_iface_tids[] = {
2606 IHTMLStyle_tid,
2607 IHTMLStyle2_tid,
2608 IHTMLStyle3_tid,
2609 IHTMLStyle4_tid,
2612 static dispex_static_data_t HTMLStyle_dispex = {
2613 &HTMLStyle_dispex_vtbl,
2614 DispHTMLStyle_tid,
2615 NULL,
2616 HTMLStyle_iface_tids
2619 IHTMLStyle *HTMLStyle_Create(nsIDOMCSSStyleDeclaration *nsstyle)
2621 HTMLStyle *ret = heap_alloc_zero(sizeof(HTMLStyle));
2623 ret->lpHTMLStyleVtbl = &HTMLStyleVtbl;
2624 ret->ref = 1;
2625 ret->nsstyle = nsstyle;
2626 HTMLStyle2_Init(ret);
2627 HTMLStyle3_Init(ret);
2629 nsIDOMCSSStyleDeclaration_AddRef(nsstyle);
2631 init_dispex(&ret->dispex, (IUnknown*)HTMLSTYLE(ret), &HTMLStyle_dispex);
2633 return HTMLSTYLE(ret);