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
31 #include "mshtml_private.h"
32 #include "htmlstyle.h"
34 #include "wine/debug.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 attrBackgroundPosition
[] =
45 {'b','a','c','k','g','r','o','u','n','d','-','p','o','s','i','t','i','o','n',0};
46 static const WCHAR attrBackgroundPositionX
[] =
47 {'b','a','c','k','g','r','o','u','n','d','-','p','o','s','i','t','i','o','n','-','x',0};
48 static const WCHAR attrBackgroundPositionY
[] =
49 {'b','a','c','k','g','r','o','u','n','d','-','p','o','s','i','t','i','o','n','-','y',0};
50 static const WCHAR attrBackgroundRepeat
[] =
51 {'b','a','c','k','g','r','o','u','n','d','-','r','e','p','e','a','t',0};
52 static const WCHAR attrBorder
[] =
53 {'b','o','r','d','e','r',0};
54 static const WCHAR attrBorderBottom
[] =
55 {'b','o','r','d','e','r','-','b','o','t','t','o','m',0};
56 static const WCHAR attrBorderBottomColor
[] =
57 {'b','o','r','d','e','r','-','b','o','t','t','o','m','-','c','o','l','o','r',0};
58 static const WCHAR attrBorderBottomStyle
[] =
59 {'b','o','r','d','e','r','-','b','o','t','t','o','m','-','s','t','y','l','e',0};
60 static const WCHAR attrBorderBottomWidth
[] =
61 {'b','o','r','d','e','r','-','b','o','t','t','o','m','-','w','i','d','t','h',0};
62 static const WCHAR attrBorderColor
[] =
63 {'b','o','r','d','e','r','-','c','o','l','o','r',0};
64 static const WCHAR attrBorderLeft
[] =
65 {'b','o','r','d','e','r','-','l','e','f','t',0};
66 static const WCHAR attrBorderLeftColor
[] =
67 {'b','o','r','d','e','r','-','l','e','f','t','-','c','o','l','o','r',0};
68 static const WCHAR attrBorderLeftStyle
[] =
69 {'b','o','r','d','e','r','-','l','e','f','t','-','s','t','y','l','e',0};
70 static const WCHAR attrBorderLeftWidth
[] =
71 {'b','o','r','d','e','r','-','l','e','f','t','-','w','i','d','t','h',0};
72 static const WCHAR attrBorderRight
[] =
73 {'b','o','r','d','e','r','-','r','i','g','h','t',0};
74 static const WCHAR attrBorderRightColor
[] =
75 {'b','o','r','d','e','r','-','r','i','g','h','t','-','c','o','l','o','r',0};
76 static const WCHAR attrBorderRightStyle
[] =
77 {'b','o','r','d','e','r','-','r','i','g','h','t','-','s','t','y','l','e',0};
78 static const WCHAR attrBorderRightWidth
[] =
79 {'b','o','r','d','e','r','-','r','i','g','h','t','-','w','i','d','t','h',0};
80 static const WCHAR attrBorderTop
[] =
81 {'b','o','r','d','e','r','-','t','o','p',0};
82 static const WCHAR attrBorderTopColor
[] =
83 {'b','o','r','d','e','r','-','t','o','p','-','c','o','l','o','r',0};
84 static const WCHAR attrBorderStyle
[] =
85 {'b','o','r','d','e','r','-','s','t','y','l','e',0};
86 static const WCHAR attrBorderTopStyle
[] =
87 {'b','o','r','d','e','r','-','t','o','p','-','s','t','y','l','e',0};
88 static const WCHAR attrBorderTopWidth
[] =
89 {'b','o','r','d','e','r','-','t','o','p','-','w','i','d','t','h',0};
90 static const WCHAR attrBorderWidth
[] =
91 {'b','o','r','d','e','r','-','w','i','d','t','h',0};
92 static const WCHAR attrBottom
[] =
93 {'b','o','t','t','o','m',0};
94 static const WCHAR attrClear
[] =
95 {'c','l','e','a','r',0};
96 static const WCHAR attrClip
[] =
98 static const WCHAR attrColor
[] =
99 {'c','o','l','o','r',0};
100 static const WCHAR attrCursor
[] =
101 {'c','u','r','s','o','r',0};
102 static const WCHAR attrDirection
[] =
103 {'d','i','r','e','c','t','i','o','n',0};
104 static const WCHAR attrDisplay
[] =
105 {'d','i','s','p','l','a','y',0};
106 static const WCHAR attrFilter
[] =
107 {'f','i','l','e','t','e','r',0};
108 static const WCHAR attrFontFamily
[] =
109 {'f','o','n','t','-','f','a','m','i','l','y',0};
110 static const WCHAR attrFontSize
[] =
111 {'f','o','n','t','-','s','i','z','e',0};
112 static const WCHAR attrFontStyle
[] =
113 {'f','o','n','t','-','s','t','y','l','e',0};
114 static const WCHAR attrFontVariant
[] =
115 {'f','o','n','t','-','v','a','r','i','a','n','t',0};
116 static const WCHAR attrFontWeight
[] =
117 {'f','o','n','t','-','w','e','i','g','h','t',0};
118 static const WCHAR attrHeight
[] =
119 {'h','e','i','g','h','t',0};
120 static const WCHAR attrLeft
[] =
122 static const WCHAR attrLetterSpacing
[] =
123 {'l','e','t','t','e','r','-','s','p','a','c','i','n','g',0};
124 static const WCHAR attrLineHeight
[] =
125 {'l','i','n','e','-','h','e','i','g','h','t',0};
126 static const WCHAR attrMargin
[] =
127 {'m','a','r','g','i','n',0};
128 static const WCHAR attrMarginBottom
[] =
129 {'m','a','r','g','i','n','-','b','o','t','t','o','m',0};
130 static const WCHAR attrMarginLeft
[] =
131 {'m','a','r','g','i','n','-','l','e','f','t',0};
132 static const WCHAR attrMarginRight
[] =
133 {'m','a','r','g','i','n','-','r','i','g','h','t',0};
134 static const WCHAR attrMarginTop
[] =
135 {'m','a','r','g','i','n','-','t','o','p',0};
136 static const WCHAR attrMinHeight
[] =
137 {'m','i','n','-','h','e','i','g','h','t',0};
138 static const WCHAR attrOverflow
[] =
139 {'o','v','e','r','f','l','o','w',0};
140 static const WCHAR attrOverflowX
[] =
141 {'o','v','e','r','f','l','o','w','-','x',0};
142 static const WCHAR attrOverflowY
[] =
143 {'o','v','e','r','f','l','o','w','-','y',0};
144 static const WCHAR attrPadding
[] =
145 {'p','a','d','d','i','n','g',0};
146 static const WCHAR attrPaddingBottom
[] =
147 {'p','a','d','d','i','n','g','-','b','o','t','t','o','m',0};
148 static const WCHAR attrPaddingLeft
[] =
149 {'p','a','d','d','i','n','g','-','l','e','f','t',0};
150 static const WCHAR attrPaddingRight
[] =
151 {'p','a','d','d','i','n','g','-','r','i','g','h','t',0};
152 static const WCHAR attrPaddingTop
[] =
153 {'p','a','d','d','i','n','g','-','t','o','p',0};
154 static const WCHAR attrPageBreakAfter
[] =
155 {'p','a','g','e','-','b','r','e','a','k','-','a','f','t','e','r',0};
156 static const WCHAR attrPageBreakBefore
[] =
157 {'p','a','g','e','-','b','r','e','a','k','-','b','e','f','o','r','e',0};
158 static const WCHAR attrPosition
[] =
159 {'p','o','s','i','t','i','o','n',0};
160 static const WCHAR attrRight
[] =
161 {'r','i','g','h','t',0};
162 static const WCHAR attrTextAlign
[] =
163 {'t','e','x','t','-','a','l','i','g','n',0};
164 static const WCHAR attrTextDecoration
[] =
165 {'t','e','x','t','-','d','e','c','o','r','a','t','i','o','n',0};
166 static const WCHAR attrTextIndent
[] =
167 {'t','e','x','t','-','i','n','d','e','n','t',0};
168 static const WCHAR attrTop
[] =
170 static const WCHAR attrVerticalAlign
[] =
171 {'v','e','r','t','i','c','a','l','-','a','l','i','g','n',0};
172 static const WCHAR attrVisibility
[] =
173 {'v','i','s','i','b','i','l','i','t','y',0};
174 static const WCHAR attrWhiteSpace
[] =
175 {'w','h','i','t','e','-','s','p','a','c','e',0};
176 static const WCHAR attrWidth
[] =
177 {'w','i','d','t','h',0};
178 static const WCHAR attrWordSpacing
[] =
179 {'w','o','r','d','-','s','p','a','c','i','n','g',0};
180 static const WCHAR attrWordWrap
[] =
181 {'w','o','r','d','-','w','r','a','p',0};
182 static const WCHAR attrZIndex
[] =
183 {'z','-','i','n','d','e','x',0};
186 static const WCHAR pxW
[] = {'p','x',0};
193 static const style_tbl_entry_t style_tbl
[] = {
194 {attrBackground
, DISPID_IHTMLSTYLE_BACKGROUND
},
195 {attrBackgroundColor
, DISPID_IHTMLSTYLE_BACKGROUNDCOLOR
},
196 {attrBackgroundImage
, DISPID_IHTMLSTYLE_BACKGROUNDIMAGE
},
197 {attrBackgroundPosition
, DISPID_IHTMLSTYLE_BACKGROUNDPOSITION
},
198 {attrBackgroundPositionX
, DISPID_IHTMLSTYLE_BACKGROUNDPOSITIONX
},
199 {attrBackgroundPositionY
, DISPID_IHTMLSTYLE_BACKGROUNDPOSITIONY
},
200 {attrBackgroundRepeat
, DISPID_IHTMLSTYLE_BACKGROUNDREPEAT
},
201 {attrBorder
, DISPID_IHTMLSTYLE_BORDER
},
202 {attrBorderBottom
, DISPID_IHTMLSTYLE_BORDERBOTTOM
},
203 {attrBorderBottomColor
, DISPID_IHTMLSTYLE_BORDERBOTTOMCOLOR
},
204 {attrBorderBottomStyle
, DISPID_IHTMLSTYLE_BORDERBOTTOMSTYLE
},
205 {attrBorderBottomWidth
, DISPID_IHTMLSTYLE_BORDERBOTTOMWIDTH
},
206 {attrBorderColor
, DISPID_IHTMLSTYLE_BORDERCOLOR
},
207 {attrBorderLeft
, DISPID_IHTMLSTYLE_BORDERLEFT
},
208 {attrBorderLeftColor
, DISPID_IHTMLSTYLE_BORDERLEFTCOLOR
},
209 {attrBorderLeftStyle
, DISPID_IHTMLSTYLE_BORDERLEFTSTYLE
},
210 {attrBorderLeftWidth
, DISPID_IHTMLSTYLE_BORDERLEFTWIDTH
},
211 {attrBorderRight
, DISPID_IHTMLSTYLE_BORDERRIGHT
},
212 {attrBorderRightColor
, DISPID_IHTMLSTYLE_BORDERRIGHTCOLOR
},
213 {attrBorderRightStyle
, DISPID_IHTMLSTYLE_BORDERRIGHTSTYLE
},
214 {attrBorderRightWidth
, DISPID_IHTMLSTYLE_BORDERRIGHTWIDTH
},
215 {attrBorderStyle
, DISPID_IHTMLSTYLE_BORDERSTYLE
},
216 {attrBorderTop
, DISPID_IHTMLSTYLE_BORDERTOP
},
217 {attrBorderTopColor
, DISPID_IHTMLSTYLE_BORDERTOPCOLOR
},
218 {attrBorderTopStyle
, DISPID_IHTMLSTYLE_BORDERTOPSTYLE
},
219 {attrBorderTopWidth
, DISPID_IHTMLSTYLE_BORDERTOPWIDTH
},
220 {attrBorderWidth
, DISPID_IHTMLSTYLE_BORDERWIDTH
},
221 {attrBottom
, DISPID_IHTMLSTYLE2_BOTTOM
},
222 {attrClear
, DISPID_IHTMLSTYLE_CLEAR
},
223 {attrClip
, DISPID_IHTMLSTYLE_CLIP
},
224 {attrColor
, DISPID_IHTMLSTYLE_COLOR
},
225 {attrCursor
, DISPID_IHTMLSTYLE_CURSOR
},
226 {attrDirection
, DISPID_IHTMLSTYLE2_DIRECTION
},
227 {attrDisplay
, DISPID_IHTMLSTYLE_DISPLAY
},
228 {attrFilter
, DISPID_IHTMLSTYLE_FILTER
},
229 {attrFontFamily
, DISPID_IHTMLSTYLE_FONTFAMILY
},
230 {attrFontSize
, DISPID_IHTMLSTYLE_FONTSIZE
},
231 {attrFontStyle
, DISPID_IHTMLSTYLE_FONTSTYLE
},
232 {attrFontVariant
, DISPID_IHTMLSTYLE_FONTVARIANT
},
233 {attrFontWeight
, DISPID_IHTMLSTYLE_FONTWEIGHT
},
234 {attrHeight
, DISPID_IHTMLSTYLE_HEIGHT
},
235 {attrLeft
, DISPID_IHTMLSTYLE_LEFT
},
236 {attrLetterSpacing
, DISPID_IHTMLSTYLE_LETTERSPACING
},
237 {attrLineHeight
, DISPID_IHTMLSTYLE_LINEHEIGHT
},
238 {attrMargin
, DISPID_IHTMLSTYLE_MARGIN
},
239 {attrMarginBottom
, DISPID_IHTMLSTYLE_MARGINBOTTOM
},
240 {attrMarginLeft
, DISPID_IHTMLSTYLE_MARGINLEFT
},
241 {attrMarginRight
, DISPID_IHTMLSTYLE_MARGINRIGHT
},
242 {attrMarginTop
, DISPID_IHTMLSTYLE_MARGINTOP
},
243 {attrMinHeight
, DISPID_IHTMLSTYLE4_MINHEIGHT
},
244 {attrOverflow
, DISPID_IHTMLSTYLE_OVERFLOW
},
245 {attrOverflowX
, DISPID_IHTMLSTYLE2_OVERFLOWX
},
246 {attrOverflowY
, DISPID_IHTMLSTYLE2_OVERFLOWY
},
247 {attrPadding
, DISPID_IHTMLSTYLE_PADDING
},
248 {attrPaddingBottom
, DISPID_IHTMLSTYLE_PADDINGBOTTOM
},
249 {attrPaddingLeft
, DISPID_IHTMLSTYLE_PADDINGLEFT
},
250 {attrPaddingRight
, DISPID_IHTMLSTYLE_PADDINGRIGHT
},
251 {attrPaddingTop
, DISPID_IHTMLSTYLE_PADDINGTOP
},
252 {attrPageBreakAfter
, DISPID_IHTMLSTYLE_PAGEBREAKAFTER
},
253 {attrPageBreakBefore
, DISPID_IHTMLSTYLE_PAGEBREAKBEFORE
},
254 {attrPosition
, DISPID_IHTMLSTYLE2_POSITION
},
255 {attrRight
, DISPID_IHTMLSTYLE2_RIGHT
},
256 {attrTextAlign
, DISPID_IHTMLSTYLE_TEXTALIGN
},
257 {attrTextDecoration
, DISPID_IHTMLSTYLE_TEXTDECORATION
},
258 {attrTextIndent
, DISPID_IHTMLSTYLE_TEXTINDENT
},
259 {attrTop
, DISPID_IHTMLSTYLE_TOP
},
260 {attrVerticalAlign
, DISPID_IHTMLSTYLE_VERTICALALIGN
},
261 {attrVisibility
, DISPID_IHTMLSTYLE_VISIBILITY
},
262 {attrWhiteSpace
, DISPID_IHTMLSTYLE_WHITESPACE
},
263 {attrWidth
, DISPID_IHTMLSTYLE_WIDTH
},
264 {attrWordSpacing
, DISPID_IHTMLSTYLE_WORDSPACING
},
265 {attrWordWrap
, DISPID_IHTMLSTYLE3_WORDWRAP
},
266 {attrZIndex
, DISPID_IHTMLSTYLE_ZINDEX
}
269 static const WCHAR valLineThrough
[] =
270 {'l','i','n','e','-','t','h','r','o','u','g','h',0};
271 static const WCHAR valUnderline
[] =
272 {'u','n','d','e','r','l','i','n','e',0};
273 static const WCHAR szNormal
[] =
274 {'n','o','r','m','a','l',0};
275 static const WCHAR styleNone
[] =
277 static const WCHAR valOverline
[] =
278 {'o','v','e','r','l','i','n','e',0};
279 static const WCHAR valBlink
[] =
280 {'b','l','i','n','k',0};
282 static const WCHAR px_formatW
[] = {'%','d','p','x',0};
283 static const WCHAR emptyW
[] = {0};
285 static const style_tbl_entry_t
*lookup_style_tbl(const WCHAR
*name
)
287 int c
, i
, min
= 0, max
= sizeof(style_tbl
)/sizeof(*style_tbl
)-1;
292 c
= strcmpW(style_tbl
[i
].name
, name
);
305 static LPWSTR
fix_px_value(LPCWSTR val
)
310 while(*ptr
&& isspaceW(*ptr
))
315 while(*ptr
&& isdigitW(*ptr
))
318 if(!*ptr
|| isspaceW(*ptr
)) {
320 int len
= strlenW(val
)+1;
322 ret
= heap_alloc((len
+2)*sizeof(WCHAR
));
323 memcpy(ret
, val
, (ptr
-val
)*sizeof(WCHAR
));
329 TRACE("fixed %s -> %s\n", debugstr_w(val
), debugstr_w(ret
));
334 while(*ptr
&& !isspaceW(*ptr
))
341 static LPWSTR
fix_url_value(LPCWSTR val
)
345 static const WCHAR urlW
[] = {'u','r','l','('};
347 if(strncmpW(val
, urlW
, sizeof(urlW
)/sizeof(WCHAR
)) || !strchrW(val
, '\\'))
350 ret
= heap_strdupW(val
);
352 for(ptr
= ret
; *ptr
; ptr
++) {
360 HRESULT
set_nsstyle_attr(nsIDOMCSSStyleDeclaration
*nsstyle
, styleid_t sid
, const WCHAR
*value
, DWORD flags
)
362 nsAString str_name
, str_value
, str_empty
;
367 if(flags
& ATTR_FIX_PX
)
368 val
= fix_px_value(value
);
369 if(flags
& ATTR_FIX_URL
)
370 val
= fix_url_value(value
);
373 nsAString_InitDepend(&str_name
, style_tbl
[sid
].name
);
374 nsAString_InitDepend(&str_value
, val
? val
: value
);
375 nsAString_InitDepend(&str_empty
, emptyW
);
377 nsres
= nsIDOMCSSStyleDeclaration_SetProperty(nsstyle
, &str_name
, &str_value
, &str_empty
);
379 ERR("SetProperty failed: %08x\n", nsres
);
381 nsAString_Finish(&str_name
);
382 nsAString_Finish(&str_value
);
383 nsAString_Finish(&str_empty
);
389 static HRESULT
var_to_styleval(const VARIANT
*v
, WCHAR
*buf
, DWORD flags
, const WCHAR
**ret
)
400 case VT_BSTR
|VT_BYREF
:
401 *ret
= *V_BSTRREF(v
);
405 static const WCHAR formatW
[] = {'%','d',0};
406 static const WCHAR hex_formatW
[] = {'#','%','0','6','x',0};
408 if(flags
& ATTR_HEX_INT
)
409 wsprintfW(buf
, hex_formatW
, V_I4(v
));
410 else if(flags
& ATTR_FIX_PX
)
411 wsprintfW(buf
, px_formatW
, V_I4(v
));
413 wsprintfW(buf
, formatW
, V_I4(v
));
419 FIXME("not implemented for %s\n", debugstr_variant(v
));
425 HRESULT
set_nsstyle_attr_var(nsIDOMCSSStyleDeclaration
*nsstyle
, styleid_t sid
, VARIANT
*value
, DWORD flags
)
431 hres
= var_to_styleval(value
, buf
, flags
, &val
);
435 return set_nsstyle_attr(nsstyle
, sid
, val
, flags
);
438 static inline HRESULT
set_style_attr(HTMLStyle
*This
, styleid_t sid
, LPCWSTR value
, DWORD flags
)
440 return set_nsstyle_attr(This
->nsstyle
, sid
, value
, flags
);
443 static HRESULT
get_nsstyle_attr_nsval(nsIDOMCSSStyleDeclaration
*nsstyle
, styleid_t sid
, nsAString
*value
)
448 nsAString_InitDepend(&str_name
, style_tbl
[sid
].name
);
450 nsres
= nsIDOMCSSStyleDeclaration_GetPropertyValue(nsstyle
, &str_name
, value
);
451 if(NS_FAILED(nsres
)) {
452 ERR("SetProperty failed: %08x\n", nsres
);
456 nsAString_Finish(&str_name
);
461 static HRESULT
nsstyle_to_bstr(const WCHAR
*val
, DWORD flags
, BSTR
*p
)
471 ret
= SysAllocString(val
);
473 return E_OUTOFMEMORY
;
475 len
= SysStringLen(ret
);
477 if(flags
& ATTR_REMOVE_COMMA
) {
481 for(ptr
= ret
; (ptr
= strchrW(ptr
, ',')); ptr
++)
487 new_ret
= SysAllocStringLen(NULL
, new_len
);
490 return E_OUTOFMEMORY
;
493 for(ptr2
= new_ret
, ptr
= ret
; *ptr
; ptr
++) {
507 HRESULT
get_nsstyle_attr(nsIDOMCSSStyleDeclaration
*nsstyle
, styleid_t sid
, BSTR
*p
, DWORD flags
)
510 const PRUnichar
*value
;
513 nsAString_Init(&str_value
, NULL
);
515 get_nsstyle_attr_nsval(nsstyle
, sid
, &str_value
);
517 nsAString_GetData(&str_value
, &value
);
518 hres
= nsstyle_to_bstr(value
, flags
, p
);
519 nsAString_Finish(&str_value
);
521 TRACE("%s -> %s\n", debugstr_w(style_tbl
[sid
].name
), debugstr_w(*p
));
525 HRESULT
get_nsstyle_attr_var(nsIDOMCSSStyleDeclaration
*nsstyle
, styleid_t sid
, VARIANT
*p
, DWORD flags
)
528 const PRUnichar
*value
;
532 nsAString_Init(&str_value
, NULL
);
534 get_nsstyle_attr_nsval(nsstyle
, sid
, &str_value
);
536 nsAString_GetData(&str_value
, &value
);
538 if(flags
& ATTR_STR_TO_INT
) {
539 const PRUnichar
*ptr
= value
;
548 while(isdigitW(*ptr
))
549 i
= i
*10 + (*ptr
++ - '0');
553 V_I4(p
) = neg
? -i
: i
;
561 hres
= nsstyle_to_bstr(value
, flags
, &str
);
562 if(SUCCEEDED(hres
)) {
568 nsAString_Finish(&str_value
);
570 TRACE("%s -> %s\n", debugstr_w(style_tbl
[sid
].name
), debugstr_variant(p
));
574 static inline HRESULT
get_style_attr(HTMLStyle
*This
, styleid_t sid
, BSTR
*p
)
576 return get_nsstyle_attr(This
->nsstyle
, sid
, p
, 0);
579 static HRESULT
check_style_attr_value(HTMLStyle
*This
, styleid_t sid
, LPCWSTR exval
, VARIANT_BOOL
*p
)
582 const PRUnichar
*value
;
584 nsAString_Init(&str_value
, NULL
);
586 get_nsstyle_attr_nsval(This
->nsstyle
, sid
, &str_value
);
588 nsAString_GetData(&str_value
, &value
);
589 *p
= strcmpW(value
, exval
) ? VARIANT_FALSE
: VARIANT_TRUE
;
590 nsAString_Finish(&str_value
);
592 TRACE("%s -> %x\n", debugstr_w(style_tbl
[sid
].name
), *p
);
596 static inline HRESULT
set_style_pos(HTMLStyle
*This
, styleid_t sid
, float value
)
599 WCHAR szFormat
[] = {'%','.','0','f','p','x',0};
601 value
= floor(value
);
603 sprintfW(szValue
, szFormat
, value
);
605 return set_style_attr(This
, sid
, szValue
, 0);
608 static HRESULT
set_style_pxattr(nsIDOMCSSStyleDeclaration
*nsstyle
, styleid_t sid
, LONG value
)
612 sprintfW(value_str
, px_formatW
, value
);
614 return set_nsstyle_attr(nsstyle
, sid
, value_str
, 0);
617 static HRESULT
get_nsstyle_pos(HTMLStyle
*This
, styleid_t sid
, float *p
)
622 TRACE("%p %d %p\n", This
, sid
, p
);
626 nsAString_Init(&str_value
, NULL
);
628 hres
= get_nsstyle_attr_nsval(This
->nsstyle
, sid
, &str_value
);
632 const PRUnichar
*value
;
634 nsAString_GetData(&str_value
, &value
);
637 *p
= strtolW(value
, &ptr
, 10);
639 if(*ptr
&& strcmpW(ptr
, pxW
))
641 nsAString_Finish(&str_value
);
642 FIXME("only px values are currently supported\n");
648 TRACE("ret %f\n", *p
);
650 nsAString_Finish(&str_value
);
654 static HRESULT
get_nsstyle_pixel_val(HTMLStyle
*This
, styleid_t sid
, LONG
*p
)
659 nsAString_Init(&str_value
, NULL
);
661 hres
= get_nsstyle_attr_nsval(This
->nsstyle
, sid
, &str_value
);
664 const PRUnichar
*value
;
666 nsAString_GetData(&str_value
, &value
);
668 *p
= strtolW(value
, &ptr
, 10);
671 /* Skip all digits. We have tests showing that we should not round the value. */
672 while(isdigitW(*++ptr
));
675 if(*ptr
&& strcmpW(ptr
, pxW
)) {
676 nsAString_Finish(&str_value
);
677 FIXME("%s: only px values are currently supported\n", debugstr_w(value
));
685 nsAString_Finish(&str_value
);
689 static BOOL
is_valid_border_style(BSTR v
)
691 static const WCHAR styleDotted
[] = {'d','o','t','t','e','d',0};
692 static const WCHAR styleDashed
[] = {'d','a','s','h','e','d',0};
693 static const WCHAR styleSolid
[] = {'s','o','l','i','d',0};
694 static const WCHAR styleDouble
[] = {'d','o','u','b','l','e',0};
695 static const WCHAR styleGroove
[] = {'g','r','o','o','v','e',0};
696 static const WCHAR styleRidge
[] = {'r','i','d','g','e',0};
697 static const WCHAR styleInset
[] = {'i','n','s','e','t',0};
698 static const WCHAR styleOutset
[] = {'o','u','t','s','e','t',0};
700 TRACE("%s\n", debugstr_w(v
));
702 if(!v
|| strcmpiW(v
, styleNone
) == 0 || strcmpiW(v
, styleDotted
) == 0 ||
703 strcmpiW(v
, styleDashed
) == 0 || strcmpiW(v
, styleSolid
) == 0 ||
704 strcmpiW(v
, styleDouble
) == 0 || strcmpiW(v
, styleGroove
) == 0 ||
705 strcmpiW(v
, styleRidge
) == 0 || strcmpiW(v
, styleInset
) == 0 ||
706 strcmpiW(v
, styleOutset
) == 0 )
714 static inline HTMLStyle
*impl_from_IHTMLStyle(IHTMLStyle
*iface
)
716 return CONTAINING_RECORD(iface
, HTMLStyle
, IHTMLStyle_iface
);
719 static HRESULT WINAPI
HTMLStyle_QueryInterface(IHTMLStyle
*iface
, REFIID riid
, void **ppv
)
721 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
725 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
726 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppv
);
727 *ppv
= &This
->IHTMLStyle_iface
;
728 }else if(IsEqualGUID(&IID_IHTMLStyle
, riid
)) {
729 TRACE("(%p)->(IID_IHTMLStyle %p)\n", This
, ppv
);
730 *ppv
= &This
->IHTMLStyle_iface
;
731 }else if(IsEqualGUID(&IID_IHTMLStyle2
, riid
)) {
732 TRACE("(%p)->(IID_IHTMLStyle2 %p)\n", This
, ppv
);
733 *ppv
= &This
->IHTMLStyle2_iface
;
734 }else if(IsEqualGUID(&IID_IHTMLStyle3
, riid
)) {
735 TRACE("(%p)->(IID_IHTMLStyle3 %p)\n", This
, ppv
);
736 *ppv
= &This
->IHTMLStyle3_iface
;
737 }else if(IsEqualGUID(&IID_IHTMLStyle4
, riid
)) {
738 TRACE("(%p)->(IID_IHTMLStyle4 %p)\n", This
, ppv
);
739 *ppv
= &This
->IHTMLStyle4_iface
;
740 }else if(IsEqualGUID(&IID_IHTMLStyle5
, riid
)) {
741 TRACE("(%p)->(IID_IHTMLStyle5 %p)\n", This
, ppv
);
742 *ppv
= &This
->IHTMLStyle5_iface
;
743 }else if(IsEqualGUID(&IID_IHTMLStyle6
, riid
)) {
744 TRACE("(%p)->(IID_IHTMLStyle6 %p)\n", This
, ppv
);
745 *ppv
= &This
->IHTMLStyle6_iface
;
746 }else if(dispex_query_interface(&This
->dispex
, riid
, ppv
)) {
747 return *ppv
? S_OK
: E_NOINTERFACE
;
751 IUnknown_AddRef((IUnknown
*)*ppv
);
755 WARN("unsupported %s\n", debugstr_guid(riid
));
756 return E_NOINTERFACE
;
759 static ULONG WINAPI
HTMLStyle_AddRef(IHTMLStyle
*iface
)
761 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
762 LONG ref
= InterlockedIncrement(&This
->ref
);
764 TRACE("(%p) ref=%d\n", This
, ref
);
769 static ULONG WINAPI
HTMLStyle_Release(IHTMLStyle
*iface
)
771 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
772 LONG ref
= InterlockedDecrement(&This
->ref
);
774 TRACE("(%p) ref=%d\n", This
, ref
);
779 nsIDOMCSSStyleDeclaration_Release(This
->nsstyle
);
780 release_dispex(&This
->dispex
);
787 static HRESULT WINAPI
HTMLStyle_GetTypeInfoCount(IHTMLStyle
*iface
, UINT
*pctinfo
)
789 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
790 return IDispatchEx_GetTypeInfoCount(&This
->dispex
.IDispatchEx_iface
, pctinfo
);
793 static HRESULT WINAPI
HTMLStyle_GetTypeInfo(IHTMLStyle
*iface
, UINT iTInfo
,
794 LCID lcid
, ITypeInfo
**ppTInfo
)
796 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
797 return IDispatchEx_GetTypeInfo(&This
->dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
800 static HRESULT WINAPI
HTMLStyle_GetIDsOfNames(IHTMLStyle
*iface
, REFIID riid
,
801 LPOLESTR
*rgszNames
, UINT cNames
,
802 LCID lcid
, DISPID
*rgDispId
)
804 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
805 return IDispatchEx_GetIDsOfNames(&This
->dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
809 static HRESULT WINAPI
HTMLStyle_Invoke(IHTMLStyle
*iface
, DISPID dispIdMember
,
810 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
811 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
813 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
814 return IDispatchEx_Invoke(&This
->dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
815 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
818 static HRESULT WINAPI
HTMLStyle_put_fontFamily(IHTMLStyle
*iface
, BSTR v
)
820 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
822 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
824 return set_style_attr(This
, STYLEID_FONT_FAMILY
, v
, 0);
827 static HRESULT WINAPI
HTMLStyle_get_fontFamily(IHTMLStyle
*iface
, BSTR
*p
)
829 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
831 TRACE("(%p)->(%p)\n", This
, p
);
833 return get_style_attr(This
, STYLEID_FONT_FAMILY
, p
);
836 static HRESULT WINAPI
HTMLStyle_put_fontStyle(IHTMLStyle
*iface
, BSTR v
)
838 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
839 static const WCHAR szItalic
[] = {'i','t','a','l','i','c',0};
840 static const WCHAR szOblique
[] = {'o','b','l','i','q','u','e',0};
842 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
844 /* fontStyle can only be one of the follow values. */
845 if(!v
|| strcmpiW(szNormal
, v
) == 0 || strcmpiW(szItalic
, v
) == 0 ||
846 strcmpiW(szOblique
, v
) == 0)
848 return set_nsstyle_attr(This
->nsstyle
, STYLEID_FONT_STYLE
, v
, 0);
854 static HRESULT WINAPI
HTMLStyle_get_fontStyle(IHTMLStyle
*iface
, BSTR
*p
)
856 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
858 TRACE("(%p)->(%p)\n", This
, p
);
860 return get_style_attr(This
, STYLEID_FONT_STYLE
, p
);
863 static HRESULT WINAPI
HTMLStyle_put_fontVariant(IHTMLStyle
*iface
, BSTR v
)
865 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
866 static const WCHAR szCaps
[] = {'s','m','a','l','l','-','c','a','p','s',0};
868 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
870 /* fontVariant can only be one of the follow values. */
871 if(!v
|| strcmpiW(szNormal
, v
) == 0 || strcmpiW(szCaps
, v
) == 0)
873 return set_nsstyle_attr(This
->nsstyle
, STYLEID_FONT_VARIANT
, v
, 0);
879 static HRESULT WINAPI
HTMLStyle_get_fontVariant(IHTMLStyle
*iface
, BSTR
*p
)
881 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
882 TRACE("(%p)->(%p)\n", This
, p
);
887 return get_style_attr(This
, STYLEID_FONT_VARIANT
, p
);
890 static HRESULT WINAPI
HTMLStyle_put_fontWeight(IHTMLStyle
*iface
, BSTR v
)
892 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
893 static const WCHAR styleBold
[] = {'b','o','l','d',0};
894 static const WCHAR styleBolder
[] = {'b','o','l','d','e','r',0};
895 static const WCHAR styleLighter
[] = {'l','i','g','h','t','e','r',0};
896 static const WCHAR style100
[] = {'1','0','0',0};
897 static const WCHAR style200
[] = {'2','0','0',0};
898 static const WCHAR style300
[] = {'3','0','0',0};
899 static const WCHAR style400
[] = {'4','0','0',0};
900 static const WCHAR style500
[] = {'5','0','0',0};
901 static const WCHAR style600
[] = {'6','0','0',0};
902 static const WCHAR style700
[] = {'7','0','0',0};
903 static const WCHAR style800
[] = {'8','0','0',0};
904 static const WCHAR style900
[] = {'9','0','0',0};
906 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
908 /* fontWeight can only be one of the following */
909 if(!v
|| strcmpiW(szNormal
, v
) == 0 || strcmpiW(styleBold
, v
) == 0 ||
910 strcmpiW(styleBolder
, v
) == 0 || strcmpiW(styleLighter
, v
) == 0 ||
911 strcmpiW(style100
, v
) == 0 || strcmpiW(style200
, v
) == 0 ||
912 strcmpiW(style300
, v
) == 0 || strcmpiW(style400
, v
) == 0 ||
913 strcmpiW(style500
, v
) == 0 || strcmpiW(style600
, v
) == 0 ||
914 strcmpiW(style700
, v
) == 0 || strcmpiW(style800
, v
) == 0 ||
915 strcmpiW(style900
, v
) == 0
918 return set_nsstyle_attr(This
->nsstyle
, STYLEID_FONT_WEIGHT
, v
, 0);
924 static HRESULT WINAPI
HTMLStyle_get_fontWeight(IHTMLStyle
*iface
, BSTR
*p
)
926 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
928 TRACE("(%p)->(%p)\n", This
, p
);
930 return get_style_attr(This
, STYLEID_FONT_WEIGHT
, p
);
933 static HRESULT WINAPI
HTMLStyle_put_fontSize(IHTMLStyle
*iface
, VARIANT v
)
935 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
937 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
939 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_FONT_SIZE
, &v
, ATTR_FIX_PX
);
942 static HRESULT WINAPI
HTMLStyle_get_fontSize(IHTMLStyle
*iface
, VARIANT
*p
)
944 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
946 TRACE("(%p)->(%p)\n", This
, p
);
948 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_FONT_SIZE
, p
, 0);
951 static HRESULT WINAPI
HTMLStyle_put_font(IHTMLStyle
*iface
, BSTR v
)
953 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
954 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
958 static HRESULT WINAPI
HTMLStyle_get_font(IHTMLStyle
*iface
, BSTR
*p
)
960 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
961 FIXME("(%p)->(%p)\n", This
, p
);
965 static HRESULT WINAPI
HTMLStyle_put_color(IHTMLStyle
*iface
, VARIANT v
)
967 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
969 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
971 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_COLOR
, &v
, ATTR_HEX_INT
);
974 static HRESULT WINAPI
HTMLStyle_get_color(IHTMLStyle
*iface
, VARIANT
*p
)
976 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
978 TRACE("(%p)->(%p)\n", This
, p
);
980 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_COLOR
, p
, 0);
983 static HRESULT WINAPI
HTMLStyle_put_background(IHTMLStyle
*iface
, BSTR v
)
985 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
987 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
989 return set_style_attr(This
, STYLEID_BACKGROUND
, v
, 0);
992 static HRESULT WINAPI
HTMLStyle_get_background(IHTMLStyle
*iface
, BSTR
*p
)
994 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
996 TRACE("(%p)->(%p)\n", This
, p
);
998 return get_style_attr(This
, STYLEID_BACKGROUND
, p
);
1001 static HRESULT WINAPI
HTMLStyle_put_backgroundColor(IHTMLStyle
*iface
, VARIANT v
)
1003 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1005 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1007 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_BACKGROUND_COLOR
, &v
, ATTR_HEX_INT
);
1010 static HRESULT WINAPI
HTMLStyle_get_backgroundColor(IHTMLStyle
*iface
, VARIANT
*p
)
1012 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1014 TRACE("(%p)->(%p)\n", This
, p
);
1016 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_BACKGROUND_COLOR
, p
, 0);
1019 static HRESULT WINAPI
HTMLStyle_put_backgroundImage(IHTMLStyle
*iface
, BSTR v
)
1021 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1023 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1025 return set_style_attr(This
, STYLEID_BACKGROUND_IMAGE
, v
, ATTR_FIX_URL
);
1028 static HRESULT WINAPI
HTMLStyle_get_backgroundImage(IHTMLStyle
*iface
, BSTR
*p
)
1030 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1032 TRACE("(%p)->(%p)\n", This
, p
);
1034 return get_style_attr(This
, STYLEID_BACKGROUND_IMAGE
, p
);
1037 static HRESULT WINAPI
HTMLStyle_put_backgroundRepeat(IHTMLStyle
*iface
, BSTR v
)
1039 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1040 static const WCHAR styleRepeat
[] = {'r','e','p','e','a','t',0};
1041 static const WCHAR styleNoRepeat
[] = {'n','o','-','r','e','p','e','a','t',0};
1042 static const WCHAR styleRepeatX
[] = {'r','e','p','e','a','t','-','x',0};
1043 static const WCHAR styleRepeatY
[] = {'r','e','p','e','a','t','-','y',0};
1045 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1047 /* fontWeight can only be one of the following */
1048 if(!v
|| strcmpiW(styleRepeat
, v
) == 0 || strcmpiW(styleNoRepeat
, v
) == 0 ||
1049 strcmpiW(styleRepeatX
, v
) == 0 || strcmpiW(styleRepeatY
, v
) == 0 )
1051 return set_style_attr(This
, STYLEID_BACKGROUND_REPEAT
, v
, 0);
1054 return E_INVALIDARG
;
1057 static HRESULT WINAPI
HTMLStyle_get_backgroundRepeat(IHTMLStyle
*iface
, BSTR
*p
)
1059 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1061 TRACE("(%p)->(%p)\n", This
, p
);
1063 return get_style_attr(This
, STYLEID_BACKGROUND_REPEAT
, p
);
1066 static HRESULT WINAPI
HTMLStyle_put_backgroundAttachment(IHTMLStyle
*iface
, BSTR v
)
1068 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1069 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1073 static HRESULT WINAPI
HTMLStyle_get_backgroundAttachment(IHTMLStyle
*iface
, BSTR
*p
)
1075 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1076 FIXME("(%p)->(%p)\n", This
, p
);
1080 static HRESULT WINAPI
HTMLStyle_put_backgroundPosition(IHTMLStyle
*iface
, BSTR v
)
1082 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1084 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1086 return set_style_attr(This
, STYLEID_BACKGROUND_POSITION
, v
, 0);
1089 static HRESULT WINAPI
HTMLStyle_get_backgroundPosition(IHTMLStyle
*iface
, BSTR
*p
)
1091 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1093 TRACE("(%p)->(%p)\n", This
, p
);
1095 return get_style_attr(This
, STYLEID_BACKGROUND_POSITION
, p
);
1098 static HRESULT WINAPI
HTMLStyle_put_backgroundPositionX(IHTMLStyle
*iface
, VARIANT v
)
1100 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1101 WCHAR buf
[14], *pos_val
;
1107 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1109 hres
= var_to_styleval(&v
, buf
, ATTR_FIX_PX
, &val
);
1113 val_len
= val
? strlenW(val
) : 0;
1115 nsAString_Init(&pos_str
, NULL
);
1116 hres
= get_nsstyle_attr_nsval(This
->nsstyle
, STYLEID_BACKGROUND_POSITION
, &pos_str
);
1117 if(SUCCEEDED(hres
)) {
1118 const PRUnichar
*pos
, *posy
;
1121 nsAString_GetData(&pos_str
, &pos
);
1122 posy
= strchrW(pos
, ' ');
1124 static const WCHAR zero_pxW
[] = {' ','0','p','x',0};
1126 TRACE("no space in %s\n", debugstr_w(pos
));
1130 posy_len
= strlenW(posy
);
1131 pos_val
= heap_alloc((val_len
+posy_len
+1)*sizeof(WCHAR
));
1134 memcpy(pos_val
, val
, val_len
*sizeof(WCHAR
));
1136 memcpy(pos_val
+val_len
, posy
, posy_len
*sizeof(WCHAR
));
1137 pos_val
[val_len
+posy_len
] = 0;
1139 hres
= E_OUTOFMEMORY
;
1142 nsAString_Finish(&pos_str
);
1146 TRACE("setting position to %s\n", debugstr_w(pos_val
));
1147 hres
= set_nsstyle_attr(This
->nsstyle
, STYLEID_BACKGROUND_POSITION
, pos_val
, ATTR_FIX_PX
);
1152 static HRESULT WINAPI
HTMLStyle_get_backgroundPositionX(IHTMLStyle
*iface
, VARIANT
*p
)
1154 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1159 TRACE("(%p)->(%p)\n", This
, p
);
1161 nsAString_Init(&pos_str
, NULL
);
1162 hres
= get_nsstyle_attr_nsval(This
->nsstyle
, STYLEID_BACKGROUND_POSITION
, &pos_str
);
1163 if(SUCCEEDED(hres
)) {
1164 const PRUnichar
*pos
, *space
;
1166 nsAString_GetData(&pos_str
, &pos
);
1167 space
= strchrW(pos
, ' ');
1169 WARN("no space in %s\n", debugstr_w(pos
));
1170 space
= pos
+ strlenW(pos
);
1174 ret
= SysAllocStringLen(pos
, space
-pos
);
1176 hres
= E_OUTOFMEMORY
;
1181 nsAString_Finish(&pos_str
);
1185 TRACE("returning %s\n", debugstr_w(ret
));
1191 static HRESULT WINAPI
HTMLStyle_put_backgroundPositionY(IHTMLStyle
*iface
, VARIANT v
)
1193 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1194 WCHAR buf
[14], *pos_val
;
1200 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1202 hres
= var_to_styleval(&v
, buf
, ATTR_FIX_PX
, &val
);
1206 val_len
= val
? strlenW(val
) : 0;
1208 nsAString_Init(&pos_str
, NULL
);
1209 hres
= get_nsstyle_attr_nsval(This
->nsstyle
, STYLEID_BACKGROUND_POSITION
, &pos_str
);
1210 if(SUCCEEDED(hres
)) {
1211 const PRUnichar
*pos
, *space
;
1214 nsAString_GetData(&pos_str
, &pos
);
1215 space
= strchrW(pos
, ' ');
1219 static const WCHAR zero_pxW
[] = {'0','p','x',' ',0};
1221 TRACE("no space in %s\n", debugstr_w(pos
));
1223 space
= pos
+ sizeof(zero_pxW
)/sizeof(WCHAR
)-1;
1226 posx_len
= space
-pos
;
1228 pos_val
= heap_alloc((posx_len
+val_len
+1)*sizeof(WCHAR
));
1230 memcpy(pos_val
, pos
, posx_len
*sizeof(WCHAR
));
1232 memcpy(pos_val
+posx_len
, val
, val_len
*sizeof(WCHAR
));
1233 pos_val
[posx_len
+val_len
] = 0;
1235 hres
= E_OUTOFMEMORY
;
1238 nsAString_Finish(&pos_str
);
1242 TRACE("setting position to %s\n", debugstr_w(pos_val
));
1243 hres
= set_nsstyle_attr(This
->nsstyle
, STYLEID_BACKGROUND_POSITION
, pos_val
, ATTR_FIX_PX
);
1248 static HRESULT WINAPI
HTMLStyle_get_backgroundPositionY(IHTMLStyle
*iface
, VARIANT
*p
)
1250 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1255 TRACE("(%p)->(%p)\n", This
, p
);
1257 nsAString_Init(&pos_str
, NULL
);
1258 hres
= get_nsstyle_attr_nsval(This
->nsstyle
, STYLEID_BACKGROUND_POSITION
, &pos_str
);
1259 if(SUCCEEDED(hres
)) {
1260 const PRUnichar
*pos
, *posy
;
1262 nsAString_GetData(&pos_str
, &pos
);
1263 posy
= strchrW(pos
, ' ');
1265 ret
= SysAllocString(posy
+1);
1267 hres
= E_OUTOFMEMORY
;
1272 nsAString_Finish(&pos_str
);
1276 TRACE("returning %s\n", debugstr_w(ret
));
1282 static HRESULT WINAPI
HTMLStyle_put_wordSpacing(IHTMLStyle
*iface
, VARIANT v
)
1284 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1286 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1288 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_WORD_SPACING
, &v
, 0);
1291 static HRESULT WINAPI
HTMLStyle_get_wordSpacing(IHTMLStyle
*iface
, VARIANT
*p
)
1293 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1294 TRACE("(%p)->(%p)\n", This
, p
);
1295 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_WORD_SPACING
, p
, 0);
1298 static HRESULT WINAPI
HTMLStyle_put_letterSpacing(IHTMLStyle
*iface
, VARIANT v
)
1300 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1302 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1304 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_LETTER_SPACING
, &v
, 0);
1307 static HRESULT WINAPI
HTMLStyle_get_letterSpacing(IHTMLStyle
*iface
, VARIANT
*p
)
1309 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1310 TRACE("(%p)->(%p)\n", This
, p
);
1311 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_LETTER_SPACING
, p
, 0);
1314 static HRESULT WINAPI
HTMLStyle_put_textDecoration(IHTMLStyle
*iface
, BSTR v
)
1316 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1318 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1320 /* textDecoration can only be one of the following */
1321 if(!v
|| strcmpiW(styleNone
, v
) == 0 || strcmpiW(valUnderline
, v
) == 0 ||
1322 strcmpiW(valOverline
, v
) == 0 || strcmpiW(valLineThrough
, v
) == 0 ||
1323 strcmpiW(valBlink
, v
) == 0)
1325 return set_style_attr(This
, STYLEID_TEXT_DECORATION
, v
, 0);
1328 return E_INVALIDARG
;
1331 static HRESULT WINAPI
HTMLStyle_get_textDecoration(IHTMLStyle
*iface
, BSTR
*p
)
1333 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1335 TRACE("(%p)->(%p)\n", This
, p
);
1337 return get_style_attr(This
, STYLEID_TEXT_DECORATION
, p
);
1340 static HRESULT WINAPI
HTMLStyle_put_textDecorationNone(IHTMLStyle
*iface
, VARIANT_BOOL v
)
1342 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1344 TRACE("(%p)->(%x)\n", This
, v
);
1346 return set_style_attr(This
, STYLEID_TEXT_DECORATION
, v
? styleNone
: emptyW
, 0);
1349 static HRESULT WINAPI
HTMLStyle_get_textDecorationNone(IHTMLStyle
*iface
, VARIANT_BOOL
*p
)
1351 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1353 TRACE("(%p)->(%p)\n", This
, p
);
1355 return check_style_attr_value(This
, STYLEID_TEXT_DECORATION
, styleNone
, p
);
1358 static HRESULT WINAPI
HTMLStyle_put_textDecorationUnderline(IHTMLStyle
*iface
, VARIANT_BOOL v
)
1360 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1362 TRACE("(%p)->(%x)\n", This
, v
);
1364 return set_style_attr(This
, STYLEID_TEXT_DECORATION
, v
? valUnderline
: emptyW
, 0);
1367 static HRESULT WINAPI
HTMLStyle_get_textDecorationUnderline(IHTMLStyle
*iface
, VARIANT_BOOL
*p
)
1369 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1371 TRACE("(%p)->(%p)\n", This
, p
);
1373 return check_style_attr_value(This
, STYLEID_TEXT_DECORATION
, valUnderline
, p
);
1376 static HRESULT WINAPI
HTMLStyle_put_textDecorationOverline(IHTMLStyle
*iface
, VARIANT_BOOL v
)
1378 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1380 TRACE("(%p)->(%x)\n", This
, v
);
1382 return set_style_attr(This
, STYLEID_TEXT_DECORATION
, v
? valOverline
: emptyW
, 0);
1385 static HRESULT WINAPI
HTMLStyle_get_textDecorationOverline(IHTMLStyle
*iface
, VARIANT_BOOL
*p
)
1387 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1389 TRACE("(%p)->(%p)\n", This
, p
);
1391 return check_style_attr_value(This
, STYLEID_TEXT_DECORATION
, valOverline
, p
);
1394 static HRESULT WINAPI
HTMLStyle_put_textDecorationLineThrough(IHTMLStyle
*iface
, VARIANT_BOOL v
)
1396 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1398 TRACE("(%p)->(%x)\n", This
, v
);
1400 return set_style_attr(This
, STYLEID_TEXT_DECORATION
, v
? valLineThrough
: emptyW
, 0);
1403 static HRESULT WINAPI
HTMLStyle_get_textDecorationLineThrough(IHTMLStyle
*iface
, VARIANT_BOOL
*p
)
1405 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1407 TRACE("(%p)->(%p)\n", This
, p
);
1409 return check_style_attr_value(This
, STYLEID_TEXT_DECORATION
, valLineThrough
, p
);
1412 static HRESULT WINAPI
HTMLStyle_put_textDecorationBlink(IHTMLStyle
*iface
, VARIANT_BOOL v
)
1414 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1416 TRACE("(%p)->(%x)\n", This
, v
);
1418 return set_style_attr(This
, STYLEID_TEXT_DECORATION
, v
? valBlink
: emptyW
, 0);
1421 static HRESULT WINAPI
HTMLStyle_get_textDecorationBlink(IHTMLStyle
*iface
, VARIANT_BOOL
*p
)
1423 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1425 TRACE("(%p)->(%p)\n", This
, p
);
1427 return check_style_attr_value(This
, STYLEID_TEXT_DECORATION
, valBlink
, p
);
1430 static HRESULT WINAPI
HTMLStyle_put_verticalAlign(IHTMLStyle
*iface
, VARIANT v
)
1432 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1434 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1436 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_VERTICAL_ALIGN
, &v
, ATTR_FIX_PX
);
1439 static HRESULT WINAPI
HTMLStyle_get_verticalAlign(IHTMLStyle
*iface
, VARIANT
*p
)
1441 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1443 TRACE("(%p)->(%p)\n", This
, p
);
1445 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_VERTICAL_ALIGN
, p
, 0);
1448 static HRESULT WINAPI
HTMLStyle_put_textTransform(IHTMLStyle
*iface
, BSTR v
)
1450 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1451 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1455 static HRESULT WINAPI
HTMLStyle_get_textTransform(IHTMLStyle
*iface
, BSTR
*p
)
1457 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1458 FIXME("(%p)->(%p)\n", This
, p
);
1462 static HRESULT WINAPI
HTMLStyle_put_textAlign(IHTMLStyle
*iface
, BSTR v
)
1464 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1466 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1468 return set_style_attr(This
, STYLEID_TEXT_ALIGN
, v
, 0);
1471 static HRESULT WINAPI
HTMLStyle_get_textAlign(IHTMLStyle
*iface
, BSTR
*p
)
1473 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1475 TRACE("(%p)->(%p)\n", This
, p
);
1477 return get_style_attr(This
, STYLEID_TEXT_ALIGN
, p
);
1480 static HRESULT WINAPI
HTMLStyle_put_textIndent(IHTMLStyle
*iface
, VARIANT v
)
1482 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1483 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1487 static HRESULT WINAPI
HTMLStyle_get_textIndent(IHTMLStyle
*iface
, VARIANT
*p
)
1489 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1490 FIXME("(%p)->(%p)\n", This
, p
);
1494 static HRESULT WINAPI
HTMLStyle_put_lineHeight(IHTMLStyle
*iface
, VARIANT v
)
1496 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1497 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1501 static HRESULT WINAPI
HTMLStyle_get_lineHeight(IHTMLStyle
*iface
, VARIANT
*p
)
1503 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1504 FIXME("(%p)->(%p)\n", This
, p
);
1508 static HRESULT WINAPI
HTMLStyle_put_marginTop(IHTMLStyle
*iface
, VARIANT v
)
1510 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1512 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1514 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_MARGIN_TOP
, &v
, ATTR_FIX_PX
);
1517 static HRESULT WINAPI
HTMLStyle_get_marginTop(IHTMLStyle
*iface
, VARIANT
*p
)
1519 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1521 TRACE("(%p)->(%p)\n", This
, p
);
1523 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_MARGIN_TOP
, p
, 0);
1526 static HRESULT WINAPI
HTMLStyle_put_marginRight(IHTMLStyle
*iface
, VARIANT v
)
1528 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1530 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1532 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_MARGIN_RIGHT
, &v
, ATTR_FIX_PX
);
1535 static HRESULT WINAPI
HTMLStyle_get_marginRight(IHTMLStyle
*iface
, VARIANT
*p
)
1537 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1538 TRACE("(%p)->(%p)\n", This
, p
);
1539 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_MARGIN_RIGHT
, p
, 0);
1542 static HRESULT WINAPI
HTMLStyle_put_marginBottom(IHTMLStyle
*iface
, VARIANT v
)
1544 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1546 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1548 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_MARGIN_BOTTOM
, &v
, ATTR_FIX_PX
);
1551 static HRESULT WINAPI
HTMLStyle_get_marginBottom(IHTMLStyle
*iface
, VARIANT
*p
)
1553 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1555 TRACE("(%p)->(%p)\n", This
, p
);
1557 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_MARGIN_BOTTOM
, p
, 0);
1560 static HRESULT WINAPI
HTMLStyle_put_marginLeft(IHTMLStyle
*iface
, VARIANT v
)
1562 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1564 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1566 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_MARGIN_LEFT
, &v
, ATTR_FIX_PX
);
1569 static HRESULT WINAPI
HTMLStyle_put_margin(IHTMLStyle
*iface
, BSTR v
)
1571 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1573 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1575 return set_style_attr(This
, STYLEID_MARGIN
, v
, 0);
1578 static HRESULT WINAPI
HTMLStyle_get_margin(IHTMLStyle
*iface
, BSTR
*p
)
1580 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1582 TRACE("(%p)->(%p)\n", This
, p
);
1584 return get_style_attr(This
, STYLEID_MARGIN
, p
);
1587 static HRESULT WINAPI
HTMLStyle_get_marginLeft(IHTMLStyle
*iface
, VARIANT
*p
)
1589 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1590 TRACE("(%p)->(%p)\n", This
, p
);
1591 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_MARGIN_LEFT
, p
, 0);
1594 static HRESULT WINAPI
HTMLStyle_put_paddingTop(IHTMLStyle
*iface
, VARIANT v
)
1596 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1598 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1600 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_PADDING_TOP
, &v
, ATTR_FIX_PX
);
1603 static HRESULT WINAPI
HTMLStyle_get_paddingTop(IHTMLStyle
*iface
, VARIANT
*p
)
1605 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1607 TRACE("(%p)->(%p)\n", This
, p
);
1609 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_PADDING_TOP
, p
, 0);
1612 static HRESULT WINAPI
HTMLStyle_put_paddingRight(IHTMLStyle
*iface
, VARIANT v
)
1614 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1616 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1618 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_PADDING_RIGHT
, &v
, ATTR_FIX_PX
);
1621 static HRESULT WINAPI
HTMLStyle_get_paddingRight(IHTMLStyle
*iface
, VARIANT
*p
)
1623 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1625 TRACE("(%p)->(%p)\n", This
, p
);
1627 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_PADDING_RIGHT
, p
, 0);
1630 static HRESULT WINAPI
HTMLStyle_put_paddingBottom(IHTMLStyle
*iface
, VARIANT v
)
1632 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1634 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1636 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_PADDING_BOTTOM
, &v
, ATTR_FIX_PX
);
1639 static HRESULT WINAPI
HTMLStyle_get_paddingBottom(IHTMLStyle
*iface
, VARIANT
*p
)
1641 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1643 TRACE("(%p)->(%p)\n", This
, p
);
1645 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_PADDING_BOTTOM
, p
, 0);
1648 static HRESULT WINAPI
HTMLStyle_put_paddingLeft(IHTMLStyle
*iface
, VARIANT v
)
1650 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1652 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1654 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_PADDING_LEFT
, &v
, ATTR_FIX_PX
);
1657 static HRESULT WINAPI
HTMLStyle_get_paddingLeft(IHTMLStyle
*iface
, VARIANT
*p
)
1659 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1661 TRACE("(%p)->(%p)\n", This
, p
);
1663 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_PADDING_LEFT
, p
, 0);
1666 static HRESULT WINAPI
HTMLStyle_put_padding(IHTMLStyle
*iface
, BSTR v
)
1668 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1670 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1672 return set_style_attr(This
, STYLEID_PADDING
, v
, 0);
1675 static HRESULT WINAPI
HTMLStyle_get_padding(IHTMLStyle
*iface
, BSTR
*p
)
1677 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1679 TRACE("(%p)->(%p)\n", This
, p
);
1681 return get_style_attr(This
, STYLEID_PADDING
, p
);
1684 static HRESULT WINAPI
HTMLStyle_put_border(IHTMLStyle
*iface
, BSTR v
)
1686 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1688 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1690 return set_style_attr(This
, STYLEID_BORDER
, v
, 0);
1693 static HRESULT WINAPI
HTMLStyle_get_border(IHTMLStyle
*iface
, BSTR
*p
)
1695 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1697 TRACE("(%p)->(%p)\n", This
, p
);
1699 return get_style_attr(This
, STYLEID_BORDER
, p
);
1702 static HRESULT WINAPI
HTMLStyle_put_borderTop(IHTMLStyle
*iface
, BSTR v
)
1704 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1705 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1706 return set_style_attr(This
, STYLEID_BORDER_TOP
, v
, ATTR_FIX_PX
);
1709 static HRESULT WINAPI
HTMLStyle_get_borderTop(IHTMLStyle
*iface
, BSTR
*p
)
1711 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1712 TRACE("(%p)->(%p)\n", This
, p
);
1713 return get_style_attr(This
, STYLEID_BORDER_TOP
, p
);
1716 static HRESULT WINAPI
HTMLStyle_put_borderRight(IHTMLStyle
*iface
, BSTR v
)
1718 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1719 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1720 return set_style_attr(This
, STYLEID_BORDER_RIGHT
, v
, ATTR_FIX_PX
);
1723 static HRESULT WINAPI
HTMLStyle_get_borderRight(IHTMLStyle
*iface
, BSTR
*p
)
1725 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1726 TRACE("(%p)->(%p)\n", This
, p
);
1727 return get_style_attr(This
, STYLEID_BORDER_RIGHT
, p
);
1730 static HRESULT WINAPI
HTMLStyle_put_borderBottom(IHTMLStyle
*iface
, BSTR v
)
1732 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1733 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1734 return set_style_attr(This
, STYLEID_BORDER_BOTTOM
, v
, ATTR_FIX_PX
);
1737 static HRESULT WINAPI
HTMLStyle_get_borderBottom(IHTMLStyle
*iface
, BSTR
*p
)
1739 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1740 TRACE("(%p)->(%p)\n", This
, p
);
1741 return get_style_attr(This
, STYLEID_BORDER_BOTTOM
, p
);
1744 static HRESULT WINAPI
HTMLStyle_put_borderLeft(IHTMLStyle
*iface
, BSTR v
)
1746 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1748 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1750 return set_style_attr(This
, STYLEID_BORDER_LEFT
, v
, ATTR_FIX_PX
);
1753 static HRESULT WINAPI
HTMLStyle_get_borderLeft(IHTMLStyle
*iface
, BSTR
*p
)
1755 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1757 TRACE("(%p)->(%p)\n", This
, p
);
1759 return get_style_attr(This
, STYLEID_BORDER_LEFT
, p
);
1762 static HRESULT WINAPI
HTMLStyle_put_borderColor(IHTMLStyle
*iface
, BSTR v
)
1764 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1766 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1768 return set_style_attr(This
, STYLEID_BORDER_COLOR
, v
, 0);
1771 static HRESULT WINAPI
HTMLStyle_get_borderColor(IHTMLStyle
*iface
, BSTR
*p
)
1773 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1775 TRACE("(%p)->(%p)\n", This
, p
);
1777 return get_style_attr(This
, STYLEID_BORDER_COLOR
, p
);
1780 static HRESULT WINAPI
HTMLStyle_put_borderTopColor(IHTMLStyle
*iface
, VARIANT v
)
1782 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1784 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1786 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_TOP_COLOR
, &v
, ATTR_HEX_INT
);
1789 static HRESULT WINAPI
HTMLStyle_get_borderTopColor(IHTMLStyle
*iface
, VARIANT
*p
)
1791 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1793 TRACE("(%p)->(%p)\n", This
, p
);
1795 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_TOP_COLOR
, p
, 0);
1798 static HRESULT WINAPI
HTMLStyle_put_borderRightColor(IHTMLStyle
*iface
, VARIANT v
)
1800 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1802 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1804 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_RIGHT_COLOR
, &v
, ATTR_HEX_INT
);
1807 static HRESULT WINAPI
HTMLStyle_get_borderRightColor(IHTMLStyle
*iface
, VARIANT
*p
)
1809 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1811 TRACE("(%p)->(%p)\n", This
, p
);
1813 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_RIGHT_COLOR
, p
, 0);
1816 static HRESULT WINAPI
HTMLStyle_put_borderBottomColor(IHTMLStyle
*iface
, VARIANT v
)
1818 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1820 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1822 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_BOTTOM_COLOR
, &v
, ATTR_HEX_INT
);
1825 static HRESULT WINAPI
HTMLStyle_get_borderBottomColor(IHTMLStyle
*iface
, VARIANT
*p
)
1827 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1829 TRACE("(%p)->(%p)\n", This
, p
);
1831 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_BOTTOM_COLOR
, p
, 0);
1834 static HRESULT WINAPI
HTMLStyle_put_borderLeftColor(IHTMLStyle
*iface
, VARIANT v
)
1836 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1838 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1840 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_LEFT_COLOR
, &v
, ATTR_HEX_INT
);
1843 static HRESULT WINAPI
HTMLStyle_get_borderLeftColor(IHTMLStyle
*iface
, VARIANT
*p
)
1845 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1847 TRACE("(%p)->(%p)\n", This
, p
);
1849 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_LEFT_COLOR
, p
, 0);
1852 static HRESULT WINAPI
HTMLStyle_put_borderWidth(IHTMLStyle
*iface
, BSTR v
)
1854 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1855 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1856 return set_style_attr(This
, STYLEID_BORDER_WIDTH
, v
, ATTR_FIX_PX
);
1859 static HRESULT WINAPI
HTMLStyle_get_borderWidth(IHTMLStyle
*iface
, BSTR
*p
)
1861 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1862 TRACE("(%p)->(%p)\n", This
, p
);
1863 return get_style_attr(This
, STYLEID_BORDER_WIDTH
, p
);
1866 static HRESULT WINAPI
HTMLStyle_put_borderTopWidth(IHTMLStyle
*iface
, VARIANT v
)
1868 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1870 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1872 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_TOP_WIDTH
, &v
, 0);
1875 static HRESULT WINAPI
HTMLStyle_get_borderTopWidth(IHTMLStyle
*iface
, VARIANT
*p
)
1877 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1879 TRACE("(%p)->(%p)\n", This
, p
);
1881 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_TOP_WIDTH
, p
, 0);
1884 static HRESULT WINAPI
HTMLStyle_put_borderRightWidth(IHTMLStyle
*iface
, VARIANT v
)
1886 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1888 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1890 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_RIGHT_WIDTH
, &v
, 0);
1893 static HRESULT WINAPI
HTMLStyle_get_borderRightWidth(IHTMLStyle
*iface
, VARIANT
*p
)
1895 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1897 TRACE("(%p)->(%p)\n", This
, p
);
1899 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_RIGHT_WIDTH
, p
, 0);
1902 static HRESULT WINAPI
HTMLStyle_put_borderBottomWidth(IHTMLStyle
*iface
, VARIANT v
)
1904 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1906 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1908 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_BOTTOM_WIDTH
, &v
, 0);
1911 static HRESULT WINAPI
HTMLStyle_get_borderBottomWidth(IHTMLStyle
*iface
, VARIANT
*p
)
1913 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1914 TRACE("(%p)->(%p)\n", This
, p
);
1915 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_BOTTOM_WIDTH
, p
, 0);
1918 static HRESULT WINAPI
HTMLStyle_put_borderLeftWidth(IHTMLStyle
*iface
, VARIANT v
)
1920 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1922 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1924 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_LEFT_WIDTH
, &v
, 0);
1927 static HRESULT WINAPI
HTMLStyle_get_borderLeftWidth(IHTMLStyle
*iface
, VARIANT
*p
)
1929 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1930 TRACE("(%p)->(%p)\n", This
, p
);
1931 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_LEFT_WIDTH
, p
, 0);
1934 static HRESULT WINAPI
HTMLStyle_put_borderStyle(IHTMLStyle
*iface
, BSTR v
)
1936 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1937 static const WCHAR styleWindowInset
[] = {'w','i','n','d','o','w','-','i','n','s','e','t',0};
1938 HRESULT hres
= S_OK
;
1943 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1945 while(v
[i
] && hres
== S_OK
)
1947 if(v
[i
] == (WCHAR
)' ')
1949 pstyle
= SysAllocStringLen(&v
[last
], (i
-last
));
1950 if( !(is_valid_border_style(pstyle
) || strcmpiW(styleWindowInset
, pstyle
) == 0))
1952 TRACE("1. Invalid style (%s)\n", debugstr_w(pstyle
));
1953 hres
= E_INVALIDARG
;
1955 SysFreeString(pstyle
);
1963 pstyle
= SysAllocStringLen(&v
[last
], i
-last
);
1964 if( !(is_valid_border_style(pstyle
) || strcmpiW(styleWindowInset
, pstyle
) == 0))
1966 TRACE("2. Invalid style (%s)\n", debugstr_w(pstyle
));
1967 hres
= E_INVALIDARG
;
1969 SysFreeString(pstyle
);
1973 hres
= set_nsstyle_attr(This
->nsstyle
, STYLEID_BORDER_STYLE
, v
, 0);
1978 static HRESULT WINAPI
HTMLStyle_get_borderStyle(IHTMLStyle
*iface
, BSTR
*p
)
1980 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1981 TRACE("(%p)->(%p)\n", This
, p
);
1982 return get_style_attr(This
, STYLEID_BORDER_STYLE
, p
);
1985 static HRESULT WINAPI
HTMLStyle_put_borderTopStyle(IHTMLStyle
*iface
, BSTR v
)
1987 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1988 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1990 if(!is_valid_border_style(v
))
1991 return E_INVALIDARG
;
1993 return set_style_attr(This
, STYLEID_BORDER_TOP_STYLE
, v
, 0);
1996 static HRESULT WINAPI
HTMLStyle_get_borderTopStyle(IHTMLStyle
*iface
, BSTR
*p
)
1998 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1999 TRACE("(%p)->(%p)\n", This
, p
);
2000 return get_style_attr(This
, STYLEID_BORDER_TOP_STYLE
, p
);
2003 static HRESULT WINAPI
HTMLStyle_put_borderRightStyle(IHTMLStyle
*iface
, BSTR v
)
2005 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2006 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2008 if(!is_valid_border_style(v
))
2009 return E_INVALIDARG
;
2011 return set_style_attr(This
, STYLEID_BORDER_RIGHT_STYLE
, v
, 0);
2014 static HRESULT WINAPI
HTMLStyle_get_borderRightStyle(IHTMLStyle
*iface
, BSTR
*p
)
2016 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2017 TRACE("(%p)->(%p)\n", This
, p
);
2018 return get_style_attr(This
, STYLEID_BORDER_RIGHT_STYLE
, p
);
2021 static HRESULT WINAPI
HTMLStyle_put_borderBottomStyle(IHTMLStyle
*iface
, BSTR v
)
2023 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2024 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2026 if(!is_valid_border_style(v
))
2027 return E_INVALIDARG
;
2029 return set_style_attr(This
, STYLEID_BORDER_BOTTOM_STYLE
, v
, 0);
2032 static HRESULT WINAPI
HTMLStyle_get_borderBottomStyle(IHTMLStyle
*iface
, BSTR
*p
)
2034 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2035 TRACE("(%p)->(%p)\n", This
, p
);
2036 return get_style_attr(This
, STYLEID_BORDER_BOTTOM_STYLE
, p
);
2039 static HRESULT WINAPI
HTMLStyle_put_borderLeftStyle(IHTMLStyle
*iface
, BSTR v
)
2041 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2042 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2044 if(!is_valid_border_style(v
))
2045 return E_INVALIDARG
;
2047 return set_style_attr(This
, STYLEID_BORDER_LEFT_STYLE
, v
, 0);
2050 static HRESULT WINAPI
HTMLStyle_get_borderLeftStyle(IHTMLStyle
*iface
, BSTR
*p
)
2052 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2053 TRACE("(%p)->(%p)\n", This
, p
);
2054 return get_style_attr(This
, STYLEID_BORDER_LEFT_STYLE
, p
);
2057 static HRESULT WINAPI
HTMLStyle_put_width(IHTMLStyle
*iface
, VARIANT v
)
2059 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2061 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2063 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_WIDTH
, &v
, ATTR_FIX_PX
);
2066 static HRESULT WINAPI
HTMLStyle_get_width(IHTMLStyle
*iface
, VARIANT
*p
)
2068 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2070 TRACE("(%p)->(%p)\n", This
, p
);
2072 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_WIDTH
, p
, 0);
2075 static HRESULT WINAPI
HTMLStyle_put_height(IHTMLStyle
*iface
, VARIANT v
)
2077 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2079 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2081 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_HEIGHT
, &v
, ATTR_FIX_PX
);
2084 static HRESULT WINAPI
HTMLStyle_get_height(IHTMLStyle
*iface
, VARIANT
*p
)
2086 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2088 TRACE("(%p)->(%p)\n", This
, p
);
2090 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_HEIGHT
, p
, 0);
2093 static HRESULT WINAPI
HTMLStyle_put_styleFloat(IHTMLStyle
*iface
, BSTR v
)
2095 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2096 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
2100 static HRESULT WINAPI
HTMLStyle_get_styleFloat(IHTMLStyle
*iface
, BSTR
*p
)
2102 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2103 FIXME("(%p)->(%p)\n", This
, p
);
2107 static HRESULT WINAPI
HTMLStyle_put_clear(IHTMLStyle
*iface
, BSTR v
)
2109 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2111 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2113 return set_style_attr(This
, STYLEID_CLEAR
, v
, 0);
2116 static HRESULT WINAPI
HTMLStyle_get_clear(IHTMLStyle
*iface
, BSTR
*p
)
2118 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2120 TRACE("(%p)->(%p)\n", This
, p
);
2122 return get_style_attr(This
, STYLEID_CLEAR
, p
);
2125 static HRESULT WINAPI
HTMLStyle_put_display(IHTMLStyle
*iface
, BSTR v
)
2127 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2129 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2131 return set_style_attr(This
, STYLEID_DISPLAY
, v
, 0);
2134 static HRESULT WINAPI
HTMLStyle_get_display(IHTMLStyle
*iface
, BSTR
*p
)
2136 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2138 TRACE("(%p)->(%p)\n", This
, p
);
2140 return get_style_attr(This
, STYLEID_DISPLAY
, p
);
2143 static HRESULT WINAPI
HTMLStyle_put_visibility(IHTMLStyle
*iface
, BSTR v
)
2145 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2147 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2149 return set_style_attr(This
, STYLEID_VISIBILITY
, v
, 0);
2152 static HRESULT WINAPI
HTMLStyle_get_visibility(IHTMLStyle
*iface
, BSTR
*p
)
2154 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2156 TRACE("(%p)->(%p)\n", This
, p
);
2158 return get_style_attr(This
, STYLEID_VISIBILITY
, p
);
2161 static HRESULT WINAPI
HTMLStyle_put_listStyleType(IHTMLStyle
*iface
, BSTR v
)
2163 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2164 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
2168 static HRESULT WINAPI
HTMLStyle_get_listStyleType(IHTMLStyle
*iface
, BSTR
*p
)
2170 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2171 FIXME("(%p)->(%p)\n", This
, p
);
2175 static HRESULT WINAPI
HTMLStyle_put_listStylePosition(IHTMLStyle
*iface
, BSTR v
)
2177 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2178 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
2182 static HRESULT WINAPI
HTMLStyle_get_listStylePosition(IHTMLStyle
*iface
, BSTR
*p
)
2184 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2185 FIXME("(%p)->(%p)\n", This
, p
);
2189 static HRESULT WINAPI
HTMLStyle_put_listStyleImage(IHTMLStyle
*iface
, BSTR v
)
2191 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2192 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
2196 static HRESULT WINAPI
HTMLStyle_get_listStyleImage(IHTMLStyle
*iface
, BSTR
*p
)
2198 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2199 FIXME("(%p)->(%p)\n", This
, p
);
2203 static HRESULT WINAPI
HTMLStyle_put_listStyle(IHTMLStyle
*iface
, BSTR v
)
2205 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2206 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
2210 static HRESULT WINAPI
HTMLStyle_get_listStyle(IHTMLStyle
*iface
, BSTR
*p
)
2212 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2213 FIXME("(%p)->(%p)\n", This
, p
);
2217 static HRESULT WINAPI
HTMLStyle_put_whiteSpace(IHTMLStyle
*iface
, BSTR v
)
2219 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2221 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2223 return set_nsstyle_attr(This
->nsstyle
, STYLEID_WHITE_SPACE
, v
, 0);
2226 static HRESULT WINAPI
HTMLStyle_get_whiteSpace(IHTMLStyle
*iface
, BSTR
*p
)
2228 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2230 TRACE("(%p)->(%p)\n", This
, p
);
2232 return get_nsstyle_attr(This
->nsstyle
, STYLEID_WHITE_SPACE
, p
, 0);
2235 static HRESULT WINAPI
HTMLStyle_put_top(IHTMLStyle
*iface
, VARIANT v
)
2237 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2239 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2241 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_TOP
, &v
, 0);
2244 static HRESULT WINAPI
HTMLStyle_get_top(IHTMLStyle
*iface
, VARIANT
*p
)
2246 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2248 TRACE("(%p)->(%p)\n", This
, p
);
2250 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_TOP
, p
, 0);
2253 static HRESULT WINAPI
HTMLStyle_put_left(IHTMLStyle
*iface
, VARIANT v
)
2255 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2257 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2259 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_LEFT
, &v
, 0);
2262 static HRESULT WINAPI
HTMLStyle_get_left(IHTMLStyle
*iface
, VARIANT
*p
)
2264 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2266 TRACE("(%p)->(%p)\n", This
, p
);
2268 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_LEFT
, p
, 0);
2271 static HRESULT WINAPI
HTMLStyle_get_position(IHTMLStyle
*iface
, BSTR
*p
)
2273 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2274 TRACE("(%p)->(%p)\n", This
, p
);
2275 return IHTMLStyle2_get_position(&This
->IHTMLStyle2_iface
, p
);
2278 static HRESULT WINAPI
HTMLStyle_put_zIndex(IHTMLStyle
*iface
, VARIANT v
)
2280 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2282 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2284 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_Z_INDEX
, &v
, 0);
2287 static HRESULT WINAPI
HTMLStyle_get_zIndex(IHTMLStyle
*iface
, VARIANT
*p
)
2289 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2291 TRACE("(%p)->(%p)\n", This
, p
);
2293 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_Z_INDEX
, p
, ATTR_STR_TO_INT
);
2296 static HRESULT WINAPI
HTMLStyle_put_overflow(IHTMLStyle
*iface
, BSTR v
)
2298 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2299 static const WCHAR szVisible
[] = {'v','i','s','i','b','l','e',0};
2300 static const WCHAR szScroll
[] = {'s','c','r','o','l','l',0};
2301 static const WCHAR szHidden
[] = {'h','i','d','d','e','n',0};
2302 static const WCHAR szAuto
[] = {'a','u','t','o',0};
2304 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2306 /* overflow can only be one of the follow values. */
2307 if(!v
|| !*v
|| strcmpiW(szVisible
, v
) == 0 || strcmpiW(szScroll
, v
) == 0 ||
2308 strcmpiW(szHidden
, v
) == 0 || strcmpiW(szAuto
, v
) == 0)
2310 return set_nsstyle_attr(This
->nsstyle
, STYLEID_OVERFLOW
, v
, 0);
2313 return E_INVALIDARG
;
2317 static HRESULT WINAPI
HTMLStyle_get_overflow(IHTMLStyle
*iface
, BSTR
*p
)
2319 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2321 TRACE("(%p)->(%p)\n", This
, p
);
2324 return E_INVALIDARG
;
2326 return get_style_attr(This
, STYLEID_OVERFLOW
, p
);
2329 static HRESULT WINAPI
HTMLStyle_put_pageBreakBefore(IHTMLStyle
*iface
, BSTR v
)
2331 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2333 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2335 return set_nsstyle_attr(This
->nsstyle
, STYLEID_PAGE_BREAK_BEFORE
, v
, 0);
2338 static HRESULT WINAPI
HTMLStyle_get_pageBreakBefore(IHTMLStyle
*iface
, BSTR
*p
)
2340 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2342 TRACE("(%p)->(%p)\n", This
, p
);
2344 return get_nsstyle_attr(This
->nsstyle
, STYLEID_PAGE_BREAK_BEFORE
, p
, 0);
2347 static HRESULT WINAPI
HTMLStyle_put_pageBreakAfter(IHTMLStyle
*iface
, BSTR v
)
2349 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2351 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2353 return set_nsstyle_attr(This
->nsstyle
, STYLEID_PAGE_BREAK_AFTER
, v
, 0);
2356 static HRESULT WINAPI
HTMLStyle_get_pageBreakAfter(IHTMLStyle
*iface
, BSTR
*p
)
2358 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2360 TRACE("(%p)->(%p)\n", This
, p
);
2362 return get_nsstyle_attr(This
->nsstyle
, STYLEID_PAGE_BREAK_AFTER
, p
, 0);
2365 static HRESULT WINAPI
HTMLStyle_put_cssText(IHTMLStyle
*iface
, BSTR v
)
2367 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2371 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2373 nsAString_InitDepend(&text_str
, v
);
2374 nsres
= nsIDOMCSSStyleDeclaration_SetCssText(This
->nsstyle
, &text_str
);
2375 nsAString_Finish(&text_str
);
2376 if(NS_FAILED(nsres
)) {
2377 FIXME("SetCssStyle failed: %08x\n", nsres
);
2384 static HRESULT WINAPI
HTMLStyle_get_cssText(IHTMLStyle
*iface
, BSTR
*p
)
2386 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2390 TRACE("(%p)->(%p)\n", This
, p
);
2392 /* FIXME: Gecko style formatting is different than IE (uppercase). */
2393 nsAString_Init(&text_str
, NULL
);
2394 nsres
= nsIDOMCSSStyleDeclaration_GetCssText(This
->nsstyle
, &text_str
);
2395 if(NS_SUCCEEDED(nsres
)) {
2396 const PRUnichar
*text
;
2398 nsAString_GetData(&text_str
, &text
);
2399 *p
= *text
? SysAllocString(text
) : NULL
;
2401 FIXME("GetCssStyle failed: %08x\n", nsres
);
2405 nsAString_Finish(&text_str
);
2409 static HRESULT WINAPI
HTMLStyle_put_pixelTop(IHTMLStyle
*iface
, LONG v
)
2411 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2412 FIXME("(%p)->()\n", This
);
2416 static HRESULT WINAPI
HTMLStyle_get_pixelTop(IHTMLStyle
*iface
, LONG
*p
)
2418 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2419 FIXME("(%p)->()\n", This
);
2423 static HRESULT WINAPI
HTMLStyle_put_pixelLeft(IHTMLStyle
*iface
, LONG v
)
2425 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2427 TRACE("(%p)->(%d)\n", This
, v
);
2429 return set_style_pxattr(This
->nsstyle
, STYLEID_LEFT
, v
);
2432 static HRESULT WINAPI
HTMLStyle_get_pixelLeft(IHTMLStyle
*iface
, LONG
*p
)
2434 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2436 TRACE("(%p)->(%p)\n", This
, p
);
2438 return get_nsstyle_pixel_val(This
, STYLEID_LEFT
, p
);
2441 static HRESULT WINAPI
HTMLStyle_put_pixelWidth(IHTMLStyle
*iface
, LONG v
)
2443 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2445 TRACE("(%p)->()\n", This
);
2447 return set_style_pxattr(This
->nsstyle
, STYLEID_WIDTH
, v
);
2450 static HRESULT WINAPI
HTMLStyle_get_pixelWidth(IHTMLStyle
*iface
, LONG
*p
)
2452 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2453 FIXME("(%p)->()\n", This
);
2457 static HRESULT WINAPI
HTMLStyle_put_pixelHeight(IHTMLStyle
*iface
, LONG v
)
2459 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2460 FIXME("(%p)->()\n", This
);
2464 static HRESULT WINAPI
HTMLStyle_get_pixelHeight(IHTMLStyle
*iface
, LONG
*p
)
2466 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2467 FIXME("(%p)->()\n", This
);
2471 static HRESULT WINAPI
HTMLStyle_put_posTop(IHTMLStyle
*iface
, float v
)
2473 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2475 TRACE("(%p)->(%f)\n", This
, v
);
2477 return set_style_pos(This
, STYLEID_TOP
, v
);
2480 static HRESULT WINAPI
HTMLStyle_get_posTop(IHTMLStyle
*iface
, float *p
)
2482 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2484 TRACE("(%p)->(%p)\n", This
, p
);
2489 return get_nsstyle_pos(This
, STYLEID_TOP
, p
);
2492 static HRESULT WINAPI
HTMLStyle_put_posLeft(IHTMLStyle
*iface
, float v
)
2494 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2496 TRACE("(%p)->(%f)\n", This
, v
);
2498 return set_style_pos(This
, STYLEID_LEFT
, v
);
2501 static HRESULT WINAPI
HTMLStyle_get_posLeft(IHTMLStyle
*iface
, float *p
)
2503 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2505 TRACE("(%p)->(%p)\n", This
, p
);
2510 return get_nsstyle_pos(This
, STYLEID_LEFT
, p
);
2513 static HRESULT WINAPI
HTMLStyle_put_posWidth(IHTMLStyle
*iface
, float v
)
2515 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2517 TRACE("(%p)->(%f)\n", This
, v
);
2519 return set_style_pos(This
, STYLEID_WIDTH
, v
);
2522 static HRESULT WINAPI
HTMLStyle_get_posWidth(IHTMLStyle
*iface
, float *p
)
2524 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2526 TRACE("(%p)->(%p)\n", This
, p
);
2531 if(get_nsstyle_pos(This
, STYLEID_WIDTH
, p
) != S_OK
)
2537 static HRESULT WINAPI
HTMLStyle_put_posHeight(IHTMLStyle
*iface
, float v
)
2539 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2541 TRACE("(%p)->(%f)\n", This
, v
);
2543 return set_style_pos(This
, STYLEID_HEIGHT
, v
);
2546 static HRESULT WINAPI
HTMLStyle_get_posHeight(IHTMLStyle
*iface
, float *p
)
2548 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2550 TRACE("(%p)->(%p)\n", This
, p
);
2555 if(get_nsstyle_pos(This
, STYLEID_HEIGHT
, p
) != S_OK
)
2561 static HRESULT WINAPI
HTMLStyle_put_cursor(IHTMLStyle
*iface
, BSTR v
)
2563 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2565 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2567 return set_style_attr(This
, STYLEID_CURSOR
, v
, 0);
2570 static HRESULT WINAPI
HTMLStyle_get_cursor(IHTMLStyle
*iface
, BSTR
*p
)
2572 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2574 TRACE("(%p)->(%p)\n", This
, p
);
2576 return get_style_attr(This
, STYLEID_CURSOR
, p
);
2579 static HRESULT WINAPI
HTMLStyle_put_clip(IHTMLStyle
*iface
, BSTR v
)
2581 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2583 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2585 return set_style_attr(This
, STYLEID_CLIP
, v
, 0);
2588 static HRESULT WINAPI
HTMLStyle_get_clip(IHTMLStyle
*iface
, BSTR
*p
)
2590 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2592 TRACE("(%p)->(%p)\n", This
, p
);
2594 return get_nsstyle_attr(This
->nsstyle
, STYLEID_CLIP
, p
, ATTR_REMOVE_COMMA
);
2597 static void set_opacity(HTMLStyle
*This
, const WCHAR
*val
)
2599 nsAString name_str
, val_str
, empty_str
;
2602 static const WCHAR opacityW
[] = {'o','p','a','c','i','t','y',0};
2604 TRACE("%s\n", debugstr_w(val
));
2606 nsAString_InitDepend(&name_str
, opacityW
);
2607 nsAString_InitDepend(&val_str
, val
);
2608 nsAString_InitDepend(&empty_str
, emptyW
);
2610 nsres
= nsIDOMCSSStyleDeclaration_SetProperty(This
->nsstyle
, &name_str
, &val_str
, &empty_str
);
2611 if(NS_FAILED(nsres
))
2612 ERR("SetProperty failed: %08x\n", nsres
);
2614 nsAString_Finish(&name_str
);
2615 nsAString_Finish(&val_str
);
2616 nsAString_Finish(&empty_str
);
2619 static void update_filter(HTMLStyle
*This
)
2621 const WCHAR
*ptr
= This
->elem
->filter
, *ptr2
;
2623 static const WCHAR alphaW
[] = {'a','l','p','h','a'};
2626 set_opacity(This
, emptyW
);
2631 while(isspaceW(*ptr
))
2637 while(isalnumW(*ptr
))
2640 WARN("unexpected char '%c'\n", *ptr
);
2644 WARN("expected '('\n");
2648 if(ptr2
+ sizeof(alphaW
)/sizeof(WCHAR
) == ptr
&& !memcmp(ptr2
, alphaW
, sizeof(alphaW
))) {
2649 static const WCHAR formatW
[] = {'%','f',0};
2650 static const WCHAR opacityW
[] = {'o','p','a','c','i','t','y','='};
2654 while(isspaceW(*ptr
))
2658 while(*ptr
&& *ptr
!= ',' && *ptr
!= ')')
2661 WARN("unexpected end of string\n");
2665 if(ptr
-ptr2
> sizeof(opacityW
)/sizeof(WCHAR
) && !memcmp(ptr2
, opacityW
, sizeof(opacityW
))) {
2666 float fval
= 0.0f
, e
= 0.1f
;
2669 ptr2
+= sizeof(opacityW
)/sizeof(WCHAR
);
2671 while(isdigitW(*ptr2
))
2672 fval
= fval
*10.0f
+ (float)(*ptr2
++ - '0');
2675 while(isdigitW(*++ptr2
)) {
2676 fval
+= e
* (float)(*ptr2
++ - '0');
2681 sprintfW(buf
, formatW
, fval
* 0.01f
);
2682 set_opacity(This
, buf
);
2684 FIXME("unknown param %s\n", debugstr_wn(ptr2
, ptr
-ptr2
));
2689 }while(*ptr
!= ')');
2691 FIXME("unknown filter %s\n", debugstr_wn(ptr2
, ptr
-ptr2
));
2692 ptr
= strchrW(ptr
, ')');
2700 static HRESULT WINAPI
HTMLStyle_put_filter(IHTMLStyle
*iface
, BSTR v
)
2702 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2703 WCHAR
*new_filter
= NULL
;
2705 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2708 FIXME("Element already destroyed\n");
2709 return E_UNEXPECTED
;
2713 new_filter
= heap_strdupW(v
);
2715 return E_OUTOFMEMORY
;
2718 heap_free(This
->elem
->filter
);
2719 This
->elem
->filter
= new_filter
;
2721 update_filter(This
);
2725 static HRESULT WINAPI
HTMLStyle_get_filter(IHTMLStyle
*iface
, BSTR
*p
)
2727 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2729 TRACE("(%p)->(%p)\n", This
, p
);
2732 FIXME("Element already destroyed\n");
2733 return E_UNEXPECTED
;
2736 if(This
->elem
->filter
) {
2737 *p
= SysAllocString(This
->elem
->filter
);
2739 return E_OUTOFMEMORY
;
2747 static HRESULT WINAPI
HTMLStyle_setAttribute(IHTMLStyle
*iface
, BSTR strAttributeName
,
2748 VARIANT AttributeValue
, LONG lFlags
)
2750 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2754 TRACE("(%p)->(%s %s %08x)\n", This
, debugstr_w(strAttributeName
),
2755 debugstr_variant(&AttributeValue
), lFlags
);
2757 if(!strAttributeName
)
2758 return E_INVALIDARG
;
2761 FIXME("Parameter lFlags ignored\n");
2763 hres
= HTMLStyle_GetIDsOfNames(iface
, &IID_NULL
, &strAttributeName
, 1,
2764 LOCALE_USER_DEFAULT
, &dispid
);
2768 DISPID dispidNamed
= DISPID_PROPERTYPUT
;
2772 params
.rgvarg
= &AttributeValue
;
2773 params
.cNamedArgs
= 1;
2774 params
.rgdispidNamedArgs
= &dispidNamed
;
2776 hres
= HTMLStyle_Invoke(iface
, dispid
, &IID_NULL
, LOCALE_SYSTEM_DEFAULT
,
2777 DISPATCH_PROPERTYPUT
, ¶ms
, &ret
, NULL
, NULL
);
2781 FIXME("Custom attributes not supported.\n");
2784 TRACE("ret: %08x\n", hres
);
2789 static HRESULT WINAPI
HTMLStyle_getAttribute(IHTMLStyle
*iface
, BSTR strAttributeName
,
2790 LONG lFlags
, VARIANT
*AttributeValue
)
2792 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2796 TRACE("(%p)->(%s v%p %08x)\n", This
, debugstr_w(strAttributeName
),
2797 AttributeValue
, lFlags
);
2799 if(!AttributeValue
|| !strAttributeName
)
2800 return E_INVALIDARG
;
2803 FIXME("Parameter lFlags ignored\n");
2805 hres
= HTMLStyle_GetIDsOfNames(iface
, &IID_NULL
, &strAttributeName
, 1,
2806 LOCALE_USER_DEFAULT
, &dispid
);
2809 DISPPARAMS params
= {NULL
, NULL
, 0, 0 };
2811 hres
= HTMLStyle_Invoke(iface
, dispid
, &IID_NULL
, LOCALE_SYSTEM_DEFAULT
,
2812 DISPATCH_PROPERTYGET
, ¶ms
, AttributeValue
, NULL
, NULL
);
2816 FIXME("Custom attributes not supported.\n");
2822 static HRESULT WINAPI
HTMLStyle_removeAttribute(IHTMLStyle
*iface
, BSTR strAttributeName
,
2823 LONG lFlags
, VARIANT_BOOL
*pfSuccess
)
2825 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2826 const style_tbl_entry_t
*style_entry
;
2827 nsAString name_str
, ret_str
;
2831 TRACE("(%p)->(%s %08x %p)\n", This
, debugstr_w(strAttributeName
), lFlags
, pfSuccess
);
2833 style_entry
= lookup_style_tbl(strAttributeName
);
2838 hres
= IDispatchEx_GetDispID(&This
->dispex
.IDispatchEx_iface
, strAttributeName
,
2839 (lFlags
&1) ? fdexNameCaseSensitive
: fdexNameCaseInsensitive
, &dispid
);
2841 *pfSuccess
= VARIANT_FALSE
;
2845 for(i
=0; i
< sizeof(style_tbl
)/sizeof(*style_tbl
); i
++) {
2846 if(dispid
== style_tbl
[i
].dispid
)
2850 if(i
== sizeof(style_tbl
)/sizeof(*style_tbl
))
2851 return remove_prop(&This
->dispex
, strAttributeName
, pfSuccess
);
2852 style_entry
= style_tbl
+i
;
2855 /* filter property is a special case */
2856 if(style_entry
->dispid
== DISPID_IHTMLSTYLE_FILTER
) {
2857 *pfSuccess
= This
->elem
->filter
&& *This
->elem
->filter
? VARIANT_TRUE
: VARIANT_FALSE
;
2858 heap_free(This
->elem
->filter
);
2859 This
->elem
->filter
= NULL
;
2860 update_filter(This
);
2864 nsAString_InitDepend(&name_str
, style_entry
->name
);
2865 nsAString_Init(&ret_str
, NULL
);
2866 nsres
= nsIDOMCSSStyleDeclaration_RemoveProperty(This
->nsstyle
, &name_str
, &ret_str
);
2867 if(NS_SUCCEEDED(nsres
)) {
2868 const PRUnichar
*ret
;
2869 nsAString_GetData(&ret_str
, &ret
);
2870 *pfSuccess
= *ret
? VARIANT_TRUE
: VARIANT_FALSE
;
2872 ERR("RemoveProperty failed: %08x\n", nsres
);
2874 nsAString_Finish(&name_str
);
2875 nsAString_Finish(&ret_str
);
2876 return NS_SUCCEEDED(nsres
) ? S_OK
: E_FAIL
;
2879 static HRESULT WINAPI
HTMLStyle_toString(IHTMLStyle
*iface
, BSTR
*String
)
2881 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2882 FIXME("(%p)->(%p)\n", This
, String
);
2886 static const IHTMLStyleVtbl HTMLStyleVtbl
= {
2887 HTMLStyle_QueryInterface
,
2890 HTMLStyle_GetTypeInfoCount
,
2891 HTMLStyle_GetTypeInfo
,
2892 HTMLStyle_GetIDsOfNames
,
2894 HTMLStyle_put_fontFamily
,
2895 HTMLStyle_get_fontFamily
,
2896 HTMLStyle_put_fontStyle
,
2897 HTMLStyle_get_fontStyle
,
2898 HTMLStyle_put_fontVariant
,
2899 HTMLStyle_get_fontVariant
,
2900 HTMLStyle_put_fontWeight
,
2901 HTMLStyle_get_fontWeight
,
2902 HTMLStyle_put_fontSize
,
2903 HTMLStyle_get_fontSize
,
2906 HTMLStyle_put_color
,
2907 HTMLStyle_get_color
,
2908 HTMLStyle_put_background
,
2909 HTMLStyle_get_background
,
2910 HTMLStyle_put_backgroundColor
,
2911 HTMLStyle_get_backgroundColor
,
2912 HTMLStyle_put_backgroundImage
,
2913 HTMLStyle_get_backgroundImage
,
2914 HTMLStyle_put_backgroundRepeat
,
2915 HTMLStyle_get_backgroundRepeat
,
2916 HTMLStyle_put_backgroundAttachment
,
2917 HTMLStyle_get_backgroundAttachment
,
2918 HTMLStyle_put_backgroundPosition
,
2919 HTMLStyle_get_backgroundPosition
,
2920 HTMLStyle_put_backgroundPositionX
,
2921 HTMLStyle_get_backgroundPositionX
,
2922 HTMLStyle_put_backgroundPositionY
,
2923 HTMLStyle_get_backgroundPositionY
,
2924 HTMLStyle_put_wordSpacing
,
2925 HTMLStyle_get_wordSpacing
,
2926 HTMLStyle_put_letterSpacing
,
2927 HTMLStyle_get_letterSpacing
,
2928 HTMLStyle_put_textDecoration
,
2929 HTMLStyle_get_textDecoration
,
2930 HTMLStyle_put_textDecorationNone
,
2931 HTMLStyle_get_textDecorationNone
,
2932 HTMLStyle_put_textDecorationUnderline
,
2933 HTMLStyle_get_textDecorationUnderline
,
2934 HTMLStyle_put_textDecorationOverline
,
2935 HTMLStyle_get_textDecorationOverline
,
2936 HTMLStyle_put_textDecorationLineThrough
,
2937 HTMLStyle_get_textDecorationLineThrough
,
2938 HTMLStyle_put_textDecorationBlink
,
2939 HTMLStyle_get_textDecorationBlink
,
2940 HTMLStyle_put_verticalAlign
,
2941 HTMLStyle_get_verticalAlign
,
2942 HTMLStyle_put_textTransform
,
2943 HTMLStyle_get_textTransform
,
2944 HTMLStyle_put_textAlign
,
2945 HTMLStyle_get_textAlign
,
2946 HTMLStyle_put_textIndent
,
2947 HTMLStyle_get_textIndent
,
2948 HTMLStyle_put_lineHeight
,
2949 HTMLStyle_get_lineHeight
,
2950 HTMLStyle_put_marginTop
,
2951 HTMLStyle_get_marginTop
,
2952 HTMLStyle_put_marginRight
,
2953 HTMLStyle_get_marginRight
,
2954 HTMLStyle_put_marginBottom
,
2955 HTMLStyle_get_marginBottom
,
2956 HTMLStyle_put_marginLeft
,
2957 HTMLStyle_get_marginLeft
,
2958 HTMLStyle_put_margin
,
2959 HTMLStyle_get_margin
,
2960 HTMLStyle_put_paddingTop
,
2961 HTMLStyle_get_paddingTop
,
2962 HTMLStyle_put_paddingRight
,
2963 HTMLStyle_get_paddingRight
,
2964 HTMLStyle_put_paddingBottom
,
2965 HTMLStyle_get_paddingBottom
,
2966 HTMLStyle_put_paddingLeft
,
2967 HTMLStyle_get_paddingLeft
,
2968 HTMLStyle_put_padding
,
2969 HTMLStyle_get_padding
,
2970 HTMLStyle_put_border
,
2971 HTMLStyle_get_border
,
2972 HTMLStyle_put_borderTop
,
2973 HTMLStyle_get_borderTop
,
2974 HTMLStyle_put_borderRight
,
2975 HTMLStyle_get_borderRight
,
2976 HTMLStyle_put_borderBottom
,
2977 HTMLStyle_get_borderBottom
,
2978 HTMLStyle_put_borderLeft
,
2979 HTMLStyle_get_borderLeft
,
2980 HTMLStyle_put_borderColor
,
2981 HTMLStyle_get_borderColor
,
2982 HTMLStyle_put_borderTopColor
,
2983 HTMLStyle_get_borderTopColor
,
2984 HTMLStyle_put_borderRightColor
,
2985 HTMLStyle_get_borderRightColor
,
2986 HTMLStyle_put_borderBottomColor
,
2987 HTMLStyle_get_borderBottomColor
,
2988 HTMLStyle_put_borderLeftColor
,
2989 HTMLStyle_get_borderLeftColor
,
2990 HTMLStyle_put_borderWidth
,
2991 HTMLStyle_get_borderWidth
,
2992 HTMLStyle_put_borderTopWidth
,
2993 HTMLStyle_get_borderTopWidth
,
2994 HTMLStyle_put_borderRightWidth
,
2995 HTMLStyle_get_borderRightWidth
,
2996 HTMLStyle_put_borderBottomWidth
,
2997 HTMLStyle_get_borderBottomWidth
,
2998 HTMLStyle_put_borderLeftWidth
,
2999 HTMLStyle_get_borderLeftWidth
,
3000 HTMLStyle_put_borderStyle
,
3001 HTMLStyle_get_borderStyle
,
3002 HTMLStyle_put_borderTopStyle
,
3003 HTMLStyle_get_borderTopStyle
,
3004 HTMLStyle_put_borderRightStyle
,
3005 HTMLStyle_get_borderRightStyle
,
3006 HTMLStyle_put_borderBottomStyle
,
3007 HTMLStyle_get_borderBottomStyle
,
3008 HTMLStyle_put_borderLeftStyle
,
3009 HTMLStyle_get_borderLeftStyle
,
3010 HTMLStyle_put_width
,
3011 HTMLStyle_get_width
,
3012 HTMLStyle_put_height
,
3013 HTMLStyle_get_height
,
3014 HTMLStyle_put_styleFloat
,
3015 HTMLStyle_get_styleFloat
,
3016 HTMLStyle_put_clear
,
3017 HTMLStyle_get_clear
,
3018 HTMLStyle_put_display
,
3019 HTMLStyle_get_display
,
3020 HTMLStyle_put_visibility
,
3021 HTMLStyle_get_visibility
,
3022 HTMLStyle_put_listStyleType
,
3023 HTMLStyle_get_listStyleType
,
3024 HTMLStyle_put_listStylePosition
,
3025 HTMLStyle_get_listStylePosition
,
3026 HTMLStyle_put_listStyleImage
,
3027 HTMLStyle_get_listStyleImage
,
3028 HTMLStyle_put_listStyle
,
3029 HTMLStyle_get_listStyle
,
3030 HTMLStyle_put_whiteSpace
,
3031 HTMLStyle_get_whiteSpace
,
3036 HTMLStyle_get_position
,
3037 HTMLStyle_put_zIndex
,
3038 HTMLStyle_get_zIndex
,
3039 HTMLStyle_put_overflow
,
3040 HTMLStyle_get_overflow
,
3041 HTMLStyle_put_pageBreakBefore
,
3042 HTMLStyle_get_pageBreakBefore
,
3043 HTMLStyle_put_pageBreakAfter
,
3044 HTMLStyle_get_pageBreakAfter
,
3045 HTMLStyle_put_cssText
,
3046 HTMLStyle_get_cssText
,
3047 HTMLStyle_put_pixelTop
,
3048 HTMLStyle_get_pixelTop
,
3049 HTMLStyle_put_pixelLeft
,
3050 HTMLStyle_get_pixelLeft
,
3051 HTMLStyle_put_pixelWidth
,
3052 HTMLStyle_get_pixelWidth
,
3053 HTMLStyle_put_pixelHeight
,
3054 HTMLStyle_get_pixelHeight
,
3055 HTMLStyle_put_posTop
,
3056 HTMLStyle_get_posTop
,
3057 HTMLStyle_put_posLeft
,
3058 HTMLStyle_get_posLeft
,
3059 HTMLStyle_put_posWidth
,
3060 HTMLStyle_get_posWidth
,
3061 HTMLStyle_put_posHeight
,
3062 HTMLStyle_get_posHeight
,
3063 HTMLStyle_put_cursor
,
3064 HTMLStyle_get_cursor
,
3067 HTMLStyle_put_filter
,
3068 HTMLStyle_get_filter
,
3069 HTMLStyle_setAttribute
,
3070 HTMLStyle_getAttribute
,
3071 HTMLStyle_removeAttribute
,
3075 static HRESULT
HTMLStyle_get_dispid(DispatchEx
*dispex
, BSTR name
, DWORD flags
, DISPID
*dispid
)
3077 const style_tbl_entry_t
*style_entry
;
3079 style_entry
= lookup_style_tbl(name
);
3081 *dispid
= style_entry
->dispid
;
3085 return DISP_E_UNKNOWNNAME
;
3088 static const dispex_static_data_vtbl_t HTMLStyle_dispex_vtbl
= {
3090 HTMLStyle_get_dispid
,
3095 static const tid_t HTMLStyle_iface_tids
[] = {
3104 static dispex_static_data_t HTMLStyle_dispex
= {
3105 &HTMLStyle_dispex_vtbl
,
3108 HTMLStyle_iface_tids
3111 HRESULT
HTMLStyle_Create(HTMLElement
*elem
, HTMLStyle
**ret
)
3113 nsIDOMElementCSSInlineStyle
*nselemstyle
;
3114 nsIDOMCSSStyleDeclaration
*nsstyle
;
3119 FIXME("NULL nselem\n");
3123 nsres
= nsIDOMHTMLElement_QueryInterface(elem
->nselem
, &IID_nsIDOMElementCSSInlineStyle
,
3124 (void**)&nselemstyle
);
3125 assert(nsres
== NS_OK
);
3127 nsres
= nsIDOMElementCSSInlineStyle_GetStyle(nselemstyle
, &nsstyle
);
3128 nsIDOMElementCSSInlineStyle_Release(nselemstyle
);
3129 if(NS_FAILED(nsres
)) {
3130 ERR("GetStyle failed: %08x\n", nsres
);
3134 style
= heap_alloc_zero(sizeof(HTMLStyle
));
3136 nsIDOMCSSStyleDeclaration_Release(nsstyle
);
3137 return E_OUTOFMEMORY
;
3140 style
->IHTMLStyle_iface
.lpVtbl
= &HTMLStyleVtbl
;
3142 style
->nsstyle
= nsstyle
;
3144 HTMLStyle2_Init(style
);
3145 HTMLStyle3_Init(style
);
3147 nsIDOMCSSStyleDeclaration_AddRef(nsstyle
);
3149 init_dispex(&style
->dispex
, (IUnknown
*)&style
->IHTMLStyle_iface
, &HTMLStyle_dispex
);