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 attrBorderLeft[] =
47 {'b','o','r','d','e','r','-','l','e','f','t',0};
48 static const WCHAR attrBorderLeftStyle[] =
49 {'b','o','r','d','e','r','-','l','e','f','t','-','s','t','y','l','e',0};
50 static const WCHAR attrBorderWidth[] =
51 {'b','o','r','d','e','r','-','w','i','d','t','h',0};
52 static const WCHAR attrColor[] =
53 {'c','o','l','o','r',0};
54 static const WCHAR attrCursor[] =
55 {'c','u','r','s','o','r',0};
56 static const WCHAR attrDisplay[] =
57 {'d','i','s','p','l','a','y',0};
58 static const WCHAR attrFilter[] =
59 {'f','i','l','e','t','e','r',0};
60 static const WCHAR attrFontFamily[] =
61 {'f','o','n','t','-','f','a','m','i','l','y',0};
62 static const WCHAR attrFontSize[] =
63 {'f','o','n','t','-','s','i','z','e',0};
64 static const WCHAR attrFontStyle[] =
65 {'f','o','n','t','-','s','t','y','l','e',0};
66 static const WCHAR attrFontVariant[] =
67 {'f','o','n','t','-','v','a','r','i','a','n','t',0};
68 static const WCHAR attrFontWeight[] =
69 {'f','o','n','t','-','w','e','i','g','h','t',0};
70 static const WCHAR attrHeight[] =
71 {'h','e','i','g','h','t',0};
72 static const WCHAR attrLeft[] =
74 static const WCHAR attrMargin[] =
75 {'m','a','r','g','i','n',0};
76 static const WCHAR attrMarginLeft[] =
77 {'m','a','r','g','i','n','-','l','e','f','t',0};
78 static const WCHAR attrMarginRight[] =
79 {'m','a','r','g','i','n','-','r','i','g','h','t',0};
80 static const WCHAR attrOverflow[] =
81 {'o','v','e','r','f','l','o','w',0};
82 static const WCHAR attrPaddingLeft[] =
83 {'p','a','d','d','i','n','g','-','l','e','f','t',0};
84 static const WCHAR attrPosition[] =
85 {'p','o','s','i','t','i','o','n',0};
86 static const WCHAR attrTextAlign[] =
87 {'t','e','x','t','-','a','l','i','g','n',0};
88 static const WCHAR attrTextDecoration[] =
89 {'t','e','x','t','-','d','e','c','o','r','a','t','i','o','n',0};
90 static const WCHAR attrTop[] =
92 static const WCHAR attrVerticalAlign[] =
93 {'v','e','r','t','i','c','a','l','-','a','l','i','g','n',0};
94 static const WCHAR attrVisibility[] =
95 {'v','i','s','i','b','i','l','i','t','y',0};
96 static const WCHAR attrWidth[] =
97 {'w','i','d','t','h',0};
98 static const WCHAR attrZIndex[] =
99 {'z','-','i','n','d','e','x',0};
105 {attrBackground, DISPID_IHTMLSTYLE_BACKGROUND},
106 {attrBackgroundColor, DISPID_IHTMLSTYLE_BACKGROUNDCOLOR},
107 {attrBackgroundImage, DISPID_IHTMLSTYLE_BACKGROUNDIMAGE},
108 {attrBorder, DISPID_IHTMLSTYLE_BORDER},
109 {attrBorderLeft, DISPID_IHTMLSTYLE_BORDERLEFT},
110 {attrBorderLeftStyle, DISPID_IHTMLSTYLE_BORDERLEFTSTYLE},
111 {attrBorderWidth, DISPID_IHTMLSTYLE_BORDERWIDTH},
112 {attrColor, DISPID_IHTMLSTYLE_COLOR},
113 {attrCursor, DISPID_IHTMLSTYLE_CURSOR},
114 {attrDisplay, DISPID_IHTMLSTYLE_DISPLAY},
115 {attrFilter, DISPID_IHTMLSTYLE_FILTER},
116 {attrFontFamily, DISPID_IHTMLSTYLE_FONTFAMILY},
117 {attrFontSize, DISPID_IHTMLSTYLE_FONTSIZE},
118 {attrFontStyle, DISPID_IHTMLSTYLE_FONTSTYLE},
119 {attrFontVariant, DISPID_IHTMLSTYLE_FONTVARIANT},
120 {attrFontWeight, DISPID_IHTMLSTYLE_FONTWEIGHT},
121 {attrHeight, DISPID_IHTMLSTYLE_HEIGHT},
122 {attrLeft, DISPID_IHTMLSTYLE_LEFT},
123 {attrMargin, DISPID_IHTMLSTYLE_MARGIN},
124 {attrMarginLeft, DISPID_IHTMLSTYLE_MARGINLEFT},
125 {attrMarginRight, DISPID_IHTMLSTYLE_MARGINRIGHT},
126 {attrOverflow, DISPID_IHTMLSTYLE_OVERFLOW},
127 {attrPaddingLeft, DISPID_IHTMLSTYLE_PADDINGLEFT},
128 {attrPosition, DISPID_IHTMLSTYLE2_POSITION},
129 {attrTextAlign, DISPID_IHTMLSTYLE_TEXTALIGN},
130 {attrTextDecoration, DISPID_IHTMLSTYLE_TEXTDECORATION},
131 {attrTop, DISPID_IHTMLSTYLE_TOP},
132 {attrVerticalAlign, DISPID_IHTMLSTYLE_VERTICALALIGN},
133 {attrVisibility, DISPID_IHTMLSTYLE_VISIBILITY},
134 {attrWidth, DISPID_IHTMLSTYLE_WIDTH},
135 {attrZIndex, DISPID_IHTMLSTYLE_ZINDEX}
138 static const WCHAR valLineThrough[] =
139 {'l','i','n','e','-','t','h','r','o','u','g','h',0};
140 static const WCHAR valUnderline[] =
141 {'u','n','d','e','r','l','i','n','e',0};
142 static const WCHAR szNormal[] =
143 {'n','o','r','m','a','l',0};
145 static const WCHAR px_formatW[] = {'%','d','p','x',0};
146 static const WCHAR emptyW[] = {0};
148 static LPWSTR fix_px_value(LPCWSTR val)
153 while(*ptr && isspaceW(*ptr))
158 while(*ptr && isdigitW(*ptr))
161 if(!*ptr || isspaceW(*ptr)) {
163 int len = strlenW(val)+1;
165 ret = heap_alloc((len+2)*sizeof(WCHAR));
166 memcpy(ret, val, (ptr-val)*sizeof(WCHAR));
172 TRACE("fixed %s -> %s\n", debugstr_w(val), debugstr_w(ret));
177 while(*ptr && !isspaceW(*ptr))
184 static LPWSTR fix_url_value(LPCWSTR val)
188 static const WCHAR urlW[] = {'u','r','l','('};
190 if(strncmpW(val, urlW, sizeof(urlW)/sizeof(WCHAR)) || !strchrW(val, '\\'))
193 ret = heap_strdupW(val);
195 for(ptr = ret; *ptr; ptr++) {
203 #define ATTR_FIX_PX 1
204 #define ATTR_FIX_URL 2
205 #define ATTR_STR_TO_INT 4
207 HRESULT set_nsstyle_attr(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, LPCWSTR value, DWORD flags)
209 nsAString str_name, str_value, str_empty;
213 static const PRUnichar wszEmpty[] = {0};
215 if(flags & ATTR_FIX_PX)
216 val = fix_px_value(value);
217 if(flags & ATTR_FIX_URL)
218 val = fix_url_value(value);
220 nsAString_Init(&str_name, style_tbl[sid].name);
221 nsAString_Init(&str_value, val ? val : value);
222 nsAString_Init(&str_empty, wszEmpty);
225 nsres = nsIDOMCSSStyleDeclaration_SetProperty(nsstyle, &str_name, &str_value, &str_empty);
227 ERR("SetProperty failed: %08x\n", nsres);
229 nsAString_Finish(&str_name);
230 nsAString_Finish(&str_value);
231 nsAString_Finish(&str_empty);
236 static HRESULT set_nsstyle_attr_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, VARIANT *value, DWORD flags)
238 switch(V_VT(value)) {
240 return set_nsstyle_attr(nsstyle, sid, emptyW, flags);
243 return set_nsstyle_attr(nsstyle, sid, V_BSTR(value), flags);
246 FIXME("not implemented vt %d\n", V_VT(value));
254 static inline HRESULT set_style_attr(HTMLStyle *This, styleid_t sid, LPCWSTR value, DWORD flags)
256 return set_nsstyle_attr(This->nsstyle, sid, value, flags);
259 static HRESULT get_nsstyle_attr_nsval(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, nsAString *value)
264 nsAString_Init(&str_name, style_tbl[sid].name);
266 nsres = nsIDOMCSSStyleDeclaration_GetPropertyValue(nsstyle, &str_name, value);
267 if(NS_FAILED(nsres)) {
268 ERR("SetProperty failed: %08x\n", nsres);
272 nsAString_Finish(&str_name);
277 HRESULT get_nsstyle_attr(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, BSTR *p)
280 const PRUnichar *value;
282 nsAString_Init(&str_value, NULL);
284 get_nsstyle_attr_nsval(nsstyle, sid, &str_value);
286 nsAString_GetData(&str_value, &value);
287 *p = *value ? SysAllocString(value) : NULL;
289 nsAString_Finish(&str_value);
291 TRACE("%s -> %s\n", debugstr_w(style_tbl[sid].name), debugstr_w(*p));
295 static HRESULT get_nsstyle_attr_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, VARIANT *p, DWORD flags)
298 const PRUnichar *value;
301 nsAString_Init(&str_value, NULL);
303 get_nsstyle_attr_nsval(nsstyle, sid, &str_value);
305 nsAString_GetData(&str_value, &value);
307 if(flags & ATTR_STR_TO_INT) {
308 const PRUnichar *ptr = value;
317 while(isdigitW(*ptr))
318 i = i*10 + (*ptr++ - '0');
322 V_I4(p) = neg ? -i : i;
331 str = SysAllocString(value);
333 return E_OUTOFMEMORY;
340 nsAString_Finish(&str_value);
342 TRACE("%s -> %s\n", debugstr_w(style_tbl[sid].name), debugstr_variant(p));
346 static inline HRESULT get_style_attr(HTMLStyle *This, styleid_t sid, BSTR *p)
348 return get_nsstyle_attr(This->nsstyle, sid, p);
351 static HRESULT check_style_attr_value(HTMLStyle *This, styleid_t sid, LPCWSTR exval, VARIANT_BOOL *p)
354 const PRUnichar *value;
356 nsAString_Init(&str_value, NULL);
358 get_nsstyle_attr_nsval(This->nsstyle, sid, &str_value);
360 nsAString_GetData(&str_value, &value);
361 *p = strcmpW(value, exval) ? VARIANT_FALSE : VARIANT_TRUE;
362 nsAString_Finish(&str_value);
364 TRACE("%s -> %x\n", debugstr_w(style_tbl[sid].name), *p);
368 static inline HRESULT set_style_pos(HTMLStyle *This, styleid_t sid, float value)
371 WCHAR szFormat[] = {'%','.','0','f','p','x',0};
373 value = floor(value);
375 sprintfW(szValue, szFormat, value);
377 return set_style_attr(This, sid, szValue, 0);
380 static HRESULT get_nsstyle_pos(HTMLStyle *This, styleid_t sid, float *p)
384 WCHAR pxW[] = {'p','x',0};
386 TRACE("%p %d %p\n", This, sid, p);
390 nsAString_Init(&str_value, NULL);
392 hres = get_nsstyle_attr_nsval(This->nsstyle, sid, &str_value);
396 const PRUnichar *value;
398 nsAString_GetData(&str_value, &value);
401 *p = strtolW(value, &ptr, 10);
403 if(*ptr && strcmpW(ptr, pxW))
405 nsAString_Finish(&str_value);
406 FIXME("only px values are currently supported\n");
412 TRACE("ret %f\n", *p);
414 nsAString_Finish(&str_value);
419 static BOOL is_valid_border_style(BSTR v)
421 static const WCHAR styleNone[] = {'n','o','n','e',0};
422 static const WCHAR styleDotted[] = {'d','o','t','t','e','d',0};
423 static const WCHAR styleDashed[] = {'d','a','s','h','e','d',0};
424 static const WCHAR styleSolid[] = {'s','o','l','i','d',0};
425 static const WCHAR styleDouble[] = {'d','o','u','b','l','e',0};
426 static const WCHAR styleGroove[] = {'g','r','o','o','v','e',0};
427 static const WCHAR styleRidge[] = {'r','i','d','g','e',0};
428 static const WCHAR styleInset[] = {'i','n','s','e','t',0};
429 static const WCHAR styleOutset[] = {'o','u','t','s','e','t',0};
431 TRACE("%s\n", debugstr_w(v));
433 if(!v || strcmpiW(v, styleNone) == 0 || strcmpiW(v, styleDotted) == 0 ||
434 strcmpiW(v, styleDashed) == 0 || strcmpiW(v, styleSolid) == 0 ||
435 strcmpiW(v, styleDouble) == 0 || strcmpiW(v, styleGroove) == 0 ||
436 strcmpiW(v, styleRidge) == 0 || strcmpiW(v, styleInset) == 0 ||
437 strcmpiW(v, styleOutset) == 0 )
445 #define HTMLSTYLE_THIS(iface) DEFINE_THIS(HTMLStyle, HTMLStyle, iface)
447 static HRESULT WINAPI HTMLStyle_QueryInterface(IHTMLStyle *iface, REFIID riid, void **ppv)
449 HTMLStyle *This = HTMLSTYLE_THIS(iface);
453 if(IsEqualGUID(&IID_IUnknown, riid)) {
454 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
455 *ppv = HTMLSTYLE(This);
456 }else if(IsEqualGUID(&IID_IHTMLStyle, riid)) {
457 TRACE("(%p)->(IID_IHTMLStyle %p)\n", This, ppv);
458 *ppv = HTMLSTYLE(This);
459 }else if(IsEqualGUID(&IID_IHTMLStyle2, riid)) {
460 TRACE("(%p)->(IID_IHTMLStyle2 %p)\n", This, ppv);
461 *ppv = HTMLSTYLE2(This);
462 }else if(dispex_query_interface(&This->dispex, riid, ppv)) {
463 return *ppv ? S_OK : E_NOINTERFACE;
467 IUnknown_AddRef((IUnknown*)*ppv);
471 WARN("unsupported %s\n", debugstr_guid(riid));
472 return E_NOINTERFACE;
475 static ULONG WINAPI HTMLStyle_AddRef(IHTMLStyle *iface)
477 HTMLStyle *This = HTMLSTYLE_THIS(iface);
478 LONG ref = InterlockedIncrement(&This->ref);
480 TRACE("(%p) ref=%d\n", This, ref);
485 static ULONG WINAPI HTMLStyle_Release(IHTMLStyle *iface)
487 HTMLStyle *This = HTMLSTYLE_THIS(iface);
488 LONG ref = InterlockedDecrement(&This->ref);
490 TRACE("(%p) ref=%d\n", This, ref);
494 nsIDOMCSSStyleDeclaration_Release(This->nsstyle);
501 static HRESULT WINAPI HTMLStyle_GetTypeInfoCount(IHTMLStyle *iface, UINT *pctinfo)
503 HTMLStyle *This = HTMLSTYLE_THIS(iface);
504 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->dispex), pctinfo);
507 static HRESULT WINAPI HTMLStyle_GetTypeInfo(IHTMLStyle *iface, UINT iTInfo,
508 LCID lcid, ITypeInfo **ppTInfo)
510 HTMLStyle *This = HTMLSTYLE_THIS(iface);
511 return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->dispex), iTInfo, lcid, ppTInfo);
514 static HRESULT WINAPI HTMLStyle_GetIDsOfNames(IHTMLStyle *iface, REFIID riid,
515 LPOLESTR *rgszNames, UINT cNames,
516 LCID lcid, DISPID *rgDispId)
518 HTMLStyle *This = HTMLSTYLE_THIS(iface);
519 return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->dispex), riid, rgszNames, cNames, lcid, rgDispId);
522 static HRESULT WINAPI HTMLStyle_Invoke(IHTMLStyle *iface, DISPID dispIdMember,
523 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
524 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
526 HTMLStyle *This = HTMLSTYLE_THIS(iface);
527 return IDispatchEx_Invoke(DISPATCHEX(&This->dispex), dispIdMember, riid, lcid,
528 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
531 static HRESULT WINAPI HTMLStyle_put_fontFamily(IHTMLStyle *iface, BSTR v)
533 HTMLStyle *This = HTMLSTYLE_THIS(iface);
535 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
537 return set_style_attr(This, STYLEID_FONT_FAMILY, v, 0);
540 static HRESULT WINAPI HTMLStyle_get_fontFamily(IHTMLStyle *iface, BSTR *p)
542 HTMLStyle *This = HTMLSTYLE_THIS(iface);
544 TRACE("(%p)->(%p)\n", This, p);
546 return get_style_attr(This, STYLEID_FONT_FAMILY, p);
549 static HRESULT WINAPI HTMLStyle_put_fontStyle(IHTMLStyle *iface, BSTR v)
551 HTMLStyle *This = HTMLSTYLE_THIS(iface);
552 static const WCHAR szItalic[] = {'i','t','a','l','i','c',0};
553 static const WCHAR szOblique[] = {'o','b','l','i','q','u','e',0};
555 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
557 /* fontStyle can only be one of the follow values. */
558 if(!v || strcmpiW(szNormal, v) == 0 || strcmpiW(szItalic, v) == 0 ||
559 strcmpiW(szOblique, v) == 0)
561 return set_nsstyle_attr(This->nsstyle, STYLEID_FONT_STYLE, v, 0);
567 static HRESULT WINAPI HTMLStyle_get_fontStyle(IHTMLStyle *iface, BSTR *p)
569 HTMLStyle *This = HTMLSTYLE_THIS(iface);
571 TRACE("(%p)->(%p)\n", This, p);
573 return get_style_attr(This, STYLEID_FONT_STYLE, p);
576 static HRESULT WINAPI HTMLStyle_put_fontVariant(IHTMLStyle *iface, BSTR v)
578 HTMLStyle *This = HTMLSTYLE_THIS(iface);
579 static const WCHAR szCaps[] = {'s','m','a','l','l','-','c','a','p','s',0};
581 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
583 /* fontVariant can only be one of the follow values. */
584 if(!v || strcmpiW(szNormal, v) == 0 || strcmpiW(szCaps, v) == 0)
586 return set_nsstyle_attr(This->nsstyle, STYLEID_FONT_VARIANT, v, 0);
592 static HRESULT WINAPI HTMLStyle_get_fontVariant(IHTMLStyle *iface, BSTR *p)
594 HTMLStyle *This = HTMLSTYLE_THIS(iface);
595 TRACE("(%p)->(%p)\n", This, p);
600 return get_style_attr(This, STYLEID_FONT_VARIANT, p);
603 static HRESULT WINAPI HTMLStyle_put_fontWeight(IHTMLStyle *iface, BSTR v)
605 HTMLStyle *This = HTMLSTYLE_THIS(iface);
606 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
610 static HRESULT WINAPI HTMLStyle_get_fontWeight(IHTMLStyle *iface, BSTR *p)
612 HTMLStyle *This = HTMLSTYLE_THIS(iface);
614 TRACE("(%p)->(%p)\n", This, p);
616 return get_style_attr(This, STYLEID_FONT_WEIGHT, p);
619 static HRESULT WINAPI HTMLStyle_put_fontSize(IHTMLStyle *iface, VARIANT v)
621 HTMLStyle *This = HTMLSTYLE_THIS(iface);
623 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
627 return set_style_attr(This, STYLEID_FONT_SIZE, V_BSTR(&v), 0);
629 FIXME("not supported vt %d\n", V_VT(&v));
635 static HRESULT WINAPI HTMLStyle_get_fontSize(IHTMLStyle *iface, VARIANT *p)
637 HTMLStyle *This = HTMLSTYLE_THIS(iface);
639 TRACE("(%p)->(%p)\n", This, p);
642 return get_style_attr(This, STYLEID_FONT_SIZE, &V_BSTR(p));
645 static HRESULT WINAPI HTMLStyle_put_font(IHTMLStyle *iface, BSTR v)
647 HTMLStyle *This = HTMLSTYLE_THIS(iface);
648 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
652 static HRESULT WINAPI HTMLStyle_get_font(IHTMLStyle *iface, BSTR *p)
654 HTMLStyle *This = HTMLSTYLE_THIS(iface);
655 FIXME("(%p)->(%p)\n", This, p);
659 static HRESULT WINAPI HTMLStyle_put_color(IHTMLStyle *iface, VARIANT v)
661 HTMLStyle *This = HTMLSTYLE_THIS(iface);
663 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
667 TRACE("%s\n", debugstr_w(V_BSTR(&v)));
668 return set_style_attr(This, STYLEID_COLOR, V_BSTR(&v), 0);
671 FIXME("unsupported vt=%d\n", V_VT(&v));
677 static HRESULT WINAPI HTMLStyle_get_color(IHTMLStyle *iface, VARIANT *p)
679 HTMLStyle *This = HTMLSTYLE_THIS(iface);
681 TRACE("(%p)->(%p)\n", This, p);
684 return get_style_attr(This, STYLEID_COLOR, &V_BSTR(p));
687 static HRESULT WINAPI HTMLStyle_put_background(IHTMLStyle *iface, BSTR v)
689 HTMLStyle *This = HTMLSTYLE_THIS(iface);
691 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
693 return set_style_attr(This, STYLEID_BACKGROUND, v, 0);
696 static HRESULT WINAPI HTMLStyle_get_background(IHTMLStyle *iface, BSTR *p)
698 HTMLStyle *This = HTMLSTYLE_THIS(iface);
700 TRACE("(%p)->(%p)\n", This, p);
702 return get_style_attr(This, STYLEID_BACKGROUND, p);
705 static HRESULT WINAPI HTMLStyle_put_backgroundColor(IHTMLStyle *iface, VARIANT v)
707 HTMLStyle *This = HTMLSTYLE_THIS(iface);
709 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
713 return set_style_attr(This, STYLEID_BACKGROUND_COLOR, V_BSTR(&v), 0);
716 static const WCHAR format[] = {'#','%','0','6','x',0};
718 wsprintfW(value, format, V_I4(&v));
719 return set_style_attr(This, STYLEID_BACKGROUND_COLOR, value, 0);
722 FIXME("unsupported vt %d\n", V_VT(&v));
728 static HRESULT WINAPI HTMLStyle_get_backgroundColor(IHTMLStyle *iface, VARIANT *p)
730 HTMLStyle *This = HTMLSTYLE_THIS(iface);
731 FIXME("(%p)->(%p)\n", This, p);
735 static HRESULT WINAPI HTMLStyle_put_backgroundImage(IHTMLStyle *iface, BSTR v)
737 HTMLStyle *This = HTMLSTYLE_THIS(iface);
739 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
741 return set_style_attr(This, STYLEID_BACKGROUND_IMAGE, v, ATTR_FIX_URL);
744 static HRESULT WINAPI HTMLStyle_get_backgroundImage(IHTMLStyle *iface, BSTR *p)
746 HTMLStyle *This = HTMLSTYLE_THIS(iface);
748 TRACE("(%p)->(%p)\n", This, p);
750 return get_style_attr(This, STYLEID_BACKGROUND_IMAGE, p);
753 static HRESULT WINAPI HTMLStyle_put_backgroundRepeat(IHTMLStyle *iface, BSTR v)
755 HTMLStyle *This = HTMLSTYLE_THIS(iface);
756 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
760 static HRESULT WINAPI HTMLStyle_get_backgroundRepeat(IHTMLStyle *iface, BSTR *p)
762 HTMLStyle *This = HTMLSTYLE_THIS(iface);
763 FIXME("(%p)->(%p)\n", This, p);
767 static HRESULT WINAPI HTMLStyle_put_backgroundAttachment(IHTMLStyle *iface, BSTR v)
769 HTMLStyle *This = HTMLSTYLE_THIS(iface);
770 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
774 static HRESULT WINAPI HTMLStyle_get_backgroundAttachment(IHTMLStyle *iface, BSTR *p)
776 HTMLStyle *This = HTMLSTYLE_THIS(iface);
777 FIXME("(%p)->(%p)\n", This, p);
781 static HRESULT WINAPI HTMLStyle_put_backgroundPosition(IHTMLStyle *iface, BSTR v)
783 HTMLStyle *This = HTMLSTYLE_THIS(iface);
784 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
788 static HRESULT WINAPI HTMLStyle_get_backgroundPosition(IHTMLStyle *iface, BSTR *p)
790 HTMLStyle *This = HTMLSTYLE_THIS(iface);
791 FIXME("(%p)->(%p)\n", This, p);
795 static HRESULT WINAPI HTMLStyle_put_backgroundPositionX(IHTMLStyle *iface, VARIANT v)
797 HTMLStyle *This = HTMLSTYLE_THIS(iface);
798 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
802 static HRESULT WINAPI HTMLStyle_get_backgroundPositionX(IHTMLStyle *iface, VARIANT *p)
804 HTMLStyle *This = HTMLSTYLE_THIS(iface);
805 FIXME("(%p)->(%p)\n", This, p);
809 static HRESULT WINAPI HTMLStyle_put_backgroundPositionY(IHTMLStyle *iface, VARIANT v)
811 HTMLStyle *This = HTMLSTYLE_THIS(iface);
812 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
816 static HRESULT WINAPI HTMLStyle_get_backgroundPositionY(IHTMLStyle *iface, VARIANT *p)
818 HTMLStyle *This = HTMLSTYLE_THIS(iface);
819 FIXME("(%p)->(%p)\n", This, p);
823 static HRESULT WINAPI HTMLStyle_put_wordSpacing(IHTMLStyle *iface, VARIANT v)
825 HTMLStyle *This = HTMLSTYLE_THIS(iface);
826 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
830 static HRESULT WINAPI HTMLStyle_get_wordSpacing(IHTMLStyle *iface, VARIANT *p)
832 HTMLStyle *This = HTMLSTYLE_THIS(iface);
833 FIXME("(%p)->(%p)\n", This, p);
837 static HRESULT WINAPI HTMLStyle_put_letterSpacing(IHTMLStyle *iface, VARIANT v)
839 HTMLStyle *This = HTMLSTYLE_THIS(iface);
840 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
844 static HRESULT WINAPI HTMLStyle_get_letterSpacing(IHTMLStyle *iface, VARIANT *p)
846 HTMLStyle *This = HTMLSTYLE_THIS(iface);
847 FIXME("(%p)->(%p)\n", This, p);
851 static HRESULT WINAPI HTMLStyle_put_textDecoration(IHTMLStyle *iface, BSTR v)
853 HTMLStyle *This = HTMLSTYLE_THIS(iface);
854 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
858 static HRESULT WINAPI HTMLStyle_get_textDecoration(IHTMLStyle *iface, BSTR *p)
860 HTMLStyle *This = HTMLSTYLE_THIS(iface);
862 TRACE("(%p)->(%p)\n", This, p);
864 return get_style_attr(This, STYLEID_TEXT_DECORATION, p);
867 static HRESULT WINAPI HTMLStyle_put_textDecorationNone(IHTMLStyle *iface, VARIANT_BOOL v)
869 HTMLStyle *This = HTMLSTYLE_THIS(iface);
870 FIXME("(%p)->(%x)\n", This, v);
874 static HRESULT WINAPI HTMLStyle_get_textDecorationNone(IHTMLStyle *iface, VARIANT_BOOL *p)
876 HTMLStyle *This = HTMLSTYLE_THIS(iface);
877 FIXME("(%p)->(%p)\n", This, p);
881 static HRESULT WINAPI HTMLStyle_put_textDecorationUnderline(IHTMLStyle *iface, VARIANT_BOOL v)
883 HTMLStyle *This = HTMLSTYLE_THIS(iface);
884 FIXME("(%p)->(%x)\n", This, v);
888 static HRESULT WINAPI HTMLStyle_get_textDecorationUnderline(IHTMLStyle *iface, VARIANT_BOOL *p)
890 HTMLStyle *This = HTMLSTYLE_THIS(iface);
892 TRACE("(%p)->(%p)\n", This, p);
894 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, valUnderline, p);
897 static HRESULT WINAPI HTMLStyle_put_textDecorationOverline(IHTMLStyle *iface, VARIANT_BOOL v)
899 HTMLStyle *This = HTMLSTYLE_THIS(iface);
900 FIXME("(%p)->(%x)\n", This, v);
904 static HRESULT WINAPI HTMLStyle_get_textDecorationOverline(IHTMLStyle *iface, VARIANT_BOOL *p)
906 HTMLStyle *This = HTMLSTYLE_THIS(iface);
907 FIXME("(%p)->(%p)\n", This, p);
911 static HRESULT WINAPI HTMLStyle_put_textDecorationLineThrough(IHTMLStyle *iface, VARIANT_BOOL v)
913 HTMLStyle *This = HTMLSTYLE_THIS(iface);
914 FIXME("(%p)->(%x)\n", This, v);
918 static HRESULT WINAPI HTMLStyle_get_textDecorationLineThrough(IHTMLStyle *iface, VARIANT_BOOL *p)
920 HTMLStyle *This = HTMLSTYLE_THIS(iface);
922 TRACE("(%p)->(%p)\n", This, p);
924 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, valLineThrough, p);
927 static HRESULT WINAPI HTMLStyle_put_textDecorationBlink(IHTMLStyle *iface, VARIANT_BOOL v)
929 HTMLStyle *This = HTMLSTYLE_THIS(iface);
930 FIXME("(%p)->(%x)\n", This, v);
934 static HRESULT WINAPI HTMLStyle_get_textDecorationBlink(IHTMLStyle *iface, VARIANT_BOOL *p)
936 HTMLStyle *This = HTMLSTYLE_THIS(iface);
937 FIXME("(%p)->(%p)\n", This, p);
941 static HRESULT WINAPI HTMLStyle_put_verticalAlign(IHTMLStyle *iface, VARIANT v)
943 HTMLStyle *This = HTMLSTYLE_THIS(iface);
945 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
949 return set_style_attr(This, STYLEID_VERTICAL_ALIGN, V_BSTR(&v), 0);
951 FIXME("not implemented vt %d\n", V_VT(&v));
958 static HRESULT WINAPI HTMLStyle_get_verticalAlign(IHTMLStyle *iface, VARIANT *p)
960 HTMLStyle *This = HTMLSTYLE_THIS(iface);
964 TRACE("(%p)->(%p)\n", This, p);
966 hres = get_style_attr(This, STYLEID_VERTICAL_ALIGN, &ret);
975 static HRESULT WINAPI HTMLStyle_put_textTransform(IHTMLStyle *iface, BSTR v)
977 HTMLStyle *This = HTMLSTYLE_THIS(iface);
978 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
982 static HRESULT WINAPI HTMLStyle_get_textTransform(IHTMLStyle *iface, BSTR *p)
984 HTMLStyle *This = HTMLSTYLE_THIS(iface);
985 FIXME("(%p)->(%p)\n", This, p);
989 static HRESULT WINAPI HTMLStyle_put_textAlign(IHTMLStyle *iface, BSTR v)
991 HTMLStyle *This = HTMLSTYLE_THIS(iface);
993 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
995 return set_style_attr(This, STYLEID_TEXT_ALIGN, v, 0);
998 static HRESULT WINAPI HTMLStyle_get_textAlign(IHTMLStyle *iface, BSTR *p)
1000 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1002 TRACE("(%p)->(%p)\n", This, p);
1004 return get_style_attr(This, STYLEID_TEXT_ALIGN, p);
1007 static HRESULT WINAPI HTMLStyle_put_textIndent(IHTMLStyle *iface, VARIANT v)
1009 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1010 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1014 static HRESULT WINAPI HTMLStyle_get_textIndent(IHTMLStyle *iface, VARIANT *p)
1016 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1017 FIXME("(%p)->(%p)\n", This, p);
1021 static HRESULT WINAPI HTMLStyle_put_lineHeight(IHTMLStyle *iface, VARIANT v)
1023 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1024 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1028 static HRESULT WINAPI HTMLStyle_get_lineHeight(IHTMLStyle *iface, VARIANT *p)
1030 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1031 FIXME("(%p)->(%p)\n", This, p);
1035 static HRESULT WINAPI HTMLStyle_put_marginTop(IHTMLStyle *iface, VARIANT v)
1037 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1038 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1042 static HRESULT WINAPI HTMLStyle_get_marginTop(IHTMLStyle *iface, VARIANT *p)
1044 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1045 FIXME("(%p)->(%p)\n", This, p);
1049 static HRESULT WINAPI HTMLStyle_put_marginRight(IHTMLStyle *iface, VARIANT v)
1051 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1053 TRACE("(%p)->(v(%d))\n", This, V_VT(&v));
1057 return set_style_attr(This, STYLEID_MARGIN_RIGHT, emptyW, 0);
1061 wsprintfW(buf, px_formatW, V_I4(&v));
1062 return set_style_attr(This, STYLEID_MARGIN_RIGHT, buf, 0);
1065 return set_style_attr(This, STYLEID_MARGIN_RIGHT, V_BSTR(&v), 0);
1067 FIXME("Unsupported vt=%d\n", V_VT(&v));
1073 static HRESULT WINAPI HTMLStyle_get_marginRight(IHTMLStyle *iface, VARIANT *p)
1075 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1076 FIXME("(%p)->(%p)\n", This, p);
1080 static HRESULT WINAPI HTMLStyle_put_marginBottom(IHTMLStyle *iface, VARIANT v)
1082 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1083 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1087 static HRESULT WINAPI HTMLStyle_get_marginBottom(IHTMLStyle *iface, VARIANT *p)
1089 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1090 FIXME("(%p)->(%p)\n", This, p);
1094 static HRESULT WINAPI HTMLStyle_put_marginLeft(IHTMLStyle *iface, VARIANT v)
1096 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1100 TRACE("(%p)->(NULL)\n", This);
1101 return set_style_attr(This, STYLEID_MARGIN_LEFT, emptyW, 0);
1105 TRACE("(%p)->(%d)\n", This, V_I4(&v));
1107 wsprintfW(buf, px_formatW, V_I4(&v));
1108 return set_style_attr(This, STYLEID_MARGIN_LEFT, buf, 0);
1111 TRACE("(%p)->(%s)\n", This, debugstr_w(V_BSTR(&v)));
1112 return set_style_attr(This, STYLEID_MARGIN_LEFT, V_BSTR(&v), 0);
1114 FIXME("Unsupported vt=%d\n", V_VT(&v));
1120 static HRESULT WINAPI HTMLStyle_put_margin(IHTMLStyle *iface, BSTR v)
1122 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1124 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1126 return set_style_attr(This, STYLEID_MARGIN, v, 0);
1129 static HRESULT WINAPI HTMLStyle_get_margin(IHTMLStyle *iface, BSTR *p)
1131 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1133 TRACE("(%p)->(%p)\n", This, p);
1135 return get_style_attr(This, STYLEID_MARGIN, p);
1138 static HRESULT WINAPI HTMLStyle_get_marginLeft(IHTMLStyle *iface, VARIANT *p)
1140 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1141 FIXME("(%p)->(%p)\n", This, p);
1145 static HRESULT WINAPI HTMLStyle_put_paddingTop(IHTMLStyle *iface, VARIANT v)
1147 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1148 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1152 static HRESULT WINAPI HTMLStyle_get_paddingTop(IHTMLStyle *iface, VARIANT *p)
1154 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1155 FIXME("(%p)->(%p)\n", This, p);
1159 static HRESULT WINAPI HTMLStyle_put_paddingRight(IHTMLStyle *iface, VARIANT v)
1161 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1162 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1166 static HRESULT WINAPI HTMLStyle_get_paddingRight(IHTMLStyle *iface, VARIANT *p)
1168 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1169 FIXME("(%p)->(%p)\n", This, p);
1173 static HRESULT WINAPI HTMLStyle_put_paddingBottom(IHTMLStyle *iface, VARIANT v)
1175 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1176 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1180 static HRESULT WINAPI HTMLStyle_get_paddingBottom(IHTMLStyle *iface, VARIANT *p)
1182 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1183 FIXME("(%p)->(%p)\n", This, p);
1187 static HRESULT WINAPI HTMLStyle_put_paddingLeft(IHTMLStyle *iface, VARIANT v)
1189 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1191 TRACE("(%p)->(vt=%d)\n", This, V_VT(&v));
1197 wsprintfW(buf, px_formatW, V_I4(&v));
1198 return set_style_attr(This, STYLEID_PADDING_LEFT, buf, 0);
1201 return set_style_attr(This, STYLEID_PADDING_LEFT, V_BSTR(&v), 0);
1203 FIXME("unsupported vt=%d\n", V_VT(&v));
1209 static HRESULT WINAPI HTMLStyle_get_paddingLeft(IHTMLStyle *iface, VARIANT *p)
1211 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1212 FIXME("(%p)->(%p)\n", This, p);
1216 static HRESULT WINAPI HTMLStyle_put_padding(IHTMLStyle *iface, BSTR v)
1218 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1219 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1223 static HRESULT WINAPI HTMLStyle_get_padding(IHTMLStyle *iface, BSTR *p)
1225 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1226 FIXME("(%p)->(%p)\n", This, p);
1230 static HRESULT WINAPI HTMLStyle_put_border(IHTMLStyle *iface, BSTR v)
1232 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1234 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1236 return set_style_attr(This, STYLEID_BORDER, v, 0);
1239 static HRESULT WINAPI HTMLStyle_get_border(IHTMLStyle *iface, BSTR *p)
1241 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1243 TRACE("(%p)->(%p)\n", This, p);
1245 return get_style_attr(This, STYLEID_BORDER, p);
1248 static HRESULT WINAPI HTMLStyle_put_borderTop(IHTMLStyle *iface, BSTR v)
1250 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1251 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1255 static HRESULT WINAPI HTMLStyle_get_borderTop(IHTMLStyle *iface, BSTR *p)
1257 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1258 FIXME("(%p)->(%p)\n", This, p);
1262 static HRESULT WINAPI HTMLStyle_put_borderRight(IHTMLStyle *iface, BSTR v)
1264 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1265 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1269 static HRESULT WINAPI HTMLStyle_get_borderRight(IHTMLStyle *iface, BSTR *p)
1271 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1272 FIXME("(%p)->(%p)\n", This, p);
1276 static HRESULT WINAPI HTMLStyle_put_borderBottom(IHTMLStyle *iface, BSTR v)
1278 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1279 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1283 static HRESULT WINAPI HTMLStyle_get_borderBottom(IHTMLStyle *iface, BSTR *p)
1285 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1286 FIXME("(%p)->(%p)\n", This, p);
1290 static HRESULT WINAPI HTMLStyle_put_borderLeft(IHTMLStyle *iface, BSTR v)
1292 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1294 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1296 return set_style_attr(This, STYLEID_BORDER_LEFT, v, ATTR_FIX_PX);
1299 static HRESULT WINAPI HTMLStyle_get_borderLeft(IHTMLStyle *iface, BSTR *p)
1301 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1302 FIXME("(%p)->(%p)\n", This, p);
1306 static HRESULT WINAPI HTMLStyle_put_borderColor(IHTMLStyle *iface, BSTR v)
1308 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1309 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1313 static HRESULT WINAPI HTMLStyle_get_borderColor(IHTMLStyle *iface, BSTR *p)
1315 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1316 FIXME("(%p)->(%p)\n", This, p);
1320 static HRESULT WINAPI HTMLStyle_put_borderTopColor(IHTMLStyle *iface, VARIANT v)
1322 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1323 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1327 static HRESULT WINAPI HTMLStyle_get_borderTopColor(IHTMLStyle *iface, VARIANT *p)
1329 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1330 FIXME("(%p)->(%p)\n", This, p);
1334 static HRESULT WINAPI HTMLStyle_put_borderRightColor(IHTMLStyle *iface, VARIANT v)
1336 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1337 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1341 static HRESULT WINAPI HTMLStyle_get_borderRightColor(IHTMLStyle *iface, VARIANT *p)
1343 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1344 FIXME("(%p)->(%p)\n", This, p);
1348 static HRESULT WINAPI HTMLStyle_put_borderBottomColor(IHTMLStyle *iface, VARIANT v)
1350 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1351 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1355 static HRESULT WINAPI HTMLStyle_get_borderBottomColor(IHTMLStyle *iface, VARIANT *p)
1357 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1358 FIXME("(%p)->(%p)\n", This, p);
1362 static HRESULT WINAPI HTMLStyle_put_borderLeftColor(IHTMLStyle *iface, VARIANT v)
1364 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1365 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1369 static HRESULT WINAPI HTMLStyle_get_borderLeftColor(IHTMLStyle *iface, VARIANT *p)
1371 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1372 FIXME("(%p)->(%p)\n", This, p);
1376 static HRESULT WINAPI HTMLStyle_put_borderWidth(IHTMLStyle *iface, BSTR v)
1378 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1379 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1380 return set_style_attr(This, STYLEID_BORDER_WIDTH, v, ATTR_FIX_PX);
1383 static HRESULT WINAPI HTMLStyle_get_borderWidth(IHTMLStyle *iface, BSTR *p)
1385 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1386 TRACE("(%p)->(%p)\n", This, p);
1387 return get_style_attr(This, STYLEID_BORDER_WIDTH, p);
1390 static HRESULT WINAPI HTMLStyle_put_borderTopWidth(IHTMLStyle *iface, VARIANT v)
1392 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1393 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1397 static HRESULT WINAPI HTMLStyle_get_borderTopWidth(IHTMLStyle *iface, VARIANT *p)
1399 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1400 FIXME("(%p)->(%p)\n", This, p);
1404 static HRESULT WINAPI HTMLStyle_put_borderRightWidth(IHTMLStyle *iface, VARIANT v)
1406 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1407 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1411 static HRESULT WINAPI HTMLStyle_get_borderRightWidth(IHTMLStyle *iface, VARIANT *p)
1413 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1414 FIXME("(%p)->(%p)\n", This, p);
1418 static HRESULT WINAPI HTMLStyle_put_borderBottomWidth(IHTMLStyle *iface, VARIANT v)
1420 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1421 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1425 static HRESULT WINAPI HTMLStyle_get_borderBottomWidth(IHTMLStyle *iface, VARIANT *p)
1427 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1428 FIXME("(%p)->(%p)\n", This, p);
1432 static HRESULT WINAPI HTMLStyle_put_borderLeftWidth(IHTMLStyle *iface, VARIANT v)
1434 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1435 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1439 static HRESULT WINAPI HTMLStyle_get_borderLeftWidth(IHTMLStyle *iface, VARIANT *p)
1441 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1442 FIXME("(%p)->(%p)\n", This, p);
1446 static HRESULT WINAPI HTMLStyle_put_borderStyle(IHTMLStyle *iface, BSTR v)
1448 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1449 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1453 static HRESULT WINAPI HTMLStyle_get_borderStyle(IHTMLStyle *iface, BSTR *p)
1455 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1456 FIXME("(%p)->(%p)\n", This, p);
1460 static HRESULT WINAPI HTMLStyle_put_borderTopStyle(IHTMLStyle *iface, BSTR v)
1462 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1463 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1467 static HRESULT WINAPI HTMLStyle_get_borderTopStyle(IHTMLStyle *iface, BSTR *p)
1469 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1470 FIXME("(%p)->(%p)\n", This, p);
1474 static HRESULT WINAPI HTMLStyle_put_borderRightStyle(IHTMLStyle *iface, BSTR v)
1476 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1477 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1481 static HRESULT WINAPI HTMLStyle_get_borderRightStyle(IHTMLStyle *iface, BSTR *p)
1483 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1484 FIXME("(%p)->(%p)\n", This, p);
1488 static HRESULT WINAPI HTMLStyle_put_borderBottomStyle(IHTMLStyle *iface, BSTR v)
1490 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1491 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1495 static HRESULT WINAPI HTMLStyle_get_borderBottomStyle(IHTMLStyle *iface, BSTR *p)
1497 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1498 FIXME("(%p)->(%p)\n", This, p);
1502 static HRESULT WINAPI HTMLStyle_put_borderLeftStyle(IHTMLStyle *iface, BSTR v)
1504 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1505 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1507 if(!is_valid_border_style(v))
1508 return E_INVALIDARG;
1510 return set_style_attr(This, STYLEID_BORDER_LEFT_STYLE, v, 0);
1513 static HRESULT WINAPI HTMLStyle_get_borderLeftStyle(IHTMLStyle *iface, BSTR *p)
1515 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1516 TRACE("(%p)->(%p)\n", This, p);
1517 return get_style_attr(This, STYLEID_BORDER_LEFT_STYLE, p);
1520 static HRESULT WINAPI HTMLStyle_put_width(IHTMLStyle *iface, VARIANT v)
1522 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1524 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
1528 TRACE("%s\n", debugstr_w(V_BSTR(&v)));
1529 return set_style_attr(This, STYLEID_WIDTH, V_BSTR(&v), 0);
1531 FIXME("unsupported vt %d\n", V_VT(&v));
1537 static HRESULT WINAPI HTMLStyle_get_width(IHTMLStyle *iface, VARIANT *p)
1539 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1541 TRACE("(%p)->(%p)\n", This, p);
1544 return get_style_attr(This, STYLEID_WIDTH, &V_BSTR(p));
1547 static HRESULT WINAPI HTMLStyle_put_height(IHTMLStyle *iface, VARIANT v)
1549 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1551 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1555 return set_style_attr(This, STYLEID_HEIGHT, V_BSTR(&v), 0);
1557 FIXME("unimplemented vt %d\n", V_VT(&v));
1564 static HRESULT WINAPI HTMLStyle_get_height(IHTMLStyle *iface, VARIANT *p)
1566 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1570 TRACE("(%p)->(%p)\n", This, p);
1572 hres = get_style_attr(This, STYLEID_HEIGHT, &ret);
1581 static HRESULT WINAPI HTMLStyle_put_styleFloat(IHTMLStyle *iface, BSTR v)
1583 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1584 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1588 static HRESULT WINAPI HTMLStyle_get_styleFloat(IHTMLStyle *iface, BSTR *p)
1590 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1591 FIXME("(%p)->(%p)\n", This, p);
1595 static HRESULT WINAPI HTMLStyle_put_clear(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_clear(IHTMLStyle *iface, BSTR *p)
1604 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1605 FIXME("(%p)->(%p)\n", This, p);
1609 static HRESULT WINAPI HTMLStyle_put_display(IHTMLStyle *iface, BSTR v)
1611 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1613 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1615 return set_style_attr(This, STYLEID_DISPLAY, v, 0);
1618 static HRESULT WINAPI HTMLStyle_get_display(IHTMLStyle *iface, BSTR *p)
1620 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1622 TRACE("(%p)->(%p)\n", This, p);
1624 return get_style_attr(This, STYLEID_DISPLAY, p);
1627 static HRESULT WINAPI HTMLStyle_put_visibility(IHTMLStyle *iface, BSTR v)
1629 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1631 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1633 return set_style_attr(This, STYLEID_VISIBILITY, v, 0);
1636 static HRESULT WINAPI HTMLStyle_get_visibility(IHTMLStyle *iface, BSTR *p)
1638 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1640 TRACE("(%p)->(%p)\n", This, p);
1642 return get_style_attr(This, STYLEID_VISIBILITY, p);
1645 static HRESULT WINAPI HTMLStyle_put_listStyleType(IHTMLStyle *iface, BSTR v)
1647 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1648 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1652 static HRESULT WINAPI HTMLStyle_get_listStyleType(IHTMLStyle *iface, BSTR *p)
1654 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1655 FIXME("(%p)->(%p)\n", This, p);
1659 static HRESULT WINAPI HTMLStyle_put_listStylePosition(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_listStylePosition(IHTMLStyle *iface, BSTR *p)
1668 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1669 FIXME("(%p)->(%p)\n", This, p);
1673 static HRESULT WINAPI HTMLStyle_put_listStyleImage(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_listStyleImage(IHTMLStyle *iface, BSTR *p)
1682 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1683 FIXME("(%p)->(%p)\n", This, p);
1687 static HRESULT WINAPI HTMLStyle_put_listStyle(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_listStyle(IHTMLStyle *iface, BSTR *p)
1696 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1697 FIXME("(%p)->(%p)\n", This, p);
1701 static HRESULT WINAPI HTMLStyle_put_whiteSpace(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_whiteSpace(IHTMLStyle *iface, BSTR *p)
1710 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1711 FIXME("(%p)->(%p)\n", This, p);
1715 static HRESULT WINAPI HTMLStyle_put_top(IHTMLStyle *iface, VARIANT v)
1717 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1719 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1721 return set_nsstyle_attr_var(This->nsstyle, STYLEID_TOP, &v, 0);
1724 static HRESULT WINAPI HTMLStyle_get_top(IHTMLStyle *iface, VARIANT *p)
1726 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1730 TRACE("(%p)->(%p)\n", This, p);
1732 hres = get_style_attr(This, STYLEID_TOP, &ret);
1741 static HRESULT WINAPI HTMLStyle_put_left(IHTMLStyle *iface, VARIANT v)
1743 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1745 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1747 return set_nsstyle_attr_var(This->nsstyle, STYLEID_LEFT, &v, 0);
1750 static HRESULT WINAPI HTMLStyle_get_left(IHTMLStyle *iface, VARIANT *p)
1752 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1756 TRACE("(%p)->(%p)\n", This, p);
1758 hres = get_style_attr(This, STYLEID_LEFT, &ret);
1767 static HRESULT WINAPI HTMLStyle_get_position(IHTMLStyle *iface, BSTR *p)
1769 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1770 TRACE("(%p)->(%p)\n", This, p);
1771 return IHTMLStyle2_get_position(HTMLSTYLE2(This), p);
1774 static HRESULT WINAPI HTMLStyle_put_zIndex(IHTMLStyle *iface, VARIANT v)
1776 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1778 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1782 return set_style_attr(This, STYLEID_Z_INDEX, V_BSTR(&v), 0);
1785 static const WCHAR format[] = {'%','d',0};
1787 wsprintfW(value, format, V_I4(&v));
1788 return set_style_attr(This, STYLEID_Z_INDEX, value, 0);
1791 FIXME("unimplemented vt %d\n", V_VT(&v));
1798 static HRESULT WINAPI HTMLStyle_get_zIndex(IHTMLStyle *iface, VARIANT *p)
1800 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1802 TRACE("(%p)->(%p)\n", This, p);
1804 return get_nsstyle_attr_var(This->nsstyle, STYLEID_Z_INDEX, p, ATTR_STR_TO_INT);
1807 static HRESULT WINAPI HTMLStyle_put_overflow(IHTMLStyle *iface, BSTR v)
1809 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1810 static const WCHAR szVisible[] = {'v','i','s','i','b','l','e',0};
1811 static const WCHAR szScroll[] = {'s','c','r','o','l','l',0};
1812 static const WCHAR szHidden[] = {'h','i','d','d','e','n',0};
1813 static const WCHAR szAuto[] = {'a','u','t','o',0};
1815 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1817 /* overflow can only be one of the follow values. */
1818 if(!v || strcmpiW(szVisible, v) == 0 || strcmpiW(szScroll, v) == 0 ||
1819 strcmpiW(szHidden, v) == 0 || strcmpiW(szAuto, v) == 0)
1821 return set_nsstyle_attr(This->nsstyle, STYLEID_OVERFLOW, v, 0);
1824 return E_INVALIDARG;
1828 static HRESULT WINAPI HTMLStyle_get_overflow(IHTMLStyle *iface, BSTR *p)
1830 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1832 TRACE("(%p)->(%p)\n", This, p);
1835 return E_INVALIDARG;
1837 return get_style_attr(This, STYLEID_OVERFLOW, p);
1840 static HRESULT WINAPI HTMLStyle_put_pageBreakBefore(IHTMLStyle *iface, BSTR v)
1842 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1843 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1847 static HRESULT WINAPI HTMLStyle_get_pageBreakBefore(IHTMLStyle *iface, BSTR *p)
1849 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1850 FIXME("(%p)->(%p)\n", This, p);
1854 static HRESULT WINAPI HTMLStyle_put_pageBreakAfter(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_pageBreakAfter(IHTMLStyle *iface, BSTR *p)
1863 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1864 FIXME("(%p)->(%p)\n", This, p);
1868 static HRESULT WINAPI HTMLStyle_put_cssText(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_cssText(IHTMLStyle *iface, BSTR *p)
1877 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1878 FIXME("(%p)->(%p)\n", This, p);
1882 static HRESULT WINAPI HTMLStyle_put_pixelTop(IHTMLStyle *iface, long v)
1884 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1885 FIXME("(%p)->()\n", This);
1889 static HRESULT WINAPI HTMLStyle_get_pixelTop(IHTMLStyle *iface, long *p)
1891 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1892 FIXME("(%p)->()\n", This);
1896 static HRESULT WINAPI HTMLStyle_put_pixelLeft(IHTMLStyle *iface, long v)
1898 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1899 FIXME("(%p)->()\n", This);
1903 static HRESULT WINAPI HTMLStyle_get_pixelLeft(IHTMLStyle *iface, long *p)
1905 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1906 FIXME("(%p)->()\n", This);
1910 static HRESULT WINAPI HTMLStyle_put_pixelWidth(IHTMLStyle *iface, long v)
1912 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1913 FIXME("(%p)->()\n", This);
1917 static HRESULT WINAPI HTMLStyle_get_pixelWidth(IHTMLStyle *iface, long *p)
1919 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1920 FIXME("(%p)->()\n", This);
1924 static HRESULT WINAPI HTMLStyle_put_pixelHeight(IHTMLStyle *iface, long v)
1926 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1927 FIXME("(%p)->()\n", This);
1931 static HRESULT WINAPI HTMLStyle_get_pixelHeight(IHTMLStyle *iface, long *p)
1933 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1934 FIXME("(%p)->()\n", This);
1938 static HRESULT WINAPI HTMLStyle_put_posTop(IHTMLStyle *iface, float v)
1940 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1942 TRACE("(%p)->(%f)\n", This, v);
1944 return set_style_pos(This, STYLEID_TOP, v);
1947 static HRESULT WINAPI HTMLStyle_get_posTop(IHTMLStyle *iface, float *p)
1949 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1951 TRACE("(%p)->(%p)\n", This, p);
1956 return get_nsstyle_pos(This, STYLEID_TOP, p);
1959 static HRESULT WINAPI HTMLStyle_put_posLeft(IHTMLStyle *iface, float v)
1961 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1963 TRACE("(%p)->(%f)\n", This, v);
1965 return set_style_pos(This, STYLEID_LEFT, v);
1968 static HRESULT WINAPI HTMLStyle_get_posLeft(IHTMLStyle *iface, float *p)
1970 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1972 TRACE("(%p)->(%p)\n", This, p);
1977 return get_nsstyle_pos(This, STYLEID_LEFT, p);
1980 static HRESULT WINAPI HTMLStyle_put_posWidth(IHTMLStyle *iface, float v)
1982 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1984 TRACE("(%p)->(%f)\n", This, v);
1986 return set_style_pos(This, STYLEID_WIDTH, v);
1989 static HRESULT WINAPI HTMLStyle_get_posWidth(IHTMLStyle *iface, float *p)
1991 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1993 TRACE("(%p)->(%p)\n", This, p);
1998 if(get_nsstyle_pos(This, STYLEID_WIDTH, p) != S_OK)
2004 static HRESULT WINAPI HTMLStyle_put_posHeight(IHTMLStyle *iface, float v)
2006 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2008 TRACE("(%p)->(%f)\n", This, v);
2010 return set_style_pos(This, STYLEID_HEIGHT, v);
2013 static HRESULT WINAPI HTMLStyle_get_posHeight(IHTMLStyle *iface, float *p)
2015 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2017 TRACE("(%p)->(%p)\n", This, p);
2022 if(get_nsstyle_pos(This, STYLEID_HEIGHT, p) != S_OK)
2028 static HRESULT WINAPI HTMLStyle_put_cursor(IHTMLStyle *iface, BSTR v)
2030 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2032 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2034 return set_style_attr(This, STYLEID_CURSOR, v, 0);
2037 static HRESULT WINAPI HTMLStyle_get_cursor(IHTMLStyle *iface, BSTR *p)
2039 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2041 TRACE("(%p)->(%p)\n", This, p);
2043 return get_style_attr(This, STYLEID_CURSOR, p);
2046 static HRESULT WINAPI HTMLStyle_put_clip(IHTMLStyle *iface, BSTR v)
2048 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2049 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
2053 static HRESULT WINAPI HTMLStyle_get_clip(IHTMLStyle *iface, BSTR *p)
2055 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2056 FIXME("(%p)->(%p)\n", This, p);
2060 static HRESULT WINAPI HTMLStyle_put_filter(IHTMLStyle *iface, BSTR v)
2062 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2064 WARN("(%p)->(%s)\n", This, debugstr_w(v));
2066 /* FIXME: Handle MS-style filters */
2067 return set_style_attr(This, STYLEID_FILTER, v, 0);
2070 static HRESULT WINAPI HTMLStyle_get_filter(IHTMLStyle *iface, BSTR *p)
2072 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2074 WARN("(%p)->(%p)\n", This, p);
2076 /* FIXME: Handle MS-style filters */
2077 return get_style_attr(This, STYLEID_FILTER, p);
2080 static HRESULT WINAPI HTMLStyle_setAttribute(IHTMLStyle *iface, BSTR strAttributeName,
2081 VARIANT AttributeValue, LONG lFlags)
2083 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2087 TRACE("(%p)->(%s v%d %08x)\n", This, debugstr_w(strAttributeName),
2088 V_VT(&AttributeValue), lFlags);
2090 if(!strAttributeName)
2091 return E_INVALIDARG;
2094 FIXME("Parameter lFlags ignored\n");
2096 hres = HTMLStyle_GetIDsOfNames(iface, &IID_NULL, (LPOLESTR*)&strAttributeName, 1,
2097 LOCALE_USER_DEFAULT, &dispid);
2101 DISPID dispidNamed = DISPID_PROPERTYPUT;
2105 params.rgvarg = &AttributeValue;
2106 params.cNamedArgs = 1;
2107 params.rgdispidNamedArgs = &dispidNamed;
2109 hres = HTMLStyle_Invoke(iface, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
2110 DISPATCH_PROPERTYPUT, ¶ms, &ret, NULL, NULL);
2114 FIXME("Custom attributes not supported.\n");
2117 TRACE("ret: %08x\n", hres);
2122 static HRESULT WINAPI HTMLStyle_getAttribute(IHTMLStyle *iface, BSTR strAttributeName,
2123 LONG lFlags, VARIANT *AttributeValue)
2125 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2129 TRACE("(%p)->(%s v%p %08x)\n", This, debugstr_w(strAttributeName),
2130 AttributeValue, lFlags);
2132 if(!AttributeValue || !strAttributeName)
2133 return E_INVALIDARG;
2136 FIXME("Parameter lFlags ignored\n");
2138 hres = HTMLStyle_GetIDsOfNames(iface, &IID_NULL, (LPOLESTR*)&strAttributeName, 1,
2139 LOCALE_USER_DEFAULT, &dispid);
2142 DISPPARAMS params = {NULL, NULL, 0, 0 };
2144 hres = HTMLStyle_Invoke(iface, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
2145 DISPATCH_PROPERTYGET, ¶ms, AttributeValue, NULL, NULL);
2149 FIXME("Custom attributes not supported.\n");
2155 static HRESULT WINAPI HTMLStyle_removeAttribute(IHTMLStyle *iface, BSTR strAttributeName,
2156 LONG lFlags, VARIANT_BOOL *pfSuccess)
2158 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2159 FIXME("(%p)->(%s %08x %p)\n", This, debugstr_w(strAttributeName),
2164 static HRESULT WINAPI HTMLStyle_toString(IHTMLStyle *iface, BSTR *String)
2166 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2167 FIXME("(%p)->(%p)\n", This, String);
2171 static HRESULT HTMLStyle_get_dispid(IUnknown *iface, BSTR name, DWORD flags, DISPID *dispid)
2173 int c, i, min=0, max = sizeof(style_tbl)/sizeof(*style_tbl)-1;
2178 c = strcmpW(style_tbl[i].name, name);
2180 *dispid = style_tbl[i].dispid;
2190 return DISP_E_UNKNOWNNAME;
2193 static const IHTMLStyleVtbl HTMLStyleVtbl = {
2194 HTMLStyle_QueryInterface,
2197 HTMLStyle_GetTypeInfoCount,
2198 HTMLStyle_GetTypeInfo,
2199 HTMLStyle_GetIDsOfNames,
2201 HTMLStyle_put_fontFamily,
2202 HTMLStyle_get_fontFamily,
2203 HTMLStyle_put_fontStyle,
2204 HTMLStyle_get_fontStyle,
2205 HTMLStyle_put_fontVariant,
2206 HTMLStyle_get_fontVariant,
2207 HTMLStyle_put_fontWeight,
2208 HTMLStyle_get_fontWeight,
2209 HTMLStyle_put_fontSize,
2210 HTMLStyle_get_fontSize,
2213 HTMLStyle_put_color,
2214 HTMLStyle_get_color,
2215 HTMLStyle_put_background,
2216 HTMLStyle_get_background,
2217 HTMLStyle_put_backgroundColor,
2218 HTMLStyle_get_backgroundColor,
2219 HTMLStyle_put_backgroundImage,
2220 HTMLStyle_get_backgroundImage,
2221 HTMLStyle_put_backgroundRepeat,
2222 HTMLStyle_get_backgroundRepeat,
2223 HTMLStyle_put_backgroundAttachment,
2224 HTMLStyle_get_backgroundAttachment,
2225 HTMLStyle_put_backgroundPosition,
2226 HTMLStyle_get_backgroundPosition,
2227 HTMLStyle_put_backgroundPositionX,
2228 HTMLStyle_get_backgroundPositionX,
2229 HTMLStyle_put_backgroundPositionY,
2230 HTMLStyle_get_backgroundPositionY,
2231 HTMLStyle_put_wordSpacing,
2232 HTMLStyle_get_wordSpacing,
2233 HTMLStyle_put_letterSpacing,
2234 HTMLStyle_get_letterSpacing,
2235 HTMLStyle_put_textDecoration,
2236 HTMLStyle_get_textDecoration,
2237 HTMLStyle_put_textDecorationNone,
2238 HTMLStyle_get_textDecorationNone,
2239 HTMLStyle_put_textDecorationUnderline,
2240 HTMLStyle_get_textDecorationUnderline,
2241 HTMLStyle_put_textDecorationOverline,
2242 HTMLStyle_get_textDecorationOverline,
2243 HTMLStyle_put_textDecorationLineThrough,
2244 HTMLStyle_get_textDecorationLineThrough,
2245 HTMLStyle_put_textDecorationBlink,
2246 HTMLStyle_get_textDecorationBlink,
2247 HTMLStyle_put_verticalAlign,
2248 HTMLStyle_get_verticalAlign,
2249 HTMLStyle_put_textTransform,
2250 HTMLStyle_get_textTransform,
2251 HTMLStyle_put_textAlign,
2252 HTMLStyle_get_textAlign,
2253 HTMLStyle_put_textIndent,
2254 HTMLStyle_get_textIndent,
2255 HTMLStyle_put_lineHeight,
2256 HTMLStyle_get_lineHeight,
2257 HTMLStyle_put_marginTop,
2258 HTMLStyle_get_marginTop,
2259 HTMLStyle_put_marginRight,
2260 HTMLStyle_get_marginRight,
2261 HTMLStyle_put_marginBottom,
2262 HTMLStyle_get_marginBottom,
2263 HTMLStyle_put_marginLeft,
2264 HTMLStyle_get_marginLeft,
2265 HTMLStyle_put_margin,
2266 HTMLStyle_get_margin,
2267 HTMLStyle_put_paddingTop,
2268 HTMLStyle_get_paddingTop,
2269 HTMLStyle_put_paddingRight,
2270 HTMLStyle_get_paddingRight,
2271 HTMLStyle_put_paddingBottom,
2272 HTMLStyle_get_paddingBottom,
2273 HTMLStyle_put_paddingLeft,
2274 HTMLStyle_get_paddingLeft,
2275 HTMLStyle_put_padding,
2276 HTMLStyle_get_padding,
2277 HTMLStyle_put_border,
2278 HTMLStyle_get_border,
2279 HTMLStyle_put_borderTop,
2280 HTMLStyle_get_borderTop,
2281 HTMLStyle_put_borderRight,
2282 HTMLStyle_get_borderRight,
2283 HTMLStyle_put_borderBottom,
2284 HTMLStyle_get_borderBottom,
2285 HTMLStyle_put_borderLeft,
2286 HTMLStyle_get_borderLeft,
2287 HTMLStyle_put_borderColor,
2288 HTMLStyle_get_borderColor,
2289 HTMLStyle_put_borderTopColor,
2290 HTMLStyle_get_borderTopColor,
2291 HTMLStyle_put_borderRightColor,
2292 HTMLStyle_get_borderRightColor,
2293 HTMLStyle_put_borderBottomColor,
2294 HTMLStyle_get_borderBottomColor,
2295 HTMLStyle_put_borderLeftColor,
2296 HTMLStyle_get_borderLeftColor,
2297 HTMLStyle_put_borderWidth,
2298 HTMLStyle_get_borderWidth,
2299 HTMLStyle_put_borderTopWidth,
2300 HTMLStyle_get_borderTopWidth,
2301 HTMLStyle_put_borderRightWidth,
2302 HTMLStyle_get_borderRightWidth,
2303 HTMLStyle_put_borderBottomWidth,
2304 HTMLStyle_get_borderBottomWidth,
2305 HTMLStyle_put_borderLeftWidth,
2306 HTMLStyle_get_borderLeftWidth,
2307 HTMLStyle_put_borderStyle,
2308 HTMLStyle_get_borderStyle,
2309 HTMLStyle_put_borderTopStyle,
2310 HTMLStyle_get_borderTopStyle,
2311 HTMLStyle_put_borderRightStyle,
2312 HTMLStyle_get_borderRightStyle,
2313 HTMLStyle_put_borderBottomStyle,
2314 HTMLStyle_get_borderBottomStyle,
2315 HTMLStyle_put_borderLeftStyle,
2316 HTMLStyle_get_borderLeftStyle,
2317 HTMLStyle_put_width,
2318 HTMLStyle_get_width,
2319 HTMLStyle_put_height,
2320 HTMLStyle_get_height,
2321 HTMLStyle_put_styleFloat,
2322 HTMLStyle_get_styleFloat,
2323 HTMLStyle_put_clear,
2324 HTMLStyle_get_clear,
2325 HTMLStyle_put_display,
2326 HTMLStyle_get_display,
2327 HTMLStyle_put_visibility,
2328 HTMLStyle_get_visibility,
2329 HTMLStyle_put_listStyleType,
2330 HTMLStyle_get_listStyleType,
2331 HTMLStyle_put_listStylePosition,
2332 HTMLStyle_get_listStylePosition,
2333 HTMLStyle_put_listStyleImage,
2334 HTMLStyle_get_listStyleImage,
2335 HTMLStyle_put_listStyle,
2336 HTMLStyle_get_listStyle,
2337 HTMLStyle_put_whiteSpace,
2338 HTMLStyle_get_whiteSpace,
2343 HTMLStyle_get_position,
2344 HTMLStyle_put_zIndex,
2345 HTMLStyle_get_zIndex,
2346 HTMLStyle_put_overflow,
2347 HTMLStyle_get_overflow,
2348 HTMLStyle_put_pageBreakBefore,
2349 HTMLStyle_get_pageBreakBefore,
2350 HTMLStyle_put_pageBreakAfter,
2351 HTMLStyle_get_pageBreakAfter,
2352 HTMLStyle_put_cssText,
2353 HTMLStyle_get_cssText,
2354 HTMLStyle_put_pixelTop,
2355 HTMLStyle_get_pixelTop,
2356 HTMLStyle_put_pixelLeft,
2357 HTMLStyle_get_pixelLeft,
2358 HTMLStyle_put_pixelWidth,
2359 HTMLStyle_get_pixelWidth,
2360 HTMLStyle_put_pixelHeight,
2361 HTMLStyle_get_pixelHeight,
2362 HTMLStyle_put_posTop,
2363 HTMLStyle_get_posTop,
2364 HTMLStyle_put_posLeft,
2365 HTMLStyle_get_posLeft,
2366 HTMLStyle_put_posWidth,
2367 HTMLStyle_get_posWidth,
2368 HTMLStyle_put_posHeight,
2369 HTMLStyle_get_posHeight,
2370 HTMLStyle_put_cursor,
2371 HTMLStyle_get_cursor,
2374 HTMLStyle_put_filter,
2375 HTMLStyle_get_filter,
2376 HTMLStyle_setAttribute,
2377 HTMLStyle_getAttribute,
2378 HTMLStyle_removeAttribute,
2382 static const dispex_static_data_vtbl_t HTMLStyle_dispex_vtbl = {
2383 HTMLStyle_get_dispid,
2387 static const tid_t HTMLStyle_iface_tids[] = {
2392 static dispex_static_data_t HTMLStyle_dispex = {
2393 &HTMLStyle_dispex_vtbl,
2396 HTMLStyle_iface_tids
2399 IHTMLStyle *HTMLStyle_Create(nsIDOMCSSStyleDeclaration *nsstyle)
2401 HTMLStyle *ret = heap_alloc_zero(sizeof(HTMLStyle));
2403 ret->lpHTMLStyleVtbl = &HTMLStyleVtbl;
2405 ret->nsstyle = nsstyle;
2406 HTMLStyle2_Init(ret);
2408 nsIDOMCSSStyleDeclaration_AddRef(nsstyle);
2410 init_dispex(&ret->dispex, (IUnknown*)HTMLSTYLE(ret), &HTMLStyle_dispex);
2412 return HTMLSTYLE(ret);