atl80: Added AtlComModuleRegisterServer implementation (based on AtlModuleRegisterSer...
[wine] / dlls / mshtml / htmlcurstyle.c
1 /*
2  * Copyright 2008 Jacek Caban for CodeWeavers
3  *
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.
8  *
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.
13  *
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
17  */
18
19 #include <stdarg.h>
20
21 #define COBJMACROS
22
23 #include "windef.h"
24 #include "winbase.h"
25 #include "winuser.h"
26 #include "ole2.h"
27
28 #include "mshtml_private.h"
29 #include "htmlstyle.h"
30
31 #include "wine/debug.h"
32
33 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
34
35 struct HTMLCurrentStyle {
36     DispatchEx dispex;
37     IHTMLCurrentStyle  IHTMLCurrentStyle_iface;
38     IHTMLCurrentStyle2 IHTMLCurrentStyle2_iface;
39     IHTMLCurrentStyle3 IHTMLCurrentStyle3_iface;
40     IHTMLCurrentStyle4 IHTMLCurrentStyle4_iface;
41
42     LONG ref;
43
44     nsIDOMCSSStyleDeclaration *nsstyle;
45     HTMLElement *elem;
46 };
47
48 static inline HTMLCurrentStyle *impl_from_IHTMLCurrentStyle(IHTMLCurrentStyle *iface)
49 {
50     return CONTAINING_RECORD(iface, HTMLCurrentStyle, IHTMLCurrentStyle_iface);
51 }
52
53 static inline HTMLCurrentStyle *impl_from_IHTMLCurrentStyle2(IHTMLCurrentStyle2 *iface)
54 {
55     return CONTAINING_RECORD(iface, HTMLCurrentStyle, IHTMLCurrentStyle2_iface);
56 }
57
58 static inline HTMLCurrentStyle *impl_from_IHTMLCurrentStyle3(IHTMLCurrentStyle3 *iface)
59 {
60     return CONTAINING_RECORD(iface, HTMLCurrentStyle, IHTMLCurrentStyle3_iface);
61 }
62
63 static inline HTMLCurrentStyle *impl_from_IHTMLCurrentStyle4(IHTMLCurrentStyle4 *iface)
64 {
65     return CONTAINING_RECORD(iface, HTMLCurrentStyle, IHTMLCurrentStyle4_iface);
66 }
67
68 static HRESULT WINAPI HTMLCurrentStyle_QueryInterface(IHTMLCurrentStyle *iface, REFIID riid, void **ppv)
69 {
70     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
71
72     *ppv = NULL;
73
74     if(IsEqualGUID(&IID_IUnknown, riid)) {
75         TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
76         *ppv = &This->IHTMLCurrentStyle_iface;
77     }else if(IsEqualGUID(&IID_IHTMLCurrentStyle, riid)) {
78         TRACE("(%p)->(IID_IHTMLCurrentStyle %p)\n", This, ppv);
79         *ppv = &This->IHTMLCurrentStyle_iface;
80     }else if(IsEqualGUID(&IID_IHTMLCurrentStyle2, riid)) {
81         TRACE("(%p)->(IID_IHTMLCurrentStyle2 %p)\n", This, ppv);
82         *ppv = &This->IHTMLCurrentStyle2_iface;
83     }else if(IsEqualGUID(&IID_IHTMLCurrentStyle3, riid)) {
84         TRACE("(%p)->(IID_IHTMLCurrentStyle3 %p)\n", This, ppv);
85         *ppv = &This->IHTMLCurrentStyle3_iface;
86     }else if(IsEqualGUID(&IID_IHTMLCurrentStyle4, riid)) {
87         TRACE("(%p)->(IID_IHTMLCurrentStyle4 %p)\n", This, ppv);
88         *ppv = &This->IHTMLCurrentStyle4_iface;
89     }else if(dispex_query_interface(&This->dispex, riid, ppv)) {
90         return *ppv ? S_OK : E_NOINTERFACE;
91     }
92
93     if(*ppv) {
94         IUnknown_AddRef((IUnknown*)*ppv);
95         return S_OK;
96     }
97
98     WARN("unsupported %s\n", debugstr_guid(riid));
99     return E_NOINTERFACE;
100 }
101
102 static ULONG WINAPI HTMLCurrentStyle_AddRef(IHTMLCurrentStyle *iface)
103 {
104     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
105     LONG ref = InterlockedIncrement(&This->ref);
106
107     TRACE("(%p) ref=%d\n", This, ref);
108
109     return ref;
110 }
111
112 static ULONG WINAPI HTMLCurrentStyle_Release(IHTMLCurrentStyle *iface)
113 {
114     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
115     LONG ref = InterlockedDecrement(&This->ref);
116
117     TRACE("(%p) ref=%d\n", This, ref);
118
119     if(!ref) {
120         if(This->nsstyle)
121             nsIDOMCSSStyleDeclaration_Release(This->nsstyle);
122         IHTMLElement_Release(&This->elem->IHTMLElement_iface);
123         release_dispex(&This->dispex);
124         heap_free(This);
125     }
126
127     return ref;
128 }
129
130 static HRESULT WINAPI HTMLCurrentStyle_GetTypeInfoCount(IHTMLCurrentStyle *iface, UINT *pctinfo)
131 {
132     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
133     return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
134 }
135
136 static HRESULT WINAPI HTMLCurrentStyle_GetTypeInfo(IHTMLCurrentStyle *iface, UINT iTInfo,
137         LCID lcid, ITypeInfo **ppTInfo)
138 {
139     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
140     return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
141 }
142
143 static HRESULT WINAPI HTMLCurrentStyle_GetIDsOfNames(IHTMLCurrentStyle *iface, REFIID riid,
144         LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
145 {
146     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
147     return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
148             lcid, rgDispId);
149 }
150
151 static HRESULT WINAPI HTMLCurrentStyle_Invoke(IHTMLCurrentStyle *iface, DISPID dispIdMember,
152         REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
153         VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
154 {
155     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
156     return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
157             wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
158 }
159
160 static HRESULT WINAPI HTMLCurrentStyle_get_position(IHTMLCurrentStyle *iface, BSTR *p)
161 {
162     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
163
164     TRACE("(%p)->(%p)\n", This, p);
165
166     return get_nsstyle_attr(This->nsstyle, STYLEID_POSITION, p, 0);
167 }
168
169 static HRESULT WINAPI HTMLCurrentStyle_get_styleFloat(IHTMLCurrentStyle *iface, BSTR *p)
170 {
171     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
172     FIXME("(%p)->(%p)\n", This, p);
173     return E_NOTIMPL;
174 }
175
176 static HRESULT WINAPI HTMLCurrentStyle_get_color(IHTMLCurrentStyle *iface, VARIANT *p)
177 {
178     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
179     TRACE("(%p)->(%p)\n", This, p);
180     return get_nsstyle_attr_var(This->nsstyle, STYLEID_COLOR, p, 0);
181 }
182
183 static HRESULT WINAPI HTMLCurrentStyle_get_backgroundColor(IHTMLCurrentStyle *iface, VARIANT *p)
184 {
185     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
186     TRACE("(%p)->(%p)\n", This, p);
187     return get_nsstyle_attr_var(This->nsstyle, STYLEID_BACKGROUND_COLOR, p, 0);
188 }
189
190 static HRESULT WINAPI HTMLCurrentStyle_get_fontFamily(IHTMLCurrentStyle *iface, BSTR *p)
191 {
192     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
193
194     TRACE("(%p)->(%p)\n", This, p);
195
196     return get_nsstyle_attr(This->nsstyle, STYLEID_FONT_FAMILY, p, 0);
197 }
198
199 static HRESULT WINAPI HTMLCurrentStyle_get_fontStyle(IHTMLCurrentStyle *iface, BSTR *p)
200 {
201     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
202     TRACE("(%p)->(%p)\n", This, p);
203     return get_nsstyle_attr(This->nsstyle, STYLEID_FONT_STYLE, p, 0);
204 }
205
206 static HRESULT WINAPI HTMLCurrentStyle_get_fontVariant(IHTMLCurrentStyle *iface, BSTR *p)
207 {
208     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
209     TRACE("(%p)->(%p)\n", This, p);
210     return get_nsstyle_attr(This->nsstyle, STYLEID_FONT_VARIANT, p, 0);
211 }
212
213 static HRESULT WINAPI HTMLCurrentStyle_get_fontWeight(IHTMLCurrentStyle *iface, VARIANT *p)
214 {
215     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
216     TRACE("(%p)->(%p)\n", This, p);
217     return get_nsstyle_attr_var(This->nsstyle, STYLEID_FONT_WEIGHT, p, ATTR_STR_TO_INT);
218 }
219
220 static HRESULT WINAPI HTMLCurrentStyle_get_fontSize(IHTMLCurrentStyle *iface, VARIANT *p)
221 {
222     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
223     TRACE("(%p)->(%p)\n", This, p);
224     return get_nsstyle_attr_var(This->nsstyle, STYLEID_FONT_SIZE, p, 0);
225 }
226
227 static HRESULT WINAPI HTMLCurrentStyle_get_backgroundImage(IHTMLCurrentStyle *iface, BSTR *p)
228 {
229     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
230     TRACE("(%p)->(%p)\n", This, p);
231     return get_nsstyle_attr(This->nsstyle, STYLEID_BACKGROUND_IMAGE, p, 0);
232 }
233
234 static HRESULT WINAPI HTMLCurrentStyle_get_backgroundPositionX(IHTMLCurrentStyle *iface, VARIANT *p)
235 {
236     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
237     FIXME("(%p)->(%p)\n", This, p);
238     return E_NOTIMPL;
239 }
240
241 static HRESULT WINAPI HTMLCurrentStyle_get_backgroundPositionY(IHTMLCurrentStyle *iface, VARIANT *p)
242 {
243     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
244     FIXME("(%p)->(%p)\n", This, p);
245     return E_NOTIMPL;
246 }
247
248 static HRESULT WINAPI HTMLCurrentStyle_get_backgroundRepeat(IHTMLCurrentStyle *iface, BSTR *p)
249 {
250     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
251     TRACE("(%p)->(%p)\n", This, p);
252     return get_nsstyle_attr(This->nsstyle, STYLEID_BACKGROUND_REPEAT, p, 0);
253 }
254
255 static HRESULT WINAPI HTMLCurrentStyle_get_borderLeftColor(IHTMLCurrentStyle *iface, VARIANT *p)
256 {
257     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
258     TRACE("(%p)->(%p)\n", This, p);
259     return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_LEFT_COLOR, p, 0);
260 }
261
262 static HRESULT WINAPI HTMLCurrentStyle_get_borderTopColor(IHTMLCurrentStyle *iface, VARIANT *p)
263 {
264     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
265     TRACE("(%p)->(%p)\n", This, p);
266     return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_TOP_COLOR, p, 0);
267 }
268
269 static HRESULT WINAPI HTMLCurrentStyle_get_borderRightColor(IHTMLCurrentStyle *iface, VARIANT *p)
270 {
271     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
272     TRACE("(%p)->(%p)\n", This, p);
273     return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_RIGHT_COLOR, p, 0);
274 }
275
276 static HRESULT WINAPI HTMLCurrentStyle_get_borderBottomColor(IHTMLCurrentStyle *iface, VARIANT *p)
277 {
278     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
279     TRACE("(%p)->(%p)\n", This, p);
280     return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_BOTTOM_COLOR, p, 0);
281 }
282
283 static HRESULT WINAPI HTMLCurrentStyle_get_borderTopStyle(IHTMLCurrentStyle *iface, BSTR *p)
284 {
285     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
286     TRACE("(%p)->(%p)\n", This, p);
287     return get_nsstyle_attr(This->nsstyle, STYLEID_BORDER_TOP_STYLE, p, 0);
288 }
289
290 static HRESULT WINAPI HTMLCurrentStyle_get_borderRightStyle(IHTMLCurrentStyle *iface, BSTR *p)
291 {
292     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
293     TRACE("(%p)->(%p)\n", This, p);
294     return get_nsstyle_attr(This->nsstyle, STYLEID_BORDER_RIGHT_STYLE, p, 0);
295 }
296
297 static HRESULT WINAPI HTMLCurrentStyle_get_borderBottomStyle(IHTMLCurrentStyle *iface, BSTR *p)
298 {
299     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
300     TRACE("(%p)->(%p)\n", This, p);
301     return get_nsstyle_attr(This->nsstyle, STYLEID_BORDER_BOTTOM_STYLE, p, 0);
302 }
303
304 static HRESULT WINAPI HTMLCurrentStyle_get_borderLeftStyle(IHTMLCurrentStyle *iface, BSTR *p)
305 {
306     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
307     TRACE("(%p)->(%p)\n", This, p);
308     return get_nsstyle_attr(This->nsstyle, STYLEID_BORDER_LEFT_STYLE, p, 0);
309 }
310
311 static HRESULT WINAPI HTMLCurrentStyle_get_borderTopWidth(IHTMLCurrentStyle *iface, VARIANT *p)
312 {
313     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
314     TRACE("(%p)->(%p)\n", This, p);
315     return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_TOP_WIDTH, p, 0);
316 }
317
318 static HRESULT WINAPI HTMLCurrentStyle_get_borderRightWidth(IHTMLCurrentStyle *iface, VARIANT *p)
319 {
320     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
321     TRACE("(%p)->(%p)\n", This, p);
322     return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_RIGHT_WIDTH, p, 0);
323 }
324
325 static HRESULT WINAPI HTMLCurrentStyle_get_borderBottomWidth(IHTMLCurrentStyle *iface, VARIANT *p)
326 {
327     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
328     TRACE("(%p)->(%p)\n", This, p);
329     return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_BOTTOM_WIDTH, p, 0);
330 }
331
332 static HRESULT WINAPI HTMLCurrentStyle_get_borderLeftWidth(IHTMLCurrentStyle *iface, VARIANT *p)
333 {
334     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
335     TRACE("(%p)->(%p)\n", This, p);
336     return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_LEFT_WIDTH, p, 0);
337 }
338
339 static HRESULT WINAPI HTMLCurrentStyle_get_left(IHTMLCurrentStyle *iface, VARIANT *p)
340 {
341     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
342     TRACE("(%p)->(%p)\n", This, p);
343     return get_nsstyle_attr_var(This->nsstyle, STYLEID_LEFT, p, 0);
344 }
345
346 static HRESULT WINAPI HTMLCurrentStyle_get_top(IHTMLCurrentStyle *iface, VARIANT *p)
347 {
348     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
349     TRACE("(%p)->(%p)\n", This, p);
350     return get_nsstyle_attr_var(This->nsstyle, STYLEID_TOP, p, 0);
351 }
352
353 static HRESULT WINAPI HTMLCurrentStyle_get_width(IHTMLCurrentStyle *iface, VARIANT *p)
354 {
355     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
356     TRACE("(%p)->(%p)\n", This, p);
357     return get_nsstyle_attr_var(This->nsstyle, STYLEID_WIDTH, p, 0);
358 }
359
360 static HRESULT WINAPI HTMLCurrentStyle_get_height(IHTMLCurrentStyle *iface, VARIANT *p)
361 {
362     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
363     TRACE("(%p)->(%p)\n", This, p);
364     return get_nsstyle_attr_var(This->nsstyle, STYLEID_HEIGHT, p, 0);
365 }
366
367 static HRESULT WINAPI HTMLCurrentStyle_get_paddingLeft(IHTMLCurrentStyle *iface, VARIANT *p)
368 {
369     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
370     TRACE("(%p)->(%p)\n", This, p);
371     return get_nsstyle_attr_var(This->nsstyle, STYLEID_PADDING_LEFT, p, 0);
372 }
373
374 static HRESULT WINAPI HTMLCurrentStyle_get_paddingTop(IHTMLCurrentStyle *iface, VARIANT *p)
375 {
376     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
377     TRACE("(%p)->(%p)\n", This, p);
378     return get_nsstyle_attr_var(This->nsstyle, STYLEID_PADDING_TOP, p, 0);
379 }
380
381 static HRESULT WINAPI HTMLCurrentStyle_get_paddingRight(IHTMLCurrentStyle *iface, VARIANT *p)
382 {
383     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
384     TRACE("(%p)->(%p)\n", This, p);
385     return get_nsstyle_attr_var(This->nsstyle, STYLEID_PADDING_RIGHT, p, 0);
386 }
387
388 static HRESULT WINAPI HTMLCurrentStyle_get_paddingBottom(IHTMLCurrentStyle *iface, VARIANT *p)
389 {
390     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
391     TRACE("(%p)->(%p)\n", This, p);
392     return get_nsstyle_attr_var(This->nsstyle, STYLEID_PADDING_BOTTOM, p, 0);
393 }
394
395 static HRESULT WINAPI HTMLCurrentStyle_get_textAlign(IHTMLCurrentStyle *iface, BSTR *p)
396 {
397     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
398     TRACE("(%p)->(%p)\n", This, p);
399     return get_nsstyle_attr(This->nsstyle, STYLEID_TEXT_ALIGN, p, 0);
400 }
401
402 static HRESULT WINAPI HTMLCurrentStyle_get_textDecoration(IHTMLCurrentStyle *iface, BSTR *p)
403 {
404     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
405     TRACE("(%p)->(%p)\n", This, p);
406     return get_nsstyle_attr(This->nsstyle, STYLEID_TEXT_DECORATION, p, 0);
407 }
408
409 static HRESULT WINAPI HTMLCurrentStyle_get_display(IHTMLCurrentStyle *iface, BSTR *p)
410 {
411     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
412
413     TRACE("(%p)->(%p)\n", This, p);
414
415     return get_nsstyle_attr(This->nsstyle, STYLEID_DISPLAY, p, 0);
416 }
417
418 static HRESULT WINAPI HTMLCurrentStyle_get_visibility(IHTMLCurrentStyle *iface, BSTR *p)
419 {
420     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
421
422     TRACE("(%p)->(%p)\n", This, p);
423
424     return get_nsstyle_attr(This->nsstyle, STYLEID_VISIBILITY, p, 0);
425 }
426
427 static HRESULT WINAPI HTMLCurrentStyle_get_zIndex(IHTMLCurrentStyle *iface, VARIANT *p)
428 {
429     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
430     TRACE("(%p)->(%p)\n", This, p);
431     return get_nsstyle_attr_var(This->nsstyle, STYLEID_Z_INDEX, p, ATTR_STR_TO_INT);
432 }
433
434 static HRESULT WINAPI HTMLCurrentStyle_get_letterSpacing(IHTMLCurrentStyle *iface, VARIANT *p)
435 {
436     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
437     TRACE("(%p)->(%p)\n", This, p);
438     return get_nsstyle_attr_var(This->nsstyle, STYLEID_LETTER_SPACING, p, 0);
439 }
440
441 static HRESULT WINAPI HTMLCurrentStyle_get_lineHeight(IHTMLCurrentStyle *iface, VARIANT *p)
442 {
443     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
444     TRACE("(%p)->(%p)\n", This, p);
445     return get_nsstyle_attr_var(This->nsstyle, STYLEID_LINE_HEIGHT, p, 0);
446 }
447
448 static HRESULT WINAPI HTMLCurrentStyle_get_textIndent(IHTMLCurrentStyle *iface, VARIANT *p)
449 {
450     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
451     TRACE("(%p)->(%p)\n", This, p);
452     return get_nsstyle_attr_var(This->nsstyle, STYLEID_TEXT_INDENT, p, 0);
453 }
454
455 static HRESULT WINAPI HTMLCurrentStyle_get_verticalAlign(IHTMLCurrentStyle *iface, VARIANT *p)
456 {
457     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
458     TRACE("(%p)->(%p)\n", This, p);
459     return get_nsstyle_attr_var(This->nsstyle, STYLEID_VERTICAL_ALIGN, p, 0);
460 }
461
462 static HRESULT WINAPI HTMLCurrentStyle_get_backgroundAttachment(IHTMLCurrentStyle *iface, BSTR *p)
463 {
464     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
465     FIXME("(%p)->(%p)\n", This, p);
466     return E_NOTIMPL;
467 }
468
469 static HRESULT WINAPI HTMLCurrentStyle_get_marginTop(IHTMLCurrentStyle *iface, VARIANT *p)
470 {
471     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
472     TRACE("(%p)->(%p)\n", This, p);
473     return get_nsstyle_attr_var(This->nsstyle, STYLEID_MARGIN_TOP, p, 0);
474 }
475
476 static HRESULT WINAPI HTMLCurrentStyle_get_marginRight(IHTMLCurrentStyle *iface, VARIANT *p)
477 {
478     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
479     TRACE("(%p)->(%p)\n", This, p);
480     return get_nsstyle_attr_var(This->nsstyle, STYLEID_MARGIN_RIGHT, p, 0);
481 }
482
483 static HRESULT WINAPI HTMLCurrentStyle_get_marginBottom(IHTMLCurrentStyle *iface, VARIANT *p)
484 {
485     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
486     TRACE("(%p)->(%p)\n", This, p);
487     return get_nsstyle_attr_var(This->nsstyle, STYLEID_MARGIN_BOTTOM, p, 0);
488 }
489
490 static HRESULT WINAPI HTMLCurrentStyle_get_marginLeft(IHTMLCurrentStyle *iface, VARIANT *p)
491 {
492     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
493     TRACE("(%p)->(%p)\n", This, p);
494     return get_nsstyle_attr_var(This->nsstyle, STYLEID_MARGIN_LEFT, p, 0);
495 }
496
497 static HRESULT WINAPI HTMLCurrentStyle_get_clear(IHTMLCurrentStyle *iface, BSTR *p)
498 {
499     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
500     FIXME("(%p)->(%p)\n", This, p);
501     return E_NOTIMPL;
502 }
503
504 static HRESULT WINAPI HTMLCurrentStyle_get_listStyleType(IHTMLCurrentStyle *iface, BSTR *p)
505 {
506     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
507     FIXME("(%p)->(%p)\n", This, p);
508     return E_NOTIMPL;
509 }
510
511 static HRESULT WINAPI HTMLCurrentStyle_get_listStylePosition(IHTMLCurrentStyle *iface, BSTR *p)
512 {
513     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
514     FIXME("(%p)->(%p)\n", This, p);
515     return E_NOTIMPL;
516 }
517
518 static HRESULT WINAPI HTMLCurrentStyle_get_listStyleImage(IHTMLCurrentStyle *iface, BSTR *p)
519 {
520     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
521     FIXME("(%p)->(%p)\n", This, p);
522     return E_NOTIMPL;
523 }
524
525 static HRESULT WINAPI HTMLCurrentStyle_get_clipTop(IHTMLCurrentStyle *iface, VARIANT *p)
526 {
527     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
528     FIXME("(%p)->(%p)\n", This, p);
529     return E_NOTIMPL;
530 }
531
532 static HRESULT WINAPI HTMLCurrentStyle_get_clipRight(IHTMLCurrentStyle *iface, VARIANT *p)
533 {
534     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
535     FIXME("(%p)->(%p)\n", This, p);
536     return E_NOTIMPL;
537 }
538
539 static HRESULT WINAPI HTMLCurrentStyle_get_clipBottom(IHTMLCurrentStyle *iface, VARIANT *p)
540 {
541     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
542     FIXME("(%p)->(%p)\n", This, p);
543     return E_NOTIMPL;
544 }
545
546 static HRESULT WINAPI HTMLCurrentStyle_get_clipLeft(IHTMLCurrentStyle *iface, VARIANT *p)
547 {
548     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
549     FIXME("(%p)->(%p)\n", This, p);
550     return E_NOTIMPL;
551 }
552
553 static HRESULT WINAPI HTMLCurrentStyle_get_overflow(IHTMLCurrentStyle *iface, BSTR *p)
554 {
555     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
556     TRACE("(%p)->(%p)\n", This, p);
557     return get_nsstyle_attr(This->nsstyle, STYLEID_OVERFLOW, p, 0);
558 }
559
560 static HRESULT WINAPI HTMLCurrentStyle_get_pageBreakBefore(IHTMLCurrentStyle *iface, BSTR *p)
561 {
562     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
563     FIXME("(%p)->(%p)\n", This, p);
564     return E_NOTIMPL;
565 }
566
567 static HRESULT WINAPI HTMLCurrentStyle_get_pageBreakAfter(IHTMLCurrentStyle *iface, BSTR *p)
568 {
569     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
570     FIXME("(%p)->(%p)\n", This, p);
571     return E_NOTIMPL;
572 }
573
574 static HRESULT WINAPI HTMLCurrentStyle_get_cursor(IHTMLCurrentStyle *iface, BSTR *p)
575 {
576     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
577     TRACE("(%p)->(%p)\n", This, p);
578     return get_nsstyle_attr(This->nsstyle, STYLEID_CURSOR, p, 0);
579 }
580
581 static HRESULT WINAPI HTMLCurrentStyle_get_tableLayout(IHTMLCurrentStyle *iface, BSTR *p)
582 {
583     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
584     FIXME("(%p)->(%p)\n", This, p);
585     return E_NOTIMPL;
586 }
587
588 static HRESULT WINAPI HTMLCurrentStyle_get_borderCollapse(IHTMLCurrentStyle *iface, BSTR *p)
589 {
590     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
591     FIXME("(%p)->(%p)\n", This, p);
592     return E_NOTIMPL;
593 }
594
595 static HRESULT WINAPI HTMLCurrentStyle_get_direction(IHTMLCurrentStyle *iface, BSTR *p)
596 {
597     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
598     FIXME("(%p)->(%p)\n", This, p);
599     return E_NOTIMPL;
600 }
601
602 static HRESULT WINAPI HTMLCurrentStyle_get_behavior(IHTMLCurrentStyle *iface, BSTR *p)
603 {
604     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
605     FIXME("(%p)->(%p)\n", This, p);
606     return E_NOTIMPL;
607 }
608
609 static HRESULT WINAPI HTMLCurrentStyle_getAttribute(IHTMLCurrentStyle *iface, BSTR strAttributeName,
610         LONG lFlags, VARIANT *AttributeValue)
611 {
612     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
613     FIXME("(%p)->(%s %x %p)\n", This, debugstr_w(strAttributeName), lFlags, AttributeValue);
614     return E_NOTIMPL;
615 }
616
617 static HRESULT WINAPI HTMLCurrentStyle_get_unicodeBidi(IHTMLCurrentStyle *iface, BSTR *p)
618 {
619     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
620     FIXME("(%p)->(%p)\n", This, p);
621     return E_NOTIMPL;
622 }
623
624 static HRESULT WINAPI HTMLCurrentStyle_get_right(IHTMLCurrentStyle *iface, VARIANT *p)
625 {
626     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
627     TRACE("(%p)->(%p)\n", This, p);
628     return get_nsstyle_attr_var(This->nsstyle, STYLEID_RIGHT, p, 0);
629 }
630
631 static HRESULT WINAPI HTMLCurrentStyle_get_bottom(IHTMLCurrentStyle *iface, VARIANT *p)
632 {
633     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
634     TRACE("(%p)->(%p)\n", This, p);
635     return get_nsstyle_attr_var(This->nsstyle, STYLEID_BOTTOM, p, 0);
636 }
637
638 static HRESULT WINAPI HTMLCurrentStyle_get_imeMode(IHTMLCurrentStyle *iface, BSTR *p)
639 {
640     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
641     FIXME("(%p)->(%p)\n", This, p);
642     return E_NOTIMPL;
643 }
644
645 static HRESULT WINAPI HTMLCurrentStyle_get_rubyAlign(IHTMLCurrentStyle *iface, BSTR *p)
646 {
647     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
648     FIXME("(%p)->(%p)\n", This, p);
649     return E_NOTIMPL;
650 }
651
652 static HRESULT WINAPI HTMLCurrentStyle_get_rubyPosition(IHTMLCurrentStyle *iface, BSTR *p)
653 {
654     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
655     FIXME("(%p)->(%p)\n", This, p);
656     return E_NOTIMPL;
657 }
658
659 static HRESULT WINAPI HTMLCurrentStyle_get_rubyOverhang(IHTMLCurrentStyle *iface, BSTR *p)
660 {
661     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
662     FIXME("(%p)->(%p)\n", This, p);
663     return E_NOTIMPL;
664 }
665
666 static HRESULT WINAPI HTMLCurrentStyle_get_textAutospace(IHTMLCurrentStyle *iface, BSTR *p)
667 {
668     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
669     FIXME("(%p)->(%p)\n", This, p);
670     return E_NOTIMPL;
671 }
672
673 static HRESULT WINAPI HTMLCurrentStyle_get_lineBreak(IHTMLCurrentStyle *iface, BSTR *p)
674 {
675     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
676     FIXME("(%p)->(%p)\n", This, p);
677     return E_NOTIMPL;
678 }
679
680 static HRESULT WINAPI HTMLCurrentStyle_get_wordBreak(IHTMLCurrentStyle *iface, BSTR *p)
681 {
682     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
683     FIXME("(%p)->(%p)\n", This, p);
684     return E_NOTIMPL;
685 }
686
687 static HRESULT WINAPI HTMLCurrentStyle_get_textJustify(IHTMLCurrentStyle *iface, BSTR *p)
688 {
689     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
690     FIXME("(%p)->(%p)\n", This, p);
691     return E_NOTIMPL;
692 }
693
694 static HRESULT WINAPI HTMLCurrentStyle_get_textJustifyTrim(IHTMLCurrentStyle *iface, BSTR *p)
695 {
696     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
697     FIXME("(%p)->(%p)\n", This, p);
698     return E_NOTIMPL;
699 }
700
701 static HRESULT WINAPI HTMLCurrentStyle_get_textKashida(IHTMLCurrentStyle *iface, VARIANT *p)
702 {
703     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
704     FIXME("(%p)->(%p)\n", This, p);
705     return E_NOTIMPL;
706 }
707
708 static HRESULT WINAPI HTMLCurrentStyle_get_blockDirection(IHTMLCurrentStyle *iface, BSTR *p)
709 {
710     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
711     FIXME("(%p)->(%p)\n", This, p);
712     return E_NOTIMPL;
713 }
714
715 static HRESULT WINAPI HTMLCurrentStyle_get_layoutGridChar(IHTMLCurrentStyle *iface, VARIANT *p)
716 {
717     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
718     FIXME("(%p)->(%p)\n", This, p);
719     return E_NOTIMPL;
720 }
721
722 static HRESULT WINAPI HTMLCurrentStyle_get_layoutGridLine(IHTMLCurrentStyle *iface, VARIANT *p)
723 {
724     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
725     FIXME("(%p)->(%p)\n", This, p);
726     return E_NOTIMPL;
727 }
728
729 static HRESULT WINAPI HTMLCurrentStyle_get_layoutGridMode(IHTMLCurrentStyle *iface, BSTR *p)
730 {
731     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
732     FIXME("(%p)->(%p)\n", This, p);
733     return E_NOTIMPL;
734 }
735
736 static HRESULT WINAPI HTMLCurrentStyle_get_layoutGridType(IHTMLCurrentStyle *iface, BSTR *p)
737 {
738     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
739     FIXME("(%p)->(%p)\n", This, p);
740     return E_NOTIMPL;
741 }
742
743 static HRESULT WINAPI HTMLCurrentStyle_get_borderStyle(IHTMLCurrentStyle *iface, BSTR *p)
744 {
745     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
746     TRACE("(%p)->(%p)\n", This, p);
747     return get_nsstyle_attr(This->nsstyle, STYLEID_BORDER_STYLE, p, 0);
748 }
749
750 static HRESULT WINAPI HTMLCurrentStyle_get_borderColor(IHTMLCurrentStyle *iface, BSTR *p)
751 {
752     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
753     TRACE("(%p)->(%p)\n", This, p);
754     return get_nsstyle_attr(This->nsstyle, STYLEID_BORDER_COLOR, p, 0);
755 }
756
757 static HRESULT WINAPI HTMLCurrentStyle_get_borderWidth(IHTMLCurrentStyle *iface, BSTR *p)
758 {
759     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
760     TRACE("(%p)->(%p)\n", This, p);
761     return get_nsstyle_attr(This->nsstyle, STYLEID_BORDER_WIDTH, p, 0);
762 }
763
764 static HRESULT WINAPI HTMLCurrentStyle_get_padding(IHTMLCurrentStyle *iface, BSTR *p)
765 {
766     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
767     TRACE("(%p)->(%p)\n", This, p);
768     return get_nsstyle_attr(This->nsstyle, STYLEID_PADDING, p, 0);
769 }
770
771 static HRESULT WINAPI HTMLCurrentStyle_get_margin(IHTMLCurrentStyle *iface, BSTR *p)
772 {
773     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
774     TRACE("(%p)->(%p)\n", This, p);
775     return get_nsstyle_attr(This->nsstyle, STYLEID_MARGIN, p, 0);
776 }
777
778 static HRESULT WINAPI HTMLCurrentStyle_get_accelerator(IHTMLCurrentStyle *iface, BSTR *p)
779 {
780     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
781     FIXME("(%p)->(%p)\n", This, p);
782     return E_NOTIMPL;
783 }
784
785 static HRESULT WINAPI HTMLCurrentStyle_get_overflowX(IHTMLCurrentStyle *iface, BSTR *p)
786 {
787     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
788     FIXME("(%p)->(%p)\n", This, p);
789     return E_NOTIMPL;
790 }
791
792 static HRESULT WINAPI HTMLCurrentStyle_get_overflowY(IHTMLCurrentStyle *iface, BSTR *p)
793 {
794     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
795     FIXME("(%p)->(%p)\n", This, p);
796     return E_NOTIMPL;
797 }
798
799 static HRESULT WINAPI HTMLCurrentStyle_get_textTransform(IHTMLCurrentStyle *iface, BSTR *p)
800 {
801     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
802     FIXME("(%p)->(%p)\n", This, p);
803     return E_NOTIMPL;
804 }
805
806 static const IHTMLCurrentStyleVtbl HTMLCurrentStyleVtbl = {
807     HTMLCurrentStyle_QueryInterface,
808     HTMLCurrentStyle_AddRef,
809     HTMLCurrentStyle_Release,
810     HTMLCurrentStyle_GetTypeInfoCount,
811     HTMLCurrentStyle_GetTypeInfo,
812     HTMLCurrentStyle_GetIDsOfNames,
813     HTMLCurrentStyle_Invoke,
814     HTMLCurrentStyle_get_position,
815     HTMLCurrentStyle_get_styleFloat,
816     HTMLCurrentStyle_get_color,
817     HTMLCurrentStyle_get_backgroundColor,
818     HTMLCurrentStyle_get_fontFamily,
819     HTMLCurrentStyle_get_fontStyle,
820     HTMLCurrentStyle_get_fontVariant,
821     HTMLCurrentStyle_get_fontWeight,
822     HTMLCurrentStyle_get_fontSize,
823     HTMLCurrentStyle_get_backgroundImage,
824     HTMLCurrentStyle_get_backgroundPositionX,
825     HTMLCurrentStyle_get_backgroundPositionY,
826     HTMLCurrentStyle_get_backgroundRepeat,
827     HTMLCurrentStyle_get_borderLeftColor,
828     HTMLCurrentStyle_get_borderTopColor,
829     HTMLCurrentStyle_get_borderRightColor,
830     HTMLCurrentStyle_get_borderBottomColor,
831     HTMLCurrentStyle_get_borderTopStyle,
832     HTMLCurrentStyle_get_borderRightStyle,
833     HTMLCurrentStyle_get_borderBottomStyle,
834     HTMLCurrentStyle_get_borderLeftStyle,
835     HTMLCurrentStyle_get_borderTopWidth,
836     HTMLCurrentStyle_get_borderRightWidth,
837     HTMLCurrentStyle_get_borderBottomWidth,
838     HTMLCurrentStyle_get_borderLeftWidth,
839     HTMLCurrentStyle_get_left,
840     HTMLCurrentStyle_get_top,
841     HTMLCurrentStyle_get_width,
842     HTMLCurrentStyle_get_height,
843     HTMLCurrentStyle_get_paddingLeft,
844     HTMLCurrentStyle_get_paddingTop,
845     HTMLCurrentStyle_get_paddingRight,
846     HTMLCurrentStyle_get_paddingBottom,
847     HTMLCurrentStyle_get_textAlign,
848     HTMLCurrentStyle_get_textDecoration,
849     HTMLCurrentStyle_get_display,
850     HTMLCurrentStyle_get_visibility,
851     HTMLCurrentStyle_get_zIndex,
852     HTMLCurrentStyle_get_letterSpacing,
853     HTMLCurrentStyle_get_lineHeight,
854     HTMLCurrentStyle_get_textIndent,
855     HTMLCurrentStyle_get_verticalAlign,
856     HTMLCurrentStyle_get_backgroundAttachment,
857     HTMLCurrentStyle_get_marginTop,
858     HTMLCurrentStyle_get_marginRight,
859     HTMLCurrentStyle_get_marginBottom,
860     HTMLCurrentStyle_get_marginLeft,
861     HTMLCurrentStyle_get_clear,
862     HTMLCurrentStyle_get_listStyleType,
863     HTMLCurrentStyle_get_listStylePosition,
864     HTMLCurrentStyle_get_listStyleImage,
865     HTMLCurrentStyle_get_clipTop,
866     HTMLCurrentStyle_get_clipRight,
867     HTMLCurrentStyle_get_clipBottom,
868     HTMLCurrentStyle_get_clipLeft,
869     HTMLCurrentStyle_get_overflow,
870     HTMLCurrentStyle_get_pageBreakBefore,
871     HTMLCurrentStyle_get_pageBreakAfter,
872     HTMLCurrentStyle_get_cursor,
873     HTMLCurrentStyle_get_tableLayout,
874     HTMLCurrentStyle_get_borderCollapse,
875     HTMLCurrentStyle_get_direction,
876     HTMLCurrentStyle_get_behavior,
877     HTMLCurrentStyle_getAttribute,
878     HTMLCurrentStyle_get_unicodeBidi,
879     HTMLCurrentStyle_get_right,
880     HTMLCurrentStyle_get_bottom,
881     HTMLCurrentStyle_get_imeMode,
882     HTMLCurrentStyle_get_rubyAlign,
883     HTMLCurrentStyle_get_rubyPosition,
884     HTMLCurrentStyle_get_rubyOverhang,
885     HTMLCurrentStyle_get_textAutospace,
886     HTMLCurrentStyle_get_lineBreak,
887     HTMLCurrentStyle_get_wordBreak,
888     HTMLCurrentStyle_get_textJustify,
889     HTMLCurrentStyle_get_textJustifyTrim,
890     HTMLCurrentStyle_get_textKashida,
891     HTMLCurrentStyle_get_blockDirection,
892     HTMLCurrentStyle_get_layoutGridChar,
893     HTMLCurrentStyle_get_layoutGridLine,
894     HTMLCurrentStyle_get_layoutGridMode,
895     HTMLCurrentStyle_get_layoutGridType,
896     HTMLCurrentStyle_get_borderStyle,
897     HTMLCurrentStyle_get_borderColor,
898     HTMLCurrentStyle_get_borderWidth,
899     HTMLCurrentStyle_get_padding,
900     HTMLCurrentStyle_get_margin,
901     HTMLCurrentStyle_get_accelerator,
902     HTMLCurrentStyle_get_overflowX,
903     HTMLCurrentStyle_get_overflowY,
904     HTMLCurrentStyle_get_textTransform
905 };
906
907 /* IHTMLCurrentStyle2 */
908 static HRESULT WINAPI HTMLCurrentStyle2_QueryInterface(IHTMLCurrentStyle2 *iface, REFIID riid, void **ppv)
909 {
910    HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
911
912    return IHTMLCurrentStyle_QueryInterface(&This->IHTMLCurrentStyle_iface, riid, ppv);
913 }
914
915 static ULONG WINAPI HTMLCurrentStyle2_AddRef(IHTMLCurrentStyle2 *iface)
916 {
917     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
918
919     return IHTMLCurrentStyle_AddRef(&This->IHTMLCurrentStyle_iface);
920 }
921
922 static ULONG WINAPI HTMLCurrentStyle2_Release(IHTMLCurrentStyle2 *iface)
923 {
924     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
925     return IHTMLCurrentStyle_Release(&This->IHTMLCurrentStyle_iface);
926 }
927
928 static HRESULT WINAPI HTMLCurrentStyle2_GetTypeInfoCount(IHTMLCurrentStyle2 *iface, UINT *pctinfo)
929 {
930     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
931     return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
932 }
933
934 static HRESULT WINAPI HTMLCurrentStyle2_GetTypeInfo(IHTMLCurrentStyle2 *iface, UINT iTInfo,
935         LCID lcid, ITypeInfo **ppTInfo)
936 {
937     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
938     return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
939 }
940
941 static HRESULT WINAPI HTMLCurrentStyle2_GetIDsOfNames(IHTMLCurrentStyle2 *iface, REFIID riid,
942         LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
943 {
944     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
945     return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
946             lcid, rgDispId);
947 }
948
949 static HRESULT WINAPI HTMLCurrentStyle2_Invoke(IHTMLCurrentStyle2 *iface, DISPID dispIdMember,
950         REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
951         VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
952 {
953     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
954     return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
955             wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
956 }
957
958 static HRESULT WINAPI HTMLCurrentStyle2_get_layoutFlow(IHTMLCurrentStyle2 *iface, BSTR *p)
959 {
960     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
961     FIXME("(%p)->(%p)\n", This, p);
962     return E_NOTIMPL;
963 }
964
965 static HRESULT WINAPI HTMLCurrentStyle2_get_wordWrap(IHTMLCurrentStyle2 *iface, BSTR *p)
966 {
967     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
968     FIXME("(%p)->(%p)\n", This, p);
969     return E_NOTIMPL;
970 }
971
972 static HRESULT WINAPI HTMLCurrentStyle2_get_textUnderlinePosition(IHTMLCurrentStyle2 *iface, BSTR *p)
973 {
974     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
975     FIXME("(%p)->(%p)\n", This, p);
976     return E_NOTIMPL;
977 }
978
979 static HRESULT WINAPI HTMLCurrentStyle2_get_hasLayout(IHTMLCurrentStyle2 *iface, VARIANT_BOOL *p)
980 {
981     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
982     FIXME("(%p)->(%p)\n", This, p);
983     return E_NOTIMPL;
984 }
985
986 static HRESULT WINAPI HTMLCurrentStyle2_get_scrollbarBaseColor(IHTMLCurrentStyle2 *iface, VARIANT *p)
987 {
988     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
989     FIXME("(%p)->(%p)\n", This, p);
990     return E_NOTIMPL;
991 }
992
993 static HRESULT WINAPI HTMLCurrentStyle2_get_scrollbarFaceColor(IHTMLCurrentStyle2 *iface, VARIANT *p)
994 {
995     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
996     FIXME("(%p)->(%p)\n", This, p);
997     return E_NOTIMPL;
998 }
999
1000 static HRESULT WINAPI HTMLCurrentStyle2_get_scrollbar3dLightColor(IHTMLCurrentStyle2 *iface, VARIANT *p)
1001 {
1002     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
1003     FIXME("(%p)->(%p)\n", This, p);
1004     return E_NOTIMPL;
1005 }
1006
1007 static HRESULT WINAPI HTMLCurrentStyle2_get_scrollbarShadowColor(IHTMLCurrentStyle2 *iface, VARIANT *p)
1008 {
1009     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
1010     FIXME("(%p)->(%p)\n", This, p);
1011     return E_NOTIMPL;
1012 }
1013
1014 static HRESULT WINAPI HTMLCurrentStyle2_get_scrollbarHighlightColor(IHTMLCurrentStyle2 *iface, VARIANT *p)
1015 {
1016     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
1017     FIXME("(%p)->(%p)\n", This, p);
1018     return E_NOTIMPL;
1019 }
1020
1021 static HRESULT WINAPI HTMLCurrentStyle2_get_scrollbarDarkShadowColor(IHTMLCurrentStyle2 *iface, VARIANT *p)
1022 {
1023     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
1024     FIXME("(%p)->(%p)\n", This, p);
1025     return E_NOTIMPL;
1026 }
1027
1028 static HRESULT WINAPI HTMLCurrentStyle2_get_scrollbarArrowColor(IHTMLCurrentStyle2 *iface, VARIANT *p)
1029 {
1030     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
1031     FIXME("(%p)->(%p)\n", This, p);
1032     return E_NOTIMPL;
1033 }
1034
1035 static HRESULT WINAPI HTMLCurrentStyle2_get_scrollbarTrackColor(IHTMLCurrentStyle2 *iface, VARIANT *p)
1036 {
1037     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
1038     FIXME("(%p)->(%p)\n", This, p);
1039     return E_NOTIMPL;
1040 }
1041
1042 static HRESULT WINAPI HTMLCurrentStyle2_get_writingMode(IHTMLCurrentStyle2 *iface, BSTR *p)
1043 {
1044     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
1045     FIXME("(%p)->(%p)\n", This, p);
1046     return E_NOTIMPL;
1047 }
1048
1049 static HRESULT WINAPI HTMLCurrentStyle2_get_zoom(IHTMLCurrentStyle2 *iface, VARIANT *p)
1050 {
1051     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
1052     FIXME("(%p)->(%p)\n", This, p);
1053     return E_NOTIMPL;
1054 }
1055
1056 static HRESULT WINAPI HTMLCurrentStyle2_get_filter(IHTMLCurrentStyle2 *iface, BSTR *p)
1057 {
1058     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
1059
1060     TRACE("(%p)->(%p)\n", This, p);
1061
1062     if(This->elem->filter) {
1063         *p = SysAllocString(This->elem->filter);
1064         if(!*p)
1065             return E_OUTOFMEMORY;
1066     }else {
1067         *p = NULL;
1068     }
1069
1070     return S_OK;
1071 }
1072
1073 static HRESULT WINAPI HTMLCurrentStyle2_get_textAlignLast(IHTMLCurrentStyle2 *iface, BSTR *p)
1074 {
1075     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
1076     FIXME("(%p)->(%p)\n", This, p);
1077     return E_NOTIMPL;
1078 }
1079
1080 static HRESULT WINAPI HTMLCurrentStyle2_get_textKashidaSpace(IHTMLCurrentStyle2 *iface, VARIANT *p)
1081 {
1082     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
1083     FIXME("(%p)->(%p)\n", This, p);
1084     return E_NOTIMPL;
1085 }
1086
1087 static HRESULT WINAPI HTMLCurrentStyle2_get_isBlock(IHTMLCurrentStyle2 *iface, VARIANT_BOOL *p)
1088 {
1089     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
1090     FIXME("(%p)->(%p)\n", This, p);
1091     return E_NOTIMPL;
1092 }
1093
1094 static const IHTMLCurrentStyle2Vtbl HTMLCurrentStyle2Vtbl = {
1095     HTMLCurrentStyle2_QueryInterface,
1096     HTMLCurrentStyle2_AddRef,
1097     HTMLCurrentStyle2_Release,
1098     HTMLCurrentStyle2_GetTypeInfoCount,
1099     HTMLCurrentStyle2_GetTypeInfo,
1100     HTMLCurrentStyle2_GetIDsOfNames,
1101     HTMLCurrentStyle2_Invoke,
1102     HTMLCurrentStyle2_get_layoutFlow,
1103     HTMLCurrentStyle2_get_wordWrap,
1104     HTMLCurrentStyle2_get_textUnderlinePosition,
1105     HTMLCurrentStyle2_get_hasLayout,
1106     HTMLCurrentStyle2_get_scrollbarBaseColor,
1107     HTMLCurrentStyle2_get_scrollbarFaceColor,
1108     HTMLCurrentStyle2_get_scrollbar3dLightColor,
1109     HTMLCurrentStyle2_get_scrollbarShadowColor,
1110     HTMLCurrentStyle2_get_scrollbarHighlightColor,
1111     HTMLCurrentStyle2_get_scrollbarDarkShadowColor,
1112     HTMLCurrentStyle2_get_scrollbarArrowColor,
1113     HTMLCurrentStyle2_get_scrollbarTrackColor,
1114     HTMLCurrentStyle2_get_writingMode,
1115     HTMLCurrentStyle2_get_zoom,
1116     HTMLCurrentStyle2_get_filter,
1117     HTMLCurrentStyle2_get_textAlignLast,
1118     HTMLCurrentStyle2_get_textKashidaSpace,
1119     HTMLCurrentStyle2_get_isBlock
1120 };
1121
1122 /* IHTMLCurrentStyle3 */
1123 static HRESULT WINAPI HTMLCurrentStyle3_QueryInterface(IHTMLCurrentStyle3 *iface, REFIID riid, void **ppv)
1124 {
1125    HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle3(iface);
1126
1127    return IHTMLCurrentStyle_QueryInterface(&This->IHTMLCurrentStyle_iface, riid, ppv);
1128 }
1129
1130 static ULONG WINAPI HTMLCurrentStyle3_AddRef(IHTMLCurrentStyle3 *iface)
1131 {
1132     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle3(iface);
1133
1134     return IHTMLCurrentStyle_AddRef(&This->IHTMLCurrentStyle_iface);
1135 }
1136
1137 static ULONG WINAPI HTMLCurrentStyle3_Release(IHTMLCurrentStyle3 *iface)
1138 {
1139     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle3(iface);
1140     return IHTMLCurrentStyle_Release(&This->IHTMLCurrentStyle_iface);
1141 }
1142
1143 static HRESULT WINAPI HTMLCurrentStyle3_GetTypeInfoCount(IHTMLCurrentStyle3 *iface, UINT *pctinfo)
1144 {
1145     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle3(iface);
1146     return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
1147 }
1148
1149 static HRESULT WINAPI HTMLCurrentStyle3_GetTypeInfo(IHTMLCurrentStyle3 *iface, UINT iTInfo,
1150         LCID lcid, ITypeInfo **ppTInfo)
1151 {
1152     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle3(iface);
1153     return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
1154 }
1155
1156 static HRESULT WINAPI HTMLCurrentStyle3_GetIDsOfNames(IHTMLCurrentStyle3 *iface, REFIID riid,
1157         LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
1158 {
1159     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle3(iface);
1160     return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
1161             lcid, rgDispId);
1162 }
1163
1164 static HRESULT WINAPI HTMLCurrentStyle3_Invoke(IHTMLCurrentStyle3 *iface, DISPID dispIdMember,
1165         REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
1166         VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
1167 {
1168     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle3(iface);
1169     return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
1170             wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
1171 }
1172
1173 static HRESULT WINAPI HTMLCurrentStyle3_get_textOverflow(IHTMLCurrentStyle3 *iface, BSTR *p)
1174 {
1175     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle3(iface);
1176     FIXME("(%p)->(%p)\n", This, p);
1177     return E_NOTIMPL;
1178 }
1179
1180 static HRESULT WINAPI HTMLCurrentStyle3_get_minHeight(IHTMLCurrentStyle3 *iface, VARIANT *p)
1181 {
1182     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle3(iface);
1183     FIXME("(%p)->(%p)\n", This, p);
1184     return E_NOTIMPL;
1185 }
1186
1187 static HRESULT WINAPI HTMLCurrentStyle3_get_wordSpacing(IHTMLCurrentStyle3 *iface, VARIANT *p)
1188 {
1189     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle3(iface);
1190     FIXME("(%p)->(%p)\n", This, p);
1191     return E_NOTIMPL;
1192 }
1193
1194 static HRESULT WINAPI HTMLCurrentStyle3_get_whiteSpace(IHTMLCurrentStyle3 *iface, BSTR *p)
1195 {
1196     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle3(iface);
1197     FIXME("(%p)->(%p)\n", This, p);
1198     return E_NOTIMPL;
1199 }
1200
1201 static const IHTMLCurrentStyle3Vtbl HTMLCurrentStyle3Vtbl = {
1202     HTMLCurrentStyle3_QueryInterface,
1203     HTMLCurrentStyle3_AddRef,
1204     HTMLCurrentStyle3_Release,
1205     HTMLCurrentStyle3_GetTypeInfoCount,
1206     HTMLCurrentStyle3_GetTypeInfo,
1207     HTMLCurrentStyle3_GetIDsOfNames,
1208     HTMLCurrentStyle3_Invoke,
1209     HTMLCurrentStyle3_get_textOverflow,
1210     HTMLCurrentStyle3_get_minHeight,
1211     HTMLCurrentStyle3_get_wordSpacing,
1212     HTMLCurrentStyle3_get_whiteSpace
1213 };
1214
1215 /* IHTMLCurrentStyle4 */
1216 static HRESULT WINAPI HTMLCurrentStyle4_QueryInterface(IHTMLCurrentStyle4 *iface, REFIID riid, void **ppv)
1217 {
1218    HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle4(iface);
1219
1220    return IHTMLCurrentStyle_QueryInterface(&This->IHTMLCurrentStyle_iface, riid, ppv);
1221 }
1222
1223 static ULONG WINAPI HTMLCurrentStyle4_AddRef(IHTMLCurrentStyle4 *iface)
1224 {
1225     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle4(iface);
1226
1227     return IHTMLCurrentStyle_AddRef(&This->IHTMLCurrentStyle_iface);
1228 }
1229
1230 static ULONG WINAPI HTMLCurrentStyle4_Release(IHTMLCurrentStyle4 *iface)
1231 {
1232     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle4(iface);
1233     return IHTMLCurrentStyle_Release(&This->IHTMLCurrentStyle_iface);
1234 }
1235
1236 static HRESULT WINAPI HTMLCurrentStyle4_GetTypeInfoCount(IHTMLCurrentStyle4 *iface, UINT *pctinfo)
1237 {
1238     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle4(iface);
1239     return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
1240 }
1241
1242 static HRESULT WINAPI HTMLCurrentStyle4_GetTypeInfo(IHTMLCurrentStyle4 *iface, UINT iTInfo,
1243         LCID lcid, ITypeInfo **ppTInfo)
1244 {
1245     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle4(iface);
1246     return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
1247 }
1248
1249 static HRESULT WINAPI HTMLCurrentStyle4_GetIDsOfNames(IHTMLCurrentStyle4 *iface, REFIID riid,
1250         LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
1251 {
1252     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle4(iface);
1253     return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
1254             lcid, rgDispId);
1255 }
1256
1257 static HRESULT WINAPI HTMLCurrentStyle4_Invoke(IHTMLCurrentStyle4 *iface, DISPID dispIdMember,
1258         REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
1259         VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
1260 {
1261     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle4(iface);
1262     return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
1263             wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
1264 }
1265
1266 static HRESULT WINAPI HTMLCurrentStyle4_msInterpolationMode(IHTMLCurrentStyle4 *iface, BSTR *p)
1267 {
1268     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle4(iface);
1269     FIXME("(%p)->(%p)\n", This, p);
1270     return E_NOTIMPL;
1271 }
1272
1273 static HRESULT WINAPI HTMLCurrentStyle4_get_maxHeight(IHTMLCurrentStyle4 *iface, VARIANT *p)
1274 {
1275     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle4(iface);
1276     FIXME("(%p)->(%p)\n", This, p);
1277     return E_NOTIMPL;
1278 }
1279
1280 static HRESULT WINAPI HTMLCurrentStyle4_get_minWidth(IHTMLCurrentStyle4 *iface, VARIANT *p)
1281 {
1282     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle4(iface);
1283     FIXME("(%p)->(%p)\n", This, p);
1284     return E_NOTIMPL;
1285 }
1286
1287 static HRESULT WINAPI HTMLCurrentStyle4_get_maxWidth(IHTMLCurrentStyle4 *iface, VARIANT *p)
1288 {
1289     HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle4(iface);
1290     FIXME("(%p)->(%p)\n", This, p);
1291     return E_NOTIMPL;
1292 }
1293
1294 static const IHTMLCurrentStyle4Vtbl HTMLCurrentStyle4Vtbl = {
1295     HTMLCurrentStyle4_QueryInterface,
1296     HTMLCurrentStyle4_AddRef,
1297     HTMLCurrentStyle4_Release,
1298     HTMLCurrentStyle4_GetTypeInfoCount,
1299     HTMLCurrentStyle4_GetTypeInfo,
1300     HTMLCurrentStyle4_GetIDsOfNames,
1301     HTMLCurrentStyle4_Invoke,
1302     HTMLCurrentStyle4_msInterpolationMode,
1303     HTMLCurrentStyle4_get_maxHeight,
1304     HTMLCurrentStyle4_get_minWidth,
1305     HTMLCurrentStyle4_get_maxWidth
1306 };
1307
1308 static const tid_t HTMLCurrentStyle_iface_tids[] = {
1309     IHTMLCurrentStyle_tid,
1310     IHTMLCurrentStyle2_tid,
1311     IHTMLCurrentStyle3_tid,
1312     IHTMLCurrentStyle4_tid,
1313     0
1314 };
1315 static dispex_static_data_t HTMLCurrentStyle_dispex = {
1316     NULL,
1317     DispHTMLCurrentStyle_tid,
1318     NULL,
1319     HTMLCurrentStyle_iface_tids
1320 };
1321
1322 HRESULT HTMLCurrentStyle_Create(HTMLElement *elem, IHTMLCurrentStyle **p)
1323 {
1324     nsIDOMCSSStyleDeclaration *nsstyle;
1325     nsIDOMWindow *nsview;
1326     nsAString nsempty_str;
1327     HTMLCurrentStyle *ret;
1328     nsresult nsres;
1329
1330     if(!elem->node.doc->nsdoc)  {
1331         WARN("NULL nsdoc\n");
1332         return E_UNEXPECTED;
1333     }
1334
1335     nsres = nsIDOMHTMLDocument_GetDefaultView(elem->node.doc->nsdoc, &nsview);
1336     if(NS_FAILED(nsres)) {
1337         ERR("GetDefaultView failed: %08x\n", nsres);
1338         return E_FAIL;
1339     }
1340
1341     nsAString_Init(&nsempty_str, NULL);
1342     nsres = nsIDOMWindow_GetComputedStyle(nsview, (nsIDOMElement*)elem->nselem, &nsempty_str, &nsstyle);
1343     nsAString_Finish(&nsempty_str);
1344     if(NS_FAILED(nsres)) {
1345         ERR("GetComputedStyle failed: %08x\n", nsres);
1346         return E_FAIL;
1347     }
1348
1349     ret = heap_alloc_zero(sizeof(HTMLCurrentStyle));
1350     if(!ret) {
1351         nsIDOMCSSStyleDeclaration_Release(nsstyle);
1352         return E_OUTOFMEMORY;
1353     }
1354
1355     ret->IHTMLCurrentStyle_iface.lpVtbl  = &HTMLCurrentStyleVtbl;
1356     ret->IHTMLCurrentStyle2_iface.lpVtbl = &HTMLCurrentStyle2Vtbl;
1357     ret->IHTMLCurrentStyle3_iface.lpVtbl = &HTMLCurrentStyle3Vtbl;
1358     ret->IHTMLCurrentStyle4_iface.lpVtbl = &HTMLCurrentStyle4Vtbl;
1359     ret->ref = 1;
1360     ret->nsstyle = nsstyle;
1361
1362     init_dispex(&ret->dispex, (IUnknown*)&ret->IHTMLCurrentStyle_iface,  &HTMLCurrentStyle_dispex);
1363
1364     IHTMLElement_AddRef(&elem->IHTMLElement_iface);
1365     ret->elem = elem;
1366
1367     *p = &ret->IHTMLCurrentStyle_iface;
1368     return S_OK;
1369 }