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 attrBorderBottomColor
[] =
53 {'b','o','r','d','e','r','-','b','o','t','t','o','m','-','c','o','l','o','r',0};
54 static const WCHAR attrBorderBottomStyle
[] =
55 {'b','o','r','d','e','r','-','b','o','t','t','o','m','-','s','t','y','l','e',0};
56 static const WCHAR attrBorderBottomWidth
[] =
57 {'b','o','r','d','e','r','-','b','o','t','t','o','m','-','w','i','d','t','h',0};
58 static const WCHAR attrBorderColor
[] =
59 {'b','o','r','d','e','r','-','c','o','l','o','r',0};
60 static const WCHAR attrBorderLeft
[] =
61 {'b','o','r','d','e','r','-','l','e','f','t',0};
62 static const WCHAR attrBorderLeftColor
[] =
63 {'b','o','r','d','e','r','-','l','e','f','t','-','c','o','l','o','r',0};
64 static const WCHAR attrBorderLeftStyle
[] =
65 {'b','o','r','d','e','r','-','l','e','f','t','-','s','t','y','l','e',0};
66 static const WCHAR attrBorderLeftWidth
[] =
67 {'b','o','r','d','e','r','-','l','e','f','t','-','w','i','d','t','h',0};
68 static const WCHAR attrBorderRightColor
[] =
69 {'b','o','r','d','e','r','-','r','i','g','h','t','-','c','o','l','o','r',0};
70 static const WCHAR attrBorderRightStyle
[] =
71 {'b','o','r','d','e','r','-','r','i','g','h','t','-','s','t','y','l','e',0};
72 static const WCHAR attrBorderRightWidth
[] =
73 {'b','o','r','d','e','r','-','r','i','g','h','t','-','w','i','d','t','h',0};
74 static const WCHAR attrBorderTopColor
[] =
75 {'b','o','r','d','e','r','-','t','o','p','-','c','o','l','o','r',0};
76 static const WCHAR attrBorderStyle
[] =
77 {'b','o','r','d','e','r','-','s','t','y','l','e',0};
78 static const WCHAR attrBorderTopStyle
[] =
79 {'b','o','r','d','e','r','-','t','o','p','-','s','t','y','l','e',0};
80 static const WCHAR attrBorderTopWidth
[] =
81 {'b','o','r','d','e','r','-','t','o','p','-','w','i','d','t','h',0};
82 static const WCHAR attrBorderWidth
[] =
83 {'b','o','r','d','e','r','-','w','i','d','t','h',0};
84 static const WCHAR attrBottom
[] =
85 {'b','o','t','t','o','m',0};
86 static const WCHAR attrColor
[] =
87 {'c','o','l','o','r',0};
88 static const WCHAR attrCursor
[] =
89 {'c','u','r','s','o','r',0};
90 static const WCHAR attrDisplay
[] =
91 {'d','i','s','p','l','a','y',0};
92 static const WCHAR attrFilter
[] =
93 {'f','i','l','e','t','e','r',0};
94 static const WCHAR attrFontFamily
[] =
95 {'f','o','n','t','-','f','a','m','i','l','y',0};
96 static const WCHAR attrFontSize
[] =
97 {'f','o','n','t','-','s','i','z','e',0};
98 static const WCHAR attrFontStyle
[] =
99 {'f','o','n','t','-','s','t','y','l','e',0};
100 static const WCHAR attrFontVariant
[] =
101 {'f','o','n','t','-','v','a','r','i','a','n','t',0};
102 static const WCHAR attrFontWeight
[] =
103 {'f','o','n','t','-','w','e','i','g','h','t',0};
104 static const WCHAR attrHeight
[] =
105 {'h','e','i','g','h','t',0};
106 static const WCHAR attrLeft
[] =
108 static const WCHAR attrLetterSpacing
[] =
109 {'l','e','t','t','e','r','-','s','p','a','c','i','n','g',0};
110 static const WCHAR attrLineHeight
[] =
111 {'l','i','n','e','-','h','e','i','g','h','t',0};
112 static const WCHAR attrMargin
[] =
113 {'m','a','r','g','i','n',0};
114 static const WCHAR attrMarginBottom
[] =
115 {'m','a','r','g','i','n','-','b','o','t','t','o','m',0};
116 static const WCHAR attrMarginLeft
[] =
117 {'m','a','r','g','i','n','-','l','e','f','t',0};
118 static const WCHAR attrMarginRight
[] =
119 {'m','a','r','g','i','n','-','r','i','g','h','t',0};
120 static const WCHAR attrMarginTop
[] =
121 {'m','a','r','g','i','n','-','t','o','p',0};
122 static const WCHAR attrMinHeight
[] =
123 {'m','i','n','-','h','e','i','g','h','t',0};
124 static const WCHAR attrOverflow
[] =
125 {'o','v','e','r','f','l','o','w',0};
126 static const WCHAR attrPaddingBottom
[] =
127 {'p','a','d','d','i','n','g','-','b','o','t','t','o','m',0};
128 static const WCHAR attrPaddingLeft
[] =
129 {'p','a','d','d','i','n','g','-','l','e','f','t',0};
130 static const WCHAR attrPaddingRight
[] =
131 {'p','a','d','d','i','n','g','-','r','i','g','h','t',0};
132 static const WCHAR attrPaddingTop
[] =
133 {'p','a','d','d','i','n','g','-','t','o','p',0};
134 static const WCHAR attrPosition
[] =
135 {'p','o','s','i','t','i','o','n',0};
136 static const WCHAR attrRight
[] =
137 {'r','i','g','h','t',0};
138 static const WCHAR attrTextAlign
[] =
139 {'t','e','x','t','-','a','l','i','g','n',0};
140 static const WCHAR attrTextDecoration
[] =
141 {'t','e','x','t','-','d','e','c','o','r','a','t','i','o','n',0};
142 static const WCHAR attrTextIndent
[] =
143 {'t','e','x','t','-','i','n','d','e','n','t',0};
144 static const WCHAR attrTop
[] =
146 static const WCHAR attrVerticalAlign
[] =
147 {'v','e','r','t','i','c','a','l','-','a','l','i','g','n',0};
148 static const WCHAR attrVisibility
[] =
149 {'v','i','s','i','b','i','l','i','t','y',0};
150 static const WCHAR attrWidth
[] =
151 {'w','i','d','t','h',0};
152 static const WCHAR attrWordSpacing
[] =
153 {'w','o','r','d','-','s','p','a','c','i','n','g',0};
154 static const WCHAR attrWordWrap
[] =
155 {'w','o','r','d','-','w','r','a','p',0};
156 static const WCHAR attrZIndex
[] =
157 {'z','-','i','n','d','e','x',0};
163 {attrBackground
, DISPID_IHTMLSTYLE_BACKGROUND
},
164 {attrBackgroundColor
, DISPID_IHTMLSTYLE_BACKGROUNDCOLOR
},
165 {attrBackgroundImage
, DISPID_IHTMLSTYLE_BACKGROUNDIMAGE
},
166 {attrBackgroundPositionX
, DISPID_IHTMLSTYLE_BACKGROUNDPOSITIONX
},
167 {attrBackgroundPositionY
, DISPID_IHTMLSTYLE_BACKGROUNDPOSITIONY
},
168 {attrBackgroundRepeat
, DISPID_IHTMLSTYLE_BACKGROUNDREPEAT
},
169 {attrBorder
, DISPID_IHTMLSTYLE_BORDER
},
170 {attrBorderBottomColor
, DISPID_IHTMLSTYLE_BORDERBOTTOMCOLOR
},
171 {attrBorderBottomStyle
, DISPID_IHTMLSTYLE_BORDERBOTTOMSTYLE
},
172 {attrBorderBottomWidth
, DISPID_IHTMLSTYLE_BORDERBOTTOMWIDTH
},
173 {attrBorderColor
, DISPID_IHTMLSTYLE_BORDERCOLOR
},
174 {attrBorderLeft
, DISPID_IHTMLSTYLE_BORDERLEFT
},
175 {attrBorderLeftColor
, DISPID_IHTMLSTYLE_BORDERLEFTCOLOR
},
176 {attrBorderLeftStyle
, DISPID_IHTMLSTYLE_BORDERLEFTSTYLE
},
177 {attrBorderLeftWidth
, DISPID_IHTMLSTYLE_BORDERLEFTWIDTH
},
178 {attrBorderRightColor
, DISPID_IHTMLSTYLE_BORDERRIGHTCOLOR
},
179 {attrBorderRightStyle
, DISPID_IHTMLSTYLE_BORDERRIGHTSTYLE
},
180 {attrBorderRightWidth
, DISPID_IHTMLSTYLE_BORDERRIGHTWIDTH
},
181 {attrBorderStyle
, DISPID_IHTMLSTYLE_BORDERSTYLE
},
182 {attrBorderTopColor
, DISPID_IHTMLSTYLE_BORDERTOPCOLOR
},
183 {attrBorderTopStyle
, DISPID_IHTMLSTYLE_BORDERTOPSTYLE
},
184 {attrBorderTopWidth
, DISPID_IHTMLSTYLE_BORDERTOPWIDTH
},
185 {attrBorderWidth
, DISPID_IHTMLSTYLE_BORDERWIDTH
},
186 {attrBottom
, DISPID_IHTMLSTYLE2_BOTTOM
},
187 {attrColor
, DISPID_IHTMLSTYLE_COLOR
},
188 {attrCursor
, DISPID_IHTMLSTYLE_CURSOR
},
189 {attrDisplay
, DISPID_IHTMLSTYLE_DISPLAY
},
190 {attrFilter
, DISPID_IHTMLSTYLE_FILTER
},
191 {attrFontFamily
, DISPID_IHTMLSTYLE_FONTFAMILY
},
192 {attrFontSize
, DISPID_IHTMLSTYLE_FONTSIZE
},
193 {attrFontStyle
, DISPID_IHTMLSTYLE_FONTSTYLE
},
194 {attrFontVariant
, DISPID_IHTMLSTYLE_FONTVARIANT
},
195 {attrFontWeight
, DISPID_IHTMLSTYLE_FONTWEIGHT
},
196 {attrHeight
, DISPID_IHTMLSTYLE_HEIGHT
},
197 {attrLeft
, DISPID_IHTMLSTYLE_LEFT
},
198 {attrLetterSpacing
, DISPID_IHTMLSTYLE_LETTERSPACING
},
199 {attrLineHeight
, DISPID_IHTMLSTYLE_LINEHEIGHT
},
200 {attrMargin
, DISPID_IHTMLSTYLE_MARGIN
},
201 {attrMarginBottom
, DISPID_IHTMLSTYLE_MARGINBOTTOM
},
202 {attrMarginLeft
, DISPID_IHTMLSTYLE_MARGINLEFT
},
203 {attrMarginRight
, DISPID_IHTMLSTYLE_MARGINRIGHT
},
204 {attrMarginTop
, DISPID_IHTMLSTYLE_MARGINTOP
},
205 {attrMinHeight
, DISPID_IHTMLSTYLE4_MINHEIGHT
},
206 {attrOverflow
, DISPID_IHTMLSTYLE_OVERFLOW
},
207 {attrPaddingBottom
, DISPID_IHTMLSTYLE_PADDINGBOTTOM
},
208 {attrPaddingLeft
, DISPID_IHTMLSTYLE_PADDINGLEFT
},
209 {attrPaddingRight
, DISPID_IHTMLSTYLE_PADDINGRIGHT
},
210 {attrPaddingTop
, DISPID_IHTMLSTYLE_PADDINGTOP
},
211 {attrPosition
, DISPID_IHTMLSTYLE2_POSITION
},
212 {attrRight
, DISPID_IHTMLSTYLE2_RIGHT
},
213 {attrTextAlign
, DISPID_IHTMLSTYLE_TEXTALIGN
},
214 {attrTextDecoration
, DISPID_IHTMLSTYLE_TEXTDECORATION
},
215 {attrTextIndent
, DISPID_IHTMLSTYLE_TEXTINDENT
},
216 {attrTop
, DISPID_IHTMLSTYLE_TOP
},
217 {attrVerticalAlign
, DISPID_IHTMLSTYLE_VERTICALALIGN
},
218 {attrVisibility
, DISPID_IHTMLSTYLE_VISIBILITY
},
219 {attrWidth
, DISPID_IHTMLSTYLE_WIDTH
},
220 {attrWordSpacing
, DISPID_IHTMLSTYLE_WORDSPACING
},
221 {attrWordWrap
, DISPID_IHTMLSTYLE3_WORDWRAP
},
222 {attrZIndex
, DISPID_IHTMLSTYLE_ZINDEX
}
225 static const WCHAR valLineThrough
[] =
226 {'l','i','n','e','-','t','h','r','o','u','g','h',0};
227 static const WCHAR valUnderline
[] =
228 {'u','n','d','e','r','l','i','n','e',0};
229 static const WCHAR szNormal
[] =
230 {'n','o','r','m','a','l',0};
231 static const WCHAR styleNone
[] =
233 static const WCHAR valOverline
[] =
234 {'o','v','e','r','l','i','n','e',0};
235 static const WCHAR valBlink
[] =
236 {'b','l','i','n','k',0};
238 static const WCHAR px_formatW
[] = {'%','d','p','x',0};
239 static const WCHAR emptyW
[] = {0};
241 static LPWSTR
fix_px_value(LPCWSTR val
)
246 while(*ptr
&& isspaceW(*ptr
))
251 while(*ptr
&& isdigitW(*ptr
))
254 if(!*ptr
|| isspaceW(*ptr
)) {
256 int len
= strlenW(val
)+1;
258 ret
= heap_alloc((len
+2)*sizeof(WCHAR
));
259 memcpy(ret
, val
, (ptr
-val
)*sizeof(WCHAR
));
265 TRACE("fixed %s -> %s\n", debugstr_w(val
), debugstr_w(ret
));
270 while(*ptr
&& !isspaceW(*ptr
))
277 static LPWSTR
fix_url_value(LPCWSTR val
)
281 static const WCHAR urlW
[] = {'u','r','l','('};
283 if(strncmpW(val
, urlW
, sizeof(urlW
)/sizeof(WCHAR
)) || !strchrW(val
, '\\'))
286 ret
= heap_strdupW(val
);
288 for(ptr
= ret
; *ptr
; ptr
++) {
296 HRESULT
set_nsstyle_attr(nsIDOMCSSStyleDeclaration
*nsstyle
, styleid_t sid
, LPCWSTR value
, DWORD flags
)
298 nsAString str_name
, str_value
, str_empty
;
302 static const PRUnichar wszEmpty
[] = {0};
304 if(flags
& ATTR_FIX_PX
)
305 val
= fix_px_value(value
);
306 if(flags
& ATTR_FIX_URL
)
307 val
= fix_url_value(value
);
309 nsAString_Init(&str_name
, style_tbl
[sid
].name
);
310 nsAString_Init(&str_value
, val
? val
: value
);
311 nsAString_Init(&str_empty
, wszEmpty
);
314 nsres
= nsIDOMCSSStyleDeclaration_SetProperty(nsstyle
, &str_name
, &str_value
, &str_empty
);
316 ERR("SetProperty failed: %08x\n", nsres
);
318 nsAString_Finish(&str_name
);
319 nsAString_Finish(&str_value
);
320 nsAString_Finish(&str_empty
);
325 HRESULT
set_nsstyle_attr_var(nsIDOMCSSStyleDeclaration
*nsstyle
, styleid_t sid
, VARIANT
*value
, DWORD flags
)
327 switch(V_VT(value
)) {
329 return set_nsstyle_attr(nsstyle
, sid
, emptyW
, flags
);
332 return set_nsstyle_attr(nsstyle
, sid
, V_BSTR(value
), flags
);
334 case VT_BSTR
|VT_BYREF
:
335 return set_nsstyle_attr(nsstyle
, sid
, *V_BSTRREF(value
), flags
);
339 static const WCHAR format
[] = {'%','d',0};
341 wsprintfW(str
, format
, V_I4(value
));
342 return set_nsstyle_attr(nsstyle
, sid
, str
, flags
);
345 FIXME("not implemented vt %d\n", V_VT(value
));
353 static inline HRESULT
set_style_attr(HTMLStyle
*This
, styleid_t sid
, LPCWSTR value
, DWORD flags
)
355 return set_nsstyle_attr(This
->nsstyle
, sid
, value
, flags
);
358 static HRESULT
get_nsstyle_attr_nsval(nsIDOMCSSStyleDeclaration
*nsstyle
, styleid_t sid
, nsAString
*value
)
363 nsAString_Init(&str_name
, style_tbl
[sid
].name
);
365 nsres
= nsIDOMCSSStyleDeclaration_GetPropertyValue(nsstyle
, &str_name
, value
);
366 if(NS_FAILED(nsres
)) {
367 ERR("SetProperty failed: %08x\n", nsres
);
371 nsAString_Finish(&str_name
);
376 HRESULT
get_nsstyle_attr(nsIDOMCSSStyleDeclaration
*nsstyle
, styleid_t sid
, BSTR
*p
)
379 const PRUnichar
*value
;
381 nsAString_Init(&str_value
, NULL
);
383 get_nsstyle_attr_nsval(nsstyle
, sid
, &str_value
);
385 nsAString_GetData(&str_value
, &value
);
386 *p
= *value
? SysAllocString(value
) : NULL
;
388 nsAString_Finish(&str_value
);
390 TRACE("%s -> %s\n", debugstr_w(style_tbl
[sid
].name
), debugstr_w(*p
));
394 HRESULT
get_nsstyle_attr_var(nsIDOMCSSStyleDeclaration
*nsstyle
, styleid_t sid
, VARIANT
*p
, DWORD flags
)
397 const PRUnichar
*value
;
400 nsAString_Init(&str_value
, NULL
);
402 get_nsstyle_attr_nsval(nsstyle
, sid
, &str_value
);
404 nsAString_GetData(&str_value
, &value
);
406 if(flags
& ATTR_STR_TO_INT
) {
407 const PRUnichar
*ptr
= value
;
416 while(isdigitW(*ptr
))
417 i
= i
*10 + (*ptr
++ - '0');
421 V_I4(p
) = neg
? -i
: i
;
430 str
= SysAllocString(value
);
432 return E_OUTOFMEMORY
;
439 nsAString_Finish(&str_value
);
441 TRACE("%s -> %s\n", debugstr_w(style_tbl
[sid
].name
), debugstr_variant(p
));
445 static inline HRESULT
get_style_attr(HTMLStyle
*This
, styleid_t sid
, BSTR
*p
)
447 return get_nsstyle_attr(This
->nsstyle
, sid
, p
);
450 static HRESULT
check_style_attr_value(HTMLStyle
*This
, styleid_t sid
, LPCWSTR exval
, VARIANT_BOOL
*p
)
453 const PRUnichar
*value
;
455 nsAString_Init(&str_value
, NULL
);
457 get_nsstyle_attr_nsval(This
->nsstyle
, sid
, &str_value
);
459 nsAString_GetData(&str_value
, &value
);
460 *p
= strcmpW(value
, exval
) ? VARIANT_FALSE
: VARIANT_TRUE
;
461 nsAString_Finish(&str_value
);
463 TRACE("%s -> %x\n", debugstr_w(style_tbl
[sid
].name
), *p
);
467 static inline HRESULT
set_style_pos(HTMLStyle
*This
, styleid_t sid
, float value
)
470 WCHAR szFormat
[] = {'%','.','0','f','p','x',0};
472 value
= floor(value
);
474 sprintfW(szValue
, szFormat
, value
);
476 return set_style_attr(This
, sid
, szValue
, 0);
479 static HRESULT
get_nsstyle_pos(HTMLStyle
*This
, styleid_t sid
, float *p
)
483 WCHAR pxW
[] = {'p','x',0};
485 TRACE("%p %d %p\n", This
, sid
, p
);
489 nsAString_Init(&str_value
, NULL
);
491 hres
= get_nsstyle_attr_nsval(This
->nsstyle
, sid
, &str_value
);
495 const PRUnichar
*value
;
497 nsAString_GetData(&str_value
, &value
);
500 *p
= strtolW(value
, &ptr
, 10);
502 if(*ptr
&& strcmpW(ptr
, pxW
))
504 nsAString_Finish(&str_value
);
505 FIXME("only px values are currently supported\n");
511 TRACE("ret %f\n", *p
);
513 nsAString_Finish(&str_value
);
518 static BOOL
is_valid_border_style(BSTR v
)
520 static const WCHAR styleDotted
[] = {'d','o','t','t','e','d',0};
521 static const WCHAR styleDashed
[] = {'d','a','s','h','e','d',0};
522 static const WCHAR styleSolid
[] = {'s','o','l','i','d',0};
523 static const WCHAR styleDouble
[] = {'d','o','u','b','l','e',0};
524 static const WCHAR styleGroove
[] = {'g','r','o','o','v','e',0};
525 static const WCHAR styleRidge
[] = {'r','i','d','g','e',0};
526 static const WCHAR styleInset
[] = {'i','n','s','e','t',0};
527 static const WCHAR styleOutset
[] = {'o','u','t','s','e','t',0};
529 TRACE("%s\n", debugstr_w(v
));
531 if(!v
|| strcmpiW(v
, styleNone
) == 0 || strcmpiW(v
, styleDotted
) == 0 ||
532 strcmpiW(v
, styleDashed
) == 0 || strcmpiW(v
, styleSolid
) == 0 ||
533 strcmpiW(v
, styleDouble
) == 0 || strcmpiW(v
, styleGroove
) == 0 ||
534 strcmpiW(v
, styleRidge
) == 0 || strcmpiW(v
, styleInset
) == 0 ||
535 strcmpiW(v
, styleOutset
) == 0 )
543 #define HTMLSTYLE_THIS(iface) DEFINE_THIS(HTMLStyle, HTMLStyle, iface)
545 static HRESULT WINAPI
HTMLStyle_QueryInterface(IHTMLStyle
*iface
, REFIID riid
, void **ppv
)
547 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
551 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
552 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppv
);
553 *ppv
= HTMLSTYLE(This
);
554 }else if(IsEqualGUID(&IID_IHTMLStyle
, riid
)) {
555 TRACE("(%p)->(IID_IHTMLStyle %p)\n", This
, ppv
);
556 *ppv
= HTMLSTYLE(This
);
557 }else if(IsEqualGUID(&IID_IHTMLStyle2
, riid
)) {
558 TRACE("(%p)->(IID_IHTMLStyle2 %p)\n", This
, ppv
);
559 *ppv
= HTMLSTYLE2(This
);
560 }else if(IsEqualGUID(&IID_IHTMLStyle3
, riid
)) {
561 TRACE("(%p)->(IID_IHTMLStyle3 %p)\n", This
, ppv
);
562 *ppv
= HTMLSTYLE3(This
);
563 }else if(IsEqualGUID(&IID_IHTMLStyle4
, riid
)) {
564 TRACE("(%p)->(IID_IHTMLStyle4 %p)\n", This
, ppv
);
565 *ppv
= HTMLSTYLE4(This
);
566 }else if(dispex_query_interface(&This
->dispex
, riid
, ppv
)) {
567 return *ppv
? S_OK
: E_NOINTERFACE
;
571 IUnknown_AddRef((IUnknown
*)*ppv
);
575 WARN("unsupported %s\n", debugstr_guid(riid
));
576 return E_NOINTERFACE
;
579 static ULONG WINAPI
HTMLStyle_AddRef(IHTMLStyle
*iface
)
581 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
582 LONG ref
= InterlockedIncrement(&This
->ref
);
584 TRACE("(%p) ref=%d\n", This
, ref
);
589 static ULONG WINAPI
HTMLStyle_Release(IHTMLStyle
*iface
)
591 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
592 LONG ref
= InterlockedDecrement(&This
->ref
);
594 TRACE("(%p) ref=%d\n", This
, ref
);
598 nsIDOMCSSStyleDeclaration_Release(This
->nsstyle
);
599 release_dispex(&This
->dispex
);
606 static HRESULT WINAPI
HTMLStyle_GetTypeInfoCount(IHTMLStyle
*iface
, UINT
*pctinfo
)
608 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
609 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This
->dispex
), pctinfo
);
612 static HRESULT WINAPI
HTMLStyle_GetTypeInfo(IHTMLStyle
*iface
, UINT iTInfo
,
613 LCID lcid
, ITypeInfo
**ppTInfo
)
615 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
616 return IDispatchEx_GetTypeInfo(DISPATCHEX(&This
->dispex
), iTInfo
, lcid
, ppTInfo
);
619 static HRESULT WINAPI
HTMLStyle_GetIDsOfNames(IHTMLStyle
*iface
, REFIID riid
,
620 LPOLESTR
*rgszNames
, UINT cNames
,
621 LCID lcid
, DISPID
*rgDispId
)
623 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
624 return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This
->dispex
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
627 static HRESULT WINAPI
HTMLStyle_Invoke(IHTMLStyle
*iface
, DISPID dispIdMember
,
628 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
629 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
631 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
632 return IDispatchEx_Invoke(DISPATCHEX(&This
->dispex
), dispIdMember
, riid
, lcid
,
633 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
636 static HRESULT WINAPI
HTMLStyle_put_fontFamily(IHTMLStyle
*iface
, BSTR v
)
638 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
640 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
642 return set_style_attr(This
, STYLEID_FONT_FAMILY
, v
, 0);
645 static HRESULT WINAPI
HTMLStyle_get_fontFamily(IHTMLStyle
*iface
, BSTR
*p
)
647 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
649 TRACE("(%p)->(%p)\n", This
, p
);
651 return get_style_attr(This
, STYLEID_FONT_FAMILY
, p
);
654 static HRESULT WINAPI
HTMLStyle_put_fontStyle(IHTMLStyle
*iface
, BSTR v
)
656 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
657 static const WCHAR szItalic
[] = {'i','t','a','l','i','c',0};
658 static const WCHAR szOblique
[] = {'o','b','l','i','q','u','e',0};
660 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
662 /* fontStyle can only be one of the follow values. */
663 if(!v
|| strcmpiW(szNormal
, v
) == 0 || strcmpiW(szItalic
, v
) == 0 ||
664 strcmpiW(szOblique
, v
) == 0)
666 return set_nsstyle_attr(This
->nsstyle
, STYLEID_FONT_STYLE
, v
, 0);
672 static HRESULT WINAPI
HTMLStyle_get_fontStyle(IHTMLStyle
*iface
, BSTR
*p
)
674 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
676 TRACE("(%p)->(%p)\n", This
, p
);
678 return get_style_attr(This
, STYLEID_FONT_STYLE
, p
);
681 static HRESULT WINAPI
HTMLStyle_put_fontVariant(IHTMLStyle
*iface
, BSTR v
)
683 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
684 static const WCHAR szCaps
[] = {'s','m','a','l','l','-','c','a','p','s',0};
686 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
688 /* fontVariant can only be one of the follow values. */
689 if(!v
|| strcmpiW(szNormal
, v
) == 0 || strcmpiW(szCaps
, v
) == 0)
691 return set_nsstyle_attr(This
->nsstyle
, STYLEID_FONT_VARIANT
, v
, 0);
697 static HRESULT WINAPI
HTMLStyle_get_fontVariant(IHTMLStyle
*iface
, BSTR
*p
)
699 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
700 TRACE("(%p)->(%p)\n", This
, p
);
705 return get_style_attr(This
, STYLEID_FONT_VARIANT
, p
);
708 static HRESULT WINAPI
HTMLStyle_put_fontWeight(IHTMLStyle
*iface
, BSTR v
)
710 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
711 static const WCHAR styleBold
[] = {'b','o','l','d',0};
712 static const WCHAR styleBolder
[] = {'b','o','l','d','e','r',0};
713 static const WCHAR styleLighter
[] = {'l','i','g','h','t','e','r',0};
714 static const WCHAR style100
[] = {'1','0','0',0};
715 static const WCHAR style200
[] = {'2','0','0',0};
716 static const WCHAR style300
[] = {'3','0','0',0};
717 static const WCHAR style400
[] = {'4','0','0',0};
718 static const WCHAR style500
[] = {'5','0','0',0};
719 static const WCHAR style600
[] = {'6','0','0',0};
720 static const WCHAR style700
[] = {'7','0','0',0};
721 static const WCHAR style800
[] = {'8','0','0',0};
722 static const WCHAR style900
[] = {'9','0','0',0};
724 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
726 /* fontWeight can only be one of the following */
727 if(!v
|| strcmpiW(szNormal
, v
) == 0 || strcmpiW(styleBold
, v
) == 0 ||
728 strcmpiW(styleBolder
, v
) == 0 || strcmpiW(styleLighter
, v
) == 0 ||
729 strcmpiW(style100
, v
) == 0 || strcmpiW(style200
, v
) == 0 ||
730 strcmpiW(style300
, v
) == 0 || strcmpiW(style400
, v
) == 0 ||
731 strcmpiW(style500
, v
) == 0 || strcmpiW(style600
, v
) == 0 ||
732 strcmpiW(style700
, v
) == 0 || strcmpiW(style800
, v
) == 0 ||
733 strcmpiW(style900
, v
) == 0
736 return set_nsstyle_attr(This
->nsstyle
, STYLEID_FONT_WEIGHT
, v
, 0);
742 static HRESULT WINAPI
HTMLStyle_get_fontWeight(IHTMLStyle
*iface
, BSTR
*p
)
744 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
746 TRACE("(%p)->(%p)\n", This
, p
);
748 return get_style_attr(This
, STYLEID_FONT_WEIGHT
, p
);
751 static HRESULT WINAPI
HTMLStyle_put_fontSize(IHTMLStyle
*iface
, VARIANT v
)
753 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
755 TRACE("(%p)->(v%d)\n", This
, V_VT(&v
));
759 return set_style_attr(This
, STYLEID_FONT_SIZE
, V_BSTR(&v
), 0);
761 FIXME("not supported vt %d\n", V_VT(&v
));
767 static HRESULT WINAPI
HTMLStyle_get_fontSize(IHTMLStyle
*iface
, VARIANT
*p
)
769 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
771 TRACE("(%p)->(%p)\n", This
, p
);
774 return get_style_attr(This
, STYLEID_FONT_SIZE
, &V_BSTR(p
));
777 static HRESULT WINAPI
HTMLStyle_put_font(IHTMLStyle
*iface
, BSTR v
)
779 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
780 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
784 static HRESULT WINAPI
HTMLStyle_get_font(IHTMLStyle
*iface
, BSTR
*p
)
786 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
787 FIXME("(%p)->(%p)\n", This
, p
);
791 static HRESULT WINAPI
HTMLStyle_put_color(IHTMLStyle
*iface
, VARIANT v
)
793 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
795 TRACE("(%p)->(v%d)\n", This
, V_VT(&v
));
799 TRACE("%s\n", debugstr_w(V_BSTR(&v
)));
800 return set_style_attr(This
, STYLEID_COLOR
, V_BSTR(&v
), 0);
803 FIXME("unsupported vt=%d\n", V_VT(&v
));
809 static HRESULT WINAPI
HTMLStyle_get_color(IHTMLStyle
*iface
, VARIANT
*p
)
811 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
813 TRACE("(%p)->(%p)\n", This
, p
);
816 return get_style_attr(This
, STYLEID_COLOR
, &V_BSTR(p
));
819 static HRESULT WINAPI
HTMLStyle_put_background(IHTMLStyle
*iface
, BSTR v
)
821 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
823 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
825 return set_style_attr(This
, STYLEID_BACKGROUND
, v
, 0);
828 static HRESULT WINAPI
HTMLStyle_get_background(IHTMLStyle
*iface
, BSTR
*p
)
830 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
832 TRACE("(%p)->(%p)\n", This
, p
);
834 return get_style_attr(This
, STYLEID_BACKGROUND
, p
);
837 static HRESULT WINAPI
HTMLStyle_put_backgroundColor(IHTMLStyle
*iface
, VARIANT v
)
839 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
841 TRACE("(%p)->(v%d)\n", This
, V_VT(&v
));
845 return set_style_attr(This
, STYLEID_BACKGROUND_COLOR
, V_BSTR(&v
), 0);
848 static const WCHAR format
[] = {'#','%','0','6','x',0};
850 wsprintfW(value
, format
, V_I4(&v
));
851 return set_style_attr(This
, STYLEID_BACKGROUND_COLOR
, value
, 0);
854 FIXME("unsupported vt %d\n", V_VT(&v
));
860 static HRESULT WINAPI
HTMLStyle_get_backgroundColor(IHTMLStyle
*iface
, VARIANT
*p
)
862 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
863 TRACE("(%p)->(%p)\n", This
, p
);
866 return get_style_attr(This
, STYLEID_BACKGROUND_COLOR
, &V_BSTR(p
));
869 static HRESULT WINAPI
HTMLStyle_put_backgroundImage(IHTMLStyle
*iface
, BSTR v
)
871 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
873 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
875 return set_style_attr(This
, STYLEID_BACKGROUND_IMAGE
, v
, ATTR_FIX_URL
);
878 static HRESULT WINAPI
HTMLStyle_get_backgroundImage(IHTMLStyle
*iface
, BSTR
*p
)
880 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
882 TRACE("(%p)->(%p)\n", This
, p
);
884 return get_style_attr(This
, STYLEID_BACKGROUND_IMAGE
, p
);
887 static HRESULT WINAPI
HTMLStyle_put_backgroundRepeat(IHTMLStyle
*iface
, BSTR v
)
889 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
890 static const WCHAR styleRepeat
[] = {'r','e','p','e','a','t',0};
891 static const WCHAR styleNoRepeat
[] = {'n','o','-','r','e','p','e','a','t',0};
892 static const WCHAR styleRepeatX
[] = {'r','e','p','e','a','t','-','x',0};
893 static const WCHAR styleRepeatY
[] = {'r','e','p','e','a','t','-','y',0};
895 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
897 /* fontWeight can only be one of the following */
898 if(!v
|| strcmpiW(styleRepeat
, v
) == 0 || strcmpiW(styleNoRepeat
, v
) == 0 ||
899 strcmpiW(styleRepeatX
, v
) == 0 || strcmpiW(styleRepeatY
, v
) == 0 )
901 return set_style_attr(This
, STYLEID_BACKGROUND_REPEAT
, v
, 0);
907 static HRESULT WINAPI
HTMLStyle_get_backgroundRepeat(IHTMLStyle
*iface
, BSTR
*p
)
909 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
911 TRACE("(%p)->(%p)\n", This
, p
);
913 return get_style_attr(This
, STYLEID_BACKGROUND_REPEAT
, p
);
916 static HRESULT WINAPI
HTMLStyle_put_backgroundAttachment(IHTMLStyle
*iface
, BSTR v
)
918 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
919 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
923 static HRESULT WINAPI
HTMLStyle_get_backgroundAttachment(IHTMLStyle
*iface
, BSTR
*p
)
925 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
926 FIXME("(%p)->(%p)\n", This
, p
);
930 static HRESULT WINAPI
HTMLStyle_put_backgroundPosition(IHTMLStyle
*iface
, BSTR v
)
932 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
933 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
937 static HRESULT WINAPI
HTMLStyle_get_backgroundPosition(IHTMLStyle
*iface
, BSTR
*p
)
939 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
940 FIXME("(%p)->(%p)\n", This
, p
);
944 static HRESULT WINAPI
HTMLStyle_put_backgroundPositionX(IHTMLStyle
*iface
, VARIANT v
)
946 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
947 TRACE("(%p)->(v%d)\n", This
, V_VT(&v
));
948 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_BACKGROUND_POSITION_X
, &v
, 0);
951 static HRESULT WINAPI
HTMLStyle_get_backgroundPositionX(IHTMLStyle
*iface
, VARIANT
*p
)
953 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
954 TRACE("(%p)->(%p)\n", This
, p
);
955 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_BACKGROUND_POSITION_X
, p
, 0);
958 static HRESULT WINAPI
HTMLStyle_put_backgroundPositionY(IHTMLStyle
*iface
, VARIANT v
)
960 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
961 TRACE("(%p)->(v%d)\n", This
, V_VT(&v
));
962 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_BACKGROUND_POSITION_Y
, &v
, 0);
965 static HRESULT WINAPI
HTMLStyle_get_backgroundPositionY(IHTMLStyle
*iface
, VARIANT
*p
)
967 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
968 TRACE("(%p)->(%p)\n", This
, p
);
969 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_BACKGROUND_POSITION_Y
, p
, 0);
972 static HRESULT WINAPI
HTMLStyle_put_wordSpacing(IHTMLStyle
*iface
, VARIANT v
)
974 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
975 TRACE("(%p)->(v%d)\n", This
, V_VT(&v
));
976 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_WORD_SPACING
, &v
, 0);
979 static HRESULT WINAPI
HTMLStyle_get_wordSpacing(IHTMLStyle
*iface
, VARIANT
*p
)
981 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
982 TRACE("(%p)->(%p)\n", This
, p
);
983 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_WORD_SPACING
, p
, 0);
986 static HRESULT WINAPI
HTMLStyle_put_letterSpacing(IHTMLStyle
*iface
, VARIANT v
)
988 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
989 TRACE("(%p)->(v%d)\n", This
, V_VT(&v
));
990 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_LETTER_SPACING
, &v
, 0);
993 static HRESULT WINAPI
HTMLStyle_get_letterSpacing(IHTMLStyle
*iface
, VARIANT
*p
)
995 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
996 TRACE("(%p)->(%p)\n", This
, p
);
997 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_LETTER_SPACING
, p
, 0);
1000 static HRESULT WINAPI
HTMLStyle_put_textDecoration(IHTMLStyle
*iface
, BSTR v
)
1002 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1004 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1006 /* textDecoration can only be one of the following */
1007 if(!v
|| strcmpiW(styleNone
, v
) == 0 || strcmpiW(valUnderline
, v
) == 0 ||
1008 strcmpiW(valOverline
, v
) == 0 || strcmpiW(valLineThrough
, v
) == 0 ||
1009 strcmpiW(valBlink
, v
) == 0)
1011 return set_style_attr(This
, STYLEID_TEXT_DECORATION
, v
, 0);
1014 return E_INVALIDARG
;
1017 static HRESULT WINAPI
HTMLStyle_get_textDecoration(IHTMLStyle
*iface
, BSTR
*p
)
1019 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1021 TRACE("(%p)->(%p)\n", This
, p
);
1023 return get_style_attr(This
, STYLEID_TEXT_DECORATION
, p
);
1026 static HRESULT WINAPI
HTMLStyle_put_textDecorationNone(IHTMLStyle
*iface
, VARIANT_BOOL v
)
1028 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1030 TRACE("(%p)->(%x)\n", This
, v
);
1032 return set_style_attr(This
, STYLEID_TEXT_DECORATION
, v
? styleNone
: emptyW
, 0);
1035 static HRESULT WINAPI
HTMLStyle_get_textDecorationNone(IHTMLStyle
*iface
, VARIANT_BOOL
*p
)
1037 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1039 TRACE("(%p)->(%p)\n", This
, p
);
1041 return check_style_attr_value(This
, STYLEID_TEXT_DECORATION
, styleNone
, p
);
1044 static HRESULT WINAPI
HTMLStyle_put_textDecorationUnderline(IHTMLStyle
*iface
, VARIANT_BOOL v
)
1046 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1048 TRACE("(%p)->(%x)\n", This
, v
);
1050 return set_style_attr(This
, STYLEID_TEXT_DECORATION
, v
? valUnderline
: emptyW
, 0);
1053 static HRESULT WINAPI
HTMLStyle_get_textDecorationUnderline(IHTMLStyle
*iface
, VARIANT_BOOL
*p
)
1055 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1057 TRACE("(%p)->(%p)\n", This
, p
);
1059 return check_style_attr_value(This
, STYLEID_TEXT_DECORATION
, valUnderline
, p
);
1062 static HRESULT WINAPI
HTMLStyle_put_textDecorationOverline(IHTMLStyle
*iface
, VARIANT_BOOL v
)
1064 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1066 TRACE("(%p)->(%x)\n", This
, v
);
1068 return set_style_attr(This
, STYLEID_TEXT_DECORATION
, v
? valOverline
: emptyW
, 0);
1071 static HRESULT WINAPI
HTMLStyle_get_textDecorationOverline(IHTMLStyle
*iface
, VARIANT_BOOL
*p
)
1073 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1075 TRACE("(%p)->(%p)\n", This
, p
);
1077 return check_style_attr_value(This
, STYLEID_TEXT_DECORATION
, valOverline
, p
);
1080 static HRESULT WINAPI
HTMLStyle_put_textDecorationLineThrough(IHTMLStyle
*iface
, VARIANT_BOOL v
)
1082 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1084 TRACE("(%p)->(%x)\n", This
, v
);
1086 return set_style_attr(This
, STYLEID_TEXT_DECORATION
, v
? valLineThrough
: emptyW
, 0);
1089 static HRESULT WINAPI
HTMLStyle_get_textDecorationLineThrough(IHTMLStyle
*iface
, VARIANT_BOOL
*p
)
1091 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1093 TRACE("(%p)->(%p)\n", This
, p
);
1095 return check_style_attr_value(This
, STYLEID_TEXT_DECORATION
, valLineThrough
, p
);
1098 static HRESULT WINAPI
HTMLStyle_put_textDecorationBlink(IHTMLStyle
*iface
, VARIANT_BOOL v
)
1100 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1102 TRACE("(%p)->(%x)\n", This
, v
);
1104 return set_style_attr(This
, STYLEID_TEXT_DECORATION
, v
? valBlink
: emptyW
, 0);
1107 static HRESULT WINAPI
HTMLStyle_get_textDecorationBlink(IHTMLStyle
*iface
, VARIANT_BOOL
*p
)
1109 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1111 TRACE("(%p)->(%p)\n", This
, p
);
1113 return check_style_attr_value(This
, STYLEID_TEXT_DECORATION
, valBlink
, p
);
1116 static HRESULT WINAPI
HTMLStyle_put_verticalAlign(IHTMLStyle
*iface
, VARIANT v
)
1118 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1120 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1124 return set_style_attr(This
, STYLEID_VERTICAL_ALIGN
, V_BSTR(&v
), 0);
1126 FIXME("not implemented vt %d\n", V_VT(&v
));
1133 static HRESULT WINAPI
HTMLStyle_get_verticalAlign(IHTMLStyle
*iface
, VARIANT
*p
)
1135 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1139 TRACE("(%p)->(%p)\n", This
, p
);
1141 hres
= get_style_attr(This
, STYLEID_VERTICAL_ALIGN
, &ret
);
1150 static HRESULT WINAPI
HTMLStyle_put_textTransform(IHTMLStyle
*iface
, BSTR v
)
1152 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1153 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1157 static HRESULT WINAPI
HTMLStyle_get_textTransform(IHTMLStyle
*iface
, BSTR
*p
)
1159 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1160 FIXME("(%p)->(%p)\n", This
, p
);
1164 static HRESULT WINAPI
HTMLStyle_put_textAlign(IHTMLStyle
*iface
, BSTR v
)
1166 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1168 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1170 return set_style_attr(This
, STYLEID_TEXT_ALIGN
, v
, 0);
1173 static HRESULT WINAPI
HTMLStyle_get_textAlign(IHTMLStyle
*iface
, BSTR
*p
)
1175 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1177 TRACE("(%p)->(%p)\n", This
, p
);
1179 return get_style_attr(This
, STYLEID_TEXT_ALIGN
, p
);
1182 static HRESULT WINAPI
HTMLStyle_put_textIndent(IHTMLStyle
*iface
, VARIANT v
)
1184 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1185 FIXME("(%p)->(v%d)\n", This
, V_VT(&v
));
1189 static HRESULT WINAPI
HTMLStyle_get_textIndent(IHTMLStyle
*iface
, VARIANT
*p
)
1191 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1192 FIXME("(%p)->(%p)\n", This
, p
);
1196 static HRESULT WINAPI
HTMLStyle_put_lineHeight(IHTMLStyle
*iface
, VARIANT v
)
1198 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1199 FIXME("(%p)->(v%d)\n", This
, V_VT(&v
));
1203 static HRESULT WINAPI
HTMLStyle_get_lineHeight(IHTMLStyle
*iface
, VARIANT
*p
)
1205 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1206 FIXME("(%p)->(%p)\n", This
, p
);
1210 static HRESULT WINAPI
HTMLStyle_put_marginTop(IHTMLStyle
*iface
, VARIANT v
)
1212 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1213 FIXME("(%p)->(v%d)\n", This
, V_VT(&v
));
1217 static HRESULT WINAPI
HTMLStyle_get_marginTop(IHTMLStyle
*iface
, VARIANT
*p
)
1219 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1220 FIXME("(%p)->(%p)\n", This
, p
);
1224 static HRESULT WINAPI
HTMLStyle_put_marginRight(IHTMLStyle
*iface
, VARIANT v
)
1226 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1228 TRACE("(%p)->(v(%d))\n", This
, V_VT(&v
));
1232 return set_style_attr(This
, STYLEID_MARGIN_RIGHT
, emptyW
, 0);
1236 wsprintfW(buf
, px_formatW
, V_I4(&v
));
1237 return set_style_attr(This
, STYLEID_MARGIN_RIGHT
, buf
, 0);
1240 return set_style_attr(This
, STYLEID_MARGIN_RIGHT
, V_BSTR(&v
), 0);
1242 FIXME("Unsupported vt=%d\n", V_VT(&v
));
1248 static HRESULT WINAPI
HTMLStyle_get_marginRight(IHTMLStyle
*iface
, VARIANT
*p
)
1250 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1251 TRACE("(%p)->(%p)\n", This
, p
);
1252 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_MARGIN_RIGHT
, p
, 0);
1255 static HRESULT WINAPI
HTMLStyle_put_marginBottom(IHTMLStyle
*iface
, VARIANT v
)
1257 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1258 FIXME("(%p)->(v%d)\n", This
, V_VT(&v
));
1262 static HRESULT WINAPI
HTMLStyle_get_marginBottom(IHTMLStyle
*iface
, VARIANT
*p
)
1264 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1265 FIXME("(%p)->(%p)\n", This
, p
);
1269 static HRESULT WINAPI
HTMLStyle_put_marginLeft(IHTMLStyle
*iface
, VARIANT v
)
1271 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1275 TRACE("(%p)->(NULL)\n", This
);
1276 return set_style_attr(This
, STYLEID_MARGIN_LEFT
, emptyW
, 0);
1280 TRACE("(%p)->(%d)\n", This
, V_I4(&v
));
1282 wsprintfW(buf
, px_formatW
, V_I4(&v
));
1283 return set_style_attr(This
, STYLEID_MARGIN_LEFT
, buf
, 0);
1286 TRACE("(%p)->(%s)\n", This
, debugstr_w(V_BSTR(&v
)));
1287 return set_style_attr(This
, STYLEID_MARGIN_LEFT
, V_BSTR(&v
), 0);
1289 FIXME("Unsupported vt=%d\n", V_VT(&v
));
1295 static HRESULT WINAPI
HTMLStyle_put_margin(IHTMLStyle
*iface
, BSTR v
)
1297 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1299 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1301 return set_style_attr(This
, STYLEID_MARGIN
, v
, 0);
1304 static HRESULT WINAPI
HTMLStyle_get_margin(IHTMLStyle
*iface
, BSTR
*p
)
1306 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1308 TRACE("(%p)->(%p)\n", This
, p
);
1310 return get_style_attr(This
, STYLEID_MARGIN
, p
);
1313 static HRESULT WINAPI
HTMLStyle_get_marginLeft(IHTMLStyle
*iface
, VARIANT
*p
)
1315 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1316 TRACE("(%p)->(%p)\n", This
, p
);
1317 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_MARGIN_LEFT
, p
, 0);
1320 static HRESULT WINAPI
HTMLStyle_put_paddingTop(IHTMLStyle
*iface
, VARIANT v
)
1322 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1323 FIXME("(%p)->(v%d)\n", This
, V_VT(&v
));
1327 static HRESULT WINAPI
HTMLStyle_get_paddingTop(IHTMLStyle
*iface
, VARIANT
*p
)
1329 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1330 FIXME("(%p)->(%p)\n", This
, p
);
1334 static HRESULT WINAPI
HTMLStyle_put_paddingRight(IHTMLStyle
*iface
, VARIANT v
)
1336 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1337 FIXME("(%p)->(v%d)\n", This
, V_VT(&v
));
1341 static HRESULT WINAPI
HTMLStyle_get_paddingRight(IHTMLStyle
*iface
, VARIANT
*p
)
1343 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1344 FIXME("(%p)->(%p)\n", This
, p
);
1348 static HRESULT WINAPI
HTMLStyle_put_paddingBottom(IHTMLStyle
*iface
, VARIANT v
)
1350 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1351 FIXME("(%p)->(v%d)\n", This
, V_VT(&v
));
1355 static HRESULT WINAPI
HTMLStyle_get_paddingBottom(IHTMLStyle
*iface
, VARIANT
*p
)
1357 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1358 FIXME("(%p)->(%p)\n", This
, p
);
1362 static HRESULT WINAPI
HTMLStyle_put_paddingLeft(IHTMLStyle
*iface
, VARIANT v
)
1364 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1366 TRACE("(%p)->(vt=%d)\n", This
, V_VT(&v
));
1372 wsprintfW(buf
, px_formatW
, V_I4(&v
));
1373 return set_style_attr(This
, STYLEID_PADDING_LEFT
, buf
, 0);
1376 return set_style_attr(This
, STYLEID_PADDING_LEFT
, V_BSTR(&v
), 0);
1378 FIXME("unsupported vt=%d\n", V_VT(&v
));
1384 static HRESULT WINAPI
HTMLStyle_get_paddingLeft(IHTMLStyle
*iface
, VARIANT
*p
)
1386 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1390 TRACE("(%p)->(%p)\n", This
, p
);
1392 hres
= get_style_attr(This
, STYLEID_PADDING_LEFT
, &ret
);
1401 static HRESULT WINAPI
HTMLStyle_put_padding(IHTMLStyle
*iface
, BSTR v
)
1403 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1404 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1408 static HRESULT WINAPI
HTMLStyle_get_padding(IHTMLStyle
*iface
, BSTR
*p
)
1410 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1411 FIXME("(%p)->(%p)\n", This
, p
);
1415 static HRESULT WINAPI
HTMLStyle_put_border(IHTMLStyle
*iface
, BSTR v
)
1417 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1419 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1421 return set_style_attr(This
, STYLEID_BORDER
, v
, 0);
1424 static HRESULT WINAPI
HTMLStyle_get_border(IHTMLStyle
*iface
, BSTR
*p
)
1426 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1428 TRACE("(%p)->(%p)\n", This
, p
);
1430 return get_style_attr(This
, STYLEID_BORDER
, p
);
1433 static HRESULT WINAPI
HTMLStyle_put_borderTop(IHTMLStyle
*iface
, BSTR v
)
1435 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1436 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1440 static HRESULT WINAPI
HTMLStyle_get_borderTop(IHTMLStyle
*iface
, BSTR
*p
)
1442 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1443 FIXME("(%p)->(%p)\n", This
, p
);
1447 static HRESULT WINAPI
HTMLStyle_put_borderRight(IHTMLStyle
*iface
, BSTR v
)
1449 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1450 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1454 static HRESULT WINAPI
HTMLStyle_get_borderRight(IHTMLStyle
*iface
, BSTR
*p
)
1456 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1457 FIXME("(%p)->(%p)\n", This
, p
);
1461 static HRESULT WINAPI
HTMLStyle_put_borderBottom(IHTMLStyle
*iface
, BSTR v
)
1463 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1464 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1468 static HRESULT WINAPI
HTMLStyle_get_borderBottom(IHTMLStyle
*iface
, BSTR
*p
)
1470 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1471 FIXME("(%p)->(%p)\n", This
, p
);
1475 static HRESULT WINAPI
HTMLStyle_put_borderLeft(IHTMLStyle
*iface
, BSTR v
)
1477 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1479 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1481 return set_style_attr(This
, STYLEID_BORDER_LEFT
, v
, ATTR_FIX_PX
);
1484 static HRESULT WINAPI
HTMLStyle_get_borderLeft(IHTMLStyle
*iface
, BSTR
*p
)
1486 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1488 TRACE("(%p)->(%p)\n", This
, p
);
1490 return get_style_attr(This
, STYLEID_BORDER_LEFT
, p
);
1493 static HRESULT WINAPI
HTMLStyle_put_borderColor(IHTMLStyle
*iface
, BSTR v
)
1495 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1497 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1499 return set_style_attr(This
, STYLEID_BORDER_COLOR
, v
, 0);
1502 static HRESULT WINAPI
HTMLStyle_get_borderColor(IHTMLStyle
*iface
, BSTR
*p
)
1504 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1506 TRACE("(%p)->(%p)\n", This
, p
);
1508 return get_style_attr(This
, STYLEID_BORDER_COLOR
, p
);
1511 static HRESULT WINAPI
HTMLStyle_put_borderTopColor(IHTMLStyle
*iface
, VARIANT v
)
1513 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1514 FIXME("(%p)->(v%d)\n", This
, V_VT(&v
));
1518 static HRESULT WINAPI
HTMLStyle_get_borderTopColor(IHTMLStyle
*iface
, VARIANT
*p
)
1520 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1521 FIXME("(%p)->(%p)\n", This
, p
);
1525 static HRESULT WINAPI
HTMLStyle_put_borderRightColor(IHTMLStyle
*iface
, VARIANT v
)
1527 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1528 FIXME("(%p)->(v%d)\n", This
, V_VT(&v
));
1532 static HRESULT WINAPI
HTMLStyle_get_borderRightColor(IHTMLStyle
*iface
, VARIANT
*p
)
1534 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1535 FIXME("(%p)->(%p)\n", This
, p
);
1539 static HRESULT WINAPI
HTMLStyle_put_borderBottomColor(IHTMLStyle
*iface
, VARIANT v
)
1541 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1542 FIXME("(%p)->(v%d)\n", This
, V_VT(&v
));
1546 static HRESULT WINAPI
HTMLStyle_get_borderBottomColor(IHTMLStyle
*iface
, VARIANT
*p
)
1548 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1549 FIXME("(%p)->(%p)\n", This
, p
);
1553 static HRESULT WINAPI
HTMLStyle_put_borderLeftColor(IHTMLStyle
*iface
, VARIANT v
)
1555 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1556 FIXME("(%p)->(v%d)\n", This
, V_VT(&v
));
1560 static HRESULT WINAPI
HTMLStyle_get_borderLeftColor(IHTMLStyle
*iface
, VARIANT
*p
)
1562 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1563 FIXME("(%p)->(%p)\n", This
, p
);
1567 static HRESULT WINAPI
HTMLStyle_put_borderWidth(IHTMLStyle
*iface
, BSTR v
)
1569 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1570 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1571 return set_style_attr(This
, STYLEID_BORDER_WIDTH
, v
, ATTR_FIX_PX
);
1574 static HRESULT WINAPI
HTMLStyle_get_borderWidth(IHTMLStyle
*iface
, BSTR
*p
)
1576 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1577 TRACE("(%p)->(%p)\n", This
, p
);
1578 return get_style_attr(This
, STYLEID_BORDER_WIDTH
, p
);
1581 static HRESULT WINAPI
HTMLStyle_put_borderTopWidth(IHTMLStyle
*iface
, VARIANT v
)
1583 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1584 TRACE("(%p)->(v%d)\n", This
, V_VT(&v
));
1585 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_TOP_WIDTH
, &v
, 0);
1588 static HRESULT WINAPI
HTMLStyle_get_borderTopWidth(IHTMLStyle
*iface
, VARIANT
*p
)
1590 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1592 TRACE("(%p)->(%p)\n", This
, p
);
1594 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_TOP_WIDTH
, p
, 0);
1597 static HRESULT WINAPI
HTMLStyle_put_borderRightWidth(IHTMLStyle
*iface
, VARIANT v
)
1599 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1600 TRACE("(%p)->(v%d)\n", This
, V_VT(&v
));
1601 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_RIGHT_WIDTH
, &v
, 0);
1604 static HRESULT WINAPI
HTMLStyle_get_borderRightWidth(IHTMLStyle
*iface
, VARIANT
*p
)
1606 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1607 TRACE("(%p)->(%p)\n", This
, p
);
1608 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_RIGHT_WIDTH
, p
, 0);
1611 static HRESULT WINAPI
HTMLStyle_put_borderBottomWidth(IHTMLStyle
*iface
, VARIANT v
)
1613 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_BOTTOM_WIDTH
, &v
, 0);
1619 static HRESULT WINAPI
HTMLStyle_get_borderBottomWidth(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_BOTTOM_WIDTH
, p
, 0);
1626 static HRESULT WINAPI
HTMLStyle_put_borderLeftWidth(IHTMLStyle
*iface
, VARIANT v
)
1628 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1629 TRACE("(%p)->(v%d)\n", This
, V_VT(&v
));
1630 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_LEFT_WIDTH
, &v
, 0);
1633 static HRESULT WINAPI
HTMLStyle_get_borderLeftWidth(IHTMLStyle
*iface
, VARIANT
*p
)
1635 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1636 TRACE("(%p)->(%p)\n", This
, p
);
1637 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_LEFT_WIDTH
, p
, 0);
1640 static HRESULT WINAPI
HTMLStyle_put_borderStyle(IHTMLStyle
*iface
, BSTR v
)
1642 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1643 static const WCHAR styleWindowInset
[] = {'w','i','n','d','o','w','-','i','n','s','e','t',0};
1644 HRESULT hres
= S_OK
;
1649 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1651 while(v
[i
] && hres
== S_OK
)
1653 if(v
[i
] == (WCHAR
)' ')
1655 pstyle
= SysAllocStringLen(&v
[last
], (i
-last
));
1656 if( !(is_valid_border_style(pstyle
) || strcmpiW(styleWindowInset
, pstyle
) == 0))
1658 TRACE("1. Invalid style (%s)\n", debugstr_w(pstyle
));
1659 hres
= E_INVALIDARG
;
1661 SysFreeString(pstyle
);
1669 pstyle
= SysAllocStringLen(&v
[last
], i
-last
);
1670 if( !(is_valid_border_style(pstyle
) || strcmpiW(styleWindowInset
, pstyle
) == 0))
1672 TRACE("2. Invalid style (%s)\n", debugstr_w(pstyle
));
1673 hres
= E_INVALIDARG
;
1675 SysFreeString(pstyle
);
1679 hres
= set_nsstyle_attr(This
->nsstyle
, STYLEID_BORDER_STYLE
, v
, 0);
1684 static HRESULT WINAPI
HTMLStyle_get_borderStyle(IHTMLStyle
*iface
, BSTR
*p
)
1686 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1687 TRACE("(%p)->(%p)\n", This
, p
);
1688 return get_style_attr(This
, STYLEID_BORDER_STYLE
, p
);
1691 static HRESULT WINAPI
HTMLStyle_put_borderTopStyle(IHTMLStyle
*iface
, BSTR v
)
1693 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1694 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1696 if(!is_valid_border_style(v
))
1697 return E_INVALIDARG
;
1699 return set_style_attr(This
, STYLEID_BORDER_TOP_STYLE
, v
, 0);
1702 static HRESULT WINAPI
HTMLStyle_get_borderTopStyle(IHTMLStyle
*iface
, BSTR
*p
)
1704 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1705 TRACE("(%p)->(%p)\n", This
, p
);
1706 return get_style_attr(This
, STYLEID_BORDER_TOP_STYLE
, p
);
1709 static HRESULT WINAPI
HTMLStyle_put_borderRightStyle(IHTMLStyle
*iface
, BSTR v
)
1711 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1712 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1714 if(!is_valid_border_style(v
))
1715 return E_INVALIDARG
;
1717 return set_style_attr(This
, STYLEID_BORDER_RIGHT_STYLE
, v
, 0);
1720 static HRESULT WINAPI
HTMLStyle_get_borderRightStyle(IHTMLStyle
*iface
, BSTR
*p
)
1722 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1723 TRACE("(%p)->(%p)\n", This
, p
);
1724 return get_style_attr(This
, STYLEID_BORDER_RIGHT_STYLE
, p
);
1727 static HRESULT WINAPI
HTMLStyle_put_borderBottomStyle(IHTMLStyle
*iface
, BSTR v
)
1729 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1730 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1732 if(!is_valid_border_style(v
))
1733 return E_INVALIDARG
;
1735 return set_style_attr(This
, STYLEID_BORDER_BOTTOM_STYLE
, v
, 0);
1738 static HRESULT WINAPI
HTMLStyle_get_borderBottomStyle(IHTMLStyle
*iface
, BSTR
*p
)
1740 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1741 TRACE("(%p)->(%p)\n", This
, p
);
1742 return get_style_attr(This
, STYLEID_BORDER_BOTTOM_STYLE
, p
);
1745 static HRESULT WINAPI
HTMLStyle_put_borderLeftStyle(IHTMLStyle
*iface
, BSTR v
)
1747 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1748 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1750 if(!is_valid_border_style(v
))
1751 return E_INVALIDARG
;
1753 return set_style_attr(This
, STYLEID_BORDER_LEFT_STYLE
, v
, 0);
1756 static HRESULT WINAPI
HTMLStyle_get_borderLeftStyle(IHTMLStyle
*iface
, BSTR
*p
)
1758 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1759 TRACE("(%p)->(%p)\n", This
, p
);
1760 return get_style_attr(This
, STYLEID_BORDER_LEFT_STYLE
, p
);
1763 static HRESULT WINAPI
HTMLStyle_put_width(IHTMLStyle
*iface
, VARIANT v
)
1765 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1767 TRACE("(%p)->(v%d)\n", This
, V_VT(&v
));
1771 TRACE("%s\n", debugstr_w(V_BSTR(&v
)));
1772 return set_style_attr(This
, STYLEID_WIDTH
, V_BSTR(&v
), 0);
1774 FIXME("unsupported vt %d\n", V_VT(&v
));
1780 static HRESULT WINAPI
HTMLStyle_get_width(IHTMLStyle
*iface
, VARIANT
*p
)
1782 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1784 TRACE("(%p)->(%p)\n", This
, p
);
1787 return get_style_attr(This
, STYLEID_WIDTH
, &V_BSTR(p
));
1790 static HRESULT WINAPI
HTMLStyle_put_height(IHTMLStyle
*iface
, VARIANT v
)
1792 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1794 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1798 return set_style_attr(This
, STYLEID_HEIGHT
, V_BSTR(&v
), 0);
1800 FIXME("unimplemented vt %d\n", V_VT(&v
));
1807 static HRESULT WINAPI
HTMLStyle_get_height(IHTMLStyle
*iface
, VARIANT
*p
)
1809 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1813 TRACE("(%p)->(%p)\n", This
, p
);
1815 hres
= get_style_attr(This
, STYLEID_HEIGHT
, &ret
);
1824 static HRESULT WINAPI
HTMLStyle_put_styleFloat(IHTMLStyle
*iface
, BSTR v
)
1826 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1827 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1831 static HRESULT WINAPI
HTMLStyle_get_styleFloat(IHTMLStyle
*iface
, BSTR
*p
)
1833 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1834 FIXME("(%p)->(%p)\n", This
, p
);
1838 static HRESULT WINAPI
HTMLStyle_put_clear(IHTMLStyle
*iface
, BSTR v
)
1840 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1841 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1845 static HRESULT WINAPI
HTMLStyle_get_clear(IHTMLStyle
*iface
, BSTR
*p
)
1847 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1848 FIXME("(%p)->(%p)\n", This
, p
);
1852 static HRESULT WINAPI
HTMLStyle_put_display(IHTMLStyle
*iface
, BSTR v
)
1854 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1856 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1858 return set_style_attr(This
, STYLEID_DISPLAY
, v
, 0);
1861 static HRESULT WINAPI
HTMLStyle_get_display(IHTMLStyle
*iface
, BSTR
*p
)
1863 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1865 TRACE("(%p)->(%p)\n", This
, p
);
1867 return get_style_attr(This
, STYLEID_DISPLAY
, p
);
1870 static HRESULT WINAPI
HTMLStyle_put_visibility(IHTMLStyle
*iface
, BSTR v
)
1872 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1874 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1876 return set_style_attr(This
, STYLEID_VISIBILITY
, v
, 0);
1879 static HRESULT WINAPI
HTMLStyle_get_visibility(IHTMLStyle
*iface
, BSTR
*p
)
1881 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1883 TRACE("(%p)->(%p)\n", This
, p
);
1885 return get_style_attr(This
, STYLEID_VISIBILITY
, p
);
1888 static HRESULT WINAPI
HTMLStyle_put_listStyleType(IHTMLStyle
*iface
, BSTR v
)
1890 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1891 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1895 static HRESULT WINAPI
HTMLStyle_get_listStyleType(IHTMLStyle
*iface
, BSTR
*p
)
1897 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1898 FIXME("(%p)->(%p)\n", This
, p
);
1902 static HRESULT WINAPI
HTMLStyle_put_listStylePosition(IHTMLStyle
*iface
, BSTR v
)
1904 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1905 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1909 static HRESULT WINAPI
HTMLStyle_get_listStylePosition(IHTMLStyle
*iface
, BSTR
*p
)
1911 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1912 FIXME("(%p)->(%p)\n", This
, p
);
1916 static HRESULT WINAPI
HTMLStyle_put_listStyleImage(IHTMLStyle
*iface
, BSTR v
)
1918 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1919 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1923 static HRESULT WINAPI
HTMLStyle_get_listStyleImage(IHTMLStyle
*iface
, BSTR
*p
)
1925 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1926 FIXME("(%p)->(%p)\n", This
, p
);
1930 static HRESULT WINAPI
HTMLStyle_put_listStyle(IHTMLStyle
*iface
, BSTR v
)
1932 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1933 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1937 static HRESULT WINAPI
HTMLStyle_get_listStyle(IHTMLStyle
*iface
, BSTR
*p
)
1939 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1940 FIXME("(%p)->(%p)\n", This
, p
);
1944 static HRESULT WINAPI
HTMLStyle_put_whiteSpace(IHTMLStyle
*iface
, BSTR v
)
1946 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1947 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1951 static HRESULT WINAPI
HTMLStyle_get_whiteSpace(IHTMLStyle
*iface
, BSTR
*p
)
1953 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1954 FIXME("(%p)->(%p)\n", This
, p
);
1958 static HRESULT WINAPI
HTMLStyle_put_top(IHTMLStyle
*iface
, VARIANT v
)
1960 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1962 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1964 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_TOP
, &v
, 0);
1967 static HRESULT WINAPI
HTMLStyle_get_top(IHTMLStyle
*iface
, VARIANT
*p
)
1969 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1973 TRACE("(%p)->(%p)\n", This
, p
);
1975 hres
= get_style_attr(This
, STYLEID_TOP
, &ret
);
1984 static HRESULT WINAPI
HTMLStyle_put_left(IHTMLStyle
*iface
, VARIANT v
)
1986 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1988 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1990 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_LEFT
, &v
, 0);
1993 static HRESULT WINAPI
HTMLStyle_get_left(IHTMLStyle
*iface
, VARIANT
*p
)
1995 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
1999 TRACE("(%p)->(%p)\n", This
, p
);
2001 hres
= get_style_attr(This
, STYLEID_LEFT
, &ret
);
2010 static HRESULT WINAPI
HTMLStyle_get_position(IHTMLStyle
*iface
, BSTR
*p
)
2012 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2013 TRACE("(%p)->(%p)\n", This
, p
);
2014 return IHTMLStyle2_get_position(HTMLSTYLE2(This
), p
);
2017 static HRESULT WINAPI
HTMLStyle_put_zIndex(IHTMLStyle
*iface
, VARIANT v
)
2019 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2021 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2025 return set_style_attr(This
, STYLEID_Z_INDEX
, V_BSTR(&v
), 0);
2028 static const WCHAR format
[] = {'%','d',0};
2030 wsprintfW(value
, format
, V_I4(&v
));
2031 return set_style_attr(This
, STYLEID_Z_INDEX
, value
, 0);
2034 FIXME("unimplemented vt %d\n", V_VT(&v
));
2041 static HRESULT WINAPI
HTMLStyle_get_zIndex(IHTMLStyle
*iface
, VARIANT
*p
)
2043 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2045 TRACE("(%p)->(%p)\n", This
, p
);
2047 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_Z_INDEX
, p
, ATTR_STR_TO_INT
);
2050 static HRESULT WINAPI
HTMLStyle_put_overflow(IHTMLStyle
*iface
, BSTR v
)
2052 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2053 static const WCHAR szVisible
[] = {'v','i','s','i','b','l','e',0};
2054 static const WCHAR szScroll
[] = {'s','c','r','o','l','l',0};
2055 static const WCHAR szHidden
[] = {'h','i','d','d','e','n',0};
2056 static const WCHAR szAuto
[] = {'a','u','t','o',0};
2058 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2060 /* overflow can only be one of the follow values. */
2061 if(!v
|| !*v
|| strcmpiW(szVisible
, v
) == 0 || strcmpiW(szScroll
, v
) == 0 ||
2062 strcmpiW(szHidden
, v
) == 0 || strcmpiW(szAuto
, v
) == 0)
2064 return set_nsstyle_attr(This
->nsstyle
, STYLEID_OVERFLOW
, v
, 0);
2067 return E_INVALIDARG
;
2071 static HRESULT WINAPI
HTMLStyle_get_overflow(IHTMLStyle
*iface
, BSTR
*p
)
2073 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2075 TRACE("(%p)->(%p)\n", This
, p
);
2078 return E_INVALIDARG
;
2080 return get_style_attr(This
, STYLEID_OVERFLOW
, p
);
2083 static HRESULT WINAPI
HTMLStyle_put_pageBreakBefore(IHTMLStyle
*iface
, BSTR v
)
2085 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2086 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
2090 static HRESULT WINAPI
HTMLStyle_get_pageBreakBefore(IHTMLStyle
*iface
, BSTR
*p
)
2092 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2093 FIXME("(%p)->(%p)\n", This
, p
);
2097 static HRESULT WINAPI
HTMLStyle_put_pageBreakAfter(IHTMLStyle
*iface
, BSTR v
)
2099 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2100 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
2104 static HRESULT WINAPI
HTMLStyle_get_pageBreakAfter(IHTMLStyle
*iface
, BSTR
*p
)
2106 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2107 FIXME("(%p)->(%p)\n", This
, p
);
2111 static HRESULT WINAPI
HTMLStyle_put_cssText(IHTMLStyle
*iface
, BSTR v
)
2113 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2117 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2119 nsAString_Init(&text_str
, v
);
2120 nsres
= nsIDOMCSSStyleDeclaration_SetCssText(This
->nsstyle
, &text_str
);
2121 nsAString_Finish(&text_str
);
2122 if(NS_FAILED(nsres
)) {
2123 FIXME("SetCssStyle failed: %08x\n", nsres
);
2130 static HRESULT WINAPI
HTMLStyle_get_cssText(IHTMLStyle
*iface
, BSTR
*p
)
2132 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2136 TRACE("(%p)->(%p)\n", This
, p
);
2138 /* FIXME: Gecko style formatting is different than IE (uppercase). */
2139 nsAString_Init(&text_str
, NULL
);
2140 nsres
= nsIDOMCSSStyleDeclaration_GetCssText(This
->nsstyle
, &text_str
);
2141 if(NS_SUCCEEDED(nsres
)) {
2142 const PRUnichar
*text
;
2144 nsAString_GetData(&text_str
, &text
);
2145 *p
= *text
? SysAllocString(text
) : NULL
;
2147 FIXME("GetCssStyle failed: %08x\n", nsres
);
2151 nsAString_Finish(&text_str
);
2155 static HRESULT WINAPI
HTMLStyle_put_pixelTop(IHTMLStyle
*iface
, LONG v
)
2157 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2158 FIXME("(%p)->()\n", This
);
2162 static HRESULT WINAPI
HTMLStyle_get_pixelTop(IHTMLStyle
*iface
, LONG
*p
)
2164 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2165 FIXME("(%p)->()\n", This
);
2169 static HRESULT WINAPI
HTMLStyle_put_pixelLeft(IHTMLStyle
*iface
, LONG v
)
2171 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2172 FIXME("(%p)->()\n", This
);
2176 static HRESULT WINAPI
HTMLStyle_get_pixelLeft(IHTMLStyle
*iface
, LONG
*p
)
2178 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2179 FIXME("(%p)->()\n", This
);
2183 static HRESULT WINAPI
HTMLStyle_put_pixelWidth(IHTMLStyle
*iface
, LONG v
)
2185 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2186 FIXME("(%p)->()\n", This
);
2190 static HRESULT WINAPI
HTMLStyle_get_pixelWidth(IHTMLStyle
*iface
, LONG
*p
)
2192 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2193 FIXME("(%p)->()\n", This
);
2197 static HRESULT WINAPI
HTMLStyle_put_pixelHeight(IHTMLStyle
*iface
, LONG v
)
2199 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2200 FIXME("(%p)->()\n", This
);
2204 static HRESULT WINAPI
HTMLStyle_get_pixelHeight(IHTMLStyle
*iface
, LONG
*p
)
2206 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2207 FIXME("(%p)->()\n", This
);
2211 static HRESULT WINAPI
HTMLStyle_put_posTop(IHTMLStyle
*iface
, float v
)
2213 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2215 TRACE("(%p)->(%f)\n", This
, v
);
2217 return set_style_pos(This
, STYLEID_TOP
, v
);
2220 static HRESULT WINAPI
HTMLStyle_get_posTop(IHTMLStyle
*iface
, float *p
)
2222 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2224 TRACE("(%p)->(%p)\n", This
, p
);
2229 return get_nsstyle_pos(This
, STYLEID_TOP
, p
);
2232 static HRESULT WINAPI
HTMLStyle_put_posLeft(IHTMLStyle
*iface
, float v
)
2234 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2236 TRACE("(%p)->(%f)\n", This
, v
);
2238 return set_style_pos(This
, STYLEID_LEFT
, v
);
2241 static HRESULT WINAPI
HTMLStyle_get_posLeft(IHTMLStyle
*iface
, float *p
)
2243 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2245 TRACE("(%p)->(%p)\n", This
, p
);
2250 return get_nsstyle_pos(This
, STYLEID_LEFT
, p
);
2253 static HRESULT WINAPI
HTMLStyle_put_posWidth(IHTMLStyle
*iface
, float v
)
2255 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2257 TRACE("(%p)->(%f)\n", This
, v
);
2259 return set_style_pos(This
, STYLEID_WIDTH
, v
);
2262 static HRESULT WINAPI
HTMLStyle_get_posWidth(IHTMLStyle
*iface
, float *p
)
2264 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2266 TRACE("(%p)->(%p)\n", This
, p
);
2271 if(get_nsstyle_pos(This
, STYLEID_WIDTH
, p
) != S_OK
)
2277 static HRESULT WINAPI
HTMLStyle_put_posHeight(IHTMLStyle
*iface
, float v
)
2279 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2281 TRACE("(%p)->(%f)\n", This
, v
);
2283 return set_style_pos(This
, STYLEID_HEIGHT
, v
);
2286 static HRESULT WINAPI
HTMLStyle_get_posHeight(IHTMLStyle
*iface
, float *p
)
2288 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2290 TRACE("(%p)->(%p)\n", This
, p
);
2295 if(get_nsstyle_pos(This
, STYLEID_HEIGHT
, p
) != S_OK
)
2301 static HRESULT WINAPI
HTMLStyle_put_cursor(IHTMLStyle
*iface
, BSTR v
)
2303 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2305 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2307 return set_style_attr(This
, STYLEID_CURSOR
, v
, 0);
2310 static HRESULT WINAPI
HTMLStyle_get_cursor(IHTMLStyle
*iface
, BSTR
*p
)
2312 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2314 TRACE("(%p)->(%p)\n", This
, p
);
2316 return get_style_attr(This
, STYLEID_CURSOR
, p
);
2319 static HRESULT WINAPI
HTMLStyle_put_clip(IHTMLStyle
*iface
, BSTR v
)
2321 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2322 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
2326 static HRESULT WINAPI
HTMLStyle_get_clip(IHTMLStyle
*iface
, BSTR
*p
)
2328 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2329 FIXME("(%p)->(%p)\n", This
, p
);
2333 static HRESULT WINAPI
HTMLStyle_put_filter(IHTMLStyle
*iface
, BSTR v
)
2335 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2337 WARN("(%p)->(%s)\n", This
, debugstr_w(v
));
2339 /* FIXME: Handle MS-style filters */
2340 return set_style_attr(This
, STYLEID_FILTER
, v
, 0);
2343 static HRESULT WINAPI
HTMLStyle_get_filter(IHTMLStyle
*iface
, BSTR
*p
)
2345 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2347 WARN("(%p)->(%p)\n", This
, p
);
2349 /* FIXME: Handle MS-style filters */
2350 return get_style_attr(This
, STYLEID_FILTER
, p
);
2353 static HRESULT WINAPI
HTMLStyle_setAttribute(IHTMLStyle
*iface
, BSTR strAttributeName
,
2354 VARIANT AttributeValue
, LONG lFlags
)
2356 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2360 TRACE("(%p)->(%s v%d %08x)\n", This
, debugstr_w(strAttributeName
),
2361 V_VT(&AttributeValue
), lFlags
);
2363 if(!strAttributeName
)
2364 return E_INVALIDARG
;
2367 FIXME("Parameter lFlags ignored\n");
2369 hres
= HTMLStyle_GetIDsOfNames(iface
, &IID_NULL
, &strAttributeName
, 1,
2370 LOCALE_USER_DEFAULT
, &dispid
);
2374 DISPID dispidNamed
= DISPID_PROPERTYPUT
;
2378 params
.rgvarg
= &AttributeValue
;
2379 params
.cNamedArgs
= 1;
2380 params
.rgdispidNamedArgs
= &dispidNamed
;
2382 hres
= HTMLStyle_Invoke(iface
, dispid
, &IID_NULL
, LOCALE_SYSTEM_DEFAULT
,
2383 DISPATCH_PROPERTYPUT
, ¶ms
, &ret
, NULL
, NULL
);
2387 FIXME("Custom attributes not supported.\n");
2390 TRACE("ret: %08x\n", hres
);
2395 static HRESULT WINAPI
HTMLStyle_getAttribute(IHTMLStyle
*iface
, BSTR strAttributeName
,
2396 LONG lFlags
, VARIANT
*AttributeValue
)
2398 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2402 TRACE("(%p)->(%s v%p %08x)\n", This
, debugstr_w(strAttributeName
),
2403 AttributeValue
, lFlags
);
2405 if(!AttributeValue
|| !strAttributeName
)
2406 return E_INVALIDARG
;
2409 FIXME("Parameter lFlags ignored\n");
2411 hres
= HTMLStyle_GetIDsOfNames(iface
, &IID_NULL
, &strAttributeName
, 1,
2412 LOCALE_USER_DEFAULT
, &dispid
);
2415 DISPPARAMS params
= {NULL
, NULL
, 0, 0 };
2417 hres
= HTMLStyle_Invoke(iface
, dispid
, &IID_NULL
, LOCALE_SYSTEM_DEFAULT
,
2418 DISPATCH_PROPERTYGET
, ¶ms
, AttributeValue
, NULL
, NULL
);
2422 FIXME("Custom attributes not supported.\n");
2428 static HRESULT WINAPI
HTMLStyle_removeAttribute(IHTMLStyle
*iface
, BSTR strAttributeName
,
2429 LONG lFlags
, VARIANT_BOOL
*pfSuccess
)
2431 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2432 FIXME("(%p)->(%s %08x %p)\n", This
, debugstr_w(strAttributeName
),
2437 static HRESULT WINAPI
HTMLStyle_toString(IHTMLStyle
*iface
, BSTR
*String
)
2439 HTMLStyle
*This
= HTMLSTYLE_THIS(iface
);
2440 FIXME("(%p)->(%p)\n", This
, String
);
2444 static HRESULT
HTMLStyle_get_dispid(IUnknown
*iface
, BSTR name
, DWORD flags
, DISPID
*dispid
)
2446 int c
, i
, min
=0, max
= sizeof(style_tbl
)/sizeof(*style_tbl
)-1;
2451 c
= strcmpW(style_tbl
[i
].name
, name
);
2453 *dispid
= style_tbl
[i
].dispid
;
2463 return DISP_E_UNKNOWNNAME
;
2466 static const IHTMLStyleVtbl HTMLStyleVtbl
= {
2467 HTMLStyle_QueryInterface
,
2470 HTMLStyle_GetTypeInfoCount
,
2471 HTMLStyle_GetTypeInfo
,
2472 HTMLStyle_GetIDsOfNames
,
2474 HTMLStyle_put_fontFamily
,
2475 HTMLStyle_get_fontFamily
,
2476 HTMLStyle_put_fontStyle
,
2477 HTMLStyle_get_fontStyle
,
2478 HTMLStyle_put_fontVariant
,
2479 HTMLStyle_get_fontVariant
,
2480 HTMLStyle_put_fontWeight
,
2481 HTMLStyle_get_fontWeight
,
2482 HTMLStyle_put_fontSize
,
2483 HTMLStyle_get_fontSize
,
2486 HTMLStyle_put_color
,
2487 HTMLStyle_get_color
,
2488 HTMLStyle_put_background
,
2489 HTMLStyle_get_background
,
2490 HTMLStyle_put_backgroundColor
,
2491 HTMLStyle_get_backgroundColor
,
2492 HTMLStyle_put_backgroundImage
,
2493 HTMLStyle_get_backgroundImage
,
2494 HTMLStyle_put_backgroundRepeat
,
2495 HTMLStyle_get_backgroundRepeat
,
2496 HTMLStyle_put_backgroundAttachment
,
2497 HTMLStyle_get_backgroundAttachment
,
2498 HTMLStyle_put_backgroundPosition
,
2499 HTMLStyle_get_backgroundPosition
,
2500 HTMLStyle_put_backgroundPositionX
,
2501 HTMLStyle_get_backgroundPositionX
,
2502 HTMLStyle_put_backgroundPositionY
,
2503 HTMLStyle_get_backgroundPositionY
,
2504 HTMLStyle_put_wordSpacing
,
2505 HTMLStyle_get_wordSpacing
,
2506 HTMLStyle_put_letterSpacing
,
2507 HTMLStyle_get_letterSpacing
,
2508 HTMLStyle_put_textDecoration
,
2509 HTMLStyle_get_textDecoration
,
2510 HTMLStyle_put_textDecorationNone
,
2511 HTMLStyle_get_textDecorationNone
,
2512 HTMLStyle_put_textDecorationUnderline
,
2513 HTMLStyle_get_textDecorationUnderline
,
2514 HTMLStyle_put_textDecorationOverline
,
2515 HTMLStyle_get_textDecorationOverline
,
2516 HTMLStyle_put_textDecorationLineThrough
,
2517 HTMLStyle_get_textDecorationLineThrough
,
2518 HTMLStyle_put_textDecorationBlink
,
2519 HTMLStyle_get_textDecorationBlink
,
2520 HTMLStyle_put_verticalAlign
,
2521 HTMLStyle_get_verticalAlign
,
2522 HTMLStyle_put_textTransform
,
2523 HTMLStyle_get_textTransform
,
2524 HTMLStyle_put_textAlign
,
2525 HTMLStyle_get_textAlign
,
2526 HTMLStyle_put_textIndent
,
2527 HTMLStyle_get_textIndent
,
2528 HTMLStyle_put_lineHeight
,
2529 HTMLStyle_get_lineHeight
,
2530 HTMLStyle_put_marginTop
,
2531 HTMLStyle_get_marginTop
,
2532 HTMLStyle_put_marginRight
,
2533 HTMLStyle_get_marginRight
,
2534 HTMLStyle_put_marginBottom
,
2535 HTMLStyle_get_marginBottom
,
2536 HTMLStyle_put_marginLeft
,
2537 HTMLStyle_get_marginLeft
,
2538 HTMLStyle_put_margin
,
2539 HTMLStyle_get_margin
,
2540 HTMLStyle_put_paddingTop
,
2541 HTMLStyle_get_paddingTop
,
2542 HTMLStyle_put_paddingRight
,
2543 HTMLStyle_get_paddingRight
,
2544 HTMLStyle_put_paddingBottom
,
2545 HTMLStyle_get_paddingBottom
,
2546 HTMLStyle_put_paddingLeft
,
2547 HTMLStyle_get_paddingLeft
,
2548 HTMLStyle_put_padding
,
2549 HTMLStyle_get_padding
,
2550 HTMLStyle_put_border
,
2551 HTMLStyle_get_border
,
2552 HTMLStyle_put_borderTop
,
2553 HTMLStyle_get_borderTop
,
2554 HTMLStyle_put_borderRight
,
2555 HTMLStyle_get_borderRight
,
2556 HTMLStyle_put_borderBottom
,
2557 HTMLStyle_get_borderBottom
,
2558 HTMLStyle_put_borderLeft
,
2559 HTMLStyle_get_borderLeft
,
2560 HTMLStyle_put_borderColor
,
2561 HTMLStyle_get_borderColor
,
2562 HTMLStyle_put_borderTopColor
,
2563 HTMLStyle_get_borderTopColor
,
2564 HTMLStyle_put_borderRightColor
,
2565 HTMLStyle_get_borderRightColor
,
2566 HTMLStyle_put_borderBottomColor
,
2567 HTMLStyle_get_borderBottomColor
,
2568 HTMLStyle_put_borderLeftColor
,
2569 HTMLStyle_get_borderLeftColor
,
2570 HTMLStyle_put_borderWidth
,
2571 HTMLStyle_get_borderWidth
,
2572 HTMLStyle_put_borderTopWidth
,
2573 HTMLStyle_get_borderTopWidth
,
2574 HTMLStyle_put_borderRightWidth
,
2575 HTMLStyle_get_borderRightWidth
,
2576 HTMLStyle_put_borderBottomWidth
,
2577 HTMLStyle_get_borderBottomWidth
,
2578 HTMLStyle_put_borderLeftWidth
,
2579 HTMLStyle_get_borderLeftWidth
,
2580 HTMLStyle_put_borderStyle
,
2581 HTMLStyle_get_borderStyle
,
2582 HTMLStyle_put_borderTopStyle
,
2583 HTMLStyle_get_borderTopStyle
,
2584 HTMLStyle_put_borderRightStyle
,
2585 HTMLStyle_get_borderRightStyle
,
2586 HTMLStyle_put_borderBottomStyle
,
2587 HTMLStyle_get_borderBottomStyle
,
2588 HTMLStyle_put_borderLeftStyle
,
2589 HTMLStyle_get_borderLeftStyle
,
2590 HTMLStyle_put_width
,
2591 HTMLStyle_get_width
,
2592 HTMLStyle_put_height
,
2593 HTMLStyle_get_height
,
2594 HTMLStyle_put_styleFloat
,
2595 HTMLStyle_get_styleFloat
,
2596 HTMLStyle_put_clear
,
2597 HTMLStyle_get_clear
,
2598 HTMLStyle_put_display
,
2599 HTMLStyle_get_display
,
2600 HTMLStyle_put_visibility
,
2601 HTMLStyle_get_visibility
,
2602 HTMLStyle_put_listStyleType
,
2603 HTMLStyle_get_listStyleType
,
2604 HTMLStyle_put_listStylePosition
,
2605 HTMLStyle_get_listStylePosition
,
2606 HTMLStyle_put_listStyleImage
,
2607 HTMLStyle_get_listStyleImage
,
2608 HTMLStyle_put_listStyle
,
2609 HTMLStyle_get_listStyle
,
2610 HTMLStyle_put_whiteSpace
,
2611 HTMLStyle_get_whiteSpace
,
2616 HTMLStyle_get_position
,
2617 HTMLStyle_put_zIndex
,
2618 HTMLStyle_get_zIndex
,
2619 HTMLStyle_put_overflow
,
2620 HTMLStyle_get_overflow
,
2621 HTMLStyle_put_pageBreakBefore
,
2622 HTMLStyle_get_pageBreakBefore
,
2623 HTMLStyle_put_pageBreakAfter
,
2624 HTMLStyle_get_pageBreakAfter
,
2625 HTMLStyle_put_cssText
,
2626 HTMLStyle_get_cssText
,
2627 HTMLStyle_put_pixelTop
,
2628 HTMLStyle_get_pixelTop
,
2629 HTMLStyle_put_pixelLeft
,
2630 HTMLStyle_get_pixelLeft
,
2631 HTMLStyle_put_pixelWidth
,
2632 HTMLStyle_get_pixelWidth
,
2633 HTMLStyle_put_pixelHeight
,
2634 HTMLStyle_get_pixelHeight
,
2635 HTMLStyle_put_posTop
,
2636 HTMLStyle_get_posTop
,
2637 HTMLStyle_put_posLeft
,
2638 HTMLStyle_get_posLeft
,
2639 HTMLStyle_put_posWidth
,
2640 HTMLStyle_get_posWidth
,
2641 HTMLStyle_put_posHeight
,
2642 HTMLStyle_get_posHeight
,
2643 HTMLStyle_put_cursor
,
2644 HTMLStyle_get_cursor
,
2647 HTMLStyle_put_filter
,
2648 HTMLStyle_get_filter
,
2649 HTMLStyle_setAttribute
,
2650 HTMLStyle_getAttribute
,
2651 HTMLStyle_removeAttribute
,
2655 static const dispex_static_data_vtbl_t HTMLStyle_dispex_vtbl
= {
2657 HTMLStyle_get_dispid
,
2661 static const tid_t HTMLStyle_iface_tids
[] = {
2668 static dispex_static_data_t HTMLStyle_dispex
= {
2669 &HTMLStyle_dispex_vtbl
,
2672 HTMLStyle_iface_tids
2675 IHTMLStyle
*HTMLStyle_Create(nsIDOMCSSStyleDeclaration
*nsstyle
)
2677 HTMLStyle
*ret
= heap_alloc_zero(sizeof(HTMLStyle
));
2679 ret
->lpHTMLStyleVtbl
= &HTMLStyleVtbl
;
2681 ret
->nsstyle
= nsstyle
;
2682 HTMLStyle2_Init(ret
);
2683 HTMLStyle3_Init(ret
);
2685 nsIDOMCSSStyleDeclaration_AddRef(nsstyle
);
2687 init_dispex(&ret
->dispex
, (IUnknown
*)HTMLSTYLE(ret
), &HTMLStyle_dispex
);
2689 return HTMLSTYLE(ret
);