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 attrBackgroundRepeat[] =
45 {'b','a','c','k','g','r','o','u','n','d','-','r','e','p','e','a','t',0};
46 static const WCHAR attrBorder[] =
47 {'b','o','r','d','e','r',0};
48 static const WCHAR attrBorderBottomStyle[] =
49 {'b','o','r','d','e','r','-','b','o','t','t','o','m','-','s','t','y','l','e',0};
50 static const WCHAR attrBorderColor[] =
51 {'b','o','r','d','e','r','-','c','o','l','o','r',0};
52 static const WCHAR attrBorderLeft[] =
53 {'b','o','r','d','e','r','-','l','e','f','t',0};
54 static const WCHAR attrBorderLeftStyle[] =
55 {'b','o','r','d','e','r','-','l','e','f','t','-','s','t','y','l','e',0};
56 static const WCHAR attrBorderRightStyle[] =
57 {'b','o','r','d','e','r','-','r','i','g','h','t','-','s','t','y','l','e',0};
58 static const WCHAR attrBorderStyle[] =
59 {'b','o','r','d','e','r','-','s','t','y','l','e',0};
60 static const WCHAR attrBorderTopStyle[] =
61 {'b','o','r','d','e','r','-','t','o','p','-','s','t','y','l','e',0};
62 static const WCHAR attrBorderWidth[] =
63 {'b','o','r','d','e','r','-','w','i','d','t','h',0};
64 static const WCHAR attrColor[] =
65 {'c','o','l','o','r',0};
66 static const WCHAR attrCursor[] =
67 {'c','u','r','s','o','r',0};
68 static const WCHAR attrDisplay[] =
69 {'d','i','s','p','l','a','y',0};
70 static const WCHAR attrFilter[] =
71 {'f','i','l','e','t','e','r',0};
72 static const WCHAR attrFontFamily[] =
73 {'f','o','n','t','-','f','a','m','i','l','y',0};
74 static const WCHAR attrFontSize[] =
75 {'f','o','n','t','-','s','i','z','e',0};
76 static const WCHAR attrFontStyle[] =
77 {'f','o','n','t','-','s','t','y','l','e',0};
78 static const WCHAR attrFontVariant[] =
79 {'f','o','n','t','-','v','a','r','i','a','n','t',0};
80 static const WCHAR attrFontWeight[] =
81 {'f','o','n','t','-','w','e','i','g','h','t',0};
82 static const WCHAR attrHeight[] =
83 {'h','e','i','g','h','t',0};
84 static const WCHAR attrLeft[] =
86 static const WCHAR attrMargin[] =
87 {'m','a','r','g','i','n',0};
88 static const WCHAR attrMarginLeft[] =
89 {'m','a','r','g','i','n','-','l','e','f','t',0};
90 static const WCHAR attrMarginRight[] =
91 {'m','a','r','g','i','n','-','r','i','g','h','t',0};
92 static const WCHAR attrMinHeight[] =
93 {'m','i','n','-','h','e','i','g','h','t',0};
94 static const WCHAR attrOverflow[] =
95 {'o','v','e','r','f','l','o','w',0};
96 static const WCHAR attrPaddingLeft[] =
97 {'p','a','d','d','i','n','g','-','l','e','f','t',0};
98 static const WCHAR attrPosition[] =
99 {'p','o','s','i','t','i','o','n',0};
100 static const WCHAR attrTextAlign[] =
101 {'t','e','x','t','-','a','l','i','g','n',0};
102 static const WCHAR attrTextDecoration[] =
103 {'t','e','x','t','-','d','e','c','o','r','a','t','i','o','n',0};
104 static const WCHAR attrTop[] =
106 static const WCHAR attrVerticalAlign[] =
107 {'v','e','r','t','i','c','a','l','-','a','l','i','g','n',0};
108 static const WCHAR attrVisibility[] =
109 {'v','i','s','i','b','i','l','i','t','y',0};
110 static const WCHAR attrWidth[] =
111 {'w','i','d','t','h',0};
112 static const WCHAR attrZIndex[] =
113 {'z','-','i','n','d','e','x',0};
119 {attrBackground, DISPID_IHTMLSTYLE_BACKGROUND},
120 {attrBackgroundColor, DISPID_IHTMLSTYLE_BACKGROUNDCOLOR},
121 {attrBackgroundImage, DISPID_IHTMLSTYLE_BACKGROUNDIMAGE},
122 {attrBackgroundRepeat, DISPID_IHTMLSTYLE_BACKGROUNDREPEAT},
123 {attrBorder, DISPID_IHTMLSTYLE_BORDER},
124 {attrBorderBottomStyle, DISPID_IHTMLSTYLE_BORDERBOTTOMSTYLE},
125 {attrBorderColor, DISPID_IHTMLSTYLE_BORDERCOLOR},
126 {attrBorderLeft, DISPID_IHTMLSTYLE_BORDERLEFT},
127 {attrBorderLeftStyle, DISPID_IHTMLSTYLE_BORDERLEFTSTYLE},
128 {attrBorderRightStyle, DISPID_IHTMLSTYLE_BORDERRIGHTSTYLE},
129 {attrBorderStyle, DISPID_IHTMLSTYLE_BORDERSTYLE},
130 {attrBorderTopStyle, DISPID_IHTMLSTYLE_BORDERTOPSTYLE},
131 {attrBorderWidth, DISPID_IHTMLSTYLE_BORDERWIDTH},
132 {attrColor, DISPID_IHTMLSTYLE_COLOR},
133 {attrCursor, DISPID_IHTMLSTYLE_CURSOR},
134 {attrDisplay, DISPID_IHTMLSTYLE_DISPLAY},
135 {attrFilter, DISPID_IHTMLSTYLE_FILTER},
136 {attrFontFamily, DISPID_IHTMLSTYLE_FONTFAMILY},
137 {attrFontSize, DISPID_IHTMLSTYLE_FONTSIZE},
138 {attrFontStyle, DISPID_IHTMLSTYLE_FONTSTYLE},
139 {attrFontVariant, DISPID_IHTMLSTYLE_FONTVARIANT},
140 {attrFontWeight, DISPID_IHTMLSTYLE_FONTWEIGHT},
141 {attrHeight, DISPID_IHTMLSTYLE_HEIGHT},
142 {attrLeft, DISPID_IHTMLSTYLE_LEFT},
143 {attrMargin, DISPID_IHTMLSTYLE_MARGIN},
144 {attrMarginLeft, DISPID_IHTMLSTYLE_MARGINLEFT},
145 {attrMarginRight, DISPID_IHTMLSTYLE_MARGINRIGHT},
146 {attrMinHeight, DISPID_IHTMLSTYLE4_MINHEIGHT},
147 {attrOverflow, DISPID_IHTMLSTYLE_OVERFLOW},
148 {attrPaddingLeft, DISPID_IHTMLSTYLE_PADDINGLEFT},
149 {attrPosition, DISPID_IHTMLSTYLE2_POSITION},
150 {attrTextAlign, DISPID_IHTMLSTYLE_TEXTALIGN},
151 {attrTextDecoration, DISPID_IHTMLSTYLE_TEXTDECORATION},
152 {attrTop, DISPID_IHTMLSTYLE_TOP},
153 {attrVerticalAlign, DISPID_IHTMLSTYLE_VERTICALALIGN},
154 {attrVisibility, DISPID_IHTMLSTYLE_VISIBILITY},
155 {attrWidth, DISPID_IHTMLSTYLE_WIDTH},
156 {attrZIndex, DISPID_IHTMLSTYLE_ZINDEX}
159 static const WCHAR valLineThrough[] =
160 {'l','i','n','e','-','t','h','r','o','u','g','h',0};
161 static const WCHAR valUnderline[] =
162 {'u','n','d','e','r','l','i','n','e',0};
163 static const WCHAR szNormal[] =
164 {'n','o','r','m','a','l',0};
165 static const WCHAR styleNone[] =
167 static const WCHAR valOverline[] =
168 {'o','v','e','r','l','i','n','e',0};
169 static const WCHAR valBlink[] =
170 {'b','l','i','n','k',0};
172 static const WCHAR px_formatW[] = {'%','d','p','x',0};
173 static const WCHAR emptyW[] = {0};
175 static LPWSTR fix_px_value(LPCWSTR val)
180 while(*ptr && isspaceW(*ptr))
185 while(*ptr && isdigitW(*ptr))
188 if(!*ptr || isspaceW(*ptr)) {
190 int len = strlenW(val)+1;
192 ret = heap_alloc((len+2)*sizeof(WCHAR));
193 memcpy(ret, val, (ptr-val)*sizeof(WCHAR));
199 TRACE("fixed %s -> %s\n", debugstr_w(val), debugstr_w(ret));
204 while(*ptr && !isspaceW(*ptr))
211 static LPWSTR fix_url_value(LPCWSTR val)
215 static const WCHAR urlW[] = {'u','r','l','('};
217 if(strncmpW(val, urlW, sizeof(urlW)/sizeof(WCHAR)) || !strchrW(val, '\\'))
220 ret = heap_strdupW(val);
222 for(ptr = ret; *ptr; ptr++) {
230 HRESULT set_nsstyle_attr(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, LPCWSTR value, DWORD flags)
232 nsAString str_name, str_value, str_empty;
236 static const PRUnichar wszEmpty[] = {0};
238 if(flags & ATTR_FIX_PX)
239 val = fix_px_value(value);
240 if(flags & ATTR_FIX_URL)
241 val = fix_url_value(value);
243 nsAString_Init(&str_name, style_tbl[sid].name);
244 nsAString_Init(&str_value, val ? val : value);
245 nsAString_Init(&str_empty, wszEmpty);
248 nsres = nsIDOMCSSStyleDeclaration_SetProperty(nsstyle, &str_name, &str_value, &str_empty);
250 ERR("SetProperty failed: %08x\n", nsres);
252 nsAString_Finish(&str_name);
253 nsAString_Finish(&str_value);
254 nsAString_Finish(&str_empty);
259 HRESULT set_nsstyle_attr_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, VARIANT *value, DWORD flags)
261 switch(V_VT(value)) {
263 return set_nsstyle_attr(nsstyle, sid, emptyW, flags);
266 return set_nsstyle_attr(nsstyle, sid, V_BSTR(value), flags);
270 static const WCHAR format[] = {'%','d',0};
272 wsprintfW(str, format, V_I4(value));
273 return set_nsstyle_attr(nsstyle, sid, str, flags);
276 FIXME("not implemented vt %d\n", V_VT(value));
284 static inline HRESULT set_style_attr(HTMLStyle *This, styleid_t sid, LPCWSTR value, DWORD flags)
286 return set_nsstyle_attr(This->nsstyle, sid, value, flags);
289 static HRESULT get_nsstyle_attr_nsval(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, nsAString *value)
294 nsAString_Init(&str_name, style_tbl[sid].name);
296 nsres = nsIDOMCSSStyleDeclaration_GetPropertyValue(nsstyle, &str_name, value);
297 if(NS_FAILED(nsres)) {
298 ERR("SetProperty failed: %08x\n", nsres);
302 nsAString_Finish(&str_name);
307 HRESULT get_nsstyle_attr(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, BSTR *p)
310 const PRUnichar *value;
312 nsAString_Init(&str_value, NULL);
314 get_nsstyle_attr_nsval(nsstyle, sid, &str_value);
316 nsAString_GetData(&str_value, &value);
317 *p = *value ? SysAllocString(value) : NULL;
319 nsAString_Finish(&str_value);
321 TRACE("%s -> %s\n", debugstr_w(style_tbl[sid].name), debugstr_w(*p));
325 HRESULT get_nsstyle_attr_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, VARIANT *p, DWORD flags)
328 const PRUnichar *value;
331 nsAString_Init(&str_value, NULL);
333 get_nsstyle_attr_nsval(nsstyle, sid, &str_value);
335 nsAString_GetData(&str_value, &value);
337 if(flags & ATTR_STR_TO_INT) {
338 const PRUnichar *ptr = value;
347 while(isdigitW(*ptr))
348 i = i*10 + (*ptr++ - '0');
352 V_I4(p) = neg ? -i : i;
361 str = SysAllocString(value);
363 return E_OUTOFMEMORY;
370 nsAString_Finish(&str_value);
372 TRACE("%s -> %s\n", debugstr_w(style_tbl[sid].name), debugstr_variant(p));
376 static inline HRESULT get_style_attr(HTMLStyle *This, styleid_t sid, BSTR *p)
378 return get_nsstyle_attr(This->nsstyle, sid, p);
381 static HRESULT check_style_attr_value(HTMLStyle *This, styleid_t sid, LPCWSTR exval, VARIANT_BOOL *p)
384 const PRUnichar *value;
386 nsAString_Init(&str_value, NULL);
388 get_nsstyle_attr_nsval(This->nsstyle, sid, &str_value);
390 nsAString_GetData(&str_value, &value);
391 *p = strcmpW(value, exval) ? VARIANT_FALSE : VARIANT_TRUE;
392 nsAString_Finish(&str_value);
394 TRACE("%s -> %x\n", debugstr_w(style_tbl[sid].name), *p);
398 static inline HRESULT set_style_pos(HTMLStyle *This, styleid_t sid, float value)
401 WCHAR szFormat[] = {'%','.','0','f','p','x',0};
403 value = floor(value);
405 sprintfW(szValue, szFormat, value);
407 return set_style_attr(This, sid, szValue, 0);
410 static HRESULT get_nsstyle_pos(HTMLStyle *This, styleid_t sid, float *p)
414 WCHAR pxW[] = {'p','x',0};
416 TRACE("%p %d %p\n", This, sid, p);
420 nsAString_Init(&str_value, NULL);
422 hres = get_nsstyle_attr_nsval(This->nsstyle, sid, &str_value);
426 const PRUnichar *value;
428 nsAString_GetData(&str_value, &value);
431 *p = strtolW(value, &ptr, 10);
433 if(*ptr && strcmpW(ptr, pxW))
435 nsAString_Finish(&str_value);
436 FIXME("only px values are currently supported\n");
442 TRACE("ret %f\n", *p);
444 nsAString_Finish(&str_value);
449 static BOOL is_valid_border_style(BSTR v)
451 static const WCHAR styleDotted[] = {'d','o','t','t','e','d',0};
452 static const WCHAR styleDashed[] = {'d','a','s','h','e','d',0};
453 static const WCHAR styleSolid[] = {'s','o','l','i','d',0};
454 static const WCHAR styleDouble[] = {'d','o','u','b','l','e',0};
455 static const WCHAR styleGroove[] = {'g','r','o','o','v','e',0};
456 static const WCHAR styleRidge[] = {'r','i','d','g','e',0};
457 static const WCHAR styleInset[] = {'i','n','s','e','t',0};
458 static const WCHAR styleOutset[] = {'o','u','t','s','e','t',0};
460 TRACE("%s\n", debugstr_w(v));
462 if(!v || strcmpiW(v, styleNone) == 0 || strcmpiW(v, styleDotted) == 0 ||
463 strcmpiW(v, styleDashed) == 0 || strcmpiW(v, styleSolid) == 0 ||
464 strcmpiW(v, styleDouble) == 0 || strcmpiW(v, styleGroove) == 0 ||
465 strcmpiW(v, styleRidge) == 0 || strcmpiW(v, styleInset) == 0 ||
466 strcmpiW(v, styleOutset) == 0 )
474 #define HTMLSTYLE_THIS(iface) DEFINE_THIS(HTMLStyle, HTMLStyle, iface)
476 static HRESULT WINAPI HTMLStyle_QueryInterface(IHTMLStyle *iface, REFIID riid, void **ppv)
478 HTMLStyle *This = HTMLSTYLE_THIS(iface);
482 if(IsEqualGUID(&IID_IUnknown, riid)) {
483 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
484 *ppv = HTMLSTYLE(This);
485 }else if(IsEqualGUID(&IID_IHTMLStyle, riid)) {
486 TRACE("(%p)->(IID_IHTMLStyle %p)\n", This, ppv);
487 *ppv = HTMLSTYLE(This);
488 }else if(IsEqualGUID(&IID_IHTMLStyle2, riid)) {
489 TRACE("(%p)->(IID_IHTMLStyle2 %p)\n", This, ppv);
490 *ppv = HTMLSTYLE2(This);
491 }else if(IsEqualGUID(&IID_IHTMLStyle3, riid)) {
492 TRACE("(%p)->(IID_IHTMLStyle3 %p)\n", This, ppv);
493 *ppv = HTMLSTYLE3(This);
494 }else if(IsEqualGUID(&IID_IHTMLStyle4, riid)) {
495 TRACE("(%p)->(IID_IHTMLStyle4 %p)\n", This, ppv);
496 *ppv = HTMLSTYLE4(This);
497 }else if(dispex_query_interface(&This->dispex, riid, ppv)) {
498 return *ppv ? S_OK : E_NOINTERFACE;
502 IUnknown_AddRef((IUnknown*)*ppv);
506 WARN("unsupported %s\n", debugstr_guid(riid));
507 return E_NOINTERFACE;
510 static ULONG WINAPI HTMLStyle_AddRef(IHTMLStyle *iface)
512 HTMLStyle *This = HTMLSTYLE_THIS(iface);
513 LONG ref = InterlockedIncrement(&This->ref);
515 TRACE("(%p) ref=%d\n", This, ref);
520 static ULONG WINAPI HTMLStyle_Release(IHTMLStyle *iface)
522 HTMLStyle *This = HTMLSTYLE_THIS(iface);
523 LONG ref = InterlockedDecrement(&This->ref);
525 TRACE("(%p) ref=%d\n", This, ref);
529 nsIDOMCSSStyleDeclaration_Release(This->nsstyle);
536 static HRESULT WINAPI HTMLStyle_GetTypeInfoCount(IHTMLStyle *iface, UINT *pctinfo)
538 HTMLStyle *This = HTMLSTYLE_THIS(iface);
539 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->dispex), pctinfo);
542 static HRESULT WINAPI HTMLStyle_GetTypeInfo(IHTMLStyle *iface, UINT iTInfo,
543 LCID lcid, ITypeInfo **ppTInfo)
545 HTMLStyle *This = HTMLSTYLE_THIS(iface);
546 return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->dispex), iTInfo, lcid, ppTInfo);
549 static HRESULT WINAPI HTMLStyle_GetIDsOfNames(IHTMLStyle *iface, REFIID riid,
550 LPOLESTR *rgszNames, UINT cNames,
551 LCID lcid, DISPID *rgDispId)
553 HTMLStyle *This = HTMLSTYLE_THIS(iface);
554 return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->dispex), riid, rgszNames, cNames, lcid, rgDispId);
557 static HRESULT WINAPI HTMLStyle_Invoke(IHTMLStyle *iface, DISPID dispIdMember,
558 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
559 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
561 HTMLStyle *This = HTMLSTYLE_THIS(iface);
562 return IDispatchEx_Invoke(DISPATCHEX(&This->dispex), dispIdMember, riid, lcid,
563 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
566 static HRESULT WINAPI HTMLStyle_put_fontFamily(IHTMLStyle *iface, BSTR v)
568 HTMLStyle *This = HTMLSTYLE_THIS(iface);
570 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
572 return set_style_attr(This, STYLEID_FONT_FAMILY, v, 0);
575 static HRESULT WINAPI HTMLStyle_get_fontFamily(IHTMLStyle *iface, BSTR *p)
577 HTMLStyle *This = HTMLSTYLE_THIS(iface);
579 TRACE("(%p)->(%p)\n", This, p);
581 return get_style_attr(This, STYLEID_FONT_FAMILY, p);
584 static HRESULT WINAPI HTMLStyle_put_fontStyle(IHTMLStyle *iface, BSTR v)
586 HTMLStyle *This = HTMLSTYLE_THIS(iface);
587 static const WCHAR szItalic[] = {'i','t','a','l','i','c',0};
588 static const WCHAR szOblique[] = {'o','b','l','i','q','u','e',0};
590 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
592 /* fontStyle can only be one of the follow values. */
593 if(!v || strcmpiW(szNormal, v) == 0 || strcmpiW(szItalic, v) == 0 ||
594 strcmpiW(szOblique, v) == 0)
596 return set_nsstyle_attr(This->nsstyle, STYLEID_FONT_STYLE, v, 0);
602 static HRESULT WINAPI HTMLStyle_get_fontStyle(IHTMLStyle *iface, BSTR *p)
604 HTMLStyle *This = HTMLSTYLE_THIS(iface);
606 TRACE("(%p)->(%p)\n", This, p);
608 return get_style_attr(This, STYLEID_FONT_STYLE, p);
611 static HRESULT WINAPI HTMLStyle_put_fontVariant(IHTMLStyle *iface, BSTR v)
613 HTMLStyle *This = HTMLSTYLE_THIS(iface);
614 static const WCHAR szCaps[] = {'s','m','a','l','l','-','c','a','p','s',0};
616 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
618 /* fontVariant can only be one of the follow values. */
619 if(!v || strcmpiW(szNormal, v) == 0 || strcmpiW(szCaps, v) == 0)
621 return set_nsstyle_attr(This->nsstyle, STYLEID_FONT_VARIANT, v, 0);
627 static HRESULT WINAPI HTMLStyle_get_fontVariant(IHTMLStyle *iface, BSTR *p)
629 HTMLStyle *This = HTMLSTYLE_THIS(iface);
630 TRACE("(%p)->(%p)\n", This, p);
635 return get_style_attr(This, STYLEID_FONT_VARIANT, p);
638 static HRESULT WINAPI HTMLStyle_put_fontWeight(IHTMLStyle *iface, BSTR v)
640 HTMLStyle *This = HTMLSTYLE_THIS(iface);
641 static const WCHAR styleBold[] = {'b','o','l','d',0};
642 static const WCHAR styleBolder[] = {'b','o','l','d','e','r',0};
643 static const WCHAR styleLighter[] = {'l','i','g','h','t','e','r',0};
644 static const WCHAR style100[] = {'1','0','0',0};
645 static const WCHAR style200[] = {'2','0','0',0};
646 static const WCHAR style300[] = {'3','0','0',0};
647 static const WCHAR style400[] = {'4','0','0',0};
648 static const WCHAR style500[] = {'5','0','0',0};
649 static const WCHAR style600[] = {'6','0','0',0};
650 static const WCHAR style700[] = {'7','0','0',0};
651 static const WCHAR style800[] = {'8','0','0',0};
652 static const WCHAR style900[] = {'9','0','0',0};
654 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
656 /* fontWeight can only be one of the following */
657 if(!v || strcmpiW(szNormal, v) == 0 || strcmpiW(styleBold, v) == 0 ||
658 strcmpiW(styleBolder, v) == 0 || strcmpiW(styleLighter, v) == 0 ||
659 strcmpiW(style100, v) == 0 || strcmpiW(style200, v) == 0 ||
660 strcmpiW(style300, v) == 0 || strcmpiW(style400, v) == 0 ||
661 strcmpiW(style500, v) == 0 || strcmpiW(style600, v) == 0 ||
662 strcmpiW(style700, v) == 0 || strcmpiW(style800, v) == 0 ||
663 strcmpiW(style900, v) == 0
666 return set_nsstyle_attr(This->nsstyle, STYLEID_FONT_WEIGHT, v, 0);
672 static HRESULT WINAPI HTMLStyle_get_fontWeight(IHTMLStyle *iface, BSTR *p)
674 HTMLStyle *This = HTMLSTYLE_THIS(iface);
676 TRACE("(%p)->(%p)\n", This, p);
678 return get_style_attr(This, STYLEID_FONT_WEIGHT, p);
681 static HRESULT WINAPI HTMLStyle_put_fontSize(IHTMLStyle *iface, VARIANT v)
683 HTMLStyle *This = HTMLSTYLE_THIS(iface);
685 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
689 return set_style_attr(This, STYLEID_FONT_SIZE, V_BSTR(&v), 0);
691 FIXME("not supported vt %d\n", V_VT(&v));
697 static HRESULT WINAPI HTMLStyle_get_fontSize(IHTMLStyle *iface, VARIANT *p)
699 HTMLStyle *This = HTMLSTYLE_THIS(iface);
701 TRACE("(%p)->(%p)\n", This, p);
704 return get_style_attr(This, STYLEID_FONT_SIZE, &V_BSTR(p));
707 static HRESULT WINAPI HTMLStyle_put_font(IHTMLStyle *iface, BSTR v)
709 HTMLStyle *This = HTMLSTYLE_THIS(iface);
710 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
714 static HRESULT WINAPI HTMLStyle_get_font(IHTMLStyle *iface, BSTR *p)
716 HTMLStyle *This = HTMLSTYLE_THIS(iface);
717 FIXME("(%p)->(%p)\n", This, p);
721 static HRESULT WINAPI HTMLStyle_put_color(IHTMLStyle *iface, VARIANT v)
723 HTMLStyle *This = HTMLSTYLE_THIS(iface);
725 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
729 TRACE("%s\n", debugstr_w(V_BSTR(&v)));
730 return set_style_attr(This, STYLEID_COLOR, V_BSTR(&v), 0);
733 FIXME("unsupported vt=%d\n", V_VT(&v));
739 static HRESULT WINAPI HTMLStyle_get_color(IHTMLStyle *iface, VARIANT *p)
741 HTMLStyle *This = HTMLSTYLE_THIS(iface);
743 TRACE("(%p)->(%p)\n", This, p);
746 return get_style_attr(This, STYLEID_COLOR, &V_BSTR(p));
749 static HRESULT WINAPI HTMLStyle_put_background(IHTMLStyle *iface, BSTR v)
751 HTMLStyle *This = HTMLSTYLE_THIS(iface);
753 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
755 return set_style_attr(This, STYLEID_BACKGROUND, v, 0);
758 static HRESULT WINAPI HTMLStyle_get_background(IHTMLStyle *iface, BSTR *p)
760 HTMLStyle *This = HTMLSTYLE_THIS(iface);
762 TRACE("(%p)->(%p)\n", This, p);
764 return get_style_attr(This, STYLEID_BACKGROUND, p);
767 static HRESULT WINAPI HTMLStyle_put_backgroundColor(IHTMLStyle *iface, VARIANT v)
769 HTMLStyle *This = HTMLSTYLE_THIS(iface);
771 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
775 return set_style_attr(This, STYLEID_BACKGROUND_COLOR, V_BSTR(&v), 0);
778 static const WCHAR format[] = {'#','%','0','6','x',0};
780 wsprintfW(value, format, V_I4(&v));
781 return set_style_attr(This, STYLEID_BACKGROUND_COLOR, value, 0);
784 FIXME("unsupported vt %d\n", V_VT(&v));
790 static HRESULT WINAPI HTMLStyle_get_backgroundColor(IHTMLStyle *iface, VARIANT *p)
792 HTMLStyle *This = HTMLSTYLE_THIS(iface);
793 TRACE("(%p)->(%p)\n", This, p);
796 return get_style_attr(This, STYLEID_BACKGROUND_COLOR, &V_BSTR(p));
799 static HRESULT WINAPI HTMLStyle_put_backgroundImage(IHTMLStyle *iface, BSTR v)
801 HTMLStyle *This = HTMLSTYLE_THIS(iface);
803 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
805 return set_style_attr(This, STYLEID_BACKGROUND_IMAGE, v, ATTR_FIX_URL);
808 static HRESULT WINAPI HTMLStyle_get_backgroundImage(IHTMLStyle *iface, BSTR *p)
810 HTMLStyle *This = HTMLSTYLE_THIS(iface);
812 TRACE("(%p)->(%p)\n", This, p);
814 return get_style_attr(This, STYLEID_BACKGROUND_IMAGE, p);
817 static HRESULT WINAPI HTMLStyle_put_backgroundRepeat(IHTMLStyle *iface, BSTR v)
819 HTMLStyle *This = HTMLSTYLE_THIS(iface);
820 static const WCHAR styleRepeat[] = {'r','e','p','e','a','t',0};
821 static const WCHAR styleNoRepeat[] = {'n','o','-','r','e','p','e','a','t',0};
822 static const WCHAR styleRepeatX[] = {'r','e','p','e','a','t','-','x',0};
823 static const WCHAR styleRepeatY[] = {'r','e','p','e','a','t','-','y',0};
825 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
827 /* fontWeight can only be one of the following */
828 if(!v || strcmpiW(styleRepeat, v) == 0 || strcmpiW(styleNoRepeat, v) == 0 ||
829 strcmpiW(styleRepeatX, v) == 0 || strcmpiW(styleRepeatY, v) == 0 )
831 return set_style_attr(This, STYLEID_BACKGROUND_REPEAT , v, 0);
837 static HRESULT WINAPI HTMLStyle_get_backgroundRepeat(IHTMLStyle *iface, BSTR *p)
839 HTMLStyle *This = HTMLSTYLE_THIS(iface);
841 TRACE("(%p)->(%p)\n", This, p);
843 return get_style_attr(This, STYLEID_BACKGROUND_REPEAT, p);
846 static HRESULT WINAPI HTMLStyle_put_backgroundAttachment(IHTMLStyle *iface, BSTR v)
848 HTMLStyle *This = HTMLSTYLE_THIS(iface);
849 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
853 static HRESULT WINAPI HTMLStyle_get_backgroundAttachment(IHTMLStyle *iface, BSTR *p)
855 HTMLStyle *This = HTMLSTYLE_THIS(iface);
856 FIXME("(%p)->(%p)\n", This, p);
860 static HRESULT WINAPI HTMLStyle_put_backgroundPosition(IHTMLStyle *iface, BSTR v)
862 HTMLStyle *This = HTMLSTYLE_THIS(iface);
863 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
867 static HRESULT WINAPI HTMLStyle_get_backgroundPosition(IHTMLStyle *iface, BSTR *p)
869 HTMLStyle *This = HTMLSTYLE_THIS(iface);
870 FIXME("(%p)->(%p)\n", This, p);
874 static HRESULT WINAPI HTMLStyle_put_backgroundPositionX(IHTMLStyle *iface, VARIANT v)
876 HTMLStyle *This = HTMLSTYLE_THIS(iface);
877 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
881 static HRESULT WINAPI HTMLStyle_get_backgroundPositionX(IHTMLStyle *iface, VARIANT *p)
883 HTMLStyle *This = HTMLSTYLE_THIS(iface);
884 FIXME("(%p)->(%p)\n", This, p);
888 static HRESULT WINAPI HTMLStyle_put_backgroundPositionY(IHTMLStyle *iface, VARIANT v)
890 HTMLStyle *This = HTMLSTYLE_THIS(iface);
891 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
895 static HRESULT WINAPI HTMLStyle_get_backgroundPositionY(IHTMLStyle *iface, VARIANT *p)
897 HTMLStyle *This = HTMLSTYLE_THIS(iface);
898 FIXME("(%p)->(%p)\n", This, p);
902 static HRESULT WINAPI HTMLStyle_put_wordSpacing(IHTMLStyle *iface, VARIANT v)
904 HTMLStyle *This = HTMLSTYLE_THIS(iface);
905 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
909 static HRESULT WINAPI HTMLStyle_get_wordSpacing(IHTMLStyle *iface, VARIANT *p)
911 HTMLStyle *This = HTMLSTYLE_THIS(iface);
912 FIXME("(%p)->(%p)\n", This, p);
916 static HRESULT WINAPI HTMLStyle_put_letterSpacing(IHTMLStyle *iface, VARIANT v)
918 HTMLStyle *This = HTMLSTYLE_THIS(iface);
919 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
923 static HRESULT WINAPI HTMLStyle_get_letterSpacing(IHTMLStyle *iface, VARIANT *p)
925 HTMLStyle *This = HTMLSTYLE_THIS(iface);
926 FIXME("(%p)->(%p)\n", This, p);
930 static HRESULT WINAPI HTMLStyle_put_textDecoration(IHTMLStyle *iface, BSTR v)
932 HTMLStyle *This = HTMLSTYLE_THIS(iface);
934 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
936 /* textDecoration can only be one of the following */
937 if(!v || strcmpiW(styleNone, v) == 0 || strcmpiW(valUnderline, v) == 0 ||
938 strcmpiW(valOverline, v) == 0 || strcmpiW(valLineThrough, v) == 0 ||
939 strcmpiW(valBlink, v) == 0)
941 return set_style_attr(This, STYLEID_TEXT_DECORATION , v, 0);
947 static HRESULT WINAPI HTMLStyle_get_textDecoration(IHTMLStyle *iface, BSTR *p)
949 HTMLStyle *This = HTMLSTYLE_THIS(iface);
951 TRACE("(%p)->(%p)\n", This, p);
953 return get_style_attr(This, STYLEID_TEXT_DECORATION, p);
956 static HRESULT WINAPI HTMLStyle_put_textDecorationNone(IHTMLStyle *iface, VARIANT_BOOL v)
958 HTMLStyle *This = HTMLSTYLE_THIS(iface);
960 TRACE("(%p)->(%x)\n", This, v);
962 return set_style_attr(This, STYLEID_TEXT_DECORATION, v ? styleNone : emptyW, 0);
965 static HRESULT WINAPI HTMLStyle_get_textDecorationNone(IHTMLStyle *iface, VARIANT_BOOL *p)
967 HTMLStyle *This = HTMLSTYLE_THIS(iface);
969 TRACE("(%p)->(%p)\n", This, p);
971 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, styleNone, p);
974 static HRESULT WINAPI HTMLStyle_put_textDecorationUnderline(IHTMLStyle *iface, VARIANT_BOOL v)
976 HTMLStyle *This = HTMLSTYLE_THIS(iface);
978 TRACE("(%p)->(%x)\n", This, v);
980 return set_style_attr(This, STYLEID_TEXT_DECORATION, v ? valUnderline : emptyW, 0);
983 static HRESULT WINAPI HTMLStyle_get_textDecorationUnderline(IHTMLStyle *iface, VARIANT_BOOL *p)
985 HTMLStyle *This = HTMLSTYLE_THIS(iface);
987 TRACE("(%p)->(%p)\n", This, p);
989 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, valUnderline, p);
992 static HRESULT WINAPI HTMLStyle_put_textDecorationOverline(IHTMLStyle *iface, VARIANT_BOOL v)
994 HTMLStyle *This = HTMLSTYLE_THIS(iface);
996 TRACE("(%p)->(%x)\n", This, v);
998 return set_style_attr(This, STYLEID_TEXT_DECORATION, v ? valOverline : emptyW, 0);
1001 static HRESULT WINAPI HTMLStyle_get_textDecorationOverline(IHTMLStyle *iface, VARIANT_BOOL *p)
1003 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1005 TRACE("(%p)->(%p)\n", This, p);
1007 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, valOverline, p);
1010 static HRESULT WINAPI HTMLStyle_put_textDecorationLineThrough(IHTMLStyle *iface, VARIANT_BOOL v)
1012 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1014 TRACE("(%p)->(%x)\n", This, v);
1016 return set_style_attr(This, STYLEID_TEXT_DECORATION, v ? valLineThrough : emptyW, 0);
1019 static HRESULT WINAPI HTMLStyle_get_textDecorationLineThrough(IHTMLStyle *iface, VARIANT_BOOL *p)
1021 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1023 TRACE("(%p)->(%p)\n", This, p);
1025 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, valLineThrough, p);
1028 static HRESULT WINAPI HTMLStyle_put_textDecorationBlink(IHTMLStyle *iface, VARIANT_BOOL v)
1030 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1032 TRACE("(%p)->(%x)\n", This, v);
1034 return set_style_attr(This, STYLEID_TEXT_DECORATION, v ? valBlink : emptyW, 0);
1037 static HRESULT WINAPI HTMLStyle_get_textDecorationBlink(IHTMLStyle *iface, VARIANT_BOOL *p)
1039 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1041 TRACE("(%p)->(%p)\n", This, p);
1043 return check_style_attr_value(This, STYLEID_TEXT_DECORATION, valBlink, p);
1046 static HRESULT WINAPI HTMLStyle_put_verticalAlign(IHTMLStyle *iface, VARIANT v)
1048 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1050 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1054 return set_style_attr(This, STYLEID_VERTICAL_ALIGN, V_BSTR(&v), 0);
1056 FIXME("not implemented vt %d\n", V_VT(&v));
1063 static HRESULT WINAPI HTMLStyle_get_verticalAlign(IHTMLStyle *iface, VARIANT *p)
1065 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1069 TRACE("(%p)->(%p)\n", This, p);
1071 hres = get_style_attr(This, STYLEID_VERTICAL_ALIGN, &ret);
1080 static HRESULT WINAPI HTMLStyle_put_textTransform(IHTMLStyle *iface, BSTR v)
1082 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1083 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1087 static HRESULT WINAPI HTMLStyle_get_textTransform(IHTMLStyle *iface, BSTR *p)
1089 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1090 FIXME("(%p)->(%p)\n", This, p);
1094 static HRESULT WINAPI HTMLStyle_put_textAlign(IHTMLStyle *iface, BSTR v)
1096 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1098 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1100 return set_style_attr(This, STYLEID_TEXT_ALIGN, v, 0);
1103 static HRESULT WINAPI HTMLStyle_get_textAlign(IHTMLStyle *iface, BSTR *p)
1105 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1107 TRACE("(%p)->(%p)\n", This, p);
1109 return get_style_attr(This, STYLEID_TEXT_ALIGN, p);
1112 static HRESULT WINAPI HTMLStyle_put_textIndent(IHTMLStyle *iface, VARIANT v)
1114 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1115 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1119 static HRESULT WINAPI HTMLStyle_get_textIndent(IHTMLStyle *iface, VARIANT *p)
1121 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1122 FIXME("(%p)->(%p)\n", This, p);
1126 static HRESULT WINAPI HTMLStyle_put_lineHeight(IHTMLStyle *iface, VARIANT v)
1128 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1129 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1133 static HRESULT WINAPI HTMLStyle_get_lineHeight(IHTMLStyle *iface, VARIANT *p)
1135 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1136 FIXME("(%p)->(%p)\n", This, p);
1140 static HRESULT WINAPI HTMLStyle_put_marginTop(IHTMLStyle *iface, VARIANT v)
1142 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1143 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1147 static HRESULT WINAPI HTMLStyle_get_marginTop(IHTMLStyle *iface, VARIANT *p)
1149 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1150 FIXME("(%p)->(%p)\n", This, p);
1154 static HRESULT WINAPI HTMLStyle_put_marginRight(IHTMLStyle *iface, VARIANT v)
1156 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1158 TRACE("(%p)->(v(%d))\n", This, V_VT(&v));
1162 return set_style_attr(This, STYLEID_MARGIN_RIGHT, emptyW, 0);
1166 wsprintfW(buf, px_formatW, V_I4(&v));
1167 return set_style_attr(This, STYLEID_MARGIN_RIGHT, buf, 0);
1170 return set_style_attr(This, STYLEID_MARGIN_RIGHT, V_BSTR(&v), 0);
1172 FIXME("Unsupported vt=%d\n", V_VT(&v));
1178 static HRESULT WINAPI HTMLStyle_get_marginRight(IHTMLStyle *iface, VARIANT *p)
1180 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1181 TRACE("(%p)->(%p)\n", This, p);
1182 return get_nsstyle_attr_var(This->nsstyle, STYLEID_MARGIN_RIGHT, p, 0);
1185 static HRESULT WINAPI HTMLStyle_put_marginBottom(IHTMLStyle *iface, VARIANT v)
1187 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1188 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1192 static HRESULT WINAPI HTMLStyle_get_marginBottom(IHTMLStyle *iface, VARIANT *p)
1194 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1195 FIXME("(%p)->(%p)\n", This, p);
1199 static HRESULT WINAPI HTMLStyle_put_marginLeft(IHTMLStyle *iface, VARIANT v)
1201 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1205 TRACE("(%p)->(NULL)\n", This);
1206 return set_style_attr(This, STYLEID_MARGIN_LEFT, emptyW, 0);
1210 TRACE("(%p)->(%d)\n", This, V_I4(&v));
1212 wsprintfW(buf, px_formatW, V_I4(&v));
1213 return set_style_attr(This, STYLEID_MARGIN_LEFT, buf, 0);
1216 TRACE("(%p)->(%s)\n", This, debugstr_w(V_BSTR(&v)));
1217 return set_style_attr(This, STYLEID_MARGIN_LEFT, V_BSTR(&v), 0);
1219 FIXME("Unsupported vt=%d\n", V_VT(&v));
1225 static HRESULT WINAPI HTMLStyle_put_margin(IHTMLStyle *iface, BSTR v)
1227 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1229 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1231 return set_style_attr(This, STYLEID_MARGIN, v, 0);
1234 static HRESULT WINAPI HTMLStyle_get_margin(IHTMLStyle *iface, BSTR *p)
1236 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1238 TRACE("(%p)->(%p)\n", This, p);
1240 return get_style_attr(This, STYLEID_MARGIN, p);
1243 static HRESULT WINAPI HTMLStyle_get_marginLeft(IHTMLStyle *iface, VARIANT *p)
1245 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1246 TRACE("(%p)->(%p)\n", This, p);
1247 return get_nsstyle_attr_var(This->nsstyle, STYLEID_MARGIN_LEFT, p, 0);
1250 static HRESULT WINAPI HTMLStyle_put_paddingTop(IHTMLStyle *iface, VARIANT v)
1252 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1253 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1257 static HRESULT WINAPI HTMLStyle_get_paddingTop(IHTMLStyle *iface, VARIANT *p)
1259 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1260 FIXME("(%p)->(%p)\n", This, p);
1264 static HRESULT WINAPI HTMLStyle_put_paddingRight(IHTMLStyle *iface, VARIANT v)
1266 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1267 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1271 static HRESULT WINAPI HTMLStyle_get_paddingRight(IHTMLStyle *iface, VARIANT *p)
1273 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1274 FIXME("(%p)->(%p)\n", This, p);
1278 static HRESULT WINAPI HTMLStyle_put_paddingBottom(IHTMLStyle *iface, VARIANT v)
1280 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1281 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1285 static HRESULT WINAPI HTMLStyle_get_paddingBottom(IHTMLStyle *iface, VARIANT *p)
1287 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1288 FIXME("(%p)->(%p)\n", This, p);
1292 static HRESULT WINAPI HTMLStyle_put_paddingLeft(IHTMLStyle *iface, VARIANT v)
1294 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1296 TRACE("(%p)->(vt=%d)\n", This, V_VT(&v));
1302 wsprintfW(buf, px_formatW, V_I4(&v));
1303 return set_style_attr(This, STYLEID_PADDING_LEFT, buf, 0);
1306 return set_style_attr(This, STYLEID_PADDING_LEFT, V_BSTR(&v), 0);
1308 FIXME("unsupported vt=%d\n", V_VT(&v));
1314 static HRESULT WINAPI HTMLStyle_get_paddingLeft(IHTMLStyle *iface, VARIANT *p)
1316 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1320 TRACE("(%p)->(%p)\n", This, p);
1322 hres = get_style_attr(This, STYLEID_PADDING_LEFT, &ret);
1331 static HRESULT WINAPI HTMLStyle_put_padding(IHTMLStyle *iface, BSTR v)
1333 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1334 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1338 static HRESULT WINAPI HTMLStyle_get_padding(IHTMLStyle *iface, BSTR *p)
1340 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1341 FIXME("(%p)->(%p)\n", This, p);
1345 static HRESULT WINAPI HTMLStyle_put_border(IHTMLStyle *iface, BSTR v)
1347 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1349 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1351 return set_style_attr(This, STYLEID_BORDER, v, 0);
1354 static HRESULT WINAPI HTMLStyle_get_border(IHTMLStyle *iface, BSTR *p)
1356 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1358 TRACE("(%p)->(%p)\n", This, p);
1360 return get_style_attr(This, STYLEID_BORDER, p);
1363 static HRESULT WINAPI HTMLStyle_put_borderTop(IHTMLStyle *iface, BSTR v)
1365 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1366 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1370 static HRESULT WINAPI HTMLStyle_get_borderTop(IHTMLStyle *iface, BSTR *p)
1372 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1373 FIXME("(%p)->(%p)\n", This, p);
1377 static HRESULT WINAPI HTMLStyle_put_borderRight(IHTMLStyle *iface, BSTR v)
1379 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1380 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1384 static HRESULT WINAPI HTMLStyle_get_borderRight(IHTMLStyle *iface, BSTR *p)
1386 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1387 FIXME("(%p)->(%p)\n", This, p);
1391 static HRESULT WINAPI HTMLStyle_put_borderBottom(IHTMLStyle *iface, BSTR v)
1393 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1394 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1398 static HRESULT WINAPI HTMLStyle_get_borderBottom(IHTMLStyle *iface, BSTR *p)
1400 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1401 FIXME("(%p)->(%p)\n", This, p);
1405 static HRESULT WINAPI HTMLStyle_put_borderLeft(IHTMLStyle *iface, BSTR v)
1407 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1409 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1411 return set_style_attr(This, STYLEID_BORDER_LEFT, v, ATTR_FIX_PX);
1414 static HRESULT WINAPI HTMLStyle_get_borderLeft(IHTMLStyle *iface, BSTR *p)
1416 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1417 FIXME("(%p)->(%p)\n", This, p);
1421 static HRESULT WINAPI HTMLStyle_put_borderColor(IHTMLStyle *iface, BSTR v)
1423 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1425 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1427 return set_style_attr(This, STYLEID_BORDER_COLOR, v, 0);
1430 static HRESULT WINAPI HTMLStyle_get_borderColor(IHTMLStyle *iface, BSTR *p)
1432 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1434 TRACE("(%p)->(%p)\n", This, p);
1436 return get_style_attr(This, STYLEID_BORDER_COLOR, p);
1439 static HRESULT WINAPI HTMLStyle_put_borderTopColor(IHTMLStyle *iface, VARIANT v)
1441 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1442 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1446 static HRESULT WINAPI HTMLStyle_get_borderTopColor(IHTMLStyle *iface, VARIANT *p)
1448 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1449 FIXME("(%p)->(%p)\n", This, p);
1453 static HRESULT WINAPI HTMLStyle_put_borderRightColor(IHTMLStyle *iface, VARIANT v)
1455 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1456 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1460 static HRESULT WINAPI HTMLStyle_get_borderRightColor(IHTMLStyle *iface, VARIANT *p)
1462 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1463 FIXME("(%p)->(%p)\n", This, p);
1467 static HRESULT WINAPI HTMLStyle_put_borderBottomColor(IHTMLStyle *iface, VARIANT v)
1469 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1470 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1474 static HRESULT WINAPI HTMLStyle_get_borderBottomColor(IHTMLStyle *iface, VARIANT *p)
1476 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1477 FIXME("(%p)->(%p)\n", This, p);
1481 static HRESULT WINAPI HTMLStyle_put_borderLeftColor(IHTMLStyle *iface, VARIANT v)
1483 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1484 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1488 static HRESULT WINAPI HTMLStyle_get_borderLeftColor(IHTMLStyle *iface, VARIANT *p)
1490 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1491 FIXME("(%p)->(%p)\n", This, p);
1495 static HRESULT WINAPI HTMLStyle_put_borderWidth(IHTMLStyle *iface, BSTR v)
1497 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1498 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1499 return set_style_attr(This, STYLEID_BORDER_WIDTH, v, ATTR_FIX_PX);
1502 static HRESULT WINAPI HTMLStyle_get_borderWidth(IHTMLStyle *iface, BSTR *p)
1504 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1505 TRACE("(%p)->(%p)\n", This, p);
1506 return get_style_attr(This, STYLEID_BORDER_WIDTH, p);
1509 static HRESULT WINAPI HTMLStyle_put_borderTopWidth(IHTMLStyle *iface, VARIANT v)
1511 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1512 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1516 static HRESULT WINAPI HTMLStyle_get_borderTopWidth(IHTMLStyle *iface, VARIANT *p)
1518 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1519 FIXME("(%p)->(%p)\n", This, p);
1523 static HRESULT WINAPI HTMLStyle_put_borderRightWidth(IHTMLStyle *iface, VARIANT v)
1525 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1526 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1530 static HRESULT WINAPI HTMLStyle_get_borderRightWidth(IHTMLStyle *iface, VARIANT *p)
1532 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1533 FIXME("(%p)->(%p)\n", This, p);
1537 static HRESULT WINAPI HTMLStyle_put_borderBottomWidth(IHTMLStyle *iface, VARIANT v)
1539 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1540 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1544 static HRESULT WINAPI HTMLStyle_get_borderBottomWidth(IHTMLStyle *iface, VARIANT *p)
1546 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1547 FIXME("(%p)->(%p)\n", This, p);
1551 static HRESULT WINAPI HTMLStyle_put_borderLeftWidth(IHTMLStyle *iface, VARIANT v)
1553 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1554 FIXME("(%p)->(v%d)\n", This, V_VT(&v));
1558 static HRESULT WINAPI HTMLStyle_get_borderLeftWidth(IHTMLStyle *iface, VARIANT *p)
1560 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1561 FIXME("(%p)->(%p)\n", This, p);
1565 static HRESULT WINAPI HTMLStyle_put_borderStyle(IHTMLStyle *iface, BSTR v)
1567 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1568 static const WCHAR styleWindowInset[] = {'w','i','n','d','o','w','-','i','n','s','e','t',0};
1569 HRESULT hres = S_OK;
1574 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1576 while(v[i] && hres == S_OK)
1578 if(v[i] == (WCHAR)' ')
1580 pstyle = SysAllocStringLen(&v[last], (i-last));
1581 if( !(is_valid_border_style(pstyle) || strcmpiW(styleWindowInset, pstyle) == 0))
1583 TRACE("1. Invalid style (%s)\n", debugstr_w(pstyle));
1584 hres = E_INVALIDARG;
1586 SysFreeString(pstyle);
1594 pstyle = SysAllocStringLen(&v[last], i-last);
1595 if( !(is_valid_border_style(pstyle) || strcmpiW(styleWindowInset, pstyle) == 0))
1597 TRACE("2. Invalid style (%s)\n", debugstr_w(pstyle));
1598 hres = E_INVALIDARG;
1600 SysFreeString(pstyle);
1604 hres = set_nsstyle_attr(This->nsstyle, STYLEID_BORDER_STYLE, v, 0);
1609 static HRESULT WINAPI HTMLStyle_get_borderStyle(IHTMLStyle *iface, BSTR *p)
1611 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1612 TRACE("(%p)->(%p)\n", This, p);
1613 return get_style_attr(This, STYLEID_BORDER_STYLE, p);
1616 static HRESULT WINAPI HTMLStyle_put_borderTopStyle(IHTMLStyle *iface, BSTR v)
1618 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1619 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1621 if(!is_valid_border_style(v))
1622 return E_INVALIDARG;
1624 return set_style_attr(This, STYLEID_BORDER_TOP_STYLE, v, 0);
1627 static HRESULT WINAPI HTMLStyle_get_borderTopStyle(IHTMLStyle *iface, BSTR *p)
1629 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1630 TRACE("(%p)->(%p)\n", This, p);
1631 return get_style_attr(This, STYLEID_BORDER_TOP_STYLE, p);
1634 static HRESULT WINAPI HTMLStyle_put_borderRightStyle(IHTMLStyle *iface, BSTR v)
1636 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1637 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1639 if(!is_valid_border_style(v))
1640 return E_INVALIDARG;
1642 return set_style_attr(This, STYLEID_BORDER_RIGHT_STYLE, v, 0);
1645 static HRESULT WINAPI HTMLStyle_get_borderRightStyle(IHTMLStyle *iface, BSTR *p)
1647 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1648 TRACE("(%p)->(%p)\n", This, p);
1649 return get_style_attr(This, STYLEID_BORDER_RIGHT_STYLE, p);
1652 static HRESULT WINAPI HTMLStyle_put_borderBottomStyle(IHTMLStyle *iface, BSTR v)
1654 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1655 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1657 if(!is_valid_border_style(v))
1658 return E_INVALIDARG;
1660 return set_style_attr(This, STYLEID_BORDER_BOTTOM_STYLE, v, 0);
1663 static HRESULT WINAPI HTMLStyle_get_borderBottomStyle(IHTMLStyle *iface, BSTR *p)
1665 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1666 TRACE("(%p)->(%p)\n", This, p);
1667 return get_style_attr(This, STYLEID_BORDER_BOTTOM_STYLE, p);
1670 static HRESULT WINAPI HTMLStyle_put_borderLeftStyle(IHTMLStyle *iface, BSTR v)
1672 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1673 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1675 if(!is_valid_border_style(v))
1676 return E_INVALIDARG;
1678 return set_style_attr(This, STYLEID_BORDER_LEFT_STYLE, v, 0);
1681 static HRESULT WINAPI HTMLStyle_get_borderLeftStyle(IHTMLStyle *iface, BSTR *p)
1683 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1684 TRACE("(%p)->(%p)\n", This, p);
1685 return get_style_attr(This, STYLEID_BORDER_LEFT_STYLE, p);
1688 static HRESULT WINAPI HTMLStyle_put_width(IHTMLStyle *iface, VARIANT v)
1690 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1692 TRACE("(%p)->(v%d)\n", This, V_VT(&v));
1696 TRACE("%s\n", debugstr_w(V_BSTR(&v)));
1697 return set_style_attr(This, STYLEID_WIDTH, V_BSTR(&v), 0);
1699 FIXME("unsupported vt %d\n", V_VT(&v));
1705 static HRESULT WINAPI HTMLStyle_get_width(IHTMLStyle *iface, VARIANT *p)
1707 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1709 TRACE("(%p)->(%p)\n", This, p);
1712 return get_style_attr(This, STYLEID_WIDTH, &V_BSTR(p));
1715 static HRESULT WINAPI HTMLStyle_put_height(IHTMLStyle *iface, VARIANT v)
1717 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1719 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1723 return set_style_attr(This, STYLEID_HEIGHT, V_BSTR(&v), 0);
1725 FIXME("unimplemented vt %d\n", V_VT(&v));
1732 static HRESULT WINAPI HTMLStyle_get_height(IHTMLStyle *iface, VARIANT *p)
1734 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1738 TRACE("(%p)->(%p)\n", This, p);
1740 hres = get_style_attr(This, STYLEID_HEIGHT, &ret);
1749 static HRESULT WINAPI HTMLStyle_put_styleFloat(IHTMLStyle *iface, BSTR v)
1751 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1752 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1756 static HRESULT WINAPI HTMLStyle_get_styleFloat(IHTMLStyle *iface, BSTR *p)
1758 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1759 FIXME("(%p)->(%p)\n", This, p);
1763 static HRESULT WINAPI HTMLStyle_put_clear(IHTMLStyle *iface, BSTR v)
1765 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1766 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1770 static HRESULT WINAPI HTMLStyle_get_clear(IHTMLStyle *iface, BSTR *p)
1772 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1773 FIXME("(%p)->(%p)\n", This, p);
1777 static HRESULT WINAPI HTMLStyle_put_display(IHTMLStyle *iface, BSTR v)
1779 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1781 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1783 return set_style_attr(This, STYLEID_DISPLAY, v, 0);
1786 static HRESULT WINAPI HTMLStyle_get_display(IHTMLStyle *iface, BSTR *p)
1788 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1790 TRACE("(%p)->(%p)\n", This, p);
1792 return get_style_attr(This, STYLEID_DISPLAY, p);
1795 static HRESULT WINAPI HTMLStyle_put_visibility(IHTMLStyle *iface, BSTR v)
1797 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1799 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1801 return set_style_attr(This, STYLEID_VISIBILITY, v, 0);
1804 static HRESULT WINAPI HTMLStyle_get_visibility(IHTMLStyle *iface, BSTR *p)
1806 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1808 TRACE("(%p)->(%p)\n", This, p);
1810 return get_style_attr(This, STYLEID_VISIBILITY, p);
1813 static HRESULT WINAPI HTMLStyle_put_listStyleType(IHTMLStyle *iface, BSTR v)
1815 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1816 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1820 static HRESULT WINAPI HTMLStyle_get_listStyleType(IHTMLStyle *iface, BSTR *p)
1822 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1823 FIXME("(%p)->(%p)\n", This, p);
1827 static HRESULT WINAPI HTMLStyle_put_listStylePosition(IHTMLStyle *iface, BSTR v)
1829 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1830 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1834 static HRESULT WINAPI HTMLStyle_get_listStylePosition(IHTMLStyle *iface, BSTR *p)
1836 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1837 FIXME("(%p)->(%p)\n", This, p);
1841 static HRESULT WINAPI HTMLStyle_put_listStyleImage(IHTMLStyle *iface, BSTR v)
1843 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1844 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1848 static HRESULT WINAPI HTMLStyle_get_listStyleImage(IHTMLStyle *iface, BSTR *p)
1850 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1851 FIXME("(%p)->(%p)\n", This, p);
1855 static HRESULT WINAPI HTMLStyle_put_listStyle(IHTMLStyle *iface, BSTR v)
1857 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1858 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1862 static HRESULT WINAPI HTMLStyle_get_listStyle(IHTMLStyle *iface, BSTR *p)
1864 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1865 FIXME("(%p)->(%p)\n", This, p);
1869 static HRESULT WINAPI HTMLStyle_put_whiteSpace(IHTMLStyle *iface, BSTR v)
1871 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1872 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1876 static HRESULT WINAPI HTMLStyle_get_whiteSpace(IHTMLStyle *iface, BSTR *p)
1878 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1879 FIXME("(%p)->(%p)\n", This, p);
1883 static HRESULT WINAPI HTMLStyle_put_top(IHTMLStyle *iface, VARIANT v)
1885 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1887 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1889 return set_nsstyle_attr_var(This->nsstyle, STYLEID_TOP, &v, 0);
1892 static HRESULT WINAPI HTMLStyle_get_top(IHTMLStyle *iface, VARIANT *p)
1894 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1898 TRACE("(%p)->(%p)\n", This, p);
1900 hres = get_style_attr(This, STYLEID_TOP, &ret);
1909 static HRESULT WINAPI HTMLStyle_put_left(IHTMLStyle *iface, VARIANT v)
1911 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1913 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1915 return set_nsstyle_attr_var(This->nsstyle, STYLEID_LEFT, &v, 0);
1918 static HRESULT WINAPI HTMLStyle_get_left(IHTMLStyle *iface, VARIANT *p)
1920 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1924 TRACE("(%p)->(%p)\n", This, p);
1926 hres = get_style_attr(This, STYLEID_LEFT, &ret);
1935 static HRESULT WINAPI HTMLStyle_get_position(IHTMLStyle *iface, BSTR *p)
1937 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1938 TRACE("(%p)->(%p)\n", This, p);
1939 return IHTMLStyle2_get_position(HTMLSTYLE2(This), p);
1942 static HRESULT WINAPI HTMLStyle_put_zIndex(IHTMLStyle *iface, VARIANT v)
1944 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1946 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1950 return set_style_attr(This, STYLEID_Z_INDEX, V_BSTR(&v), 0);
1953 static const WCHAR format[] = {'%','d',0};
1955 wsprintfW(value, format, V_I4(&v));
1956 return set_style_attr(This, STYLEID_Z_INDEX, value, 0);
1959 FIXME("unimplemented vt %d\n", V_VT(&v));
1966 static HRESULT WINAPI HTMLStyle_get_zIndex(IHTMLStyle *iface, VARIANT *p)
1968 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1970 TRACE("(%p)->(%p)\n", This, p);
1972 return get_nsstyle_attr_var(This->nsstyle, STYLEID_Z_INDEX, p, ATTR_STR_TO_INT);
1975 static HRESULT WINAPI HTMLStyle_put_overflow(IHTMLStyle *iface, BSTR v)
1977 HTMLStyle *This = HTMLSTYLE_THIS(iface);
1978 static const WCHAR szVisible[] = {'v','i','s','i','b','l','e',0};
1979 static const WCHAR szScroll[] = {'s','c','r','o','l','l',0};
1980 static const WCHAR szHidden[] = {'h','i','d','d','e','n',0};
1981 static const WCHAR szAuto[] = {'a','u','t','o',0};
1983 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1985 /* overflow can only be one of the follow values. */
1986 if(!v || strcmpiW(szVisible, v) == 0 || strcmpiW(szScroll, v) == 0 ||
1987 strcmpiW(szHidden, v) == 0 || strcmpiW(szAuto, v) == 0)
1989 return set_nsstyle_attr(This->nsstyle, STYLEID_OVERFLOW, v, 0);
1992 return E_INVALIDARG;
1996 static HRESULT WINAPI HTMLStyle_get_overflow(IHTMLStyle *iface, BSTR *p)
1998 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2000 TRACE("(%p)->(%p)\n", This, p);
2003 return E_INVALIDARG;
2005 return get_style_attr(This, STYLEID_OVERFLOW, p);
2008 static HRESULT WINAPI HTMLStyle_put_pageBreakBefore(IHTMLStyle *iface, BSTR v)
2010 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2011 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
2015 static HRESULT WINAPI HTMLStyle_get_pageBreakBefore(IHTMLStyle *iface, BSTR *p)
2017 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2018 FIXME("(%p)->(%p)\n", This, p);
2022 static HRESULT WINAPI HTMLStyle_put_pageBreakAfter(IHTMLStyle *iface, BSTR v)
2024 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2025 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
2029 static HRESULT WINAPI HTMLStyle_get_pageBreakAfter(IHTMLStyle *iface, BSTR *p)
2031 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2032 FIXME("(%p)->(%p)\n", This, p);
2036 static HRESULT WINAPI HTMLStyle_put_cssText(IHTMLStyle *iface, BSTR v)
2038 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2039 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
2043 static HRESULT WINAPI HTMLStyle_get_cssText(IHTMLStyle *iface, BSTR *p)
2045 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2046 FIXME("(%p)->(%p)\n", This, p);
2050 static HRESULT WINAPI HTMLStyle_put_pixelTop(IHTMLStyle *iface, long v)
2052 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2053 FIXME("(%p)->()\n", This);
2057 static HRESULT WINAPI HTMLStyle_get_pixelTop(IHTMLStyle *iface, long *p)
2059 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2060 FIXME("(%p)->()\n", This);
2064 static HRESULT WINAPI HTMLStyle_put_pixelLeft(IHTMLStyle *iface, long v)
2066 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2067 FIXME("(%p)->()\n", This);
2071 static HRESULT WINAPI HTMLStyle_get_pixelLeft(IHTMLStyle *iface, long *p)
2073 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2074 FIXME("(%p)->()\n", This);
2078 static HRESULT WINAPI HTMLStyle_put_pixelWidth(IHTMLStyle *iface, long v)
2080 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2081 FIXME("(%p)->()\n", This);
2085 static HRESULT WINAPI HTMLStyle_get_pixelWidth(IHTMLStyle *iface, long *p)
2087 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2088 FIXME("(%p)->()\n", This);
2092 static HRESULT WINAPI HTMLStyle_put_pixelHeight(IHTMLStyle *iface, long v)
2094 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2095 FIXME("(%p)->()\n", This);
2099 static HRESULT WINAPI HTMLStyle_get_pixelHeight(IHTMLStyle *iface, long *p)
2101 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2102 FIXME("(%p)->()\n", This);
2106 static HRESULT WINAPI HTMLStyle_put_posTop(IHTMLStyle *iface, float v)
2108 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2110 TRACE("(%p)->(%f)\n", This, v);
2112 return set_style_pos(This, STYLEID_TOP, v);
2115 static HRESULT WINAPI HTMLStyle_get_posTop(IHTMLStyle *iface, float *p)
2117 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2119 TRACE("(%p)->(%p)\n", This, p);
2124 return get_nsstyle_pos(This, STYLEID_TOP, p);
2127 static HRESULT WINAPI HTMLStyle_put_posLeft(IHTMLStyle *iface, float v)
2129 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2131 TRACE("(%p)->(%f)\n", This, v);
2133 return set_style_pos(This, STYLEID_LEFT, v);
2136 static HRESULT WINAPI HTMLStyle_get_posLeft(IHTMLStyle *iface, float *p)
2138 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2140 TRACE("(%p)->(%p)\n", This, p);
2145 return get_nsstyle_pos(This, STYLEID_LEFT, p);
2148 static HRESULT WINAPI HTMLStyle_put_posWidth(IHTMLStyle *iface, float v)
2150 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2152 TRACE("(%p)->(%f)\n", This, v);
2154 return set_style_pos(This, STYLEID_WIDTH, v);
2157 static HRESULT WINAPI HTMLStyle_get_posWidth(IHTMLStyle *iface, float *p)
2159 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2161 TRACE("(%p)->(%p)\n", This, p);
2166 if(get_nsstyle_pos(This, STYLEID_WIDTH, p) != S_OK)
2172 static HRESULT WINAPI HTMLStyle_put_posHeight(IHTMLStyle *iface, float v)
2174 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2176 TRACE("(%p)->(%f)\n", This, v);
2178 return set_style_pos(This, STYLEID_HEIGHT, v);
2181 static HRESULT WINAPI HTMLStyle_get_posHeight(IHTMLStyle *iface, float *p)
2183 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2185 TRACE("(%p)->(%p)\n", This, p);
2190 if(get_nsstyle_pos(This, STYLEID_HEIGHT, p) != S_OK)
2196 static HRESULT WINAPI HTMLStyle_put_cursor(IHTMLStyle *iface, BSTR v)
2198 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2200 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
2202 return set_style_attr(This, STYLEID_CURSOR, v, 0);
2205 static HRESULT WINAPI HTMLStyle_get_cursor(IHTMLStyle *iface, BSTR *p)
2207 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2209 TRACE("(%p)->(%p)\n", This, p);
2211 return get_style_attr(This, STYLEID_CURSOR, p);
2214 static HRESULT WINAPI HTMLStyle_put_clip(IHTMLStyle *iface, BSTR v)
2216 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2217 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
2221 static HRESULT WINAPI HTMLStyle_get_clip(IHTMLStyle *iface, BSTR *p)
2223 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2224 FIXME("(%p)->(%p)\n", This, p);
2228 static HRESULT WINAPI HTMLStyle_put_filter(IHTMLStyle *iface, BSTR v)
2230 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2232 WARN("(%p)->(%s)\n", This, debugstr_w(v));
2234 /* FIXME: Handle MS-style filters */
2235 return set_style_attr(This, STYLEID_FILTER, v, 0);
2238 static HRESULT WINAPI HTMLStyle_get_filter(IHTMLStyle *iface, BSTR *p)
2240 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2242 WARN("(%p)->(%p)\n", This, p);
2244 /* FIXME: Handle MS-style filters */
2245 return get_style_attr(This, STYLEID_FILTER, p);
2248 static HRESULT WINAPI HTMLStyle_setAttribute(IHTMLStyle *iface, BSTR strAttributeName,
2249 VARIANT AttributeValue, LONG lFlags)
2251 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2255 TRACE("(%p)->(%s v%d %08x)\n", This, debugstr_w(strAttributeName),
2256 V_VT(&AttributeValue), lFlags);
2258 if(!strAttributeName)
2259 return E_INVALIDARG;
2262 FIXME("Parameter lFlags ignored\n");
2264 hres = HTMLStyle_GetIDsOfNames(iface, &IID_NULL, &strAttributeName, 1,
2265 LOCALE_USER_DEFAULT, &dispid);
2269 DISPID dispidNamed = DISPID_PROPERTYPUT;
2273 params.rgvarg = &AttributeValue;
2274 params.cNamedArgs = 1;
2275 params.rgdispidNamedArgs = &dispidNamed;
2277 hres = HTMLStyle_Invoke(iface, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
2278 DISPATCH_PROPERTYPUT, ¶ms, &ret, NULL, NULL);
2282 FIXME("Custom attributes not supported.\n");
2285 TRACE("ret: %08x\n", hres);
2290 static HRESULT WINAPI HTMLStyle_getAttribute(IHTMLStyle *iface, BSTR strAttributeName,
2291 LONG lFlags, VARIANT *AttributeValue)
2293 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2297 TRACE("(%p)->(%s v%p %08x)\n", This, debugstr_w(strAttributeName),
2298 AttributeValue, lFlags);
2300 if(!AttributeValue || !strAttributeName)
2301 return E_INVALIDARG;
2304 FIXME("Parameter lFlags ignored\n");
2306 hres = HTMLStyle_GetIDsOfNames(iface, &IID_NULL, &strAttributeName, 1,
2307 LOCALE_USER_DEFAULT, &dispid);
2310 DISPPARAMS params = {NULL, NULL, 0, 0 };
2312 hres = HTMLStyle_Invoke(iface, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
2313 DISPATCH_PROPERTYGET, ¶ms, AttributeValue, NULL, NULL);
2317 FIXME("Custom attributes not supported.\n");
2323 static HRESULT WINAPI HTMLStyle_removeAttribute(IHTMLStyle *iface, BSTR strAttributeName,
2324 LONG lFlags, VARIANT_BOOL *pfSuccess)
2326 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2327 FIXME("(%p)->(%s %08x %p)\n", This, debugstr_w(strAttributeName),
2332 static HRESULT WINAPI HTMLStyle_toString(IHTMLStyle *iface, BSTR *String)
2334 HTMLStyle *This = HTMLSTYLE_THIS(iface);
2335 FIXME("(%p)->(%p)\n", This, String);
2339 static HRESULT HTMLStyle_get_dispid(IUnknown *iface, BSTR name, DWORD flags, DISPID *dispid)
2341 int c, i, min=0, max = sizeof(style_tbl)/sizeof(*style_tbl)-1;
2346 c = strcmpW(style_tbl[i].name, name);
2348 *dispid = style_tbl[i].dispid;
2358 return DISP_E_UNKNOWNNAME;
2361 static const IHTMLStyleVtbl HTMLStyleVtbl = {
2362 HTMLStyle_QueryInterface,
2365 HTMLStyle_GetTypeInfoCount,
2366 HTMLStyle_GetTypeInfo,
2367 HTMLStyle_GetIDsOfNames,
2369 HTMLStyle_put_fontFamily,
2370 HTMLStyle_get_fontFamily,
2371 HTMLStyle_put_fontStyle,
2372 HTMLStyle_get_fontStyle,
2373 HTMLStyle_put_fontVariant,
2374 HTMLStyle_get_fontVariant,
2375 HTMLStyle_put_fontWeight,
2376 HTMLStyle_get_fontWeight,
2377 HTMLStyle_put_fontSize,
2378 HTMLStyle_get_fontSize,
2381 HTMLStyle_put_color,
2382 HTMLStyle_get_color,
2383 HTMLStyle_put_background,
2384 HTMLStyle_get_background,
2385 HTMLStyle_put_backgroundColor,
2386 HTMLStyle_get_backgroundColor,
2387 HTMLStyle_put_backgroundImage,
2388 HTMLStyle_get_backgroundImage,
2389 HTMLStyle_put_backgroundRepeat,
2390 HTMLStyle_get_backgroundRepeat,
2391 HTMLStyle_put_backgroundAttachment,
2392 HTMLStyle_get_backgroundAttachment,
2393 HTMLStyle_put_backgroundPosition,
2394 HTMLStyle_get_backgroundPosition,
2395 HTMLStyle_put_backgroundPositionX,
2396 HTMLStyle_get_backgroundPositionX,
2397 HTMLStyle_put_backgroundPositionY,
2398 HTMLStyle_get_backgroundPositionY,
2399 HTMLStyle_put_wordSpacing,
2400 HTMLStyle_get_wordSpacing,
2401 HTMLStyle_put_letterSpacing,
2402 HTMLStyle_get_letterSpacing,
2403 HTMLStyle_put_textDecoration,
2404 HTMLStyle_get_textDecoration,
2405 HTMLStyle_put_textDecorationNone,
2406 HTMLStyle_get_textDecorationNone,
2407 HTMLStyle_put_textDecorationUnderline,
2408 HTMLStyle_get_textDecorationUnderline,
2409 HTMLStyle_put_textDecorationOverline,
2410 HTMLStyle_get_textDecorationOverline,
2411 HTMLStyle_put_textDecorationLineThrough,
2412 HTMLStyle_get_textDecorationLineThrough,
2413 HTMLStyle_put_textDecorationBlink,
2414 HTMLStyle_get_textDecorationBlink,
2415 HTMLStyle_put_verticalAlign,
2416 HTMLStyle_get_verticalAlign,
2417 HTMLStyle_put_textTransform,
2418 HTMLStyle_get_textTransform,
2419 HTMLStyle_put_textAlign,
2420 HTMLStyle_get_textAlign,
2421 HTMLStyle_put_textIndent,
2422 HTMLStyle_get_textIndent,
2423 HTMLStyle_put_lineHeight,
2424 HTMLStyle_get_lineHeight,
2425 HTMLStyle_put_marginTop,
2426 HTMLStyle_get_marginTop,
2427 HTMLStyle_put_marginRight,
2428 HTMLStyle_get_marginRight,
2429 HTMLStyle_put_marginBottom,
2430 HTMLStyle_get_marginBottom,
2431 HTMLStyle_put_marginLeft,
2432 HTMLStyle_get_marginLeft,
2433 HTMLStyle_put_margin,
2434 HTMLStyle_get_margin,
2435 HTMLStyle_put_paddingTop,
2436 HTMLStyle_get_paddingTop,
2437 HTMLStyle_put_paddingRight,
2438 HTMLStyle_get_paddingRight,
2439 HTMLStyle_put_paddingBottom,
2440 HTMLStyle_get_paddingBottom,
2441 HTMLStyle_put_paddingLeft,
2442 HTMLStyle_get_paddingLeft,
2443 HTMLStyle_put_padding,
2444 HTMLStyle_get_padding,
2445 HTMLStyle_put_border,
2446 HTMLStyle_get_border,
2447 HTMLStyle_put_borderTop,
2448 HTMLStyle_get_borderTop,
2449 HTMLStyle_put_borderRight,
2450 HTMLStyle_get_borderRight,
2451 HTMLStyle_put_borderBottom,
2452 HTMLStyle_get_borderBottom,
2453 HTMLStyle_put_borderLeft,
2454 HTMLStyle_get_borderLeft,
2455 HTMLStyle_put_borderColor,
2456 HTMLStyle_get_borderColor,
2457 HTMLStyle_put_borderTopColor,
2458 HTMLStyle_get_borderTopColor,
2459 HTMLStyle_put_borderRightColor,
2460 HTMLStyle_get_borderRightColor,
2461 HTMLStyle_put_borderBottomColor,
2462 HTMLStyle_get_borderBottomColor,
2463 HTMLStyle_put_borderLeftColor,
2464 HTMLStyle_get_borderLeftColor,
2465 HTMLStyle_put_borderWidth,
2466 HTMLStyle_get_borderWidth,
2467 HTMLStyle_put_borderTopWidth,
2468 HTMLStyle_get_borderTopWidth,
2469 HTMLStyle_put_borderRightWidth,
2470 HTMLStyle_get_borderRightWidth,
2471 HTMLStyle_put_borderBottomWidth,
2472 HTMLStyle_get_borderBottomWidth,
2473 HTMLStyle_put_borderLeftWidth,
2474 HTMLStyle_get_borderLeftWidth,
2475 HTMLStyle_put_borderStyle,
2476 HTMLStyle_get_borderStyle,
2477 HTMLStyle_put_borderTopStyle,
2478 HTMLStyle_get_borderTopStyle,
2479 HTMLStyle_put_borderRightStyle,
2480 HTMLStyle_get_borderRightStyle,
2481 HTMLStyle_put_borderBottomStyle,
2482 HTMLStyle_get_borderBottomStyle,
2483 HTMLStyle_put_borderLeftStyle,
2484 HTMLStyle_get_borderLeftStyle,
2485 HTMLStyle_put_width,
2486 HTMLStyle_get_width,
2487 HTMLStyle_put_height,
2488 HTMLStyle_get_height,
2489 HTMLStyle_put_styleFloat,
2490 HTMLStyle_get_styleFloat,
2491 HTMLStyle_put_clear,
2492 HTMLStyle_get_clear,
2493 HTMLStyle_put_display,
2494 HTMLStyle_get_display,
2495 HTMLStyle_put_visibility,
2496 HTMLStyle_get_visibility,
2497 HTMLStyle_put_listStyleType,
2498 HTMLStyle_get_listStyleType,
2499 HTMLStyle_put_listStylePosition,
2500 HTMLStyle_get_listStylePosition,
2501 HTMLStyle_put_listStyleImage,
2502 HTMLStyle_get_listStyleImage,
2503 HTMLStyle_put_listStyle,
2504 HTMLStyle_get_listStyle,
2505 HTMLStyle_put_whiteSpace,
2506 HTMLStyle_get_whiteSpace,
2511 HTMLStyle_get_position,
2512 HTMLStyle_put_zIndex,
2513 HTMLStyle_get_zIndex,
2514 HTMLStyle_put_overflow,
2515 HTMLStyle_get_overflow,
2516 HTMLStyle_put_pageBreakBefore,
2517 HTMLStyle_get_pageBreakBefore,
2518 HTMLStyle_put_pageBreakAfter,
2519 HTMLStyle_get_pageBreakAfter,
2520 HTMLStyle_put_cssText,
2521 HTMLStyle_get_cssText,
2522 HTMLStyle_put_pixelTop,
2523 HTMLStyle_get_pixelTop,
2524 HTMLStyle_put_pixelLeft,
2525 HTMLStyle_get_pixelLeft,
2526 HTMLStyle_put_pixelWidth,
2527 HTMLStyle_get_pixelWidth,
2528 HTMLStyle_put_pixelHeight,
2529 HTMLStyle_get_pixelHeight,
2530 HTMLStyle_put_posTop,
2531 HTMLStyle_get_posTop,
2532 HTMLStyle_put_posLeft,
2533 HTMLStyle_get_posLeft,
2534 HTMLStyle_put_posWidth,
2535 HTMLStyle_get_posWidth,
2536 HTMLStyle_put_posHeight,
2537 HTMLStyle_get_posHeight,
2538 HTMLStyle_put_cursor,
2539 HTMLStyle_get_cursor,
2542 HTMLStyle_put_filter,
2543 HTMLStyle_get_filter,
2544 HTMLStyle_setAttribute,
2545 HTMLStyle_getAttribute,
2546 HTMLStyle_removeAttribute,
2550 static const dispex_static_data_vtbl_t HTMLStyle_dispex_vtbl = {
2551 HTMLStyle_get_dispid,
2555 static const tid_t HTMLStyle_iface_tids[] = {
2560 static dispex_static_data_t HTMLStyle_dispex = {
2561 &HTMLStyle_dispex_vtbl,
2564 HTMLStyle_iface_tids
2567 IHTMLStyle *HTMLStyle_Create(nsIDOMCSSStyleDeclaration *nsstyle)
2569 HTMLStyle *ret = heap_alloc_zero(sizeof(HTMLStyle));
2571 ret->lpHTMLStyleVtbl = &HTMLStyleVtbl;
2573 ret->nsstyle = nsstyle;
2574 HTMLStyle2_Init(ret);
2575 HTMLStyle3_Init(ret);
2577 nsIDOMCSSStyleDeclaration_AddRef(nsstyle);
2579 init_dispex(&ret->dispex, (IUnknown*)HTMLSTYLE(ret), &HTMLStyle_dispex);
2581 return HTMLSTYLE(ret);