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
);
959 TRACE("(%p)->(%x)\n", This
, v
);
961 return set_style_attr(This
, STYLEID_TEXT_DECORATION
, v
? valLineThrough
: emptyW
, 0);
964 static HRESULT WINAPI
HTMLStyle_get_textDecorationLineThrough(IHTMLStyle
*iface
, VARIANT_BOOL
*p
)
966 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
968 TRACE("(%p)->(%p)\n", This
, p
);
970 return check_style_attr_value(This
, STYLEID_TEXT_DECORATION
, valLineThrough
, p
);
973 static HRESULT WINAPI
HTMLStyle_put_textDecorationBlink(IHTMLStyle
*iface
, VARIANT_BOOL v
)
975 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
976 FIXME("(%p)->(%x)\n", This
, v
);
980 static HRESULT WINAPI
HTMLStyle_get_textDecorationBlink(IHTMLStyle
*iface
, VARIANT_BOOL
*p
)
982 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
983 FIXME("(%p)->(%p)\n", This
, p
);
987 static HRESULT WINAPI
HTMLStyle_put_verticalAlign(IHTMLStyle
*iface
, VARIANT v
)
989 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
991 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
995 return set_style_attr(This
, STYLEID_VERTICAL_ALIGN
, V_BSTR(&v
), 0);
997 FIXME("not implemented vt %d\n", V_VT(&v
));
1004 static HRESULT WINAPI
HTMLStyle_get_verticalAlign(IHTMLStyle
*iface
, VARIANT
*p
)
1006 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1010 TRACE("(%p)->(%p)\n", This
, p
);
1012 hres
= get_style_attr(This
, STYLEID_VERTICAL_ALIGN
, &ret
);
1021 static HRESULT WINAPI
HTMLStyle_put_textTransform(IHTMLStyle
*iface
, BSTR v
)
1023 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1024 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1028 static HRESULT WINAPI
HTMLStyle_get_textTransform(IHTMLStyle
*iface
, BSTR
*p
)
1030 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1031 FIXME("(%p)->(%p)\n", This
, p
);
1035 static HRESULT WINAPI
HTMLStyle_put_textAlign(IHTMLStyle
*iface
, BSTR v
)
1037 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1039 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1041 return set_style_attr(This
, STYLEID_TEXT_ALIGN
, v
, 0);
1044 static HRESULT WINAPI
HTMLStyle_get_textAlign(IHTMLStyle
*iface
, BSTR
*p
)
1046 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1048 TRACE("(%p)->(%p)\n", This
, p
);
1050 return get_style_attr(This
, STYLEID_TEXT_ALIGN
, p
);
1053 static HRESULT WINAPI
HTMLStyle_put_textIndent(IHTMLStyle
*iface
, VARIANT v
)
1055 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1056 FIXME("(%p)->(v%d)\n", This
, V_VT(&v
));
1060 static HRESULT WINAPI
HTMLStyle_get_textIndent(IHTMLStyle
*iface
, VARIANT
*p
)
1062 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1063 FIXME("(%p)->(%p)\n", This
, p
);
1067 static HRESULT WINAPI
HTMLStyle_put_lineHeight(IHTMLStyle
*iface
, VARIANT v
)
1069 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1070 FIXME("(%p)->(v%d)\n", This
, V_VT(&v
));
1074 static HRESULT WINAPI
HTMLStyle_get_lineHeight(IHTMLStyle
*iface
, VARIANT
*p
)
1076 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1077 FIXME("(%p)->(%p)\n", This
, p
);
1081 static HRESULT WINAPI
HTMLStyle_put_marginTop(IHTMLStyle
*iface
, VARIANT v
)
1083 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1084 FIXME("(%p)->(v%d)\n", This
, V_VT(&v
));
1088 static HRESULT WINAPI
HTMLStyle_get_marginTop(IHTMLStyle
*iface
, VARIANT
*p
)
1090 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1091 FIXME("(%p)->(%p)\n", This
, p
);
1095 static HRESULT WINAPI
HTMLStyle_put_marginRight(IHTMLStyle
*iface
, VARIANT v
)
1097 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1099 TRACE("(%p)->(v(%d))\n", This
, V_VT(&v
));
1103 return set_style_attr(This
, STYLEID_MARGIN_RIGHT
, emptyW
, 0);
1107 wsprintfW(buf
, px_formatW
, V_I4(&v
));
1108 return set_style_attr(This
, STYLEID_MARGIN_RIGHT
, buf
, 0);
1111 return set_style_attr(This
, STYLEID_MARGIN_RIGHT
, V_BSTR(&v
), 0);
1113 FIXME("Unsupported vt=%d\n", V_VT(&v
));
1119 static HRESULT WINAPI
HTMLStyle_get_marginRight(IHTMLStyle
*iface
, VARIANT
*p
)
1121 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1122 FIXME("(%p)->(%p)\n", This
, p
);
1126 static HRESULT WINAPI
HTMLStyle_put_marginBottom(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_marginBottom(IHTMLStyle
*iface
, VARIANT
*p
)
1135 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1136 FIXME("(%p)->(%p)\n", This
, p
);
1140 static HRESULT WINAPI
HTMLStyle_put_marginLeft(IHTMLStyle
*iface
, VARIANT v
)
1142 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1146 TRACE("(%p)->(NULL)\n", This
);
1147 return set_style_attr(This
, STYLEID_MARGIN_LEFT
, emptyW
, 0);
1151 TRACE("(%p)->(%d)\n", This
, V_I4(&v
));
1153 wsprintfW(buf
, px_formatW
, V_I4(&v
));
1154 return set_style_attr(This
, STYLEID_MARGIN_LEFT
, buf
, 0);
1157 TRACE("(%p)->(%s)\n", This
, debugstr_w(V_BSTR(&v
)));
1158 return set_style_attr(This
, STYLEID_MARGIN_LEFT
, V_BSTR(&v
), 0);
1160 FIXME("Unsupported vt=%d\n", V_VT(&v
));
1166 static HRESULT WINAPI
HTMLStyle_put_margin(IHTMLStyle
*iface
, BSTR v
)
1168 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1170 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1172 return set_style_attr(This
, STYLEID_MARGIN
, v
, 0);
1175 static HRESULT WINAPI
HTMLStyle_get_margin(IHTMLStyle
*iface
, BSTR
*p
)
1177 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1179 TRACE("(%p)->(%p)\n", This
, p
);
1181 return get_style_attr(This
, STYLEID_MARGIN
, p
);
1184 static HRESULT WINAPI
HTMLStyle_get_marginLeft(IHTMLStyle
*iface
, VARIANT
*p
)
1186 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1187 FIXME("(%p)->(%p)\n", This
, p
);
1191 static HRESULT WINAPI
HTMLStyle_put_paddingTop(IHTMLStyle
*iface
, VARIANT v
)
1193 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1194 FIXME("(%p)->(v%d)\n", This
, V_VT(&v
));
1198 static HRESULT WINAPI
HTMLStyle_get_paddingTop(IHTMLStyle
*iface
, VARIANT
*p
)
1200 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1201 FIXME("(%p)->(%p)\n", This
, p
);
1205 static HRESULT WINAPI
HTMLStyle_put_paddingRight(IHTMLStyle
*iface
, VARIANT v
)
1207 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1208 FIXME("(%p)->(v%d)\n", This
, V_VT(&v
));
1212 static HRESULT WINAPI
HTMLStyle_get_paddingRight(IHTMLStyle
*iface
, VARIANT
*p
)
1214 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1215 FIXME("(%p)->(%p)\n", This
, p
);
1219 static HRESULT WINAPI
HTMLStyle_put_paddingBottom(IHTMLStyle
*iface
, VARIANT v
)
1221 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1222 FIXME("(%p)->(v%d)\n", This
, V_VT(&v
));
1226 static HRESULT WINAPI
HTMLStyle_get_paddingBottom(IHTMLStyle
*iface
, VARIANT
*p
)
1228 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1229 FIXME("(%p)->(%p)\n", This
, p
);
1233 static HRESULT WINAPI
HTMLStyle_put_paddingLeft(IHTMLStyle
*iface
, VARIANT v
)
1235 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1237 TRACE("(%p)->(vt=%d)\n", This
, V_VT(&v
));
1243 wsprintfW(buf
, px_formatW
, V_I4(&v
));
1244 return set_style_attr(This
, STYLEID_PADDING_LEFT
, buf
, 0);
1247 return set_style_attr(This
, STYLEID_PADDING_LEFT
, V_BSTR(&v
), 0);
1249 FIXME("unsupported vt=%d\n", V_VT(&v
));
1255 static HRESULT WINAPI
HTMLStyle_get_paddingLeft(IHTMLStyle
*iface
, VARIANT
*p
)
1257 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1261 TRACE("(%p)->(%p)\n", This
, p
);
1263 hres
= get_style_attr(This
, STYLEID_PADDING_LEFT
, &ret
);
1272 static HRESULT WINAPI
HTMLStyle_put_padding(IHTMLStyle
*iface
, BSTR v
)
1274 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1275 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1279 static HRESULT WINAPI
HTMLStyle_get_padding(IHTMLStyle
*iface
, BSTR
*p
)
1281 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1282 FIXME("(%p)->(%p)\n", This
, p
);
1286 static HRESULT WINAPI
HTMLStyle_put_border(IHTMLStyle
*iface
, BSTR v
)
1288 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1290 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1292 return set_style_attr(This
, STYLEID_BORDER
, v
, 0);
1295 static HRESULT WINAPI
HTMLStyle_get_border(IHTMLStyle
*iface
, BSTR
*p
)
1297 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1299 TRACE("(%p)->(%p)\n", This
, p
);
1301 return get_style_attr(This
, STYLEID_BORDER
, p
);
1304 static HRESULT WINAPI
HTMLStyle_put_borderTop(IHTMLStyle
*iface
, BSTR v
)
1306 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1307 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1311 static HRESULT WINAPI
HTMLStyle_get_borderTop(IHTMLStyle
*iface
, BSTR
*p
)
1313 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1314 FIXME("(%p)->(%p)\n", This
, p
);
1318 static HRESULT WINAPI
HTMLStyle_put_borderRight(IHTMLStyle
*iface
, BSTR v
)
1320 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1321 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1325 static HRESULT WINAPI
HTMLStyle_get_borderRight(IHTMLStyle
*iface
, BSTR
*p
)
1327 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1328 FIXME("(%p)->(%p)\n", This
, p
);
1332 static HRESULT WINAPI
HTMLStyle_put_borderBottom(IHTMLStyle
*iface
, BSTR v
)
1334 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1335 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1339 static HRESULT WINAPI
HTMLStyle_get_borderBottom(IHTMLStyle
*iface
, BSTR
*p
)
1341 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1342 FIXME("(%p)->(%p)\n", This
, p
);
1346 static HRESULT WINAPI
HTMLStyle_put_borderLeft(IHTMLStyle
*iface
, BSTR v
)
1348 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1350 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1352 return set_style_attr(This
, STYLEID_BORDER_LEFT
, v
, ATTR_FIX_PX
);
1355 static HRESULT WINAPI
HTMLStyle_get_borderLeft(IHTMLStyle
*iface
, BSTR
*p
)
1357 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1358 FIXME("(%p)->(%p)\n", This
, p
);
1362 static HRESULT WINAPI
HTMLStyle_put_borderColor(IHTMLStyle
*iface
, BSTR v
)
1364 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1365 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1369 static HRESULT WINAPI
HTMLStyle_get_borderColor(IHTMLStyle
*iface
, BSTR
*p
)
1371 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1372 FIXME("(%p)->(%p)\n", This
, p
);
1376 static HRESULT WINAPI
HTMLStyle_put_borderTopColor(IHTMLStyle
*iface
, VARIANT v
)
1378 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1379 FIXME("(%p)->(v%d)\n", This
, V_VT(&v
));
1383 static HRESULT WINAPI
HTMLStyle_get_borderTopColor(IHTMLStyle
*iface
, VARIANT
*p
)
1385 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1386 FIXME("(%p)->(%p)\n", This
, p
);
1390 static HRESULT WINAPI
HTMLStyle_put_borderRightColor(IHTMLStyle
*iface
, VARIANT v
)
1392 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1393 FIXME("(%p)->(v%d)\n", This
, V_VT(&v
));
1397 static HRESULT WINAPI
HTMLStyle_get_borderRightColor(IHTMLStyle
*iface
, VARIANT
*p
)
1399 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1400 FIXME("(%p)->(%p)\n", This
, p
);
1404 static HRESULT WINAPI
HTMLStyle_put_borderBottomColor(IHTMLStyle
*iface
, VARIANT v
)
1406 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1407 FIXME("(%p)->(v%d)\n", This
, V_VT(&v
));
1411 static HRESULT WINAPI
HTMLStyle_get_borderBottomColor(IHTMLStyle
*iface
, VARIANT
*p
)
1413 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1414 FIXME("(%p)->(%p)\n", This
, p
);
1418 static HRESULT WINAPI
HTMLStyle_put_borderLeftColor(IHTMLStyle
*iface
, VARIANT v
)
1420 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1421 FIXME("(%p)->(v%d)\n", This
, V_VT(&v
));
1425 static HRESULT WINAPI
HTMLStyle_get_borderLeftColor(IHTMLStyle
*iface
, VARIANT
*p
)
1427 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1428 FIXME("(%p)->(%p)\n", This
, p
);
1432 static HRESULT WINAPI
HTMLStyle_put_borderWidth(IHTMLStyle
*iface
, BSTR v
)
1434 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1435 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1436 return set_style_attr(This
, STYLEID_BORDER_WIDTH
, v
, ATTR_FIX_PX
);
1439 static HRESULT WINAPI
HTMLStyle_get_borderWidth(IHTMLStyle
*iface
, BSTR
*p
)
1441 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1442 TRACE("(%p)->(%p)\n", This
, p
);
1443 return get_style_attr(This
, STYLEID_BORDER_WIDTH
, p
);
1446 static HRESULT WINAPI
HTMLStyle_put_borderTopWidth(IHTMLStyle
*iface
, VARIANT v
)
1448 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1449 FIXME("(%p)->(v%d)\n", This
, V_VT(&v
));
1453 static HRESULT WINAPI
HTMLStyle_get_borderTopWidth(IHTMLStyle
*iface
, VARIANT
*p
)
1455 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1456 FIXME("(%p)->(%p)\n", This
, p
);
1460 static HRESULT WINAPI
HTMLStyle_put_borderRightWidth(IHTMLStyle
*iface
, VARIANT v
)
1462 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1463 FIXME("(%p)->(v%d)\n", This
, V_VT(&v
));
1467 static HRESULT WINAPI
HTMLStyle_get_borderRightWidth(IHTMLStyle
*iface
, VARIANT
*p
)
1469 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1470 FIXME("(%p)->(%p)\n", This
, p
);
1474 static HRESULT WINAPI
HTMLStyle_put_borderBottomWidth(IHTMLStyle
*iface
, VARIANT v
)
1476 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1477 FIXME("(%p)->(v%d)\n", This
, V_VT(&v
));
1481 static HRESULT WINAPI
HTMLStyle_get_borderBottomWidth(IHTMLStyle
*iface
, VARIANT
*p
)
1483 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1484 FIXME("(%p)->(%p)\n", This
, p
);
1488 static HRESULT WINAPI
HTMLStyle_put_borderLeftWidth(IHTMLStyle
*iface
, VARIANT v
)
1490 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1491 FIXME("(%p)->(v%d)\n", This
, V_VT(&v
));
1495 static HRESULT WINAPI
HTMLStyle_get_borderLeftWidth(IHTMLStyle
*iface
, VARIANT
*p
)
1497 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1498 FIXME("(%p)->(%p)\n", This
, p
);
1502 static HRESULT WINAPI
HTMLStyle_put_borderStyle(IHTMLStyle
*iface
, BSTR v
)
1504 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1505 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1509 static HRESULT WINAPI
HTMLStyle_get_borderStyle(IHTMLStyle
*iface
, BSTR
*p
)
1511 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1512 FIXME("(%p)->(%p)\n", This
, p
);
1516 static HRESULT WINAPI
HTMLStyle_put_borderTopStyle(IHTMLStyle
*iface
, BSTR v
)
1518 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1519 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1521 if(!is_valid_border_style(v
))
1522 return E_INVALIDARG
;
1524 return set_style_attr(This
, STYLEID_BORDER_TOP_STYLE
, v
, 0);
1527 static HRESULT WINAPI
HTMLStyle_get_borderTopStyle(IHTMLStyle
*iface
, BSTR
*p
)
1529 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1530 TRACE("(%p)->(%p)\n", This
, p
);
1531 return get_style_attr(This
, STYLEID_BORDER_TOP_STYLE
, p
);
1534 static HRESULT WINAPI
HTMLStyle_put_borderRightStyle(IHTMLStyle
*iface
, BSTR v
)
1536 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1537 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1539 if(!is_valid_border_style(v
))
1540 return E_INVALIDARG
;
1542 return set_style_attr(This
, STYLEID_BORDER_RIGHT_STYLE
, v
, 0);
1545 static HRESULT WINAPI
HTMLStyle_get_borderRightStyle(IHTMLStyle
*iface
, BSTR
*p
)
1547 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1548 TRACE("(%p)->(%p)\n", This
, p
);
1549 return get_style_attr(This
, STYLEID_BORDER_RIGHT_STYLE
, p
);
1552 static HRESULT WINAPI
HTMLStyle_put_borderBottomStyle(IHTMLStyle
*iface
, BSTR v
)
1554 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1555 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1557 if(!is_valid_border_style(v
))
1558 return E_INVALIDARG
;
1560 return set_style_attr(This
, STYLEID_BORDER_BOTTOM_STYLE
, v
, 0);
1563 static HRESULT WINAPI
HTMLStyle_get_borderBottomStyle(IHTMLStyle
*iface
, BSTR
*p
)
1565 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1566 TRACE("(%p)->(%p)\n", This
, p
);
1567 return get_style_attr(This
, STYLEID_BORDER_BOTTOM_STYLE
, p
);
1570 static HRESULT WINAPI
HTMLStyle_put_borderLeftStyle(IHTMLStyle
*iface
, BSTR v
)
1572 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1573 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1575 if(!is_valid_border_style(v
))
1576 return E_INVALIDARG
;
1578 return set_style_attr(This
, STYLEID_BORDER_LEFT_STYLE
, v
, 0);
1581 static HRESULT WINAPI
HTMLStyle_get_borderLeftStyle(IHTMLStyle
*iface
, BSTR
*p
)
1583 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1584 TRACE("(%p)->(%p)\n", This
, p
);
1585 return get_style_attr(This
, STYLEID_BORDER_LEFT_STYLE
, p
);
1588 static HRESULT WINAPI
HTMLStyle_put_width(IHTMLStyle
*iface
, VARIANT v
)
1590 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1592 TRACE("(%p)->(v%d)\n", This
, V_VT(&v
));
1596 TRACE("%s\n", debugstr_w(V_BSTR(&v
)));
1597 return set_style_attr(This
, STYLEID_WIDTH
, V_BSTR(&v
), 0);
1599 FIXME("unsupported vt %d\n", V_VT(&v
));
1605 static HRESULT WINAPI
HTMLStyle_get_width(IHTMLStyle
*iface
, VARIANT
*p
)
1607 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1609 TRACE("(%p)->(%p)\n", This
, p
);
1612 return get_style_attr(This
, STYLEID_WIDTH
, &V_BSTR(p
));
1615 static HRESULT WINAPI
HTMLStyle_put_height(IHTMLStyle
*iface
, VARIANT v
)
1617 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1619 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1623 return set_style_attr(This
, STYLEID_HEIGHT
, V_BSTR(&v
), 0);
1625 FIXME("unimplemented vt %d\n", V_VT(&v
));
1632 static HRESULT WINAPI
HTMLStyle_get_height(IHTMLStyle
*iface
, VARIANT
*p
)
1634 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1638 TRACE("(%p)->(%p)\n", This
, p
);
1640 hres
= get_style_attr(This
, STYLEID_HEIGHT
, &ret
);
1649 static HRESULT WINAPI
HTMLStyle_put_styleFloat(IHTMLStyle
*iface
, BSTR v
)
1651 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1652 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1656 static HRESULT WINAPI
HTMLStyle_get_styleFloat(IHTMLStyle
*iface
, BSTR
*p
)
1658 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1659 FIXME("(%p)->(%p)\n", This
, p
);
1663 static HRESULT WINAPI
HTMLStyle_put_clear(IHTMLStyle
*iface
, BSTR v
)
1665 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1666 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1670 static HRESULT WINAPI
HTMLStyle_get_clear(IHTMLStyle
*iface
, BSTR
*p
)
1672 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1673 FIXME("(%p)->(%p)\n", This
, p
);
1677 static HRESULT WINAPI
HTMLStyle_put_display(IHTMLStyle
*iface
, BSTR v
)
1679 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1681 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1683 return set_style_attr(This
, STYLEID_DISPLAY
, v
, 0);
1686 static HRESULT WINAPI
HTMLStyle_get_display(IHTMLStyle
*iface
, BSTR
*p
)
1688 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1690 TRACE("(%p)->(%p)\n", This
, p
);
1692 return get_style_attr(This
, STYLEID_DISPLAY
, p
);
1695 static HRESULT WINAPI
HTMLStyle_put_visibility(IHTMLStyle
*iface
, BSTR v
)
1697 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1699 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1701 return set_style_attr(This
, STYLEID_VISIBILITY
, v
, 0);
1704 static HRESULT WINAPI
HTMLStyle_get_visibility(IHTMLStyle
*iface
, BSTR
*p
)
1706 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1708 TRACE("(%p)->(%p)\n", This
, p
);
1710 return get_style_attr(This
, STYLEID_VISIBILITY
, p
);
1713 static HRESULT WINAPI
HTMLStyle_put_listStyleType(IHTMLStyle
*iface
, BSTR v
)
1715 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1716 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1720 static HRESULT WINAPI
HTMLStyle_get_listStyleType(IHTMLStyle
*iface
, BSTR
*p
)
1722 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1723 FIXME("(%p)->(%p)\n", This
, p
);
1727 static HRESULT WINAPI
HTMLStyle_put_listStylePosition(IHTMLStyle
*iface
, BSTR v
)
1729 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1730 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1734 static HRESULT WINAPI
HTMLStyle_get_listStylePosition(IHTMLStyle
*iface
, BSTR
*p
)
1736 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1737 FIXME("(%p)->(%p)\n", This
, p
);
1741 static HRESULT WINAPI
HTMLStyle_put_listStyleImage(IHTMLStyle
*iface
, BSTR v
)
1743 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1744 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1748 static HRESULT WINAPI
HTMLStyle_get_listStyleImage(IHTMLStyle
*iface
, BSTR
*p
)
1750 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1751 FIXME("(%p)->(%p)\n", This
, p
);
1755 static HRESULT WINAPI
HTMLStyle_put_listStyle(IHTMLStyle
*iface
, BSTR v
)
1757 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1758 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1762 static HRESULT WINAPI
HTMLStyle_get_listStyle(IHTMLStyle
*iface
, BSTR
*p
)
1764 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1765 FIXME("(%p)->(%p)\n", This
, p
);
1769 static HRESULT WINAPI
HTMLStyle_put_whiteSpace(IHTMLStyle
*iface
, BSTR v
)
1771 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1772 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1776 static HRESULT WINAPI
HTMLStyle_get_whiteSpace(IHTMLStyle
*iface
, BSTR
*p
)
1778 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1779 FIXME("(%p)->(%p)\n", This
, p
);
1783 static HRESULT WINAPI
HTMLStyle_put_top(IHTMLStyle
*iface
, VARIANT v
)
1785 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1787 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1789 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_TOP
, &v
, 0);
1792 static HRESULT WINAPI
HTMLStyle_get_top(IHTMLStyle
*iface
, VARIANT
*p
)
1794 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1798 TRACE("(%p)->(%p)\n", This
, p
);
1800 hres
= get_style_attr(This
, STYLEID_TOP
, &ret
);
1809 static HRESULT WINAPI
HTMLStyle_put_left(IHTMLStyle
*iface
, VARIANT v
)
1811 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1813 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1815 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_LEFT
, &v
, 0);
1818 static HRESULT WINAPI
HTMLStyle_get_left(IHTMLStyle
*iface
, VARIANT
*p
)
1820 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1824 TRACE("(%p)->(%p)\n", This
, p
);
1826 hres
= get_style_attr(This
, STYLEID_LEFT
, &ret
);
1835 static HRESULT WINAPI
HTMLStyle_get_position(IHTMLStyle
*iface
, BSTR
*p
)
1837 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1838 TRACE("(%p)->(%p)\n", This
, p
);
1839 return IHTMLStyle2_get_position(HTMLSTYLE2(This
), p
);
1842 static HRESULT WINAPI
HTMLStyle_put_zIndex(IHTMLStyle
*iface
, VARIANT v
)
1844 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1846 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1850 return set_style_attr(This
, STYLEID_Z_INDEX
, V_BSTR(&v
), 0);
1853 static const WCHAR format
[] = {'%','d',0};
1855 wsprintfW(value
, format
, V_I4(&v
));
1856 return set_style_attr(This
, STYLEID_Z_INDEX
, value
, 0);
1859 FIXME("unimplemented vt %d\n", V_VT(&v
));
1866 static HRESULT WINAPI
HTMLStyle_get_zIndex(IHTMLStyle
*iface
, VARIANT
*p
)
1868 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1870 TRACE("(%p)->(%p)\n", This
, p
);
1872 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_Z_INDEX
, p
, ATTR_STR_TO_INT
);
1875 static HRESULT WINAPI
HTMLStyle_put_overflow(IHTMLStyle
*iface
, BSTR v
)
1877 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1878 static const WCHAR szVisible
[] = {'v','i','s','i','b','l','e',0};
1879 static const WCHAR szScroll
[] = {'s','c','r','o','l','l',0};
1880 static const WCHAR szHidden
[] = {'h','i','d','d','e','n',0};
1881 static const WCHAR szAuto
[] = {'a','u','t','o',0};
1883 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1885 /* overflow can only be one of the follow values. */
1886 if(!v
|| strcmpiW(szVisible
, v
) == 0 || strcmpiW(szScroll
, v
) == 0 ||
1887 strcmpiW(szHidden
, v
) == 0 || strcmpiW(szAuto
, v
) == 0)
1889 return set_nsstyle_attr(This
->nsstyle
, STYLEID_OVERFLOW
, v
, 0);
1892 return E_INVALIDARG
;
1896 static HRESULT WINAPI
HTMLStyle_get_overflow(IHTMLStyle
*iface
, BSTR
*p
)
1898 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1900 TRACE("(%p)->(%p)\n", This
, p
);
1903 return E_INVALIDARG
;
1905 return get_style_attr(This
, STYLEID_OVERFLOW
, p
);
1908 static HRESULT WINAPI
HTMLStyle_put_pageBreakBefore(IHTMLStyle
*iface
, BSTR v
)
1910 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1911 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1915 static HRESULT WINAPI
HTMLStyle_get_pageBreakBefore(IHTMLStyle
*iface
, BSTR
*p
)
1917 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1918 FIXME("(%p)->(%p)\n", This
, p
);
1922 static HRESULT WINAPI
HTMLStyle_put_pageBreakAfter(IHTMLStyle
*iface
, BSTR v
)
1924 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1925 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1929 static HRESULT WINAPI
HTMLStyle_get_pageBreakAfter(IHTMLStyle
*iface
, BSTR
*p
)
1931 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1932 FIXME("(%p)->(%p)\n", This
, p
);
1936 static HRESULT WINAPI
HTMLStyle_put_cssText(IHTMLStyle
*iface
, BSTR v
)
1938 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1939 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1943 static HRESULT WINAPI
HTMLStyle_get_cssText(IHTMLStyle
*iface
, BSTR
*p
)
1945 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1946 FIXME("(%p)->(%p)\n", This
, p
);
1950 static HRESULT WINAPI
HTMLStyle_put_pixelTop(IHTMLStyle
*iface
, long v
)
1952 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1953 FIXME("(%p)->()\n", This
);
1957 static HRESULT WINAPI
HTMLStyle_get_pixelTop(IHTMLStyle
*iface
, long *p
)
1959 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1960 FIXME("(%p)->()\n", This
);
1964 static HRESULT WINAPI
HTMLStyle_put_pixelLeft(IHTMLStyle
*iface
, long v
)
1966 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1967 FIXME("(%p)->()\n", This
);
1971 static HRESULT WINAPI
HTMLStyle_get_pixelLeft(IHTMLStyle
*iface
, long *p
)
1973 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1974 FIXME("(%p)->()\n", This
);
1978 static HRESULT WINAPI
HTMLStyle_put_pixelWidth(IHTMLStyle
*iface
, long v
)
1980 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1981 FIXME("(%p)->()\n", This
);
1985 static HRESULT WINAPI
HTMLStyle_get_pixelWidth(IHTMLStyle
*iface
, long *p
)
1987 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1988 FIXME("(%p)->()\n", This
);
1992 static HRESULT WINAPI
HTMLStyle_put_pixelHeight(IHTMLStyle
*iface
, long v
)
1994 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1995 FIXME("(%p)->()\n", This
);
1999 static HRESULT WINAPI
HTMLStyle_get_pixelHeight(IHTMLStyle
*iface
, long *p
)
2001 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2002 FIXME("(%p)->()\n", This
);
2006 static HRESULT WINAPI
HTMLStyle_put_posTop(IHTMLStyle
*iface
, float v
)
2008 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2010 TRACE("(%p)->(%f)\n", This
, v
);
2012 return set_style_pos(This
, STYLEID_TOP
, v
);
2015 static HRESULT WINAPI
HTMLStyle_get_posTop(IHTMLStyle
*iface
, float *p
)
2017 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2019 TRACE("(%p)->(%p)\n", This
, p
);
2024 return get_nsstyle_pos(This
, STYLEID_TOP
, p
);
2027 static HRESULT WINAPI
HTMLStyle_put_posLeft(IHTMLStyle
*iface
, float v
)
2029 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2031 TRACE("(%p)->(%f)\n", This
, v
);
2033 return set_style_pos(This
, STYLEID_LEFT
, v
);
2036 static HRESULT WINAPI
HTMLStyle_get_posLeft(IHTMLStyle
*iface
, float *p
)
2038 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2040 TRACE("(%p)->(%p)\n", This
, p
);
2045 return get_nsstyle_pos(This
, STYLEID_LEFT
, p
);
2048 static HRESULT WINAPI
HTMLStyle_put_posWidth(IHTMLStyle
*iface
, float v
)
2050 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2052 TRACE("(%p)->(%f)\n", This
, v
);
2054 return set_style_pos(This
, STYLEID_WIDTH
, v
);
2057 static HRESULT WINAPI
HTMLStyle_get_posWidth(IHTMLStyle
*iface
, float *p
)
2059 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2061 TRACE("(%p)->(%p)\n", This
, p
);
2066 if(get_nsstyle_pos(This
, STYLEID_WIDTH
, p
) != S_OK
)
2072 static HRESULT WINAPI
HTMLStyle_put_posHeight(IHTMLStyle
*iface
, float v
)
2074 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2076 TRACE("(%p)->(%f)\n", This
, v
);
2078 return set_style_pos(This
, STYLEID_HEIGHT
, v
);
2081 static HRESULT WINAPI
HTMLStyle_get_posHeight(IHTMLStyle
*iface
, float *p
)
2083 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2085 TRACE("(%p)->(%p)\n", This
, p
);
2090 if(get_nsstyle_pos(This
, STYLEID_HEIGHT
, p
) != S_OK
)
2096 static HRESULT WINAPI
HTMLStyle_put_cursor(IHTMLStyle
*iface
, BSTR v
)
2098 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2100 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2102 return set_style_attr(This
, STYLEID_CURSOR
, v
, 0);
2105 static HRESULT WINAPI
HTMLStyle_get_cursor(IHTMLStyle
*iface
, BSTR
*p
)
2107 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2109 TRACE("(%p)->(%p)\n", This
, p
);
2111 return get_style_attr(This
, STYLEID_CURSOR
, p
);
2114 static HRESULT WINAPI
HTMLStyle_put_clip(IHTMLStyle
*iface
, BSTR v
)
2116 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2117 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
2121 static HRESULT WINAPI
HTMLStyle_get_clip(IHTMLStyle
*iface
, BSTR
*p
)
2123 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2124 FIXME("(%p)->(%p)\n", This
, p
);
2128 static HRESULT WINAPI
HTMLStyle_put_filter(IHTMLStyle
*iface
, BSTR v
)
2130 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2132 WARN("(%p)->(%s)\n", This
, debugstr_w(v
));
2134 /* FIXME: Handle MS-style filters */
2135 return set_style_attr(This
, STYLEID_FILTER
, v
, 0);
2138 static HRESULT WINAPI
HTMLStyle_get_filter(IHTMLStyle
*iface
, BSTR
*p
)
2140 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2142 WARN("(%p)->(%p)\n", This
, p
);
2144 /* FIXME: Handle MS-style filters */
2145 return get_style_attr(This
, STYLEID_FILTER
, p
);
2148 static HRESULT WINAPI
HTMLStyle_setAttribute(IHTMLStyle
*iface
, BSTR strAttributeName
,
2149 VARIANT AttributeValue
, LONG lFlags
)
2151 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2155 TRACE("(%p)->(%s v%d %08x)\n", This
, debugstr_w(strAttributeName
),
2156 V_VT(&AttributeValue
), lFlags
);
2158 if(!strAttributeName
)
2159 return E_INVALIDARG
;
2162 FIXME("Parameter lFlags ignored\n");
2164 hres
= HTMLStyle_GetIDsOfNames(iface
, &IID_NULL
, (LPOLESTR
*)&strAttributeName
, 1,
2165 LOCALE_USER_DEFAULT
, &dispid
);
2169 DISPID dispidNamed
= DISPID_PROPERTYPUT
;
2173 params
.rgvarg
= &AttributeValue
;
2174 params
.cNamedArgs
= 1;
2175 params
.rgdispidNamedArgs
= &dispidNamed
;
2177 hres
= HTMLStyle_Invoke(iface
, dispid
, &IID_NULL
, LOCALE_SYSTEM_DEFAULT
,
2178 DISPATCH_PROPERTYPUT
, ¶ms
, &ret
, NULL
, NULL
);
2182 FIXME("Custom attributes not supported.\n");
2185 TRACE("ret: %08x\n", hres
);
2190 static HRESULT WINAPI
HTMLStyle_getAttribute(IHTMLStyle
*iface
, BSTR strAttributeName
,
2191 LONG lFlags
, VARIANT
*AttributeValue
)
2193 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2197 TRACE("(%p)->(%s v%p %08x)\n", This
, debugstr_w(strAttributeName
),
2198 AttributeValue
, lFlags
);
2200 if(!AttributeValue
|| !strAttributeName
)
2201 return E_INVALIDARG
;
2204 FIXME("Parameter lFlags ignored\n");
2206 hres
= HTMLStyle_GetIDsOfNames(iface
, &IID_NULL
, (LPOLESTR
*)&strAttributeName
, 1,
2207 LOCALE_USER_DEFAULT
, &dispid
);
2210 DISPPARAMS params
= {NULL
, NULL
, 0, 0 };
2212 hres
= HTMLStyle_Invoke(iface
, dispid
, &IID_NULL
, LOCALE_SYSTEM_DEFAULT
,
2213 DISPATCH_PROPERTYGET
, ¶ms
, AttributeValue
, NULL
, NULL
);
2217 FIXME("Custom attributes not supported.\n");
2223 static HRESULT WINAPI
HTMLStyle_removeAttribute(IHTMLStyle
*iface
, BSTR strAttributeName
,
2224 LONG lFlags
, VARIANT_BOOL
*pfSuccess
)
2226 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2227 FIXME("(%p)->(%s %08x %p)\n", This
, debugstr_w(strAttributeName
),
2232 static HRESULT WINAPI
HTMLStyle_toString(IHTMLStyle
*iface
, BSTR
*String
)
2234 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2235 FIXME("(%p)->(%p)\n", This
, String
);
2239 static HRESULT
HTMLStyle_get_dispid(IUnknown
*iface
, BSTR name
, DWORD flags
, DISPID
*dispid
)
2241 int c
, i
, min
=0, max
= sizeof(style_tbl
)/sizeof(*style_tbl
)-1;
2246 c
= strcmpW(style_tbl
[i
].name
, name
);
2248 *dispid
= style_tbl
[i
].dispid
;
2258 return DISP_E_UNKNOWNNAME
;
2261 static const IHTMLStyleVtbl HTMLStyleVtbl
= {
2262 HTMLStyle_QueryInterface
,
2265 HTMLStyle_GetTypeInfoCount
,
2266 HTMLStyle_GetTypeInfo
,
2267 HTMLStyle_GetIDsOfNames
,
2269 HTMLStyle_put_fontFamily
,
2270 HTMLStyle_get_fontFamily
,
2271 HTMLStyle_put_fontStyle
,
2272 HTMLStyle_get_fontStyle
,
2273 HTMLStyle_put_fontVariant
,
2274 HTMLStyle_get_fontVariant
,
2275 HTMLStyle_put_fontWeight
,
2276 HTMLStyle_get_fontWeight
,
2277 HTMLStyle_put_fontSize
,
2278 HTMLStyle_get_fontSize
,
2281 HTMLStyle_put_color
,
2282 HTMLStyle_get_color
,
2283 HTMLStyle_put_background
,
2284 HTMLStyle_get_background
,
2285 HTMLStyle_put_backgroundColor
,
2286 HTMLStyle_get_backgroundColor
,
2287 HTMLStyle_put_backgroundImage
,
2288 HTMLStyle_get_backgroundImage
,
2289 HTMLStyle_put_backgroundRepeat
,
2290 HTMLStyle_get_backgroundRepeat
,
2291 HTMLStyle_put_backgroundAttachment
,
2292 HTMLStyle_get_backgroundAttachment
,
2293 HTMLStyle_put_backgroundPosition
,
2294 HTMLStyle_get_backgroundPosition
,
2295 HTMLStyle_put_backgroundPositionX
,
2296 HTMLStyle_get_backgroundPositionX
,
2297 HTMLStyle_put_backgroundPositionY
,
2298 HTMLStyle_get_backgroundPositionY
,
2299 HTMLStyle_put_wordSpacing
,
2300 HTMLStyle_get_wordSpacing
,
2301 HTMLStyle_put_letterSpacing
,
2302 HTMLStyle_get_letterSpacing
,
2303 HTMLStyle_put_textDecoration
,
2304 HTMLStyle_get_textDecoration
,
2305 HTMLStyle_put_textDecorationNone
,
2306 HTMLStyle_get_textDecorationNone
,
2307 HTMLStyle_put_textDecorationUnderline
,
2308 HTMLStyle_get_textDecorationUnderline
,
2309 HTMLStyle_put_textDecorationOverline
,
2310 HTMLStyle_get_textDecorationOverline
,
2311 HTMLStyle_put_textDecorationLineThrough
,
2312 HTMLStyle_get_textDecorationLineThrough
,
2313 HTMLStyle_put_textDecorationBlink
,
2314 HTMLStyle_get_textDecorationBlink
,
2315 HTMLStyle_put_verticalAlign
,
2316 HTMLStyle_get_verticalAlign
,
2317 HTMLStyle_put_textTransform
,
2318 HTMLStyle_get_textTransform
,
2319 HTMLStyle_put_textAlign
,
2320 HTMLStyle_get_textAlign
,
2321 HTMLStyle_put_textIndent
,
2322 HTMLStyle_get_textIndent
,
2323 HTMLStyle_put_lineHeight
,
2324 HTMLStyle_get_lineHeight
,
2325 HTMLStyle_put_marginTop
,
2326 HTMLStyle_get_marginTop
,
2327 HTMLStyle_put_marginRight
,
2328 HTMLStyle_get_marginRight
,
2329 HTMLStyle_put_marginBottom
,
2330 HTMLStyle_get_marginBottom
,
2331 HTMLStyle_put_marginLeft
,
2332 HTMLStyle_get_marginLeft
,
2333 HTMLStyle_put_margin
,
2334 HTMLStyle_get_margin
,
2335 HTMLStyle_put_paddingTop
,
2336 HTMLStyle_get_paddingTop
,
2337 HTMLStyle_put_paddingRight
,
2338 HTMLStyle_get_paddingRight
,
2339 HTMLStyle_put_paddingBottom
,
2340 HTMLStyle_get_paddingBottom
,
2341 HTMLStyle_put_paddingLeft
,
2342 HTMLStyle_get_paddingLeft
,
2343 HTMLStyle_put_padding
,
2344 HTMLStyle_get_padding
,
2345 HTMLStyle_put_border
,
2346 HTMLStyle_get_border
,
2347 HTMLStyle_put_borderTop
,
2348 HTMLStyle_get_borderTop
,
2349 HTMLStyle_put_borderRight
,
2350 HTMLStyle_get_borderRight
,
2351 HTMLStyle_put_borderBottom
,
2352 HTMLStyle_get_borderBottom
,
2353 HTMLStyle_put_borderLeft
,
2354 HTMLStyle_get_borderLeft
,
2355 HTMLStyle_put_borderColor
,
2356 HTMLStyle_get_borderColor
,
2357 HTMLStyle_put_borderTopColor
,
2358 HTMLStyle_get_borderTopColor
,
2359 HTMLStyle_put_borderRightColor
,
2360 HTMLStyle_get_borderRightColor
,
2361 HTMLStyle_put_borderBottomColor
,
2362 HTMLStyle_get_borderBottomColor
,
2363 HTMLStyle_put_borderLeftColor
,
2364 HTMLStyle_get_borderLeftColor
,
2365 HTMLStyle_put_borderWidth
,
2366 HTMLStyle_get_borderWidth
,
2367 HTMLStyle_put_borderTopWidth
,
2368 HTMLStyle_get_borderTopWidth
,
2369 HTMLStyle_put_borderRightWidth
,
2370 HTMLStyle_get_borderRightWidth
,
2371 HTMLStyle_put_borderBottomWidth
,
2372 HTMLStyle_get_borderBottomWidth
,
2373 HTMLStyle_put_borderLeftWidth
,
2374 HTMLStyle_get_borderLeftWidth
,
2375 HTMLStyle_put_borderStyle
,
2376 HTMLStyle_get_borderStyle
,
2377 HTMLStyle_put_borderTopStyle
,
2378 HTMLStyle_get_borderTopStyle
,
2379 HTMLStyle_put_borderRightStyle
,
2380 HTMLStyle_get_borderRightStyle
,
2381 HTMLStyle_put_borderBottomStyle
,
2382 HTMLStyle_get_borderBottomStyle
,
2383 HTMLStyle_put_borderLeftStyle
,
2384 HTMLStyle_get_borderLeftStyle
,
2385 HTMLStyle_put_width
,
2386 HTMLStyle_get_width
,
2387 HTMLStyle_put_height
,
2388 HTMLStyle_get_height
,
2389 HTMLStyle_put_styleFloat
,
2390 HTMLStyle_get_styleFloat
,
2391 HTMLStyle_put_clear
,
2392 HTMLStyle_get_clear
,
2393 HTMLStyle_put_display
,
2394 HTMLStyle_get_display
,
2395 HTMLStyle_put_visibility
,
2396 HTMLStyle_get_visibility
,
2397 HTMLStyle_put_listStyleType
,
2398 HTMLStyle_get_listStyleType
,
2399 HTMLStyle_put_listStylePosition
,
2400 HTMLStyle_get_listStylePosition
,
2401 HTMLStyle_put_listStyleImage
,
2402 HTMLStyle_get_listStyleImage
,
2403 HTMLStyle_put_listStyle
,
2404 HTMLStyle_get_listStyle
,
2405 HTMLStyle_put_whiteSpace
,
2406 HTMLStyle_get_whiteSpace
,
2411 HTMLStyle_get_position
,
2412 HTMLStyle_put_zIndex
,
2413 HTMLStyle_get_zIndex
,
2414 HTMLStyle_put_overflow
,
2415 HTMLStyle_get_overflow
,
2416 HTMLStyle_put_pageBreakBefore
,
2417 HTMLStyle_get_pageBreakBefore
,
2418 HTMLStyle_put_pageBreakAfter
,
2419 HTMLStyle_get_pageBreakAfter
,
2420 HTMLStyle_put_cssText
,
2421 HTMLStyle_get_cssText
,
2422 HTMLStyle_put_pixelTop
,
2423 HTMLStyle_get_pixelTop
,
2424 HTMLStyle_put_pixelLeft
,
2425 HTMLStyle_get_pixelLeft
,
2426 HTMLStyle_put_pixelWidth
,
2427 HTMLStyle_get_pixelWidth
,
2428 HTMLStyle_put_pixelHeight
,
2429 HTMLStyle_get_pixelHeight
,
2430 HTMLStyle_put_posTop
,
2431 HTMLStyle_get_posTop
,
2432 HTMLStyle_put_posLeft
,
2433 HTMLStyle_get_posLeft
,
2434 HTMLStyle_put_posWidth
,
2435 HTMLStyle_get_posWidth
,
2436 HTMLStyle_put_posHeight
,
2437 HTMLStyle_get_posHeight
,
2438 HTMLStyle_put_cursor
,
2439 HTMLStyle_get_cursor
,
2442 HTMLStyle_put_filter
,
2443 HTMLStyle_get_filter
,
2444 HTMLStyle_setAttribute
,
2445 HTMLStyle_getAttribute
,
2446 HTMLStyle_removeAttribute
,
2450 static const dispex_static_data_vtbl_t HTMLStyle_dispex_vtbl
= {
2451 HTMLStyle_get_dispid
,
2455 static const tid_t HTMLStyle_iface_tids
[] = {
2460 static dispex_static_data_t HTMLStyle_dispex
= {
2461 &HTMLStyle_dispex_vtbl
,
2464 HTMLStyle_iface_tids
2467 IHTMLStyle
*HTMLStyle_Create(nsIDOMCSSStyleDeclaration
*nsstyle
)
2469 HTMLStyle
*ret
= heap_alloc_zero(sizeof(HTMLStyle
));
2471 ret
->lpHTMLStyleVtbl
= &HTMLStyleVtbl
;
2473 ret
->nsstyle
= nsstyle
;
2474 HTMLStyle2_Init(ret
);
2475 HTMLStyle3_Init(ret
);
2477 nsIDOMCSSStyleDeclaration_AddRef(nsstyle
);
2479 init_dispex(&ret
->dispex
, (IUnknown
*)HTMLSTYLE(ret
), &HTMLStyle_dispex
);
2481 return HTMLSTYLE(ret
);