2 * Copyright 2006 Jacek Caban for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
30 #include "mshtml_private.h"
31 #include "htmlstyle.h"
33 #include "wine/debug.h"
34 #include "wine/unicode.h"
36 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
38 static const WCHAR attrBackground[] =
39 {'b','a','c','k','g','r','o','u','n','d',0};
40 static const WCHAR attrBackgroundColor[] =
41 {'b','a','c','k','g','r','o','u','n','d','-','c','o','l','o','r',0};
42 static const WCHAR attrBackgroundImage[] =
43 {'b','a','c','k','g','r','o','u','n','d','-','i','m','a','g','e',0};
44 static const WCHAR 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 attrBorderWidth[] =
55 {'b','o','r','d','e','r','-','w','i','d','t','h',0};
56 static const WCHAR attrColor[] =
57 {'c','o','l','o','r',0};
58 static const WCHAR attrCursor[] =
59 {'c','u','r','s','o','r',0};
60 static const WCHAR attrDisplay[] =
61 {'d','i','s','p','l','a','y',0};
62 static const WCHAR attrFilter[] =
63 {'f','i','l','e','t','e','r',0};
64 static const WCHAR attrFontFamily[] =
65 {'f','o','n','t','-','f','a','m','i','l','y',0};
66 static const WCHAR attrFontSize[] =
67 {'f','o','n','t','-','s','i','z','e',0};
68 static const WCHAR attrFontStyle[] =
69 {'f','o','n','t','-','s','t','y','l','e',0};
70 static const WCHAR attrFontVariant[] =
71 {'f','o','n','t','-','v','a','r','i','a','n','t',0};
72 static const WCHAR attrFontWeight[] =
73 {'f','o','n','t','-','w','e','i','g','h','t',0};
74 static const WCHAR attrHeight[] =
75 {'h','e','i','g','h','t',0};
76 static const WCHAR attrLeft[] =
78 static const WCHAR attrMargin[] =
79 {'m','a','r','g','i','n',0};
80 static const WCHAR attrMarginLeft[] =
81 {'m','a','r','g','i','n','-','l','e','f','t',0};
82 static const WCHAR attrMarginRight[] =
83 {'m','a','r','g','i','n','-','r','i','g','h','t',0};
84 static const WCHAR attrOverflow[] =
85 {'o','v','e','r','f','l','o','w',0};
86 static const WCHAR attrPaddingLeft[] =
87 {'p','a','d','d','i','n','g','-','l','e','f','t',0};
88 static const WCHAR attrPosition[] =
89 {'p','o','s','i','t','i','o','n',0};
90 static const WCHAR attrTextAlign[] =
91 {'t','e','x','t','-','a','l','i','g','n',0};
92 static const WCHAR attrTextDecoration[] =
93 {'t','e','x','t','-','d','e','c','o','r','a','t','i','o','n',0};
94 static const WCHAR attrTop[] =
96 static const WCHAR attrVerticalAlign[] =
97 {'v','e','r','t','i','c','a','l','-','a','l','i','g','n',0};
98 static const WCHAR attrVisibility[] =
99 {'v','i','s','i','b','i','l','i','t','y',0};
100 static const WCHAR attrWidth[] =
101 {'w','i','d','t','h',0};
102 static const WCHAR attrZIndex[] =
103 {'z','-','i','n','d','e','x',0};
109 {attrBackground, DISPID_IHTMLSTYLE_BACKGROUND},
110 {attrBackgroundColor, DISPID_IHTMLSTYLE_BACKGROUNDCOLOR},
111 {attrBackgroundImage, DISPID_IHTMLSTYLE_BACKGROUNDIMAGE},
112 {attrBorder, DISPID_IHTMLSTYLE_BORDER},
113 {attrBorderBottomStyle, DISPID_IHTMLSTYLE_BORDERBOTTOMSTYLE},
114 {attrBorderLeft, DISPID_IHTMLSTYLE_BORDERLEFT},
115 {attrBorderLeftStyle, DISPID_IHTMLSTYLE_BORDERLEFTSTYLE},
116 {attrBorderRightStyle, DISPID_IHTMLSTYLE_BORDERRIGHTSTYLE},
117 {attrBorderWidth, DISPID_IHTMLSTYLE_BORDERWIDTH},
118 {attrColor, DISPID_IHTMLSTYLE_COLOR},
119 {attrCursor, DISPID_IHTMLSTYLE_CURSOR},
120 {attrDisplay, DISPID_IHTMLSTYLE_DISPLAY},
121 {attrFilter, DISPID_IHTMLSTYLE_FILTER},
122 {attrFontFamily, DISPID_IHTMLSTYLE_FONTFAMILY},
123 {attrFontSize, DISPID_IHTMLSTYLE_FONTSIZE},
124 {attrFontStyle, DISPID_IHTMLSTYLE_FONTSTYLE},
125 {attrFontVariant, DISPID_IHTMLSTYLE_FONTVARIANT},
126 {attrFontWeight, DISPID_IHTMLSTYLE_FONTWEIGHT},
127 {attrHeight, DISPID_IHTMLSTYLE_HEIGHT},
128 {attrLeft, DISPID_IHTMLSTYLE_LEFT},
129 {attrMargin, DISPID_IHTMLSTYLE_MARGIN},
130 {attrMarginLeft, DISPID_IHTMLSTYLE_MARGINLEFT},
131 {attrMarginRight, DISPID_IHTMLSTYLE_MARGINRIGHT},
132 {attrOverflow, DISPID_IHTMLSTYLE_OVERFLOW},
133 {attrPaddingLeft, DISPID_IHTMLSTYLE_PADDINGLEFT},
134 {attrPosition, DISPID_IHTMLSTYLE2_POSITION},
135 {attrTextAlign, DISPID_IHTMLSTYLE_TEXTALIGN},
136 {attrTextDecoration, DISPID_IHTMLSTYLE_TEXTDECORATION},
137 {attrTop, DISPID_IHTMLSTYLE_TOP},
138 {attrVerticalAlign, DISPID_IHTMLSTYLE_VERTICALALIGN},
139 {attrVisibility, DISPID_IHTMLSTYLE_VISIBILITY},
140 {attrWidth, DISPID_IHTMLSTYLE_WIDTH},
141 {attrZIndex, DISPID_IHTMLSTYLE_ZINDEX}
144 static const WCHAR valLineThrough[] =
145 {'l','i','n','e','-','t','h','r','o','u','g','h',0};
146 static const WCHAR valUnderline[] =
147 {'u','n','d','e','r','l','i','n','e',0};
148 static const WCHAR szNormal[] =
149 {'n','o','r','m','a','l',0};
151 static const WCHAR px_formatW[] = {'%','d','p','x',0};
152 static const WCHAR emptyW[] = {0};
154 static LPWSTR fix_px_value(LPCWSTR val)
159 while(*ptr && isspaceW(*ptr))
164 while(*ptr && isdigitW(*ptr))
167 if(!*ptr || isspaceW(*ptr)) {
169 int len = strlenW(val)+1;
171 ret = heap_alloc((len+2)*sizeof(WCHAR));
172 memcpy(ret, val, (ptr-val)*sizeof(WCHAR));
178 TRACE("fixed %s -> %s\n", debugstr_w(val), debugstr_w(ret));
183 while(*ptr && !isspaceW(*ptr))
190 static LPWSTR fix_url_value(LPCWSTR val)
194 static const WCHAR urlW[] = {'u','r','l','('};
196 if(strncmpW(val, urlW, sizeof(urlW)/sizeof(WCHAR)) || !strchrW(val, '\\'))
199 ret = heap_strdupW(val);
201 for(ptr = ret; *ptr; ptr++) {
209 #define ATTR_FIX_PX 1
210 #define ATTR_FIX_URL 2
211 #define ATTR_STR_TO_INT 4
213 HRESULT set_nsstyle_attr(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, LPCWSTR value, DWORD flags)
215 nsAString str_name, str_value, str_empty;
219 static const PRUnichar wszEmpty[] = {0};
221 if(flags & ATTR_FIX_PX)
222 val = fix_px_value(value);
223 if(flags & ATTR_FIX_URL)
224 val = fix_url_value(value);
226 nsAString_Init(&str_name, style_tbl[sid].name);
227 nsAString_Init(&str_value, val ? val : value);
228 nsAString_Init(&str_empty, wszEmpty);
231 nsres = nsIDOMCSSStyleDeclaration_SetProperty(nsstyle, &str_name, &str_value, &str_empty);
233 ERR("SetProperty failed: %08x\n", nsres);
235 nsAString_Finish(&str_name);
236 nsAString_Finish(&str_value);
237 nsAString_Finish(&str_empty);
242 static HRESULT set_nsstyle_attr_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, VARIANT *value, DWORD flags)
244 switch(V_VT(value)) {
246 return set_nsstyle_attr(nsstyle, sid, emptyW, flags);
249 return set_nsstyle_attr(nsstyle, sid, V_BSTR(value), flags);
252 FIXME("not implemented vt %d\n", V_VT(value));
260 static inline HRESULT set_style_attr(HTMLStyle *This, styleid_t sid, LPCWSTR value, DWORD flags)
262 return set_nsstyle_attr(This->nsstyle, sid, value, flags);
265 static HRESULT get_nsstyle_attr_nsval(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, nsAString *value)
270 nsAString_Init(&str_name, style_tbl[sid].name);
272 nsres = nsIDOMCSSStyleDeclaration_GetPropertyValue(nsstyle, &str_name, value);
273 if(NS_FAILED(nsres)) {
274 ERR("SetProperty failed: %08x\n", nsres);
278 nsAString_Finish(&str_name);
283 HRESULT get_nsstyle_attr(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, BSTR *p)
286 const PRUnichar *value;
288 nsAString_Init(&str_value, NULL);
290 get_nsstyle_attr_nsval(nsstyle, sid, &str_value);
292 nsAString_GetData(&str_value, &value);
293 *p = *value ? SysAllocString(value) : NULL;
295 nsAString_Finish(&str_value);
297 TRACE("%s -> %s\n", debugstr_w(style_tbl[sid].name), debugstr_w(*p));
301 static HRESULT get_nsstyle_attr_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, VARIANT *p, DWORD flags)
304 const PRUnichar *value;
307 nsAString_Init(&str_value, NULL);
309 get_nsstyle_attr_nsval(nsstyle, sid, &str_value);
311 nsAString_GetData(&str_value, &value);
313 if(flags & ATTR_STR_TO_INT) {
314 const PRUnichar *ptr = value;
323 while(isdigitW(*ptr))
324 i = i*10 + (*ptr++ - '0');
328 V_I4(p) = neg ? -i : i;
337 str = SysAllocString(value);
339 return E_OUTOFMEMORY;
346 nsAString_Finish(&str_value);
348 TRACE("%s -> %s\n", debugstr_w(style_tbl[sid].name), debugstr_variant(p));
352 static inline HRESULT get_style_attr(HTMLStyle *This, styleid_t sid, BSTR *p)
354 return get_nsstyle_attr(This->nsstyle, sid, p);
357 static HRESULT check_style_attr_value(HTMLStyle *This, styleid_t sid, LPCWSTR exval, VARIANT_BOOL *p)
360 const PRUnichar *value;
362 nsAString_Init(&str_value, NULL);
364 get_nsstyle_attr_nsval(This->nsstyle, sid, &str_value);
366 nsAString_GetData(&str_value, &value);
367 *p = strcmpW(value, exval) ? VARIANT_FALSE : VARIANT_TRUE;
368 nsAString_Finish(&str_value);
370 TRACE("%s -> %x\n", debugstr_w(style_tbl[sid].name), *p);
374 static inline HRESULT set_style_pos(HTMLStyle *This, styleid_t sid, float value)
377 WCHAR szFormat[] = {'%','.','0','f','p','x',0};
379 value = floor(value);
381 sprintfW(szValue, szFormat, value);
383 return set_style_attr(This, sid, szValue, 0);
386 static HRESULT get_nsstyle_pos(HTMLStyle *This, styleid_t sid, float *p)
390 WCHAR pxW[] = {'p','x',0};
392 TRACE("%p %d %p\n", This, sid, p);
396 nsAString_Init(&str_value, NULL);
398 hres = get_nsstyle_attr_nsval(This->nsstyle, sid, &str_value);
402 const PRUnichar *value;
404 nsAString_GetData(&str_value, &value);
407 *p = strtolW(value, &ptr, 10);
409 if(*ptr && strcmpW(ptr, pxW))
411 nsAString_Finish(&str_value);
412 FIXME("only px values are currently supported\n");
418 TRACE("ret %f\n", *p);
420 nsAString_Finish(&str_value);
425 static BOOL is_valid_border_style(BSTR v)
427 static const WCHAR styleNone[] = {'n','o','n','e',0};
428 static const WCHAR styleDotted[] = {'d','o','t','t','e','d',0};
429 static const WCHAR styleDashed[] = {'d','a','s','h','e','d',0};
430 static const WCHAR styleSolid[] = {'s','o','l','i','d',0};
431 static const WCHAR styleDouble[] = {'d','o','u','b','l','e',0};
432 static const WCHAR styleGroove[] = {'g','r','o','o','v','e',0};
433 static const WCHAR styleRidge[] = {'r','i','d','g','e',0};
434 static const WCHAR styleInset[] = {'i','n','s','e','t',0};
435 static const WCHAR styleOutset[] = {'o','u','t','s','e','t',0};
437 TRACE("%s\n", debugstr_w(v));
439 if(!v || strcmpiW(v, styleNone) == 0 || strcmpiW(v, styleDotted) == 0 ||
440 strcmpiW(v, styleDashed) == 0 || strcmpiW(v, styleSolid) == 0 ||
441 strcmpiW(v, styleDouble) == 0 || strcmpiW(v, styleGroove) == 0 ||
442 strcmpiW(v, styleRidge) == 0 || strcmpiW(v, styleInset) == 0 ||
443 strcmpiW(v, styleOutset) == 0 )
451 #define HTMLSTYLE_THIS(iface) DEFINE_THIS(HTMLStyle, HTMLStyle, iface)
453 static HRESULT WINAPI HTMLStyle_QueryInterface(IHTMLStyle *iface, REFIID riid, void **ppv)
455 HTMLStyle *This = HTMLSTYLE_THIS(iface);
459 if(IsEqualGUID(&IID_IUnknown, riid)) {
460 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
461 *ppv = HTMLSTYLE(This);
462 }else if(IsEqualGUID(&IID_IHTMLStyle, riid)) {
463 TRACE("(%p)->(IID_IHTMLStyle %p)\n", This, ppv);
464 *ppv = HTMLSTYLE(This);
465 }else if(IsEqualGUID(&IID_IHTMLStyle2, riid)) {
466 TRACE("(%p)->(IID_IHTMLStyle2 %p)\n", This, ppv);
467 *ppv = HTMLSTYLE2(This);
468 }else if(dispex_query_interface(&This->dispex, riid, ppv)) {
469 return *ppv ? S_OK : E_NOINTERFACE;
473 IUnknown_AddRef((IUnknown*)*ppv);
477 WARN("unsupported %s\n", debugstr_guid(riid));
478 return E_NOINTERFACE;
481 static ULONG WINAPI HTMLStyle_AddRef(IHTMLStyle *iface)
483 HTMLStyle *This = HTMLSTYLE_THIS(iface);
484 LONG ref = InterlockedIncrement(&This->ref);
486 TRACE("(%p) ref=%d\n", This, ref);
491 static ULONG WINAPI HTMLStyle_Release(IHTMLStyle *iface)
493 HTMLStyle *This = HTMLSTYLE_THIS(iface);
494 LONG ref = InterlockedDecrement(&This->ref);
496 TRACE("(%p) ref=%d\n", This, ref);
500 nsIDOMCSSStyleDeclaration_Release(This->nsstyle);
507 static HRESULT WINAPI HTMLStyle_GetTypeInfoCount(IHTMLStyle *iface, UINT *pctinfo)
509 HTMLStyle *This = HTMLSTYLE_THIS(iface);
510 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->dispex), pctinfo);
513 static HRESULT WINAPI HTMLStyle_GetTypeInfo(IHTMLStyle *iface, UINT iTInfo,
514 LCID lcid, ITypeInfo **ppTInfo)
516 HTMLStyle *This = HTMLSTYLE_THIS(iface);
517 return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->dispex), iTInfo, lcid, ppTInfo);
520 static HRESULT WINAPI HTMLStyle_GetIDsOfNames(IHTMLStyle *iface, REFIID riid,
521 LPOLESTR *rgszNames, UINT cNames,
522 LCID lcid, DISPID *rgDispId)
524 HTMLStyle *This = HTMLSTYLE_THIS(iface);
525 return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->dispex), riid, rgszNames, cNames, lcid, rgDispId);
528 static HRESULT WINAPI HTMLStyle_Invoke(IHTMLStyle *iface, DISPID dispIdMember,
529 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
530 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
532 HTMLStyle *This = HTMLSTYLE_THIS(iface);
533 return IDispatchEx_Invoke(DISPATCHEX(&This->dispex), dispIdMember, riid, lcid,
534 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
537 static HRESULT WINAPI HTMLStyle_put_fontFamily(IHTMLStyle *iface, BSTR v)
539 HTMLStyle *This = HTMLSTYLE_THIS(iface);
541 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
543 return set_style_attr(This, STYLEID_FONT_FAMILY, v, 0);
546 static HRESULT WINAPI HTMLStyle_get_fontFamily(IHTMLStyle *iface, BSTR *p)
548 HTMLStyle *This = HTMLSTYLE_THIS(iface);
550 TRACE("(%p)->(%p)\n", This, p);
552 return get_style_attr(This, STYLEID_FONT_FAMILY, p);
555 static HRESULT WINAPI HTMLStyle_put_fontStyle(IHTMLStyle *iface, BSTR v)
557 HTMLStyle *This = HTMLSTYLE_THIS(iface);
558 static const WCHAR szItalic[] = {'i','t','a','l','i','c',0};
559 static const WCHAR szOblique[] = {'o','b','l','i','q','u','e',0};
561 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
563 /* fontStyle can only be one of the follow values. */
564 if(!v || strcmpiW(szNormal, v) == 0 || strcmpiW(szItalic, v) == 0 ||
565 strcmpiW(szOblique, v) == 0)
567 return set_nsstyle_attr(This->nsstyle, STYLEID_FONT_STYLE, v, 0);
573 static HRESULT WINAPI HTMLStyle_get_fontStyle(IHTMLStyle *iface, BSTR *p)
575 HTMLStyle *This = HTMLSTYLE_THIS(iface);
577 TRACE("(%p)->(%p)\n", This, p);
579 return get_style_attr(This, STYLEID_FONT_STYLE, p);
582 static HRESULT WINAPI HTMLStyle_put_fontVariant(IHTMLStyle *iface, BSTR v)
584 HTMLStyle *This = HTMLSTYLE_THIS(iface);
585 static const WCHAR szCaps[] = {'s','m','a','l','l','-','c','a','p','s',0};
587 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
589 /* fontVariant can only be one of the follow values. */
590 if(!v || strcmpiW(szNormal, v) == 0 || strcmpiW(szCaps, v) == 0)
592 return set_nsstyle_attr(This->nsstyle, STYLEID_FONT_VARIANT, v, 0);
598 static HRESULT WINAPI HTMLStyle_get_fontVariant(IHTMLStyle *iface, BSTR *p)
600 HTMLStyle *This = HTMLSTYLE_THIS(iface);
601 TRACE("(%p)->(%p)\n", This, p);
606 return get_style_attr(This, STYLEID_FONT_VARIANT, p);
609 static HRESULT WINAPI HTMLStyle_put_fontWeight(IHTMLStyle *iface, BSTR v)
611 HTMLStyle *This = HTMLSTYLE_THIS(iface);
612 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
616 static HRESULT WINAPI HTMLStyle_get_fontWeight(IHTMLStyle *iface, BSTR *p)
618 HTMLStyle *This = HTMLSTYLE_THIS(iface);
620 TRACE("(%p)->(%p)\n", This, p);
622 return get_style_attr(This, STYLEID_FONT_WEIGHT, p);
625 static HRESULT WINAPI HTMLStyle_put_fontSize(IHTMLStyle *iface, VARIANT v)
627 HTMLStyle *This = HTMLSTYLE_THIS(iface);
629 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
633 return set_style_attr(This, STYLEID_FONT_SIZE, V_BSTR(&v), 0);
635 FIXME("not supported vt %d\n", V_VT(&v));
641 static HRESULT WINAPI HTMLStyle_get_fontSize(IHTMLStyle *iface, VARIANT *p)
643 HTMLStyle *This = HTMLSTYLE_THIS(iface);
645 TRACE("(%p)->(%p)\n", This, p);
648 return get_style_attr(This, STYLEID_FONT_SIZE, &V_BSTR(p));
651 static HRESULT WINAPI HTMLStyle_put_font(IHTMLStyle *iface, BSTR v)
653 HTMLStyle *This = HTMLSTYLE_THIS(iface);
654 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
658 static HRESULT WINAPI HTMLStyle_get_font(IHTMLStyle *iface, BSTR *p)
660 HTMLStyle *This = HTMLSTYLE_THIS(iface);
661 FIXME("(%p)->(%p)\n", This, p);
665 static HRESULT WINAPI HTMLStyle_put_color(IHTMLStyle *iface, VARIANT v)
667 HTMLStyle *This = HTMLSTYLE_THIS(iface);
669 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
673 TRACE("%s\n", debugstr_w(V_BSTR(&v)));
674 return set_style_attr(This, STYLEID_COLOR, V_BSTR(&v), 0);
677 FIXME("unsupported vt=%d\n", V_VT(&v));
683 static HRESULT WINAPI HTMLStyle_get_color(IHTMLStyle *iface, VARIANT *p)
685 HTMLStyle *This = HTMLSTYLE_THIS(iface);
687 TRACE("(%p)->(%p)\n", This, p);
690 return get_style_attr(This, STYLEID_COLOR, &V_BSTR(p));
693 static HRESULT WINAPI HTMLStyle_put_background(IHTMLStyle *iface, BSTR v)
695 HTMLStyle *This = HTMLSTYLE_THIS(iface);
697 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
699 return set_style_attr(This, STYLEID_BACKGROUND, v, 0);
702 static HRESULT WINAPI HTMLStyle_get_background(IHTMLStyle *iface, BSTR *p)
704 HTMLStyle *This = HTMLSTYLE_THIS(iface);
706 TRACE("(%p)->(%p)\n", This, p);
708 return get_style_attr(This, STYLEID_BACKGROUND, p);
711 static HRESULT WINAPI HTMLStyle_put_backgroundColor(IHTMLStyle *iface, VARIANT v)
713 HTMLStyle *This = HTMLSTYLE_THIS(iface);
715 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
719 return set_style_attr(This, STYLEID_BACKGROUND_COLOR, V_BSTR(&v), 0);
722 static const WCHAR format[] = {'#','%','0','6','x',0};
724 wsprintfW(value, format, V_I4(&v));
725 return set_style_attr(This, STYLEID_BACKGROUND_COLOR, value, 0);
728 FIXME("unsupported vt %d\n", V_VT(&v));
734 static HRESULT WINAPI HTMLStyle_get_backgroundColor(IHTMLStyle *iface, VARIANT *p)
736 HTMLStyle *This = HTMLSTYLE_THIS(iface);
737 FIXME("(%p)->(%p)\n", This, p);
741 static HRESULT WINAPI HTMLStyle_put_backgroundImage(IHTMLStyle *iface, BSTR v)
743 HTMLStyle *This = HTMLSTYLE_THIS(iface);
745 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
747 return set_style_attr(This, STYLEID_BACKGROUND_IMAGE, v, ATTR_FIX_URL);
750 static HRESULT WINAPI HTMLStyle_get_backgroundImage(IHTMLStyle *iface, BSTR *p)
752 HTMLStyle *This = HTMLSTYLE_THIS(iface);
754 TRACE("(%p)->(%p)\n", This, p);
756 return get_style_attr(This, STYLEID_BACKGROUND_IMAGE, p);
759 static HRESULT WINAPI HTMLStyle_put_backgroundRepeat(IHTMLStyle *iface, BSTR v)
761 HTMLStyle *This = HTMLSTYLE_THIS(iface);
762 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
766 static HRESULT WINAPI HTMLStyle_get_backgroundRepeat(IHTMLStyle *iface, BSTR *p)
768 HTMLStyle *This = HTMLSTYLE_THIS(iface);
769 FIXME("(%p)->(%p)\n", This, p);
773 static HRESULT WINAPI HTMLStyle_put_backgroundAttachment(IHTMLStyle *iface, BSTR v)
775 HTMLStyle *This = HTMLSTYLE_THIS(iface);
776 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
780 static HRESULT WINAPI HTMLStyle_get_backgroundAttachment(IHTMLStyle *iface, BSTR *p)
782 HTMLStyle *This = HTMLSTYLE_THIS(iface);
783 FIXME("(%p)->(%p)\n", This, p);
787 static HRESULT WINAPI HTMLStyle_put_backgroundPosition(IHTMLStyle *iface, BSTR v)
789 HTMLStyle *This = HTMLSTYLE_THIS(iface);
790 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
794 static HRESULT WINAPI HTMLStyle_get_backgroundPosition(IHTMLStyle *iface, BSTR *p)
796 HTMLStyle *This = HTMLSTYLE_THIS(iface);
797 FIXME("(%p)->(%p)\n", This, p);
801 static HRESULT WINAPI HTMLStyle_put_backgroundPositionX(IHTMLStyle *iface, VARIANT v)
803 HTMLStyle *This = HTMLSTYLE_THIS(iface);
804 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
808 static HRESULT WINAPI HTMLStyle_get_backgroundPositionX(IHTMLStyle *iface, VARIANT *p)
810 HTMLStyle *This = HTMLSTYLE_THIS(iface);
811 FIXME("(%p)->(%p)\n", This, p);
815 static HRESULT WINAPI HTMLStyle_put_backgroundPositionY(IHTMLStyle *iface, VARIANT v)
817 HTMLStyle *This = HTMLSTYLE_THIS(iface);
818 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
822 static HRESULT WINAPI HTMLStyle_get_backgroundPositionY(IHTMLStyle *iface, VARIANT *p)
824 HTMLStyle *This = HTMLSTYLE_THIS(iface);
825 FIXME("(%p)->(%p)\n", This, p);
829 static HRESULT WINAPI HTMLStyle_put_wordSpacing(IHTMLStyle *iface, VARIANT v)
831 HTMLStyle *This = HTMLSTYLE_THIS(iface);
832 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
836 static HRESULT WINAPI HTMLStyle_get_wordSpacing(IHTMLStyle *iface, VARIANT *p)
838 HTMLStyle *This = HTMLSTYLE_THIS(iface);
839 FIXME("(%p)->(%p)\n", This, p);
843 static HRESULT WINAPI HTMLStyle_put_letterSpacing(IHTMLStyle *iface, VARIANT v)
845 HTMLStyle *This = HTMLSTYLE_THIS(iface);
846 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
850 static HRESULT WINAPI HTMLStyle_get_letterSpacing(IHTMLStyle *iface, VARIANT *p)
852 HTMLStyle *This = HTMLSTYLE_THIS(iface);
853 FIXME("(%p)->(%p)\n", This, p);
857 static HRESULT WINAPI HTMLStyle_put_textDecoration(IHTMLStyle *iface, BSTR v)
859 HTMLStyle *This = HTMLSTYLE_THIS(iface);
860 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
864 static HRESULT WINAPI HTMLStyle_get_textDecoration(IHTMLStyle *iface, BSTR *p)
866 HTMLStyle *This = HTMLSTYLE_THIS(iface);
868 TRACE("(%p)->(%p)\n", This, p);
870 return get_style_attr(This, STYLEID_TEXT_DECORATION, p);
873 static HRESULT WINAPI HTMLStyle_put_textDecorationNone(IHTMLStyle *iface, VARIANT_BOOL v)
875 HTMLStyle *This = HTMLSTYLE_THIS(iface);
876 FIXME("(%p)->(%x)\n", This, v);
880 static HRESULT WINAPI HTMLStyle_get_textDecorationNone(IHTMLStyle *iface, VARIANT_BOOL *p)
882 HTMLStyle *This = HTMLSTYLE_THIS(iface);
883 FIXME("(%p)->(%p)\n", This, p);
887 static HRESULT WINAPI HTMLStyle_put_textDecorationUnderline(IHTMLStyle *iface, VARIANT_BOOL v)
889 HTMLStyle *This = HTMLSTYLE_THIS(iface);
890 FIXME("(%p)->(%x)\n", This, v);
894 static HRESULT WINAPI HTMLStyle_get_textDecorationUnderline(IHTMLStyle *iface, VARIANT_BOOL *p)
896 HTMLStyle *This = HTMLSTYLE_THIS(iface);
898 TRACE("(%p)->(%p)\n", This, p);
900 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, valUnderline, p);
903 static HRESULT WINAPI HTMLStyle_put_textDecorationOverline(IHTMLStyle *iface, VARIANT_BOOL v)
905 HTMLStyle *This = HTMLSTYLE_THIS(iface);
906 FIXME("(%p)->(%x)\n", This, v);
910 static HRESULT WINAPI HTMLStyle_get_textDecorationOverline(IHTMLStyle *iface, VARIANT_BOOL *p)
912 HTMLStyle *This = HTMLSTYLE_THIS(iface);
913 FIXME("(%p)->(%p)\n", This, p);
917 static HRESULT WINAPI HTMLStyle_put_textDecorationLineThrough(IHTMLStyle *iface, VARIANT_BOOL v)
919 HTMLStyle *This = HTMLSTYLE_THIS(iface);
920 FIXME("(%p)->(%x)\n", This, v);
924 static HRESULT WINAPI HTMLStyle_get_textDecorationLineThrough(IHTMLStyle *iface, VARIANT_BOOL *p)
926 HTMLStyle *This = HTMLSTYLE_THIS(iface);
928 TRACE("(%p)->(%p)\n", This, p);
930 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, valLineThrough, p);
933 static HRESULT WINAPI HTMLStyle_put_textDecorationBlink(IHTMLStyle *iface, VARIANT_BOOL v)
935 HTMLStyle *This = HTMLSTYLE_THIS(iface);
936 FIXME("(%p)->(%x)\n", This, v);
940 static HRESULT WINAPI HTMLStyle_get_textDecorationBlink(IHTMLStyle *iface, VARIANT_BOOL *p)
942 HTMLStyle *This = HTMLSTYLE_THIS(iface);
943 FIXME("(%p)->(%p)\n", This, p);
947 static HRESULT WINAPI HTMLStyle_put_verticalAlign(IHTMLStyle *iface, VARIANT v)
949 HTMLStyle *This = HTMLSTYLE_THIS(iface);
951 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
955 return set_style_attr(This, STYLEID_VERTICAL_ALIGN, V_BSTR(&v), 0);
957 FIXME("not implemented vt %d\n", V_VT(&v));
964 static HRESULT WINAPI HTMLStyle_get_verticalAlign(IHTMLStyle *iface, VARIANT *p)
966 HTMLStyle *This = HTMLSTYLE_THIS(iface);
970 TRACE("(%p)->(%p)\n", This, p);
972 hres = get_style_attr(This, STYLEID_VERTICAL_ALIGN, &ret);
981 static HRESULT WINAPI HTMLStyle_put_textTransform(IHTMLStyle *iface, BSTR v)
983 HTMLStyle *This = HTMLSTYLE_THIS(iface);
984 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
988 static HRESULT WINAPI HTMLStyle_get_textTransform(IHTMLStyle *iface, BSTR *p)
990 HTMLStyle *This = HTMLSTYLE_THIS(iface);
991 FIXME("(%p)->(%p)\n", This, p);
995 static HRESULT WINAPI HTMLStyle_put_textAlign(IHTMLStyle *iface, BSTR v)
997 HTMLStyle *This = HTMLSTYLE_THIS(iface);
999 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1001 return set_style_attr(This, STYLEID_TEXT_ALIGN, v, 0);
1004 static HRESULT WINAPI HTMLStyle_get_textAlign(IHTMLStyle *iface, BSTR *p)
1006 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1008 TRACE("(%p)->(%p)\n", This, p);
1010 return get_style_attr(This, STYLEID_TEXT_ALIGN, p);
1013 static HRESULT WINAPI HTMLStyle_put_textIndent(IHTMLStyle *iface, VARIANT v)
1015 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1016 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1020 static HRESULT WINAPI HTMLStyle_get_textIndent(IHTMLStyle *iface, VARIANT *p)
1022 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1023 FIXME("(%p)->(%p)\n", This, p);
1027 static HRESULT WINAPI HTMLStyle_put_lineHeight(IHTMLStyle *iface, VARIANT v)
1029 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1030 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1034 static HRESULT WINAPI HTMLStyle_get_lineHeight(IHTMLStyle *iface, VARIANT *p)
1036 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1037 FIXME("(%p)->(%p)\n", This, p);
1041 static HRESULT WINAPI HTMLStyle_put_marginTop(IHTMLStyle *iface, VARIANT v)
1043 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1044 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1048 static HRESULT WINAPI HTMLStyle_get_marginTop(IHTMLStyle *iface, VARIANT *p)
1050 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1051 FIXME("(%p)->(%p)\n", This, p);
1055 static HRESULT WINAPI HTMLStyle_put_marginRight(IHTMLStyle *iface, VARIANT v)
1057 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1059 TRACE("(%p)->(v(%d))\n", This, V_VT(&v));
1063 return set_style_attr(This, STYLEID_MARGIN_RIGHT, emptyW, 0);
1067 wsprintfW(buf, px_formatW, V_I4(&v));
1068 return set_style_attr(This, STYLEID_MARGIN_RIGHT, buf, 0);
1071 return set_style_attr(This, STYLEID_MARGIN_RIGHT, V_BSTR(&v), 0);
1073 FIXME("Unsupported vt=%d\n", V_VT(&v));
1079 static HRESULT WINAPI HTMLStyle_get_marginRight(IHTMLStyle *iface, VARIANT *p)
1081 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1082 FIXME("(%p)->(%p)\n", This, p);
1086 static HRESULT WINAPI HTMLStyle_put_marginBottom(IHTMLStyle *iface, VARIANT v)
1088 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1089 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1093 static HRESULT WINAPI HTMLStyle_get_marginBottom(IHTMLStyle *iface, VARIANT *p)
1095 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1096 FIXME("(%p)->(%p)\n", This, p);
1100 static HRESULT WINAPI HTMLStyle_put_marginLeft(IHTMLStyle *iface, VARIANT v)
1102 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1106 TRACE("(%p)->(NULL)\n", This);
1107 return set_style_attr(This, STYLEID_MARGIN_LEFT, emptyW, 0);
1111 TRACE("(%p)->(%d)\n", This, V_I4(&v));
1113 wsprintfW(buf, px_formatW, V_I4(&v));
1114 return set_style_attr(This, STYLEID_MARGIN_LEFT, buf, 0);
1117 TRACE("(%p)->(%s)\n", This, debugstr_w(V_BSTR(&v)));
1118 return set_style_attr(This, STYLEID_MARGIN_LEFT, V_BSTR(&v), 0);
1120 FIXME("Unsupported vt=%d\n", V_VT(&v));
1126 static HRESULT WINAPI HTMLStyle_put_margin(IHTMLStyle *iface, BSTR v)
1128 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1130 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1132 return set_style_attr(This, STYLEID_MARGIN, v, 0);
1135 static HRESULT WINAPI HTMLStyle_get_margin(IHTMLStyle *iface, BSTR *p)
1137 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1139 TRACE("(%p)->(%p)\n", This, p);
1141 return get_style_attr(This, STYLEID_MARGIN, p);
1144 static HRESULT WINAPI HTMLStyle_get_marginLeft(IHTMLStyle *iface, VARIANT *p)
1146 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1147 FIXME("(%p)->(%p)\n", This, p);
1151 static HRESULT WINAPI HTMLStyle_put_paddingTop(IHTMLStyle *iface, VARIANT v)
1153 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1154 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1158 static HRESULT WINAPI HTMLStyle_get_paddingTop(IHTMLStyle *iface, VARIANT *p)
1160 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1161 FIXME("(%p)->(%p)\n", This, p);
1165 static HRESULT WINAPI HTMLStyle_put_paddingRight(IHTMLStyle *iface, VARIANT v)
1167 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1168 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1172 static HRESULT WINAPI HTMLStyle_get_paddingRight(IHTMLStyle *iface, VARIANT *p)
1174 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1175 FIXME("(%p)->(%p)\n", This, p);
1179 static HRESULT WINAPI HTMLStyle_put_paddingBottom(IHTMLStyle *iface, VARIANT v)
1181 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1182 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1186 static HRESULT WINAPI HTMLStyle_get_paddingBottom(IHTMLStyle *iface, VARIANT *p)
1188 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1189 FIXME("(%p)->(%p)\n", This, p);
1193 static HRESULT WINAPI HTMLStyle_put_paddingLeft(IHTMLStyle *iface, VARIANT v)
1195 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1197 TRACE("(%p)->(vt=%d)\n", This, V_VT(&v));
1203 wsprintfW(buf, px_formatW, V_I4(&v));
1204 return set_style_attr(This, STYLEID_PADDING_LEFT, buf, 0);
1207 return set_style_attr(This, STYLEID_PADDING_LEFT, V_BSTR(&v), 0);
1209 FIXME("unsupported vt=%d\n", V_VT(&v));
1215 static HRESULT WINAPI HTMLStyle_get_paddingLeft(IHTMLStyle *iface, VARIANT *p)
1217 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1218 FIXME("(%p)->(%p)\n", This, p);
1222 static HRESULT WINAPI HTMLStyle_put_padding(IHTMLStyle *iface, BSTR v)
1224 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1225 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1229 static HRESULT WINAPI HTMLStyle_get_padding(IHTMLStyle *iface, BSTR *p)
1231 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1232 FIXME("(%p)->(%p)\n", This, p);
1236 static HRESULT WINAPI HTMLStyle_put_border(IHTMLStyle *iface, BSTR v)
1238 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1240 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1242 return set_style_attr(This, STYLEID_BORDER, v, 0);
1245 static HRESULT WINAPI HTMLStyle_get_border(IHTMLStyle *iface, BSTR *p)
1247 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1249 TRACE("(%p)->(%p)\n", This, p);
1251 return get_style_attr(This, STYLEID_BORDER, p);
1254 static HRESULT WINAPI HTMLStyle_put_borderTop(IHTMLStyle *iface, BSTR v)
1256 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1257 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1261 static HRESULT WINAPI HTMLStyle_get_borderTop(IHTMLStyle *iface, BSTR *p)
1263 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1264 FIXME("(%p)->(%p)\n", This, p);
1268 static HRESULT WINAPI HTMLStyle_put_borderRight(IHTMLStyle *iface, BSTR v)
1270 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1271 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1275 static HRESULT WINAPI HTMLStyle_get_borderRight(IHTMLStyle *iface, BSTR *p)
1277 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1278 FIXME("(%p)->(%p)\n", This, p);
1282 static HRESULT WINAPI HTMLStyle_put_borderBottom(IHTMLStyle *iface, BSTR v)
1284 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1285 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1289 static HRESULT WINAPI HTMLStyle_get_borderBottom(IHTMLStyle *iface, BSTR *p)
1291 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1292 FIXME("(%p)->(%p)\n", This, p);
1296 static HRESULT WINAPI HTMLStyle_put_borderLeft(IHTMLStyle *iface, BSTR v)
1298 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1300 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1302 return set_style_attr(This, STYLEID_BORDER_LEFT, v, ATTR_FIX_PX);
1305 static HRESULT WINAPI HTMLStyle_get_borderLeft(IHTMLStyle *iface, BSTR *p)
1307 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1308 FIXME("(%p)->(%p)\n", This, p);
1312 static HRESULT WINAPI HTMLStyle_put_borderColor(IHTMLStyle *iface, BSTR v)
1314 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1315 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1319 static HRESULT WINAPI HTMLStyle_get_borderColor(IHTMLStyle *iface, BSTR *p)
1321 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1322 FIXME("(%p)->(%p)\n", This, p);
1326 static HRESULT WINAPI HTMLStyle_put_borderTopColor(IHTMLStyle *iface, VARIANT v)
1328 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1329 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1333 static HRESULT WINAPI HTMLStyle_get_borderTopColor(IHTMLStyle *iface, VARIANT *p)
1335 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1336 FIXME("(%p)->(%p)\n", This, p);
1340 static HRESULT WINAPI HTMLStyle_put_borderRightColor(IHTMLStyle *iface, VARIANT v)
1342 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1343 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1347 static HRESULT WINAPI HTMLStyle_get_borderRightColor(IHTMLStyle *iface, VARIANT *p)
1349 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1350 FIXME("(%p)->(%p)\n", This, p);
1354 static HRESULT WINAPI HTMLStyle_put_borderBottomColor(IHTMLStyle *iface, VARIANT v)
1356 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1357 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1361 static HRESULT WINAPI HTMLStyle_get_borderBottomColor(IHTMLStyle *iface, VARIANT *p)
1363 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1364 FIXME("(%p)->(%p)\n", This, p);
1368 static HRESULT WINAPI HTMLStyle_put_borderLeftColor(IHTMLStyle *iface, VARIANT v)
1370 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1371 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1375 static HRESULT WINAPI HTMLStyle_get_borderLeftColor(IHTMLStyle *iface, VARIANT *p)
1377 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1378 FIXME("(%p)->(%p)\n", This, p);
1382 static HRESULT WINAPI HTMLStyle_put_borderWidth(IHTMLStyle *iface, BSTR v)
1384 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1385 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1386 return set_style_attr(This, STYLEID_BORDER_WIDTH, v, ATTR_FIX_PX);
1389 static HRESULT WINAPI HTMLStyle_get_borderWidth(IHTMLStyle *iface, BSTR *p)
1391 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1392 TRACE("(%p)->(%p)\n", This, p);
1393 return get_style_attr(This, STYLEID_BORDER_WIDTH, p);
1396 static HRESULT WINAPI HTMLStyle_put_borderTopWidth(IHTMLStyle *iface, VARIANT v)
1398 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1399 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1403 static HRESULT WINAPI HTMLStyle_get_borderTopWidth(IHTMLStyle *iface, VARIANT *p)
1405 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1406 FIXME("(%p)->(%p)\n", This, p);
1410 static HRESULT WINAPI HTMLStyle_put_borderRightWidth(IHTMLStyle *iface, VARIANT v)
1412 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1413 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1417 static HRESULT WINAPI HTMLStyle_get_borderRightWidth(IHTMLStyle *iface, VARIANT *p)
1419 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1420 FIXME("(%p)->(%p)\n", This, p);
1424 static HRESULT WINAPI HTMLStyle_put_borderBottomWidth(IHTMLStyle *iface, VARIANT v)
1426 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1427 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1431 static HRESULT WINAPI HTMLStyle_get_borderBottomWidth(IHTMLStyle *iface, VARIANT *p)
1433 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1434 FIXME("(%p)->(%p)\n", This, p);
1438 static HRESULT WINAPI HTMLStyle_put_borderLeftWidth(IHTMLStyle *iface, VARIANT v)
1440 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1441 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1445 static HRESULT WINAPI HTMLStyle_get_borderLeftWidth(IHTMLStyle *iface, VARIANT *p)
1447 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1448 FIXME("(%p)->(%p)\n", This, p);
1452 static HRESULT WINAPI HTMLStyle_put_borderStyle(IHTMLStyle *iface, BSTR v)
1454 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1455 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1459 static HRESULT WINAPI HTMLStyle_get_borderStyle(IHTMLStyle *iface, BSTR *p)
1461 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1462 FIXME("(%p)->(%p)\n", This, p);
1466 static HRESULT WINAPI HTMLStyle_put_borderTopStyle(IHTMLStyle *iface, BSTR v)
1468 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1469 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1473 static HRESULT WINAPI HTMLStyle_get_borderTopStyle(IHTMLStyle *iface, BSTR *p)
1475 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1476 FIXME("(%p)->(%p)\n", This, p);
1480 static HRESULT WINAPI HTMLStyle_put_borderRightStyle(IHTMLStyle *iface, BSTR v)
1482 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1483 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1485 if(!is_valid_border_style(v))
1486 return E_INVALIDARG;
1488 return set_style_attr(This, STYLEID_BORDER_RIGHT_STYLE, v, 0);
1491 static HRESULT WINAPI HTMLStyle_get_borderRightStyle(IHTMLStyle *iface, BSTR *p)
1493 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1494 TRACE("(%p)->(%p)\n", This, p);
1495 return get_style_attr(This, STYLEID_BORDER_RIGHT_STYLE, p);
1498 static HRESULT WINAPI HTMLStyle_put_borderBottomStyle(IHTMLStyle *iface, BSTR v)
1500 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1501 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1503 if(!is_valid_border_style(v))
1504 return E_INVALIDARG;
1506 return set_style_attr(This, STYLEID_BORDER_BOTTOM_STYLE, v, 0);
1509 static HRESULT WINAPI HTMLStyle_get_borderBottomStyle(IHTMLStyle *iface, BSTR *p)
1511 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1512 TRACE("(%p)->(%p)\n", This, p);
1513 return get_style_attr(This, STYLEID_BORDER_BOTTOM_STYLE, p);
1516 static HRESULT WINAPI HTMLStyle_put_borderLeftStyle(IHTMLStyle *iface, BSTR v)
1518 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1519 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1521 if(!is_valid_border_style(v))
1522 return E_INVALIDARG;
1524 return set_style_attr(This, STYLEID_BORDER_LEFT_STYLE, v, 0);
1527 static HRESULT WINAPI HTMLStyle_get_borderLeftStyle(IHTMLStyle *iface, BSTR *p)
1529 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1530 TRACE("(%p)->(%p)\n", This, p);
1531 return get_style_attr(This, STYLEID_BORDER_LEFT_STYLE, p);
1534 static HRESULT WINAPI HTMLStyle_put_width(IHTMLStyle *iface, VARIANT v)
1536 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1538 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
1542 TRACE("%s\n", debugstr_w(V_BSTR(&v)));
1543 return set_style_attr(This, STYLEID_WIDTH, V_BSTR(&v), 0);
1545 FIXME("unsupported vt %d\n", V_VT(&v));
1551 static HRESULT WINAPI HTMLStyle_get_width(IHTMLStyle *iface, VARIANT *p)
1553 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1555 TRACE("(%p)->(%p)\n", This, p);
1558 return get_style_attr(This, STYLEID_WIDTH, &V_BSTR(p));
1561 static HRESULT WINAPI HTMLStyle_put_height(IHTMLStyle *iface, VARIANT v)
1563 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1565 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1569 return set_style_attr(This, STYLEID_HEIGHT, V_BSTR(&v), 0);
1571 FIXME("unimplemented vt %d\n", V_VT(&v));
1578 static HRESULT WINAPI HTMLStyle_get_height(IHTMLStyle *iface, VARIANT *p)
1580 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1584 TRACE("(%p)->(%p)\n", This, p);
1586 hres = get_style_attr(This, STYLEID_HEIGHT, &ret);
1595 static HRESULT WINAPI HTMLStyle_put_styleFloat(IHTMLStyle *iface, BSTR v)
1597 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1598 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1602 static HRESULT WINAPI HTMLStyle_get_styleFloat(IHTMLStyle *iface, BSTR *p)
1604 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1605 FIXME("(%p)->(%p)\n", This, p);
1609 static HRESULT WINAPI HTMLStyle_put_clear(IHTMLStyle *iface, BSTR v)
1611 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1612 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1616 static HRESULT WINAPI HTMLStyle_get_clear(IHTMLStyle *iface, BSTR *p)
1618 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1619 FIXME("(%p)->(%p)\n", This, p);
1623 static HRESULT WINAPI HTMLStyle_put_display(IHTMLStyle *iface, BSTR v)
1625 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1627 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1629 return set_style_attr(This, STYLEID_DISPLAY, v, 0);
1632 static HRESULT WINAPI HTMLStyle_get_display(IHTMLStyle *iface, BSTR *p)
1634 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1636 TRACE("(%p)->(%p)\n", This, p);
1638 return get_style_attr(This, STYLEID_DISPLAY, p);
1641 static HRESULT WINAPI HTMLStyle_put_visibility(IHTMLStyle *iface, BSTR v)
1643 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1645 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1647 return set_style_attr(This, STYLEID_VISIBILITY, v, 0);
1650 static HRESULT WINAPI HTMLStyle_get_visibility(IHTMLStyle *iface, BSTR *p)
1652 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1654 TRACE("(%p)->(%p)\n", This, p);
1656 return get_style_attr(This, STYLEID_VISIBILITY, p);
1659 static HRESULT WINAPI HTMLStyle_put_listStyleType(IHTMLStyle *iface, BSTR v)
1661 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1662 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1666 static HRESULT WINAPI HTMLStyle_get_listStyleType(IHTMLStyle *iface, BSTR *p)
1668 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1669 FIXME("(%p)->(%p)\n", This, p);
1673 static HRESULT WINAPI HTMLStyle_put_listStylePosition(IHTMLStyle *iface, BSTR v)
1675 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1676 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1680 static HRESULT WINAPI HTMLStyle_get_listStylePosition(IHTMLStyle *iface, BSTR *p)
1682 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1683 FIXME("(%p)->(%p)\n", This, p);
1687 static HRESULT WINAPI HTMLStyle_put_listStyleImage(IHTMLStyle *iface, BSTR v)
1689 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1690 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1694 static HRESULT WINAPI HTMLStyle_get_listStyleImage(IHTMLStyle *iface, BSTR *p)
1696 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1697 FIXME("(%p)->(%p)\n", This, p);
1701 static HRESULT WINAPI HTMLStyle_put_listStyle(IHTMLStyle *iface, BSTR v)
1703 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1704 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1708 static HRESULT WINAPI HTMLStyle_get_listStyle(IHTMLStyle *iface, BSTR *p)
1710 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1711 FIXME("(%p)->(%p)\n", This, p);
1715 static HRESULT WINAPI HTMLStyle_put_whiteSpace(IHTMLStyle *iface, BSTR v)
1717 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1718 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1722 static HRESULT WINAPI HTMLStyle_get_whiteSpace(IHTMLStyle *iface, BSTR *p)
1724 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1725 FIXME("(%p)->(%p)\n", This, p);
1729 static HRESULT WINAPI HTMLStyle_put_top(IHTMLStyle *iface, VARIANT v)
1731 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1733 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1735 return set_nsstyle_attr_var(This->nsstyle, STYLEID_TOP, &v, 0);
1738 static HRESULT WINAPI HTMLStyle_get_top(IHTMLStyle *iface, VARIANT *p)
1740 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1744 TRACE("(%p)->(%p)\n", This, p);
1746 hres = get_style_attr(This, STYLEID_TOP, &ret);
1755 static HRESULT WINAPI HTMLStyle_put_left(IHTMLStyle *iface, VARIANT v)
1757 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1759 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1761 return set_nsstyle_attr_var(This->nsstyle, STYLEID_LEFT, &v, 0);
1764 static HRESULT WINAPI HTMLStyle_get_left(IHTMLStyle *iface, VARIANT *p)
1766 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1770 TRACE("(%p)->(%p)\n", This, p);
1772 hres = get_style_attr(This, STYLEID_LEFT, &ret);
1781 static HRESULT WINAPI HTMLStyle_get_position(IHTMLStyle *iface, BSTR *p)
1783 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1784 TRACE("(%p)->(%p)\n", This, p);
1785 return IHTMLStyle2_get_position(HTMLSTYLE2(This), p);
1788 static HRESULT WINAPI HTMLStyle_put_zIndex(IHTMLStyle *iface, VARIANT v)
1790 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1792 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1796 return set_style_attr(This, STYLEID_Z_INDEX, V_BSTR(&v), 0);
1799 static const WCHAR format[] = {'%','d',0};
1801 wsprintfW(value, format, V_I4(&v));
1802 return set_style_attr(This, STYLEID_Z_INDEX, value, 0);
1805 FIXME("unimplemented vt %d\n", V_VT(&v));
1812 static HRESULT WINAPI HTMLStyle_get_zIndex(IHTMLStyle *iface, VARIANT *p)
1814 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1816 TRACE("(%p)->(%p)\n", This, p);
1818 return get_nsstyle_attr_var(This->nsstyle, STYLEID_Z_INDEX, p, ATTR_STR_TO_INT);
1821 static HRESULT WINAPI HTMLStyle_put_overflow(IHTMLStyle *iface, BSTR v)
1823 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1824 static const WCHAR szVisible[] = {'v','i','s','i','b','l','e',0};
1825 static const WCHAR szScroll[] = {'s','c','r','o','l','l',0};
1826 static const WCHAR szHidden[] = {'h','i','d','d','e','n',0};
1827 static const WCHAR szAuto[] = {'a','u','t','o',0};
1829 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1831 /* overflow can only be one of the follow values. */
1832 if(!v || strcmpiW(szVisible, v) == 0 || strcmpiW(szScroll, v) == 0 ||
1833 strcmpiW(szHidden, v) == 0 || strcmpiW(szAuto, v) == 0)
1835 return set_nsstyle_attr(This->nsstyle, STYLEID_OVERFLOW, v, 0);
1838 return E_INVALIDARG;
1842 static HRESULT WINAPI HTMLStyle_get_overflow(IHTMLStyle *iface, BSTR *p)
1844 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1846 TRACE("(%p)->(%p)\n", This, p);
1849 return E_INVALIDARG;
1851 return get_style_attr(This, STYLEID_OVERFLOW, p);
1854 static HRESULT WINAPI HTMLStyle_put_pageBreakBefore(IHTMLStyle *iface, BSTR v)
1856 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1857 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1861 static HRESULT WINAPI HTMLStyle_get_pageBreakBefore(IHTMLStyle *iface, BSTR *p)
1863 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1864 FIXME("(%p)->(%p)\n", This, p);
1868 static HRESULT WINAPI HTMLStyle_put_pageBreakAfter(IHTMLStyle *iface, BSTR v)
1870 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1871 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1875 static HRESULT WINAPI HTMLStyle_get_pageBreakAfter(IHTMLStyle *iface, BSTR *p)
1877 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1878 FIXME("(%p)->(%p)\n", This, p);
1882 static HRESULT WINAPI HTMLStyle_put_cssText(IHTMLStyle *iface, BSTR v)
1884 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1885 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1889 static HRESULT WINAPI HTMLStyle_get_cssText(IHTMLStyle *iface, BSTR *p)
1891 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1892 FIXME("(%p)->(%p)\n", This, p);
1896 static HRESULT WINAPI HTMLStyle_put_pixelTop(IHTMLStyle *iface, long v)
1898 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1899 FIXME("(%p)->()\n", This);
1903 static HRESULT WINAPI HTMLStyle_get_pixelTop(IHTMLStyle *iface, long *p)
1905 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1906 FIXME("(%p)->()\n", This);
1910 static HRESULT WINAPI HTMLStyle_put_pixelLeft(IHTMLStyle *iface, long v)
1912 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1913 FIXME("(%p)->()\n", This);
1917 static HRESULT WINAPI HTMLStyle_get_pixelLeft(IHTMLStyle *iface, long *p)
1919 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1920 FIXME("(%p)->()\n", This);
1924 static HRESULT WINAPI HTMLStyle_put_pixelWidth(IHTMLStyle *iface, long v)
1926 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1927 FIXME("(%p)->()\n", This);
1931 static HRESULT WINAPI HTMLStyle_get_pixelWidth(IHTMLStyle *iface, long *p)
1933 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1934 FIXME("(%p)->()\n", This);
1938 static HRESULT WINAPI HTMLStyle_put_pixelHeight(IHTMLStyle *iface, long v)
1940 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1941 FIXME("(%p)->()\n", This);
1945 static HRESULT WINAPI HTMLStyle_get_pixelHeight(IHTMLStyle *iface, long *p)
1947 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1948 FIXME("(%p)->()\n", This);
1952 static HRESULT WINAPI HTMLStyle_put_posTop(IHTMLStyle *iface, float v)
1954 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1956 TRACE("(%p)->(%f)\n", This, v);
1958 return set_style_pos(This, STYLEID_TOP, v);
1961 static HRESULT WINAPI HTMLStyle_get_posTop(IHTMLStyle *iface, float *p)
1963 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1965 TRACE("(%p)->(%p)\n", This, p);
1970 return get_nsstyle_pos(This, STYLEID_TOP, p);
1973 static HRESULT WINAPI HTMLStyle_put_posLeft(IHTMLStyle *iface, float v)
1975 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1977 TRACE("(%p)->(%f)\n", This, v);
1979 return set_style_pos(This, STYLEID_LEFT, v);
1982 static HRESULT WINAPI HTMLStyle_get_posLeft(IHTMLStyle *iface, float *p)
1984 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1986 TRACE("(%p)->(%p)\n", This, p);
1991 return get_nsstyle_pos(This, STYLEID_LEFT, p);
1994 static HRESULT WINAPI HTMLStyle_put_posWidth(IHTMLStyle *iface, float v)
1996 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1998 TRACE("(%p)->(%f)\n", This, v);
2000 return set_style_pos(This, STYLEID_WIDTH, v);
2003 static HRESULT WINAPI HTMLStyle_get_posWidth(IHTMLStyle *iface, float *p)
2005 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2007 TRACE("(%p)->(%p)\n", This, p);
2012 if(get_nsstyle_pos(This, STYLEID_WIDTH, p) != S_OK)
2018 static HRESULT WINAPI HTMLStyle_put_posHeight(IHTMLStyle *iface, float v)
2020 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2022 TRACE("(%p)->(%f)\n", This, v);
2024 return set_style_pos(This, STYLEID_HEIGHT, v);
2027 static HRESULT WINAPI HTMLStyle_get_posHeight(IHTMLStyle *iface, float *p)
2029 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2031 TRACE("(%p)->(%p)\n", This, p);
2036 if(get_nsstyle_pos(This, STYLEID_HEIGHT, p) != S_OK)
2042 static HRESULT WINAPI HTMLStyle_put_cursor(IHTMLStyle *iface, BSTR v)
2044 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2046 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2048 return set_style_attr(This, STYLEID_CURSOR, v, 0);
2051 static HRESULT WINAPI HTMLStyle_get_cursor(IHTMLStyle *iface, BSTR *p)
2053 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2055 TRACE("(%p)->(%p)\n", This, p);
2057 return get_style_attr(This, STYLEID_CURSOR, p);
2060 static HRESULT WINAPI HTMLStyle_put_clip(IHTMLStyle *iface, BSTR v)
2062 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2063 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
2067 static HRESULT WINAPI HTMLStyle_get_clip(IHTMLStyle *iface, BSTR *p)
2069 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2070 FIXME("(%p)->(%p)\n", This, p);
2074 static HRESULT WINAPI HTMLStyle_put_filter(IHTMLStyle *iface, BSTR v)
2076 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2078 WARN("(%p)->(%s)\n", This, debugstr_w(v));
2080 /* FIXME: Handle MS-style filters */
2081 return set_style_attr(This, STYLEID_FILTER, v, 0);
2084 static HRESULT WINAPI HTMLStyle_get_filter(IHTMLStyle *iface, BSTR *p)
2086 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2088 WARN("(%p)->(%p)\n", This, p);
2090 /* FIXME: Handle MS-style filters */
2091 return get_style_attr(This, STYLEID_FILTER, p);
2094 static HRESULT WINAPI HTMLStyle_setAttribute(IHTMLStyle *iface, BSTR strAttributeName,
2095 VARIANT AttributeValue, LONG lFlags)
2097 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2101 TRACE("(%p)->(%s v%d %08x)\n", This, debugstr_w(strAttributeName),
2102 V_VT(&AttributeValue), lFlags);
2104 if(!strAttributeName)
2105 return E_INVALIDARG;
2108 FIXME("Parameter lFlags ignored\n");
2110 hres = HTMLStyle_GetIDsOfNames(iface, &IID_NULL, (LPOLESTR*)&strAttributeName, 1,
2111 LOCALE_USER_DEFAULT, &dispid);
2115 DISPID dispidNamed = DISPID_PROPERTYPUT;
2119 params.rgvarg = &AttributeValue;
2120 params.cNamedArgs = 1;
2121 params.rgdispidNamedArgs = &dispidNamed;
2123 hres = HTMLStyle_Invoke(iface, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
2124 DISPATCH_PROPERTYPUT, ¶ms, &ret, NULL, NULL);
2128 FIXME("Custom attributes not supported.\n");
2131 TRACE("ret: %08x\n", hres);
2136 static HRESULT WINAPI HTMLStyle_getAttribute(IHTMLStyle *iface, BSTR strAttributeName,
2137 LONG lFlags, VARIANT *AttributeValue)
2139 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2143 TRACE("(%p)->(%s v%p %08x)\n", This, debugstr_w(strAttributeName),
2144 AttributeValue, lFlags);
2146 if(!AttributeValue || !strAttributeName)
2147 return E_INVALIDARG;
2150 FIXME("Parameter lFlags ignored\n");
2152 hres = HTMLStyle_GetIDsOfNames(iface, &IID_NULL, (LPOLESTR*)&strAttributeName, 1,
2153 LOCALE_USER_DEFAULT, &dispid);
2156 DISPPARAMS params = {NULL, NULL, 0, 0 };
2158 hres = HTMLStyle_Invoke(iface, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
2159 DISPATCH_PROPERTYGET, ¶ms, AttributeValue, NULL, NULL);
2163 FIXME("Custom attributes not supported.\n");
2169 static HRESULT WINAPI HTMLStyle_removeAttribute(IHTMLStyle *iface, BSTR strAttributeName,
2170 LONG lFlags, VARIANT_BOOL *pfSuccess)
2172 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2173 FIXME("(%p)->(%s %08x %p)\n", This, debugstr_w(strAttributeName),
2178 static HRESULT WINAPI HTMLStyle_toString(IHTMLStyle *iface, BSTR *String)
2180 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2181 FIXME("(%p)->(%p)\n", This, String);
2185 static HRESULT HTMLStyle_get_dispid(IUnknown *iface, BSTR name, DWORD flags, DISPID *dispid)
2187 int c, i, min=0, max = sizeof(style_tbl)/sizeof(*style_tbl)-1;
2192 c = strcmpW(style_tbl[i].name, name);
2194 *dispid = style_tbl[i].dispid;
2204 return DISP_E_UNKNOWNNAME;
2207 static const IHTMLStyleVtbl HTMLStyleVtbl = {
2208 HTMLStyle_QueryInterface,
2211 HTMLStyle_GetTypeInfoCount,
2212 HTMLStyle_GetTypeInfo,
2213 HTMLStyle_GetIDsOfNames,
2215 HTMLStyle_put_fontFamily,
2216 HTMLStyle_get_fontFamily,
2217 HTMLStyle_put_fontStyle,
2218 HTMLStyle_get_fontStyle,
2219 HTMLStyle_put_fontVariant,
2220 HTMLStyle_get_fontVariant,
2221 HTMLStyle_put_fontWeight,
2222 HTMLStyle_get_fontWeight,
2223 HTMLStyle_put_fontSize,
2224 HTMLStyle_get_fontSize,
2227 HTMLStyle_put_color,
2228 HTMLStyle_get_color,
2229 HTMLStyle_put_background,
2230 HTMLStyle_get_background,
2231 HTMLStyle_put_backgroundColor,
2232 HTMLStyle_get_backgroundColor,
2233 HTMLStyle_put_backgroundImage,
2234 HTMLStyle_get_backgroundImage,
2235 HTMLStyle_put_backgroundRepeat,
2236 HTMLStyle_get_backgroundRepeat,
2237 HTMLStyle_put_backgroundAttachment,
2238 HTMLStyle_get_backgroundAttachment,
2239 HTMLStyle_put_backgroundPosition,
2240 HTMLStyle_get_backgroundPosition,
2241 HTMLStyle_put_backgroundPositionX,
2242 HTMLStyle_get_backgroundPositionX,
2243 HTMLStyle_put_backgroundPositionY,
2244 HTMLStyle_get_backgroundPositionY,
2245 HTMLStyle_put_wordSpacing,
2246 HTMLStyle_get_wordSpacing,
2247 HTMLStyle_put_letterSpacing,
2248 HTMLStyle_get_letterSpacing,
2249 HTMLStyle_put_textDecoration,
2250 HTMLStyle_get_textDecoration,
2251 HTMLStyle_put_textDecorationNone,
2252 HTMLStyle_get_textDecorationNone,
2253 HTMLStyle_put_textDecorationUnderline,
2254 HTMLStyle_get_textDecorationUnderline,
2255 HTMLStyle_put_textDecorationOverline,
2256 HTMLStyle_get_textDecorationOverline,
2257 HTMLStyle_put_textDecorationLineThrough,
2258 HTMLStyle_get_textDecorationLineThrough,
2259 HTMLStyle_put_textDecorationBlink,
2260 HTMLStyle_get_textDecorationBlink,
2261 HTMLStyle_put_verticalAlign,
2262 HTMLStyle_get_verticalAlign,
2263 HTMLStyle_put_textTransform,
2264 HTMLStyle_get_textTransform,
2265 HTMLStyle_put_textAlign,
2266 HTMLStyle_get_textAlign,
2267 HTMLStyle_put_textIndent,
2268 HTMLStyle_get_textIndent,
2269 HTMLStyle_put_lineHeight,
2270 HTMLStyle_get_lineHeight,
2271 HTMLStyle_put_marginTop,
2272 HTMLStyle_get_marginTop,
2273 HTMLStyle_put_marginRight,
2274 HTMLStyle_get_marginRight,
2275 HTMLStyle_put_marginBottom,
2276 HTMLStyle_get_marginBottom,
2277 HTMLStyle_put_marginLeft,
2278 HTMLStyle_get_marginLeft,
2279 HTMLStyle_put_margin,
2280 HTMLStyle_get_margin,
2281 HTMLStyle_put_paddingTop,
2282 HTMLStyle_get_paddingTop,
2283 HTMLStyle_put_paddingRight,
2284 HTMLStyle_get_paddingRight,
2285 HTMLStyle_put_paddingBottom,
2286 HTMLStyle_get_paddingBottom,
2287 HTMLStyle_put_paddingLeft,
2288 HTMLStyle_get_paddingLeft,
2289 HTMLStyle_put_padding,
2290 HTMLStyle_get_padding,
2291 HTMLStyle_put_border,
2292 HTMLStyle_get_border,
2293 HTMLStyle_put_borderTop,
2294 HTMLStyle_get_borderTop,
2295 HTMLStyle_put_borderRight,
2296 HTMLStyle_get_borderRight,
2297 HTMLStyle_put_borderBottom,
2298 HTMLStyle_get_borderBottom,
2299 HTMLStyle_put_borderLeft,
2300 HTMLStyle_get_borderLeft,
2301 HTMLStyle_put_borderColor,
2302 HTMLStyle_get_borderColor,
2303 HTMLStyle_put_borderTopColor,
2304 HTMLStyle_get_borderTopColor,
2305 HTMLStyle_put_borderRightColor,
2306 HTMLStyle_get_borderRightColor,
2307 HTMLStyle_put_borderBottomColor,
2308 HTMLStyle_get_borderBottomColor,
2309 HTMLStyle_put_borderLeftColor,
2310 HTMLStyle_get_borderLeftColor,
2311 HTMLStyle_put_borderWidth,
2312 HTMLStyle_get_borderWidth,
2313 HTMLStyle_put_borderTopWidth,
2314 HTMLStyle_get_borderTopWidth,
2315 HTMLStyle_put_borderRightWidth,
2316 HTMLStyle_get_borderRightWidth,
2317 HTMLStyle_put_borderBottomWidth,
2318 HTMLStyle_get_borderBottomWidth,
2319 HTMLStyle_put_borderLeftWidth,
2320 HTMLStyle_get_borderLeftWidth,
2321 HTMLStyle_put_borderStyle,
2322 HTMLStyle_get_borderStyle,
2323 HTMLStyle_put_borderTopStyle,
2324 HTMLStyle_get_borderTopStyle,
2325 HTMLStyle_put_borderRightStyle,
2326 HTMLStyle_get_borderRightStyle,
2327 HTMLStyle_put_borderBottomStyle,
2328 HTMLStyle_get_borderBottomStyle,
2329 HTMLStyle_put_borderLeftStyle,
2330 HTMLStyle_get_borderLeftStyle,
2331 HTMLStyle_put_width,
2332 HTMLStyle_get_width,
2333 HTMLStyle_put_height,
2334 HTMLStyle_get_height,
2335 HTMLStyle_put_styleFloat,
2336 HTMLStyle_get_styleFloat,
2337 HTMLStyle_put_clear,
2338 HTMLStyle_get_clear,
2339 HTMLStyle_put_display,
2340 HTMLStyle_get_display,
2341 HTMLStyle_put_visibility,
2342 HTMLStyle_get_visibility,
2343 HTMLStyle_put_listStyleType,
2344 HTMLStyle_get_listStyleType,
2345 HTMLStyle_put_listStylePosition,
2346 HTMLStyle_get_listStylePosition,
2347 HTMLStyle_put_listStyleImage,
2348 HTMLStyle_get_listStyleImage,
2349 HTMLStyle_put_listStyle,
2350 HTMLStyle_get_listStyle,
2351 HTMLStyle_put_whiteSpace,
2352 HTMLStyle_get_whiteSpace,
2357 HTMLStyle_get_position,
2358 HTMLStyle_put_zIndex,
2359 HTMLStyle_get_zIndex,
2360 HTMLStyle_put_overflow,
2361 HTMLStyle_get_overflow,
2362 HTMLStyle_put_pageBreakBefore,
2363 HTMLStyle_get_pageBreakBefore,
2364 HTMLStyle_put_pageBreakAfter,
2365 HTMLStyle_get_pageBreakAfter,
2366 HTMLStyle_put_cssText,
2367 HTMLStyle_get_cssText,
2368 HTMLStyle_put_pixelTop,
2369 HTMLStyle_get_pixelTop,
2370 HTMLStyle_put_pixelLeft,
2371 HTMLStyle_get_pixelLeft,
2372 HTMLStyle_put_pixelWidth,
2373 HTMLStyle_get_pixelWidth,
2374 HTMLStyle_put_pixelHeight,
2375 HTMLStyle_get_pixelHeight,
2376 HTMLStyle_put_posTop,
2377 HTMLStyle_get_posTop,
2378 HTMLStyle_put_posLeft,
2379 HTMLStyle_get_posLeft,
2380 HTMLStyle_put_posWidth,
2381 HTMLStyle_get_posWidth,
2382 HTMLStyle_put_posHeight,
2383 HTMLStyle_get_posHeight,
2384 HTMLStyle_put_cursor,
2385 HTMLStyle_get_cursor,
2388 HTMLStyle_put_filter,
2389 HTMLStyle_get_filter,
2390 HTMLStyle_setAttribute,
2391 HTMLStyle_getAttribute,
2392 HTMLStyle_removeAttribute,
2396 static const dispex_static_data_vtbl_t HTMLStyle_dispex_vtbl = {
2397 HTMLStyle_get_dispid,
2401 static const tid_t HTMLStyle_iface_tids[] = {
2406 static dispex_static_data_t HTMLStyle_dispex = {
2407 &HTMLStyle_dispex_vtbl,
2410 HTMLStyle_iface_tids
2413 IHTMLStyle *HTMLStyle_Create(nsIDOMCSSStyleDeclaration *nsstyle)
2415 HTMLStyle *ret = heap_alloc_zero(sizeof(HTMLStyle));
2417 ret->lpHTMLStyleVtbl = &HTMLStyleVtbl;
2419 ret->nsstyle = nsstyle;
2420 HTMLStyle2_Init(ret);
2422 nsIDOMCSSStyleDeclaration_AddRef(nsstyle);
2424 init_dispex(&ret->dispex, (IUnknown*)HTMLSTYLE(ret), &HTMLStyle_dispex);
2426 return HTMLSTYLE(ret);