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 backgroundW
[] =
39 {'b','a','c','k','g','r','o','u','n','d',0};
40 static const WCHAR background_attachmentW
[] =
41 {'b','a','c','k','g','r','o','u','n','d','-','a','t','t','a','c','h','m','e','n','t',0};
42 static const WCHAR background_colorW
[] =
43 {'b','a','c','k','g','r','o','u','n','d','-','c','o','l','o','r',0};
44 static const WCHAR background_imageW
[] =
45 {'b','a','c','k','g','r','o','u','n','d','-','i','m','a','g','e',0};
46 static const WCHAR background_positionW
[] =
47 {'b','a','c','k','g','r','o','u','n','d','-','p','o','s','i','t','i','o','n',0};
48 static const WCHAR background_position_xW
[] =
49 {'b','a','c','k','g','r','o','u','n','d','-','p','o','s','i','t','i','o','n','-','x',0};
50 static const WCHAR background_position_yW
[] =
51 {'b','a','c','k','g','r','o','u','n','d','-','p','o','s','i','t','i','o','n','-','y',0};
52 static const WCHAR background_repeatW
[] =
53 {'b','a','c','k','g','r','o','u','n','d','-','r','e','p','e','a','t',0};
54 static const WCHAR borderW
[] =
55 {'b','o','r','d','e','r',0};
56 static const WCHAR border_bottomW
[] =
57 {'b','o','r','d','e','r','-','b','o','t','t','o','m',0};
58 static const WCHAR border_bottom_colorW
[] =
59 {'b','o','r','d','e','r','-','b','o','t','t','o','m','-','c','o','l','o','r',0};
60 static const WCHAR border_bottom_styleW
[] =
61 {'b','o','r','d','e','r','-','b','o','t','t','o','m','-','s','t','y','l','e',0};
62 static const WCHAR border_bottom_widthW
[] =
63 {'b','o','r','d','e','r','-','b','o','t','t','o','m','-','w','i','d','t','h',0};
64 static const WCHAR border_colorW
[] =
65 {'b','o','r','d','e','r','-','c','o','l','o','r',0};
66 static const WCHAR border_leftW
[] =
67 {'b','o','r','d','e','r','-','l','e','f','t',0};
68 static const WCHAR border_left_colorW
[] =
69 {'b','o','r','d','e','r','-','l','e','f','t','-','c','o','l','o','r',0};
70 static const WCHAR border_left_styleW
[] =
71 {'b','o','r','d','e','r','-','l','e','f','t','-','s','t','y','l','e',0};
72 static const WCHAR border_left_widthW
[] =
73 {'b','o','r','d','e','r','-','l','e','f','t','-','w','i','d','t','h',0};
74 static const WCHAR border_rightW
[] =
75 {'b','o','r','d','e','r','-','r','i','g','h','t',0};
76 static const WCHAR border_right_colorW
[] =
77 {'b','o','r','d','e','r','-','r','i','g','h','t','-','c','o','l','o','r',0};
78 static const WCHAR border_right_styleW
[] =
79 {'b','o','r','d','e','r','-','r','i','g','h','t','-','s','t','y','l','e',0};
80 static const WCHAR border_right_widthW
[] =
81 {'b','o','r','d','e','r','-','r','i','g','h','t','-','w','i','d','t','h',0};
82 static const WCHAR border_topW
[] =
83 {'b','o','r','d','e','r','-','t','o','p',0};
84 static const WCHAR border_top_colorW
[] =
85 {'b','o','r','d','e','r','-','t','o','p','-','c','o','l','o','r',0};
86 static const WCHAR border_styleW
[] =
87 {'b','o','r','d','e','r','-','s','t','y','l','e',0};
88 static const WCHAR border_top_styleW
[] =
89 {'b','o','r','d','e','r','-','t','o','p','-','s','t','y','l','e',0};
90 static const WCHAR border_top_widthW
[] =
91 {'b','o','r','d','e','r','-','t','o','p','-','w','i','d','t','h',0};
92 static const WCHAR border_widthW
[] =
93 {'b','o','r','d','e','r','-','w','i','d','t','h',0};
94 static const WCHAR bottomW
[] =
95 {'b','o','t','t','o','m',0};
96 /* FIXME: Use unprefixed version (requires Gecko changes). */
97 static const WCHAR box_sizingW
[] =
98 {'-','m','o','z','-','b','o','x','-','s','i','z','i','n','g',0};
99 static const WCHAR clearW
[] =
100 {'c','l','e','a','r',0};
101 static const WCHAR clipW
[] =
103 static const WCHAR colorW
[] =
104 {'c','o','l','o','r',0};
105 static const WCHAR cursorW
[] =
106 {'c','u','r','s','o','r',0};
107 static const WCHAR directionW
[] =
108 {'d','i','r','e','c','t','i','o','n',0};
109 static const WCHAR displayW
[] =
110 {'d','i','s','p','l','a','y',0};
111 static const WCHAR filterW
[] =
112 {'f','i','l','e','t','e','r',0};
113 static const WCHAR floatW
[] =
114 {'f','l','o','a','t',0};
115 static const WCHAR font_familyW
[] =
116 {'f','o','n','t','-','f','a','m','i','l','y',0};
117 static const WCHAR font_sizeW
[] =
118 {'f','o','n','t','-','s','i','z','e',0};
119 static const WCHAR font_styleW
[] =
120 {'f','o','n','t','-','s','t','y','l','e',0};
121 static const WCHAR font_variantW
[] =
122 {'f','o','n','t','-','v','a','r','i','a','n','t',0};
123 static const WCHAR font_weightW
[] =
124 {'f','o','n','t','-','w','e','i','g','h','t',0};
125 static const WCHAR heightW
[] =
126 {'h','e','i','g','h','t',0};
127 static const WCHAR leftW
[] =
129 static const WCHAR letter_spacingW
[] =
130 {'l','e','t','t','e','r','-','s','p','a','c','i','n','g',0};
131 static const WCHAR line_heightW
[] =
132 {'l','i','n','e','-','h','e','i','g','h','t',0};
133 static const WCHAR list_styleW
[] =
134 {'l','i','s','t','-','s','t','y','l','e',0};
135 static const WCHAR list_style_typeW
[] =
136 {'l','i','s','t','-','s','t','y','l','e','-','t','y','p','e',0};
137 static const WCHAR list_style_positionW
[] =
138 {'l','i','s','t','-','s','t','y','l','e','-','p','o','s','i','t','i','o','n',0};
139 static const WCHAR marginW
[] =
140 {'m','a','r','g','i','n',0};
141 static const WCHAR margin_bottomW
[] =
142 {'m','a','r','g','i','n','-','b','o','t','t','o','m',0};
143 static const WCHAR margin_leftW
[] =
144 {'m','a','r','g','i','n','-','l','e','f','t',0};
145 static const WCHAR margin_rightW
[] =
146 {'m','a','r','g','i','n','-','r','i','g','h','t',0};
147 static const WCHAR margin_topW
[] =
148 {'m','a','r','g','i','n','-','t','o','p',0};
149 static const WCHAR max_heightW
[] =
150 {'m','a','x','-','h','e','i','g','h','t',0};
151 static const WCHAR max_widthW
[] =
152 {'m','a','x','-','w','i','d','t','h',0};
153 static const WCHAR min_heightW
[] =
154 {'m','i','n','-','h','e','i','g','h','t',0};
155 static const WCHAR min_widthW
[] =
156 {'m','i','n','-','w','i','d','t','h',0};
157 static const WCHAR outlineW
[] =
158 {'o','u','t','l','i','n','e',0};
159 static const WCHAR overflowW
[] =
160 {'o','v','e','r','f','l','o','w',0};
161 static const WCHAR overflow_xW
[] =
162 {'o','v','e','r','f','l','o','w','-','x',0};
163 static const WCHAR overflow_yW
[] =
164 {'o','v','e','r','f','l','o','w','-','y',0};
165 static const WCHAR paddingW
[] =
166 {'p','a','d','d','i','n','g',0};
167 static const WCHAR padding_bottomW
[] =
168 {'p','a','d','d','i','n','g','-','b','o','t','t','o','m',0};
169 static const WCHAR padding_leftW
[] =
170 {'p','a','d','d','i','n','g','-','l','e','f','t',0};
171 static const WCHAR padding_rightW
[] =
172 {'p','a','d','d','i','n','g','-','r','i','g','h','t',0};
173 static const WCHAR padding_topW
[] =
174 {'p','a','d','d','i','n','g','-','t','o','p',0};
175 static const WCHAR page_break_afterW
[] =
176 {'p','a','g','e','-','b','r','e','a','k','-','a','f','t','e','r',0};
177 static const WCHAR page_break_beforeW
[] =
178 {'p','a','g','e','-','b','r','e','a','k','-','b','e','f','o','r','e',0};
179 static const WCHAR positionW
[] =
180 {'p','o','s','i','t','i','o','n',0};
181 static const WCHAR rightW
[] =
182 {'r','i','g','h','t',0};
183 static const WCHAR table_layoutW
[] =
184 {'t','a','b','l','e','-','l','a','y','o','u','t',0};
185 static const WCHAR text_alignW
[] =
186 {'t','e','x','t','-','a','l','i','g','n',0};
187 static const WCHAR text_decorationW
[] =
188 {'t','e','x','t','-','d','e','c','o','r','a','t','i','o','n',0};
189 static const WCHAR text_indentW
[] =
190 {'t','e','x','t','-','i','n','d','e','n','t',0};
191 static const WCHAR text_transformW
[] =
192 {'t','e','x','t','-','t','r','a','n','s','f','o','r','m',0};
193 static const WCHAR topW
[] =
195 static const WCHAR vertical_alignW
[] =
196 {'v','e','r','t','i','c','a','l','-','a','l','i','g','n',0};
197 static const WCHAR visibilityW
[] =
198 {'v','i','s','i','b','i','l','i','t','y',0};
199 static const WCHAR white_spaceW
[] =
200 {'w','h','i','t','e','-','s','p','a','c','e',0};
201 static const WCHAR widthW
[] =
202 {'w','i','d','t','h',0};
203 static const WCHAR word_spacingW
[] =
204 {'w','o','r','d','-','s','p','a','c','i','n','g',0};
205 static const WCHAR word_wrapW
[] =
206 {'w','o','r','d','-','w','r','a','p',0};
207 static const WCHAR z_indexW
[] =
208 {'z','-','i','n','d','e','x',0};
211 static const WCHAR pxW
[] = {'p','x',0};
219 static const style_tbl_entry_t style_tbl
[] = {
220 {backgroundW
, DISPID_IHTMLSTYLE_BACKGROUND
},
221 {background_attachmentW
, DISPID_IHTMLSTYLE_BACKGROUNDATTACHMENT
},
222 {background_colorW
, DISPID_IHTMLSTYLE_BACKGROUNDCOLOR
, ATTR_HEX_INT
},
223 {background_imageW
, DISPID_IHTMLSTYLE_BACKGROUNDIMAGE
, ATTR_FIX_URL
},
224 {background_positionW
, DISPID_IHTMLSTYLE_BACKGROUNDPOSITION
},
225 {background_position_xW
, DISPID_IHTMLSTYLE_BACKGROUNDPOSITIONX
, ATTR_FIX_PX
},
226 {background_position_yW
, DISPID_IHTMLSTYLE_BACKGROUNDPOSITIONY
, ATTR_FIX_PX
},
227 {background_repeatW
, DISPID_IHTMLSTYLE_BACKGROUNDREPEAT
},
228 {borderW
, DISPID_IHTMLSTYLE_BORDER
},
229 {border_bottomW
, DISPID_IHTMLSTYLE_BORDERBOTTOM
, ATTR_FIX_PX
},
230 {border_bottom_colorW
, DISPID_IHTMLSTYLE_BORDERBOTTOMCOLOR
, ATTR_HEX_INT
},
231 {border_bottom_styleW
, DISPID_IHTMLSTYLE_BORDERBOTTOMSTYLE
},
232 {border_bottom_widthW
, DISPID_IHTMLSTYLE_BORDERBOTTOMWIDTH
, ATTR_FIX_PX
},
233 {border_colorW
, DISPID_IHTMLSTYLE_BORDERCOLOR
},
234 {border_leftW
, DISPID_IHTMLSTYLE_BORDERLEFT
, ATTR_FIX_PX
},
235 {border_left_colorW
, DISPID_IHTMLSTYLE_BORDERLEFTCOLOR
, ATTR_HEX_INT
},
236 {border_left_styleW
, DISPID_IHTMLSTYLE_BORDERLEFTSTYLE
},
237 {border_left_widthW
, DISPID_IHTMLSTYLE_BORDERLEFTWIDTH
, ATTR_FIX_PX
},
238 {border_rightW
, DISPID_IHTMLSTYLE_BORDERRIGHT
, ATTR_FIX_PX
},
239 {border_right_colorW
, DISPID_IHTMLSTYLE_BORDERRIGHTCOLOR
, ATTR_HEX_INT
},
240 {border_right_styleW
, DISPID_IHTMLSTYLE_BORDERRIGHTSTYLE
},
241 {border_right_widthW
, DISPID_IHTMLSTYLE_BORDERRIGHTWIDTH
, ATTR_FIX_PX
},
242 {border_styleW
, DISPID_IHTMLSTYLE_BORDERSTYLE
},
243 {border_topW
, DISPID_IHTMLSTYLE_BORDERTOP
, ATTR_FIX_PX
},
244 {border_top_colorW
, DISPID_IHTMLSTYLE_BORDERTOPCOLOR
, ATTR_HEX_INT
},
245 {border_top_styleW
, DISPID_IHTMLSTYLE_BORDERTOPSTYLE
},
246 {border_top_widthW
, DISPID_IHTMLSTYLE_BORDERTOPWIDTH
},
247 {border_widthW
, DISPID_IHTMLSTYLE_BORDERWIDTH
},
248 {bottomW
, DISPID_IHTMLSTYLE2_BOTTOM
, ATTR_FIX_PX
},
249 {box_sizingW
, DISPID_IHTMLSTYLE6_BOXSIZING
},
250 {clearW
, DISPID_IHTMLSTYLE_CLEAR
},
251 {clipW
, DISPID_IHTMLSTYLE_CLIP
, ATTR_REMOVE_COMMA
},
252 {colorW
, DISPID_IHTMLSTYLE_COLOR
, ATTR_HEX_INT
},
253 {cursorW
, DISPID_IHTMLSTYLE_CURSOR
},
254 {directionW
, DISPID_IHTMLSTYLE2_DIRECTION
},
255 {displayW
, DISPID_IHTMLSTYLE_DISPLAY
},
256 {filterW
, DISPID_IHTMLSTYLE_FILTER
},
257 {floatW
, DISPID_IHTMLSTYLE_STYLEFLOAT
},
258 {font_familyW
, DISPID_IHTMLSTYLE_FONTFAMILY
},
259 {font_sizeW
, DISPID_IHTMLSTYLE_FONTSIZE
, ATTR_FIX_PX
},
260 {font_styleW
, DISPID_IHTMLSTYLE_FONTSTYLE
},
261 {font_variantW
, DISPID_IHTMLSTYLE_FONTVARIANT
},
262 {font_weightW
, DISPID_IHTMLSTYLE_FONTWEIGHT
, ATTR_STR_TO_INT
},
263 {heightW
, DISPID_IHTMLSTYLE_HEIGHT
, ATTR_FIX_PX
},
264 {leftW
, DISPID_IHTMLSTYLE_LEFT
},
265 {letter_spacingW
, DISPID_IHTMLSTYLE_LETTERSPACING
},
266 {line_heightW
, DISPID_IHTMLSTYLE_LINEHEIGHT
},
267 {list_styleW
, DISPID_IHTMLSTYLE_LISTSTYLE
},
268 {list_style_positionW
, DISPID_IHTMLSTYLE_LISTSTYLEPOSITION
},
269 {list_style_typeW
, DISPID_IHTMLSTYLE_LISTSTYLETYPE
},
270 {marginW
, DISPID_IHTMLSTYLE_MARGIN
},
271 {margin_bottomW
, DISPID_IHTMLSTYLE_MARGINBOTTOM
, ATTR_FIX_PX
},
272 {margin_leftW
, DISPID_IHTMLSTYLE_MARGINLEFT
, ATTR_FIX_PX
},
273 {margin_rightW
, DISPID_IHTMLSTYLE_MARGINRIGHT
, ATTR_FIX_PX
},
274 {margin_topW
, DISPID_IHTMLSTYLE_MARGINTOP
, ATTR_FIX_PX
},
275 {max_heightW
, DISPID_IHTMLSTYLE5_MAXHEIGHT
, ATTR_FIX_PX
},
276 {max_widthW
, DISPID_IHTMLSTYLE5_MAXWIDTH
, ATTR_FIX_PX
},
277 {min_heightW
, DISPID_IHTMLSTYLE4_MINHEIGHT
},
278 {min_widthW
, DISPID_IHTMLSTYLE5_MINWIDTH
, ATTR_FIX_PX
},
279 {outlineW
, DISPID_IHTMLSTYLE6_OUTLINE
, ATTR_NO_NULL
},
280 {overflowW
, DISPID_IHTMLSTYLE_OVERFLOW
},
281 {overflow_xW
, DISPID_IHTMLSTYLE2_OVERFLOWX
},
282 {overflow_yW
, DISPID_IHTMLSTYLE2_OVERFLOWY
},
283 {paddingW
, DISPID_IHTMLSTYLE_PADDING
},
284 {padding_bottomW
, DISPID_IHTMLSTYLE_PADDINGBOTTOM
, ATTR_FIX_PX
},
285 {padding_leftW
, DISPID_IHTMLSTYLE_PADDINGLEFT
, ATTR_FIX_PX
},
286 {padding_rightW
, DISPID_IHTMLSTYLE_PADDINGRIGHT
, ATTR_FIX_PX
},
287 {padding_topW
, DISPID_IHTMLSTYLE_PADDINGTOP
, ATTR_FIX_PX
},
288 {page_break_afterW
, DISPID_IHTMLSTYLE_PAGEBREAKAFTER
},
289 {page_break_beforeW
, DISPID_IHTMLSTYLE_PAGEBREAKBEFORE
},
290 {positionW
, DISPID_IHTMLSTYLE2_POSITION
},
291 {rightW
, DISPID_IHTMLSTYLE2_RIGHT
},
292 {table_layoutW
, DISPID_IHTMLSTYLE2_TABLELAYOUT
},
293 {text_alignW
, DISPID_IHTMLSTYLE_TEXTALIGN
},
294 {text_decorationW
, DISPID_IHTMLSTYLE_TEXTDECORATION
},
295 {text_indentW
, DISPID_IHTMLSTYLE_TEXTINDENT
, ATTR_FIX_PX
},
296 {text_transformW
, DISPID_IHTMLSTYLE_TEXTTRANSFORM
},
297 {topW
, DISPID_IHTMLSTYLE_TOP
},
298 {vertical_alignW
, DISPID_IHTMLSTYLE_VERTICALALIGN
, ATTR_FIX_PX
},
299 {visibilityW
, DISPID_IHTMLSTYLE_VISIBILITY
},
300 {white_spaceW
, DISPID_IHTMLSTYLE_WHITESPACE
},
301 {widthW
, DISPID_IHTMLSTYLE_WIDTH
, ATTR_FIX_PX
},
302 {word_spacingW
, DISPID_IHTMLSTYLE_WORDSPACING
},
303 {word_wrapW
, DISPID_IHTMLSTYLE3_WORDWRAP
},
304 {z_indexW
, DISPID_IHTMLSTYLE_ZINDEX
, ATTR_STR_TO_INT
}
307 C_ASSERT(ARRAY_SIZE(style_tbl
) == STYLEID_MAX_VALUE
);
309 static const WCHAR valLineThrough
[] =
310 {'l','i','n','e','-','t','h','r','o','u','g','h',0};
311 static const WCHAR valUnderline
[] =
312 {'u','n','d','e','r','l','i','n','e',0};
313 static const WCHAR szNormal
[] =
314 {'n','o','r','m','a','l',0};
315 static const WCHAR styleNone
[] =
317 static const WCHAR valOverline
[] =
318 {'o','v','e','r','l','i','n','e',0};
319 static const WCHAR valBlink
[] =
320 {'b','l','i','n','k',0};
322 static const WCHAR px_formatW
[] = {'%','d','p','x',0};
323 static const WCHAR emptyW
[] = {0};
325 static const style_tbl_entry_t
*lookup_style_tbl(const WCHAR
*name
)
327 int c
, i
, min
= 0, max
= ARRAY_SIZE(style_tbl
)-1;
332 c
= strcmpW(style_tbl
[i
].name
, name
);
345 static inline compat_mode_t
get_style_compat_mode(HTMLStyle
*style
)
347 return style
->elem
&& style
->elem
->node
.doc
? style
->elem
->node
.doc
->document_mode
: COMPAT_MODE_QUIRKS
;
350 static LPWSTR
fix_px_value(LPCWSTR val
)
355 while(*ptr
&& isspaceW(*ptr
))
360 while(*ptr
&& isdigitW(*ptr
))
363 if(!*ptr
|| isspaceW(*ptr
)) {
365 int len
= strlenW(val
)+1;
367 ret
= heap_alloc((len
+2)*sizeof(WCHAR
));
368 memcpy(ret
, val
, (ptr
-val
)*sizeof(WCHAR
));
374 TRACE("fixed %s -> %s\n", debugstr_w(val
), debugstr_w(ret
));
379 while(*ptr
&& !isspaceW(*ptr
))
386 static LPWSTR
fix_url_value(LPCWSTR val
)
390 static const WCHAR urlW
[] = {'u','r','l','('};
392 if(strncmpW(val
, urlW
, ARRAY_SIZE(urlW
)) || !strchrW(val
, '\\'))
395 ret
= heap_strdupW(val
);
397 for(ptr
= ret
; *ptr
; ptr
++) {
405 static HRESULT
set_nsstyle_attr(nsIDOMCSSStyleDeclaration
*nsstyle
, styleid_t sid
, const WCHAR
*value
, DWORD flags
)
407 nsAString str_name
, str_value
, str_empty
;
412 flags
= style_tbl
[sid
].flags
;
413 if(flags
& ATTR_FIX_PX
)
414 val
= fix_px_value(value
);
415 else if(flags
& ATTR_FIX_URL
)
416 val
= fix_url_value(value
);
419 nsAString_InitDepend(&str_name
, style_tbl
[sid
].name
);
420 nsAString_InitDepend(&str_value
, val
? val
: value
);
421 nsAString_InitDepend(&str_empty
, emptyW
);
423 nsres
= nsIDOMCSSStyleDeclaration_SetProperty(nsstyle
, &str_name
, &str_value
, &str_empty
);
425 ERR("SetProperty failed: %08x\n", nsres
);
427 nsAString_Finish(&str_name
);
428 nsAString_Finish(&str_value
);
429 nsAString_Finish(&str_empty
);
435 static HRESULT
var_to_styleval(const VARIANT
*v
, WCHAR
*buf
, DWORD flags
, const WCHAR
**ret
)
446 case VT_BSTR
|VT_BYREF
:
447 *ret
= *V_BSTRREF(v
);
451 static const WCHAR formatW
[] = {'%','d',0};
452 static const WCHAR hex_formatW
[] = {'#','%','0','6','x',0};
454 if(flags
& ATTR_HEX_INT
)
455 wsprintfW(buf
, hex_formatW
, V_I4(v
));
456 else if(flags
& ATTR_FIX_PX
)
457 wsprintfW(buf
, px_formatW
, V_I4(v
));
459 wsprintfW(buf
, formatW
, V_I4(v
));
465 FIXME("not implemented for %s\n", debugstr_variant(v
));
471 static HRESULT
set_nsstyle_attr_var(nsIDOMCSSStyleDeclaration
*nsstyle
, styleid_t sid
, VARIANT
*value
, DWORD flags
)
477 hres
= var_to_styleval(value
, buf
, flags
, &val
);
481 return set_nsstyle_attr(nsstyle
, sid
, val
, flags
);
484 static inline HRESULT
set_style_attr(HTMLStyle
*This
, styleid_t sid
, LPCWSTR value
, DWORD flags
)
486 return set_nsstyle_attr(This
->nsstyle
, sid
, value
, flags
);
489 static HRESULT
get_nsstyle_attr_nsval(nsIDOMCSSStyleDeclaration
*nsstyle
, styleid_t sid
, nsAString
*value
)
494 nsAString_InitDepend(&str_name
, style_tbl
[sid
].name
);
495 nsres
= nsIDOMCSSStyleDeclaration_GetPropertyValue(nsstyle
, &str_name
, value
);
496 nsAString_Finish(&str_name
);
497 if(NS_FAILED(nsres
)) {
498 ERR("SetProperty failed: %08x\n", nsres
);
505 static HRESULT
nsstyle_to_bstr(const WCHAR
*val
, DWORD flags
, BSTR
*p
)
511 *p
= (flags
& ATTR_NO_NULL
) ? SysAllocStringLen(NULL
, 0) : NULL
;
515 ret
= SysAllocString(val
);
517 return E_OUTOFMEMORY
;
519 len
= SysStringLen(ret
);
521 if(flags
& ATTR_REMOVE_COMMA
) {
525 for(ptr
= ret
; (ptr
= strchrW(ptr
, ',')); ptr
++)
531 new_ret
= SysAllocStringLen(NULL
, new_len
);
534 return E_OUTOFMEMORY
;
537 for(ptr2
= new_ret
, ptr
= ret
; *ptr
; ptr
++) {
551 HRESULT
get_nsstyle_attr(nsIDOMCSSStyleDeclaration
*nsstyle
, styleid_t sid
, BSTR
*p
, DWORD flags
)
554 const PRUnichar
*value
;
557 nsAString_Init(&str_value
, NULL
);
559 get_nsstyle_attr_nsval(nsstyle
, sid
, &str_value
);
561 nsAString_GetData(&str_value
, &value
);
562 hres
= nsstyle_to_bstr(value
, flags
, p
);
563 nsAString_Finish(&str_value
);
565 TRACE("%s -> %s\n", debugstr_w(style_tbl
[sid
].name
), debugstr_w(*p
));
569 HRESULT
get_nsstyle_attr_var(nsIDOMCSSStyleDeclaration
*nsstyle
, styleid_t sid
, VARIANT
*p
, DWORD flags
)
572 const PRUnichar
*value
;
576 flags
= style_tbl
[sid
].flags
;
577 nsAString_Init(&str_value
, NULL
);
579 get_nsstyle_attr_nsval(nsstyle
, sid
, &str_value
);
581 nsAString_GetData(&str_value
, &value
);
583 if(flags
& ATTR_STR_TO_INT
) {
584 const PRUnichar
*ptr
= value
;
593 while(isdigitW(*ptr
))
594 i
= i
*10 + (*ptr
++ - '0');
598 V_I4(p
) = neg
? -i
: i
;
606 hres
= nsstyle_to_bstr(value
, flags
, &str
);
607 if(SUCCEEDED(hres
)) {
613 nsAString_Finish(&str_value
);
615 TRACE("%s -> %s\n", debugstr_w(style_tbl
[sid
].name
), debugstr_variant(p
));
619 static inline HRESULT
get_style_attr(HTMLStyle
*This
, styleid_t sid
, BSTR
*p
)
621 return get_nsstyle_attr(This
->nsstyle
, sid
, p
, 0);
624 static HRESULT
check_style_attr_value(HTMLStyle
*This
, styleid_t sid
, LPCWSTR exval
, VARIANT_BOOL
*p
)
627 const PRUnichar
*value
;
629 nsAString_Init(&str_value
, NULL
);
631 get_nsstyle_attr_nsval(This
->nsstyle
, sid
, &str_value
);
633 nsAString_GetData(&str_value
, &value
);
634 *p
= variant_bool(!strcmpW(value
, exval
));
635 nsAString_Finish(&str_value
);
637 TRACE("%s -> %x\n", debugstr_w(style_tbl
[sid
].name
), *p
);
641 static inline HRESULT
set_style_pos(HTMLStyle
*This
, styleid_t sid
, float value
)
644 WCHAR szFormat
[] = {'%','.','0','f','p','x',0};
646 value
= floor(value
);
648 sprintfW(szValue
, szFormat
, value
);
650 return set_style_attr(This
, sid
, szValue
, 0);
653 static HRESULT
set_style_pxattr(nsIDOMCSSStyleDeclaration
*nsstyle
, styleid_t sid
, LONG value
)
657 sprintfW(value_str
, px_formatW
, value
);
659 return set_nsstyle_attr(nsstyle
, sid
, value_str
, 0);
662 static HRESULT
get_nsstyle_pos(HTMLStyle
*This
, styleid_t sid
, float *p
)
667 TRACE("%p %d %p\n", This
, sid
, p
);
671 nsAString_Init(&str_value
, NULL
);
673 hres
= get_nsstyle_attr_nsval(This
->nsstyle
, sid
, &str_value
);
677 const PRUnichar
*value
;
679 nsAString_GetData(&str_value
, &value
);
682 *p
= strtolW(value
, &ptr
, 10);
684 if(*ptr
&& strcmpW(ptr
, pxW
))
686 nsAString_Finish(&str_value
);
687 FIXME("only px values are currently supported\n");
693 TRACE("ret %f\n", *p
);
695 nsAString_Finish(&str_value
);
699 static HRESULT
get_nsstyle_pixel_val(HTMLStyle
*This
, styleid_t sid
, LONG
*p
)
707 nsAString_Init(&str_value
, NULL
);
709 hres
= get_nsstyle_attr_nsval(This
->nsstyle
, sid
, &str_value
);
712 const PRUnichar
*value
;
714 nsAString_GetData(&str_value
, &value
);
716 *p
= strtolW(value
, &ptr
, 10);
719 /* Skip all digits. We have tests showing that we should not round the value. */
720 while(isdigitW(*++ptr
));
724 if(!ptr
|| (*ptr
&& strcmpW(ptr
, pxW
)))
728 nsAString_Finish(&str_value
);
732 static BOOL
is_valid_border_style(BSTR v
)
734 static const WCHAR styleDotted
[] = {'d','o','t','t','e','d',0};
735 static const WCHAR styleDashed
[] = {'d','a','s','h','e','d',0};
736 static const WCHAR styleSolid
[] = {'s','o','l','i','d',0};
737 static const WCHAR styleDouble
[] = {'d','o','u','b','l','e',0};
738 static const WCHAR styleGroove
[] = {'g','r','o','o','v','e',0};
739 static const WCHAR styleRidge
[] = {'r','i','d','g','e',0};
740 static const WCHAR styleInset
[] = {'i','n','s','e','t',0};
741 static const WCHAR styleOutset
[] = {'o','u','t','s','e','t',0};
743 TRACE("%s\n", debugstr_w(v
));
745 if(!v
|| strcmpiW(v
, styleNone
) == 0 || strcmpiW(v
, styleDotted
) == 0 ||
746 strcmpiW(v
, styleDashed
) == 0 || strcmpiW(v
, styleSolid
) == 0 ||
747 strcmpiW(v
, styleDouble
) == 0 || strcmpiW(v
, styleGroove
) == 0 ||
748 strcmpiW(v
, styleRidge
) == 0 || strcmpiW(v
, styleInset
) == 0 ||
749 strcmpiW(v
, styleOutset
) == 0 )
757 static inline HTMLStyle
*impl_from_IHTMLStyle(IHTMLStyle
*iface
)
759 return CONTAINING_RECORD(iface
, HTMLStyle
, IHTMLStyle_iface
);
762 static HRESULT WINAPI
HTMLStyle_QueryInterface(IHTMLStyle
*iface
, REFIID riid
, void **ppv
)
764 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
766 TRACE("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
768 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
769 *ppv
= &This
->IHTMLStyle_iface
;
770 }else if(IsEqualGUID(&IID_IHTMLStyle
, riid
)) {
771 *ppv
= &This
->IHTMLStyle_iface
;
772 }else if(IsEqualGUID(&IID_IHTMLStyle2
, riid
)) {
773 *ppv
= &This
->IHTMLStyle2_iface
;
774 }else if(IsEqualGUID(&IID_IHTMLStyle3
, riid
)) {
775 *ppv
= &This
->IHTMLStyle3_iface
;
776 }else if(IsEqualGUID(&IID_IHTMLStyle4
, riid
)) {
777 *ppv
= &This
->IHTMLStyle4_iface
;
778 }else if(IsEqualGUID(&IID_IHTMLStyle5
, riid
)) {
779 *ppv
= &This
->IHTMLStyle5_iface
;
780 }else if(IsEqualGUID(&IID_IHTMLStyle6
, riid
)) {
781 *ppv
= &This
->IHTMLStyle6_iface
;
782 }else if(dispex_query_interface(&This
->dispex
, riid
, ppv
)) {
783 return *ppv
? S_OK
: E_NOINTERFACE
;
786 WARN("unsupported iface %s\n", debugstr_mshtml_guid(riid
));
787 return E_NOINTERFACE
;
790 IUnknown_AddRef((IUnknown
*)*ppv
);
794 static ULONG WINAPI
HTMLStyle_AddRef(IHTMLStyle
*iface
)
796 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
797 LONG ref
= InterlockedIncrement(&This
->ref
);
799 TRACE("(%p) ref=%d\n", This
, ref
);
804 static ULONG WINAPI
HTMLStyle_Release(IHTMLStyle
*iface
)
806 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
807 LONG ref
= InterlockedDecrement(&This
->ref
);
809 TRACE("(%p) ref=%d\n", This
, ref
);
814 nsIDOMCSSStyleDeclaration_Release(This
->nsstyle
);
815 release_dispex(&This
->dispex
);
822 static HRESULT WINAPI
HTMLStyle_GetTypeInfoCount(IHTMLStyle
*iface
, UINT
*pctinfo
)
824 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
825 return IDispatchEx_GetTypeInfoCount(&This
->dispex
.IDispatchEx_iface
, pctinfo
);
828 static HRESULT WINAPI
HTMLStyle_GetTypeInfo(IHTMLStyle
*iface
, UINT iTInfo
,
829 LCID lcid
, ITypeInfo
**ppTInfo
)
831 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
832 return IDispatchEx_GetTypeInfo(&This
->dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
835 static HRESULT WINAPI
HTMLStyle_GetIDsOfNames(IHTMLStyle
*iface
, REFIID riid
,
836 LPOLESTR
*rgszNames
, UINT cNames
,
837 LCID lcid
, DISPID
*rgDispId
)
839 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
840 return IDispatchEx_GetIDsOfNames(&This
->dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
844 static HRESULT WINAPI
HTMLStyle_Invoke(IHTMLStyle
*iface
, DISPID dispIdMember
,
845 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
846 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
848 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
849 return IDispatchEx_Invoke(&This
->dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
850 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
853 static HRESULT WINAPI
HTMLStyle_put_fontFamily(IHTMLStyle
*iface
, BSTR v
)
855 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
857 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
859 return set_style_attr(This
, STYLEID_FONT_FAMILY
, v
, 0);
862 static HRESULT WINAPI
HTMLStyle_get_fontFamily(IHTMLStyle
*iface
, BSTR
*p
)
864 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
866 TRACE("(%p)->(%p)\n", This
, p
);
868 return get_style_attr(This
, STYLEID_FONT_FAMILY
, p
);
871 static HRESULT WINAPI
HTMLStyle_put_fontStyle(IHTMLStyle
*iface
, BSTR v
)
873 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
874 static const WCHAR szItalic
[] = {'i','t','a','l','i','c',0};
875 static const WCHAR szOblique
[] = {'o','b','l','i','q','u','e',0};
877 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
879 /* fontStyle can only be one of the follow values. */
880 if(!v
|| strcmpiW(szNormal
, v
) == 0 || strcmpiW(szItalic
, v
) == 0 ||
881 strcmpiW(szOblique
, v
) == 0)
883 return set_nsstyle_attr(This
->nsstyle
, STYLEID_FONT_STYLE
, v
, 0);
889 static HRESULT WINAPI
HTMLStyle_get_fontStyle(IHTMLStyle
*iface
, BSTR
*p
)
891 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
893 TRACE("(%p)->(%p)\n", This
, p
);
895 return get_style_attr(This
, STYLEID_FONT_STYLE
, p
);
898 static HRESULT WINAPI
HTMLStyle_put_fontVariant(IHTMLStyle
*iface
, BSTR v
)
900 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
901 static const WCHAR szCaps
[] = {'s','m','a','l','l','-','c','a','p','s',0};
903 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
905 /* fontVariant can only be one of the follow values. */
906 if(!v
|| strcmpiW(szNormal
, v
) == 0 || strcmpiW(szCaps
, v
) == 0)
908 return set_nsstyle_attr(This
->nsstyle
, STYLEID_FONT_VARIANT
, v
, 0);
914 static HRESULT WINAPI
HTMLStyle_get_fontVariant(IHTMLStyle
*iface
, BSTR
*p
)
916 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
917 TRACE("(%p)->(%p)\n", This
, p
);
922 return get_style_attr(This
, STYLEID_FONT_VARIANT
, p
);
925 static HRESULT WINAPI
HTMLStyle_put_fontWeight(IHTMLStyle
*iface
, BSTR v
)
927 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
928 static const WCHAR styleBold
[] = {'b','o','l','d',0};
929 static const WCHAR styleBolder
[] = {'b','o','l','d','e','r',0};
930 static const WCHAR styleLighter
[] = {'l','i','g','h','t','e','r',0};
931 static const WCHAR style100
[] = {'1','0','0',0};
932 static const WCHAR style200
[] = {'2','0','0',0};
933 static const WCHAR style300
[] = {'3','0','0',0};
934 static const WCHAR style400
[] = {'4','0','0',0};
935 static const WCHAR style500
[] = {'5','0','0',0};
936 static const WCHAR style600
[] = {'6','0','0',0};
937 static const WCHAR style700
[] = {'7','0','0',0};
938 static const WCHAR style800
[] = {'8','0','0',0};
939 static const WCHAR style900
[] = {'9','0','0',0};
941 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
943 /* fontWeight can only be one of the following */
944 if(v
&& *v
&& strcmpiW(szNormal
, v
) && strcmpiW(styleBold
, v
) && strcmpiW(styleBolder
, v
)
945 && strcmpiW(styleLighter
, v
) && strcmpiW(style100
, v
) && strcmpiW(style200
, v
)
946 && strcmpiW(style300
, v
) && strcmpiW(style400
, v
) && strcmpiW(style500
, v
) && strcmpiW(style600
, v
)
947 && strcmpiW(style700
, v
) && strcmpiW(style800
, v
) && strcmpiW(style900
, v
))
950 return set_nsstyle_attr(This
->nsstyle
, STYLEID_FONT_WEIGHT
, v
, 0);
953 static HRESULT WINAPI
HTMLStyle_get_fontWeight(IHTMLStyle
*iface
, BSTR
*p
)
955 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
957 TRACE("(%p)->(%p)\n", This
, p
);
959 return get_style_attr(This
, STYLEID_FONT_WEIGHT
, p
);
962 static HRESULT WINAPI
HTMLStyle_put_fontSize(IHTMLStyle
*iface
, VARIANT v
)
964 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
966 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
968 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_FONT_SIZE
, &v
, ATTR_FIX_PX
);
971 static HRESULT WINAPI
HTMLStyle_get_fontSize(IHTMLStyle
*iface
, VARIANT
*p
)
973 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
975 TRACE("(%p)->(%p)\n", This
, p
);
977 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_FONT_SIZE
, p
, 0);
980 static HRESULT WINAPI
HTMLStyle_put_font(IHTMLStyle
*iface
, BSTR v
)
982 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
983 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
987 static HRESULT WINAPI
HTMLStyle_get_font(IHTMLStyle
*iface
, BSTR
*p
)
989 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
990 FIXME("(%p)->(%p)\n", This
, p
);
994 static HRESULT WINAPI
HTMLStyle_put_color(IHTMLStyle
*iface
, VARIANT v
)
996 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
998 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1000 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_COLOR
, &v
, ATTR_HEX_INT
);
1003 static HRESULT WINAPI
HTMLStyle_get_color(IHTMLStyle
*iface
, VARIANT
*p
)
1005 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1007 TRACE("(%p)->(%p)\n", This
, p
);
1009 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_COLOR
, p
, 0);
1012 static HRESULT WINAPI
HTMLStyle_put_background(IHTMLStyle
*iface
, BSTR v
)
1014 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1016 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1018 return set_style_attr(This
, STYLEID_BACKGROUND
, v
, 0);
1021 static HRESULT WINAPI
HTMLStyle_get_background(IHTMLStyle
*iface
, BSTR
*p
)
1023 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1025 TRACE("(%p)->(%p)\n", This
, p
);
1027 return get_style_attr(This
, STYLEID_BACKGROUND
, p
);
1030 static HRESULT WINAPI
HTMLStyle_put_backgroundColor(IHTMLStyle
*iface
, VARIANT v
)
1032 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1034 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1036 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_BACKGROUND_COLOR
, &v
, ATTR_HEX_INT
);
1039 static HRESULT WINAPI
HTMLStyle_get_backgroundColor(IHTMLStyle
*iface
, VARIANT
*p
)
1041 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1043 TRACE("(%p)->(%p)\n", This
, p
);
1045 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_BACKGROUND_COLOR
, p
, 0);
1048 static HRESULT WINAPI
HTMLStyle_put_backgroundImage(IHTMLStyle
*iface
, BSTR v
)
1050 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1052 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1054 return set_style_attr(This
, STYLEID_BACKGROUND_IMAGE
, v
, ATTR_FIX_URL
);
1057 static HRESULT WINAPI
HTMLStyle_get_backgroundImage(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_IMAGE
, p
);
1066 static HRESULT WINAPI
HTMLStyle_put_backgroundRepeat(IHTMLStyle
*iface
, BSTR v
)
1068 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1069 static const WCHAR styleRepeat
[] = {'r','e','p','e','a','t',0};
1070 static const WCHAR styleNoRepeat
[] = {'n','o','-','r','e','p','e','a','t',0};
1071 static const WCHAR styleRepeatX
[] = {'r','e','p','e','a','t','-','x',0};
1072 static const WCHAR styleRepeatY
[] = {'r','e','p','e','a','t','-','y',0};
1074 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1076 /* fontWeight can only be one of the following */
1077 if(!v
|| strcmpiW(styleRepeat
, v
) == 0 || strcmpiW(styleNoRepeat
, v
) == 0 ||
1078 strcmpiW(styleRepeatX
, v
) == 0 || strcmpiW(styleRepeatY
, v
) == 0 )
1080 return set_style_attr(This
, STYLEID_BACKGROUND_REPEAT
, v
, 0);
1083 return E_INVALIDARG
;
1086 static HRESULT WINAPI
HTMLStyle_get_backgroundRepeat(IHTMLStyle
*iface
, BSTR
*p
)
1088 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1090 TRACE("(%p)->(%p)\n", This
, p
);
1092 return get_style_attr(This
, STYLEID_BACKGROUND_REPEAT
, p
);
1095 static HRESULT WINAPI
HTMLStyle_put_backgroundAttachment(IHTMLStyle
*iface
, BSTR v
)
1097 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1099 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1101 return set_style_attr(This
, STYLEID_BACKGROUND_ATTACHMENT
, v
, 0);
1104 static HRESULT WINAPI
HTMLStyle_get_backgroundAttachment(IHTMLStyle
*iface
, BSTR
*p
)
1106 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1108 TRACE("(%p)->(%p)\n", This
, p
);
1110 return get_style_attr(This
, STYLEID_BACKGROUND_ATTACHMENT
, p
);
1113 static HRESULT WINAPI
HTMLStyle_put_backgroundPosition(IHTMLStyle
*iface
, BSTR v
)
1115 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1117 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1119 return set_style_attr(This
, STYLEID_BACKGROUND_POSITION
, v
, 0);
1122 static HRESULT WINAPI
HTMLStyle_get_backgroundPosition(IHTMLStyle
*iface
, BSTR
*p
)
1124 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1126 TRACE("(%p)->(%p)\n", This
, p
);
1128 return get_style_attr(This
, STYLEID_BACKGROUND_POSITION
, p
);
1131 static HRESULT WINAPI
HTMLStyle_put_backgroundPositionX(IHTMLStyle
*iface
, VARIANT v
)
1133 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1134 WCHAR buf
[14], *pos_val
;
1140 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1142 hres
= var_to_styleval(&v
, buf
, ATTR_FIX_PX
, &val
);
1146 val_len
= val
? strlenW(val
) : 0;
1148 nsAString_Init(&pos_str
, NULL
);
1149 hres
= get_nsstyle_attr_nsval(This
->nsstyle
, STYLEID_BACKGROUND_POSITION
, &pos_str
);
1150 if(SUCCEEDED(hres
)) {
1151 const PRUnichar
*pos
, *posy
;
1154 nsAString_GetData(&pos_str
, &pos
);
1155 posy
= strchrW(pos
, ' ');
1157 static const WCHAR zero_pxW
[] = {' ','0','p','x',0};
1159 TRACE("no space in %s\n", debugstr_w(pos
));
1163 posy_len
= strlenW(posy
);
1164 pos_val
= heap_alloc((val_len
+posy_len
+1)*sizeof(WCHAR
));
1167 memcpy(pos_val
, val
, val_len
*sizeof(WCHAR
));
1169 memcpy(pos_val
+val_len
, posy
, posy_len
*sizeof(WCHAR
));
1170 pos_val
[val_len
+posy_len
] = 0;
1172 hres
= E_OUTOFMEMORY
;
1175 nsAString_Finish(&pos_str
);
1179 TRACE("setting position to %s\n", debugstr_w(pos_val
));
1180 hres
= set_nsstyle_attr(This
->nsstyle
, STYLEID_BACKGROUND_POSITION
, pos_val
, ATTR_FIX_PX
);
1185 static HRESULT WINAPI
HTMLStyle_get_backgroundPositionX(IHTMLStyle
*iface
, VARIANT
*p
)
1187 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1192 TRACE("(%p)->(%p)\n", This
, p
);
1194 nsAString_Init(&pos_str
, NULL
);
1195 hres
= get_nsstyle_attr_nsval(This
->nsstyle
, STYLEID_BACKGROUND_POSITION
, &pos_str
);
1196 if(SUCCEEDED(hres
)) {
1197 const PRUnichar
*pos
, *space
;
1199 nsAString_GetData(&pos_str
, &pos
);
1200 space
= strchrW(pos
, ' ');
1202 WARN("no space in %s\n", debugstr_w(pos
));
1203 space
= pos
+ strlenW(pos
);
1207 ret
= SysAllocStringLen(pos
, space
-pos
);
1209 hres
= E_OUTOFMEMORY
;
1214 nsAString_Finish(&pos_str
);
1218 TRACE("returning %s\n", debugstr_w(ret
));
1224 static HRESULT WINAPI
HTMLStyle_put_backgroundPositionY(IHTMLStyle
*iface
, VARIANT v
)
1226 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1227 WCHAR buf
[14], *pos_val
;
1233 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1235 hres
= var_to_styleval(&v
, buf
, ATTR_FIX_PX
, &val
);
1239 val_len
= val
? strlenW(val
) : 0;
1241 nsAString_Init(&pos_str
, NULL
);
1242 hres
= get_nsstyle_attr_nsval(This
->nsstyle
, STYLEID_BACKGROUND_POSITION
, &pos_str
);
1243 if(SUCCEEDED(hres
)) {
1244 const PRUnichar
*pos
, *space
;
1247 nsAString_GetData(&pos_str
, &pos
);
1248 space
= strchrW(pos
, ' ');
1252 static const WCHAR zero_pxW
[] = {'0','p','x',' ',0};
1254 TRACE("no space in %s\n", debugstr_w(pos
));
1256 space
= pos
+ ARRAY_SIZE(zero_pxW
)-1;
1259 posx_len
= space
-pos
;
1261 pos_val
= heap_alloc((posx_len
+val_len
+1)*sizeof(WCHAR
));
1263 memcpy(pos_val
, pos
, posx_len
*sizeof(WCHAR
));
1265 memcpy(pos_val
+posx_len
, val
, val_len
*sizeof(WCHAR
));
1266 pos_val
[posx_len
+val_len
] = 0;
1268 hres
= E_OUTOFMEMORY
;
1271 nsAString_Finish(&pos_str
);
1275 TRACE("setting position to %s\n", debugstr_w(pos_val
));
1276 hres
= set_nsstyle_attr(This
->nsstyle
, STYLEID_BACKGROUND_POSITION
, pos_val
, ATTR_FIX_PX
);
1281 static HRESULT WINAPI
HTMLStyle_get_backgroundPositionY(IHTMLStyle
*iface
, VARIANT
*p
)
1283 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1288 TRACE("(%p)->(%p)\n", This
, p
);
1290 nsAString_Init(&pos_str
, NULL
);
1291 hres
= get_nsstyle_attr_nsval(This
->nsstyle
, STYLEID_BACKGROUND_POSITION
, &pos_str
);
1292 if(SUCCEEDED(hres
)) {
1293 const PRUnichar
*pos
, *posy
;
1295 nsAString_GetData(&pos_str
, &pos
);
1296 posy
= strchrW(pos
, ' ');
1298 ret
= SysAllocString(posy
+1);
1300 hres
= E_OUTOFMEMORY
;
1305 nsAString_Finish(&pos_str
);
1309 TRACE("returning %s\n", debugstr_w(ret
));
1315 static HRESULT WINAPI
HTMLStyle_put_wordSpacing(IHTMLStyle
*iface
, VARIANT v
)
1317 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1319 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1321 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_WORD_SPACING
, &v
, 0);
1324 static HRESULT WINAPI
HTMLStyle_get_wordSpacing(IHTMLStyle
*iface
, VARIANT
*p
)
1326 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1327 TRACE("(%p)->(%p)\n", This
, p
);
1328 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_WORD_SPACING
, p
, 0);
1331 static HRESULT WINAPI
HTMLStyle_put_letterSpacing(IHTMLStyle
*iface
, VARIANT v
)
1333 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1335 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1337 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_LETTER_SPACING
, &v
, 0);
1340 static HRESULT WINAPI
HTMLStyle_get_letterSpacing(IHTMLStyle
*iface
, VARIANT
*p
)
1342 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1343 TRACE("(%p)->(%p)\n", This
, p
);
1344 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_LETTER_SPACING
, p
, 0);
1347 static HRESULT WINAPI
HTMLStyle_put_textDecoration(IHTMLStyle
*iface
, BSTR v
)
1349 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1351 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1353 /* textDecoration can only be one of the following */
1354 if(!v
|| strcmpiW(styleNone
, v
) == 0 || strcmpiW(valUnderline
, v
) == 0 ||
1355 strcmpiW(valOverline
, v
) == 0 || strcmpiW(valLineThrough
, v
) == 0 ||
1356 strcmpiW(valBlink
, v
) == 0)
1358 return set_style_attr(This
, STYLEID_TEXT_DECORATION
, v
, 0);
1361 return E_INVALIDARG
;
1364 static HRESULT WINAPI
HTMLStyle_get_textDecoration(IHTMLStyle
*iface
, BSTR
*p
)
1366 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1368 TRACE("(%p)->(%p)\n", This
, p
);
1370 return get_style_attr(This
, STYLEID_TEXT_DECORATION
, p
);
1373 static HRESULT WINAPI
HTMLStyle_put_textDecorationNone(IHTMLStyle
*iface
, VARIANT_BOOL v
)
1375 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1377 TRACE("(%p)->(%x)\n", This
, v
);
1379 return set_style_attr(This
, STYLEID_TEXT_DECORATION
, v
? styleNone
: emptyW
, 0);
1382 static HRESULT WINAPI
HTMLStyle_get_textDecorationNone(IHTMLStyle
*iface
, VARIANT_BOOL
*p
)
1384 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1386 TRACE("(%p)->(%p)\n", This
, p
);
1388 return check_style_attr_value(This
, STYLEID_TEXT_DECORATION
, styleNone
, p
);
1391 static HRESULT WINAPI
HTMLStyle_put_textDecorationUnderline(IHTMLStyle
*iface
, VARIANT_BOOL v
)
1393 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1395 TRACE("(%p)->(%x)\n", This
, v
);
1397 return set_style_attr(This
, STYLEID_TEXT_DECORATION
, v
? valUnderline
: emptyW
, 0);
1400 static HRESULT WINAPI
HTMLStyle_get_textDecorationUnderline(IHTMLStyle
*iface
, VARIANT_BOOL
*p
)
1402 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1404 TRACE("(%p)->(%p)\n", This
, p
);
1406 return check_style_attr_value(This
, STYLEID_TEXT_DECORATION
, valUnderline
, p
);
1409 static HRESULT WINAPI
HTMLStyle_put_textDecorationOverline(IHTMLStyle
*iface
, VARIANT_BOOL v
)
1411 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1413 TRACE("(%p)->(%x)\n", This
, v
);
1415 return set_style_attr(This
, STYLEID_TEXT_DECORATION
, v
? valOverline
: emptyW
, 0);
1418 static HRESULT WINAPI
HTMLStyle_get_textDecorationOverline(IHTMLStyle
*iface
, VARIANT_BOOL
*p
)
1420 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1422 TRACE("(%p)->(%p)\n", This
, p
);
1424 return check_style_attr_value(This
, STYLEID_TEXT_DECORATION
, valOverline
, p
);
1427 static HRESULT WINAPI
HTMLStyle_put_textDecorationLineThrough(IHTMLStyle
*iface
, VARIANT_BOOL v
)
1429 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1431 TRACE("(%p)->(%x)\n", This
, v
);
1433 return set_style_attr(This
, STYLEID_TEXT_DECORATION
, v
? valLineThrough
: emptyW
, 0);
1436 static HRESULT WINAPI
HTMLStyle_get_textDecorationLineThrough(IHTMLStyle
*iface
, VARIANT_BOOL
*p
)
1438 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1440 TRACE("(%p)->(%p)\n", This
, p
);
1442 return check_style_attr_value(This
, STYLEID_TEXT_DECORATION
, valLineThrough
, p
);
1445 static HRESULT WINAPI
HTMLStyle_put_textDecorationBlink(IHTMLStyle
*iface
, VARIANT_BOOL v
)
1447 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1449 TRACE("(%p)->(%x)\n", This
, v
);
1451 return set_style_attr(This
, STYLEID_TEXT_DECORATION
, v
? valBlink
: emptyW
, 0);
1454 static HRESULT WINAPI
HTMLStyle_get_textDecorationBlink(IHTMLStyle
*iface
, VARIANT_BOOL
*p
)
1456 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1458 TRACE("(%p)->(%p)\n", This
, p
);
1460 return check_style_attr_value(This
, STYLEID_TEXT_DECORATION
, valBlink
, p
);
1463 static HRESULT WINAPI
HTMLStyle_put_verticalAlign(IHTMLStyle
*iface
, VARIANT v
)
1465 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1467 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1469 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_VERTICAL_ALIGN
, &v
, ATTR_FIX_PX
);
1472 static HRESULT WINAPI
HTMLStyle_get_verticalAlign(IHTMLStyle
*iface
, VARIANT
*p
)
1474 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1476 TRACE("(%p)->(%p)\n", This
, p
);
1478 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_VERTICAL_ALIGN
, p
, 0);
1481 static HRESULT WINAPI
HTMLStyle_put_textTransform(IHTMLStyle
*iface
, BSTR v
)
1483 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1485 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1487 return set_style_attr(This
, STYLEID_TEXT_TRANSFORM
, v
, 0);
1490 static HRESULT WINAPI
HTMLStyle_get_textTransform(IHTMLStyle
*iface
, BSTR
*p
)
1492 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1494 TRACE("(%p)->(%p)\n", This
, p
);
1496 return get_style_attr(This
, STYLEID_TEXT_TRANSFORM
, p
);
1499 static HRESULT WINAPI
HTMLStyle_put_textAlign(IHTMLStyle
*iface
, BSTR v
)
1501 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1503 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1505 return set_style_attr(This
, STYLEID_TEXT_ALIGN
, v
, 0);
1508 static HRESULT WINAPI
HTMLStyle_get_textAlign(IHTMLStyle
*iface
, BSTR
*p
)
1510 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1512 TRACE("(%p)->(%p)\n", This
, p
);
1514 return get_style_attr(This
, STYLEID_TEXT_ALIGN
, p
);
1517 static HRESULT WINAPI
HTMLStyle_put_textIndent(IHTMLStyle
*iface
, VARIANT v
)
1519 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1521 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1523 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_TEXT_INDENT
, &v
, ATTR_FIX_PX
);
1526 static HRESULT WINAPI
HTMLStyle_get_textIndent(IHTMLStyle
*iface
, VARIANT
*p
)
1528 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1530 TRACE("(%p)->(%p)\n", This
, p
);
1532 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_TEXT_INDENT
, p
, 0);
1535 static HRESULT WINAPI
HTMLStyle_put_lineHeight(IHTMLStyle
*iface
, VARIANT v
)
1537 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1539 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1541 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_LINE_HEIGHT
, &v
, 0);
1544 static HRESULT WINAPI
HTMLStyle_get_lineHeight(IHTMLStyle
*iface
, VARIANT
*p
)
1546 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1548 TRACE("(%p)->(%p)\n", This
, p
);
1550 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_LINE_HEIGHT
, p
, 0);
1553 static HRESULT WINAPI
HTMLStyle_put_marginTop(IHTMLStyle
*iface
, VARIANT v
)
1555 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1557 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1559 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_MARGIN_TOP
, &v
, ATTR_FIX_PX
);
1562 static HRESULT WINAPI
HTMLStyle_get_marginTop(IHTMLStyle
*iface
, VARIANT
*p
)
1564 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1566 TRACE("(%p)->(%p)\n", This
, p
);
1568 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_MARGIN_TOP
, p
, 0);
1571 static HRESULT WINAPI
HTMLStyle_put_marginRight(IHTMLStyle
*iface
, VARIANT v
)
1573 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1575 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1577 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_MARGIN_RIGHT
, &v
, ATTR_FIX_PX
);
1580 static HRESULT WINAPI
HTMLStyle_get_marginRight(IHTMLStyle
*iface
, VARIANT
*p
)
1582 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1583 TRACE("(%p)->(%p)\n", This
, p
);
1584 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_MARGIN_RIGHT
, p
, 0);
1587 static HRESULT WINAPI
HTMLStyle_put_marginBottom(IHTMLStyle
*iface
, VARIANT v
)
1589 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1591 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1593 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_MARGIN_BOTTOM
, &v
, ATTR_FIX_PX
);
1596 static HRESULT WINAPI
HTMLStyle_get_marginBottom(IHTMLStyle
*iface
, VARIANT
*p
)
1598 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1600 TRACE("(%p)->(%p)\n", This
, p
);
1602 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_MARGIN_BOTTOM
, p
, 0);
1605 static HRESULT WINAPI
HTMLStyle_put_marginLeft(IHTMLStyle
*iface
, VARIANT v
)
1607 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1609 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1611 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_MARGIN_LEFT
, &v
, ATTR_FIX_PX
);
1614 static HRESULT WINAPI
HTMLStyle_put_margin(IHTMLStyle
*iface
, BSTR v
)
1616 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1618 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1620 return set_style_attr(This
, STYLEID_MARGIN
, v
, 0);
1623 static HRESULT WINAPI
HTMLStyle_get_margin(IHTMLStyle
*iface
, BSTR
*p
)
1625 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1627 TRACE("(%p)->(%p)\n", This
, p
);
1629 return get_style_attr(This
, STYLEID_MARGIN
, p
);
1632 static HRESULT WINAPI
HTMLStyle_get_marginLeft(IHTMLStyle
*iface
, VARIANT
*p
)
1634 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1635 TRACE("(%p)->(%p)\n", This
, p
);
1636 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_MARGIN_LEFT
, p
, 0);
1639 static HRESULT WINAPI
HTMLStyle_put_paddingTop(IHTMLStyle
*iface
, VARIANT v
)
1641 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1643 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1645 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_PADDING_TOP
, &v
, ATTR_FIX_PX
);
1648 static HRESULT WINAPI
HTMLStyle_get_paddingTop(IHTMLStyle
*iface
, VARIANT
*p
)
1650 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1652 TRACE("(%p)->(%p)\n", This
, p
);
1654 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_PADDING_TOP
, p
, 0);
1657 static HRESULT WINAPI
HTMLStyle_put_paddingRight(IHTMLStyle
*iface
, VARIANT v
)
1659 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1661 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1663 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_PADDING_RIGHT
, &v
, ATTR_FIX_PX
);
1666 static HRESULT WINAPI
HTMLStyle_get_paddingRight(IHTMLStyle
*iface
, VARIANT
*p
)
1668 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1670 TRACE("(%p)->(%p)\n", This
, p
);
1672 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_PADDING_RIGHT
, p
, 0);
1675 static HRESULT WINAPI
HTMLStyle_put_paddingBottom(IHTMLStyle
*iface
, VARIANT v
)
1677 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1679 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1681 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_PADDING_BOTTOM
, &v
, ATTR_FIX_PX
);
1684 static HRESULT WINAPI
HTMLStyle_get_paddingBottom(IHTMLStyle
*iface
, VARIANT
*p
)
1686 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1688 TRACE("(%p)->(%p)\n", This
, p
);
1690 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_PADDING_BOTTOM
, p
, 0);
1693 static HRESULT WINAPI
HTMLStyle_put_paddingLeft(IHTMLStyle
*iface
, VARIANT v
)
1695 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1697 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1699 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_PADDING_LEFT
, &v
, ATTR_FIX_PX
);
1702 static HRESULT WINAPI
HTMLStyle_get_paddingLeft(IHTMLStyle
*iface
, VARIANT
*p
)
1704 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1706 TRACE("(%p)->(%p)\n", This
, p
);
1708 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_PADDING_LEFT
, p
, 0);
1711 static HRESULT WINAPI
HTMLStyle_put_padding(IHTMLStyle
*iface
, BSTR v
)
1713 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1715 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1717 return set_style_attr(This
, STYLEID_PADDING
, v
, 0);
1720 static HRESULT WINAPI
HTMLStyle_get_padding(IHTMLStyle
*iface
, BSTR
*p
)
1722 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1724 TRACE("(%p)->(%p)\n", This
, p
);
1726 return get_style_attr(This
, STYLEID_PADDING
, p
);
1729 static HRESULT WINAPI
HTMLStyle_put_border(IHTMLStyle
*iface
, BSTR v
)
1731 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1733 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1735 return set_style_attr(This
, STYLEID_BORDER
, v
, 0);
1738 static HRESULT WINAPI
HTMLStyle_get_border(IHTMLStyle
*iface
, BSTR
*p
)
1740 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1742 TRACE("(%p)->(%p)\n", This
, p
);
1744 return get_style_attr(This
, STYLEID_BORDER
, p
);
1747 static HRESULT WINAPI
HTMLStyle_put_borderTop(IHTMLStyle
*iface
, BSTR v
)
1749 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1750 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1751 return set_style_attr(This
, STYLEID_BORDER_TOP
, v
, ATTR_FIX_PX
);
1754 static HRESULT WINAPI
HTMLStyle_get_borderTop(IHTMLStyle
*iface
, BSTR
*p
)
1756 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1757 TRACE("(%p)->(%p)\n", This
, p
);
1758 return get_style_attr(This
, STYLEID_BORDER_TOP
, p
);
1761 static HRESULT WINAPI
HTMLStyle_put_borderRight(IHTMLStyle
*iface
, BSTR v
)
1763 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1764 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1765 return set_style_attr(This
, STYLEID_BORDER_RIGHT
, v
, ATTR_FIX_PX
);
1768 static HRESULT WINAPI
HTMLStyle_get_borderRight(IHTMLStyle
*iface
, BSTR
*p
)
1770 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1771 TRACE("(%p)->(%p)\n", This
, p
);
1772 return get_style_attr(This
, STYLEID_BORDER_RIGHT
, p
);
1775 static HRESULT WINAPI
HTMLStyle_put_borderBottom(IHTMLStyle
*iface
, BSTR v
)
1777 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1778 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1779 return set_style_attr(This
, STYLEID_BORDER_BOTTOM
, v
, ATTR_FIX_PX
);
1782 static HRESULT WINAPI
HTMLStyle_get_borderBottom(IHTMLStyle
*iface
, BSTR
*p
)
1784 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1785 TRACE("(%p)->(%p)\n", This
, p
);
1786 return get_style_attr(This
, STYLEID_BORDER_BOTTOM
, p
);
1789 static HRESULT WINAPI
HTMLStyle_put_borderLeft(IHTMLStyle
*iface
, BSTR v
)
1791 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1793 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1795 return set_style_attr(This
, STYLEID_BORDER_LEFT
, v
, ATTR_FIX_PX
);
1798 static HRESULT WINAPI
HTMLStyle_get_borderLeft(IHTMLStyle
*iface
, BSTR
*p
)
1800 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1802 TRACE("(%p)->(%p)\n", This
, p
);
1804 return get_style_attr(This
, STYLEID_BORDER_LEFT
, p
);
1807 static HRESULT WINAPI
HTMLStyle_put_borderColor(IHTMLStyle
*iface
, BSTR v
)
1809 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1811 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1813 return set_style_attr(This
, STYLEID_BORDER_COLOR
, v
, 0);
1816 static HRESULT WINAPI
HTMLStyle_get_borderColor(IHTMLStyle
*iface
, BSTR
*p
)
1818 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1820 TRACE("(%p)->(%p)\n", This
, p
);
1822 return get_style_attr(This
, STYLEID_BORDER_COLOR
, p
);
1825 static HRESULT WINAPI
HTMLStyle_put_borderTopColor(IHTMLStyle
*iface
, VARIANT v
)
1827 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1829 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1831 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_TOP_COLOR
, &v
, ATTR_HEX_INT
);
1834 static HRESULT WINAPI
HTMLStyle_get_borderTopColor(IHTMLStyle
*iface
, VARIANT
*p
)
1836 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1838 TRACE("(%p)->(%p)\n", This
, p
);
1840 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_TOP_COLOR
, p
, 0);
1843 static HRESULT WINAPI
HTMLStyle_put_borderRightColor(IHTMLStyle
*iface
, VARIANT v
)
1845 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1847 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1849 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_RIGHT_COLOR
, &v
, ATTR_HEX_INT
);
1852 static HRESULT WINAPI
HTMLStyle_get_borderRightColor(IHTMLStyle
*iface
, VARIANT
*p
)
1854 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1856 TRACE("(%p)->(%p)\n", This
, p
);
1858 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_RIGHT_COLOR
, p
, 0);
1861 static HRESULT WINAPI
HTMLStyle_put_borderBottomColor(IHTMLStyle
*iface
, VARIANT v
)
1863 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1865 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1867 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_BOTTOM_COLOR
, &v
, ATTR_HEX_INT
);
1870 static HRESULT WINAPI
HTMLStyle_get_borderBottomColor(IHTMLStyle
*iface
, VARIANT
*p
)
1872 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1874 TRACE("(%p)->(%p)\n", This
, p
);
1876 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_BOTTOM_COLOR
, p
, 0);
1879 static HRESULT WINAPI
HTMLStyle_put_borderLeftColor(IHTMLStyle
*iface
, VARIANT v
)
1881 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1883 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1885 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_LEFT_COLOR
, &v
, ATTR_HEX_INT
);
1888 static HRESULT WINAPI
HTMLStyle_get_borderLeftColor(IHTMLStyle
*iface
, VARIANT
*p
)
1890 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1892 TRACE("(%p)->(%p)\n", This
, p
);
1894 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_LEFT_COLOR
, p
, 0);
1897 static HRESULT WINAPI
HTMLStyle_put_borderWidth(IHTMLStyle
*iface
, BSTR v
)
1899 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1900 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1901 return set_style_attr(This
, STYLEID_BORDER_WIDTH
, v
, ATTR_FIX_PX
);
1904 static HRESULT WINAPI
HTMLStyle_get_borderWidth(IHTMLStyle
*iface
, BSTR
*p
)
1906 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1907 TRACE("(%p)->(%p)\n", This
, p
);
1908 return get_style_attr(This
, STYLEID_BORDER_WIDTH
, p
);
1911 static HRESULT WINAPI
HTMLStyle_put_borderTopWidth(IHTMLStyle
*iface
, VARIANT v
)
1913 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1915 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1917 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_TOP_WIDTH
, &v
, 0);
1920 static HRESULT WINAPI
HTMLStyle_get_borderTopWidth(IHTMLStyle
*iface
, VARIANT
*p
)
1922 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1924 TRACE("(%p)->(%p)\n", This
, p
);
1926 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_TOP_WIDTH
, p
, 0);
1929 static HRESULT WINAPI
HTMLStyle_put_borderRightWidth(IHTMLStyle
*iface
, VARIANT v
)
1931 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1933 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1935 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_RIGHT_WIDTH
, &v
, 0);
1938 static HRESULT WINAPI
HTMLStyle_get_borderRightWidth(IHTMLStyle
*iface
, VARIANT
*p
)
1940 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1942 TRACE("(%p)->(%p)\n", This
, p
);
1944 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_RIGHT_WIDTH
, p
, 0);
1947 static HRESULT WINAPI
HTMLStyle_put_borderBottomWidth(IHTMLStyle
*iface
, VARIANT v
)
1949 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1951 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1953 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_BOTTOM_WIDTH
, &v
, 0);
1956 static HRESULT WINAPI
HTMLStyle_get_borderBottomWidth(IHTMLStyle
*iface
, VARIANT
*p
)
1958 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1959 TRACE("(%p)->(%p)\n", This
, p
);
1960 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_BOTTOM_WIDTH
, p
, 0);
1963 static HRESULT WINAPI
HTMLStyle_put_borderLeftWidth(IHTMLStyle
*iface
, VARIANT v
)
1965 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1967 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1969 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_LEFT_WIDTH
, &v
, 0);
1972 static HRESULT WINAPI
HTMLStyle_get_borderLeftWidth(IHTMLStyle
*iface
, VARIANT
*p
)
1974 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1975 TRACE("(%p)->(%p)\n", This
, p
);
1976 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_LEFT_WIDTH
, p
, 0);
1979 static HRESULT WINAPI
HTMLStyle_put_borderStyle(IHTMLStyle
*iface
, BSTR v
)
1981 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
1982 static const WCHAR styleWindowInset
[] = {'w','i','n','d','o','w','-','i','n','s','e','t',0};
1983 HRESULT hres
= S_OK
;
1988 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1990 while(v
[i
] && hres
== S_OK
)
1992 if(v
[i
] == (WCHAR
)' ')
1994 pstyle
= SysAllocStringLen(&v
[last
], (i
-last
));
1995 if( !(is_valid_border_style(pstyle
) || strcmpiW(styleWindowInset
, pstyle
) == 0))
1997 TRACE("1. Invalid style (%s)\n", debugstr_w(pstyle
));
1998 hres
= E_INVALIDARG
;
2000 SysFreeString(pstyle
);
2008 pstyle
= SysAllocStringLen(&v
[last
], i
-last
);
2009 if( !(is_valid_border_style(pstyle
) || strcmpiW(styleWindowInset
, pstyle
) == 0))
2011 TRACE("2. Invalid style (%s)\n", debugstr_w(pstyle
));
2012 hres
= E_INVALIDARG
;
2014 SysFreeString(pstyle
);
2018 hres
= set_nsstyle_attr(This
->nsstyle
, STYLEID_BORDER_STYLE
, v
, 0);
2023 static HRESULT WINAPI
HTMLStyle_get_borderStyle(IHTMLStyle
*iface
, BSTR
*p
)
2025 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2026 TRACE("(%p)->(%p)\n", This
, p
);
2027 return get_style_attr(This
, STYLEID_BORDER_STYLE
, p
);
2030 static HRESULT WINAPI
HTMLStyle_put_borderTopStyle(IHTMLStyle
*iface
, BSTR v
)
2032 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2033 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2035 if(!is_valid_border_style(v
))
2036 return E_INVALIDARG
;
2038 return set_style_attr(This
, STYLEID_BORDER_TOP_STYLE
, v
, 0);
2041 static HRESULT WINAPI
HTMLStyle_get_borderTopStyle(IHTMLStyle
*iface
, BSTR
*p
)
2043 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2044 TRACE("(%p)->(%p)\n", This
, p
);
2045 return get_style_attr(This
, STYLEID_BORDER_TOP_STYLE
, p
);
2048 static HRESULT WINAPI
HTMLStyle_put_borderRightStyle(IHTMLStyle
*iface
, BSTR v
)
2050 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2051 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2053 if(!is_valid_border_style(v
))
2054 return E_INVALIDARG
;
2056 return set_style_attr(This
, STYLEID_BORDER_RIGHT_STYLE
, v
, 0);
2059 static HRESULT WINAPI
HTMLStyle_get_borderRightStyle(IHTMLStyle
*iface
, BSTR
*p
)
2061 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2062 TRACE("(%p)->(%p)\n", This
, p
);
2063 return get_style_attr(This
, STYLEID_BORDER_RIGHT_STYLE
, p
);
2066 static HRESULT WINAPI
HTMLStyle_put_borderBottomStyle(IHTMLStyle
*iface
, BSTR v
)
2068 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2069 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2071 if(!is_valid_border_style(v
))
2072 return E_INVALIDARG
;
2074 return set_style_attr(This
, STYLEID_BORDER_BOTTOM_STYLE
, v
, 0);
2077 static HRESULT WINAPI
HTMLStyle_get_borderBottomStyle(IHTMLStyle
*iface
, BSTR
*p
)
2079 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2080 TRACE("(%p)->(%p)\n", This
, p
);
2081 return get_style_attr(This
, STYLEID_BORDER_BOTTOM_STYLE
, p
);
2084 static HRESULT WINAPI
HTMLStyle_put_borderLeftStyle(IHTMLStyle
*iface
, BSTR v
)
2086 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2087 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2089 if(!is_valid_border_style(v
))
2090 return E_INVALIDARG
;
2092 return set_style_attr(This
, STYLEID_BORDER_LEFT_STYLE
, v
, 0);
2095 static HRESULT WINAPI
HTMLStyle_get_borderLeftStyle(IHTMLStyle
*iface
, BSTR
*p
)
2097 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2098 TRACE("(%p)->(%p)\n", This
, p
);
2099 return get_style_attr(This
, STYLEID_BORDER_LEFT_STYLE
, p
);
2102 static HRESULT WINAPI
HTMLStyle_put_width(IHTMLStyle
*iface
, VARIANT v
)
2104 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2106 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2108 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_WIDTH
, &v
, ATTR_FIX_PX
);
2111 static HRESULT WINAPI
HTMLStyle_get_width(IHTMLStyle
*iface
, VARIANT
*p
)
2113 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2115 TRACE("(%p)->(%p)\n", This
, p
);
2117 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_WIDTH
, p
, 0);
2120 static HRESULT WINAPI
HTMLStyle_put_height(IHTMLStyle
*iface
, VARIANT v
)
2122 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2124 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2126 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_HEIGHT
, &v
, ATTR_FIX_PX
);
2129 static HRESULT WINAPI
HTMLStyle_get_height(IHTMLStyle
*iface
, VARIANT
*p
)
2131 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2133 TRACE("(%p)->(%p)\n", This
, p
);
2135 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_HEIGHT
, p
, 0);
2138 static HRESULT WINAPI
HTMLStyle_put_styleFloat(IHTMLStyle
*iface
, BSTR v
)
2140 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2142 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2144 return set_style_attr(This
, STYLEID_FLOAT
, v
, 0);
2147 static HRESULT WINAPI
HTMLStyle_get_styleFloat(IHTMLStyle
*iface
, BSTR
*p
)
2149 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2151 TRACE("(%p)->(%p)\n", This
, p
);
2153 return get_style_attr(This
, STYLEID_FLOAT
, p
);
2156 static HRESULT WINAPI
HTMLStyle_put_clear(IHTMLStyle
*iface
, BSTR v
)
2158 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2160 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2162 return set_style_attr(This
, STYLEID_CLEAR
, v
, 0);
2165 static HRESULT WINAPI
HTMLStyle_get_clear(IHTMLStyle
*iface
, BSTR
*p
)
2167 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2169 TRACE("(%p)->(%p)\n", This
, p
);
2171 return get_style_attr(This
, STYLEID_CLEAR
, p
);
2174 static HRESULT WINAPI
HTMLStyle_put_display(IHTMLStyle
*iface
, BSTR v
)
2176 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2178 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2180 return set_style_attr(This
, STYLEID_DISPLAY
, v
, 0);
2183 static HRESULT WINAPI
HTMLStyle_get_display(IHTMLStyle
*iface
, BSTR
*p
)
2185 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2187 TRACE("(%p)->(%p)\n", This
, p
);
2189 return get_style_attr(This
, STYLEID_DISPLAY
, p
);
2192 static HRESULT WINAPI
HTMLStyle_put_visibility(IHTMLStyle
*iface
, BSTR v
)
2194 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2196 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2198 return set_style_attr(This
, STYLEID_VISIBILITY
, v
, 0);
2201 static HRESULT WINAPI
HTMLStyle_get_visibility(IHTMLStyle
*iface
, BSTR
*p
)
2203 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2205 TRACE("(%p)->(%p)\n", This
, p
);
2207 return get_style_attr(This
, STYLEID_VISIBILITY
, p
);
2210 static HRESULT WINAPI
HTMLStyle_put_listStyleType(IHTMLStyle
*iface
, BSTR v
)
2212 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2214 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2216 return set_style_attr(This
, STYLEID_LISTSTYLETYPE
, v
, 0);
2219 static HRESULT WINAPI
HTMLStyle_get_listStyleType(IHTMLStyle
*iface
, BSTR
*p
)
2221 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2223 TRACE("(%p)->(%p)\n", This
, p
);
2225 return get_style_attr(This
, STYLEID_LISTSTYLETYPE
, p
);
2228 static HRESULT WINAPI
HTMLStyle_put_listStylePosition(IHTMLStyle
*iface
, BSTR v
)
2230 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2232 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2234 return set_style_attr(This
, STYLEID_LISTSTYLEPOSITION
, v
, 0);
2237 static HRESULT WINAPI
HTMLStyle_get_listStylePosition(IHTMLStyle
*iface
, BSTR
*p
)
2239 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2241 TRACE("(%p)->(%p)\n", This
, p
);
2243 return get_style_attr(This
, STYLEID_LISTSTYLEPOSITION
, p
);
2246 static HRESULT WINAPI
HTMLStyle_put_listStyleImage(IHTMLStyle
*iface
, BSTR v
)
2248 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2249 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
2253 static HRESULT WINAPI
HTMLStyle_get_listStyleImage(IHTMLStyle
*iface
, BSTR
*p
)
2255 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2256 FIXME("(%p)->(%p)\n", This
, p
);
2260 static HRESULT WINAPI
HTMLStyle_put_listStyle(IHTMLStyle
*iface
, BSTR v
)
2262 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2264 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2266 return set_style_attr(This
, STYLEID_LIST_STYLE
, v
, 0);
2269 static HRESULT WINAPI
HTMLStyle_get_listStyle(IHTMLStyle
*iface
, BSTR
*p
)
2271 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2273 TRACE("(%p)->(%p)\n", This
, p
);
2275 return get_style_attr(This
, STYLEID_LIST_STYLE
, p
);
2278 static HRESULT WINAPI
HTMLStyle_put_whiteSpace(IHTMLStyle
*iface
, BSTR v
)
2280 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2282 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2284 return set_nsstyle_attr(This
->nsstyle
, STYLEID_WHITE_SPACE
, v
, 0);
2287 static HRESULT WINAPI
HTMLStyle_get_whiteSpace(IHTMLStyle
*iface
, BSTR
*p
)
2289 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2291 TRACE("(%p)->(%p)\n", This
, p
);
2293 return get_nsstyle_attr(This
->nsstyle
, STYLEID_WHITE_SPACE
, p
, 0);
2296 static HRESULT WINAPI
HTMLStyle_put_top(IHTMLStyle
*iface
, VARIANT v
)
2298 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2300 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2302 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_TOP
, &v
, 0);
2305 static HRESULT WINAPI
HTMLStyle_get_top(IHTMLStyle
*iface
, VARIANT
*p
)
2307 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2309 TRACE("(%p)->(%p)\n", This
, p
);
2311 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_TOP
, p
, 0);
2314 static HRESULT WINAPI
HTMLStyle_put_left(IHTMLStyle
*iface
, VARIANT v
)
2316 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2318 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2320 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_LEFT
, &v
, 0);
2323 static HRESULT WINAPI
HTMLStyle_get_left(IHTMLStyle
*iface
, VARIANT
*p
)
2325 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2327 TRACE("(%p)->(%p)\n", This
, p
);
2329 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_LEFT
, p
, 0);
2332 static HRESULT WINAPI
HTMLStyle_get_position(IHTMLStyle
*iface
, BSTR
*p
)
2334 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2335 TRACE("(%p)->(%p)\n", This
, p
);
2336 return IHTMLStyle2_get_position(&This
->IHTMLStyle2_iface
, p
);
2339 static HRESULT WINAPI
HTMLStyle_put_zIndex(IHTMLStyle
*iface
, VARIANT v
)
2341 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2343 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2345 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_Z_INDEX
, &v
, 0);
2348 static HRESULT WINAPI
HTMLStyle_get_zIndex(IHTMLStyle
*iface
, VARIANT
*p
)
2350 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2352 TRACE("(%p)->(%p)\n", This
, p
);
2354 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_Z_INDEX
, p
, ATTR_STR_TO_INT
);
2357 static HRESULT WINAPI
HTMLStyle_put_overflow(IHTMLStyle
*iface
, BSTR v
)
2359 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2360 static const WCHAR szVisible
[] = {'v','i','s','i','b','l','e',0};
2361 static const WCHAR szScroll
[] = {'s','c','r','o','l','l',0};
2362 static const WCHAR szHidden
[] = {'h','i','d','d','e','n',0};
2363 static const WCHAR szAuto
[] = {'a','u','t','o',0};
2365 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2367 /* overflow can only be one of the follow values. */
2368 if(!v
|| !*v
|| strcmpiW(szVisible
, v
) == 0 || strcmpiW(szScroll
, v
) == 0 ||
2369 strcmpiW(szHidden
, v
) == 0 || strcmpiW(szAuto
, v
) == 0)
2371 return set_nsstyle_attr(This
->nsstyle
, STYLEID_OVERFLOW
, v
, 0);
2374 return E_INVALIDARG
;
2378 static HRESULT WINAPI
HTMLStyle_get_overflow(IHTMLStyle
*iface
, BSTR
*p
)
2380 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2382 TRACE("(%p)->(%p)\n", This
, p
);
2385 return E_INVALIDARG
;
2387 return get_style_attr(This
, STYLEID_OVERFLOW
, p
);
2390 static HRESULT WINAPI
HTMLStyle_put_pageBreakBefore(IHTMLStyle
*iface
, BSTR v
)
2392 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2394 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2396 return set_nsstyle_attr(This
->nsstyle
, STYLEID_PAGE_BREAK_BEFORE
, v
, 0);
2399 static HRESULT WINAPI
HTMLStyle_get_pageBreakBefore(IHTMLStyle
*iface
, BSTR
*p
)
2401 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2403 TRACE("(%p)->(%p)\n", This
, p
);
2405 return get_nsstyle_attr(This
->nsstyle
, STYLEID_PAGE_BREAK_BEFORE
, p
, 0);
2408 static HRESULT WINAPI
HTMLStyle_put_pageBreakAfter(IHTMLStyle
*iface
, BSTR v
)
2410 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2412 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2414 return set_nsstyle_attr(This
->nsstyle
, STYLEID_PAGE_BREAK_AFTER
, v
, 0);
2417 static HRESULT WINAPI
HTMLStyle_get_pageBreakAfter(IHTMLStyle
*iface
, BSTR
*p
)
2419 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2421 TRACE("(%p)->(%p)\n", This
, p
);
2423 return get_nsstyle_attr(This
->nsstyle
, STYLEID_PAGE_BREAK_AFTER
, p
, 0);
2426 static HRESULT WINAPI
HTMLStyle_put_cssText(IHTMLStyle
*iface
, BSTR v
)
2428 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2432 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2434 nsAString_InitDepend(&text_str
, v
);
2435 nsres
= nsIDOMCSSStyleDeclaration_SetCssText(This
->nsstyle
, &text_str
);
2436 nsAString_Finish(&text_str
);
2437 if(NS_FAILED(nsres
)) {
2438 FIXME("SetCssStyle failed: %08x\n", nsres
);
2445 static HRESULT WINAPI
HTMLStyle_get_cssText(IHTMLStyle
*iface
, BSTR
*p
)
2447 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2451 TRACE("(%p)->(%p)\n", This
, p
);
2453 /* FIXME: Gecko style formatting is different than IE (uppercase). */
2454 nsAString_Init(&text_str
, NULL
);
2455 nsres
= nsIDOMCSSStyleDeclaration_GetCssText(This
->nsstyle
, &text_str
);
2456 if(NS_SUCCEEDED(nsres
)) {
2457 const PRUnichar
*text
;
2459 nsAString_GetData(&text_str
, &text
);
2460 *p
= *text
? SysAllocString(text
) : NULL
;
2462 FIXME("GetCssStyle failed: %08x\n", nsres
);
2466 nsAString_Finish(&text_str
);
2470 static HRESULT WINAPI
HTMLStyle_put_pixelTop(IHTMLStyle
*iface
, LONG v
)
2472 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2474 TRACE("(%p)->(%d)\n", This
, v
);
2476 return set_style_pxattr(This
->nsstyle
, STYLEID_TOP
, v
);
2479 static HRESULT WINAPI
HTMLStyle_get_pixelTop(IHTMLStyle
*iface
, LONG
*p
)
2481 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2483 TRACE("(%p)->(%p)\n", This
, p
);
2485 return get_nsstyle_pixel_val(This
, STYLEID_TOP
, p
);
2488 static HRESULT WINAPI
HTMLStyle_put_pixelLeft(IHTMLStyle
*iface
, LONG v
)
2490 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2492 TRACE("(%p)->(%d)\n", This
, v
);
2494 return set_style_pxattr(This
->nsstyle
, STYLEID_LEFT
, v
);
2497 static HRESULT WINAPI
HTMLStyle_get_pixelLeft(IHTMLStyle
*iface
, LONG
*p
)
2499 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2501 TRACE("(%p)->(%p)\n", This
, p
);
2503 return get_nsstyle_pixel_val(This
, STYLEID_LEFT
, p
);
2506 static HRESULT WINAPI
HTMLStyle_put_pixelWidth(IHTMLStyle
*iface
, LONG v
)
2508 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2510 TRACE("(%p)->()\n", This
);
2512 return set_style_pxattr(This
->nsstyle
, STYLEID_WIDTH
, v
);
2515 static HRESULT WINAPI
HTMLStyle_get_pixelWidth(IHTMLStyle
*iface
, LONG
*p
)
2517 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2519 TRACE("(%p)->(%p)\n", This
, p
);
2521 return get_nsstyle_pixel_val(This
, STYLEID_WIDTH
, p
);
2524 static HRESULT WINAPI
HTMLStyle_put_pixelHeight(IHTMLStyle
*iface
, LONG v
)
2526 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2528 TRACE("(%p)->(%d)\n", This
, v
);
2530 return set_style_pxattr(This
->nsstyle
, STYLEID_HEIGHT
, v
);
2533 static HRESULT WINAPI
HTMLStyle_get_pixelHeight(IHTMLStyle
*iface
, LONG
*p
)
2535 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2537 TRACE("(%p)->(%p)\n", This
, p
);
2539 return get_nsstyle_pixel_val(This
, STYLEID_HEIGHT
, p
);
2542 static HRESULT WINAPI
HTMLStyle_put_posTop(IHTMLStyle
*iface
, float v
)
2544 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2546 TRACE("(%p)->(%f)\n", This
, v
);
2548 return set_style_pos(This
, STYLEID_TOP
, v
);
2551 static HRESULT WINAPI
HTMLStyle_get_posTop(IHTMLStyle
*iface
, float *p
)
2553 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2555 TRACE("(%p)->(%p)\n", This
, p
);
2560 return get_nsstyle_pos(This
, STYLEID_TOP
, p
);
2563 static HRESULT WINAPI
HTMLStyle_put_posLeft(IHTMLStyle
*iface
, float v
)
2565 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2567 TRACE("(%p)->(%f)\n", This
, v
);
2569 return set_style_pos(This
, STYLEID_LEFT
, v
);
2572 static HRESULT WINAPI
HTMLStyle_get_posLeft(IHTMLStyle
*iface
, float *p
)
2574 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2576 TRACE("(%p)->(%p)\n", This
, p
);
2581 return get_nsstyle_pos(This
, STYLEID_LEFT
, p
);
2584 static HRESULT WINAPI
HTMLStyle_put_posWidth(IHTMLStyle
*iface
, float v
)
2586 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2588 TRACE("(%p)->(%f)\n", This
, v
);
2590 return set_style_pos(This
, STYLEID_WIDTH
, v
);
2593 static HRESULT WINAPI
HTMLStyle_get_posWidth(IHTMLStyle
*iface
, float *p
)
2595 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2597 TRACE("(%p)->(%p)\n", This
, p
);
2602 if(get_nsstyle_pos(This
, STYLEID_WIDTH
, p
) != S_OK
)
2608 static HRESULT WINAPI
HTMLStyle_put_posHeight(IHTMLStyle
*iface
, float v
)
2610 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2612 TRACE("(%p)->(%f)\n", This
, v
);
2614 return set_style_pos(This
, STYLEID_HEIGHT
, v
);
2617 static HRESULT WINAPI
HTMLStyle_get_posHeight(IHTMLStyle
*iface
, float *p
)
2619 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2621 TRACE("(%p)->(%p)\n", This
, p
);
2626 if(get_nsstyle_pos(This
, STYLEID_HEIGHT
, p
) != S_OK
)
2632 static HRESULT WINAPI
HTMLStyle_put_cursor(IHTMLStyle
*iface
, BSTR v
)
2634 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2636 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2638 return set_style_attr(This
, STYLEID_CURSOR
, v
, 0);
2641 static HRESULT WINAPI
HTMLStyle_get_cursor(IHTMLStyle
*iface
, BSTR
*p
)
2643 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2645 TRACE("(%p)->(%p)\n", This
, p
);
2647 return get_style_attr(This
, STYLEID_CURSOR
, p
);
2650 static HRESULT WINAPI
HTMLStyle_put_clip(IHTMLStyle
*iface
, BSTR v
)
2652 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2654 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2656 return set_style_attr(This
, STYLEID_CLIP
, v
, 0);
2659 static HRESULT WINAPI
HTMLStyle_get_clip(IHTMLStyle
*iface
, BSTR
*p
)
2661 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2663 TRACE("(%p)->(%p)\n", This
, p
);
2665 return get_nsstyle_attr(This
->nsstyle
, STYLEID_CLIP
, p
, ATTR_REMOVE_COMMA
);
2668 static void set_opacity(HTMLStyle
*This
, const WCHAR
*val
)
2670 nsAString name_str
, val_str
, empty_str
;
2673 static const WCHAR opacityW
[] = {'o','p','a','c','i','t','y',0};
2675 TRACE("%s\n", debugstr_w(val
));
2677 nsAString_InitDepend(&name_str
, opacityW
);
2678 nsAString_InitDepend(&val_str
, val
);
2679 nsAString_InitDepend(&empty_str
, emptyW
);
2681 nsres
= nsIDOMCSSStyleDeclaration_SetProperty(This
->nsstyle
, &name_str
, &val_str
, &empty_str
);
2682 if(NS_FAILED(nsres
))
2683 ERR("SetProperty failed: %08x\n", nsres
);
2685 nsAString_Finish(&name_str
);
2686 nsAString_Finish(&val_str
);
2687 nsAString_Finish(&empty_str
);
2690 static void update_filter(HTMLStyle
*This
)
2692 const WCHAR
*ptr
, *ptr2
;
2694 static const WCHAR alphaW
[] = {'a','l','p','h','a'};
2696 if(get_style_compat_mode(This
) >= COMPAT_MODE_IE10
)
2699 ptr
= This
->elem
->filter
;
2700 TRACE("%s\n", debugstr_w(ptr
));
2702 set_opacity(This
, emptyW
);
2707 while(isspaceW(*ptr
))
2713 while(isalnumW(*ptr
))
2716 WARN("unexpected char '%c'\n", *ptr
);
2720 WARN("expected '('\n");
2724 if(ptr2
+ ARRAY_SIZE(alphaW
) == ptr
&& !memcmp(ptr2
, alphaW
, sizeof(alphaW
))) {
2725 static const WCHAR formatW
[] = {'%','f',0};
2726 static const WCHAR opacityW
[] = {'o','p','a','c','i','t','y','='};
2730 while(isspaceW(*ptr
))
2734 while(*ptr
&& *ptr
!= ',' && *ptr
!= ')')
2737 WARN("unexpected end of string\n");
2741 if(ptr
-ptr2
> ARRAY_SIZE(opacityW
) && !memcmp(ptr2
, opacityW
, sizeof(opacityW
))) {
2742 float fval
= 0.0f
, e
= 0.1f
;
2745 ptr2
+= ARRAY_SIZE(opacityW
);
2747 while(isdigitW(*ptr2
))
2748 fval
= fval
*10.0f
+ (float)(*ptr2
++ - '0');
2751 while(isdigitW(*++ptr2
)) {
2752 fval
+= e
* (float)(*ptr2
++ - '0');
2757 sprintfW(buf
, formatW
, fval
* 0.01f
);
2758 set_opacity(This
, buf
);
2760 FIXME("unknown param %s\n", debugstr_wn(ptr2
, ptr
-ptr2
));
2765 }while(*ptr
!= ')');
2767 FIXME("unknown filter %s\n", debugstr_wn(ptr2
, ptr
-ptr2
));
2768 ptr
= strchrW(ptr
, ')');
2776 static HRESULT WINAPI
HTMLStyle_put_filter(IHTMLStyle
*iface
, BSTR v
)
2778 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2779 WCHAR
*new_filter
= NULL
;
2781 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2784 FIXME("Element already destroyed\n");
2785 return E_UNEXPECTED
;
2789 new_filter
= heap_strdupW(v
);
2791 return E_OUTOFMEMORY
;
2794 heap_free(This
->elem
->filter
);
2795 This
->elem
->filter
= new_filter
;
2797 update_filter(This
);
2801 static HRESULT WINAPI
HTMLStyle_get_filter(IHTMLStyle
*iface
, BSTR
*p
)
2803 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2805 TRACE("(%p)->(%p)\n", This
, p
);
2808 FIXME("Element already destroyed\n");
2809 return E_UNEXPECTED
;
2812 if(This
->elem
->filter
) {
2813 *p
= SysAllocString(This
->elem
->filter
);
2815 return E_OUTOFMEMORY
;
2823 static HRESULT WINAPI
HTMLStyle_setAttribute(IHTMLStyle
*iface
, BSTR strAttributeName
,
2824 VARIANT AttributeValue
, LONG lFlags
)
2826 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2830 TRACE("(%p)->(%s %s %08x)\n", This
, debugstr_w(strAttributeName
),
2831 debugstr_variant(&AttributeValue
), lFlags
);
2833 if(!strAttributeName
)
2834 return E_INVALIDARG
;
2837 FIXME("Parameter lFlags ignored\n");
2839 hres
= HTMLStyle_GetIDsOfNames(iface
, &IID_NULL
, &strAttributeName
, 1,
2840 LOCALE_USER_DEFAULT
, &dispid
);
2844 DISPID dispidNamed
= DISPID_PROPERTYPUT
;
2848 params
.rgvarg
= &AttributeValue
;
2849 params
.cNamedArgs
= 1;
2850 params
.rgdispidNamedArgs
= &dispidNamed
;
2852 hres
= HTMLStyle_Invoke(iface
, dispid
, &IID_NULL
, LOCALE_SYSTEM_DEFAULT
,
2853 DISPATCH_PROPERTYPUT
, ¶ms
, &ret
, NULL
, NULL
);
2857 FIXME("Custom attributes not supported.\n");
2860 TRACE("ret: %08x\n", hres
);
2865 static HRESULT WINAPI
HTMLStyle_getAttribute(IHTMLStyle
*iface
, BSTR strAttributeName
,
2866 LONG lFlags
, VARIANT
*AttributeValue
)
2868 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2872 TRACE("(%p)->(%s v%p %08x)\n", This
, debugstr_w(strAttributeName
),
2873 AttributeValue
, lFlags
);
2875 if(!AttributeValue
|| !strAttributeName
)
2876 return E_INVALIDARG
;
2879 FIXME("Parameter lFlags ignored\n");
2881 hres
= HTMLStyle_GetIDsOfNames(iface
, &IID_NULL
, &strAttributeName
, 1,
2882 LOCALE_USER_DEFAULT
, &dispid
);
2885 DISPPARAMS params
= {NULL
, NULL
, 0, 0 };
2887 hres
= HTMLStyle_Invoke(iface
, dispid
, &IID_NULL
, LOCALE_SYSTEM_DEFAULT
,
2888 DISPATCH_PROPERTYGET
, ¶ms
, AttributeValue
, NULL
, NULL
);
2892 FIXME("Custom attributes not supported.\n");
2898 static HRESULT WINAPI
HTMLStyle_removeAttribute(IHTMLStyle
*iface
, BSTR strAttributeName
,
2899 LONG lFlags
, VARIANT_BOOL
*pfSuccess
)
2901 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2902 const style_tbl_entry_t
*style_entry
;
2903 nsAString name_str
, ret_str
;
2907 TRACE("(%p)->(%s %08x %p)\n", This
, debugstr_w(strAttributeName
), lFlags
, pfSuccess
);
2909 style_entry
= lookup_style_tbl(strAttributeName
);
2914 hres
= IDispatchEx_GetDispID(&This
->dispex
.IDispatchEx_iface
, strAttributeName
,
2915 (lFlags
&1) ? fdexNameCaseSensitive
: fdexNameCaseInsensitive
, &dispid
);
2917 *pfSuccess
= VARIANT_FALSE
;
2921 for(i
=0; i
< ARRAY_SIZE(style_tbl
); i
++) {
2922 if(dispid
== style_tbl
[i
].dispid
)
2926 if(i
== ARRAY_SIZE(style_tbl
))
2927 return remove_attribute(&This
->dispex
, dispid
, pfSuccess
);
2928 style_entry
= style_tbl
+i
;
2931 /* filter property is a special case */
2932 if(style_entry
->dispid
== DISPID_IHTMLSTYLE_FILTER
) {
2933 *pfSuccess
= variant_bool(This
->elem
->filter
&& *This
->elem
->filter
);
2934 heap_free(This
->elem
->filter
);
2935 This
->elem
->filter
= NULL
;
2936 update_filter(This
);
2940 nsAString_InitDepend(&name_str
, style_entry
->name
);
2941 nsAString_Init(&ret_str
, NULL
);
2942 nsres
= nsIDOMCSSStyleDeclaration_RemoveProperty(This
->nsstyle
, &name_str
, &ret_str
);
2943 if(NS_SUCCEEDED(nsres
)) {
2944 const PRUnichar
*ret
;
2945 nsAString_GetData(&ret_str
, &ret
);
2946 *pfSuccess
= variant_bool(*ret
);
2948 ERR("RemoveProperty failed: %08x\n", nsres
);
2950 nsAString_Finish(&name_str
);
2951 nsAString_Finish(&ret_str
);
2952 return NS_SUCCEEDED(nsres
) ? S_OK
: E_FAIL
;
2955 static HRESULT WINAPI
HTMLStyle_toString(IHTMLStyle
*iface
, BSTR
*String
)
2957 HTMLStyle
*This
= impl_from_IHTMLStyle(iface
);
2958 FIXME("(%p)->(%p)\n", This
, String
);
2962 static const IHTMLStyleVtbl HTMLStyleVtbl
= {
2963 HTMLStyle_QueryInterface
,
2966 HTMLStyle_GetTypeInfoCount
,
2967 HTMLStyle_GetTypeInfo
,
2968 HTMLStyle_GetIDsOfNames
,
2970 HTMLStyle_put_fontFamily
,
2971 HTMLStyle_get_fontFamily
,
2972 HTMLStyle_put_fontStyle
,
2973 HTMLStyle_get_fontStyle
,
2974 HTMLStyle_put_fontVariant
,
2975 HTMLStyle_get_fontVariant
,
2976 HTMLStyle_put_fontWeight
,
2977 HTMLStyle_get_fontWeight
,
2978 HTMLStyle_put_fontSize
,
2979 HTMLStyle_get_fontSize
,
2982 HTMLStyle_put_color
,
2983 HTMLStyle_get_color
,
2984 HTMLStyle_put_background
,
2985 HTMLStyle_get_background
,
2986 HTMLStyle_put_backgroundColor
,
2987 HTMLStyle_get_backgroundColor
,
2988 HTMLStyle_put_backgroundImage
,
2989 HTMLStyle_get_backgroundImage
,
2990 HTMLStyle_put_backgroundRepeat
,
2991 HTMLStyle_get_backgroundRepeat
,
2992 HTMLStyle_put_backgroundAttachment
,
2993 HTMLStyle_get_backgroundAttachment
,
2994 HTMLStyle_put_backgroundPosition
,
2995 HTMLStyle_get_backgroundPosition
,
2996 HTMLStyle_put_backgroundPositionX
,
2997 HTMLStyle_get_backgroundPositionX
,
2998 HTMLStyle_put_backgroundPositionY
,
2999 HTMLStyle_get_backgroundPositionY
,
3000 HTMLStyle_put_wordSpacing
,
3001 HTMLStyle_get_wordSpacing
,
3002 HTMLStyle_put_letterSpacing
,
3003 HTMLStyle_get_letterSpacing
,
3004 HTMLStyle_put_textDecoration
,
3005 HTMLStyle_get_textDecoration
,
3006 HTMLStyle_put_textDecorationNone
,
3007 HTMLStyle_get_textDecorationNone
,
3008 HTMLStyle_put_textDecorationUnderline
,
3009 HTMLStyle_get_textDecorationUnderline
,
3010 HTMLStyle_put_textDecorationOverline
,
3011 HTMLStyle_get_textDecorationOverline
,
3012 HTMLStyle_put_textDecorationLineThrough
,
3013 HTMLStyle_get_textDecorationLineThrough
,
3014 HTMLStyle_put_textDecorationBlink
,
3015 HTMLStyle_get_textDecorationBlink
,
3016 HTMLStyle_put_verticalAlign
,
3017 HTMLStyle_get_verticalAlign
,
3018 HTMLStyle_put_textTransform
,
3019 HTMLStyle_get_textTransform
,
3020 HTMLStyle_put_textAlign
,
3021 HTMLStyle_get_textAlign
,
3022 HTMLStyle_put_textIndent
,
3023 HTMLStyle_get_textIndent
,
3024 HTMLStyle_put_lineHeight
,
3025 HTMLStyle_get_lineHeight
,
3026 HTMLStyle_put_marginTop
,
3027 HTMLStyle_get_marginTop
,
3028 HTMLStyle_put_marginRight
,
3029 HTMLStyle_get_marginRight
,
3030 HTMLStyle_put_marginBottom
,
3031 HTMLStyle_get_marginBottom
,
3032 HTMLStyle_put_marginLeft
,
3033 HTMLStyle_get_marginLeft
,
3034 HTMLStyle_put_margin
,
3035 HTMLStyle_get_margin
,
3036 HTMLStyle_put_paddingTop
,
3037 HTMLStyle_get_paddingTop
,
3038 HTMLStyle_put_paddingRight
,
3039 HTMLStyle_get_paddingRight
,
3040 HTMLStyle_put_paddingBottom
,
3041 HTMLStyle_get_paddingBottom
,
3042 HTMLStyle_put_paddingLeft
,
3043 HTMLStyle_get_paddingLeft
,
3044 HTMLStyle_put_padding
,
3045 HTMLStyle_get_padding
,
3046 HTMLStyle_put_border
,
3047 HTMLStyle_get_border
,
3048 HTMLStyle_put_borderTop
,
3049 HTMLStyle_get_borderTop
,
3050 HTMLStyle_put_borderRight
,
3051 HTMLStyle_get_borderRight
,
3052 HTMLStyle_put_borderBottom
,
3053 HTMLStyle_get_borderBottom
,
3054 HTMLStyle_put_borderLeft
,
3055 HTMLStyle_get_borderLeft
,
3056 HTMLStyle_put_borderColor
,
3057 HTMLStyle_get_borderColor
,
3058 HTMLStyle_put_borderTopColor
,
3059 HTMLStyle_get_borderTopColor
,
3060 HTMLStyle_put_borderRightColor
,
3061 HTMLStyle_get_borderRightColor
,
3062 HTMLStyle_put_borderBottomColor
,
3063 HTMLStyle_get_borderBottomColor
,
3064 HTMLStyle_put_borderLeftColor
,
3065 HTMLStyle_get_borderLeftColor
,
3066 HTMLStyle_put_borderWidth
,
3067 HTMLStyle_get_borderWidth
,
3068 HTMLStyle_put_borderTopWidth
,
3069 HTMLStyle_get_borderTopWidth
,
3070 HTMLStyle_put_borderRightWidth
,
3071 HTMLStyle_get_borderRightWidth
,
3072 HTMLStyle_put_borderBottomWidth
,
3073 HTMLStyle_get_borderBottomWidth
,
3074 HTMLStyle_put_borderLeftWidth
,
3075 HTMLStyle_get_borderLeftWidth
,
3076 HTMLStyle_put_borderStyle
,
3077 HTMLStyle_get_borderStyle
,
3078 HTMLStyle_put_borderTopStyle
,
3079 HTMLStyle_get_borderTopStyle
,
3080 HTMLStyle_put_borderRightStyle
,
3081 HTMLStyle_get_borderRightStyle
,
3082 HTMLStyle_put_borderBottomStyle
,
3083 HTMLStyle_get_borderBottomStyle
,
3084 HTMLStyle_put_borderLeftStyle
,
3085 HTMLStyle_get_borderLeftStyle
,
3086 HTMLStyle_put_width
,
3087 HTMLStyle_get_width
,
3088 HTMLStyle_put_height
,
3089 HTMLStyle_get_height
,
3090 HTMLStyle_put_styleFloat
,
3091 HTMLStyle_get_styleFloat
,
3092 HTMLStyle_put_clear
,
3093 HTMLStyle_get_clear
,
3094 HTMLStyle_put_display
,
3095 HTMLStyle_get_display
,
3096 HTMLStyle_put_visibility
,
3097 HTMLStyle_get_visibility
,
3098 HTMLStyle_put_listStyleType
,
3099 HTMLStyle_get_listStyleType
,
3100 HTMLStyle_put_listStylePosition
,
3101 HTMLStyle_get_listStylePosition
,
3102 HTMLStyle_put_listStyleImage
,
3103 HTMLStyle_get_listStyleImage
,
3104 HTMLStyle_put_listStyle
,
3105 HTMLStyle_get_listStyle
,
3106 HTMLStyle_put_whiteSpace
,
3107 HTMLStyle_get_whiteSpace
,
3112 HTMLStyle_get_position
,
3113 HTMLStyle_put_zIndex
,
3114 HTMLStyle_get_zIndex
,
3115 HTMLStyle_put_overflow
,
3116 HTMLStyle_get_overflow
,
3117 HTMLStyle_put_pageBreakBefore
,
3118 HTMLStyle_get_pageBreakBefore
,
3119 HTMLStyle_put_pageBreakAfter
,
3120 HTMLStyle_get_pageBreakAfter
,
3121 HTMLStyle_put_cssText
,
3122 HTMLStyle_get_cssText
,
3123 HTMLStyle_put_pixelTop
,
3124 HTMLStyle_get_pixelTop
,
3125 HTMLStyle_put_pixelLeft
,
3126 HTMLStyle_get_pixelLeft
,
3127 HTMLStyle_put_pixelWidth
,
3128 HTMLStyle_get_pixelWidth
,
3129 HTMLStyle_put_pixelHeight
,
3130 HTMLStyle_get_pixelHeight
,
3131 HTMLStyle_put_posTop
,
3132 HTMLStyle_get_posTop
,
3133 HTMLStyle_put_posLeft
,
3134 HTMLStyle_get_posLeft
,
3135 HTMLStyle_put_posWidth
,
3136 HTMLStyle_get_posWidth
,
3137 HTMLStyle_put_posHeight
,
3138 HTMLStyle_get_posHeight
,
3139 HTMLStyle_put_cursor
,
3140 HTMLStyle_get_cursor
,
3143 HTMLStyle_put_filter
,
3144 HTMLStyle_get_filter
,
3145 HTMLStyle_setAttribute
,
3146 HTMLStyle_getAttribute
,
3147 HTMLStyle_removeAttribute
,
3151 static inline HTMLStyle
*impl_from_IHTMLStyle2(IHTMLStyle2
*iface
)
3153 return CONTAINING_RECORD(iface
, HTMLStyle
, IHTMLStyle2_iface
);
3156 static HRESULT WINAPI
HTMLStyle2_QueryInterface(IHTMLStyle2
*iface
, REFIID riid
, void **ppv
)
3158 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3160 return IHTMLStyle_QueryInterface(&This
->IHTMLStyle_iface
, riid
, ppv
);
3163 static ULONG WINAPI
HTMLStyle2_AddRef(IHTMLStyle2
*iface
)
3165 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3167 return IHTMLStyle_AddRef(&This
->IHTMLStyle_iface
);
3170 static ULONG WINAPI
HTMLStyle2_Release(IHTMLStyle2
*iface
)
3172 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3174 return IHTMLStyle_Release(&This
->IHTMLStyle_iface
);
3177 static HRESULT WINAPI
HTMLStyle2_GetTypeInfoCount(IHTMLStyle2
*iface
, UINT
*pctinfo
)
3179 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3180 return IDispatchEx_GetTypeInfoCount(&This
->dispex
.IDispatchEx_iface
, pctinfo
);
3183 static HRESULT WINAPI
HTMLStyle2_GetTypeInfo(IHTMLStyle2
*iface
, UINT iTInfo
,
3184 LCID lcid
, ITypeInfo
**ppTInfo
)
3186 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3187 return IDispatchEx_GetTypeInfo(&This
->dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
3190 static HRESULT WINAPI
HTMLStyle2_GetIDsOfNames(IHTMLStyle2
*iface
, REFIID riid
,
3191 LPOLESTR
*rgszNames
, UINT cNames
,
3192 LCID lcid
, DISPID
*rgDispId
)
3194 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3195 return IDispatchEx_GetIDsOfNames(&This
->dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
3199 static HRESULT WINAPI
HTMLStyle2_Invoke(IHTMLStyle2
*iface
, DISPID dispIdMember
,
3200 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
3201 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
3203 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3204 return IDispatchEx_Invoke(&This
->dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
3205 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
3208 static HRESULT WINAPI
HTMLStyle2_put_tableLayout(IHTMLStyle2
*iface
, BSTR v
)
3210 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3212 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
3214 return set_nsstyle_attr(This
->nsstyle
, STYLEID_TABLE_LAYOUT
, v
, 0);
3217 static HRESULT WINAPI
HTMLStyle2_get_tableLayout(IHTMLStyle2
*iface
, BSTR
*p
)
3219 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3221 TRACE("(%p)->(%p)\n", This
, p
);
3223 return get_nsstyle_attr(This
->nsstyle
, STYLEID_TABLE_LAYOUT
, p
, 0);
3226 static HRESULT WINAPI
HTMLStyle2_put_borderCollapse(IHTMLStyle2
*iface
, BSTR v
)
3228 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3229 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
3233 static HRESULT WINAPI
HTMLStyle2_get_borderCollapse(IHTMLStyle2
*iface
, BSTR
*p
)
3235 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3236 FIXME("(%p)->(%p)\n", This
, p
);
3240 static HRESULT WINAPI
HTMLStyle2_put_direction(IHTMLStyle2
*iface
, BSTR v
)
3242 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3244 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
3246 return set_nsstyle_attr(This
->nsstyle
, STYLEID_DIRECTION
, v
, 0);
3249 static HRESULT WINAPI
HTMLStyle2_get_direction(IHTMLStyle2
*iface
, BSTR
*p
)
3251 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3253 TRACE("(%p)->(%p)\n", This
, p
);
3255 return get_nsstyle_attr(This
->nsstyle
, STYLEID_DIRECTION
, p
, 0);
3258 static HRESULT WINAPI
HTMLStyle2_put_behavior(IHTMLStyle2
*iface
, BSTR v
)
3260 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3261 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
3265 static HRESULT WINAPI
HTMLStyle2_get_behavior(IHTMLStyle2
*iface
, BSTR
*p
)
3267 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3268 FIXME("(%p)->(%p)\n", This
, p
);
3272 static HRESULT WINAPI
HTMLStyle2_setExpression(IHTMLStyle2
*iface
, BSTR propname
, BSTR expression
, BSTR language
)
3274 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3275 FIXME("(%p)->(%s %s %s)\n", This
, debugstr_w(propname
), debugstr_w(expression
), debugstr_w(language
));
3279 static HRESULT WINAPI
HTMLStyle2_getExpression(IHTMLStyle2
*iface
, BSTR propname
, VARIANT
*expression
)
3281 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3282 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(propname
), expression
);
3286 static HRESULT WINAPI
HTMLStyle2_removeExpression(IHTMLStyle2
*iface
, BSTR propname
, VARIANT_BOOL
*pfSuccess
)
3288 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3289 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(propname
), pfSuccess
);
3293 static HRESULT WINAPI
HTMLStyle2_put_position(IHTMLStyle2
*iface
, BSTR v
)
3295 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3297 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
3299 return set_nsstyle_attr(This
->nsstyle
, STYLEID_POSITION
, v
, 0);
3302 static HRESULT WINAPI
HTMLStyle2_get_position(IHTMLStyle2
*iface
, BSTR
*p
)
3304 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3306 TRACE("(%p)->(%p)\n", This
, p
);
3308 return get_nsstyle_attr(This
->nsstyle
, STYLEID_POSITION
, p
, 0);
3311 static HRESULT WINAPI
HTMLStyle2_put_unicodeBidi(IHTMLStyle2
*iface
, BSTR v
)
3313 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3314 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
3318 static HRESULT WINAPI
HTMLStyle2_get_unicodeBidi(IHTMLStyle2
*iface
, BSTR
*p
)
3320 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3321 FIXME("(%p)->(%p)\n", This
, p
);
3325 static HRESULT WINAPI
HTMLStyle2_put_bottom(IHTMLStyle2
*iface
, VARIANT v
)
3327 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3329 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3331 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_BOTTOM
, &v
, ATTR_FIX_PX
);
3334 static HRESULT WINAPI
HTMLStyle2_get_bottom(IHTMLStyle2
*iface
, VARIANT
*p
)
3336 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3338 TRACE("(%p)->(%p)\n", This
, p
);
3340 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_BOTTOM
, p
, 0);
3343 static HRESULT WINAPI
HTMLStyle2_put_right(IHTMLStyle2
*iface
, VARIANT v
)
3345 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3347 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3349 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_RIGHT
, &v
, 0);
3352 static HRESULT WINAPI
HTMLStyle2_get_right(IHTMLStyle2
*iface
, VARIANT
*p
)
3354 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3356 TRACE("(%p)->(%p)\n", This
, p
);
3358 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_RIGHT
, p
, 0);
3361 static HRESULT WINAPI
HTMLStyle2_put_pixelBottom(IHTMLStyle2
*iface
, LONG v
)
3363 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3364 FIXME("(%p)->(%d)\n", This
, v
);
3368 static HRESULT WINAPI
HTMLStyle2_get_pixelBottom(IHTMLStyle2
*iface
, LONG
*p
)
3370 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3371 FIXME("(%p)->(%p)\n", This
, p
);
3375 static HRESULT WINAPI
HTMLStyle2_put_pixelRight(IHTMLStyle2
*iface
, LONG v
)
3377 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3378 FIXME("(%p)->(%d)\n", This
, v
);
3382 static HRESULT WINAPI
HTMLStyle2_get_pixelRight(IHTMLStyle2
*iface
, LONG
*p
)
3384 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3385 FIXME("(%p)->(%p)\n", This
, p
);
3389 static HRESULT WINAPI
HTMLStyle2_put_posBottom(IHTMLStyle2
*iface
, float v
)
3391 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3392 FIXME("(%p)->(%f)\n", This
, v
);
3396 static HRESULT WINAPI
HTMLStyle2_get_posBottom(IHTMLStyle2
*iface
, float *p
)
3398 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3399 FIXME("(%p)->(%p)\n", This
, p
);
3403 static HRESULT WINAPI
HTMLStyle2_put_posRight(IHTMLStyle2
*iface
, float v
)
3405 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3406 FIXME("(%p)->(%f)\n", This
, v
);
3410 static HRESULT WINAPI
HTMLStyle2_get_posRight(IHTMLStyle2
*iface
, float *p
)
3412 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3413 FIXME("(%p)->(%p)\n", This
, p
);
3417 static HRESULT WINAPI
HTMLStyle2_put_imeMode(IHTMLStyle2
*iface
, BSTR v
)
3419 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3420 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
3424 static HRESULT WINAPI
HTMLStyle2_get_imeMode(IHTMLStyle2
*iface
, BSTR
*p
)
3426 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3427 FIXME("(%p)->(%p)\n", This
, p
);
3431 static HRESULT WINAPI
HTMLStyle2_put_rubyAlign(IHTMLStyle2
*iface
, BSTR v
)
3433 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3434 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
3438 static HRESULT WINAPI
HTMLStyle2_get_rubyAlign(IHTMLStyle2
*iface
, BSTR
*p
)
3440 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3441 FIXME("(%p)->(%p)\n", This
, p
);
3445 static HRESULT WINAPI
HTMLStyle2_put_rubyPosition(IHTMLStyle2
*iface
, BSTR v
)
3447 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3448 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
3452 static HRESULT WINAPI
HTMLStyle2_get_rubyPosition(IHTMLStyle2
*iface
, BSTR
*p
)
3454 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3455 FIXME("(%p)->(%p)\n", This
, p
);
3459 static HRESULT WINAPI
HTMLStyle2_put_rubyOverhang(IHTMLStyle2
*iface
, BSTR v
)
3461 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3462 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
3466 static HRESULT WINAPI
HTMLStyle2_get_rubyOverhang(IHTMLStyle2
*iface
, BSTR
*p
)
3468 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3469 FIXME("(%p)->(%p)\n", This
, p
);
3473 static HRESULT WINAPI
HTMLStyle2_put_layoutGridChar(IHTMLStyle2
*iface
, VARIANT v
)
3475 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3476 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3480 static HRESULT WINAPI
HTMLStyle2_get_layoutGridChar(IHTMLStyle2
*iface
, VARIANT
*p
)
3482 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3483 FIXME("(%p)->(%p)\n", This
, p
);
3487 static HRESULT WINAPI
HTMLStyle2_put_layoutGridLine(IHTMLStyle2
*iface
, VARIANT v
)
3489 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3490 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3494 static HRESULT WINAPI
HTMLStyle2_get_layoutGridLine(IHTMLStyle2
*iface
, VARIANT
*p
)
3496 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3497 FIXME("(%p)->(%p)\n", This
, p
);
3501 static HRESULT WINAPI
HTMLStyle2_put_layoutGridMode(IHTMLStyle2
*iface
, BSTR v
)
3503 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3504 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
3508 static HRESULT WINAPI
HTMLStyle2_get_layoutGridMode(IHTMLStyle2
*iface
, BSTR
*p
)
3510 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3511 FIXME("(%p)->(%p)\n", This
, p
);
3515 static HRESULT WINAPI
HTMLStyle2_put_layoutGridType(IHTMLStyle2
*iface
, BSTR v
)
3517 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3518 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
3522 static HRESULT WINAPI
HTMLStyle2_get_layoutGridType(IHTMLStyle2
*iface
, BSTR
*p
)
3524 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3525 FIXME("(%p)->(%p)\n", This
, p
);
3529 static HRESULT WINAPI
HTMLStyle2_put_layoutGrid(IHTMLStyle2
*iface
, BSTR v
)
3531 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3532 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
3536 static HRESULT WINAPI
HTMLStyle2_get_layoutGrid(IHTMLStyle2
*iface
, BSTR
*p
)
3538 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3539 FIXME("(%p)->(%p)\n", This
, p
);
3543 static HRESULT WINAPI
HTMLStyle2_put_wordBreak(IHTMLStyle2
*iface
, BSTR v
)
3545 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3546 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
3550 static HRESULT WINAPI
HTMLStyle2_get_wordBreak(IHTMLStyle2
*iface
, BSTR
*p
)
3552 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3553 FIXME("(%p)->(%p)\n", This
, p
);
3557 static HRESULT WINAPI
HTMLStyle2_put_lineBreak(IHTMLStyle2
*iface
, BSTR v
)
3559 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3560 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
3564 static HRESULT WINAPI
HTMLStyle2_get_lineBreak(IHTMLStyle2
*iface
, BSTR
*p
)
3566 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3567 FIXME("(%p)->(%p)\n", This
, p
);
3571 static HRESULT WINAPI
HTMLStyle2_put_textJustify(IHTMLStyle2
*iface
, BSTR v
)
3573 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3574 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
3578 static HRESULT WINAPI
HTMLStyle2_get_textJustify(IHTMLStyle2
*iface
, BSTR
*p
)
3580 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3581 FIXME("(%p)->(%p)\n", This
, p
);
3585 static HRESULT WINAPI
HTMLStyle2_put_textJustifyTrim(IHTMLStyle2
*iface
, BSTR v
)
3587 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3588 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
3592 static HRESULT WINAPI
HTMLStyle2_get_textJustifyTrim(IHTMLStyle2
*iface
, BSTR
*p
)
3594 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3595 FIXME("(%p)->(%p)\n", This
, p
);
3599 static HRESULT WINAPI
HTMLStyle2_put_textKashida(IHTMLStyle2
*iface
, VARIANT v
)
3601 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3602 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3606 static HRESULT WINAPI
HTMLStyle2_get_textKashida(IHTMLStyle2
*iface
, VARIANT
*p
)
3608 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3609 FIXME("(%p)->(%p)\n", This
, p
);
3613 static HRESULT WINAPI
HTMLStyle2_put_textAutospace(IHTMLStyle2
*iface
, BSTR v
)
3615 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3616 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
3620 static HRESULT WINAPI
HTMLStyle2_get_textAutospace(IHTMLStyle2
*iface
, BSTR
*p
)
3622 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3623 FIXME("(%p)->(%p)\n", This
, p
);
3627 static HRESULT WINAPI
HTMLStyle2_put_overflowX(IHTMLStyle2
*iface
, BSTR v
)
3629 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3631 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
3633 return set_nsstyle_attr(This
->nsstyle
, STYLEID_OVERFLOW_X
, v
, 0);
3636 static HRESULT WINAPI
HTMLStyle2_get_overflowX(IHTMLStyle2
*iface
, BSTR
*p
)
3638 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3640 TRACE("(%p)->(%p)\n", This
, p
);
3642 return get_nsstyle_attr(This
->nsstyle
, STYLEID_OVERFLOW_X
, p
, 0);
3645 static HRESULT WINAPI
HTMLStyle2_put_overflowY(IHTMLStyle2
*iface
, BSTR v
)
3647 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3649 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
3651 return set_nsstyle_attr(This
->nsstyle
, STYLEID_OVERFLOW_Y
, v
, 0);
3654 static HRESULT WINAPI
HTMLStyle2_get_overflowY(IHTMLStyle2
*iface
, BSTR
*p
)
3656 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3658 TRACE("(%p)->(%p)\n", This
, p
);
3660 return get_nsstyle_attr(This
->nsstyle
, STYLEID_OVERFLOW_Y
, p
, 0);
3663 static HRESULT WINAPI
HTMLStyle2_put_accelerator(IHTMLStyle2
*iface
, BSTR v
)
3665 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3666 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
3670 static HRESULT WINAPI
HTMLStyle2_get_accelerator(IHTMLStyle2
*iface
, BSTR
*p
)
3672 HTMLStyle
*This
= impl_from_IHTMLStyle2(iface
);
3673 FIXME("(%p)->(%p)\n", This
, p
);
3677 static const IHTMLStyle2Vtbl HTMLStyle2Vtbl
= {
3678 HTMLStyle2_QueryInterface
,
3681 HTMLStyle2_GetTypeInfoCount
,
3682 HTMLStyle2_GetTypeInfo
,
3683 HTMLStyle2_GetIDsOfNames
,
3685 HTMLStyle2_put_tableLayout
,
3686 HTMLStyle2_get_tableLayout
,
3687 HTMLStyle2_put_borderCollapse
,
3688 HTMLStyle2_get_borderCollapse
,
3689 HTMLStyle2_put_direction
,
3690 HTMLStyle2_get_direction
,
3691 HTMLStyle2_put_behavior
,
3692 HTMLStyle2_get_behavior
,
3693 HTMLStyle2_setExpression
,
3694 HTMLStyle2_getExpression
,
3695 HTMLStyle2_removeExpression
,
3696 HTMLStyle2_put_position
,
3697 HTMLStyle2_get_position
,
3698 HTMLStyle2_put_unicodeBidi
,
3699 HTMLStyle2_get_unicodeBidi
,
3700 HTMLStyle2_put_bottom
,
3701 HTMLStyle2_get_bottom
,
3702 HTMLStyle2_put_right
,
3703 HTMLStyle2_get_right
,
3704 HTMLStyle2_put_pixelBottom
,
3705 HTMLStyle2_get_pixelBottom
,
3706 HTMLStyle2_put_pixelRight
,
3707 HTMLStyle2_get_pixelRight
,
3708 HTMLStyle2_put_posBottom
,
3709 HTMLStyle2_get_posBottom
,
3710 HTMLStyle2_put_posRight
,
3711 HTMLStyle2_get_posRight
,
3712 HTMLStyle2_put_imeMode
,
3713 HTMLStyle2_get_imeMode
,
3714 HTMLStyle2_put_rubyAlign
,
3715 HTMLStyle2_get_rubyAlign
,
3716 HTMLStyle2_put_rubyPosition
,
3717 HTMLStyle2_get_rubyPosition
,
3718 HTMLStyle2_put_rubyOverhang
,
3719 HTMLStyle2_get_rubyOverhang
,
3720 HTMLStyle2_put_layoutGridChar
,
3721 HTMLStyle2_get_layoutGridChar
,
3722 HTMLStyle2_put_layoutGridLine
,
3723 HTMLStyle2_get_layoutGridLine
,
3724 HTMLStyle2_put_layoutGridMode
,
3725 HTMLStyle2_get_layoutGridMode
,
3726 HTMLStyle2_put_layoutGridType
,
3727 HTMLStyle2_get_layoutGridType
,
3728 HTMLStyle2_put_layoutGrid
,
3729 HTMLStyle2_get_layoutGrid
,
3730 HTMLStyle2_put_wordBreak
,
3731 HTMLStyle2_get_wordBreak
,
3732 HTMLStyle2_put_lineBreak
,
3733 HTMLStyle2_get_lineBreak
,
3734 HTMLStyle2_put_textJustify
,
3735 HTMLStyle2_get_textJustify
,
3736 HTMLStyle2_put_textJustifyTrim
,
3737 HTMLStyle2_get_textJustifyTrim
,
3738 HTMLStyle2_put_textKashida
,
3739 HTMLStyle2_get_textKashida
,
3740 HTMLStyle2_put_textAutospace
,
3741 HTMLStyle2_get_textAutospace
,
3742 HTMLStyle2_put_overflowX
,
3743 HTMLStyle2_get_overflowX
,
3744 HTMLStyle2_put_overflowY
,
3745 HTMLStyle2_get_overflowY
,
3746 HTMLStyle2_put_accelerator
,
3747 HTMLStyle2_get_accelerator
3750 static inline HTMLStyle
*impl_from_IHTMLStyle3(IHTMLStyle3
*iface
)
3752 return CONTAINING_RECORD(iface
, HTMLStyle
, IHTMLStyle3_iface
);
3755 static HRESULT WINAPI
HTMLStyle3_QueryInterface(IHTMLStyle3
*iface
, REFIID riid
, void **ppv
)
3757 HTMLStyle
*This
= impl_from_IHTMLStyle3(iface
);
3759 return IHTMLStyle_QueryInterface(&This
->IHTMLStyle_iface
, riid
, ppv
);
3762 static ULONG WINAPI
HTMLStyle3_AddRef(IHTMLStyle3
*iface
)
3764 HTMLStyle
*This
= impl_from_IHTMLStyle3(iface
);
3766 return IHTMLStyle_AddRef(&This
->IHTMLStyle_iface
);
3769 static ULONG WINAPI
HTMLStyle3_Release(IHTMLStyle3
*iface
)
3771 HTMLStyle
*This
= impl_from_IHTMLStyle3(iface
);
3773 return IHTMLStyle_Release(&This
->IHTMLStyle_iface
);
3776 static HRESULT WINAPI
HTMLStyle3_GetTypeInfoCount(IHTMLStyle3
*iface
, UINT
*pctinfo
)
3778 HTMLStyle
*This
= impl_from_IHTMLStyle3(iface
);
3779 return IDispatchEx_GetTypeInfoCount(&This
->dispex
.IDispatchEx_iface
, pctinfo
);
3782 static HRESULT WINAPI
HTMLStyle3_GetTypeInfo(IHTMLStyle3
*iface
, UINT iTInfo
,
3783 LCID lcid
, ITypeInfo
**ppTInfo
)
3785 HTMLStyle
*This
= impl_from_IHTMLStyle3(iface
);
3786 return IDispatchEx_GetTypeInfo(&This
->dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
3789 static HRESULT WINAPI
HTMLStyle3_GetIDsOfNames(IHTMLStyle3
*iface
, REFIID riid
,
3790 LPOLESTR
*rgszNames
, UINT cNames
,
3791 LCID lcid
, DISPID
*rgDispId
)
3793 HTMLStyle
*This
= impl_from_IHTMLStyle3(iface
);
3794 return IDispatchEx_GetIDsOfNames(&This
->dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
3798 static HRESULT WINAPI
HTMLStyle3_Invoke(IHTMLStyle3
*iface
, DISPID dispIdMember
,
3799 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
3800 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
3802 HTMLStyle
*This
= impl_from_IHTMLStyle3(iface
);
3803 return IDispatchEx_Invoke(&This
->dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
3804 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
3807 static HRESULT WINAPI
HTMLStyle3_put_layoutFlow(IHTMLStyle3
*iface
, BSTR v
)
3809 HTMLStyle
*This
= impl_from_IHTMLStyle3(iface
);
3810 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
3814 static HRESULT WINAPI
HTMLStyle3_get_layoutFlow(IHTMLStyle3
*iface
, BSTR
*p
)
3816 HTMLStyle
*This
= impl_from_IHTMLStyle3(iface
);
3817 FIXME("(%p)->(%p)\n", This
, p
);
3821 static const WCHAR zoomW
[] = {'z','o','o','m',0};
3823 static HRESULT WINAPI
HTMLStyle3_put_zoom(IHTMLStyle3
*iface
, VARIANT v
)
3825 HTMLStyle
*This
= impl_from_IHTMLStyle3(iface
);
3829 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3831 /* zoom property is IE CSS extension that is mostly used as a hack to workaround IE bugs.
3832 * The value is set to 1 then. We can safely ignore setting zoom to 1. */
3833 if(V_VT(&v
) != VT_I4
|| V_I4(&v
) != 1)
3834 WARN("stub for %s\n", debugstr_variant(&v
));
3836 hres
= dispex_get_dprop_ref(&This
->dispex
, zoomW
, TRUE
, &var
);
3840 return VariantChangeType(var
, &v
, 0, VT_BSTR
);
3843 static HRESULT WINAPI
HTMLStyle3_get_zoom(IHTMLStyle3
*iface
, VARIANT
*p
)
3845 HTMLStyle
*This
= impl_from_IHTMLStyle3(iface
);
3849 TRACE("(%p)->(%p)\n", This
, p
);
3851 hres
= dispex_get_dprop_ref(&This
->dispex
, zoomW
, FALSE
, &var
);
3852 if(hres
== DISP_E_UNKNOWNNAME
) {
3860 return VariantCopy(p
, var
);
3863 static HRESULT WINAPI
HTMLStyle3_put_wordWrap(IHTMLStyle3
*iface
, BSTR v
)
3865 HTMLStyle
*This
= impl_from_IHTMLStyle3(iface
);
3867 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
3869 return set_nsstyle_attr(This
->nsstyle
, STYLEID_WORD_WRAP
, v
, 0);
3872 static HRESULT WINAPI
HTMLStyle3_get_wordWrap(IHTMLStyle3
*iface
, BSTR
*p
)
3874 HTMLStyle
*This
= impl_from_IHTMLStyle3(iface
);
3876 TRACE("(%p)->(%p)\n", This
, p
);
3878 return get_nsstyle_attr(This
->nsstyle
, STYLEID_WORD_WRAP
, p
, 0);
3881 static HRESULT WINAPI
HTMLStyle3_put_textUnderlinePosition(IHTMLStyle3
*iface
, BSTR v
)
3883 HTMLStyle
*This
= impl_from_IHTMLStyle3(iface
);
3884 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
3888 static HRESULT WINAPI
HTMLStyle3_get_textUnderlinePosition(IHTMLStyle3
*iface
, BSTR
*p
)
3890 HTMLStyle
*This
= impl_from_IHTMLStyle3(iface
);
3891 FIXME("(%p)->(%p)\n", This
, p
);
3895 static HRESULT WINAPI
HTMLStyle3_put_scrollbarBaseColor(IHTMLStyle3
*iface
, VARIANT v
)
3897 HTMLStyle
*This
= impl_from_IHTMLStyle3(iface
);
3898 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3902 static HRESULT WINAPI
HTMLStyle3_get_scrollbarBaseColor(IHTMLStyle3
*iface
, VARIANT
*p
)
3904 HTMLStyle
*This
= impl_from_IHTMLStyle3(iface
);
3905 FIXME("(%p)->(%p)\n", This
, p
);
3909 static HRESULT WINAPI
HTMLStyle3_put_scrollbarFaceColor(IHTMLStyle3
*iface
, VARIANT v
)
3911 HTMLStyle
*This
= impl_from_IHTMLStyle3(iface
);
3912 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3916 static HRESULT WINAPI
HTMLStyle3_get_scrollbarFaceColor(IHTMLStyle3
*iface
, VARIANT
*p
)
3918 HTMLStyle
*This
= impl_from_IHTMLStyle3(iface
);
3919 FIXME("(%p)->(%p)\n", This
, p
);
3923 static HRESULT WINAPI
HTMLStyle3_put_scrollbar3dLightColor(IHTMLStyle3
*iface
, VARIANT v
)
3925 HTMLStyle
*This
= impl_from_IHTMLStyle3(iface
);
3926 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3930 static HRESULT WINAPI
HTMLStyle3_get_scrollbar3dLightColor(IHTMLStyle3
*iface
, VARIANT
*p
)
3932 HTMLStyle
*This
= impl_from_IHTMLStyle3(iface
);
3933 FIXME("(%p)->(%p)\n", This
, p
);
3937 static HRESULT WINAPI
HTMLStyle3_put_scrollbarShadowColor(IHTMLStyle3
*iface
, VARIANT v
)
3939 HTMLStyle
*This
= impl_from_IHTMLStyle3(iface
);
3940 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3944 static HRESULT WINAPI
HTMLStyle3_get_scrollbarShadowColor(IHTMLStyle3
*iface
, VARIANT
*p
)
3946 HTMLStyle
*This
= impl_from_IHTMLStyle3(iface
);
3947 FIXME("(%p)->(%p)\n", This
, p
);
3951 static HRESULT WINAPI
HTMLStyle3_put_scrollbarHighlightColor(IHTMLStyle3
*iface
, VARIANT v
)
3953 HTMLStyle
*This
= impl_from_IHTMLStyle3(iface
);
3954 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3958 static HRESULT WINAPI
HTMLStyle3_get_scrollbarHighlightColor(IHTMLStyle3
*iface
, VARIANT
*p
)
3960 HTMLStyle
*This
= impl_from_IHTMLStyle3(iface
);
3961 FIXME("(%p)->(%p)\n", This
, p
);
3965 static HRESULT WINAPI
HTMLStyle3_put_scrollbarDarkShadowColor(IHTMLStyle3
*iface
, VARIANT v
)
3967 HTMLStyle
*This
= impl_from_IHTMLStyle3(iface
);
3968 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3972 static HRESULT WINAPI
HTMLStyle3_get_scrollbarDarkShadowColor(IHTMLStyle3
*iface
, VARIANT
*p
)
3974 HTMLStyle
*This
= impl_from_IHTMLStyle3(iface
);
3975 FIXME("(%p)->(%p)\n", This
, p
);
3979 static HRESULT WINAPI
HTMLStyle3_put_scrollbarArrowColor(IHTMLStyle3
*iface
, VARIANT v
)
3981 HTMLStyle
*This
= impl_from_IHTMLStyle3(iface
);
3982 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3986 static HRESULT WINAPI
HTMLStyle3_get_scrollbarArrowColor(IHTMLStyle3
*iface
, VARIANT
*p
)
3988 HTMLStyle
*This
= impl_from_IHTMLStyle3(iface
);
3989 FIXME("(%p)->(%p)\n", This
, p
);
3993 static HRESULT WINAPI
HTMLStyle3_put_scrollbarTrackColor(IHTMLStyle3
*iface
, VARIANT v
)
3995 HTMLStyle
*This
= impl_from_IHTMLStyle3(iface
);
3996 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4000 static HRESULT WINAPI
HTMLStyle3_get_scrollbarTrackColor(IHTMLStyle3
*iface
, VARIANT
*p
)
4002 HTMLStyle
*This
= impl_from_IHTMLStyle3(iface
);
4003 FIXME("(%p)->(%p)\n", This
, p
);
4007 static HRESULT WINAPI
HTMLStyle3_put_writingMode(IHTMLStyle3
*iface
, BSTR v
)
4009 HTMLStyle
*This
= impl_from_IHTMLStyle3(iface
);
4010 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
4014 static HRESULT WINAPI
HTMLStyle3_get_writingMode(IHTMLStyle3
*iface
, BSTR
*p
)
4016 HTMLStyle
*This
= impl_from_IHTMLStyle3(iface
);
4017 FIXME("(%p)->(%p)\n", This
, p
);
4021 static HRESULT WINAPI
HTMLStyle3_put_textAlignLast(IHTMLStyle3
*iface
, BSTR v
)
4023 HTMLStyle
*This
= impl_from_IHTMLStyle3(iface
);
4024 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
4028 static HRESULT WINAPI
HTMLStyle3_get_textAlignLast(IHTMLStyle3
*iface
, BSTR
*p
)
4030 HTMLStyle
*This
= impl_from_IHTMLStyle3(iface
);
4031 FIXME("(%p)->(%p)\n", This
, p
);
4035 static HRESULT WINAPI
HTMLStyle3_put_textKashidaSpace(IHTMLStyle3
*iface
, VARIANT v
)
4037 HTMLStyle
*This
= impl_from_IHTMLStyle3(iface
);
4038 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4042 static HRESULT WINAPI
HTMLStyle3_get_textKashidaSpace(IHTMLStyle3
*iface
, VARIANT
*p
)
4044 HTMLStyle
*This
= impl_from_IHTMLStyle3(iface
);
4045 FIXME("(%p)->(%p)\n", This
, p
);
4049 static const IHTMLStyle3Vtbl HTMLStyle3Vtbl
= {
4050 HTMLStyle3_QueryInterface
,
4053 HTMLStyle3_GetTypeInfoCount
,
4054 HTMLStyle3_GetTypeInfo
,
4055 HTMLStyle3_GetIDsOfNames
,
4057 HTMLStyle3_put_layoutFlow
,
4058 HTMLStyle3_get_layoutFlow
,
4059 HTMLStyle3_put_zoom
,
4060 HTMLStyle3_get_zoom
,
4061 HTMLStyle3_put_wordWrap
,
4062 HTMLStyle3_get_wordWrap
,
4063 HTMLStyle3_put_textUnderlinePosition
,
4064 HTMLStyle3_get_textUnderlinePosition
,
4065 HTMLStyle3_put_scrollbarBaseColor
,
4066 HTMLStyle3_get_scrollbarBaseColor
,
4067 HTMLStyle3_put_scrollbarFaceColor
,
4068 HTMLStyle3_get_scrollbarFaceColor
,
4069 HTMLStyle3_put_scrollbar3dLightColor
,
4070 HTMLStyle3_get_scrollbar3dLightColor
,
4071 HTMLStyle3_put_scrollbarShadowColor
,
4072 HTMLStyle3_get_scrollbarShadowColor
,
4073 HTMLStyle3_put_scrollbarHighlightColor
,
4074 HTMLStyle3_get_scrollbarHighlightColor
,
4075 HTMLStyle3_put_scrollbarDarkShadowColor
,
4076 HTMLStyle3_get_scrollbarDarkShadowColor
,
4077 HTMLStyle3_put_scrollbarArrowColor
,
4078 HTMLStyle3_get_scrollbarArrowColor
,
4079 HTMLStyle3_put_scrollbarTrackColor
,
4080 HTMLStyle3_get_scrollbarTrackColor
,
4081 HTMLStyle3_put_writingMode
,
4082 HTMLStyle3_get_writingMode
,
4083 HTMLStyle3_put_textAlignLast
,
4084 HTMLStyle3_get_textAlignLast
,
4085 HTMLStyle3_put_textKashidaSpace
,
4086 HTMLStyle3_get_textKashidaSpace
4090 * IHTMLStyle4 Interface
4092 static inline HTMLStyle
*impl_from_IHTMLStyle4(IHTMLStyle4
*iface
)
4094 return CONTAINING_RECORD(iface
, HTMLStyle
, IHTMLStyle4_iface
);
4097 static HRESULT WINAPI
HTMLStyle4_QueryInterface(IHTMLStyle4
*iface
, REFIID riid
, void **ppv
)
4099 HTMLStyle
*This
= impl_from_IHTMLStyle4(iface
);
4101 return IHTMLStyle_QueryInterface(&This
->IHTMLStyle_iface
, riid
, ppv
);
4104 static ULONG WINAPI
HTMLStyle4_AddRef(IHTMLStyle4
*iface
)
4106 HTMLStyle
*This
= impl_from_IHTMLStyle4(iface
);
4108 return IHTMLStyle_AddRef(&This
->IHTMLStyle_iface
);
4111 static ULONG WINAPI
HTMLStyle4_Release(IHTMLStyle4
*iface
)
4113 HTMLStyle
*This
= impl_from_IHTMLStyle4(iface
);
4115 return IHTMLStyle_Release(&This
->IHTMLStyle_iface
);
4118 static HRESULT WINAPI
HTMLStyle4_GetTypeInfoCount(IHTMLStyle4
*iface
, UINT
*pctinfo
)
4120 HTMLStyle
*This
= impl_from_IHTMLStyle4(iface
);
4121 return IDispatchEx_GetTypeInfoCount(&This
->dispex
.IDispatchEx_iface
, pctinfo
);
4124 static HRESULT WINAPI
HTMLStyle4_GetTypeInfo(IHTMLStyle4
*iface
, UINT iTInfo
,
4125 LCID lcid
, ITypeInfo
**ppTInfo
)
4127 HTMLStyle
*This
= impl_from_IHTMLStyle4(iface
);
4128 return IDispatchEx_GetTypeInfo(&This
->dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
4131 static HRESULT WINAPI
HTMLStyle4_GetIDsOfNames(IHTMLStyle4
*iface
, REFIID riid
,
4132 LPOLESTR
*rgszNames
, UINT cNames
,
4133 LCID lcid
, DISPID
*rgDispId
)
4135 HTMLStyle
*This
= impl_from_IHTMLStyle4(iface
);
4136 return IDispatchEx_GetIDsOfNames(&This
->dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
4140 static HRESULT WINAPI
HTMLStyle4_Invoke(IHTMLStyle4
*iface
, DISPID dispIdMember
,
4141 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
4142 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
4144 HTMLStyle
*This
= impl_from_IHTMLStyle4(iface
);
4145 return IDispatchEx_Invoke(&This
->dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
4146 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
4149 static HRESULT WINAPI
HTMLStyle4_put_textOverflow(IHTMLStyle4
*iface
, BSTR v
)
4151 HTMLStyle
*This
= impl_from_IHTMLStyle4(iface
);
4152 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
4156 static HRESULT WINAPI
HTMLStyle4_get_textOverflow(IHTMLStyle4
*iface
, BSTR
*p
)
4158 HTMLStyle
*This
= impl_from_IHTMLStyle4(iface
);
4159 FIXME("(%p)->(%p)\n", This
, p
);
4163 static HRESULT WINAPI
HTMLStyle4_put_minHeight(IHTMLStyle4
*iface
, VARIANT v
)
4165 HTMLStyle
*This
= impl_from_IHTMLStyle4(iface
);
4167 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4169 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_MIN_HEIGHT
, &v
, 0);
4172 static HRESULT WINAPI
HTMLStyle4_get_minHeight(IHTMLStyle4
*iface
, VARIANT
*p
)
4174 HTMLStyle
*This
= impl_from_IHTMLStyle4(iface
);
4176 TRACE("(%p)->(%p)\n", This
, p
);
4178 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_MIN_HEIGHT
, p
, 0);
4181 static const IHTMLStyle4Vtbl HTMLStyle4Vtbl
= {
4182 HTMLStyle4_QueryInterface
,
4185 HTMLStyle4_GetTypeInfoCount
,
4186 HTMLStyle4_GetTypeInfo
,
4187 HTMLStyle4_GetIDsOfNames
,
4189 HTMLStyle4_put_textOverflow
,
4190 HTMLStyle4_get_textOverflow
,
4191 HTMLStyle4_put_minHeight
,
4192 HTMLStyle4_get_minHeight
4195 static inline HTMLStyle
*impl_from_IHTMLStyle5(IHTMLStyle5
*iface
)
4197 return CONTAINING_RECORD(iface
, HTMLStyle
, IHTMLStyle5_iface
);
4200 static HRESULT WINAPI
HTMLStyle5_QueryInterface(IHTMLStyle5
*iface
, REFIID riid
, void **ppv
)
4202 HTMLStyle
*This
= impl_from_IHTMLStyle5(iface
);
4204 return IHTMLStyle_QueryInterface(&This
->IHTMLStyle_iface
, riid
, ppv
);
4207 static ULONG WINAPI
HTMLStyle5_AddRef(IHTMLStyle5
*iface
)
4209 HTMLStyle
*This
= impl_from_IHTMLStyle5(iface
);
4211 return IHTMLStyle_AddRef(&This
->IHTMLStyle_iface
);
4214 static ULONG WINAPI
HTMLStyle5_Release(IHTMLStyle5
*iface
)
4216 HTMLStyle
*This
= impl_from_IHTMLStyle5(iface
);
4218 return IHTMLStyle_Release(&This
->IHTMLStyle_iface
);
4221 static HRESULT WINAPI
HTMLStyle5_GetTypeInfoCount(IHTMLStyle5
*iface
, UINT
*pctinfo
)
4223 HTMLStyle
*This
= impl_from_IHTMLStyle5(iface
);
4224 return IDispatchEx_GetTypeInfoCount(&This
->dispex
.IDispatchEx_iface
, pctinfo
);
4227 static HRESULT WINAPI
HTMLStyle5_GetTypeInfo(IHTMLStyle5
*iface
, UINT iTInfo
,
4228 LCID lcid
, ITypeInfo
**ppTInfo
)
4230 HTMLStyle
*This
= impl_from_IHTMLStyle5(iface
);
4231 return IDispatchEx_GetTypeInfo(&This
->dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
4234 static HRESULT WINAPI
HTMLStyle5_GetIDsOfNames(IHTMLStyle5
*iface
, REFIID riid
,
4235 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
4237 HTMLStyle
*This
= impl_from_IHTMLStyle5(iface
);
4238 return IDispatchEx_GetIDsOfNames(&This
->dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
4242 static HRESULT WINAPI
HTMLStyle5_Invoke(IHTMLStyle5
*iface
, DISPID dispIdMember
,
4243 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
4244 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
4246 HTMLStyle
*This
= impl_from_IHTMLStyle5(iface
);
4247 return IDispatchEx_Invoke(&This
->dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
4248 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
4251 static HRESULT WINAPI
HTMLStyle5_put_msInterpolationMode(IHTMLStyle5
*iface
, BSTR v
)
4253 HTMLStyle
*This
= impl_from_IHTMLStyle5(iface
);
4254 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
4258 static HRESULT WINAPI
HTMLStyle5_get_msInterpolationMode(IHTMLStyle5
*iface
, BSTR
*p
)
4260 HTMLStyle
*This
= impl_from_IHTMLStyle5(iface
);
4261 FIXME("(%p)->(%p)\n", This
, p
);
4265 static HRESULT WINAPI
HTMLStyle5_put_maxHeight(IHTMLStyle5
*iface
, VARIANT v
)
4267 HTMLStyle
*This
= impl_from_IHTMLStyle5(iface
);
4269 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4271 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_MAX_HEIGHT
, &v
, ATTR_FIX_PX
);
4274 static HRESULT WINAPI
HTMLStyle5_get_maxHeight(IHTMLStyle5
*iface
, VARIANT
*p
)
4276 HTMLStyle
*This
= impl_from_IHTMLStyle5(iface
);
4278 TRACE("(%p)->(%s)\n", This
, debugstr_variant(p
));
4280 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_MAX_HEIGHT
, p
, 0);
4283 static HRESULT WINAPI
HTMLStyle5_put_minWidth(IHTMLStyle5
*iface
, VARIANT v
)
4285 HTMLStyle
*This
= impl_from_IHTMLStyle5(iface
);
4287 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4289 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_MIN_WIDTH
, &v
, ATTR_FIX_PX
);
4292 static HRESULT WINAPI
HTMLStyle5_get_minWidth(IHTMLStyle5
*iface
, VARIANT
*p
)
4294 HTMLStyle
*This
= impl_from_IHTMLStyle5(iface
);
4296 TRACE("(%p)->(%p)\n", This
, p
);
4298 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_MIN_WIDTH
, p
, 0);
4301 static HRESULT WINAPI
HTMLStyle5_put_maxWidth(IHTMLStyle5
*iface
, VARIANT v
)
4303 HTMLStyle
*This
= impl_from_IHTMLStyle5(iface
);
4305 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4307 return set_nsstyle_attr_var(This
->nsstyle
, STYLEID_MAX_WIDTH
, &v
, ATTR_FIX_PX
);
4310 static HRESULT WINAPI
HTMLStyle5_get_maxWidth(IHTMLStyle5
*iface
, VARIANT
*p
)
4312 HTMLStyle
*This
= impl_from_IHTMLStyle5(iface
);
4314 TRACE("(%p)->(%p)\n", This
, p
);
4316 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_MAX_WIDTH
, p
, 0);
4319 static const IHTMLStyle5Vtbl HTMLStyle5Vtbl
= {
4320 HTMLStyle5_QueryInterface
,
4323 HTMLStyle5_GetTypeInfoCount
,
4324 HTMLStyle5_GetTypeInfo
,
4325 HTMLStyle5_GetIDsOfNames
,
4327 HTMLStyle5_put_msInterpolationMode
,
4328 HTMLStyle5_get_msInterpolationMode
,
4329 HTMLStyle5_put_maxHeight
,
4330 HTMLStyle5_get_maxHeight
,
4331 HTMLStyle5_put_minWidth
,
4332 HTMLStyle5_get_minWidth
,
4333 HTMLStyle5_put_maxWidth
,
4334 HTMLStyle5_get_maxWidth
4337 static inline HTMLStyle
*impl_from_IHTMLStyle6(IHTMLStyle6
*iface
)
4339 return CONTAINING_RECORD(iface
, HTMLStyle
, IHTMLStyle6_iface
);
4342 static HRESULT WINAPI
HTMLStyle6_QueryInterface(IHTMLStyle6
*iface
, REFIID riid
, void **ppv
)
4344 HTMLStyle
*This
= impl_from_IHTMLStyle6(iface
);
4346 return IHTMLStyle_QueryInterface(&This
->IHTMLStyle_iface
, riid
, ppv
);
4349 static ULONG WINAPI
HTMLStyle6_AddRef(IHTMLStyle6
*iface
)
4351 HTMLStyle
*This
= impl_from_IHTMLStyle6(iface
);
4353 return IHTMLStyle_AddRef(&This
->IHTMLStyle_iface
);
4356 static ULONG WINAPI
HTMLStyle6_Release(IHTMLStyle6
*iface
)
4358 HTMLStyle
*This
= impl_from_IHTMLStyle6(iface
);
4360 return IHTMLStyle_Release(&This
->IHTMLStyle_iface
);
4363 static HRESULT WINAPI
HTMLStyle6_GetTypeInfoCount(IHTMLStyle6
*iface
, UINT
*pctinfo
)
4365 HTMLStyle
*This
= impl_from_IHTMLStyle6(iface
);
4366 return IDispatchEx_GetTypeInfoCount(&This
->dispex
.IDispatchEx_iface
, pctinfo
);
4369 static HRESULT WINAPI
HTMLStyle6_GetTypeInfo(IHTMLStyle6
*iface
, UINT iTInfo
,
4370 LCID lcid
, ITypeInfo
**ppTInfo
)
4372 HTMLStyle
*This
= impl_from_IHTMLStyle6(iface
);
4373 return IDispatchEx_GetTypeInfo(&This
->dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
4376 static HRESULT WINAPI
HTMLStyle6_GetIDsOfNames(IHTMLStyle6
*iface
, REFIID riid
,
4377 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
4379 HTMLStyle
*This
= impl_from_IHTMLStyle6(iface
);
4380 return IDispatchEx_GetIDsOfNames(&This
->dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
4384 static HRESULT WINAPI
HTMLStyle6_Invoke(IHTMLStyle6
*iface
, DISPID dispIdMember
,
4385 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
4386 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
4388 HTMLStyle
*This
= impl_from_IHTMLStyle6(iface
);
4389 return IDispatchEx_Invoke(&This
->dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
4390 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
4393 static HRESULT WINAPI
HTMLStyle6_put_content(IHTMLStyle6
*iface
, BSTR v
)
4395 HTMLStyle
*This
= impl_from_IHTMLStyle6(iface
);
4396 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
4400 static HRESULT WINAPI
HTMLStyle6_get_content(IHTMLStyle6
*iface
, BSTR
*p
)
4402 HTMLStyle
*This
= impl_from_IHTMLStyle6(iface
);
4403 FIXME("(%p)->(%p)\n", This
, p
);
4407 static HRESULT WINAPI
HTMLStyle6_put_contentSide(IHTMLStyle6
*iface
, BSTR v
)
4409 HTMLStyle
*This
= impl_from_IHTMLStyle6(iface
);
4410 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
4414 static HRESULT WINAPI
HTMLStyle6_get_contentSide(IHTMLStyle6
*iface
, BSTR
*p
)
4416 HTMLStyle
*This
= impl_from_IHTMLStyle6(iface
);
4417 FIXME("(%p)->(%p)\n", This
, p
);
4421 static HRESULT WINAPI
HTMLStyle6_put_counterIncrement(IHTMLStyle6
*iface
, BSTR v
)
4423 HTMLStyle
*This
= impl_from_IHTMLStyle6(iface
);
4424 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
4428 static HRESULT WINAPI
HTMLStyle6_get_counterIncrement(IHTMLStyle6
*iface
, BSTR
*p
)
4430 HTMLStyle
*This
= impl_from_IHTMLStyle6(iface
);
4431 FIXME("(%p)->(%p)\n", This
, p
);
4435 static HRESULT WINAPI
HTMLStyle6_put_counterReset(IHTMLStyle6
*iface
, BSTR v
)
4437 HTMLStyle
*This
= impl_from_IHTMLStyle6(iface
);
4438 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
4442 static HRESULT WINAPI
HTMLStyle6_get_counterReset(IHTMLStyle6
*iface
, BSTR
*p
)
4444 HTMLStyle
*This
= impl_from_IHTMLStyle6(iface
);
4445 FIXME("(%p)->(%p)\n", This
, p
);
4449 static HRESULT WINAPI
HTMLStyle6_put_outline(IHTMLStyle6
*iface
, BSTR v
)
4451 HTMLStyle
*This
= impl_from_IHTMLStyle6(iface
);
4453 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
4455 return set_nsstyle_attr(This
->nsstyle
, STYLEID_OUTLINE
, v
, 0);
4458 static HRESULT WINAPI
HTMLStyle6_get_outline(IHTMLStyle6
*iface
, BSTR
*p
)
4460 HTMLStyle
*This
= impl_from_IHTMLStyle6(iface
);
4462 TRACE("(%p)->(%p)\n", This
, p
);
4464 return get_nsstyle_attr(This
->nsstyle
, STYLEID_OUTLINE
, p
, ATTR_NO_NULL
);
4467 static HRESULT WINAPI
HTMLStyle6_put_outlineWidth(IHTMLStyle6
*iface
, VARIANT v
)
4469 HTMLStyle
*This
= impl_from_IHTMLStyle6(iface
);
4470 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4474 static HRESULT WINAPI
HTMLStyle6_get_outlineWidth(IHTMLStyle6
*iface
, VARIANT
*p
)
4476 HTMLStyle
*This
= impl_from_IHTMLStyle6(iface
);
4477 FIXME("(%p)->(%p)\n", This
, p
);
4481 static HRESULT WINAPI
HTMLStyle6_put_outlineStyle(IHTMLStyle6
*iface
, BSTR v
)
4483 HTMLStyle
*This
= impl_from_IHTMLStyle6(iface
);
4484 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
4488 static HRESULT WINAPI
HTMLStyle6_get_outlineStyle(IHTMLStyle6
*iface
, BSTR
*p
)
4490 HTMLStyle
*This
= impl_from_IHTMLStyle6(iface
);
4491 FIXME("(%p)->(%p)\n", This
, p
);
4495 static HRESULT WINAPI
HTMLStyle6_put_outlineColor(IHTMLStyle6
*iface
, VARIANT v
)
4497 HTMLStyle
*This
= impl_from_IHTMLStyle6(iface
);
4498 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4502 static HRESULT WINAPI
HTMLStyle6_get_outlineColor(IHTMLStyle6
*iface
, VARIANT
*p
)
4504 HTMLStyle
*This
= impl_from_IHTMLStyle6(iface
);
4505 FIXME("(%p)->(%p)\n", This
, p
);
4509 static HRESULT WINAPI
HTMLStyle6_put_boxSizing(IHTMLStyle6
*iface
, BSTR v
)
4511 HTMLStyle
*This
= impl_from_IHTMLStyle6(iface
);
4513 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
4515 return set_nsstyle_attr(This
->nsstyle
, STYLEID_BOX_SIZING
, v
, 0);
4518 static HRESULT WINAPI
HTMLStyle6_get_boxSizing(IHTMLStyle6
*iface
, BSTR
*p
)
4520 HTMLStyle
*This
= impl_from_IHTMLStyle6(iface
);
4522 TRACE("(%p)->(%p)\n", This
, p
);
4524 return get_nsstyle_attr(This
->nsstyle
, STYLEID_BOX_SIZING
, p
, 0);
4527 static HRESULT WINAPI
HTMLStyle6_put_boxSpacing(IHTMLStyle6
*iface
, BSTR v
)
4529 HTMLStyle
*This
= impl_from_IHTMLStyle6(iface
);
4530 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
4534 static HRESULT WINAPI
HTMLStyle6_get_boxSpacing(IHTMLStyle6
*iface
, BSTR
*p
)
4536 HTMLStyle
*This
= impl_from_IHTMLStyle6(iface
);
4537 FIXME("(%p)->(%p)\n", This
, p
);
4541 static HRESULT WINAPI
HTMLStyle6_put_orphans(IHTMLStyle6
*iface
, VARIANT v
)
4543 HTMLStyle
*This
= impl_from_IHTMLStyle6(iface
);
4544 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4548 static HRESULT WINAPI
HTMLStyle6_get_orphans(IHTMLStyle6
*iface
, VARIANT
*p
)
4550 HTMLStyle
*This
= impl_from_IHTMLStyle6(iface
);
4551 FIXME("(%p)->(%p)\n", This
, p
);
4555 static HRESULT WINAPI
HTMLStyle6_put_windows(IHTMLStyle6
*iface
, VARIANT v
)
4557 HTMLStyle
*This
= impl_from_IHTMLStyle6(iface
);
4558 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4562 static HRESULT WINAPI
HTMLStyle6_get_windows(IHTMLStyle6
*iface
, VARIANT
*p
)
4564 HTMLStyle
*This
= impl_from_IHTMLStyle6(iface
);
4565 FIXME("(%p)->(%p)\n", This
, p
);
4569 static HRESULT WINAPI
HTMLStyle6_put_pageBreakInside(IHTMLStyle6
*iface
, BSTR v
)
4571 HTMLStyle
*This
= impl_from_IHTMLStyle6(iface
);
4572 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
4576 static HRESULT WINAPI
HTMLStyle6_get_pageBreakInside(IHTMLStyle6
*iface
, BSTR
*p
)
4578 HTMLStyle
*This
= impl_from_IHTMLStyle6(iface
);
4579 FIXME("(%p)->(%p)\n", This
, p
);
4583 static HRESULT WINAPI
HTMLStyle6_put_emptyCells(IHTMLStyle6
*iface
, BSTR v
)
4585 HTMLStyle
*This
= impl_from_IHTMLStyle6(iface
);
4586 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
4590 static HRESULT WINAPI
HTMLStyle6_get_emptyCells(IHTMLStyle6
*iface
, BSTR
*p
)
4592 HTMLStyle
*This
= impl_from_IHTMLStyle6(iface
);
4593 FIXME("(%p)->(%p)\n", This
, p
);
4597 static HRESULT WINAPI
HTMLStyle6_put_msBlockProgression(IHTMLStyle6
*iface
, BSTR v
)
4599 HTMLStyle
*This
= impl_from_IHTMLStyle6(iface
);
4600 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
4604 static HRESULT WINAPI
HTMLStyle6_get_msBlockProgression(IHTMLStyle6
*iface
, BSTR
*p
)
4606 HTMLStyle
*This
= impl_from_IHTMLStyle6(iface
);
4607 FIXME("(%p)->(%p)\n", This
, p
);
4611 static HRESULT WINAPI
HTMLStyle6_put_quotes(IHTMLStyle6
*iface
, BSTR v
)
4613 HTMLStyle
*This
= impl_from_IHTMLStyle6(iface
);
4614 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
4618 static HRESULT WINAPI
HTMLStyle6_get_quotes(IHTMLStyle6
*iface
, BSTR
*p
)
4620 HTMLStyle
*This
= impl_from_IHTMLStyle6(iface
);
4621 FIXME("(%p)->(%p)\n", This
, p
);
4625 static const IHTMLStyle6Vtbl HTMLStyle6Vtbl
= {
4626 HTMLStyle6_QueryInterface
,
4629 HTMLStyle6_GetTypeInfoCount
,
4630 HTMLStyle6_GetTypeInfo
,
4631 HTMLStyle6_GetIDsOfNames
,
4633 HTMLStyle6_put_content
,
4634 HTMLStyle6_get_content
,
4635 HTMLStyle6_put_contentSide
,
4636 HTMLStyle6_get_contentSide
,
4637 HTMLStyle6_put_counterIncrement
,
4638 HTMLStyle6_get_counterIncrement
,
4639 HTMLStyle6_put_counterReset
,
4640 HTMLStyle6_get_counterReset
,
4641 HTMLStyle6_put_outline
,
4642 HTMLStyle6_get_outline
,
4643 HTMLStyle6_put_outlineWidth
,
4644 HTMLStyle6_get_outlineWidth
,
4645 HTMLStyle6_put_outlineStyle
,
4646 HTMLStyle6_get_outlineStyle
,
4647 HTMLStyle6_put_outlineColor
,
4648 HTMLStyle6_get_outlineColor
,
4649 HTMLStyle6_put_boxSizing
,
4650 HTMLStyle6_get_boxSizing
,
4651 HTMLStyle6_put_boxSpacing
,
4652 HTMLStyle6_get_boxSpacing
,
4653 HTMLStyle6_put_orphans
,
4654 HTMLStyle6_get_orphans
,
4655 HTMLStyle6_put_windows
,
4656 HTMLStyle6_get_windows
,
4657 HTMLStyle6_put_pageBreakInside
,
4658 HTMLStyle6_get_pageBreakInside
,
4659 HTMLStyle6_put_emptyCells
,
4660 HTMLStyle6_get_emptyCells
,
4661 HTMLStyle6_put_msBlockProgression
,
4662 HTMLStyle6_get_msBlockProgression
,
4663 HTMLStyle6_put_quotes
,
4664 HTMLStyle6_get_quotes
4667 static HRESULT
HTMLStyle_get_dispid(DispatchEx
*dispex
, BSTR name
, DWORD flags
, DISPID
*dispid
)
4669 const style_tbl_entry_t
*style_entry
;
4671 style_entry
= lookup_style_tbl(name
);
4673 *dispid
= style_entry
->dispid
;
4677 return DISP_E_UNKNOWNNAME
;
4680 static const dispex_static_data_vtbl_t HTMLStyle_dispex_vtbl
= {
4682 HTMLStyle_get_dispid
,
4687 static const tid_t HTMLStyle_iface_tids
[] = {
4696 static dispex_static_data_t HTMLStyle_dispex
= {
4697 &HTMLStyle_dispex_vtbl
,
4699 HTMLStyle_iface_tids
4702 static HRESULT
get_style_from_elem(HTMLElement
*elem
, nsIDOMCSSStyleDeclaration
**ret
)
4704 nsIDOMElementCSSInlineStyle
*nselemstyle
;
4707 if(!elem
->dom_element
) {
4708 FIXME("comment element\n");
4712 nsres
= nsIDOMElement_QueryInterface(elem
->dom_element
, &IID_nsIDOMElementCSSInlineStyle
,
4713 (void**)&nselemstyle
);
4714 assert(nsres
== NS_OK
);
4716 nsres
= nsIDOMElementCSSInlineStyle_GetStyle(nselemstyle
, ret
);
4717 nsIDOMElementCSSInlineStyle_Release(nselemstyle
);
4718 if(NS_FAILED(nsres
)) {
4719 ERR("GetStyle failed: %08x\n", nsres
);
4726 HRESULT
HTMLStyle_Create(HTMLElement
*elem
, HTMLStyle
**ret
)
4728 nsIDOMCSSStyleDeclaration
*nsstyle
;
4732 hres
= get_style_from_elem(elem
, &nsstyle
);
4736 style
= heap_alloc_zero(sizeof(HTMLStyle
));
4738 nsIDOMCSSStyleDeclaration_Release(nsstyle
);
4739 return E_OUTOFMEMORY
;
4742 style
->IHTMLStyle_iface
.lpVtbl
= &HTMLStyleVtbl
;
4743 style
->IHTMLStyle2_iface
.lpVtbl
= &HTMLStyle2Vtbl
;
4744 style
->IHTMLStyle3_iface
.lpVtbl
= &HTMLStyle3Vtbl
;
4745 style
->IHTMLStyle4_iface
.lpVtbl
= &HTMLStyle4Vtbl
;
4746 style
->IHTMLStyle5_iface
.lpVtbl
= &HTMLStyle5Vtbl
;
4747 style
->IHTMLStyle6_iface
.lpVtbl
= &HTMLStyle6Vtbl
;
4750 style
->nsstyle
= nsstyle
;
4753 nsIDOMCSSStyleDeclaration_AddRef(nsstyle
);
4755 init_dispex(&style
->dispex
, (IUnknown
*)&style
->IHTMLStyle_iface
, &HTMLStyle_dispex
);
4761 HRESULT
get_elem_style(HTMLElement
*elem
, styleid_t styleid
, BSTR
*ret
)
4763 nsIDOMCSSStyleDeclaration
*style
;
4766 hres
= get_style_from_elem(elem
, &style
);
4770 hres
= get_nsstyle_attr(style
, styleid
, ret
, 0);
4771 nsIDOMCSSStyleDeclaration_Release(style
);
4775 HRESULT
set_elem_style(HTMLElement
*elem
, styleid_t styleid
, const WCHAR
*val
)
4777 nsIDOMCSSStyleDeclaration
*style
;
4780 hres
= get_style_from_elem(elem
, &style
);
4784 hres
= set_nsstyle_attr(style
, styleid
, val
, 0);
4785 nsIDOMCSSStyleDeclaration_Release(style
);