mshtml: Added semi-stub IHTMLElement2::onreadystatechange implmementation.
[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 #include "htmlevent.h"
33
34 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
35
36 #define HTMLELEM2_THIS(iface) DEFINE_THIS(HTMLElement, HTMLElement2, iface)
37
38 static HRESULT WINAPI HTMLElement2_QueryInterface(IHTMLElement2 *iface,
39                                                   REFIID riid, void **ppv)
40 {
41     HTMLElement *This = HTMLELEM2_THIS(iface);
42     return IHTMLElement_QueryInterface(HTMLELEM(This), riid, ppv);
43 }
44
45 static ULONG WINAPI HTMLElement2_AddRef(IHTMLElement2 *iface)
46 {
47     HTMLElement *This = HTMLELEM2_THIS(iface);
48     return IHTMLElement_AddRef(HTMLELEM(This));
49 }
50
51 static ULONG WINAPI HTMLElement2_Release(IHTMLElement2 *iface)
52 {
53     HTMLElement *This = HTMLELEM2_THIS(iface);
54     return IHTMLElement_Release(HTMLELEM(This));
55 }
56
57 static HRESULT WINAPI HTMLElement2_GetTypeInfoCount(IHTMLElement2 *iface, UINT *pctinfo)
58 {
59     HTMLElement *This = HTMLELEM2_THIS(iface);
60     return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->node.dispex), pctinfo);
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     return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->node.dispex), iTInfo, lcid, ppTInfo);
68 }
69
70 static HRESULT WINAPI HTMLElement2_GetIDsOfNames(IHTMLElement2 *iface, REFIID riid,
71                                                 LPOLESTR *rgszNames, UINT cNames,
72                                                 LCID lcid, DISPID *rgDispId)
73 {
74     HTMLElement *This = HTMLELEM2_THIS(iface);
75     return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->node.dispex), riid, rgszNames, cNames, lcid, rgDispId);
76 }
77
78 static HRESULT WINAPI HTMLElement2_Invoke(IHTMLElement2 *iface, DISPID dispIdMember,
79                             REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
80                             VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
81 {
82     HTMLElement *This = HTMLELEM2_THIS(iface);
83     return IDispatchEx_Invoke(DISPATCHEX(&This->node.dispex), dispIdMember, riid, lcid,
84             wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
85 }
86
87 static HRESULT WINAPI HTMLElement2_get_scopeName(IHTMLElement2 *iface, BSTR *p)
88 {
89     HTMLElement *This = HTMLELEM2_THIS(iface);
90     FIXME("(%p)->(%p)\n", This, p);
91     return E_NOTIMPL;
92 }
93
94 static HRESULT WINAPI HTMLElement2_setCapture(IHTMLElement2 *iface, VARIANT_BOOL containerCapture)
95 {
96     HTMLElement *This = HTMLELEM2_THIS(iface);
97     FIXME("(%p)->(%x)\n", This, containerCapture);
98     return E_NOTIMPL;
99 }
100
101 static HRESULT WINAPI HTMLElement2_releaseCapture(IHTMLElement2 *iface)
102 {
103     HTMLElement *This = HTMLELEM2_THIS(iface);
104     FIXME("(%p)\n", This);
105     return E_NOTIMPL;
106 }
107
108 static HRESULT WINAPI HTMLElement2_put_onlosecapture(IHTMLElement2 *iface, VARIANT v)
109 {
110     HTMLElement *This = HTMLELEM2_THIS(iface);
111     FIXME("(%p)->()\n", This);
112     return E_NOTIMPL;
113 }
114
115 static HRESULT WINAPI HTMLElement2_get_onlosecapture(IHTMLElement2 *iface, VARIANT *p)
116 {
117     HTMLElement *This = HTMLELEM2_THIS(iface);
118     FIXME("(%p)->(%p)\n", This, p);
119     return E_NOTIMPL;
120 }
121
122 static HRESULT WINAPI HTMLElement2_componentFromPoint(IHTMLElement2 *iface,
123                                                       LONG x, LONG y, BSTR *component)
124 {
125     HTMLElement *This = HTMLELEM2_THIS(iface);
126     FIXME("(%p)->(%d %d %p)\n", This, x, y, component);
127     return E_NOTIMPL;
128 }
129
130 static HRESULT WINAPI HTMLElement2_doScroll(IHTMLElement2 *iface, VARIANT component)
131 {
132     HTMLElement *This = HTMLELEM2_THIS(iface);
133     FIXME("(%p)->()\n", This);
134     return E_NOTIMPL;
135 }
136
137 static HRESULT WINAPI HTMLElement2_put_onscroll(IHTMLElement2 *iface, VARIANT v)
138 {
139     HTMLElement *This = HTMLELEM2_THIS(iface);
140     FIXME("(%p)->()\n", This);
141     return E_NOTIMPL;
142 }
143
144 static HRESULT WINAPI HTMLElement2_get_onscroll(IHTMLElement2 *iface, VARIANT *p)
145 {
146     HTMLElement *This = HTMLELEM2_THIS(iface);
147     FIXME("(%p)->(%p)\n", This, p);
148     return E_NOTIMPL;
149 }
150
151 static HRESULT WINAPI HTMLElement2_put_ondrag(IHTMLElement2 *iface, VARIANT v)
152 {
153     HTMLElement *This = HTMLELEM2_THIS(iface);
154
155     TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
156
157     return set_node_event(&This->node, EVENTID_DRAG, &v);
158 }
159
160 static HRESULT WINAPI HTMLElement2_get_ondrag(IHTMLElement2 *iface, VARIANT *p)
161 {
162     HTMLElement *This = HTMLELEM2_THIS(iface);
163
164     TRACE("(%p)->(%p)\n", This, p);
165
166     return get_node_event(&This->node, EVENTID_DRAG, p);
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
313     TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
314
315     return set_node_event(&This->node, EVENTID_PASTE, &v);
316 }
317
318 static HRESULT WINAPI HTMLElement2_get_onpaste(IHTMLElement2 *iface, VARIANT *p)
319 {
320     HTMLElement *This = HTMLELEM2_THIS(iface);
321
322     TRACE("(%p)->(%p)\n", This, p);
323
324     return get_node_event(&This->node, EVENTID_PASTE, p);
325 }
326
327 static HRESULT WINAPI HTMLElement2_get_currentStyle(IHTMLElement2 *iface, IHTMLCurrentStyle **p)
328 {
329     HTMLElement *This = HTMLELEM2_THIS(iface);
330
331     TRACE("(%p)->(%p)\n", This, p);
332
333     return HTMLCurrentStyle_Create(This, p);
334 }
335
336 static HRESULT WINAPI HTMLElement2_put_onpropertychange(IHTMLElement2 *iface, VARIANT v)
337 {
338     HTMLElement *This = HTMLELEM2_THIS(iface);
339     FIXME("(%p)->()\n", This);
340     return E_NOTIMPL;
341 }
342
343 static HRESULT WINAPI HTMLElement2_get_onpropertychange(IHTMLElement2 *iface, VARIANT *p)
344 {
345     HTMLElement *This = HTMLELEM2_THIS(iface);
346     FIXME("(%p)->(%p)\n", This, p);
347     return E_NOTIMPL;
348 }
349
350 static HRESULT WINAPI HTMLElement2_getClientRects(IHTMLElement2 *iface, IHTMLRectCollection **pRectCol)
351 {
352     HTMLElement *This = HTMLELEM2_THIS(iface);
353     FIXME("(%p)->(%p)\n", This, pRectCol);
354     return E_NOTIMPL;
355 }
356
357 static HRESULT WINAPI HTMLElement2_getBoundingClientRect(IHTMLElement2 *iface, IHTMLRect **pRect)
358 {
359     HTMLElement *This = HTMLELEM2_THIS(iface);
360     FIXME("(%p)->(%p)\n", This, pRect);
361     return E_NOTIMPL;
362 }
363
364 static HRESULT WINAPI HTMLElement2_setExpression(IHTMLElement2 *iface, BSTR propname,
365                                                  BSTR expression, BSTR language)
366 {
367     HTMLElement *This = HTMLELEM2_THIS(iface);
368     FIXME("(%p)->(%s %s %s)\n", This, debugstr_w(propname), debugstr_w(expression),
369           debugstr_w(language));
370     return E_NOTIMPL;
371 }
372
373 static HRESULT WINAPI HTMLElement2_getExpression(IHTMLElement2 *iface, BSTR propname,
374                                                  VARIANT *expression)
375 {
376     HTMLElement *This = HTMLELEM2_THIS(iface);
377     FIXME("(%p)->(%s %p)\n", This, debugstr_w(propname), expression);
378     return E_NOTIMPL;
379 }
380
381 static HRESULT WINAPI HTMLElement2_removeExpression(IHTMLElement2 *iface, BSTR propname,
382                                                     VARIANT_BOOL *pfSuccess)
383 {
384     HTMLElement *This = HTMLELEM2_THIS(iface);
385     FIXME("(%p)->(%s %p)\n", This, debugstr_w(propname), pfSuccess);
386     return E_NOTIMPL;
387 }
388
389 static HRESULT WINAPI HTMLElement2_put_tabIndex(IHTMLElement2 *iface, short v)
390 {
391     HTMLElement *This = HTMLELEM2_THIS(iface);
392     nsIDOMNSHTMLElement *nselem;
393     nsresult nsres;
394
395     TRACE("(%p)->(%d)\n", This, v);
396
397     nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
398     if(NS_FAILED(nsres)) {
399         ERR("Could not get nsIDOMHTMLNSElement: %08x\n", nsres);
400         return S_OK;
401     }
402
403     nsres = nsIDOMNSHTMLElement_SetTabIndex(nselem, v);
404     nsIDOMNSHTMLElement_Release(nselem);
405     if(NS_FAILED(nsres))
406         ERR("GetTabIndex failed: %08x\n", nsres);
407
408     return S_OK;
409 }
410
411 static HRESULT WINAPI HTMLElement2_get_tabIndex(IHTMLElement2 *iface, short *p)
412 {
413     HTMLElement *This = HTMLELEM2_THIS(iface);
414     nsIDOMNSHTMLElement *nselem;
415     PRInt32 index = 0;
416     nsresult nsres;
417
418     TRACE("(%p)->(%p)\n", This, p);
419
420     nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
421     if(NS_FAILED(nsres)) {
422         ERR("Could not get nsIDOMHTMLNSElement: %08x\n", nsres);
423         return E_FAIL;
424     }
425
426     nsres = nsIDOMNSHTMLElement_GetTabIndex(nselem, &index);
427     nsIDOMNSHTMLElement_Release(nselem);
428     if(NS_FAILED(nsres)) {
429         ERR("GetTabIndex failed: %08x\n", nsres);
430         return E_FAIL;
431     }
432
433     *p = index;
434     return S_OK;
435 }
436
437 static HRESULT WINAPI HTMLElement2_focus(IHTMLElement2 *iface)
438 {
439     HTMLElement *This = HTMLELEM2_THIS(iface);
440     nsIDOMNSHTMLElement *nselem;
441     nsresult nsres;
442
443     TRACE("(%p)\n", This);
444
445     nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
446     if(NS_SUCCEEDED(nsres)) {
447         nsIDOMNSHTMLElement_focus(nselem);
448         nsIDOMNSHTMLElement_Release(nselem);
449     }else {
450         ERR("Could not get nsIDOMHTMLNSElement: %08x\n", nsres);
451     }
452
453     return S_OK;
454 }
455
456 static HRESULT WINAPI HTMLElement2_put_accessKey(IHTMLElement2 *iface, BSTR v)
457 {
458     HTMLElement *This = HTMLELEM2_THIS(iface);
459     VARIANT var;
460
461     static WCHAR accessKeyW[] = {'a','c','c','e','s','s','K','e','y',0};
462
463     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
464
465     V_VT(&var) = VT_BSTR;
466     V_BSTR(&var) = v;
467     return IHTMLElement_setAttribute(HTMLELEM(This), accessKeyW, var, 0);
468 }
469
470 static HRESULT WINAPI HTMLElement2_get_accessKey(IHTMLElement2 *iface, BSTR *p)
471 {
472     HTMLElement *This = HTMLELEM2_THIS(iface);
473     FIXME("(%p)->(%p)\n", This, p);
474     return E_NOTIMPL;
475 }
476
477 static HRESULT WINAPI HTMLElement2_put_onblur(IHTMLElement2 *iface, VARIANT v)
478 {
479     HTMLElement *This = HTMLELEM2_THIS(iface);
480
481     TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
482
483     return set_node_event(&This->node, EVENTID_BLUR, &v);
484 }
485
486 static HRESULT WINAPI HTMLElement2_get_onblur(IHTMLElement2 *iface, VARIANT *p)
487 {
488     HTMLElement *This = HTMLELEM2_THIS(iface);
489
490     TRACE("(%p)->(%p)\n", This, p);
491
492     return get_node_event(&This->node, EVENTID_BLUR, p);
493 }
494
495 static HRESULT WINAPI HTMLElement2_put_onfocus(IHTMLElement2 *iface, VARIANT v)
496 {
497     HTMLElement *This = HTMLELEM2_THIS(iface);
498
499     TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
500
501     return set_node_event(&This->node, EVENTID_FOCUS, &v);
502 }
503
504 static HRESULT WINAPI HTMLElement2_get_onfocus(IHTMLElement2 *iface, VARIANT *p)
505 {
506     HTMLElement *This = HTMLELEM2_THIS(iface);
507
508     TRACE("(%p)->(%p)\n", This, p);
509
510     return get_node_event(&This->node, EVENTID_FOCUS, p);
511 }
512
513 static HRESULT WINAPI HTMLElement2_put_onresize(IHTMLElement2 *iface, VARIANT v)
514 {
515     HTMLElement *This = HTMLELEM2_THIS(iface);
516     FIXME("(%p)->()\n", This);
517     return E_NOTIMPL;
518 }
519
520 static HRESULT WINAPI HTMLElement2_get_onresize(IHTMLElement2 *iface, VARIANT *p)
521 {
522     HTMLElement *This = HTMLELEM2_THIS(iface);
523     FIXME("(%p)->(%p)\n", This, p);
524     return E_NOTIMPL;
525 }
526
527 static HRESULT WINAPI HTMLElement2_blur(IHTMLElement2 *iface)
528 {
529     HTMLElement *This = HTMLELEM2_THIS(iface);
530     FIXME("(%p)\n", This);
531     return E_NOTIMPL;
532 }
533
534 static HRESULT WINAPI HTMLElement2_addFilter(IHTMLElement2 *iface, IUnknown *pUnk)
535 {
536     HTMLElement *This = HTMLELEM2_THIS(iface);
537     FIXME("(%p)->(%p)\n", This, pUnk);
538     return E_NOTIMPL;
539 }
540
541 static HRESULT WINAPI HTMLElement2_removeFilter(IHTMLElement2 *iface, IUnknown *pUnk)
542 {
543     HTMLElement *This = HTMLELEM2_THIS(iface);
544     FIXME("(%p)->(%p)\n", This, pUnk);
545     return E_NOTIMPL;
546 }
547
548 static HRESULT WINAPI HTMLElement2_get_clientHeight(IHTMLElement2 *iface, LONG *p)
549 {
550     HTMLElement *This = HTMLELEM2_THIS(iface);
551     nsIDOMNSElement *nselem;
552     PRInt32 height=0;
553     nsresult nsres;
554
555     TRACE("(%p)->(%p)\n", This, p);
556
557     nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSElement, (void**)&nselem);
558     if(NS_SUCCEEDED(nsres)) {
559         nsIDOMNSElement_GetClientHeight(nselem, &height);
560         nsIDOMNSElement_Release(nselem);
561     }else {
562         ERR("Could not get nsIDOMNSElement: %08x\n", nsres);
563     }
564
565     *p = height;
566     return S_OK;
567 }
568
569 static HRESULT WINAPI HTMLElement2_get_clientWidth(IHTMLElement2 *iface, LONG *p)
570 {
571     HTMLElement *This = HTMLELEM2_THIS(iface);
572     nsIDOMNSElement *nselem;
573     PRInt32 width=0;
574     nsresult nsres;
575
576     TRACE("(%p)->(%p)\n", This, p);
577
578     nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSElement, (void**)&nselem);
579     if(NS_SUCCEEDED(nsres)) {
580         nsIDOMNSElement_GetClientWidth(nselem, &width);
581         nsIDOMNSElement_Release(nselem);
582     }else {
583         ERR("Could not get nsIDOMNSElement: %08x\n", nsres);
584     }
585
586     *p = width;
587     return S_OK;
588 }
589
590 static HRESULT WINAPI HTMLElement2_get_clientTop(IHTMLElement2 *iface, LONG *p)
591 {
592     HTMLElement *This = HTMLELEM2_THIS(iface);
593     FIXME("(%p)->(%p)\n", This, p);
594     return E_NOTIMPL;
595 }
596
597 static HRESULT WINAPI HTMLElement2_get_clientLeft(IHTMLElement2 *iface, LONG *p)
598 {
599     HTMLElement *This = HTMLELEM2_THIS(iface);
600     FIXME("(%p)->(%p)\n", This, p);
601     return E_NOTIMPL;
602 }
603
604 static HRESULT WINAPI HTMLElement2_attachEvent(IHTMLElement2 *iface, BSTR event,
605                                                IDispatch *pDisp, VARIANT_BOOL *pfResult)
606 {
607     HTMLElement *This = HTMLELEM2_THIS(iface);
608
609     TRACE("(%p)->(%s %p %p)\n", This, debugstr_w(event), pDisp, pfResult);
610
611     return attach_event(get_node_event_target(&This->node), This->node.doc, event, pDisp, pfResult);
612 }
613
614 static HRESULT WINAPI HTMLElement2_detachEvent(IHTMLElement2 *iface, BSTR event, IDispatch *pDisp)
615 {
616     HTMLElement *This = HTMLELEM2_THIS(iface);
617     FIXME("(%p)->(%s %p)\n", This, debugstr_w(event), pDisp);
618     return E_NOTIMPL;
619 }
620
621 static HRESULT WINAPI HTMLElement2_get_readyState(IHTMLElement2 *iface, VARIANT *p)
622 {
623     HTMLElement *This = HTMLELEM2_THIS(iface);
624     FIXME("(%p)->(%p)\n", This, p);
625     return E_NOTIMPL;
626 }
627
628 static HRESULT WINAPI HTMLElement2_put_onreadystatechange(IHTMLElement2 *iface, VARIANT v)
629 {
630     HTMLElement *This = HTMLELEM2_THIS(iface);
631
632     FIXME("(%p)->(%s): semi-stub\n", This, debugstr_variant(&v));
633
634     return set_node_event(&This->node, EVENTID_READYSTATECHANGE, &v);
635 }
636
637 static HRESULT WINAPI HTMLElement2_get_onreadystatechange(IHTMLElement2 *iface, VARIANT *p)
638 {
639     HTMLElement *This = HTMLELEM2_THIS(iface);
640
641     TRACE("(%p)->(%p)\n", This, p);
642
643     return get_node_event(&This->node, EVENTID_READYSTATECHANGE, p);
644 }
645
646 static HRESULT WINAPI HTMLElement2_put_onrowsdelete(IHTMLElement2 *iface, VARIANT v)
647 {
648     HTMLElement *This = HTMLELEM2_THIS(iface);
649     FIXME("(%p)->()\n", This);
650     return E_NOTIMPL;
651 }
652
653 static HRESULT WINAPI HTMLElement2_get_onrowsdelete(IHTMLElement2 *iface, VARIANT *p)
654 {
655     HTMLElement *This = HTMLELEM2_THIS(iface);
656     FIXME("(%p)->(%p)\n", This, p);
657     return E_NOTIMPL;
658 }
659
660 static HRESULT WINAPI HTMLElement2_put_onrowsinserted(IHTMLElement2 *iface, VARIANT v)
661 {
662     HTMLElement *This = HTMLELEM2_THIS(iface);
663     FIXME("(%p)->()\n", This);
664     return E_NOTIMPL;
665 }
666
667 static HRESULT WINAPI HTMLElement2_get_onrowsinserted(IHTMLElement2 *iface, VARIANT *p)
668 {
669     HTMLElement *This = HTMLELEM2_THIS(iface);
670     FIXME("(%p)->(%p)\n", This, p);
671     return E_NOTIMPL;
672 }
673
674 static HRESULT WINAPI HTMLElement2_put_oncellchange(IHTMLElement2 *iface, VARIANT v)
675 {
676     HTMLElement *This = HTMLELEM2_THIS(iface);
677     FIXME("(%p)->()\n", This);
678     return E_NOTIMPL;
679 }
680
681 static HRESULT WINAPI HTMLElement2_get_oncellchange(IHTMLElement2 *iface, VARIANT *p)
682 {
683     HTMLElement *This = HTMLELEM2_THIS(iface);
684     FIXME("(%p)->(%p)\n", This, p);
685     return E_NOTIMPL;
686 }
687
688 static HRESULT WINAPI HTMLElement2_put_dir(IHTMLElement2 *iface, BSTR v)
689 {
690     HTMLElement *This = HTMLELEM2_THIS(iface);
691     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
692     return E_NOTIMPL;
693 }
694
695 static HRESULT WINAPI HTMLElement2_get_dir(IHTMLElement2 *iface, BSTR *p)
696 {
697     HTMLElement *This = HTMLELEM2_THIS(iface);
698
699     TRACE("(%p)->(%p)\n", This, p);
700
701     *p = NULL;
702
703     if(This->nselem) {
704         nsAString dir_str;
705         nsresult nsres;
706
707         nsAString_Init(&dir_str, NULL);
708
709         nsres = nsIDOMHTMLElement_GetDir(This->nselem, &dir_str);
710         if(NS_SUCCEEDED(nsres)) {
711             const PRUnichar *dir;
712             nsAString_GetData(&dir_str, &dir);
713             if(*dir)
714                 *p = SysAllocString(dir);
715         }else {
716             ERR("GetDir failed: %08x\n", nsres);
717         }
718
719         nsAString_Finish(&dir_str);
720     }
721
722     TRACE("ret %s\n", debugstr_w(*p));
723     return S_OK;
724 }
725
726 static HRESULT WINAPI HTMLElement2_createControlRange(IHTMLElement2 *iface, IDispatch **range)
727 {
728     HTMLElement *This = HTMLELEM2_THIS(iface);
729     FIXME("(%p)->(%p)\n", This, range);
730     return E_NOTIMPL;
731 }
732
733 static HRESULT WINAPI HTMLElement2_get_scrollHeight(IHTMLElement2 *iface, LONG *p)
734 {
735     HTMLElement *This = HTMLELEM2_THIS(iface);
736     nsIDOMNSElement *nselem;
737     PRInt32 height = 0;
738     nsresult nsres;
739
740     TRACE("(%p)->(%p)\n", This, p);
741
742     nsres = nsIDOMElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
743     if(NS_SUCCEEDED(nsres)) {
744         nsres = nsIDOMNSElement_GetScrollHeight(nselem, &height);
745         nsIDOMNSElement_Release(nselem);
746         if(NS_FAILED(nsres))
747             ERR("GetScrollHeight failed: %08x\n", nsres);
748     }else {
749         ERR("Could not get nsIDOMNSElement interface: %08x\n", nsres);
750     }
751
752     *p = height == -1 ? 0 : height;
753     TRACE("*p = %d\n", *p);
754
755     return S_OK;
756 }
757
758 static HRESULT WINAPI HTMLElement2_get_scrollWidth(IHTMLElement2 *iface, LONG *p)
759 {
760     HTMLElement *This = HTMLELEM2_THIS(iface);
761     nsIDOMNSElement *nselem;
762     PRInt32 width = 0;
763     nsresult nsres;
764
765     TRACE("(%p)->(%p)\n", This, p);
766
767     nsres = nsIDOMElement_QueryInterface(This->nselem, &IID_nsIDOMNSElement, (void**)&nselem);
768     if(NS_SUCCEEDED(nsres)) {
769         nsres = nsIDOMNSElement_GetScrollWidth(nselem, &width);
770         nsIDOMNSElement_Release(nselem);
771         if(NS_FAILED(nsres))
772             ERR("GetScrollWidth failed: %08x\n", nsres);
773     }else {
774         ERR("Could not get nsIDOMNSElement interface: %08x\n", nsres);
775     }
776
777     *p = width;
778     TRACE("*p = %d\n", *p);
779
780     return S_OK;
781 }
782
783 static HRESULT WINAPI HTMLElement2_put_scrollTop(IHTMLElement2 *iface, LONG v)
784 {
785     HTMLElement *This = HTMLELEM2_THIS(iface);
786     nsIDOMNSElement *nselem;
787     nsresult nsres;
788
789     TRACE("(%p)->(%d)\n", This, v);
790
791     if(!This->nselem) {
792         FIXME("NULL nselem\n");
793         return E_NOTIMPL;
794     }
795
796     nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSElement, (void**)&nselem);
797     if(NS_SUCCEEDED(nsres)) {
798         nsIDOMNSElement_SetScrollTop(nselem, v);
799         nsIDOMNSElement_Release(nselem);
800     }else {
801         ERR("Could not get nsIDOMNSElement interface: %08x\n", nsres);
802     }
803
804     return S_OK;
805 }
806
807 static HRESULT WINAPI HTMLElement2_get_scrollTop(IHTMLElement2 *iface, LONG *p)
808 {
809     HTMLElement *This = HTMLELEM2_THIS(iface);
810     nsIDOMNSElement *nselem;
811     PRInt32 top = 0;
812     nsresult nsres;
813
814     TRACE("(%p)->(%p)\n", This, p);
815
816     nsres = nsIDOMElement_QueryInterface(This->nselem, &IID_nsIDOMNSElement, (void**)&nselem);
817     if(NS_SUCCEEDED(nsres)) {
818         nsres = nsIDOMNSElement_GetScrollTop(nselem, &top);
819         nsIDOMNSElement_Release(nselem);
820         if(NS_FAILED(nsres))
821             ERR("GetScrollTop failed: %08x\n", nsres);
822     }else {
823         ERR("Could not get nsIDOMNSElement interface: %08x\n", nsres);
824     }
825
826     *p = top;
827     TRACE("*p = %d\n", *p);
828
829     return S_OK;
830 }
831
832 static HRESULT WINAPI HTMLElement2_put_scrollLeft(IHTMLElement2 *iface, LONG v)
833 {
834     HTMLElement *This = HTMLELEM2_THIS(iface);
835     nsIDOMNSElement *nselem;
836     nsresult nsres;
837
838     TRACE("(%p)->(%d)\n", This, v);
839
840     if(!This->nselem) {
841         FIXME("NULL nselem\n");
842         return E_NOTIMPL;
843     }
844
845     nsres = nsIDOMElement_QueryInterface(This->nselem, &IID_nsIDOMNSElement, (void**)&nselem);
846     if(NS_SUCCEEDED(nsres)) {
847         nsIDOMNSElement_SetScrollLeft(nselem, v);
848         nsIDOMNSElement_Release(nselem);
849     }else {
850         ERR("Could not get nsIDOMNSElement interface: %08x\n", nsres);
851     }
852
853     return S_OK;
854 }
855
856 static HRESULT WINAPI HTMLElement2_get_scrollLeft(IHTMLElement2 *iface, LONG *p)
857 {
858     HTMLElement *This = HTMLELEM2_THIS(iface);
859     nsIDOMNSElement *nselem;
860     PRInt32 left = 0;
861     nsresult nsres;
862
863     TRACE("(%p)->(%p)\n", This, p);
864
865     if(!p)
866         return E_INVALIDARG;
867
868     if(!This->nselem)
869     {
870         FIXME("NULL nselem\n");
871         return E_NOTIMPL;
872     }
873
874     nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSElement, (void**)&nselem);
875     if(NS_SUCCEEDED(nsres))
876     {
877         nsres = nsIDOMNSElement_GetScrollLeft(nselem, &left);
878         nsIDOMNSElement_Release(nselem);
879         if(NS_FAILED(nsres))
880             left = 0;
881     }
882
883     *p = left;
884     TRACE("*p = %d\n", *p);
885
886     return S_OK;
887 }
888
889 static HRESULT WINAPI HTMLElement2_clearAttributes(IHTMLElement2 *iface)
890 {
891     HTMLElement *This = HTMLELEM2_THIS(iface);
892     FIXME("(%p)\n", This);
893     return E_NOTIMPL;
894 }
895
896 static HRESULT WINAPI HTMLElement2_mergeAttributes(IHTMLElement2 *iface, IHTMLElement *mergeThis)
897 {
898     HTMLElement *This = HTMLELEM2_THIS(iface);
899     FIXME("(%p)->(%p)\n", This, mergeThis);
900     return E_NOTIMPL;
901 }
902
903 static HRESULT WINAPI HTMLElement2_put_oncontextmenu(IHTMLElement2 *iface, VARIANT v)
904 {
905     HTMLElement *This = HTMLELEM2_THIS(iface);
906     FIXME("(%p)->()\n", This);
907     return E_NOTIMPL;
908 }
909
910 static HRESULT WINAPI HTMLElement2_get_oncontextmenu(IHTMLElement2 *iface, VARIANT *p)
911 {
912     HTMLElement *This = HTMLELEM2_THIS(iface);
913     FIXME("(%p)->(%p)\n", This, p);
914     return E_NOTIMPL;
915 }
916
917 static HRESULT WINAPI HTMLElement2_insertAdjecentElement(IHTMLElement2 *iface, BSTR where,
918         IHTMLElement *insertedElement, IHTMLElement **inserted)
919 {
920     HTMLElement *This = HTMLELEM2_THIS(iface);
921     FIXME("(%p)->(%s %p %p)\n", This, debugstr_w(where), insertedElement, inserted);
922     return E_NOTIMPL;
923 }
924
925 static HRESULT WINAPI HTMLElement2_applyElement(IHTMLElement2 *iface, IHTMLElement *apply,
926                                                 BSTR where, IHTMLElement **applied)
927 {
928     HTMLElement *This = HTMLELEM2_THIS(iface);
929     FIXME("(%p)->(%p %s %p)\n", This, apply, debugstr_w(where), applied);
930     return E_NOTIMPL;
931 }
932
933 static HRESULT WINAPI HTMLElement2_getAdjecentText(IHTMLElement2 *iface, BSTR where, BSTR *text)
934 {
935     HTMLElement *This = HTMLELEM2_THIS(iface);
936     FIXME("(%p)->(%s %p)\n", This, debugstr_w(where), text);
937     return E_NOTIMPL;
938 }
939
940 static HRESULT WINAPI HTMLElement2_replaceAdjecentText(IHTMLElement2 *iface, BSTR where,
941                                                        BSTR newText, BSTR *oldText)
942 {
943     HTMLElement *This = HTMLELEM2_THIS(iface);
944     FIXME("(%p)->(%s %s %p)\n", This, debugstr_w(where), debugstr_w(newText), oldText);
945     return E_NOTIMPL;
946 }
947
948 static HRESULT WINAPI HTMLElement2_get_canHandleChildren(IHTMLElement2 *iface, VARIANT_BOOL *p)
949 {
950     HTMLElement *This = HTMLELEM2_THIS(iface);
951     FIXME("(%p)->(%p)\n", This, p);
952     return E_NOTIMPL;
953 }
954
955 static HRESULT WINAPI HTMLElement2_addBehavior(IHTMLElement2 *iface, BSTR bstrUrl,
956                                                VARIANT *pvarFactory, LONG *pCookie)
957 {
958     HTMLElement *This = HTMLELEM2_THIS(iface);
959     FIXME("(%p)->(%s %p %p)\n", This, debugstr_w(bstrUrl), pvarFactory, pCookie);
960     return E_NOTIMPL;
961 }
962
963 static HRESULT WINAPI HTMLElement2_removeBehavior(IHTMLElement2 *iface, LONG cookie,
964                                                   VARIANT_BOOL *pfResult)
965 {
966     HTMLElement *This = HTMLELEM2_THIS(iface);
967     FIXME("(%p)->(%d %p)\n", This, cookie, pfResult);
968     return E_NOTIMPL;
969 }
970
971 static HRESULT WINAPI HTMLElement2_get_runtimeStyle(IHTMLElement2 *iface, IHTMLStyle **p)
972 {
973     HTMLElement *This = HTMLELEM2_THIS(iface);
974     FIXME("(%p)->(%p)\n", This, p);
975     return E_NOTIMPL;
976 }
977
978 static HRESULT WINAPI HTMLElement2_get_behaviorUrns(IHTMLElement2 *iface, IDispatch **p)
979 {
980     HTMLElement *This = HTMLELEM2_THIS(iface);
981     FIXME("(%p)->(%p)\n", This, p);
982     return E_NOTIMPL;
983 }
984
985 static HRESULT WINAPI HTMLElement2_put_tagUrn(IHTMLElement2 *iface, BSTR v)
986 {
987     HTMLElement *This = HTMLELEM2_THIS(iface);
988     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
989     return E_NOTIMPL;
990 }
991
992 static HRESULT WINAPI HTMLElement2_get_tagUrn(IHTMLElement2 *iface, BSTR *p)
993 {
994     HTMLElement *This = HTMLELEM2_THIS(iface);
995     FIXME("(%p)->(%p)\n", This, p);
996     return E_NOTIMPL;
997 }
998
999 static HRESULT WINAPI HTMLElement2_put_onbeforeeditfocus(IHTMLElement2 *iface, VARIANT vv)
1000 {
1001     HTMLElement *This = HTMLELEM2_THIS(iface);
1002     FIXME("(%p)->()\n", This);
1003     return E_NOTIMPL;
1004 }
1005
1006 static HRESULT WINAPI HTMLElement2_get_onbeforeeditfocus(IHTMLElement2 *iface, VARIANT *p)
1007 {
1008     HTMLElement *This = HTMLELEM2_THIS(iface);
1009     FIXME("(%p)->(%p)\n", This, p);
1010     return E_NOTIMPL;
1011 }
1012
1013 static HRESULT WINAPI HTMLElement2_get_readyStateValue(IHTMLElement2 *iface, LONG *p)
1014 {
1015     HTMLElement *This = HTMLELEM2_THIS(iface);
1016     FIXME("(%p)->(%p)\n", This, p);
1017     return E_NOTIMPL;
1018 }
1019
1020 static HRESULT WINAPI HTMLElement2_getElementsByTagName(IHTMLElement2 *iface, BSTR v,
1021                                                        IHTMLElementCollection **pelColl)
1022 {
1023     HTMLElement *This = HTMLELEM2_THIS(iface);
1024     nsIDOMNodeList *nslist;
1025     nsAString tag_str;
1026     nsresult nsres;
1027
1028     TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), pelColl);
1029
1030     nsAString_Init(&tag_str, v);
1031     nsres = nsIDOMHTMLElement_GetElementsByTagName(This->nselem, &tag_str, &nslist);
1032     nsAString_Finish(&tag_str);
1033     if(NS_FAILED(nsres)) {
1034         ERR("GetElementByTagName failed: %08x\n", nsres);
1035         return E_FAIL;
1036     }
1037
1038     *pelColl = create_collection_from_nodelist(This->node.doc, (IUnknown*)HTMLELEM(This), nslist);
1039     nsIDOMNodeList_Release(nslist);
1040     return S_OK;
1041 }
1042
1043 #undef HTMLELEM2_THIS
1044
1045 static const IHTMLElement2Vtbl HTMLElement2Vtbl = {
1046     HTMLElement2_QueryInterface,
1047     HTMLElement2_AddRef,
1048     HTMLElement2_Release,
1049     HTMLElement2_GetTypeInfoCount,
1050     HTMLElement2_GetTypeInfo,
1051     HTMLElement2_GetIDsOfNames,
1052     HTMLElement2_Invoke,
1053     HTMLElement2_get_scopeName,
1054     HTMLElement2_setCapture,
1055     HTMLElement2_releaseCapture,
1056     HTMLElement2_put_onlosecapture,
1057     HTMLElement2_get_onlosecapture,
1058     HTMLElement2_componentFromPoint,
1059     HTMLElement2_doScroll,
1060     HTMLElement2_put_onscroll,
1061     HTMLElement2_get_onscroll,
1062     HTMLElement2_put_ondrag,
1063     HTMLElement2_get_ondrag,
1064     HTMLElement2_put_ondragend,
1065     HTMLElement2_get_ondragend,
1066     HTMLElement2_put_ondragenter,
1067     HTMLElement2_get_ondragenter,
1068     HTMLElement2_put_ondragover,
1069     HTMLElement2_get_ondragover,
1070     HTMLElement2_put_ondragleave,
1071     HTMLElement2_get_ondragleave,
1072     HTMLElement2_put_ondrop,
1073     HTMLElement2_get_ondrop,
1074     HTMLElement2_put_onbeforecut,
1075     HTMLElement2_get_onbeforecut,
1076     HTMLElement2_put_oncut,
1077     HTMLElement2_get_oncut,
1078     HTMLElement2_put_onbeforecopy,
1079     HTMLElement2_get_onbeforecopy,
1080     HTMLElement2_put_oncopy,
1081     HTMLElement2_get_oncopy,
1082     HTMLElement2_put_onbeforepaste,
1083     HTMLElement2_get_onbeforepaste,
1084     HTMLElement2_put_onpaste,
1085     HTMLElement2_get_onpaste,
1086     HTMLElement2_get_currentStyle,
1087     HTMLElement2_put_onpropertychange,
1088     HTMLElement2_get_onpropertychange,
1089     HTMLElement2_getClientRects,
1090     HTMLElement2_getBoundingClientRect,
1091     HTMLElement2_setExpression,
1092     HTMLElement2_getExpression,
1093     HTMLElement2_removeExpression,
1094     HTMLElement2_put_tabIndex,
1095     HTMLElement2_get_tabIndex,
1096     HTMLElement2_focus,
1097     HTMLElement2_put_accessKey,
1098     HTMLElement2_get_accessKey,
1099     HTMLElement2_put_onblur,
1100     HTMLElement2_get_onblur,
1101     HTMLElement2_put_onfocus,
1102     HTMLElement2_get_onfocus,
1103     HTMLElement2_put_onresize,
1104     HTMLElement2_get_onresize,
1105     HTMLElement2_blur,
1106     HTMLElement2_addFilter,
1107     HTMLElement2_removeFilter,
1108     HTMLElement2_get_clientHeight,
1109     HTMLElement2_get_clientWidth,
1110     HTMLElement2_get_clientTop,
1111     HTMLElement2_get_clientLeft,
1112     HTMLElement2_attachEvent,
1113     HTMLElement2_detachEvent,
1114     HTMLElement2_get_readyState,
1115     HTMLElement2_put_onreadystatechange,
1116     HTMLElement2_get_onreadystatechange,
1117     HTMLElement2_put_onrowsdelete,
1118     HTMLElement2_get_onrowsdelete,
1119     HTMLElement2_put_onrowsinserted,
1120     HTMLElement2_get_onrowsinserted,
1121     HTMLElement2_put_oncellchange,
1122     HTMLElement2_get_oncellchange,
1123     HTMLElement2_put_dir,
1124     HTMLElement2_get_dir,
1125     HTMLElement2_createControlRange,
1126     HTMLElement2_get_scrollHeight,
1127     HTMLElement2_get_scrollWidth,
1128     HTMLElement2_put_scrollTop,
1129     HTMLElement2_get_scrollTop,
1130     HTMLElement2_put_scrollLeft,
1131     HTMLElement2_get_scrollLeft,
1132     HTMLElement2_clearAttributes,
1133     HTMLElement2_mergeAttributes,
1134     HTMLElement2_put_oncontextmenu,
1135     HTMLElement2_get_oncontextmenu,
1136     HTMLElement2_insertAdjecentElement,
1137     HTMLElement2_applyElement,
1138     HTMLElement2_getAdjecentText,
1139     HTMLElement2_replaceAdjecentText,
1140     HTMLElement2_get_canHandleChildren,
1141     HTMLElement2_addBehavior,
1142     HTMLElement2_removeBehavior,
1143     HTMLElement2_get_runtimeStyle,
1144     HTMLElement2_get_behaviorUrns,
1145     HTMLElement2_put_tagUrn,
1146     HTMLElement2_get_tagUrn,
1147     HTMLElement2_put_onbeforeeditfocus,
1148     HTMLElement2_get_onbeforeeditfocus,
1149     HTMLElement2_get_readyStateValue,
1150     HTMLElement2_getElementsByTagName,
1151 };
1152
1153 void HTMLElement2_Init(HTMLElement *This)
1154 {
1155     This->lpHTMLElement2Vtbl = &HTMLElement2Vtbl;
1156 }