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 attrBackgroundPosition[] =
45 {'b','a','c','k','g','r','o','u','n','d','-','p','o','s','i','t','i','o','n',0};
46 static const WCHAR attrBackgroundPositionX[] =
47 {'b','a','c','k','g','r','o','u','n','d','-','p','o','s','i','t','i','o','n','-','x',0};
48 static const WCHAR attrBackgroundPositionY[] =
49 {'b','a','c','k','g','r','o','u','n','d','-','p','o','s','i','t','i','o','n','-','y',0};
50 static const WCHAR attrBackgroundRepeat[] =
51 {'b','a','c','k','g','r','o','u','n','d','-','r','e','p','e','a','t',0};
52 static const WCHAR attrBorder[] =
53 {'b','o','r','d','e','r',0};
54 static const WCHAR attrBorderBottom[] =
55 {'b','o','r','d','e','r','-','b','o','t','t','o','m',0};
56 static const WCHAR attrBorderBottomColor[] =
57 {'b','o','r','d','e','r','-','b','o','t','t','o','m','-','c','o','l','o','r',0};
58 static const WCHAR attrBorderBottomStyle[] =
59 {'b','o','r','d','e','r','-','b','o','t','t','o','m','-','s','t','y','l','e',0};
60 static const WCHAR attrBorderBottomWidth[] =
61 {'b','o','r','d','e','r','-','b','o','t','t','o','m','-','w','i','d','t','h',0};
62 static const WCHAR attrBorderColor[] =
63 {'b','o','r','d','e','r','-','c','o','l','o','r',0};
64 static const WCHAR attrBorderLeft[] =
65 {'b','o','r','d','e','r','-','l','e','f','t',0};
66 static const WCHAR attrBorderLeftColor[] =
67 {'b','o','r','d','e','r','-','l','e','f','t','-','c','o','l','o','r',0};
68 static const WCHAR attrBorderLeftStyle[] =
69 {'b','o','r','d','e','r','-','l','e','f','t','-','s','t','y','l','e',0};
70 static const WCHAR attrBorderLeftWidth[] =
71 {'b','o','r','d','e','r','-','l','e','f','t','-','w','i','d','t','h',0};
72 static const WCHAR attrBorderRight[] =
73 {'b','o','r','d','e','r','-','r','i','g','h','t',0};
74 static const WCHAR attrBorderRightColor[] =
75 {'b','o','r','d','e','r','-','r','i','g','h','t','-','c','o','l','o','r',0};
76 static const WCHAR attrBorderRightStyle[] =
77 {'b','o','r','d','e','r','-','r','i','g','h','t','-','s','t','y','l','e',0};
78 static const WCHAR attrBorderRightWidth[] =
79 {'b','o','r','d','e','r','-','r','i','g','h','t','-','w','i','d','t','h',0};
80 static const WCHAR attrBorderTop[] =
81 {'b','o','r','d','e','r','-','t','o','p',0};
82 static const WCHAR attrBorderTopColor[] =
83 {'b','o','r','d','e','r','-','t','o','p','-','c','o','l','o','r',0};
84 static const WCHAR attrBorderStyle[] =
85 {'b','o','r','d','e','r','-','s','t','y','l','e',0};
86 static const WCHAR attrBorderTopStyle[] =
87 {'b','o','r','d','e','r','-','t','o','p','-','s','t','y','l','e',0};
88 static const WCHAR attrBorderTopWidth[] =
89 {'b','o','r','d','e','r','-','t','o','p','-','w','i','d','t','h',0};
90 static const WCHAR attrBorderWidth[] =
91 {'b','o','r','d','e','r','-','w','i','d','t','h',0};
92 static const WCHAR attrBottom[] =
93 {'b','o','t','t','o','m',0};
94 static const WCHAR attrColor[] =
95 {'c','o','l','o','r',0};
96 static const WCHAR attrCursor[] =
97 {'c','u','r','s','o','r',0};
98 static const WCHAR attrDisplay[] =
99 {'d','i','s','p','l','a','y',0};
100 static const WCHAR attrFilter[] =
101 {'f','i','l','e','t','e','r',0};
102 static const WCHAR attrFontFamily[] =
103 {'f','o','n','t','-','f','a','m','i','l','y',0};
104 static const WCHAR attrFontSize[] =
105 {'f','o','n','t','-','s','i','z','e',0};
106 static const WCHAR attrFontStyle[] =
107 {'f','o','n','t','-','s','t','y','l','e',0};
108 static const WCHAR attrFontVariant[] =
109 {'f','o','n','t','-','v','a','r','i','a','n','t',0};
110 static const WCHAR attrFontWeight[] =
111 {'f','o','n','t','-','w','e','i','g','h','t',0};
112 static const WCHAR attrHeight[] =
113 {'h','e','i','g','h','t',0};
114 static const WCHAR attrLeft[] =
116 static const WCHAR attrLetterSpacing[] =
117 {'l','e','t','t','e','r','-','s','p','a','c','i','n','g',0};
118 static const WCHAR attrLineHeight[] =
119 {'l','i','n','e','-','h','e','i','g','h','t',0};
120 static const WCHAR attrMargin[] =
121 {'m','a','r','g','i','n',0};
122 static const WCHAR attrMarginBottom[] =
123 {'m','a','r','g','i','n','-','b','o','t','t','o','m',0};
124 static const WCHAR attrMarginLeft[] =
125 {'m','a','r','g','i','n','-','l','e','f','t',0};
126 static const WCHAR attrMarginRight[] =
127 {'m','a','r','g','i','n','-','r','i','g','h','t',0};
128 static const WCHAR attrMarginTop[] =
129 {'m','a','r','g','i','n','-','t','o','p',0};
130 static const WCHAR attrMinHeight[] =
131 {'m','i','n','-','h','e','i','g','h','t',0};
132 static const WCHAR attrOverflow[] =
133 {'o','v','e','r','f','l','o','w',0};
134 static const WCHAR attrPadding[] =
135 {'p','a','d','d','i','n','g',0};
136 static const WCHAR attrPaddingBottom[] =
137 {'p','a','d','d','i','n','g','-','b','o','t','t','o','m',0};
138 static const WCHAR attrPaddingLeft[] =
139 {'p','a','d','d','i','n','g','-','l','e','f','t',0};
140 static const WCHAR attrPaddingRight[] =
141 {'p','a','d','d','i','n','g','-','r','i','g','h','t',0};
142 static const WCHAR attrPaddingTop[] =
143 {'p','a','d','d','i','n','g','-','t','o','p',0};
144 static const WCHAR attrPosition[] =
145 {'p','o','s','i','t','i','o','n',0};
146 static const WCHAR attrRight[] =
147 {'r','i','g','h','t',0};
148 static const WCHAR attrTextAlign[] =
149 {'t','e','x','t','-','a','l','i','g','n',0};
150 static const WCHAR attrTextDecoration[] =
151 {'t','e','x','t','-','d','e','c','o','r','a','t','i','o','n',0};
152 static const WCHAR attrTextIndent[] =
153 {'t','e','x','t','-','i','n','d','e','n','t',0};
154 static const WCHAR attrTop[] =
156 static const WCHAR attrVerticalAlign[] =
157 {'v','e','r','t','i','c','a','l','-','a','l','i','g','n',0};
158 static const WCHAR attrVisibility[] =
159 {'v','i','s','i','b','i','l','i','t','y',0};
160 static const WCHAR attrWidth[] =
161 {'w','i','d','t','h',0};
162 static const WCHAR attrWordSpacing[] =
163 {'w','o','r','d','-','s','p','a','c','i','n','g',0};
164 static const WCHAR attrWordWrap[] =
165 {'w','o','r','d','-','w','r','a','p',0};
166 static const WCHAR attrZIndex[] =
167 {'z','-','i','n','d','e','x',0};
173 {attrBackground, DISPID_IHTMLSTYLE_BACKGROUND},
174 {attrBackgroundColor, DISPID_IHTMLSTYLE_BACKGROUNDCOLOR},
175 {attrBackgroundImage, DISPID_IHTMLSTYLE_BACKGROUNDIMAGE},
176 {attrBackgroundPosition, DISPID_IHTMLSTYLE_BACKGROUNDPOSITION},
177 {attrBackgroundPositionX, DISPID_IHTMLSTYLE_BACKGROUNDPOSITIONX},
178 {attrBackgroundPositionY, DISPID_IHTMLSTYLE_BACKGROUNDPOSITIONY},
179 {attrBackgroundRepeat, DISPID_IHTMLSTYLE_BACKGROUNDREPEAT},
180 {attrBorder, DISPID_IHTMLSTYLE_BORDER},
181 {attrBorderBottom, DISPID_IHTMLSTYLE_BORDERBOTTOM},
182 {attrBorderBottomColor, DISPID_IHTMLSTYLE_BORDERBOTTOMCOLOR},
183 {attrBorderBottomStyle, DISPID_IHTMLSTYLE_BORDERBOTTOMSTYLE},
184 {attrBorderBottomWidth, DISPID_IHTMLSTYLE_BORDERBOTTOMWIDTH},
185 {attrBorderColor, DISPID_IHTMLSTYLE_BORDERCOLOR},
186 {attrBorderLeft, DISPID_IHTMLSTYLE_BORDERLEFT},
187 {attrBorderLeftColor, DISPID_IHTMLSTYLE_BORDERLEFTCOLOR},
188 {attrBorderLeftStyle, DISPID_IHTMLSTYLE_BORDERLEFTSTYLE},
189 {attrBorderLeftWidth, DISPID_IHTMLSTYLE_BORDERLEFTWIDTH},
190 {attrBorderRight, DISPID_IHTMLSTYLE_BORDERRIGHT},
191 {attrBorderRightColor, DISPID_IHTMLSTYLE_BORDERRIGHTCOLOR},
192 {attrBorderRightStyle, DISPID_IHTMLSTYLE_BORDERRIGHTSTYLE},
193 {attrBorderRightWidth, DISPID_IHTMLSTYLE_BORDERRIGHTWIDTH},
194 {attrBorderStyle, DISPID_IHTMLSTYLE_BORDERSTYLE},
195 {attrBorderTop, DISPID_IHTMLSTYLE_BORDERTOP},
196 {attrBorderTopColor, DISPID_IHTMLSTYLE_BORDERTOPCOLOR},
197 {attrBorderTopStyle, DISPID_IHTMLSTYLE_BORDERTOPSTYLE},
198 {attrBorderTopWidth, DISPID_IHTMLSTYLE_BORDERTOPWIDTH},
199 {attrBorderWidth, DISPID_IHTMLSTYLE_BORDERWIDTH},
200 {attrBottom, DISPID_IHTMLSTYLE2_BOTTOM},
201 {attrColor, DISPID_IHTMLSTYLE_COLOR},
202 {attrCursor, DISPID_IHTMLSTYLE_CURSOR},
203 {attrDisplay, DISPID_IHTMLSTYLE_DISPLAY},
204 {attrFilter, DISPID_IHTMLSTYLE_FILTER},
205 {attrFontFamily, DISPID_IHTMLSTYLE_FONTFAMILY},
206 {attrFontSize, DISPID_IHTMLSTYLE_FONTSIZE},
207 {attrFontStyle, DISPID_IHTMLSTYLE_FONTSTYLE},
208 {attrFontVariant, DISPID_IHTMLSTYLE_FONTVARIANT},
209 {attrFontWeight, DISPID_IHTMLSTYLE_FONTWEIGHT},
210 {attrHeight, DISPID_IHTMLSTYLE_HEIGHT},
211 {attrLeft, DISPID_IHTMLSTYLE_LEFT},
212 {attrLetterSpacing, DISPID_IHTMLSTYLE_LETTERSPACING},
213 {attrLineHeight, DISPID_IHTMLSTYLE_LINEHEIGHT},
214 {attrMargin, DISPID_IHTMLSTYLE_MARGIN},
215 {attrMarginBottom, DISPID_IHTMLSTYLE_MARGINBOTTOM},
216 {attrMarginLeft, DISPID_IHTMLSTYLE_MARGINLEFT},
217 {attrMarginRight, DISPID_IHTMLSTYLE_MARGINRIGHT},
218 {attrMarginTop, DISPID_IHTMLSTYLE_MARGINTOP},
219 {attrMinHeight, DISPID_IHTMLSTYLE4_MINHEIGHT},
220 {attrOverflow, DISPID_IHTMLSTYLE_OVERFLOW},
221 {attrPadding, DISPID_IHTMLSTYLE_PADDING},
222 {attrPaddingBottom, DISPID_IHTMLSTYLE_PADDINGBOTTOM},
223 {attrPaddingLeft, DISPID_IHTMLSTYLE_PADDINGLEFT},
224 {attrPaddingRight, DISPID_IHTMLSTYLE_PADDINGRIGHT},
225 {attrPaddingTop, DISPID_IHTMLSTYLE_PADDINGTOP},
226 {attrPosition, DISPID_IHTMLSTYLE2_POSITION},
227 {attrRight, DISPID_IHTMLSTYLE2_RIGHT},
228 {attrTextAlign, DISPID_IHTMLSTYLE_TEXTALIGN},
229 {attrTextDecoration, DISPID_IHTMLSTYLE_TEXTDECORATION},
230 {attrTextIndent, DISPID_IHTMLSTYLE_TEXTINDENT},
231 {attrTop, DISPID_IHTMLSTYLE_TOP},
232 {attrVerticalAlign, DISPID_IHTMLSTYLE_VERTICALALIGN},
233 {attrVisibility, DISPID_IHTMLSTYLE_VISIBILITY},
234 {attrWidth, DISPID_IHTMLSTYLE_WIDTH},
235 {attrWordSpacing, DISPID_IHTMLSTYLE_WORDSPACING},
236 {attrWordWrap, DISPID_IHTMLSTYLE3_WORDWRAP},
237 {attrZIndex, DISPID_IHTMLSTYLE_ZINDEX}
240 static const WCHAR valLineThrough[] =
241 {'l','i','n','e','-','t','h','r','o','u','g','h',0};
242 static const WCHAR valUnderline[] =
243 {'u','n','d','e','r','l','i','n','e',0};
244 static const WCHAR szNormal[] =
245 {'n','o','r','m','a','l',0};
246 static const WCHAR styleNone[] =
248 static const WCHAR valOverline[] =
249 {'o','v','e','r','l','i','n','e',0};
250 static const WCHAR valBlink[] =
251 {'b','l','i','n','k',0};
253 static const WCHAR px_formatW[] = {'%','d','p','x',0};
254 static const WCHAR emptyW[] = {0};
256 static LPWSTR fix_px_value(LPCWSTR val)
261 while(*ptr && isspaceW(*ptr))
266 while(*ptr && isdigitW(*ptr))
269 if(!*ptr || isspaceW(*ptr)) {
271 int len = strlenW(val)+1;
273 ret = heap_alloc((len+2)*sizeof(WCHAR));
274 memcpy(ret, val, (ptr-val)*sizeof(WCHAR));
280 TRACE("fixed %s -> %s\n", debugstr_w(val), debugstr_w(ret));
285 while(*ptr && !isspaceW(*ptr))
292 static LPWSTR fix_url_value(LPCWSTR val)
296 static const WCHAR urlW[] = {'u','r','l','('};
298 if(strncmpW(val, urlW, sizeof(urlW)/sizeof(WCHAR)) || !strchrW(val, '\\'))
301 ret = heap_strdupW(val);
303 for(ptr = ret; *ptr; ptr++) {
311 HRESULT set_nsstyle_attr(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, LPCWSTR value, DWORD flags)
313 nsAString str_name, str_value, str_empty;
317 if(flags & ATTR_FIX_PX)
318 val = fix_px_value(value);
319 if(flags & ATTR_FIX_URL)
320 val = fix_url_value(value);
322 nsAString_InitDepend(&str_name, style_tbl[sid].name);
323 nsAString_InitDepend(&str_value, val ? val : value);
324 nsAString_InitDepend(&str_empty, emptyW);
326 nsres = nsIDOMCSSStyleDeclaration_SetProperty(nsstyle, &str_name, &str_value, &str_empty);
328 ERR("SetProperty failed: %08x\n", nsres);
330 nsAString_Finish(&str_name);
331 nsAString_Finish(&str_value);
332 nsAString_Finish(&str_empty);
338 static HRESULT var_to_styleval(const VARIANT *v, WCHAR *buf, DWORD flags, const WCHAR **ret)
349 case VT_BSTR|VT_BYREF:
350 *ret = *V_BSTRREF(v);
354 static const WCHAR formatW[] = {'%','d',0};
355 static const WCHAR hex_formatW[] = {'#','%','0','6','x',0};
357 if(flags & ATTR_HEX_INT)
358 wsprintfW(buf, hex_formatW, V_I4(v));
359 else if(flags & ATTR_FIX_PX)
360 wsprintfW(buf, px_formatW, V_I4(v));
362 wsprintfW(buf, formatW, V_I4(v));
368 FIXME("not implemented vt %d\n", V_VT(v));
374 HRESULT set_nsstyle_attr_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, VARIANT *value, DWORD flags)
380 hres = var_to_styleval(value, buf, flags, &val);
384 return set_nsstyle_attr(nsstyle, sid, val, flags);
387 static inline HRESULT set_style_attr(HTMLStyle *This, styleid_t sid, LPCWSTR value, DWORD flags)
389 return set_nsstyle_attr(This->nsstyle, sid, value, flags);
392 static HRESULT get_nsstyle_attr_nsval(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, nsAString *value)
397 nsAString_InitDepend(&str_name, style_tbl[sid].name);
399 nsres = nsIDOMCSSStyleDeclaration_GetPropertyValue(nsstyle, &str_name, value);
400 if(NS_FAILED(nsres)) {
401 ERR("SetProperty failed: %08x\n", nsres);
405 nsAString_Finish(&str_name);
410 HRESULT get_nsstyle_attr(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, BSTR *p)
413 const PRUnichar *value;
415 nsAString_Init(&str_value, NULL);
417 get_nsstyle_attr_nsval(nsstyle, sid, &str_value);
419 nsAString_GetData(&str_value, &value);
420 *p = *value ? SysAllocString(value) : NULL;
422 nsAString_Finish(&str_value);
424 TRACE("%s -> %s\n", debugstr_w(style_tbl[sid].name), debugstr_w(*p));
428 HRESULT get_nsstyle_attr_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, VARIANT *p, DWORD flags)
431 const PRUnichar *value;
434 nsAString_Init(&str_value, NULL);
436 get_nsstyle_attr_nsval(nsstyle, sid, &str_value);
438 nsAString_GetData(&str_value, &value);
440 if(flags & ATTR_STR_TO_INT) {
441 const PRUnichar *ptr = value;
450 while(isdigitW(*ptr))
451 i = i*10 + (*ptr++ - '0');
455 V_I4(p) = neg ? -i : i;
464 str = SysAllocString(value);
466 return E_OUTOFMEMORY;
473 nsAString_Finish(&str_value);
475 TRACE("%s -> %s\n", debugstr_w(style_tbl[sid].name), debugstr_variant(p));
479 static inline HRESULT get_style_attr(HTMLStyle *This, styleid_t sid, BSTR *p)
481 return get_nsstyle_attr(This->nsstyle, sid, p);
484 static HRESULT check_style_attr_value(HTMLStyle *This, styleid_t sid, LPCWSTR exval, VARIANT_BOOL *p)
487 const PRUnichar *value;
489 nsAString_Init(&str_value, NULL);
491 get_nsstyle_attr_nsval(This->nsstyle, sid, &str_value);
493 nsAString_GetData(&str_value, &value);
494 *p = strcmpW(value, exval) ? VARIANT_FALSE : VARIANT_TRUE;
495 nsAString_Finish(&str_value);
497 TRACE("%s -> %x\n", debugstr_w(style_tbl[sid].name), *p);
501 static inline HRESULT set_style_pos(HTMLStyle *This, styleid_t sid, float value)
504 WCHAR szFormat[] = {'%','.','0','f','p','x',0};
506 value = floor(value);
508 sprintfW(szValue, szFormat, value);
510 return set_style_attr(This, sid, szValue, 0);
513 static HRESULT get_nsstyle_pos(HTMLStyle *This, styleid_t sid, float *p)
517 WCHAR pxW[] = {'p','x',0};
519 TRACE("%p %d %p\n", This, sid, p);
523 nsAString_Init(&str_value, NULL);
525 hres = get_nsstyle_attr_nsval(This->nsstyle, sid, &str_value);
529 const PRUnichar *value;
531 nsAString_GetData(&str_value, &value);
534 *p = strtolW(value, &ptr, 10);
536 if(*ptr && strcmpW(ptr, pxW))
538 nsAString_Finish(&str_value);
539 FIXME("only px values are currently supported\n");
545 TRACE("ret %f\n", *p);
547 nsAString_Finish(&str_value);
552 static BOOL is_valid_border_style(BSTR v)
554 static const WCHAR styleDotted[] = {'d','o','t','t','e','d',0};
555 static const WCHAR styleDashed[] = {'d','a','s','h','e','d',0};
556 static const WCHAR styleSolid[] = {'s','o','l','i','d',0};
557 static const WCHAR styleDouble[] = {'d','o','u','b','l','e',0};
558 static const WCHAR styleGroove[] = {'g','r','o','o','v','e',0};
559 static const WCHAR styleRidge[] = {'r','i','d','g','e',0};
560 static const WCHAR styleInset[] = {'i','n','s','e','t',0};
561 static const WCHAR styleOutset[] = {'o','u','t','s','e','t',0};
563 TRACE("%s\n", debugstr_w(v));
565 if(!v || strcmpiW(v, styleNone) == 0 || strcmpiW(v, styleDotted) == 0 ||
566 strcmpiW(v, styleDashed) == 0 || strcmpiW(v, styleSolid) == 0 ||
567 strcmpiW(v, styleDouble) == 0 || strcmpiW(v, styleGroove) == 0 ||
568 strcmpiW(v, styleRidge) == 0 || strcmpiW(v, styleInset) == 0 ||
569 strcmpiW(v, styleOutset) == 0 )
577 static inline HTMLStyle *impl_from_IHTMLStyle(IHTMLStyle *iface)
579 return CONTAINING_RECORD(iface, HTMLStyle, IHTMLStyle_iface);
582 static HRESULT WINAPI HTMLStyle_QueryInterface(IHTMLStyle *iface, REFIID riid, void **ppv)
584 HTMLStyle *This = impl_from_IHTMLStyle(iface);
588 if(IsEqualGUID(&IID_IUnknown, riid)) {
589 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
590 *ppv = &This->IHTMLStyle_iface;
591 }else if(IsEqualGUID(&IID_IHTMLStyle, riid)) {
592 TRACE("(%p)->(IID_IHTMLStyle %p)\n", This, ppv);
593 *ppv = &This->IHTMLStyle_iface;
594 }else if(IsEqualGUID(&IID_IHTMLStyle2, riid)) {
595 TRACE("(%p)->(IID_IHTMLStyle2 %p)\n", This, ppv);
596 *ppv = &This->IHTMLStyle2_iface;
597 }else if(IsEqualGUID(&IID_IHTMLStyle3, riid)) {
598 TRACE("(%p)->(IID_IHTMLStyle3 %p)\n", This, ppv);
599 *ppv = &This->IHTMLStyle3_iface;
600 }else if(IsEqualGUID(&IID_IHTMLStyle4, riid)) {
601 TRACE("(%p)->(IID_IHTMLStyle4 %p)\n", This, ppv);
602 *ppv = &This->IHTMLStyle4_iface;
603 }else if(dispex_query_interface(&This->dispex, riid, ppv)) {
604 return *ppv ? S_OK : E_NOINTERFACE;
608 IUnknown_AddRef((IUnknown*)*ppv);
612 WARN("unsupported %s\n", debugstr_guid(riid));
613 return E_NOINTERFACE;
616 static ULONG WINAPI HTMLStyle_AddRef(IHTMLStyle *iface)
618 HTMLStyle *This = impl_from_IHTMLStyle(iface);
619 LONG ref = InterlockedIncrement(&This->ref);
621 TRACE("(%p) ref=%d\n", This, ref);
626 static ULONG WINAPI HTMLStyle_Release(IHTMLStyle *iface)
628 HTMLStyle *This = impl_from_IHTMLStyle(iface);
629 LONG ref = InterlockedDecrement(&This->ref);
631 TRACE("(%p) ref=%d\n", This, ref);
635 nsIDOMCSSStyleDeclaration_Release(This->nsstyle);
636 release_dispex(&This->dispex);
643 static HRESULT WINAPI HTMLStyle_GetTypeInfoCount(IHTMLStyle *iface, UINT *pctinfo)
645 HTMLStyle *This = impl_from_IHTMLStyle(iface);
646 return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
649 static HRESULT WINAPI HTMLStyle_GetTypeInfo(IHTMLStyle *iface, UINT iTInfo,
650 LCID lcid, ITypeInfo **ppTInfo)
652 HTMLStyle *This = impl_from_IHTMLStyle(iface);
653 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
656 static HRESULT WINAPI HTMLStyle_GetIDsOfNames(IHTMLStyle *iface, REFIID riid,
657 LPOLESTR *rgszNames, UINT cNames,
658 LCID lcid, DISPID *rgDispId)
660 HTMLStyle *This = impl_from_IHTMLStyle(iface);
661 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
665 static HRESULT WINAPI HTMLStyle_Invoke(IHTMLStyle *iface, DISPID dispIdMember,
666 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
667 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
669 HTMLStyle *This = impl_from_IHTMLStyle(iface);
670 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
671 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
674 static HRESULT WINAPI HTMLStyle_put_fontFamily(IHTMLStyle *iface, BSTR v)
676 HTMLStyle *This = impl_from_IHTMLStyle(iface);
678 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
680 return set_style_attr(This, STYLEID_FONT_FAMILY, v, 0);
683 static HRESULT WINAPI HTMLStyle_get_fontFamily(IHTMLStyle *iface, BSTR *p)
685 HTMLStyle *This = impl_from_IHTMLStyle(iface);
687 TRACE("(%p)->(%p)\n", This, p);
689 return get_style_attr(This, STYLEID_FONT_FAMILY, p);
692 static HRESULT WINAPI HTMLStyle_put_fontStyle(IHTMLStyle *iface, BSTR v)
694 HTMLStyle *This = impl_from_IHTMLStyle(iface);
695 static const WCHAR szItalic[] = {'i','t','a','l','i','c',0};
696 static const WCHAR szOblique[] = {'o','b','l','i','q','u','e',0};
698 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
700 /* fontStyle can only be one of the follow values. */
701 if(!v || strcmpiW(szNormal, v) == 0 || strcmpiW(szItalic, v) == 0 ||
702 strcmpiW(szOblique, v) == 0)
704 return set_nsstyle_attr(This->nsstyle, STYLEID_FONT_STYLE, v, 0);
710 static HRESULT WINAPI HTMLStyle_get_fontStyle(IHTMLStyle *iface, BSTR *p)
712 HTMLStyle *This = impl_from_IHTMLStyle(iface);
714 TRACE("(%p)->(%p)\n", This, p);
716 return get_style_attr(This, STYLEID_FONT_STYLE, p);
719 static HRESULT WINAPI HTMLStyle_put_fontVariant(IHTMLStyle *iface, BSTR v)
721 HTMLStyle *This = impl_from_IHTMLStyle(iface);
722 static const WCHAR szCaps[] = {'s','m','a','l','l','-','c','a','p','s',0};
724 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
726 /* fontVariant can only be one of the follow values. */
727 if(!v || strcmpiW(szNormal, v) == 0 || strcmpiW(szCaps, v) == 0)
729 return set_nsstyle_attr(This->nsstyle, STYLEID_FONT_VARIANT, v, 0);
735 static HRESULT WINAPI HTMLStyle_get_fontVariant(IHTMLStyle *iface, BSTR *p)
737 HTMLStyle *This = impl_from_IHTMLStyle(iface);
738 TRACE("(%p)->(%p)\n", This, p);
743 return get_style_attr(This, STYLEID_FONT_VARIANT, p);
746 static HRESULT WINAPI HTMLStyle_put_fontWeight(IHTMLStyle *iface, BSTR v)
748 HTMLStyle *This = impl_from_IHTMLStyle(iface);
749 static const WCHAR styleBold[] = {'b','o','l','d',0};
750 static const WCHAR styleBolder[] = {'b','o','l','d','e','r',0};
751 static const WCHAR styleLighter[] = {'l','i','g','h','t','e','r',0};
752 static const WCHAR style100[] = {'1','0','0',0};
753 static const WCHAR style200[] = {'2','0','0',0};
754 static const WCHAR style300[] = {'3','0','0',0};
755 static const WCHAR style400[] = {'4','0','0',0};
756 static const WCHAR style500[] = {'5','0','0',0};
757 static const WCHAR style600[] = {'6','0','0',0};
758 static const WCHAR style700[] = {'7','0','0',0};
759 static const WCHAR style800[] = {'8','0','0',0};
760 static const WCHAR style900[] = {'9','0','0',0};
762 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
764 /* fontWeight can only be one of the following */
765 if(!v || strcmpiW(szNormal, v) == 0 || strcmpiW(styleBold, v) == 0 ||
766 strcmpiW(styleBolder, v) == 0 || strcmpiW(styleLighter, v) == 0 ||
767 strcmpiW(style100, v) == 0 || strcmpiW(style200, v) == 0 ||
768 strcmpiW(style300, v) == 0 || strcmpiW(style400, v) == 0 ||
769 strcmpiW(style500, v) == 0 || strcmpiW(style600, v) == 0 ||
770 strcmpiW(style700, v) == 0 || strcmpiW(style800, v) == 0 ||
771 strcmpiW(style900, v) == 0
774 return set_nsstyle_attr(This->nsstyle, STYLEID_FONT_WEIGHT, v, 0);
780 static HRESULT WINAPI HTMLStyle_get_fontWeight(IHTMLStyle *iface, BSTR *p)
782 HTMLStyle *This = impl_from_IHTMLStyle(iface);
784 TRACE("(%p)->(%p)\n", This, p);
786 return get_style_attr(This, STYLEID_FONT_WEIGHT, p);
789 static HRESULT WINAPI HTMLStyle_put_fontSize(IHTMLStyle *iface, VARIANT v)
791 HTMLStyle *This = impl_from_IHTMLStyle(iface);
793 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
797 return set_style_attr(This, STYLEID_FONT_SIZE, V_BSTR(&v), 0);
799 FIXME("not supported vt %d\n", V_VT(&v));
805 static HRESULT WINAPI HTMLStyle_get_fontSize(IHTMLStyle *iface, VARIANT *p)
807 HTMLStyle *This = impl_from_IHTMLStyle(iface);
809 TRACE("(%p)->(%p)\n", This, p);
812 return get_style_attr(This, STYLEID_FONT_SIZE, &V_BSTR(p));
815 static HRESULT WINAPI HTMLStyle_put_font(IHTMLStyle *iface, BSTR v)
817 HTMLStyle *This = impl_from_IHTMLStyle(iface);
818 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
822 static HRESULT WINAPI HTMLStyle_get_font(IHTMLStyle *iface, BSTR *p)
824 HTMLStyle *This = impl_from_IHTMLStyle(iface);
825 FIXME("(%p)->(%p)\n", This, p);
829 static HRESULT WINAPI HTMLStyle_put_color(IHTMLStyle *iface, VARIANT v)
831 HTMLStyle *This = impl_from_IHTMLStyle(iface);
833 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
837 TRACE("%s\n", debugstr_w(V_BSTR(&v)));
838 return set_style_attr(This, STYLEID_COLOR, V_BSTR(&v), 0);
841 FIXME("unsupported vt=%d\n", V_VT(&v));
847 static HRESULT WINAPI HTMLStyle_get_color(IHTMLStyle *iface, VARIANT *p)
849 HTMLStyle *This = impl_from_IHTMLStyle(iface);
851 TRACE("(%p)->(%p)\n", This, p);
854 return get_style_attr(This, STYLEID_COLOR, &V_BSTR(p));
857 static HRESULT WINAPI HTMLStyle_put_background(IHTMLStyle *iface, BSTR v)
859 HTMLStyle *This = impl_from_IHTMLStyle(iface);
861 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
863 return set_style_attr(This, STYLEID_BACKGROUND, v, 0);
866 static HRESULT WINAPI HTMLStyle_get_background(IHTMLStyle *iface, BSTR *p)
868 HTMLStyle *This = impl_from_IHTMLStyle(iface);
870 TRACE("(%p)->(%p)\n", This, p);
872 return get_style_attr(This, STYLEID_BACKGROUND, p);
875 static HRESULT WINAPI HTMLStyle_put_backgroundColor(IHTMLStyle *iface, VARIANT v)
877 HTMLStyle *This = impl_from_IHTMLStyle(iface);
879 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
883 return set_style_attr(This, STYLEID_BACKGROUND_COLOR, V_BSTR(&v), 0);
886 static const WCHAR format[] = {'#','%','0','6','x',0};
888 wsprintfW(value, format, V_I4(&v));
889 return set_style_attr(This, STYLEID_BACKGROUND_COLOR, value, 0);
892 FIXME("unsupported vt %d\n", V_VT(&v));
898 static HRESULT WINAPI HTMLStyle_get_backgroundColor(IHTMLStyle *iface, VARIANT *p)
900 HTMLStyle *This = impl_from_IHTMLStyle(iface);
901 TRACE("(%p)->(%p)\n", This, p);
904 return get_style_attr(This, STYLEID_BACKGROUND_COLOR, &V_BSTR(p));
907 static HRESULT WINAPI HTMLStyle_put_backgroundImage(IHTMLStyle *iface, BSTR v)
909 HTMLStyle *This = impl_from_IHTMLStyle(iface);
911 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
913 return set_style_attr(This, STYLEID_BACKGROUND_IMAGE, v, ATTR_FIX_URL);
916 static HRESULT WINAPI HTMLStyle_get_backgroundImage(IHTMLStyle *iface, BSTR *p)
918 HTMLStyle *This = impl_from_IHTMLStyle(iface);
920 TRACE("(%p)->(%p)\n", This, p);
922 return get_style_attr(This, STYLEID_BACKGROUND_IMAGE, p);
925 static HRESULT WINAPI HTMLStyle_put_backgroundRepeat(IHTMLStyle *iface, BSTR v)
927 HTMLStyle *This = impl_from_IHTMLStyle(iface);
928 static const WCHAR styleRepeat[] = {'r','e','p','e','a','t',0};
929 static const WCHAR styleNoRepeat[] = {'n','o','-','r','e','p','e','a','t',0};
930 static const WCHAR styleRepeatX[] = {'r','e','p','e','a','t','-','x',0};
931 static const WCHAR styleRepeatY[] = {'r','e','p','e','a','t','-','y',0};
933 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
935 /* fontWeight can only be one of the following */
936 if(!v || strcmpiW(styleRepeat, v) == 0 || strcmpiW(styleNoRepeat, v) == 0 ||
937 strcmpiW(styleRepeatX, v) == 0 || strcmpiW(styleRepeatY, v) == 0 )
939 return set_style_attr(This, STYLEID_BACKGROUND_REPEAT , v, 0);
945 static HRESULT WINAPI HTMLStyle_get_backgroundRepeat(IHTMLStyle *iface, BSTR *p)
947 HTMLStyle *This = impl_from_IHTMLStyle(iface);
949 TRACE("(%p)->(%p)\n", This, p);
951 return get_style_attr(This, STYLEID_BACKGROUND_REPEAT, p);
954 static HRESULT WINAPI HTMLStyle_put_backgroundAttachment(IHTMLStyle *iface, BSTR v)
956 HTMLStyle *This = impl_from_IHTMLStyle(iface);
957 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
961 static HRESULT WINAPI HTMLStyle_get_backgroundAttachment(IHTMLStyle *iface, BSTR *p)
963 HTMLStyle *This = impl_from_IHTMLStyle(iface);
964 FIXME("(%p)->(%p)\n", This, p);
968 static HRESULT WINAPI HTMLStyle_put_backgroundPosition(IHTMLStyle *iface, BSTR v)
970 HTMLStyle *This = impl_from_IHTMLStyle(iface);
972 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
974 return set_style_attr(This, STYLEID_BACKGROUND_POSITION, v, 0);
977 static HRESULT WINAPI HTMLStyle_get_backgroundPosition(IHTMLStyle *iface, BSTR *p)
979 HTMLStyle *This = impl_from_IHTMLStyle(iface);
981 TRACE("(%p)->(%p)\n", This, p);
983 return get_style_attr(This, STYLEID_BACKGROUND_POSITION, p);
986 static HRESULT WINAPI HTMLStyle_put_backgroundPositionX(IHTMLStyle *iface, VARIANT v)
988 HTMLStyle *This = impl_from_IHTMLStyle(iface);
989 WCHAR buf[14], *pos_val;
995 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
997 hres = var_to_styleval(&v, buf, ATTR_FIX_PX, &val);
1001 val_len = val ? strlenW(val) : 0;
1003 nsAString_Init(&pos_str, NULL);
1004 hres = get_nsstyle_attr_nsval(This->nsstyle, STYLEID_BACKGROUND_POSITION, &pos_str);
1005 if(SUCCEEDED(hres)) {
1006 const PRUnichar *pos, *posy;
1009 nsAString_GetData(&pos_str, &pos);
1010 posy = strchrW(pos, ' ');
1012 static const WCHAR zero_pxW[] = {' ','0','p','x',0};
1014 TRACE("no space in %s\n", debugstr_w(pos));
1018 posy_len = strlenW(posy);
1019 pos_val = heap_alloc((val_len+posy_len+1)*sizeof(WCHAR));
1022 memcpy(pos_val, val, val_len*sizeof(WCHAR));
1024 memcpy(pos_val+val_len, posy, posy_len*sizeof(WCHAR));
1025 pos_val[val_len+posy_len] = 0;
1027 hres = E_OUTOFMEMORY;
1030 nsAString_Finish(&pos_str);
1034 TRACE("setting position to %s\n", debugstr_w(pos_val));
1035 hres = set_nsstyle_attr(This->nsstyle, STYLEID_BACKGROUND_POSITION, pos_val, ATTR_FIX_PX);
1040 static HRESULT WINAPI HTMLStyle_get_backgroundPositionX(IHTMLStyle *iface, VARIANT *p)
1042 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1047 TRACE("(%p)->(%p)\n", This, p);
1049 nsAString_Init(&pos_str, NULL);
1050 hres = get_nsstyle_attr_nsval(This->nsstyle, STYLEID_BACKGROUND_POSITION, &pos_str);
1051 if(SUCCEEDED(hres)) {
1052 const PRUnichar *pos, *space;
1054 nsAString_GetData(&pos_str, &pos);
1055 space = strchrW(pos, ' ');
1057 WARN("no space in %s\n", debugstr_w(pos));
1058 space = pos + strlenW(pos);
1062 ret = SysAllocStringLen(pos, space-pos);
1064 hres = E_OUTOFMEMORY;
1069 nsAString_Finish(&pos_str);
1073 TRACE("returning %s\n", debugstr_w(ret));
1079 static HRESULT WINAPI HTMLStyle_put_backgroundPositionY(IHTMLStyle *iface, VARIANT v)
1081 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1082 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
1083 return set_nsstyle_attr_var(This->nsstyle, STYLEID_BACKGROUND_POSITION_Y, &v, 0);
1086 static HRESULT WINAPI HTMLStyle_get_backgroundPositionY(IHTMLStyle *iface, VARIANT *p)
1088 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1089 TRACE("(%p)->(%p)\n", This, p);
1090 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BACKGROUND_POSITION_Y, p, 0);
1093 static HRESULT WINAPI HTMLStyle_put_wordSpacing(IHTMLStyle *iface, VARIANT v)
1095 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1096 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
1097 return set_nsstyle_attr_var(This->nsstyle, STYLEID_WORD_SPACING, &v, 0);
1100 static HRESULT WINAPI HTMLStyle_get_wordSpacing(IHTMLStyle *iface, VARIANT *p)
1102 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1103 TRACE("(%p)->(%p)\n", This, p);
1104 return get_nsstyle_attr_var(This->nsstyle, STYLEID_WORD_SPACING, p, 0);
1107 static HRESULT WINAPI HTMLStyle_put_letterSpacing(IHTMLStyle *iface, VARIANT v)
1109 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1110 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
1111 return set_nsstyle_attr_var(This->nsstyle, STYLEID_LETTER_SPACING, &v, 0);
1114 static HRESULT WINAPI HTMLStyle_get_letterSpacing(IHTMLStyle *iface, VARIANT *p)
1116 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1117 TRACE("(%p)->(%p)\n", This, p);
1118 return get_nsstyle_attr_var(This->nsstyle, STYLEID_LETTER_SPACING, p, 0);
1121 static HRESULT WINAPI HTMLStyle_put_textDecoration(IHTMLStyle *iface, BSTR v)
1123 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1125 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1127 /* textDecoration can only be one of the following */
1128 if(!v || strcmpiW(styleNone, v) == 0 || strcmpiW(valUnderline, v) == 0 ||
1129 strcmpiW(valOverline, v) == 0 || strcmpiW(valLineThrough, v) == 0 ||
1130 strcmpiW(valBlink, v) == 0)
1132 return set_style_attr(This, STYLEID_TEXT_DECORATION , v, 0);
1135 return E_INVALIDARG;
1138 static HRESULT WINAPI HTMLStyle_get_textDecoration(IHTMLStyle *iface, BSTR *p)
1140 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1142 TRACE("(%p)->(%p)\n", This, p);
1144 return get_style_attr(This, STYLEID_TEXT_DECORATION, p);
1147 static HRESULT WINAPI HTMLStyle_put_textDecorationNone(IHTMLStyle *iface, VARIANT_BOOL v)
1149 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1151 TRACE("(%p)->(%x)\n", This, v);
1153 return set_style_attr(This, STYLEID_TEXT_DECORATION, v ? styleNone : emptyW, 0);
1156 static HRESULT WINAPI HTMLStyle_get_textDecorationNone(IHTMLStyle *iface, VARIANT_BOOL *p)
1158 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1160 TRACE("(%p)->(%p)\n", This, p);
1162 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, styleNone, p);
1165 static HRESULT WINAPI HTMLStyle_put_textDecorationUnderline(IHTMLStyle *iface, VARIANT_BOOL v)
1167 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1169 TRACE("(%p)->(%x)\n", This, v);
1171 return set_style_attr(This, STYLEID_TEXT_DECORATION, v ? valUnderline : emptyW, 0);
1174 static HRESULT WINAPI HTMLStyle_get_textDecorationUnderline(IHTMLStyle *iface, VARIANT_BOOL *p)
1176 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1178 TRACE("(%p)->(%p)\n", This, p);
1180 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, valUnderline, p);
1183 static HRESULT WINAPI HTMLStyle_put_textDecorationOverline(IHTMLStyle *iface, VARIANT_BOOL v)
1185 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1187 TRACE("(%p)->(%x)\n", This, v);
1189 return set_style_attr(This, STYLEID_TEXT_DECORATION, v ? valOverline : emptyW, 0);
1192 static HRESULT WINAPI HTMLStyle_get_textDecorationOverline(IHTMLStyle *iface, VARIANT_BOOL *p)
1194 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1196 TRACE("(%p)->(%p)\n", This, p);
1198 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, valOverline, p);
1201 static HRESULT WINAPI HTMLStyle_put_textDecorationLineThrough(IHTMLStyle *iface, VARIANT_BOOL v)
1203 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1205 TRACE("(%p)->(%x)\n", This, v);
1207 return set_style_attr(This, STYLEID_TEXT_DECORATION, v ? valLineThrough : emptyW, 0);
1210 static HRESULT WINAPI HTMLStyle_get_textDecorationLineThrough(IHTMLStyle *iface, VARIANT_BOOL *p)
1212 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1214 TRACE("(%p)->(%p)\n", This, p);
1216 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, valLineThrough, p);
1219 static HRESULT WINAPI HTMLStyle_put_textDecorationBlink(IHTMLStyle *iface, VARIANT_BOOL v)
1221 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1223 TRACE("(%p)->(%x)\n", This, v);
1225 return set_style_attr(This, STYLEID_TEXT_DECORATION, v ? valBlink : emptyW, 0);
1228 static HRESULT WINAPI HTMLStyle_get_textDecorationBlink(IHTMLStyle *iface, VARIANT_BOOL *p)
1230 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1232 TRACE("(%p)->(%p)\n", This, p);
1234 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, valBlink, p);
1237 static HRESULT WINAPI HTMLStyle_put_verticalAlign(IHTMLStyle *iface, VARIANT v)
1239 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1241 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1245 return set_style_attr(This, STYLEID_VERTICAL_ALIGN, V_BSTR(&v), 0);
1247 FIXME("not implemented vt %d\n", V_VT(&v));
1254 static HRESULT WINAPI HTMLStyle_get_verticalAlign(IHTMLStyle *iface, VARIANT *p)
1256 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1260 TRACE("(%p)->(%p)\n", This, p);
1262 hres = get_style_attr(This, STYLEID_VERTICAL_ALIGN, &ret);
1271 static HRESULT WINAPI HTMLStyle_put_textTransform(IHTMLStyle *iface, BSTR v)
1273 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1274 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1278 static HRESULT WINAPI HTMLStyle_get_textTransform(IHTMLStyle *iface, BSTR *p)
1280 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1281 FIXME("(%p)->(%p)\n", This, p);
1285 static HRESULT WINAPI HTMLStyle_put_textAlign(IHTMLStyle *iface, BSTR v)
1287 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1289 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1291 return set_style_attr(This, STYLEID_TEXT_ALIGN, v, 0);
1294 static HRESULT WINAPI HTMLStyle_get_textAlign(IHTMLStyle *iface, BSTR *p)
1296 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1298 TRACE("(%p)->(%p)\n", This, p);
1300 return get_style_attr(This, STYLEID_TEXT_ALIGN, p);
1303 static HRESULT WINAPI HTMLStyle_put_textIndent(IHTMLStyle *iface, VARIANT v)
1305 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1306 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1310 static HRESULT WINAPI HTMLStyle_get_textIndent(IHTMLStyle *iface, VARIANT *p)
1312 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1313 FIXME("(%p)->(%p)\n", This, p);
1317 static HRESULT WINAPI HTMLStyle_put_lineHeight(IHTMLStyle *iface, VARIANT v)
1319 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1320 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1324 static HRESULT WINAPI HTMLStyle_get_lineHeight(IHTMLStyle *iface, VARIANT *p)
1326 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1327 FIXME("(%p)->(%p)\n", This, p);
1331 static HRESULT WINAPI HTMLStyle_put_marginTop(IHTMLStyle *iface, VARIANT v)
1333 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1335 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
1337 return set_nsstyle_attr_var(This->nsstyle, STYLEID_MARGIN_TOP, &v, 0);
1340 static HRESULT WINAPI HTMLStyle_get_marginTop(IHTMLStyle *iface, VARIANT *p)
1342 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1344 TRACE("(%p)->(%p)\n", This, p);
1346 return get_nsstyle_attr_var(This->nsstyle, STYLEID_MARGIN_TOP, p, 0);
1349 static HRESULT WINAPI HTMLStyle_put_marginRight(IHTMLStyle *iface, VARIANT v)
1351 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1353 TRACE("(%p)->(v(%d))\n", This, V_VT(&v));
1357 return set_style_attr(This, STYLEID_MARGIN_RIGHT, emptyW, 0);
1361 wsprintfW(buf, px_formatW, V_I4(&v));
1362 return set_style_attr(This, STYLEID_MARGIN_RIGHT, buf, 0);
1365 return set_style_attr(This, STYLEID_MARGIN_RIGHT, V_BSTR(&v), 0);
1367 FIXME("Unsupported vt=%d\n", V_VT(&v));
1373 static HRESULT WINAPI HTMLStyle_get_marginRight(IHTMLStyle *iface, VARIANT *p)
1375 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1376 TRACE("(%p)->(%p)\n", This, p);
1377 return get_nsstyle_attr_var(This->nsstyle, STYLEID_MARGIN_RIGHT, p, 0);
1380 static HRESULT WINAPI HTMLStyle_put_marginBottom(IHTMLStyle *iface, VARIANT v)
1382 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1383 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1387 static HRESULT WINAPI HTMLStyle_get_marginBottom(IHTMLStyle *iface, VARIANT *p)
1389 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1390 FIXME("(%p)->(%p)\n", This, p);
1394 static HRESULT WINAPI HTMLStyle_put_marginLeft(IHTMLStyle *iface, VARIANT v)
1396 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1400 TRACE("(%p)->(NULL)\n", This);
1401 return set_style_attr(This, STYLEID_MARGIN_LEFT, emptyW, 0);
1405 TRACE("(%p)->(%d)\n", This, V_I4(&v));
1407 wsprintfW(buf, px_formatW, V_I4(&v));
1408 return set_style_attr(This, STYLEID_MARGIN_LEFT, buf, 0);
1411 TRACE("(%p)->(%s)\n", This, debugstr_w(V_BSTR(&v)));
1412 return set_style_attr(This, STYLEID_MARGIN_LEFT, V_BSTR(&v), 0);
1414 FIXME("Unsupported vt=%d\n", V_VT(&v));
1420 static HRESULT WINAPI HTMLStyle_put_margin(IHTMLStyle *iface, BSTR v)
1422 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1424 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1426 return set_style_attr(This, STYLEID_MARGIN, v, 0);
1429 static HRESULT WINAPI HTMLStyle_get_margin(IHTMLStyle *iface, BSTR *p)
1431 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1433 TRACE("(%p)->(%p)\n", This, p);
1435 return get_style_attr(This, STYLEID_MARGIN, p);
1438 static HRESULT WINAPI HTMLStyle_get_marginLeft(IHTMLStyle *iface, VARIANT *p)
1440 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1441 TRACE("(%p)->(%p)\n", This, p);
1442 return get_nsstyle_attr_var(This->nsstyle, STYLEID_MARGIN_LEFT, p, 0);
1445 static HRESULT WINAPI HTMLStyle_put_paddingTop(IHTMLStyle *iface, VARIANT v)
1447 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1448 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1452 static HRESULT WINAPI HTMLStyle_get_paddingTop(IHTMLStyle *iface, VARIANT *p)
1454 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1455 FIXME("(%p)->(%p)\n", This, p);
1459 static HRESULT WINAPI HTMLStyle_put_paddingRight(IHTMLStyle *iface, VARIANT v)
1461 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1462 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1466 static HRESULT WINAPI HTMLStyle_get_paddingRight(IHTMLStyle *iface, VARIANT *p)
1468 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1469 FIXME("(%p)->(%p)\n", This, p);
1473 static HRESULT WINAPI HTMLStyle_put_paddingBottom(IHTMLStyle *iface, VARIANT v)
1475 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1476 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1480 static HRESULT WINAPI HTMLStyle_get_paddingBottom(IHTMLStyle *iface, VARIANT *p)
1482 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1483 FIXME("(%p)->(%p)\n", This, p);
1487 static HRESULT WINAPI HTMLStyle_put_paddingLeft(IHTMLStyle *iface, VARIANT v)
1489 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1491 TRACE("(%p)->(vt=%d)\n", This, V_VT(&v));
1497 wsprintfW(buf, px_formatW, V_I4(&v));
1498 return set_style_attr(This, STYLEID_PADDING_LEFT, buf, 0);
1501 return set_style_attr(This, STYLEID_PADDING_LEFT, V_BSTR(&v), 0);
1503 FIXME("unsupported vt=%d\n", V_VT(&v));
1509 static HRESULT WINAPI HTMLStyle_get_paddingLeft(IHTMLStyle *iface, VARIANT *p)
1511 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1515 TRACE("(%p)->(%p)\n", This, p);
1517 hres = get_style_attr(This, STYLEID_PADDING_LEFT, &ret);
1526 static HRESULT WINAPI HTMLStyle_put_padding(IHTMLStyle *iface, BSTR v)
1528 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1530 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1532 return set_style_attr(This, STYLEID_PADDING, v, 0);
1535 static HRESULT WINAPI HTMLStyle_get_padding(IHTMLStyle *iface, BSTR *p)
1537 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1539 TRACE("(%p)->(%p)\n", This, p);
1541 return get_style_attr(This, STYLEID_PADDING, p);
1544 static HRESULT WINAPI HTMLStyle_put_border(IHTMLStyle *iface, BSTR v)
1546 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1548 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1550 return set_style_attr(This, STYLEID_BORDER, v, 0);
1553 static HRESULT WINAPI HTMLStyle_get_border(IHTMLStyle *iface, BSTR *p)
1555 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1557 TRACE("(%p)->(%p)\n", This, p);
1559 return get_style_attr(This, STYLEID_BORDER, p);
1562 static HRESULT WINAPI HTMLStyle_put_borderTop(IHTMLStyle *iface, BSTR v)
1564 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1565 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1566 return set_style_attr(This, STYLEID_BORDER_TOP, v, ATTR_FIX_PX);
1569 static HRESULT WINAPI HTMLStyle_get_borderTop(IHTMLStyle *iface, BSTR *p)
1571 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1572 TRACE("(%p)->(%p)\n", This, p);
1573 return get_style_attr(This, STYLEID_BORDER_TOP, p);
1576 static HRESULT WINAPI HTMLStyle_put_borderRight(IHTMLStyle *iface, BSTR v)
1578 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1579 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1580 return set_style_attr(This, STYLEID_BORDER_RIGHT, v, ATTR_FIX_PX);
1583 static HRESULT WINAPI HTMLStyle_get_borderRight(IHTMLStyle *iface, BSTR *p)
1585 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1586 TRACE("(%p)->(%p)\n", This, p);
1587 return get_style_attr(This, STYLEID_BORDER_RIGHT, p);
1590 static HRESULT WINAPI HTMLStyle_put_borderBottom(IHTMLStyle *iface, BSTR v)
1592 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1593 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1594 return set_style_attr(This, STYLEID_BORDER_BOTTOM, v, ATTR_FIX_PX);
1597 static HRESULT WINAPI HTMLStyle_get_borderBottom(IHTMLStyle *iface, BSTR *p)
1599 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1600 TRACE("(%p)->(%p)\n", This, p);
1601 return get_style_attr(This, STYLEID_BORDER_BOTTOM, p);
1604 static HRESULT WINAPI HTMLStyle_put_borderLeft(IHTMLStyle *iface, BSTR v)
1606 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1608 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1610 return set_style_attr(This, STYLEID_BORDER_LEFT, v, ATTR_FIX_PX);
1613 static HRESULT WINAPI HTMLStyle_get_borderLeft(IHTMLStyle *iface, BSTR *p)
1615 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1617 TRACE("(%p)->(%p)\n", This, p);
1619 return get_style_attr(This, STYLEID_BORDER_LEFT, p);
1622 static HRESULT WINAPI HTMLStyle_put_borderColor(IHTMLStyle *iface, BSTR v)
1624 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1626 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1628 return set_style_attr(This, STYLEID_BORDER_COLOR, v, 0);
1631 static HRESULT WINAPI HTMLStyle_get_borderColor(IHTMLStyle *iface, BSTR *p)
1633 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1635 TRACE("(%p)->(%p)\n", This, p);
1637 return get_style_attr(This, STYLEID_BORDER_COLOR, p);
1640 static HRESULT WINAPI HTMLStyle_put_borderTopColor(IHTMLStyle *iface, VARIANT v)
1642 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1644 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
1646 return set_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_TOP_COLOR, &v, ATTR_HEX_INT);
1649 static HRESULT WINAPI HTMLStyle_get_borderTopColor(IHTMLStyle *iface, VARIANT *p)
1651 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1653 TRACE("(%p)->(%p)\n", This, p);
1655 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_TOP_COLOR, p, 0);
1658 static HRESULT WINAPI HTMLStyle_put_borderRightColor(IHTMLStyle *iface, VARIANT v)
1660 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1662 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
1664 return set_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_RIGHT_COLOR, &v, ATTR_HEX_INT);
1667 static HRESULT WINAPI HTMLStyle_get_borderRightColor(IHTMLStyle *iface, VARIANT *p)
1669 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1671 TRACE("(%p)->(%p)\n", This, p);
1673 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_RIGHT_COLOR, p, 0);
1676 static HRESULT WINAPI HTMLStyle_put_borderBottomColor(IHTMLStyle *iface, VARIANT v)
1678 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1680 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
1682 return set_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_BOTTOM_COLOR, &v, ATTR_HEX_INT);
1685 static HRESULT WINAPI HTMLStyle_get_borderBottomColor(IHTMLStyle *iface, VARIANT *p)
1687 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1689 TRACE("(%p)->(%p)\n", This, p);
1691 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_BOTTOM_COLOR, p, 0);
1694 static HRESULT WINAPI HTMLStyle_put_borderLeftColor(IHTMLStyle *iface, VARIANT v)
1696 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1698 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
1700 return set_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_LEFT_COLOR, &v, ATTR_HEX_INT);
1703 static HRESULT WINAPI HTMLStyle_get_borderLeftColor(IHTMLStyle *iface, VARIANT *p)
1705 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1707 TRACE("(%p)->(%p)\n", This, p);
1709 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_LEFT_COLOR, p, 0);
1712 static HRESULT WINAPI HTMLStyle_put_borderWidth(IHTMLStyle *iface, BSTR v)
1714 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1715 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1716 return set_style_attr(This, STYLEID_BORDER_WIDTH, v, ATTR_FIX_PX);
1719 static HRESULT WINAPI HTMLStyle_get_borderWidth(IHTMLStyle *iface, BSTR *p)
1721 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1722 TRACE("(%p)->(%p)\n", This, p);
1723 return get_style_attr(This, STYLEID_BORDER_WIDTH, p);
1726 static HRESULT WINAPI HTMLStyle_put_borderTopWidth(IHTMLStyle *iface, VARIANT v)
1728 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1729 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
1730 return set_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_TOP_WIDTH, &v, 0);
1733 static HRESULT WINAPI HTMLStyle_get_borderTopWidth(IHTMLStyle *iface, VARIANT *p)
1735 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1737 TRACE("(%p)->(%p)\n", This, p);
1739 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_TOP_WIDTH, p, 0);
1742 static HRESULT WINAPI HTMLStyle_put_borderRightWidth(IHTMLStyle *iface, VARIANT v)
1744 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1745 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
1746 return set_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_RIGHT_WIDTH, &v, 0);
1749 static HRESULT WINAPI HTMLStyle_get_borderRightWidth(IHTMLStyle *iface, VARIANT *p)
1751 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1752 TRACE("(%p)->(%p)\n", This, p);
1753 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_RIGHT_WIDTH, p, 0);
1756 static HRESULT WINAPI HTMLStyle_put_borderBottomWidth(IHTMLStyle *iface, VARIANT v)
1758 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1760 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
1761 return set_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_BOTTOM_WIDTH, &v, 0);
1764 static HRESULT WINAPI HTMLStyle_get_borderBottomWidth(IHTMLStyle *iface, VARIANT *p)
1766 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1767 TRACE("(%p)->(%p)\n", This, p);
1768 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_BOTTOM_WIDTH, p, 0);
1771 static HRESULT WINAPI HTMLStyle_put_borderLeftWidth(IHTMLStyle *iface, VARIANT v)
1773 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1774 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
1775 return set_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_LEFT_WIDTH, &v, 0);
1778 static HRESULT WINAPI HTMLStyle_get_borderLeftWidth(IHTMLStyle *iface, VARIANT *p)
1780 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1781 TRACE("(%p)->(%p)\n", This, p);
1782 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_LEFT_WIDTH, p, 0);
1785 static HRESULT WINAPI HTMLStyle_put_borderStyle(IHTMLStyle *iface, BSTR v)
1787 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1788 static const WCHAR styleWindowInset[] = {'w','i','n','d','o','w','-','i','n','s','e','t',0};
1789 HRESULT hres = S_OK;
1794 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1796 while(v[i] && hres == S_OK)
1798 if(v[i] == (WCHAR)' ')
1800 pstyle = SysAllocStringLen(&v[last], (i-last));
1801 if( !(is_valid_border_style(pstyle) || strcmpiW(styleWindowInset, pstyle) == 0))
1803 TRACE("1. Invalid style (%s)\n", debugstr_w(pstyle));
1804 hres = E_INVALIDARG;
1806 SysFreeString(pstyle);
1814 pstyle = SysAllocStringLen(&v[last], i-last);
1815 if( !(is_valid_border_style(pstyle) || strcmpiW(styleWindowInset, pstyle) == 0))
1817 TRACE("2. Invalid style (%s)\n", debugstr_w(pstyle));
1818 hres = E_INVALIDARG;
1820 SysFreeString(pstyle);
1824 hres = set_nsstyle_attr(This->nsstyle, STYLEID_BORDER_STYLE, v, 0);
1829 static HRESULT WINAPI HTMLStyle_get_borderStyle(IHTMLStyle *iface, BSTR *p)
1831 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1832 TRACE("(%p)->(%p)\n", This, p);
1833 return get_style_attr(This, STYLEID_BORDER_STYLE, p);
1836 static HRESULT WINAPI HTMLStyle_put_borderTopStyle(IHTMLStyle *iface, BSTR v)
1838 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1839 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1841 if(!is_valid_border_style(v))
1842 return E_INVALIDARG;
1844 return set_style_attr(This, STYLEID_BORDER_TOP_STYLE, v, 0);
1847 static HRESULT WINAPI HTMLStyle_get_borderTopStyle(IHTMLStyle *iface, BSTR *p)
1849 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1850 TRACE("(%p)->(%p)\n", This, p);
1851 return get_style_attr(This, STYLEID_BORDER_TOP_STYLE, p);
1854 static HRESULT WINAPI HTMLStyle_put_borderRightStyle(IHTMLStyle *iface, BSTR v)
1856 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1857 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1859 if(!is_valid_border_style(v))
1860 return E_INVALIDARG;
1862 return set_style_attr(This, STYLEID_BORDER_RIGHT_STYLE, v, 0);
1865 static HRESULT WINAPI HTMLStyle_get_borderRightStyle(IHTMLStyle *iface, BSTR *p)
1867 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1868 TRACE("(%p)->(%p)\n", This, p);
1869 return get_style_attr(This, STYLEID_BORDER_RIGHT_STYLE, p);
1872 static HRESULT WINAPI HTMLStyle_put_borderBottomStyle(IHTMLStyle *iface, BSTR v)
1874 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1875 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1877 if(!is_valid_border_style(v))
1878 return E_INVALIDARG;
1880 return set_style_attr(This, STYLEID_BORDER_BOTTOM_STYLE, v, 0);
1883 static HRESULT WINAPI HTMLStyle_get_borderBottomStyle(IHTMLStyle *iface, BSTR *p)
1885 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1886 TRACE("(%p)->(%p)\n", This, p);
1887 return get_style_attr(This, STYLEID_BORDER_BOTTOM_STYLE, p);
1890 static HRESULT WINAPI HTMLStyle_put_borderLeftStyle(IHTMLStyle *iface, BSTR v)
1892 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1893 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1895 if(!is_valid_border_style(v))
1896 return E_INVALIDARG;
1898 return set_style_attr(This, STYLEID_BORDER_LEFT_STYLE, v, 0);
1901 static HRESULT WINAPI HTMLStyle_get_borderLeftStyle(IHTMLStyle *iface, BSTR *p)
1903 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1904 TRACE("(%p)->(%p)\n", This, p);
1905 return get_style_attr(This, STYLEID_BORDER_LEFT_STYLE, p);
1908 static HRESULT WINAPI HTMLStyle_put_width(IHTMLStyle *iface, VARIANT v)
1910 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1912 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
1914 return set_nsstyle_attr_var(This->nsstyle, STYLEID_WIDTH, &v, ATTR_FIX_PX);
1917 static HRESULT WINAPI HTMLStyle_get_width(IHTMLStyle *iface, VARIANT *p)
1919 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1921 TRACE("(%p)->(%p)\n", This, p);
1924 return get_style_attr(This, STYLEID_WIDTH, &V_BSTR(p));
1927 static HRESULT WINAPI HTMLStyle_put_height(IHTMLStyle *iface, VARIANT v)
1929 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1931 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1935 return set_style_attr(This, STYLEID_HEIGHT, V_BSTR(&v), 0);
1937 FIXME("unimplemented vt %d\n", V_VT(&v));
1944 static HRESULT WINAPI HTMLStyle_get_height(IHTMLStyle *iface, VARIANT *p)
1946 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1950 TRACE("(%p)->(%p)\n", This, p);
1952 hres = get_style_attr(This, STYLEID_HEIGHT, &ret);
1961 static HRESULT WINAPI HTMLStyle_put_styleFloat(IHTMLStyle *iface, BSTR v)
1963 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1964 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1968 static HRESULT WINAPI HTMLStyle_get_styleFloat(IHTMLStyle *iface, BSTR *p)
1970 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1971 FIXME("(%p)->(%p)\n", This, p);
1975 static HRESULT WINAPI HTMLStyle_put_clear(IHTMLStyle *iface, BSTR v)
1977 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1978 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1982 static HRESULT WINAPI HTMLStyle_get_clear(IHTMLStyle *iface, BSTR *p)
1984 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1985 FIXME("(%p)->(%p)\n", This, p);
1989 static HRESULT WINAPI HTMLStyle_put_display(IHTMLStyle *iface, BSTR v)
1991 HTMLStyle *This = impl_from_IHTMLStyle(iface);
1993 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1995 return set_style_attr(This, STYLEID_DISPLAY, v, 0);
1998 static HRESULT WINAPI HTMLStyle_get_display(IHTMLStyle *iface, BSTR *p)
2000 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2002 TRACE("(%p)->(%p)\n", This, p);
2004 return get_style_attr(This, STYLEID_DISPLAY, p);
2007 static HRESULT WINAPI HTMLStyle_put_visibility(IHTMLStyle *iface, BSTR v)
2009 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2011 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2013 return set_style_attr(This, STYLEID_VISIBILITY, v, 0);
2016 static HRESULT WINAPI HTMLStyle_get_visibility(IHTMLStyle *iface, BSTR *p)
2018 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2020 TRACE("(%p)->(%p)\n", This, p);
2022 return get_style_attr(This, STYLEID_VISIBILITY, p);
2025 static HRESULT WINAPI HTMLStyle_put_listStyleType(IHTMLStyle *iface, BSTR v)
2027 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2028 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
2032 static HRESULT WINAPI HTMLStyle_get_listStyleType(IHTMLStyle *iface, BSTR *p)
2034 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2035 FIXME("(%p)->(%p)\n", This, p);
2039 static HRESULT WINAPI HTMLStyle_put_listStylePosition(IHTMLStyle *iface, BSTR v)
2041 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2042 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
2046 static HRESULT WINAPI HTMLStyle_get_listStylePosition(IHTMLStyle *iface, BSTR *p)
2048 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2049 FIXME("(%p)->(%p)\n", This, p);
2053 static HRESULT WINAPI HTMLStyle_put_listStyleImage(IHTMLStyle *iface, BSTR v)
2055 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2056 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
2060 static HRESULT WINAPI HTMLStyle_get_listStyleImage(IHTMLStyle *iface, BSTR *p)
2062 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2063 FIXME("(%p)->(%p)\n", This, p);
2067 static HRESULT WINAPI HTMLStyle_put_listStyle(IHTMLStyle *iface, BSTR v)
2069 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2070 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
2074 static HRESULT WINAPI HTMLStyle_get_listStyle(IHTMLStyle *iface, BSTR *p)
2076 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2077 FIXME("(%p)->(%p)\n", This, p);
2081 static HRESULT WINAPI HTMLStyle_put_whiteSpace(IHTMLStyle *iface, BSTR v)
2083 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2084 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
2088 static HRESULT WINAPI HTMLStyle_get_whiteSpace(IHTMLStyle *iface, BSTR *p)
2090 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2091 FIXME("(%p)->(%p)\n", This, p);
2095 static HRESULT WINAPI HTMLStyle_put_top(IHTMLStyle *iface, VARIANT v)
2097 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2099 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
2101 return set_nsstyle_attr_var(This->nsstyle, STYLEID_TOP, &v, 0);
2104 static HRESULT WINAPI HTMLStyle_get_top(IHTMLStyle *iface, VARIANT *p)
2106 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2110 TRACE("(%p)->(%p)\n", This, p);
2112 hres = get_style_attr(This, STYLEID_TOP, &ret);
2121 static HRESULT WINAPI HTMLStyle_put_left(IHTMLStyle *iface, VARIANT v)
2123 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2125 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
2127 return set_nsstyle_attr_var(This->nsstyle, STYLEID_LEFT, &v, 0);
2130 static HRESULT WINAPI HTMLStyle_get_left(IHTMLStyle *iface, VARIANT *p)
2132 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2136 TRACE("(%p)->(%p)\n", This, p);
2138 hres = get_style_attr(This, STYLEID_LEFT, &ret);
2147 static HRESULT WINAPI HTMLStyle_get_position(IHTMLStyle *iface, BSTR *p)
2149 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2150 TRACE("(%p)->(%p)\n", This, p);
2151 return IHTMLStyle2_get_position(&This->IHTMLStyle2_iface, p);
2154 static HRESULT WINAPI HTMLStyle_put_zIndex(IHTMLStyle *iface, VARIANT v)
2156 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2158 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
2162 return set_style_attr(This, STYLEID_Z_INDEX, V_BSTR(&v), 0);
2165 static const WCHAR format[] = {'%','d',0};
2167 wsprintfW(value, format, V_I4(&v));
2168 return set_style_attr(This, STYLEID_Z_INDEX, value, 0);
2171 FIXME("unimplemented vt %d\n", V_VT(&v));
2178 static HRESULT WINAPI HTMLStyle_get_zIndex(IHTMLStyle *iface, VARIANT *p)
2180 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2182 TRACE("(%p)->(%p)\n", This, p);
2184 return get_nsstyle_attr_var(This->nsstyle, STYLEID_Z_INDEX, p, ATTR_STR_TO_INT);
2187 static HRESULT WINAPI HTMLStyle_put_overflow(IHTMLStyle *iface, BSTR v)
2189 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2190 static const WCHAR szVisible[] = {'v','i','s','i','b','l','e',0};
2191 static const WCHAR szScroll[] = {'s','c','r','o','l','l',0};
2192 static const WCHAR szHidden[] = {'h','i','d','d','e','n',0};
2193 static const WCHAR szAuto[] = {'a','u','t','o',0};
2195 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2197 /* overflow can only be one of the follow values. */
2198 if(!v || !*v || strcmpiW(szVisible, v) == 0 || strcmpiW(szScroll, v) == 0 ||
2199 strcmpiW(szHidden, v) == 0 || strcmpiW(szAuto, v) == 0)
2201 return set_nsstyle_attr(This->nsstyle, STYLEID_OVERFLOW, v, 0);
2204 return E_INVALIDARG;
2208 static HRESULT WINAPI HTMLStyle_get_overflow(IHTMLStyle *iface, BSTR *p)
2210 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2212 TRACE("(%p)->(%p)\n", This, p);
2215 return E_INVALIDARG;
2217 return get_style_attr(This, STYLEID_OVERFLOW, p);
2220 static HRESULT WINAPI HTMLStyle_put_pageBreakBefore(IHTMLStyle *iface, BSTR v)
2222 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2223 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
2227 static HRESULT WINAPI HTMLStyle_get_pageBreakBefore(IHTMLStyle *iface, BSTR *p)
2229 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2230 FIXME("(%p)->(%p)\n", This, p);
2234 static HRESULT WINAPI HTMLStyle_put_pageBreakAfter(IHTMLStyle *iface, BSTR v)
2236 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2237 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
2241 static HRESULT WINAPI HTMLStyle_get_pageBreakAfter(IHTMLStyle *iface, BSTR *p)
2243 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2244 FIXME("(%p)->(%p)\n", This, p);
2248 static HRESULT WINAPI HTMLStyle_put_cssText(IHTMLStyle *iface, BSTR v)
2250 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2254 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2256 nsAString_InitDepend(&text_str, v);
2257 nsres = nsIDOMCSSStyleDeclaration_SetCssText(This->nsstyle, &text_str);
2258 nsAString_Finish(&text_str);
2259 if(NS_FAILED(nsres)) {
2260 FIXME("SetCssStyle failed: %08x\n", nsres);
2267 static HRESULT WINAPI HTMLStyle_get_cssText(IHTMLStyle *iface, BSTR *p)
2269 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2273 TRACE("(%p)->(%p)\n", This, p);
2275 /* FIXME: Gecko style formatting is different than IE (uppercase). */
2276 nsAString_Init(&text_str, NULL);
2277 nsres = nsIDOMCSSStyleDeclaration_GetCssText(This->nsstyle, &text_str);
2278 if(NS_SUCCEEDED(nsres)) {
2279 const PRUnichar *text;
2281 nsAString_GetData(&text_str, &text);
2282 *p = *text ? SysAllocString(text) : NULL;
2284 FIXME("GetCssStyle failed: %08x\n", nsres);
2288 nsAString_Finish(&text_str);
2292 static HRESULT WINAPI HTMLStyle_put_pixelTop(IHTMLStyle *iface, LONG v)
2294 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2295 FIXME("(%p)->()\n", This);
2299 static HRESULT WINAPI HTMLStyle_get_pixelTop(IHTMLStyle *iface, LONG *p)
2301 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2302 FIXME("(%p)->()\n", This);
2306 static HRESULT WINAPI HTMLStyle_put_pixelLeft(IHTMLStyle *iface, LONG v)
2308 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2309 FIXME("(%p)->()\n", This);
2313 static HRESULT WINAPI HTMLStyle_get_pixelLeft(IHTMLStyle *iface, LONG *p)
2315 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2316 FIXME("(%p)->()\n", This);
2320 static HRESULT WINAPI HTMLStyle_put_pixelWidth(IHTMLStyle *iface, LONG v)
2322 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2323 FIXME("(%p)->()\n", This);
2327 static HRESULT WINAPI HTMLStyle_get_pixelWidth(IHTMLStyle *iface, LONG *p)
2329 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2330 FIXME("(%p)->()\n", This);
2334 static HRESULT WINAPI HTMLStyle_put_pixelHeight(IHTMLStyle *iface, LONG v)
2336 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2337 FIXME("(%p)->()\n", This);
2341 static HRESULT WINAPI HTMLStyle_get_pixelHeight(IHTMLStyle *iface, LONG *p)
2343 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2344 FIXME("(%p)->()\n", This);
2348 static HRESULT WINAPI HTMLStyle_put_posTop(IHTMLStyle *iface, float v)
2350 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2352 TRACE("(%p)->(%f)\n", This, v);
2354 return set_style_pos(This, STYLEID_TOP, v);
2357 static HRESULT WINAPI HTMLStyle_get_posTop(IHTMLStyle *iface, float *p)
2359 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2361 TRACE("(%p)->(%p)\n", This, p);
2366 return get_nsstyle_pos(This, STYLEID_TOP, p);
2369 static HRESULT WINAPI HTMLStyle_put_posLeft(IHTMLStyle *iface, float v)
2371 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2373 TRACE("(%p)->(%f)\n", This, v);
2375 return set_style_pos(This, STYLEID_LEFT, v);
2378 static HRESULT WINAPI HTMLStyle_get_posLeft(IHTMLStyle *iface, float *p)
2380 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2382 TRACE("(%p)->(%p)\n", This, p);
2387 return get_nsstyle_pos(This, STYLEID_LEFT, p);
2390 static HRESULT WINAPI HTMLStyle_put_posWidth(IHTMLStyle *iface, float v)
2392 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2394 TRACE("(%p)->(%f)\n", This, v);
2396 return set_style_pos(This, STYLEID_WIDTH, v);
2399 static HRESULT WINAPI HTMLStyle_get_posWidth(IHTMLStyle *iface, float *p)
2401 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2403 TRACE("(%p)->(%p)\n", This, p);
2408 if(get_nsstyle_pos(This, STYLEID_WIDTH, p) != S_OK)
2414 static HRESULT WINAPI HTMLStyle_put_posHeight(IHTMLStyle *iface, float v)
2416 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2418 TRACE("(%p)->(%f)\n", This, v);
2420 return set_style_pos(This, STYLEID_HEIGHT, v);
2423 static HRESULT WINAPI HTMLStyle_get_posHeight(IHTMLStyle *iface, float *p)
2425 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2427 TRACE("(%p)->(%p)\n", This, p);
2432 if(get_nsstyle_pos(This, STYLEID_HEIGHT, p) != S_OK)
2438 static HRESULT WINAPI HTMLStyle_put_cursor(IHTMLStyle *iface, BSTR v)
2440 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2442 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2444 return set_style_attr(This, STYLEID_CURSOR, v, 0);
2447 static HRESULT WINAPI HTMLStyle_get_cursor(IHTMLStyle *iface, BSTR *p)
2449 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2451 TRACE("(%p)->(%p)\n", This, p);
2453 return get_style_attr(This, STYLEID_CURSOR, p);
2456 static HRESULT WINAPI HTMLStyle_put_clip(IHTMLStyle *iface, BSTR v)
2458 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2459 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
2463 static HRESULT WINAPI HTMLStyle_get_clip(IHTMLStyle *iface, BSTR *p)
2465 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2466 FIXME("(%p)->(%p)\n", This, p);
2470 static HRESULT WINAPI HTMLStyle_put_filter(IHTMLStyle *iface, BSTR v)
2472 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2474 WARN("(%p)->(%s)\n", This, debugstr_w(v));
2476 /* FIXME: Handle MS-style filters */
2477 return set_style_attr(This, STYLEID_FILTER, v, 0);
2480 static HRESULT WINAPI HTMLStyle_get_filter(IHTMLStyle *iface, BSTR *p)
2482 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2484 WARN("(%p)->(%p)\n", This, p);
2486 /* FIXME: Handle MS-style filters */
2487 return get_style_attr(This, STYLEID_FILTER, p);
2490 static HRESULT WINAPI HTMLStyle_setAttribute(IHTMLStyle *iface, BSTR strAttributeName,
2491 VARIANT AttributeValue, LONG lFlags)
2493 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2497 TRACE("(%p)->(%s v%d %08x)\n", This, debugstr_w(strAttributeName),
2498 V_VT(&AttributeValue), lFlags);
2500 if(!strAttributeName)
2501 return E_INVALIDARG;
2504 FIXME("Parameter lFlags ignored\n");
2506 hres = HTMLStyle_GetIDsOfNames(iface, &IID_NULL, &strAttributeName, 1,
2507 LOCALE_USER_DEFAULT, &dispid);
2511 DISPID dispidNamed = DISPID_PROPERTYPUT;
2515 params.rgvarg = &AttributeValue;
2516 params.cNamedArgs = 1;
2517 params.rgdispidNamedArgs = &dispidNamed;
2519 hres = HTMLStyle_Invoke(iface, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
2520 DISPATCH_PROPERTYPUT, ¶ms, &ret, NULL, NULL);
2524 FIXME("Custom attributes not supported.\n");
2527 TRACE("ret: %08x\n", hres);
2532 static HRESULT WINAPI HTMLStyle_getAttribute(IHTMLStyle *iface, BSTR strAttributeName,
2533 LONG lFlags, VARIANT *AttributeValue)
2535 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2539 TRACE("(%p)->(%s v%p %08x)\n", This, debugstr_w(strAttributeName),
2540 AttributeValue, lFlags);
2542 if(!AttributeValue || !strAttributeName)
2543 return E_INVALIDARG;
2546 FIXME("Parameter lFlags ignored\n");
2548 hres = HTMLStyle_GetIDsOfNames(iface, &IID_NULL, &strAttributeName, 1,
2549 LOCALE_USER_DEFAULT, &dispid);
2552 DISPPARAMS params = {NULL, NULL, 0, 0 };
2554 hres = HTMLStyle_Invoke(iface, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
2555 DISPATCH_PROPERTYGET, ¶ms, AttributeValue, NULL, NULL);
2559 FIXME("Custom attributes not supported.\n");
2565 static HRESULT WINAPI HTMLStyle_removeAttribute(IHTMLStyle *iface, BSTR strAttributeName,
2566 LONG lFlags, VARIANT_BOOL *pfSuccess)
2568 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2569 FIXME("(%p)->(%s %08x %p)\n", This, debugstr_w(strAttributeName),
2574 static HRESULT WINAPI HTMLStyle_toString(IHTMLStyle *iface, BSTR *String)
2576 HTMLStyle *This = impl_from_IHTMLStyle(iface);
2577 FIXME("(%p)->(%p)\n", This, String);
2581 static const IHTMLStyleVtbl HTMLStyleVtbl = {
2582 HTMLStyle_QueryInterface,
2585 HTMLStyle_GetTypeInfoCount,
2586 HTMLStyle_GetTypeInfo,
2587 HTMLStyle_GetIDsOfNames,
2589 HTMLStyle_put_fontFamily,
2590 HTMLStyle_get_fontFamily,
2591 HTMLStyle_put_fontStyle,
2592 HTMLStyle_get_fontStyle,
2593 HTMLStyle_put_fontVariant,
2594 HTMLStyle_get_fontVariant,
2595 HTMLStyle_put_fontWeight,
2596 HTMLStyle_get_fontWeight,
2597 HTMLStyle_put_fontSize,
2598 HTMLStyle_get_fontSize,
2601 HTMLStyle_put_color,
2602 HTMLStyle_get_color,
2603 HTMLStyle_put_background,
2604 HTMLStyle_get_background,
2605 HTMLStyle_put_backgroundColor,
2606 HTMLStyle_get_backgroundColor,
2607 HTMLStyle_put_backgroundImage,
2608 HTMLStyle_get_backgroundImage,
2609 HTMLStyle_put_backgroundRepeat,
2610 HTMLStyle_get_backgroundRepeat,
2611 HTMLStyle_put_backgroundAttachment,
2612 HTMLStyle_get_backgroundAttachment,
2613 HTMLStyle_put_backgroundPosition,
2614 HTMLStyle_get_backgroundPosition,
2615 HTMLStyle_put_backgroundPositionX,
2616 HTMLStyle_get_backgroundPositionX,
2617 HTMLStyle_put_backgroundPositionY,
2618 HTMLStyle_get_backgroundPositionY,
2619 HTMLStyle_put_wordSpacing,
2620 HTMLStyle_get_wordSpacing,
2621 HTMLStyle_put_letterSpacing,
2622 HTMLStyle_get_letterSpacing,
2623 HTMLStyle_put_textDecoration,
2624 HTMLStyle_get_textDecoration,
2625 HTMLStyle_put_textDecorationNone,
2626 HTMLStyle_get_textDecorationNone,
2627 HTMLStyle_put_textDecorationUnderline,
2628 HTMLStyle_get_textDecorationUnderline,
2629 HTMLStyle_put_textDecorationOverline,
2630 HTMLStyle_get_textDecorationOverline,
2631 HTMLStyle_put_textDecorationLineThrough,
2632 HTMLStyle_get_textDecorationLineThrough,
2633 HTMLStyle_put_textDecorationBlink,
2634 HTMLStyle_get_textDecorationBlink,
2635 HTMLStyle_put_verticalAlign,
2636 HTMLStyle_get_verticalAlign,
2637 HTMLStyle_put_textTransform,
2638 HTMLStyle_get_textTransform,
2639 HTMLStyle_put_textAlign,
2640 HTMLStyle_get_textAlign,
2641 HTMLStyle_put_textIndent,
2642 HTMLStyle_get_textIndent,
2643 HTMLStyle_put_lineHeight,
2644 HTMLStyle_get_lineHeight,
2645 HTMLStyle_put_marginTop,
2646 HTMLStyle_get_marginTop,
2647 HTMLStyle_put_marginRight,
2648 HTMLStyle_get_marginRight,
2649 HTMLStyle_put_marginBottom,
2650 HTMLStyle_get_marginBottom,
2651 HTMLStyle_put_marginLeft,
2652 HTMLStyle_get_marginLeft,
2653 HTMLStyle_put_margin,
2654 HTMLStyle_get_margin,
2655 HTMLStyle_put_paddingTop,
2656 HTMLStyle_get_paddingTop,
2657 HTMLStyle_put_paddingRight,
2658 HTMLStyle_get_paddingRight,
2659 HTMLStyle_put_paddingBottom,
2660 HTMLStyle_get_paddingBottom,
2661 HTMLStyle_put_paddingLeft,
2662 HTMLStyle_get_paddingLeft,
2663 HTMLStyle_put_padding,
2664 HTMLStyle_get_padding,
2665 HTMLStyle_put_border,
2666 HTMLStyle_get_border,
2667 HTMLStyle_put_borderTop,
2668 HTMLStyle_get_borderTop,
2669 HTMLStyle_put_borderRight,
2670 HTMLStyle_get_borderRight,
2671 HTMLStyle_put_borderBottom,
2672 HTMLStyle_get_borderBottom,
2673 HTMLStyle_put_borderLeft,
2674 HTMLStyle_get_borderLeft,
2675 HTMLStyle_put_borderColor,
2676 HTMLStyle_get_borderColor,
2677 HTMLStyle_put_borderTopColor,
2678 HTMLStyle_get_borderTopColor,
2679 HTMLStyle_put_borderRightColor,
2680 HTMLStyle_get_borderRightColor,
2681 HTMLStyle_put_borderBottomColor,
2682 HTMLStyle_get_borderBottomColor,
2683 HTMLStyle_put_borderLeftColor,
2684 HTMLStyle_get_borderLeftColor,
2685 HTMLStyle_put_borderWidth,
2686 HTMLStyle_get_borderWidth,
2687 HTMLStyle_put_borderTopWidth,
2688 HTMLStyle_get_borderTopWidth,
2689 HTMLStyle_put_borderRightWidth,
2690 HTMLStyle_get_borderRightWidth,
2691 HTMLStyle_put_borderBottomWidth,
2692 HTMLStyle_get_borderBottomWidth,
2693 HTMLStyle_put_borderLeftWidth,
2694 HTMLStyle_get_borderLeftWidth,
2695 HTMLStyle_put_borderStyle,
2696 HTMLStyle_get_borderStyle,
2697 HTMLStyle_put_borderTopStyle,
2698 HTMLStyle_get_borderTopStyle,
2699 HTMLStyle_put_borderRightStyle,
2700 HTMLStyle_get_borderRightStyle,
2701 HTMLStyle_put_borderBottomStyle,
2702 HTMLStyle_get_borderBottomStyle,
2703 HTMLStyle_put_borderLeftStyle,
2704 HTMLStyle_get_borderLeftStyle,
2705 HTMLStyle_put_width,
2706 HTMLStyle_get_width,
2707 HTMLStyle_put_height,
2708 HTMLStyle_get_height,
2709 HTMLStyle_put_styleFloat,
2710 HTMLStyle_get_styleFloat,
2711 HTMLStyle_put_clear,
2712 HTMLStyle_get_clear,
2713 HTMLStyle_put_display,
2714 HTMLStyle_get_display,
2715 HTMLStyle_put_visibility,
2716 HTMLStyle_get_visibility,
2717 HTMLStyle_put_listStyleType,
2718 HTMLStyle_get_listStyleType,
2719 HTMLStyle_put_listStylePosition,
2720 HTMLStyle_get_listStylePosition,
2721 HTMLStyle_put_listStyleImage,
2722 HTMLStyle_get_listStyleImage,
2723 HTMLStyle_put_listStyle,
2724 HTMLStyle_get_listStyle,
2725 HTMLStyle_put_whiteSpace,
2726 HTMLStyle_get_whiteSpace,
2731 HTMLStyle_get_position,
2732 HTMLStyle_put_zIndex,
2733 HTMLStyle_get_zIndex,
2734 HTMLStyle_put_overflow,
2735 HTMLStyle_get_overflow,
2736 HTMLStyle_put_pageBreakBefore,
2737 HTMLStyle_get_pageBreakBefore,
2738 HTMLStyle_put_pageBreakAfter,
2739 HTMLStyle_get_pageBreakAfter,
2740 HTMLStyle_put_cssText,
2741 HTMLStyle_get_cssText,
2742 HTMLStyle_put_pixelTop,
2743 HTMLStyle_get_pixelTop,
2744 HTMLStyle_put_pixelLeft,
2745 HTMLStyle_get_pixelLeft,
2746 HTMLStyle_put_pixelWidth,
2747 HTMLStyle_get_pixelWidth,
2748 HTMLStyle_put_pixelHeight,
2749 HTMLStyle_get_pixelHeight,
2750 HTMLStyle_put_posTop,
2751 HTMLStyle_get_posTop,
2752 HTMLStyle_put_posLeft,
2753 HTMLStyle_get_posLeft,
2754 HTMLStyle_put_posWidth,
2755 HTMLStyle_get_posWidth,
2756 HTMLStyle_put_posHeight,
2757 HTMLStyle_get_posHeight,
2758 HTMLStyle_put_cursor,
2759 HTMLStyle_get_cursor,
2762 HTMLStyle_put_filter,
2763 HTMLStyle_get_filter,
2764 HTMLStyle_setAttribute,
2765 HTMLStyle_getAttribute,
2766 HTMLStyle_removeAttribute,
2770 static HRESULT HTMLStyle_get_dispid(DispatchEx *dispex, BSTR name, DWORD flags, DISPID *dispid)
2772 int c, i, min=0, max = sizeof(style_tbl)/sizeof(*style_tbl)-1;
2777 c = strcmpW(style_tbl[i].name, name);
2779 *dispid = style_tbl[i].dispid;
2789 return DISP_E_UNKNOWNNAME;
2792 static const dispex_static_data_vtbl_t HTMLStyle_dispex_vtbl = {
2794 HTMLStyle_get_dispid,
2798 static const tid_t HTMLStyle_iface_tids[] = {
2805 static dispex_static_data_t HTMLStyle_dispex = {
2806 &HTMLStyle_dispex_vtbl,
2809 HTMLStyle_iface_tids
2812 IHTMLStyle *HTMLStyle_Create(nsIDOMCSSStyleDeclaration *nsstyle)
2814 HTMLStyle *ret = heap_alloc_zero(sizeof(HTMLStyle));
2816 ret->IHTMLStyle_iface.lpVtbl = &HTMLStyleVtbl;
2818 ret->nsstyle = nsstyle;
2819 HTMLStyle2_Init(ret);
2820 HTMLStyle3_Init(ret);
2822 nsIDOMCSSStyleDeclaration_AddRef(nsstyle);
2824 init_dispex(&ret->dispex, (IUnknown*)&ret->IHTMLStyle_iface, &HTMLStyle_dispex);
2826 return &ret->IHTMLStyle_iface;