wintrust: Use path in WIN_TRUST_SUBJECT_FILE structure rather than assuming a path...
[wine] / dlls / mshtml / htmlelem2.c
1 /*
2  * Copyright 2006 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 "wine/debug.h"
29 #include "wine/unicode.h"
30
31 #include "mshtml_private.h"
32
33 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
34
35 #define HTMLELEM2_THIS(iface) DEFINE_THIS(HTMLElement, HTMLElement2, iface)
36
37 static HRESULT WINAPI HTMLElement2_QueryInterface(IHTMLElement2 *iface,
38                                                   REFIID riid, void **ppv)
39 {
40     HTMLElement *This = HTMLELEM2_THIS(iface);
41     return IHTMLElement_QueryInterface(HTMLELEM(This), riid, ppv);
42 }
43
44 static ULONG WINAPI HTMLElement2_AddRef(IHTMLElement2 *iface)
45 {
46     HTMLElement *This = HTMLELEM2_THIS(iface);
47     return IHTMLElement_AddRef(HTMLELEM(This));
48 }
49
50 static ULONG WINAPI HTMLElement2_Release(IHTMLElement2 *iface)
51 {
52     HTMLElement *This = HTMLELEM2_THIS(iface);
53     return IHTMLElement_Release(HTMLELEM(This));
54 }
55
56 static HRESULT WINAPI HTMLElement2_GetTypeInfoCount(IHTMLElement2 *iface, UINT *pctinfo)
57 {
58     HTMLElement *This = HTMLELEM2_THIS(iface);
59     FIXME("(%p)->(%p)\n", This, pctinfo);
60     return E_NOTIMPL;
61 }
62
63 static HRESULT WINAPI HTMLElement2_GetTypeInfo(IHTMLElement2 *iface, UINT iTInfo,
64                                                LCID lcid, ITypeInfo **ppTInfo)
65 {
66     HTMLElement *This = HTMLELEM2_THIS(iface);
67     FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
68     return E_NOTIMPL;
69 }
70
71 static HRESULT WINAPI HTMLElement2_GetIDsOfNames(IHTMLElement2 *iface, REFIID riid,
72                                                 LPOLESTR *rgszNames, UINT cNames,
73                                                 LCID lcid, DISPID *rgDispId)
74 {
75     HTMLElement *This = HTMLELEM2_THIS(iface);
76     FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
77                                         lcid, rgDispId);
78     return E_NOTIMPL;
79 }
80
81 static HRESULT WINAPI HTMLElement2_Invoke(IHTMLElement2 *iface, DISPID dispIdMember,
82                             REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
83                             VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
84 {
85     HTMLElement *This = HTMLELEM2_THIS(iface);
86     FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
87             lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
88     return E_NOTIMPL;
89 }
90
91 static HRESULT WINAPI HTMLElement2_get_scopeName(IHTMLElement2 *iface, BSTR *p)
92 {
93     HTMLElement *This = HTMLELEM2_THIS(iface);
94     FIXME("(%p)->(%p)\n", This, p);
95     return E_NOTIMPL;
96 }
97
98 static HRESULT WINAPI HTMLElement2_setCapture(IHTMLElement2 *iface, VARIANT_BOOL containerCapture)
99 {
100     HTMLElement *This = HTMLELEM2_THIS(iface);
101     FIXME("(%p)->(%x)\n", This, containerCapture);
102     return E_NOTIMPL;
103 }
104
105 static HRESULT WINAPI HTMLElement2_releaseCapture(IHTMLElement2 *iface)
106 {
107     HTMLElement *This = HTMLELEM2_THIS(iface);
108     FIXME("(%p)\n", This);
109     return E_NOTIMPL;
110 }
111
112 static HRESULT WINAPI HTMLElement2_put_onlosecapture(IHTMLElement2 *iface, VARIANT v)
113 {
114     HTMLElement *This = HTMLELEM2_THIS(iface);
115     FIXME("(%p)->()\n", This);
116     return E_NOTIMPL;
117 }
118
119 static HRESULT WINAPI HTMLElement2_get_onlosecapture(IHTMLElement2 *iface, VARIANT *p)
120 {
121     HTMLElement *This = HTMLELEM2_THIS(iface);
122     FIXME("(%p)->(%p)\n", This, p);
123     return E_NOTIMPL;
124 }
125
126 static HRESULT WINAPI HTMLElement2_componentFromPoint(IHTMLElement2 *iface,
127                                                       long x, long y, BSTR *component)
128 {
129     HTMLElement *This = HTMLELEM2_THIS(iface);
130     FIXME("(%p)->(%ld %ld %p)\n", This, x, y, component);
131     return E_NOTIMPL;
132 }
133
134 static HRESULT WINAPI HTMLElement2_doScroll(IHTMLElement2 *iface, VARIANT component)
135 {
136     HTMLElement *This = HTMLELEM2_THIS(iface);
137     FIXME("(%p)->()\n", This);
138     return E_NOTIMPL;
139 }
140
141 static HRESULT WINAPI HTMLElement2_put_onscroll(IHTMLElement2 *iface, VARIANT v)
142 {
143     HTMLElement *This = HTMLELEM2_THIS(iface);
144     FIXME("(%p)->()\n", This);
145     return E_NOTIMPL;
146 }
147
148 static HRESULT WINAPI HTMLElement2_get_onscroll(IHTMLElement2 *iface, VARIANT *p)
149 {
150     HTMLElement *This = HTMLELEM2_THIS(iface);
151     FIXME("(%p)->(%p)\n", This, p);
152     return E_NOTIMPL;
153 }
154
155 static HRESULT WINAPI HTMLElement2_put_ondrag(IHTMLElement2 *iface, VARIANT v)
156 {
157     HTMLElement *This = HTMLELEM2_THIS(iface);
158     FIXME("(%p)->()\n", This);
159     return E_NOTIMPL;
160 }
161
162 static HRESULT WINAPI HTMLElement2_get_ondrag(IHTMLElement2 *iface, VARIANT *p)
163 {
164     HTMLElement *This = HTMLELEM2_THIS(iface);
165     FIXME("(%p)->(%p)\n", This, p);
166     return E_NOTIMPL;
167 }
168
169 static HRESULT WINAPI HTMLElement2_put_ondragend(IHTMLElement2 *iface, VARIANT v)
170 {
171     HTMLElement *This = HTMLELEM2_THIS(iface);
172     FIXME("(%p)->()\n", This);
173     return E_NOTIMPL;
174 }
175
176 static HRESULT WINAPI HTMLElement2_get_ondragend(IHTMLElement2 *iface, VARIANT *p)
177 {
178     HTMLElement *This = HTMLELEM2_THIS(iface);
179     FIXME("(%p)->(%p)\n", This, p);
180     return E_NOTIMPL;
181 }
182
183 static HRESULT WINAPI HTMLElement2_put_ondragenter(IHTMLElement2 *iface, VARIANT v)
184 {
185     HTMLElement *This = HTMLELEM2_THIS(iface);
186     FIXME("(%p)->()\n", This);
187     return E_NOTIMPL;
188 }
189
190 static HRESULT WINAPI HTMLElement2_get_ondragenter(IHTMLElement2 *iface, VARIANT *p)
191 {
192     HTMLElement *This = HTMLELEM2_THIS(iface);
193     FIXME("(%p)->(%p)\n", This, p);
194     return E_NOTIMPL;
195 }
196
197 static HRESULT WINAPI HTMLElement2_put_ondragover(IHTMLElement2 *iface, VARIANT v)
198 {
199     HTMLElement *This = HTMLELEM2_THIS(iface);
200     FIXME("(%p)->()\n", This);
201     return E_NOTIMPL;
202 }
203
204 static HRESULT WINAPI HTMLElement2_get_ondragover(IHTMLElement2 *iface, VARIANT *p)
205 {
206     HTMLElement *This = HTMLELEM2_THIS(iface);
207     FIXME("(%p)->(%p)\n", This, p);
208     return E_NOTIMPL;
209 }
210
211 static HRESULT WINAPI HTMLElement2_put_ondragleave(IHTMLElement2 *iface, VARIANT v)
212 {
213     HTMLElement *This = HTMLELEM2_THIS(iface);
214     FIXME("(%p)->()\n", This);
215     return E_NOTIMPL;
216 }
217
218 static HRESULT WINAPI HTMLElement2_get_ondragleave(IHTMLElement2 *iface, VARIANT *p)
219 {
220     HTMLElement *This = HTMLELEM2_THIS(iface);
221     FIXME("(%p)->(%p)\n", This, p);
222     return E_NOTIMPL;
223 }
224
225 static HRESULT WINAPI HTMLElement2_put_ondrop(IHTMLElement2 *iface, VARIANT v)
226 {
227     HTMLElement *This = HTMLELEM2_THIS(iface);
228     FIXME("(%p)->()\n", This);
229     return E_NOTIMPL;
230 }
231
232 static HRESULT WINAPI HTMLElement2_get_ondrop(IHTMLElement2 *iface, VARIANT *p)
233 {
234     HTMLElement *This = HTMLELEM2_THIS(iface);
235     FIXME("(%p)->(%p)\n", This, p);
236     return E_NOTIMPL;
237 }
238
239 static HRESULT WINAPI HTMLElement2_put_onbeforecut(IHTMLElement2 *iface, VARIANT v)
240 {
241     HTMLElement *This = HTMLELEM2_THIS(iface);
242     FIXME("(%p)->()\n", This);
243     return E_NOTIMPL;
244 }
245
246 static HRESULT WINAPI HTMLElement2_get_onbeforecut(IHTMLElement2 *iface, VARIANT *p)
247 {
248     HTMLElement *This = HTMLELEM2_THIS(iface);
249     FIXME("(%p)->(%p)\n", This, p);
250     return E_NOTIMPL;
251 }
252
253 static HRESULT WINAPI HTMLElement2_put_oncut(IHTMLElement2 *iface, VARIANT v)
254 {
255     HTMLElement *This = HTMLELEM2_THIS(iface);
256     FIXME("(%p)->()\n", This);
257     return E_NOTIMPL;
258 }
259
260 static HRESULT WINAPI HTMLElement2_get_oncut(IHTMLElement2 *iface, VARIANT *p)
261 {
262     HTMLElement *This = HTMLELEM2_THIS(iface);
263     FIXME("(%p)->(%p)\n", This, p);
264     return E_NOTIMPL;
265 }
266
267 static HRESULT WINAPI HTMLElement2_put_onbeforecopy(IHTMLElement2 *iface, VARIANT v)
268 {
269     HTMLElement *This = HTMLELEM2_THIS(iface);
270     FIXME("(%p)->()\n", This);
271     return E_NOTIMPL;
272 }
273
274 static HRESULT WINAPI HTMLElement2_get_onbeforecopy(IHTMLElement2 *iface, VARIANT *p)
275 {
276     HTMLElement *This = HTMLELEM2_THIS(iface);
277     FIXME("(%p)->(%p)\n", This, p);
278     return E_NOTIMPL;
279 }
280
281 static HRESULT WINAPI HTMLElement2_put_oncopy(IHTMLElement2 *iface, VARIANT v)
282 {
283     HTMLElement *This = HTMLELEM2_THIS(iface);
284     FIXME("(%p)->()\n", This);
285     return E_NOTIMPL;
286 }
287
288 static HRESULT WINAPI HTMLElement2_get_oncopy(IHTMLElement2 *iface, VARIANT *p)
289 {
290     HTMLElement *This = HTMLELEM2_THIS(iface);
291     FIXME("(%p)->(%p)\n", This, p);
292     return E_NOTIMPL;
293 }
294
295 static HRESULT WINAPI HTMLElement2_put_onbeforepaste(IHTMLElement2 *iface, VARIANT v)
296 {
297     HTMLElement *This = HTMLELEM2_THIS(iface);
298     FIXME("(%p)->()\n", This);
299     return E_NOTIMPL;
300 }
301
302 static HRESULT WINAPI HTMLElement2_get_onbeforepaste(IHTMLElement2 *iface, VARIANT *p)
303 {
304     HTMLElement *This = HTMLELEM2_THIS(iface);
305     FIXME("(%p)->(%p)\n", This, p);
306     return E_NOTIMPL;
307 }
308
309 static HRESULT WINAPI HTMLElement2_put_onpaste(IHTMLElement2 *iface, VARIANT v)
310 {
311     HTMLElement *This = HTMLELEM2_THIS(iface);
312     FIXME("(%p)->()\n", This);
313     return E_NOTIMPL;
314 }
315
316 static HRESULT WINAPI HTMLElement2_get_onpaste(IHTMLElement2 *iface, VARIANT *p)
317 {
318     HTMLElement *This = HTMLELEM2_THIS(iface);
319     FIXME("(%p)->(%p)\n", This, p);
320     return E_NOTIMPL;
321 }
322
323 static HRESULT WINAPI HTMLElement2_get_currentStyle(IHTMLElement2 *iface, IHTMLCurrentStyle **p)
324 {
325     HTMLElement *This = HTMLELEM2_THIS(iface);
326     FIXME("(%p)->(%p)\n", This, p);
327     return E_NOTIMPL;
328 }
329
330 static HRESULT WINAPI HTMLElement2_put_onpropertychange(IHTMLElement2 *iface, VARIANT v)
331 {
332     HTMLElement *This = HTMLELEM2_THIS(iface);
333     FIXME("(%p)->()\n", This);
334     return E_NOTIMPL;
335 }
336
337 static HRESULT WINAPI HTMLElement2_get_onpropertychange(IHTMLElement2 *iface, VARIANT *p)
338 {
339     HTMLElement *This = HTMLELEM2_THIS(iface);
340     FIXME("(%p)->(%p)\n", This, p);
341     return E_NOTIMPL;
342 }
343
344 static HRESULT WINAPI HTMLElement2_getClientRects(IHTMLElement2 *iface, IHTMLRectCollection **pRectCol)
345 {
346     HTMLElement *This = HTMLELEM2_THIS(iface);
347     FIXME("(%p)->(%p)\n", This, pRectCol);
348     return E_NOTIMPL;
349 }
350
351 static HRESULT WINAPI HTMLElement2_getBoundingClientRect(IHTMLElement2 *iface, IHTMLRect **pRect)
352 {
353     HTMLElement *This = HTMLELEM2_THIS(iface);
354     FIXME("(%p)->(%p)\n", This, pRect);
355     return E_NOTIMPL;
356 }
357
358 static HRESULT WINAPI HTMLElement2_setExpression(IHTMLElement2 *iface, BSTR propname,
359                                                  BSTR expression, BSTR language)
360 {
361     HTMLElement *This = HTMLELEM2_THIS(iface);
362     FIXME("(%p)->(%s %s %s)\n", This, debugstr_w(propname), debugstr_w(expression),
363           debugstr_w(language));
364     return E_NOTIMPL;
365 }
366
367 static HRESULT WINAPI HTMLElement2_getExpression(IHTMLElement2 *iface, BSTR propname,
368                                                  VARIANT *expression)
369 {
370     HTMLElement *This = HTMLELEM2_THIS(iface);
371     FIXME("(%p)->(%s %p)\n", This, debugstr_w(propname), expression);
372     return E_NOTIMPL;
373 }
374
375 static HRESULT WINAPI HTMLElement2_removeExpression(IHTMLElement2 *iface, BSTR propname,
376                                                     VARIANT_BOOL *pfSuccess)
377 {
378     HTMLElement *This = HTMLELEM2_THIS(iface);
379     FIXME("(%p)->(%s %p)\n", This, debugstr_w(propname), pfSuccess);
380     return E_NOTIMPL;
381 }
382
383 static HRESULT WINAPI HTMLElement2_put_tabIndex(IHTMLElement2 *iface, short v)
384 {
385     HTMLElement *This = HTMLELEM2_THIS(iface);
386     nsIDOMNSHTMLElement *nselem;
387     nsresult nsres;
388
389     TRACE("(%p)->(%d)\n", This, v);
390
391     nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
392     if(NS_FAILED(nsres)) {
393         ERR("Could not get nsIDOMHTMLNSElement: %08x\n", nsres);
394         return S_OK;
395     }
396
397     nsres = nsIDOMNSHTMLElement_SetTabIndex(nselem, v);
398     nsIDOMNSHTMLElement_Release(nselem);
399     if(NS_FAILED(nsres))
400         ERR("GetTabIndex failed: %08x\n", nsres);
401
402     return S_OK;
403 }
404
405 static HRESULT WINAPI HTMLElement2_get_tabIndex(IHTMLElement2 *iface, short *p)
406 {
407     HTMLElement *This = HTMLELEM2_THIS(iface);
408     nsIDOMNSHTMLElement *nselem;
409     PRInt32 index = 0;
410     nsresult nsres;
411
412     TRACE("(%p)->(%p)\n", This, p);
413
414     nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
415     if(NS_FAILED(nsres)) {
416         ERR("Could not get nsIDOMHTMLNSElement: %08x\n", nsres);
417         return E_FAIL;
418     }
419
420     nsres = nsIDOMNSHTMLElement_GetTabIndex(nselem, &index);
421     nsIDOMNSHTMLElement_Release(nselem);
422     if(NS_FAILED(nsres)) {
423         ERR("GetTabIndex failed: %08x\n", nsres);
424         return E_FAIL;
425     }
426
427     *p = index;
428     return S_OK;
429 }
430
431 static HRESULT WINAPI HTMLElement2_focus(IHTMLElement2 *iface)
432 {
433     HTMLElement *This = HTMLELEM2_THIS(iface);
434     nsIDOMNSHTMLElement *nselem;
435     nsresult nsres;
436
437     TRACE("(%p)\n", This);
438
439     nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
440     if(NS_SUCCEEDED(nsres)) {
441         nsIDOMNSHTMLElement_focus(nselem);
442         nsIDOMNSHTMLElement_Release(nselem);
443     }else {
444         ERR("Could not get nsIDOMHTMLNSElement: %08x\n", nsres);
445     }
446
447     return S_OK;
448 }
449
450 static HRESULT WINAPI HTMLElement2_put_accessKey(IHTMLElement2 *iface, BSTR v)
451 {
452     HTMLElement *This = HTMLELEM2_THIS(iface);
453     VARIANT var;
454
455     static WCHAR accessKeyW[] = {'a','c','c','e','s','s','K','e','y',0};
456
457     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
458
459     V_VT(&var) = VT_BSTR;
460     V_BSTR(&var) = v;
461     return IHTMLElement_setAttribute(HTMLELEM(This), accessKeyW, var, 0);
462 }
463
464 static HRESULT WINAPI HTMLElement2_get_accessKey(IHTMLElement2 *iface, BSTR *p)
465 {
466     HTMLElement *This = HTMLELEM2_THIS(iface);
467     FIXME("(%p)->(%p)\n", This, p);
468     return E_NOTIMPL;
469 }
470
471 static HRESULT WINAPI HTMLElement2_put_onblur(IHTMLElement2 *iface, VARIANT v)
472 {
473     HTMLElement *This = HTMLELEM2_THIS(iface);
474     FIXME("(%p)->()\n", This);
475     return E_NOTIMPL;
476 }
477
478 static HRESULT WINAPI HTMLElement2_get_onblur(IHTMLElement2 *iface, VARIANT *p)
479 {
480     HTMLElement *This = HTMLELEM2_THIS(iface);
481     FIXME("(%p)->(%p)\n", This, p);
482     return E_NOTIMPL;
483 }
484
485 static HRESULT WINAPI HTMLElement2_put_onfocus(IHTMLElement2 *iface, VARIANT v)
486 {
487     HTMLElement *This = HTMLELEM2_THIS(iface);
488     FIXME("(%p)->()\n", This);
489     return E_NOTIMPL;
490 }
491
492 static HRESULT WINAPI HTMLElement2_get_onfocus(IHTMLElement2 *iface, VARIANT *p)
493 {
494     HTMLElement *This = HTMLELEM2_THIS(iface);
495     FIXME("(%p)->(%p)\n", This, p);
496     return E_NOTIMPL;
497 }
498
499 static HRESULT WINAPI HTMLElement2_put_onresize(IHTMLElement2 *iface, VARIANT v)
500 {
501     HTMLElement *This = HTMLELEM2_THIS(iface);
502     FIXME("(%p)->()\n", This);
503     return E_NOTIMPL;
504 }
505
506 static HRESULT WINAPI HTMLElement2_get_onresize(IHTMLElement2 *iface, VARIANT *p)
507 {
508     HTMLElement *This = HTMLELEM2_THIS(iface);
509     FIXME("(%p)->(%p)\n", This, p);
510     return E_NOTIMPL;
511 }
512
513 static HRESULT WINAPI HTMLElement2_blur(IHTMLElement2 *iface)
514 {
515     HTMLElement *This = HTMLELEM2_THIS(iface);
516     FIXME("(%p)\n", This);
517     return E_NOTIMPL;
518 }
519
520 static HRESULT WINAPI HTMLElement2_addFilter(IHTMLElement2 *iface, IUnknown *pUnk)
521 {
522     HTMLElement *This = HTMLELEM2_THIS(iface);
523     FIXME("(%p)->(%p)\n", This, pUnk);
524     return E_NOTIMPL;
525 }
526
527 static HRESULT WINAPI HTMLElement2_removeFilter(IHTMLElement2 *iface, IUnknown *pUnk)
528 {
529     HTMLElement *This = HTMLELEM2_THIS(iface);
530     FIXME("(%p)->(%p)\n", This, pUnk);
531     return E_NOTIMPL;
532 }
533
534 static HRESULT WINAPI HTMLElement2_get_clientHeight(IHTMLElement2 *iface, long *p)
535 {
536     HTMLElement *This = HTMLELEM2_THIS(iface);
537     nsIDOMNSHTMLElement *nselem;
538     PRInt32 height=0;
539     nsresult nsres;
540
541     TRACE("(%p)->(%p)\n", This, p);
542
543     nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
544     if(NS_SUCCEEDED(nsres)) {
545         nsIDOMNSHTMLElement_GetClientHeight(nselem, &height);
546         nsIDOMNSHTMLElement_Release(nselem);
547     }else {
548         ERR("Could not get nsIDOMHTMLNSElement: %08x\n", nsres);
549     }
550
551     *p = height;
552     return S_OK;
553 }
554
555 static HRESULT WINAPI HTMLElement2_get_clientWidth(IHTMLElement2 *iface, long *p)
556 {
557     HTMLElement *This = HTMLELEM2_THIS(iface);
558     nsIDOMNSHTMLElement *nselem;
559     PRInt32 width=0;
560     nsresult nsres;
561
562     TRACE("(%p)->(%p)\n", This, p);
563
564     nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
565     if(NS_SUCCEEDED(nsres)) {
566         nsIDOMNSHTMLElement_GetClientWidth(nselem, &width);
567         nsIDOMNSHTMLElement_Release(nselem);
568     }else {
569         ERR("Could not get nsIDOMHTMLNSElement: %08x\n", nsres);
570     }
571
572     *p = width;
573     return S_OK;
574 }
575
576 static HRESULT WINAPI HTMLElement2_get_clientTop(IHTMLElement2 *iface, long *p)
577 {
578     HTMLElement *This = HTMLELEM2_THIS(iface);
579     FIXME("(%p)->(%p)\n", This, p);
580     return E_NOTIMPL;
581 }
582
583 static HRESULT WINAPI HTMLElement2_get_clientLeft(IHTMLElement2 *iface, long *p)
584 {
585     HTMLElement *This = HTMLELEM2_THIS(iface);
586     FIXME("(%p)->(%p)\n", This, p);
587     return E_NOTIMPL;
588 }
589
590 static HRESULT WINAPI HTMLElement2_attachEvent(IHTMLElement2 *iface, BSTR event,
591                                                IDispatch *pDisp, VARIANT_BOOL *pfResult)
592 {
593     HTMLElement *This = HTMLELEM2_THIS(iface);
594     FIXME("(%p)->(%s %p %p)\n", This, debugstr_w(event), pDisp, pfResult);
595     return E_NOTIMPL;
596 }
597
598 static HRESULT WINAPI HTMLElement2_detachEvent(IHTMLElement2 *iface, BSTR event, IDispatch *pDisp)
599 {
600     HTMLElement *This = HTMLELEM2_THIS(iface);
601     FIXME("(%p)->(%s %p)\n", This, debugstr_w(event), pDisp);
602     return E_NOTIMPL;
603 }
604
605 static HRESULT WINAPI HTMLElement2_get_readyState(IHTMLElement2 *iface, VARIANT *p)
606 {
607     HTMLElement *This = HTMLELEM2_THIS(iface);
608     FIXME("(%p)->(%p)\n", This, p);
609     return E_NOTIMPL;
610 }
611
612 static HRESULT WINAPI HTMLElement2_put_onreadystatechange(IHTMLElement2 *iface, VARIANT v)
613 {
614     HTMLElement *This = HTMLELEM2_THIS(iface);
615     FIXME("(%p)->()\n", This);
616     return E_NOTIMPL;
617 }
618
619 static HRESULT WINAPI HTMLElement2_get_onreadystatechange(IHTMLElement2 *iface, VARIANT *p)
620 {
621     HTMLElement *This = HTMLELEM2_THIS(iface);
622     FIXME("(%p)->(%p)\n", This, p);
623     return E_NOTIMPL;
624 }
625
626 static HRESULT WINAPI HTMLElement2_put_onrowsdelete(IHTMLElement2 *iface, VARIANT v)
627 {
628     HTMLElement *This = HTMLELEM2_THIS(iface);
629     FIXME("(%p)->()\n", This);
630     return E_NOTIMPL;
631 }
632
633 static HRESULT WINAPI HTMLElement2_get_onrowsdelete(IHTMLElement2 *iface, VARIANT *p)
634 {
635     HTMLElement *This = HTMLELEM2_THIS(iface);
636     FIXME("(%p)->(%p)\n", This, p);
637     return E_NOTIMPL;
638 }
639
640 static HRESULT WINAPI HTMLElement2_put_onrowsinserted(IHTMLElement2 *iface, VARIANT v)
641 {
642     HTMLElement *This = HTMLELEM2_THIS(iface);
643     FIXME("(%p)->()\n", This);
644     return E_NOTIMPL;
645 }
646
647 static HRESULT WINAPI HTMLElement2_get_onrowsinserted(IHTMLElement2 *iface, VARIANT *p)
648 {
649     HTMLElement *This = HTMLELEM2_THIS(iface);
650     FIXME("(%p)->(%p)\n", This, p);
651     return E_NOTIMPL;
652 }
653
654 static HRESULT WINAPI HTMLElement2_put_oncellchange(IHTMLElement2 *iface, VARIANT v)
655 {
656     HTMLElement *This = HTMLELEM2_THIS(iface);
657     FIXME("(%p)->()\n", This);
658     return E_NOTIMPL;
659 }
660
661 static HRESULT WINAPI HTMLElement2_get_oncellchange(IHTMLElement2 *iface, VARIANT *p)
662 {
663     HTMLElement *This = HTMLELEM2_THIS(iface);
664     FIXME("(%p)->(%p)\n", This, p);
665     return E_NOTIMPL;
666 }
667
668 static HRESULT WINAPI HTMLElement2_put_dir(IHTMLElement2 *iface, BSTR v)
669 {
670     HTMLElement *This = HTMLELEM2_THIS(iface);
671     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
672     return E_NOTIMPL;
673 }
674
675 static HRESULT WINAPI HTMLElement2_get_dir(IHTMLElement2 *iface, BSTR *p)
676 {
677     HTMLElement *This = HTMLELEM2_THIS(iface);
678
679     TRACE("(%p)->(%p)\n", This, p);
680
681     *p = NULL;
682
683     if(This->nselem) {
684         nsAString dir_str;
685         nsresult nsres;
686
687         nsAString_Init(&dir_str, NULL);
688
689         nsres = nsIDOMHTMLElement_GetDir(This->nselem, &dir_str);
690         if(NS_SUCCEEDED(nsres)) {
691             const PRUnichar *dir;
692             nsAString_GetData(&dir_str, &dir);
693             if(*dir)
694                 *p = SysAllocString(dir);
695         }else {
696             ERR("GetDir failed: %08x\n", nsres);
697         }
698
699         nsAString_Finish(&dir_str);
700     }
701
702     TRACE("ret %s\n", debugstr_w(*p));
703     return S_OK;
704 }
705
706 static HRESULT WINAPI HTMLElement2_createControlRange(IHTMLElement2 *iface, IDispatch **range)
707 {
708     HTMLElement *This = HTMLELEM2_THIS(iface);
709     FIXME("(%p)->(%p)\n", This, range);
710     return E_NOTIMPL;
711 }
712
713 static HRESULT WINAPI HTMLElement2_get_scrollHeight(IHTMLElement2 *iface, long *p)
714 {
715     HTMLElement *This = HTMLELEM2_THIS(iface);
716     FIXME("(%p)->(%p)\n", This, p);
717     return E_NOTIMPL;
718 }
719
720 static HRESULT WINAPI HTMLElement2_get_scrollWidth(IHTMLElement2 *iface, long *p)
721 {
722     HTMLElement *This = HTMLELEM2_THIS(iface);
723     FIXME("(%p)->(%p)\n", This, p);
724     return E_NOTIMPL;
725 }
726
727 static HRESULT WINAPI HTMLElement2_put_scrollTop(IHTMLElement2 *iface, long v)
728 {
729     HTMLElement *This = HTMLELEM2_THIS(iface);
730     nsIDOMNSHTMLElement *nselem;
731     nsresult nsres;
732
733     TRACE("(%p)->(%ld)\n", This, v);
734
735     if(!This->nselem) {
736         FIXME("NULL nselem\n");
737         return E_NOTIMPL;
738     }
739
740     nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
741     if(NS_SUCCEEDED(nsres)) {
742         nsIDOMNSHTMLElement_SetScrollTop(nselem, v);
743         nsIDOMNSHTMLElement_Release(nselem);
744     }else {
745         ERR("Could not get nsIDOMNSHTMLElement interface: %08x\n", nsres);
746     }
747
748     return S_OK;
749 }
750
751 static HRESULT WINAPI HTMLElement2_get_scrollTop(IHTMLElement2 *iface, long *p)
752 {
753     HTMLElement *This = HTMLELEM2_THIS(iface);
754     FIXME("(%p)->(%p)\n", This, p);
755     return E_NOTIMPL;
756 }
757
758 static HRESULT WINAPI HTMLElement2_put_scrollLeft(IHTMLElement2 *iface, long v)
759 {
760     HTMLElement *This = HTMLELEM2_THIS(iface);
761     nsIDOMNSHTMLElement *nselem;
762     nsresult nsres;
763
764     TRACE("(%p)->(%ld)\n", This, v);
765
766     if(!This->nselem) {
767         FIXME("NULL nselem\n");
768         return E_NOTIMPL;
769     }
770
771     nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
772     if(NS_SUCCEEDED(nsres)) {
773         nsIDOMNSHTMLElement_SetScrollLeft(nselem, v);
774         nsIDOMNSHTMLElement_Release(nselem);
775     }else {
776         ERR("Could not get nsIDOMNSHTMLElement interface: %08x\n", nsres);
777     }
778
779     return S_OK;
780 }
781
782 static HRESULT WINAPI HTMLElement2_get_scrollLeft(IHTMLElement2 *iface, long *p)
783 {
784     HTMLElement *This = HTMLELEM2_THIS(iface);
785     FIXME("(%p)->(%p)\n", This, p);
786     return E_NOTIMPL;
787 }
788
789 static HRESULT WINAPI HTMLElement2_clearAttributes(IHTMLElement2 *iface)
790 {
791     HTMLElement *This = HTMLELEM2_THIS(iface);
792     FIXME("(%p)\n", This);
793     return E_NOTIMPL;
794 }
795
796 static HRESULT WINAPI HTMLElement2_mergeAttributes(IHTMLElement2 *iface, IHTMLElement *mergeThis)
797 {
798     HTMLElement *This = HTMLELEM2_THIS(iface);
799     FIXME("(%p)->(%p)\n", This, mergeThis);
800     return E_NOTIMPL;
801 }
802
803 static HRESULT WINAPI HTMLElement2_put_oncontextmenu(IHTMLElement2 *iface, VARIANT v)
804 {
805     HTMLElement *This = HTMLELEM2_THIS(iface);
806     FIXME("(%p)->()\n", This);
807     return E_NOTIMPL;
808 }
809
810 static HRESULT WINAPI HTMLElement2_get_oncontextmenu(IHTMLElement2 *iface, VARIANT *p)
811 {
812     HTMLElement *This = HTMLELEM2_THIS(iface);
813     FIXME("(%p)->(%p)\n", This, p);
814     return E_NOTIMPL;
815 }
816
817 static HRESULT WINAPI HTMLElement2_insertAdjecentElement(IHTMLElement2 *iface, BSTR where,
818         IHTMLElement *insertedElement, IHTMLElement **inserted)
819 {
820     HTMLElement *This = HTMLELEM2_THIS(iface);
821     FIXME("(%p)->(%s %p %p)\n", This, debugstr_w(where), insertedElement, inserted);
822     return E_NOTIMPL;
823 }
824
825 static HRESULT WINAPI HTMLElement2_applyElement(IHTMLElement2 *iface, IHTMLElement *apply,
826                                                 BSTR where, IHTMLElement **applied)
827 {
828     HTMLElement *This = HTMLELEM2_THIS(iface);
829     FIXME("(%p)->(%p %s %p)\n", This, apply, debugstr_w(where), applied);
830     return E_NOTIMPL;
831 }
832
833 static HRESULT WINAPI HTMLElement2_getAdjecentText(IHTMLElement2 *iface, BSTR where, BSTR *text)
834 {
835     HTMLElement *This = HTMLELEM2_THIS(iface);
836     FIXME("(%p)->(%s %p)\n", This, debugstr_w(where), text);
837     return E_NOTIMPL;
838 }
839
840 static HRESULT WINAPI HTMLElement2_replaceAdjecentText(IHTMLElement2 *iface, BSTR where,
841                                                        BSTR newText, BSTR *oldText)
842 {
843     HTMLElement *This = HTMLELEM2_THIS(iface);
844     FIXME("(%p)->(%s %s %p)\n", This, debugstr_w(where), debugstr_w(newText), oldText);
845     return E_NOTIMPL;
846 }
847
848 static HRESULT WINAPI HTMLElement2_get_canHandleChildren(IHTMLElement2 *iface, VARIANT_BOOL *p)
849 {
850     HTMLElement *This = HTMLELEM2_THIS(iface);
851     FIXME("(%p)->(%p)\n", This, p);
852     return E_NOTIMPL;
853 }
854
855 static HRESULT WINAPI HTMLElement2_addBehavior(IHTMLElement2 *iface, BSTR bstrUrl,
856                                                VARIANT *pvarFactory, long *pCookie)
857 {
858     HTMLElement *This = HTMLELEM2_THIS(iface);
859     FIXME("(%p)->(%s %p %p)\n", This, debugstr_w(bstrUrl), pvarFactory, pCookie);
860     return E_NOTIMPL;
861 }
862
863 static HRESULT WINAPI HTMLElement2_removeBehavior(IHTMLElement2 *iface, long cookie,
864                                                   VARIANT_BOOL *pfResult)
865 {
866     HTMLElement *This = HTMLELEM2_THIS(iface);
867     FIXME("(%p)->(%ld %p)\n", This, cookie, pfResult);
868     return E_NOTIMPL;
869 }
870
871 static HRESULT WINAPI HTMLElement2_get_runtimeStyle(IHTMLElement2 *iface, IHTMLStyle **p)
872 {
873     HTMLElement *This = HTMLELEM2_THIS(iface);
874     FIXME("(%p)->(%p)\n", This, p);
875     return E_NOTIMPL;
876 }
877
878 static HRESULT WINAPI HTMLElement2_get_behaviorUrns(IHTMLElement2 *iface, IDispatch **p)
879 {
880     HTMLElement *This = HTMLELEM2_THIS(iface);
881     FIXME("(%p)->(%p)\n", This, p);
882     return E_NOTIMPL;
883 }
884
885 static HRESULT WINAPI HTMLElement2_put_tagUrn(IHTMLElement2 *iface, BSTR v)
886 {
887     HTMLElement *This = HTMLELEM2_THIS(iface);
888     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
889     return E_NOTIMPL;
890 }
891
892 static HRESULT WINAPI HTMLElement2_get_tagUrn(IHTMLElement2 *iface, BSTR *p)
893 {
894     HTMLElement *This = HTMLELEM2_THIS(iface);
895     FIXME("(%p)->(%p)\n", This, p);
896     return E_NOTIMPL;
897 }
898
899 static HRESULT WINAPI HTMLElement2_put_onbeforeeditfocus(IHTMLElement2 *iface, VARIANT vv)
900 {
901     HTMLElement *This = HTMLELEM2_THIS(iface);
902     FIXME("(%p)->()\n", This);
903     return E_NOTIMPL;
904 }
905
906 static HRESULT WINAPI HTMLElement2_get_onbeforeeditfocus(IHTMLElement2 *iface, VARIANT *p)
907 {
908     HTMLElement *This = HTMLELEM2_THIS(iface);
909     FIXME("(%p)->(%p)\n", This, p);
910     return E_NOTIMPL;
911 }
912
913 static HRESULT WINAPI HTMLElement2_get_readyStateValue(IHTMLElement2 *iface, long *p)
914 {
915     HTMLElement *This = HTMLELEM2_THIS(iface);
916     FIXME("(%p)->(%p)\n", This, p);
917     return E_NOTIMPL;
918 }
919
920 static HRESULT WINAPI HTMLElement2_getElementByTagName(IHTMLElement2 *iface, BSTR v,
921                                                        IHTMLElementCollection **pelColl)
922 {
923     HTMLElement *This = HTMLELEM2_THIS(iface);
924     FIXME("(%p)->(%s %p)\n", This, debugstr_w(v), pelColl);
925     return E_NOTIMPL;
926 }
927
928 #undef HTMLELEM2_THIS
929
930 static const IHTMLElement2Vtbl HTMLElement2Vtbl = {
931     HTMLElement2_QueryInterface,
932     HTMLElement2_AddRef,
933     HTMLElement2_Release,
934     HTMLElement2_GetTypeInfoCount,
935     HTMLElement2_GetTypeInfo,
936     HTMLElement2_GetIDsOfNames,
937     HTMLElement2_Invoke,
938     HTMLElement2_get_scopeName,
939     HTMLElement2_setCapture,
940     HTMLElement2_releaseCapture,
941     HTMLElement2_put_onlosecapture,
942     HTMLElement2_get_onlosecapture,
943     HTMLElement2_componentFromPoint,
944     HTMLElement2_doScroll,
945     HTMLElement2_put_onscroll,
946     HTMLElement2_get_onscroll,
947     HTMLElement2_put_ondrag,
948     HTMLElement2_get_ondrag,
949     HTMLElement2_put_ondragend,
950     HTMLElement2_get_ondragend,
951     HTMLElement2_put_ondragenter,
952     HTMLElement2_get_ondragenter,
953     HTMLElement2_put_ondragover,
954     HTMLElement2_get_ondragover,
955     HTMLElement2_put_ondragleave,
956     HTMLElement2_get_ondragleave,
957     HTMLElement2_put_ondrop,
958     HTMLElement2_get_ondrop,
959     HTMLElement2_put_onbeforecut,
960     HTMLElement2_get_onbeforecut,
961     HTMLElement2_put_oncut,
962     HTMLElement2_get_oncut,
963     HTMLElement2_put_onbeforecopy,
964     HTMLElement2_get_onbeforecopy,
965     HTMLElement2_put_oncopy,
966     HTMLElement2_get_oncopy,
967     HTMLElement2_put_onbeforepaste,
968     HTMLElement2_get_onbeforepaste,
969     HTMLElement2_put_onpaste,
970     HTMLElement2_get_onpaste,
971     HTMLElement2_get_currentStyle,
972     HTMLElement2_put_onpropertychange,
973     HTMLElement2_get_onpropertychange,
974     HTMLElement2_getClientRects,
975     HTMLElement2_getBoundingClientRect,
976     HTMLElement2_setExpression,
977     HTMLElement2_getExpression,
978     HTMLElement2_removeExpression,
979     HTMLElement2_put_tabIndex,
980     HTMLElement2_get_tabIndex,
981     HTMLElement2_focus,
982     HTMLElement2_put_accessKey,
983     HTMLElement2_get_accessKey,
984     HTMLElement2_put_onblur,
985     HTMLElement2_get_onblur,
986     HTMLElement2_put_onfocus,
987     HTMLElement2_get_onfocus,
988     HTMLElement2_put_onresize,
989     HTMLElement2_get_onresize,
990     HTMLElement2_blur,
991     HTMLElement2_addFilter,
992     HTMLElement2_removeFilter,
993     HTMLElement2_get_clientHeight,
994     HTMLElement2_get_clientWidth,
995     HTMLElement2_get_clientTop,
996     HTMLElement2_get_clientLeft,
997     HTMLElement2_attachEvent,
998     HTMLElement2_detachEvent,
999     HTMLElement2_get_readyState,
1000     HTMLElement2_put_onreadystatechange,
1001     HTMLElement2_get_onreadystatechange,
1002     HTMLElement2_put_onrowsdelete,
1003     HTMLElement2_get_onrowsdelete,
1004     HTMLElement2_put_onrowsinserted,
1005     HTMLElement2_get_onrowsinserted,
1006     HTMLElement2_put_oncellchange,
1007     HTMLElement2_get_oncellchange,
1008     HTMLElement2_put_dir,
1009     HTMLElement2_get_dir,
1010     HTMLElement2_createControlRange,
1011     HTMLElement2_get_scrollHeight,
1012     HTMLElement2_get_scrollWidth,
1013     HTMLElement2_put_scrollTop,
1014     HTMLElement2_get_scrollTop,
1015     HTMLElement2_put_scrollLeft,
1016     HTMLElement2_get_scrollLeft,
1017     HTMLElement2_clearAttributes,
1018     HTMLElement2_mergeAttributes,
1019     HTMLElement2_put_oncontextmenu,
1020     HTMLElement2_get_oncontextmenu,
1021     HTMLElement2_insertAdjecentElement,
1022     HTMLElement2_applyElement,
1023     HTMLElement2_getAdjecentText,
1024     HTMLElement2_replaceAdjecentText,
1025     HTMLElement2_get_canHandleChildren,
1026     HTMLElement2_addBehavior,
1027     HTMLElement2_removeBehavior,
1028     HTMLElement2_get_runtimeStyle,
1029     HTMLElement2_get_behaviorUrns,
1030     HTMLElement2_put_tagUrn,
1031     HTMLElement2_get_tagUrn,
1032     HTMLElement2_put_onbeforeeditfocus,
1033     HTMLElement2_get_onbeforeeditfocus,
1034     HTMLElement2_get_readyStateValue,
1035     HTMLElement2_getElementByTagName,
1036 };
1037
1038 void HTMLElement2_Init(HTMLElement *This)
1039 {
1040     This->lpHTMLElement2Vtbl = &HTMLElement2Vtbl;
1041 }