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 attrBorderTopStyle[] =
55 {'b','o','r','d','e','r','-','t','o','p','-','s','t','y','l','e',0};
56 static const WCHAR attrBorderWidth[] =
57 {'b','o','r','d','e','r','-','w','i','d','t','h',0};
58 static const WCHAR attrColor[] =
59 {'c','o','l','o','r',0};
60 static const WCHAR attrCursor[] =
61 {'c','u','r','s','o','r',0};
62 static const WCHAR attrDisplay[] =
63 {'d','i','s','p','l','a','y',0};
64 static const WCHAR attrFilter[] =
65 {'f','i','l','e','t','e','r',0};
66 static const WCHAR attrFontFamily[] =
67 {'f','o','n','t','-','f','a','m','i','l','y',0};
68 static const WCHAR attrFontSize[] =
69 {'f','o','n','t','-','s','i','z','e',0};
70 static const WCHAR attrFontStyle[] =
71 {'f','o','n','t','-','s','t','y','l','e',0};
72 static const WCHAR attrFontVariant[] =
73 {'f','o','n','t','-','v','a','r','i','a','n','t',0};
74 static const WCHAR attrFontWeight[] =
75 {'f','o','n','t','-','w','e','i','g','h','t',0};
76 static const WCHAR attrHeight[] =
77 {'h','e','i','g','h','t',0};
78 static const WCHAR attrLeft[] =
80 static const WCHAR attrMargin[] =
81 {'m','a','r','g','i','n',0};
82 static const WCHAR attrMarginLeft[] =
83 {'m','a','r','g','i','n','-','l','e','f','t',0};
84 static const WCHAR attrMarginRight[] =
85 {'m','a','r','g','i','n','-','r','i','g','h','t',0};
86 static const WCHAR attrOverflow[] =
87 {'o','v','e','r','f','l','o','w',0};
88 static const WCHAR attrPaddingLeft[] =
89 {'p','a','d','d','i','n','g','-','l','e','f','t',0};
90 static const WCHAR attrPosition[] =
91 {'p','o','s','i','t','i','o','n',0};
92 static const WCHAR attrTextAlign[] =
93 {'t','e','x','t','-','a','l','i','g','n',0};
94 static const WCHAR attrTextDecoration[] =
95 {'t','e','x','t','-','d','e','c','o','r','a','t','i','o','n',0};
96 static const WCHAR attrTop[] =
98 static const WCHAR attrVerticalAlign[] =
99 {'v','e','r','t','i','c','a','l','-','a','l','i','g','n',0};
100 static const WCHAR attrVisibility[] =
101 {'v','i','s','i','b','i','l','i','t','y',0};
102 static const WCHAR attrWidth[] =
103 {'w','i','d','t','h',0};
104 static const WCHAR attrZIndex[] =
105 {'z','-','i','n','d','e','x',0};
111 {attrBackground, DISPID_IHTMLSTYLE_BACKGROUND},
112 {attrBackgroundColor, DISPID_IHTMLSTYLE_BACKGROUNDCOLOR},
113 {attrBackgroundImage, DISPID_IHTMLSTYLE_BACKGROUNDIMAGE},
114 {attrBorder, DISPID_IHTMLSTYLE_BORDER},
115 {attrBorderBottomStyle, DISPID_IHTMLSTYLE_BORDERBOTTOMSTYLE},
116 {attrBorderLeft, DISPID_IHTMLSTYLE_BORDERLEFT},
117 {attrBorderLeftStyle, DISPID_IHTMLSTYLE_BORDERLEFTSTYLE},
118 {attrBorderRightStyle, DISPID_IHTMLSTYLE_BORDERRIGHTSTYLE},
119 {attrBorderTopStyle, DISPID_IHTMLSTYLE_BORDERTOPSTYLE},
120 {attrBorderWidth, DISPID_IHTMLSTYLE_BORDERWIDTH},
121 {attrColor, DISPID_IHTMLSTYLE_COLOR},
122 {attrCursor, DISPID_IHTMLSTYLE_CURSOR},
123 {attrDisplay, DISPID_IHTMLSTYLE_DISPLAY},
124 {attrFilter, DISPID_IHTMLSTYLE_FILTER},
125 {attrFontFamily, DISPID_IHTMLSTYLE_FONTFAMILY},
126 {attrFontSize, DISPID_IHTMLSTYLE_FONTSIZE},
127 {attrFontStyle, DISPID_IHTMLSTYLE_FONTSTYLE},
128 {attrFontVariant, DISPID_IHTMLSTYLE_FONTVARIANT},
129 {attrFontWeight, DISPID_IHTMLSTYLE_FONTWEIGHT},
130 {attrHeight, DISPID_IHTMLSTYLE_HEIGHT},
131 {attrLeft, DISPID_IHTMLSTYLE_LEFT},
132 {attrMargin, DISPID_IHTMLSTYLE_MARGIN},
133 {attrMarginLeft, DISPID_IHTMLSTYLE_MARGINLEFT},
134 {attrMarginRight, DISPID_IHTMLSTYLE_MARGINRIGHT},
135 {attrOverflow, DISPID_IHTMLSTYLE_OVERFLOW},
136 {attrPaddingLeft, DISPID_IHTMLSTYLE_PADDINGLEFT},
137 {attrPosition, DISPID_IHTMLSTYLE2_POSITION},
138 {attrTextAlign, DISPID_IHTMLSTYLE_TEXTALIGN},
139 {attrTextDecoration, DISPID_IHTMLSTYLE_TEXTDECORATION},
140 {attrTop, DISPID_IHTMLSTYLE_TOP},
141 {attrVerticalAlign, DISPID_IHTMLSTYLE_VERTICALALIGN},
142 {attrVisibility, DISPID_IHTMLSTYLE_VISIBILITY},
143 {attrWidth, DISPID_IHTMLSTYLE_WIDTH},
144 {attrZIndex, DISPID_IHTMLSTYLE_ZINDEX}
147 static const WCHAR valLineThrough[] =
148 {'l','i','n','e','-','t','h','r','o','u','g','h',0};
149 static const WCHAR valUnderline[] =
150 {'u','n','d','e','r','l','i','n','e',0};
151 static const WCHAR szNormal[] =
152 {'n','o','r','m','a','l',0};
154 static const WCHAR px_formatW[] = {'%','d','p','x',0};
155 static const WCHAR emptyW[] = {0};
157 static LPWSTR fix_px_value(LPCWSTR val)
162 while(*ptr && isspaceW(*ptr))
167 while(*ptr && isdigitW(*ptr))
170 if(!*ptr || isspaceW(*ptr)) {
172 int len = strlenW(val)+1;
174 ret = heap_alloc((len+2)*sizeof(WCHAR));
175 memcpy(ret, val, (ptr-val)*sizeof(WCHAR));
181 TRACE("fixed %s -> %s\n", debugstr_w(val), debugstr_w(ret));
186 while(*ptr && !isspaceW(*ptr))
193 static LPWSTR fix_url_value(LPCWSTR val)
197 static const WCHAR urlW[] = {'u','r','l','('};
199 if(strncmpW(val, urlW, sizeof(urlW)/sizeof(WCHAR)) || !strchrW(val, '\\'))
202 ret = heap_strdupW(val);
204 for(ptr = ret; *ptr; ptr++) {
212 #define ATTR_FIX_PX 1
213 #define ATTR_FIX_URL 2
214 #define ATTR_STR_TO_INT 4
216 HRESULT set_nsstyle_attr(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, LPCWSTR value, DWORD flags)
218 nsAString str_name, str_value, str_empty;
222 static const PRUnichar wszEmpty[] = {0};
224 if(flags & ATTR_FIX_PX)
225 val = fix_px_value(value);
226 if(flags & ATTR_FIX_URL)
227 val = fix_url_value(value);
229 nsAString_Init(&str_name, style_tbl[sid].name);
230 nsAString_Init(&str_value, val ? val : value);
231 nsAString_Init(&str_empty, wszEmpty);
234 nsres = nsIDOMCSSStyleDeclaration_SetProperty(nsstyle, &str_name, &str_value, &str_empty);
236 ERR("SetProperty failed: %08x\n", nsres);
238 nsAString_Finish(&str_name);
239 nsAString_Finish(&str_value);
240 nsAString_Finish(&str_empty);
245 static HRESULT set_nsstyle_attr_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, VARIANT *value, DWORD flags)
247 switch(V_VT(value)) {
249 return set_nsstyle_attr(nsstyle, sid, emptyW, flags);
252 return set_nsstyle_attr(nsstyle, sid, V_BSTR(value), flags);
255 FIXME("not implemented vt %d\n", V_VT(value));
263 static inline HRESULT set_style_attr(HTMLStyle *This, styleid_t sid, LPCWSTR value, DWORD flags)
265 return set_nsstyle_attr(This->nsstyle, sid, value, flags);
268 static HRESULT get_nsstyle_attr_nsval(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, nsAString *value)
273 nsAString_Init(&str_name, style_tbl[sid].name);
275 nsres = nsIDOMCSSStyleDeclaration_GetPropertyValue(nsstyle, &str_name, value);
276 if(NS_FAILED(nsres)) {
277 ERR("SetProperty failed: %08x\n", nsres);
281 nsAString_Finish(&str_name);
286 HRESULT get_nsstyle_attr(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, BSTR *p)
289 const PRUnichar *value;
291 nsAString_Init(&str_value, NULL);
293 get_nsstyle_attr_nsval(nsstyle, sid, &str_value);
295 nsAString_GetData(&str_value, &value);
296 *p = *value ? SysAllocString(value) : NULL;
298 nsAString_Finish(&str_value);
300 TRACE("%s -> %s\n", debugstr_w(style_tbl[sid].name), debugstr_w(*p));
304 static HRESULT get_nsstyle_attr_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, VARIANT *p, DWORD flags)
307 const PRUnichar *value;
310 nsAString_Init(&str_value, NULL);
312 get_nsstyle_attr_nsval(nsstyle, sid, &str_value);
314 nsAString_GetData(&str_value, &value);
316 if(flags & ATTR_STR_TO_INT) {
317 const PRUnichar *ptr = value;
326 while(isdigitW(*ptr))
327 i = i*10 + (*ptr++ - '0');
331 V_I4(p) = neg ? -i : i;
340 str = SysAllocString(value);
342 return E_OUTOFMEMORY;
349 nsAString_Finish(&str_value);
351 TRACE("%s -> %s\n", debugstr_w(style_tbl[sid].name), debugstr_variant(p));
355 static inline HRESULT get_style_attr(HTMLStyle *This, styleid_t sid, BSTR *p)
357 return get_nsstyle_attr(This->nsstyle, sid, p);
360 static HRESULT check_style_attr_value(HTMLStyle *This, styleid_t sid, LPCWSTR exval, VARIANT_BOOL *p)
363 const PRUnichar *value;
365 nsAString_Init(&str_value, NULL);
367 get_nsstyle_attr_nsval(This->nsstyle, sid, &str_value);
369 nsAString_GetData(&str_value, &value);
370 *p = strcmpW(value, exval) ? VARIANT_FALSE : VARIANT_TRUE;
371 nsAString_Finish(&str_value);
373 TRACE("%s -> %x\n", debugstr_w(style_tbl[sid].name), *p);
377 static inline HRESULT set_style_pos(HTMLStyle *This, styleid_t sid, float value)
380 WCHAR szFormat[] = {'%','.','0','f','p','x',0};
382 value = floor(value);
384 sprintfW(szValue, szFormat, value);
386 return set_style_attr(This, sid, szValue, 0);
389 static HRESULT get_nsstyle_pos(HTMLStyle *This, styleid_t sid, float *p)
393 WCHAR pxW[] = {'p','x',0};
395 TRACE("%p %d %p\n", This, sid, p);
399 nsAString_Init(&str_value, NULL);
401 hres = get_nsstyle_attr_nsval(This->nsstyle, sid, &str_value);
405 const PRUnichar *value;
407 nsAString_GetData(&str_value, &value);
410 *p = strtolW(value, &ptr, 10);
412 if(*ptr && strcmpW(ptr, pxW))
414 nsAString_Finish(&str_value);
415 FIXME("only px values are currently supported\n");
421 TRACE("ret %f\n", *p);
423 nsAString_Finish(&str_value);
428 static BOOL is_valid_border_style(BSTR v)
430 static const WCHAR styleNone[] = {'n','o','n','e',0};
431 static const WCHAR styleDotted[] = {'d','o','t','t','e','d',0};
432 static const WCHAR styleDashed[] = {'d','a','s','h','e','d',0};
433 static const WCHAR styleSolid[] = {'s','o','l','i','d',0};
434 static const WCHAR styleDouble[] = {'d','o','u','b','l','e',0};
435 static const WCHAR styleGroove[] = {'g','r','o','o','v','e',0};
436 static const WCHAR styleRidge[] = {'r','i','d','g','e',0};
437 static const WCHAR styleInset[] = {'i','n','s','e','t',0};
438 static const WCHAR styleOutset[] = {'o','u','t','s','e','t',0};
440 TRACE("%s\n", debugstr_w(v));
442 if(!v || strcmpiW(v, styleNone) == 0 || strcmpiW(v, styleDotted) == 0 ||
443 strcmpiW(v, styleDashed) == 0 || strcmpiW(v, styleSolid) == 0 ||
444 strcmpiW(v, styleDouble) == 0 || strcmpiW(v, styleGroove) == 0 ||
445 strcmpiW(v, styleRidge) == 0 || strcmpiW(v, styleInset) == 0 ||
446 strcmpiW(v, styleOutset) == 0 )
454 #define HTMLSTYLE_THIS(iface) DEFINE_THIS(HTMLStyle, HTMLStyle, iface)
456 static HRESULT WINAPI HTMLStyle_QueryInterface(IHTMLStyle *iface, REFIID riid, void **ppv)
458 HTMLStyle *This = HTMLSTYLE_THIS(iface);
462 if(IsEqualGUID(&IID_IUnknown, riid)) {
463 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
464 *ppv = HTMLSTYLE(This);
465 }else if(IsEqualGUID(&IID_IHTMLStyle, riid)) {
466 TRACE("(%p)->(IID_IHTMLStyle %p)\n", This, ppv);
467 *ppv = HTMLSTYLE(This);
468 }else if(IsEqualGUID(&IID_IHTMLStyle2, riid)) {
469 TRACE("(%p)->(IID_IHTMLStyle2 %p)\n", This, ppv);
470 *ppv = HTMLSTYLE2(This);
471 }else if(IsEqualGUID(&IID_IHTMLStyle3, riid)) {
472 TRACE("(%p)->(IID_IHTMLStyle3 %p)\n", This, ppv);
473 *ppv = HTMLSTYLE3(This);
474 }else if(IsEqualGUID(&IID_IHTMLStyle4, riid)) {
475 TRACE("(%p)->(IID_IHTMLStyle4 %p)\n", This, ppv);
476 *ppv = HTMLSTYLE4(This);
477 }else if(dispex_query_interface(&This->dispex, riid, ppv)) {
478 return *ppv ? S_OK : E_NOINTERFACE;
482 IUnknown_AddRef((IUnknown*)*ppv);
486 WARN("unsupported %s\n", debugstr_guid(riid));
487 return E_NOINTERFACE;
490 static ULONG WINAPI HTMLStyle_AddRef(IHTMLStyle *iface)
492 HTMLStyle *This = HTMLSTYLE_THIS(iface);
493 LONG ref = InterlockedIncrement(&This->ref);
495 TRACE("(%p) ref=%d\n", This, ref);
500 static ULONG WINAPI HTMLStyle_Release(IHTMLStyle *iface)
502 HTMLStyle *This = HTMLSTYLE_THIS(iface);
503 LONG ref = InterlockedDecrement(&This->ref);
505 TRACE("(%p) ref=%d\n", This, ref);
509 nsIDOMCSSStyleDeclaration_Release(This->nsstyle);
516 static HRESULT WINAPI HTMLStyle_GetTypeInfoCount(IHTMLStyle *iface, UINT *pctinfo)
518 HTMLStyle *This = HTMLSTYLE_THIS(iface);
519 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->dispex), pctinfo);
522 static HRESULT WINAPI HTMLStyle_GetTypeInfo(IHTMLStyle *iface, UINT iTInfo,
523 LCID lcid, ITypeInfo **ppTInfo)
525 HTMLStyle *This = HTMLSTYLE_THIS(iface);
526 return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->dispex), iTInfo, lcid, ppTInfo);
529 static HRESULT WINAPI HTMLStyle_GetIDsOfNames(IHTMLStyle *iface, REFIID riid,
530 LPOLESTR *rgszNames, UINT cNames,
531 LCID lcid, DISPID *rgDispId)
533 HTMLStyle *This = HTMLSTYLE_THIS(iface);
534 return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->dispex), riid, rgszNames, cNames, lcid, rgDispId);
537 static HRESULT WINAPI HTMLStyle_Invoke(IHTMLStyle *iface, DISPID dispIdMember,
538 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
539 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
541 HTMLStyle *This = HTMLSTYLE_THIS(iface);
542 return IDispatchEx_Invoke(DISPATCHEX(&This->dispex), dispIdMember, riid, lcid,
543 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
546 static HRESULT WINAPI HTMLStyle_put_fontFamily(IHTMLStyle *iface, BSTR v)
548 HTMLStyle *This = HTMLSTYLE_THIS(iface);
550 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
552 return set_style_attr(This, STYLEID_FONT_FAMILY, v, 0);
555 static HRESULT WINAPI HTMLStyle_get_fontFamily(IHTMLStyle *iface, BSTR *p)
557 HTMLStyle *This = HTMLSTYLE_THIS(iface);
559 TRACE("(%p)->(%p)\n", This, p);
561 return get_style_attr(This, STYLEID_FONT_FAMILY, p);
564 static HRESULT WINAPI HTMLStyle_put_fontStyle(IHTMLStyle *iface, BSTR v)
566 HTMLStyle *This = HTMLSTYLE_THIS(iface);
567 static const WCHAR szItalic[] = {'i','t','a','l','i','c',0};
568 static const WCHAR szOblique[] = {'o','b','l','i','q','u','e',0};
570 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
572 /* fontStyle can only be one of the follow values. */
573 if(!v || strcmpiW(szNormal, v) == 0 || strcmpiW(szItalic, v) == 0 ||
574 strcmpiW(szOblique, v) == 0)
576 return set_nsstyle_attr(This->nsstyle, STYLEID_FONT_STYLE, v, 0);
582 static HRESULT WINAPI HTMLStyle_get_fontStyle(IHTMLStyle *iface, BSTR *p)
584 HTMLStyle *This = HTMLSTYLE_THIS(iface);
586 TRACE("(%p)->(%p)\n", This, p);
588 return get_style_attr(This, STYLEID_FONT_STYLE, p);
591 static HRESULT WINAPI HTMLStyle_put_fontVariant(IHTMLStyle *iface, BSTR v)
593 HTMLStyle *This = HTMLSTYLE_THIS(iface);
594 static const WCHAR szCaps[] = {'s','m','a','l','l','-','c','a','p','s',0};
596 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
598 /* fontVariant can only be one of the follow values. */
599 if(!v || strcmpiW(szNormal, v) == 0 || strcmpiW(szCaps, v) == 0)
601 return set_nsstyle_attr(This->nsstyle, STYLEID_FONT_VARIANT, v, 0);
607 static HRESULT WINAPI HTMLStyle_get_fontVariant(IHTMLStyle *iface, BSTR *p)
609 HTMLStyle *This = HTMLSTYLE_THIS(iface);
610 TRACE("(%p)->(%p)\n", This, p);
615 return get_style_attr(This, STYLEID_FONT_VARIANT, p);
618 static HRESULT WINAPI HTMLStyle_put_fontWeight(IHTMLStyle *iface, BSTR v)
620 HTMLStyle *This = HTMLSTYLE_THIS(iface);
621 static const WCHAR styleBold[] = {'b','o','l','d',0};
622 static const WCHAR styleBolder[] = {'b','o','l','d','e','r',0};
623 static const WCHAR styleLighter[] = {'l','i','g','h','t','e','r',0};
624 static const WCHAR style100[] = {'1','0','0',0};
625 static const WCHAR style200[] = {'2','0','0',0};
626 static const WCHAR style300[] = {'3','0','0',0};
627 static const WCHAR style400[] = {'4','0','0',0};
628 static const WCHAR style500[] = {'5','0','0',0};
629 static const WCHAR style600[] = {'6','0','0',0};
630 static const WCHAR style700[] = {'7','0','0',0};
631 static const WCHAR style800[] = {'8','0','0',0};
632 static const WCHAR style900[] = {'9','0','0',0};
634 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
636 /* fontWeight can only be one of the following */
637 if(!v || strcmpiW(szNormal, v) == 0 || strcmpiW(styleBold, v) == 0 ||
638 strcmpiW(styleBolder, v) == 0 || strcmpiW(styleLighter, v) == 0 ||
639 strcmpiW(style100, v) == 0 || strcmpiW(style200, v) == 0 ||
640 strcmpiW(style300, v) == 0 || strcmpiW(style400, v) == 0 ||
641 strcmpiW(style500, v) == 0 || strcmpiW(style600, v) == 0 ||
642 strcmpiW(style700, v) == 0 || strcmpiW(style800, v) == 0 ||
643 strcmpiW(style900, v) == 0
646 return set_nsstyle_attr(This->nsstyle, STYLEID_FONT_WEIGHT, v, 0);
652 static HRESULT WINAPI HTMLStyle_get_fontWeight(IHTMLStyle *iface, BSTR *p)
654 HTMLStyle *This = HTMLSTYLE_THIS(iface);
656 TRACE("(%p)->(%p)\n", This, p);
658 return get_style_attr(This, STYLEID_FONT_WEIGHT, p);
661 static HRESULT WINAPI HTMLStyle_put_fontSize(IHTMLStyle *iface, VARIANT v)
663 HTMLStyle *This = HTMLSTYLE_THIS(iface);
665 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
669 return set_style_attr(This, STYLEID_FONT_SIZE, V_BSTR(&v), 0);
671 FIXME("not supported vt %d\n", V_VT(&v));
677 static HRESULT WINAPI HTMLStyle_get_fontSize(IHTMLStyle *iface, VARIANT *p)
679 HTMLStyle *This = HTMLSTYLE_THIS(iface);
681 TRACE("(%p)->(%p)\n", This, p);
684 return get_style_attr(This, STYLEID_FONT_SIZE, &V_BSTR(p));
687 static HRESULT WINAPI HTMLStyle_put_font(IHTMLStyle *iface, BSTR v)
689 HTMLStyle *This = HTMLSTYLE_THIS(iface);
690 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
694 static HRESULT WINAPI HTMLStyle_get_font(IHTMLStyle *iface, BSTR *p)
696 HTMLStyle *This = HTMLSTYLE_THIS(iface);
697 FIXME("(%p)->(%p)\n", This, p);
701 static HRESULT WINAPI HTMLStyle_put_color(IHTMLStyle *iface, VARIANT v)
703 HTMLStyle *This = HTMLSTYLE_THIS(iface);
705 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
709 TRACE("%s\n", debugstr_w(V_BSTR(&v)));
710 return set_style_attr(This, STYLEID_COLOR, V_BSTR(&v), 0);
713 FIXME("unsupported vt=%d\n", V_VT(&v));
719 static HRESULT WINAPI HTMLStyle_get_color(IHTMLStyle *iface, VARIANT *p)
721 HTMLStyle *This = HTMLSTYLE_THIS(iface);
723 TRACE("(%p)->(%p)\n", This, p);
726 return get_style_attr(This, STYLEID_COLOR, &V_BSTR(p));
729 static HRESULT WINAPI HTMLStyle_put_background(IHTMLStyle *iface, BSTR v)
731 HTMLStyle *This = HTMLSTYLE_THIS(iface);
733 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
735 return set_style_attr(This, STYLEID_BACKGROUND, v, 0);
738 static HRESULT WINAPI HTMLStyle_get_background(IHTMLStyle *iface, BSTR *p)
740 HTMLStyle *This = HTMLSTYLE_THIS(iface);
742 TRACE("(%p)->(%p)\n", This, p);
744 return get_style_attr(This, STYLEID_BACKGROUND, p);
747 static HRESULT WINAPI HTMLStyle_put_backgroundColor(IHTMLStyle *iface, VARIANT v)
749 HTMLStyle *This = HTMLSTYLE_THIS(iface);
751 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
755 return set_style_attr(This, STYLEID_BACKGROUND_COLOR, V_BSTR(&v), 0);
758 static const WCHAR format[] = {'#','%','0','6','x',0};
760 wsprintfW(value, format, V_I4(&v));
761 return set_style_attr(This, STYLEID_BACKGROUND_COLOR, value, 0);
764 FIXME("unsupported vt %d\n", V_VT(&v));
770 static HRESULT WINAPI HTMLStyle_get_backgroundColor(IHTMLStyle *iface, VARIANT *p)
772 HTMLStyle *This = HTMLSTYLE_THIS(iface);
773 TRACE("(%p)->(%p)\n", This, p);
776 return get_style_attr(This, STYLEID_BACKGROUND_COLOR, &V_BSTR(p));
779 static HRESULT WINAPI HTMLStyle_put_backgroundImage(IHTMLStyle *iface, BSTR v)
781 HTMLStyle *This = HTMLSTYLE_THIS(iface);
783 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
785 return set_style_attr(This, STYLEID_BACKGROUND_IMAGE, v, ATTR_FIX_URL);
788 static HRESULT WINAPI HTMLStyle_get_backgroundImage(IHTMLStyle *iface, BSTR *p)
790 HTMLStyle *This = HTMLSTYLE_THIS(iface);
792 TRACE("(%p)->(%p)\n", This, p);
794 return get_style_attr(This, STYLEID_BACKGROUND_IMAGE, p);
797 static HRESULT WINAPI HTMLStyle_put_backgroundRepeat(IHTMLStyle *iface, BSTR v)
799 HTMLStyle *This = HTMLSTYLE_THIS(iface);
800 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
804 static HRESULT WINAPI HTMLStyle_get_backgroundRepeat(IHTMLStyle *iface, BSTR *p)
806 HTMLStyle *This = HTMLSTYLE_THIS(iface);
807 FIXME("(%p)->(%p)\n", This, p);
811 static HRESULT WINAPI HTMLStyle_put_backgroundAttachment(IHTMLStyle *iface, BSTR v)
813 HTMLStyle *This = HTMLSTYLE_THIS(iface);
814 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
818 static HRESULT WINAPI HTMLStyle_get_backgroundAttachment(IHTMLStyle *iface, BSTR *p)
820 HTMLStyle *This = HTMLSTYLE_THIS(iface);
821 FIXME("(%p)->(%p)\n", This, p);
825 static HRESULT WINAPI HTMLStyle_put_backgroundPosition(IHTMLStyle *iface, BSTR v)
827 HTMLStyle *This = HTMLSTYLE_THIS(iface);
828 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
832 static HRESULT WINAPI HTMLStyle_get_backgroundPosition(IHTMLStyle *iface, BSTR *p)
834 HTMLStyle *This = HTMLSTYLE_THIS(iface);
835 FIXME("(%p)->(%p)\n", This, p);
839 static HRESULT WINAPI HTMLStyle_put_backgroundPositionX(IHTMLStyle *iface, VARIANT v)
841 HTMLStyle *This = HTMLSTYLE_THIS(iface);
842 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
846 static HRESULT WINAPI HTMLStyle_get_backgroundPositionX(IHTMLStyle *iface, VARIANT *p)
848 HTMLStyle *This = HTMLSTYLE_THIS(iface);
849 FIXME("(%p)->(%p)\n", This, p);
853 static HRESULT WINAPI HTMLStyle_put_backgroundPositionY(IHTMLStyle *iface, VARIANT v)
855 HTMLStyle *This = HTMLSTYLE_THIS(iface);
856 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
860 static HRESULT WINAPI HTMLStyle_get_backgroundPositionY(IHTMLStyle *iface, VARIANT *p)
862 HTMLStyle *This = HTMLSTYLE_THIS(iface);
863 FIXME("(%p)->(%p)\n", This, p);
867 static HRESULT WINAPI HTMLStyle_put_wordSpacing(IHTMLStyle *iface, VARIANT v)
869 HTMLStyle *This = HTMLSTYLE_THIS(iface);
870 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
874 static HRESULT WINAPI HTMLStyle_get_wordSpacing(IHTMLStyle *iface, VARIANT *p)
876 HTMLStyle *This = HTMLSTYLE_THIS(iface);
877 FIXME("(%p)->(%p)\n", This, p);
881 static HRESULT WINAPI HTMLStyle_put_letterSpacing(IHTMLStyle *iface, VARIANT v)
883 HTMLStyle *This = HTMLSTYLE_THIS(iface);
884 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
888 static HRESULT WINAPI HTMLStyle_get_letterSpacing(IHTMLStyle *iface, VARIANT *p)
890 HTMLStyle *This = HTMLSTYLE_THIS(iface);
891 FIXME("(%p)->(%p)\n", This, p);
895 static HRESULT WINAPI HTMLStyle_put_textDecoration(IHTMLStyle *iface, BSTR v)
897 HTMLStyle *This = HTMLSTYLE_THIS(iface);
898 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
902 static HRESULT WINAPI HTMLStyle_get_textDecoration(IHTMLStyle *iface, BSTR *p)
904 HTMLStyle *This = HTMLSTYLE_THIS(iface);
906 TRACE("(%p)->(%p)\n", This, p);
908 return get_style_attr(This, STYLEID_TEXT_DECORATION, p);
911 static HRESULT WINAPI HTMLStyle_put_textDecorationNone(IHTMLStyle *iface, VARIANT_BOOL v)
913 HTMLStyle *This = HTMLSTYLE_THIS(iface);
914 FIXME("(%p)->(%x)\n", This, v);
918 static HRESULT WINAPI HTMLStyle_get_textDecorationNone(IHTMLStyle *iface, VARIANT_BOOL *p)
920 HTMLStyle *This = HTMLSTYLE_THIS(iface);
921 FIXME("(%p)->(%p)\n", This, p);
925 static HRESULT WINAPI HTMLStyle_put_textDecorationUnderline(IHTMLStyle *iface, VARIANT_BOOL v)
927 HTMLStyle *This = HTMLSTYLE_THIS(iface);
928 FIXME("(%p)->(%x)\n", This, v);
932 static HRESULT WINAPI HTMLStyle_get_textDecorationUnderline(IHTMLStyle *iface, VARIANT_BOOL *p)
934 HTMLStyle *This = HTMLSTYLE_THIS(iface);
936 TRACE("(%p)->(%p)\n", This, p);
938 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, valUnderline, p);
941 static HRESULT WINAPI HTMLStyle_put_textDecorationOverline(IHTMLStyle *iface, VARIANT_BOOL v)
943 HTMLStyle *This = HTMLSTYLE_THIS(iface);
944 FIXME("(%p)->(%x)\n", This, v);
948 static HRESULT WINAPI HTMLStyle_get_textDecorationOverline(IHTMLStyle *iface, VARIANT_BOOL *p)
950 HTMLStyle *This = HTMLSTYLE_THIS(iface);
951 FIXME("(%p)->(%p)\n", This, p);
955 static HRESULT WINAPI HTMLStyle_put_textDecorationLineThrough(IHTMLStyle *iface, VARIANT_BOOL v)
957 HTMLStyle *This = HTMLSTYLE_THIS(iface);
958 FIXME("(%p)->(%x)\n", This, v);
962 static HRESULT WINAPI HTMLStyle_get_textDecorationLineThrough(IHTMLStyle *iface, VARIANT_BOOL *p)
964 HTMLStyle *This = HTMLSTYLE_THIS(iface);
966 TRACE("(%p)->(%p)\n", This, p);
968 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, valLineThrough, p);
971 static HRESULT WINAPI HTMLStyle_put_textDecorationBlink(IHTMLStyle *iface, VARIANT_BOOL v)
973 HTMLStyle *This = HTMLSTYLE_THIS(iface);
974 FIXME("(%p)->(%x)\n", This, v);
978 static HRESULT WINAPI HTMLStyle_get_textDecorationBlink(IHTMLStyle *iface, VARIANT_BOOL *p)
980 HTMLStyle *This = HTMLSTYLE_THIS(iface);
981 FIXME("(%p)->(%p)\n", This, p);
985 static HRESULT WINAPI HTMLStyle_put_verticalAlign(IHTMLStyle *iface, VARIANT v)
987 HTMLStyle *This = HTMLSTYLE_THIS(iface);
989 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
993 return set_style_attr(This, STYLEID_VERTICAL_ALIGN, V_BSTR(&v), 0);
995 FIXME("not implemented vt %d\n", V_VT(&v));
1002 static HRESULT WINAPI HTMLStyle_get_verticalAlign(IHTMLStyle *iface, VARIANT *p)
1004 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1008 TRACE("(%p)->(%p)\n", This, p);
1010 hres = get_style_attr(This, STYLEID_VERTICAL_ALIGN, &ret);
1019 static HRESULT WINAPI HTMLStyle_put_textTransform(IHTMLStyle *iface, BSTR v)
1021 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1022 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1026 static HRESULT WINAPI HTMLStyle_get_textTransform(IHTMLStyle *iface, BSTR *p)
1028 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1029 FIXME("(%p)->(%p)\n", This, p);
1033 static HRESULT WINAPI HTMLStyle_put_textAlign(IHTMLStyle *iface, BSTR v)
1035 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1037 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1039 return set_style_attr(This, STYLEID_TEXT_ALIGN, v, 0);
1042 static HRESULT WINAPI HTMLStyle_get_textAlign(IHTMLStyle *iface, BSTR *p)
1044 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1046 TRACE("(%p)->(%p)\n", This, p);
1048 return get_style_attr(This, STYLEID_TEXT_ALIGN, p);
1051 static HRESULT WINAPI HTMLStyle_put_textIndent(IHTMLStyle *iface, VARIANT v)
1053 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1054 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1058 static HRESULT WINAPI HTMLStyle_get_textIndent(IHTMLStyle *iface, VARIANT *p)
1060 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1061 FIXME("(%p)->(%p)\n", This, p);
1065 static HRESULT WINAPI HTMLStyle_put_lineHeight(IHTMLStyle *iface, VARIANT v)
1067 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1068 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1072 static HRESULT WINAPI HTMLStyle_get_lineHeight(IHTMLStyle *iface, VARIANT *p)
1074 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1075 FIXME("(%p)->(%p)\n", This, p);
1079 static HRESULT WINAPI HTMLStyle_put_marginTop(IHTMLStyle *iface, VARIANT v)
1081 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1082 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1086 static HRESULT WINAPI HTMLStyle_get_marginTop(IHTMLStyle *iface, VARIANT *p)
1088 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1089 FIXME("(%p)->(%p)\n", This, p);
1093 static HRESULT WINAPI HTMLStyle_put_marginRight(IHTMLStyle *iface, VARIANT v)
1095 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1097 TRACE("(%p)->(v(%d))\n", This, V_VT(&v));
1101 return set_style_attr(This, STYLEID_MARGIN_RIGHT, emptyW, 0);
1105 wsprintfW(buf, px_formatW, V_I4(&v));
1106 return set_style_attr(This, STYLEID_MARGIN_RIGHT, buf, 0);
1109 return set_style_attr(This, STYLEID_MARGIN_RIGHT, V_BSTR(&v), 0);
1111 FIXME("Unsupported vt=%d\n", V_VT(&v));
1117 static HRESULT WINAPI HTMLStyle_get_marginRight(IHTMLStyle *iface, VARIANT *p)
1119 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1120 FIXME("(%p)->(%p)\n", This, p);
1124 static HRESULT WINAPI HTMLStyle_put_marginBottom(IHTMLStyle *iface, VARIANT v)
1126 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1127 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1131 static HRESULT WINAPI HTMLStyle_get_marginBottom(IHTMLStyle *iface, VARIANT *p)
1133 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1134 FIXME("(%p)->(%p)\n", This, p);
1138 static HRESULT WINAPI HTMLStyle_put_marginLeft(IHTMLStyle *iface, VARIANT v)
1140 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1144 TRACE("(%p)->(NULL)\n", This);
1145 return set_style_attr(This, STYLEID_MARGIN_LEFT, emptyW, 0);
1149 TRACE("(%p)->(%d)\n", This, V_I4(&v));
1151 wsprintfW(buf, px_formatW, V_I4(&v));
1152 return set_style_attr(This, STYLEID_MARGIN_LEFT, buf, 0);
1155 TRACE("(%p)->(%s)\n", This, debugstr_w(V_BSTR(&v)));
1156 return set_style_attr(This, STYLEID_MARGIN_LEFT, V_BSTR(&v), 0);
1158 FIXME("Unsupported vt=%d\n", V_VT(&v));
1164 static HRESULT WINAPI HTMLStyle_put_margin(IHTMLStyle *iface, BSTR v)
1166 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1168 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1170 return set_style_attr(This, STYLEID_MARGIN, v, 0);
1173 static HRESULT WINAPI HTMLStyle_get_margin(IHTMLStyle *iface, BSTR *p)
1175 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1177 TRACE("(%p)->(%p)\n", This, p);
1179 return get_style_attr(This, STYLEID_MARGIN, p);
1182 static HRESULT WINAPI HTMLStyle_get_marginLeft(IHTMLStyle *iface, VARIANT *p)
1184 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1185 FIXME("(%p)->(%p)\n", This, p);
1189 static HRESULT WINAPI HTMLStyle_put_paddingTop(IHTMLStyle *iface, VARIANT v)
1191 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1192 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1196 static HRESULT WINAPI HTMLStyle_get_paddingTop(IHTMLStyle *iface, VARIANT *p)
1198 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1199 FIXME("(%p)->(%p)\n", This, p);
1203 static HRESULT WINAPI HTMLStyle_put_paddingRight(IHTMLStyle *iface, VARIANT v)
1205 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1206 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1210 static HRESULT WINAPI HTMLStyle_get_paddingRight(IHTMLStyle *iface, VARIANT *p)
1212 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1213 FIXME("(%p)->(%p)\n", This, p);
1217 static HRESULT WINAPI HTMLStyle_put_paddingBottom(IHTMLStyle *iface, VARIANT v)
1219 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1220 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1224 static HRESULT WINAPI HTMLStyle_get_paddingBottom(IHTMLStyle *iface, VARIANT *p)
1226 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1227 FIXME("(%p)->(%p)\n", This, p);
1231 static HRESULT WINAPI HTMLStyle_put_paddingLeft(IHTMLStyle *iface, VARIANT v)
1233 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1235 TRACE("(%p)->(vt=%d)\n", This, V_VT(&v));
1241 wsprintfW(buf, px_formatW, V_I4(&v));
1242 return set_style_attr(This, STYLEID_PADDING_LEFT, buf, 0);
1245 return set_style_attr(This, STYLEID_PADDING_LEFT, V_BSTR(&v), 0);
1247 FIXME("unsupported vt=%d\n", V_VT(&v));
1253 static HRESULT WINAPI HTMLStyle_get_paddingLeft(IHTMLStyle *iface, VARIANT *p)
1255 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1256 FIXME("(%p)->(%p)\n", This, p);
1260 static HRESULT WINAPI HTMLStyle_put_padding(IHTMLStyle *iface, BSTR v)
1262 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1263 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1267 static HRESULT WINAPI HTMLStyle_get_padding(IHTMLStyle *iface, BSTR *p)
1269 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1270 FIXME("(%p)->(%p)\n", This, p);
1274 static HRESULT WINAPI HTMLStyle_put_border(IHTMLStyle *iface, BSTR v)
1276 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1278 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1280 return set_style_attr(This, STYLEID_BORDER, v, 0);
1283 static HRESULT WINAPI HTMLStyle_get_border(IHTMLStyle *iface, BSTR *p)
1285 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1287 TRACE("(%p)->(%p)\n", This, p);
1289 return get_style_attr(This, STYLEID_BORDER, p);
1292 static HRESULT WINAPI HTMLStyle_put_borderTop(IHTMLStyle *iface, BSTR v)
1294 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1295 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1299 static HRESULT WINAPI HTMLStyle_get_borderTop(IHTMLStyle *iface, BSTR *p)
1301 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1302 FIXME("(%p)->(%p)\n", This, p);
1306 static HRESULT WINAPI HTMLStyle_put_borderRight(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_borderRight(IHTMLStyle *iface, BSTR *p)
1315 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1316 FIXME("(%p)->(%p)\n", This, p);
1320 static HRESULT WINAPI HTMLStyle_put_borderBottom(IHTMLStyle *iface, BSTR v)
1322 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1323 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1327 static HRESULT WINAPI HTMLStyle_get_borderBottom(IHTMLStyle *iface, BSTR *p)
1329 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1330 FIXME("(%p)->(%p)\n", This, p);
1334 static HRESULT WINAPI HTMLStyle_put_borderLeft(IHTMLStyle *iface, BSTR v)
1336 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1338 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1340 return set_style_attr(This, STYLEID_BORDER_LEFT, v, ATTR_FIX_PX);
1343 static HRESULT WINAPI HTMLStyle_get_borderLeft(IHTMLStyle *iface, BSTR *p)
1345 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1346 FIXME("(%p)->(%p)\n", This, p);
1350 static HRESULT WINAPI HTMLStyle_put_borderColor(IHTMLStyle *iface, BSTR v)
1352 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1353 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1357 static HRESULT WINAPI HTMLStyle_get_borderColor(IHTMLStyle *iface, BSTR *p)
1359 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1360 FIXME("(%p)->(%p)\n", This, p);
1364 static HRESULT WINAPI HTMLStyle_put_borderTopColor(IHTMLStyle *iface, VARIANT v)
1366 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1367 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1371 static HRESULT WINAPI HTMLStyle_get_borderTopColor(IHTMLStyle *iface, VARIANT *p)
1373 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1374 FIXME("(%p)->(%p)\n", This, p);
1378 static HRESULT WINAPI HTMLStyle_put_borderRightColor(IHTMLStyle *iface, VARIANT v)
1380 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1381 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1385 static HRESULT WINAPI HTMLStyle_get_borderRightColor(IHTMLStyle *iface, VARIANT *p)
1387 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1388 FIXME("(%p)->(%p)\n", This, p);
1392 static HRESULT WINAPI HTMLStyle_put_borderBottomColor(IHTMLStyle *iface, VARIANT v)
1394 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1395 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1399 static HRESULT WINAPI HTMLStyle_get_borderBottomColor(IHTMLStyle *iface, VARIANT *p)
1401 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1402 FIXME("(%p)->(%p)\n", This, p);
1406 static HRESULT WINAPI HTMLStyle_put_borderLeftColor(IHTMLStyle *iface, VARIANT v)
1408 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1409 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1413 static HRESULT WINAPI HTMLStyle_get_borderLeftColor(IHTMLStyle *iface, VARIANT *p)
1415 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1416 FIXME("(%p)->(%p)\n", This, p);
1420 static HRESULT WINAPI HTMLStyle_put_borderWidth(IHTMLStyle *iface, BSTR v)
1422 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1423 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1424 return set_style_attr(This, STYLEID_BORDER_WIDTH, v, ATTR_FIX_PX);
1427 static HRESULT WINAPI HTMLStyle_get_borderWidth(IHTMLStyle *iface, BSTR *p)
1429 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1430 TRACE("(%p)->(%p)\n", This, p);
1431 return get_style_attr(This, STYLEID_BORDER_WIDTH, p);
1434 static HRESULT WINAPI HTMLStyle_put_borderTopWidth(IHTMLStyle *iface, VARIANT v)
1436 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1437 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1441 static HRESULT WINAPI HTMLStyle_get_borderTopWidth(IHTMLStyle *iface, VARIANT *p)
1443 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1444 FIXME("(%p)->(%p)\n", This, p);
1448 static HRESULT WINAPI HTMLStyle_put_borderRightWidth(IHTMLStyle *iface, VARIANT v)
1450 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1451 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1455 static HRESULT WINAPI HTMLStyle_get_borderRightWidth(IHTMLStyle *iface, VARIANT *p)
1457 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1458 FIXME("(%p)->(%p)\n", This, p);
1462 static HRESULT WINAPI HTMLStyle_put_borderBottomWidth(IHTMLStyle *iface, VARIANT v)
1464 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1465 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1469 static HRESULT WINAPI HTMLStyle_get_borderBottomWidth(IHTMLStyle *iface, VARIANT *p)
1471 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1472 FIXME("(%p)->(%p)\n", This, p);
1476 static HRESULT WINAPI HTMLStyle_put_borderLeftWidth(IHTMLStyle *iface, VARIANT v)
1478 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1479 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1483 static HRESULT WINAPI HTMLStyle_get_borderLeftWidth(IHTMLStyle *iface, VARIANT *p)
1485 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1486 FIXME("(%p)->(%p)\n", This, p);
1490 static HRESULT WINAPI HTMLStyle_put_borderStyle(IHTMLStyle *iface, BSTR v)
1492 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1493 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1497 static HRESULT WINAPI HTMLStyle_get_borderStyle(IHTMLStyle *iface, BSTR *p)
1499 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1500 FIXME("(%p)->(%p)\n", This, p);
1504 static HRESULT WINAPI HTMLStyle_put_borderTopStyle(IHTMLStyle *iface, BSTR v)
1506 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1507 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1509 if(!is_valid_border_style(v))
1510 return E_INVALIDARG;
1512 return set_style_attr(This, STYLEID_BORDER_TOP_STYLE, v, 0);
1515 static HRESULT WINAPI HTMLStyle_get_borderTopStyle(IHTMLStyle *iface, BSTR *p)
1517 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1518 TRACE("(%p)->(%p)\n", This, p);
1519 return get_style_attr(This, STYLEID_BORDER_TOP_STYLE, p);
1522 static HRESULT WINAPI HTMLStyle_put_borderRightStyle(IHTMLStyle *iface, BSTR v)
1524 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1525 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1527 if(!is_valid_border_style(v))
1528 return E_INVALIDARG;
1530 return set_style_attr(This, STYLEID_BORDER_RIGHT_STYLE, v, 0);
1533 static HRESULT WINAPI HTMLStyle_get_borderRightStyle(IHTMLStyle *iface, BSTR *p)
1535 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1536 TRACE("(%p)->(%p)\n", This, p);
1537 return get_style_attr(This, STYLEID_BORDER_RIGHT_STYLE, p);
1540 static HRESULT WINAPI HTMLStyle_put_borderBottomStyle(IHTMLStyle *iface, BSTR v)
1542 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1543 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1545 if(!is_valid_border_style(v))
1546 return E_INVALIDARG;
1548 return set_style_attr(This, STYLEID_BORDER_BOTTOM_STYLE, v, 0);
1551 static HRESULT WINAPI HTMLStyle_get_borderBottomStyle(IHTMLStyle *iface, BSTR *p)
1553 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1554 TRACE("(%p)->(%p)\n", This, p);
1555 return get_style_attr(This, STYLEID_BORDER_BOTTOM_STYLE, p);
1558 static HRESULT WINAPI HTMLStyle_put_borderLeftStyle(IHTMLStyle *iface, BSTR v)
1560 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1561 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1563 if(!is_valid_border_style(v))
1564 return E_INVALIDARG;
1566 return set_style_attr(This, STYLEID_BORDER_LEFT_STYLE, v, 0);
1569 static HRESULT WINAPI HTMLStyle_get_borderLeftStyle(IHTMLStyle *iface, BSTR *p)
1571 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1572 TRACE("(%p)->(%p)\n", This, p);
1573 return get_style_attr(This, STYLEID_BORDER_LEFT_STYLE, p);
1576 static HRESULT WINAPI HTMLStyle_put_width(IHTMLStyle *iface, VARIANT v)
1578 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1580 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
1584 TRACE("%s\n", debugstr_w(V_BSTR(&v)));
1585 return set_style_attr(This, STYLEID_WIDTH, V_BSTR(&v), 0);
1587 FIXME("unsupported vt %d\n", V_VT(&v));
1593 static HRESULT WINAPI HTMLStyle_get_width(IHTMLStyle *iface, VARIANT *p)
1595 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1597 TRACE("(%p)->(%p)\n", This, p);
1600 return get_style_attr(This, STYLEID_WIDTH, &V_BSTR(p));
1603 static HRESULT WINAPI HTMLStyle_put_height(IHTMLStyle *iface, VARIANT v)
1605 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1607 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1611 return set_style_attr(This, STYLEID_HEIGHT, V_BSTR(&v), 0);
1613 FIXME("unimplemented vt %d\n", V_VT(&v));
1620 static HRESULT WINAPI HTMLStyle_get_height(IHTMLStyle *iface, VARIANT *p)
1622 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1626 TRACE("(%p)->(%p)\n", This, p);
1628 hres = get_style_attr(This, STYLEID_HEIGHT, &ret);
1637 static HRESULT WINAPI HTMLStyle_put_styleFloat(IHTMLStyle *iface, BSTR v)
1639 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1640 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1644 static HRESULT WINAPI HTMLStyle_get_styleFloat(IHTMLStyle *iface, BSTR *p)
1646 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1647 FIXME("(%p)->(%p)\n", This, p);
1651 static HRESULT WINAPI HTMLStyle_put_clear(IHTMLStyle *iface, BSTR v)
1653 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1654 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1658 static HRESULT WINAPI HTMLStyle_get_clear(IHTMLStyle *iface, BSTR *p)
1660 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1661 FIXME("(%p)->(%p)\n", This, p);
1665 static HRESULT WINAPI HTMLStyle_put_display(IHTMLStyle *iface, BSTR v)
1667 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1669 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1671 return set_style_attr(This, STYLEID_DISPLAY, v, 0);
1674 static HRESULT WINAPI HTMLStyle_get_display(IHTMLStyle *iface, BSTR *p)
1676 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1678 TRACE("(%p)->(%p)\n", This, p);
1680 return get_style_attr(This, STYLEID_DISPLAY, p);
1683 static HRESULT WINAPI HTMLStyle_put_visibility(IHTMLStyle *iface, BSTR v)
1685 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1687 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1689 return set_style_attr(This, STYLEID_VISIBILITY, v, 0);
1692 static HRESULT WINAPI HTMLStyle_get_visibility(IHTMLStyle *iface, BSTR *p)
1694 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1696 TRACE("(%p)->(%p)\n", This, p);
1698 return get_style_attr(This, STYLEID_VISIBILITY, p);
1701 static HRESULT WINAPI HTMLStyle_put_listStyleType(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_listStyleType(IHTMLStyle *iface, BSTR *p)
1710 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1711 FIXME("(%p)->(%p)\n", This, p);
1715 static HRESULT WINAPI HTMLStyle_put_listStylePosition(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_listStylePosition(IHTMLStyle *iface, BSTR *p)
1724 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1725 FIXME("(%p)->(%p)\n", This, p);
1729 static HRESULT WINAPI HTMLStyle_put_listStyleImage(IHTMLStyle *iface, BSTR v)
1731 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1732 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1736 static HRESULT WINAPI HTMLStyle_get_listStyleImage(IHTMLStyle *iface, BSTR *p)
1738 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1739 FIXME("(%p)->(%p)\n", This, p);
1743 static HRESULT WINAPI HTMLStyle_put_listStyle(IHTMLStyle *iface, BSTR v)
1745 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1746 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1750 static HRESULT WINAPI HTMLStyle_get_listStyle(IHTMLStyle *iface, BSTR *p)
1752 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1753 FIXME("(%p)->(%p)\n", This, p);
1757 static HRESULT WINAPI HTMLStyle_put_whiteSpace(IHTMLStyle *iface, BSTR v)
1759 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1760 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1764 static HRESULT WINAPI HTMLStyle_get_whiteSpace(IHTMLStyle *iface, BSTR *p)
1766 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1767 FIXME("(%p)->(%p)\n", This, p);
1771 static HRESULT WINAPI HTMLStyle_put_top(IHTMLStyle *iface, VARIANT v)
1773 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1775 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1777 return set_nsstyle_attr_var(This->nsstyle, STYLEID_TOP, &v, 0);
1780 static HRESULT WINAPI HTMLStyle_get_top(IHTMLStyle *iface, VARIANT *p)
1782 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1786 TRACE("(%p)->(%p)\n", This, p);
1788 hres = get_style_attr(This, STYLEID_TOP, &ret);
1797 static HRESULT WINAPI HTMLStyle_put_left(IHTMLStyle *iface, VARIANT v)
1799 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1801 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1803 return set_nsstyle_attr_var(This->nsstyle, STYLEID_LEFT, &v, 0);
1806 static HRESULT WINAPI HTMLStyle_get_left(IHTMLStyle *iface, VARIANT *p)
1808 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1812 TRACE("(%p)->(%p)\n", This, p);
1814 hres = get_style_attr(This, STYLEID_LEFT, &ret);
1823 static HRESULT WINAPI HTMLStyle_get_position(IHTMLStyle *iface, BSTR *p)
1825 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1826 TRACE("(%p)->(%p)\n", This, p);
1827 return IHTMLStyle2_get_position(HTMLSTYLE2(This), p);
1830 static HRESULT WINAPI HTMLStyle_put_zIndex(IHTMLStyle *iface, VARIANT v)
1832 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1834 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1838 return set_style_attr(This, STYLEID_Z_INDEX, V_BSTR(&v), 0);
1841 static const WCHAR format[] = {'%','d',0};
1843 wsprintfW(value, format, V_I4(&v));
1844 return set_style_attr(This, STYLEID_Z_INDEX, value, 0);
1847 FIXME("unimplemented vt %d\n", V_VT(&v));
1854 static HRESULT WINAPI HTMLStyle_get_zIndex(IHTMLStyle *iface, VARIANT *p)
1856 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1858 TRACE("(%p)->(%p)\n", This, p);
1860 return get_nsstyle_attr_var(This->nsstyle, STYLEID_Z_INDEX, p, ATTR_STR_TO_INT);
1863 static HRESULT WINAPI HTMLStyle_put_overflow(IHTMLStyle *iface, BSTR v)
1865 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1866 static const WCHAR szVisible[] = {'v','i','s','i','b','l','e',0};
1867 static const WCHAR szScroll[] = {'s','c','r','o','l','l',0};
1868 static const WCHAR szHidden[] = {'h','i','d','d','e','n',0};
1869 static const WCHAR szAuto[] = {'a','u','t','o',0};
1871 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1873 /* overflow can only be one of the follow values. */
1874 if(!v || strcmpiW(szVisible, v) == 0 || strcmpiW(szScroll, v) == 0 ||
1875 strcmpiW(szHidden, v) == 0 || strcmpiW(szAuto, v) == 0)
1877 return set_nsstyle_attr(This->nsstyle, STYLEID_OVERFLOW, v, 0);
1880 return E_INVALIDARG;
1884 static HRESULT WINAPI HTMLStyle_get_overflow(IHTMLStyle *iface, BSTR *p)
1886 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1888 TRACE("(%p)->(%p)\n", This, p);
1891 return E_INVALIDARG;
1893 return get_style_attr(This, STYLEID_OVERFLOW, p);
1896 static HRESULT WINAPI HTMLStyle_put_pageBreakBefore(IHTMLStyle *iface, BSTR v)
1898 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1899 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1903 static HRESULT WINAPI HTMLStyle_get_pageBreakBefore(IHTMLStyle *iface, BSTR *p)
1905 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1906 FIXME("(%p)->(%p)\n", This, p);
1910 static HRESULT WINAPI HTMLStyle_put_pageBreakAfter(IHTMLStyle *iface, BSTR v)
1912 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1913 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1917 static HRESULT WINAPI HTMLStyle_get_pageBreakAfter(IHTMLStyle *iface, BSTR *p)
1919 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1920 FIXME("(%p)->(%p)\n", This, p);
1924 static HRESULT WINAPI HTMLStyle_put_cssText(IHTMLStyle *iface, BSTR v)
1926 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1927 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1931 static HRESULT WINAPI HTMLStyle_get_cssText(IHTMLStyle *iface, BSTR *p)
1933 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1934 FIXME("(%p)->(%p)\n", This, p);
1938 static HRESULT WINAPI HTMLStyle_put_pixelTop(IHTMLStyle *iface, long v)
1940 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1941 FIXME("(%p)->()\n", This);
1945 static HRESULT WINAPI HTMLStyle_get_pixelTop(IHTMLStyle *iface, long *p)
1947 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1948 FIXME("(%p)->()\n", This);
1952 static HRESULT WINAPI HTMLStyle_put_pixelLeft(IHTMLStyle *iface, long v)
1954 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1955 FIXME("(%p)->()\n", This);
1959 static HRESULT WINAPI HTMLStyle_get_pixelLeft(IHTMLStyle *iface, long *p)
1961 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1962 FIXME("(%p)->()\n", This);
1966 static HRESULT WINAPI HTMLStyle_put_pixelWidth(IHTMLStyle *iface, long v)
1968 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1969 FIXME("(%p)->()\n", This);
1973 static HRESULT WINAPI HTMLStyle_get_pixelWidth(IHTMLStyle *iface, long *p)
1975 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1976 FIXME("(%p)->()\n", This);
1980 static HRESULT WINAPI HTMLStyle_put_pixelHeight(IHTMLStyle *iface, long v)
1982 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1983 FIXME("(%p)->()\n", This);
1987 static HRESULT WINAPI HTMLStyle_get_pixelHeight(IHTMLStyle *iface, long *p)
1989 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1990 FIXME("(%p)->()\n", This);
1994 static HRESULT WINAPI HTMLStyle_put_posTop(IHTMLStyle *iface, float v)
1996 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1998 TRACE("(%p)->(%f)\n", This, v);
2000 return set_style_pos(This, STYLEID_TOP, v);
2003 static HRESULT WINAPI HTMLStyle_get_posTop(IHTMLStyle *iface, float *p)
2005 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2007 TRACE("(%p)->(%p)\n", This, p);
2012 return get_nsstyle_pos(This, STYLEID_TOP, p);
2015 static HRESULT WINAPI HTMLStyle_put_posLeft(IHTMLStyle *iface, float v)
2017 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2019 TRACE("(%p)->(%f)\n", This, v);
2021 return set_style_pos(This, STYLEID_LEFT, v);
2024 static HRESULT WINAPI HTMLStyle_get_posLeft(IHTMLStyle *iface, float *p)
2026 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2028 TRACE("(%p)->(%p)\n", This, p);
2033 return get_nsstyle_pos(This, STYLEID_LEFT, p);
2036 static HRESULT WINAPI HTMLStyle_put_posWidth(IHTMLStyle *iface, float v)
2038 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2040 TRACE("(%p)->(%f)\n", This, v);
2042 return set_style_pos(This, STYLEID_WIDTH, v);
2045 static HRESULT WINAPI HTMLStyle_get_posWidth(IHTMLStyle *iface, float *p)
2047 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2049 TRACE("(%p)->(%p)\n", This, p);
2054 if(get_nsstyle_pos(This, STYLEID_WIDTH, p) != S_OK)
2060 static HRESULT WINAPI HTMLStyle_put_posHeight(IHTMLStyle *iface, float v)
2062 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2064 TRACE("(%p)->(%f)\n", This, v);
2066 return set_style_pos(This, STYLEID_HEIGHT, v);
2069 static HRESULT WINAPI HTMLStyle_get_posHeight(IHTMLStyle *iface, float *p)
2071 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2073 TRACE("(%p)->(%p)\n", This, p);
2078 if(get_nsstyle_pos(This, STYLEID_HEIGHT, p) != S_OK)
2084 static HRESULT WINAPI HTMLStyle_put_cursor(IHTMLStyle *iface, BSTR v)
2086 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2088 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2090 return set_style_attr(This, STYLEID_CURSOR, v, 0);
2093 static HRESULT WINAPI HTMLStyle_get_cursor(IHTMLStyle *iface, BSTR *p)
2095 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2097 TRACE("(%p)->(%p)\n", This, p);
2099 return get_style_attr(This, STYLEID_CURSOR, p);
2102 static HRESULT WINAPI HTMLStyle_put_clip(IHTMLStyle *iface, BSTR v)
2104 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2105 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
2109 static HRESULT WINAPI HTMLStyle_get_clip(IHTMLStyle *iface, BSTR *p)
2111 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2112 FIXME("(%p)->(%p)\n", This, p);
2116 static HRESULT WINAPI HTMLStyle_put_filter(IHTMLStyle *iface, BSTR v)
2118 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2120 WARN("(%p)->(%s)\n", This, debugstr_w(v));
2122 /* FIXME: Handle MS-style filters */
2123 return set_style_attr(This, STYLEID_FILTER, v, 0);
2126 static HRESULT WINAPI HTMLStyle_get_filter(IHTMLStyle *iface, BSTR *p)
2128 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2130 WARN("(%p)->(%p)\n", This, p);
2132 /* FIXME: Handle MS-style filters */
2133 return get_style_attr(This, STYLEID_FILTER, p);
2136 static HRESULT WINAPI HTMLStyle_setAttribute(IHTMLStyle *iface, BSTR strAttributeName,
2137 VARIANT AttributeValue, LONG lFlags)
2139 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2143 TRACE("(%p)->(%s v%d %08x)\n", This, debugstr_w(strAttributeName),
2144 V_VT(&AttributeValue), lFlags);
2146 if(!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);
2157 DISPID dispidNamed = DISPID_PROPERTYPUT;
2161 params.rgvarg = &AttributeValue;
2162 params.cNamedArgs = 1;
2163 params.rgdispidNamedArgs = &dispidNamed;
2165 hres = HTMLStyle_Invoke(iface, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
2166 DISPATCH_PROPERTYPUT, ¶ms, &ret, NULL, NULL);
2170 FIXME("Custom attributes not supported.\n");
2173 TRACE("ret: %08x\n", hres);
2178 static HRESULT WINAPI HTMLStyle_getAttribute(IHTMLStyle *iface, BSTR strAttributeName,
2179 LONG lFlags, VARIANT *AttributeValue)
2181 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2185 TRACE("(%p)->(%s v%p %08x)\n", This, debugstr_w(strAttributeName),
2186 AttributeValue, lFlags);
2188 if(!AttributeValue || !strAttributeName)
2189 return E_INVALIDARG;
2192 FIXME("Parameter lFlags ignored\n");
2194 hres = HTMLStyle_GetIDsOfNames(iface, &IID_NULL, (LPOLESTR*)&strAttributeName, 1,
2195 LOCALE_USER_DEFAULT, &dispid);
2198 DISPPARAMS params = {NULL, NULL, 0, 0 };
2200 hres = HTMLStyle_Invoke(iface, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
2201 DISPATCH_PROPERTYGET, ¶ms, AttributeValue, NULL, NULL);
2205 FIXME("Custom attributes not supported.\n");
2211 static HRESULT WINAPI HTMLStyle_removeAttribute(IHTMLStyle *iface, BSTR strAttributeName,
2212 LONG lFlags, VARIANT_BOOL *pfSuccess)
2214 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2215 FIXME("(%p)->(%s %08x %p)\n", This, debugstr_w(strAttributeName),
2220 static HRESULT WINAPI HTMLStyle_toString(IHTMLStyle *iface, BSTR *String)
2222 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2223 FIXME("(%p)->(%p)\n", This, String);
2227 static HRESULT HTMLStyle_get_dispid(IUnknown *iface, BSTR name, DWORD flags, DISPID *dispid)
2229 int c, i, min=0, max = sizeof(style_tbl)/sizeof(*style_tbl)-1;
2234 c = strcmpW(style_tbl[i].name, name);
2236 *dispid = style_tbl[i].dispid;
2246 return DISP_E_UNKNOWNNAME;
2249 static const IHTMLStyleVtbl HTMLStyleVtbl = {
2250 HTMLStyle_QueryInterface,
2253 HTMLStyle_GetTypeInfoCount,
2254 HTMLStyle_GetTypeInfo,
2255 HTMLStyle_GetIDsOfNames,
2257 HTMLStyle_put_fontFamily,
2258 HTMLStyle_get_fontFamily,
2259 HTMLStyle_put_fontStyle,
2260 HTMLStyle_get_fontStyle,
2261 HTMLStyle_put_fontVariant,
2262 HTMLStyle_get_fontVariant,
2263 HTMLStyle_put_fontWeight,
2264 HTMLStyle_get_fontWeight,
2265 HTMLStyle_put_fontSize,
2266 HTMLStyle_get_fontSize,
2269 HTMLStyle_put_color,
2270 HTMLStyle_get_color,
2271 HTMLStyle_put_background,
2272 HTMLStyle_get_background,
2273 HTMLStyle_put_backgroundColor,
2274 HTMLStyle_get_backgroundColor,
2275 HTMLStyle_put_backgroundImage,
2276 HTMLStyle_get_backgroundImage,
2277 HTMLStyle_put_backgroundRepeat,
2278 HTMLStyle_get_backgroundRepeat,
2279 HTMLStyle_put_backgroundAttachment,
2280 HTMLStyle_get_backgroundAttachment,
2281 HTMLStyle_put_backgroundPosition,
2282 HTMLStyle_get_backgroundPosition,
2283 HTMLStyle_put_backgroundPositionX,
2284 HTMLStyle_get_backgroundPositionX,
2285 HTMLStyle_put_backgroundPositionY,
2286 HTMLStyle_get_backgroundPositionY,
2287 HTMLStyle_put_wordSpacing,
2288 HTMLStyle_get_wordSpacing,
2289 HTMLStyle_put_letterSpacing,
2290 HTMLStyle_get_letterSpacing,
2291 HTMLStyle_put_textDecoration,
2292 HTMLStyle_get_textDecoration,
2293 HTMLStyle_put_textDecorationNone,
2294 HTMLStyle_get_textDecorationNone,
2295 HTMLStyle_put_textDecorationUnderline,
2296 HTMLStyle_get_textDecorationUnderline,
2297 HTMLStyle_put_textDecorationOverline,
2298 HTMLStyle_get_textDecorationOverline,
2299 HTMLStyle_put_textDecorationLineThrough,
2300 HTMLStyle_get_textDecorationLineThrough,
2301 HTMLStyle_put_textDecorationBlink,
2302 HTMLStyle_get_textDecorationBlink,
2303 HTMLStyle_put_verticalAlign,
2304 HTMLStyle_get_verticalAlign,
2305 HTMLStyle_put_textTransform,
2306 HTMLStyle_get_textTransform,
2307 HTMLStyle_put_textAlign,
2308 HTMLStyle_get_textAlign,
2309 HTMLStyle_put_textIndent,
2310 HTMLStyle_get_textIndent,
2311 HTMLStyle_put_lineHeight,
2312 HTMLStyle_get_lineHeight,
2313 HTMLStyle_put_marginTop,
2314 HTMLStyle_get_marginTop,
2315 HTMLStyle_put_marginRight,
2316 HTMLStyle_get_marginRight,
2317 HTMLStyle_put_marginBottom,
2318 HTMLStyle_get_marginBottom,
2319 HTMLStyle_put_marginLeft,
2320 HTMLStyle_get_marginLeft,
2321 HTMLStyle_put_margin,
2322 HTMLStyle_get_margin,
2323 HTMLStyle_put_paddingTop,
2324 HTMLStyle_get_paddingTop,
2325 HTMLStyle_put_paddingRight,
2326 HTMLStyle_get_paddingRight,
2327 HTMLStyle_put_paddingBottom,
2328 HTMLStyle_get_paddingBottom,
2329 HTMLStyle_put_paddingLeft,
2330 HTMLStyle_get_paddingLeft,
2331 HTMLStyle_put_padding,
2332 HTMLStyle_get_padding,
2333 HTMLStyle_put_border,
2334 HTMLStyle_get_border,
2335 HTMLStyle_put_borderTop,
2336 HTMLStyle_get_borderTop,
2337 HTMLStyle_put_borderRight,
2338 HTMLStyle_get_borderRight,
2339 HTMLStyle_put_borderBottom,
2340 HTMLStyle_get_borderBottom,
2341 HTMLStyle_put_borderLeft,
2342 HTMLStyle_get_borderLeft,
2343 HTMLStyle_put_borderColor,
2344 HTMLStyle_get_borderColor,
2345 HTMLStyle_put_borderTopColor,
2346 HTMLStyle_get_borderTopColor,
2347 HTMLStyle_put_borderRightColor,
2348 HTMLStyle_get_borderRightColor,
2349 HTMLStyle_put_borderBottomColor,
2350 HTMLStyle_get_borderBottomColor,
2351 HTMLStyle_put_borderLeftColor,
2352 HTMLStyle_get_borderLeftColor,
2353 HTMLStyle_put_borderWidth,
2354 HTMLStyle_get_borderWidth,
2355 HTMLStyle_put_borderTopWidth,
2356 HTMLStyle_get_borderTopWidth,
2357 HTMLStyle_put_borderRightWidth,
2358 HTMLStyle_get_borderRightWidth,
2359 HTMLStyle_put_borderBottomWidth,
2360 HTMLStyle_get_borderBottomWidth,
2361 HTMLStyle_put_borderLeftWidth,
2362 HTMLStyle_get_borderLeftWidth,
2363 HTMLStyle_put_borderStyle,
2364 HTMLStyle_get_borderStyle,
2365 HTMLStyle_put_borderTopStyle,
2366 HTMLStyle_get_borderTopStyle,
2367 HTMLStyle_put_borderRightStyle,
2368 HTMLStyle_get_borderRightStyle,
2369 HTMLStyle_put_borderBottomStyle,
2370 HTMLStyle_get_borderBottomStyle,
2371 HTMLStyle_put_borderLeftStyle,
2372 HTMLStyle_get_borderLeftStyle,
2373 HTMLStyle_put_width,
2374 HTMLStyle_get_width,
2375 HTMLStyle_put_height,
2376 HTMLStyle_get_height,
2377 HTMLStyle_put_styleFloat,
2378 HTMLStyle_get_styleFloat,
2379 HTMLStyle_put_clear,
2380 HTMLStyle_get_clear,
2381 HTMLStyle_put_display,
2382 HTMLStyle_get_display,
2383 HTMLStyle_put_visibility,
2384 HTMLStyle_get_visibility,
2385 HTMLStyle_put_listStyleType,
2386 HTMLStyle_get_listStyleType,
2387 HTMLStyle_put_listStylePosition,
2388 HTMLStyle_get_listStylePosition,
2389 HTMLStyle_put_listStyleImage,
2390 HTMLStyle_get_listStyleImage,
2391 HTMLStyle_put_listStyle,
2392 HTMLStyle_get_listStyle,
2393 HTMLStyle_put_whiteSpace,
2394 HTMLStyle_get_whiteSpace,
2399 HTMLStyle_get_position,
2400 HTMLStyle_put_zIndex,
2401 HTMLStyle_get_zIndex,
2402 HTMLStyle_put_overflow,
2403 HTMLStyle_get_overflow,
2404 HTMLStyle_put_pageBreakBefore,
2405 HTMLStyle_get_pageBreakBefore,
2406 HTMLStyle_put_pageBreakAfter,
2407 HTMLStyle_get_pageBreakAfter,
2408 HTMLStyle_put_cssText,
2409 HTMLStyle_get_cssText,
2410 HTMLStyle_put_pixelTop,
2411 HTMLStyle_get_pixelTop,
2412 HTMLStyle_put_pixelLeft,
2413 HTMLStyle_get_pixelLeft,
2414 HTMLStyle_put_pixelWidth,
2415 HTMLStyle_get_pixelWidth,
2416 HTMLStyle_put_pixelHeight,
2417 HTMLStyle_get_pixelHeight,
2418 HTMLStyle_put_posTop,
2419 HTMLStyle_get_posTop,
2420 HTMLStyle_put_posLeft,
2421 HTMLStyle_get_posLeft,
2422 HTMLStyle_put_posWidth,
2423 HTMLStyle_get_posWidth,
2424 HTMLStyle_put_posHeight,
2425 HTMLStyle_get_posHeight,
2426 HTMLStyle_put_cursor,
2427 HTMLStyle_get_cursor,
2430 HTMLStyle_put_filter,
2431 HTMLStyle_get_filter,
2432 HTMLStyle_setAttribute,
2433 HTMLStyle_getAttribute,
2434 HTMLStyle_removeAttribute,
2438 static const dispex_static_data_vtbl_t HTMLStyle_dispex_vtbl = {
2439 HTMLStyle_get_dispid,
2443 static const tid_t HTMLStyle_iface_tids[] = {
2448 static dispex_static_data_t HTMLStyle_dispex = {
2449 &HTMLStyle_dispex_vtbl,
2452 HTMLStyle_iface_tids
2455 IHTMLStyle *HTMLStyle_Create(nsIDOMCSSStyleDeclaration *nsstyle)
2457 HTMLStyle *ret = heap_alloc_zero(sizeof(HTMLStyle));
2459 ret->lpHTMLStyleVtbl = &HTMLStyleVtbl;
2461 ret->nsstyle = nsstyle;
2462 HTMLStyle2_Init(ret);
2463 HTMLStyle3_Init(ret);
2465 nsIDOMCSSStyleDeclaration_AddRef(nsstyle);
2467 init_dispex(&ret->dispex, (IUnknown*)HTMLSTYLE(ret), &HTMLStyle_dispex);
2469 return HTMLSTYLE(ret);