mshtml: Fix pointer cast warnings on 64-bit.
[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 typedef struct {
36     DispatchEx dispex;
37     const IHTMLCurrentStyleVtbl *lpIHTMLCurrentStyleVtbl;
38
39     LONG ref;
40
41     nsIDOMCSSStyleDeclaration *nsstyle;
42 } HTMLCurrentStyle;
43
44 #define HTMLCURSTYLE(x)  ((IHTMLCurrentStyle*)  &(x)->lpIHTMLCurrentStyleVtbl)
45
46 #define HTMLCURSTYLE_THIS(iface) DEFINE_THIS(HTMLCurrentStyle, IHTMLCurrentStyle, iface)
47
48 static HRESULT WINAPI HTMLCurrentStyle_QueryInterface(IHTMLCurrentStyle *iface, REFIID riid, void **ppv)
49 {
50     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
51
52     *ppv = NULL;
53
54     if(IsEqualGUID(&IID_IUnknown, riid)) {
55         TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
56         *ppv = HTMLCURSTYLE(This);
57     }else if(IsEqualGUID(&IID_IHTMLCurrentStyle, riid)) {
58         TRACE("(%p)->(IID_IHTMLCurrentStyle %p)\n", This, ppv);
59         *ppv = HTMLCURSTYLE(This);
60     }else if(dispex_query_interface(&This->dispex, riid, ppv)) {
61         return *ppv ? S_OK : E_NOINTERFACE;
62     }
63
64     if(*ppv) {
65         IUnknown_AddRef((IUnknown*)*ppv);
66         return S_OK;
67     }
68
69     WARN("unsupported %s\n", debugstr_guid(riid));
70     return E_NOINTERFACE;
71 }
72
73 static ULONG WINAPI HTMLCurrentStyle_AddRef(IHTMLCurrentStyle *iface)
74 {
75     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
76     LONG ref = InterlockedIncrement(&This->ref);
77
78     TRACE("(%p) ref=%d\n", This, ref);
79
80     return ref;
81 }
82
83 static ULONG WINAPI HTMLCurrentStyle_Release(IHTMLCurrentStyle *iface)
84 {
85     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
86     LONG ref = InterlockedDecrement(&This->ref);
87
88     TRACE("(%p) ref=%d\n", This, ref);
89
90     if(!ref) {
91         if(This->nsstyle)
92             nsIDOMCSSStyleDeclaration_Release(This->nsstyle);
93         heap_free(This);
94     }
95
96     return ref;
97 }
98
99 static HRESULT WINAPI HTMLCurrentStyle_GetTypeInfoCount(IHTMLCurrentStyle *iface, UINT *pctinfo)
100 {
101     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
102     return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->dispex), pctinfo);
103 }
104
105 static HRESULT WINAPI HTMLCurrentStyle_GetTypeInfo(IHTMLCurrentStyle *iface, UINT iTInfo,
106         LCID lcid, ITypeInfo **ppTInfo)
107 {
108     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
109     return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->dispex), iTInfo, lcid, ppTInfo);
110 }
111
112 static HRESULT WINAPI HTMLCurrentStyle_GetIDsOfNames(IHTMLCurrentStyle *iface, REFIID riid,
113         LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
114 {
115     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
116     return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->dispex), riid, rgszNames, cNames, lcid, rgDispId);
117 }
118
119 static HRESULT WINAPI HTMLCurrentStyle_Invoke(IHTMLCurrentStyle *iface, DISPID dispIdMember,
120         REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
121         VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
122 {
123     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
124     return IDispatchEx_Invoke(DISPATCHEX(&This->dispex), dispIdMember, riid, lcid,
125             wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
126 }
127
128 static HRESULT WINAPI HTMLCurrentStyle_get_position(IHTMLCurrentStyle *iface, BSTR *p)
129 {
130     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
131     FIXME("(%p)->(%p)\n", This, p);
132     return E_NOTIMPL;
133 }
134
135 static HRESULT WINAPI HTMLCurrentStyle_get_styleFloat(IHTMLCurrentStyle *iface, BSTR *p)
136 {
137     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
138     FIXME("(%p)->(%p)\n", This, p);
139     return E_NOTIMPL;
140 }
141
142 static HRESULT WINAPI HTMLCurrentStyle_get_color(IHTMLCurrentStyle *iface, VARIANT *p)
143 {
144     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
145     FIXME("(%p)->(%p)\n", This, p);
146     return E_NOTIMPL;
147 }
148
149 static HRESULT WINAPI HTMLCurrentStyle_get_backgroundColor(IHTMLCurrentStyle *iface, VARIANT *p)
150 {
151     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
152     FIXME("(%p)->(%p)\n", This, p);
153     return E_NOTIMPL;
154 }
155
156 static HRESULT WINAPI HTMLCurrentStyle_get_fontFamily(IHTMLCurrentStyle *iface, BSTR *p)
157 {
158     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
159     FIXME("(%p)->(%p)\n", This, p);
160     return E_NOTIMPL;
161 }
162
163 static HRESULT WINAPI HTMLCurrentStyle_get_fontStyle(IHTMLCurrentStyle *iface, BSTR *p)
164 {
165     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
166     FIXME("(%p)->(%p)\n", This, p);
167     return E_NOTIMPL;
168 }
169
170 static HRESULT WINAPI HTMLCurrentStyle_get_fontVariant(IHTMLCurrentStyle *iface, BSTR *p)
171 {
172     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
173     FIXME("(%p)->(%p)\n", This, p);
174     return E_NOTIMPL;
175 }
176
177 static HRESULT WINAPI HTMLCurrentStyle_get_fontWeight(IHTMLCurrentStyle *iface, VARIANT *p)
178 {
179     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
180     FIXME("(%p)->(%p)\n", This, p);
181     return E_NOTIMPL;
182 }
183
184 static HRESULT WINAPI HTMLCurrentStyle_get_fontSize(IHTMLCurrentStyle *iface, VARIANT *p)
185 {
186     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
187     FIXME("(%p)->(%p)\n", This, p);
188     return E_NOTIMPL;
189 }
190
191 static HRESULT WINAPI HTMLCurrentStyle_get_backgroundImage(IHTMLCurrentStyle *iface, BSTR *p)
192 {
193     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
194     FIXME("(%p)->(%p)\n", This, p);
195     return E_NOTIMPL;
196 }
197
198 static HRESULT WINAPI HTMLCurrentStyle_get_backgroundPositionX(IHTMLCurrentStyle *iface, VARIANT *p)
199 {
200     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
201     FIXME("(%p)->(%p)\n", This, p);
202     return E_NOTIMPL;
203 }
204
205 static HRESULT WINAPI HTMLCurrentStyle_get_backgroundPositionY(IHTMLCurrentStyle *iface, VARIANT *p)
206 {
207     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
208     FIXME("(%p)->(%p)\n", This, p);
209     return E_NOTIMPL;
210 }
211
212 static HRESULT WINAPI HTMLCurrentStyle_get_backgroundRepeat(IHTMLCurrentStyle *iface, BSTR *p)
213 {
214     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
215     FIXME("(%p)->(%p)\n", This, p);
216     return E_NOTIMPL;
217 }
218
219 static HRESULT WINAPI HTMLCurrentStyle_get_borderLeftColor(IHTMLCurrentStyle *iface, VARIANT *p)
220 {
221     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
222     FIXME("(%p)->(%p)\n", This, p);
223     return E_NOTIMPL;
224 }
225
226 static HRESULT WINAPI HTMLCurrentStyle_get_borderTopColor(IHTMLCurrentStyle *iface, VARIANT *p)
227 {
228     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
229     FIXME("(%p)->(%p)\n", This, p);
230     return E_NOTIMPL;
231 }
232
233 static HRESULT WINAPI HTMLCurrentStyle_get_borderRightColor(IHTMLCurrentStyle *iface, VARIANT *p)
234 {
235     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
236     FIXME("(%p)->(%p)\n", This, p);
237     return E_NOTIMPL;
238 }
239
240 static HRESULT WINAPI HTMLCurrentStyle_get_borderBottomColor(IHTMLCurrentStyle *iface, VARIANT *p)
241 {
242     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
243     FIXME("(%p)->(%p)\n", This, p);
244     return E_NOTIMPL;
245 }
246
247 static HRESULT WINAPI HTMLCurrentStyle_get_borderTopStyle(IHTMLCurrentStyle *iface, BSTR *p)
248 {
249     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
250     FIXME("(%p)->(%p)\n", This, p);
251     return E_NOTIMPL;
252 }
253
254 static HRESULT WINAPI HTMLCurrentStyle_get_borderRightStyle(IHTMLCurrentStyle *iface, BSTR *p)
255 {
256     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
257     FIXME("(%p)->(%p)\n", This, p);
258     return E_NOTIMPL;
259 }
260
261 static HRESULT WINAPI HTMLCurrentStyle_get_borderBottomStyle(IHTMLCurrentStyle *iface, BSTR *p)
262 {
263     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
264     FIXME("(%p)->(%p)\n", This, p);
265     return E_NOTIMPL;
266 }
267
268 static HRESULT WINAPI HTMLCurrentStyle_get_borderLeftStyle(IHTMLCurrentStyle *iface, BSTR *p)
269 {
270     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
271     FIXME("(%p)->(%p)\n", This, p);
272     return E_NOTIMPL;
273 }
274
275 static HRESULT WINAPI HTMLCurrentStyle_get_borderTopWidth(IHTMLCurrentStyle *iface, VARIANT *p)
276 {
277     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
278     FIXME("(%p)->(%p)\n", This, p);
279     return E_NOTIMPL;
280 }
281
282 static HRESULT WINAPI HTMLCurrentStyle_get_borderRightWidth(IHTMLCurrentStyle *iface, VARIANT *p)
283 {
284     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
285     FIXME("(%p)->(%p)\n", This, p);
286     return E_NOTIMPL;
287 }
288
289 static HRESULT WINAPI HTMLCurrentStyle_get_borderBottomWidth(IHTMLCurrentStyle *iface, VARIANT *p)
290 {
291     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
292     FIXME("(%p)->(%p)\n", This, p);
293     return E_NOTIMPL;
294 }
295
296 static HRESULT WINAPI HTMLCurrentStyle_get_borderLeftWidth(IHTMLCurrentStyle *iface, VARIANT *p)
297 {
298     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
299     FIXME("(%p)->(%p)\n", This, p);
300     return E_NOTIMPL;
301 }
302
303 static HRESULT WINAPI HTMLCurrentStyle_get_left(IHTMLCurrentStyle *iface, VARIANT *p)
304 {
305     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
306     FIXME("(%p)->(%p)\n", This, p);
307     return E_NOTIMPL;
308 }
309
310 static HRESULT WINAPI HTMLCurrentStyle_get_top(IHTMLCurrentStyle *iface, VARIANT *p)
311 {
312     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
313     FIXME("(%p)->(%p)\n", This, p);
314     return E_NOTIMPL;
315 }
316
317 static HRESULT WINAPI HTMLCurrentStyle_get_width(IHTMLCurrentStyle *iface, VARIANT *p)
318 {
319     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
320     FIXME("(%p)->(%p)\n", This, p);
321     return E_NOTIMPL;
322 }
323
324 static HRESULT WINAPI HTMLCurrentStyle_get_height(IHTMLCurrentStyle *iface, VARIANT *p)
325 {
326     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
327     FIXME("(%p)->(%p)\n", This, p);
328     return E_NOTIMPL;
329 }
330
331 static HRESULT WINAPI HTMLCurrentStyle_get_paddingLeft(IHTMLCurrentStyle *iface, VARIANT *p)
332 {
333     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
334     FIXME("(%p)->(%p)\n", This, p);
335     return E_NOTIMPL;
336 }
337
338 static HRESULT WINAPI HTMLCurrentStyle_get_paddingTop(IHTMLCurrentStyle *iface, VARIANT *p)
339 {
340     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
341     FIXME("(%p)->(%p)\n", This, p);
342     return E_NOTIMPL;
343 }
344
345 static HRESULT WINAPI HTMLCurrentStyle_get_paddingRight(IHTMLCurrentStyle *iface, VARIANT *p)
346 {
347     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
348     FIXME("(%p)->(%p)\n", This, p);
349     return E_NOTIMPL;
350 }
351
352 static HRESULT WINAPI HTMLCurrentStyle_get_paddingBottom(IHTMLCurrentStyle *iface, VARIANT *p)
353 {
354     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
355     FIXME("(%p)->(%p)\n", This, p);
356     return E_NOTIMPL;
357 }
358
359 static HRESULT WINAPI HTMLCurrentStyle_get_textAlign(IHTMLCurrentStyle *iface, BSTR *p)
360 {
361     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
362     FIXME("(%p)->(%p)\n", This, p);
363     return E_NOTIMPL;
364 }
365
366 static HRESULT WINAPI HTMLCurrentStyle_get_textDecoration(IHTMLCurrentStyle *iface, BSTR *p)
367 {
368     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
369     FIXME("(%p)->(%p)\n", This, p);
370     return E_NOTIMPL;
371 }
372
373 static HRESULT WINAPI HTMLCurrentStyle_get_display(IHTMLCurrentStyle *iface, BSTR *p)
374 {
375     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
376
377     TRACE("(%p)->(%p)\n", This, p);
378
379     return get_nsstyle_attr(This->nsstyle, STYLEID_DISPLAY, p);
380 }
381
382 static HRESULT WINAPI HTMLCurrentStyle_get_visibility(IHTMLCurrentStyle *iface, BSTR *p)
383 {
384     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
385     FIXME("(%p)->(%p)\n", This, p);
386     return E_NOTIMPL;
387 }
388
389 static HRESULT WINAPI HTMLCurrentStyle_get_zIndex(IHTMLCurrentStyle *iface, VARIANT *p)
390 {
391     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
392     FIXME("(%p)->(%p)\n", This, p);
393     return E_NOTIMPL;
394 }
395
396 static HRESULT WINAPI HTMLCurrentStyle_get_letterSpacing(IHTMLCurrentStyle *iface, VARIANT *p)
397 {
398     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
399     FIXME("(%p)->(%p)\n", This, p);
400     return E_NOTIMPL;
401 }
402
403 static HRESULT WINAPI HTMLCurrentStyle_get_lineHeight(IHTMLCurrentStyle *iface, VARIANT *p)
404 {
405     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
406     FIXME("(%p)->(%p)\n", This, p);
407     return E_NOTIMPL;
408 }
409
410 static HRESULT WINAPI HTMLCurrentStyle_get_textIndent(IHTMLCurrentStyle *iface, VARIANT *p)
411 {
412     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
413     FIXME("(%p)->(%p)\n", This, p);
414     return E_NOTIMPL;
415 }
416
417 static HRESULT WINAPI HTMLCurrentStyle_get_verticalAlign(IHTMLCurrentStyle *iface, VARIANT *p)
418 {
419     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
420     FIXME("(%p)->(%p)\n", This, p);
421     return E_NOTIMPL;
422 }
423
424 static HRESULT WINAPI HTMLCurrentStyle_get_backgroundAttachment(IHTMLCurrentStyle *iface, BSTR *p)
425 {
426     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
427     FIXME("(%p)->(%p)\n", This, p);
428     return E_NOTIMPL;
429 }
430
431 static HRESULT WINAPI HTMLCurrentStyle_get_marginTop(IHTMLCurrentStyle *iface, VARIANT *p)
432 {
433     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
434     FIXME("(%p)->(%p)\n", This, p);
435     return E_NOTIMPL;
436 }
437
438 static HRESULT WINAPI HTMLCurrentStyle_get_marginRight(IHTMLCurrentStyle *iface, VARIANT *p)
439 {
440     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
441     FIXME("(%p)->(%p)\n", This, p);
442     return E_NOTIMPL;
443 }
444
445 static HRESULT WINAPI HTMLCurrentStyle_get_marginBottom(IHTMLCurrentStyle *iface, VARIANT *p)
446 {
447     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
448     FIXME("(%p)->(%p)\n", This, p);
449     return E_NOTIMPL;
450 }
451
452 static HRESULT WINAPI HTMLCurrentStyle_get_marginLeft(IHTMLCurrentStyle *iface, VARIANT *p)
453 {
454     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
455     FIXME("(%p)->(%p)\n", This, p);
456     return E_NOTIMPL;
457 }
458
459 static HRESULT WINAPI HTMLCurrentStyle_get_clear(IHTMLCurrentStyle *iface, BSTR *p)
460 {
461     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
462     FIXME("(%p)->(%p)\n", This, p);
463     return E_NOTIMPL;
464 }
465
466 static HRESULT WINAPI HTMLCurrentStyle_get_listStyleType(IHTMLCurrentStyle *iface, BSTR *p)
467 {
468     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
469     FIXME("(%p)->(%p)\n", This, p);
470     return E_NOTIMPL;
471 }
472
473 static HRESULT WINAPI HTMLCurrentStyle_get_listStylePosition(IHTMLCurrentStyle *iface, BSTR *p)
474 {
475     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
476     FIXME("(%p)->(%p)\n", This, p);
477     return E_NOTIMPL;
478 }
479
480 static HRESULT WINAPI HTMLCurrentStyle_get_listStyleImage(IHTMLCurrentStyle *iface, BSTR *p)
481 {
482     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
483     FIXME("(%p)->(%p)\n", This, p);
484     return E_NOTIMPL;
485 }
486
487 static HRESULT WINAPI HTMLCurrentStyle_get_clipTop(IHTMLCurrentStyle *iface, VARIANT *p)
488 {
489     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
490     FIXME("(%p)->(%p)\n", This, p);
491     return E_NOTIMPL;
492 }
493
494 static HRESULT WINAPI HTMLCurrentStyle_get_clipRight(IHTMLCurrentStyle *iface, VARIANT *p)
495 {
496     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
497     FIXME("(%p)->(%p)\n", This, p);
498     return E_NOTIMPL;
499 }
500
501 static HRESULT WINAPI HTMLCurrentStyle_get_clipBottom(IHTMLCurrentStyle *iface, VARIANT *p)
502 {
503     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
504     FIXME("(%p)->(%p)\n", This, p);
505     return E_NOTIMPL;
506 }
507
508 static HRESULT WINAPI HTMLCurrentStyle_get_clipLeft(IHTMLCurrentStyle *iface, VARIANT *p)
509 {
510     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
511     FIXME("(%p)->(%p)\n", This, p);
512     return E_NOTIMPL;
513 }
514
515 static HRESULT WINAPI HTMLCurrentStyle_get_overflow(IHTMLCurrentStyle *iface, BSTR *p)
516 {
517     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
518     FIXME("(%p)->(%p)\n", This, p);
519     return E_NOTIMPL;
520 }
521
522 static HRESULT WINAPI HTMLCurrentStyle_get_pageBreakBefore(IHTMLCurrentStyle *iface, BSTR *p)
523 {
524     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
525     FIXME("(%p)->(%p)\n", This, p);
526     return E_NOTIMPL;
527 }
528
529 static HRESULT WINAPI HTMLCurrentStyle_get_pageBreakAfter(IHTMLCurrentStyle *iface, BSTR *p)
530 {
531     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
532     FIXME("(%p)->(%p)\n", This, p);
533     return E_NOTIMPL;
534 }
535
536 static HRESULT WINAPI HTMLCurrentStyle_get_cursor(IHTMLCurrentStyle *iface, BSTR *p)
537 {
538     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
539     FIXME("(%p)->(%p)\n", This, p);
540     return E_NOTIMPL;
541 }
542
543 static HRESULT WINAPI HTMLCurrentStyle_get_tableLayout(IHTMLCurrentStyle *iface, BSTR *p)
544 {
545     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
546     FIXME("(%p)->(%p)\n", This, p);
547     return E_NOTIMPL;
548 }
549
550 static HRESULT WINAPI HTMLCurrentStyle_get_borderCollapse(IHTMLCurrentStyle *iface, BSTR *p)
551 {
552     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
553     FIXME("(%p)->(%p)\n", This, p);
554     return E_NOTIMPL;
555 }
556
557 static HRESULT WINAPI HTMLCurrentStyle_get_direction(IHTMLCurrentStyle *iface, BSTR *p)
558 {
559     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
560     FIXME("(%p)->(%p)\n", This, p);
561     return E_NOTIMPL;
562 }
563
564 static HRESULT WINAPI HTMLCurrentStyle_get_behavior(IHTMLCurrentStyle *iface, BSTR *p)
565 {
566     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
567     FIXME("(%p)->(%p)\n", This, p);
568     return E_NOTIMPL;
569 }
570
571 static HRESULT WINAPI HTMLCurrentStyle_getAttribute(IHTMLCurrentStyle *iface, BSTR strAttributeName,
572         LONG lFlags, VARIANT *AttributeValue)
573 {
574     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
575     FIXME("(%p)->(%s %x %p)\n", This, debugstr_w(strAttributeName), lFlags, AttributeValue);
576     return E_NOTIMPL;
577 }
578
579 static HRESULT WINAPI HTMLCurrentStyle_get_unicodeBidi(IHTMLCurrentStyle *iface, BSTR *p)
580 {
581     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
582     FIXME("(%p)->(%p)\n", This, p);
583     return E_NOTIMPL;
584 }
585
586 static HRESULT WINAPI HTMLCurrentStyle_get_right(IHTMLCurrentStyle *iface, VARIANT *p)
587 {
588     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
589     FIXME("(%p)->(%p)\n", This, p);
590     return E_NOTIMPL;
591 }
592
593 static HRESULT WINAPI HTMLCurrentStyle_get_bottom(IHTMLCurrentStyle *iface, VARIANT *p)
594 {
595     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
596     FIXME("(%p)->(%p)\n", This, p);
597     return E_NOTIMPL;
598 }
599
600 static HRESULT WINAPI HTMLCurrentStyle_get_imeMode(IHTMLCurrentStyle *iface, BSTR *p)
601 {
602     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
603     FIXME("(%p)->(%p)\n", This, p);
604     return E_NOTIMPL;
605 }
606
607 static HRESULT WINAPI HTMLCurrentStyle_get_rubyAlign(IHTMLCurrentStyle *iface, BSTR *p)
608 {
609     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
610     FIXME("(%p)->(%p)\n", This, p);
611     return E_NOTIMPL;
612 }
613
614 static HRESULT WINAPI HTMLCurrentStyle_get_rubyPosition(IHTMLCurrentStyle *iface, BSTR *p)
615 {
616     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
617     FIXME("(%p)->(%p)\n", This, p);
618     return E_NOTIMPL;
619 }
620
621 static HRESULT WINAPI HTMLCurrentStyle_get_rubyOverhang(IHTMLCurrentStyle *iface, BSTR *p)
622 {
623     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
624     FIXME("(%p)->(%p)\n", This, p);
625     return E_NOTIMPL;
626 }
627
628 static HRESULT WINAPI HTMLCurrentStyle_get_textAutospace(IHTMLCurrentStyle *iface, BSTR *p)
629 {
630     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
631     FIXME("(%p)->(%p)\n", This, p);
632     return E_NOTIMPL;
633 }
634
635 static HRESULT WINAPI HTMLCurrentStyle_get_lineBreak(IHTMLCurrentStyle *iface, BSTR *p)
636 {
637     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
638     FIXME("(%p)->(%p)\n", This, p);
639     return E_NOTIMPL;
640 }
641
642 static HRESULT WINAPI HTMLCurrentStyle_get_wordBreak(IHTMLCurrentStyle *iface, BSTR *p)
643 {
644     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
645     FIXME("(%p)->(%p)\n", This, p);
646     return E_NOTIMPL;
647 }
648
649 static HRESULT WINAPI HTMLCurrentStyle_get_textJustify(IHTMLCurrentStyle *iface, BSTR *p)
650 {
651     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
652     FIXME("(%p)->(%p)\n", This, p);
653     return E_NOTIMPL;
654 }
655
656 static HRESULT WINAPI HTMLCurrentStyle_get_textJustifyTrim(IHTMLCurrentStyle *iface, BSTR *p)
657 {
658     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
659     FIXME("(%p)->(%p)\n", This, p);
660     return E_NOTIMPL;
661 }
662
663 static HRESULT WINAPI HTMLCurrentStyle_get_textKashida(IHTMLCurrentStyle *iface, VARIANT *p)
664 {
665     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
666     FIXME("(%p)->(%p)\n", This, p);
667     return E_NOTIMPL;
668 }
669
670 static HRESULT WINAPI HTMLCurrentStyle_get_blockDirection(IHTMLCurrentStyle *iface, BSTR *p)
671 {
672     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
673     FIXME("(%p)->(%p)\n", This, p);
674     return E_NOTIMPL;
675 }
676
677 static HRESULT WINAPI HTMLCurrentStyle_get_layoutGridChar(IHTMLCurrentStyle *iface, VARIANT *p)
678 {
679     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
680     FIXME("(%p)->(%p)\n", This, p);
681     return E_NOTIMPL;
682 }
683
684 static HRESULT WINAPI HTMLCurrentStyle_get_layoutGridLine(IHTMLCurrentStyle *iface, VARIANT *p)
685 {
686     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
687     FIXME("(%p)->(%p)\n", This, p);
688     return E_NOTIMPL;
689 }
690
691 static HRESULT WINAPI HTMLCurrentStyle_get_layoutGridMode(IHTMLCurrentStyle *iface, BSTR *p)
692 {
693     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
694     FIXME("(%p)->(%p)\n", This, p);
695     return E_NOTIMPL;
696 }
697
698 static HRESULT WINAPI HTMLCurrentStyle_get_layoutGridType(IHTMLCurrentStyle *iface, BSTR *p)
699 {
700     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
701     FIXME("(%p)->(%p)\n", This, p);
702     return E_NOTIMPL;
703 }
704
705 static HRESULT WINAPI HTMLCurrentStyle_get_borderStyle(IHTMLCurrentStyle *iface, BSTR *p)
706 {
707     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
708     FIXME("(%p)->(%p)\n", This, p);
709     return E_NOTIMPL;
710 }
711
712 static HRESULT WINAPI HTMLCurrentStyle_get_borderColor(IHTMLCurrentStyle *iface, BSTR *p)
713 {
714     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
715     FIXME("(%p)->(%p)\n", This, p);
716     return E_NOTIMPL;
717 }
718
719 static HRESULT WINAPI HTMLCurrentStyle_get_borderWidth(IHTMLCurrentStyle *iface, BSTR *p)
720 {
721     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
722     FIXME("(%p)->(%p)\n", This, p);
723     return E_NOTIMPL;
724 }
725
726 static HRESULT WINAPI HTMLCurrentStyle_get_padding(IHTMLCurrentStyle *iface, BSTR *p)
727 {
728     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
729     FIXME("(%p)->(%p)\n", This, p);
730     return E_NOTIMPL;
731 }
732
733 static HRESULT WINAPI HTMLCurrentStyle_get_margin(IHTMLCurrentStyle *iface, BSTR *p)
734 {
735     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
736     FIXME("(%p)->(%p)\n", This, p);
737     return E_NOTIMPL;
738 }
739
740 static HRESULT WINAPI HTMLCurrentStyle_get_accelerator(IHTMLCurrentStyle *iface, BSTR *p)
741 {
742     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
743     FIXME("(%p)->(%p)\n", This, p);
744     return E_NOTIMPL;
745 }
746
747 static HRESULT WINAPI HTMLCurrentStyle_get_overflowX(IHTMLCurrentStyle *iface, BSTR *p)
748 {
749     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
750     FIXME("(%p)->(%p)\n", This, p);
751     return E_NOTIMPL;
752 }
753
754 static HRESULT WINAPI HTMLCurrentStyle_get_overflowY(IHTMLCurrentStyle *iface, BSTR *p)
755 {
756     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
757     FIXME("(%p)->(%p)\n", This, p);
758     return E_NOTIMPL;
759 }
760
761 static HRESULT WINAPI HTMLCurrentStyle_get_textTransform(IHTMLCurrentStyle *iface, BSTR *p)
762 {
763     HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
764     FIXME("(%p)->(%p)\n", This, p);
765     return E_NOTIMPL;
766 }
767
768 #undef HTMLCURSTYLE_THIS
769
770 static const IHTMLCurrentStyleVtbl HTMLCurrentStyleVtbl = {
771     HTMLCurrentStyle_QueryInterface,
772     HTMLCurrentStyle_AddRef,
773     HTMLCurrentStyle_Release,
774     HTMLCurrentStyle_GetTypeInfoCount,
775     HTMLCurrentStyle_GetTypeInfo,
776     HTMLCurrentStyle_GetIDsOfNames,
777     HTMLCurrentStyle_Invoke,
778     HTMLCurrentStyle_get_position,
779     HTMLCurrentStyle_get_styleFloat,
780     HTMLCurrentStyle_get_color,
781     HTMLCurrentStyle_get_backgroundColor,
782     HTMLCurrentStyle_get_fontFamily,
783     HTMLCurrentStyle_get_fontStyle,
784     HTMLCurrentStyle_get_fontVariant,
785     HTMLCurrentStyle_get_fontWeight,
786     HTMLCurrentStyle_get_fontSize,
787     HTMLCurrentStyle_get_backgroundImage,
788     HTMLCurrentStyle_get_backgroundPositionX,
789     HTMLCurrentStyle_get_backgroundPositionY,
790     HTMLCurrentStyle_get_backgroundRepeat,
791     HTMLCurrentStyle_get_borderLeftColor,
792     HTMLCurrentStyle_get_borderTopColor,
793     HTMLCurrentStyle_get_borderRightColor,
794     HTMLCurrentStyle_get_borderBottomColor,
795     HTMLCurrentStyle_get_borderTopStyle,
796     HTMLCurrentStyle_get_borderRightStyle,
797     HTMLCurrentStyle_get_borderBottomStyle,
798     HTMLCurrentStyle_get_borderLeftStyle,
799     HTMLCurrentStyle_get_borderTopWidth,
800     HTMLCurrentStyle_get_borderRightWidth,
801     HTMLCurrentStyle_get_borderBottomWidth,
802     HTMLCurrentStyle_get_borderLeftWidth,
803     HTMLCurrentStyle_get_left,
804     HTMLCurrentStyle_get_top,
805     HTMLCurrentStyle_get_width,
806     HTMLCurrentStyle_get_height,
807     HTMLCurrentStyle_get_paddingLeft,
808     HTMLCurrentStyle_get_paddingTop,
809     HTMLCurrentStyle_get_paddingRight,
810     HTMLCurrentStyle_get_paddingBottom,
811     HTMLCurrentStyle_get_textAlign,
812     HTMLCurrentStyle_get_textDecoration,
813     HTMLCurrentStyle_get_display,
814     HTMLCurrentStyle_get_visibility,
815     HTMLCurrentStyle_get_zIndex,
816     HTMLCurrentStyle_get_letterSpacing,
817     HTMLCurrentStyle_get_lineHeight,
818     HTMLCurrentStyle_get_textIndent,
819     HTMLCurrentStyle_get_verticalAlign,
820     HTMLCurrentStyle_get_backgroundAttachment,
821     HTMLCurrentStyle_get_marginTop,
822     HTMLCurrentStyle_get_marginRight,
823     HTMLCurrentStyle_get_marginBottom,
824     HTMLCurrentStyle_get_marginLeft,
825     HTMLCurrentStyle_get_clear,
826     HTMLCurrentStyle_get_listStyleType,
827     HTMLCurrentStyle_get_listStylePosition,
828     HTMLCurrentStyle_get_listStyleImage,
829     HTMLCurrentStyle_get_clipTop,
830     HTMLCurrentStyle_get_clipRight,
831     HTMLCurrentStyle_get_clipBottom,
832     HTMLCurrentStyle_get_clipLeft,
833     HTMLCurrentStyle_get_overflow,
834     HTMLCurrentStyle_get_pageBreakBefore,
835     HTMLCurrentStyle_get_pageBreakAfter,
836     HTMLCurrentStyle_get_cursor,
837     HTMLCurrentStyle_get_tableLayout,
838     HTMLCurrentStyle_get_borderCollapse,
839     HTMLCurrentStyle_get_direction,
840     HTMLCurrentStyle_get_behavior,
841     HTMLCurrentStyle_getAttribute,
842     HTMLCurrentStyle_get_unicodeBidi,
843     HTMLCurrentStyle_get_right,
844     HTMLCurrentStyle_get_bottom,
845     HTMLCurrentStyle_get_imeMode,
846     HTMLCurrentStyle_get_rubyAlign,
847     HTMLCurrentStyle_get_rubyPosition,
848     HTMLCurrentStyle_get_rubyOverhang,
849     HTMLCurrentStyle_get_textAutospace,
850     HTMLCurrentStyle_get_lineBreak,
851     HTMLCurrentStyle_get_wordBreak,
852     HTMLCurrentStyle_get_textJustify,
853     HTMLCurrentStyle_get_textJustifyTrim,
854     HTMLCurrentStyle_get_textKashida,
855     HTMLCurrentStyle_get_blockDirection,
856     HTMLCurrentStyle_get_layoutGridChar,
857     HTMLCurrentStyle_get_layoutGridLine,
858     HTMLCurrentStyle_get_layoutGridMode,
859     HTMLCurrentStyle_get_layoutGridType,
860     HTMLCurrentStyle_get_borderStyle,
861     HTMLCurrentStyle_get_borderColor,
862     HTMLCurrentStyle_get_borderWidth,
863     HTMLCurrentStyle_get_padding,
864     HTMLCurrentStyle_get_margin,
865     HTMLCurrentStyle_get_accelerator,
866     HTMLCurrentStyle_get_overflowX,
867     HTMLCurrentStyle_get_overflowY,
868     HTMLCurrentStyle_get_textTransform
869 };
870
871 static const tid_t HTMLCurrentStyle_iface_tids[] = {
872     IHTMLCurrentStyle_tid,
873     0
874 };
875 static dispex_static_data_t HTMLCurrentStyle_dispex = {
876     NULL,
877     DispHTMLCurrentStyle_tid,
878     NULL,
879     HTMLCurrentStyle_iface_tids
880 };
881
882 HRESULT HTMLCurrentStyle_Create(HTMLElement *elem, IHTMLCurrentStyle **p)
883 {
884     nsIDOMCSSStyleDeclaration *nsstyle;
885     nsIDOMDocumentView *nsdocview;
886     nsIDOMAbstractView *nsview;
887     nsIDOMViewCSS *nsviewcss;
888     nsAString nsempty_str;
889     HTMLCurrentStyle *ret;
890     nsresult nsres;
891
892     if(!elem->node.doc->nsdoc)  {
893         WARN("NULL nsdoc\n");
894         return E_UNEXPECTED;
895     }
896
897     nsres = nsIDOMHTMLDocument_QueryInterface(elem->node.doc->nsdoc, &IID_nsIDOMDocumentView, (void**)&nsdocview);
898     if(NS_FAILED(nsres)) {
899         ERR("Could not get nsIDOMDocumentView: %08x\n", nsres);
900         return E_FAIL;
901     }
902
903     nsres = nsIDOMDocumentView_GetDefaultView(nsdocview, &nsview);
904     nsIDOMDocumentView_Release(nsdocview);
905     if(NS_FAILED(nsres)) {
906         ERR("GetDefaultView failed: %08x\n", nsres);
907         return E_FAIL;
908     }
909
910     nsres = nsIDOMAbstractView_QueryInterface(nsview, &IID_nsIDOMViewCSS, (void**)&nsviewcss);
911     nsIDOMAbstractView_Release(nsview);
912     if(NS_FAILED(nsres)) {
913         ERR("Could not get nsIDOMViewCSS: %08x\n", nsres);
914         return E_FAIL;
915     }
916
917     nsAString_Init(&nsempty_str, NULL);
918     nsres = nsIDOMViewCSS_GetComputedStyle(nsviewcss, (nsIDOMElement*)elem->nselem, &nsempty_str, &nsstyle);
919     nsIDOMViewCSS_Release(nsviewcss);
920     nsAString_Finish(&nsempty_str);
921     if(NS_FAILED(nsres)) {
922         ERR("GetComputedStyle failed: %08x\n", nsres);
923         return E_FAIL;
924     }
925
926     ret = heap_alloc_zero(sizeof(HTMLCurrentStyle));
927     if(!ret) {
928         nsIDOMCSSStyleDeclaration_Release(nsstyle);
929         return E_OUTOFMEMORY;
930     }
931
932     ret->lpIHTMLCurrentStyleVtbl = &HTMLCurrentStyleVtbl;
933     ret->ref = 1;
934     ret->nsstyle = nsstyle;
935
936     init_dispex(&ret->dispex, (IUnknown*)HTMLCURSTYLE(ret),  &HTMLCurrentStyle_dispex);
937
938     *p = HTMLCURSTYLE(ret);
939     return S_OK;
940 }