mshtml: Added noscript tag handling tests.
[wine] / dlls / mshtml / htmlelem3.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 "wine/debug.h"
29
30 #include "mshtml_private.h"
31 #include "htmlevent.h"
32
33 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
34
35 static inline HTMLElement *impl_from_IHTMLElement3(IHTMLElement3 *iface)
36 {
37     return CONTAINING_RECORD(iface, HTMLElement, IHTMLElement3_iface);
38 }
39
40 static HRESULT WINAPI HTMLElement3_QueryInterface(IHTMLElement3 *iface,
41                                                   REFIID riid, void **ppv)
42 {
43     HTMLElement *This = impl_from_IHTMLElement3(iface);
44     return IHTMLElement_QueryInterface(&This->IHTMLElement_iface, riid, ppv);
45 }
46
47 static ULONG WINAPI HTMLElement3_AddRef(IHTMLElement3 *iface)
48 {
49     HTMLElement *This = impl_from_IHTMLElement3(iface);
50     return IHTMLElement_AddRef(&This->IHTMLElement_iface);
51 }
52
53 static ULONG WINAPI HTMLElement3_Release(IHTMLElement3 *iface)
54 {
55     HTMLElement *This = impl_from_IHTMLElement3(iface);
56     return IHTMLElement_Release(&This->IHTMLElement_iface);
57 }
58
59 static HRESULT WINAPI HTMLElement3_GetTypeInfoCount(IHTMLElement3 *iface, UINT *pctinfo)
60 {
61     HTMLElement *This = impl_from_IHTMLElement3(iface);
62     return IDispatchEx_GetTypeInfoCount(&This->node.dispex.IDispatchEx_iface, pctinfo);
63 }
64
65 static HRESULT WINAPI HTMLElement3_GetTypeInfo(IHTMLElement3 *iface, UINT iTInfo,
66                                                LCID lcid, ITypeInfo **ppTInfo)
67 {
68     HTMLElement *This = impl_from_IHTMLElement3(iface);
69     return IDispatchEx_GetTypeInfo(&This->node.dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
70 }
71
72 static HRESULT WINAPI HTMLElement3_GetIDsOfNames(IHTMLElement3 *iface, REFIID riid,
73                                                 LPOLESTR *rgszNames, UINT cNames,
74                                                 LCID lcid, DISPID *rgDispId)
75 {
76     HTMLElement *This = impl_from_IHTMLElement3(iface);
77     return IDispatchEx_GetIDsOfNames(&This->node.dispex.IDispatchEx_iface, riid, rgszNames, cNames,
78             lcid, rgDispId);
79 }
80
81 static HRESULT WINAPI HTMLElement3_Invoke(IHTMLElement3 *iface, DISPID dispIdMember,
82                             REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
83                             VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
84 {
85     HTMLElement *This = impl_from_IHTMLElement3(iface);
86     return IDispatchEx_Invoke(&This->node.dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
87             wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
88 }
89
90 static HRESULT WINAPI HTMLElement3_mergeAttributes(IHTMLElement3 *iface, IHTMLElement *mergeThis, VARIANT *pvarFlags)
91 {
92     HTMLElement *This = impl_from_IHTMLElement3(iface);
93     FIXME("(%p)->(%p %p)\n", This, mergeThis, pvarFlags);
94     return E_NOTIMPL;
95 }
96
97 static HRESULT WINAPI HTMLElement3_get_isMultiLine(IHTMLElement3 *iface, VARIANT_BOOL *p)
98 {
99     HTMLElement *This = impl_from_IHTMLElement3(iface);
100     FIXME("(%p)->(%p)\n", This, p);
101     return E_NOTIMPL;
102 }
103
104 static HRESULT WINAPI HTMLElement3_get_canHaveHTML(IHTMLElement3 *iface, VARIANT_BOOL *p)
105 {
106     HTMLElement *This = impl_from_IHTMLElement3(iface);
107     FIXME("(%p)->(%p)\n", This, p);
108     return E_NOTIMPL;
109 }
110
111 static HRESULT WINAPI HTMLElement3_put_onlayoutcomplete(IHTMLElement3 *iface, VARIANT v)
112 {
113     HTMLElement *This = impl_from_IHTMLElement3(iface);
114     FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
115     return E_NOTIMPL;
116 }
117
118 static HRESULT WINAPI HTMLElement3_get_onlayoutcomplete(IHTMLElement3 *iface, VARIANT *p)
119 {
120     HTMLElement *This = impl_from_IHTMLElement3(iface);
121     FIXME("(%p)->(%p)\n", This, p);
122     return E_NOTIMPL;
123 }
124
125 static HRESULT WINAPI HTMLElement3_put_onpage(IHTMLElement3 *iface, VARIANT v)
126 {
127     HTMLElement *This = impl_from_IHTMLElement3(iface);
128     FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
129     return E_NOTIMPL;
130 }
131
132 static HRESULT WINAPI HTMLElement3_get_onpage(IHTMLElement3 *iface, VARIANT *p)
133 {
134     HTMLElement *This = impl_from_IHTMLElement3(iface);
135     FIXME("(%p)->(%p)\n", This, p);
136     return E_NOTIMPL;
137 }
138
139 static HRESULT WINAPI HTMLElement3_put_inflateBlock(IHTMLElement3 *iface, VARIANT_BOOL v)
140 {
141     HTMLElement *This = impl_from_IHTMLElement3(iface);
142     FIXME("(%p)->(%x)\n", This, v);
143     return E_NOTIMPL;
144 }
145
146 static HRESULT WINAPI HTMLElement3_get_inflateBlock(IHTMLElement3 *iface, VARIANT_BOOL *p)
147 {
148     HTMLElement *This = impl_from_IHTMLElement3(iface);
149     FIXME("(%p)->(%p)\n", This, p);
150     return E_NOTIMPL;
151 }
152
153 static HRESULT WINAPI HTMLElement3_put_onbeforedeactivate(IHTMLElement3 *iface, VARIANT v)
154 {
155     HTMLElement *This = impl_from_IHTMLElement3(iface);
156     FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
157     return E_NOTIMPL;
158 }
159
160 static HRESULT WINAPI HTMLElement3_get_onbeforedeactivate(IHTMLElement3 *iface, VARIANT *p)
161 {
162     HTMLElement *This = impl_from_IHTMLElement3(iface);
163     FIXME("(%p)->(%p)\n", This, p);
164     return E_NOTIMPL;
165 }
166
167 static HRESULT WINAPI HTMLElement3_setActive(IHTMLElement3 *iface)
168 {
169     HTMLElement *This = impl_from_IHTMLElement3(iface);
170     FIXME("(%p)\n", This);
171     return E_NOTIMPL;
172 }
173
174 static HRESULT WINAPI HTMLElement3_put_contentEditable(IHTMLElement3 *iface, BSTR v)
175 {
176     HTMLElement *This = impl_from_IHTMLElement3(iface);
177     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
178     return E_NOTIMPL;
179 }
180
181 static HRESULT WINAPI HTMLElement3_get_contentEditable(IHTMLElement3 *iface, BSTR *p)
182 {
183     HTMLElement *This = impl_from_IHTMLElement3(iface);
184     FIXME("(%p)->(%p)\n", This, p);
185     return E_NOTIMPL;
186 }
187
188 static HRESULT WINAPI HTMLElement3_get_isContentEditable(IHTMLElement3 *iface, VARIANT_BOOL *p)
189 {
190     HTMLElement *This = impl_from_IHTMLElement3(iface);
191     FIXME("(%p)->(%p)\n", This, p);
192     return E_NOTIMPL;
193 }
194
195 static HRESULT WINAPI HTMLElement3_put_hideFocus(IHTMLElement3 *iface, VARIANT_BOOL v)
196 {
197     HTMLElement *This = impl_from_IHTMLElement3(iface);
198     FIXME("(%p)->(%x)\n", This, v);
199     return E_NOTIMPL;
200 }
201
202 static HRESULT WINAPI HTMLElement3_get_hideFocus(IHTMLElement3 *iface, VARIANT_BOOL *p)
203 {
204     HTMLElement *This = impl_from_IHTMLElement3(iface);
205     FIXME("(%p)->(%p)\n", This, p);
206     return E_NOTIMPL;
207 }
208
209 static const WCHAR disabledW[] = {'d','i','s','a','b','l','e','d',0};
210
211 static HRESULT WINAPI HTMLElement3_put_disabled(IHTMLElement3 *iface, VARIANT_BOOL v)
212 {
213     HTMLElement *This = impl_from_IHTMLElement3(iface);
214     VARIANT *var;
215     HRESULT hres;
216
217     TRACE("(%p)->(%x)\n", This, v);
218
219     if(This->node.vtbl->put_disabled)
220         return This->node.vtbl->put_disabled(&This->node, v);
221
222     hres = dispex_get_dprop_ref(&This->node.dispex, disabledW, TRUE, &var);
223     if(FAILED(hres))
224         return hres;
225
226     VariantClear(var);
227     V_VT(var) = VT_BOOL;
228     V_BOOL(var) = v;
229     return S_OK;
230 }
231
232 static HRESULT WINAPI HTMLElement3_get_disabled(IHTMLElement3 *iface, VARIANT_BOOL *p)
233 {
234     HTMLElement *This = impl_from_IHTMLElement3(iface);
235     VARIANT *var;
236     HRESULT hres;
237
238     TRACE("(%p)->(%p)\n", This, p);
239
240     if(This->node.vtbl->get_disabled)
241         return This->node.vtbl->get_disabled(&This->node, p);
242
243     hres = dispex_get_dprop_ref(&This->node.dispex, disabledW, FALSE, &var);
244     if(hres == DISP_E_UNKNOWNNAME) {
245         *p = VARIANT_FALSE;
246         return S_OK;
247     }
248     if(FAILED(hres))
249         return hres;
250
251     if(V_VT(var) != VT_BOOL) {
252         FIXME("value is %s\n", debugstr_variant(var));
253         return E_NOTIMPL;
254     }
255
256     *p = V_BOOL(var);
257     return S_OK;
258 }
259
260 static HRESULT WINAPI HTMLElement3_get_isDisabled(IHTMLElement3 *iface, VARIANT_BOOL *p)
261 {
262     HTMLElement *This = impl_from_IHTMLElement3(iface);
263     FIXME("(%p)->(%p)\n", This, p);
264     return E_NOTIMPL;
265 }
266
267 static HRESULT WINAPI HTMLElement3_put_onmove(IHTMLElement3 *iface, VARIANT v)
268 {
269     HTMLElement *This = impl_from_IHTMLElement3(iface);
270     FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
271     return E_NOTIMPL;
272 }
273
274 static HRESULT WINAPI HTMLElement3_get_onmove(IHTMLElement3 *iface, VARIANT *p)
275 {
276     HTMLElement *This = impl_from_IHTMLElement3(iface);
277     FIXME("(%p)->(%p)\n", This, p);
278     return E_NOTIMPL;
279 }
280
281 static HRESULT WINAPI HTMLElement3_put_oncontrolselect(IHTMLElement3 *iface, VARIANT v)
282 {
283     HTMLElement *This = impl_from_IHTMLElement3(iface);
284     FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
285     return E_NOTIMPL;
286 }
287
288 static HRESULT WINAPI HTMLElement3_get_oncontrolselect(IHTMLElement3 *iface, VARIANT *p)
289 {
290     HTMLElement *This = impl_from_IHTMLElement3(iface);
291     FIXME("(%p)->(%p)\n", This, p);
292     return E_NOTIMPL;
293 }
294
295 static HRESULT WINAPI HTMLElement3_fireEvent(IHTMLElement3 *iface, BSTR bstrEventName,
296         VARIANT *pvarEventObject, VARIANT_BOOL *pfCancelled)
297 {
298     HTMLElement *This = impl_from_IHTMLElement3(iface);
299
300     TRACE("(%p)->(%s %s %p)\n", This, debugstr_w(bstrEventName), debugstr_variant(pvarEventObject),
301           pfCancelled);
302
303     return dispatch_event(&This->node, bstrEventName, pvarEventObject, pfCancelled);
304 }
305
306 static HRESULT WINAPI HTMLElement3_put_onresizestart(IHTMLElement3 *iface, VARIANT v)
307 {
308     HTMLElement *This = impl_from_IHTMLElement3(iface);
309     FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
310     return E_NOTIMPL;
311 }
312
313 static HRESULT WINAPI HTMLElement3_get_onresizestart(IHTMLElement3 *iface, VARIANT *p)
314 {
315     HTMLElement *This = impl_from_IHTMLElement3(iface);
316     FIXME("(%p)->(%p)\n", This, p);
317     return E_NOTIMPL;
318 }
319
320 static HRESULT WINAPI HTMLElement3_put_onresizeend(IHTMLElement3 *iface, VARIANT v)
321 {
322     HTMLElement *This = impl_from_IHTMLElement3(iface);
323     FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
324     return E_NOTIMPL;
325 }
326
327 static HRESULT WINAPI HTMLElement3_get_onresizeend(IHTMLElement3 *iface, VARIANT *p)
328 {
329     HTMLElement *This = impl_from_IHTMLElement3(iface);
330     FIXME("(%p)->(%p)\n", This, p);
331     return E_NOTIMPL;
332 }
333
334 static HRESULT WINAPI HTMLElement3_put_onmovestart(IHTMLElement3 *iface, VARIANT v)
335 {
336     HTMLElement *This = impl_from_IHTMLElement3(iface);
337     FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
338     return E_NOTIMPL;
339 }
340
341 static HRESULT WINAPI HTMLElement3_get_onmovestart(IHTMLElement3 *iface, VARIANT *p)
342 {
343     HTMLElement *This = impl_from_IHTMLElement3(iface);
344     FIXME("(%p)->(%p)\n", This, p);
345     return E_NOTIMPL;
346 }
347
348 static HRESULT WINAPI HTMLElement3_put_onmoveend(IHTMLElement3 *iface, VARIANT v)
349 {
350     HTMLElement *This = impl_from_IHTMLElement3(iface);
351     FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
352     return E_NOTIMPL;
353 }
354
355 static HRESULT WINAPI HTMLElement3_get_onmoveend(IHTMLElement3 *iface, VARIANT *p)
356 {
357     HTMLElement *This = impl_from_IHTMLElement3(iface);
358     FIXME("(%p)->(%p)\n", This, p);
359     return E_NOTIMPL;
360 }
361
362 static HRESULT WINAPI HTMLElement3_put_onmousecenter(IHTMLElement3 *iface, VARIANT v)
363 {
364     HTMLElement *This = impl_from_IHTMLElement3(iface);
365     FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
366     return E_NOTIMPL;
367 }
368
369 static HRESULT WINAPI HTMLElement3_get_onmousecenter(IHTMLElement3 *iface, VARIANT *p)
370 {
371     HTMLElement *This = impl_from_IHTMLElement3(iface);
372     FIXME("(%p)->(%p)\n", This, p);
373     return E_NOTIMPL;
374 }
375
376 static HRESULT WINAPI HTMLElement3_put_onmouseleave(IHTMLElement3 *iface, VARIANT v)
377 {
378     HTMLElement *This = impl_from_IHTMLElement3(iface);
379     FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
380     return E_NOTIMPL;
381 }
382
383 static HRESULT WINAPI HTMLElement3_get_onmouseleave(IHTMLElement3 *iface, VARIANT *p)
384 {
385     HTMLElement *This = impl_from_IHTMLElement3(iface);
386     FIXME("(%p)->(%p)\n", This, p);
387     return E_NOTIMPL;
388 }
389
390 static HRESULT WINAPI HTMLElement3_put_onactivate(IHTMLElement3 *iface, VARIANT v)
391 {
392     HTMLElement *This = impl_from_IHTMLElement3(iface);
393     FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
394     return E_NOTIMPL;
395 }
396
397 static HRESULT WINAPI HTMLElement3_get_onactivate(IHTMLElement3 *iface, VARIANT *p)
398 {
399     HTMLElement *This = impl_from_IHTMLElement3(iface);
400     FIXME("(%p)->(%p)\n", This, p);
401     return E_NOTIMPL;
402 }
403
404 static HRESULT WINAPI HTMLElement3_put_ondeactivate(IHTMLElement3 *iface, VARIANT v)
405 {
406     HTMLElement *This = impl_from_IHTMLElement3(iface);
407     FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
408     return E_NOTIMPL;
409 }
410
411 static HRESULT WINAPI HTMLElement3_get_ondeactivate(IHTMLElement3 *iface, VARIANT *p)
412 {
413     HTMLElement *This = impl_from_IHTMLElement3(iface);
414     FIXME("(%p)->(%p)\n", This, p);
415     return E_NOTIMPL;
416 }
417
418 static HRESULT WINAPI HTMLElement3_dragDrop(IHTMLElement3 *iface, VARIANT_BOOL *pfRet)
419 {
420     HTMLElement *This = impl_from_IHTMLElement3(iface);
421     FIXME("(%p)->(%p)\n", This, pfRet);
422     return E_NOTIMPL;
423 }
424
425 static HRESULT WINAPI HTMLElement3_get_glyphMode(IHTMLElement3 *iface, LONG *p)
426 {
427     HTMLElement *This = impl_from_IHTMLElement3(iface);
428     FIXME("(%p)->(%p)\n", This, p);
429     return E_NOTIMPL;
430 }
431
432 static const IHTMLElement3Vtbl HTMLElement3Vtbl = {
433     HTMLElement3_QueryInterface,
434     HTMLElement3_AddRef,
435     HTMLElement3_Release,
436     HTMLElement3_GetTypeInfoCount,
437     HTMLElement3_GetTypeInfo,
438     HTMLElement3_GetIDsOfNames,
439     HTMLElement3_Invoke,
440     HTMLElement3_mergeAttributes,
441     HTMLElement3_get_isMultiLine,
442     HTMLElement3_get_canHaveHTML,
443     HTMLElement3_put_onlayoutcomplete,
444     HTMLElement3_get_onlayoutcomplete,
445     HTMLElement3_put_onpage,
446     HTMLElement3_get_onpage,
447     HTMLElement3_put_inflateBlock,
448     HTMLElement3_get_inflateBlock,
449     HTMLElement3_put_onbeforedeactivate,
450     HTMLElement3_get_onbeforedeactivate,
451     HTMLElement3_setActive,
452     HTMLElement3_put_contentEditable,
453     HTMLElement3_get_contentEditable,
454     HTMLElement3_get_isContentEditable,
455     HTMLElement3_put_hideFocus,
456     HTMLElement3_get_hideFocus,
457     HTMLElement3_put_disabled,
458     HTMLElement3_get_disabled,
459     HTMLElement3_get_isDisabled,
460     HTMLElement3_put_onmove,
461     HTMLElement3_get_onmove,
462     HTMLElement3_put_oncontrolselect,
463     HTMLElement3_get_oncontrolselect,
464     HTMLElement3_fireEvent,
465     HTMLElement3_put_onresizestart,
466     HTMLElement3_get_onresizestart,
467     HTMLElement3_put_onresizeend,
468     HTMLElement3_get_onresizeend,
469     HTMLElement3_put_onmovestart,
470     HTMLElement3_get_onmovestart,
471     HTMLElement3_put_onmoveend,
472     HTMLElement3_get_onmoveend,
473     HTMLElement3_put_onmousecenter,
474     HTMLElement3_get_onmousecenter,
475     HTMLElement3_put_onmouseleave,
476     HTMLElement3_get_onmouseleave,
477     HTMLElement3_put_onactivate,
478     HTMLElement3_get_onactivate,
479     HTMLElement3_put_ondeactivate,
480     HTMLElement3_get_ondeactivate,
481     HTMLElement3_dragDrop,
482     HTMLElement3_get_glyphMode
483 };
484
485 static inline HTMLElement *impl_from_IHTMLElement4(IHTMLElement4 *iface)
486 {
487     return CONTAINING_RECORD(iface, HTMLElement, IHTMLElement4_iface);
488 }
489
490 static HRESULT WINAPI HTMLElement4_QueryInterface(IHTMLElement4 *iface,
491         REFIID riid, void **ppv)
492 {
493     HTMLElement *This = impl_from_IHTMLElement4(iface);
494     return IHTMLElement_QueryInterface(&This->IHTMLElement_iface, riid, ppv);
495 }
496
497 static ULONG WINAPI HTMLElement4_AddRef(IHTMLElement4 *iface)
498 {
499     HTMLElement *This = impl_from_IHTMLElement4(iface);
500     return IHTMLElement_AddRef(&This->IHTMLElement_iface);
501 }
502
503 static ULONG WINAPI HTMLElement4_Release(IHTMLElement4 *iface)
504 {
505     HTMLElement *This = impl_from_IHTMLElement4(iface);
506     return IHTMLElement_Release(&This->IHTMLElement_iface);
507 }
508
509 static HRESULT WINAPI HTMLElement4_GetTypeInfoCount(IHTMLElement4 *iface, UINT *pctinfo)
510 {
511     HTMLElement *This = impl_from_IHTMLElement4(iface);
512     return IDispatchEx_GetTypeInfoCount(&This->node.dispex.IDispatchEx_iface, pctinfo);
513 }
514
515 static HRESULT WINAPI HTMLElement4_GetTypeInfo(IHTMLElement4 *iface, UINT iTInfo,
516         LCID lcid, ITypeInfo **ppTInfo)
517 {
518     HTMLElement *This = impl_from_IHTMLElement4(iface);
519     return IDispatchEx_GetTypeInfo(&This->node.dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
520 }
521
522 static HRESULT WINAPI HTMLElement4_GetIDsOfNames(IHTMLElement4 *iface, REFIID riid,
523         LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
524 {
525     HTMLElement *This = impl_from_IHTMLElement4(iface);
526     return IDispatchEx_GetIDsOfNames(&This->node.dispex.IDispatchEx_iface, riid, rgszNames, cNames,
527             lcid, rgDispId);
528 }
529
530 static HRESULT WINAPI HTMLElement4_Invoke(IHTMLElement4 *iface, DISPID dispIdMember, REFIID riid,
531         LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
532 {
533     HTMLElement *This = impl_from_IHTMLElement4(iface);
534     return IDispatchEx_Invoke(&This->node.dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
535             wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
536 }
537
538 static HRESULT WINAPI HTMLElement4_put_onmousewheel(IHTMLElement4 *iface, VARIANT v)
539 {
540     HTMLElement *This = impl_from_IHTMLElement4(iface);
541     FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
542     return E_NOTIMPL;
543 }
544
545 static HRESULT WINAPI HTMLElement4_get_onmousewheel(IHTMLElement4 *iface, VARIANT *p)
546 {
547     HTMLElement *This = impl_from_IHTMLElement4(iface);
548     FIXME("(%p)->(%p)\n", This, p);
549     return E_NOTIMPL;
550 }
551
552 static HRESULT WINAPI HTMLElement4_normalize(IHTMLElement4 *iface)
553 {
554     HTMLElement *This = impl_from_IHTMLElement4(iface);
555     FIXME("(%p)\n", This);
556     return E_NOTIMPL;
557 }
558
559 static HRESULT WINAPI HTMLElement4_getAttributeNode(IHTMLElement4 *iface, BSTR bstrname, IHTMLDOMAttribute **ppAttribute)
560 {
561     HTMLElement *This = impl_from_IHTMLElement4(iface);
562     HTMLAttributeCollection *attrs;
563     HRESULT hres;
564
565     TRACE("(%p)->(%s %p)\n", This, debugstr_w(bstrname), ppAttribute);
566
567     hres = HTMLElement_get_attr_col(&This->node, &attrs);
568     if(FAILED(hres))
569         return hres;
570
571     hres = IHTMLAttributeCollection2_getNamedItem(&attrs->IHTMLAttributeCollection2_iface, bstrname, ppAttribute);
572     IHTMLAttributeCollection_Release(&attrs->IHTMLAttributeCollection_iface);
573     return hres;
574 }
575
576 static HRESULT WINAPI HTMLElement4_setAttributeNode(IHTMLElement4 *iface, IHTMLDOMAttribute *pattr,
577         IHTMLDOMAttribute **ppretAttribute)
578 {
579     HTMLElement *This = impl_from_IHTMLElement4(iface);
580     FIXME("(%p)->(%p %p)\n", This, pattr, ppretAttribute);
581     return E_NOTIMPL;
582 }
583
584 static HRESULT WINAPI HTMLElement4_removeAttributeNode(IHTMLElement4 *iface, IHTMLDOMAttribute *pattr,
585         IHTMLDOMAttribute **ppretAttribute)
586 {
587     HTMLElement *This = impl_from_IHTMLElement4(iface);
588     FIXME("(%p)->(%p %p)\n", This, pattr, ppretAttribute);
589     return E_NOTIMPL;
590 }
591
592 static HRESULT WINAPI HTMLElement4_put_onbeforeactivate(IHTMLElement4 *iface, VARIANT v)
593 {
594     HTMLElement *This = impl_from_IHTMLElement4(iface);
595     FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
596     return E_NOTIMPL;
597 }
598
599 static HRESULT WINAPI HTMLElement4_get_onbeforeactivate(IHTMLElement4 *iface, VARIANT *p)
600 {
601     HTMLElement *This = impl_from_IHTMLElement4(iface);
602     FIXME("(%p)->(%p)\n", This, p);
603     return E_NOTIMPL;
604 }
605
606 static HRESULT WINAPI HTMLElement4_put_onfocusin(IHTMLElement4 *iface, VARIANT v)
607 {
608     HTMLElement *This = impl_from_IHTMLElement4(iface);
609     FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
610     return E_NOTIMPL;
611 }
612
613 static HRESULT WINAPI HTMLElement4_get_onfocusin(IHTMLElement4 *iface, VARIANT *p)
614 {
615     HTMLElement *This = impl_from_IHTMLElement4(iface);
616     FIXME("(%p)->(%p)\n", This, p);
617     return E_NOTIMPL;
618 }
619
620 static HRESULT WINAPI HTMLElement4_put_onfocusout(IHTMLElement4 *iface, VARIANT v)
621 {
622     HTMLElement *This = impl_from_IHTMLElement4(iface);
623     FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
624     return E_NOTIMPL;
625 }
626
627 static HRESULT WINAPI HTMLElement4_get_onfocusout(IHTMLElement4 *iface, VARIANT *p)
628 {
629     HTMLElement *This = impl_from_IHTMLElement4(iface);
630     FIXME("(%p)->(%p)\n", This, p);
631     return E_NOTIMPL;
632 }
633
634 static const IHTMLElement4Vtbl HTMLElement4Vtbl = {
635     HTMLElement4_QueryInterface,
636     HTMLElement4_AddRef,
637     HTMLElement4_Release,
638     HTMLElement4_GetTypeInfoCount,
639     HTMLElement4_GetTypeInfo,
640     HTMLElement4_GetIDsOfNames,
641     HTMLElement4_Invoke,
642     HTMLElement4_put_onmousewheel,
643     HTMLElement4_get_onmousewheel,
644     HTMLElement4_normalize,
645     HTMLElement4_getAttributeNode,
646     HTMLElement4_setAttributeNode,
647     HTMLElement4_removeAttributeNode,
648     HTMLElement4_put_onbeforeactivate,
649     HTMLElement4_get_onbeforeactivate,
650     HTMLElement4_put_onfocusin,
651     HTMLElement4_get_onfocusin,
652     HTMLElement4_put_onfocusout,
653     HTMLElement4_get_onfocusout
654 };
655
656 void HTMLElement3_Init(HTMLElement *This)
657 {
658     This->IHTMLElement3_iface.lpVtbl = &HTMLElement3Vtbl;
659     This->IHTMLElement4_iface.lpVtbl = &HTMLElement4Vtbl;
660 }