push 98299ad1251baa2727aab065c47e9d935978c732
[wine/hacks.git] / dlls / mshtml / htmlstyle.c
blob18d3e315c7776a5f382ddaeb76d55d61248710c7
1 /*
2 * Copyright 2006 Jacek Caban for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #include <stdarg.h>
20 #include <math.h>
22 #define COBJMACROS
24 #include "windef.h"
25 #include "winbase.h"
26 #include "winuser.h"
27 #include "ole2.h"
28 #include "mshtmdid.h"
30 #include "mshtml_private.h"
31 #include "htmlstyle.h"
33 #include "wine/debug.h"
34 #include "wine/unicode.h"
36 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
38 static const WCHAR attrBackground[] =
39 {'b','a','c','k','g','r','o','u','n','d',0};
40 static const WCHAR attrBackgroundColor[] =
41 {'b','a','c','k','g','r','o','u','n','d','-','c','o','l','o','r',0};
42 static const WCHAR attrBackgroundImage[] =
43 {'b','a','c','k','g','r','o','u','n','d','-','i','m','a','g','e',0};
44 static const WCHAR attrBorder[] =
45 {'b','o','r','d','e','r',0};
46 static const WCHAR attrBorderBottomStyle[] =
47 {'b','o','r','d','e','r','-','b','o','t','t','o','m','-','s','t','y','l','e',0};
48 static const WCHAR attrBorderLeft[] =
49 {'b','o','r','d','e','r','-','l','e','f','t',0};
50 static const WCHAR attrBorderLeftStyle[] =
51 {'b','o','r','d','e','r','-','l','e','f','t','-','s','t','y','l','e',0};
52 static const WCHAR attrBorderRightStyle[] =
53 {'b','o','r','d','e','r','-','r','i','g','h','t','-','s','t','y','l','e',0};
54 static const WCHAR attrBorderTopStyle[] =
55 {'b','o','r','d','e','r','-','t','o','p','-','s','t','y','l','e',0};
56 static const WCHAR attrBorderWidth[] =
57 {'b','o','r','d','e','r','-','w','i','d','t','h',0};
58 static const WCHAR attrColor[] =
59 {'c','o','l','o','r',0};
60 static const WCHAR attrCursor[] =
61 {'c','u','r','s','o','r',0};
62 static const WCHAR attrDisplay[] =
63 {'d','i','s','p','l','a','y',0};
64 static const WCHAR attrFilter[] =
65 {'f','i','l','e','t','e','r',0};
66 static const WCHAR attrFontFamily[] =
67 {'f','o','n','t','-','f','a','m','i','l','y',0};
68 static const WCHAR attrFontSize[] =
69 {'f','o','n','t','-','s','i','z','e',0};
70 static const WCHAR attrFontStyle[] =
71 {'f','o','n','t','-','s','t','y','l','e',0};
72 static const WCHAR attrFontVariant[] =
73 {'f','o','n','t','-','v','a','r','i','a','n','t',0};
74 static const WCHAR attrFontWeight[] =
75 {'f','o','n','t','-','w','e','i','g','h','t',0};
76 static const WCHAR attrHeight[] =
77 {'h','e','i','g','h','t',0};
78 static const WCHAR attrLeft[] =
79 {'l','e','f','t',0};
80 static const WCHAR attrMargin[] =
81 {'m','a','r','g','i','n',0};
82 static const WCHAR attrMarginLeft[] =
83 {'m','a','r','g','i','n','-','l','e','f','t',0};
84 static const WCHAR attrMarginRight[] =
85 {'m','a','r','g','i','n','-','r','i','g','h','t',0};
86 static const WCHAR attrOverflow[] =
87 {'o','v','e','r','f','l','o','w',0};
88 static const WCHAR attrPaddingLeft[] =
89 {'p','a','d','d','i','n','g','-','l','e','f','t',0};
90 static const WCHAR attrPosition[] =
91 {'p','o','s','i','t','i','o','n',0};
92 static const WCHAR attrTextAlign[] =
93 {'t','e','x','t','-','a','l','i','g','n',0};
94 static const WCHAR attrTextDecoration[] =
95 {'t','e','x','t','-','d','e','c','o','r','a','t','i','o','n',0};
96 static const WCHAR attrTop[] =
97 {'t','o','p',0};
98 static const WCHAR attrVerticalAlign[] =
99 {'v','e','r','t','i','c','a','l','-','a','l','i','g','n',0};
100 static const WCHAR attrVisibility[] =
101 {'v','i','s','i','b','i','l','i','t','y',0};
102 static const WCHAR attrWidth[] =
103 {'w','i','d','t','h',0};
104 static const WCHAR attrZIndex[] =
105 {'z','-','i','n','d','e','x',0};
107 static const struct{
108 const WCHAR *name;
109 DISPID dispid;
110 } style_tbl[] = {
111 {attrBackground, DISPID_IHTMLSTYLE_BACKGROUND},
112 {attrBackgroundColor, DISPID_IHTMLSTYLE_BACKGROUNDCOLOR},
113 {attrBackgroundImage, DISPID_IHTMLSTYLE_BACKGROUNDIMAGE},
114 {attrBorder, DISPID_IHTMLSTYLE_BORDER},
115 {attrBorderBottomStyle, DISPID_IHTMLSTYLE_BORDERBOTTOMSTYLE},
116 {attrBorderLeft, DISPID_IHTMLSTYLE_BORDERLEFT},
117 {attrBorderLeftStyle, DISPID_IHTMLSTYLE_BORDERLEFTSTYLE},
118 {attrBorderRightStyle, DISPID_IHTMLSTYLE_BORDERRIGHTSTYLE},
119 {attrBorderTopStyle, DISPID_IHTMLSTYLE_BORDERTOPSTYLE},
120 {attrBorderWidth, DISPID_IHTMLSTYLE_BORDERWIDTH},
121 {attrColor, DISPID_IHTMLSTYLE_COLOR},
122 {attrCursor, DISPID_IHTMLSTYLE_CURSOR},
123 {attrDisplay, DISPID_IHTMLSTYLE_DISPLAY},
124 {attrFilter, DISPID_IHTMLSTYLE_FILTER},
125 {attrFontFamily, DISPID_IHTMLSTYLE_FONTFAMILY},
126 {attrFontSize, DISPID_IHTMLSTYLE_FONTSIZE},
127 {attrFontStyle, DISPID_IHTMLSTYLE_FONTSTYLE},
128 {attrFontVariant, DISPID_IHTMLSTYLE_FONTVARIANT},
129 {attrFontWeight, DISPID_IHTMLSTYLE_FONTWEIGHT},
130 {attrHeight, DISPID_IHTMLSTYLE_HEIGHT},
131 {attrLeft, DISPID_IHTMLSTYLE_LEFT},
132 {attrMargin, DISPID_IHTMLSTYLE_MARGIN},
133 {attrMarginLeft, DISPID_IHTMLSTYLE_MARGINLEFT},
134 {attrMarginRight, DISPID_IHTMLSTYLE_MARGINRIGHT},
135 {attrOverflow, DISPID_IHTMLSTYLE_OVERFLOW},
136 {attrPaddingLeft, DISPID_IHTMLSTYLE_PADDINGLEFT},
137 {attrPosition, DISPID_IHTMLSTYLE2_POSITION},
138 {attrTextAlign, DISPID_IHTMLSTYLE_TEXTALIGN},
139 {attrTextDecoration, DISPID_IHTMLSTYLE_TEXTDECORATION},
140 {attrTop, DISPID_IHTMLSTYLE_TOP},
141 {attrVerticalAlign, DISPID_IHTMLSTYLE_VERTICALALIGN},
142 {attrVisibility, DISPID_IHTMLSTYLE_VISIBILITY},
143 {attrWidth, DISPID_IHTMLSTYLE_WIDTH},
144 {attrZIndex, DISPID_IHTMLSTYLE_ZINDEX}
147 static const WCHAR valLineThrough[] =
148 {'l','i','n','e','-','t','h','r','o','u','g','h',0};
149 static const WCHAR valUnderline[] =
150 {'u','n','d','e','r','l','i','n','e',0};
151 static const WCHAR szNormal[] =
152 {'n','o','r','m','a','l',0};
154 static const WCHAR px_formatW[] = {'%','d','p','x',0};
155 static const WCHAR emptyW[] = {0};
157 static LPWSTR fix_px_value(LPCWSTR val)
159 LPCWSTR ptr = val;
161 while(*ptr) {
162 while(*ptr && isspaceW(*ptr))
163 ptr++;
164 if(!*ptr)
165 break;
167 while(*ptr && isdigitW(*ptr))
168 ptr++;
170 if(!*ptr || isspaceW(*ptr)) {
171 LPWSTR ret, p;
172 int len = strlenW(val)+1;
174 ret = heap_alloc((len+2)*sizeof(WCHAR));
175 memcpy(ret, val, (ptr-val)*sizeof(WCHAR));
176 p = ret + (ptr-val);
177 *p++ = 'p';
178 *p++ = 'x';
179 strcpyW(p, ptr);
181 TRACE("fixed %s -> %s\n", debugstr_w(val), debugstr_w(ret));
183 return ret;
186 while(*ptr && !isspaceW(*ptr))
187 ptr++;
190 return NULL;
193 static LPWSTR fix_url_value(LPCWSTR val)
195 WCHAR *ret, *ptr;
197 static const WCHAR urlW[] = {'u','r','l','('};
199 if(strncmpW(val, urlW, sizeof(urlW)/sizeof(WCHAR)) || !strchrW(val, '\\'))
200 return NULL;
202 ret = heap_strdupW(val);
204 for(ptr = ret; *ptr; ptr++) {
205 if(*ptr == '\\')
206 *ptr = '/';
209 return ret;
212 #define ATTR_FIX_PX 1
213 #define ATTR_FIX_URL 2
214 #define ATTR_STR_TO_INT 4
216 HRESULT set_nsstyle_attr(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, LPCWSTR value, DWORD flags)
218 nsAString str_name, str_value, str_empty;
219 LPWSTR val = NULL;
220 nsresult nsres;
222 static const PRUnichar wszEmpty[] = {0};
224 if(flags & ATTR_FIX_PX)
225 val = fix_px_value(value);
226 if(flags & ATTR_FIX_URL)
227 val = fix_url_value(value);
229 nsAString_Init(&str_name, style_tbl[sid].name);
230 nsAString_Init(&str_value, val ? val : value);
231 nsAString_Init(&str_empty, wszEmpty);
232 heap_free(val);
234 nsres = nsIDOMCSSStyleDeclaration_SetProperty(nsstyle, &str_name, &str_value, &str_empty);
235 if(NS_FAILED(nsres))
236 ERR("SetProperty failed: %08x\n", nsres);
238 nsAString_Finish(&str_name);
239 nsAString_Finish(&str_value);
240 nsAString_Finish(&str_empty);
242 return S_OK;
245 static HRESULT set_nsstyle_attr_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, VARIANT *value, DWORD flags)
247 switch(V_VT(value)) {
248 case VT_NULL:
249 return set_nsstyle_attr(nsstyle, sid, emptyW, flags);
251 case VT_BSTR:
252 return set_nsstyle_attr(nsstyle, sid, V_BSTR(value), flags);
254 default:
255 FIXME("not implemented vt %d\n", V_VT(value));
256 return E_NOTIMPL;
260 return S_OK;
263 static inline HRESULT set_style_attr(HTMLStyle *This, styleid_t sid, LPCWSTR value, DWORD flags)
265 return set_nsstyle_attr(This->nsstyle, sid, value, flags);
268 static HRESULT get_nsstyle_attr_nsval(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, nsAString *value)
270 nsAString str_name;
271 nsresult nsres;
273 nsAString_Init(&str_name, style_tbl[sid].name);
275 nsres = nsIDOMCSSStyleDeclaration_GetPropertyValue(nsstyle, &str_name, value);
276 if(NS_FAILED(nsres)) {
277 ERR("SetProperty failed: %08x\n", nsres);
278 return E_FAIL;
281 nsAString_Finish(&str_name);
283 return NS_OK;
286 HRESULT get_nsstyle_attr(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, BSTR *p)
288 nsAString str_value;
289 const PRUnichar *value;
291 nsAString_Init(&str_value, NULL);
293 get_nsstyle_attr_nsval(nsstyle, sid, &str_value);
295 nsAString_GetData(&str_value, &value);
296 *p = *value ? SysAllocString(value) : NULL;
298 nsAString_Finish(&str_value);
300 TRACE("%s -> %s\n", debugstr_w(style_tbl[sid].name), debugstr_w(*p));
301 return S_OK;
304 static HRESULT get_nsstyle_attr_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, VARIANT *p, DWORD flags)
306 nsAString str_value;
307 const PRUnichar *value;
308 BOOL set = FALSE;
310 nsAString_Init(&str_value, NULL);
312 get_nsstyle_attr_nsval(nsstyle, sid, &str_value);
314 nsAString_GetData(&str_value, &value);
316 if(flags & ATTR_STR_TO_INT) {
317 const PRUnichar *ptr = value;
318 BOOL neg = FALSE;
319 INT i = 0;
321 if(*ptr == '-') {
322 neg = TRUE;
323 ptr++;
326 while(isdigitW(*ptr))
327 i = i*10 + (*ptr++ - '0');
329 if(!*ptr) {
330 V_VT(p) = VT_I4;
331 V_I4(p) = neg ? -i : i;
332 set = TRUE;
336 if(!set) {
337 BSTR str = NULL;
339 if(*value) {
340 str = SysAllocString(value);
341 if(!str)
342 return E_OUTOFMEMORY;
345 V_VT(p) = VT_BSTR;
346 V_BSTR(p) = str;
349 nsAString_Finish(&str_value);
351 TRACE("%s -> %s\n", debugstr_w(style_tbl[sid].name), debugstr_variant(p));
352 return S_OK;
355 static inline HRESULT get_style_attr(HTMLStyle *This, styleid_t sid, BSTR *p)
357 return get_nsstyle_attr(This->nsstyle, sid, p);
360 static HRESULT check_style_attr_value(HTMLStyle *This, styleid_t sid, LPCWSTR exval, VARIANT_BOOL *p)
362 nsAString str_value;
363 const PRUnichar *value;
365 nsAString_Init(&str_value, NULL);
367 get_nsstyle_attr_nsval(This->nsstyle, sid, &str_value);
369 nsAString_GetData(&str_value, &value);
370 *p = strcmpW(value, exval) ? VARIANT_FALSE : VARIANT_TRUE;
371 nsAString_Finish(&str_value);
373 TRACE("%s -> %x\n", debugstr_w(style_tbl[sid].name), *p);
374 return S_OK;
377 static inline HRESULT set_style_pos(HTMLStyle *This, styleid_t sid, float value)
379 WCHAR szValue[25];
380 WCHAR szFormat[] = {'%','.','0','f','p','x',0};
382 value = floor(value);
384 sprintfW(szValue, szFormat, value);
386 return set_style_attr(This, sid, szValue, 0);
389 static HRESULT get_nsstyle_pos(HTMLStyle *This, styleid_t sid, float *p)
391 nsAString str_value;
392 HRESULT hres;
393 WCHAR pxW[] = {'p','x',0};
395 TRACE("%p %d %p\n", This, sid, p);
397 *p = 0.0f;
399 nsAString_Init(&str_value, NULL);
401 hres = get_nsstyle_attr_nsval(This->nsstyle, sid, &str_value);
402 if(hres == S_OK)
404 WCHAR *ptr;
405 const PRUnichar *value;
407 nsAString_GetData(&str_value, &value);
408 if(value)
410 *p = strtolW(value, &ptr, 10);
412 if(*ptr && strcmpW(ptr, pxW))
414 nsAString_Finish(&str_value);
415 FIXME("only px values are currently supported\n");
416 return E_FAIL;
421 TRACE("ret %f\n", *p);
423 nsAString_Finish(&str_value);
425 return hres;
428 static BOOL is_valid_border_style(BSTR v)
430 static const WCHAR styleNone[] = {'n','o','n','e',0};
431 static const WCHAR styleDotted[] = {'d','o','t','t','e','d',0};
432 static const WCHAR styleDashed[] = {'d','a','s','h','e','d',0};
433 static const WCHAR styleSolid[] = {'s','o','l','i','d',0};
434 static const WCHAR styleDouble[] = {'d','o','u','b','l','e',0};
435 static const WCHAR styleGroove[] = {'g','r','o','o','v','e',0};
436 static const WCHAR styleRidge[] = {'r','i','d','g','e',0};
437 static const WCHAR styleInset[] = {'i','n','s','e','t',0};
438 static const WCHAR styleOutset[] = {'o','u','t','s','e','t',0};
440 TRACE("%s\n", debugstr_w(v));
442 if(!v || strcmpiW(v, styleNone) == 0 || strcmpiW(v, styleDotted) == 0 ||
443 strcmpiW(v, styleDashed) == 0 || strcmpiW(v, styleSolid) == 0 ||
444 strcmpiW(v, styleDouble) == 0 || strcmpiW(v, styleGroove) == 0 ||
445 strcmpiW(v, styleRidge) == 0 || strcmpiW(v, styleInset) == 0 ||
446 strcmpiW(v, styleOutset) == 0 )
448 return TRUE;
451 return FALSE;
454 #define HTMLSTYLE_THIS(iface) DEFINE_THIS(HTMLStyle, HTMLStyle, iface)
456 static HRESULT WINAPI HTMLStyle_QueryInterface(IHTMLStyle *iface, REFIID riid, void **ppv)
458 HTMLStyle *This = HTMLSTYLE_THIS(iface);
460 *ppv = NULL;
462 if(IsEqualGUID(&IID_IUnknown, riid)) {
463 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
464 *ppv = HTMLSTYLE(This);
465 }else if(IsEqualGUID(&IID_IHTMLStyle, riid)) {
466 TRACE("(%p)->(IID_IHTMLStyle %p)\n", This, ppv);
467 *ppv = HTMLSTYLE(This);
468 }else if(IsEqualGUID(&IID_IHTMLStyle2, riid)) {
469 TRACE("(%p)->(IID_IHTMLStyle2 %p)\n", This, ppv);
470 *ppv = HTMLSTYLE2(This);
471 }else if(IsEqualGUID(&IID_IHTMLStyle3, riid)) {
472 TRACE("(%p)->(IID_IHTMLStyle3 %p)\n", This, ppv);
473 *ppv = HTMLSTYLE3(This);
474 }else if(IsEqualGUID(&IID_IHTMLStyle4, riid)) {
475 TRACE("(%p)->(IID_IHTMLStyle4 %p)\n", This, ppv);
476 *ppv = HTMLSTYLE4(This);
477 }else if(dispex_query_interface(&This->dispex, riid, ppv)) {
478 return *ppv ? S_OK : E_NOINTERFACE;
481 if(*ppv) {
482 IUnknown_AddRef((IUnknown*)*ppv);
483 return S_OK;
486 WARN("unsupported %s\n", debugstr_guid(riid));
487 return E_NOINTERFACE;
490 static ULONG WINAPI HTMLStyle_AddRef(IHTMLStyle *iface)
492 HTMLStyle *This = HTMLSTYLE_THIS(iface);
493 LONG ref = InterlockedIncrement(&This->ref);
495 TRACE("(%p) ref=%d\n", This, ref);
497 return ref;
500 static ULONG WINAPI HTMLStyle_Release(IHTMLStyle *iface)
502 HTMLStyle *This = HTMLSTYLE_THIS(iface);
503 LONG ref = InterlockedDecrement(&This->ref);
505 TRACE("(%p) ref=%d\n", This, ref);
507 if(!ref) {
508 if(This->nsstyle)
509 nsIDOMCSSStyleDeclaration_Release(This->nsstyle);
510 heap_free(This);
513 return ref;
516 static HRESULT WINAPI HTMLStyle_GetTypeInfoCount(IHTMLStyle *iface, UINT *pctinfo)
518 HTMLStyle *This = HTMLSTYLE_THIS(iface);
519 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->dispex), pctinfo);
522 static HRESULT WINAPI HTMLStyle_GetTypeInfo(IHTMLStyle *iface, UINT iTInfo,
523 LCID lcid, ITypeInfo **ppTInfo)
525 HTMLStyle *This = HTMLSTYLE_THIS(iface);
526 return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->dispex), iTInfo, lcid, ppTInfo);
529 static HRESULT WINAPI HTMLStyle_GetIDsOfNames(IHTMLStyle *iface, REFIID riid,
530 LPOLESTR *rgszNames, UINT cNames,
531 LCID lcid, DISPID *rgDispId)
533 HTMLStyle *This = HTMLSTYLE_THIS(iface);
534 return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->dispex), riid, rgszNames, cNames, lcid, rgDispId);
537 static HRESULT WINAPI HTMLStyle_Invoke(IHTMLStyle *iface, DISPID dispIdMember,
538 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
539 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
541 HTMLStyle *This = HTMLSTYLE_THIS(iface);
542 return IDispatchEx_Invoke(DISPATCHEX(&This->dispex), dispIdMember, riid, lcid,
543 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
546 static HRESULT WINAPI HTMLStyle_put_fontFamily(IHTMLStyle *iface, BSTR v)
548 HTMLStyle *This = HTMLSTYLE_THIS(iface);
550 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
552 return set_style_attr(This, STYLEID_FONT_FAMILY, v, 0);
555 static HRESULT WINAPI HTMLStyle_get_fontFamily(IHTMLStyle *iface, BSTR *p)
557 HTMLStyle *This = HTMLSTYLE_THIS(iface);
559 TRACE("(%p)->(%p)\n", This, p);
561 return get_style_attr(This, STYLEID_FONT_FAMILY, p);
564 static HRESULT WINAPI HTMLStyle_put_fontStyle(IHTMLStyle *iface, BSTR v)
566 HTMLStyle *This = HTMLSTYLE_THIS(iface);
567 static const WCHAR szItalic[] = {'i','t','a','l','i','c',0};
568 static const WCHAR szOblique[] = {'o','b','l','i','q','u','e',0};
570 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
572 /* fontStyle can only be one of the follow values. */
573 if(!v || strcmpiW(szNormal, v) == 0 || strcmpiW(szItalic, v) == 0 ||
574 strcmpiW(szOblique, v) == 0)
576 return set_nsstyle_attr(This->nsstyle, STYLEID_FONT_STYLE, v, 0);
579 return E_INVALIDARG;
582 static HRESULT WINAPI HTMLStyle_get_fontStyle(IHTMLStyle *iface, BSTR *p)
584 HTMLStyle *This = HTMLSTYLE_THIS(iface);
586 TRACE("(%p)->(%p)\n", This, p);
588 return get_style_attr(This, STYLEID_FONT_STYLE, p);
591 static HRESULT WINAPI HTMLStyle_put_fontVariant(IHTMLStyle *iface, BSTR v)
593 HTMLStyle *This = HTMLSTYLE_THIS(iface);
594 static const WCHAR szCaps[] = {'s','m','a','l','l','-','c','a','p','s',0};
596 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
598 /* fontVariant can only be one of the follow values. */
599 if(!v || strcmpiW(szNormal, v) == 0 || strcmpiW(szCaps, v) == 0)
601 return set_nsstyle_attr(This->nsstyle, STYLEID_FONT_VARIANT, v, 0);
604 return E_INVALIDARG;
607 static HRESULT WINAPI HTMLStyle_get_fontVariant(IHTMLStyle *iface, BSTR *p)
609 HTMLStyle *This = HTMLSTYLE_THIS(iface);
610 TRACE("(%p)->(%p)\n", This, p);
612 if(!p)
613 return E_INVALIDARG;
615 return get_style_attr(This, STYLEID_FONT_VARIANT, p);
618 static HRESULT WINAPI HTMLStyle_put_fontWeight(IHTMLStyle *iface, BSTR v)
620 HTMLStyle *This = HTMLSTYLE_THIS(iface);
621 static const WCHAR styleBold[] = {'b','o','l','d',0};
622 static const WCHAR styleBolder[] = {'b','o','l','d','e','r',0};
623 static const WCHAR styleLighter[] = {'l','i','g','h','t','e','r',0};
624 static const WCHAR style100[] = {'1','0','0',0};
625 static const WCHAR style200[] = {'2','0','0',0};
626 static const WCHAR style300[] = {'3','0','0',0};
627 static const WCHAR style400[] = {'4','0','0',0};
628 static const WCHAR style500[] = {'5','0','0',0};
629 static const WCHAR style600[] = {'6','0','0',0};
630 static const WCHAR style700[] = {'7','0','0',0};
631 static const WCHAR style800[] = {'8','0','0',0};
632 static const WCHAR style900[] = {'9','0','0',0};
634 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
636 /* fontWeight can only be one of the following */
637 if(!v || strcmpiW(szNormal, v) == 0 || strcmpiW(styleBold, v) == 0 ||
638 strcmpiW(styleBolder, v) == 0 || strcmpiW(styleLighter, v) == 0 ||
639 strcmpiW(style100, v) == 0 || strcmpiW(style200, v) == 0 ||
640 strcmpiW(style300, v) == 0 || strcmpiW(style400, v) == 0 ||
641 strcmpiW(style500, v) == 0 || strcmpiW(style600, v) == 0 ||
642 strcmpiW(style700, v) == 0 || strcmpiW(style800, v) == 0 ||
643 strcmpiW(style900, v) == 0
646 return set_nsstyle_attr(This->nsstyle, STYLEID_FONT_WEIGHT, v, 0);
649 return E_INVALIDARG;
652 static HRESULT WINAPI HTMLStyle_get_fontWeight(IHTMLStyle *iface, BSTR *p)
654 HTMLStyle *This = HTMLSTYLE_THIS(iface);
656 TRACE("(%p)->(%p)\n", This, p);
658 return get_style_attr(This, STYLEID_FONT_WEIGHT, p);
661 static HRESULT WINAPI HTMLStyle_put_fontSize(IHTMLStyle *iface, VARIANT v)
663 HTMLStyle *This = HTMLSTYLE_THIS(iface);
665 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
667 switch(V_VT(&v)) {
668 case VT_BSTR:
669 return set_style_attr(This, STYLEID_FONT_SIZE, V_BSTR(&v), 0);
670 default:
671 FIXME("not supported vt %d\n", V_VT(&v));
674 return S_OK;
677 static HRESULT WINAPI HTMLStyle_get_fontSize(IHTMLStyle *iface, VARIANT *p)
679 HTMLStyle *This = HTMLSTYLE_THIS(iface);
681 TRACE("(%p)->(%p)\n", This, p);
683 V_VT(p) = VT_BSTR;
684 return get_style_attr(This, STYLEID_FONT_SIZE, &V_BSTR(p));
687 static HRESULT WINAPI HTMLStyle_put_font(IHTMLStyle *iface, BSTR v)
689 HTMLStyle *This = HTMLSTYLE_THIS(iface);
690 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
691 return E_NOTIMPL;
694 static HRESULT WINAPI HTMLStyle_get_font(IHTMLStyle *iface, BSTR *p)
696 HTMLStyle *This = HTMLSTYLE_THIS(iface);
697 FIXME("(%p)->(%p)\n", This, p);
698 return E_NOTIMPL;
701 static HRESULT WINAPI HTMLStyle_put_color(IHTMLStyle *iface, VARIANT v)
703 HTMLStyle *This = HTMLSTYLE_THIS(iface);
705 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
707 switch(V_VT(&v)) {
708 case VT_BSTR:
709 TRACE("%s\n", debugstr_w(V_BSTR(&v)));
710 return set_style_attr(This, STYLEID_COLOR, V_BSTR(&v), 0);
712 default:
713 FIXME("unsupported vt=%d\n", V_VT(&v));
716 return E_NOTIMPL;
719 static HRESULT WINAPI HTMLStyle_get_color(IHTMLStyle *iface, VARIANT *p)
721 HTMLStyle *This = HTMLSTYLE_THIS(iface);
723 TRACE("(%p)->(%p)\n", This, p);
725 V_VT(p) = VT_BSTR;
726 return get_style_attr(This, STYLEID_COLOR, &V_BSTR(p));
729 static HRESULT WINAPI HTMLStyle_put_background(IHTMLStyle *iface, BSTR v)
731 HTMLStyle *This = HTMLSTYLE_THIS(iface);
733 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
735 return set_style_attr(This, STYLEID_BACKGROUND, v, 0);
738 static HRESULT WINAPI HTMLStyle_get_background(IHTMLStyle *iface, BSTR *p)
740 HTMLStyle *This = HTMLSTYLE_THIS(iface);
742 TRACE("(%p)->(%p)\n", This, p);
744 return get_style_attr(This, STYLEID_BACKGROUND, p);
747 static HRESULT WINAPI HTMLStyle_put_backgroundColor(IHTMLStyle *iface, VARIANT v)
749 HTMLStyle *This = HTMLSTYLE_THIS(iface);
751 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
753 switch(V_VT(&v)) {
754 case VT_BSTR:
755 return set_style_attr(This, STYLEID_BACKGROUND_COLOR, V_BSTR(&v), 0);
756 case VT_I4: {
757 WCHAR value[10];
758 static const WCHAR format[] = {'#','%','0','6','x',0};
760 wsprintfW(value, format, V_I4(&v));
761 return set_style_attr(This, STYLEID_BACKGROUND_COLOR, value, 0);
763 default:
764 FIXME("unsupported vt %d\n", V_VT(&v));
767 return S_OK;
770 static HRESULT WINAPI HTMLStyle_get_backgroundColor(IHTMLStyle *iface, VARIANT *p)
772 HTMLStyle *This = HTMLSTYLE_THIS(iface);
773 TRACE("(%p)->(%p)\n", This, p);
775 V_VT(p) = VT_BSTR;
776 return get_style_attr(This, STYLEID_BACKGROUND_COLOR, &V_BSTR(p));
779 static HRESULT WINAPI HTMLStyle_put_backgroundImage(IHTMLStyle *iface, BSTR v)
781 HTMLStyle *This = HTMLSTYLE_THIS(iface);
783 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
785 return set_style_attr(This, STYLEID_BACKGROUND_IMAGE, v, ATTR_FIX_URL);
788 static HRESULT WINAPI HTMLStyle_get_backgroundImage(IHTMLStyle *iface, BSTR *p)
790 HTMLStyle *This = HTMLSTYLE_THIS(iface);
792 TRACE("(%p)->(%p)\n", This, p);
794 return get_style_attr(This, STYLEID_BACKGROUND_IMAGE, p);
797 static HRESULT WINAPI HTMLStyle_put_backgroundRepeat(IHTMLStyle *iface, BSTR v)
799 HTMLStyle *This = HTMLSTYLE_THIS(iface);
800 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
801 return E_NOTIMPL;
804 static HRESULT WINAPI HTMLStyle_get_backgroundRepeat(IHTMLStyle *iface, BSTR *p)
806 HTMLStyle *This = HTMLSTYLE_THIS(iface);
807 FIXME("(%p)->(%p)\n", This, p);
808 return E_NOTIMPL;
811 static HRESULT WINAPI HTMLStyle_put_backgroundAttachment(IHTMLStyle *iface, BSTR v)
813 HTMLStyle *This = HTMLSTYLE_THIS(iface);
814 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
815 return E_NOTIMPL;
818 static HRESULT WINAPI HTMLStyle_get_backgroundAttachment(IHTMLStyle *iface, BSTR *p)
820 HTMLStyle *This = HTMLSTYLE_THIS(iface);
821 FIXME("(%p)->(%p)\n", This, p);
822 return E_NOTIMPL;
825 static HRESULT WINAPI HTMLStyle_put_backgroundPosition(IHTMLStyle *iface, BSTR v)
827 HTMLStyle *This = HTMLSTYLE_THIS(iface);
828 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
829 return E_NOTIMPL;
832 static HRESULT WINAPI HTMLStyle_get_backgroundPosition(IHTMLStyle *iface, BSTR *p)
834 HTMLStyle *This = HTMLSTYLE_THIS(iface);
835 FIXME("(%p)->(%p)\n", This, p);
836 return E_NOTIMPL;
839 static HRESULT WINAPI HTMLStyle_put_backgroundPositionX(IHTMLStyle *iface, VARIANT v)
841 HTMLStyle *This = HTMLSTYLE_THIS(iface);
842 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
843 return E_NOTIMPL;
846 static HRESULT WINAPI HTMLStyle_get_backgroundPositionX(IHTMLStyle *iface, VARIANT *p)
848 HTMLStyle *This = HTMLSTYLE_THIS(iface);
849 FIXME("(%p)->(%p)\n", This, p);
850 return E_NOTIMPL;
853 static HRESULT WINAPI HTMLStyle_put_backgroundPositionY(IHTMLStyle *iface, VARIANT v)
855 HTMLStyle *This = HTMLSTYLE_THIS(iface);
856 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
857 return E_NOTIMPL;
860 static HRESULT WINAPI HTMLStyle_get_backgroundPositionY(IHTMLStyle *iface, VARIANT *p)
862 HTMLStyle *This = HTMLSTYLE_THIS(iface);
863 FIXME("(%p)->(%p)\n", This, p);
864 return E_NOTIMPL;
867 static HRESULT WINAPI HTMLStyle_put_wordSpacing(IHTMLStyle *iface, VARIANT v)
869 HTMLStyle *This = HTMLSTYLE_THIS(iface);
870 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
871 return E_NOTIMPL;
874 static HRESULT WINAPI HTMLStyle_get_wordSpacing(IHTMLStyle *iface, VARIANT *p)
876 HTMLStyle *This = HTMLSTYLE_THIS(iface);
877 FIXME("(%p)->(%p)\n", This, p);
878 return E_NOTIMPL;
881 static HRESULT WINAPI HTMLStyle_put_letterSpacing(IHTMLStyle *iface, VARIANT v)
883 HTMLStyle *This = HTMLSTYLE_THIS(iface);
884 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
885 return E_NOTIMPL;
888 static HRESULT WINAPI HTMLStyle_get_letterSpacing(IHTMLStyle *iface, VARIANT *p)
890 HTMLStyle *This = HTMLSTYLE_THIS(iface);
891 FIXME("(%p)->(%p)\n", This, p);
892 return E_NOTIMPL;
895 static HRESULT WINAPI HTMLStyle_put_textDecoration(IHTMLStyle *iface, BSTR v)
897 HTMLStyle *This = HTMLSTYLE_THIS(iface);
898 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
899 return E_NOTIMPL;
902 static HRESULT WINAPI HTMLStyle_get_textDecoration(IHTMLStyle *iface, BSTR *p)
904 HTMLStyle *This = HTMLSTYLE_THIS(iface);
906 TRACE("(%p)->(%p)\n", This, p);
908 return get_style_attr(This, STYLEID_TEXT_DECORATION, p);
911 static HRESULT WINAPI HTMLStyle_put_textDecorationNone(IHTMLStyle *iface, VARIANT_BOOL v)
913 HTMLStyle *This = HTMLSTYLE_THIS(iface);
914 FIXME("(%p)->(%x)\n", This, v);
915 return E_NOTIMPL;
918 static HRESULT WINAPI HTMLStyle_get_textDecorationNone(IHTMLStyle *iface, VARIANT_BOOL *p)
920 HTMLStyle *This = HTMLSTYLE_THIS(iface);
921 FIXME("(%p)->(%p)\n", This, p);
922 return E_NOTIMPL;
925 static HRESULT WINAPI HTMLStyle_put_textDecorationUnderline(IHTMLStyle *iface, VARIANT_BOOL v)
927 HTMLStyle *This = HTMLSTYLE_THIS(iface);
929 TRACE("(%p)->(%x)\n", This, v);
931 return set_style_attr(This, STYLEID_TEXT_DECORATION, v ? valUnderline : emptyW, 0);
934 static HRESULT WINAPI HTMLStyle_get_textDecorationUnderline(IHTMLStyle *iface, VARIANT_BOOL *p)
936 HTMLStyle *This = HTMLSTYLE_THIS(iface);
938 TRACE("(%p)->(%p)\n", This, p);
940 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, valUnderline, p);
943 static HRESULT WINAPI HTMLStyle_put_textDecorationOverline(IHTMLStyle *iface, VARIANT_BOOL v)
945 HTMLStyle *This = HTMLSTYLE_THIS(iface);
946 FIXME("(%p)->(%x)\n", This, v);
947 return E_NOTIMPL;
950 static HRESULT WINAPI HTMLStyle_get_textDecorationOverline(IHTMLStyle *iface, VARIANT_BOOL *p)
952 HTMLStyle *This = HTMLSTYLE_THIS(iface);
953 FIXME("(%p)->(%p)\n", This, p);
954 return E_NOTIMPL;
957 static HRESULT WINAPI HTMLStyle_put_textDecorationLineThrough(IHTMLStyle *iface, VARIANT_BOOL v)
959 HTMLStyle *This = HTMLSTYLE_THIS(iface);
961 TRACE("(%p)->(%x)\n", This, v);
963 return set_style_attr(This, STYLEID_TEXT_DECORATION, v ? valLineThrough : emptyW, 0);
966 static HRESULT WINAPI HTMLStyle_get_textDecorationLineThrough(IHTMLStyle *iface, VARIANT_BOOL *p)
968 HTMLStyle *This = HTMLSTYLE_THIS(iface);
970 TRACE("(%p)->(%p)\n", This, p);
972 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, valLineThrough, p);
975 static HRESULT WINAPI HTMLStyle_put_textDecorationBlink(IHTMLStyle *iface, VARIANT_BOOL v)
977 HTMLStyle *This = HTMLSTYLE_THIS(iface);
978 FIXME("(%p)->(%x)\n", This, v);
979 return E_NOTIMPL;
982 static HRESULT WINAPI HTMLStyle_get_textDecorationBlink(IHTMLStyle *iface, VARIANT_BOOL *p)
984 HTMLStyle *This = HTMLSTYLE_THIS(iface);
985 FIXME("(%p)->(%p)\n", This, p);
986 return E_NOTIMPL;
989 static HRESULT WINAPI HTMLStyle_put_verticalAlign(IHTMLStyle *iface, VARIANT v)
991 HTMLStyle *This = HTMLSTYLE_THIS(iface);
993 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
995 switch(V_VT(&v)) {
996 case VT_BSTR:
997 return set_style_attr(This, STYLEID_VERTICAL_ALIGN, V_BSTR(&v), 0);
998 default:
999 FIXME("not implemented vt %d\n", V_VT(&v));
1000 return E_NOTIMPL;
1003 return S_OK;
1006 static HRESULT WINAPI HTMLStyle_get_verticalAlign(IHTMLStyle *iface, VARIANT *p)
1008 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1009 BSTR ret;
1010 HRESULT hres;
1012 TRACE("(%p)->(%p)\n", This, p);
1014 hres = get_style_attr(This, STYLEID_VERTICAL_ALIGN, &ret);
1015 if(FAILED(hres))
1016 return hres;
1018 V_VT(p) = VT_BSTR;
1019 V_BSTR(p) = ret;
1020 return S_OK;
1023 static HRESULT WINAPI HTMLStyle_put_textTransform(IHTMLStyle *iface, BSTR v)
1025 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1026 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1027 return E_NOTIMPL;
1030 static HRESULT WINAPI HTMLStyle_get_textTransform(IHTMLStyle *iface, BSTR *p)
1032 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1033 FIXME("(%p)->(%p)\n", This, p);
1034 return E_NOTIMPL;
1037 static HRESULT WINAPI HTMLStyle_put_textAlign(IHTMLStyle *iface, BSTR v)
1039 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1041 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1043 return set_style_attr(This, STYLEID_TEXT_ALIGN, v, 0);
1046 static HRESULT WINAPI HTMLStyle_get_textAlign(IHTMLStyle *iface, BSTR *p)
1048 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1050 TRACE("(%p)->(%p)\n", This, p);
1052 return get_style_attr(This, STYLEID_TEXT_ALIGN, p);
1055 static HRESULT WINAPI HTMLStyle_put_textIndent(IHTMLStyle *iface, VARIANT v)
1057 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1058 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1059 return E_NOTIMPL;
1062 static HRESULT WINAPI HTMLStyle_get_textIndent(IHTMLStyle *iface, VARIANT *p)
1064 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1065 FIXME("(%p)->(%p)\n", This, p);
1066 return E_NOTIMPL;
1069 static HRESULT WINAPI HTMLStyle_put_lineHeight(IHTMLStyle *iface, VARIANT v)
1071 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1072 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1073 return E_NOTIMPL;
1076 static HRESULT WINAPI HTMLStyle_get_lineHeight(IHTMLStyle *iface, VARIANT *p)
1078 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1079 FIXME("(%p)->(%p)\n", This, p);
1080 return E_NOTIMPL;
1083 static HRESULT WINAPI HTMLStyle_put_marginTop(IHTMLStyle *iface, VARIANT v)
1085 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1086 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1087 return E_NOTIMPL;
1090 static HRESULT WINAPI HTMLStyle_get_marginTop(IHTMLStyle *iface, VARIANT *p)
1092 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1093 FIXME("(%p)->(%p)\n", This, p);
1094 return E_NOTIMPL;
1097 static HRESULT WINAPI HTMLStyle_put_marginRight(IHTMLStyle *iface, VARIANT v)
1099 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1101 TRACE("(%p)->(v(%d))\n", This, V_VT(&v));
1103 switch(V_VT(&v)) {
1104 case VT_NULL:
1105 return set_style_attr(This, STYLEID_MARGIN_RIGHT, emptyW, 0);
1106 case VT_I4: {
1107 WCHAR buf[14];
1109 wsprintfW(buf, px_formatW, V_I4(&v));
1110 return set_style_attr(This, STYLEID_MARGIN_RIGHT, buf, 0);
1112 case VT_BSTR:
1113 return set_style_attr(This, STYLEID_MARGIN_RIGHT, V_BSTR(&v), 0);
1114 default:
1115 FIXME("Unsupported vt=%d\n", V_VT(&v));
1118 return E_NOTIMPL;
1121 static HRESULT WINAPI HTMLStyle_get_marginRight(IHTMLStyle *iface, VARIANT *p)
1123 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1124 FIXME("(%p)->(%p)\n", This, p);
1125 return E_NOTIMPL;
1128 static HRESULT WINAPI HTMLStyle_put_marginBottom(IHTMLStyle *iface, VARIANT v)
1130 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1131 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1132 return E_NOTIMPL;
1135 static HRESULT WINAPI HTMLStyle_get_marginBottom(IHTMLStyle *iface, VARIANT *p)
1137 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1138 FIXME("(%p)->(%p)\n", This, p);
1139 return E_NOTIMPL;
1142 static HRESULT WINAPI HTMLStyle_put_marginLeft(IHTMLStyle *iface, VARIANT v)
1144 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1146 switch(V_VT(&v)) {
1147 case VT_NULL:
1148 TRACE("(%p)->(NULL)\n", This);
1149 return set_style_attr(This, STYLEID_MARGIN_LEFT, emptyW, 0);
1150 case VT_I4: {
1151 WCHAR buf[14];
1153 TRACE("(%p)->(%d)\n", This, V_I4(&v));
1155 wsprintfW(buf, px_formatW, V_I4(&v));
1156 return set_style_attr(This, STYLEID_MARGIN_LEFT, buf, 0);
1158 case VT_BSTR:
1159 TRACE("(%p)->(%s)\n", This, debugstr_w(V_BSTR(&v)));
1160 return set_style_attr(This, STYLEID_MARGIN_LEFT, V_BSTR(&v), 0);
1161 default:
1162 FIXME("Unsupported vt=%d\n", V_VT(&v));
1165 return E_NOTIMPL;
1168 static HRESULT WINAPI HTMLStyle_put_margin(IHTMLStyle *iface, BSTR v)
1170 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1172 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1174 return set_style_attr(This, STYLEID_MARGIN, v, 0);
1177 static HRESULT WINAPI HTMLStyle_get_margin(IHTMLStyle *iface, BSTR *p)
1179 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1181 TRACE("(%p)->(%p)\n", This, p);
1183 return get_style_attr(This, STYLEID_MARGIN, p);
1186 static HRESULT WINAPI HTMLStyle_get_marginLeft(IHTMLStyle *iface, VARIANT *p)
1188 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1189 FIXME("(%p)->(%p)\n", This, p);
1190 return E_NOTIMPL;
1193 static HRESULT WINAPI HTMLStyle_put_paddingTop(IHTMLStyle *iface, VARIANT v)
1195 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1196 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1197 return E_NOTIMPL;
1200 static HRESULT WINAPI HTMLStyle_get_paddingTop(IHTMLStyle *iface, VARIANT *p)
1202 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1203 FIXME("(%p)->(%p)\n", This, p);
1204 return E_NOTIMPL;
1207 static HRESULT WINAPI HTMLStyle_put_paddingRight(IHTMLStyle *iface, VARIANT v)
1209 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1210 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1211 return E_NOTIMPL;
1214 static HRESULT WINAPI HTMLStyle_get_paddingRight(IHTMLStyle *iface, VARIANT *p)
1216 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1217 FIXME("(%p)->(%p)\n", This, p);
1218 return E_NOTIMPL;
1221 static HRESULT WINAPI HTMLStyle_put_paddingBottom(IHTMLStyle *iface, VARIANT v)
1223 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1224 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1225 return E_NOTIMPL;
1228 static HRESULT WINAPI HTMLStyle_get_paddingBottom(IHTMLStyle *iface, VARIANT *p)
1230 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1231 FIXME("(%p)->(%p)\n", This, p);
1232 return E_NOTIMPL;
1235 static HRESULT WINAPI HTMLStyle_put_paddingLeft(IHTMLStyle *iface, VARIANT v)
1237 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1239 TRACE("(%p)->(vt=%d)\n", This, V_VT(&v));
1241 switch(V_VT(&v)) {
1242 case VT_I4: {
1243 WCHAR buf[14];
1245 wsprintfW(buf, px_formatW, V_I4(&v));
1246 return set_style_attr(This, STYLEID_PADDING_LEFT, buf, 0);
1248 case VT_BSTR:
1249 return set_style_attr(This, STYLEID_PADDING_LEFT, V_BSTR(&v), 0);
1250 default:
1251 FIXME("unsupported vt=%d\n", V_VT(&v));
1254 return E_NOTIMPL;
1257 static HRESULT WINAPI HTMLStyle_get_paddingLeft(IHTMLStyle *iface, VARIANT *p)
1259 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1260 BSTR ret;
1261 HRESULT hres;
1263 TRACE("(%p)->(%p)\n", This, p);
1265 hres = get_style_attr(This, STYLEID_PADDING_LEFT, &ret);
1266 if(FAILED(hres))
1267 return hres;
1269 V_VT(p) = VT_BSTR;
1270 V_BSTR(p) = ret;
1271 return S_OK;
1274 static HRESULT WINAPI HTMLStyle_put_padding(IHTMLStyle *iface, BSTR v)
1276 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1277 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1278 return E_NOTIMPL;
1281 static HRESULT WINAPI HTMLStyle_get_padding(IHTMLStyle *iface, BSTR *p)
1283 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1284 FIXME("(%p)->(%p)\n", This, p);
1285 return E_NOTIMPL;
1288 static HRESULT WINAPI HTMLStyle_put_border(IHTMLStyle *iface, BSTR v)
1290 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1292 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1294 return set_style_attr(This, STYLEID_BORDER, v, 0);
1297 static HRESULT WINAPI HTMLStyle_get_border(IHTMLStyle *iface, BSTR *p)
1299 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1301 TRACE("(%p)->(%p)\n", This, p);
1303 return get_style_attr(This, STYLEID_BORDER, p);
1306 static HRESULT WINAPI HTMLStyle_put_borderTop(IHTMLStyle *iface, BSTR v)
1308 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1309 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1310 return E_NOTIMPL;
1313 static HRESULT WINAPI HTMLStyle_get_borderTop(IHTMLStyle *iface, BSTR *p)
1315 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1316 FIXME("(%p)->(%p)\n", This, p);
1317 return E_NOTIMPL;
1320 static HRESULT WINAPI HTMLStyle_put_borderRight(IHTMLStyle *iface, BSTR v)
1322 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1323 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1324 return E_NOTIMPL;
1327 static HRESULT WINAPI HTMLStyle_get_borderRight(IHTMLStyle *iface, BSTR *p)
1329 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1330 FIXME("(%p)->(%p)\n", This, p);
1331 return E_NOTIMPL;
1334 static HRESULT WINAPI HTMLStyle_put_borderBottom(IHTMLStyle *iface, BSTR v)
1336 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1337 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1338 return E_NOTIMPL;
1341 static HRESULT WINAPI HTMLStyle_get_borderBottom(IHTMLStyle *iface, BSTR *p)
1343 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1344 FIXME("(%p)->(%p)\n", This, p);
1345 return E_NOTIMPL;
1348 static HRESULT WINAPI HTMLStyle_put_borderLeft(IHTMLStyle *iface, BSTR v)
1350 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1352 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1354 return set_style_attr(This, STYLEID_BORDER_LEFT, v, ATTR_FIX_PX);
1357 static HRESULT WINAPI HTMLStyle_get_borderLeft(IHTMLStyle *iface, BSTR *p)
1359 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1360 FIXME("(%p)->(%p)\n", This, p);
1361 return E_NOTIMPL;
1364 static HRESULT WINAPI HTMLStyle_put_borderColor(IHTMLStyle *iface, BSTR v)
1366 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1367 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1368 return E_NOTIMPL;
1371 static HRESULT WINAPI HTMLStyle_get_borderColor(IHTMLStyle *iface, BSTR *p)
1373 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1374 FIXME("(%p)->(%p)\n", This, p);
1375 return E_NOTIMPL;
1378 static HRESULT WINAPI HTMLStyle_put_borderTopColor(IHTMLStyle *iface, VARIANT v)
1380 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1381 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1382 return E_NOTIMPL;
1385 static HRESULT WINAPI HTMLStyle_get_borderTopColor(IHTMLStyle *iface, VARIANT *p)
1387 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1388 FIXME("(%p)->(%p)\n", This, p);
1389 return E_NOTIMPL;
1392 static HRESULT WINAPI HTMLStyle_put_borderRightColor(IHTMLStyle *iface, VARIANT v)
1394 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1395 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1396 return E_NOTIMPL;
1399 static HRESULT WINAPI HTMLStyle_get_borderRightColor(IHTMLStyle *iface, VARIANT *p)
1401 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1402 FIXME("(%p)->(%p)\n", This, p);
1403 return E_NOTIMPL;
1406 static HRESULT WINAPI HTMLStyle_put_borderBottomColor(IHTMLStyle *iface, VARIANT v)
1408 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1409 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1410 return E_NOTIMPL;
1413 static HRESULT WINAPI HTMLStyle_get_borderBottomColor(IHTMLStyle *iface, VARIANT *p)
1415 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1416 FIXME("(%p)->(%p)\n", This, p);
1417 return E_NOTIMPL;
1420 static HRESULT WINAPI HTMLStyle_put_borderLeftColor(IHTMLStyle *iface, VARIANT v)
1422 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1423 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1424 return E_NOTIMPL;
1427 static HRESULT WINAPI HTMLStyle_get_borderLeftColor(IHTMLStyle *iface, VARIANT *p)
1429 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1430 FIXME("(%p)->(%p)\n", This, p);
1431 return E_NOTIMPL;
1434 static HRESULT WINAPI HTMLStyle_put_borderWidth(IHTMLStyle *iface, BSTR v)
1436 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1437 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1438 return set_style_attr(This, STYLEID_BORDER_WIDTH, v, ATTR_FIX_PX);
1441 static HRESULT WINAPI HTMLStyle_get_borderWidth(IHTMLStyle *iface, BSTR *p)
1443 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1444 TRACE("(%p)->(%p)\n", This, p);
1445 return get_style_attr(This, STYLEID_BORDER_WIDTH, p);
1448 static HRESULT WINAPI HTMLStyle_put_borderTopWidth(IHTMLStyle *iface, VARIANT v)
1450 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1451 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1452 return E_NOTIMPL;
1455 static HRESULT WINAPI HTMLStyle_get_borderTopWidth(IHTMLStyle *iface, VARIANT *p)
1457 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1458 FIXME("(%p)->(%p)\n", This, p);
1459 return E_NOTIMPL;
1462 static HRESULT WINAPI HTMLStyle_put_borderRightWidth(IHTMLStyle *iface, VARIANT v)
1464 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1465 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1466 return E_NOTIMPL;
1469 static HRESULT WINAPI HTMLStyle_get_borderRightWidth(IHTMLStyle *iface, VARIANT *p)
1471 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1472 FIXME("(%p)->(%p)\n", This, p);
1473 return E_NOTIMPL;
1476 static HRESULT WINAPI HTMLStyle_put_borderBottomWidth(IHTMLStyle *iface, VARIANT v)
1478 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1479 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1480 return E_NOTIMPL;
1483 static HRESULT WINAPI HTMLStyle_get_borderBottomWidth(IHTMLStyle *iface, VARIANT *p)
1485 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1486 FIXME("(%p)->(%p)\n", This, p);
1487 return E_NOTIMPL;
1490 static HRESULT WINAPI HTMLStyle_put_borderLeftWidth(IHTMLStyle *iface, VARIANT v)
1492 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1493 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1494 return E_NOTIMPL;
1497 static HRESULT WINAPI HTMLStyle_get_borderLeftWidth(IHTMLStyle *iface, VARIANT *p)
1499 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1500 FIXME("(%p)->(%p)\n", This, p);
1501 return E_NOTIMPL;
1504 static HRESULT WINAPI HTMLStyle_put_borderStyle(IHTMLStyle *iface, BSTR v)
1506 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1507 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1508 return E_NOTIMPL;
1511 static HRESULT WINAPI HTMLStyle_get_borderStyle(IHTMLStyle *iface, BSTR *p)
1513 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1514 FIXME("(%p)->(%p)\n", This, p);
1515 return E_NOTIMPL;
1518 static HRESULT WINAPI HTMLStyle_put_borderTopStyle(IHTMLStyle *iface, BSTR v)
1520 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1521 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1523 if(!is_valid_border_style(v))
1524 return E_INVALIDARG;
1526 return set_style_attr(This, STYLEID_BORDER_TOP_STYLE, v, 0);
1529 static HRESULT WINAPI HTMLStyle_get_borderTopStyle(IHTMLStyle *iface, BSTR *p)
1531 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1532 TRACE("(%p)->(%p)\n", This, p);
1533 return get_style_attr(This, STYLEID_BORDER_TOP_STYLE, p);
1536 static HRESULT WINAPI HTMLStyle_put_borderRightStyle(IHTMLStyle *iface, BSTR v)
1538 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1539 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1541 if(!is_valid_border_style(v))
1542 return E_INVALIDARG;
1544 return set_style_attr(This, STYLEID_BORDER_RIGHT_STYLE, v, 0);
1547 static HRESULT WINAPI HTMLStyle_get_borderRightStyle(IHTMLStyle *iface, BSTR *p)
1549 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1550 TRACE("(%p)->(%p)\n", This, p);
1551 return get_style_attr(This, STYLEID_BORDER_RIGHT_STYLE, p);
1554 static HRESULT WINAPI HTMLStyle_put_borderBottomStyle(IHTMLStyle *iface, BSTR v)
1556 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1557 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1559 if(!is_valid_border_style(v))
1560 return E_INVALIDARG;
1562 return set_style_attr(This, STYLEID_BORDER_BOTTOM_STYLE, v, 0);
1565 static HRESULT WINAPI HTMLStyle_get_borderBottomStyle(IHTMLStyle *iface, BSTR *p)
1567 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1568 TRACE("(%p)->(%p)\n", This, p);
1569 return get_style_attr(This, STYLEID_BORDER_BOTTOM_STYLE, p);
1572 static HRESULT WINAPI HTMLStyle_put_borderLeftStyle(IHTMLStyle *iface, BSTR v)
1574 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1575 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1577 if(!is_valid_border_style(v))
1578 return E_INVALIDARG;
1580 return set_style_attr(This, STYLEID_BORDER_LEFT_STYLE, v, 0);
1583 static HRESULT WINAPI HTMLStyle_get_borderLeftStyle(IHTMLStyle *iface, BSTR *p)
1585 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1586 TRACE("(%p)->(%p)\n", This, p);
1587 return get_style_attr(This, STYLEID_BORDER_LEFT_STYLE, p);
1590 static HRESULT WINAPI HTMLStyle_put_width(IHTMLStyle *iface, VARIANT v)
1592 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1594 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
1596 switch(V_VT(&v)) {
1597 case VT_BSTR:
1598 TRACE("%s\n", debugstr_w(V_BSTR(&v)));
1599 return set_style_attr(This, STYLEID_WIDTH, V_BSTR(&v), 0);
1600 default:
1601 FIXME("unsupported vt %d\n", V_VT(&v));
1604 return E_NOTIMPL;
1607 static HRESULT WINAPI HTMLStyle_get_width(IHTMLStyle *iface, VARIANT *p)
1609 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1611 TRACE("(%p)->(%p)\n", This, p);
1613 V_VT(p) = VT_BSTR;
1614 return get_style_attr(This, STYLEID_WIDTH, &V_BSTR(p));
1617 static HRESULT WINAPI HTMLStyle_put_height(IHTMLStyle *iface, VARIANT v)
1619 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1621 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1623 switch(V_VT(&v)) {
1624 case VT_BSTR:
1625 return set_style_attr(This, STYLEID_HEIGHT, V_BSTR(&v), 0);
1626 default:
1627 FIXME("unimplemented vt %d\n", V_VT(&v));
1628 return E_NOTIMPL;
1631 return S_OK;
1634 static HRESULT WINAPI HTMLStyle_get_height(IHTMLStyle *iface, VARIANT *p)
1636 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1637 BSTR ret;
1638 HRESULT hres;
1640 TRACE("(%p)->(%p)\n", This, p);
1642 hres = get_style_attr(This, STYLEID_HEIGHT, &ret);
1643 if(FAILED(hres))
1644 return hres;
1646 V_VT(p) = VT_BSTR;
1647 V_BSTR(p) = ret;
1648 return S_OK;
1651 static HRESULT WINAPI HTMLStyle_put_styleFloat(IHTMLStyle *iface, BSTR v)
1653 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1654 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1655 return E_NOTIMPL;
1658 static HRESULT WINAPI HTMLStyle_get_styleFloat(IHTMLStyle *iface, BSTR *p)
1660 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1661 FIXME("(%p)->(%p)\n", This, p);
1662 return E_NOTIMPL;
1665 static HRESULT WINAPI HTMLStyle_put_clear(IHTMLStyle *iface, BSTR v)
1667 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1668 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1669 return E_NOTIMPL;
1672 static HRESULT WINAPI HTMLStyle_get_clear(IHTMLStyle *iface, BSTR *p)
1674 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1675 FIXME("(%p)->(%p)\n", This, p);
1676 return E_NOTIMPL;
1679 static HRESULT WINAPI HTMLStyle_put_display(IHTMLStyle *iface, BSTR v)
1681 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1683 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1685 return set_style_attr(This, STYLEID_DISPLAY, v, 0);
1688 static HRESULT WINAPI HTMLStyle_get_display(IHTMLStyle *iface, BSTR *p)
1690 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1692 TRACE("(%p)->(%p)\n", This, p);
1694 return get_style_attr(This, STYLEID_DISPLAY, p);
1697 static HRESULT WINAPI HTMLStyle_put_visibility(IHTMLStyle *iface, BSTR v)
1699 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1701 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1703 return set_style_attr(This, STYLEID_VISIBILITY, v, 0);
1706 static HRESULT WINAPI HTMLStyle_get_visibility(IHTMLStyle *iface, BSTR *p)
1708 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1710 TRACE("(%p)->(%p)\n", This, p);
1712 return get_style_attr(This, STYLEID_VISIBILITY, p);
1715 static HRESULT WINAPI HTMLStyle_put_listStyleType(IHTMLStyle *iface, BSTR v)
1717 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1718 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1719 return E_NOTIMPL;
1722 static HRESULT WINAPI HTMLStyle_get_listStyleType(IHTMLStyle *iface, BSTR *p)
1724 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1725 FIXME("(%p)->(%p)\n", This, p);
1726 return E_NOTIMPL;
1729 static HRESULT WINAPI HTMLStyle_put_listStylePosition(IHTMLStyle *iface, BSTR v)
1731 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1732 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1733 return E_NOTIMPL;
1736 static HRESULT WINAPI HTMLStyle_get_listStylePosition(IHTMLStyle *iface, BSTR *p)
1738 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1739 FIXME("(%p)->(%p)\n", This, p);
1740 return E_NOTIMPL;
1743 static HRESULT WINAPI HTMLStyle_put_listStyleImage(IHTMLStyle *iface, BSTR v)
1745 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1746 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1747 return E_NOTIMPL;
1750 static HRESULT WINAPI HTMLStyle_get_listStyleImage(IHTMLStyle *iface, BSTR *p)
1752 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1753 FIXME("(%p)->(%p)\n", This, p);
1754 return E_NOTIMPL;
1757 static HRESULT WINAPI HTMLStyle_put_listStyle(IHTMLStyle *iface, BSTR v)
1759 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1760 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1761 return E_NOTIMPL;
1764 static HRESULT WINAPI HTMLStyle_get_listStyle(IHTMLStyle *iface, BSTR *p)
1766 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1767 FIXME("(%p)->(%p)\n", This, p);
1768 return E_NOTIMPL;
1771 static HRESULT WINAPI HTMLStyle_put_whiteSpace(IHTMLStyle *iface, BSTR v)
1773 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1774 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1775 return E_NOTIMPL;
1778 static HRESULT WINAPI HTMLStyle_get_whiteSpace(IHTMLStyle *iface, BSTR *p)
1780 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1781 FIXME("(%p)->(%p)\n", This, p);
1782 return E_NOTIMPL;
1785 static HRESULT WINAPI HTMLStyle_put_top(IHTMLStyle *iface, VARIANT v)
1787 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1789 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1791 return set_nsstyle_attr_var(This->nsstyle, STYLEID_TOP, &v, 0);
1794 static HRESULT WINAPI HTMLStyle_get_top(IHTMLStyle *iface, VARIANT *p)
1796 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1797 BSTR ret;
1798 HRESULT hres;
1800 TRACE("(%p)->(%p)\n", This, p);
1802 hres = get_style_attr(This, STYLEID_TOP, &ret);
1803 if(FAILED(hres))
1804 return hres;
1806 V_VT(p) = VT_BSTR;
1807 V_BSTR(p) = ret;
1808 return S_OK;
1811 static HRESULT WINAPI HTMLStyle_put_left(IHTMLStyle *iface, VARIANT v)
1813 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1815 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1817 return set_nsstyle_attr_var(This->nsstyle, STYLEID_LEFT, &v, 0);
1820 static HRESULT WINAPI HTMLStyle_get_left(IHTMLStyle *iface, VARIANT *p)
1822 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1823 BSTR ret;
1824 HRESULT hres;
1826 TRACE("(%p)->(%p)\n", This, p);
1828 hres = get_style_attr(This, STYLEID_LEFT, &ret);
1829 if(FAILED(hres))
1830 return hres;
1832 V_VT(p) = VT_BSTR;
1833 V_BSTR(p) = ret;
1834 return S_OK;
1837 static HRESULT WINAPI HTMLStyle_get_position(IHTMLStyle *iface, BSTR *p)
1839 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1840 TRACE("(%p)->(%p)\n", This, p);
1841 return IHTMLStyle2_get_position(HTMLSTYLE2(This), p);
1844 static HRESULT WINAPI HTMLStyle_put_zIndex(IHTMLStyle *iface, VARIANT v)
1846 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1848 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1850 switch(V_VT(&v)) {
1851 case VT_BSTR:
1852 return set_style_attr(This, STYLEID_Z_INDEX, V_BSTR(&v), 0);
1853 case VT_I4: {
1854 WCHAR value[14];
1855 static const WCHAR format[] = {'%','d',0};
1857 wsprintfW(value, format, V_I4(&v));
1858 return set_style_attr(This, STYLEID_Z_INDEX, value, 0);
1860 default:
1861 FIXME("unimplemented vt %d\n", V_VT(&v));
1862 return E_NOTIMPL;
1865 return S_OK;
1868 static HRESULT WINAPI HTMLStyle_get_zIndex(IHTMLStyle *iface, VARIANT *p)
1870 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1872 TRACE("(%p)->(%p)\n", This, p);
1874 return get_nsstyle_attr_var(This->nsstyle, STYLEID_Z_INDEX, p, ATTR_STR_TO_INT);
1877 static HRESULT WINAPI HTMLStyle_put_overflow(IHTMLStyle *iface, BSTR v)
1879 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1880 static const WCHAR szVisible[] = {'v','i','s','i','b','l','e',0};
1881 static const WCHAR szScroll[] = {'s','c','r','o','l','l',0};
1882 static const WCHAR szHidden[] = {'h','i','d','d','e','n',0};
1883 static const WCHAR szAuto[] = {'a','u','t','o',0};
1885 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1887 /* overflow can only be one of the follow values. */
1888 if(!v || strcmpiW(szVisible, v) == 0 || strcmpiW(szScroll, v) == 0 ||
1889 strcmpiW(szHidden, v) == 0 || strcmpiW(szAuto, v) == 0)
1891 return set_nsstyle_attr(This->nsstyle, STYLEID_OVERFLOW, v, 0);
1894 return E_INVALIDARG;
1898 static HRESULT WINAPI HTMLStyle_get_overflow(IHTMLStyle *iface, BSTR *p)
1900 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1902 TRACE("(%p)->(%p)\n", This, p);
1904 if(!p)
1905 return E_INVALIDARG;
1907 return get_style_attr(This, STYLEID_OVERFLOW, p);
1910 static HRESULT WINAPI HTMLStyle_put_pageBreakBefore(IHTMLStyle *iface, BSTR v)
1912 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1913 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1914 return E_NOTIMPL;
1917 static HRESULT WINAPI HTMLStyle_get_pageBreakBefore(IHTMLStyle *iface, BSTR *p)
1919 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1920 FIXME("(%p)->(%p)\n", This, p);
1921 return E_NOTIMPL;
1924 static HRESULT WINAPI HTMLStyle_put_pageBreakAfter(IHTMLStyle *iface, BSTR v)
1926 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1927 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1928 return E_NOTIMPL;
1931 static HRESULT WINAPI HTMLStyle_get_pageBreakAfter(IHTMLStyle *iface, BSTR *p)
1933 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1934 FIXME("(%p)->(%p)\n", This, p);
1935 return E_NOTIMPL;
1938 static HRESULT WINAPI HTMLStyle_put_cssText(IHTMLStyle *iface, BSTR v)
1940 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1941 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1942 return E_NOTIMPL;
1945 static HRESULT WINAPI HTMLStyle_get_cssText(IHTMLStyle *iface, BSTR *p)
1947 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1948 FIXME("(%p)->(%p)\n", This, p);
1949 return E_NOTIMPL;
1952 static HRESULT WINAPI HTMLStyle_put_pixelTop(IHTMLStyle *iface, long v)
1954 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1955 FIXME("(%p)->()\n", This);
1956 return E_NOTIMPL;
1959 static HRESULT WINAPI HTMLStyle_get_pixelTop(IHTMLStyle *iface, long *p)
1961 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1962 FIXME("(%p)->()\n", This);
1963 return E_NOTIMPL;
1966 static HRESULT WINAPI HTMLStyle_put_pixelLeft(IHTMLStyle *iface, long v)
1968 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1969 FIXME("(%p)->()\n", This);
1970 return E_NOTIMPL;
1973 static HRESULT WINAPI HTMLStyle_get_pixelLeft(IHTMLStyle *iface, long *p)
1975 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1976 FIXME("(%p)->()\n", This);
1977 return E_NOTIMPL;
1980 static HRESULT WINAPI HTMLStyle_put_pixelWidth(IHTMLStyle *iface, long v)
1982 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1983 FIXME("(%p)->()\n", This);
1984 return E_NOTIMPL;
1987 static HRESULT WINAPI HTMLStyle_get_pixelWidth(IHTMLStyle *iface, long *p)
1989 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1990 FIXME("(%p)->()\n", This);
1991 return E_NOTIMPL;
1994 static HRESULT WINAPI HTMLStyle_put_pixelHeight(IHTMLStyle *iface, long v)
1996 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1997 FIXME("(%p)->()\n", This);
1998 return E_NOTIMPL;
2001 static HRESULT WINAPI HTMLStyle_get_pixelHeight(IHTMLStyle *iface, long *p)
2003 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2004 FIXME("(%p)->()\n", This);
2005 return E_NOTIMPL;
2008 static HRESULT WINAPI HTMLStyle_put_posTop(IHTMLStyle *iface, float v)
2010 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2012 TRACE("(%p)->(%f)\n", This, v);
2014 return set_style_pos(This, STYLEID_TOP, v);
2017 static HRESULT WINAPI HTMLStyle_get_posTop(IHTMLStyle *iface, float *p)
2019 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2021 TRACE("(%p)->(%p)\n", This, p);
2023 if(!p)
2024 return E_POINTER;
2026 return get_nsstyle_pos(This, STYLEID_TOP, p);
2029 static HRESULT WINAPI HTMLStyle_put_posLeft(IHTMLStyle *iface, float v)
2031 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2033 TRACE("(%p)->(%f)\n", This, v);
2035 return set_style_pos(This, STYLEID_LEFT, v);
2038 static HRESULT WINAPI HTMLStyle_get_posLeft(IHTMLStyle *iface, float *p)
2040 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2042 TRACE("(%p)->(%p)\n", This, p);
2044 if(!p)
2045 return E_POINTER;
2047 return get_nsstyle_pos(This, STYLEID_LEFT, p);
2050 static HRESULT WINAPI HTMLStyle_put_posWidth(IHTMLStyle *iface, float v)
2052 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2054 TRACE("(%p)->(%f)\n", This, v);
2056 return set_style_pos(This, STYLEID_WIDTH, v);
2059 static HRESULT WINAPI HTMLStyle_get_posWidth(IHTMLStyle *iface, float *p)
2061 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2063 TRACE("(%p)->(%p)\n", This, p);
2065 if(!p)
2066 return E_POINTER;
2068 if(get_nsstyle_pos(This, STYLEID_WIDTH, p) != S_OK)
2069 *p = 0.0f;
2071 return S_OK;
2074 static HRESULT WINAPI HTMLStyle_put_posHeight(IHTMLStyle *iface, float v)
2076 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2078 TRACE("(%p)->(%f)\n", This, v);
2080 return set_style_pos(This, STYLEID_HEIGHT, v);
2083 static HRESULT WINAPI HTMLStyle_get_posHeight(IHTMLStyle *iface, float *p)
2085 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2087 TRACE("(%p)->(%p)\n", This, p);
2089 if(!p)
2090 return E_POINTER;
2092 if(get_nsstyle_pos(This, STYLEID_HEIGHT, p) != S_OK)
2093 *p = 0.0f;
2095 return S_OK;
2098 static HRESULT WINAPI HTMLStyle_put_cursor(IHTMLStyle *iface, BSTR v)
2100 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2102 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2104 return set_style_attr(This, STYLEID_CURSOR, v, 0);
2107 static HRESULT WINAPI HTMLStyle_get_cursor(IHTMLStyle *iface, BSTR *p)
2109 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2111 TRACE("(%p)->(%p)\n", This, p);
2113 return get_style_attr(This, STYLEID_CURSOR, p);
2116 static HRESULT WINAPI HTMLStyle_put_clip(IHTMLStyle *iface, BSTR v)
2118 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2119 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
2120 return E_NOTIMPL;
2123 static HRESULT WINAPI HTMLStyle_get_clip(IHTMLStyle *iface, BSTR *p)
2125 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2126 FIXME("(%p)->(%p)\n", This, p);
2127 return E_NOTIMPL;
2130 static HRESULT WINAPI HTMLStyle_put_filter(IHTMLStyle *iface, BSTR v)
2132 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2134 WARN("(%p)->(%s)\n", This, debugstr_w(v));
2136 /* FIXME: Handle MS-style filters */
2137 return set_style_attr(This, STYLEID_FILTER, v, 0);
2140 static HRESULT WINAPI HTMLStyle_get_filter(IHTMLStyle *iface, BSTR *p)
2142 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2144 WARN("(%p)->(%p)\n", This, p);
2146 /* FIXME: Handle MS-style filters */
2147 return get_style_attr(This, STYLEID_FILTER, p);
2150 static HRESULT WINAPI HTMLStyle_setAttribute(IHTMLStyle *iface, BSTR strAttributeName,
2151 VARIANT AttributeValue, LONG lFlags)
2153 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2154 HRESULT hres;
2155 DISPID dispid;
2157 TRACE("(%p)->(%s v%d %08x)\n", This, debugstr_w(strAttributeName),
2158 V_VT(&AttributeValue), lFlags);
2160 if(!strAttributeName)
2161 return E_INVALIDARG;
2163 if(lFlags == 1)
2164 FIXME("Parameter lFlags ignored\n");
2166 hres = HTMLStyle_GetIDsOfNames(iface, &IID_NULL, (LPOLESTR*)&strAttributeName, 1,
2167 LOCALE_USER_DEFAULT, &dispid);
2168 if(hres == S_OK)
2170 VARIANT ret;
2171 DISPID dispidNamed = DISPID_PROPERTYPUT;
2172 DISPPARAMS params;
2174 params.cArgs = 1;
2175 params.rgvarg = &AttributeValue;
2176 params.cNamedArgs = 1;
2177 params.rgdispidNamedArgs = &dispidNamed;
2179 hres = HTMLStyle_Invoke(iface, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
2180 DISPATCH_PROPERTYPUT, &params, &ret, NULL, NULL);
2182 else
2184 FIXME("Custom attributes not supported.\n");
2187 TRACE("ret: %08x\n", hres);
2189 return hres;
2192 static HRESULT WINAPI HTMLStyle_getAttribute(IHTMLStyle *iface, BSTR strAttributeName,
2193 LONG lFlags, VARIANT *AttributeValue)
2195 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2196 HRESULT hres;
2197 DISPID dispid;
2199 TRACE("(%p)->(%s v%p %08x)\n", This, debugstr_w(strAttributeName),
2200 AttributeValue, lFlags);
2202 if(!AttributeValue || !strAttributeName)
2203 return E_INVALIDARG;
2205 if(lFlags == 1)
2206 FIXME("Parameter lFlags ignored\n");
2208 hres = HTMLStyle_GetIDsOfNames(iface, &IID_NULL, (LPOLESTR*)&strAttributeName, 1,
2209 LOCALE_USER_DEFAULT, &dispid);
2210 if(hres == S_OK)
2212 DISPPARAMS params = {NULL, NULL, 0, 0 };
2214 hres = HTMLStyle_Invoke(iface, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
2215 DISPATCH_PROPERTYGET, &params, AttributeValue, NULL, NULL);
2217 else
2219 FIXME("Custom attributes not supported.\n");
2222 return hres;
2225 static HRESULT WINAPI HTMLStyle_removeAttribute(IHTMLStyle *iface, BSTR strAttributeName,
2226 LONG lFlags, VARIANT_BOOL *pfSuccess)
2228 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2229 FIXME("(%p)->(%s %08x %p)\n", This, debugstr_w(strAttributeName),
2230 lFlags, pfSuccess);
2231 return E_NOTIMPL;
2234 static HRESULT WINAPI HTMLStyle_toString(IHTMLStyle *iface, BSTR *String)
2236 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2237 FIXME("(%p)->(%p)\n", This, String);
2238 return E_NOTIMPL;
2241 static HRESULT HTMLStyle_get_dispid(IUnknown *iface, BSTR name, DWORD flags, DISPID *dispid)
2243 int c, i, min=0, max = sizeof(style_tbl)/sizeof(*style_tbl)-1;
2245 while(min <= max) {
2246 i = (min+max)/2;
2248 c = strcmpW(style_tbl[i].name, name);
2249 if(!c) {
2250 *dispid = style_tbl[i].dispid;
2251 return S_OK;
2254 if(c > 0)
2255 max = i-1;
2256 else
2257 min = i+1;
2260 return DISP_E_UNKNOWNNAME;
2263 static const IHTMLStyleVtbl HTMLStyleVtbl = {
2264 HTMLStyle_QueryInterface,
2265 HTMLStyle_AddRef,
2266 HTMLStyle_Release,
2267 HTMLStyle_GetTypeInfoCount,
2268 HTMLStyle_GetTypeInfo,
2269 HTMLStyle_GetIDsOfNames,
2270 HTMLStyle_Invoke,
2271 HTMLStyle_put_fontFamily,
2272 HTMLStyle_get_fontFamily,
2273 HTMLStyle_put_fontStyle,
2274 HTMLStyle_get_fontStyle,
2275 HTMLStyle_put_fontVariant,
2276 HTMLStyle_get_fontVariant,
2277 HTMLStyle_put_fontWeight,
2278 HTMLStyle_get_fontWeight,
2279 HTMLStyle_put_fontSize,
2280 HTMLStyle_get_fontSize,
2281 HTMLStyle_put_font,
2282 HTMLStyle_get_font,
2283 HTMLStyle_put_color,
2284 HTMLStyle_get_color,
2285 HTMLStyle_put_background,
2286 HTMLStyle_get_background,
2287 HTMLStyle_put_backgroundColor,
2288 HTMLStyle_get_backgroundColor,
2289 HTMLStyle_put_backgroundImage,
2290 HTMLStyle_get_backgroundImage,
2291 HTMLStyle_put_backgroundRepeat,
2292 HTMLStyle_get_backgroundRepeat,
2293 HTMLStyle_put_backgroundAttachment,
2294 HTMLStyle_get_backgroundAttachment,
2295 HTMLStyle_put_backgroundPosition,
2296 HTMLStyle_get_backgroundPosition,
2297 HTMLStyle_put_backgroundPositionX,
2298 HTMLStyle_get_backgroundPositionX,
2299 HTMLStyle_put_backgroundPositionY,
2300 HTMLStyle_get_backgroundPositionY,
2301 HTMLStyle_put_wordSpacing,
2302 HTMLStyle_get_wordSpacing,
2303 HTMLStyle_put_letterSpacing,
2304 HTMLStyle_get_letterSpacing,
2305 HTMLStyle_put_textDecoration,
2306 HTMLStyle_get_textDecoration,
2307 HTMLStyle_put_textDecorationNone,
2308 HTMLStyle_get_textDecorationNone,
2309 HTMLStyle_put_textDecorationUnderline,
2310 HTMLStyle_get_textDecorationUnderline,
2311 HTMLStyle_put_textDecorationOverline,
2312 HTMLStyle_get_textDecorationOverline,
2313 HTMLStyle_put_textDecorationLineThrough,
2314 HTMLStyle_get_textDecorationLineThrough,
2315 HTMLStyle_put_textDecorationBlink,
2316 HTMLStyle_get_textDecorationBlink,
2317 HTMLStyle_put_verticalAlign,
2318 HTMLStyle_get_verticalAlign,
2319 HTMLStyle_put_textTransform,
2320 HTMLStyle_get_textTransform,
2321 HTMLStyle_put_textAlign,
2322 HTMLStyle_get_textAlign,
2323 HTMLStyle_put_textIndent,
2324 HTMLStyle_get_textIndent,
2325 HTMLStyle_put_lineHeight,
2326 HTMLStyle_get_lineHeight,
2327 HTMLStyle_put_marginTop,
2328 HTMLStyle_get_marginTop,
2329 HTMLStyle_put_marginRight,
2330 HTMLStyle_get_marginRight,
2331 HTMLStyle_put_marginBottom,
2332 HTMLStyle_get_marginBottom,
2333 HTMLStyle_put_marginLeft,
2334 HTMLStyle_get_marginLeft,
2335 HTMLStyle_put_margin,
2336 HTMLStyle_get_margin,
2337 HTMLStyle_put_paddingTop,
2338 HTMLStyle_get_paddingTop,
2339 HTMLStyle_put_paddingRight,
2340 HTMLStyle_get_paddingRight,
2341 HTMLStyle_put_paddingBottom,
2342 HTMLStyle_get_paddingBottom,
2343 HTMLStyle_put_paddingLeft,
2344 HTMLStyle_get_paddingLeft,
2345 HTMLStyle_put_padding,
2346 HTMLStyle_get_padding,
2347 HTMLStyle_put_border,
2348 HTMLStyle_get_border,
2349 HTMLStyle_put_borderTop,
2350 HTMLStyle_get_borderTop,
2351 HTMLStyle_put_borderRight,
2352 HTMLStyle_get_borderRight,
2353 HTMLStyle_put_borderBottom,
2354 HTMLStyle_get_borderBottom,
2355 HTMLStyle_put_borderLeft,
2356 HTMLStyle_get_borderLeft,
2357 HTMLStyle_put_borderColor,
2358 HTMLStyle_get_borderColor,
2359 HTMLStyle_put_borderTopColor,
2360 HTMLStyle_get_borderTopColor,
2361 HTMLStyle_put_borderRightColor,
2362 HTMLStyle_get_borderRightColor,
2363 HTMLStyle_put_borderBottomColor,
2364 HTMLStyle_get_borderBottomColor,
2365 HTMLStyle_put_borderLeftColor,
2366 HTMLStyle_get_borderLeftColor,
2367 HTMLStyle_put_borderWidth,
2368 HTMLStyle_get_borderWidth,
2369 HTMLStyle_put_borderTopWidth,
2370 HTMLStyle_get_borderTopWidth,
2371 HTMLStyle_put_borderRightWidth,
2372 HTMLStyle_get_borderRightWidth,
2373 HTMLStyle_put_borderBottomWidth,
2374 HTMLStyle_get_borderBottomWidth,
2375 HTMLStyle_put_borderLeftWidth,
2376 HTMLStyle_get_borderLeftWidth,
2377 HTMLStyle_put_borderStyle,
2378 HTMLStyle_get_borderStyle,
2379 HTMLStyle_put_borderTopStyle,
2380 HTMLStyle_get_borderTopStyle,
2381 HTMLStyle_put_borderRightStyle,
2382 HTMLStyle_get_borderRightStyle,
2383 HTMLStyle_put_borderBottomStyle,
2384 HTMLStyle_get_borderBottomStyle,
2385 HTMLStyle_put_borderLeftStyle,
2386 HTMLStyle_get_borderLeftStyle,
2387 HTMLStyle_put_width,
2388 HTMLStyle_get_width,
2389 HTMLStyle_put_height,
2390 HTMLStyle_get_height,
2391 HTMLStyle_put_styleFloat,
2392 HTMLStyle_get_styleFloat,
2393 HTMLStyle_put_clear,
2394 HTMLStyle_get_clear,
2395 HTMLStyle_put_display,
2396 HTMLStyle_get_display,
2397 HTMLStyle_put_visibility,
2398 HTMLStyle_get_visibility,
2399 HTMLStyle_put_listStyleType,
2400 HTMLStyle_get_listStyleType,
2401 HTMLStyle_put_listStylePosition,
2402 HTMLStyle_get_listStylePosition,
2403 HTMLStyle_put_listStyleImage,
2404 HTMLStyle_get_listStyleImage,
2405 HTMLStyle_put_listStyle,
2406 HTMLStyle_get_listStyle,
2407 HTMLStyle_put_whiteSpace,
2408 HTMLStyle_get_whiteSpace,
2409 HTMLStyle_put_top,
2410 HTMLStyle_get_top,
2411 HTMLStyle_put_left,
2412 HTMLStyle_get_left,
2413 HTMLStyle_get_position,
2414 HTMLStyle_put_zIndex,
2415 HTMLStyle_get_zIndex,
2416 HTMLStyle_put_overflow,
2417 HTMLStyle_get_overflow,
2418 HTMLStyle_put_pageBreakBefore,
2419 HTMLStyle_get_pageBreakBefore,
2420 HTMLStyle_put_pageBreakAfter,
2421 HTMLStyle_get_pageBreakAfter,
2422 HTMLStyle_put_cssText,
2423 HTMLStyle_get_cssText,
2424 HTMLStyle_put_pixelTop,
2425 HTMLStyle_get_pixelTop,
2426 HTMLStyle_put_pixelLeft,
2427 HTMLStyle_get_pixelLeft,
2428 HTMLStyle_put_pixelWidth,
2429 HTMLStyle_get_pixelWidth,
2430 HTMLStyle_put_pixelHeight,
2431 HTMLStyle_get_pixelHeight,
2432 HTMLStyle_put_posTop,
2433 HTMLStyle_get_posTop,
2434 HTMLStyle_put_posLeft,
2435 HTMLStyle_get_posLeft,
2436 HTMLStyle_put_posWidth,
2437 HTMLStyle_get_posWidth,
2438 HTMLStyle_put_posHeight,
2439 HTMLStyle_get_posHeight,
2440 HTMLStyle_put_cursor,
2441 HTMLStyle_get_cursor,
2442 HTMLStyle_put_clip,
2443 HTMLStyle_get_clip,
2444 HTMLStyle_put_filter,
2445 HTMLStyle_get_filter,
2446 HTMLStyle_setAttribute,
2447 HTMLStyle_getAttribute,
2448 HTMLStyle_removeAttribute,
2449 HTMLStyle_toString
2452 static const dispex_static_data_vtbl_t HTMLStyle_dispex_vtbl = {
2453 HTMLStyle_get_dispid,
2454 NULL
2457 static const tid_t HTMLStyle_iface_tids[] = {
2458 IHTMLStyle_tid,
2459 IHTMLStyle2_tid,
2462 static dispex_static_data_t HTMLStyle_dispex = {
2463 &HTMLStyle_dispex_vtbl,
2464 DispHTMLStyle_tid,
2465 NULL,
2466 HTMLStyle_iface_tids
2469 IHTMLStyle *HTMLStyle_Create(nsIDOMCSSStyleDeclaration *nsstyle)
2471 HTMLStyle *ret = heap_alloc_zero(sizeof(HTMLStyle));
2473 ret->lpHTMLStyleVtbl = &HTMLStyleVtbl;
2474 ret->ref = 1;
2475 ret->nsstyle = nsstyle;
2476 HTMLStyle2_Init(ret);
2477 HTMLStyle3_Init(ret);
2479 nsIDOMCSSStyleDeclaration_AddRef(nsstyle);
2481 init_dispex(&ret->dispex, (IUnknown*)HTMLSTYLE(ret), &HTMLStyle_dispex);
2483 return HTMLSTYLE(ret);