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 attrBackgroundPositionX
[] =
45 {'b','a','c','k','g','r','o','u','n','d','-','p','o','s','i','t','i','o','n','-','x',0};
46 static const WCHAR attrBackgroundPositionY
[] =
47 {'b','a','c','k','g','r','o','u','n','d','-','p','o','s','i','t','i','o','n','-','y',0};
48 static const WCHAR attrBackgroundRepeat
[] =
49 {'b','a','c','k','g','r','o','u','n','d','-','r','e','p','e','a','t',0};
50 static const WCHAR attrBorder
[] =
51 {'b','o','r','d','e','r',0};
52 static const WCHAR attrBorderBottom
[] =
53 {'b','o','r','d','e','r','-','b','o','t','t','o','m',0};
54 static const WCHAR attrBorderBottomColor
[] =
55 {'b','o','r','d','e','r','-','b','o','t','t','o','m','-','c','o','l','o','r',0};
56 static const WCHAR attrBorderBottomStyle
[] =
57 {'b','o','r','d','e','r','-','b','o','t','t','o','m','-','s','t','y','l','e',0};
58 static const WCHAR attrBorderBottomWidth
[] =
59 {'b','o','r','d','e','r','-','b','o','t','t','o','m','-','w','i','d','t','h',0};
60 static const WCHAR attrBorderColor
[] =
61 {'b','o','r','d','e','r','-','c','o','l','o','r',0};
62 static const WCHAR attrBorderLeft
[] =
63 {'b','o','r','d','e','r','-','l','e','f','t',0};
64 static const WCHAR attrBorderLeftColor
[] =
65 {'b','o','r','d','e','r','-','l','e','f','t','-','c','o','l','o','r',0};
66 static const WCHAR attrBorderLeftStyle
[] =
67 {'b','o','r','d','e','r','-','l','e','f','t','-','s','t','y','l','e',0};
68 static const WCHAR attrBorderLeftWidth
[] =
69 {'b','o','r','d','e','r','-','l','e','f','t','-','w','i','d','t','h',0};
70 static const WCHAR attrBorderRight
[] =
71 {'b','o','r','d','e','r','-','r','i','g','h','t',0};
72 static const WCHAR attrBorderRightColor
[] =
73 {'b','o','r','d','e','r','-','r','i','g','h','t','-','c','o','l','o','r',0};
74 static const WCHAR attrBorderRightStyle
[] =
75 {'b','o','r','d','e','r','-','r','i','g','h','t','-','s','t','y','l','e',0};
76 static const WCHAR attrBorderRightWidth
[] =
77 {'b','o','r','d','e','r','-','r','i','g','h','t','-','w','i','d','t','h',0};
78 static const WCHAR attrBorderTop
[] =
79 {'b','o','r','d','e','r','-','t','o','p',0};
80 static const WCHAR attrBorderTopColor
[] =
81 {'b','o','r','d','e','r','-','t','o','p','-','c','o','l','o','r',0};
82 static const WCHAR attrBorderStyle
[] =
83 {'b','o','r','d','e','r','-','s','t','y','l','e',0};
84 static const WCHAR attrBorderTopStyle
[] =
85 {'b','o','r','d','e','r','-','t','o','p','-','s','t','y','l','e',0};
86 static const WCHAR attrBorderTopWidth
[] =
87 {'b','o','r','d','e','r','-','t','o','p','-','w','i','d','t','h',0};
88 static const WCHAR attrBorderWidth
[] =
89 {'b','o','r','d','e','r','-','w','i','d','t','h',0};
90 static const WCHAR attrBottom
[] =
91 {'b','o','t','t','o','m',0};
92 static const WCHAR attrColor
[] =
93 {'c','o','l','o','r',0};
94 static const WCHAR attrCursor
[] =
95 {'c','u','r','s','o','r',0};
96 static const WCHAR attrDisplay
[] =
97 {'d','i','s','p','l','a','y',0};
98 static const WCHAR attrFilter
[] =
99 {'f','i','l','e','t','e','r',0};
100 static const WCHAR attrFontFamily
[] =
101 {'f','o','n','t','-','f','a','m','i','l','y',0};
102 static const WCHAR attrFontSize
[] =
103 {'f','o','n','t','-','s','i','z','e',0};
104 static const WCHAR attrFontStyle
[] =
105 {'f','o','n','t','-','s','t','y','l','e',0};
106 static const WCHAR attrFontVariant
[] =
107 {'f','o','n','t','-','v','a','r','i','a','n','t',0};
108 static const WCHAR attrFontWeight
[] =
109 {'f','o','n','t','-','w','e','i','g','h','t',0};
110 static const WCHAR attrHeight
[] =
111 {'h','e','i','g','h','t',0};
112 static const WCHAR attrLeft
[] =
114 static const WCHAR attrLetterSpacing
[] =
115 {'l','e','t','t','e','r','-','s','p','a','c','i','n','g',0};
116 static const WCHAR attrLineHeight
[] =
117 {'l','i','n','e','-','h','e','i','g','h','t',0};
118 static const WCHAR attrMargin
[] =
119 {'m','a','r','g','i','n',0};
120 static const WCHAR attrMarginBottom
[] =
121 {'m','a','r','g','i','n','-','b','o','t','t','o','m',0};
122 static const WCHAR attrMarginLeft
[] =
123 {'m','a','r','g','i','n','-','l','e','f','t',0};
124 static const WCHAR attrMarginRight
[] =
125 {'m','a','r','g','i','n','-','r','i','g','h','t',0};
126 static const WCHAR attrMarginTop
[] =
127 {'m','a','r','g','i','n','-','t','o','p',0};
128 static const WCHAR attrMinHeight
[] =
129 {'m','i','n','-','h','e','i','g','h','t',0};
130 static const WCHAR attrOverflow
[] =
131 {'o','v','e','r','f','l','o','w',0};
132 static const WCHAR attrPaddingBottom
[] =
133 {'p','a','d','d','i','n','g','-','b','o','t','t','o','m',0};
134 static const WCHAR attrPaddingLeft
[] =
135 {'p','a','d','d','i','n','g','-','l','e','f','t',0};
136 static const WCHAR attrPaddingRight
[] =
137 {'p','a','d','d','i','n','g','-','r','i','g','h','t',0};
138 static const WCHAR attrPaddingTop
[] =
139 {'p','a','d','d','i','n','g','-','t','o','p',0};
140 static const WCHAR attrPosition
[] =
141 {'p','o','s','i','t','i','o','n',0};
142 static const WCHAR attrRight
[] =
143 {'r','i','g','h','t',0};
144 static const WCHAR attrTextAlign
[] =
145 {'t','e','x','t','-','a','l','i','g','n',0};
146 static const WCHAR attrTextDecoration
[] =
147 {'t','e','x','t','-','d','e','c','o','r','a','t','i','o','n',0};
148 static const WCHAR attrTextIndent
[] =
149 {'t','e','x','t','-','i','n','d','e','n','t',0};
150 static const WCHAR attrTop
[] =
152 static const WCHAR attrVerticalAlign
[] =
153 {'v','e','r','t','i','c','a','l','-','a','l','i','g','n',0};
154 static const WCHAR attrVisibility
[] =
155 {'v','i','s','i','b','i','l','i','t','y',0};
156 static const WCHAR attrWidth
[] =
157 {'w','i','d','t','h',0};
158 static const WCHAR attrWordSpacing
[] =
159 {'w','o','r','d','-','s','p','a','c','i','n','g',0};
160 static const WCHAR attrWordWrap
[] =
161 {'w','o','r','d','-','w','r','a','p',0};
162 static const WCHAR attrZIndex
[] =
163 {'z','-','i','n','d','e','x',0};
169 {attrBackground
, DISPID_IHTMLSTYLE_BACKGROUND
},
170 {attrBackgroundColor
, DISPID_IHTMLSTYLE_BACKGROUNDCOLOR
},
171 {attrBackgroundImage
, DISPID_IHTMLSTYLE_BACKGROUNDIMAGE
},
172 {attrBackgroundPositionX
, DISPID_IHTMLSTYLE_BACKGROUNDPOSITIONX
},
173 {attrBackgroundPositionY
, DISPID_IHTMLSTYLE_BACKGROUNDPOSITIONY
},
174 {attrBackgroundRepeat
, DISPID_IHTMLSTYLE_BACKGROUNDREPEAT
},
175 {attrBorder
, DISPID_IHTMLSTYLE_BORDER
},
176 {attrBorderBottom
, DISPID_IHTMLSTYLE_BORDERBOTTOM
},
177 {attrBorderBottomColor
, DISPID_IHTMLSTYLE_BORDERBOTTOMCOLOR
},
178 {attrBorderBottomStyle
, DISPID_IHTMLSTYLE_BORDERBOTTOMSTYLE
},
179 {attrBorderBottomWidth
, DISPID_IHTMLSTYLE_BORDERBOTTOMWIDTH
},
180 {attrBorderColor
, DISPID_IHTMLSTYLE_BORDERCOLOR
},
181 {attrBorderLeft
, DISPID_IHTMLSTYLE_BORDERLEFT
},
182 {attrBorderLeftColor
, DISPID_IHTMLSTYLE_BORDERLEFTCOLOR
},
183 {attrBorderLeftStyle
, DISPID_IHTMLSTYLE_BORDERLEFTSTYLE
},
184 {attrBorderLeftWidth
, DISPID_IHTMLSTYLE_BORDERLEFTWIDTH
},
185 {attrBorderRight
, DISPID_IHTMLSTYLE_BORDERRIGHT
},
186 {attrBorderRightColor
, DISPID_IHTMLSTYLE_BORDERRIGHTCOLOR
},
187 {attrBorderRightStyle
, DISPID_IHTMLSTYLE_BORDERRIGHTSTYLE
},
188 {attrBorderRightWidth
, DISPID_IHTMLSTYLE_BORDERRIGHTWIDTH
},
189 {attrBorderStyle
, DISPID_IHTMLSTYLE_BORDERSTYLE
},
190 {attrBorderTop
, DISPID_IHTMLSTYLE_BORDERTOP
},
191 {attrBorderTopColor
, DISPID_IHTMLSTYLE_BORDERTOPCOLOR
},
192 {attrBorderTopStyle
, DISPID_IHTMLSTYLE_BORDERTOPSTYLE
},
193 {attrBorderTopWidth
, DISPID_IHTMLSTYLE_BORDERTOPWIDTH
},
194 {attrBorderWidth
, DISPID_IHTMLSTYLE_BORDERWIDTH
},
195 {attrBottom
, DISPID_IHTMLSTYLE2_BOTTOM
},
196 {attrColor
, DISPID_IHTMLSTYLE_COLOR
},
197 {attrCursor
, DISPID_IHTMLSTYLE_CURSOR
},
198 {attrDisplay
, DISPID_IHTMLSTYLE_DISPLAY
},
199 {attrFilter
, DISPID_IHTMLSTYLE_FILTER
},
200 {attrFontFamily
, DISPID_IHTMLSTYLE_FONTFAMILY
},
201 {attrFontSize
, DISPID_IHTMLSTYLE_FONTSIZE
},
202 {attrFontStyle
, DISPID_IHTMLSTYLE_FONTSTYLE
},
203 {attrFontVariant
, DISPID_IHTMLSTYLE_FONTVARIANT
},
204 {attrFontWeight
, DISPID_IHTMLSTYLE_FONTWEIGHT
},
205 {attrHeight
, DISPID_IHTMLSTYLE_HEIGHT
},
206 {attrLeft
, DISPID_IHTMLSTYLE_LEFT
},
207 {attrLetterSpacing
, DISPID_IHTMLSTYLE_LETTERSPACING
},
208 {attrLineHeight
, DISPID_IHTMLSTYLE_LINEHEIGHT
},
209 {attrMargin
, DISPID_IHTMLSTYLE_MARGIN
},
210 {attrMarginBottom
, DISPID_IHTMLSTYLE_MARGINBOTTOM
},
211 {attrMarginLeft
, DISPID_IHTMLSTYLE_MARGINLEFT
},
212 {attrMarginRight
, DISPID_IHTMLSTYLE_MARGINRIGHT
},
213 {attrMarginTop
, DISPID_IHTMLSTYLE_MARGINTOP
},
214 {attrMinHeight
, DISPID_IHTMLSTYLE4_MINHEIGHT
},
215 {attrOverflow
, DISPID_IHTMLSTYLE_OVERFLOW
},
216 {attrPaddingBottom
, DISPID_IHTMLSTYLE_PADDINGBOTTOM
},
217 {attrPaddingLeft
, DISPID_IHTMLSTYLE_PADDINGLEFT
},
218 {attrPaddingRight
, DISPID_IHTMLSTYLE_PADDINGRIGHT
},
219 {attrPaddingTop
, DISPID_IHTMLSTYLE_PADDINGTOP
},
220 {attrPosition
, DISPID_IHTMLSTYLE2_POSITION
},
221 {attrRight
, DISPID_IHTMLSTYLE2_RIGHT
},
222 {attrTextAlign
, DISPID_IHTMLSTYLE_TEXTALIGN
},
223 {attrTextDecoration
, DISPID_IHTMLSTYLE_TEXTDECORATION
},
224 {attrTextIndent
, DISPID_IHTMLSTYLE_TEXTINDENT
},
225 {attrTop
, DISPID_IHTMLSTYLE_TOP
},
226 {attrVerticalAlign
, DISPID_IHTMLSTYLE_VERTICALALIGN
},
227 {attrVisibility
, DISPID_IHTMLSTYLE_VISIBILITY
},
228 {attrWidth
, DISPID_IHTMLSTYLE_WIDTH
},
229 {attrWordSpacing
, DISPID_IHTMLSTYLE_WORDSPACING
},
230 {attrWordWrap
, DISPID_IHTMLSTYLE3_WORDWRAP
},
231 {attrZIndex
, DISPID_IHTMLSTYLE_ZINDEX
}
234 static const WCHAR valLineThrough
[] =
235 {'l','i','n','e','-','t','h','r','o','u','g','h',0};
236 static const WCHAR valUnderline
[] =
237 {'u','n','d','e','r','l','i','n','e',0};
238 static const WCHAR szNormal
[] =
239 {'n','o','r','m','a','l',0};
240 static const WCHAR styleNone
[] =
242 static const WCHAR valOverline
[] =
243 {'o','v','e','r','l','i','n','e',0};
244 static const WCHAR valBlink
[] =
245 {'b','l','i','n','k',0};
247 static const WCHAR px_formatW
[] = {'%','d','p','x',0};
248 static const WCHAR emptyW
[] = {0};
250 static LPWSTR
fix_px_value(LPCWSTR val
)
255 while(*ptr
&& isspaceW(*ptr
))
260 while(*ptr
&& isdigitW(*ptr
))
263 if(!*ptr
|| isspaceW(*ptr
)) {
265 int len
= strlenW(val
)+1;
267 ret
= heap_alloc((len
+2)*sizeof(WCHAR
));
268 memcpy(ret
, val
, (ptr
-val
)*sizeof(WCHAR
));
274 TRACE("fixed %s -> %s\n", debugstr_w(val
), debugstr_w(ret
));
279 while(*ptr
&& !isspaceW(*ptr
))
286 static LPWSTR
fix_url_value(LPCWSTR val
)
290 static const WCHAR urlW
[] = {'u','r','l','('};
292 if(strncmpW(val
, urlW
, sizeof(urlW
)/sizeof(WCHAR
)) || !strchrW(val
, '\\'))
295 ret
= heap_strdupW(val
);
297 for(ptr
= ret
; *ptr
; ptr
++) {
305 HRESULT
set_nsstyle_attr(nsIDOMCSSStyleDeclaration
*nsstyle
, styleid_t sid
, LPCWSTR value
, DWORD flags
)
307 nsAString str_name
, str_value
, str_empty
;
311 static const PRUnichar wszEmpty
[] = {0};
313 if(flags
& ATTR_FIX_PX
)
314 val
= fix_px_value(value
);
315 if(flags
& ATTR_FIX_URL
)
316 val
= fix_url_value(value
);
318 nsAString_InitDepend(&str_name
, style_tbl
[sid
].name
);
319 nsAString_InitDepend(&str_value
, val
? val
: value
);
320 nsAString_InitDepend(&str_empty
, wszEmpty
);
323 nsres
= nsIDOMCSSStyleDeclaration_SetProperty(nsstyle
, &str_name
, &str_value
, &str_empty
);
325 ERR("SetProperty failed: %08x\n", nsres
);
327 nsAString_Finish(&str_name
);
328 nsAString_Finish(&str_value
);
329 nsAString_Finish(&str_empty
);
334 HRESULT
set_nsstyle_attr_var(nsIDOMCSSStyleDeclaration
*nsstyle
, styleid_t sid
, VARIANT
*value
, DWORD flags
)
336 switch(V_VT(value
)) {
338 return set_nsstyle_attr(nsstyle
, sid
, emptyW
, flags
);
341 return set_nsstyle_attr(nsstyle
, sid
, V_BSTR(value
), flags
);
343 case VT_BSTR
|VT_BYREF
:
344 return set_nsstyle_attr(nsstyle
, sid
, *V_BSTRREF(value
), flags
);
349 static const WCHAR format
[] = {'%','d',0};
350 static const WCHAR px_format
[] = {'%','d','p','x',0};
352 wsprintfW(str
, flags
&ATTR_FIX_PX
? px_format
: format
, V_I4(value
));
353 return set_nsstyle_attr(nsstyle
, sid
, str
, flags
& ~ATTR_FIX_PX
);
356 FIXME("not implemented vt %d\n", V_VT(value
));
364 static inline HRESULT
set_style_attr(HTMLStyle
*This
, styleid_t sid
, LPCWSTR value
, DWORD flags
)
366 return set_nsstyle_attr(This
->nsstyle
, sid
, value
, flags
);
369 static HRESULT
get_nsstyle_attr_nsval(nsIDOMCSSStyleDeclaration
*nsstyle
, styleid_t sid
, nsAString
*value
)
374 nsAString_InitDepend(&str_name
, style_tbl
[sid
].name
);
376 nsres
= nsIDOMCSSStyleDeclaration_GetPropertyValue(nsstyle
, &str_name
, value
);
377 if(NS_FAILED(nsres
)) {
378 ERR("SetProperty failed: %08x\n", nsres
);
382 nsAString_Finish(&str_name
);
387 HRESULT
get_nsstyle_attr(nsIDOMCSSStyleDeclaration
*nsstyle
, styleid_t sid
, BSTR
*p
)
390 const PRUnichar
*value
;
392 nsAString_Init(&str_value
, NULL
);
394 get_nsstyle_attr_nsval(nsstyle
, sid
, &str_value
);
396 nsAString_GetData(&str_value
, &value
);
397 *p
= *value
? SysAllocString(value
) : NULL
;
399 nsAString_Finish(&str_value
);
401 TRACE("%s -> %s\n", debugstr_w(style_tbl
[sid
].name
), debugstr_w(*p
));
405 HRESULT
get_nsstyle_attr_var(nsIDOMCSSStyleDeclaration
*nsstyle
, styleid_t sid
, VARIANT
*p
, DWORD flags
)
408 const PRUnichar
*value
;
411 nsAString_Init(&str_value
, NULL
);
413 get_nsstyle_attr_nsval(nsstyle
, sid
, &str_value
);
415 nsAString_GetData(&str_value
, &value
);
417 if(flags
& ATTR_STR_TO_INT
) {
418 const PRUnichar
*ptr
= value
;
427 while(isdigitW(*ptr
))
428 i
= i
*10 + (*ptr
++ - '0');
432 V_I4(p
) = neg
? -i
: i
;
441 str
= SysAllocString(value
);
443 return E_OUTOFMEMORY
;
450 nsAString_Finish(&str_value
);
452 TRACE("%s -> %s\n", debugstr_w(style_tbl
[sid
].name
), debugstr_variant(p
));
456 static inline HRESULT
get_style_attr(HTMLStyle
*This
, styleid_t sid
, BSTR
*p
)
458 return get_nsstyle_attr(This
->nsstyle
, sid
, p
);
461 static HRESULT
check_style_attr_value(HTMLStyle
*This
, styleid_t sid
, LPCWSTR exval
, VARIANT_BOOL
*p
)
464 const PRUnichar
*value
;
466 nsAString_Init(&str_value
, NULL
);
468 get_nsstyle_attr_nsval(This
->nsstyle
, sid
, &str_value
);
470 nsAString_GetData(&str_value
, &value
);
471 *p
= strcmpW(value
, exval
) ? VARIANT_FALSE
: VARIANT_TRUE
;
472 nsAString_Finish(&str_value
);
474 TRACE("%s -> %x\n", debugstr_w(style_tbl
[sid
].name
), *p
);
478 static inline HRESULT
set_style_pos(HTMLStyle
*This
, styleid_t sid
, float value
)
481 WCHAR szFormat
[] = {'%','.','0','f','p','x',0};
483 value
= floor(value
);
485 sprintfW(szValue
, szFormat
, value
);
487 return set_style_attr(This
, sid
, szValue
, 0);
490 static HRESULT
get_nsstyle_pos(HTMLStyle
*This
, styleid_t sid
, float *p
)
494 WCHAR pxW
[] = {'p','x',0};
496 TRACE("%p %d %p\n", This
, sid
, p
);
500 nsAString_Init(&str_value
, NULL
);
502 hres
= get_nsstyle_attr_nsval(This
->nsstyle
, sid
, &str_value
);
506 const PRUnichar
*value
;
508 nsAString_GetData(&str_value
, &value
);
511 *p
= strtolW(value
, &ptr
, 10);
513 if(*ptr
&& strcmpW(ptr
, pxW
))
515 nsAString_Finish(&str_value
);
516 FIXME("only px values are currently supported\n");
522 TRACE("ret %f\n", *p
);
524 nsAString_Finish(&str_value
);
529 static BOOL
is_valid_border_style(BSTR v
)
531 static const WCHAR styleDotted
[] = {'d','o','t','t','e','d',0};
532 static const WCHAR styleDashed
[] = {'d','a','s','h','e','d',0};
533 static const WCHAR styleSolid
[] = {'s','o','l','i','d',0};
534 static const WCHAR styleDouble
[] = {'d','o','u','b','l','e',0};
535 static const WCHAR styleGroove
[] = {'g','r','o','o','v','e',0};
536 static const WCHAR styleRidge
[] = {'r','i','d','g','e',0};
537 static const WCHAR styleInset
[] = {'i','n','s','e','t',0};
538 static const WCHAR styleOutset
[] = {'o','u','t','s','e','t',0};
540 TRACE("%s\n", debugstr_w(v
));
542 if(!v
|| strcmpiW(v
, styleNone
) == 0 || strcmpiW(v
, styleDotted
) == 0 ||
543 strcmpiW(v
, styleDashed
) == 0 || strcmpiW(v
, styleSolid
) == 0 ||
544 strcmpiW(v
, styleDouble
) == 0 || strcmpiW(v
, styleGroove
) == 0 ||
545 strcmpiW(v
, styleRidge
) == 0 || strcmpiW(v
, styleInset
) == 0 ||
546 strcmpiW(v
, styleOutset
) == 0 )
554 #define HTMLSTYLE_THIS(iface) DEFINE_THIS(HTMLStyle, HTMLStyle, iface)
556 static HRESULT WINAPI
HTMLStyle_QueryInterface(IHTMLStyle
*iface
, REFIID riid
, void **ppv
)
558 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
562 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
563 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppv
);
564 *ppv
= HTMLSTYLE(This
);
565 }else if(IsEqualGUID(&IID_IHTMLStyle
, riid
)) {
566 TRACE("(%p)->(IID_IHTMLStyle %p)\n", This
, ppv
);
567 *ppv
= HTMLSTYLE(This
);
568 }else if(IsEqualGUID(&IID_IHTMLStyle2
, riid
)) {
569 TRACE("(%p)->(IID_IHTMLStyle2 %p)\n", This
, ppv
);
570 *ppv
= HTMLSTYLE2(This
);
571 }else if(IsEqualGUID(&IID_IHTMLStyle3
, riid
)) {
572 TRACE("(%p)->(IID_IHTMLStyle3 %p)\n", This
, ppv
);
573 *ppv
= HTMLSTYLE3(This
);
574 }else if(IsEqualGUID(&IID_IHTMLStyle4
, riid
)) {
575 TRACE("(%p)->(IID_IHTMLStyle4 %p)\n", This
, ppv
);
576 *ppv
= HTMLSTYLE4(This
);
577 }else if(dispex_query_interface(&This
->dispex
, riid
, ppv
)) {
578 return *ppv
? S_OK
: E_NOINTERFACE
;
582 IUnknown_AddRef((IUnknown
*)*ppv
);
586 WARN("unsupported %s\n", debugstr_guid(riid
));
587 return E_NOINTERFACE
;
590 static ULONG WINAPI
HTMLStyle_AddRef(IHTMLStyle
*iface
)
592 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
593 LONG ref
= InterlockedIncrement(&This
->ref
);
595 TRACE("(%p) ref=%d\n", This
, ref
);
600 static ULONG WINAPI
HTMLStyle_Release(IHTMLStyle
*iface
)
602 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
603 LONG ref
= InterlockedDecrement(&This
->ref
);
605 TRACE("(%p) ref=%d\n", This
, ref
);
609 nsIDOMCSSStyleDeclaration_Release(This
->nsstyle
);
610 release_dispex(&This
->dispex
);
617 static HRESULT WINAPI
HTMLStyle_GetTypeInfoCount(IHTMLStyle
*iface
, UINT
*pctinfo
)
619 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
620 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This
->dispex
), pctinfo
);
623 static HRESULT WINAPI
HTMLStyle_GetTypeInfo(IHTMLStyle
*iface
, UINT iTInfo
,
624 LCID lcid
, ITypeInfo
**ppTInfo
)
626 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
627 return IDispatchEx_GetTypeInfo(DISPATCHEX(&This
->dispex
), iTInfo
, lcid
, ppTInfo
);
630 static HRESULT WINAPI
HTMLStyle_GetIDsOfNames(IHTMLStyle
*iface
, REFIID riid
,
631 LPOLESTR
*rgszNames
, UINT cNames
,
632 LCID lcid
, DISPID
*rgDispId
)
634 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
635 return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This
->dispex
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
638 static HRESULT WINAPI
HTMLStyle_Invoke(IHTMLStyle
*iface
, DISPID dispIdMember
,
639 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
640 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
642 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
643 return IDispatchEx_Invoke(DISPATCHEX(&This
->dispex
), dispIdMember
, riid
, lcid
,
644 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
647 static HRESULT WINAPI
HTMLStyle_put_fontFamily(IHTMLStyle
*iface
, BSTR v
)
649 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
651 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
653 return set_style_attr(This
, STYLEID_FONT_FAMILY
, v
, 0);
656 static HRESULT WINAPI
HTMLStyle_get_fontFamily(IHTMLStyle
*iface
, BSTR
*p
)
658 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
660 TRACE("(%p)->(%p)\n", This
, p
);
662 return get_style_attr(This
, STYLEID_FONT_FAMILY
, p
);
665 static HRESULT WINAPI
HTMLStyle_put_fontStyle(IHTMLStyle
*iface
, BSTR v
)
667 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
668 static const WCHAR szItalic
[] = {'i','t','a','l','i','c',0};
669 static const WCHAR szOblique
[] = {'o','b','l','i','q','u','e',0};
671 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
673 /* fontStyle can only be one of the follow values. */
674 if(!v
|| strcmpiW(szNormal
, v
) == 0 || strcmpiW(szItalic
, v
) == 0 ||
675 strcmpiW(szOblique
, v
) == 0)
677 return set_nsstyle_attr(This
->nsstyle
, STYLEID_FONT_STYLE
, v
, 0);
683 static HRESULT WINAPI
HTMLStyle_get_fontStyle(IHTMLStyle
*iface
, BSTR
*p
)
685 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
687 TRACE("(%p)->(%p)\n", This
, p
);
689 return get_style_attr(This
, STYLEID_FONT_STYLE
, p
);
692 static HRESULT WINAPI
HTMLStyle_put_fontVariant(IHTMLStyle
*iface
, BSTR v
)
694 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
695 static const WCHAR szCaps
[] = {'s','m','a','l','l','-','c','a','p','s',0};
697 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
699 /* fontVariant can only be one of the follow values. */
700 if(!v
|| strcmpiW(szNormal
, v
) == 0 || strcmpiW(szCaps
, v
) == 0)
702 return set_nsstyle_attr(This
->nsstyle
, STYLEID_FONT_VARIANT
, v
, 0);
708 static HRESULT WINAPI
HTMLStyle_get_fontVariant(IHTMLStyle
*iface
, BSTR
*p
)
710 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
711 TRACE("(%p)->(%p)\n", This
, p
);
716 return get_style_attr(This
, STYLEID_FONT_VARIANT
, p
);
719 static HRESULT WINAPI
HTMLStyle_put_fontWeight(IHTMLStyle
*iface
, BSTR v
)
721 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
722 static const WCHAR styleBold
[] = {'b','o','l','d',0};
723 static const WCHAR styleBolder
[] = {'b','o','l','d','e','r',0};
724 static const WCHAR styleLighter
[] = {'l','i','g','h','t','e','r',0};
725 static const WCHAR style100
[] = {'1','0','0',0};
726 static const WCHAR style200
[] = {'2','0','0',0};
727 static const WCHAR style300
[] = {'3','0','0',0};
728 static const WCHAR style400
[] = {'4','0','0',0};
729 static const WCHAR style500
[] = {'5','0','0',0};
730 static const WCHAR style600
[] = {'6','0','0',0};
731 static const WCHAR style700
[] = {'7','0','0',0};
732 static const WCHAR style800
[] = {'8','0','0',0};
733 static const WCHAR style900
[] = {'9','0','0',0};
735 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
737 /* fontWeight can only be one of the following */
738 if(!v
|| strcmpiW(szNormal
, v
) == 0 || strcmpiW(styleBold
, v
) == 0 ||
739 strcmpiW(styleBolder
, v
) == 0 || strcmpiW(styleLighter
, v
) == 0 ||
740 strcmpiW(style100
, v
) == 0 || strcmpiW(style200
, v
) == 0 ||
741 strcmpiW(style300
, v
) == 0 || strcmpiW(style400
, v
) == 0 ||
742 strcmpiW(style500
, v
) == 0 || strcmpiW(style600
, v
) == 0 ||
743 strcmpiW(style700
, v
) == 0 || strcmpiW(style800
, v
) == 0 ||
744 strcmpiW(style900
, v
) == 0
747 return set_nsstyle_attr(This
->nsstyle
, STYLEID_FONT_WEIGHT
, v
, 0);
753 static HRESULT WINAPI
HTMLStyle_get_fontWeight(IHTMLStyle
*iface
, BSTR
*p
)
755 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
757 TRACE("(%p)->(%p)\n", This
, p
);
759 return get_style_attr(This
, STYLEID_FONT_WEIGHT
, p
);
762 static HRESULT WINAPI
HTMLStyle_put_fontSize(IHTMLStyle
*iface
, VARIANT v
)
764 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
766 TRACE("(%p)->(v%d)\n", This
, V_VT(&v
));
770 return set_style_attr(This
, STYLEID_FONT_SIZE
, V_BSTR(&v
), 0);
772 FIXME("not supported vt %d\n", V_VT(&v
));
778 static HRESULT WINAPI
HTMLStyle_get_fontSize(IHTMLStyle
*iface
, VARIANT
*p
)
780 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
782 TRACE("(%p)->(%p)\n", This
, p
);
785 return get_style_attr(This
, STYLEID_FONT_SIZE
, &V_BSTR(p
));
788 static HRESULT WINAPI
HTMLStyle_put_font(IHTMLStyle
*iface
, BSTR v
)
790 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
791 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
795 static HRESULT WINAPI
HTMLStyle_get_font(IHTMLStyle
*iface
, BSTR
*p
)
797 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
798 FIXME("(%p)->(%p)\n", This
, p
);
802 static HRESULT WINAPI
HTMLStyle_put_color(IHTMLStyle
*iface
, VARIANT v
)
804 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
806 TRACE("(%p)->(v%d)\n", This
, V_VT(&v
));
810 TRACE("%s\n", debugstr_w(V_BSTR(&v
)));
811 return set_style_attr(This
, STYLEID_COLOR
, V_BSTR(&v
), 0);
814 FIXME("unsupported vt=%d\n", V_VT(&v
));
820 static HRESULT WINAPI
HTMLStyle_get_color(IHTMLStyle
*iface
, VARIANT
*p
)
822 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
824 TRACE("(%p)->(%p)\n", This
, p
);
827 return get_style_attr(This
, STYLEID_COLOR
, &V_BSTR(p
));
830 static HRESULT WINAPI
HTMLStyle_put_background(IHTMLStyle
*iface
, BSTR v
)
832 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
834 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
836 return set_style_attr(This
, STYLEID_BACKGROUND
, v
, 0);
839 static HRESULT WINAPI
HTMLStyle_get_background(IHTMLStyle
*iface
, BSTR
*p
)
841 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
843 TRACE("(%p)->(%p)\n", This
, p
);
845 return get_style_attr(This
, STYLEID_BACKGROUND
, p
);
848 static HRESULT WINAPI
HTMLStyle_put_backgroundColor(IHTMLStyle
*iface
, VARIANT v
)
850 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
852 TRACE("(%p)->(v%d)\n", This
, V_VT(&v
));
856 return set_style_attr(This
, STYLEID_BACKGROUND_COLOR
, V_BSTR(&v
), 0);
859 static const WCHAR format
[] = {'#','%','0','6','x',0};
861 wsprintfW(value
, format
, V_I4(&v
));
862 return set_style_attr(This
, STYLEID_BACKGROUND_COLOR
, value
, 0);
865 FIXME("unsupported vt %d\n", V_VT(&v
));
871 static HRESULT WINAPI
HTMLStyle_get_backgroundColor(IHTMLStyle
*iface
, VARIANT
*p
)
873 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
874 TRACE("(%p)->(%p)\n", This
, p
);
877 return get_style_attr(This
, STYLEID_BACKGROUND_COLOR
, &V_BSTR(p
));
880 static HRESULT WINAPI
HTMLStyle_put_backgroundImage(IHTMLStyle
*iface
, BSTR v
)
882 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
884 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
886 return set_style_attr(This
, STYLEID_BACKGROUND_IMAGE
, v
, ATTR_FIX_URL
);
889 static HRESULT WINAPI
HTMLStyle_get_backgroundImage(IHTMLStyle
*iface
, BSTR
*p
)
891 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
893 TRACE("(%p)->(%p)\n", This
, p
);
895 return get_style_attr(This
, STYLEID_BACKGROUND_IMAGE
, p
);
898 static HRESULT WINAPI
HTMLStyle_put_backgroundRepeat(IHTMLStyle
*iface
, BSTR v
)
900 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
901 static const WCHAR styleRepeat
[] = {'r','e','p','e','a','t',0};
902 static const WCHAR styleNoRepeat
[] = {'n','o','-','r','e','p','e','a','t',0};
903 static const WCHAR styleRepeatX
[] = {'r','e','p','e','a','t','-','x',0};
904 static const WCHAR styleRepeatY
[] = {'r','e','p','e','a','t','-','y',0};
906 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
908 /* fontWeight can only be one of the following */
909 if(!v
|| strcmpiW(styleRepeat
, v
) == 0 || strcmpiW(styleNoRepeat
, v
) == 0 ||
910 strcmpiW(styleRepeatX
, v
) == 0 || strcmpiW(styleRepeatY
, v
) == 0 )
912 return set_style_attr(This
, STYLEID_BACKGROUND_REPEAT
, v
, 0);
918 static HRESULT WINAPI
HTMLStyle_get_backgroundRepeat(IHTMLStyle
*iface
, BSTR
*p
)
920 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
922 TRACE("(%p)->(%p)\n", This
, p
);
924 return get_style_attr(This
, STYLEID_BACKGROUND_REPEAT
, p
);
927 static HRESULT WINAPI
HTMLStyle_put_backgroundAttachment(IHTMLStyle
*iface
, BSTR v
)
929 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
930 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
934 static HRESULT WINAPI
HTMLStyle_get_backgroundAttachment(IHTMLStyle
*iface
, BSTR
*p
)
936 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
937 FIXME("(%p)->(%p)\n", This
, p
);
941 static HRESULT WINAPI
HTMLStyle_put_backgroundPosition(IHTMLStyle
*iface
, BSTR v
)
943 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
944 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
948 static HRESULT WINAPI
HTMLStyle_get_backgroundPosition(IHTMLStyle
*iface
, BSTR
*p
)
950 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
951 FIXME("(%p)->(%p)\n", This
, p
);
955 static HRESULT WINAPI
HTMLStyle_put_backgroundPositionX(IHTMLStyle
*iface
, VARIANT v
)
957 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
958 TRACE("(%p)->(v%d)\n", This
, V_VT(&v
));
959 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_BACKGROUND_POSITION_X
, &v
, 0);
962 static HRESULT WINAPI
HTMLStyle_get_backgroundPositionX(IHTMLStyle
*iface
, VARIANT
*p
)
964 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
965 TRACE("(%p)->(%p)\n", This
, p
);
966 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_BACKGROUND_POSITION_X
, p
, 0);
969 static HRESULT WINAPI
HTMLStyle_put_backgroundPositionY(IHTMLStyle
*iface
, VARIANT v
)
971 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
972 TRACE("(%p)->(v%d)\n", This
, V_VT(&v
));
973 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_BACKGROUND_POSITION_Y
, &v
, 0);
976 static HRESULT WINAPI
HTMLStyle_get_backgroundPositionY(IHTMLStyle
*iface
, VARIANT
*p
)
978 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
979 TRACE("(%p)->(%p)\n", This
, p
);
980 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_BACKGROUND_POSITION_Y
, p
, 0);
983 static HRESULT WINAPI
HTMLStyle_put_wordSpacing(IHTMLStyle
*iface
, VARIANT v
)
985 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
986 TRACE("(%p)->(v%d)\n", This
, V_VT(&v
));
987 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_WORD_SPACING
, &v
, 0);
990 static HRESULT WINAPI
HTMLStyle_get_wordSpacing(IHTMLStyle
*iface
, VARIANT
*p
)
992 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
993 TRACE("(%p)->(%p)\n", This
, p
);
994 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_WORD_SPACING
, p
, 0);
997 static HRESULT WINAPI
HTMLStyle_put_letterSpacing(IHTMLStyle
*iface
, VARIANT v
)
999 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1000 TRACE("(%p)->(v%d)\n", This
, V_VT(&v
));
1001 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_LETTER_SPACING
, &v
, 0);
1004 static HRESULT WINAPI
HTMLStyle_get_letterSpacing(IHTMLStyle
*iface
, VARIANT
*p
)
1006 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1007 TRACE("(%p)->(%p)\n", This
, p
);
1008 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_LETTER_SPACING
, p
, 0);
1011 static HRESULT WINAPI
HTMLStyle_put_textDecoration(IHTMLStyle
*iface
, BSTR v
)
1013 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1015 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1017 /* textDecoration can only be one of the following */
1018 if(!v
|| strcmpiW(styleNone
, v
) == 0 || strcmpiW(valUnderline
, v
) == 0 ||
1019 strcmpiW(valOverline
, v
) == 0 || strcmpiW(valLineThrough
, v
) == 0 ||
1020 strcmpiW(valBlink
, v
) == 0)
1022 return set_style_attr(This
, STYLEID_TEXT_DECORATION
, v
, 0);
1025 return E_INVALIDARG
;
1028 static HRESULT WINAPI
HTMLStyle_get_textDecoration(IHTMLStyle
*iface
, BSTR
*p
)
1030 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1032 TRACE("(%p)->(%p)\n", This
, p
);
1034 return get_style_attr(This
, STYLEID_TEXT_DECORATION
, p
);
1037 static HRESULT WINAPI
HTMLStyle_put_textDecorationNone(IHTMLStyle
*iface
, VARIANT_BOOL v
)
1039 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1041 TRACE("(%p)->(%x)\n", This
, v
);
1043 return set_style_attr(This
, STYLEID_TEXT_DECORATION
, v
? styleNone
: emptyW
, 0);
1046 static HRESULT WINAPI
HTMLStyle_get_textDecorationNone(IHTMLStyle
*iface
, VARIANT_BOOL
*p
)
1048 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1050 TRACE("(%p)->(%p)\n", This
, p
);
1052 return check_style_attr_value(This
, STYLEID_TEXT_DECORATION
, styleNone
, p
);
1055 static HRESULT WINAPI
HTMLStyle_put_textDecorationUnderline(IHTMLStyle
*iface
, VARIANT_BOOL v
)
1057 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1059 TRACE("(%p)->(%x)\n", This
, v
);
1061 return set_style_attr(This
, STYLEID_TEXT_DECORATION
, v
? valUnderline
: emptyW
, 0);
1064 static HRESULT WINAPI
HTMLStyle_get_textDecorationUnderline(IHTMLStyle
*iface
, VARIANT_BOOL
*p
)
1066 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1068 TRACE("(%p)->(%p)\n", This
, p
);
1070 return check_style_attr_value(This
, STYLEID_TEXT_DECORATION
, valUnderline
, p
);
1073 static HRESULT WINAPI
HTMLStyle_put_textDecorationOverline(IHTMLStyle
*iface
, VARIANT_BOOL v
)
1075 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1077 TRACE("(%p)->(%x)\n", This
, v
);
1079 return set_style_attr(This
, STYLEID_TEXT_DECORATION
, v
? valOverline
: emptyW
, 0);
1082 static HRESULT WINAPI
HTMLStyle_get_textDecorationOverline(IHTMLStyle
*iface
, VARIANT_BOOL
*p
)
1084 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1086 TRACE("(%p)->(%p)\n", This
, p
);
1088 return check_style_attr_value(This
, STYLEID_TEXT_DECORATION
, valOverline
, p
);
1091 static HRESULT WINAPI
HTMLStyle_put_textDecorationLineThrough(IHTMLStyle
*iface
, VARIANT_BOOL v
)
1093 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1095 TRACE("(%p)->(%x)\n", This
, v
);
1097 return set_style_attr(This
, STYLEID_TEXT_DECORATION
, v
? valLineThrough
: emptyW
, 0);
1100 static HRESULT WINAPI
HTMLStyle_get_textDecorationLineThrough(IHTMLStyle
*iface
, VARIANT_BOOL
*p
)
1102 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1104 TRACE("(%p)->(%p)\n", This
, p
);
1106 return check_style_attr_value(This
, STYLEID_TEXT_DECORATION
, valLineThrough
, p
);
1109 static HRESULT WINAPI
HTMLStyle_put_textDecorationBlink(IHTMLStyle
*iface
, VARIANT_BOOL v
)
1111 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1113 TRACE("(%p)->(%x)\n", This
, v
);
1115 return set_style_attr(This
, STYLEID_TEXT_DECORATION
, v
? valBlink
: emptyW
, 0);
1118 static HRESULT WINAPI
HTMLStyle_get_textDecorationBlink(IHTMLStyle
*iface
, VARIANT_BOOL
*p
)
1120 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1122 TRACE("(%p)->(%p)\n", This
, p
);
1124 return check_style_attr_value(This
, STYLEID_TEXT_DECORATION
, valBlink
, p
);
1127 static HRESULT WINAPI
HTMLStyle_put_verticalAlign(IHTMLStyle
*iface
, VARIANT v
)
1129 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1131 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1135 return set_style_attr(This
, STYLEID_VERTICAL_ALIGN
, V_BSTR(&v
), 0);
1137 FIXME("not implemented vt %d\n", V_VT(&v
));
1144 static HRESULT WINAPI
HTMLStyle_get_verticalAlign(IHTMLStyle
*iface
, VARIANT
*p
)
1146 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1150 TRACE("(%p)->(%p)\n", This
, p
);
1152 hres
= get_style_attr(This
, STYLEID_VERTICAL_ALIGN
, &ret
);
1161 static HRESULT WINAPI
HTMLStyle_put_textTransform(IHTMLStyle
*iface
, BSTR v
)
1163 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1164 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1168 static HRESULT WINAPI
HTMLStyle_get_textTransform(IHTMLStyle
*iface
, BSTR
*p
)
1170 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1171 FIXME("(%p)->(%p)\n", This
, p
);
1175 static HRESULT WINAPI
HTMLStyle_put_textAlign(IHTMLStyle
*iface
, BSTR v
)
1177 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1179 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1181 return set_style_attr(This
, STYLEID_TEXT_ALIGN
, v
, 0);
1184 static HRESULT WINAPI
HTMLStyle_get_textAlign(IHTMLStyle
*iface
, BSTR
*p
)
1186 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1188 TRACE("(%p)->(%p)\n", This
, p
);
1190 return get_style_attr(This
, STYLEID_TEXT_ALIGN
, p
);
1193 static HRESULT WINAPI
HTMLStyle_put_textIndent(IHTMLStyle
*iface
, VARIANT v
)
1195 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1196 FIXME("(%p)->(v%d)\n", This
, V_VT(&v
));
1200 static HRESULT WINAPI
HTMLStyle_get_textIndent(IHTMLStyle
*iface
, VARIANT
*p
)
1202 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1203 FIXME("(%p)->(%p)\n", This
, p
);
1207 static HRESULT WINAPI
HTMLStyle_put_lineHeight(IHTMLStyle
*iface
, VARIANT v
)
1209 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1210 FIXME("(%p)->(v%d)\n", This
, V_VT(&v
));
1214 static HRESULT WINAPI
HTMLStyle_get_lineHeight(IHTMLStyle
*iface
, VARIANT
*p
)
1216 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1217 FIXME("(%p)->(%p)\n", This
, p
);
1221 static HRESULT WINAPI
HTMLStyle_put_marginTop(IHTMLStyle
*iface
, VARIANT v
)
1223 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1225 TRACE("(%p)->(v%d)\n", This
, V_VT(&v
));
1227 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_MARGIN_TOP
, &v
, 0);
1230 static HRESULT WINAPI
HTMLStyle_get_marginTop(IHTMLStyle
*iface
, VARIANT
*p
)
1232 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1234 TRACE("(%p)->(%p)\n", This
, p
);
1236 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_MARGIN_TOP
, p
, 0);
1239 static HRESULT WINAPI
HTMLStyle_put_marginRight(IHTMLStyle
*iface
, VARIANT v
)
1241 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1243 TRACE("(%p)->(v(%d))\n", This
, V_VT(&v
));
1247 return set_style_attr(This
, STYLEID_MARGIN_RIGHT
, emptyW
, 0);
1251 wsprintfW(buf
, px_formatW
, V_I4(&v
));
1252 return set_style_attr(This
, STYLEID_MARGIN_RIGHT
, buf
, 0);
1255 return set_style_attr(This
, STYLEID_MARGIN_RIGHT
, V_BSTR(&v
), 0);
1257 FIXME("Unsupported vt=%d\n", V_VT(&v
));
1263 static HRESULT WINAPI
HTMLStyle_get_marginRight(IHTMLStyle
*iface
, VARIANT
*p
)
1265 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1266 TRACE("(%p)->(%p)\n", This
, p
);
1267 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_MARGIN_RIGHT
, p
, 0);
1270 static HRESULT WINAPI
HTMLStyle_put_marginBottom(IHTMLStyle
*iface
, VARIANT v
)
1272 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1273 FIXME("(%p)->(v%d)\n", This
, V_VT(&v
));
1277 static HRESULT WINAPI
HTMLStyle_get_marginBottom(IHTMLStyle
*iface
, VARIANT
*p
)
1279 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1280 FIXME("(%p)->(%p)\n", This
, p
);
1284 static HRESULT WINAPI
HTMLStyle_put_marginLeft(IHTMLStyle
*iface
, VARIANT v
)
1286 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1290 TRACE("(%p)->(NULL)\n", This
);
1291 return set_style_attr(This
, STYLEID_MARGIN_LEFT
, emptyW
, 0);
1295 TRACE("(%p)->(%d)\n", This
, V_I4(&v
));
1297 wsprintfW(buf
, px_formatW
, V_I4(&v
));
1298 return set_style_attr(This
, STYLEID_MARGIN_LEFT
, buf
, 0);
1301 TRACE("(%p)->(%s)\n", This
, debugstr_w(V_BSTR(&v
)));
1302 return set_style_attr(This
, STYLEID_MARGIN_LEFT
, V_BSTR(&v
), 0);
1304 FIXME("Unsupported vt=%d\n", V_VT(&v
));
1310 static HRESULT WINAPI
HTMLStyle_put_margin(IHTMLStyle
*iface
, BSTR v
)
1312 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1314 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1316 return set_style_attr(This
, STYLEID_MARGIN
, v
, 0);
1319 static HRESULT WINAPI
HTMLStyle_get_margin(IHTMLStyle
*iface
, BSTR
*p
)
1321 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1323 TRACE("(%p)->(%p)\n", This
, p
);
1325 return get_style_attr(This
, STYLEID_MARGIN
, p
);
1328 static HRESULT WINAPI
HTMLStyle_get_marginLeft(IHTMLStyle
*iface
, VARIANT
*p
)
1330 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1331 TRACE("(%p)->(%p)\n", This
, p
);
1332 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_MARGIN_LEFT
, p
, 0);
1335 static HRESULT WINAPI
HTMLStyle_put_paddingTop(IHTMLStyle
*iface
, VARIANT v
)
1337 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1338 FIXME("(%p)->(v%d)\n", This
, V_VT(&v
));
1342 static HRESULT WINAPI
HTMLStyle_get_paddingTop(IHTMLStyle
*iface
, VARIANT
*p
)
1344 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1345 FIXME("(%p)->(%p)\n", This
, p
);
1349 static HRESULT WINAPI
HTMLStyle_put_paddingRight(IHTMLStyle
*iface
, VARIANT v
)
1351 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1352 FIXME("(%p)->(v%d)\n", This
, V_VT(&v
));
1356 static HRESULT WINAPI
HTMLStyle_get_paddingRight(IHTMLStyle
*iface
, VARIANT
*p
)
1358 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1359 FIXME("(%p)->(%p)\n", This
, p
);
1363 static HRESULT WINAPI
HTMLStyle_put_paddingBottom(IHTMLStyle
*iface
, VARIANT v
)
1365 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1366 FIXME("(%p)->(v%d)\n", This
, V_VT(&v
));
1370 static HRESULT WINAPI
HTMLStyle_get_paddingBottom(IHTMLStyle
*iface
, VARIANT
*p
)
1372 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1373 FIXME("(%p)->(%p)\n", This
, p
);
1377 static HRESULT WINAPI
HTMLStyle_put_paddingLeft(IHTMLStyle
*iface
, VARIANT v
)
1379 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1381 TRACE("(%p)->(vt=%d)\n", This
, V_VT(&v
));
1387 wsprintfW(buf
, px_formatW
, V_I4(&v
));
1388 return set_style_attr(This
, STYLEID_PADDING_LEFT
, buf
, 0);
1391 return set_style_attr(This
, STYLEID_PADDING_LEFT
, V_BSTR(&v
), 0);
1393 FIXME("unsupported vt=%d\n", V_VT(&v
));
1399 static HRESULT WINAPI
HTMLStyle_get_paddingLeft(IHTMLStyle
*iface
, VARIANT
*p
)
1401 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1405 TRACE("(%p)->(%p)\n", This
, p
);
1407 hres
= get_style_attr(This
, STYLEID_PADDING_LEFT
, &ret
);
1416 static HRESULT WINAPI
HTMLStyle_put_padding(IHTMLStyle
*iface
, BSTR v
)
1418 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1419 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1423 static HRESULT WINAPI
HTMLStyle_get_padding(IHTMLStyle
*iface
, BSTR
*p
)
1425 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1426 FIXME("(%p)->(%p)\n", This
, p
);
1430 static HRESULT WINAPI
HTMLStyle_put_border(IHTMLStyle
*iface
, BSTR v
)
1432 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1434 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1436 return set_style_attr(This
, STYLEID_BORDER
, v
, 0);
1439 static HRESULT WINAPI
HTMLStyle_get_border(IHTMLStyle
*iface
, BSTR
*p
)
1441 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1443 TRACE("(%p)->(%p)\n", This
, p
);
1445 return get_style_attr(This
, STYLEID_BORDER
, p
);
1448 static HRESULT WINAPI
HTMLStyle_put_borderTop(IHTMLStyle
*iface
, BSTR v
)
1450 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1451 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1452 return set_style_attr(This
, STYLEID_BORDER_TOP
, v
, ATTR_FIX_PX
);
1455 static HRESULT WINAPI
HTMLStyle_get_borderTop(IHTMLStyle
*iface
, BSTR
*p
)
1457 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1458 TRACE("(%p)->(%p)\n", This
, p
);
1459 return get_style_attr(This
, STYLEID_BORDER_TOP
, p
);
1462 static HRESULT WINAPI
HTMLStyle_put_borderRight(IHTMLStyle
*iface
, BSTR v
)
1464 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1465 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1466 return set_style_attr(This
, STYLEID_BORDER_RIGHT
, v
, ATTR_FIX_PX
);
1469 static HRESULT WINAPI
HTMLStyle_get_borderRight(IHTMLStyle
*iface
, BSTR
*p
)
1471 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1472 TRACE("(%p)->(%p)\n", This
, p
);
1473 return get_style_attr(This
, STYLEID_BORDER_RIGHT
, p
);
1476 static HRESULT WINAPI
HTMLStyle_put_borderBottom(IHTMLStyle
*iface
, BSTR v
)
1478 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1479 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1480 return set_style_attr(This
, STYLEID_BORDER_BOTTOM
, v
, ATTR_FIX_PX
);
1483 static HRESULT WINAPI
HTMLStyle_get_borderBottom(IHTMLStyle
*iface
, BSTR
*p
)
1485 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1486 TRACE("(%p)->(%p)\n", This
, p
);
1487 return get_style_attr(This
, STYLEID_BORDER_BOTTOM
, p
);
1490 static HRESULT WINAPI
HTMLStyle_put_borderLeft(IHTMLStyle
*iface
, BSTR v
)
1492 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1494 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1496 return set_style_attr(This
, STYLEID_BORDER_LEFT
, v
, ATTR_FIX_PX
);
1499 static HRESULT WINAPI
HTMLStyle_get_borderLeft(IHTMLStyle
*iface
, BSTR
*p
)
1501 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1503 TRACE("(%p)->(%p)\n", This
, p
);
1505 return get_style_attr(This
, STYLEID_BORDER_LEFT
, p
);
1508 static HRESULT WINAPI
HTMLStyle_put_borderColor(IHTMLStyle
*iface
, BSTR v
)
1510 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1512 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1514 return set_style_attr(This
, STYLEID_BORDER_COLOR
, v
, 0);
1517 static HRESULT WINAPI
HTMLStyle_get_borderColor(IHTMLStyle
*iface
, BSTR
*p
)
1519 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1521 TRACE("(%p)->(%p)\n", This
, p
);
1523 return get_style_attr(This
, STYLEID_BORDER_COLOR
, p
);
1526 static HRESULT WINAPI
HTMLStyle_put_borderTopColor(IHTMLStyle
*iface
, VARIANT v
)
1528 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1529 FIXME("(%p)->(v%d)\n", This
, V_VT(&v
));
1533 static HRESULT WINAPI
HTMLStyle_get_borderTopColor(IHTMLStyle
*iface
, VARIANT
*p
)
1535 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1536 FIXME("(%p)->(%p)\n", This
, p
);
1540 static HRESULT WINAPI
HTMLStyle_put_borderRightColor(IHTMLStyle
*iface
, VARIANT v
)
1542 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1543 FIXME("(%p)->(v%d)\n", This
, V_VT(&v
));
1547 static HRESULT WINAPI
HTMLStyle_get_borderRightColor(IHTMLStyle
*iface
, VARIANT
*p
)
1549 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1550 FIXME("(%p)->(%p)\n", This
, p
);
1554 static HRESULT WINAPI
HTMLStyle_put_borderBottomColor(IHTMLStyle
*iface
, VARIANT v
)
1556 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1557 FIXME("(%p)->(v%d)\n", This
, V_VT(&v
));
1561 static HRESULT WINAPI
HTMLStyle_get_borderBottomColor(IHTMLStyle
*iface
, VARIANT
*p
)
1563 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1564 FIXME("(%p)->(%p)\n", This
, p
);
1568 static HRESULT WINAPI
HTMLStyle_put_borderLeftColor(IHTMLStyle
*iface
, VARIANT v
)
1570 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1571 FIXME("(%p)->(v%d)\n", This
, V_VT(&v
));
1575 static HRESULT WINAPI
HTMLStyle_get_borderLeftColor(IHTMLStyle
*iface
, VARIANT
*p
)
1577 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1578 FIXME("(%p)->(%p)\n", This
, p
);
1582 static HRESULT WINAPI
HTMLStyle_put_borderWidth(IHTMLStyle
*iface
, BSTR v
)
1584 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1585 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1586 return set_style_attr(This
, STYLEID_BORDER_WIDTH
, v
, ATTR_FIX_PX
);
1589 static HRESULT WINAPI
HTMLStyle_get_borderWidth(IHTMLStyle
*iface
, BSTR
*p
)
1591 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1592 TRACE("(%p)->(%p)\n", This
, p
);
1593 return get_style_attr(This
, STYLEID_BORDER_WIDTH
, p
);
1596 static HRESULT WINAPI
HTMLStyle_put_borderTopWidth(IHTMLStyle
*iface
, VARIANT v
)
1598 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1599 TRACE("(%p)->(v%d)\n", This
, V_VT(&v
));
1600 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_TOP_WIDTH
, &v
, 0);
1603 static HRESULT WINAPI
HTMLStyle_get_borderTopWidth(IHTMLStyle
*iface
, VARIANT
*p
)
1605 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1607 TRACE("(%p)->(%p)\n", This
, p
);
1609 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_TOP_WIDTH
, p
, 0);
1612 static HRESULT WINAPI
HTMLStyle_put_borderRightWidth(IHTMLStyle
*iface
, VARIANT v
)
1614 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1615 TRACE("(%p)->(v%d)\n", This
, V_VT(&v
));
1616 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_RIGHT_WIDTH
, &v
, 0);
1619 static HRESULT WINAPI
HTMLStyle_get_borderRightWidth(IHTMLStyle
*iface
, VARIANT
*p
)
1621 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1622 TRACE("(%p)->(%p)\n", This
, p
);
1623 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_RIGHT_WIDTH
, p
, 0);
1626 static HRESULT WINAPI
HTMLStyle_put_borderBottomWidth(IHTMLStyle
*iface
, VARIANT v
)
1628 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1630 TRACE("(%p)->(v%d)\n", This
, V_VT(&v
));
1631 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_BOTTOM_WIDTH
, &v
, 0);
1634 static HRESULT WINAPI
HTMLStyle_get_borderBottomWidth(IHTMLStyle
*iface
, VARIANT
*p
)
1636 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1637 TRACE("(%p)->(%p)\n", This
, p
);
1638 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_BOTTOM_WIDTH
, p
, 0);
1641 static HRESULT WINAPI
HTMLStyle_put_borderLeftWidth(IHTMLStyle
*iface
, VARIANT v
)
1643 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1644 TRACE("(%p)->(v%d)\n", This
, V_VT(&v
));
1645 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_LEFT_WIDTH
, &v
, 0);
1648 static HRESULT WINAPI
HTMLStyle_get_borderLeftWidth(IHTMLStyle
*iface
, VARIANT
*p
)
1650 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1651 TRACE("(%p)->(%p)\n", This
, p
);
1652 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_LEFT_WIDTH
, p
, 0);
1655 static HRESULT WINAPI
HTMLStyle_put_borderStyle(IHTMLStyle
*iface
, BSTR v
)
1657 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1658 static const WCHAR styleWindowInset
[] = {'w','i','n','d','o','w','-','i','n','s','e','t',0};
1659 HRESULT hres
= S_OK
;
1664 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1666 while(v
[i
] && hres
== S_OK
)
1668 if(v
[i
] == (WCHAR
)' ')
1670 pstyle
= SysAllocStringLen(&v
[last
], (i
-last
));
1671 if( !(is_valid_border_style(pstyle
) || strcmpiW(styleWindowInset
, pstyle
) == 0))
1673 TRACE("1. Invalid style (%s)\n", debugstr_w(pstyle
));
1674 hres
= E_INVALIDARG
;
1676 SysFreeString(pstyle
);
1684 pstyle
= SysAllocStringLen(&v
[last
], i
-last
);
1685 if( !(is_valid_border_style(pstyle
) || strcmpiW(styleWindowInset
, pstyle
) == 0))
1687 TRACE("2. Invalid style (%s)\n", debugstr_w(pstyle
));
1688 hres
= E_INVALIDARG
;
1690 SysFreeString(pstyle
);
1694 hres
= set_nsstyle_attr(This
->nsstyle
, STYLEID_BORDER_STYLE
, v
, 0);
1699 static HRESULT WINAPI
HTMLStyle_get_borderStyle(IHTMLStyle
*iface
, BSTR
*p
)
1701 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1702 TRACE("(%p)->(%p)\n", This
, p
);
1703 return get_style_attr(This
, STYLEID_BORDER_STYLE
, p
);
1706 static HRESULT WINAPI
HTMLStyle_put_borderTopStyle(IHTMLStyle
*iface
, BSTR v
)
1708 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1709 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1711 if(!is_valid_border_style(v
))
1712 return E_INVALIDARG
;
1714 return set_style_attr(This
, STYLEID_BORDER_TOP_STYLE
, v
, 0);
1717 static HRESULT WINAPI
HTMLStyle_get_borderTopStyle(IHTMLStyle
*iface
, BSTR
*p
)
1719 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1720 TRACE("(%p)->(%p)\n", This
, p
);
1721 return get_style_attr(This
, STYLEID_BORDER_TOP_STYLE
, p
);
1724 static HRESULT WINAPI
HTMLStyle_put_borderRightStyle(IHTMLStyle
*iface
, BSTR v
)
1726 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1727 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1729 if(!is_valid_border_style(v
))
1730 return E_INVALIDARG
;
1732 return set_style_attr(This
, STYLEID_BORDER_RIGHT_STYLE
, v
, 0);
1735 static HRESULT WINAPI
HTMLStyle_get_borderRightStyle(IHTMLStyle
*iface
, BSTR
*p
)
1737 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1738 TRACE("(%p)->(%p)\n", This
, p
);
1739 return get_style_attr(This
, STYLEID_BORDER_RIGHT_STYLE
, p
);
1742 static HRESULT WINAPI
HTMLStyle_put_borderBottomStyle(IHTMLStyle
*iface
, BSTR v
)
1744 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1745 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1747 if(!is_valid_border_style(v
))
1748 return E_INVALIDARG
;
1750 return set_style_attr(This
, STYLEID_BORDER_BOTTOM_STYLE
, v
, 0);
1753 static HRESULT WINAPI
HTMLStyle_get_borderBottomStyle(IHTMLStyle
*iface
, BSTR
*p
)
1755 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1756 TRACE("(%p)->(%p)\n", This
, p
);
1757 return get_style_attr(This
, STYLEID_BORDER_BOTTOM_STYLE
, p
);
1760 static HRESULT WINAPI
HTMLStyle_put_borderLeftStyle(IHTMLStyle
*iface
, BSTR v
)
1762 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1763 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1765 if(!is_valid_border_style(v
))
1766 return E_INVALIDARG
;
1768 return set_style_attr(This
, STYLEID_BORDER_LEFT_STYLE
, v
, 0);
1771 static HRESULT WINAPI
HTMLStyle_get_borderLeftStyle(IHTMLStyle
*iface
, BSTR
*p
)
1773 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1774 TRACE("(%p)->(%p)\n", This
, p
);
1775 return get_style_attr(This
, STYLEID_BORDER_LEFT_STYLE
, p
);
1778 static HRESULT WINAPI
HTMLStyle_put_width(IHTMLStyle
*iface
, VARIANT v
)
1780 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1782 TRACE("(%p)->(v%d)\n", This
, V_VT(&v
));
1784 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_WIDTH
, &v
, ATTR_FIX_PX
);
1787 static HRESULT WINAPI
HTMLStyle_get_width(IHTMLStyle
*iface
, VARIANT
*p
)
1789 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1791 TRACE("(%p)->(%p)\n", This
, p
);
1794 return get_style_attr(This
, STYLEID_WIDTH
, &V_BSTR(p
));
1797 static HRESULT WINAPI
HTMLStyle_put_height(IHTMLStyle
*iface
, VARIANT v
)
1799 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1801 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1805 return set_style_attr(This
, STYLEID_HEIGHT
, V_BSTR(&v
), 0);
1807 FIXME("unimplemented vt %d\n", V_VT(&v
));
1814 static HRESULT WINAPI
HTMLStyle_get_height(IHTMLStyle
*iface
, VARIANT
*p
)
1816 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1820 TRACE("(%p)->(%p)\n", This
, p
);
1822 hres
= get_style_attr(This
, STYLEID_HEIGHT
, &ret
);
1831 static HRESULT WINAPI
HTMLStyle_put_styleFloat(IHTMLStyle
*iface
, BSTR v
)
1833 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1834 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1838 static HRESULT WINAPI
HTMLStyle_get_styleFloat(IHTMLStyle
*iface
, BSTR
*p
)
1840 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1841 FIXME("(%p)->(%p)\n", This
, p
);
1845 static HRESULT WINAPI
HTMLStyle_put_clear(IHTMLStyle
*iface
, BSTR v
)
1847 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1848 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1852 static HRESULT WINAPI
HTMLStyle_get_clear(IHTMLStyle
*iface
, BSTR
*p
)
1854 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1855 FIXME("(%p)->(%p)\n", This
, p
);
1859 static HRESULT WINAPI
HTMLStyle_put_display(IHTMLStyle
*iface
, BSTR v
)
1861 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1863 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1865 return set_style_attr(This
, STYLEID_DISPLAY
, v
, 0);
1868 static HRESULT WINAPI
HTMLStyle_get_display(IHTMLStyle
*iface
, BSTR
*p
)
1870 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1872 TRACE("(%p)->(%p)\n", This
, p
);
1874 return get_style_attr(This
, STYLEID_DISPLAY
, p
);
1877 static HRESULT WINAPI
HTMLStyle_put_visibility(IHTMLStyle
*iface
, BSTR v
)
1879 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1881 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1883 return set_style_attr(This
, STYLEID_VISIBILITY
, v
, 0);
1886 static HRESULT WINAPI
HTMLStyle_get_visibility(IHTMLStyle
*iface
, BSTR
*p
)
1888 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1890 TRACE("(%p)->(%p)\n", This
, p
);
1892 return get_style_attr(This
, STYLEID_VISIBILITY
, p
);
1895 static HRESULT WINAPI
HTMLStyle_put_listStyleType(IHTMLStyle
*iface
, BSTR v
)
1897 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1898 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1902 static HRESULT WINAPI
HTMLStyle_get_listStyleType(IHTMLStyle
*iface
, BSTR
*p
)
1904 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1905 FIXME("(%p)->(%p)\n", This
, p
);
1909 static HRESULT WINAPI
HTMLStyle_put_listStylePosition(IHTMLStyle
*iface
, BSTR v
)
1911 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1912 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1916 static HRESULT WINAPI
HTMLStyle_get_listStylePosition(IHTMLStyle
*iface
, BSTR
*p
)
1918 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1919 FIXME("(%p)->(%p)\n", This
, p
);
1923 static HRESULT WINAPI
HTMLStyle_put_listStyleImage(IHTMLStyle
*iface
, BSTR v
)
1925 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1926 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1930 static HRESULT WINAPI
HTMLStyle_get_listStyleImage(IHTMLStyle
*iface
, BSTR
*p
)
1932 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1933 FIXME("(%p)->(%p)\n", This
, p
);
1937 static HRESULT WINAPI
HTMLStyle_put_listStyle(IHTMLStyle
*iface
, BSTR v
)
1939 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1940 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1944 static HRESULT WINAPI
HTMLStyle_get_listStyle(IHTMLStyle
*iface
, BSTR
*p
)
1946 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1947 FIXME("(%p)->(%p)\n", This
, p
);
1951 static HRESULT WINAPI
HTMLStyle_put_whiteSpace(IHTMLStyle
*iface
, BSTR v
)
1953 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1954 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1958 static HRESULT WINAPI
HTMLStyle_get_whiteSpace(IHTMLStyle
*iface
, BSTR
*p
)
1960 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1961 FIXME("(%p)->(%p)\n", This
, p
);
1965 static HRESULT WINAPI
HTMLStyle_put_top(IHTMLStyle
*iface
, VARIANT v
)
1967 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1969 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1971 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_TOP
, &v
, 0);
1974 static HRESULT WINAPI
HTMLStyle_get_top(IHTMLStyle
*iface
, VARIANT
*p
)
1976 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1980 TRACE("(%p)->(%p)\n", This
, p
);
1982 hres
= get_style_attr(This
, STYLEID_TOP
, &ret
);
1991 static HRESULT WINAPI
HTMLStyle_put_left(IHTMLStyle
*iface
, VARIANT v
)
1993 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1995 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1997 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_LEFT
, &v
, 0);
2000 static HRESULT WINAPI
HTMLStyle_get_left(IHTMLStyle
*iface
, VARIANT
*p
)
2002 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2006 TRACE("(%p)->(%p)\n", This
, p
);
2008 hres
= get_style_attr(This
, STYLEID_LEFT
, &ret
);
2017 static HRESULT WINAPI
HTMLStyle_get_position(IHTMLStyle
*iface
, BSTR
*p
)
2019 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2020 TRACE("(%p)->(%p)\n", This
, p
);
2021 return IHTMLStyle2_get_position(HTMLSTYLE2(This
), p
);
2024 static HRESULT WINAPI
HTMLStyle_put_zIndex(IHTMLStyle
*iface
, VARIANT v
)
2026 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2028 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2032 return set_style_attr(This
, STYLEID_Z_INDEX
, V_BSTR(&v
), 0);
2035 static const WCHAR format
[] = {'%','d',0};
2037 wsprintfW(value
, format
, V_I4(&v
));
2038 return set_style_attr(This
, STYLEID_Z_INDEX
, value
, 0);
2041 FIXME("unimplemented vt %d\n", V_VT(&v
));
2048 static HRESULT WINAPI
HTMLStyle_get_zIndex(IHTMLStyle
*iface
, VARIANT
*p
)
2050 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2052 TRACE("(%p)->(%p)\n", This
, p
);
2054 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_Z_INDEX
, p
, ATTR_STR_TO_INT
);
2057 static HRESULT WINAPI
HTMLStyle_put_overflow(IHTMLStyle
*iface
, BSTR v
)
2059 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2060 static const WCHAR szVisible
[] = {'v','i','s','i','b','l','e',0};
2061 static const WCHAR szScroll
[] = {'s','c','r','o','l','l',0};
2062 static const WCHAR szHidden
[] = {'h','i','d','d','e','n',0};
2063 static const WCHAR szAuto
[] = {'a','u','t','o',0};
2065 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2067 /* overflow can only be one of the follow values. */
2068 if(!v
|| !*v
|| strcmpiW(szVisible
, v
) == 0 || strcmpiW(szScroll
, v
) == 0 ||
2069 strcmpiW(szHidden
, v
) == 0 || strcmpiW(szAuto
, v
) == 0)
2071 return set_nsstyle_attr(This
->nsstyle
, STYLEID_OVERFLOW
, v
, 0);
2074 return E_INVALIDARG
;
2078 static HRESULT WINAPI
HTMLStyle_get_overflow(IHTMLStyle
*iface
, BSTR
*p
)
2080 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2082 TRACE("(%p)->(%p)\n", This
, p
);
2085 return E_INVALIDARG
;
2087 return get_style_attr(This
, STYLEID_OVERFLOW
, p
);
2090 static HRESULT WINAPI
HTMLStyle_put_pageBreakBefore(IHTMLStyle
*iface
, BSTR v
)
2092 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2093 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
2097 static HRESULT WINAPI
HTMLStyle_get_pageBreakBefore(IHTMLStyle
*iface
, BSTR
*p
)
2099 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2100 FIXME("(%p)->(%p)\n", This
, p
);
2104 static HRESULT WINAPI
HTMLStyle_put_pageBreakAfter(IHTMLStyle
*iface
, BSTR v
)
2106 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2107 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
2111 static HRESULT WINAPI
HTMLStyle_get_pageBreakAfter(IHTMLStyle
*iface
, BSTR
*p
)
2113 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2114 FIXME("(%p)->(%p)\n", This
, p
);
2118 static HRESULT WINAPI
HTMLStyle_put_cssText(IHTMLStyle
*iface
, BSTR v
)
2120 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2124 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2126 nsAString_InitDepend(&text_str
, v
);
2127 nsres
= nsIDOMCSSStyleDeclaration_SetCssText(This
->nsstyle
, &text_str
);
2128 nsAString_Finish(&text_str
);
2129 if(NS_FAILED(nsres
)) {
2130 FIXME("SetCssStyle failed: %08x\n", nsres
);
2137 static HRESULT WINAPI
HTMLStyle_get_cssText(IHTMLStyle
*iface
, BSTR
*p
)
2139 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2143 TRACE("(%p)->(%p)\n", This
, p
);
2145 /* FIXME: Gecko style formatting is different than IE (uppercase). */
2146 nsAString_Init(&text_str
, NULL
);
2147 nsres
= nsIDOMCSSStyleDeclaration_GetCssText(This
->nsstyle
, &text_str
);
2148 if(NS_SUCCEEDED(nsres
)) {
2149 const PRUnichar
*text
;
2151 nsAString_GetData(&text_str
, &text
);
2152 *p
= *text
? SysAllocString(text
) : NULL
;
2154 FIXME("GetCssStyle failed: %08x\n", nsres
);
2158 nsAString_Finish(&text_str
);
2162 static HRESULT WINAPI
HTMLStyle_put_pixelTop(IHTMLStyle
*iface
, LONG v
)
2164 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2165 FIXME("(%p)->()\n", This
);
2169 static HRESULT WINAPI
HTMLStyle_get_pixelTop(IHTMLStyle
*iface
, LONG
*p
)
2171 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2172 FIXME("(%p)->()\n", This
);
2176 static HRESULT WINAPI
HTMLStyle_put_pixelLeft(IHTMLStyle
*iface
, LONG v
)
2178 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2179 FIXME("(%p)->()\n", This
);
2183 static HRESULT WINAPI
HTMLStyle_get_pixelLeft(IHTMLStyle
*iface
, LONG
*p
)
2185 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2186 FIXME("(%p)->()\n", This
);
2190 static HRESULT WINAPI
HTMLStyle_put_pixelWidth(IHTMLStyle
*iface
, LONG v
)
2192 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2193 FIXME("(%p)->()\n", This
);
2197 static HRESULT WINAPI
HTMLStyle_get_pixelWidth(IHTMLStyle
*iface
, LONG
*p
)
2199 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2200 FIXME("(%p)->()\n", This
);
2204 static HRESULT WINAPI
HTMLStyle_put_pixelHeight(IHTMLStyle
*iface
, LONG v
)
2206 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2207 FIXME("(%p)->()\n", This
);
2211 static HRESULT WINAPI
HTMLStyle_get_pixelHeight(IHTMLStyle
*iface
, LONG
*p
)
2213 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2214 FIXME("(%p)->()\n", This
);
2218 static HRESULT WINAPI
HTMLStyle_put_posTop(IHTMLStyle
*iface
, float v
)
2220 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2222 TRACE("(%p)->(%f)\n", This
, v
);
2224 return set_style_pos(This
, STYLEID_TOP
, v
);
2227 static HRESULT WINAPI
HTMLStyle_get_posTop(IHTMLStyle
*iface
, float *p
)
2229 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2231 TRACE("(%p)->(%p)\n", This
, p
);
2236 return get_nsstyle_pos(This
, STYLEID_TOP
, p
);
2239 static HRESULT WINAPI
HTMLStyle_put_posLeft(IHTMLStyle
*iface
, float v
)
2241 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2243 TRACE("(%p)->(%f)\n", This
, v
);
2245 return set_style_pos(This
, STYLEID_LEFT
, v
);
2248 static HRESULT WINAPI
HTMLStyle_get_posLeft(IHTMLStyle
*iface
, float *p
)
2250 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2252 TRACE("(%p)->(%p)\n", This
, p
);
2257 return get_nsstyle_pos(This
, STYLEID_LEFT
, p
);
2260 static HRESULT WINAPI
HTMLStyle_put_posWidth(IHTMLStyle
*iface
, float v
)
2262 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2264 TRACE("(%p)->(%f)\n", This
, v
);
2266 return set_style_pos(This
, STYLEID_WIDTH
, v
);
2269 static HRESULT WINAPI
HTMLStyle_get_posWidth(IHTMLStyle
*iface
, float *p
)
2271 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2273 TRACE("(%p)->(%p)\n", This
, p
);
2278 if(get_nsstyle_pos(This
, STYLEID_WIDTH
, p
) != S_OK
)
2284 static HRESULT WINAPI
HTMLStyle_put_posHeight(IHTMLStyle
*iface
, float v
)
2286 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2288 TRACE("(%p)->(%f)\n", This
, v
);
2290 return set_style_pos(This
, STYLEID_HEIGHT
, v
);
2293 static HRESULT WINAPI
HTMLStyle_get_posHeight(IHTMLStyle
*iface
, float *p
)
2295 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2297 TRACE("(%p)->(%p)\n", This
, p
);
2302 if(get_nsstyle_pos(This
, STYLEID_HEIGHT
, p
) != S_OK
)
2308 static HRESULT WINAPI
HTMLStyle_put_cursor(IHTMLStyle
*iface
, BSTR v
)
2310 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2312 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2314 return set_style_attr(This
, STYLEID_CURSOR
, v
, 0);
2317 static HRESULT WINAPI
HTMLStyle_get_cursor(IHTMLStyle
*iface
, BSTR
*p
)
2319 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2321 TRACE("(%p)->(%p)\n", This
, p
);
2323 return get_style_attr(This
, STYLEID_CURSOR
, p
);
2326 static HRESULT WINAPI
HTMLStyle_put_clip(IHTMLStyle
*iface
, BSTR v
)
2328 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2329 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
2333 static HRESULT WINAPI
HTMLStyle_get_clip(IHTMLStyle
*iface
, BSTR
*p
)
2335 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2336 FIXME("(%p)->(%p)\n", This
, p
);
2340 static HRESULT WINAPI
HTMLStyle_put_filter(IHTMLStyle
*iface
, BSTR v
)
2342 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2344 WARN("(%p)->(%s)\n", This
, debugstr_w(v
));
2346 /* FIXME: Handle MS-style filters */
2347 return set_style_attr(This
, STYLEID_FILTER
, v
, 0);
2350 static HRESULT WINAPI
HTMLStyle_get_filter(IHTMLStyle
*iface
, BSTR
*p
)
2352 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2354 WARN("(%p)->(%p)\n", This
, p
);
2356 /* FIXME: Handle MS-style filters */
2357 return get_style_attr(This
, STYLEID_FILTER
, p
);
2360 static HRESULT WINAPI
HTMLStyle_setAttribute(IHTMLStyle
*iface
, BSTR strAttributeName
,
2361 VARIANT AttributeValue
, LONG lFlags
)
2363 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2367 TRACE("(%p)->(%s v%d %08x)\n", This
, debugstr_w(strAttributeName
),
2368 V_VT(&AttributeValue
), lFlags
);
2370 if(!strAttributeName
)
2371 return E_INVALIDARG
;
2374 FIXME("Parameter lFlags ignored\n");
2376 hres
= HTMLStyle_GetIDsOfNames(iface
, &IID_NULL
, &strAttributeName
, 1,
2377 LOCALE_USER_DEFAULT
, &dispid
);
2381 DISPID dispidNamed
= DISPID_PROPERTYPUT
;
2385 params
.rgvarg
= &AttributeValue
;
2386 params
.cNamedArgs
= 1;
2387 params
.rgdispidNamedArgs
= &dispidNamed
;
2389 hres
= HTMLStyle_Invoke(iface
, dispid
, &IID_NULL
, LOCALE_SYSTEM_DEFAULT
,
2390 DISPATCH_PROPERTYPUT
, ¶ms
, &ret
, NULL
, NULL
);
2394 FIXME("Custom attributes not supported.\n");
2397 TRACE("ret: %08x\n", hres
);
2402 static HRESULT WINAPI
HTMLStyle_getAttribute(IHTMLStyle
*iface
, BSTR strAttributeName
,
2403 LONG lFlags
, VARIANT
*AttributeValue
)
2405 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2409 TRACE("(%p)->(%s v%p %08x)\n", This
, debugstr_w(strAttributeName
),
2410 AttributeValue
, lFlags
);
2412 if(!AttributeValue
|| !strAttributeName
)
2413 return E_INVALIDARG
;
2416 FIXME("Parameter lFlags ignored\n");
2418 hres
= HTMLStyle_GetIDsOfNames(iface
, &IID_NULL
, &strAttributeName
, 1,
2419 LOCALE_USER_DEFAULT
, &dispid
);
2422 DISPPARAMS params
= {NULL
, NULL
, 0, 0 };
2424 hres
= HTMLStyle_Invoke(iface
, dispid
, &IID_NULL
, LOCALE_SYSTEM_DEFAULT
,
2425 DISPATCH_PROPERTYGET
, ¶ms
, AttributeValue
, NULL
, NULL
);
2429 FIXME("Custom attributes not supported.\n");
2435 static HRESULT WINAPI
HTMLStyle_removeAttribute(IHTMLStyle
*iface
, BSTR strAttributeName
,
2436 LONG lFlags
, VARIANT_BOOL
*pfSuccess
)
2438 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2439 FIXME("(%p)->(%s %08x %p)\n", This
, debugstr_w(strAttributeName
),
2444 static HRESULT WINAPI
HTMLStyle_toString(IHTMLStyle
*iface
, BSTR
*String
)
2446 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2447 FIXME("(%p)->(%p)\n", This
, String
);
2451 static HRESULT
HTMLStyle_get_dispid(IUnknown
*iface
, BSTR name
, DWORD flags
, DISPID
*dispid
)
2453 int c
, i
, min
=0, max
= sizeof(style_tbl
)/sizeof(*style_tbl
)-1;
2458 c
= strcmpW(style_tbl
[i
].name
, name
);
2460 *dispid
= style_tbl
[i
].dispid
;
2470 return DISP_E_UNKNOWNNAME
;
2473 static const IHTMLStyleVtbl HTMLStyleVtbl
= {
2474 HTMLStyle_QueryInterface
,
2477 HTMLStyle_GetTypeInfoCount
,
2478 HTMLStyle_GetTypeInfo
,
2479 HTMLStyle_GetIDsOfNames
,
2481 HTMLStyle_put_fontFamily
,
2482 HTMLStyle_get_fontFamily
,
2483 HTMLStyle_put_fontStyle
,
2484 HTMLStyle_get_fontStyle
,
2485 HTMLStyle_put_fontVariant
,
2486 HTMLStyle_get_fontVariant
,
2487 HTMLStyle_put_fontWeight
,
2488 HTMLStyle_get_fontWeight
,
2489 HTMLStyle_put_fontSize
,
2490 HTMLStyle_get_fontSize
,
2493 HTMLStyle_put_color
,
2494 HTMLStyle_get_color
,
2495 HTMLStyle_put_background
,
2496 HTMLStyle_get_background
,
2497 HTMLStyle_put_backgroundColor
,
2498 HTMLStyle_get_backgroundColor
,
2499 HTMLStyle_put_backgroundImage
,
2500 HTMLStyle_get_backgroundImage
,
2501 HTMLStyle_put_backgroundRepeat
,
2502 HTMLStyle_get_backgroundRepeat
,
2503 HTMLStyle_put_backgroundAttachment
,
2504 HTMLStyle_get_backgroundAttachment
,
2505 HTMLStyle_put_backgroundPosition
,
2506 HTMLStyle_get_backgroundPosition
,
2507 HTMLStyle_put_backgroundPositionX
,
2508 HTMLStyle_get_backgroundPositionX
,
2509 HTMLStyle_put_backgroundPositionY
,
2510 HTMLStyle_get_backgroundPositionY
,
2511 HTMLStyle_put_wordSpacing
,
2512 HTMLStyle_get_wordSpacing
,
2513 HTMLStyle_put_letterSpacing
,
2514 HTMLStyle_get_letterSpacing
,
2515 HTMLStyle_put_textDecoration
,
2516 HTMLStyle_get_textDecoration
,
2517 HTMLStyle_put_textDecorationNone
,
2518 HTMLStyle_get_textDecorationNone
,
2519 HTMLStyle_put_textDecorationUnderline
,
2520 HTMLStyle_get_textDecorationUnderline
,
2521 HTMLStyle_put_textDecorationOverline
,
2522 HTMLStyle_get_textDecorationOverline
,
2523 HTMLStyle_put_textDecorationLineThrough
,
2524 HTMLStyle_get_textDecorationLineThrough
,
2525 HTMLStyle_put_textDecorationBlink
,
2526 HTMLStyle_get_textDecorationBlink
,
2527 HTMLStyle_put_verticalAlign
,
2528 HTMLStyle_get_verticalAlign
,
2529 HTMLStyle_put_textTransform
,
2530 HTMLStyle_get_textTransform
,
2531 HTMLStyle_put_textAlign
,
2532 HTMLStyle_get_textAlign
,
2533 HTMLStyle_put_textIndent
,
2534 HTMLStyle_get_textIndent
,
2535 HTMLStyle_put_lineHeight
,
2536 HTMLStyle_get_lineHeight
,
2537 HTMLStyle_put_marginTop
,
2538 HTMLStyle_get_marginTop
,
2539 HTMLStyle_put_marginRight
,
2540 HTMLStyle_get_marginRight
,
2541 HTMLStyle_put_marginBottom
,
2542 HTMLStyle_get_marginBottom
,
2543 HTMLStyle_put_marginLeft
,
2544 HTMLStyle_get_marginLeft
,
2545 HTMLStyle_put_margin
,
2546 HTMLStyle_get_margin
,
2547 HTMLStyle_put_paddingTop
,
2548 HTMLStyle_get_paddingTop
,
2549 HTMLStyle_put_paddingRight
,
2550 HTMLStyle_get_paddingRight
,
2551 HTMLStyle_put_paddingBottom
,
2552 HTMLStyle_get_paddingBottom
,
2553 HTMLStyle_put_paddingLeft
,
2554 HTMLStyle_get_paddingLeft
,
2555 HTMLStyle_put_padding
,
2556 HTMLStyle_get_padding
,
2557 HTMLStyle_put_border
,
2558 HTMLStyle_get_border
,
2559 HTMLStyle_put_borderTop
,
2560 HTMLStyle_get_borderTop
,
2561 HTMLStyle_put_borderRight
,
2562 HTMLStyle_get_borderRight
,
2563 HTMLStyle_put_borderBottom
,
2564 HTMLStyle_get_borderBottom
,
2565 HTMLStyle_put_borderLeft
,
2566 HTMLStyle_get_borderLeft
,
2567 HTMLStyle_put_borderColor
,
2568 HTMLStyle_get_borderColor
,
2569 HTMLStyle_put_borderTopColor
,
2570 HTMLStyle_get_borderTopColor
,
2571 HTMLStyle_put_borderRightColor
,
2572 HTMLStyle_get_borderRightColor
,
2573 HTMLStyle_put_borderBottomColor
,
2574 HTMLStyle_get_borderBottomColor
,
2575 HTMLStyle_put_borderLeftColor
,
2576 HTMLStyle_get_borderLeftColor
,
2577 HTMLStyle_put_borderWidth
,
2578 HTMLStyle_get_borderWidth
,
2579 HTMLStyle_put_borderTopWidth
,
2580 HTMLStyle_get_borderTopWidth
,
2581 HTMLStyle_put_borderRightWidth
,
2582 HTMLStyle_get_borderRightWidth
,
2583 HTMLStyle_put_borderBottomWidth
,
2584 HTMLStyle_get_borderBottomWidth
,
2585 HTMLStyle_put_borderLeftWidth
,
2586 HTMLStyle_get_borderLeftWidth
,
2587 HTMLStyle_put_borderStyle
,
2588 HTMLStyle_get_borderStyle
,
2589 HTMLStyle_put_borderTopStyle
,
2590 HTMLStyle_get_borderTopStyle
,
2591 HTMLStyle_put_borderRightStyle
,
2592 HTMLStyle_get_borderRightStyle
,
2593 HTMLStyle_put_borderBottomStyle
,
2594 HTMLStyle_get_borderBottomStyle
,
2595 HTMLStyle_put_borderLeftStyle
,
2596 HTMLStyle_get_borderLeftStyle
,
2597 HTMLStyle_put_width
,
2598 HTMLStyle_get_width
,
2599 HTMLStyle_put_height
,
2600 HTMLStyle_get_height
,
2601 HTMLStyle_put_styleFloat
,
2602 HTMLStyle_get_styleFloat
,
2603 HTMLStyle_put_clear
,
2604 HTMLStyle_get_clear
,
2605 HTMLStyle_put_display
,
2606 HTMLStyle_get_display
,
2607 HTMLStyle_put_visibility
,
2608 HTMLStyle_get_visibility
,
2609 HTMLStyle_put_listStyleType
,
2610 HTMLStyle_get_listStyleType
,
2611 HTMLStyle_put_listStylePosition
,
2612 HTMLStyle_get_listStylePosition
,
2613 HTMLStyle_put_listStyleImage
,
2614 HTMLStyle_get_listStyleImage
,
2615 HTMLStyle_put_listStyle
,
2616 HTMLStyle_get_listStyle
,
2617 HTMLStyle_put_whiteSpace
,
2618 HTMLStyle_get_whiteSpace
,
2623 HTMLStyle_get_position
,
2624 HTMLStyle_put_zIndex
,
2625 HTMLStyle_get_zIndex
,
2626 HTMLStyle_put_overflow
,
2627 HTMLStyle_get_overflow
,
2628 HTMLStyle_put_pageBreakBefore
,
2629 HTMLStyle_get_pageBreakBefore
,
2630 HTMLStyle_put_pageBreakAfter
,
2631 HTMLStyle_get_pageBreakAfter
,
2632 HTMLStyle_put_cssText
,
2633 HTMLStyle_get_cssText
,
2634 HTMLStyle_put_pixelTop
,
2635 HTMLStyle_get_pixelTop
,
2636 HTMLStyle_put_pixelLeft
,
2637 HTMLStyle_get_pixelLeft
,
2638 HTMLStyle_put_pixelWidth
,
2639 HTMLStyle_get_pixelWidth
,
2640 HTMLStyle_put_pixelHeight
,
2641 HTMLStyle_get_pixelHeight
,
2642 HTMLStyle_put_posTop
,
2643 HTMLStyle_get_posTop
,
2644 HTMLStyle_put_posLeft
,
2645 HTMLStyle_get_posLeft
,
2646 HTMLStyle_put_posWidth
,
2647 HTMLStyle_get_posWidth
,
2648 HTMLStyle_put_posHeight
,
2649 HTMLStyle_get_posHeight
,
2650 HTMLStyle_put_cursor
,
2651 HTMLStyle_get_cursor
,
2654 HTMLStyle_put_filter
,
2655 HTMLStyle_get_filter
,
2656 HTMLStyle_setAttribute
,
2657 HTMLStyle_getAttribute
,
2658 HTMLStyle_removeAttribute
,
2662 static const dispex_static_data_vtbl_t HTMLStyle_dispex_vtbl
= {
2664 HTMLStyle_get_dispid
,
2668 static const tid_t HTMLStyle_iface_tids
[] = {
2675 static dispex_static_data_t HTMLStyle_dispex
= {
2676 &HTMLStyle_dispex_vtbl
,
2679 HTMLStyle_iface_tids
2682 IHTMLStyle
*HTMLStyle_Create(nsIDOMCSSStyleDeclaration
*nsstyle
)
2684 HTMLStyle
*ret
= heap_alloc_zero(sizeof(HTMLStyle
));
2686 ret
->lpHTMLStyleVtbl
= &HTMLStyleVtbl
;
2688 ret
->nsstyle
= nsstyle
;
2689 HTMLStyle2_Init(ret
);
2690 HTMLStyle3_Init(ret
);
2692 nsIDOMCSSStyleDeclaration_AddRef(nsstyle
);
2694 init_dispex(&ret
->dispex
, (IUnknown
*)HTMLSTYLE(ret
), &HTMLStyle_dispex
);
2696 return HTMLSTYLE(ret
);