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 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 attrBorderLeftWidth[] =
63 {'b','o','r','d','e','r','-','l','e','f','t','-','w','i','d','t','h',0};
64 static const WCHAR attrBorderRightStyle[] =
65 {'b','o','r','d','e','r','-','r','i','g','h','t','-','s','t','y','l','e',0};
66 static const WCHAR attrBorderRightWidth[] =
67 {'b','o','r','d','e','r','-','r','i','g','h','t','-','w','i','d','t','h',0};
68 static const WCHAR attrBorderStyle[] =
69 {'b','o','r','d','e','r','-','s','t','y','l','e',0};
70 static const WCHAR attrBorderTopStyle[] =
71 {'b','o','r','d','e','r','-','t','o','p','-','s','t','y','l','e',0};
72 static const WCHAR attrBorderTopWidth[] =
73 {'b','o','r','d','e','r','-','t','o','p','-','w','i','d','t','h',0};
74 static const WCHAR attrBorderWidth[] =
75 {'b','o','r','d','e','r','-','w','i','d','t','h',0};
76 static const WCHAR attrColor[] =
77 {'c','o','l','o','r',0};
78 static const WCHAR attrCursor[] =
79 {'c','u','r','s','o','r',0};
80 static const WCHAR attrDisplay[] =
81 {'d','i','s','p','l','a','y',0};
82 static const WCHAR attrFilter[] =
83 {'f','i','l','e','t','e','r',0};
84 static const WCHAR attrFontFamily[] =
85 {'f','o','n','t','-','f','a','m','i','l','y',0};
86 static const WCHAR attrFontSize[] =
87 {'f','o','n','t','-','s','i','z','e',0};
88 static const WCHAR attrFontStyle[] =
89 {'f','o','n','t','-','s','t','y','l','e',0};
90 static const WCHAR attrFontVariant[] =
91 {'f','o','n','t','-','v','a','r','i','a','n','t',0};
92 static const WCHAR attrFontWeight[] =
93 {'f','o','n','t','-','w','e','i','g','h','t',0};
94 static const WCHAR attrHeight[] =
95 {'h','e','i','g','h','t',0};
96 static const WCHAR attrLeft[] =
98 static const WCHAR attrMargin[] =
99 {'m','a','r','g','i','n',0};
100 static const WCHAR attrMarginLeft[] =
101 {'m','a','r','g','i','n','-','l','e','f','t',0};
102 static const WCHAR attrMarginRight[] =
103 {'m','a','r','g','i','n','-','r','i','g','h','t',0};
104 static const WCHAR attrMinHeight[] =
105 {'m','i','n','-','h','e','i','g','h','t',0};
106 static const WCHAR attrOverflow[] =
107 {'o','v','e','r','f','l','o','w',0};
108 static const WCHAR attrPaddingLeft[] =
109 {'p','a','d','d','i','n','g','-','l','e','f','t',0};
110 static const WCHAR attrPosition[] =
111 {'p','o','s','i','t','i','o','n',0};
112 static const WCHAR attrTextAlign[] =
113 {'t','e','x','t','-','a','l','i','g','n',0};
114 static const WCHAR attrTextDecoration[] =
115 {'t','e','x','t','-','d','e','c','o','r','a','t','i','o','n',0};
116 static const WCHAR attrTop[] =
118 static const WCHAR attrVerticalAlign[] =
119 {'v','e','r','t','i','c','a','l','-','a','l','i','g','n',0};
120 static const WCHAR attrVisibility[] =
121 {'v','i','s','i','b','i','l','i','t','y',0};
122 static const WCHAR attrWidth[] =
123 {'w','i','d','t','h',0};
124 static const WCHAR attrWordWrap[] =
125 {'w','o','r','d','-','w','r','a','p',0};
126 static const WCHAR attrZIndex[] =
127 {'z','-','i','n','d','e','x',0};
133 {attrBackground, DISPID_IHTMLSTYLE_BACKGROUND},
134 {attrBackgroundColor, DISPID_IHTMLSTYLE_BACKGROUNDCOLOR},
135 {attrBackgroundImage, DISPID_IHTMLSTYLE_BACKGROUNDIMAGE},
136 {attrBackgroundPositionX, DISPID_IHTMLSTYLE_BACKGROUNDPOSITIONX},
137 {attrBackgroundPositionY, DISPID_IHTMLSTYLE_BACKGROUNDPOSITIONY},
138 {attrBackgroundRepeat, DISPID_IHTMLSTYLE_BACKGROUNDREPEAT},
139 {attrBorder, DISPID_IHTMLSTYLE_BORDER},
140 {attrBorderBottomStyle, DISPID_IHTMLSTYLE_BORDERBOTTOMSTYLE},
141 {attrBorderBottomWidth, DISPID_IHTMLSTYLE_BORDERBOTTOMWIDTH},
142 {attrBorderColor, DISPID_IHTMLSTYLE_BORDERCOLOR},
143 {attrBorderLeft, DISPID_IHTMLSTYLE_BORDERLEFT},
144 {attrBorderLeftStyle, DISPID_IHTMLSTYLE_BORDERLEFTSTYLE},
145 {attrBorderLeftWidth, DISPID_IHTMLSTYLE_BORDERLEFTWIDTH},
146 {attrBorderRightStyle, DISPID_IHTMLSTYLE_BORDERRIGHTSTYLE},
147 {attrBorderRightWidth, DISPID_IHTMLSTYLE_BORDERRIGHTWIDTH},
148 {attrBorderStyle, DISPID_IHTMLSTYLE_BORDERSTYLE},
149 {attrBorderTopStyle, DISPID_IHTMLSTYLE_BORDERTOPSTYLE},
150 {attrBorderTopWidth, DISPID_IHTMLSTYLE_BORDERTOPWIDTH},
151 {attrBorderWidth, DISPID_IHTMLSTYLE_BORDERWIDTH},
152 {attrColor, DISPID_IHTMLSTYLE_COLOR},
153 {attrCursor, DISPID_IHTMLSTYLE_CURSOR},
154 {attrDisplay, DISPID_IHTMLSTYLE_DISPLAY},
155 {attrFilter, DISPID_IHTMLSTYLE_FILTER},
156 {attrFontFamily, DISPID_IHTMLSTYLE_FONTFAMILY},
157 {attrFontSize, DISPID_IHTMLSTYLE_FONTSIZE},
158 {attrFontStyle, DISPID_IHTMLSTYLE_FONTSTYLE},
159 {attrFontVariant, DISPID_IHTMLSTYLE_FONTVARIANT},
160 {attrFontWeight, DISPID_IHTMLSTYLE_FONTWEIGHT},
161 {attrHeight, DISPID_IHTMLSTYLE_HEIGHT},
162 {attrLeft, DISPID_IHTMLSTYLE_LEFT},
163 {attrMargin, DISPID_IHTMLSTYLE_MARGIN},
164 {attrMarginLeft, DISPID_IHTMLSTYLE_MARGINLEFT},
165 {attrMarginRight, DISPID_IHTMLSTYLE_MARGINRIGHT},
166 {attrMinHeight, DISPID_IHTMLSTYLE4_MINHEIGHT},
167 {attrOverflow, DISPID_IHTMLSTYLE_OVERFLOW},
168 {attrPaddingLeft, DISPID_IHTMLSTYLE_PADDINGLEFT},
169 {attrPosition, DISPID_IHTMLSTYLE2_POSITION},
170 {attrTextAlign, DISPID_IHTMLSTYLE_TEXTALIGN},
171 {attrTextDecoration, DISPID_IHTMLSTYLE_TEXTDECORATION},
172 {attrTop, DISPID_IHTMLSTYLE_TOP},
173 {attrVerticalAlign, DISPID_IHTMLSTYLE_VERTICALALIGN},
174 {attrVisibility, DISPID_IHTMLSTYLE_VISIBILITY},
175 {attrWidth, DISPID_IHTMLSTYLE_WIDTH},
176 {attrWordWrap, DISPID_IHTMLSTYLE3_WORDWRAP},
177 {attrZIndex, DISPID_IHTMLSTYLE_ZINDEX}
180 static const WCHAR valLineThrough[] =
181 {'l','i','n','e','-','t','h','r','o','u','g','h',0};
182 static const WCHAR valUnderline[] =
183 {'u','n','d','e','r','l','i','n','e',0};
184 static const WCHAR szNormal[] =
185 {'n','o','r','m','a','l',0};
186 static const WCHAR styleNone[] =
188 static const WCHAR valOverline[] =
189 {'o','v','e','r','l','i','n','e',0};
190 static const WCHAR valBlink[] =
191 {'b','l','i','n','k',0};
193 static const WCHAR px_formatW[] = {'%','d','p','x',0};
194 static const WCHAR emptyW[] = {0};
196 static LPWSTR fix_px_value(LPCWSTR val)
201 while(*ptr && isspaceW(*ptr))
206 while(*ptr && isdigitW(*ptr))
209 if(!*ptr || isspaceW(*ptr)) {
211 int len = strlenW(val)+1;
213 ret = heap_alloc((len+2)*sizeof(WCHAR));
214 memcpy(ret, val, (ptr-val)*sizeof(WCHAR));
220 TRACE("fixed %s -> %s\n", debugstr_w(val), debugstr_w(ret));
225 while(*ptr && !isspaceW(*ptr))
232 static LPWSTR fix_url_value(LPCWSTR val)
236 static const WCHAR urlW[] = {'u','r','l','('};
238 if(strncmpW(val, urlW, sizeof(urlW)/sizeof(WCHAR)) || !strchrW(val, '\\'))
241 ret = heap_strdupW(val);
243 for(ptr = ret; *ptr; ptr++) {
251 HRESULT set_nsstyle_attr(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, LPCWSTR value, DWORD flags)
253 nsAString str_name, str_value, str_empty;
257 static const PRUnichar wszEmpty[] = {0};
259 if(flags & ATTR_FIX_PX)
260 val = fix_px_value(value);
261 if(flags & ATTR_FIX_URL)
262 val = fix_url_value(value);
264 nsAString_Init(&str_name, style_tbl[sid].name);
265 nsAString_Init(&str_value, val ? val : value);
266 nsAString_Init(&str_empty, wszEmpty);
269 nsres = nsIDOMCSSStyleDeclaration_SetProperty(nsstyle, &str_name, &str_value, &str_empty);
271 ERR("SetProperty failed: %08x\n", nsres);
273 nsAString_Finish(&str_name);
274 nsAString_Finish(&str_value);
275 nsAString_Finish(&str_empty);
280 HRESULT set_nsstyle_attr_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, VARIANT *value, DWORD flags)
282 switch(V_VT(value)) {
284 return set_nsstyle_attr(nsstyle, sid, emptyW, flags);
287 return set_nsstyle_attr(nsstyle, sid, V_BSTR(value), flags);
291 static const WCHAR format[] = {'%','d',0};
293 wsprintfW(str, format, V_I4(value));
294 return set_nsstyle_attr(nsstyle, sid, str, flags);
297 FIXME("not implemented vt %d\n", V_VT(value));
305 static inline HRESULT set_style_attr(HTMLStyle *This, styleid_t sid, LPCWSTR value, DWORD flags)
307 return set_nsstyle_attr(This->nsstyle, sid, value, flags);
310 static HRESULT get_nsstyle_attr_nsval(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, nsAString *value)
315 nsAString_Init(&str_name, style_tbl[sid].name);
317 nsres = nsIDOMCSSStyleDeclaration_GetPropertyValue(nsstyle, &str_name, value);
318 if(NS_FAILED(nsres)) {
319 ERR("SetProperty failed: %08x\n", nsres);
323 nsAString_Finish(&str_name);
328 HRESULT get_nsstyle_attr(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, BSTR *p)
331 const PRUnichar *value;
333 nsAString_Init(&str_value, NULL);
335 get_nsstyle_attr_nsval(nsstyle, sid, &str_value);
337 nsAString_GetData(&str_value, &value);
338 *p = *value ? SysAllocString(value) : NULL;
340 nsAString_Finish(&str_value);
342 TRACE("%s -> %s\n", debugstr_w(style_tbl[sid].name), debugstr_w(*p));
346 HRESULT get_nsstyle_attr_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, VARIANT *p, DWORD flags)
349 const PRUnichar *value;
352 nsAString_Init(&str_value, NULL);
354 get_nsstyle_attr_nsval(nsstyle, sid, &str_value);
356 nsAString_GetData(&str_value, &value);
358 if(flags & ATTR_STR_TO_INT) {
359 const PRUnichar *ptr = value;
368 while(isdigitW(*ptr))
369 i = i*10 + (*ptr++ - '0');
373 V_I4(p) = neg ? -i : i;
382 str = SysAllocString(value);
384 return E_OUTOFMEMORY;
391 nsAString_Finish(&str_value);
393 TRACE("%s -> %s\n", debugstr_w(style_tbl[sid].name), debugstr_variant(p));
397 static inline HRESULT get_style_attr(HTMLStyle *This, styleid_t sid, BSTR *p)
399 return get_nsstyle_attr(This->nsstyle, sid, p);
402 static HRESULT check_style_attr_value(HTMLStyle *This, styleid_t sid, LPCWSTR exval, VARIANT_BOOL *p)
405 const PRUnichar *value;
407 nsAString_Init(&str_value, NULL);
409 get_nsstyle_attr_nsval(This->nsstyle, sid, &str_value);
411 nsAString_GetData(&str_value, &value);
412 *p = strcmpW(value, exval) ? VARIANT_FALSE : VARIANT_TRUE;
413 nsAString_Finish(&str_value);
415 TRACE("%s -> %x\n", debugstr_w(style_tbl[sid].name), *p);
419 static inline HRESULT set_style_pos(HTMLStyle *This, styleid_t sid, float value)
422 WCHAR szFormat[] = {'%','.','0','f','p','x',0};
424 value = floor(value);
426 sprintfW(szValue, szFormat, value);
428 return set_style_attr(This, sid, szValue, 0);
431 static HRESULT get_nsstyle_pos(HTMLStyle *This, styleid_t sid, float *p)
435 WCHAR pxW[] = {'p','x',0};
437 TRACE("%p %d %p\n", This, sid, p);
441 nsAString_Init(&str_value, NULL);
443 hres = get_nsstyle_attr_nsval(This->nsstyle, sid, &str_value);
447 const PRUnichar *value;
449 nsAString_GetData(&str_value, &value);
452 *p = strtolW(value, &ptr, 10);
454 if(*ptr && strcmpW(ptr, pxW))
456 nsAString_Finish(&str_value);
457 FIXME("only px values are currently supported\n");
463 TRACE("ret %f\n", *p);
465 nsAString_Finish(&str_value);
470 static BOOL is_valid_border_style(BSTR v)
472 static const WCHAR styleDotted[] = {'d','o','t','t','e','d',0};
473 static const WCHAR styleDashed[] = {'d','a','s','h','e','d',0};
474 static const WCHAR styleSolid[] = {'s','o','l','i','d',0};
475 static const WCHAR styleDouble[] = {'d','o','u','b','l','e',0};
476 static const WCHAR styleGroove[] = {'g','r','o','o','v','e',0};
477 static const WCHAR styleRidge[] = {'r','i','d','g','e',0};
478 static const WCHAR styleInset[] = {'i','n','s','e','t',0};
479 static const WCHAR styleOutset[] = {'o','u','t','s','e','t',0};
481 TRACE("%s\n", debugstr_w(v));
483 if(!v || strcmpiW(v, styleNone) == 0 || strcmpiW(v, styleDotted) == 0 ||
484 strcmpiW(v, styleDashed) == 0 || strcmpiW(v, styleSolid) == 0 ||
485 strcmpiW(v, styleDouble) == 0 || strcmpiW(v, styleGroove) == 0 ||
486 strcmpiW(v, styleRidge) == 0 || strcmpiW(v, styleInset) == 0 ||
487 strcmpiW(v, styleOutset) == 0 )
495 #define HTMLSTYLE_THIS(iface) DEFINE_THIS(HTMLStyle, HTMLStyle, iface)
497 static HRESULT WINAPI HTMLStyle_QueryInterface(IHTMLStyle *iface, REFIID riid, void **ppv)
499 HTMLStyle *This = HTMLSTYLE_THIS(iface);
503 if(IsEqualGUID(&IID_IUnknown, riid)) {
504 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
505 *ppv = HTMLSTYLE(This);
506 }else if(IsEqualGUID(&IID_IHTMLStyle, riid)) {
507 TRACE("(%p)->(IID_IHTMLStyle %p)\n", This, ppv);
508 *ppv = HTMLSTYLE(This);
509 }else if(IsEqualGUID(&IID_IHTMLStyle2, riid)) {
510 TRACE("(%p)->(IID_IHTMLStyle2 %p)\n", This, ppv);
511 *ppv = HTMLSTYLE2(This);
512 }else if(IsEqualGUID(&IID_IHTMLStyle3, riid)) {
513 TRACE("(%p)->(IID_IHTMLStyle3 %p)\n", This, ppv);
514 *ppv = HTMLSTYLE3(This);
515 }else if(IsEqualGUID(&IID_IHTMLStyle4, riid)) {
516 TRACE("(%p)->(IID_IHTMLStyle4 %p)\n", This, ppv);
517 *ppv = HTMLSTYLE4(This);
518 }else if(dispex_query_interface(&This->dispex, riid, ppv)) {
519 return *ppv ? S_OK : E_NOINTERFACE;
523 IUnknown_AddRef((IUnknown*)*ppv);
527 WARN("unsupported %s\n", debugstr_guid(riid));
528 return E_NOINTERFACE;
531 static ULONG WINAPI HTMLStyle_AddRef(IHTMLStyle *iface)
533 HTMLStyle *This = HTMLSTYLE_THIS(iface);
534 LONG ref = InterlockedIncrement(&This->ref);
536 TRACE("(%p) ref=%d\n", This, ref);
541 static ULONG WINAPI HTMLStyle_Release(IHTMLStyle *iface)
543 HTMLStyle *This = HTMLSTYLE_THIS(iface);
544 LONG ref = InterlockedDecrement(&This->ref);
546 TRACE("(%p) ref=%d\n", This, ref);
550 nsIDOMCSSStyleDeclaration_Release(This->nsstyle);
557 static HRESULT WINAPI HTMLStyle_GetTypeInfoCount(IHTMLStyle *iface, UINT *pctinfo)
559 HTMLStyle *This = HTMLSTYLE_THIS(iface);
560 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->dispex), pctinfo);
563 static HRESULT WINAPI HTMLStyle_GetTypeInfo(IHTMLStyle *iface, UINT iTInfo,
564 LCID lcid, ITypeInfo **ppTInfo)
566 HTMLStyle *This = HTMLSTYLE_THIS(iface);
567 return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->dispex), iTInfo, lcid, ppTInfo);
570 static HRESULT WINAPI HTMLStyle_GetIDsOfNames(IHTMLStyle *iface, REFIID riid,
571 LPOLESTR *rgszNames, UINT cNames,
572 LCID lcid, DISPID *rgDispId)
574 HTMLStyle *This = HTMLSTYLE_THIS(iface);
575 return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->dispex), riid, rgszNames, cNames, lcid, rgDispId);
578 static HRESULT WINAPI HTMLStyle_Invoke(IHTMLStyle *iface, DISPID dispIdMember,
579 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
580 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
582 HTMLStyle *This = HTMLSTYLE_THIS(iface);
583 return IDispatchEx_Invoke(DISPATCHEX(&This->dispex), dispIdMember, riid, lcid,
584 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
587 static HRESULT WINAPI HTMLStyle_put_fontFamily(IHTMLStyle *iface, BSTR v)
589 HTMLStyle *This = HTMLSTYLE_THIS(iface);
591 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
593 return set_style_attr(This, STYLEID_FONT_FAMILY, v, 0);
596 static HRESULT WINAPI HTMLStyle_get_fontFamily(IHTMLStyle *iface, BSTR *p)
598 HTMLStyle *This = HTMLSTYLE_THIS(iface);
600 TRACE("(%p)->(%p)\n", This, p);
602 return get_style_attr(This, STYLEID_FONT_FAMILY, p);
605 static HRESULT WINAPI HTMLStyle_put_fontStyle(IHTMLStyle *iface, BSTR v)
607 HTMLStyle *This = HTMLSTYLE_THIS(iface);
608 static const WCHAR szItalic[] = {'i','t','a','l','i','c',0};
609 static const WCHAR szOblique[] = {'o','b','l','i','q','u','e',0};
611 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
613 /* fontStyle can only be one of the follow values. */
614 if(!v || strcmpiW(szNormal, v) == 0 || strcmpiW(szItalic, v) == 0 ||
615 strcmpiW(szOblique, v) == 0)
617 return set_nsstyle_attr(This->nsstyle, STYLEID_FONT_STYLE, v, 0);
623 static HRESULT WINAPI HTMLStyle_get_fontStyle(IHTMLStyle *iface, BSTR *p)
625 HTMLStyle *This = HTMLSTYLE_THIS(iface);
627 TRACE("(%p)->(%p)\n", This, p);
629 return get_style_attr(This, STYLEID_FONT_STYLE, p);
632 static HRESULT WINAPI HTMLStyle_put_fontVariant(IHTMLStyle *iface, BSTR v)
634 HTMLStyle *This = HTMLSTYLE_THIS(iface);
635 static const WCHAR szCaps[] = {'s','m','a','l','l','-','c','a','p','s',0};
637 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
639 /* fontVariant can only be one of the follow values. */
640 if(!v || strcmpiW(szNormal, v) == 0 || strcmpiW(szCaps, v) == 0)
642 return set_nsstyle_attr(This->nsstyle, STYLEID_FONT_VARIANT, v, 0);
648 static HRESULT WINAPI HTMLStyle_get_fontVariant(IHTMLStyle *iface, BSTR *p)
650 HTMLStyle *This = HTMLSTYLE_THIS(iface);
651 TRACE("(%p)->(%p)\n", This, p);
656 return get_style_attr(This, STYLEID_FONT_VARIANT, p);
659 static HRESULT WINAPI HTMLStyle_put_fontWeight(IHTMLStyle *iface, BSTR v)
661 HTMLStyle *This = HTMLSTYLE_THIS(iface);
662 static const WCHAR styleBold[] = {'b','o','l','d',0};
663 static const WCHAR styleBolder[] = {'b','o','l','d','e','r',0};
664 static const WCHAR styleLighter[] = {'l','i','g','h','t','e','r',0};
665 static const WCHAR style100[] = {'1','0','0',0};
666 static const WCHAR style200[] = {'2','0','0',0};
667 static const WCHAR style300[] = {'3','0','0',0};
668 static const WCHAR style400[] = {'4','0','0',0};
669 static const WCHAR style500[] = {'5','0','0',0};
670 static const WCHAR style600[] = {'6','0','0',0};
671 static const WCHAR style700[] = {'7','0','0',0};
672 static const WCHAR style800[] = {'8','0','0',0};
673 static const WCHAR style900[] = {'9','0','0',0};
675 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
677 /* fontWeight can only be one of the following */
678 if(!v || strcmpiW(szNormal, v) == 0 || strcmpiW(styleBold, v) == 0 ||
679 strcmpiW(styleBolder, v) == 0 || strcmpiW(styleLighter, v) == 0 ||
680 strcmpiW(style100, v) == 0 || strcmpiW(style200, v) == 0 ||
681 strcmpiW(style300, v) == 0 || strcmpiW(style400, v) == 0 ||
682 strcmpiW(style500, v) == 0 || strcmpiW(style600, v) == 0 ||
683 strcmpiW(style700, v) == 0 || strcmpiW(style800, v) == 0 ||
684 strcmpiW(style900, v) == 0
687 return set_nsstyle_attr(This->nsstyle, STYLEID_FONT_WEIGHT, v, 0);
693 static HRESULT WINAPI HTMLStyle_get_fontWeight(IHTMLStyle *iface, BSTR *p)
695 HTMLStyle *This = HTMLSTYLE_THIS(iface);
697 TRACE("(%p)->(%p)\n", This, p);
699 return get_style_attr(This, STYLEID_FONT_WEIGHT, p);
702 static HRESULT WINAPI HTMLStyle_put_fontSize(IHTMLStyle *iface, VARIANT v)
704 HTMLStyle *This = HTMLSTYLE_THIS(iface);
706 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
710 return set_style_attr(This, STYLEID_FONT_SIZE, V_BSTR(&v), 0);
712 FIXME("not supported vt %d\n", V_VT(&v));
718 static HRESULT WINAPI HTMLStyle_get_fontSize(IHTMLStyle *iface, VARIANT *p)
720 HTMLStyle *This = HTMLSTYLE_THIS(iface);
722 TRACE("(%p)->(%p)\n", This, p);
725 return get_style_attr(This, STYLEID_FONT_SIZE, &V_BSTR(p));
728 static HRESULT WINAPI HTMLStyle_put_font(IHTMLStyle *iface, BSTR v)
730 HTMLStyle *This = HTMLSTYLE_THIS(iface);
731 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
735 static HRESULT WINAPI HTMLStyle_get_font(IHTMLStyle *iface, BSTR *p)
737 HTMLStyle *This = HTMLSTYLE_THIS(iface);
738 FIXME("(%p)->(%p)\n", This, p);
742 static HRESULT WINAPI HTMLStyle_put_color(IHTMLStyle *iface, VARIANT v)
744 HTMLStyle *This = HTMLSTYLE_THIS(iface);
746 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
750 TRACE("%s\n", debugstr_w(V_BSTR(&v)));
751 return set_style_attr(This, STYLEID_COLOR, V_BSTR(&v), 0);
754 FIXME("unsupported vt=%d\n", V_VT(&v));
760 static HRESULT WINAPI HTMLStyle_get_color(IHTMLStyle *iface, VARIANT *p)
762 HTMLStyle *This = HTMLSTYLE_THIS(iface);
764 TRACE("(%p)->(%p)\n", This, p);
767 return get_style_attr(This, STYLEID_COLOR, &V_BSTR(p));
770 static HRESULT WINAPI HTMLStyle_put_background(IHTMLStyle *iface, BSTR v)
772 HTMLStyle *This = HTMLSTYLE_THIS(iface);
774 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
776 return set_style_attr(This, STYLEID_BACKGROUND, v, 0);
779 static HRESULT WINAPI HTMLStyle_get_background(IHTMLStyle *iface, BSTR *p)
781 HTMLStyle *This = HTMLSTYLE_THIS(iface);
783 TRACE("(%p)->(%p)\n", This, p);
785 return get_style_attr(This, STYLEID_BACKGROUND, p);
788 static HRESULT WINAPI HTMLStyle_put_backgroundColor(IHTMLStyle *iface, VARIANT v)
790 HTMLStyle *This = HTMLSTYLE_THIS(iface);
792 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
796 return set_style_attr(This, STYLEID_BACKGROUND_COLOR, V_BSTR(&v), 0);
799 static const WCHAR format[] = {'#','%','0','6','x',0};
801 wsprintfW(value, format, V_I4(&v));
802 return set_style_attr(This, STYLEID_BACKGROUND_COLOR, value, 0);
805 FIXME("unsupported vt %d\n", V_VT(&v));
811 static HRESULT WINAPI HTMLStyle_get_backgroundColor(IHTMLStyle *iface, VARIANT *p)
813 HTMLStyle *This = HTMLSTYLE_THIS(iface);
814 TRACE("(%p)->(%p)\n", This, p);
817 return get_style_attr(This, STYLEID_BACKGROUND_COLOR, &V_BSTR(p));
820 static HRESULT WINAPI HTMLStyle_put_backgroundImage(IHTMLStyle *iface, BSTR v)
822 HTMLStyle *This = HTMLSTYLE_THIS(iface);
824 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
826 return set_style_attr(This, STYLEID_BACKGROUND_IMAGE, v, ATTR_FIX_URL);
829 static HRESULT WINAPI HTMLStyle_get_backgroundImage(IHTMLStyle *iface, BSTR *p)
831 HTMLStyle *This = HTMLSTYLE_THIS(iface);
833 TRACE("(%p)->(%p)\n", This, p);
835 return get_style_attr(This, STYLEID_BACKGROUND_IMAGE, p);
838 static HRESULT WINAPI HTMLStyle_put_backgroundRepeat(IHTMLStyle *iface, BSTR v)
840 HTMLStyle *This = HTMLSTYLE_THIS(iface);
841 static const WCHAR styleRepeat[] = {'r','e','p','e','a','t',0};
842 static const WCHAR styleNoRepeat[] = {'n','o','-','r','e','p','e','a','t',0};
843 static const WCHAR styleRepeatX[] = {'r','e','p','e','a','t','-','x',0};
844 static const WCHAR styleRepeatY[] = {'r','e','p','e','a','t','-','y',0};
846 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
848 /* fontWeight can only be one of the following */
849 if(!v || strcmpiW(styleRepeat, v) == 0 || strcmpiW(styleNoRepeat, v) == 0 ||
850 strcmpiW(styleRepeatX, v) == 0 || strcmpiW(styleRepeatY, v) == 0 )
852 return set_style_attr(This, STYLEID_BACKGROUND_REPEAT , v, 0);
858 static HRESULT WINAPI HTMLStyle_get_backgroundRepeat(IHTMLStyle *iface, BSTR *p)
860 HTMLStyle *This = HTMLSTYLE_THIS(iface);
862 TRACE("(%p)->(%p)\n", This, p);
864 return get_style_attr(This, STYLEID_BACKGROUND_REPEAT, p);
867 static HRESULT WINAPI HTMLStyle_put_backgroundAttachment(IHTMLStyle *iface, BSTR v)
869 HTMLStyle *This = HTMLSTYLE_THIS(iface);
870 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
874 static HRESULT WINAPI HTMLStyle_get_backgroundAttachment(IHTMLStyle *iface, BSTR *p)
876 HTMLStyle *This = HTMLSTYLE_THIS(iface);
877 FIXME("(%p)->(%p)\n", This, p);
881 static HRESULT WINAPI HTMLStyle_put_backgroundPosition(IHTMLStyle *iface, BSTR v)
883 HTMLStyle *This = HTMLSTYLE_THIS(iface);
884 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
888 static HRESULT WINAPI HTMLStyle_get_backgroundPosition(IHTMLStyle *iface, BSTR *p)
890 HTMLStyle *This = HTMLSTYLE_THIS(iface);
891 FIXME("(%p)->(%p)\n", This, p);
895 static HRESULT WINAPI HTMLStyle_put_backgroundPositionX(IHTMLStyle *iface, VARIANT v)
897 HTMLStyle *This = HTMLSTYLE_THIS(iface);
898 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
899 return set_nsstyle_attr_var(This->nsstyle, STYLEID_BACKGROUND_POSITION_X, &v, 0);
902 static HRESULT WINAPI HTMLStyle_get_backgroundPositionX(IHTMLStyle *iface, VARIANT *p)
904 HTMLStyle *This = HTMLSTYLE_THIS(iface);
905 TRACE("(%p)->(%p)\n", This, p);
906 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BACKGROUND_POSITION_X, p, 0);
909 static HRESULT WINAPI HTMLStyle_put_backgroundPositionY(IHTMLStyle *iface, VARIANT v)
911 HTMLStyle *This = HTMLSTYLE_THIS(iface);
912 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
913 return set_nsstyle_attr_var(This->nsstyle, STYLEID_BACKGROUND_POSITION_Y, &v, 0);
916 static HRESULT WINAPI HTMLStyle_get_backgroundPositionY(IHTMLStyle *iface, VARIANT *p)
918 HTMLStyle *This = HTMLSTYLE_THIS(iface);
919 TRACE("(%p)->(%p)\n", This, p);
920 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BACKGROUND_POSITION_Y, p, 0);
923 static HRESULT WINAPI HTMLStyle_put_wordSpacing(IHTMLStyle *iface, VARIANT v)
925 HTMLStyle *This = HTMLSTYLE_THIS(iface);
926 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
930 static HRESULT WINAPI HTMLStyle_get_wordSpacing(IHTMLStyle *iface, VARIANT *p)
932 HTMLStyle *This = HTMLSTYLE_THIS(iface);
933 FIXME("(%p)->(%p)\n", This, p);
937 static HRESULT WINAPI HTMLStyle_put_letterSpacing(IHTMLStyle *iface, VARIANT v)
939 HTMLStyle *This = HTMLSTYLE_THIS(iface);
940 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
944 static HRESULT WINAPI HTMLStyle_get_letterSpacing(IHTMLStyle *iface, VARIANT *p)
946 HTMLStyle *This = HTMLSTYLE_THIS(iface);
947 FIXME("(%p)->(%p)\n", This, p);
951 static HRESULT WINAPI HTMLStyle_put_textDecoration(IHTMLStyle *iface, BSTR v)
953 HTMLStyle *This = HTMLSTYLE_THIS(iface);
955 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
957 /* textDecoration can only be one of the following */
958 if(!v || strcmpiW(styleNone, v) == 0 || strcmpiW(valUnderline, v) == 0 ||
959 strcmpiW(valOverline, v) == 0 || strcmpiW(valLineThrough, v) == 0 ||
960 strcmpiW(valBlink, v) == 0)
962 return set_style_attr(This, STYLEID_TEXT_DECORATION , v, 0);
968 static HRESULT WINAPI HTMLStyle_get_textDecoration(IHTMLStyle *iface, BSTR *p)
970 HTMLStyle *This = HTMLSTYLE_THIS(iface);
972 TRACE("(%p)->(%p)\n", This, p);
974 return get_style_attr(This, STYLEID_TEXT_DECORATION, p);
977 static HRESULT WINAPI HTMLStyle_put_textDecorationNone(IHTMLStyle *iface, VARIANT_BOOL v)
979 HTMLStyle *This = HTMLSTYLE_THIS(iface);
981 TRACE("(%p)->(%x)\n", This, v);
983 return set_style_attr(This, STYLEID_TEXT_DECORATION, v ? styleNone : emptyW, 0);
986 static HRESULT WINAPI HTMLStyle_get_textDecorationNone(IHTMLStyle *iface, VARIANT_BOOL *p)
988 HTMLStyle *This = HTMLSTYLE_THIS(iface);
990 TRACE("(%p)->(%p)\n", This, p);
992 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, styleNone, p);
995 static HRESULT WINAPI HTMLStyle_put_textDecorationUnderline(IHTMLStyle *iface, VARIANT_BOOL v)
997 HTMLStyle *This = HTMLSTYLE_THIS(iface);
999 TRACE("(%p)->(%x)\n", This, v);
1001 return set_style_attr(This, STYLEID_TEXT_DECORATION, v ? valUnderline : emptyW, 0);
1004 static HRESULT WINAPI HTMLStyle_get_textDecorationUnderline(IHTMLStyle *iface, VARIANT_BOOL *p)
1006 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1008 TRACE("(%p)->(%p)\n", This, p);
1010 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, valUnderline, p);
1013 static HRESULT WINAPI HTMLStyle_put_textDecorationOverline(IHTMLStyle *iface, VARIANT_BOOL v)
1015 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1017 TRACE("(%p)->(%x)\n", This, v);
1019 return set_style_attr(This, STYLEID_TEXT_DECORATION, v ? valOverline : emptyW, 0);
1022 static HRESULT WINAPI HTMLStyle_get_textDecorationOverline(IHTMLStyle *iface, VARIANT_BOOL *p)
1024 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1026 TRACE("(%p)->(%p)\n", This, p);
1028 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, valOverline, p);
1031 static HRESULT WINAPI HTMLStyle_put_textDecorationLineThrough(IHTMLStyle *iface, VARIANT_BOOL v)
1033 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1035 TRACE("(%p)->(%x)\n", This, v);
1037 return set_style_attr(This, STYLEID_TEXT_DECORATION, v ? valLineThrough : emptyW, 0);
1040 static HRESULT WINAPI HTMLStyle_get_textDecorationLineThrough(IHTMLStyle *iface, VARIANT_BOOL *p)
1042 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1044 TRACE("(%p)->(%p)\n", This, p);
1046 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, valLineThrough, p);
1049 static HRESULT WINAPI HTMLStyle_put_textDecorationBlink(IHTMLStyle *iface, VARIANT_BOOL v)
1051 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1053 TRACE("(%p)->(%x)\n", This, v);
1055 return set_style_attr(This, STYLEID_TEXT_DECORATION, v ? valBlink : emptyW, 0);
1058 static HRESULT WINAPI HTMLStyle_get_textDecorationBlink(IHTMLStyle *iface, VARIANT_BOOL *p)
1060 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1062 TRACE("(%p)->(%p)\n", This, p);
1064 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, valBlink, p);
1067 static HRESULT WINAPI HTMLStyle_put_verticalAlign(IHTMLStyle *iface, VARIANT v)
1069 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1071 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1075 return set_style_attr(This, STYLEID_VERTICAL_ALIGN, V_BSTR(&v), 0);
1077 FIXME("not implemented vt %d\n", V_VT(&v));
1084 static HRESULT WINAPI HTMLStyle_get_verticalAlign(IHTMLStyle *iface, VARIANT *p)
1086 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1090 TRACE("(%p)->(%p)\n", This, p);
1092 hres = get_style_attr(This, STYLEID_VERTICAL_ALIGN, &ret);
1101 static HRESULT WINAPI HTMLStyle_put_textTransform(IHTMLStyle *iface, BSTR v)
1103 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1104 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1108 static HRESULT WINAPI HTMLStyle_get_textTransform(IHTMLStyle *iface, BSTR *p)
1110 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1111 FIXME("(%p)->(%p)\n", This, p);
1115 static HRESULT WINAPI HTMLStyle_put_textAlign(IHTMLStyle *iface, BSTR v)
1117 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1119 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1121 return set_style_attr(This, STYLEID_TEXT_ALIGN, v, 0);
1124 static HRESULT WINAPI HTMLStyle_get_textAlign(IHTMLStyle *iface, BSTR *p)
1126 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1128 TRACE("(%p)->(%p)\n", This, p);
1130 return get_style_attr(This, STYLEID_TEXT_ALIGN, p);
1133 static HRESULT WINAPI HTMLStyle_put_textIndent(IHTMLStyle *iface, VARIANT v)
1135 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1136 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1140 static HRESULT WINAPI HTMLStyle_get_textIndent(IHTMLStyle *iface, VARIANT *p)
1142 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1143 FIXME("(%p)->(%p)\n", This, p);
1147 static HRESULT WINAPI HTMLStyle_put_lineHeight(IHTMLStyle *iface, VARIANT v)
1149 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1150 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1154 static HRESULT WINAPI HTMLStyle_get_lineHeight(IHTMLStyle *iface, VARIANT *p)
1156 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1157 FIXME("(%p)->(%p)\n", This, p);
1161 static HRESULT WINAPI HTMLStyle_put_marginTop(IHTMLStyle *iface, VARIANT v)
1163 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1164 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1168 static HRESULT WINAPI HTMLStyle_get_marginTop(IHTMLStyle *iface, VARIANT *p)
1170 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1171 FIXME("(%p)->(%p)\n", This, p);
1175 static HRESULT WINAPI HTMLStyle_put_marginRight(IHTMLStyle *iface, VARIANT v)
1177 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1179 TRACE("(%p)->(v(%d))\n", This, V_VT(&v));
1183 return set_style_attr(This, STYLEID_MARGIN_RIGHT, emptyW, 0);
1187 wsprintfW(buf, px_formatW, V_I4(&v));
1188 return set_style_attr(This, STYLEID_MARGIN_RIGHT, buf, 0);
1191 return set_style_attr(This, STYLEID_MARGIN_RIGHT, V_BSTR(&v), 0);
1193 FIXME("Unsupported vt=%d\n", V_VT(&v));
1199 static HRESULT WINAPI HTMLStyle_get_marginRight(IHTMLStyle *iface, VARIANT *p)
1201 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1202 TRACE("(%p)->(%p)\n", This, p);
1203 return get_nsstyle_attr_var(This->nsstyle, STYLEID_MARGIN_RIGHT, p, 0);
1206 static HRESULT WINAPI HTMLStyle_put_marginBottom(IHTMLStyle *iface, VARIANT v)
1208 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1209 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1213 static HRESULT WINAPI HTMLStyle_get_marginBottom(IHTMLStyle *iface, VARIANT *p)
1215 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1216 FIXME("(%p)->(%p)\n", This, p);
1220 static HRESULT WINAPI HTMLStyle_put_marginLeft(IHTMLStyle *iface, VARIANT v)
1222 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1226 TRACE("(%p)->(NULL)\n", This);
1227 return set_style_attr(This, STYLEID_MARGIN_LEFT, emptyW, 0);
1231 TRACE("(%p)->(%d)\n", This, V_I4(&v));
1233 wsprintfW(buf, px_formatW, V_I4(&v));
1234 return set_style_attr(This, STYLEID_MARGIN_LEFT, buf, 0);
1237 TRACE("(%p)->(%s)\n", This, debugstr_w(V_BSTR(&v)));
1238 return set_style_attr(This, STYLEID_MARGIN_LEFT, V_BSTR(&v), 0);
1240 FIXME("Unsupported vt=%d\n", V_VT(&v));
1246 static HRESULT WINAPI HTMLStyle_put_margin(IHTMLStyle *iface, BSTR v)
1248 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1250 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1252 return set_style_attr(This, STYLEID_MARGIN, v, 0);
1255 static HRESULT WINAPI HTMLStyle_get_margin(IHTMLStyle *iface, BSTR *p)
1257 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1259 TRACE("(%p)->(%p)\n", This, p);
1261 return get_style_attr(This, STYLEID_MARGIN, p);
1264 static HRESULT WINAPI HTMLStyle_get_marginLeft(IHTMLStyle *iface, VARIANT *p)
1266 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1267 TRACE("(%p)->(%p)\n", This, p);
1268 return get_nsstyle_attr_var(This->nsstyle, STYLEID_MARGIN_LEFT, p, 0);
1271 static HRESULT WINAPI HTMLStyle_put_paddingTop(IHTMLStyle *iface, VARIANT v)
1273 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1274 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1278 static HRESULT WINAPI HTMLStyle_get_paddingTop(IHTMLStyle *iface, VARIANT *p)
1280 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1281 FIXME("(%p)->(%p)\n", This, p);
1285 static HRESULT WINAPI HTMLStyle_put_paddingRight(IHTMLStyle *iface, VARIANT v)
1287 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1288 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1292 static HRESULT WINAPI HTMLStyle_get_paddingRight(IHTMLStyle *iface, VARIANT *p)
1294 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1295 FIXME("(%p)->(%p)\n", This, p);
1299 static HRESULT WINAPI HTMLStyle_put_paddingBottom(IHTMLStyle *iface, VARIANT v)
1301 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1302 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1306 static HRESULT WINAPI HTMLStyle_get_paddingBottom(IHTMLStyle *iface, VARIANT *p)
1308 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1309 FIXME("(%p)->(%p)\n", This, p);
1313 static HRESULT WINAPI HTMLStyle_put_paddingLeft(IHTMLStyle *iface, VARIANT v)
1315 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1317 TRACE("(%p)->(vt=%d)\n", This, V_VT(&v));
1323 wsprintfW(buf, px_formatW, V_I4(&v));
1324 return set_style_attr(This, STYLEID_PADDING_LEFT, buf, 0);
1327 return set_style_attr(This, STYLEID_PADDING_LEFT, V_BSTR(&v), 0);
1329 FIXME("unsupported vt=%d\n", V_VT(&v));
1335 static HRESULT WINAPI HTMLStyle_get_paddingLeft(IHTMLStyle *iface, VARIANT *p)
1337 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1341 TRACE("(%p)->(%p)\n", This, p);
1343 hres = get_style_attr(This, STYLEID_PADDING_LEFT, &ret);
1352 static HRESULT WINAPI HTMLStyle_put_padding(IHTMLStyle *iface, BSTR v)
1354 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1355 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1359 static HRESULT WINAPI HTMLStyle_get_padding(IHTMLStyle *iface, BSTR *p)
1361 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1362 FIXME("(%p)->(%p)\n", This, p);
1366 static HRESULT WINAPI HTMLStyle_put_border(IHTMLStyle *iface, BSTR v)
1368 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1370 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1372 return set_style_attr(This, STYLEID_BORDER, v, 0);
1375 static HRESULT WINAPI HTMLStyle_get_border(IHTMLStyle *iface, BSTR *p)
1377 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1379 TRACE("(%p)->(%p)\n", This, p);
1381 return get_style_attr(This, STYLEID_BORDER, p);
1384 static HRESULT WINAPI HTMLStyle_put_borderTop(IHTMLStyle *iface, BSTR v)
1386 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1387 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1391 static HRESULT WINAPI HTMLStyle_get_borderTop(IHTMLStyle *iface, BSTR *p)
1393 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1394 FIXME("(%p)->(%p)\n", This, p);
1398 static HRESULT WINAPI HTMLStyle_put_borderRight(IHTMLStyle *iface, BSTR v)
1400 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1401 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1405 static HRESULT WINAPI HTMLStyle_get_borderRight(IHTMLStyle *iface, BSTR *p)
1407 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1408 FIXME("(%p)->(%p)\n", This, p);
1412 static HRESULT WINAPI HTMLStyle_put_borderBottom(IHTMLStyle *iface, BSTR v)
1414 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1415 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1419 static HRESULT WINAPI HTMLStyle_get_borderBottom(IHTMLStyle *iface, BSTR *p)
1421 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1422 FIXME("(%p)->(%p)\n", This, p);
1426 static HRESULT WINAPI HTMLStyle_put_borderLeft(IHTMLStyle *iface, BSTR v)
1428 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1430 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1432 return set_style_attr(This, STYLEID_BORDER_LEFT, v, ATTR_FIX_PX);
1435 static HRESULT WINAPI HTMLStyle_get_borderLeft(IHTMLStyle *iface, BSTR *p)
1437 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1439 TRACE("(%p)->(%p)\n", This, p);
1441 return get_style_attr(This, STYLEID_BORDER_LEFT, p);
1444 static HRESULT WINAPI HTMLStyle_put_borderColor(IHTMLStyle *iface, BSTR v)
1446 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1448 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1450 return set_style_attr(This, STYLEID_BORDER_COLOR, v, 0);
1453 static HRESULT WINAPI HTMLStyle_get_borderColor(IHTMLStyle *iface, BSTR *p)
1455 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1457 TRACE("(%p)->(%p)\n", This, p);
1459 return get_style_attr(This, STYLEID_BORDER_COLOR, p);
1462 static HRESULT WINAPI HTMLStyle_put_borderTopColor(IHTMLStyle *iface, VARIANT v)
1464 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1465 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1469 static HRESULT WINAPI HTMLStyle_get_borderTopColor(IHTMLStyle *iface, VARIANT *p)
1471 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1472 FIXME("(%p)->(%p)\n", This, p);
1476 static HRESULT WINAPI HTMLStyle_put_borderRightColor(IHTMLStyle *iface, VARIANT v)
1478 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1479 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1483 static HRESULT WINAPI HTMLStyle_get_borderRightColor(IHTMLStyle *iface, VARIANT *p)
1485 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1486 FIXME("(%p)->(%p)\n", This, p);
1490 static HRESULT WINAPI HTMLStyle_put_borderBottomColor(IHTMLStyle *iface, VARIANT v)
1492 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1493 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1497 static HRESULT WINAPI HTMLStyle_get_borderBottomColor(IHTMLStyle *iface, VARIANT *p)
1499 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1500 FIXME("(%p)->(%p)\n", This, p);
1504 static HRESULT WINAPI HTMLStyle_put_borderLeftColor(IHTMLStyle *iface, VARIANT v)
1506 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1507 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1511 static HRESULT WINAPI HTMLStyle_get_borderLeftColor(IHTMLStyle *iface, VARIANT *p)
1513 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1514 FIXME("(%p)->(%p)\n", This, p);
1518 static HRESULT WINAPI HTMLStyle_put_borderWidth(IHTMLStyle *iface, BSTR v)
1520 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1521 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1522 return set_style_attr(This, STYLEID_BORDER_WIDTH, v, ATTR_FIX_PX);
1525 static HRESULT WINAPI HTMLStyle_get_borderWidth(IHTMLStyle *iface, BSTR *p)
1527 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1528 TRACE("(%p)->(%p)\n", This, p);
1529 return get_style_attr(This, STYLEID_BORDER_WIDTH, p);
1532 static HRESULT WINAPI HTMLStyle_put_borderTopWidth(IHTMLStyle *iface, VARIANT v)
1534 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1535 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
1536 return set_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_TOP_WIDTH, &v, 0);
1539 static HRESULT WINAPI HTMLStyle_get_borderTopWidth(IHTMLStyle *iface, VARIANT *p)
1541 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1543 TRACE("(%p)->(%p)\n", This, p);
1545 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_TOP_WIDTH, p, 0);
1548 static HRESULT WINAPI HTMLStyle_put_borderRightWidth(IHTMLStyle *iface, VARIANT v)
1550 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1551 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
1552 return set_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_RIGHT_WIDTH, &v, 0);
1555 static HRESULT WINAPI HTMLStyle_get_borderRightWidth(IHTMLStyle *iface, VARIANT *p)
1557 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1558 TRACE("(%p)->(%p)\n", This, p);
1559 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_RIGHT_WIDTH, p, 0);
1562 static HRESULT WINAPI HTMLStyle_put_borderBottomWidth(IHTMLStyle *iface, VARIANT v)
1564 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1566 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
1567 return set_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_BOTTOM_WIDTH, &v, 0);
1570 static HRESULT WINAPI HTMLStyle_get_borderBottomWidth(IHTMLStyle *iface, VARIANT *p)
1572 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1573 TRACE("(%p)->(%p)\n", This, p);
1574 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_BOTTOM_WIDTH, p, 0);
1577 static HRESULT WINAPI HTMLStyle_put_borderLeftWidth(IHTMLStyle *iface, VARIANT v)
1579 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1580 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
1581 return set_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_LEFT_WIDTH, &v, 0);
1584 static HRESULT WINAPI HTMLStyle_get_borderLeftWidth(IHTMLStyle *iface, VARIANT *p)
1586 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1587 TRACE("(%p)->(%p)\n", This, p);
1588 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_LEFT_WIDTH, p, 0);
1591 static HRESULT WINAPI HTMLStyle_put_borderStyle(IHTMLStyle *iface, BSTR v)
1593 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1594 static const WCHAR styleWindowInset[] = {'w','i','n','d','o','w','-','i','n','s','e','t',0};
1595 HRESULT hres = S_OK;
1600 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1602 while(v[i] && hres == S_OK)
1604 if(v[i] == (WCHAR)' ')
1606 pstyle = SysAllocStringLen(&v[last], (i-last));
1607 if( !(is_valid_border_style(pstyle) || strcmpiW(styleWindowInset, pstyle) == 0))
1609 TRACE("1. Invalid style (%s)\n", debugstr_w(pstyle));
1610 hres = E_INVALIDARG;
1612 SysFreeString(pstyle);
1620 pstyle = SysAllocStringLen(&v[last], i-last);
1621 if( !(is_valid_border_style(pstyle) || strcmpiW(styleWindowInset, pstyle) == 0))
1623 TRACE("2. Invalid style (%s)\n", debugstr_w(pstyle));
1624 hres = E_INVALIDARG;
1626 SysFreeString(pstyle);
1630 hres = set_nsstyle_attr(This->nsstyle, STYLEID_BORDER_STYLE, v, 0);
1635 static HRESULT WINAPI HTMLStyle_get_borderStyle(IHTMLStyle *iface, BSTR *p)
1637 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1638 TRACE("(%p)->(%p)\n", This, p);
1639 return get_style_attr(This, STYLEID_BORDER_STYLE, p);
1642 static HRESULT WINAPI HTMLStyle_put_borderTopStyle(IHTMLStyle *iface, BSTR v)
1644 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1645 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1647 if(!is_valid_border_style(v))
1648 return E_INVALIDARG;
1650 return set_style_attr(This, STYLEID_BORDER_TOP_STYLE, v, 0);
1653 static HRESULT WINAPI HTMLStyle_get_borderTopStyle(IHTMLStyle *iface, BSTR *p)
1655 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1656 TRACE("(%p)->(%p)\n", This, p);
1657 return get_style_attr(This, STYLEID_BORDER_TOP_STYLE, p);
1660 static HRESULT WINAPI HTMLStyle_put_borderRightStyle(IHTMLStyle *iface, BSTR v)
1662 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1663 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1665 if(!is_valid_border_style(v))
1666 return E_INVALIDARG;
1668 return set_style_attr(This, STYLEID_BORDER_RIGHT_STYLE, v, 0);
1671 static HRESULT WINAPI HTMLStyle_get_borderRightStyle(IHTMLStyle *iface, BSTR *p)
1673 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1674 TRACE("(%p)->(%p)\n", This, p);
1675 return get_style_attr(This, STYLEID_BORDER_RIGHT_STYLE, p);
1678 static HRESULT WINAPI HTMLStyle_put_borderBottomStyle(IHTMLStyle *iface, BSTR v)
1680 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1681 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1683 if(!is_valid_border_style(v))
1684 return E_INVALIDARG;
1686 return set_style_attr(This, STYLEID_BORDER_BOTTOM_STYLE, v, 0);
1689 static HRESULT WINAPI HTMLStyle_get_borderBottomStyle(IHTMLStyle *iface, BSTR *p)
1691 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1692 TRACE("(%p)->(%p)\n", This, p);
1693 return get_style_attr(This, STYLEID_BORDER_BOTTOM_STYLE, p);
1696 static HRESULT WINAPI HTMLStyle_put_borderLeftStyle(IHTMLStyle *iface, BSTR v)
1698 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1699 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1701 if(!is_valid_border_style(v))
1702 return E_INVALIDARG;
1704 return set_style_attr(This, STYLEID_BORDER_LEFT_STYLE, v, 0);
1707 static HRESULT WINAPI HTMLStyle_get_borderLeftStyle(IHTMLStyle *iface, BSTR *p)
1709 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1710 TRACE("(%p)->(%p)\n", This, p);
1711 return get_style_attr(This, STYLEID_BORDER_LEFT_STYLE, p);
1714 static HRESULT WINAPI HTMLStyle_put_width(IHTMLStyle *iface, VARIANT v)
1716 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1718 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
1722 TRACE("%s\n", debugstr_w(V_BSTR(&v)));
1723 return set_style_attr(This, STYLEID_WIDTH, V_BSTR(&v), 0);
1725 FIXME("unsupported vt %d\n", V_VT(&v));
1731 static HRESULT WINAPI HTMLStyle_get_width(IHTMLStyle *iface, VARIANT *p)
1733 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1735 TRACE("(%p)->(%p)\n", This, p);
1738 return get_style_attr(This, STYLEID_WIDTH, &V_BSTR(p));
1741 static HRESULT WINAPI HTMLStyle_put_height(IHTMLStyle *iface, VARIANT v)
1743 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1745 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1749 return set_style_attr(This, STYLEID_HEIGHT, V_BSTR(&v), 0);
1751 FIXME("unimplemented vt %d\n", V_VT(&v));
1758 static HRESULT WINAPI HTMLStyle_get_height(IHTMLStyle *iface, VARIANT *p)
1760 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1764 TRACE("(%p)->(%p)\n", This, p);
1766 hres = get_style_attr(This, STYLEID_HEIGHT, &ret);
1775 static HRESULT WINAPI HTMLStyle_put_styleFloat(IHTMLStyle *iface, BSTR v)
1777 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1778 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1782 static HRESULT WINAPI HTMLStyle_get_styleFloat(IHTMLStyle *iface, BSTR *p)
1784 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1785 FIXME("(%p)->(%p)\n", This, p);
1789 static HRESULT WINAPI HTMLStyle_put_clear(IHTMLStyle *iface, BSTR v)
1791 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1792 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1796 static HRESULT WINAPI HTMLStyle_get_clear(IHTMLStyle *iface, BSTR *p)
1798 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1799 FIXME("(%p)->(%p)\n", This, p);
1803 static HRESULT WINAPI HTMLStyle_put_display(IHTMLStyle *iface, BSTR v)
1805 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1807 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1809 return set_style_attr(This, STYLEID_DISPLAY, v, 0);
1812 static HRESULT WINAPI HTMLStyle_get_display(IHTMLStyle *iface, BSTR *p)
1814 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1816 TRACE("(%p)->(%p)\n", This, p);
1818 return get_style_attr(This, STYLEID_DISPLAY, p);
1821 static HRESULT WINAPI HTMLStyle_put_visibility(IHTMLStyle *iface, BSTR v)
1823 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1825 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1827 return set_style_attr(This, STYLEID_VISIBILITY, v, 0);
1830 static HRESULT WINAPI HTMLStyle_get_visibility(IHTMLStyle *iface, BSTR *p)
1832 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1834 TRACE("(%p)->(%p)\n", This, p);
1836 return get_style_attr(This, STYLEID_VISIBILITY, p);
1839 static HRESULT WINAPI HTMLStyle_put_listStyleType(IHTMLStyle *iface, BSTR v)
1841 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1842 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1846 static HRESULT WINAPI HTMLStyle_get_listStyleType(IHTMLStyle *iface, BSTR *p)
1848 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1849 FIXME("(%p)->(%p)\n", This, p);
1853 static HRESULT WINAPI HTMLStyle_put_listStylePosition(IHTMLStyle *iface, BSTR v)
1855 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1856 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1860 static HRESULT WINAPI HTMLStyle_get_listStylePosition(IHTMLStyle *iface, BSTR *p)
1862 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1863 FIXME("(%p)->(%p)\n", This, p);
1867 static HRESULT WINAPI HTMLStyle_put_listStyleImage(IHTMLStyle *iface, BSTR v)
1869 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1870 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1874 static HRESULT WINAPI HTMLStyle_get_listStyleImage(IHTMLStyle *iface, BSTR *p)
1876 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1877 FIXME("(%p)->(%p)\n", This, p);
1881 static HRESULT WINAPI HTMLStyle_put_listStyle(IHTMLStyle *iface, BSTR v)
1883 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1884 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1888 static HRESULT WINAPI HTMLStyle_get_listStyle(IHTMLStyle *iface, BSTR *p)
1890 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1891 FIXME("(%p)->(%p)\n", This, p);
1895 static HRESULT WINAPI HTMLStyle_put_whiteSpace(IHTMLStyle *iface, BSTR v)
1897 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1898 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1902 static HRESULT WINAPI HTMLStyle_get_whiteSpace(IHTMLStyle *iface, BSTR *p)
1904 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1905 FIXME("(%p)->(%p)\n", This, p);
1909 static HRESULT WINAPI HTMLStyle_put_top(IHTMLStyle *iface, VARIANT v)
1911 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1913 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1915 return set_nsstyle_attr_var(This->nsstyle, STYLEID_TOP, &v, 0);
1918 static HRESULT WINAPI HTMLStyle_get_top(IHTMLStyle *iface, VARIANT *p)
1920 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1924 TRACE("(%p)->(%p)\n", This, p);
1926 hres = get_style_attr(This, STYLEID_TOP, &ret);
1935 static HRESULT WINAPI HTMLStyle_put_left(IHTMLStyle *iface, VARIANT v)
1937 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1939 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1941 return set_nsstyle_attr_var(This->nsstyle, STYLEID_LEFT, &v, 0);
1944 static HRESULT WINAPI HTMLStyle_get_left(IHTMLStyle *iface, VARIANT *p)
1946 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1950 TRACE("(%p)->(%p)\n", This, p);
1952 hres = get_style_attr(This, STYLEID_LEFT, &ret);
1961 static HRESULT WINAPI HTMLStyle_get_position(IHTMLStyle *iface, BSTR *p)
1963 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1964 TRACE("(%p)->(%p)\n", This, p);
1965 return IHTMLStyle2_get_position(HTMLSTYLE2(This), p);
1968 static HRESULT WINAPI HTMLStyle_put_zIndex(IHTMLStyle *iface, VARIANT v)
1970 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1972 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1976 return set_style_attr(This, STYLEID_Z_INDEX, V_BSTR(&v), 0);
1979 static const WCHAR format[] = {'%','d',0};
1981 wsprintfW(value, format, V_I4(&v));
1982 return set_style_attr(This, STYLEID_Z_INDEX, value, 0);
1985 FIXME("unimplemented vt %d\n", V_VT(&v));
1992 static HRESULT WINAPI HTMLStyle_get_zIndex(IHTMLStyle *iface, VARIANT *p)
1994 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1996 TRACE("(%p)->(%p)\n", This, p);
1998 return get_nsstyle_attr_var(This->nsstyle, STYLEID_Z_INDEX, p, ATTR_STR_TO_INT);
2001 static HRESULT WINAPI HTMLStyle_put_overflow(IHTMLStyle *iface, BSTR v)
2003 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2004 static const WCHAR szVisible[] = {'v','i','s','i','b','l','e',0};
2005 static const WCHAR szScroll[] = {'s','c','r','o','l','l',0};
2006 static const WCHAR szHidden[] = {'h','i','d','d','e','n',0};
2007 static const WCHAR szAuto[] = {'a','u','t','o',0};
2009 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2011 /* overflow can only be one of the follow values. */
2012 if(!v || strcmpiW(szVisible, v) == 0 || strcmpiW(szScroll, v) == 0 ||
2013 strcmpiW(szHidden, v) == 0 || strcmpiW(szAuto, v) == 0)
2015 return set_nsstyle_attr(This->nsstyle, STYLEID_OVERFLOW, v, 0);
2018 return E_INVALIDARG;
2022 static HRESULT WINAPI HTMLStyle_get_overflow(IHTMLStyle *iface, BSTR *p)
2024 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2026 TRACE("(%p)->(%p)\n", This, p);
2029 return E_INVALIDARG;
2031 return get_style_attr(This, STYLEID_OVERFLOW, p);
2034 static HRESULT WINAPI HTMLStyle_put_pageBreakBefore(IHTMLStyle *iface, BSTR v)
2036 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2037 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
2041 static HRESULT WINAPI HTMLStyle_get_pageBreakBefore(IHTMLStyle *iface, BSTR *p)
2043 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2044 FIXME("(%p)->(%p)\n", This, p);
2048 static HRESULT WINAPI HTMLStyle_put_pageBreakAfter(IHTMLStyle *iface, BSTR v)
2050 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2051 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
2055 static HRESULT WINAPI HTMLStyle_get_pageBreakAfter(IHTMLStyle *iface, BSTR *p)
2057 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2058 FIXME("(%p)->(%p)\n", This, p);
2062 static HRESULT WINAPI HTMLStyle_put_cssText(IHTMLStyle *iface, BSTR v)
2064 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2068 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2070 nsAString_Init(&text_str, v);
2071 nsres = nsIDOMCSSStyleDeclaration_SetCssText(This->nsstyle, &text_str);
2072 nsAString_Finish(&text_str);
2073 if(NS_FAILED(nsres)) {
2074 FIXME("SetCssStyle failed: %08x\n", nsres);
2081 static HRESULT WINAPI HTMLStyle_get_cssText(IHTMLStyle *iface, BSTR *p)
2083 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2087 TRACE("(%p)->(%p)\n", This, p);
2089 /* FIXME: Gecko style formatting is different than IE (uppercase). */
2090 nsAString_Init(&text_str, NULL);
2091 nsres = nsIDOMCSSStyleDeclaration_GetCssText(This->nsstyle, &text_str);
2092 if(NS_SUCCEEDED(nsres)) {
2093 const PRUnichar *text;
2095 nsAString_GetData(&text_str, &text);
2096 *p = *text ? SysAllocString(text) : NULL;
2098 FIXME("GetCssStyle failed: %08x\n", nsres);
2102 nsAString_Finish(&text_str);
2106 static HRESULT WINAPI HTMLStyle_put_pixelTop(IHTMLStyle *iface, LONG v)
2108 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2109 FIXME("(%p)->()\n", This);
2113 static HRESULT WINAPI HTMLStyle_get_pixelTop(IHTMLStyle *iface, LONG *p)
2115 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2116 FIXME("(%p)->()\n", This);
2120 static HRESULT WINAPI HTMLStyle_put_pixelLeft(IHTMLStyle *iface, LONG v)
2122 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2123 FIXME("(%p)->()\n", This);
2127 static HRESULT WINAPI HTMLStyle_get_pixelLeft(IHTMLStyle *iface, LONG *p)
2129 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2130 FIXME("(%p)->()\n", This);
2134 static HRESULT WINAPI HTMLStyle_put_pixelWidth(IHTMLStyle *iface, LONG v)
2136 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2137 FIXME("(%p)->()\n", This);
2141 static HRESULT WINAPI HTMLStyle_get_pixelWidth(IHTMLStyle *iface, LONG *p)
2143 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2144 FIXME("(%p)->()\n", This);
2148 static HRESULT WINAPI HTMLStyle_put_pixelHeight(IHTMLStyle *iface, LONG v)
2150 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2151 FIXME("(%p)->()\n", This);
2155 static HRESULT WINAPI HTMLStyle_get_pixelHeight(IHTMLStyle *iface, LONG *p)
2157 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2158 FIXME("(%p)->()\n", This);
2162 static HRESULT WINAPI HTMLStyle_put_posTop(IHTMLStyle *iface, float v)
2164 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2166 TRACE("(%p)->(%f)\n", This, v);
2168 return set_style_pos(This, STYLEID_TOP, v);
2171 static HRESULT WINAPI HTMLStyle_get_posTop(IHTMLStyle *iface, float *p)
2173 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2175 TRACE("(%p)->(%p)\n", This, p);
2180 return get_nsstyle_pos(This, STYLEID_TOP, p);
2183 static HRESULT WINAPI HTMLStyle_put_posLeft(IHTMLStyle *iface, float v)
2185 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2187 TRACE("(%p)->(%f)\n", This, v);
2189 return set_style_pos(This, STYLEID_LEFT, v);
2192 static HRESULT WINAPI HTMLStyle_get_posLeft(IHTMLStyle *iface, float *p)
2194 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2196 TRACE("(%p)->(%p)\n", This, p);
2201 return get_nsstyle_pos(This, STYLEID_LEFT, p);
2204 static HRESULT WINAPI HTMLStyle_put_posWidth(IHTMLStyle *iface, float v)
2206 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2208 TRACE("(%p)->(%f)\n", This, v);
2210 return set_style_pos(This, STYLEID_WIDTH, v);
2213 static HRESULT WINAPI HTMLStyle_get_posWidth(IHTMLStyle *iface, float *p)
2215 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2217 TRACE("(%p)->(%p)\n", This, p);
2222 if(get_nsstyle_pos(This, STYLEID_WIDTH, p) != S_OK)
2228 static HRESULT WINAPI HTMLStyle_put_posHeight(IHTMLStyle *iface, float v)
2230 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2232 TRACE("(%p)->(%f)\n", This, v);
2234 return set_style_pos(This, STYLEID_HEIGHT, v);
2237 static HRESULT WINAPI HTMLStyle_get_posHeight(IHTMLStyle *iface, float *p)
2239 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2241 TRACE("(%p)->(%p)\n", This, p);
2246 if(get_nsstyle_pos(This, STYLEID_HEIGHT, p) != S_OK)
2252 static HRESULT WINAPI HTMLStyle_put_cursor(IHTMLStyle *iface, BSTR v)
2254 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2256 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2258 return set_style_attr(This, STYLEID_CURSOR, v, 0);
2261 static HRESULT WINAPI HTMLStyle_get_cursor(IHTMLStyle *iface, BSTR *p)
2263 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2265 TRACE("(%p)->(%p)\n", This, p);
2267 return get_style_attr(This, STYLEID_CURSOR, p);
2270 static HRESULT WINAPI HTMLStyle_put_clip(IHTMLStyle *iface, BSTR v)
2272 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2273 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
2277 static HRESULT WINAPI HTMLStyle_get_clip(IHTMLStyle *iface, BSTR *p)
2279 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2280 FIXME("(%p)->(%p)\n", This, p);
2284 static HRESULT WINAPI HTMLStyle_put_filter(IHTMLStyle *iface, BSTR v)
2286 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2288 WARN("(%p)->(%s)\n", This, debugstr_w(v));
2290 /* FIXME: Handle MS-style filters */
2291 return set_style_attr(This, STYLEID_FILTER, v, 0);
2294 static HRESULT WINAPI HTMLStyle_get_filter(IHTMLStyle *iface, BSTR *p)
2296 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2298 WARN("(%p)->(%p)\n", This, p);
2300 /* FIXME: Handle MS-style filters */
2301 return get_style_attr(This, STYLEID_FILTER, p);
2304 static HRESULT WINAPI HTMLStyle_setAttribute(IHTMLStyle *iface, BSTR strAttributeName,
2305 VARIANT AttributeValue, LONG lFlags)
2307 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2311 TRACE("(%p)->(%s v%d %08x)\n", This, debugstr_w(strAttributeName),
2312 V_VT(&AttributeValue), lFlags);
2314 if(!strAttributeName)
2315 return E_INVALIDARG;
2318 FIXME("Parameter lFlags ignored\n");
2320 hres = HTMLStyle_GetIDsOfNames(iface, &IID_NULL, &strAttributeName, 1,
2321 LOCALE_USER_DEFAULT, &dispid);
2325 DISPID dispidNamed = DISPID_PROPERTYPUT;
2329 params.rgvarg = &AttributeValue;
2330 params.cNamedArgs = 1;
2331 params.rgdispidNamedArgs = &dispidNamed;
2333 hres = HTMLStyle_Invoke(iface, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
2334 DISPATCH_PROPERTYPUT, ¶ms, &ret, NULL, NULL);
2338 FIXME("Custom attributes not supported.\n");
2341 TRACE("ret: %08x\n", hres);
2346 static HRESULT WINAPI HTMLStyle_getAttribute(IHTMLStyle *iface, BSTR strAttributeName,
2347 LONG lFlags, VARIANT *AttributeValue)
2349 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2353 TRACE("(%p)->(%s v%p %08x)\n", This, debugstr_w(strAttributeName),
2354 AttributeValue, lFlags);
2356 if(!AttributeValue || !strAttributeName)
2357 return E_INVALIDARG;
2360 FIXME("Parameter lFlags ignored\n");
2362 hres = HTMLStyle_GetIDsOfNames(iface, &IID_NULL, &strAttributeName, 1,
2363 LOCALE_USER_DEFAULT, &dispid);
2366 DISPPARAMS params = {NULL, NULL, 0, 0 };
2368 hres = HTMLStyle_Invoke(iface, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
2369 DISPATCH_PROPERTYGET, ¶ms, AttributeValue, NULL, NULL);
2373 FIXME("Custom attributes not supported.\n");
2379 static HRESULT WINAPI HTMLStyle_removeAttribute(IHTMLStyle *iface, BSTR strAttributeName,
2380 LONG lFlags, VARIANT_BOOL *pfSuccess)
2382 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2383 FIXME("(%p)->(%s %08x %p)\n", This, debugstr_w(strAttributeName),
2388 static HRESULT WINAPI HTMLStyle_toString(IHTMLStyle *iface, BSTR *String)
2390 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2391 FIXME("(%p)->(%p)\n", This, String);
2395 static HRESULT HTMLStyle_get_dispid(IUnknown *iface, BSTR name, DWORD flags, DISPID *dispid)
2397 int c, i, min=0, max = sizeof(style_tbl)/sizeof(*style_tbl)-1;
2402 c = strcmpW(style_tbl[i].name, name);
2404 *dispid = style_tbl[i].dispid;
2414 return DISP_E_UNKNOWNNAME;
2417 static const IHTMLStyleVtbl HTMLStyleVtbl = {
2418 HTMLStyle_QueryInterface,
2421 HTMLStyle_GetTypeInfoCount,
2422 HTMLStyle_GetTypeInfo,
2423 HTMLStyle_GetIDsOfNames,
2425 HTMLStyle_put_fontFamily,
2426 HTMLStyle_get_fontFamily,
2427 HTMLStyle_put_fontStyle,
2428 HTMLStyle_get_fontStyle,
2429 HTMLStyle_put_fontVariant,
2430 HTMLStyle_get_fontVariant,
2431 HTMLStyle_put_fontWeight,
2432 HTMLStyle_get_fontWeight,
2433 HTMLStyle_put_fontSize,
2434 HTMLStyle_get_fontSize,
2437 HTMLStyle_put_color,
2438 HTMLStyle_get_color,
2439 HTMLStyle_put_background,
2440 HTMLStyle_get_background,
2441 HTMLStyle_put_backgroundColor,
2442 HTMLStyle_get_backgroundColor,
2443 HTMLStyle_put_backgroundImage,
2444 HTMLStyle_get_backgroundImage,
2445 HTMLStyle_put_backgroundRepeat,
2446 HTMLStyle_get_backgroundRepeat,
2447 HTMLStyle_put_backgroundAttachment,
2448 HTMLStyle_get_backgroundAttachment,
2449 HTMLStyle_put_backgroundPosition,
2450 HTMLStyle_get_backgroundPosition,
2451 HTMLStyle_put_backgroundPositionX,
2452 HTMLStyle_get_backgroundPositionX,
2453 HTMLStyle_put_backgroundPositionY,
2454 HTMLStyle_get_backgroundPositionY,
2455 HTMLStyle_put_wordSpacing,
2456 HTMLStyle_get_wordSpacing,
2457 HTMLStyle_put_letterSpacing,
2458 HTMLStyle_get_letterSpacing,
2459 HTMLStyle_put_textDecoration,
2460 HTMLStyle_get_textDecoration,
2461 HTMLStyle_put_textDecorationNone,
2462 HTMLStyle_get_textDecorationNone,
2463 HTMLStyle_put_textDecorationUnderline,
2464 HTMLStyle_get_textDecorationUnderline,
2465 HTMLStyle_put_textDecorationOverline,
2466 HTMLStyle_get_textDecorationOverline,
2467 HTMLStyle_put_textDecorationLineThrough,
2468 HTMLStyle_get_textDecorationLineThrough,
2469 HTMLStyle_put_textDecorationBlink,
2470 HTMLStyle_get_textDecorationBlink,
2471 HTMLStyle_put_verticalAlign,
2472 HTMLStyle_get_verticalAlign,
2473 HTMLStyle_put_textTransform,
2474 HTMLStyle_get_textTransform,
2475 HTMLStyle_put_textAlign,
2476 HTMLStyle_get_textAlign,
2477 HTMLStyle_put_textIndent,
2478 HTMLStyle_get_textIndent,
2479 HTMLStyle_put_lineHeight,
2480 HTMLStyle_get_lineHeight,
2481 HTMLStyle_put_marginTop,
2482 HTMLStyle_get_marginTop,
2483 HTMLStyle_put_marginRight,
2484 HTMLStyle_get_marginRight,
2485 HTMLStyle_put_marginBottom,
2486 HTMLStyle_get_marginBottom,
2487 HTMLStyle_put_marginLeft,
2488 HTMLStyle_get_marginLeft,
2489 HTMLStyle_put_margin,
2490 HTMLStyle_get_margin,
2491 HTMLStyle_put_paddingTop,
2492 HTMLStyle_get_paddingTop,
2493 HTMLStyle_put_paddingRight,
2494 HTMLStyle_get_paddingRight,
2495 HTMLStyle_put_paddingBottom,
2496 HTMLStyle_get_paddingBottom,
2497 HTMLStyle_put_paddingLeft,
2498 HTMLStyle_get_paddingLeft,
2499 HTMLStyle_put_padding,
2500 HTMLStyle_get_padding,
2501 HTMLStyle_put_border,
2502 HTMLStyle_get_border,
2503 HTMLStyle_put_borderTop,
2504 HTMLStyle_get_borderTop,
2505 HTMLStyle_put_borderRight,
2506 HTMLStyle_get_borderRight,
2507 HTMLStyle_put_borderBottom,
2508 HTMLStyle_get_borderBottom,
2509 HTMLStyle_put_borderLeft,
2510 HTMLStyle_get_borderLeft,
2511 HTMLStyle_put_borderColor,
2512 HTMLStyle_get_borderColor,
2513 HTMLStyle_put_borderTopColor,
2514 HTMLStyle_get_borderTopColor,
2515 HTMLStyle_put_borderRightColor,
2516 HTMLStyle_get_borderRightColor,
2517 HTMLStyle_put_borderBottomColor,
2518 HTMLStyle_get_borderBottomColor,
2519 HTMLStyle_put_borderLeftColor,
2520 HTMLStyle_get_borderLeftColor,
2521 HTMLStyle_put_borderWidth,
2522 HTMLStyle_get_borderWidth,
2523 HTMLStyle_put_borderTopWidth,
2524 HTMLStyle_get_borderTopWidth,
2525 HTMLStyle_put_borderRightWidth,
2526 HTMLStyle_get_borderRightWidth,
2527 HTMLStyle_put_borderBottomWidth,
2528 HTMLStyle_get_borderBottomWidth,
2529 HTMLStyle_put_borderLeftWidth,
2530 HTMLStyle_get_borderLeftWidth,
2531 HTMLStyle_put_borderStyle,
2532 HTMLStyle_get_borderStyle,
2533 HTMLStyle_put_borderTopStyle,
2534 HTMLStyle_get_borderTopStyle,
2535 HTMLStyle_put_borderRightStyle,
2536 HTMLStyle_get_borderRightStyle,
2537 HTMLStyle_put_borderBottomStyle,
2538 HTMLStyle_get_borderBottomStyle,
2539 HTMLStyle_put_borderLeftStyle,
2540 HTMLStyle_get_borderLeftStyle,
2541 HTMLStyle_put_width,
2542 HTMLStyle_get_width,
2543 HTMLStyle_put_height,
2544 HTMLStyle_get_height,
2545 HTMLStyle_put_styleFloat,
2546 HTMLStyle_get_styleFloat,
2547 HTMLStyle_put_clear,
2548 HTMLStyle_get_clear,
2549 HTMLStyle_put_display,
2550 HTMLStyle_get_display,
2551 HTMLStyle_put_visibility,
2552 HTMLStyle_get_visibility,
2553 HTMLStyle_put_listStyleType,
2554 HTMLStyle_get_listStyleType,
2555 HTMLStyle_put_listStylePosition,
2556 HTMLStyle_get_listStylePosition,
2557 HTMLStyle_put_listStyleImage,
2558 HTMLStyle_get_listStyleImage,
2559 HTMLStyle_put_listStyle,
2560 HTMLStyle_get_listStyle,
2561 HTMLStyle_put_whiteSpace,
2562 HTMLStyle_get_whiteSpace,
2567 HTMLStyle_get_position,
2568 HTMLStyle_put_zIndex,
2569 HTMLStyle_get_zIndex,
2570 HTMLStyle_put_overflow,
2571 HTMLStyle_get_overflow,
2572 HTMLStyle_put_pageBreakBefore,
2573 HTMLStyle_get_pageBreakBefore,
2574 HTMLStyle_put_pageBreakAfter,
2575 HTMLStyle_get_pageBreakAfter,
2576 HTMLStyle_put_cssText,
2577 HTMLStyle_get_cssText,
2578 HTMLStyle_put_pixelTop,
2579 HTMLStyle_get_pixelTop,
2580 HTMLStyle_put_pixelLeft,
2581 HTMLStyle_get_pixelLeft,
2582 HTMLStyle_put_pixelWidth,
2583 HTMLStyle_get_pixelWidth,
2584 HTMLStyle_put_pixelHeight,
2585 HTMLStyle_get_pixelHeight,
2586 HTMLStyle_put_posTop,
2587 HTMLStyle_get_posTop,
2588 HTMLStyle_put_posLeft,
2589 HTMLStyle_get_posLeft,
2590 HTMLStyle_put_posWidth,
2591 HTMLStyle_get_posWidth,
2592 HTMLStyle_put_posHeight,
2593 HTMLStyle_get_posHeight,
2594 HTMLStyle_put_cursor,
2595 HTMLStyle_get_cursor,
2598 HTMLStyle_put_filter,
2599 HTMLStyle_get_filter,
2600 HTMLStyle_setAttribute,
2601 HTMLStyle_getAttribute,
2602 HTMLStyle_removeAttribute,
2606 static const dispex_static_data_vtbl_t HTMLStyle_dispex_vtbl = {
2607 HTMLStyle_get_dispid,
2611 static const tid_t HTMLStyle_iface_tids[] = {
2618 static dispex_static_data_t HTMLStyle_dispex = {
2619 &HTMLStyle_dispex_vtbl,
2622 HTMLStyle_iface_tids
2625 IHTMLStyle *HTMLStyle_Create(nsIDOMCSSStyleDeclaration *nsstyle)
2627 HTMLStyle *ret = heap_alloc_zero(sizeof(HTMLStyle));
2629 ret->lpHTMLStyleVtbl = &HTMLStyleVtbl;
2631 ret->nsstyle = nsstyle;
2632 HTMLStyle2_Init(ret);
2633 HTMLStyle3_Init(ret);
2635 nsIDOMCSSStyleDeclaration_AddRef(nsstyle);
2637 init_dispex(&ret->dispex, (IUnknown*)HTMLSTYLE(ret), &HTMLStyle_dispex);
2639 return HTMLSTYLE(ret);