mshtml: Implement IHTMLStyle_get_marginRight.
[wine/multimedia.git] / dlls / mshtml / htmlstyle.c
blob3ee3d80ee31560f776ae9417a8ecc7d165d48745
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 attrMinHeight[] =
87 {'m','i','n','-','h','e','i','g','h','t',0};
88 static const WCHAR attrOverflow[] =
89 {'o','v','e','r','f','l','o','w',0};
90 static const WCHAR attrPaddingLeft[] =
91 {'p','a','d','d','i','n','g','-','l','e','f','t',0};
92 static const WCHAR attrPosition[] =
93 {'p','o','s','i','t','i','o','n',0};
94 static const WCHAR attrTextAlign[] =
95 {'t','e','x','t','-','a','l','i','g','n',0};
96 static const WCHAR attrTextDecoration[] =
97 {'t','e','x','t','-','d','e','c','o','r','a','t','i','o','n',0};
98 static const WCHAR attrTop[] =
99 {'t','o','p',0};
100 static const WCHAR attrVerticalAlign[] =
101 {'v','e','r','t','i','c','a','l','-','a','l','i','g','n',0};
102 static const WCHAR attrVisibility[] =
103 {'v','i','s','i','b','i','l','i','t','y',0};
104 static const WCHAR attrWidth[] =
105 {'w','i','d','t','h',0};
106 static const WCHAR attrZIndex[] =
107 {'z','-','i','n','d','e','x',0};
109 static const struct{
110 const WCHAR *name;
111 DISPID dispid;
112 } style_tbl[] = {
113 {attrBackground, DISPID_IHTMLSTYLE_BACKGROUND},
114 {attrBackgroundColor, DISPID_IHTMLSTYLE_BACKGROUNDCOLOR},
115 {attrBackgroundImage, DISPID_IHTMLSTYLE_BACKGROUNDIMAGE},
116 {attrBorder, DISPID_IHTMLSTYLE_BORDER},
117 {attrBorderBottomStyle, DISPID_IHTMLSTYLE_BORDERBOTTOMSTYLE},
118 {attrBorderLeft, DISPID_IHTMLSTYLE_BORDERLEFT},
119 {attrBorderLeftStyle, DISPID_IHTMLSTYLE_BORDERLEFTSTYLE},
120 {attrBorderRightStyle, DISPID_IHTMLSTYLE_BORDERRIGHTSTYLE},
121 {attrBorderTopStyle, DISPID_IHTMLSTYLE_BORDERTOPSTYLE},
122 {attrBorderWidth, DISPID_IHTMLSTYLE_BORDERWIDTH},
123 {attrColor, DISPID_IHTMLSTYLE_COLOR},
124 {attrCursor, DISPID_IHTMLSTYLE_CURSOR},
125 {attrDisplay, DISPID_IHTMLSTYLE_DISPLAY},
126 {attrFilter, DISPID_IHTMLSTYLE_FILTER},
127 {attrFontFamily, DISPID_IHTMLSTYLE_FONTFAMILY},
128 {attrFontSize, DISPID_IHTMLSTYLE_FONTSIZE},
129 {attrFontStyle, DISPID_IHTMLSTYLE_FONTSTYLE},
130 {attrFontVariant, DISPID_IHTMLSTYLE_FONTVARIANT},
131 {attrFontWeight, DISPID_IHTMLSTYLE_FONTWEIGHT},
132 {attrHeight, DISPID_IHTMLSTYLE_HEIGHT},
133 {attrLeft, DISPID_IHTMLSTYLE_LEFT},
134 {attrMargin, DISPID_IHTMLSTYLE_MARGIN},
135 {attrMarginLeft, DISPID_IHTMLSTYLE_MARGINLEFT},
136 {attrMarginRight, DISPID_IHTMLSTYLE_MARGINRIGHT},
137 {attrMinHeight, DISPID_IHTMLSTYLE4_MINHEIGHT},
138 {attrOverflow, DISPID_IHTMLSTYLE_OVERFLOW},
139 {attrPaddingLeft, DISPID_IHTMLSTYLE_PADDINGLEFT},
140 {attrPosition, DISPID_IHTMLSTYLE2_POSITION},
141 {attrTextAlign, DISPID_IHTMLSTYLE_TEXTALIGN},
142 {attrTextDecoration, DISPID_IHTMLSTYLE_TEXTDECORATION},
143 {attrTop, DISPID_IHTMLSTYLE_TOP},
144 {attrVerticalAlign, DISPID_IHTMLSTYLE_VERTICALALIGN},
145 {attrVisibility, DISPID_IHTMLSTYLE_VISIBILITY},
146 {attrWidth, DISPID_IHTMLSTYLE_WIDTH},
147 {attrZIndex, DISPID_IHTMLSTYLE_ZINDEX}
150 static const WCHAR valLineThrough[] =
151 {'l','i','n','e','-','t','h','r','o','u','g','h',0};
152 static const WCHAR valUnderline[] =
153 {'u','n','d','e','r','l','i','n','e',0};
154 static const WCHAR szNormal[] =
155 {'n','o','r','m','a','l',0};
157 static const WCHAR px_formatW[] = {'%','d','p','x',0};
158 static const WCHAR emptyW[] = {0};
160 static LPWSTR fix_px_value(LPCWSTR val)
162 LPCWSTR ptr = val;
164 while(*ptr) {
165 while(*ptr && isspaceW(*ptr))
166 ptr++;
167 if(!*ptr)
168 break;
170 while(*ptr && isdigitW(*ptr))
171 ptr++;
173 if(!*ptr || isspaceW(*ptr)) {
174 LPWSTR ret, p;
175 int len = strlenW(val)+1;
177 ret = heap_alloc((len+2)*sizeof(WCHAR));
178 memcpy(ret, val, (ptr-val)*sizeof(WCHAR));
179 p = ret + (ptr-val);
180 *p++ = 'p';
181 *p++ = 'x';
182 strcpyW(p, ptr);
184 TRACE("fixed %s -> %s\n", debugstr_w(val), debugstr_w(ret));
186 return ret;
189 while(*ptr && !isspaceW(*ptr))
190 ptr++;
193 return NULL;
196 static LPWSTR fix_url_value(LPCWSTR val)
198 WCHAR *ret, *ptr;
200 static const WCHAR urlW[] = {'u','r','l','('};
202 if(strncmpW(val, urlW, sizeof(urlW)/sizeof(WCHAR)) || !strchrW(val, '\\'))
203 return NULL;
205 ret = heap_strdupW(val);
207 for(ptr = ret; *ptr; ptr++) {
208 if(*ptr == '\\')
209 *ptr = '/';
212 return ret;
215 #define ATTR_FIX_PX 1
216 #define ATTR_FIX_URL 2
217 #define ATTR_STR_TO_INT 4
219 HRESULT set_nsstyle_attr(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, LPCWSTR value, DWORD flags)
221 nsAString str_name, str_value, str_empty;
222 LPWSTR val = NULL;
223 nsresult nsres;
225 static const PRUnichar wszEmpty[] = {0};
227 if(flags & ATTR_FIX_PX)
228 val = fix_px_value(value);
229 if(flags & ATTR_FIX_URL)
230 val = fix_url_value(value);
232 nsAString_Init(&str_name, style_tbl[sid].name);
233 nsAString_Init(&str_value, val ? val : value);
234 nsAString_Init(&str_empty, wszEmpty);
235 heap_free(val);
237 nsres = nsIDOMCSSStyleDeclaration_SetProperty(nsstyle, &str_name, &str_value, &str_empty);
238 if(NS_FAILED(nsres))
239 ERR("SetProperty failed: %08x\n", nsres);
241 nsAString_Finish(&str_name);
242 nsAString_Finish(&str_value);
243 nsAString_Finish(&str_empty);
245 return S_OK;
248 HRESULT set_nsstyle_attr_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, VARIANT *value, DWORD flags)
250 switch(V_VT(value)) {
251 case VT_NULL:
252 return set_nsstyle_attr(nsstyle, sid, emptyW, flags);
254 case VT_BSTR:
255 return set_nsstyle_attr(nsstyle, sid, V_BSTR(value), flags);
257 case VT_I4: {
258 WCHAR str[14];
259 static const WCHAR format[] = {'%','d',0};
261 wsprintfW(str, format, V_I4(value));
262 return set_nsstyle_attr(nsstyle, sid, str, flags);
264 default:
265 FIXME("not implemented vt %d\n", V_VT(value));
266 return E_NOTIMPL;
270 return S_OK;
273 static inline HRESULT set_style_attr(HTMLStyle *This, styleid_t sid, LPCWSTR value, DWORD flags)
275 return set_nsstyle_attr(This->nsstyle, sid, value, flags);
278 static HRESULT get_nsstyle_attr_nsval(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, nsAString *value)
280 nsAString str_name;
281 nsresult nsres;
283 nsAString_Init(&str_name, style_tbl[sid].name);
285 nsres = nsIDOMCSSStyleDeclaration_GetPropertyValue(nsstyle, &str_name, value);
286 if(NS_FAILED(nsres)) {
287 ERR("SetProperty failed: %08x\n", nsres);
288 return E_FAIL;
291 nsAString_Finish(&str_name);
293 return NS_OK;
296 HRESULT get_nsstyle_attr(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, BSTR *p)
298 nsAString str_value;
299 const PRUnichar *value;
301 nsAString_Init(&str_value, NULL);
303 get_nsstyle_attr_nsval(nsstyle, sid, &str_value);
305 nsAString_GetData(&str_value, &value);
306 *p = *value ? SysAllocString(value) : NULL;
308 nsAString_Finish(&str_value);
310 TRACE("%s -> %s\n", debugstr_w(style_tbl[sid].name), debugstr_w(*p));
311 return S_OK;
314 HRESULT get_nsstyle_attr_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, VARIANT *p, DWORD flags)
316 nsAString str_value;
317 const PRUnichar *value;
318 BOOL set = FALSE;
320 nsAString_Init(&str_value, NULL);
322 get_nsstyle_attr_nsval(nsstyle, sid, &str_value);
324 nsAString_GetData(&str_value, &value);
326 if(flags & ATTR_STR_TO_INT) {
327 const PRUnichar *ptr = value;
328 BOOL neg = FALSE;
329 INT i = 0;
331 if(*ptr == '-') {
332 neg = TRUE;
333 ptr++;
336 while(isdigitW(*ptr))
337 i = i*10 + (*ptr++ - '0');
339 if(!*ptr) {
340 V_VT(p) = VT_I4;
341 V_I4(p) = neg ? -i : i;
342 set = TRUE;
346 if(!set) {
347 BSTR str = NULL;
349 if(*value) {
350 str = SysAllocString(value);
351 if(!str)
352 return E_OUTOFMEMORY;
355 V_VT(p) = VT_BSTR;
356 V_BSTR(p) = str;
359 nsAString_Finish(&str_value);
361 TRACE("%s -> %s\n", debugstr_w(style_tbl[sid].name), debugstr_variant(p));
362 return S_OK;
365 static inline HRESULT get_style_attr(HTMLStyle *This, styleid_t sid, BSTR *p)
367 return get_nsstyle_attr(This->nsstyle, sid, p);
370 static HRESULT check_style_attr_value(HTMLStyle *This, styleid_t sid, LPCWSTR exval, VARIANT_BOOL *p)
372 nsAString str_value;
373 const PRUnichar *value;
375 nsAString_Init(&str_value, NULL);
377 get_nsstyle_attr_nsval(This->nsstyle, sid, &str_value);
379 nsAString_GetData(&str_value, &value);
380 *p = strcmpW(value, exval) ? VARIANT_FALSE : VARIANT_TRUE;
381 nsAString_Finish(&str_value);
383 TRACE("%s -> %x\n", debugstr_w(style_tbl[sid].name), *p);
384 return S_OK;
387 static inline HRESULT set_style_pos(HTMLStyle *This, styleid_t sid, float value)
389 WCHAR szValue[25];
390 WCHAR szFormat[] = {'%','.','0','f','p','x',0};
392 value = floor(value);
394 sprintfW(szValue, szFormat, value);
396 return set_style_attr(This, sid, szValue, 0);
399 static HRESULT get_nsstyle_pos(HTMLStyle *This, styleid_t sid, float *p)
401 nsAString str_value;
402 HRESULT hres;
403 WCHAR pxW[] = {'p','x',0};
405 TRACE("%p %d %p\n", This, sid, p);
407 *p = 0.0f;
409 nsAString_Init(&str_value, NULL);
411 hres = get_nsstyle_attr_nsval(This->nsstyle, sid, &str_value);
412 if(hres == S_OK)
414 WCHAR *ptr;
415 const PRUnichar *value;
417 nsAString_GetData(&str_value, &value);
418 if(value)
420 *p = strtolW(value, &ptr, 10);
422 if(*ptr && strcmpW(ptr, pxW))
424 nsAString_Finish(&str_value);
425 FIXME("only px values are currently supported\n");
426 return E_FAIL;
431 TRACE("ret %f\n", *p);
433 nsAString_Finish(&str_value);
435 return hres;
438 static BOOL is_valid_border_style(BSTR v)
440 static const WCHAR styleNone[] = {'n','o','n','e',0};
441 static const WCHAR styleDotted[] = {'d','o','t','t','e','d',0};
442 static const WCHAR styleDashed[] = {'d','a','s','h','e','d',0};
443 static const WCHAR styleSolid[] = {'s','o','l','i','d',0};
444 static const WCHAR styleDouble[] = {'d','o','u','b','l','e',0};
445 static const WCHAR styleGroove[] = {'g','r','o','o','v','e',0};
446 static const WCHAR styleRidge[] = {'r','i','d','g','e',0};
447 static const WCHAR styleInset[] = {'i','n','s','e','t',0};
448 static const WCHAR styleOutset[] = {'o','u','t','s','e','t',0};
450 TRACE("%s\n", debugstr_w(v));
452 if(!v || strcmpiW(v, styleNone) == 0 || strcmpiW(v, styleDotted) == 0 ||
453 strcmpiW(v, styleDashed) == 0 || strcmpiW(v, styleSolid) == 0 ||
454 strcmpiW(v, styleDouble) == 0 || strcmpiW(v, styleGroove) == 0 ||
455 strcmpiW(v, styleRidge) == 0 || strcmpiW(v, styleInset) == 0 ||
456 strcmpiW(v, styleOutset) == 0 )
458 return TRUE;
461 return FALSE;
464 #define HTMLSTYLE_THIS(iface) DEFINE_THIS(HTMLStyle, HTMLStyle, iface)
466 static HRESULT WINAPI HTMLStyle_QueryInterface(IHTMLStyle *iface, REFIID riid, void **ppv)
468 HTMLStyle *This = HTMLSTYLE_THIS(iface);
470 *ppv = NULL;
472 if(IsEqualGUID(&IID_IUnknown, riid)) {
473 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
474 *ppv = HTMLSTYLE(This);
475 }else if(IsEqualGUID(&IID_IHTMLStyle, riid)) {
476 TRACE("(%p)->(IID_IHTMLStyle %p)\n", This, ppv);
477 *ppv = HTMLSTYLE(This);
478 }else if(IsEqualGUID(&IID_IHTMLStyle2, riid)) {
479 TRACE("(%p)->(IID_IHTMLStyle2 %p)\n", This, ppv);
480 *ppv = HTMLSTYLE2(This);
481 }else if(IsEqualGUID(&IID_IHTMLStyle3, riid)) {
482 TRACE("(%p)->(IID_IHTMLStyle3 %p)\n", This, ppv);
483 *ppv = HTMLSTYLE3(This);
484 }else if(IsEqualGUID(&IID_IHTMLStyle4, riid)) {
485 TRACE("(%p)->(IID_IHTMLStyle4 %p)\n", This, ppv);
486 *ppv = HTMLSTYLE4(This);
487 }else if(dispex_query_interface(&This->dispex, riid, ppv)) {
488 return *ppv ? S_OK : E_NOINTERFACE;
491 if(*ppv) {
492 IUnknown_AddRef((IUnknown*)*ppv);
493 return S_OK;
496 WARN("unsupported %s\n", debugstr_guid(riid));
497 return E_NOINTERFACE;
500 static ULONG WINAPI HTMLStyle_AddRef(IHTMLStyle *iface)
502 HTMLStyle *This = HTMLSTYLE_THIS(iface);
503 LONG ref = InterlockedIncrement(&This->ref);
505 TRACE("(%p) ref=%d\n", This, ref);
507 return ref;
510 static ULONG WINAPI HTMLStyle_Release(IHTMLStyle *iface)
512 HTMLStyle *This = HTMLSTYLE_THIS(iface);
513 LONG ref = InterlockedDecrement(&This->ref);
515 TRACE("(%p) ref=%d\n", This, ref);
517 if(!ref) {
518 if(This->nsstyle)
519 nsIDOMCSSStyleDeclaration_Release(This->nsstyle);
520 heap_free(This);
523 return ref;
526 static HRESULT WINAPI HTMLStyle_GetTypeInfoCount(IHTMLStyle *iface, UINT *pctinfo)
528 HTMLStyle *This = HTMLSTYLE_THIS(iface);
529 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->dispex), pctinfo);
532 static HRESULT WINAPI HTMLStyle_GetTypeInfo(IHTMLStyle *iface, UINT iTInfo,
533 LCID lcid, ITypeInfo **ppTInfo)
535 HTMLStyle *This = HTMLSTYLE_THIS(iface);
536 return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->dispex), iTInfo, lcid, ppTInfo);
539 static HRESULT WINAPI HTMLStyle_GetIDsOfNames(IHTMLStyle *iface, REFIID riid,
540 LPOLESTR *rgszNames, UINT cNames,
541 LCID lcid, DISPID *rgDispId)
543 HTMLStyle *This = HTMLSTYLE_THIS(iface);
544 return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->dispex), riid, rgszNames, cNames, lcid, rgDispId);
547 static HRESULT WINAPI HTMLStyle_Invoke(IHTMLStyle *iface, DISPID dispIdMember,
548 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
549 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
551 HTMLStyle *This = HTMLSTYLE_THIS(iface);
552 return IDispatchEx_Invoke(DISPATCHEX(&This->dispex), dispIdMember, riid, lcid,
553 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
556 static HRESULT WINAPI HTMLStyle_put_fontFamily(IHTMLStyle *iface, BSTR v)
558 HTMLStyle *This = HTMLSTYLE_THIS(iface);
560 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
562 return set_style_attr(This, STYLEID_FONT_FAMILY, v, 0);
565 static HRESULT WINAPI HTMLStyle_get_fontFamily(IHTMLStyle *iface, BSTR *p)
567 HTMLStyle *This = HTMLSTYLE_THIS(iface);
569 TRACE("(%p)->(%p)\n", This, p);
571 return get_style_attr(This, STYLEID_FONT_FAMILY, p);
574 static HRESULT WINAPI HTMLStyle_put_fontStyle(IHTMLStyle *iface, BSTR v)
576 HTMLStyle *This = HTMLSTYLE_THIS(iface);
577 static const WCHAR szItalic[] = {'i','t','a','l','i','c',0};
578 static const WCHAR szOblique[] = {'o','b','l','i','q','u','e',0};
580 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
582 /* fontStyle can only be one of the follow values. */
583 if(!v || strcmpiW(szNormal, v) == 0 || strcmpiW(szItalic, v) == 0 ||
584 strcmpiW(szOblique, v) == 0)
586 return set_nsstyle_attr(This->nsstyle, STYLEID_FONT_STYLE, v, 0);
589 return E_INVALIDARG;
592 static HRESULT WINAPI HTMLStyle_get_fontStyle(IHTMLStyle *iface, BSTR *p)
594 HTMLStyle *This = HTMLSTYLE_THIS(iface);
596 TRACE("(%p)->(%p)\n", This, p);
598 return get_style_attr(This, STYLEID_FONT_STYLE, p);
601 static HRESULT WINAPI HTMLStyle_put_fontVariant(IHTMLStyle *iface, BSTR v)
603 HTMLStyle *This = HTMLSTYLE_THIS(iface);
604 static const WCHAR szCaps[] = {'s','m','a','l','l','-','c','a','p','s',0};
606 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
608 /* fontVariant can only be one of the follow values. */
609 if(!v || strcmpiW(szNormal, v) == 0 || strcmpiW(szCaps, v) == 0)
611 return set_nsstyle_attr(This->nsstyle, STYLEID_FONT_VARIANT, v, 0);
614 return E_INVALIDARG;
617 static HRESULT WINAPI HTMLStyle_get_fontVariant(IHTMLStyle *iface, BSTR *p)
619 HTMLStyle *This = HTMLSTYLE_THIS(iface);
620 TRACE("(%p)->(%p)\n", This, p);
622 if(!p)
623 return E_INVALIDARG;
625 return get_style_attr(This, STYLEID_FONT_VARIANT, p);
628 static HRESULT WINAPI HTMLStyle_put_fontWeight(IHTMLStyle *iface, BSTR v)
630 HTMLStyle *This = HTMLSTYLE_THIS(iface);
631 static const WCHAR styleBold[] = {'b','o','l','d',0};
632 static const WCHAR styleBolder[] = {'b','o','l','d','e','r',0};
633 static const WCHAR styleLighter[] = {'l','i','g','h','t','e','r',0};
634 static const WCHAR style100[] = {'1','0','0',0};
635 static const WCHAR style200[] = {'2','0','0',0};
636 static const WCHAR style300[] = {'3','0','0',0};
637 static const WCHAR style400[] = {'4','0','0',0};
638 static const WCHAR style500[] = {'5','0','0',0};
639 static const WCHAR style600[] = {'6','0','0',0};
640 static const WCHAR style700[] = {'7','0','0',0};
641 static const WCHAR style800[] = {'8','0','0',0};
642 static const WCHAR style900[] = {'9','0','0',0};
644 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
646 /* fontWeight can only be one of the following */
647 if(!v || strcmpiW(szNormal, v) == 0 || strcmpiW(styleBold, v) == 0 ||
648 strcmpiW(styleBolder, v) == 0 || strcmpiW(styleLighter, v) == 0 ||
649 strcmpiW(style100, v) == 0 || strcmpiW(style200, v) == 0 ||
650 strcmpiW(style300, v) == 0 || strcmpiW(style400, v) == 0 ||
651 strcmpiW(style500, v) == 0 || strcmpiW(style600, v) == 0 ||
652 strcmpiW(style700, v) == 0 || strcmpiW(style800, v) == 0 ||
653 strcmpiW(style900, v) == 0
656 return set_nsstyle_attr(This->nsstyle, STYLEID_FONT_WEIGHT, v, 0);
659 return E_INVALIDARG;
662 static HRESULT WINAPI HTMLStyle_get_fontWeight(IHTMLStyle *iface, BSTR *p)
664 HTMLStyle *This = HTMLSTYLE_THIS(iface);
666 TRACE("(%p)->(%p)\n", This, p);
668 return get_style_attr(This, STYLEID_FONT_WEIGHT, p);
671 static HRESULT WINAPI HTMLStyle_put_fontSize(IHTMLStyle *iface, VARIANT v)
673 HTMLStyle *This = HTMLSTYLE_THIS(iface);
675 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
677 switch(V_VT(&v)) {
678 case VT_BSTR:
679 return set_style_attr(This, STYLEID_FONT_SIZE, V_BSTR(&v), 0);
680 default:
681 FIXME("not supported vt %d\n", V_VT(&v));
684 return S_OK;
687 static HRESULT WINAPI HTMLStyle_get_fontSize(IHTMLStyle *iface, VARIANT *p)
689 HTMLStyle *This = HTMLSTYLE_THIS(iface);
691 TRACE("(%p)->(%p)\n", This, p);
693 V_VT(p) = VT_BSTR;
694 return get_style_attr(This, STYLEID_FONT_SIZE, &V_BSTR(p));
697 static HRESULT WINAPI HTMLStyle_put_font(IHTMLStyle *iface, BSTR v)
699 HTMLStyle *This = HTMLSTYLE_THIS(iface);
700 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
701 return E_NOTIMPL;
704 static HRESULT WINAPI HTMLStyle_get_font(IHTMLStyle *iface, BSTR *p)
706 HTMLStyle *This = HTMLSTYLE_THIS(iface);
707 FIXME("(%p)->(%p)\n", This, p);
708 return E_NOTIMPL;
711 static HRESULT WINAPI HTMLStyle_put_color(IHTMLStyle *iface, VARIANT v)
713 HTMLStyle *This = HTMLSTYLE_THIS(iface);
715 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
717 switch(V_VT(&v)) {
718 case VT_BSTR:
719 TRACE("%s\n", debugstr_w(V_BSTR(&v)));
720 return set_style_attr(This, STYLEID_COLOR, V_BSTR(&v), 0);
722 default:
723 FIXME("unsupported vt=%d\n", V_VT(&v));
726 return E_NOTIMPL;
729 static HRESULT WINAPI HTMLStyle_get_color(IHTMLStyle *iface, VARIANT *p)
731 HTMLStyle *This = HTMLSTYLE_THIS(iface);
733 TRACE("(%p)->(%p)\n", This, p);
735 V_VT(p) = VT_BSTR;
736 return get_style_attr(This, STYLEID_COLOR, &V_BSTR(p));
739 static HRESULT WINAPI HTMLStyle_put_background(IHTMLStyle *iface, BSTR v)
741 HTMLStyle *This = HTMLSTYLE_THIS(iface);
743 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
745 return set_style_attr(This, STYLEID_BACKGROUND, v, 0);
748 static HRESULT WINAPI HTMLStyle_get_background(IHTMLStyle *iface, BSTR *p)
750 HTMLStyle *This = HTMLSTYLE_THIS(iface);
752 TRACE("(%p)->(%p)\n", This, p);
754 return get_style_attr(This, STYLEID_BACKGROUND, p);
757 static HRESULT WINAPI HTMLStyle_put_backgroundColor(IHTMLStyle *iface, VARIANT v)
759 HTMLStyle *This = HTMLSTYLE_THIS(iface);
761 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
763 switch(V_VT(&v)) {
764 case VT_BSTR:
765 return set_style_attr(This, STYLEID_BACKGROUND_COLOR, V_BSTR(&v), 0);
766 case VT_I4: {
767 WCHAR value[10];
768 static const WCHAR format[] = {'#','%','0','6','x',0};
770 wsprintfW(value, format, V_I4(&v));
771 return set_style_attr(This, STYLEID_BACKGROUND_COLOR, value, 0);
773 default:
774 FIXME("unsupported vt %d\n", V_VT(&v));
777 return S_OK;
780 static HRESULT WINAPI HTMLStyle_get_backgroundColor(IHTMLStyle *iface, VARIANT *p)
782 HTMLStyle *This = HTMLSTYLE_THIS(iface);
783 TRACE("(%p)->(%p)\n", This, p);
785 V_VT(p) = VT_BSTR;
786 return get_style_attr(This, STYLEID_BACKGROUND_COLOR, &V_BSTR(p));
789 static HRESULT WINAPI HTMLStyle_put_backgroundImage(IHTMLStyle *iface, BSTR v)
791 HTMLStyle *This = HTMLSTYLE_THIS(iface);
793 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
795 return set_style_attr(This, STYLEID_BACKGROUND_IMAGE, v, ATTR_FIX_URL);
798 static HRESULT WINAPI HTMLStyle_get_backgroundImage(IHTMLStyle *iface, BSTR *p)
800 HTMLStyle *This = HTMLSTYLE_THIS(iface);
802 TRACE("(%p)->(%p)\n", This, p);
804 return get_style_attr(This, STYLEID_BACKGROUND_IMAGE, p);
807 static HRESULT WINAPI HTMLStyle_put_backgroundRepeat(IHTMLStyle *iface, BSTR v)
809 HTMLStyle *This = HTMLSTYLE_THIS(iface);
810 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
811 return E_NOTIMPL;
814 static HRESULT WINAPI HTMLStyle_get_backgroundRepeat(IHTMLStyle *iface, BSTR *p)
816 HTMLStyle *This = HTMLSTYLE_THIS(iface);
817 FIXME("(%p)->(%p)\n", This, p);
818 return E_NOTIMPL;
821 static HRESULT WINAPI HTMLStyle_put_backgroundAttachment(IHTMLStyle *iface, BSTR v)
823 HTMLStyle *This = HTMLSTYLE_THIS(iface);
824 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
825 return E_NOTIMPL;
828 static HRESULT WINAPI HTMLStyle_get_backgroundAttachment(IHTMLStyle *iface, BSTR *p)
830 HTMLStyle *This = HTMLSTYLE_THIS(iface);
831 FIXME("(%p)->(%p)\n", This, p);
832 return E_NOTIMPL;
835 static HRESULT WINAPI HTMLStyle_put_backgroundPosition(IHTMLStyle *iface, BSTR v)
837 HTMLStyle *This = HTMLSTYLE_THIS(iface);
838 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
839 return E_NOTIMPL;
842 static HRESULT WINAPI HTMLStyle_get_backgroundPosition(IHTMLStyle *iface, BSTR *p)
844 HTMLStyle *This = HTMLSTYLE_THIS(iface);
845 FIXME("(%p)->(%p)\n", This, p);
846 return E_NOTIMPL;
849 static HRESULT WINAPI HTMLStyle_put_backgroundPositionX(IHTMLStyle *iface, VARIANT v)
851 HTMLStyle *This = HTMLSTYLE_THIS(iface);
852 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
853 return E_NOTIMPL;
856 static HRESULT WINAPI HTMLStyle_get_backgroundPositionX(IHTMLStyle *iface, VARIANT *p)
858 HTMLStyle *This = HTMLSTYLE_THIS(iface);
859 FIXME("(%p)->(%p)\n", This, p);
860 return E_NOTIMPL;
863 static HRESULT WINAPI HTMLStyle_put_backgroundPositionY(IHTMLStyle *iface, VARIANT v)
865 HTMLStyle *This = HTMLSTYLE_THIS(iface);
866 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
867 return E_NOTIMPL;
870 static HRESULT WINAPI HTMLStyle_get_backgroundPositionY(IHTMLStyle *iface, VARIANT *p)
872 HTMLStyle *This = HTMLSTYLE_THIS(iface);
873 FIXME("(%p)->(%p)\n", This, p);
874 return E_NOTIMPL;
877 static HRESULT WINAPI HTMLStyle_put_wordSpacing(IHTMLStyle *iface, VARIANT v)
879 HTMLStyle *This = HTMLSTYLE_THIS(iface);
880 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
881 return E_NOTIMPL;
884 static HRESULT WINAPI HTMLStyle_get_wordSpacing(IHTMLStyle *iface, VARIANT *p)
886 HTMLStyle *This = HTMLSTYLE_THIS(iface);
887 FIXME("(%p)->(%p)\n", This, p);
888 return E_NOTIMPL;
891 static HRESULT WINAPI HTMLStyle_put_letterSpacing(IHTMLStyle *iface, VARIANT v)
893 HTMLStyle *This = HTMLSTYLE_THIS(iface);
894 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
895 return E_NOTIMPL;
898 static HRESULT WINAPI HTMLStyle_get_letterSpacing(IHTMLStyle *iface, VARIANT *p)
900 HTMLStyle *This = HTMLSTYLE_THIS(iface);
901 FIXME("(%p)->(%p)\n", This, p);
902 return E_NOTIMPL;
905 static HRESULT WINAPI HTMLStyle_put_textDecoration(IHTMLStyle *iface, BSTR v)
907 HTMLStyle *This = HTMLSTYLE_THIS(iface);
908 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
909 return E_NOTIMPL;
912 static HRESULT WINAPI HTMLStyle_get_textDecoration(IHTMLStyle *iface, BSTR *p)
914 HTMLStyle *This = HTMLSTYLE_THIS(iface);
916 TRACE("(%p)->(%p)\n", This, p);
918 return get_style_attr(This, STYLEID_TEXT_DECORATION, p);
921 static HRESULT WINAPI HTMLStyle_put_textDecorationNone(IHTMLStyle *iface, VARIANT_BOOL v)
923 HTMLStyle *This = HTMLSTYLE_THIS(iface);
924 FIXME("(%p)->(%x)\n", This, v);
925 return E_NOTIMPL;
928 static HRESULT WINAPI HTMLStyle_get_textDecorationNone(IHTMLStyle *iface, VARIANT_BOOL *p)
930 HTMLStyle *This = HTMLSTYLE_THIS(iface);
931 FIXME("(%p)->(%p)\n", This, p);
932 return E_NOTIMPL;
935 static HRESULT WINAPI HTMLStyle_put_textDecorationUnderline(IHTMLStyle *iface, VARIANT_BOOL v)
937 HTMLStyle *This = HTMLSTYLE_THIS(iface);
939 TRACE("(%p)->(%x)\n", This, v);
941 return set_style_attr(This, STYLEID_TEXT_DECORATION, v ? valUnderline : emptyW, 0);
944 static HRESULT WINAPI HTMLStyle_get_textDecorationUnderline(IHTMLStyle *iface, VARIANT_BOOL *p)
946 HTMLStyle *This = HTMLSTYLE_THIS(iface);
948 TRACE("(%p)->(%p)\n", This, p);
950 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, valUnderline, p);
953 static HRESULT WINAPI HTMLStyle_put_textDecorationOverline(IHTMLStyle *iface, VARIANT_BOOL v)
955 HTMLStyle *This = HTMLSTYLE_THIS(iface);
956 FIXME("(%p)->(%x)\n", This, v);
957 return E_NOTIMPL;
960 static HRESULT WINAPI HTMLStyle_get_textDecorationOverline(IHTMLStyle *iface, VARIANT_BOOL *p)
962 HTMLStyle *This = HTMLSTYLE_THIS(iface);
963 FIXME("(%p)->(%p)\n", This, p);
964 return E_NOTIMPL;
967 static HRESULT WINAPI HTMLStyle_put_textDecorationLineThrough(IHTMLStyle *iface, VARIANT_BOOL v)
969 HTMLStyle *This = HTMLSTYLE_THIS(iface);
971 TRACE("(%p)->(%x)\n", This, v);
973 return set_style_attr(This, STYLEID_TEXT_DECORATION, v ? valLineThrough : emptyW, 0);
976 static HRESULT WINAPI HTMLStyle_get_textDecorationLineThrough(IHTMLStyle *iface, VARIANT_BOOL *p)
978 HTMLStyle *This = HTMLSTYLE_THIS(iface);
980 TRACE("(%p)->(%p)\n", This, p);
982 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, valLineThrough, p);
985 static HRESULT WINAPI HTMLStyle_put_textDecorationBlink(IHTMLStyle *iface, VARIANT_BOOL v)
987 HTMLStyle *This = HTMLSTYLE_THIS(iface);
988 FIXME("(%p)->(%x)\n", This, v);
989 return E_NOTIMPL;
992 static HRESULT WINAPI HTMLStyle_get_textDecorationBlink(IHTMLStyle *iface, VARIANT_BOOL *p)
994 HTMLStyle *This = HTMLSTYLE_THIS(iface);
995 FIXME("(%p)->(%p)\n", This, p);
996 return E_NOTIMPL;
999 static HRESULT WINAPI HTMLStyle_put_verticalAlign(IHTMLStyle *iface, VARIANT v)
1001 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1003 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1005 switch(V_VT(&v)) {
1006 case VT_BSTR:
1007 return set_style_attr(This, STYLEID_VERTICAL_ALIGN, V_BSTR(&v), 0);
1008 default:
1009 FIXME("not implemented vt %d\n", V_VT(&v));
1010 return E_NOTIMPL;
1013 return S_OK;
1016 static HRESULT WINAPI HTMLStyle_get_verticalAlign(IHTMLStyle *iface, VARIANT *p)
1018 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1019 BSTR ret;
1020 HRESULT hres;
1022 TRACE("(%p)->(%p)\n", This, p);
1024 hres = get_style_attr(This, STYLEID_VERTICAL_ALIGN, &ret);
1025 if(FAILED(hres))
1026 return hres;
1028 V_VT(p) = VT_BSTR;
1029 V_BSTR(p) = ret;
1030 return S_OK;
1033 static HRESULT WINAPI HTMLStyle_put_textTransform(IHTMLStyle *iface, BSTR v)
1035 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1036 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1037 return E_NOTIMPL;
1040 static HRESULT WINAPI HTMLStyle_get_textTransform(IHTMLStyle *iface, BSTR *p)
1042 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1043 FIXME("(%p)->(%p)\n", This, p);
1044 return E_NOTIMPL;
1047 static HRESULT WINAPI HTMLStyle_put_textAlign(IHTMLStyle *iface, BSTR v)
1049 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1051 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1053 return set_style_attr(This, STYLEID_TEXT_ALIGN, v, 0);
1056 static HRESULT WINAPI HTMLStyle_get_textAlign(IHTMLStyle *iface, BSTR *p)
1058 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1060 TRACE("(%p)->(%p)\n", This, p);
1062 return get_style_attr(This, STYLEID_TEXT_ALIGN, p);
1065 static HRESULT WINAPI HTMLStyle_put_textIndent(IHTMLStyle *iface, VARIANT v)
1067 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1068 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1069 return E_NOTIMPL;
1072 static HRESULT WINAPI HTMLStyle_get_textIndent(IHTMLStyle *iface, VARIANT *p)
1074 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1075 FIXME("(%p)->(%p)\n", This, p);
1076 return E_NOTIMPL;
1079 static HRESULT WINAPI HTMLStyle_put_lineHeight(IHTMLStyle *iface, VARIANT v)
1081 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1082 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1083 return E_NOTIMPL;
1086 static HRESULT WINAPI HTMLStyle_get_lineHeight(IHTMLStyle *iface, VARIANT *p)
1088 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1089 FIXME("(%p)->(%p)\n", This, p);
1090 return E_NOTIMPL;
1093 static HRESULT WINAPI HTMLStyle_put_marginTop(IHTMLStyle *iface, VARIANT v)
1095 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1096 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1097 return E_NOTIMPL;
1100 static HRESULT WINAPI HTMLStyle_get_marginTop(IHTMLStyle *iface, VARIANT *p)
1102 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1103 FIXME("(%p)->(%p)\n", This, p);
1104 return E_NOTIMPL;
1107 static HRESULT WINAPI HTMLStyle_put_marginRight(IHTMLStyle *iface, VARIANT v)
1109 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1111 TRACE("(%p)->(v(%d))\n", This, V_VT(&v));
1113 switch(V_VT(&v)) {
1114 case VT_NULL:
1115 return set_style_attr(This, STYLEID_MARGIN_RIGHT, emptyW, 0);
1116 case VT_I4: {
1117 WCHAR buf[14];
1119 wsprintfW(buf, px_formatW, V_I4(&v));
1120 return set_style_attr(This, STYLEID_MARGIN_RIGHT, buf, 0);
1122 case VT_BSTR:
1123 return set_style_attr(This, STYLEID_MARGIN_RIGHT, V_BSTR(&v), 0);
1124 default:
1125 FIXME("Unsupported vt=%d\n", V_VT(&v));
1128 return E_NOTIMPL;
1131 static HRESULT WINAPI HTMLStyle_get_marginRight(IHTMLStyle *iface, VARIANT *p)
1133 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1134 TRACE("(%p)->(%p)\n", This, p);
1135 return get_nsstyle_attr_var(This->nsstyle, STYLEID_MARGIN_RIGHT, p, 0);
1138 static HRESULT WINAPI HTMLStyle_put_marginBottom(IHTMLStyle *iface, VARIANT v)
1140 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1141 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1142 return E_NOTIMPL;
1145 static HRESULT WINAPI HTMLStyle_get_marginBottom(IHTMLStyle *iface, VARIANT *p)
1147 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1148 FIXME("(%p)->(%p)\n", This, p);
1149 return E_NOTIMPL;
1152 static HRESULT WINAPI HTMLStyle_put_marginLeft(IHTMLStyle *iface, VARIANT v)
1154 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1156 switch(V_VT(&v)) {
1157 case VT_NULL:
1158 TRACE("(%p)->(NULL)\n", This);
1159 return set_style_attr(This, STYLEID_MARGIN_LEFT, emptyW, 0);
1160 case VT_I4: {
1161 WCHAR buf[14];
1163 TRACE("(%p)->(%d)\n", This, V_I4(&v));
1165 wsprintfW(buf, px_formatW, V_I4(&v));
1166 return set_style_attr(This, STYLEID_MARGIN_LEFT, buf, 0);
1168 case VT_BSTR:
1169 TRACE("(%p)->(%s)\n", This, debugstr_w(V_BSTR(&v)));
1170 return set_style_attr(This, STYLEID_MARGIN_LEFT, V_BSTR(&v), 0);
1171 default:
1172 FIXME("Unsupported vt=%d\n", V_VT(&v));
1175 return E_NOTIMPL;
1178 static HRESULT WINAPI HTMLStyle_put_margin(IHTMLStyle *iface, BSTR v)
1180 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1182 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1184 return set_style_attr(This, STYLEID_MARGIN, v, 0);
1187 static HRESULT WINAPI HTMLStyle_get_margin(IHTMLStyle *iface, BSTR *p)
1189 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1191 TRACE("(%p)->(%p)\n", This, p);
1193 return get_style_attr(This, STYLEID_MARGIN, p);
1196 static HRESULT WINAPI HTMLStyle_get_marginLeft(IHTMLStyle *iface, VARIANT *p)
1198 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1199 FIXME("(%p)->(%p)\n", This, p);
1200 return E_NOTIMPL;
1203 static HRESULT WINAPI HTMLStyle_put_paddingTop(IHTMLStyle *iface, VARIANT v)
1205 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1206 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1207 return E_NOTIMPL;
1210 static HRESULT WINAPI HTMLStyle_get_paddingTop(IHTMLStyle *iface, VARIANT *p)
1212 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1213 FIXME("(%p)->(%p)\n", This, p);
1214 return E_NOTIMPL;
1217 static HRESULT WINAPI HTMLStyle_put_paddingRight(IHTMLStyle *iface, VARIANT v)
1219 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1220 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1221 return E_NOTIMPL;
1224 static HRESULT WINAPI HTMLStyle_get_paddingRight(IHTMLStyle *iface, VARIANT *p)
1226 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1227 FIXME("(%p)->(%p)\n", This, p);
1228 return E_NOTIMPL;
1231 static HRESULT WINAPI HTMLStyle_put_paddingBottom(IHTMLStyle *iface, VARIANT v)
1233 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1234 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1235 return E_NOTIMPL;
1238 static HRESULT WINAPI HTMLStyle_get_paddingBottom(IHTMLStyle *iface, VARIANT *p)
1240 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1241 FIXME("(%p)->(%p)\n", This, p);
1242 return E_NOTIMPL;
1245 static HRESULT WINAPI HTMLStyle_put_paddingLeft(IHTMLStyle *iface, VARIANT v)
1247 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1249 TRACE("(%p)->(vt=%d)\n", This, V_VT(&v));
1251 switch(V_VT(&v)) {
1252 case VT_I4: {
1253 WCHAR buf[14];
1255 wsprintfW(buf, px_formatW, V_I4(&v));
1256 return set_style_attr(This, STYLEID_PADDING_LEFT, buf, 0);
1258 case VT_BSTR:
1259 return set_style_attr(This, STYLEID_PADDING_LEFT, V_BSTR(&v), 0);
1260 default:
1261 FIXME("unsupported vt=%d\n", V_VT(&v));
1264 return E_NOTIMPL;
1267 static HRESULT WINAPI HTMLStyle_get_paddingLeft(IHTMLStyle *iface, VARIANT *p)
1269 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1270 BSTR ret;
1271 HRESULT hres;
1273 TRACE("(%p)->(%p)\n", This, p);
1275 hres = get_style_attr(This, STYLEID_PADDING_LEFT, &ret);
1276 if(FAILED(hres))
1277 return hres;
1279 V_VT(p) = VT_BSTR;
1280 V_BSTR(p) = ret;
1281 return S_OK;
1284 static HRESULT WINAPI HTMLStyle_put_padding(IHTMLStyle *iface, BSTR v)
1286 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1287 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1288 return E_NOTIMPL;
1291 static HRESULT WINAPI HTMLStyle_get_padding(IHTMLStyle *iface, BSTR *p)
1293 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1294 FIXME("(%p)->(%p)\n", This, p);
1295 return E_NOTIMPL;
1298 static HRESULT WINAPI HTMLStyle_put_border(IHTMLStyle *iface, BSTR v)
1300 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1302 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1304 return set_style_attr(This, STYLEID_BORDER, v, 0);
1307 static HRESULT WINAPI HTMLStyle_get_border(IHTMLStyle *iface, BSTR *p)
1309 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1311 TRACE("(%p)->(%p)\n", This, p);
1313 return get_style_attr(This, STYLEID_BORDER, p);
1316 static HRESULT WINAPI HTMLStyle_put_borderTop(IHTMLStyle *iface, BSTR v)
1318 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1319 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1320 return E_NOTIMPL;
1323 static HRESULT WINAPI HTMLStyle_get_borderTop(IHTMLStyle *iface, BSTR *p)
1325 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1326 FIXME("(%p)->(%p)\n", This, p);
1327 return E_NOTIMPL;
1330 static HRESULT WINAPI HTMLStyle_put_borderRight(IHTMLStyle *iface, BSTR v)
1332 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1333 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1334 return E_NOTIMPL;
1337 static HRESULT WINAPI HTMLStyle_get_borderRight(IHTMLStyle *iface, BSTR *p)
1339 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1340 FIXME("(%p)->(%p)\n", This, p);
1341 return E_NOTIMPL;
1344 static HRESULT WINAPI HTMLStyle_put_borderBottom(IHTMLStyle *iface, BSTR v)
1346 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1347 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1348 return E_NOTIMPL;
1351 static HRESULT WINAPI HTMLStyle_get_borderBottom(IHTMLStyle *iface, BSTR *p)
1353 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1354 FIXME("(%p)->(%p)\n", This, p);
1355 return E_NOTIMPL;
1358 static HRESULT WINAPI HTMLStyle_put_borderLeft(IHTMLStyle *iface, BSTR v)
1360 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1362 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1364 return set_style_attr(This, STYLEID_BORDER_LEFT, v, ATTR_FIX_PX);
1367 static HRESULT WINAPI HTMLStyle_get_borderLeft(IHTMLStyle *iface, BSTR *p)
1369 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1370 FIXME("(%p)->(%p)\n", This, p);
1371 return E_NOTIMPL;
1374 static HRESULT WINAPI HTMLStyle_put_borderColor(IHTMLStyle *iface, BSTR v)
1376 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1377 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1378 return E_NOTIMPL;
1381 static HRESULT WINAPI HTMLStyle_get_borderColor(IHTMLStyle *iface, BSTR *p)
1383 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1384 FIXME("(%p)->(%p)\n", This, p);
1385 return E_NOTIMPL;
1388 static HRESULT WINAPI HTMLStyle_put_borderTopColor(IHTMLStyle *iface, VARIANT v)
1390 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1391 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1392 return E_NOTIMPL;
1395 static HRESULT WINAPI HTMLStyle_get_borderTopColor(IHTMLStyle *iface, VARIANT *p)
1397 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1398 FIXME("(%p)->(%p)\n", This, p);
1399 return E_NOTIMPL;
1402 static HRESULT WINAPI HTMLStyle_put_borderRightColor(IHTMLStyle *iface, VARIANT v)
1404 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1405 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1406 return E_NOTIMPL;
1409 static HRESULT WINAPI HTMLStyle_get_borderRightColor(IHTMLStyle *iface, VARIANT *p)
1411 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1412 FIXME("(%p)->(%p)\n", This, p);
1413 return E_NOTIMPL;
1416 static HRESULT WINAPI HTMLStyle_put_borderBottomColor(IHTMLStyle *iface, VARIANT v)
1418 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1419 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1420 return E_NOTIMPL;
1423 static HRESULT WINAPI HTMLStyle_get_borderBottomColor(IHTMLStyle *iface, VARIANT *p)
1425 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1426 FIXME("(%p)->(%p)\n", This, p);
1427 return E_NOTIMPL;
1430 static HRESULT WINAPI HTMLStyle_put_borderLeftColor(IHTMLStyle *iface, VARIANT v)
1432 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1433 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1434 return E_NOTIMPL;
1437 static HRESULT WINAPI HTMLStyle_get_borderLeftColor(IHTMLStyle *iface, VARIANT *p)
1439 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1440 FIXME("(%p)->(%p)\n", This, p);
1441 return E_NOTIMPL;
1444 static HRESULT WINAPI HTMLStyle_put_borderWidth(IHTMLStyle *iface, BSTR v)
1446 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1447 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1448 return set_style_attr(This, STYLEID_BORDER_WIDTH, v, ATTR_FIX_PX);
1451 static HRESULT WINAPI HTMLStyle_get_borderWidth(IHTMLStyle *iface, BSTR *p)
1453 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1454 TRACE("(%p)->(%p)\n", This, p);
1455 return get_style_attr(This, STYLEID_BORDER_WIDTH, p);
1458 static HRESULT WINAPI HTMLStyle_put_borderTopWidth(IHTMLStyle *iface, VARIANT v)
1460 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1461 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1462 return E_NOTIMPL;
1465 static HRESULT WINAPI HTMLStyle_get_borderTopWidth(IHTMLStyle *iface, VARIANT *p)
1467 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1468 FIXME("(%p)->(%p)\n", This, p);
1469 return E_NOTIMPL;
1472 static HRESULT WINAPI HTMLStyle_put_borderRightWidth(IHTMLStyle *iface, VARIANT v)
1474 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1475 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1476 return E_NOTIMPL;
1479 static HRESULT WINAPI HTMLStyle_get_borderRightWidth(IHTMLStyle *iface, VARIANT *p)
1481 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1482 FIXME("(%p)->(%p)\n", This, p);
1483 return E_NOTIMPL;
1486 static HRESULT WINAPI HTMLStyle_put_borderBottomWidth(IHTMLStyle *iface, VARIANT v)
1488 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1489 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1490 return E_NOTIMPL;
1493 static HRESULT WINAPI HTMLStyle_get_borderBottomWidth(IHTMLStyle *iface, VARIANT *p)
1495 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1496 FIXME("(%p)->(%p)\n", This, p);
1497 return E_NOTIMPL;
1500 static HRESULT WINAPI HTMLStyle_put_borderLeftWidth(IHTMLStyle *iface, VARIANT v)
1502 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1503 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1504 return E_NOTIMPL;
1507 static HRESULT WINAPI HTMLStyle_get_borderLeftWidth(IHTMLStyle *iface, VARIANT *p)
1509 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1510 FIXME("(%p)->(%p)\n", This, p);
1511 return E_NOTIMPL;
1514 static HRESULT WINAPI HTMLStyle_put_borderStyle(IHTMLStyle *iface, BSTR v)
1516 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1517 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1518 return E_NOTIMPL;
1521 static HRESULT WINAPI HTMLStyle_get_borderStyle(IHTMLStyle *iface, BSTR *p)
1523 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1524 FIXME("(%p)->(%p)\n", This, p);
1525 return E_NOTIMPL;
1528 static HRESULT WINAPI HTMLStyle_put_borderTopStyle(IHTMLStyle *iface, BSTR v)
1530 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1531 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1533 if(!is_valid_border_style(v))
1534 return E_INVALIDARG;
1536 return set_style_attr(This, STYLEID_BORDER_TOP_STYLE, v, 0);
1539 static HRESULT WINAPI HTMLStyle_get_borderTopStyle(IHTMLStyle *iface, BSTR *p)
1541 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1542 TRACE("(%p)->(%p)\n", This, p);
1543 return get_style_attr(This, STYLEID_BORDER_TOP_STYLE, p);
1546 static HRESULT WINAPI HTMLStyle_put_borderRightStyle(IHTMLStyle *iface, BSTR v)
1548 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1549 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1551 if(!is_valid_border_style(v))
1552 return E_INVALIDARG;
1554 return set_style_attr(This, STYLEID_BORDER_RIGHT_STYLE, v, 0);
1557 static HRESULT WINAPI HTMLStyle_get_borderRightStyle(IHTMLStyle *iface, BSTR *p)
1559 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1560 TRACE("(%p)->(%p)\n", This, p);
1561 return get_style_attr(This, STYLEID_BORDER_RIGHT_STYLE, p);
1564 static HRESULT WINAPI HTMLStyle_put_borderBottomStyle(IHTMLStyle *iface, BSTR v)
1566 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1567 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1569 if(!is_valid_border_style(v))
1570 return E_INVALIDARG;
1572 return set_style_attr(This, STYLEID_BORDER_BOTTOM_STYLE, v, 0);
1575 static HRESULT WINAPI HTMLStyle_get_borderBottomStyle(IHTMLStyle *iface, BSTR *p)
1577 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1578 TRACE("(%p)->(%p)\n", This, p);
1579 return get_style_attr(This, STYLEID_BORDER_BOTTOM_STYLE, p);
1582 static HRESULT WINAPI HTMLStyle_put_borderLeftStyle(IHTMLStyle *iface, BSTR v)
1584 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1585 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1587 if(!is_valid_border_style(v))
1588 return E_INVALIDARG;
1590 return set_style_attr(This, STYLEID_BORDER_LEFT_STYLE, v, 0);
1593 static HRESULT WINAPI HTMLStyle_get_borderLeftStyle(IHTMLStyle *iface, BSTR *p)
1595 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1596 TRACE("(%p)->(%p)\n", This, p);
1597 return get_style_attr(This, STYLEID_BORDER_LEFT_STYLE, p);
1600 static HRESULT WINAPI HTMLStyle_put_width(IHTMLStyle *iface, VARIANT v)
1602 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1604 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
1606 switch(V_VT(&v)) {
1607 case VT_BSTR:
1608 TRACE("%s\n", debugstr_w(V_BSTR(&v)));
1609 return set_style_attr(This, STYLEID_WIDTH, V_BSTR(&v), 0);
1610 default:
1611 FIXME("unsupported vt %d\n", V_VT(&v));
1614 return E_NOTIMPL;
1617 static HRESULT WINAPI HTMLStyle_get_width(IHTMLStyle *iface, VARIANT *p)
1619 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1621 TRACE("(%p)->(%p)\n", This, p);
1623 V_VT(p) = VT_BSTR;
1624 return get_style_attr(This, STYLEID_WIDTH, &V_BSTR(p));
1627 static HRESULT WINAPI HTMLStyle_put_height(IHTMLStyle *iface, VARIANT v)
1629 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1631 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1633 switch(V_VT(&v)) {
1634 case VT_BSTR:
1635 return set_style_attr(This, STYLEID_HEIGHT, V_BSTR(&v), 0);
1636 default:
1637 FIXME("unimplemented vt %d\n", V_VT(&v));
1638 return E_NOTIMPL;
1641 return S_OK;
1644 static HRESULT WINAPI HTMLStyle_get_height(IHTMLStyle *iface, VARIANT *p)
1646 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1647 BSTR ret;
1648 HRESULT hres;
1650 TRACE("(%p)->(%p)\n", This, p);
1652 hres = get_style_attr(This, STYLEID_HEIGHT, &ret);
1653 if(FAILED(hres))
1654 return hres;
1656 V_VT(p) = VT_BSTR;
1657 V_BSTR(p) = ret;
1658 return S_OK;
1661 static HRESULT WINAPI HTMLStyle_put_styleFloat(IHTMLStyle *iface, BSTR v)
1663 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1664 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1665 return E_NOTIMPL;
1668 static HRESULT WINAPI HTMLStyle_get_styleFloat(IHTMLStyle *iface, BSTR *p)
1670 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1671 FIXME("(%p)->(%p)\n", This, p);
1672 return E_NOTIMPL;
1675 static HRESULT WINAPI HTMLStyle_put_clear(IHTMLStyle *iface, BSTR v)
1677 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1678 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1679 return E_NOTIMPL;
1682 static HRESULT WINAPI HTMLStyle_get_clear(IHTMLStyle *iface, BSTR *p)
1684 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1685 FIXME("(%p)->(%p)\n", This, p);
1686 return E_NOTIMPL;
1689 static HRESULT WINAPI HTMLStyle_put_display(IHTMLStyle *iface, BSTR v)
1691 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1693 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1695 return set_style_attr(This, STYLEID_DISPLAY, v, 0);
1698 static HRESULT WINAPI HTMLStyle_get_display(IHTMLStyle *iface, BSTR *p)
1700 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1702 TRACE("(%p)->(%p)\n", This, p);
1704 return get_style_attr(This, STYLEID_DISPLAY, p);
1707 static HRESULT WINAPI HTMLStyle_put_visibility(IHTMLStyle *iface, BSTR v)
1709 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1711 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1713 return set_style_attr(This, STYLEID_VISIBILITY, v, 0);
1716 static HRESULT WINAPI HTMLStyle_get_visibility(IHTMLStyle *iface, BSTR *p)
1718 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1720 TRACE("(%p)->(%p)\n", This, p);
1722 return get_style_attr(This, STYLEID_VISIBILITY, p);
1725 static HRESULT WINAPI HTMLStyle_put_listStyleType(IHTMLStyle *iface, BSTR v)
1727 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1728 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1729 return E_NOTIMPL;
1732 static HRESULT WINAPI HTMLStyle_get_listStyleType(IHTMLStyle *iface, BSTR *p)
1734 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1735 FIXME("(%p)->(%p)\n", This, p);
1736 return E_NOTIMPL;
1739 static HRESULT WINAPI HTMLStyle_put_listStylePosition(IHTMLStyle *iface, BSTR v)
1741 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1742 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1743 return E_NOTIMPL;
1746 static HRESULT WINAPI HTMLStyle_get_listStylePosition(IHTMLStyle *iface, BSTR *p)
1748 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1749 FIXME("(%p)->(%p)\n", This, p);
1750 return E_NOTIMPL;
1753 static HRESULT WINAPI HTMLStyle_put_listStyleImage(IHTMLStyle *iface, BSTR v)
1755 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1756 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1757 return E_NOTIMPL;
1760 static HRESULT WINAPI HTMLStyle_get_listStyleImage(IHTMLStyle *iface, BSTR *p)
1762 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1763 FIXME("(%p)->(%p)\n", This, p);
1764 return E_NOTIMPL;
1767 static HRESULT WINAPI HTMLStyle_put_listStyle(IHTMLStyle *iface, BSTR v)
1769 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1770 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1771 return E_NOTIMPL;
1774 static HRESULT WINAPI HTMLStyle_get_listStyle(IHTMLStyle *iface, BSTR *p)
1776 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1777 FIXME("(%p)->(%p)\n", This, p);
1778 return E_NOTIMPL;
1781 static HRESULT WINAPI HTMLStyle_put_whiteSpace(IHTMLStyle *iface, BSTR v)
1783 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1784 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1785 return E_NOTIMPL;
1788 static HRESULT WINAPI HTMLStyle_get_whiteSpace(IHTMLStyle *iface, BSTR *p)
1790 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1791 FIXME("(%p)->(%p)\n", This, p);
1792 return E_NOTIMPL;
1795 static HRESULT WINAPI HTMLStyle_put_top(IHTMLStyle *iface, VARIANT v)
1797 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1799 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1801 return set_nsstyle_attr_var(This->nsstyle, STYLEID_TOP, &v, 0);
1804 static HRESULT WINAPI HTMLStyle_get_top(IHTMLStyle *iface, VARIANT *p)
1806 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1807 BSTR ret;
1808 HRESULT hres;
1810 TRACE("(%p)->(%p)\n", This, p);
1812 hres = get_style_attr(This, STYLEID_TOP, &ret);
1813 if(FAILED(hres))
1814 return hres;
1816 V_VT(p) = VT_BSTR;
1817 V_BSTR(p) = ret;
1818 return S_OK;
1821 static HRESULT WINAPI HTMLStyle_put_left(IHTMLStyle *iface, VARIANT v)
1823 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1825 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1827 return set_nsstyle_attr_var(This->nsstyle, STYLEID_LEFT, &v, 0);
1830 static HRESULT WINAPI HTMLStyle_get_left(IHTMLStyle *iface, VARIANT *p)
1832 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1833 BSTR ret;
1834 HRESULT hres;
1836 TRACE("(%p)->(%p)\n", This, p);
1838 hres = get_style_attr(This, STYLEID_LEFT, &ret);
1839 if(FAILED(hres))
1840 return hres;
1842 V_VT(p) = VT_BSTR;
1843 V_BSTR(p) = ret;
1844 return S_OK;
1847 static HRESULT WINAPI HTMLStyle_get_position(IHTMLStyle *iface, BSTR *p)
1849 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1850 TRACE("(%p)->(%p)\n", This, p);
1851 return IHTMLStyle2_get_position(HTMLSTYLE2(This), p);
1854 static HRESULT WINAPI HTMLStyle_put_zIndex(IHTMLStyle *iface, VARIANT v)
1856 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1858 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1860 switch(V_VT(&v)) {
1861 case VT_BSTR:
1862 return set_style_attr(This, STYLEID_Z_INDEX, V_BSTR(&v), 0);
1863 case VT_I4: {
1864 WCHAR value[14];
1865 static const WCHAR format[] = {'%','d',0};
1867 wsprintfW(value, format, V_I4(&v));
1868 return set_style_attr(This, STYLEID_Z_INDEX, value, 0);
1870 default:
1871 FIXME("unimplemented vt %d\n", V_VT(&v));
1872 return E_NOTIMPL;
1875 return S_OK;
1878 static HRESULT WINAPI HTMLStyle_get_zIndex(IHTMLStyle *iface, VARIANT *p)
1880 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1882 TRACE("(%p)->(%p)\n", This, p);
1884 return get_nsstyle_attr_var(This->nsstyle, STYLEID_Z_INDEX, p, ATTR_STR_TO_INT);
1887 static HRESULT WINAPI HTMLStyle_put_overflow(IHTMLStyle *iface, BSTR v)
1889 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1890 static const WCHAR szVisible[] = {'v','i','s','i','b','l','e',0};
1891 static const WCHAR szScroll[] = {'s','c','r','o','l','l',0};
1892 static const WCHAR szHidden[] = {'h','i','d','d','e','n',0};
1893 static const WCHAR szAuto[] = {'a','u','t','o',0};
1895 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1897 /* overflow can only be one of the follow values. */
1898 if(!v || strcmpiW(szVisible, v) == 0 || strcmpiW(szScroll, v) == 0 ||
1899 strcmpiW(szHidden, v) == 0 || strcmpiW(szAuto, v) == 0)
1901 return set_nsstyle_attr(This->nsstyle, STYLEID_OVERFLOW, v, 0);
1904 return E_INVALIDARG;
1908 static HRESULT WINAPI HTMLStyle_get_overflow(IHTMLStyle *iface, BSTR *p)
1910 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1912 TRACE("(%p)->(%p)\n", This, p);
1914 if(!p)
1915 return E_INVALIDARG;
1917 return get_style_attr(This, STYLEID_OVERFLOW, p);
1920 static HRESULT WINAPI HTMLStyle_put_pageBreakBefore(IHTMLStyle *iface, BSTR v)
1922 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1923 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1924 return E_NOTIMPL;
1927 static HRESULT WINAPI HTMLStyle_get_pageBreakBefore(IHTMLStyle *iface, BSTR *p)
1929 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1930 FIXME("(%p)->(%p)\n", This, p);
1931 return E_NOTIMPL;
1934 static HRESULT WINAPI HTMLStyle_put_pageBreakAfter(IHTMLStyle *iface, BSTR v)
1936 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1937 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1938 return E_NOTIMPL;
1941 static HRESULT WINAPI HTMLStyle_get_pageBreakAfter(IHTMLStyle *iface, BSTR *p)
1943 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1944 FIXME("(%p)->(%p)\n", This, p);
1945 return E_NOTIMPL;
1948 static HRESULT WINAPI HTMLStyle_put_cssText(IHTMLStyle *iface, BSTR v)
1950 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1951 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1952 return E_NOTIMPL;
1955 static HRESULT WINAPI HTMLStyle_get_cssText(IHTMLStyle *iface, BSTR *p)
1957 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1958 FIXME("(%p)->(%p)\n", This, p);
1959 return E_NOTIMPL;
1962 static HRESULT WINAPI HTMLStyle_put_pixelTop(IHTMLStyle *iface, long v)
1964 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1965 FIXME("(%p)->()\n", This);
1966 return E_NOTIMPL;
1969 static HRESULT WINAPI HTMLStyle_get_pixelTop(IHTMLStyle *iface, long *p)
1971 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1972 FIXME("(%p)->()\n", This);
1973 return E_NOTIMPL;
1976 static HRESULT WINAPI HTMLStyle_put_pixelLeft(IHTMLStyle *iface, long v)
1978 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1979 FIXME("(%p)->()\n", This);
1980 return E_NOTIMPL;
1983 static HRESULT WINAPI HTMLStyle_get_pixelLeft(IHTMLStyle *iface, long *p)
1985 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1986 FIXME("(%p)->()\n", This);
1987 return E_NOTIMPL;
1990 static HRESULT WINAPI HTMLStyle_put_pixelWidth(IHTMLStyle *iface, long v)
1992 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1993 FIXME("(%p)->()\n", This);
1994 return E_NOTIMPL;
1997 static HRESULT WINAPI HTMLStyle_get_pixelWidth(IHTMLStyle *iface, long *p)
1999 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2000 FIXME("(%p)->()\n", This);
2001 return E_NOTIMPL;
2004 static HRESULT WINAPI HTMLStyle_put_pixelHeight(IHTMLStyle *iface, long v)
2006 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2007 FIXME("(%p)->()\n", This);
2008 return E_NOTIMPL;
2011 static HRESULT WINAPI HTMLStyle_get_pixelHeight(IHTMLStyle *iface, long *p)
2013 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2014 FIXME("(%p)->()\n", This);
2015 return E_NOTIMPL;
2018 static HRESULT WINAPI HTMLStyle_put_posTop(IHTMLStyle *iface, float v)
2020 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2022 TRACE("(%p)->(%f)\n", This, v);
2024 return set_style_pos(This, STYLEID_TOP, v);
2027 static HRESULT WINAPI HTMLStyle_get_posTop(IHTMLStyle *iface, float *p)
2029 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2031 TRACE("(%p)->(%p)\n", This, p);
2033 if(!p)
2034 return E_POINTER;
2036 return get_nsstyle_pos(This, STYLEID_TOP, p);
2039 static HRESULT WINAPI HTMLStyle_put_posLeft(IHTMLStyle *iface, float v)
2041 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2043 TRACE("(%p)->(%f)\n", This, v);
2045 return set_style_pos(This, STYLEID_LEFT, v);
2048 static HRESULT WINAPI HTMLStyle_get_posLeft(IHTMLStyle *iface, float *p)
2050 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2052 TRACE("(%p)->(%p)\n", This, p);
2054 if(!p)
2055 return E_POINTER;
2057 return get_nsstyle_pos(This, STYLEID_LEFT, p);
2060 static HRESULT WINAPI HTMLStyle_put_posWidth(IHTMLStyle *iface, float v)
2062 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2064 TRACE("(%p)->(%f)\n", This, v);
2066 return set_style_pos(This, STYLEID_WIDTH, v);
2069 static HRESULT WINAPI HTMLStyle_get_posWidth(IHTMLStyle *iface, float *p)
2071 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2073 TRACE("(%p)->(%p)\n", This, p);
2075 if(!p)
2076 return E_POINTER;
2078 if(get_nsstyle_pos(This, STYLEID_WIDTH, p) != S_OK)
2079 *p = 0.0f;
2081 return S_OK;
2084 static HRESULT WINAPI HTMLStyle_put_posHeight(IHTMLStyle *iface, float v)
2086 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2088 TRACE("(%p)->(%f)\n", This, v);
2090 return set_style_pos(This, STYLEID_HEIGHT, v);
2093 static HRESULT WINAPI HTMLStyle_get_posHeight(IHTMLStyle *iface, float *p)
2095 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2097 TRACE("(%p)->(%p)\n", This, p);
2099 if(!p)
2100 return E_POINTER;
2102 if(get_nsstyle_pos(This, STYLEID_HEIGHT, p) != S_OK)
2103 *p = 0.0f;
2105 return S_OK;
2108 static HRESULT WINAPI HTMLStyle_put_cursor(IHTMLStyle *iface, BSTR v)
2110 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2112 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2114 return set_style_attr(This, STYLEID_CURSOR, v, 0);
2117 static HRESULT WINAPI HTMLStyle_get_cursor(IHTMLStyle *iface, BSTR *p)
2119 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2121 TRACE("(%p)->(%p)\n", This, p);
2123 return get_style_attr(This, STYLEID_CURSOR, p);
2126 static HRESULT WINAPI HTMLStyle_put_clip(IHTMLStyle *iface, BSTR v)
2128 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2129 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
2130 return E_NOTIMPL;
2133 static HRESULT WINAPI HTMLStyle_get_clip(IHTMLStyle *iface, BSTR *p)
2135 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2136 FIXME("(%p)->(%p)\n", This, p);
2137 return E_NOTIMPL;
2140 static HRESULT WINAPI HTMLStyle_put_filter(IHTMLStyle *iface, BSTR v)
2142 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2144 WARN("(%p)->(%s)\n", This, debugstr_w(v));
2146 /* FIXME: Handle MS-style filters */
2147 return set_style_attr(This, STYLEID_FILTER, v, 0);
2150 static HRESULT WINAPI HTMLStyle_get_filter(IHTMLStyle *iface, BSTR *p)
2152 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2154 WARN("(%p)->(%p)\n", This, p);
2156 /* FIXME: Handle MS-style filters */
2157 return get_style_attr(This, STYLEID_FILTER, p);
2160 static HRESULT WINAPI HTMLStyle_setAttribute(IHTMLStyle *iface, BSTR strAttributeName,
2161 VARIANT AttributeValue, LONG lFlags)
2163 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2164 HRESULT hres;
2165 DISPID dispid;
2167 TRACE("(%p)->(%s v%d %08x)\n", This, debugstr_w(strAttributeName),
2168 V_VT(&AttributeValue), lFlags);
2170 if(!strAttributeName)
2171 return E_INVALIDARG;
2173 if(lFlags == 1)
2174 FIXME("Parameter lFlags ignored\n");
2176 hres = HTMLStyle_GetIDsOfNames(iface, &IID_NULL, &strAttributeName, 1,
2177 LOCALE_USER_DEFAULT, &dispid);
2178 if(hres == S_OK)
2180 VARIANT ret;
2181 DISPID dispidNamed = DISPID_PROPERTYPUT;
2182 DISPPARAMS params;
2184 params.cArgs = 1;
2185 params.rgvarg = &AttributeValue;
2186 params.cNamedArgs = 1;
2187 params.rgdispidNamedArgs = &dispidNamed;
2189 hres = HTMLStyle_Invoke(iface, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
2190 DISPATCH_PROPERTYPUT, &params, &ret, NULL, NULL);
2192 else
2194 FIXME("Custom attributes not supported.\n");
2197 TRACE("ret: %08x\n", hres);
2199 return hres;
2202 static HRESULT WINAPI HTMLStyle_getAttribute(IHTMLStyle *iface, BSTR strAttributeName,
2203 LONG lFlags, VARIANT *AttributeValue)
2205 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2206 HRESULT hres;
2207 DISPID dispid;
2209 TRACE("(%p)->(%s v%p %08x)\n", This, debugstr_w(strAttributeName),
2210 AttributeValue, lFlags);
2212 if(!AttributeValue || !strAttributeName)
2213 return E_INVALIDARG;
2215 if(lFlags == 1)
2216 FIXME("Parameter lFlags ignored\n");
2218 hres = HTMLStyle_GetIDsOfNames(iface, &IID_NULL, &strAttributeName, 1,
2219 LOCALE_USER_DEFAULT, &dispid);
2220 if(hres == S_OK)
2222 DISPPARAMS params = {NULL, NULL, 0, 0 };
2224 hres = HTMLStyle_Invoke(iface, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
2225 DISPATCH_PROPERTYGET, &params, AttributeValue, NULL, NULL);
2227 else
2229 FIXME("Custom attributes not supported.\n");
2232 return hres;
2235 static HRESULT WINAPI HTMLStyle_removeAttribute(IHTMLStyle *iface, BSTR strAttributeName,
2236 LONG lFlags, VARIANT_BOOL *pfSuccess)
2238 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2239 FIXME("(%p)->(%s %08x %p)\n", This, debugstr_w(strAttributeName),
2240 lFlags, pfSuccess);
2241 return E_NOTIMPL;
2244 static HRESULT WINAPI HTMLStyle_toString(IHTMLStyle *iface, BSTR *String)
2246 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2247 FIXME("(%p)->(%p)\n", This, String);
2248 return E_NOTIMPL;
2251 static HRESULT HTMLStyle_get_dispid(IUnknown *iface, BSTR name, DWORD flags, DISPID *dispid)
2253 int c, i, min=0, max = sizeof(style_tbl)/sizeof(*style_tbl)-1;
2255 while(min <= max) {
2256 i = (min+max)/2;
2258 c = strcmpW(style_tbl[i].name, name);
2259 if(!c) {
2260 *dispid = style_tbl[i].dispid;
2261 return S_OK;
2264 if(c > 0)
2265 max = i-1;
2266 else
2267 min = i+1;
2270 return DISP_E_UNKNOWNNAME;
2273 static const IHTMLStyleVtbl HTMLStyleVtbl = {
2274 HTMLStyle_QueryInterface,
2275 HTMLStyle_AddRef,
2276 HTMLStyle_Release,
2277 HTMLStyle_GetTypeInfoCount,
2278 HTMLStyle_GetTypeInfo,
2279 HTMLStyle_GetIDsOfNames,
2280 HTMLStyle_Invoke,
2281 HTMLStyle_put_fontFamily,
2282 HTMLStyle_get_fontFamily,
2283 HTMLStyle_put_fontStyle,
2284 HTMLStyle_get_fontStyle,
2285 HTMLStyle_put_fontVariant,
2286 HTMLStyle_get_fontVariant,
2287 HTMLStyle_put_fontWeight,
2288 HTMLStyle_get_fontWeight,
2289 HTMLStyle_put_fontSize,
2290 HTMLStyle_get_fontSize,
2291 HTMLStyle_put_font,
2292 HTMLStyle_get_font,
2293 HTMLStyle_put_color,
2294 HTMLStyle_get_color,
2295 HTMLStyle_put_background,
2296 HTMLStyle_get_background,
2297 HTMLStyle_put_backgroundColor,
2298 HTMLStyle_get_backgroundColor,
2299 HTMLStyle_put_backgroundImage,
2300 HTMLStyle_get_backgroundImage,
2301 HTMLStyle_put_backgroundRepeat,
2302 HTMLStyle_get_backgroundRepeat,
2303 HTMLStyle_put_backgroundAttachment,
2304 HTMLStyle_get_backgroundAttachment,
2305 HTMLStyle_put_backgroundPosition,
2306 HTMLStyle_get_backgroundPosition,
2307 HTMLStyle_put_backgroundPositionX,
2308 HTMLStyle_get_backgroundPositionX,
2309 HTMLStyle_put_backgroundPositionY,
2310 HTMLStyle_get_backgroundPositionY,
2311 HTMLStyle_put_wordSpacing,
2312 HTMLStyle_get_wordSpacing,
2313 HTMLStyle_put_letterSpacing,
2314 HTMLStyle_get_letterSpacing,
2315 HTMLStyle_put_textDecoration,
2316 HTMLStyle_get_textDecoration,
2317 HTMLStyle_put_textDecorationNone,
2318 HTMLStyle_get_textDecorationNone,
2319 HTMLStyle_put_textDecorationUnderline,
2320 HTMLStyle_get_textDecorationUnderline,
2321 HTMLStyle_put_textDecorationOverline,
2322 HTMLStyle_get_textDecorationOverline,
2323 HTMLStyle_put_textDecorationLineThrough,
2324 HTMLStyle_get_textDecorationLineThrough,
2325 HTMLStyle_put_textDecorationBlink,
2326 HTMLStyle_get_textDecorationBlink,
2327 HTMLStyle_put_verticalAlign,
2328 HTMLStyle_get_verticalAlign,
2329 HTMLStyle_put_textTransform,
2330 HTMLStyle_get_textTransform,
2331 HTMLStyle_put_textAlign,
2332 HTMLStyle_get_textAlign,
2333 HTMLStyle_put_textIndent,
2334 HTMLStyle_get_textIndent,
2335 HTMLStyle_put_lineHeight,
2336 HTMLStyle_get_lineHeight,
2337 HTMLStyle_put_marginTop,
2338 HTMLStyle_get_marginTop,
2339 HTMLStyle_put_marginRight,
2340 HTMLStyle_get_marginRight,
2341 HTMLStyle_put_marginBottom,
2342 HTMLStyle_get_marginBottom,
2343 HTMLStyle_put_marginLeft,
2344 HTMLStyle_get_marginLeft,
2345 HTMLStyle_put_margin,
2346 HTMLStyle_get_margin,
2347 HTMLStyle_put_paddingTop,
2348 HTMLStyle_get_paddingTop,
2349 HTMLStyle_put_paddingRight,
2350 HTMLStyle_get_paddingRight,
2351 HTMLStyle_put_paddingBottom,
2352 HTMLStyle_get_paddingBottom,
2353 HTMLStyle_put_paddingLeft,
2354 HTMLStyle_get_paddingLeft,
2355 HTMLStyle_put_padding,
2356 HTMLStyle_get_padding,
2357 HTMLStyle_put_border,
2358 HTMLStyle_get_border,
2359 HTMLStyle_put_borderTop,
2360 HTMLStyle_get_borderTop,
2361 HTMLStyle_put_borderRight,
2362 HTMLStyle_get_borderRight,
2363 HTMLStyle_put_borderBottom,
2364 HTMLStyle_get_borderBottom,
2365 HTMLStyle_put_borderLeft,
2366 HTMLStyle_get_borderLeft,
2367 HTMLStyle_put_borderColor,
2368 HTMLStyle_get_borderColor,
2369 HTMLStyle_put_borderTopColor,
2370 HTMLStyle_get_borderTopColor,
2371 HTMLStyle_put_borderRightColor,
2372 HTMLStyle_get_borderRightColor,
2373 HTMLStyle_put_borderBottomColor,
2374 HTMLStyle_get_borderBottomColor,
2375 HTMLStyle_put_borderLeftColor,
2376 HTMLStyle_get_borderLeftColor,
2377 HTMLStyle_put_borderWidth,
2378 HTMLStyle_get_borderWidth,
2379 HTMLStyle_put_borderTopWidth,
2380 HTMLStyle_get_borderTopWidth,
2381 HTMLStyle_put_borderRightWidth,
2382 HTMLStyle_get_borderRightWidth,
2383 HTMLStyle_put_borderBottomWidth,
2384 HTMLStyle_get_borderBottomWidth,
2385 HTMLStyle_put_borderLeftWidth,
2386 HTMLStyle_get_borderLeftWidth,
2387 HTMLStyle_put_borderStyle,
2388 HTMLStyle_get_borderStyle,
2389 HTMLStyle_put_borderTopStyle,
2390 HTMLStyle_get_borderTopStyle,
2391 HTMLStyle_put_borderRightStyle,
2392 HTMLStyle_get_borderRightStyle,
2393 HTMLStyle_put_borderBottomStyle,
2394 HTMLStyle_get_borderBottomStyle,
2395 HTMLStyle_put_borderLeftStyle,
2396 HTMLStyle_get_borderLeftStyle,
2397 HTMLStyle_put_width,
2398 HTMLStyle_get_width,
2399 HTMLStyle_put_height,
2400 HTMLStyle_get_height,
2401 HTMLStyle_put_styleFloat,
2402 HTMLStyle_get_styleFloat,
2403 HTMLStyle_put_clear,
2404 HTMLStyle_get_clear,
2405 HTMLStyle_put_display,
2406 HTMLStyle_get_display,
2407 HTMLStyle_put_visibility,
2408 HTMLStyle_get_visibility,
2409 HTMLStyle_put_listStyleType,
2410 HTMLStyle_get_listStyleType,
2411 HTMLStyle_put_listStylePosition,
2412 HTMLStyle_get_listStylePosition,
2413 HTMLStyle_put_listStyleImage,
2414 HTMLStyle_get_listStyleImage,
2415 HTMLStyle_put_listStyle,
2416 HTMLStyle_get_listStyle,
2417 HTMLStyle_put_whiteSpace,
2418 HTMLStyle_get_whiteSpace,
2419 HTMLStyle_put_top,
2420 HTMLStyle_get_top,
2421 HTMLStyle_put_left,
2422 HTMLStyle_get_left,
2423 HTMLStyle_get_position,
2424 HTMLStyle_put_zIndex,
2425 HTMLStyle_get_zIndex,
2426 HTMLStyle_put_overflow,
2427 HTMLStyle_get_overflow,
2428 HTMLStyle_put_pageBreakBefore,
2429 HTMLStyle_get_pageBreakBefore,
2430 HTMLStyle_put_pageBreakAfter,
2431 HTMLStyle_get_pageBreakAfter,
2432 HTMLStyle_put_cssText,
2433 HTMLStyle_get_cssText,
2434 HTMLStyle_put_pixelTop,
2435 HTMLStyle_get_pixelTop,
2436 HTMLStyle_put_pixelLeft,
2437 HTMLStyle_get_pixelLeft,
2438 HTMLStyle_put_pixelWidth,
2439 HTMLStyle_get_pixelWidth,
2440 HTMLStyle_put_pixelHeight,
2441 HTMLStyle_get_pixelHeight,
2442 HTMLStyle_put_posTop,
2443 HTMLStyle_get_posTop,
2444 HTMLStyle_put_posLeft,
2445 HTMLStyle_get_posLeft,
2446 HTMLStyle_put_posWidth,
2447 HTMLStyle_get_posWidth,
2448 HTMLStyle_put_posHeight,
2449 HTMLStyle_get_posHeight,
2450 HTMLStyle_put_cursor,
2451 HTMLStyle_get_cursor,
2452 HTMLStyle_put_clip,
2453 HTMLStyle_get_clip,
2454 HTMLStyle_put_filter,
2455 HTMLStyle_get_filter,
2456 HTMLStyle_setAttribute,
2457 HTMLStyle_getAttribute,
2458 HTMLStyle_removeAttribute,
2459 HTMLStyle_toString
2462 static const dispex_static_data_vtbl_t HTMLStyle_dispex_vtbl = {
2463 HTMLStyle_get_dispid,
2464 NULL
2467 static const tid_t HTMLStyle_iface_tids[] = {
2468 IHTMLStyle_tid,
2469 IHTMLStyle2_tid,
2472 static dispex_static_data_t HTMLStyle_dispex = {
2473 &HTMLStyle_dispex_vtbl,
2474 DispHTMLStyle_tid,
2475 NULL,
2476 HTMLStyle_iface_tids
2479 IHTMLStyle *HTMLStyle_Create(nsIDOMCSSStyleDeclaration *nsstyle)
2481 HTMLStyle *ret = heap_alloc_zero(sizeof(HTMLStyle));
2483 ret->lpHTMLStyleVtbl = &HTMLStyleVtbl;
2484 ret->ref = 1;
2485 ret->nsstyle = nsstyle;
2486 HTMLStyle2_Init(ret);
2487 HTMLStyle3_Init(ret);
2489 nsIDOMCSSStyleDeclaration_AddRef(nsstyle);
2491 init_dispex(&ret->dispex, (IUnknown*)HTMLSTYLE(ret), &HTMLStyle_dispex);
2493 return HTMLSTYLE(ret);