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
19 #include "mshtml_private.h"
21 static const WCHAR attrBackground
[] =
22 {'b','a','c','k','g','r','o','u','n','d',0};
23 static const WCHAR attrBackgroundColor
[] =
24 {'b','a','c','k','g','r','o','u','n','d','-','c','o','l','o','r',0};
25 static const WCHAR attrBackgroundImage
[] =
26 {'b','a','c','k','g','r','o','u','n','d','-','i','m','a','g','e',0};
27 static const WCHAR attrBackgroundPosition
[] =
28 {'b','a','c','k','g','r','o','u','n','d','-','p','o','s','i','t','i','o','n',0};
29 static const WCHAR attrBackgroundPositionX
[] =
30 {'b','a','c','k','g','r','o','u','n','d','-','p','o','s','i','t','i','o','n','-','x',0};
31 static const WCHAR attrBackgroundPositionY
[] =
32 {'b','a','c','k','g','r','o','u','n','d','-','p','o','s','i','t','i','o','n','-','y',0};
33 static const WCHAR attrBackgroundRepeat
[] =
34 {'b','a','c','k','g','r','o','u','n','d','-','r','e','p','e','a','t',0};
35 static const WCHAR attrBorder
[] =
36 {'b','o','r','d','e','r',0};
37 static const WCHAR attrBorderBottom
[] =
38 {'b','o','r','d','e','r','-','b','o','t','t','o','m',0};
39 static const WCHAR attrBorderBottomColor
[] =
40 {'b','o','r','d','e','r','-','b','o','t','t','o','m','-','c','o','l','o','r',0};
41 static const WCHAR attrBorderBottomStyle
[] =
42 {'b','o','r','d','e','r','-','b','o','t','t','o','m','-','s','t','y','l','e',0};
43 static const WCHAR attrBorderBottomWidth
[] =
44 {'b','o','r','d','e','r','-','b','o','t','t','o','m','-','w','i','d','t','h',0};
45 static const WCHAR attrBorderColor
[] =
46 {'b','o','r','d','e','r','-','c','o','l','o','r',0};
47 static const WCHAR attrBorderLeft
[] =
48 {'b','o','r','d','e','r','-','l','e','f','t',0};
49 static const WCHAR attrBorderLeftColor
[] =
50 {'b','o','r','d','e','r','-','l','e','f','t','-','c','o','l','o','r',0};
51 static const WCHAR attrBorderLeftStyle
[] =
52 {'b','o','r','d','e','r','-','l','e','f','t','-','s','t','y','l','e',0};
53 static const WCHAR attrBorderLeftWidth
[] =
54 {'b','o','r','d','e','r','-','l','e','f','t','-','w','i','d','t','h',0};
55 static const WCHAR attrBorderRight
[] =
56 {'b','o','r','d','e','r','-','r','i','g','h','t',0};
57 static const WCHAR attrBorderRightColor
[] =
58 {'b','o','r','d','e','r','-','r','i','g','h','t','-','c','o','l','o','r',0};
59 static const WCHAR attrBorderRightStyle
[] =
60 {'b','o','r','d','e','r','-','r','i','g','h','t','-','s','t','y','l','e',0};
61 static const WCHAR attrBorderRightWidth
[] =
62 {'b','o','r','d','e','r','-','r','i','g','h','t','-','w','i','d','t','h',0};
63 static const WCHAR attrBorderTop
[] =
64 {'b','o','r','d','e','r','-','t','o','p',0};
65 static const WCHAR attrBorderTopColor
[] =
66 {'b','o','r','d','e','r','-','t','o','p','-','c','o','l','o','r',0};
67 static const WCHAR attrBorderStyle
[] =
68 {'b','o','r','d','e','r','-','s','t','y','l','e',0};
69 static const WCHAR attrBorderTopStyle
[] =
70 {'b','o','r','d','e','r','-','t','o','p','-','s','t','y','l','e',0};
71 static const WCHAR attrBorderTopWidth
[] =
72 {'b','o','r','d','e','r','-','t','o','p','-','w','i','d','t','h',0};
73 static const WCHAR attrBorderWidth
[] =
74 {'b','o','r','d','e','r','-','w','i','d','t','h',0};
75 static const WCHAR attrBottom
[] =
76 {'b','o','t','t','o','m',0};
77 static const WCHAR attrClear
[] =
78 {'c','l','e','a','r',0};
79 static const WCHAR attrClip
[] =
81 static const WCHAR attrColor
[] =
82 {'c','o','l','o','r',0};
83 static const WCHAR attrCursor
[] =
84 {'c','u','r','s','o','r',0};
85 static const WCHAR attrDirection
[] =
86 {'d','i','r','e','c','t','i','o','n',0};
87 static const WCHAR attrDisplay
[] =
88 {'d','i','s','p','l','a','y',0};
89 static const WCHAR attrFilter
[] =
90 {'f','i','l','e','t','e','r',0};
91 static const WCHAR attrFontFamily
[] =
92 {'f','o','n','t','-','f','a','m','i','l','y',0};
93 static const WCHAR attrFontSize
[] =
94 {'f','o','n','t','-','s','i','z','e',0};
95 static const WCHAR attrFontStyle
[] =
96 {'f','o','n','t','-','s','t','y','l','e',0};
97 static const WCHAR attrFontVariant
[] =
98 {'f','o','n','t','-','v','a','r','i','a','n','t',0};
99 static const WCHAR attrFontWeight
[] =
100 {'f','o','n','t','-','w','e','i','g','h','t',0};
101 static const WCHAR attrHeight
[] =
102 {'h','e','i','g','h','t',0};
103 static const WCHAR attrLeft
[] =
105 static const WCHAR attrLetterSpacing
[] =
106 {'l','e','t','t','e','r','-','s','p','a','c','i','n','g',0};
107 static const WCHAR attrLineHeight
[] =
108 {'l','i','n','e','-','h','e','i','g','h','t',0};
109 static const WCHAR attrMargin
[] =
110 {'m','a','r','g','i','n',0};
111 static const WCHAR attrMarginBottom
[] =
112 {'m','a','r','g','i','n','-','b','o','t','t','o','m',0};
113 static const WCHAR attrMarginLeft
[] =
114 {'m','a','r','g','i','n','-','l','e','f','t',0};
115 static const WCHAR attrMarginRight
[] =
116 {'m','a','r','g','i','n','-','r','i','g','h','t',0};
117 static const WCHAR attrMarginTop
[] =
118 {'m','a','r','g','i','n','-','t','o','p',0};
119 static const WCHAR attrMinHeight
[] =
120 {'m','i','n','-','h','e','i','g','h','t',0};
121 static const WCHAR attrOverflow
[] =
122 {'o','v','e','r','f','l','o','w',0};
123 static const WCHAR attrOverflowX
[] =
124 {'o','v','e','r','f','l','o','w','-','x',0};
125 static const WCHAR attrOverflowY
[] =
126 {'o','v','e','r','f','l','o','w','-','y',0};
127 static const WCHAR attrPadding
[] =
128 {'p','a','d','d','i','n','g',0};
129 static const WCHAR attrPaddingBottom
[] =
130 {'p','a','d','d','i','n','g','-','b','o','t','t','o','m',0};
131 static const WCHAR attrPaddingLeft
[] =
132 {'p','a','d','d','i','n','g','-','l','e','f','t',0};
133 static const WCHAR attrPaddingRight
[] =
134 {'p','a','d','d','i','n','g','-','r','i','g','h','t',0};
135 static const WCHAR attrPaddingTop
[] =
136 {'p','a','d','d','i','n','g','-','t','o','p',0};
137 static const WCHAR attrPageBreakAfter
[] =
138 {'p','a','g','e','-','b','r','e','a','k','-','a','f','t','e','r',0};
139 static const WCHAR attrPageBreakBefore
[] =
140 {'p','a','g','e','-','b','r','e','a','k','-','b','e','f','o','r','e',0};
141 static const WCHAR attrPosition
[] =
142 {'p','o','s','i','t','i','o','n',0};
143 static const WCHAR attrRight
[] =
144 {'r','i','g','h','t',0};
145 static const WCHAR attrTextAlign
[] =
146 {'t','e','x','t','-','a','l','i','g','n',0};
147 static const WCHAR attrTextDecoration
[] =
148 {'t','e','x','t','-','d','e','c','o','r','a','t','i','o','n',0};
149 static const WCHAR attrTextIndent
[] =
150 {'t','e','x','t','-','i','n','d','e','n','t',0};
151 static const WCHAR attrTop
[] =
153 static const WCHAR attrVerticalAlign
[] =
154 {'v','e','r','t','i','c','a','l','-','a','l','i','g','n',0};
155 static const WCHAR attrVisibility
[] =
156 {'v','i','s','i','b','i','l','i','t','y',0};
157 static const WCHAR attrWhiteSpace
[] =
158 {'w','h','i','t','e','-','s','p','a','c','e',0};
159 static const WCHAR attrWidth
[] =
160 {'w','i','d','t','h',0};
161 static const WCHAR attrWordSpacing
[] =
162 {'w','o','r','d','-','s','p','a','c','i','n','g',0};
163 static const WCHAR attrWordWrap
[] =
164 {'w','o','r','d','-','w','r','a','p',0};
165 static const WCHAR attrZIndex
[] =
166 {'z','-','i','n','d','e','x',0};
169 static const WCHAR pxW
[] = {'p','x',0};
176 static const style_tbl_entry_t style_tbl
[] = {
177 {attrBackground
, DISPID_IHTMLSTYLE_BACKGROUND
},
178 {attrBackgroundColor
, DISPID_IHTMLSTYLE_BACKGROUNDCOLOR
},
179 {attrBackgroundImage
, DISPID_IHTMLSTYLE_BACKGROUNDIMAGE
},
180 {attrBackgroundPosition
, DISPID_IHTMLSTYLE_BACKGROUNDPOSITION
},
181 {attrBackgroundPositionX
, DISPID_IHTMLSTYLE_BACKGROUNDPOSITIONX
},
182 {attrBackgroundPositionY
, DISPID_IHTMLSTYLE_BACKGROUNDPOSITIONY
},
183 {attrBackgroundRepeat
, DISPID_IHTMLSTYLE_BACKGROUNDREPEAT
},
184 {attrBorder
, DISPID_IHTMLSTYLE_BORDER
},
185 {attrBorderBottom
, DISPID_IHTMLSTYLE_BORDERBOTTOM
},
186 {attrBorderBottomColor
, DISPID_IHTMLSTYLE_BORDERBOTTOMCOLOR
},
187 {attrBorderBottomStyle
, DISPID_IHTMLSTYLE_BORDERBOTTOMSTYLE
},
188 {attrBorderBottomWidth
, DISPID_IHTMLSTYLE_BORDERBOTTOMWIDTH
},
189 {attrBorderColor
, DISPID_IHTMLSTYLE_BORDERCOLOR
},
190 {attrBorderLeft
, DISPID_IHTMLSTYLE_BORDERLEFT
},
191 {attrBorderLeftColor
, DISPID_IHTMLSTYLE_BORDERLEFTCOLOR
},
192 {attrBorderLeftStyle
, DISPID_IHTMLSTYLE_BORDERLEFTSTYLE
},
193 {attrBorderLeftWidth
, DISPID_IHTMLSTYLE_BORDERLEFTWIDTH
},
194 {attrBorderRight
, DISPID_IHTMLSTYLE_BORDERRIGHT
},
195 {attrBorderRightColor
, DISPID_IHTMLSTYLE_BORDERRIGHTCOLOR
},
196 {attrBorderRightStyle
, DISPID_IHTMLSTYLE_BORDERRIGHTSTYLE
},
197 {attrBorderRightWidth
, DISPID_IHTMLSTYLE_BORDERRIGHTWIDTH
},
198 {attrBorderStyle
, DISPID_IHTMLSTYLE_BORDERSTYLE
},
199 {attrBorderTop
, DISPID_IHTMLSTYLE_BORDERTOP
},
200 {attrBorderTopColor
, DISPID_IHTMLSTYLE_BORDERTOPCOLOR
},
201 {attrBorderTopStyle
, DISPID_IHTMLSTYLE_BORDERTOPSTYLE
},
202 {attrBorderTopWidth
, DISPID_IHTMLSTYLE_BORDERTOPWIDTH
},
203 {attrBorderWidth
, DISPID_IHTMLSTYLE_BORDERWIDTH
},
204 {attrBottom
, DISPID_IHTMLSTYLE2_BOTTOM
},
205 {attrClear
, DISPID_IHTMLSTYLE_CLEAR
},
206 {attrClip
, DISPID_IHTMLSTYLE_CLIP
},
207 {attrColor
, DISPID_IHTMLSTYLE_COLOR
},
208 {attrCursor
, DISPID_IHTMLSTYLE_CURSOR
},
209 {attrDirection
, DISPID_IHTMLSTYLE2_DIRECTION
},
210 {attrDisplay
, DISPID_IHTMLSTYLE_DISPLAY
},
211 {attrFilter
, DISPID_IHTMLSTYLE_FILTER
},
212 {attrFontFamily
, DISPID_IHTMLSTYLE_FONTFAMILY
},
213 {attrFontSize
, DISPID_IHTMLSTYLE_FONTSIZE
},
214 {attrFontStyle
, DISPID_IHTMLSTYLE_FONTSTYLE
},
215 {attrFontVariant
, DISPID_IHTMLSTYLE_FONTVARIANT
},
216 {attrFontWeight
, DISPID_IHTMLSTYLE_FONTWEIGHT
},
217 {attrHeight
, DISPID_IHTMLSTYLE_HEIGHT
},
218 {attrLeft
, DISPID_IHTMLSTYLE_LEFT
},
219 {attrLetterSpacing
, DISPID_IHTMLSTYLE_LETTERSPACING
},
220 {attrLineHeight
, DISPID_IHTMLSTYLE_LINEHEIGHT
},
221 {attrMargin
, DISPID_IHTMLSTYLE_MARGIN
},
222 {attrMarginBottom
, DISPID_IHTMLSTYLE_MARGINBOTTOM
},
223 {attrMarginLeft
, DISPID_IHTMLSTYLE_MARGINLEFT
},
224 {attrMarginRight
, DISPID_IHTMLSTYLE_MARGINRIGHT
},
225 {attrMarginTop
, DISPID_IHTMLSTYLE_MARGINTOP
},
226 {attrMinHeight
, DISPID_IHTMLSTYLE4_MINHEIGHT
},
227 {attrOverflow
, DISPID_IHTMLSTYLE_OVERFLOW
},
228 {attrOverflowX
, DISPID_IHTMLSTYLE2_OVERFLOWX
},
229 {attrOverflowY
, DISPID_IHTMLSTYLE2_OVERFLOWY
},
230 {attrPadding
, DISPID_IHTMLSTYLE_PADDING
},
231 {attrPaddingBottom
, DISPID_IHTMLSTYLE_PADDINGBOTTOM
},
232 {attrPaddingLeft
, DISPID_IHTMLSTYLE_PADDINGLEFT
},
233 {attrPaddingRight
, DISPID_IHTMLSTYLE_PADDINGRIGHT
},
234 {attrPaddingTop
, DISPID_IHTMLSTYLE_PADDINGTOP
},
235 {attrPageBreakAfter
, DISPID_IHTMLSTYLE_PAGEBREAKAFTER
},
236 {attrPageBreakBefore
, DISPID_IHTMLSTYLE_PAGEBREAKBEFORE
},
237 {attrPosition
, DISPID_IHTMLSTYLE2_POSITION
},
238 {attrRight
, DISPID_IHTMLSTYLE2_RIGHT
},
239 {attrTextAlign
, DISPID_IHTMLSTYLE_TEXTALIGN
},
240 {attrTextDecoration
, DISPID_IHTMLSTYLE_TEXTDECORATION
},
241 {attrTextIndent
, DISPID_IHTMLSTYLE_TEXTINDENT
},
242 {attrTop
, DISPID_IHTMLSTYLE_TOP
},
243 {attrVerticalAlign
, DISPID_IHTMLSTYLE_VERTICALALIGN
},
244 {attrVisibility
, DISPID_IHTMLSTYLE_VISIBILITY
},
245 {attrWhiteSpace
, DISPID_IHTMLSTYLE_WHITESPACE
},
246 {attrWidth
, DISPID_IHTMLSTYLE_WIDTH
},
247 {attrWordSpacing
, DISPID_IHTMLSTYLE_WORDSPACING
},
248 {attrWordWrap
, DISPID_IHTMLSTYLE3_WORDWRAP
},
249 {attrZIndex
, DISPID_IHTMLSTYLE_ZINDEX
}
252 static const WCHAR valLineThrough
[] =
253 {'l','i','n','e','-','t','h','r','o','u','g','h',0};
254 static const WCHAR valUnderline
[] =
255 {'u','n','d','e','r','l','i','n','e',0};
256 static const WCHAR szNormal
[] =
257 {'n','o','r','m','a','l',0};
258 static const WCHAR styleNone
[] =
260 static const WCHAR valOverline
[] =
261 {'o','v','e','r','l','i','n','e',0};
262 static const WCHAR valBlink
[] =
263 {'b','l','i','n','k',0};
265 static const WCHAR px_formatW
[] = {'%','d','p','x',0};
266 static const WCHAR emptyW
[] = {0};
268 static const style_tbl_entry_t
*lookup_style_tbl(const WCHAR
*name
)
270 int c
, i
, min
= 0, max
= sizeof(style_tbl
)/sizeof(*style_tbl
)-1;
275 c
= strcmpW(style_tbl
[i
].name
, name
);
288 static LPWSTR
fix_px_value(LPCWSTR val
)
293 while(*ptr
&& isspaceW(*ptr
))
298 while(*ptr
&& isdigitW(*ptr
))
301 if(!*ptr
|| isspaceW(*ptr
)) {
303 int len
= strlenW(val
)+1;
305 ret
= heap_alloc((len
+2)*sizeof(WCHAR
));
306 memcpy(ret
, val
, (ptr
-val
)*sizeof(WCHAR
));
312 TRACE("fixed %s -> %s\n", debugstr_w(val
), debugstr_w(ret
));
317 while(*ptr
&& !isspaceW(*ptr
))
324 static LPWSTR
fix_url_value(LPCWSTR val
)
328 static const WCHAR urlW
[] = {'u','r','l','('};
330 if(strncmpW(val
, urlW
, sizeof(urlW
)/sizeof(WCHAR
)) || !strchrW(val
, '\\'))
333 ret
= heap_strdupW(val
);
335 for(ptr
= ret
; *ptr
; ptr
++) {
343 HRESULT
set_nsstyle_attr(nsIDOMCSSStyleDeclaration
*nsstyle
, styleid_t sid
, const WCHAR
*value
, DWORD flags
)
345 nsAString str_name
, str_value
, str_empty
;
350 if(flags
& ATTR_FIX_PX
)
351 val
= fix_px_value(value
);
352 if(flags
& ATTR_FIX_URL
)
353 val
= fix_url_value(value
);
356 nsAString_InitDepend(&str_name
, style_tbl
[sid
].name
);
357 nsAString_InitDepend(&str_value
, val
? val
: value
);
358 nsAString_InitDepend(&str_empty
, emptyW
);
360 nsres
= nsIDOMCSSStyleDeclaration_SetProperty(nsstyle
, &str_name
, &str_value
, &str_empty
);
362 ERR("SetProperty failed: %08x\n", nsres
);
364 nsAString_Finish(&str_name
);
365 nsAString_Finish(&str_value
);
366 nsAString_Finish(&str_empty
);
372 static HRESULT
var_to_styleval(const VARIANT
*v
, WCHAR
*buf
, DWORD flags
, const WCHAR
**ret
)
383 case VT_BSTR
|VT_BYREF
:
384 *ret
= *V_BSTRREF(v
);
388 static const WCHAR formatW
[] = {'%','d',0};
389 static const WCHAR hex_formatW
[] = {'#','%','0','6','x',0};
391 if(flags
& ATTR_HEX_INT
)
392 wsprintfW(buf
, hex_formatW
, V_I4(v
));
393 else if(flags
& ATTR_FIX_PX
)
394 wsprintfW(buf
, px_formatW
, V_I4(v
));
396 wsprintfW(buf
, formatW
, V_I4(v
));
402 FIXME("not implemented for %s\n", debugstr_variant(v
));
408 HRESULT
set_nsstyle_attr_var(nsIDOMCSSStyleDeclaration
*nsstyle
, styleid_t sid
, VARIANT
*value
, DWORD flags
)
414 hres
= var_to_styleval(value
, buf
, flags
, &val
);
418 return set_nsstyle_attr(nsstyle
, sid
, val
, flags
);
421 static inline HRESULT
set_style_attr(HTMLStyle
*This
, styleid_t sid
, LPCWSTR value
, DWORD flags
)
423 return set_nsstyle_attr(This
->nsstyle
, sid
, value
, flags
);
426 static HRESULT
get_nsstyle_attr_nsval(nsIDOMCSSStyleDeclaration
*nsstyle
, styleid_t sid
, nsAString
*value
)
431 nsAString_InitDepend(&str_name
, style_tbl
[sid
].name
);
433 nsres
= nsIDOMCSSStyleDeclaration_GetPropertyValue(nsstyle
, &str_name
, value
);
434 if(NS_FAILED(nsres
)) {
435 ERR("SetProperty failed: %08x\n", nsres
);
439 nsAString_Finish(&str_name
);
444 static HRESULT
nsstyle_to_bstr(const WCHAR
*val
, DWORD flags
, BSTR
*p
)
454 ret
= SysAllocString(val
);
456 return E_OUTOFMEMORY
;
458 len
= SysStringLen(ret
);
460 if(flags
& ATTR_REMOVE_COMMA
) {
464 for(ptr
= ret
; (ptr
= strchrW(ptr
, ',')); ptr
++)
470 new_ret
= SysAllocStringLen(NULL
, new_len
);
473 return E_OUTOFMEMORY
;
476 for(ptr2
= new_ret
, ptr
= ret
; *ptr
; ptr
++) {
490 HRESULT
get_nsstyle_attr(nsIDOMCSSStyleDeclaration
*nsstyle
, styleid_t sid
, BSTR
*p
, DWORD flags
)
493 const PRUnichar
*value
;
496 nsAString_Init(&str_value
, NULL
);
498 get_nsstyle_attr_nsval(nsstyle
, sid
, &str_value
);
500 nsAString_GetData(&str_value
, &value
);
501 hres
= nsstyle_to_bstr(value
, flags
, p
);
502 nsAString_Finish(&str_value
);
504 TRACE("%s -> %s\n", debugstr_w(style_tbl
[sid
].name
), debugstr_w(*p
));
508 HRESULT
get_nsstyle_attr_var(nsIDOMCSSStyleDeclaration
*nsstyle
, styleid_t sid
, VARIANT
*p
, DWORD flags
)
511 const PRUnichar
*value
;
515 nsAString_Init(&str_value
, NULL
);
517 get_nsstyle_attr_nsval(nsstyle
, sid
, &str_value
);
519 nsAString_GetData(&str_value
, &value
);
521 if(flags
& ATTR_STR_TO_INT
) {
522 const PRUnichar
*ptr
= value
;
531 while(isdigitW(*ptr
))
532 i
= i
*10 + (*ptr
++ - '0');
536 V_I4(p
) = neg
? -i
: i
;
544 hres
= nsstyle_to_bstr(value
, flags
, &str
);
545 if(SUCCEEDED(hres
)) {
551 nsAString_Finish(&str_value
);
553 TRACE("%s -> %s\n", debugstr_w(style_tbl
[sid
].name
), debugstr_variant(p
));
557 static inline HRESULT
get_style_attr(HTMLStyle
*This
, styleid_t sid
, BSTR
*p
)
559 return get_nsstyle_attr(This
->nsstyle
, sid
, p
, 0);
562 static HRESULT
check_style_attr_value(HTMLStyle
*This
, styleid_t sid
, LPCWSTR exval
, VARIANT_BOOL
*p
)
565 const PRUnichar
*value
;
567 nsAString_Init(&str_value
, NULL
);
569 get_nsstyle_attr_nsval(This
->nsstyle
, sid
, &str_value
);
571 nsAString_GetData(&str_value
, &value
);
572 *p
= strcmpW(value
, exval
) ? VARIANT_FALSE
: VARIANT_TRUE
;
573 nsAString_Finish(&str_value
);
575 TRACE("%s -> %x\n", debugstr_w(style_tbl
[sid
].name
), *p
);
579 static inline HRESULT
set_style_pos(HTMLStyle
*This
, styleid_t sid
, float value
)
582 WCHAR szFormat
[] = {'%','.','0','f','p','x',0};
584 value
= floor(value
);
586 sprintfW(szValue
, szFormat
, value
);
588 return set_style_attr(This
, sid
, szValue
, 0);
591 static HRESULT
set_style_pxattr(nsIDOMCSSStyleDeclaration
*nsstyle
, styleid_t sid
, LONG value
)
595 sprintfW(value_str
, px_formatW
, value
);
597 return set_nsstyle_attr(nsstyle
, sid
, value_str
, 0);
600 static HRESULT
get_nsstyle_pos(HTMLStyle
*This
, styleid_t sid
, float *p
)
605 TRACE("%p %d %p\n", This
, sid
, p
);
609 nsAString_Init(&str_value
, NULL
);
611 hres
= get_nsstyle_attr_nsval(This
->nsstyle
, sid
, &str_value
);
615 const PRUnichar
*value
;
617 nsAString_GetData(&str_value
, &value
);
620 *p
= strtolW(value
, &ptr
, 10);
622 if(*ptr
&& strcmpW(ptr
, pxW
))
624 nsAString_Finish(&str_value
);
625 FIXME("only px values are currently supported\n");
631 TRACE("ret %f\n", *p
);
633 nsAString_Finish(&str_value
);
637 static HRESULT
get_nsstyle_pixel_val(HTMLStyle
*This
, styleid_t sid
, LONG
*p
)
642 nsAString_Init(&str_value
, NULL
);
644 hres
= get_nsstyle_attr_nsval(This
->nsstyle
, sid
, &str_value
);
647 const PRUnichar
*value
;
649 nsAString_GetData(&str_value
, &value
);
651 *p
= strtolW(value
, &ptr
, 10);
654 /* Skip all digits. We have tests showing that we should not round the value. */
655 while(isdigitW(*++ptr
));
658 if(*ptr
&& strcmpW(ptr
, pxW
)) {
659 nsAString_Finish(&str_value
);
660 FIXME("%s: only px values are currently supported\n", debugstr_w(value
));
668 nsAString_Finish(&str_value
);
672 static BOOL
is_valid_border_style(BSTR v
)
674 static const WCHAR styleDotted
[] = {'d','o','t','t','e','d',0};
675 static const WCHAR styleDashed
[] = {'d','a','s','h','e','d',0};
676 static const WCHAR styleSolid
[] = {'s','o','l','i','d',0};
677 static const WCHAR styleDouble
[] = {'d','o','u','b','l','e',0};
678 static const WCHAR styleGroove
[] = {'g','r','o','o','v','e',0};
679 static const WCHAR styleRidge
[] = {'r','i','d','g','e',0};
680 static const WCHAR styleInset
[] = {'i','n','s','e','t',0};
681 static const WCHAR styleOutset
[] = {'o','u','t','s','e','t',0};
683 TRACE("%s\n", debugstr_w(v
));
685 if(!v
|| strcmpiW(v
, styleNone
) == 0 || strcmpiW(v
, styleDotted
) == 0 ||
686 strcmpiW(v
, styleDashed
) == 0 || strcmpiW(v
, styleSolid
) == 0 ||
687 strcmpiW(v
, styleDouble
) == 0 || strcmpiW(v
, styleGroove
) == 0 ||
688 strcmpiW(v
, styleRidge
) == 0 || strcmpiW(v
, styleInset
) == 0 ||
689 strcmpiW(v
, styleOutset
) == 0 )
697 static inline HTMLStyle
*impl_from_IHTMLStyle(IHTMLStyle
*iface
)
699 return CONTAINING_RECORD(iface
, HTMLStyle
, IHTMLStyle_iface
);
702 static HRESULT WINAPI
HTMLStyle_QueryInterface(IHTMLStyle
*iface
, REFIID riid
, void **ppv
)
704 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
708 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
709 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppv
);
710 *ppv
= &This
->IHTMLStyle_iface
;
711 }else if(IsEqualGUID(&IID_IHTMLStyle
, riid
)) {
712 TRACE("(%p)->(IID_IHTMLStyle %p)\n", This
, ppv
);
713 *ppv
= &This
->IHTMLStyle_iface
;
714 }else if(IsEqualGUID(&IID_IHTMLStyle2
, riid
)) {
715 TRACE("(%p)->(IID_IHTMLStyle2 %p)\n", This
, ppv
);
716 *ppv
= &This
->IHTMLStyle2_iface
;
717 }else if(IsEqualGUID(&IID_IHTMLStyle3
, riid
)) {
718 TRACE("(%p)->(IID_IHTMLStyle3 %p)\n", This
, ppv
);
719 *ppv
= &This
->IHTMLStyle3_iface
;
720 }else if(IsEqualGUID(&IID_IHTMLStyle4
, riid
)) {
721 TRACE("(%p)->(IID_IHTMLStyle4 %p)\n", This
, ppv
);
722 *ppv
= &This
->IHTMLStyle4_iface
;
723 }else if(IsEqualGUID(&IID_IHTMLStyle5
, riid
)) {
724 TRACE("(%p)->(IID_IHTMLStyle5 %p)\n", This
, ppv
);
725 *ppv
= &This
->IHTMLStyle5_iface
;
726 }else if(IsEqualGUID(&IID_IHTMLStyle6
, riid
)) {
727 TRACE("(%p)->(IID_IHTMLStyle6 %p)\n", This
, ppv
);
728 *ppv
= &This
->IHTMLStyle6_iface
;
729 }else if(dispex_query_interface(&This
->dispex
, riid
, ppv
)) {
730 return *ppv
? S_OK
: E_NOINTERFACE
;
734 IUnknown_AddRef((IUnknown
*)*ppv
);
738 WARN("unsupported %s\n", debugstr_guid(riid
));
739 return E_NOINTERFACE
;
742 static ULONG WINAPI
HTMLStyle_AddRef(IHTMLStyle
*iface
)
744 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
745 LONG ref
= InterlockedIncrement(&This
->ref
);
747 TRACE("(%p) ref=%d\n", This
, ref
);
752 static ULONG WINAPI
HTMLStyle_Release(IHTMLStyle
*iface
)
754 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
755 LONG ref
= InterlockedDecrement(&This
->ref
);
757 TRACE("(%p) ref=%d\n", This
, ref
);
762 nsIDOMCSSStyleDeclaration_Release(This
->nsstyle
);
763 release_dispex(&This
->dispex
);
770 static HRESULT WINAPI
HTMLStyle_GetTypeInfoCount(IHTMLStyle
*iface
, UINT
*pctinfo
)
772 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
773 return IDispatchEx_GetTypeInfoCount(&This
->dispex
.IDispatchEx_iface
, pctinfo
);
776 static HRESULT WINAPI
HTMLStyle_GetTypeInfo(IHTMLStyle
*iface
, UINT iTInfo
,
777 LCID lcid
, ITypeInfo
**ppTInfo
)
779 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
780 return IDispatchEx_GetTypeInfo(&This
->dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
783 static HRESULT WINAPI
HTMLStyle_GetIDsOfNames(IHTMLStyle
*iface
, REFIID riid
,
784 LPOLESTR
*rgszNames
, UINT cNames
,
785 LCID lcid
, DISPID
*rgDispId
)
787 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
788 return IDispatchEx_GetIDsOfNames(&This
->dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
792 static HRESULT WINAPI
HTMLStyle_Invoke(IHTMLStyle
*iface
, DISPID dispIdMember
,
793 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
794 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
796 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
797 return IDispatchEx_Invoke(&This
->dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
798 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
801 static HRESULT WINAPI
HTMLStyle_put_fontFamily(IHTMLStyle
*iface
, BSTR v
)
803 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
805 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
807 return set_style_attr(This
, STYLEID_FONT_FAMILY
, v
, 0);
810 static HRESULT WINAPI
HTMLStyle_get_fontFamily(IHTMLStyle
*iface
, BSTR
*p
)
812 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
814 TRACE("(%p)->(%p)\n", This
, p
);
816 return get_style_attr(This
, STYLEID_FONT_FAMILY
, p
);
819 static HRESULT WINAPI
HTMLStyle_put_fontStyle(IHTMLStyle
*iface
, BSTR v
)
821 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
822 static const WCHAR szItalic
[] = {'i','t','a','l','i','c',0};
823 static const WCHAR szOblique
[] = {'o','b','l','i','q','u','e',0};
825 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
827 /* fontStyle can only be one of the follow values. */
828 if(!v
|| strcmpiW(szNormal
, v
) == 0 || strcmpiW(szItalic
, v
) == 0 ||
829 strcmpiW(szOblique
, v
) == 0)
831 return set_nsstyle_attr(This
->nsstyle
, STYLEID_FONT_STYLE
, v
, 0);
837 static HRESULT WINAPI
HTMLStyle_get_fontStyle(IHTMLStyle
*iface
, BSTR
*p
)
839 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
841 TRACE("(%p)->(%p)\n", This
, p
);
843 return get_style_attr(This
, STYLEID_FONT_STYLE
, p
);
846 static HRESULT WINAPI
HTMLStyle_put_fontVariant(IHTMLStyle
*iface
, BSTR v
)
848 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
849 static const WCHAR szCaps
[] = {'s','m','a','l','l','-','c','a','p','s',0};
851 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
853 /* fontVariant can only be one of the follow values. */
854 if(!v
|| strcmpiW(szNormal
, v
) == 0 || strcmpiW(szCaps
, v
) == 0)
856 return set_nsstyle_attr(This
->nsstyle
, STYLEID_FONT_VARIANT
, v
, 0);
862 static HRESULT WINAPI
HTMLStyle_get_fontVariant(IHTMLStyle
*iface
, BSTR
*p
)
864 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
865 TRACE("(%p)->(%p)\n", This
, p
);
870 return get_style_attr(This
, STYLEID_FONT_VARIANT
, p
);
873 static HRESULT WINAPI
HTMLStyle_put_fontWeight(IHTMLStyle
*iface
, BSTR v
)
875 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
876 static const WCHAR styleBold
[] = {'b','o','l','d',0};
877 static const WCHAR styleBolder
[] = {'b','o','l','d','e','r',0};
878 static const WCHAR styleLighter
[] = {'l','i','g','h','t','e','r',0};
879 static const WCHAR style100
[] = {'1','0','0',0};
880 static const WCHAR style200
[] = {'2','0','0',0};
881 static const WCHAR style300
[] = {'3','0','0',0};
882 static const WCHAR style400
[] = {'4','0','0',0};
883 static const WCHAR style500
[] = {'5','0','0',0};
884 static const WCHAR style600
[] = {'6','0','0',0};
885 static const WCHAR style700
[] = {'7','0','0',0};
886 static const WCHAR style800
[] = {'8','0','0',0};
887 static const WCHAR style900
[] = {'9','0','0',0};
889 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
891 /* fontWeight can only be one of the following */
892 if(!v
|| strcmpiW(szNormal
, v
) == 0 || strcmpiW(styleBold
, v
) == 0 ||
893 strcmpiW(styleBolder
, v
) == 0 || strcmpiW(styleLighter
, v
) == 0 ||
894 strcmpiW(style100
, v
) == 0 || strcmpiW(style200
, v
) == 0 ||
895 strcmpiW(style300
, v
) == 0 || strcmpiW(style400
, v
) == 0 ||
896 strcmpiW(style500
, v
) == 0 || strcmpiW(style600
, v
) == 0 ||
897 strcmpiW(style700
, v
) == 0 || strcmpiW(style800
, v
) == 0 ||
898 strcmpiW(style900
, v
) == 0
901 return set_nsstyle_attr(This
->nsstyle
, STYLEID_FONT_WEIGHT
, v
, 0);
907 static HRESULT WINAPI
HTMLStyle_get_fontWeight(IHTMLStyle
*iface
, BSTR
*p
)
909 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
911 TRACE("(%p)->(%p)\n", This
, p
);
913 return get_style_attr(This
, STYLEID_FONT_WEIGHT
, p
);
916 static HRESULT WINAPI
HTMLStyle_put_fontSize(IHTMLStyle
*iface
, VARIANT v
)
918 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
920 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
922 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_FONT_SIZE
, &v
, ATTR_FIX_PX
);
925 static HRESULT WINAPI
HTMLStyle_get_fontSize(IHTMLStyle
*iface
, VARIANT
*p
)
927 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
929 TRACE("(%p)->(%p)\n", This
, p
);
931 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_FONT_SIZE
, p
, 0);
934 static HRESULT WINAPI
HTMLStyle_put_font(IHTMLStyle
*iface
, BSTR v
)
936 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
937 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
941 static HRESULT WINAPI
HTMLStyle_get_font(IHTMLStyle
*iface
, BSTR
*p
)
943 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
944 FIXME("(%p)->(%p)\n", This
, p
);
948 static HRESULT WINAPI
HTMLStyle_put_color(IHTMLStyle
*iface
, VARIANT v
)
950 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
952 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
954 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_COLOR
, &v
, ATTR_HEX_INT
);
957 static HRESULT WINAPI
HTMLStyle_get_color(IHTMLStyle
*iface
, VARIANT
*p
)
959 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
961 TRACE("(%p)->(%p)\n", This
, p
);
963 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_COLOR
, p
, 0);
966 static HRESULT WINAPI
HTMLStyle_put_background(IHTMLStyle
*iface
, BSTR v
)
968 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
970 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
972 return set_style_attr(This
, STYLEID_BACKGROUND
, v
, 0);
975 static HRESULT WINAPI
HTMLStyle_get_background(IHTMLStyle
*iface
, BSTR
*p
)
977 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
979 TRACE("(%p)->(%p)\n", This
, p
);
981 return get_style_attr(This
, STYLEID_BACKGROUND
, p
);
984 static HRESULT WINAPI
HTMLStyle_put_backgroundColor(IHTMLStyle
*iface
, VARIANT v
)
986 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
988 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
990 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_BACKGROUND_COLOR
, &v
, ATTR_HEX_INT
);
993 static HRESULT WINAPI
HTMLStyle_get_backgroundColor(IHTMLStyle
*iface
, VARIANT
*p
)
995 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
997 TRACE("(%p)->(%p)\n", This
, p
);
999 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_BACKGROUND_COLOR
, p
, 0);
1002 static HRESULT WINAPI
HTMLStyle_put_backgroundImage(IHTMLStyle
*iface
, BSTR v
)
1004 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1006 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1008 return set_style_attr(This
, STYLEID_BACKGROUND_IMAGE
, v
, ATTR_FIX_URL
);
1011 static HRESULT WINAPI
HTMLStyle_get_backgroundImage(IHTMLStyle
*iface
, BSTR
*p
)
1013 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1015 TRACE("(%p)->(%p)\n", This
, p
);
1017 return get_style_attr(This
, STYLEID_BACKGROUND_IMAGE
, p
);
1020 static HRESULT WINAPI
HTMLStyle_put_backgroundRepeat(IHTMLStyle
*iface
, BSTR v
)
1022 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1023 static const WCHAR styleRepeat
[] = {'r','e','p','e','a','t',0};
1024 static const WCHAR styleNoRepeat
[] = {'n','o','-','r','e','p','e','a','t',0};
1025 static const WCHAR styleRepeatX
[] = {'r','e','p','e','a','t','-','x',0};
1026 static const WCHAR styleRepeatY
[] = {'r','e','p','e','a','t','-','y',0};
1028 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1030 /* fontWeight can only be one of the following */
1031 if(!v
|| strcmpiW(styleRepeat
, v
) == 0 || strcmpiW(styleNoRepeat
, v
) == 0 ||
1032 strcmpiW(styleRepeatX
, v
) == 0 || strcmpiW(styleRepeatY
, v
) == 0 )
1034 return set_style_attr(This
, STYLEID_BACKGROUND_REPEAT
, v
, 0);
1037 return E_INVALIDARG
;
1040 static HRESULT WINAPI
HTMLStyle_get_backgroundRepeat(IHTMLStyle
*iface
, BSTR
*p
)
1042 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1044 TRACE("(%p)->(%p)\n", This
, p
);
1046 return get_style_attr(This
, STYLEID_BACKGROUND_REPEAT
, p
);
1049 static HRESULT WINAPI
HTMLStyle_put_backgroundAttachment(IHTMLStyle
*iface
, BSTR v
)
1051 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1052 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1056 static HRESULT WINAPI
HTMLStyle_get_backgroundAttachment(IHTMLStyle
*iface
, BSTR
*p
)
1058 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1059 FIXME("(%p)->(%p)\n", This
, p
);
1063 static HRESULT WINAPI
HTMLStyle_put_backgroundPosition(IHTMLStyle
*iface
, BSTR v
)
1065 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1067 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1069 return set_style_attr(This
, STYLEID_BACKGROUND_POSITION
, v
, 0);
1072 static HRESULT WINAPI
HTMLStyle_get_backgroundPosition(IHTMLStyle
*iface
, BSTR
*p
)
1074 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1076 TRACE("(%p)->(%p)\n", This
, p
);
1078 return get_style_attr(This
, STYLEID_BACKGROUND_POSITION
, p
);
1081 static HRESULT WINAPI
HTMLStyle_put_backgroundPositionX(IHTMLStyle
*iface
, VARIANT v
)
1083 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1084 WCHAR buf
[14], *pos_val
;
1090 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1092 hres
= var_to_styleval(&v
, buf
, ATTR_FIX_PX
, &val
);
1096 val_len
= val
? strlenW(val
) : 0;
1098 nsAString_Init(&pos_str
, NULL
);
1099 hres
= get_nsstyle_attr_nsval(This
->nsstyle
, STYLEID_BACKGROUND_POSITION
, &pos_str
);
1100 if(SUCCEEDED(hres
)) {
1101 const PRUnichar
*pos
, *posy
;
1104 nsAString_GetData(&pos_str
, &pos
);
1105 posy
= strchrW(pos
, ' ');
1107 static const WCHAR zero_pxW
[] = {' ','0','p','x',0};
1109 TRACE("no space in %s\n", debugstr_w(pos
));
1113 posy_len
= strlenW(posy
);
1114 pos_val
= heap_alloc((val_len
+posy_len
+1)*sizeof(WCHAR
));
1117 memcpy(pos_val
, val
, val_len
*sizeof(WCHAR
));
1119 memcpy(pos_val
+val_len
, posy
, posy_len
*sizeof(WCHAR
));
1120 pos_val
[val_len
+posy_len
] = 0;
1122 hres
= E_OUTOFMEMORY
;
1125 nsAString_Finish(&pos_str
);
1129 TRACE("setting position to %s\n", debugstr_w(pos_val
));
1130 hres
= set_nsstyle_attr(This
->nsstyle
, STYLEID_BACKGROUND_POSITION
, pos_val
, ATTR_FIX_PX
);
1135 static HRESULT WINAPI
HTMLStyle_get_backgroundPositionX(IHTMLStyle
*iface
, VARIANT
*p
)
1137 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1142 TRACE("(%p)->(%p)\n", This
, p
);
1144 nsAString_Init(&pos_str
, NULL
);
1145 hres
= get_nsstyle_attr_nsval(This
->nsstyle
, STYLEID_BACKGROUND_POSITION
, &pos_str
);
1146 if(SUCCEEDED(hres
)) {
1147 const PRUnichar
*pos
, *space
;
1149 nsAString_GetData(&pos_str
, &pos
);
1150 space
= strchrW(pos
, ' ');
1152 WARN("no space in %s\n", debugstr_w(pos
));
1153 space
= pos
+ strlenW(pos
);
1157 ret
= SysAllocStringLen(pos
, space
-pos
);
1159 hres
= E_OUTOFMEMORY
;
1164 nsAString_Finish(&pos_str
);
1168 TRACE("returning %s\n", debugstr_w(ret
));
1174 static HRESULT WINAPI
HTMLStyle_put_backgroundPositionY(IHTMLStyle
*iface
, VARIANT v
)
1176 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1177 WCHAR buf
[14], *pos_val
;
1183 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1185 hres
= var_to_styleval(&v
, buf
, ATTR_FIX_PX
, &val
);
1189 val_len
= val
? strlenW(val
) : 0;
1191 nsAString_Init(&pos_str
, NULL
);
1192 hres
= get_nsstyle_attr_nsval(This
->nsstyle
, STYLEID_BACKGROUND_POSITION
, &pos_str
);
1193 if(SUCCEEDED(hres
)) {
1194 const PRUnichar
*pos
, *space
;
1197 nsAString_GetData(&pos_str
, &pos
);
1198 space
= strchrW(pos
, ' ');
1202 static const WCHAR zero_pxW
[] = {'0','p','x',' ',0};
1204 TRACE("no space in %s\n", debugstr_w(pos
));
1206 space
= pos
+ sizeof(zero_pxW
)/sizeof(WCHAR
)-1;
1209 posx_len
= space
-pos
;
1211 pos_val
= heap_alloc((posx_len
+val_len
+1)*sizeof(WCHAR
));
1213 memcpy(pos_val
, pos
, posx_len
*sizeof(WCHAR
));
1215 memcpy(pos_val
+posx_len
, val
, val_len
*sizeof(WCHAR
));
1216 pos_val
[posx_len
+val_len
] = 0;
1218 hres
= E_OUTOFMEMORY
;
1221 nsAString_Finish(&pos_str
);
1225 TRACE("setting position to %s\n", debugstr_w(pos_val
));
1226 hres
= set_nsstyle_attr(This
->nsstyle
, STYLEID_BACKGROUND_POSITION
, pos_val
, ATTR_FIX_PX
);
1231 static HRESULT WINAPI
HTMLStyle_get_backgroundPositionY(IHTMLStyle
*iface
, VARIANT
*p
)
1233 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1238 TRACE("(%p)->(%p)\n", This
, p
);
1240 nsAString_Init(&pos_str
, NULL
);
1241 hres
= get_nsstyle_attr_nsval(This
->nsstyle
, STYLEID_BACKGROUND_POSITION
, &pos_str
);
1242 if(SUCCEEDED(hres
)) {
1243 const PRUnichar
*pos
, *posy
;
1245 nsAString_GetData(&pos_str
, &pos
);
1246 posy
= strchrW(pos
, ' ');
1248 ret
= SysAllocString(posy
+1);
1250 hres
= E_OUTOFMEMORY
;
1255 nsAString_Finish(&pos_str
);
1259 TRACE("returning %s\n", debugstr_w(ret
));
1265 static HRESULT WINAPI
HTMLStyle_put_wordSpacing(IHTMLStyle
*iface
, VARIANT v
)
1267 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1269 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1271 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_WORD_SPACING
, &v
, 0);
1274 static HRESULT WINAPI
HTMLStyle_get_wordSpacing(IHTMLStyle
*iface
, VARIANT
*p
)
1276 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1277 TRACE("(%p)->(%p)\n", This
, p
);
1278 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_WORD_SPACING
, p
, 0);
1281 static HRESULT WINAPI
HTMLStyle_put_letterSpacing(IHTMLStyle
*iface
, VARIANT v
)
1283 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1285 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1287 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_LETTER_SPACING
, &v
, 0);
1290 static HRESULT WINAPI
HTMLStyle_get_letterSpacing(IHTMLStyle
*iface
, VARIANT
*p
)
1292 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1293 TRACE("(%p)->(%p)\n", This
, p
);
1294 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_LETTER_SPACING
, p
, 0);
1297 static HRESULT WINAPI
HTMLStyle_put_textDecoration(IHTMLStyle
*iface
, BSTR v
)
1299 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1301 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1303 /* textDecoration can only be one of the following */
1304 if(!v
|| strcmpiW(styleNone
, v
) == 0 || strcmpiW(valUnderline
, v
) == 0 ||
1305 strcmpiW(valOverline
, v
) == 0 || strcmpiW(valLineThrough
, v
) == 0 ||
1306 strcmpiW(valBlink
, v
) == 0)
1308 return set_style_attr(This
, STYLEID_TEXT_DECORATION
, v
, 0);
1311 return E_INVALIDARG
;
1314 static HRESULT WINAPI
HTMLStyle_get_textDecoration(IHTMLStyle
*iface
, BSTR
*p
)
1316 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1318 TRACE("(%p)->(%p)\n", This
, p
);
1320 return get_style_attr(This
, STYLEID_TEXT_DECORATION
, p
);
1323 static HRESULT WINAPI
HTMLStyle_put_textDecorationNone(IHTMLStyle
*iface
, VARIANT_BOOL v
)
1325 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1327 TRACE("(%p)->(%x)\n", This
, v
);
1329 return set_style_attr(This
, STYLEID_TEXT_DECORATION
, v
? styleNone
: emptyW
, 0);
1332 static HRESULT WINAPI
HTMLStyle_get_textDecorationNone(IHTMLStyle
*iface
, VARIANT_BOOL
*p
)
1334 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1336 TRACE("(%p)->(%p)\n", This
, p
);
1338 return check_style_attr_value(This
, STYLEID_TEXT_DECORATION
, styleNone
, p
);
1341 static HRESULT WINAPI
HTMLStyle_put_textDecorationUnderline(IHTMLStyle
*iface
, VARIANT_BOOL v
)
1343 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1345 TRACE("(%p)->(%x)\n", This
, v
);
1347 return set_style_attr(This
, STYLEID_TEXT_DECORATION
, v
? valUnderline
: emptyW
, 0);
1350 static HRESULT WINAPI
HTMLStyle_get_textDecorationUnderline(IHTMLStyle
*iface
, VARIANT_BOOL
*p
)
1352 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1354 TRACE("(%p)->(%p)\n", This
, p
);
1356 return check_style_attr_value(This
, STYLEID_TEXT_DECORATION
, valUnderline
, p
);
1359 static HRESULT WINAPI
HTMLStyle_put_textDecorationOverline(IHTMLStyle
*iface
, VARIANT_BOOL v
)
1361 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1363 TRACE("(%p)->(%x)\n", This
, v
);
1365 return set_style_attr(This
, STYLEID_TEXT_DECORATION
, v
? valOverline
: emptyW
, 0);
1368 static HRESULT WINAPI
HTMLStyle_get_textDecorationOverline(IHTMLStyle
*iface
, VARIANT_BOOL
*p
)
1370 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1372 TRACE("(%p)->(%p)\n", This
, p
);
1374 return check_style_attr_value(This
, STYLEID_TEXT_DECORATION
, valOverline
, p
);
1377 static HRESULT WINAPI
HTMLStyle_put_textDecorationLineThrough(IHTMLStyle
*iface
, VARIANT_BOOL v
)
1379 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1381 TRACE("(%p)->(%x)\n", This
, v
);
1383 return set_style_attr(This
, STYLEID_TEXT_DECORATION
, v
? valLineThrough
: emptyW
, 0);
1386 static HRESULT WINAPI
HTMLStyle_get_textDecorationLineThrough(IHTMLStyle
*iface
, VARIANT_BOOL
*p
)
1388 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1390 TRACE("(%p)->(%p)\n", This
, p
);
1392 return check_style_attr_value(This
, STYLEID_TEXT_DECORATION
, valLineThrough
, p
);
1395 static HRESULT WINAPI
HTMLStyle_put_textDecorationBlink(IHTMLStyle
*iface
, VARIANT_BOOL v
)
1397 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1399 TRACE("(%p)->(%x)\n", This
, v
);
1401 return set_style_attr(This
, STYLEID_TEXT_DECORATION
, v
? valBlink
: emptyW
, 0);
1404 static HRESULT WINAPI
HTMLStyle_get_textDecorationBlink(IHTMLStyle
*iface
, VARIANT_BOOL
*p
)
1406 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1408 TRACE("(%p)->(%p)\n", This
, p
);
1410 return check_style_attr_value(This
, STYLEID_TEXT_DECORATION
, valBlink
, p
);
1413 static HRESULT WINAPI
HTMLStyle_put_verticalAlign(IHTMLStyle
*iface
, VARIANT v
)
1415 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1417 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1419 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_VERTICAL_ALIGN
, &v
, ATTR_FIX_PX
);
1422 static HRESULT WINAPI
HTMLStyle_get_verticalAlign(IHTMLStyle
*iface
, VARIANT
*p
)
1424 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1426 TRACE("(%p)->(%p)\n", This
, p
);
1428 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_VERTICAL_ALIGN
, p
, 0);
1431 static HRESULT WINAPI
HTMLStyle_put_textTransform(IHTMLStyle
*iface
, BSTR v
)
1433 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1434 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1438 static HRESULT WINAPI
HTMLStyle_get_textTransform(IHTMLStyle
*iface
, BSTR
*p
)
1440 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1441 FIXME("(%p)->(%p)\n", This
, p
);
1445 static HRESULT WINAPI
HTMLStyle_put_textAlign(IHTMLStyle
*iface
, BSTR v
)
1447 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1449 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1451 return set_style_attr(This
, STYLEID_TEXT_ALIGN
, v
, 0);
1454 static HRESULT WINAPI
HTMLStyle_get_textAlign(IHTMLStyle
*iface
, BSTR
*p
)
1456 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1458 TRACE("(%p)->(%p)\n", This
, p
);
1460 return get_style_attr(This
, STYLEID_TEXT_ALIGN
, p
);
1463 static HRESULT WINAPI
HTMLStyle_put_textIndent(IHTMLStyle
*iface
, VARIANT v
)
1465 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1466 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1470 static HRESULT WINAPI
HTMLStyle_get_textIndent(IHTMLStyle
*iface
, VARIANT
*p
)
1472 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1473 FIXME("(%p)->(%p)\n", This
, p
);
1477 static HRESULT WINAPI
HTMLStyle_put_lineHeight(IHTMLStyle
*iface
, VARIANT v
)
1479 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1480 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1484 static HRESULT WINAPI
HTMLStyle_get_lineHeight(IHTMLStyle
*iface
, VARIANT
*p
)
1486 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1487 FIXME("(%p)->(%p)\n", This
, p
);
1491 static HRESULT WINAPI
HTMLStyle_put_marginTop(IHTMLStyle
*iface
, VARIANT v
)
1493 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1495 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1497 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_MARGIN_TOP
, &v
, ATTR_FIX_PX
);
1500 static HRESULT WINAPI
HTMLStyle_get_marginTop(IHTMLStyle
*iface
, VARIANT
*p
)
1502 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1504 TRACE("(%p)->(%p)\n", This
, p
);
1506 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_MARGIN_TOP
, p
, 0);
1509 static HRESULT WINAPI
HTMLStyle_put_marginRight(IHTMLStyle
*iface
, VARIANT v
)
1511 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1513 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1515 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_MARGIN_RIGHT
, &v
, ATTR_FIX_PX
);
1518 static HRESULT WINAPI
HTMLStyle_get_marginRight(IHTMLStyle
*iface
, VARIANT
*p
)
1520 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1521 TRACE("(%p)->(%p)\n", This
, p
);
1522 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_MARGIN_RIGHT
, p
, 0);
1525 static HRESULT WINAPI
HTMLStyle_put_marginBottom(IHTMLStyle
*iface
, VARIANT v
)
1527 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1529 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1531 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_MARGIN_BOTTOM
, &v
, ATTR_FIX_PX
);
1534 static HRESULT WINAPI
HTMLStyle_get_marginBottom(IHTMLStyle
*iface
, VARIANT
*p
)
1536 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1538 TRACE("(%p)->(%p)\n", This
, p
);
1540 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_MARGIN_BOTTOM
, p
, 0);
1543 static HRESULT WINAPI
HTMLStyle_put_marginLeft(IHTMLStyle
*iface
, VARIANT v
)
1545 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1547 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1549 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_MARGIN_LEFT
, &v
, ATTR_FIX_PX
);
1552 static HRESULT WINAPI
HTMLStyle_put_margin(IHTMLStyle
*iface
, BSTR v
)
1554 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1556 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1558 return set_style_attr(This
, STYLEID_MARGIN
, v
, 0);
1561 static HRESULT WINAPI
HTMLStyle_get_margin(IHTMLStyle
*iface
, BSTR
*p
)
1563 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1565 TRACE("(%p)->(%p)\n", This
, p
);
1567 return get_style_attr(This
, STYLEID_MARGIN
, p
);
1570 static HRESULT WINAPI
HTMLStyle_get_marginLeft(IHTMLStyle
*iface
, VARIANT
*p
)
1572 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1573 TRACE("(%p)->(%p)\n", This
, p
);
1574 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_MARGIN_LEFT
, p
, 0);
1577 static HRESULT WINAPI
HTMLStyle_put_paddingTop(IHTMLStyle
*iface
, VARIANT v
)
1579 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1581 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1583 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_PADDING_TOP
, &v
, ATTR_FIX_PX
);
1586 static HRESULT WINAPI
HTMLStyle_get_paddingTop(IHTMLStyle
*iface
, VARIANT
*p
)
1588 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1590 TRACE("(%p)->(%p)\n", This
, p
);
1592 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_PADDING_TOP
, p
, 0);
1595 static HRESULT WINAPI
HTMLStyle_put_paddingRight(IHTMLStyle
*iface
, VARIANT v
)
1597 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1599 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1601 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_PADDING_RIGHT
, &v
, ATTR_FIX_PX
);
1604 static HRESULT WINAPI
HTMLStyle_get_paddingRight(IHTMLStyle
*iface
, VARIANT
*p
)
1606 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1608 TRACE("(%p)->(%p)\n", This
, p
);
1610 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_PADDING_RIGHT
, p
, 0);
1613 static HRESULT WINAPI
HTMLStyle_put_paddingBottom(IHTMLStyle
*iface
, VARIANT v
)
1615 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1617 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1619 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_PADDING_BOTTOM
, &v
, ATTR_FIX_PX
);
1622 static HRESULT WINAPI
HTMLStyle_get_paddingBottom(IHTMLStyle
*iface
, VARIANT
*p
)
1624 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1626 TRACE("(%p)->(%p)\n", This
, p
);
1628 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_PADDING_BOTTOM
, p
, 0);
1631 static HRESULT WINAPI
HTMLStyle_put_paddingLeft(IHTMLStyle
*iface
, VARIANT v
)
1633 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1635 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1637 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_PADDING_LEFT
, &v
, ATTR_FIX_PX
);
1640 static HRESULT WINAPI
HTMLStyle_get_paddingLeft(IHTMLStyle
*iface
, VARIANT
*p
)
1642 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1644 TRACE("(%p)->(%p)\n", This
, p
);
1646 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_PADDING_LEFT
, p
, 0);
1649 static HRESULT WINAPI
HTMLStyle_put_padding(IHTMLStyle
*iface
, BSTR v
)
1651 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1653 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1655 return set_style_attr(This
, STYLEID_PADDING
, v
, 0);
1658 static HRESULT WINAPI
HTMLStyle_get_padding(IHTMLStyle
*iface
, BSTR
*p
)
1660 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1662 TRACE("(%p)->(%p)\n", This
, p
);
1664 return get_style_attr(This
, STYLEID_PADDING
, p
);
1667 static HRESULT WINAPI
HTMLStyle_put_border(IHTMLStyle
*iface
, BSTR v
)
1669 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1671 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1673 return set_style_attr(This
, STYLEID_BORDER
, v
, 0);
1676 static HRESULT WINAPI
HTMLStyle_get_border(IHTMLStyle
*iface
, BSTR
*p
)
1678 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1680 TRACE("(%p)->(%p)\n", This
, p
);
1682 return get_style_attr(This
, STYLEID_BORDER
, p
);
1685 static HRESULT WINAPI
HTMLStyle_put_borderTop(IHTMLStyle
*iface
, BSTR v
)
1687 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1688 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1689 return set_style_attr(This
, STYLEID_BORDER_TOP
, v
, ATTR_FIX_PX
);
1692 static HRESULT WINAPI
HTMLStyle_get_borderTop(IHTMLStyle
*iface
, BSTR
*p
)
1694 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1695 TRACE("(%p)->(%p)\n", This
, p
);
1696 return get_style_attr(This
, STYLEID_BORDER_TOP
, p
);
1699 static HRESULT WINAPI
HTMLStyle_put_borderRight(IHTMLStyle
*iface
, BSTR v
)
1701 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1702 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1703 return set_style_attr(This
, STYLEID_BORDER_RIGHT
, v
, ATTR_FIX_PX
);
1706 static HRESULT WINAPI
HTMLStyle_get_borderRight(IHTMLStyle
*iface
, BSTR
*p
)
1708 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1709 TRACE("(%p)->(%p)\n", This
, p
);
1710 return get_style_attr(This
, STYLEID_BORDER_RIGHT
, p
);
1713 static HRESULT WINAPI
HTMLStyle_put_borderBottom(IHTMLStyle
*iface
, BSTR v
)
1715 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1716 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1717 return set_style_attr(This
, STYLEID_BORDER_BOTTOM
, v
, ATTR_FIX_PX
);
1720 static HRESULT WINAPI
HTMLStyle_get_borderBottom(IHTMLStyle
*iface
, BSTR
*p
)
1722 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1723 TRACE("(%p)->(%p)\n", This
, p
);
1724 return get_style_attr(This
, STYLEID_BORDER_BOTTOM
, p
);
1727 static HRESULT WINAPI
HTMLStyle_put_borderLeft(IHTMLStyle
*iface
, BSTR v
)
1729 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1731 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1733 return set_style_attr(This
, STYLEID_BORDER_LEFT
, v
, ATTR_FIX_PX
);
1736 static HRESULT WINAPI
HTMLStyle_get_borderLeft(IHTMLStyle
*iface
, BSTR
*p
)
1738 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1740 TRACE("(%p)->(%p)\n", This
, p
);
1742 return get_style_attr(This
, STYLEID_BORDER_LEFT
, p
);
1745 static HRESULT WINAPI
HTMLStyle_put_borderColor(IHTMLStyle
*iface
, BSTR v
)
1747 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1749 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1751 return set_style_attr(This
, STYLEID_BORDER_COLOR
, v
, 0);
1754 static HRESULT WINAPI
HTMLStyle_get_borderColor(IHTMLStyle
*iface
, BSTR
*p
)
1756 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1758 TRACE("(%p)->(%p)\n", This
, p
);
1760 return get_style_attr(This
, STYLEID_BORDER_COLOR
, p
);
1763 static HRESULT WINAPI
HTMLStyle_put_borderTopColor(IHTMLStyle
*iface
, VARIANT v
)
1765 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1767 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1769 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_TOP_COLOR
, &v
, ATTR_HEX_INT
);
1772 static HRESULT WINAPI
HTMLStyle_get_borderTopColor(IHTMLStyle
*iface
, VARIANT
*p
)
1774 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1776 TRACE("(%p)->(%p)\n", This
, p
);
1778 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_TOP_COLOR
, p
, 0);
1781 static HRESULT WINAPI
HTMLStyle_put_borderRightColor(IHTMLStyle
*iface
, VARIANT v
)
1783 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1785 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1787 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_RIGHT_COLOR
, &v
, ATTR_HEX_INT
);
1790 static HRESULT WINAPI
HTMLStyle_get_borderRightColor(IHTMLStyle
*iface
, VARIANT
*p
)
1792 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1794 TRACE("(%p)->(%p)\n", This
, p
);
1796 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_RIGHT_COLOR
, p
, 0);
1799 static HRESULT WINAPI
HTMLStyle_put_borderBottomColor(IHTMLStyle
*iface
, VARIANT v
)
1801 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1803 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1805 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_BOTTOM_COLOR
, &v
, ATTR_HEX_INT
);
1808 static HRESULT WINAPI
HTMLStyle_get_borderBottomColor(IHTMLStyle
*iface
, VARIANT
*p
)
1810 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1812 TRACE("(%p)->(%p)\n", This
, p
);
1814 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_BOTTOM_COLOR
, p
, 0);
1817 static HRESULT WINAPI
HTMLStyle_put_borderLeftColor(IHTMLStyle
*iface
, VARIANT v
)
1819 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1821 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1823 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_LEFT_COLOR
, &v
, ATTR_HEX_INT
);
1826 static HRESULT WINAPI
HTMLStyle_get_borderLeftColor(IHTMLStyle
*iface
, VARIANT
*p
)
1828 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1830 TRACE("(%p)->(%p)\n", This
, p
);
1832 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_LEFT_COLOR
, p
, 0);
1835 static HRESULT WINAPI
HTMLStyle_put_borderWidth(IHTMLStyle
*iface
, BSTR v
)
1837 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1838 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1839 return set_style_attr(This
, STYLEID_BORDER_WIDTH
, v
, ATTR_FIX_PX
);
1842 static HRESULT WINAPI
HTMLStyle_get_borderWidth(IHTMLStyle
*iface
, BSTR
*p
)
1844 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1845 TRACE("(%p)->(%p)\n", This
, p
);
1846 return get_style_attr(This
, STYLEID_BORDER_WIDTH
, p
);
1849 static HRESULT WINAPI
HTMLStyle_put_borderTopWidth(IHTMLStyle
*iface
, VARIANT v
)
1851 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1853 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1855 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_TOP_WIDTH
, &v
, 0);
1858 static HRESULT WINAPI
HTMLStyle_get_borderTopWidth(IHTMLStyle
*iface
, VARIANT
*p
)
1860 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1862 TRACE("(%p)->(%p)\n", This
, p
);
1864 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_TOP_WIDTH
, p
, 0);
1867 static HRESULT WINAPI
HTMLStyle_put_borderRightWidth(IHTMLStyle
*iface
, VARIANT v
)
1869 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1871 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1873 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_RIGHT_WIDTH
, &v
, 0);
1876 static HRESULT WINAPI
HTMLStyle_get_borderRightWidth(IHTMLStyle
*iface
, VARIANT
*p
)
1878 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1880 TRACE("(%p)->(%p)\n", This
, p
);
1882 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_RIGHT_WIDTH
, p
, 0);
1885 static HRESULT WINAPI
HTMLStyle_put_borderBottomWidth(IHTMLStyle
*iface
, VARIANT v
)
1887 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1889 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1891 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_BOTTOM_WIDTH
, &v
, 0);
1894 static HRESULT WINAPI
HTMLStyle_get_borderBottomWidth(IHTMLStyle
*iface
, VARIANT
*p
)
1896 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1897 TRACE("(%p)->(%p)\n", This
, p
);
1898 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_BOTTOM_WIDTH
, p
, 0);
1901 static HRESULT WINAPI
HTMLStyle_put_borderLeftWidth(IHTMLStyle
*iface
, VARIANT v
)
1903 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1905 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1907 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_LEFT_WIDTH
, &v
, 0);
1910 static HRESULT WINAPI
HTMLStyle_get_borderLeftWidth(IHTMLStyle
*iface
, VARIANT
*p
)
1912 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1913 TRACE("(%p)->(%p)\n", This
, p
);
1914 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_LEFT_WIDTH
, p
, 0);
1917 static HRESULT WINAPI
HTMLStyle_put_borderStyle(IHTMLStyle
*iface
, BSTR v
)
1919 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1920 static const WCHAR styleWindowInset
[] = {'w','i','n','d','o','w','-','i','n','s','e','t',0};
1921 HRESULT hres
= S_OK
;
1926 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1928 while(v
[i
] && hres
== S_OK
)
1930 if(v
[i
] == (WCHAR
)' ')
1932 pstyle
= SysAllocStringLen(&v
[last
], (i
-last
));
1933 if( !(is_valid_border_style(pstyle
) || strcmpiW(styleWindowInset
, pstyle
) == 0))
1935 TRACE("1. Invalid style (%s)\n", debugstr_w(pstyle
));
1936 hres
= E_INVALIDARG
;
1938 SysFreeString(pstyle
);
1946 pstyle
= SysAllocStringLen(&v
[last
], i
-last
);
1947 if( !(is_valid_border_style(pstyle
) || strcmpiW(styleWindowInset
, pstyle
) == 0))
1949 TRACE("2. Invalid style (%s)\n", debugstr_w(pstyle
));
1950 hres
= E_INVALIDARG
;
1952 SysFreeString(pstyle
);
1956 hres
= set_nsstyle_attr(This
->nsstyle
, STYLEID_BORDER_STYLE
, v
, 0);
1961 static HRESULT WINAPI
HTMLStyle_get_borderStyle(IHTMLStyle
*iface
, BSTR
*p
)
1963 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1964 TRACE("(%p)->(%p)\n", This
, p
);
1965 return get_style_attr(This
, STYLEID_BORDER_STYLE
, p
);
1968 static HRESULT WINAPI
HTMLStyle_put_borderTopStyle(IHTMLStyle
*iface
, BSTR v
)
1970 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1971 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1973 if(!is_valid_border_style(v
))
1974 return E_INVALIDARG
;
1976 return set_style_attr(This
, STYLEID_BORDER_TOP_STYLE
, v
, 0);
1979 static HRESULT WINAPI
HTMLStyle_get_borderTopStyle(IHTMLStyle
*iface
, BSTR
*p
)
1981 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1982 TRACE("(%p)->(%p)\n", This
, p
);
1983 return get_style_attr(This
, STYLEID_BORDER_TOP_STYLE
, p
);
1986 static HRESULT WINAPI
HTMLStyle_put_borderRightStyle(IHTMLStyle
*iface
, BSTR v
)
1988 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1989 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1991 if(!is_valid_border_style(v
))
1992 return E_INVALIDARG
;
1994 return set_style_attr(This
, STYLEID_BORDER_RIGHT_STYLE
, v
, 0);
1997 static HRESULT WINAPI
HTMLStyle_get_borderRightStyle(IHTMLStyle
*iface
, BSTR
*p
)
1999 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2000 TRACE("(%p)->(%p)\n", This
, p
);
2001 return get_style_attr(This
, STYLEID_BORDER_RIGHT_STYLE
, p
);
2004 static HRESULT WINAPI
HTMLStyle_put_borderBottomStyle(IHTMLStyle
*iface
, BSTR v
)
2006 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2007 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2009 if(!is_valid_border_style(v
))
2010 return E_INVALIDARG
;
2012 return set_style_attr(This
, STYLEID_BORDER_BOTTOM_STYLE
, v
, 0);
2015 static HRESULT WINAPI
HTMLStyle_get_borderBottomStyle(IHTMLStyle
*iface
, BSTR
*p
)
2017 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2018 TRACE("(%p)->(%p)\n", This
, p
);
2019 return get_style_attr(This
, STYLEID_BORDER_BOTTOM_STYLE
, p
);
2022 static HRESULT WINAPI
HTMLStyle_put_borderLeftStyle(IHTMLStyle
*iface
, BSTR v
)
2024 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2025 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2027 if(!is_valid_border_style(v
))
2028 return E_INVALIDARG
;
2030 return set_style_attr(This
, STYLEID_BORDER_LEFT_STYLE
, v
, 0);
2033 static HRESULT WINAPI
HTMLStyle_get_borderLeftStyle(IHTMLStyle
*iface
, BSTR
*p
)
2035 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2036 TRACE("(%p)->(%p)\n", This
, p
);
2037 return get_style_attr(This
, STYLEID_BORDER_LEFT_STYLE
, p
);
2040 static HRESULT WINAPI
HTMLStyle_put_width(IHTMLStyle
*iface
, VARIANT v
)
2042 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2044 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2046 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_WIDTH
, &v
, ATTR_FIX_PX
);
2049 static HRESULT WINAPI
HTMLStyle_get_width(IHTMLStyle
*iface
, VARIANT
*p
)
2051 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2053 TRACE("(%p)->(%p)\n", This
, p
);
2055 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_WIDTH
, p
, 0);
2058 static HRESULT WINAPI
HTMLStyle_put_height(IHTMLStyle
*iface
, VARIANT v
)
2060 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2062 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2064 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_HEIGHT
, &v
, ATTR_FIX_PX
);
2067 static HRESULT WINAPI
HTMLStyle_get_height(IHTMLStyle
*iface
, VARIANT
*p
)
2069 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2071 TRACE("(%p)->(%p)\n", This
, p
);
2073 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_HEIGHT
, p
, 0);
2076 static HRESULT WINAPI
HTMLStyle_put_styleFloat(IHTMLStyle
*iface
, BSTR v
)
2078 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2079 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
2083 static HRESULT WINAPI
HTMLStyle_get_styleFloat(IHTMLStyle
*iface
, BSTR
*p
)
2085 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2086 FIXME("(%p)->(%p)\n", This
, p
);
2090 static HRESULT WINAPI
HTMLStyle_put_clear(IHTMLStyle
*iface
, BSTR v
)
2092 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2094 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2096 return set_style_attr(This
, STYLEID_CLEAR
, v
, 0);
2099 static HRESULT WINAPI
HTMLStyle_get_clear(IHTMLStyle
*iface
, BSTR
*p
)
2101 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2103 TRACE("(%p)->(%p)\n", This
, p
);
2105 return get_style_attr(This
, STYLEID_CLEAR
, p
);
2108 static HRESULT WINAPI
HTMLStyle_put_display(IHTMLStyle
*iface
, BSTR v
)
2110 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2112 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2114 return set_style_attr(This
, STYLEID_DISPLAY
, v
, 0);
2117 static HRESULT WINAPI
HTMLStyle_get_display(IHTMLStyle
*iface
, BSTR
*p
)
2119 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2121 TRACE("(%p)->(%p)\n", This
, p
);
2123 return get_style_attr(This
, STYLEID_DISPLAY
, p
);
2126 static HRESULT WINAPI
HTMLStyle_put_visibility(IHTMLStyle
*iface
, BSTR v
)
2128 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2130 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2132 return set_style_attr(This
, STYLEID_VISIBILITY
, v
, 0);
2135 static HRESULT WINAPI
HTMLStyle_get_visibility(IHTMLStyle
*iface
, BSTR
*p
)
2137 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2139 TRACE("(%p)->(%p)\n", This
, p
);
2141 return get_style_attr(This
, STYLEID_VISIBILITY
, p
);
2144 static HRESULT WINAPI
HTMLStyle_put_listStyleType(IHTMLStyle
*iface
, BSTR v
)
2146 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2147 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
2151 static HRESULT WINAPI
HTMLStyle_get_listStyleType(IHTMLStyle
*iface
, BSTR
*p
)
2153 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2154 FIXME("(%p)->(%p)\n", This
, p
);
2158 static HRESULT WINAPI
HTMLStyle_put_listStylePosition(IHTMLStyle
*iface
, BSTR v
)
2160 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2161 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
2165 static HRESULT WINAPI
HTMLStyle_get_listStylePosition(IHTMLStyle
*iface
, BSTR
*p
)
2167 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2168 FIXME("(%p)->(%p)\n", This
, p
);
2172 static HRESULT WINAPI
HTMLStyle_put_listStyleImage(IHTMLStyle
*iface
, BSTR v
)
2174 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2175 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
2179 static HRESULT WINAPI
HTMLStyle_get_listStyleImage(IHTMLStyle
*iface
, BSTR
*p
)
2181 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2182 FIXME("(%p)->(%p)\n", This
, p
);
2186 static HRESULT WINAPI
HTMLStyle_put_listStyle(IHTMLStyle
*iface
, BSTR v
)
2188 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2189 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
2193 static HRESULT WINAPI
HTMLStyle_get_listStyle(IHTMLStyle
*iface
, BSTR
*p
)
2195 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2196 FIXME("(%p)->(%p)\n", This
, p
);
2200 static HRESULT WINAPI
HTMLStyle_put_whiteSpace(IHTMLStyle
*iface
, BSTR v
)
2202 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2204 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2206 return set_nsstyle_attr(This
->nsstyle
, STYLEID_WHITE_SPACE
, v
, 0);
2209 static HRESULT WINAPI
HTMLStyle_get_whiteSpace(IHTMLStyle
*iface
, BSTR
*p
)
2211 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2213 TRACE("(%p)->(%p)\n", This
, p
);
2215 return get_nsstyle_attr(This
->nsstyle
, STYLEID_WHITE_SPACE
, p
, 0);
2218 static HRESULT WINAPI
HTMLStyle_put_top(IHTMLStyle
*iface
, VARIANT v
)
2220 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2222 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2224 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_TOP
, &v
, 0);
2227 static HRESULT WINAPI
HTMLStyle_get_top(IHTMLStyle
*iface
, VARIANT
*p
)
2229 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2231 TRACE("(%p)->(%p)\n", This
, p
);
2233 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_TOP
, p
, 0);
2236 static HRESULT WINAPI
HTMLStyle_put_left(IHTMLStyle
*iface
, VARIANT v
)
2238 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2240 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2242 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_LEFT
, &v
, 0);
2245 static HRESULT WINAPI
HTMLStyle_get_left(IHTMLStyle
*iface
, VARIANT
*p
)
2247 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2249 TRACE("(%p)->(%p)\n", This
, p
);
2251 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_LEFT
, p
, 0);
2254 static HRESULT WINAPI
HTMLStyle_get_position(IHTMLStyle
*iface
, BSTR
*p
)
2256 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2257 TRACE("(%p)->(%p)\n", This
, p
);
2258 return IHTMLStyle2_get_position(&This
->IHTMLStyle2_iface
, p
);
2261 static HRESULT WINAPI
HTMLStyle_put_zIndex(IHTMLStyle
*iface
, VARIANT v
)
2263 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2265 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2267 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_Z_INDEX
, &v
, 0);
2270 static HRESULT WINAPI
HTMLStyle_get_zIndex(IHTMLStyle
*iface
, VARIANT
*p
)
2272 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2274 TRACE("(%p)->(%p)\n", This
, p
);
2276 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_Z_INDEX
, p
, ATTR_STR_TO_INT
);
2279 static HRESULT WINAPI
HTMLStyle_put_overflow(IHTMLStyle
*iface
, BSTR v
)
2281 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2282 static const WCHAR szVisible
[] = {'v','i','s','i','b','l','e',0};
2283 static const WCHAR szScroll
[] = {'s','c','r','o','l','l',0};
2284 static const WCHAR szHidden
[] = {'h','i','d','d','e','n',0};
2285 static const WCHAR szAuto
[] = {'a','u','t','o',0};
2287 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2289 /* overflow can only be one of the follow values. */
2290 if(!v
|| !*v
|| strcmpiW(szVisible
, v
) == 0 || strcmpiW(szScroll
, v
) == 0 ||
2291 strcmpiW(szHidden
, v
) == 0 || strcmpiW(szAuto
, v
) == 0)
2293 return set_nsstyle_attr(This
->nsstyle
, STYLEID_OVERFLOW
, v
, 0);
2296 return E_INVALIDARG
;
2300 static HRESULT WINAPI
HTMLStyle_get_overflow(IHTMLStyle
*iface
, BSTR
*p
)
2302 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2304 TRACE("(%p)->(%p)\n", This
, p
);
2307 return E_INVALIDARG
;
2309 return get_style_attr(This
, STYLEID_OVERFLOW
, p
);
2312 static HRESULT WINAPI
HTMLStyle_put_pageBreakBefore(IHTMLStyle
*iface
, BSTR v
)
2314 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2316 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2318 return set_nsstyle_attr(This
->nsstyle
, STYLEID_PAGE_BREAK_BEFORE
, v
, 0);
2321 static HRESULT WINAPI
HTMLStyle_get_pageBreakBefore(IHTMLStyle
*iface
, BSTR
*p
)
2323 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2325 TRACE("(%p)->(%p)\n", This
, p
);
2327 return get_nsstyle_attr(This
->nsstyle
, STYLEID_PAGE_BREAK_BEFORE
, p
, 0);
2330 static HRESULT WINAPI
HTMLStyle_put_pageBreakAfter(IHTMLStyle
*iface
, BSTR v
)
2332 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2334 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2336 return set_nsstyle_attr(This
->nsstyle
, STYLEID_PAGE_BREAK_AFTER
, v
, 0);
2339 static HRESULT WINAPI
HTMLStyle_get_pageBreakAfter(IHTMLStyle
*iface
, BSTR
*p
)
2341 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2343 TRACE("(%p)->(%p)\n", This
, p
);
2345 return get_nsstyle_attr(This
->nsstyle
, STYLEID_PAGE_BREAK_AFTER
, p
, 0);
2348 static HRESULT WINAPI
HTMLStyle_put_cssText(IHTMLStyle
*iface
, BSTR v
)
2350 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2354 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2356 nsAString_InitDepend(&text_str
, v
);
2357 nsres
= nsIDOMCSSStyleDeclaration_SetCssText(This
->nsstyle
, &text_str
);
2358 nsAString_Finish(&text_str
);
2359 if(NS_FAILED(nsres
)) {
2360 FIXME("SetCssStyle failed: %08x\n", nsres
);
2367 static HRESULT WINAPI
HTMLStyle_get_cssText(IHTMLStyle
*iface
, BSTR
*p
)
2369 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2373 TRACE("(%p)->(%p)\n", This
, p
);
2375 /* FIXME: Gecko style formatting is different than IE (uppercase). */
2376 nsAString_Init(&text_str
, NULL
);
2377 nsres
= nsIDOMCSSStyleDeclaration_GetCssText(This
->nsstyle
, &text_str
);
2378 if(NS_SUCCEEDED(nsres
)) {
2379 const PRUnichar
*text
;
2381 nsAString_GetData(&text_str
, &text
);
2382 *p
= *text
? SysAllocString(text
) : NULL
;
2384 FIXME("GetCssStyle failed: %08x\n", nsres
);
2388 nsAString_Finish(&text_str
);
2392 static HRESULT WINAPI
HTMLStyle_put_pixelTop(IHTMLStyle
*iface
, LONG v
)
2394 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2395 FIXME("(%p)->()\n", This
);
2399 static HRESULT WINAPI
HTMLStyle_get_pixelTop(IHTMLStyle
*iface
, LONG
*p
)
2401 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2402 FIXME("(%p)->()\n", This
);
2406 static HRESULT WINAPI
HTMLStyle_put_pixelLeft(IHTMLStyle
*iface
, LONG v
)
2408 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2410 TRACE("(%p)->(%d)\n", This
, v
);
2412 return set_style_pxattr(This
->nsstyle
, STYLEID_LEFT
, v
);
2415 static HRESULT WINAPI
HTMLStyle_get_pixelLeft(IHTMLStyle
*iface
, LONG
*p
)
2417 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2419 TRACE("(%p)->(%p)\n", This
, p
);
2421 return get_nsstyle_pixel_val(This
, STYLEID_LEFT
, p
);
2424 static HRESULT WINAPI
HTMLStyle_put_pixelWidth(IHTMLStyle
*iface
, LONG v
)
2426 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2428 TRACE("(%p)->()\n", This
);
2430 return set_style_pxattr(This
->nsstyle
, STYLEID_WIDTH
, v
);
2433 static HRESULT WINAPI
HTMLStyle_get_pixelWidth(IHTMLStyle
*iface
, LONG
*p
)
2435 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2436 FIXME("(%p)->()\n", This
);
2440 static HRESULT WINAPI
HTMLStyle_put_pixelHeight(IHTMLStyle
*iface
, LONG v
)
2442 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2443 FIXME("(%p)->()\n", This
);
2447 static HRESULT WINAPI
HTMLStyle_get_pixelHeight(IHTMLStyle
*iface
, LONG
*p
)
2449 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2450 FIXME("(%p)->()\n", This
);
2454 static HRESULT WINAPI
HTMLStyle_put_posTop(IHTMLStyle
*iface
, float v
)
2456 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2458 TRACE("(%p)->(%f)\n", This
, v
);
2460 return set_style_pos(This
, STYLEID_TOP
, v
);
2463 static HRESULT WINAPI
HTMLStyle_get_posTop(IHTMLStyle
*iface
, float *p
)
2465 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2467 TRACE("(%p)->(%p)\n", This
, p
);
2472 return get_nsstyle_pos(This
, STYLEID_TOP
, p
);
2475 static HRESULT WINAPI
HTMLStyle_put_posLeft(IHTMLStyle
*iface
, float v
)
2477 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2479 TRACE("(%p)->(%f)\n", This
, v
);
2481 return set_style_pos(This
, STYLEID_LEFT
, v
);
2484 static HRESULT WINAPI
HTMLStyle_get_posLeft(IHTMLStyle
*iface
, float *p
)
2486 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2488 TRACE("(%p)->(%p)\n", This
, p
);
2493 return get_nsstyle_pos(This
, STYLEID_LEFT
, p
);
2496 static HRESULT WINAPI
HTMLStyle_put_posWidth(IHTMLStyle
*iface
, float v
)
2498 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2500 TRACE("(%p)->(%f)\n", This
, v
);
2502 return set_style_pos(This
, STYLEID_WIDTH
, v
);
2505 static HRESULT WINAPI
HTMLStyle_get_posWidth(IHTMLStyle
*iface
, float *p
)
2507 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2509 TRACE("(%p)->(%p)\n", This
, p
);
2514 if(get_nsstyle_pos(This
, STYLEID_WIDTH
, p
) != S_OK
)
2520 static HRESULT WINAPI
HTMLStyle_put_posHeight(IHTMLStyle
*iface
, float v
)
2522 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2524 TRACE("(%p)->(%f)\n", This
, v
);
2526 return set_style_pos(This
, STYLEID_HEIGHT
, v
);
2529 static HRESULT WINAPI
HTMLStyle_get_posHeight(IHTMLStyle
*iface
, float *p
)
2531 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2533 TRACE("(%p)->(%p)\n", This
, p
);
2538 if(get_nsstyle_pos(This
, STYLEID_HEIGHT
, p
) != S_OK
)
2544 static HRESULT WINAPI
HTMLStyle_put_cursor(IHTMLStyle
*iface
, BSTR v
)
2546 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2548 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2550 return set_style_attr(This
, STYLEID_CURSOR
, v
, 0);
2553 static HRESULT WINAPI
HTMLStyle_get_cursor(IHTMLStyle
*iface
, BSTR
*p
)
2555 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2557 TRACE("(%p)->(%p)\n", This
, p
);
2559 return get_style_attr(This
, STYLEID_CURSOR
, p
);
2562 static HRESULT WINAPI
HTMLStyle_put_clip(IHTMLStyle
*iface
, BSTR v
)
2564 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2566 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2568 return set_style_attr(This
, STYLEID_CLIP
, v
, 0);
2571 static HRESULT WINAPI
HTMLStyle_get_clip(IHTMLStyle
*iface
, BSTR
*p
)
2573 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2575 TRACE("(%p)->(%p)\n", This
, p
);
2577 return get_nsstyle_attr(This
->nsstyle
, STYLEID_CLIP
, p
, ATTR_REMOVE_COMMA
);
2580 static void set_opacity(HTMLStyle
*This
, const WCHAR
*val
)
2582 nsAString name_str
, val_str
, empty_str
;
2585 static const WCHAR opacityW
[] = {'o','p','a','c','i','t','y',0};
2587 TRACE("%s\n", debugstr_w(val
));
2589 nsAString_InitDepend(&name_str
, opacityW
);
2590 nsAString_InitDepend(&val_str
, val
);
2591 nsAString_InitDepend(&empty_str
, emptyW
);
2593 nsres
= nsIDOMCSSStyleDeclaration_SetProperty(This
->nsstyle
, &name_str
, &val_str
, &empty_str
);
2594 if(NS_FAILED(nsres
))
2595 ERR("SetProperty failed: %08x\n", nsres
);
2597 nsAString_Finish(&name_str
);
2598 nsAString_Finish(&val_str
);
2599 nsAString_Finish(&empty_str
);
2602 static void update_filter(HTMLStyle
*This
)
2604 const WCHAR
*ptr
= This
->elem
->filter
, *ptr2
;
2606 static const WCHAR alphaW
[] = {'a','l','p','h','a'};
2609 set_opacity(This
, emptyW
);
2614 while(isspaceW(*ptr
))
2620 while(isalnumW(*ptr
))
2623 WARN("unexpected char '%c'\n", *ptr
);
2627 WARN("expected '('\n");
2631 if(ptr2
+ sizeof(alphaW
)/sizeof(WCHAR
) == ptr
&& !memcmp(ptr2
, alphaW
, sizeof(alphaW
))) {
2632 static const WCHAR formatW
[] = {'%','f',0};
2633 static const WCHAR opacityW
[] = {'o','p','a','c','i','t','y','='};
2637 while(isspaceW(*ptr
))
2641 while(*ptr
&& *ptr
!= ',' && *ptr
!= ')')
2644 WARN("unexpected end of string\n");
2648 if(ptr
-ptr2
> sizeof(opacityW
)/sizeof(WCHAR
) && !memcmp(ptr2
, opacityW
, sizeof(opacityW
))) {
2649 float fval
= 0.0f
, e
= 0.1f
;
2652 ptr2
+= sizeof(opacityW
)/sizeof(WCHAR
);
2654 while(isdigitW(*ptr2
))
2655 fval
= fval
*10.0f
+ (float)(*ptr2
++ - '0');
2658 while(isdigitW(*++ptr2
)) {
2659 fval
+= e
* (float)(*ptr2
++ - '0');
2664 sprintfW(buf
, formatW
, fval
* 0.01f
);
2665 set_opacity(This
, buf
);
2667 FIXME("unknown param %s\n", debugstr_wn(ptr2
, ptr
-ptr2
));
2672 }while(*ptr
!= ')');
2674 FIXME("unknown filter %s\n", debugstr_wn(ptr2
, ptr
-ptr2
));
2675 ptr
= strchrW(ptr
, ')');
2683 static HRESULT WINAPI
HTMLStyle_put_filter(IHTMLStyle
*iface
, BSTR v
)
2685 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2686 WCHAR
*new_filter
= NULL
;
2688 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2691 FIXME("Element already destroyed\n");
2692 return E_UNEXPECTED
;
2696 new_filter
= heap_strdupW(v
);
2698 return E_OUTOFMEMORY
;
2701 heap_free(This
->elem
->filter
);
2702 This
->elem
->filter
= new_filter
;
2704 update_filter(This
);
2708 static HRESULT WINAPI
HTMLStyle_get_filter(IHTMLStyle
*iface
, BSTR
*p
)
2710 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2712 TRACE("(%p)->(%p)\n", This
, p
);
2715 FIXME("Element already destroyed\n");
2716 return E_UNEXPECTED
;
2719 if(This
->elem
->filter
) {
2720 *p
= SysAllocString(This
->elem
->filter
);
2722 return E_OUTOFMEMORY
;
2730 static HRESULT WINAPI
HTMLStyle_setAttribute(IHTMLStyle
*iface
, BSTR strAttributeName
,
2731 VARIANT AttributeValue
, LONG lFlags
)
2733 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2737 TRACE("(%p)->(%s %s %08x)\n", This
, debugstr_w(strAttributeName
),
2738 debugstr_variant(&AttributeValue
), lFlags
);
2740 if(!strAttributeName
)
2741 return E_INVALIDARG
;
2744 FIXME("Parameter lFlags ignored\n");
2746 hres
= HTMLStyle_GetIDsOfNames(iface
, &IID_NULL
, &strAttributeName
, 1,
2747 LOCALE_USER_DEFAULT
, &dispid
);
2751 DISPID dispidNamed
= DISPID_PROPERTYPUT
;
2755 params
.rgvarg
= &AttributeValue
;
2756 params
.cNamedArgs
= 1;
2757 params
.rgdispidNamedArgs
= &dispidNamed
;
2759 hres
= HTMLStyle_Invoke(iface
, dispid
, &IID_NULL
, LOCALE_SYSTEM_DEFAULT
,
2760 DISPATCH_PROPERTYPUT
, ¶ms
, &ret
, NULL
, NULL
);
2764 FIXME("Custom attributes not supported.\n");
2767 TRACE("ret: %08x\n", hres
);
2772 static HRESULT WINAPI
HTMLStyle_getAttribute(IHTMLStyle
*iface
, BSTR strAttributeName
,
2773 LONG lFlags
, VARIANT
*AttributeValue
)
2775 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2779 TRACE("(%p)->(%s v%p %08x)\n", This
, debugstr_w(strAttributeName
),
2780 AttributeValue
, lFlags
);
2782 if(!AttributeValue
|| !strAttributeName
)
2783 return E_INVALIDARG
;
2786 FIXME("Parameter lFlags ignored\n");
2788 hres
= HTMLStyle_GetIDsOfNames(iface
, &IID_NULL
, &strAttributeName
, 1,
2789 LOCALE_USER_DEFAULT
, &dispid
);
2792 DISPPARAMS params
= {NULL
, NULL
, 0, 0 };
2794 hres
= HTMLStyle_Invoke(iface
, dispid
, &IID_NULL
, LOCALE_SYSTEM_DEFAULT
,
2795 DISPATCH_PROPERTYGET
, ¶ms
, AttributeValue
, NULL
, NULL
);
2799 FIXME("Custom attributes not supported.\n");
2805 static HRESULT WINAPI
HTMLStyle_removeAttribute(IHTMLStyle
*iface
, BSTR strAttributeName
,
2806 LONG lFlags
, VARIANT_BOOL
*pfSuccess
)
2808 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2809 const style_tbl_entry_t
*style_entry
;
2810 nsAString name_str
, ret_str
;
2814 TRACE("(%p)->(%s %08x %p)\n", This
, debugstr_w(strAttributeName
), lFlags
, pfSuccess
);
2816 style_entry
= lookup_style_tbl(strAttributeName
);
2821 hres
= IDispatchEx_GetDispID(&This
->dispex
.IDispatchEx_iface
, strAttributeName
,
2822 (lFlags
&1) ? fdexNameCaseSensitive
: fdexNameCaseInsensitive
, &dispid
);
2824 *pfSuccess
= VARIANT_FALSE
;
2828 for(i
=0; i
< sizeof(style_tbl
)/sizeof(*style_tbl
); i
++) {
2829 if(dispid
== style_tbl
[i
].dispid
)
2833 if(i
== sizeof(style_tbl
)/sizeof(*style_tbl
))
2834 return remove_prop(&This
->dispex
, strAttributeName
, pfSuccess
);
2835 style_entry
= style_tbl
+i
;
2838 /* filter property is a special case */
2839 if(style_entry
->dispid
== DISPID_IHTMLSTYLE_FILTER
) {
2840 *pfSuccess
= This
->elem
->filter
&& *This
->elem
->filter
? VARIANT_TRUE
: VARIANT_FALSE
;
2841 heap_free(This
->elem
->filter
);
2842 This
->elem
->filter
= NULL
;
2843 update_filter(This
);
2847 nsAString_InitDepend(&name_str
, style_entry
->name
);
2848 nsAString_Init(&ret_str
, NULL
);
2849 nsres
= nsIDOMCSSStyleDeclaration_RemoveProperty(This
->nsstyle
, &name_str
, &ret_str
);
2850 if(NS_SUCCEEDED(nsres
)) {
2851 const PRUnichar
*ret
;
2852 nsAString_GetData(&ret_str
, &ret
);
2853 *pfSuccess
= *ret
? VARIANT_TRUE
: VARIANT_FALSE
;
2855 ERR("RemoveProperty failed: %08x\n", nsres
);
2857 nsAString_Finish(&name_str
);
2858 nsAString_Finish(&ret_str
);
2859 return NS_SUCCEEDED(nsres
) ? S_OK
: E_FAIL
;
2862 static HRESULT WINAPI
HTMLStyle_toString(IHTMLStyle
*iface
, BSTR
*String
)
2864 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2865 FIXME("(%p)->(%p)\n", This
, String
);
2869 static const IHTMLStyleVtbl HTMLStyleVtbl
= {
2870 HTMLStyle_QueryInterface
,
2873 HTMLStyle_GetTypeInfoCount
,
2874 HTMLStyle_GetTypeInfo
,
2875 HTMLStyle_GetIDsOfNames
,
2877 HTMLStyle_put_fontFamily
,
2878 HTMLStyle_get_fontFamily
,
2879 HTMLStyle_put_fontStyle
,
2880 HTMLStyle_get_fontStyle
,
2881 HTMLStyle_put_fontVariant
,
2882 HTMLStyle_get_fontVariant
,
2883 HTMLStyle_put_fontWeight
,
2884 HTMLStyle_get_fontWeight
,
2885 HTMLStyle_put_fontSize
,
2886 HTMLStyle_get_fontSize
,
2889 HTMLStyle_put_color
,
2890 HTMLStyle_get_color
,
2891 HTMLStyle_put_background
,
2892 HTMLStyle_get_background
,
2893 HTMLStyle_put_backgroundColor
,
2894 HTMLStyle_get_backgroundColor
,
2895 HTMLStyle_put_backgroundImage
,
2896 HTMLStyle_get_backgroundImage
,
2897 HTMLStyle_put_backgroundRepeat
,
2898 HTMLStyle_get_backgroundRepeat
,
2899 HTMLStyle_put_backgroundAttachment
,
2900 HTMLStyle_get_backgroundAttachment
,
2901 HTMLStyle_put_backgroundPosition
,
2902 HTMLStyle_get_backgroundPosition
,
2903 HTMLStyle_put_backgroundPositionX
,
2904 HTMLStyle_get_backgroundPositionX
,
2905 HTMLStyle_put_backgroundPositionY
,
2906 HTMLStyle_get_backgroundPositionY
,
2907 HTMLStyle_put_wordSpacing
,
2908 HTMLStyle_get_wordSpacing
,
2909 HTMLStyle_put_letterSpacing
,
2910 HTMLStyle_get_letterSpacing
,
2911 HTMLStyle_put_textDecoration
,
2912 HTMLStyle_get_textDecoration
,
2913 HTMLStyle_put_textDecorationNone
,
2914 HTMLStyle_get_textDecorationNone
,
2915 HTMLStyle_put_textDecorationUnderline
,
2916 HTMLStyle_get_textDecorationUnderline
,
2917 HTMLStyle_put_textDecorationOverline
,
2918 HTMLStyle_get_textDecorationOverline
,
2919 HTMLStyle_put_textDecorationLineThrough
,
2920 HTMLStyle_get_textDecorationLineThrough
,
2921 HTMLStyle_put_textDecorationBlink
,
2922 HTMLStyle_get_textDecorationBlink
,
2923 HTMLStyle_put_verticalAlign
,
2924 HTMLStyle_get_verticalAlign
,
2925 HTMLStyle_put_textTransform
,
2926 HTMLStyle_get_textTransform
,
2927 HTMLStyle_put_textAlign
,
2928 HTMLStyle_get_textAlign
,
2929 HTMLStyle_put_textIndent
,
2930 HTMLStyle_get_textIndent
,
2931 HTMLStyle_put_lineHeight
,
2932 HTMLStyle_get_lineHeight
,
2933 HTMLStyle_put_marginTop
,
2934 HTMLStyle_get_marginTop
,
2935 HTMLStyle_put_marginRight
,
2936 HTMLStyle_get_marginRight
,
2937 HTMLStyle_put_marginBottom
,
2938 HTMLStyle_get_marginBottom
,
2939 HTMLStyle_put_marginLeft
,
2940 HTMLStyle_get_marginLeft
,
2941 HTMLStyle_put_margin
,
2942 HTMLStyle_get_margin
,
2943 HTMLStyle_put_paddingTop
,
2944 HTMLStyle_get_paddingTop
,
2945 HTMLStyle_put_paddingRight
,
2946 HTMLStyle_get_paddingRight
,
2947 HTMLStyle_put_paddingBottom
,
2948 HTMLStyle_get_paddingBottom
,
2949 HTMLStyle_put_paddingLeft
,
2950 HTMLStyle_get_paddingLeft
,
2951 HTMLStyle_put_padding
,
2952 HTMLStyle_get_padding
,
2953 HTMLStyle_put_border
,
2954 HTMLStyle_get_border
,
2955 HTMLStyle_put_borderTop
,
2956 HTMLStyle_get_borderTop
,
2957 HTMLStyle_put_borderRight
,
2958 HTMLStyle_get_borderRight
,
2959 HTMLStyle_put_borderBottom
,
2960 HTMLStyle_get_borderBottom
,
2961 HTMLStyle_put_borderLeft
,
2962 HTMLStyle_get_borderLeft
,
2963 HTMLStyle_put_borderColor
,
2964 HTMLStyle_get_borderColor
,
2965 HTMLStyle_put_borderTopColor
,
2966 HTMLStyle_get_borderTopColor
,
2967 HTMLStyle_put_borderRightColor
,
2968 HTMLStyle_get_borderRightColor
,
2969 HTMLStyle_put_borderBottomColor
,
2970 HTMLStyle_get_borderBottomColor
,
2971 HTMLStyle_put_borderLeftColor
,
2972 HTMLStyle_get_borderLeftColor
,
2973 HTMLStyle_put_borderWidth
,
2974 HTMLStyle_get_borderWidth
,
2975 HTMLStyle_put_borderTopWidth
,
2976 HTMLStyle_get_borderTopWidth
,
2977 HTMLStyle_put_borderRightWidth
,
2978 HTMLStyle_get_borderRightWidth
,
2979 HTMLStyle_put_borderBottomWidth
,
2980 HTMLStyle_get_borderBottomWidth
,
2981 HTMLStyle_put_borderLeftWidth
,
2982 HTMLStyle_get_borderLeftWidth
,
2983 HTMLStyle_put_borderStyle
,
2984 HTMLStyle_get_borderStyle
,
2985 HTMLStyle_put_borderTopStyle
,
2986 HTMLStyle_get_borderTopStyle
,
2987 HTMLStyle_put_borderRightStyle
,
2988 HTMLStyle_get_borderRightStyle
,
2989 HTMLStyle_put_borderBottomStyle
,
2990 HTMLStyle_get_borderBottomStyle
,
2991 HTMLStyle_put_borderLeftStyle
,
2992 HTMLStyle_get_borderLeftStyle
,
2993 HTMLStyle_put_width
,
2994 HTMLStyle_get_width
,
2995 HTMLStyle_put_height
,
2996 HTMLStyle_get_height
,
2997 HTMLStyle_put_styleFloat
,
2998 HTMLStyle_get_styleFloat
,
2999 HTMLStyle_put_clear
,
3000 HTMLStyle_get_clear
,
3001 HTMLStyle_put_display
,
3002 HTMLStyle_get_display
,
3003 HTMLStyle_put_visibility
,
3004 HTMLStyle_get_visibility
,
3005 HTMLStyle_put_listStyleType
,
3006 HTMLStyle_get_listStyleType
,
3007 HTMLStyle_put_listStylePosition
,
3008 HTMLStyle_get_listStylePosition
,
3009 HTMLStyle_put_listStyleImage
,
3010 HTMLStyle_get_listStyleImage
,
3011 HTMLStyle_put_listStyle
,
3012 HTMLStyle_get_listStyle
,
3013 HTMLStyle_put_whiteSpace
,
3014 HTMLStyle_get_whiteSpace
,
3019 HTMLStyle_get_position
,
3020 HTMLStyle_put_zIndex
,
3021 HTMLStyle_get_zIndex
,
3022 HTMLStyle_put_overflow
,
3023 HTMLStyle_get_overflow
,
3024 HTMLStyle_put_pageBreakBefore
,
3025 HTMLStyle_get_pageBreakBefore
,
3026 HTMLStyle_put_pageBreakAfter
,
3027 HTMLStyle_get_pageBreakAfter
,
3028 HTMLStyle_put_cssText
,
3029 HTMLStyle_get_cssText
,
3030 HTMLStyle_put_pixelTop
,
3031 HTMLStyle_get_pixelTop
,
3032 HTMLStyle_put_pixelLeft
,
3033 HTMLStyle_get_pixelLeft
,
3034 HTMLStyle_put_pixelWidth
,
3035 HTMLStyle_get_pixelWidth
,
3036 HTMLStyle_put_pixelHeight
,
3037 HTMLStyle_get_pixelHeight
,
3038 HTMLStyle_put_posTop
,
3039 HTMLStyle_get_posTop
,
3040 HTMLStyle_put_posLeft
,
3041 HTMLStyle_get_posLeft
,
3042 HTMLStyle_put_posWidth
,
3043 HTMLStyle_get_posWidth
,
3044 HTMLStyle_put_posHeight
,
3045 HTMLStyle_get_posHeight
,
3046 HTMLStyle_put_cursor
,
3047 HTMLStyle_get_cursor
,
3050 HTMLStyle_put_filter
,
3051 HTMLStyle_get_filter
,
3052 HTMLStyle_setAttribute
,
3053 HTMLStyle_getAttribute
,
3054 HTMLStyle_removeAttribute
,
3058 static HRESULT
HTMLStyle_get_dispid(DispatchEx
*dispex
, BSTR name
, DWORD flags
, DISPID
*dispid
)
3060 const style_tbl_entry_t
*style_entry
;
3062 style_entry
= lookup_style_tbl(name
);
3064 *dispid
= style_entry
->dispid
;
3068 return DISP_E_UNKNOWNNAME
;
3071 static const dispex_static_data_vtbl_t HTMLStyle_dispex_vtbl
= {
3073 HTMLStyle_get_dispid
,
3078 static const tid_t HTMLStyle_iface_tids
[] = {
3087 static dispex_static_data_t HTMLStyle_dispex
= {
3088 &HTMLStyle_dispex_vtbl
,
3091 HTMLStyle_iface_tids
3094 HRESULT
HTMLStyle_Create(HTMLElement
*elem
, HTMLStyle
**ret
)
3096 nsIDOMElementCSSInlineStyle
*nselemstyle
;
3097 nsIDOMCSSStyleDeclaration
*nsstyle
;
3102 FIXME("NULL nselem\n");
3106 nsres
= nsIDOMHTMLElement_QueryInterface(elem
->nselem
, &IID_nsIDOMElementCSSInlineStyle
,
3107 (void**)&nselemstyle
);
3108 assert(nsres
== NS_OK
);
3110 nsres
= nsIDOMElementCSSInlineStyle_GetStyle(nselemstyle
, &nsstyle
);
3111 nsIDOMElementCSSInlineStyle_Release(nselemstyle
);
3112 if(NS_FAILED(nsres
)) {
3113 ERR("GetStyle failed: %08x\n", nsres
);
3117 style
= heap_alloc_zero(sizeof(HTMLStyle
));
3119 nsIDOMCSSStyleDeclaration_Release(nsstyle
);
3120 return E_OUTOFMEMORY
;
3123 style
->IHTMLStyle_iface
.lpVtbl
= &HTMLStyleVtbl
;
3125 style
->nsstyle
= nsstyle
;
3127 HTMLStyle2_Init(style
);
3128 HTMLStyle3_Init(style
);
3130 nsIDOMCSSStyleDeclaration_AddRef(nsstyle
);
3132 init_dispex(&style
->dispex
, (IUnknown
*)&style
->IHTMLStyle_iface
, &HTMLStyle_dispex
);