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
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 attrBorderBottomColor[] =
53 {'b','o','r','d','e','r','-','b','o','t','t','o','m','-','c','o','l','o','r',0};
54 static const WCHAR attrBorderBottomStyle[] =
55 {'b','o','r','d','e','r','-','b','o','t','t','o','m','-','s','t','y','l','e',0};
56 static const WCHAR attrBorderBottomWidth[] =
57 {'b','o','r','d','e','r','-','b','o','t','t','o','m','-','w','i','d','t','h',0};
58 static const WCHAR attrBorderColor[] =
59 {'b','o','r','d','e','r','-','c','o','l','o','r',0};
60 static const WCHAR attrBorderLeft[] =
61 {'b','o','r','d','e','r','-','l','e','f','t',0};
62 static const WCHAR attrBorderLeftColor[] =
63 {'b','o','r','d','e','r','-','l','e','f','t','-','c','o','l','o','r',0};
64 static const WCHAR attrBorderLeftStyle[] =
65 {'b','o','r','d','e','r','-','l','e','f','t','-','s','t','y','l','e',0};
66 static const WCHAR attrBorderLeftWidth[] =
67 {'b','o','r','d','e','r','-','l','e','f','t','-','w','i','d','t','h',0};
68 static const WCHAR attrBorderRightColor[] =
69 {'b','o','r','d','e','r','-','r','i','g','h','t','-','c','o','l','o','r',0};
70 static const WCHAR attrBorderRightStyle[] =
71 {'b','o','r','d','e','r','-','r','i','g','h','t','-','s','t','y','l','e',0};
72 static const WCHAR attrBorderRightWidth[] =
73 {'b','o','r','d','e','r','-','r','i','g','h','t','-','w','i','d','t','h',0};
74 static const WCHAR attrBorderTopColor[] =
75 {'b','o','r','d','e','r','-','t','o','p','-','c','o','l','o','r',0};
76 static const WCHAR attrBorderStyle[] =
77 {'b','o','r','d','e','r','-','s','t','y','l','e',0};
78 static const WCHAR attrBorderTopStyle[] =
79 {'b','o','r','d','e','r','-','t','o','p','-','s','t','y','l','e',0};
80 static const WCHAR attrBorderTopWidth[] =
81 {'b','o','r','d','e','r','-','t','o','p','-','w','i','d','t','h',0};
82 static const WCHAR attrBorderWidth[] =
83 {'b','o','r','d','e','r','-','w','i','d','t','h',0};
84 static const WCHAR attrBottom[] =
85 {'b','o','t','t','o','m',0};
86 static const WCHAR attrColor[] =
87 {'c','o','l','o','r',0};
88 static const WCHAR attrCursor[] =
89 {'c','u','r','s','o','r',0};
90 static const WCHAR attrDisplay[] =
91 {'d','i','s','p','l','a','y',0};
92 static const WCHAR attrFilter[] =
93 {'f','i','l','e','t','e','r',0};
94 static const WCHAR attrFontFamily[] =
95 {'f','o','n','t','-','f','a','m','i','l','y',0};
96 static const WCHAR attrFontSize[] =
97 {'f','o','n','t','-','s','i','z','e',0};
98 static const WCHAR attrFontStyle[] =
99 {'f','o','n','t','-','s','t','y','l','e',0};
100 static const WCHAR attrFontVariant[] =
101 {'f','o','n','t','-','v','a','r','i','a','n','t',0};
102 static const WCHAR attrFontWeight[] =
103 {'f','o','n','t','-','w','e','i','g','h','t',0};
104 static const WCHAR attrHeight[] =
105 {'h','e','i','g','h','t',0};
106 static const WCHAR attrLeft[] =
108 static const WCHAR attrLetterSpacing[] =
109 {'l','e','t','t','e','r','-','s','p','a','c','i','n','g',0};
110 static const WCHAR attrMargin[] =
111 {'m','a','r','g','i','n',0};
112 static const WCHAR attrMarginBottom[] =
113 {'m','a','r','g','i','n','-','b','o','t','t','o','m',0};
114 static const WCHAR attrMarginLeft[] =
115 {'m','a','r','g','i','n','-','l','e','f','t',0};
116 static const WCHAR attrMarginRight[] =
117 {'m','a','r','g','i','n','-','r','i','g','h','t',0};
118 static const WCHAR attrMarginTop[] =
119 {'m','a','r','g','i','n','-','t','o','p',0};
120 static const WCHAR attrMinHeight[] =
121 {'m','i','n','-','h','e','i','g','h','t',0};
122 static const WCHAR attrOverflow[] =
123 {'o','v','e','r','f','l','o','w',0};
124 static const WCHAR attrPaddingBottom[] =
125 {'p','a','d','d','i','n','g','-','b','o','t','t','o','m',0};
126 static const WCHAR attrPaddingLeft[] =
127 {'p','a','d','d','i','n','g','-','l','e','f','t',0};
128 static const WCHAR attrPaddingRight[] =
129 {'p','a','d','d','i','n','g','-','r','i','g','h','t',0};
130 static const WCHAR attrPaddingTop[] =
131 {'p','a','d','d','i','n','g','-','t','o','p',0};
132 static const WCHAR attrPosition[] =
133 {'p','o','s','i','t','i','o','n',0};
134 static const WCHAR attrRight[] =
135 {'r','i','g','h','t',0};
136 static const WCHAR attrTextAlign[] =
137 {'t','e','x','t','-','a','l','i','g','n',0};
138 static const WCHAR attrTextDecoration[] =
139 {'t','e','x','t','-','d','e','c','o','r','a','t','i','o','n',0};
140 static const WCHAR attrTop[] =
142 static const WCHAR attrVerticalAlign[] =
143 {'v','e','r','t','i','c','a','l','-','a','l','i','g','n',0};
144 static const WCHAR attrVisibility[] =
145 {'v','i','s','i','b','i','l','i','t','y',0};
146 static const WCHAR attrWidth[] =
147 {'w','i','d','t','h',0};
148 static const WCHAR attrWordSpacing[] =
149 {'w','o','r','d','-','s','p','a','c','i','n','g',0};
150 static const WCHAR attrWordWrap[] =
151 {'w','o','r','d','-','w','r','a','p',0};
152 static const WCHAR attrZIndex[] =
153 {'z','-','i','n','d','e','x',0};
159 {attrBackground, DISPID_IHTMLSTYLE_BACKGROUND},
160 {attrBackgroundColor, DISPID_IHTMLSTYLE_BACKGROUNDCOLOR},
161 {attrBackgroundImage, DISPID_IHTMLSTYLE_BACKGROUNDIMAGE},
162 {attrBackgroundPositionX, DISPID_IHTMLSTYLE_BACKGROUNDPOSITIONX},
163 {attrBackgroundPositionY, DISPID_IHTMLSTYLE_BACKGROUNDPOSITIONY},
164 {attrBackgroundRepeat, DISPID_IHTMLSTYLE_BACKGROUNDREPEAT},
165 {attrBorder, DISPID_IHTMLSTYLE_BORDER},
166 {attrBorderBottomColor, DISPID_IHTMLSTYLE_BORDERBOTTOMCOLOR},
167 {attrBorderBottomStyle, DISPID_IHTMLSTYLE_BORDERBOTTOMSTYLE},
168 {attrBorderBottomWidth, DISPID_IHTMLSTYLE_BORDERBOTTOMWIDTH},
169 {attrBorderColor, DISPID_IHTMLSTYLE_BORDERCOLOR},
170 {attrBorderLeft, DISPID_IHTMLSTYLE_BORDERLEFT},
171 {attrBorderLeftColor, DISPID_IHTMLSTYLE_BORDERLEFTCOLOR},
172 {attrBorderLeftStyle, DISPID_IHTMLSTYLE_BORDERLEFTSTYLE},
173 {attrBorderLeftWidth, DISPID_IHTMLSTYLE_BORDERLEFTWIDTH},
174 {attrBorderRightColor, DISPID_IHTMLSTYLE_BORDERRIGHTCOLOR},
175 {attrBorderRightStyle, DISPID_IHTMLSTYLE_BORDERRIGHTSTYLE},
176 {attrBorderRightWidth, DISPID_IHTMLSTYLE_BORDERRIGHTWIDTH},
177 {attrBorderStyle, DISPID_IHTMLSTYLE_BORDERSTYLE},
178 {attrBorderTopColor, DISPID_IHTMLSTYLE_BORDERTOPCOLOR},
179 {attrBorderTopStyle, DISPID_IHTMLSTYLE_BORDERTOPSTYLE},
180 {attrBorderTopWidth, DISPID_IHTMLSTYLE_BORDERTOPWIDTH},
181 {attrBorderWidth, DISPID_IHTMLSTYLE_BORDERWIDTH},
182 {attrBottom, DISPID_IHTMLSTYLE2_BOTTOM},
183 {attrColor, DISPID_IHTMLSTYLE_COLOR},
184 {attrCursor, DISPID_IHTMLSTYLE_CURSOR},
185 {attrDisplay, DISPID_IHTMLSTYLE_DISPLAY},
186 {attrFilter, DISPID_IHTMLSTYLE_FILTER},
187 {attrFontFamily, DISPID_IHTMLSTYLE_FONTFAMILY},
188 {attrFontSize, DISPID_IHTMLSTYLE_FONTSIZE},
189 {attrFontStyle, DISPID_IHTMLSTYLE_FONTSTYLE},
190 {attrFontVariant, DISPID_IHTMLSTYLE_FONTVARIANT},
191 {attrFontWeight, DISPID_IHTMLSTYLE_FONTWEIGHT},
192 {attrHeight, DISPID_IHTMLSTYLE_HEIGHT},
193 {attrLeft, DISPID_IHTMLSTYLE_LEFT},
194 {attrLetterSpacing, DISPID_IHTMLSTYLE_LETTERSPACING},
195 {attrMargin, DISPID_IHTMLSTYLE_MARGIN},
196 {attrMarginBottom, DISPID_IHTMLSTYLE_MARGINBOTTOM},
197 {attrMarginLeft, DISPID_IHTMLSTYLE_MARGINLEFT},
198 {attrMarginRight, DISPID_IHTMLSTYLE_MARGINRIGHT},
199 {attrMarginTop, DISPID_IHTMLSTYLE_MARGINTOP},
200 {attrMinHeight, DISPID_IHTMLSTYLE4_MINHEIGHT},
201 {attrOverflow, DISPID_IHTMLSTYLE_OVERFLOW},
202 {attrPaddingBottom, DISPID_IHTMLSTYLE_PADDINGBOTTOM},
203 {attrPaddingLeft, DISPID_IHTMLSTYLE_PADDINGLEFT},
204 {attrPaddingRight, DISPID_IHTMLSTYLE_PADDINGRIGHT},
205 {attrPaddingTop, DISPID_IHTMLSTYLE_PADDINGTOP},
206 {attrPosition, DISPID_IHTMLSTYLE2_POSITION},
207 {attrRight, DISPID_IHTMLSTYLE2_RIGHT},
208 {attrTextAlign, DISPID_IHTMLSTYLE_TEXTALIGN},
209 {attrTextDecoration, DISPID_IHTMLSTYLE_TEXTDECORATION},
210 {attrTop, DISPID_IHTMLSTYLE_TOP},
211 {attrVerticalAlign, DISPID_IHTMLSTYLE_VERTICALALIGN},
212 {attrVisibility, DISPID_IHTMLSTYLE_VISIBILITY},
213 {attrWidth, DISPID_IHTMLSTYLE_WIDTH},
214 {attrWordSpacing, DISPID_IHTMLSTYLE_WORDSPACING},
215 {attrWordWrap, DISPID_IHTMLSTYLE3_WORDWRAP},
216 {attrZIndex, DISPID_IHTMLSTYLE_ZINDEX}
219 static const WCHAR valLineThrough[] =
220 {'l','i','n','e','-','t','h','r','o','u','g','h',0};
221 static const WCHAR valUnderline[] =
222 {'u','n','d','e','r','l','i','n','e',0};
223 static const WCHAR szNormal[] =
224 {'n','o','r','m','a','l',0};
225 static const WCHAR styleNone[] =
227 static const WCHAR valOverline[] =
228 {'o','v','e','r','l','i','n','e',0};
229 static const WCHAR valBlink[] =
230 {'b','l','i','n','k',0};
232 static const WCHAR px_formatW[] = {'%','d','p','x',0};
233 static const WCHAR emptyW[] = {0};
235 static LPWSTR fix_px_value(LPCWSTR val)
240 while(*ptr && isspaceW(*ptr))
245 while(*ptr && isdigitW(*ptr))
248 if(!*ptr || isspaceW(*ptr)) {
250 int len = strlenW(val)+1;
252 ret = heap_alloc((len+2)*sizeof(WCHAR));
253 memcpy(ret, val, (ptr-val)*sizeof(WCHAR));
259 TRACE("fixed %s -> %s\n", debugstr_w(val), debugstr_w(ret));
264 while(*ptr && !isspaceW(*ptr))
271 static LPWSTR fix_url_value(LPCWSTR val)
275 static const WCHAR urlW[] = {'u','r','l','('};
277 if(strncmpW(val, urlW, sizeof(urlW)/sizeof(WCHAR)) || !strchrW(val, '\\'))
280 ret = heap_strdupW(val);
282 for(ptr = ret; *ptr; ptr++) {
290 HRESULT set_nsstyle_attr(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, LPCWSTR value, DWORD flags)
292 nsAString str_name, str_value, str_empty;
296 static const PRUnichar wszEmpty[] = {0};
298 if(flags & ATTR_FIX_PX)
299 val = fix_px_value(value);
300 if(flags & ATTR_FIX_URL)
301 val = fix_url_value(value);
303 nsAString_Init(&str_name, style_tbl[sid].name);
304 nsAString_Init(&str_value, val ? val : value);
305 nsAString_Init(&str_empty, wszEmpty);
308 nsres = nsIDOMCSSStyleDeclaration_SetProperty(nsstyle, &str_name, &str_value, &str_empty);
310 ERR("SetProperty failed: %08x\n", nsres);
312 nsAString_Finish(&str_name);
313 nsAString_Finish(&str_value);
314 nsAString_Finish(&str_empty);
319 HRESULT set_nsstyle_attr_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, VARIANT *value, DWORD flags)
321 switch(V_VT(value)) {
323 return set_nsstyle_attr(nsstyle, sid, emptyW, flags);
326 return set_nsstyle_attr(nsstyle, sid, V_BSTR(value), flags);
328 case VT_BSTR|VT_BYREF:
329 return set_nsstyle_attr(nsstyle, sid, *V_BSTRREF(value), flags);
333 static const WCHAR format[] = {'%','d',0};
335 wsprintfW(str, format, V_I4(value));
336 return set_nsstyle_attr(nsstyle, sid, str, flags);
339 FIXME("not implemented vt %d\n", V_VT(value));
347 static inline HRESULT set_style_attr(HTMLStyle *This, styleid_t sid, LPCWSTR value, DWORD flags)
349 return set_nsstyle_attr(This->nsstyle, sid, value, flags);
352 static HRESULT get_nsstyle_attr_nsval(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, nsAString *value)
357 nsAString_Init(&str_name, style_tbl[sid].name);
359 nsres = nsIDOMCSSStyleDeclaration_GetPropertyValue(nsstyle, &str_name, value);
360 if(NS_FAILED(nsres)) {
361 ERR("SetProperty failed: %08x\n", nsres);
365 nsAString_Finish(&str_name);
370 HRESULT get_nsstyle_attr(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, BSTR *p)
373 const PRUnichar *value;
375 nsAString_Init(&str_value, NULL);
377 get_nsstyle_attr_nsval(nsstyle, sid, &str_value);
379 nsAString_GetData(&str_value, &value);
380 *p = *value ? SysAllocString(value) : NULL;
382 nsAString_Finish(&str_value);
384 TRACE("%s -> %s\n", debugstr_w(style_tbl[sid].name), debugstr_w(*p));
388 HRESULT get_nsstyle_attr_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, VARIANT *p, DWORD flags)
391 const PRUnichar *value;
394 nsAString_Init(&str_value, NULL);
396 get_nsstyle_attr_nsval(nsstyle, sid, &str_value);
398 nsAString_GetData(&str_value, &value);
400 if(flags & ATTR_STR_TO_INT) {
401 const PRUnichar *ptr = value;
410 while(isdigitW(*ptr))
411 i = i*10 + (*ptr++ - '0');
415 V_I4(p) = neg ? -i : i;
424 str = SysAllocString(value);
426 return E_OUTOFMEMORY;
433 nsAString_Finish(&str_value);
435 TRACE("%s -> %s\n", debugstr_w(style_tbl[sid].name), debugstr_variant(p));
439 static inline HRESULT get_style_attr(HTMLStyle *This, styleid_t sid, BSTR *p)
441 return get_nsstyle_attr(This->nsstyle, sid, p);
444 static HRESULT check_style_attr_value(HTMLStyle *This, styleid_t sid, LPCWSTR exval, VARIANT_BOOL *p)
447 const PRUnichar *value;
449 nsAString_Init(&str_value, NULL);
451 get_nsstyle_attr_nsval(This->nsstyle, sid, &str_value);
453 nsAString_GetData(&str_value, &value);
454 *p = strcmpW(value, exval) ? VARIANT_FALSE : VARIANT_TRUE;
455 nsAString_Finish(&str_value);
457 TRACE("%s -> %x\n", debugstr_w(style_tbl[sid].name), *p);
461 static inline HRESULT set_style_pos(HTMLStyle *This, styleid_t sid, float value)
464 WCHAR szFormat[] = {'%','.','0','f','p','x',0};
466 value = floor(value);
468 sprintfW(szValue, szFormat, value);
470 return set_style_attr(This, sid, szValue, 0);
473 static HRESULT get_nsstyle_pos(HTMLStyle *This, styleid_t sid, float *p)
477 WCHAR pxW[] = {'p','x',0};
479 TRACE("%p %d %p\n", This, sid, p);
483 nsAString_Init(&str_value, NULL);
485 hres = get_nsstyle_attr_nsval(This->nsstyle, sid, &str_value);
489 const PRUnichar *value;
491 nsAString_GetData(&str_value, &value);
494 *p = strtolW(value, &ptr, 10);
496 if(*ptr && strcmpW(ptr, pxW))
498 nsAString_Finish(&str_value);
499 FIXME("only px values are currently supported\n");
505 TRACE("ret %f\n", *p);
507 nsAString_Finish(&str_value);
512 static BOOL is_valid_border_style(BSTR v)
514 static const WCHAR styleDotted[] = {'d','o','t','t','e','d',0};
515 static const WCHAR styleDashed[] = {'d','a','s','h','e','d',0};
516 static const WCHAR styleSolid[] = {'s','o','l','i','d',0};
517 static const WCHAR styleDouble[] = {'d','o','u','b','l','e',0};
518 static const WCHAR styleGroove[] = {'g','r','o','o','v','e',0};
519 static const WCHAR styleRidge[] = {'r','i','d','g','e',0};
520 static const WCHAR styleInset[] = {'i','n','s','e','t',0};
521 static const WCHAR styleOutset[] = {'o','u','t','s','e','t',0};
523 TRACE("%s\n", debugstr_w(v));
525 if(!v || strcmpiW(v, styleNone) == 0 || strcmpiW(v, styleDotted) == 0 ||
526 strcmpiW(v, styleDashed) == 0 || strcmpiW(v, styleSolid) == 0 ||
527 strcmpiW(v, styleDouble) == 0 || strcmpiW(v, styleGroove) == 0 ||
528 strcmpiW(v, styleRidge) == 0 || strcmpiW(v, styleInset) == 0 ||
529 strcmpiW(v, styleOutset) == 0 )
537 #define HTMLSTYLE_THIS(iface) DEFINE_THIS(HTMLStyle, HTMLStyle, iface)
539 static HRESULT WINAPI HTMLStyle_QueryInterface(IHTMLStyle *iface, REFIID riid, void **ppv)
541 HTMLStyle *This = HTMLSTYLE_THIS(iface);
545 if(IsEqualGUID(&IID_IUnknown, riid)) {
546 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
547 *ppv = HTMLSTYLE(This);
548 }else if(IsEqualGUID(&IID_IHTMLStyle, riid)) {
549 TRACE("(%p)->(IID_IHTMLStyle %p)\n", This, ppv);
550 *ppv = HTMLSTYLE(This);
551 }else if(IsEqualGUID(&IID_IHTMLStyle2, riid)) {
552 TRACE("(%p)->(IID_IHTMLStyle2 %p)\n", This, ppv);
553 *ppv = HTMLSTYLE2(This);
554 }else if(IsEqualGUID(&IID_IHTMLStyle3, riid)) {
555 TRACE("(%p)->(IID_IHTMLStyle3 %p)\n", This, ppv);
556 *ppv = HTMLSTYLE3(This);
557 }else if(IsEqualGUID(&IID_IHTMLStyle4, riid)) {
558 TRACE("(%p)->(IID_IHTMLStyle4 %p)\n", This, ppv);
559 *ppv = HTMLSTYLE4(This);
560 }else if(dispex_query_interface(&This->dispex, riid, ppv)) {
561 return *ppv ? S_OK : E_NOINTERFACE;
565 IUnknown_AddRef((IUnknown*)*ppv);
569 WARN("unsupported %s\n", debugstr_guid(riid));
570 return E_NOINTERFACE;
573 static ULONG WINAPI HTMLStyle_AddRef(IHTMLStyle *iface)
575 HTMLStyle *This = HTMLSTYLE_THIS(iface);
576 LONG ref = InterlockedIncrement(&This->ref);
578 TRACE("(%p) ref=%d\n", This, ref);
583 static ULONG WINAPI HTMLStyle_Release(IHTMLStyle *iface)
585 HTMLStyle *This = HTMLSTYLE_THIS(iface);
586 LONG ref = InterlockedDecrement(&This->ref);
588 TRACE("(%p) ref=%d\n", This, ref);
592 nsIDOMCSSStyleDeclaration_Release(This->nsstyle);
593 release_dispex(&This->dispex);
600 static HRESULT WINAPI HTMLStyle_GetTypeInfoCount(IHTMLStyle *iface, UINT *pctinfo)
602 HTMLStyle *This = HTMLSTYLE_THIS(iface);
603 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->dispex), pctinfo);
606 static HRESULT WINAPI HTMLStyle_GetTypeInfo(IHTMLStyle *iface, UINT iTInfo,
607 LCID lcid, ITypeInfo **ppTInfo)
609 HTMLStyle *This = HTMLSTYLE_THIS(iface);
610 return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->dispex), iTInfo, lcid, ppTInfo);
613 static HRESULT WINAPI HTMLStyle_GetIDsOfNames(IHTMLStyle *iface, REFIID riid,
614 LPOLESTR *rgszNames, UINT cNames,
615 LCID lcid, DISPID *rgDispId)
617 HTMLStyle *This = HTMLSTYLE_THIS(iface);
618 return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->dispex), riid, rgszNames, cNames, lcid, rgDispId);
621 static HRESULT WINAPI HTMLStyle_Invoke(IHTMLStyle *iface, DISPID dispIdMember,
622 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
623 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
625 HTMLStyle *This = HTMLSTYLE_THIS(iface);
626 return IDispatchEx_Invoke(DISPATCHEX(&This->dispex), dispIdMember, riid, lcid,
627 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
630 static HRESULT WINAPI HTMLStyle_put_fontFamily(IHTMLStyle *iface, BSTR v)
632 HTMLStyle *This = HTMLSTYLE_THIS(iface);
634 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
636 return set_style_attr(This, STYLEID_FONT_FAMILY, v, 0);
639 static HRESULT WINAPI HTMLStyle_get_fontFamily(IHTMLStyle *iface, BSTR *p)
641 HTMLStyle *This = HTMLSTYLE_THIS(iface);
643 TRACE("(%p)->(%p)\n", This, p);
645 return get_style_attr(This, STYLEID_FONT_FAMILY, p);
648 static HRESULT WINAPI HTMLStyle_put_fontStyle(IHTMLStyle *iface, BSTR v)
650 HTMLStyle *This = HTMLSTYLE_THIS(iface);
651 static const WCHAR szItalic[] = {'i','t','a','l','i','c',0};
652 static const WCHAR szOblique[] = {'o','b','l','i','q','u','e',0};
654 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
656 /* fontStyle can only be one of the follow values. */
657 if(!v || strcmpiW(szNormal, v) == 0 || strcmpiW(szItalic, v) == 0 ||
658 strcmpiW(szOblique, v) == 0)
660 return set_nsstyle_attr(This->nsstyle, STYLEID_FONT_STYLE, v, 0);
666 static HRESULT WINAPI HTMLStyle_get_fontStyle(IHTMLStyle *iface, BSTR *p)
668 HTMLStyle *This = HTMLSTYLE_THIS(iface);
670 TRACE("(%p)->(%p)\n", This, p);
672 return get_style_attr(This, STYLEID_FONT_STYLE, p);
675 static HRESULT WINAPI HTMLStyle_put_fontVariant(IHTMLStyle *iface, BSTR v)
677 HTMLStyle *This = HTMLSTYLE_THIS(iface);
678 static const WCHAR szCaps[] = {'s','m','a','l','l','-','c','a','p','s',0};
680 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
682 /* fontVariant can only be one of the follow values. */
683 if(!v || strcmpiW(szNormal, v) == 0 || strcmpiW(szCaps, v) == 0)
685 return set_nsstyle_attr(This->nsstyle, STYLEID_FONT_VARIANT, v, 0);
691 static HRESULT WINAPI HTMLStyle_get_fontVariant(IHTMLStyle *iface, BSTR *p)
693 HTMLStyle *This = HTMLSTYLE_THIS(iface);
694 TRACE("(%p)->(%p)\n", This, p);
699 return get_style_attr(This, STYLEID_FONT_VARIANT, p);
702 static HRESULT WINAPI HTMLStyle_put_fontWeight(IHTMLStyle *iface, BSTR v)
704 HTMLStyle *This = HTMLSTYLE_THIS(iface);
705 static const WCHAR styleBold[] = {'b','o','l','d',0};
706 static const WCHAR styleBolder[] = {'b','o','l','d','e','r',0};
707 static const WCHAR styleLighter[] = {'l','i','g','h','t','e','r',0};
708 static const WCHAR style100[] = {'1','0','0',0};
709 static const WCHAR style200[] = {'2','0','0',0};
710 static const WCHAR style300[] = {'3','0','0',0};
711 static const WCHAR style400[] = {'4','0','0',0};
712 static const WCHAR style500[] = {'5','0','0',0};
713 static const WCHAR style600[] = {'6','0','0',0};
714 static const WCHAR style700[] = {'7','0','0',0};
715 static const WCHAR style800[] = {'8','0','0',0};
716 static const WCHAR style900[] = {'9','0','0',0};
718 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
720 /* fontWeight can only be one of the following */
721 if(!v || strcmpiW(szNormal, v) == 0 || strcmpiW(styleBold, v) == 0 ||
722 strcmpiW(styleBolder, v) == 0 || strcmpiW(styleLighter, v) == 0 ||
723 strcmpiW(style100, v) == 0 || strcmpiW(style200, v) == 0 ||
724 strcmpiW(style300, v) == 0 || strcmpiW(style400, v) == 0 ||
725 strcmpiW(style500, v) == 0 || strcmpiW(style600, v) == 0 ||
726 strcmpiW(style700, v) == 0 || strcmpiW(style800, v) == 0 ||
727 strcmpiW(style900, v) == 0
730 return set_nsstyle_attr(This->nsstyle, STYLEID_FONT_WEIGHT, v, 0);
736 static HRESULT WINAPI HTMLStyle_get_fontWeight(IHTMLStyle *iface, BSTR *p)
738 HTMLStyle *This = HTMLSTYLE_THIS(iface);
740 TRACE("(%p)->(%p)\n", This, p);
742 return get_style_attr(This, STYLEID_FONT_WEIGHT, p);
745 static HRESULT WINAPI HTMLStyle_put_fontSize(IHTMLStyle *iface, VARIANT v)
747 HTMLStyle *This = HTMLSTYLE_THIS(iface);
749 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
753 return set_style_attr(This, STYLEID_FONT_SIZE, V_BSTR(&v), 0);
755 FIXME("not supported vt %d\n", V_VT(&v));
761 static HRESULT WINAPI HTMLStyle_get_fontSize(IHTMLStyle *iface, VARIANT *p)
763 HTMLStyle *This = HTMLSTYLE_THIS(iface);
765 TRACE("(%p)->(%p)\n", This, p);
768 return get_style_attr(This, STYLEID_FONT_SIZE, &V_BSTR(p));
771 static HRESULT WINAPI HTMLStyle_put_font(IHTMLStyle *iface, BSTR v)
773 HTMLStyle *This = HTMLSTYLE_THIS(iface);
774 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
778 static HRESULT WINAPI HTMLStyle_get_font(IHTMLStyle *iface, BSTR *p)
780 HTMLStyle *This = HTMLSTYLE_THIS(iface);
781 FIXME("(%p)->(%p)\n", This, p);
785 static HRESULT WINAPI HTMLStyle_put_color(IHTMLStyle *iface, VARIANT v)
787 HTMLStyle *This = HTMLSTYLE_THIS(iface);
789 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
793 TRACE("%s\n", debugstr_w(V_BSTR(&v)));
794 return set_style_attr(This, STYLEID_COLOR, V_BSTR(&v), 0);
797 FIXME("unsupported vt=%d\n", V_VT(&v));
803 static HRESULT WINAPI HTMLStyle_get_color(IHTMLStyle *iface, VARIANT *p)
805 HTMLStyle *This = HTMLSTYLE_THIS(iface);
807 TRACE("(%p)->(%p)\n", This, p);
810 return get_style_attr(This, STYLEID_COLOR, &V_BSTR(p));
813 static HRESULT WINAPI HTMLStyle_put_background(IHTMLStyle *iface, BSTR v)
815 HTMLStyle *This = HTMLSTYLE_THIS(iface);
817 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
819 return set_style_attr(This, STYLEID_BACKGROUND, v, 0);
822 static HRESULT WINAPI HTMLStyle_get_background(IHTMLStyle *iface, BSTR *p)
824 HTMLStyle *This = HTMLSTYLE_THIS(iface);
826 TRACE("(%p)->(%p)\n", This, p);
828 return get_style_attr(This, STYLEID_BACKGROUND, p);
831 static HRESULT WINAPI HTMLStyle_put_backgroundColor(IHTMLStyle *iface, VARIANT v)
833 HTMLStyle *This = HTMLSTYLE_THIS(iface);
835 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
839 return set_style_attr(This, STYLEID_BACKGROUND_COLOR, V_BSTR(&v), 0);
842 static const WCHAR format[] = {'#','%','0','6','x',0};
844 wsprintfW(value, format, V_I4(&v));
845 return set_style_attr(This, STYLEID_BACKGROUND_COLOR, value, 0);
848 FIXME("unsupported vt %d\n", V_VT(&v));
854 static HRESULT WINAPI HTMLStyle_get_backgroundColor(IHTMLStyle *iface, VARIANT *p)
856 HTMLStyle *This = HTMLSTYLE_THIS(iface);
857 TRACE("(%p)->(%p)\n", This, p);
860 return get_style_attr(This, STYLEID_BACKGROUND_COLOR, &V_BSTR(p));
863 static HRESULT WINAPI HTMLStyle_put_backgroundImage(IHTMLStyle *iface, BSTR v)
865 HTMLStyle *This = HTMLSTYLE_THIS(iface);
867 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
869 return set_style_attr(This, STYLEID_BACKGROUND_IMAGE, v, ATTR_FIX_URL);
872 static HRESULT WINAPI HTMLStyle_get_backgroundImage(IHTMLStyle *iface, BSTR *p)
874 HTMLStyle *This = HTMLSTYLE_THIS(iface);
876 TRACE("(%p)->(%p)\n", This, p);
878 return get_style_attr(This, STYLEID_BACKGROUND_IMAGE, p);
881 static HRESULT WINAPI HTMLStyle_put_backgroundRepeat(IHTMLStyle *iface, BSTR v)
883 HTMLStyle *This = HTMLSTYLE_THIS(iface);
884 static const WCHAR styleRepeat[] = {'r','e','p','e','a','t',0};
885 static const WCHAR styleNoRepeat[] = {'n','o','-','r','e','p','e','a','t',0};
886 static const WCHAR styleRepeatX[] = {'r','e','p','e','a','t','-','x',0};
887 static const WCHAR styleRepeatY[] = {'r','e','p','e','a','t','-','y',0};
889 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
891 /* fontWeight can only be one of the following */
892 if(!v || strcmpiW(styleRepeat, v) == 0 || strcmpiW(styleNoRepeat, v) == 0 ||
893 strcmpiW(styleRepeatX, v) == 0 || strcmpiW(styleRepeatY, v) == 0 )
895 return set_style_attr(This, STYLEID_BACKGROUND_REPEAT , v, 0);
901 static HRESULT WINAPI HTMLStyle_get_backgroundRepeat(IHTMLStyle *iface, BSTR *p)
903 HTMLStyle *This = HTMLSTYLE_THIS(iface);
905 TRACE("(%p)->(%p)\n", This, p);
907 return get_style_attr(This, STYLEID_BACKGROUND_REPEAT, p);
910 static HRESULT WINAPI HTMLStyle_put_backgroundAttachment(IHTMLStyle *iface, BSTR v)
912 HTMLStyle *This = HTMLSTYLE_THIS(iface);
913 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
917 static HRESULT WINAPI HTMLStyle_get_backgroundAttachment(IHTMLStyle *iface, BSTR *p)
919 HTMLStyle *This = HTMLSTYLE_THIS(iface);
920 FIXME("(%p)->(%p)\n", This, p);
924 static HRESULT WINAPI HTMLStyle_put_backgroundPosition(IHTMLStyle *iface, BSTR v)
926 HTMLStyle *This = HTMLSTYLE_THIS(iface);
927 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
931 static HRESULT WINAPI HTMLStyle_get_backgroundPosition(IHTMLStyle *iface, BSTR *p)
933 HTMLStyle *This = HTMLSTYLE_THIS(iface);
934 FIXME("(%p)->(%p)\n", This, p);
938 static HRESULT WINAPI HTMLStyle_put_backgroundPositionX(IHTMLStyle *iface, VARIANT v)
940 HTMLStyle *This = HTMLSTYLE_THIS(iface);
941 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
942 return set_nsstyle_attr_var(This->nsstyle, STYLEID_BACKGROUND_POSITION_X, &v, 0);
945 static HRESULT WINAPI HTMLStyle_get_backgroundPositionX(IHTMLStyle *iface, VARIANT *p)
947 HTMLStyle *This = HTMLSTYLE_THIS(iface);
948 TRACE("(%p)->(%p)\n", This, p);
949 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BACKGROUND_POSITION_X, p, 0);
952 static HRESULT WINAPI HTMLStyle_put_backgroundPositionY(IHTMLStyle *iface, VARIANT v)
954 HTMLStyle *This = HTMLSTYLE_THIS(iface);
955 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
956 return set_nsstyle_attr_var(This->nsstyle, STYLEID_BACKGROUND_POSITION_Y, &v, 0);
959 static HRESULT WINAPI HTMLStyle_get_backgroundPositionY(IHTMLStyle *iface, VARIANT *p)
961 HTMLStyle *This = HTMLSTYLE_THIS(iface);
962 TRACE("(%p)->(%p)\n", This, p);
963 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BACKGROUND_POSITION_Y, p, 0);
966 static HRESULT WINAPI HTMLStyle_put_wordSpacing(IHTMLStyle *iface, VARIANT v)
968 HTMLStyle *This = HTMLSTYLE_THIS(iface);
969 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
970 return set_nsstyle_attr_var(This->nsstyle, STYLEID_WORD_SPACING, &v, 0);
973 static HRESULT WINAPI HTMLStyle_get_wordSpacing(IHTMLStyle *iface, VARIANT *p)
975 HTMLStyle *This = HTMLSTYLE_THIS(iface);
976 TRACE("(%p)->(%p)\n", This, p);
977 return get_nsstyle_attr_var(This->nsstyle, STYLEID_WORD_SPACING, p, 0);
980 static HRESULT WINAPI HTMLStyle_put_letterSpacing(IHTMLStyle *iface, VARIANT v)
982 HTMLStyle *This = HTMLSTYLE_THIS(iface);
983 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
984 return set_nsstyle_attr_var(This->nsstyle, STYLEID_LETTER_SPACING, &v, 0);
987 static HRESULT WINAPI HTMLStyle_get_letterSpacing(IHTMLStyle *iface, VARIANT *p)
989 HTMLStyle *This = HTMLSTYLE_THIS(iface);
990 TRACE("(%p)->(%p)\n", This, p);
991 return get_nsstyle_attr_var(This->nsstyle, STYLEID_LETTER_SPACING, p, 0);
994 static HRESULT WINAPI HTMLStyle_put_textDecoration(IHTMLStyle *iface, BSTR v)
996 HTMLStyle *This = HTMLSTYLE_THIS(iface);
998 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1000 /* textDecoration can only be one of the following */
1001 if(!v || strcmpiW(styleNone, v) == 0 || strcmpiW(valUnderline, v) == 0 ||
1002 strcmpiW(valOverline, v) == 0 || strcmpiW(valLineThrough, v) == 0 ||
1003 strcmpiW(valBlink, v) == 0)
1005 return set_style_attr(This, STYLEID_TEXT_DECORATION , v, 0);
1008 return E_INVALIDARG;
1011 static HRESULT WINAPI HTMLStyle_get_textDecoration(IHTMLStyle *iface, BSTR *p)
1013 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1015 TRACE("(%p)->(%p)\n", This, p);
1017 return get_style_attr(This, STYLEID_TEXT_DECORATION, p);
1020 static HRESULT WINAPI HTMLStyle_put_textDecorationNone(IHTMLStyle *iface, VARIANT_BOOL v)
1022 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1024 TRACE("(%p)->(%x)\n", This, v);
1026 return set_style_attr(This, STYLEID_TEXT_DECORATION, v ? styleNone : emptyW, 0);
1029 static HRESULT WINAPI HTMLStyle_get_textDecorationNone(IHTMLStyle *iface, VARIANT_BOOL *p)
1031 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1033 TRACE("(%p)->(%p)\n", This, p);
1035 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, styleNone, p);
1038 static HRESULT WINAPI HTMLStyle_put_textDecorationUnderline(IHTMLStyle *iface, VARIANT_BOOL v)
1040 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1042 TRACE("(%p)->(%x)\n", This, v);
1044 return set_style_attr(This, STYLEID_TEXT_DECORATION, v ? valUnderline : emptyW, 0);
1047 static HRESULT WINAPI HTMLStyle_get_textDecorationUnderline(IHTMLStyle *iface, VARIANT_BOOL *p)
1049 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1051 TRACE("(%p)->(%p)\n", This, p);
1053 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, valUnderline, p);
1056 static HRESULT WINAPI HTMLStyle_put_textDecorationOverline(IHTMLStyle *iface, VARIANT_BOOL v)
1058 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1060 TRACE("(%p)->(%x)\n", This, v);
1062 return set_style_attr(This, STYLEID_TEXT_DECORATION, v ? valOverline : emptyW, 0);
1065 static HRESULT WINAPI HTMLStyle_get_textDecorationOverline(IHTMLStyle *iface, VARIANT_BOOL *p)
1067 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1069 TRACE("(%p)->(%p)\n", This, p);
1071 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, valOverline, p);
1074 static HRESULT WINAPI HTMLStyle_put_textDecorationLineThrough(IHTMLStyle *iface, VARIANT_BOOL v)
1076 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1078 TRACE("(%p)->(%x)\n", This, v);
1080 return set_style_attr(This, STYLEID_TEXT_DECORATION, v ? valLineThrough : emptyW, 0);
1083 static HRESULT WINAPI HTMLStyle_get_textDecorationLineThrough(IHTMLStyle *iface, VARIANT_BOOL *p)
1085 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1087 TRACE("(%p)->(%p)\n", This, p);
1089 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, valLineThrough, p);
1092 static HRESULT WINAPI HTMLStyle_put_textDecorationBlink(IHTMLStyle *iface, VARIANT_BOOL v)
1094 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1096 TRACE("(%p)->(%x)\n", This, v);
1098 return set_style_attr(This, STYLEID_TEXT_DECORATION, v ? valBlink : emptyW, 0);
1101 static HRESULT WINAPI HTMLStyle_get_textDecorationBlink(IHTMLStyle *iface, VARIANT_BOOL *p)
1103 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1105 TRACE("(%p)->(%p)\n", This, p);
1107 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, valBlink, p);
1110 static HRESULT WINAPI HTMLStyle_put_verticalAlign(IHTMLStyle *iface, VARIANT v)
1112 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1114 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1118 return set_style_attr(This, STYLEID_VERTICAL_ALIGN, V_BSTR(&v), 0);
1120 FIXME("not implemented vt %d\n", V_VT(&v));
1127 static HRESULT WINAPI HTMLStyle_get_verticalAlign(IHTMLStyle *iface, VARIANT *p)
1129 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1133 TRACE("(%p)->(%p)\n", This, p);
1135 hres = get_style_attr(This, STYLEID_VERTICAL_ALIGN, &ret);
1144 static HRESULT WINAPI HTMLStyle_put_textTransform(IHTMLStyle *iface, BSTR v)
1146 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1147 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1151 static HRESULT WINAPI HTMLStyle_get_textTransform(IHTMLStyle *iface, BSTR *p)
1153 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1154 FIXME("(%p)->(%p)\n", This, p);
1158 static HRESULT WINAPI HTMLStyle_put_textAlign(IHTMLStyle *iface, BSTR v)
1160 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1162 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1164 return set_style_attr(This, STYLEID_TEXT_ALIGN, v, 0);
1167 static HRESULT WINAPI HTMLStyle_get_textAlign(IHTMLStyle *iface, BSTR *p)
1169 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1171 TRACE("(%p)->(%p)\n", This, p);
1173 return get_style_attr(This, STYLEID_TEXT_ALIGN, p);
1176 static HRESULT WINAPI HTMLStyle_put_textIndent(IHTMLStyle *iface, VARIANT v)
1178 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1179 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1183 static HRESULT WINAPI HTMLStyle_get_textIndent(IHTMLStyle *iface, VARIANT *p)
1185 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1186 FIXME("(%p)->(%p)\n", This, p);
1190 static HRESULT WINAPI HTMLStyle_put_lineHeight(IHTMLStyle *iface, VARIANT v)
1192 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1193 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1197 static HRESULT WINAPI HTMLStyle_get_lineHeight(IHTMLStyle *iface, VARIANT *p)
1199 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1200 FIXME("(%p)->(%p)\n", This, p);
1204 static HRESULT WINAPI HTMLStyle_put_marginTop(IHTMLStyle *iface, VARIANT v)
1206 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1207 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1211 static HRESULT WINAPI HTMLStyle_get_marginTop(IHTMLStyle *iface, VARIANT *p)
1213 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1214 FIXME("(%p)->(%p)\n", This, p);
1218 static HRESULT WINAPI HTMLStyle_put_marginRight(IHTMLStyle *iface, VARIANT v)
1220 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1222 TRACE("(%p)->(v(%d))\n", This, V_VT(&v));
1226 return set_style_attr(This, STYLEID_MARGIN_RIGHT, emptyW, 0);
1230 wsprintfW(buf, px_formatW, V_I4(&v));
1231 return set_style_attr(This, STYLEID_MARGIN_RIGHT, buf, 0);
1234 return set_style_attr(This, STYLEID_MARGIN_RIGHT, V_BSTR(&v), 0);
1236 FIXME("Unsupported vt=%d\n", V_VT(&v));
1242 static HRESULT WINAPI HTMLStyle_get_marginRight(IHTMLStyle *iface, VARIANT *p)
1244 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1245 TRACE("(%p)->(%p)\n", This, p);
1246 return get_nsstyle_attr_var(This->nsstyle, STYLEID_MARGIN_RIGHT, p, 0);
1249 static HRESULT WINAPI HTMLStyle_put_marginBottom(IHTMLStyle *iface, VARIANT v)
1251 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1252 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1256 static HRESULT WINAPI HTMLStyle_get_marginBottom(IHTMLStyle *iface, VARIANT *p)
1258 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1259 FIXME("(%p)->(%p)\n", This, p);
1263 static HRESULT WINAPI HTMLStyle_put_marginLeft(IHTMLStyle *iface, VARIANT v)
1265 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1269 TRACE("(%p)->(NULL)\n", This);
1270 return set_style_attr(This, STYLEID_MARGIN_LEFT, emptyW, 0);
1274 TRACE("(%p)->(%d)\n", This, V_I4(&v));
1276 wsprintfW(buf, px_formatW, V_I4(&v));
1277 return set_style_attr(This, STYLEID_MARGIN_LEFT, buf, 0);
1280 TRACE("(%p)->(%s)\n", This, debugstr_w(V_BSTR(&v)));
1281 return set_style_attr(This, STYLEID_MARGIN_LEFT, V_BSTR(&v), 0);
1283 FIXME("Unsupported vt=%d\n", V_VT(&v));
1289 static HRESULT WINAPI HTMLStyle_put_margin(IHTMLStyle *iface, BSTR v)
1291 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1293 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1295 return set_style_attr(This, STYLEID_MARGIN, v, 0);
1298 static HRESULT WINAPI HTMLStyle_get_margin(IHTMLStyle *iface, BSTR *p)
1300 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1302 TRACE("(%p)->(%p)\n", This, p);
1304 return get_style_attr(This, STYLEID_MARGIN, p);
1307 static HRESULT WINAPI HTMLStyle_get_marginLeft(IHTMLStyle *iface, VARIANT *p)
1309 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1310 TRACE("(%p)->(%p)\n", This, p);
1311 return get_nsstyle_attr_var(This->nsstyle, STYLEID_MARGIN_LEFT, p, 0);
1314 static HRESULT WINAPI HTMLStyle_put_paddingTop(IHTMLStyle *iface, VARIANT v)
1316 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1317 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1321 static HRESULT WINAPI HTMLStyle_get_paddingTop(IHTMLStyle *iface, VARIANT *p)
1323 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1324 FIXME("(%p)->(%p)\n", This, p);
1328 static HRESULT WINAPI HTMLStyle_put_paddingRight(IHTMLStyle *iface, VARIANT v)
1330 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1331 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1335 static HRESULT WINAPI HTMLStyle_get_paddingRight(IHTMLStyle *iface, VARIANT *p)
1337 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1338 FIXME("(%p)->(%p)\n", This, p);
1342 static HRESULT WINAPI HTMLStyle_put_paddingBottom(IHTMLStyle *iface, VARIANT v)
1344 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1345 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1349 static HRESULT WINAPI HTMLStyle_get_paddingBottom(IHTMLStyle *iface, VARIANT *p)
1351 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1352 FIXME("(%p)->(%p)\n", This, p);
1356 static HRESULT WINAPI HTMLStyle_put_paddingLeft(IHTMLStyle *iface, VARIANT v)
1358 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1360 TRACE("(%p)->(vt=%d)\n", This, V_VT(&v));
1366 wsprintfW(buf, px_formatW, V_I4(&v));
1367 return set_style_attr(This, STYLEID_PADDING_LEFT, buf, 0);
1370 return set_style_attr(This, STYLEID_PADDING_LEFT, V_BSTR(&v), 0);
1372 FIXME("unsupported vt=%d\n", V_VT(&v));
1378 static HRESULT WINAPI HTMLStyle_get_paddingLeft(IHTMLStyle *iface, VARIANT *p)
1380 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1384 TRACE("(%p)->(%p)\n", This, p);
1386 hres = get_style_attr(This, STYLEID_PADDING_LEFT, &ret);
1395 static HRESULT WINAPI HTMLStyle_put_padding(IHTMLStyle *iface, BSTR v)
1397 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1398 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1402 static HRESULT WINAPI HTMLStyle_get_padding(IHTMLStyle *iface, BSTR *p)
1404 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1405 FIXME("(%p)->(%p)\n", This, p);
1409 static HRESULT WINAPI HTMLStyle_put_border(IHTMLStyle *iface, BSTR v)
1411 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1413 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1415 return set_style_attr(This, STYLEID_BORDER, v, 0);
1418 static HRESULT WINAPI HTMLStyle_get_border(IHTMLStyle *iface, BSTR *p)
1420 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1422 TRACE("(%p)->(%p)\n", This, p);
1424 return get_style_attr(This, STYLEID_BORDER, p);
1427 static HRESULT WINAPI HTMLStyle_put_borderTop(IHTMLStyle *iface, BSTR v)
1429 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1430 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1434 static HRESULT WINAPI HTMLStyle_get_borderTop(IHTMLStyle *iface, BSTR *p)
1436 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1437 FIXME("(%p)->(%p)\n", This, p);
1441 static HRESULT WINAPI HTMLStyle_put_borderRight(IHTMLStyle *iface, BSTR v)
1443 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1444 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1448 static HRESULT WINAPI HTMLStyle_get_borderRight(IHTMLStyle *iface, BSTR *p)
1450 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1451 FIXME("(%p)->(%p)\n", This, p);
1455 static HRESULT WINAPI HTMLStyle_put_borderBottom(IHTMLStyle *iface, BSTR v)
1457 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1458 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1462 static HRESULT WINAPI HTMLStyle_get_borderBottom(IHTMLStyle *iface, BSTR *p)
1464 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1465 FIXME("(%p)->(%p)\n", This, p);
1469 static HRESULT WINAPI HTMLStyle_put_borderLeft(IHTMLStyle *iface, BSTR v)
1471 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1473 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1475 return set_style_attr(This, STYLEID_BORDER_LEFT, v, ATTR_FIX_PX);
1478 static HRESULT WINAPI HTMLStyle_get_borderLeft(IHTMLStyle *iface, BSTR *p)
1480 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1482 TRACE("(%p)->(%p)\n", This, p);
1484 return get_style_attr(This, STYLEID_BORDER_LEFT, p);
1487 static HRESULT WINAPI HTMLStyle_put_borderColor(IHTMLStyle *iface, BSTR v)
1489 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1491 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1493 return set_style_attr(This, STYLEID_BORDER_COLOR, v, 0);
1496 static HRESULT WINAPI HTMLStyle_get_borderColor(IHTMLStyle *iface, BSTR *p)
1498 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1500 TRACE("(%p)->(%p)\n", This, p);
1502 return get_style_attr(This, STYLEID_BORDER_COLOR, p);
1505 static HRESULT WINAPI HTMLStyle_put_borderTopColor(IHTMLStyle *iface, VARIANT v)
1507 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1508 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1512 static HRESULT WINAPI HTMLStyle_get_borderTopColor(IHTMLStyle *iface, VARIANT *p)
1514 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1515 FIXME("(%p)->(%p)\n", This, p);
1519 static HRESULT WINAPI HTMLStyle_put_borderRightColor(IHTMLStyle *iface, VARIANT v)
1521 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1522 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1526 static HRESULT WINAPI HTMLStyle_get_borderRightColor(IHTMLStyle *iface, VARIANT *p)
1528 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1529 FIXME("(%p)->(%p)\n", This, p);
1533 static HRESULT WINAPI HTMLStyle_put_borderBottomColor(IHTMLStyle *iface, VARIANT v)
1535 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1536 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1540 static HRESULT WINAPI HTMLStyle_get_borderBottomColor(IHTMLStyle *iface, VARIANT *p)
1542 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1543 FIXME("(%p)->(%p)\n", This, p);
1547 static HRESULT WINAPI HTMLStyle_put_borderLeftColor(IHTMLStyle *iface, VARIANT v)
1549 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1550 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1554 static HRESULT WINAPI HTMLStyle_get_borderLeftColor(IHTMLStyle *iface, VARIANT *p)
1556 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1557 FIXME("(%p)->(%p)\n", This, p);
1561 static HRESULT WINAPI HTMLStyle_put_borderWidth(IHTMLStyle *iface, BSTR v)
1563 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1564 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1565 return set_style_attr(This, STYLEID_BORDER_WIDTH, v, ATTR_FIX_PX);
1568 static HRESULT WINAPI HTMLStyle_get_borderWidth(IHTMLStyle *iface, BSTR *p)
1570 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1571 TRACE("(%p)->(%p)\n", This, p);
1572 return get_style_attr(This, STYLEID_BORDER_WIDTH, p);
1575 static HRESULT WINAPI HTMLStyle_put_borderTopWidth(IHTMLStyle *iface, VARIANT v)
1577 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1578 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
1579 return set_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_TOP_WIDTH, &v, 0);
1582 static HRESULT WINAPI HTMLStyle_get_borderTopWidth(IHTMLStyle *iface, VARIANT *p)
1584 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1586 TRACE("(%p)->(%p)\n", This, p);
1588 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_TOP_WIDTH, p, 0);
1591 static HRESULT WINAPI HTMLStyle_put_borderRightWidth(IHTMLStyle *iface, VARIANT v)
1593 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1594 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
1595 return set_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_RIGHT_WIDTH, &v, 0);
1598 static HRESULT WINAPI HTMLStyle_get_borderRightWidth(IHTMLStyle *iface, VARIANT *p)
1600 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1601 TRACE("(%p)->(%p)\n", This, p);
1602 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_RIGHT_WIDTH, p, 0);
1605 static HRESULT WINAPI HTMLStyle_put_borderBottomWidth(IHTMLStyle *iface, VARIANT v)
1607 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1609 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
1610 return set_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_BOTTOM_WIDTH, &v, 0);
1613 static HRESULT WINAPI HTMLStyle_get_borderBottomWidth(IHTMLStyle *iface, VARIANT *p)
1615 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1616 TRACE("(%p)->(%p)\n", This, p);
1617 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_BOTTOM_WIDTH, p, 0);
1620 static HRESULT WINAPI HTMLStyle_put_borderLeftWidth(IHTMLStyle *iface, VARIANT v)
1622 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1623 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
1624 return set_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_LEFT_WIDTH, &v, 0);
1627 static HRESULT WINAPI HTMLStyle_get_borderLeftWidth(IHTMLStyle *iface, VARIANT *p)
1629 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1630 TRACE("(%p)->(%p)\n", This, p);
1631 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_LEFT_WIDTH, p, 0);
1634 static HRESULT WINAPI HTMLStyle_put_borderStyle(IHTMLStyle *iface, BSTR v)
1636 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1637 static const WCHAR styleWindowInset[] = {'w','i','n','d','o','w','-','i','n','s','e','t',0};
1638 HRESULT hres = S_OK;
1643 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1645 while(v[i] && hres == S_OK)
1647 if(v[i] == (WCHAR)' ')
1649 pstyle = SysAllocStringLen(&v[last], (i-last));
1650 if( !(is_valid_border_style(pstyle) || strcmpiW(styleWindowInset, pstyle) == 0))
1652 TRACE("1. Invalid style (%s)\n", debugstr_w(pstyle));
1653 hres = E_INVALIDARG;
1655 SysFreeString(pstyle);
1663 pstyle = SysAllocStringLen(&v[last], i-last);
1664 if( !(is_valid_border_style(pstyle) || strcmpiW(styleWindowInset, pstyle) == 0))
1666 TRACE("2. Invalid style (%s)\n", debugstr_w(pstyle));
1667 hres = E_INVALIDARG;
1669 SysFreeString(pstyle);
1673 hres = set_nsstyle_attr(This->nsstyle, STYLEID_BORDER_STYLE, v, 0);
1678 static HRESULT WINAPI HTMLStyle_get_borderStyle(IHTMLStyle *iface, BSTR *p)
1680 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1681 TRACE("(%p)->(%p)\n", This, p);
1682 return get_style_attr(This, STYLEID_BORDER_STYLE, p);
1685 static HRESULT WINAPI HTMLStyle_put_borderTopStyle(IHTMLStyle *iface, BSTR v)
1687 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1688 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1690 if(!is_valid_border_style(v))
1691 return E_INVALIDARG;
1693 return set_style_attr(This, STYLEID_BORDER_TOP_STYLE, v, 0);
1696 static HRESULT WINAPI HTMLStyle_get_borderTopStyle(IHTMLStyle *iface, BSTR *p)
1698 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1699 TRACE("(%p)->(%p)\n", This, p);
1700 return get_style_attr(This, STYLEID_BORDER_TOP_STYLE, p);
1703 static HRESULT WINAPI HTMLStyle_put_borderRightStyle(IHTMLStyle *iface, BSTR v)
1705 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1706 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1708 if(!is_valid_border_style(v))
1709 return E_INVALIDARG;
1711 return set_style_attr(This, STYLEID_BORDER_RIGHT_STYLE, v, 0);
1714 static HRESULT WINAPI HTMLStyle_get_borderRightStyle(IHTMLStyle *iface, BSTR *p)
1716 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1717 TRACE("(%p)->(%p)\n", This, p);
1718 return get_style_attr(This, STYLEID_BORDER_RIGHT_STYLE, p);
1721 static HRESULT WINAPI HTMLStyle_put_borderBottomStyle(IHTMLStyle *iface, BSTR v)
1723 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1724 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1726 if(!is_valid_border_style(v))
1727 return E_INVALIDARG;
1729 return set_style_attr(This, STYLEID_BORDER_BOTTOM_STYLE, v, 0);
1732 static HRESULT WINAPI HTMLStyle_get_borderBottomStyle(IHTMLStyle *iface, BSTR *p)
1734 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1735 TRACE("(%p)->(%p)\n", This, p);
1736 return get_style_attr(This, STYLEID_BORDER_BOTTOM_STYLE, p);
1739 static HRESULT WINAPI HTMLStyle_put_borderLeftStyle(IHTMLStyle *iface, BSTR v)
1741 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1742 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1744 if(!is_valid_border_style(v))
1745 return E_INVALIDARG;
1747 return set_style_attr(This, STYLEID_BORDER_LEFT_STYLE, v, 0);
1750 static HRESULT WINAPI HTMLStyle_get_borderLeftStyle(IHTMLStyle *iface, BSTR *p)
1752 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1753 TRACE("(%p)->(%p)\n", This, p);
1754 return get_style_attr(This, STYLEID_BORDER_LEFT_STYLE, p);
1757 static HRESULT WINAPI HTMLStyle_put_width(IHTMLStyle *iface, VARIANT v)
1759 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1761 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
1765 TRACE("%s\n", debugstr_w(V_BSTR(&v)));
1766 return set_style_attr(This, STYLEID_WIDTH, V_BSTR(&v), 0);
1768 FIXME("unsupported vt %d\n", V_VT(&v));
1774 static HRESULT WINAPI HTMLStyle_get_width(IHTMLStyle *iface, VARIANT *p)
1776 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1778 TRACE("(%p)->(%p)\n", This, p);
1781 return get_style_attr(This, STYLEID_WIDTH, &V_BSTR(p));
1784 static HRESULT WINAPI HTMLStyle_put_height(IHTMLStyle *iface, VARIANT v)
1786 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1788 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1792 return set_style_attr(This, STYLEID_HEIGHT, V_BSTR(&v), 0);
1794 FIXME("unimplemented vt %d\n", V_VT(&v));
1801 static HRESULT WINAPI HTMLStyle_get_height(IHTMLStyle *iface, VARIANT *p)
1803 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1807 TRACE("(%p)->(%p)\n", This, p);
1809 hres = get_style_attr(This, STYLEID_HEIGHT, &ret);
1818 static HRESULT WINAPI HTMLStyle_put_styleFloat(IHTMLStyle *iface, BSTR v)
1820 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1821 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1825 static HRESULT WINAPI HTMLStyle_get_styleFloat(IHTMLStyle *iface, BSTR *p)
1827 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1828 FIXME("(%p)->(%p)\n", This, p);
1832 static HRESULT WINAPI HTMLStyle_put_clear(IHTMLStyle *iface, BSTR v)
1834 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1835 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1839 static HRESULT WINAPI HTMLStyle_get_clear(IHTMLStyle *iface, BSTR *p)
1841 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1842 FIXME("(%p)->(%p)\n", This, p);
1846 static HRESULT WINAPI HTMLStyle_put_display(IHTMLStyle *iface, BSTR v)
1848 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1850 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1852 return set_style_attr(This, STYLEID_DISPLAY, v, 0);
1855 static HRESULT WINAPI HTMLStyle_get_display(IHTMLStyle *iface, BSTR *p)
1857 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1859 TRACE("(%p)->(%p)\n", This, p);
1861 return get_style_attr(This, STYLEID_DISPLAY, p);
1864 static HRESULT WINAPI HTMLStyle_put_visibility(IHTMLStyle *iface, BSTR v)
1866 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1868 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1870 return set_style_attr(This, STYLEID_VISIBILITY, v, 0);
1873 static HRESULT WINAPI HTMLStyle_get_visibility(IHTMLStyle *iface, BSTR *p)
1875 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1877 TRACE("(%p)->(%p)\n", This, p);
1879 return get_style_attr(This, STYLEID_VISIBILITY, p);
1882 static HRESULT WINAPI HTMLStyle_put_listStyleType(IHTMLStyle *iface, BSTR v)
1884 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1885 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1889 static HRESULT WINAPI HTMLStyle_get_listStyleType(IHTMLStyle *iface, BSTR *p)
1891 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1892 FIXME("(%p)->(%p)\n", This, p);
1896 static HRESULT WINAPI HTMLStyle_put_listStylePosition(IHTMLStyle *iface, BSTR v)
1898 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1899 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1903 static HRESULT WINAPI HTMLStyle_get_listStylePosition(IHTMLStyle *iface, BSTR *p)
1905 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1906 FIXME("(%p)->(%p)\n", This, p);
1910 static HRESULT WINAPI HTMLStyle_put_listStyleImage(IHTMLStyle *iface, BSTR v)
1912 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1913 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1917 static HRESULT WINAPI HTMLStyle_get_listStyleImage(IHTMLStyle *iface, BSTR *p)
1919 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1920 FIXME("(%p)->(%p)\n", This, p);
1924 static HRESULT WINAPI HTMLStyle_put_listStyle(IHTMLStyle *iface, BSTR v)
1926 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1927 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1931 static HRESULT WINAPI HTMLStyle_get_listStyle(IHTMLStyle *iface, BSTR *p)
1933 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1934 FIXME("(%p)->(%p)\n", This, p);
1938 static HRESULT WINAPI HTMLStyle_put_whiteSpace(IHTMLStyle *iface, BSTR v)
1940 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1941 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1945 static HRESULT WINAPI HTMLStyle_get_whiteSpace(IHTMLStyle *iface, BSTR *p)
1947 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1948 FIXME("(%p)->(%p)\n", This, p);
1952 static HRESULT WINAPI HTMLStyle_put_top(IHTMLStyle *iface, VARIANT v)
1954 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1956 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1958 return set_nsstyle_attr_var(This->nsstyle, STYLEID_TOP, &v, 0);
1961 static HRESULT WINAPI HTMLStyle_get_top(IHTMLStyle *iface, VARIANT *p)
1963 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1967 TRACE("(%p)->(%p)\n", This, p);
1969 hres = get_style_attr(This, STYLEID_TOP, &ret);
1978 static HRESULT WINAPI HTMLStyle_put_left(IHTMLStyle *iface, VARIANT v)
1980 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1982 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1984 return set_nsstyle_attr_var(This->nsstyle, STYLEID_LEFT, &v, 0);
1987 static HRESULT WINAPI HTMLStyle_get_left(IHTMLStyle *iface, VARIANT *p)
1989 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1993 TRACE("(%p)->(%p)\n", This, p);
1995 hres = get_style_attr(This, STYLEID_LEFT, &ret);
2004 static HRESULT WINAPI HTMLStyle_get_position(IHTMLStyle *iface, BSTR *p)
2006 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2007 TRACE("(%p)->(%p)\n", This, p);
2008 return IHTMLStyle2_get_position(HTMLSTYLE2(This), p);
2011 static HRESULT WINAPI HTMLStyle_put_zIndex(IHTMLStyle *iface, VARIANT v)
2013 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2015 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
2019 return set_style_attr(This, STYLEID_Z_INDEX, V_BSTR(&v), 0);
2022 static const WCHAR format[] = {'%','d',0};
2024 wsprintfW(value, format, V_I4(&v));
2025 return set_style_attr(This, STYLEID_Z_INDEX, value, 0);
2028 FIXME("unimplemented vt %d\n", V_VT(&v));
2035 static HRESULT WINAPI HTMLStyle_get_zIndex(IHTMLStyle *iface, VARIANT *p)
2037 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2039 TRACE("(%p)->(%p)\n", This, p);
2041 return get_nsstyle_attr_var(This->nsstyle, STYLEID_Z_INDEX, p, ATTR_STR_TO_INT);
2044 static HRESULT WINAPI HTMLStyle_put_overflow(IHTMLStyle *iface, BSTR v)
2046 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2047 static const WCHAR szVisible[] = {'v','i','s','i','b','l','e',0};
2048 static const WCHAR szScroll[] = {'s','c','r','o','l','l',0};
2049 static const WCHAR szHidden[] = {'h','i','d','d','e','n',0};
2050 static const WCHAR szAuto[] = {'a','u','t','o',0};
2052 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2054 /* overflow can only be one of the follow values. */
2055 if(!v || !*v || strcmpiW(szVisible, v) == 0 || strcmpiW(szScroll, v) == 0 ||
2056 strcmpiW(szHidden, v) == 0 || strcmpiW(szAuto, v) == 0)
2058 return set_nsstyle_attr(This->nsstyle, STYLEID_OVERFLOW, v, 0);
2061 return E_INVALIDARG;
2065 static HRESULT WINAPI HTMLStyle_get_overflow(IHTMLStyle *iface, BSTR *p)
2067 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2069 TRACE("(%p)->(%p)\n", This, p);
2072 return E_INVALIDARG;
2074 return get_style_attr(This, STYLEID_OVERFLOW, p);
2077 static HRESULT WINAPI HTMLStyle_put_pageBreakBefore(IHTMLStyle *iface, BSTR v)
2079 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2080 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
2084 static HRESULT WINAPI HTMLStyle_get_pageBreakBefore(IHTMLStyle *iface, BSTR *p)
2086 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2087 FIXME("(%p)->(%p)\n", This, p);
2091 static HRESULT WINAPI HTMLStyle_put_pageBreakAfter(IHTMLStyle *iface, BSTR v)
2093 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2094 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
2098 static HRESULT WINAPI HTMLStyle_get_pageBreakAfter(IHTMLStyle *iface, BSTR *p)
2100 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2101 FIXME("(%p)->(%p)\n", This, p);
2105 static HRESULT WINAPI HTMLStyle_put_cssText(IHTMLStyle *iface, BSTR v)
2107 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2111 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2113 nsAString_Init(&text_str, v);
2114 nsres = nsIDOMCSSStyleDeclaration_SetCssText(This->nsstyle, &text_str);
2115 nsAString_Finish(&text_str);
2116 if(NS_FAILED(nsres)) {
2117 FIXME("SetCssStyle failed: %08x\n", nsres);
2124 static HRESULT WINAPI HTMLStyle_get_cssText(IHTMLStyle *iface, BSTR *p)
2126 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2130 TRACE("(%p)->(%p)\n", This, p);
2132 /* FIXME: Gecko style formatting is different than IE (uppercase). */
2133 nsAString_Init(&text_str, NULL);
2134 nsres = nsIDOMCSSStyleDeclaration_GetCssText(This->nsstyle, &text_str);
2135 if(NS_SUCCEEDED(nsres)) {
2136 const PRUnichar *text;
2138 nsAString_GetData(&text_str, &text);
2139 *p = *text ? SysAllocString(text) : NULL;
2141 FIXME("GetCssStyle failed: %08x\n", nsres);
2145 nsAString_Finish(&text_str);
2149 static HRESULT WINAPI HTMLStyle_put_pixelTop(IHTMLStyle *iface, LONG v)
2151 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2152 FIXME("(%p)->()\n", This);
2156 static HRESULT WINAPI HTMLStyle_get_pixelTop(IHTMLStyle *iface, LONG *p)
2158 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2159 FIXME("(%p)->()\n", This);
2163 static HRESULT WINAPI HTMLStyle_put_pixelLeft(IHTMLStyle *iface, LONG v)
2165 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2166 FIXME("(%p)->()\n", This);
2170 static HRESULT WINAPI HTMLStyle_get_pixelLeft(IHTMLStyle *iface, LONG *p)
2172 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2173 FIXME("(%p)->()\n", This);
2177 static HRESULT WINAPI HTMLStyle_put_pixelWidth(IHTMLStyle *iface, LONG v)
2179 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2180 FIXME("(%p)->()\n", This);
2184 static HRESULT WINAPI HTMLStyle_get_pixelWidth(IHTMLStyle *iface, LONG *p)
2186 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2187 FIXME("(%p)->()\n", This);
2191 static HRESULT WINAPI HTMLStyle_put_pixelHeight(IHTMLStyle *iface, LONG v)
2193 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2194 FIXME("(%p)->()\n", This);
2198 static HRESULT WINAPI HTMLStyle_get_pixelHeight(IHTMLStyle *iface, LONG *p)
2200 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2201 FIXME("(%p)->()\n", This);
2205 static HRESULT WINAPI HTMLStyle_put_posTop(IHTMLStyle *iface, float v)
2207 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2209 TRACE("(%p)->(%f)\n", This, v);
2211 return set_style_pos(This, STYLEID_TOP, v);
2214 static HRESULT WINAPI HTMLStyle_get_posTop(IHTMLStyle *iface, float *p)
2216 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2218 TRACE("(%p)->(%p)\n", This, p);
2223 return get_nsstyle_pos(This, STYLEID_TOP, p);
2226 static HRESULT WINAPI HTMLStyle_put_posLeft(IHTMLStyle *iface, float v)
2228 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2230 TRACE("(%p)->(%f)\n", This, v);
2232 return set_style_pos(This, STYLEID_LEFT, v);
2235 static HRESULT WINAPI HTMLStyle_get_posLeft(IHTMLStyle *iface, float *p)
2237 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2239 TRACE("(%p)->(%p)\n", This, p);
2244 return get_nsstyle_pos(This, STYLEID_LEFT, p);
2247 static HRESULT WINAPI HTMLStyle_put_posWidth(IHTMLStyle *iface, float v)
2249 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2251 TRACE("(%p)->(%f)\n", This, v);
2253 return set_style_pos(This, STYLEID_WIDTH, v);
2256 static HRESULT WINAPI HTMLStyle_get_posWidth(IHTMLStyle *iface, float *p)
2258 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2260 TRACE("(%p)->(%p)\n", This, p);
2265 if(get_nsstyle_pos(This, STYLEID_WIDTH, p) != S_OK)
2271 static HRESULT WINAPI HTMLStyle_put_posHeight(IHTMLStyle *iface, float v)
2273 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2275 TRACE("(%p)->(%f)\n", This, v);
2277 return set_style_pos(This, STYLEID_HEIGHT, v);
2280 static HRESULT WINAPI HTMLStyle_get_posHeight(IHTMLStyle *iface, float *p)
2282 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2284 TRACE("(%p)->(%p)\n", This, p);
2289 if(get_nsstyle_pos(This, STYLEID_HEIGHT, p) != S_OK)
2295 static HRESULT WINAPI HTMLStyle_put_cursor(IHTMLStyle *iface, BSTR v)
2297 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2299 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2301 return set_style_attr(This, STYLEID_CURSOR, v, 0);
2304 static HRESULT WINAPI HTMLStyle_get_cursor(IHTMLStyle *iface, BSTR *p)
2306 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2308 TRACE("(%p)->(%p)\n", This, p);
2310 return get_style_attr(This, STYLEID_CURSOR, p);
2313 static HRESULT WINAPI HTMLStyle_put_clip(IHTMLStyle *iface, BSTR v)
2315 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2316 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
2320 static HRESULT WINAPI HTMLStyle_get_clip(IHTMLStyle *iface, BSTR *p)
2322 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2323 FIXME("(%p)->(%p)\n", This, p);
2327 static HRESULT WINAPI HTMLStyle_put_filter(IHTMLStyle *iface, BSTR v)
2329 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2331 WARN("(%p)->(%s)\n", This, debugstr_w(v));
2333 /* FIXME: Handle MS-style filters */
2334 return set_style_attr(This, STYLEID_FILTER, v, 0);
2337 static HRESULT WINAPI HTMLStyle_get_filter(IHTMLStyle *iface, BSTR *p)
2339 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2341 WARN("(%p)->(%p)\n", This, p);
2343 /* FIXME: Handle MS-style filters */
2344 return get_style_attr(This, STYLEID_FILTER, p);
2347 static HRESULT WINAPI HTMLStyle_setAttribute(IHTMLStyle *iface, BSTR strAttributeName,
2348 VARIANT AttributeValue, LONG lFlags)
2350 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2354 TRACE("(%p)->(%s v%d %08x)\n", This, debugstr_w(strAttributeName),
2355 V_VT(&AttributeValue), lFlags);
2357 if(!strAttributeName)
2358 return E_INVALIDARG;
2361 FIXME("Parameter lFlags ignored\n");
2363 hres = HTMLStyle_GetIDsOfNames(iface, &IID_NULL, &strAttributeName, 1,
2364 LOCALE_USER_DEFAULT, &dispid);
2368 DISPID dispidNamed = DISPID_PROPERTYPUT;
2372 params.rgvarg = &AttributeValue;
2373 params.cNamedArgs = 1;
2374 params.rgdispidNamedArgs = &dispidNamed;
2376 hres = HTMLStyle_Invoke(iface, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
2377 DISPATCH_PROPERTYPUT, ¶ms, &ret, NULL, NULL);
2381 FIXME("Custom attributes not supported.\n");
2384 TRACE("ret: %08x\n", hres);
2389 static HRESULT WINAPI HTMLStyle_getAttribute(IHTMLStyle *iface, BSTR strAttributeName,
2390 LONG lFlags, VARIANT *AttributeValue)
2392 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2396 TRACE("(%p)->(%s v%p %08x)\n", This, debugstr_w(strAttributeName),
2397 AttributeValue, lFlags);
2399 if(!AttributeValue || !strAttributeName)
2400 return E_INVALIDARG;
2403 FIXME("Parameter lFlags ignored\n");
2405 hres = HTMLStyle_GetIDsOfNames(iface, &IID_NULL, &strAttributeName, 1,
2406 LOCALE_USER_DEFAULT, &dispid);
2409 DISPPARAMS params = {NULL, NULL, 0, 0 };
2411 hres = HTMLStyle_Invoke(iface, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
2412 DISPATCH_PROPERTYGET, ¶ms, AttributeValue, NULL, NULL);
2416 FIXME("Custom attributes not supported.\n");
2422 static HRESULT WINAPI HTMLStyle_removeAttribute(IHTMLStyle *iface, BSTR strAttributeName,
2423 LONG lFlags, VARIANT_BOOL *pfSuccess)
2425 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2426 FIXME("(%p)->(%s %08x %p)\n", This, debugstr_w(strAttributeName),
2431 static HRESULT WINAPI HTMLStyle_toString(IHTMLStyle *iface, BSTR *String)
2433 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2434 FIXME("(%p)->(%p)\n", This, String);
2438 static HRESULT HTMLStyle_get_dispid(IUnknown *iface, BSTR name, DWORD flags, DISPID *dispid)
2440 int c, i, min=0, max = sizeof(style_tbl)/sizeof(*style_tbl)-1;
2445 c = strcmpW(style_tbl[i].name, name);
2447 *dispid = style_tbl[i].dispid;
2457 return DISP_E_UNKNOWNNAME;
2460 static const IHTMLStyleVtbl HTMLStyleVtbl = {
2461 HTMLStyle_QueryInterface,
2464 HTMLStyle_GetTypeInfoCount,
2465 HTMLStyle_GetTypeInfo,
2466 HTMLStyle_GetIDsOfNames,
2468 HTMLStyle_put_fontFamily,
2469 HTMLStyle_get_fontFamily,
2470 HTMLStyle_put_fontStyle,
2471 HTMLStyle_get_fontStyle,
2472 HTMLStyle_put_fontVariant,
2473 HTMLStyle_get_fontVariant,
2474 HTMLStyle_put_fontWeight,
2475 HTMLStyle_get_fontWeight,
2476 HTMLStyle_put_fontSize,
2477 HTMLStyle_get_fontSize,
2480 HTMLStyle_put_color,
2481 HTMLStyle_get_color,
2482 HTMLStyle_put_background,
2483 HTMLStyle_get_background,
2484 HTMLStyle_put_backgroundColor,
2485 HTMLStyle_get_backgroundColor,
2486 HTMLStyle_put_backgroundImage,
2487 HTMLStyle_get_backgroundImage,
2488 HTMLStyle_put_backgroundRepeat,
2489 HTMLStyle_get_backgroundRepeat,
2490 HTMLStyle_put_backgroundAttachment,
2491 HTMLStyle_get_backgroundAttachment,
2492 HTMLStyle_put_backgroundPosition,
2493 HTMLStyle_get_backgroundPosition,
2494 HTMLStyle_put_backgroundPositionX,
2495 HTMLStyle_get_backgroundPositionX,
2496 HTMLStyle_put_backgroundPositionY,
2497 HTMLStyle_get_backgroundPositionY,
2498 HTMLStyle_put_wordSpacing,
2499 HTMLStyle_get_wordSpacing,
2500 HTMLStyle_put_letterSpacing,
2501 HTMLStyle_get_letterSpacing,
2502 HTMLStyle_put_textDecoration,
2503 HTMLStyle_get_textDecoration,
2504 HTMLStyle_put_textDecorationNone,
2505 HTMLStyle_get_textDecorationNone,
2506 HTMLStyle_put_textDecorationUnderline,
2507 HTMLStyle_get_textDecorationUnderline,
2508 HTMLStyle_put_textDecorationOverline,
2509 HTMLStyle_get_textDecorationOverline,
2510 HTMLStyle_put_textDecorationLineThrough,
2511 HTMLStyle_get_textDecorationLineThrough,
2512 HTMLStyle_put_textDecorationBlink,
2513 HTMLStyle_get_textDecorationBlink,
2514 HTMLStyle_put_verticalAlign,
2515 HTMLStyle_get_verticalAlign,
2516 HTMLStyle_put_textTransform,
2517 HTMLStyle_get_textTransform,
2518 HTMLStyle_put_textAlign,
2519 HTMLStyle_get_textAlign,
2520 HTMLStyle_put_textIndent,
2521 HTMLStyle_get_textIndent,
2522 HTMLStyle_put_lineHeight,
2523 HTMLStyle_get_lineHeight,
2524 HTMLStyle_put_marginTop,
2525 HTMLStyle_get_marginTop,
2526 HTMLStyle_put_marginRight,
2527 HTMLStyle_get_marginRight,
2528 HTMLStyle_put_marginBottom,
2529 HTMLStyle_get_marginBottom,
2530 HTMLStyle_put_marginLeft,
2531 HTMLStyle_get_marginLeft,
2532 HTMLStyle_put_margin,
2533 HTMLStyle_get_margin,
2534 HTMLStyle_put_paddingTop,
2535 HTMLStyle_get_paddingTop,
2536 HTMLStyle_put_paddingRight,
2537 HTMLStyle_get_paddingRight,
2538 HTMLStyle_put_paddingBottom,
2539 HTMLStyle_get_paddingBottom,
2540 HTMLStyle_put_paddingLeft,
2541 HTMLStyle_get_paddingLeft,
2542 HTMLStyle_put_padding,
2543 HTMLStyle_get_padding,
2544 HTMLStyle_put_border,
2545 HTMLStyle_get_border,
2546 HTMLStyle_put_borderTop,
2547 HTMLStyle_get_borderTop,
2548 HTMLStyle_put_borderRight,
2549 HTMLStyle_get_borderRight,
2550 HTMLStyle_put_borderBottom,
2551 HTMLStyle_get_borderBottom,
2552 HTMLStyle_put_borderLeft,
2553 HTMLStyle_get_borderLeft,
2554 HTMLStyle_put_borderColor,
2555 HTMLStyle_get_borderColor,
2556 HTMLStyle_put_borderTopColor,
2557 HTMLStyle_get_borderTopColor,
2558 HTMLStyle_put_borderRightColor,
2559 HTMLStyle_get_borderRightColor,
2560 HTMLStyle_put_borderBottomColor,
2561 HTMLStyle_get_borderBottomColor,
2562 HTMLStyle_put_borderLeftColor,
2563 HTMLStyle_get_borderLeftColor,
2564 HTMLStyle_put_borderWidth,
2565 HTMLStyle_get_borderWidth,
2566 HTMLStyle_put_borderTopWidth,
2567 HTMLStyle_get_borderTopWidth,
2568 HTMLStyle_put_borderRightWidth,
2569 HTMLStyle_get_borderRightWidth,
2570 HTMLStyle_put_borderBottomWidth,
2571 HTMLStyle_get_borderBottomWidth,
2572 HTMLStyle_put_borderLeftWidth,
2573 HTMLStyle_get_borderLeftWidth,
2574 HTMLStyle_put_borderStyle,
2575 HTMLStyle_get_borderStyle,
2576 HTMLStyle_put_borderTopStyle,
2577 HTMLStyle_get_borderTopStyle,
2578 HTMLStyle_put_borderRightStyle,
2579 HTMLStyle_get_borderRightStyle,
2580 HTMLStyle_put_borderBottomStyle,
2581 HTMLStyle_get_borderBottomStyle,
2582 HTMLStyle_put_borderLeftStyle,
2583 HTMLStyle_get_borderLeftStyle,
2584 HTMLStyle_put_width,
2585 HTMLStyle_get_width,
2586 HTMLStyle_put_height,
2587 HTMLStyle_get_height,
2588 HTMLStyle_put_styleFloat,
2589 HTMLStyle_get_styleFloat,
2590 HTMLStyle_put_clear,
2591 HTMLStyle_get_clear,
2592 HTMLStyle_put_display,
2593 HTMLStyle_get_display,
2594 HTMLStyle_put_visibility,
2595 HTMLStyle_get_visibility,
2596 HTMLStyle_put_listStyleType,
2597 HTMLStyle_get_listStyleType,
2598 HTMLStyle_put_listStylePosition,
2599 HTMLStyle_get_listStylePosition,
2600 HTMLStyle_put_listStyleImage,
2601 HTMLStyle_get_listStyleImage,
2602 HTMLStyle_put_listStyle,
2603 HTMLStyle_get_listStyle,
2604 HTMLStyle_put_whiteSpace,
2605 HTMLStyle_get_whiteSpace,
2610 HTMLStyle_get_position,
2611 HTMLStyle_put_zIndex,
2612 HTMLStyle_get_zIndex,
2613 HTMLStyle_put_overflow,
2614 HTMLStyle_get_overflow,
2615 HTMLStyle_put_pageBreakBefore,
2616 HTMLStyle_get_pageBreakBefore,
2617 HTMLStyle_put_pageBreakAfter,
2618 HTMLStyle_get_pageBreakAfter,
2619 HTMLStyle_put_cssText,
2620 HTMLStyle_get_cssText,
2621 HTMLStyle_put_pixelTop,
2622 HTMLStyle_get_pixelTop,
2623 HTMLStyle_put_pixelLeft,
2624 HTMLStyle_get_pixelLeft,
2625 HTMLStyle_put_pixelWidth,
2626 HTMLStyle_get_pixelWidth,
2627 HTMLStyle_put_pixelHeight,
2628 HTMLStyle_get_pixelHeight,
2629 HTMLStyle_put_posTop,
2630 HTMLStyle_get_posTop,
2631 HTMLStyle_put_posLeft,
2632 HTMLStyle_get_posLeft,
2633 HTMLStyle_put_posWidth,
2634 HTMLStyle_get_posWidth,
2635 HTMLStyle_put_posHeight,
2636 HTMLStyle_get_posHeight,
2637 HTMLStyle_put_cursor,
2638 HTMLStyle_get_cursor,
2641 HTMLStyle_put_filter,
2642 HTMLStyle_get_filter,
2643 HTMLStyle_setAttribute,
2644 HTMLStyle_getAttribute,
2645 HTMLStyle_removeAttribute,
2649 static const dispex_static_data_vtbl_t HTMLStyle_dispex_vtbl = {
2651 HTMLStyle_get_dispid,
2655 static const tid_t HTMLStyle_iface_tids[] = {
2662 static dispex_static_data_t HTMLStyle_dispex = {
2663 &HTMLStyle_dispex_vtbl,
2666 HTMLStyle_iface_tids
2669 IHTMLStyle *HTMLStyle_Create(nsIDOMCSSStyleDeclaration *nsstyle)
2671 HTMLStyle *ret = heap_alloc_zero(sizeof(HTMLStyle));
2673 ret->lpHTMLStyleVtbl = &HTMLStyleVtbl;
2675 ret->nsstyle = nsstyle;
2676 HTMLStyle2_Init(ret);
2677 HTMLStyle3_Init(ret);
2679 nsIDOMCSSStyleDeclaration_AddRef(nsstyle);
2681 init_dispex(&ret->dispex, (IUnknown*)HTMLSTYLE(ret), &HTMLStyle_dispex);
2683 return HTMLSTYLE(ret);