2 * Copyright 2006-2010 Jacek Caban for CodeWeavers
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.
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.
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
29 #include "wine/debug.h"
30 #include "wine/unicode.h"
32 #include "mshtml_private.h"
33 #include "htmlevent.h"
35 WINE_DEFAULT_DEBUG_CHANNEL(mshtml
);
39 const IHTMLRectVtbl
*lpIHTMLRectVtbl
;
43 nsIDOMClientRect
*nsrect
;
46 #define HTMLRECT(x) ((IHTMLRect*) &(x)->lpIHTMLRectVtbl)
48 #define HTMLRECT_THIS(iface) DEFINE_THIS(HTMLRect, IHTMLRect, iface)
50 static HRESULT WINAPI
HTMLRect_QueryInterface(IHTMLRect
*iface
, REFIID riid
, void **ppv
)
52 HTMLRect
*This
= HTMLRECT_THIS(iface
);
54 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
55 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppv
);
56 *ppv
= HTMLRECT(This
);
57 }else if(IsEqualGUID(&IID_IHTMLRect
, riid
)) {
58 TRACE("(%p)->(IID_IHTMLRect %p)\n", This
, ppv
);
59 *ppv
= HTMLRECT(This
);
60 }else if(dispex_query_interface(&This
->dispex
, riid
, ppv
)) {
61 return *ppv
? S_OK
: E_NOINTERFACE
;
63 FIXME("(%p)->(%s %p)\n", This
, debugstr_guid(riid
), ppv
);
68 IUnknown_AddRef((IUnknown
*)*ppv
);
72 static ULONG WINAPI
HTMLRect_AddRef(IHTMLRect
*iface
)
74 HTMLRect
*This
= HTMLRECT_THIS(iface
);
75 LONG ref
= InterlockedIncrement(&This
->ref
);
77 TRACE("(%p) ref=%d\n", This
, ref
);
82 static ULONG WINAPI
HTMLRect_Release(IHTMLRect
*iface
)
84 HTMLRect
*This
= HTMLRECT_THIS(iface
);
85 LONG ref
= InterlockedDecrement(&This
->ref
);
87 TRACE("(%p) ref=%d\n", This
, ref
);
91 nsIDOMClientRect_Release(This
->nsrect
);
98 static HRESULT WINAPI
HTMLRect_GetTypeInfoCount(IHTMLRect
*iface
, UINT
*pctinfo
)
100 HTMLRect
*This
= HTMLRECT_THIS(iface
);
101 FIXME("(%p)->(%p)\n", This
, pctinfo
);
105 static HRESULT WINAPI
HTMLRect_GetTypeInfo(IHTMLRect
*iface
, UINT iTInfo
,
106 LCID lcid
, ITypeInfo
**ppTInfo
)
108 HTMLRect
*This
= HTMLRECT_THIS(iface
);
110 return IDispatchEx_GetTypeInfo(DISPATCHEX(&This
->dispex
), iTInfo
, lcid
, ppTInfo
);
113 static HRESULT WINAPI
HTMLRect_GetIDsOfNames(IHTMLRect
*iface
, REFIID riid
,
114 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
116 HTMLRect
*This
= HTMLRECT_THIS(iface
);
118 return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This
->dispex
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
121 static HRESULT WINAPI
HTMLRect_Invoke(IHTMLRect
*iface
, DISPID dispIdMember
,
122 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
123 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
125 HTMLRect
*This
= HTMLRECT_THIS(iface
);
127 return IDispatchEx_Invoke(DISPATCHEX(&This
->dispex
), dispIdMember
, riid
, lcid
, wFlags
, pDispParams
,
128 pVarResult
, pExcepInfo
, puArgErr
);
131 static HRESULT WINAPI
HTMLRect_put_left(IHTMLRect
*iface
, LONG v
)
133 HTMLRect
*This
= HTMLRECT_THIS(iface
);
134 FIXME("(%p)->(%d)\n", This
, v
);
138 static HRESULT WINAPI
HTMLRect_get_left(IHTMLRect
*iface
, LONG
*p
)
140 HTMLRect
*This
= HTMLRECT_THIS(iface
);
144 TRACE("(%p)->(%p)\n", This
, p
);
146 nsres
= nsIDOMClientRect_GetLeft(This
->nsrect
, &left
);
147 if(NS_FAILED(nsres
)) {
148 ERR("GetLeft failed: %08x\n", nsres
);
152 *p
= floor(left
+0.5);
156 static HRESULT WINAPI
HTMLRect_put_top(IHTMLRect
*iface
, LONG v
)
158 HTMLRect
*This
= HTMLRECT_THIS(iface
);
159 FIXME("(%p)->(%d)\n", This
, v
);
163 static HRESULT WINAPI
HTMLRect_get_top(IHTMLRect
*iface
, LONG
*p
)
165 HTMLRect
*This
= HTMLRECT_THIS(iface
);
169 TRACE("(%p)->(%p)\n", This
, p
);
171 nsres
= nsIDOMClientRect_GetTop(This
->nsrect
, &top
);
172 if(NS_FAILED(nsres
)) {
173 ERR("GetTop failed: %08x\n", nsres
);
181 static HRESULT WINAPI
HTMLRect_put_right(IHTMLRect
*iface
, LONG v
)
183 HTMLRect
*This
= HTMLRECT_THIS(iface
);
184 FIXME("(%p)->(%d)\n", This
, v
);
188 static HRESULT WINAPI
HTMLRect_get_right(IHTMLRect
*iface
, LONG
*p
)
190 HTMLRect
*This
= HTMLRECT_THIS(iface
);
194 TRACE("(%p)->(%p)\n", This
, p
);
196 nsres
= nsIDOMClientRect_GetRight(This
->nsrect
, &right
);
197 if(NS_FAILED(nsres
)) {
198 ERR("GetRight failed: %08x\n", nsres
);
202 *p
= floor(right
+0.5);
206 static HRESULT WINAPI
HTMLRect_put_bottom(IHTMLRect
*iface
, LONG v
)
208 HTMLRect
*This
= HTMLRECT_THIS(iface
);
209 FIXME("(%p)->(%d)\n", This
, v
);
213 static HRESULT WINAPI
HTMLRect_get_bottom(IHTMLRect
*iface
, LONG
*p
)
215 HTMLRect
*This
= HTMLRECT_THIS(iface
);
219 TRACE("(%p)->(%p)\n", This
, p
);
221 nsres
= nsIDOMClientRect_GetBottom(This
->nsrect
, &bottom
);
222 if(NS_FAILED(nsres
)) {
223 ERR("GetBottom failed: %08x\n", nsres
);
227 *p
= floor(bottom
+0.5);
233 static const IHTMLRectVtbl HTMLRectVtbl
= {
234 HTMLRect_QueryInterface
,
237 HTMLRect_GetTypeInfoCount
,
238 HTMLRect_GetTypeInfo
,
239 HTMLRect_GetIDsOfNames
,
251 static const tid_t HTMLRect_iface_tids
[] = {
255 static dispex_static_data_t HTMLRect_dispex
= {
262 static HRESULT
create_html_rect(nsIDOMClientRect
*nsrect
, IHTMLRect
**ret
)
266 rect
= heap_alloc_zero(sizeof(HTMLRect
));
268 return E_OUTOFMEMORY
;
270 rect
->lpIHTMLRectVtbl
= &HTMLRectVtbl
;
273 init_dispex(&rect
->dispex
, (IUnknown
*)HTMLRECT(rect
), &HTMLRect_dispex
);
275 nsIDOMClientRect_AddRef(nsrect
);
276 rect
->nsrect
= nsrect
;
278 *ret
= HTMLRECT(rect
);
282 #define HTMLELEM2_THIS(iface) DEFINE_THIS(HTMLElement, HTMLElement2, iface)
284 static HRESULT WINAPI
HTMLElement2_QueryInterface(IHTMLElement2
*iface
,
285 REFIID riid
, void **ppv
)
287 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
288 return IHTMLElement_QueryInterface(HTMLELEM(This
), riid
, ppv
);
291 static ULONG WINAPI
HTMLElement2_AddRef(IHTMLElement2
*iface
)
293 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
294 return IHTMLElement_AddRef(HTMLELEM(This
));
297 static ULONG WINAPI
HTMLElement2_Release(IHTMLElement2
*iface
)
299 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
300 return IHTMLElement_Release(HTMLELEM(This
));
303 static HRESULT WINAPI
HTMLElement2_GetTypeInfoCount(IHTMLElement2
*iface
, UINT
*pctinfo
)
305 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
306 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This
->node
.dispex
), pctinfo
);
309 static HRESULT WINAPI
HTMLElement2_GetTypeInfo(IHTMLElement2
*iface
, UINT iTInfo
,
310 LCID lcid
, ITypeInfo
**ppTInfo
)
312 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
313 return IDispatchEx_GetTypeInfo(DISPATCHEX(&This
->node
.dispex
), iTInfo
, lcid
, ppTInfo
);
316 static HRESULT WINAPI
HTMLElement2_GetIDsOfNames(IHTMLElement2
*iface
, REFIID riid
,
317 LPOLESTR
*rgszNames
, UINT cNames
,
318 LCID lcid
, DISPID
*rgDispId
)
320 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
321 return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This
->node
.dispex
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
324 static HRESULT WINAPI
HTMLElement2_Invoke(IHTMLElement2
*iface
, DISPID dispIdMember
,
325 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
326 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
328 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
329 return IDispatchEx_Invoke(DISPATCHEX(&This
->node
.dispex
), dispIdMember
, riid
, lcid
,
330 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
333 static HRESULT WINAPI
HTMLElement2_get_scopeName(IHTMLElement2
*iface
, BSTR
*p
)
335 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
336 FIXME("(%p)->(%p)\n", This
, p
);
340 static HRESULT WINAPI
HTMLElement2_setCapture(IHTMLElement2
*iface
, VARIANT_BOOL containerCapture
)
342 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
343 FIXME("(%p)->(%x)\n", This
, containerCapture
);
347 static HRESULT WINAPI
HTMLElement2_releaseCapture(IHTMLElement2
*iface
)
349 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
350 FIXME("(%p)\n", This
);
354 static HRESULT WINAPI
HTMLElement2_put_onlosecapture(IHTMLElement2
*iface
, VARIANT v
)
356 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
357 FIXME("(%p)->()\n", This
);
361 static HRESULT WINAPI
HTMLElement2_get_onlosecapture(IHTMLElement2
*iface
, VARIANT
*p
)
363 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
364 FIXME("(%p)->(%p)\n", This
, p
);
368 static HRESULT WINAPI
HTMLElement2_componentFromPoint(IHTMLElement2
*iface
,
369 LONG x
, LONG y
, BSTR
*component
)
371 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
372 FIXME("(%p)->(%d %d %p)\n", This
, x
, y
, component
);
376 static HRESULT WINAPI
HTMLElement2_doScroll(IHTMLElement2
*iface
, VARIANT component
)
378 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
380 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&component
));
382 if(!This
->node
.doc
->content_ready
383 || !This
->node
.doc
->basedoc
.doc_obj
->in_place_active
)
390 static HRESULT WINAPI
HTMLElement2_put_onscroll(IHTMLElement2
*iface
, VARIANT v
)
392 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
393 FIXME("(%p)->()\n", This
);
397 static HRESULT WINAPI
HTMLElement2_get_onscroll(IHTMLElement2
*iface
, VARIANT
*p
)
399 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
400 FIXME("(%p)->(%p)\n", This
, p
);
404 static HRESULT WINAPI
HTMLElement2_put_ondrag(IHTMLElement2
*iface
, VARIANT v
)
406 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
408 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
410 return set_node_event(&This
->node
, EVENTID_DRAG
, &v
);
413 static HRESULT WINAPI
HTMLElement2_get_ondrag(IHTMLElement2
*iface
, VARIANT
*p
)
415 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
417 TRACE("(%p)->(%p)\n", This
, p
);
419 return get_node_event(&This
->node
, EVENTID_DRAG
, p
);
422 static HRESULT WINAPI
HTMLElement2_put_ondragend(IHTMLElement2
*iface
, VARIANT v
)
424 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
425 FIXME("(%p)->()\n", This
);
429 static HRESULT WINAPI
HTMLElement2_get_ondragend(IHTMLElement2
*iface
, VARIANT
*p
)
431 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
432 FIXME("(%p)->(%p)\n", This
, p
);
436 static HRESULT WINAPI
HTMLElement2_put_ondragenter(IHTMLElement2
*iface
, VARIANT v
)
438 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
439 FIXME("(%p)->()\n", This
);
443 static HRESULT WINAPI
HTMLElement2_get_ondragenter(IHTMLElement2
*iface
, VARIANT
*p
)
445 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
446 FIXME("(%p)->(%p)\n", This
, p
);
450 static HRESULT WINAPI
HTMLElement2_put_ondragover(IHTMLElement2
*iface
, VARIANT v
)
452 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
453 FIXME("(%p)->()\n", This
);
457 static HRESULT WINAPI
HTMLElement2_get_ondragover(IHTMLElement2
*iface
, VARIANT
*p
)
459 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
460 FIXME("(%p)->(%p)\n", This
, p
);
464 static HRESULT WINAPI
HTMLElement2_put_ondragleave(IHTMLElement2
*iface
, VARIANT v
)
466 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
467 FIXME("(%p)->()\n", This
);
471 static HRESULT WINAPI
HTMLElement2_get_ondragleave(IHTMLElement2
*iface
, VARIANT
*p
)
473 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
474 FIXME("(%p)->(%p)\n", This
, p
);
478 static HRESULT WINAPI
HTMLElement2_put_ondrop(IHTMLElement2
*iface
, VARIANT v
)
480 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
481 FIXME("(%p)->()\n", This
);
485 static HRESULT WINAPI
HTMLElement2_get_ondrop(IHTMLElement2
*iface
, VARIANT
*p
)
487 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
488 FIXME("(%p)->(%p)\n", This
, p
);
492 static HRESULT WINAPI
HTMLElement2_put_onbeforecut(IHTMLElement2
*iface
, VARIANT v
)
494 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
495 FIXME("(%p)->()\n", This
);
499 static HRESULT WINAPI
HTMLElement2_get_onbeforecut(IHTMLElement2
*iface
, VARIANT
*p
)
501 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
502 FIXME("(%p)->(%p)\n", This
, p
);
506 static HRESULT WINAPI
HTMLElement2_put_oncut(IHTMLElement2
*iface
, VARIANT v
)
508 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
509 FIXME("(%p)->()\n", This
);
513 static HRESULT WINAPI
HTMLElement2_get_oncut(IHTMLElement2
*iface
, VARIANT
*p
)
515 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
516 FIXME("(%p)->(%p)\n", This
, p
);
520 static HRESULT WINAPI
HTMLElement2_put_onbeforecopy(IHTMLElement2
*iface
, VARIANT v
)
522 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
523 FIXME("(%p)->()\n", This
);
527 static HRESULT WINAPI
HTMLElement2_get_onbeforecopy(IHTMLElement2
*iface
, VARIANT
*p
)
529 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
530 FIXME("(%p)->(%p)\n", This
, p
);
534 static HRESULT WINAPI
HTMLElement2_put_oncopy(IHTMLElement2
*iface
, VARIANT v
)
536 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
537 FIXME("(%p)->()\n", This
);
541 static HRESULT WINAPI
HTMLElement2_get_oncopy(IHTMLElement2
*iface
, VARIANT
*p
)
543 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
544 FIXME("(%p)->(%p)\n", This
, p
);
548 static HRESULT WINAPI
HTMLElement2_put_onbeforepaste(IHTMLElement2
*iface
, VARIANT v
)
550 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
551 FIXME("(%p)->()\n", This
);
555 static HRESULT WINAPI
HTMLElement2_get_onbeforepaste(IHTMLElement2
*iface
, VARIANT
*p
)
557 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
558 FIXME("(%p)->(%p)\n", This
, p
);
562 static HRESULT WINAPI
HTMLElement2_put_onpaste(IHTMLElement2
*iface
, VARIANT v
)
564 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
566 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
568 return set_node_event(&This
->node
, EVENTID_PASTE
, &v
);
571 static HRESULT WINAPI
HTMLElement2_get_onpaste(IHTMLElement2
*iface
, VARIANT
*p
)
573 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
575 TRACE("(%p)->(%p)\n", This
, p
);
577 return get_node_event(&This
->node
, EVENTID_PASTE
, p
);
580 static HRESULT WINAPI
HTMLElement2_get_currentStyle(IHTMLElement2
*iface
, IHTMLCurrentStyle
**p
)
582 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
584 TRACE("(%p)->(%p)\n", This
, p
);
586 return HTMLCurrentStyle_Create(This
, p
);
589 static HRESULT WINAPI
HTMLElement2_put_onpropertychange(IHTMLElement2
*iface
, VARIANT v
)
591 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
592 FIXME("(%p)->()\n", This
);
596 static HRESULT WINAPI
HTMLElement2_get_onpropertychange(IHTMLElement2
*iface
, VARIANT
*p
)
598 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
599 FIXME("(%p)->(%p)\n", This
, p
);
603 static HRESULT WINAPI
HTMLElement2_getClientRects(IHTMLElement2
*iface
, IHTMLRectCollection
**pRectCol
)
605 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
606 FIXME("(%p)->(%p)\n", This
, pRectCol
);
610 static HRESULT WINAPI
HTMLElement2_getBoundingClientRect(IHTMLElement2
*iface
, IHTMLRect
**pRect
)
612 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
613 nsIDOMNSElement
*nselem
;
614 nsIDOMClientRect
*nsrect
;
618 TRACE("(%p)->(%p)\n", This
, pRect
);
620 nsres
= nsIDOMHTMLElement_QueryInterface(This
->node
.nsnode
, &IID_nsIDOMNSElement
,
622 if(NS_FAILED(nsres
)) {
623 ERR("Could not get nsIDOMNSElement iface: %08x\n", nsres
);
627 nsres
= nsIDOMNSElement_GetBoundingClientRect(nselem
, &nsrect
);
628 nsIDOMNSElement_Release(nselem
);
629 if(NS_FAILED(nsres
) || !nsrect
) {
630 ERR("GetBoindingClientRect failed: %08x\n", nsres
);
634 hres
= create_html_rect(nsrect
, pRect
);
636 nsIDOMClientRect_Release(nsrect
);
640 static HRESULT WINAPI
HTMLElement2_setExpression(IHTMLElement2
*iface
, BSTR propname
,
641 BSTR expression
, BSTR language
)
643 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
644 FIXME("(%p)->(%s %s %s)\n", This
, debugstr_w(propname
), debugstr_w(expression
),
645 debugstr_w(language
));
649 static HRESULT WINAPI
HTMLElement2_getExpression(IHTMLElement2
*iface
, BSTR propname
,
652 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
653 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(propname
), expression
);
657 static HRESULT WINAPI
HTMLElement2_removeExpression(IHTMLElement2
*iface
, BSTR propname
,
658 VARIANT_BOOL
*pfSuccess
)
660 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
661 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(propname
), pfSuccess
);
665 static HRESULT WINAPI
HTMLElement2_put_tabIndex(IHTMLElement2
*iface
, short v
)
667 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
668 nsIDOMNSHTMLElement
*nselem
;
671 TRACE("(%p)->(%d)\n", This
, v
);
673 nsres
= nsIDOMHTMLElement_QueryInterface(This
->nselem
, &IID_nsIDOMNSHTMLElement
, (void**)&nselem
);
674 if(NS_FAILED(nsres
)) {
675 ERR("Could not get nsIDOMHTMLNSElement: %08x\n", nsres
);
679 nsres
= nsIDOMNSHTMLElement_SetTabIndex(nselem
, v
);
680 nsIDOMNSHTMLElement_Release(nselem
);
682 ERR("GetTabIndex failed: %08x\n", nsres
);
687 static HRESULT WINAPI
HTMLElement2_get_tabIndex(IHTMLElement2
*iface
, short *p
)
689 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
690 nsIDOMNSHTMLElement
*nselem
;
694 TRACE("(%p)->(%p)\n", This
, p
);
696 nsres
= nsIDOMHTMLElement_QueryInterface(This
->nselem
, &IID_nsIDOMNSHTMLElement
, (void**)&nselem
);
697 if(NS_FAILED(nsres
)) {
698 ERR("Could not get nsIDOMHTMLNSElement: %08x\n", nsres
);
702 nsres
= nsIDOMNSHTMLElement_GetTabIndex(nselem
, &index
);
703 nsIDOMNSHTMLElement_Release(nselem
);
704 if(NS_FAILED(nsres
)) {
705 ERR("GetTabIndex failed: %08x\n", nsres
);
713 static HRESULT WINAPI
HTMLElement2_focus(IHTMLElement2
*iface
)
715 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
716 nsIDOMNSHTMLElement
*nselem
;
719 TRACE("(%p)\n", This
);
721 nsres
= nsIDOMHTMLElement_QueryInterface(This
->nselem
, &IID_nsIDOMNSHTMLElement
, (void**)&nselem
);
722 if(NS_SUCCEEDED(nsres
)) {
723 nsIDOMNSHTMLElement_Focus(nselem
);
724 nsIDOMNSHTMLElement_Release(nselem
);
726 ERR("Could not get nsIDOMHTMLNSElement: %08x\n", nsres
);
732 static HRESULT WINAPI
HTMLElement2_put_accessKey(IHTMLElement2
*iface
, BSTR v
)
734 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
737 static WCHAR accessKeyW
[] = {'a','c','c','e','s','s','K','e','y',0};
739 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
741 V_VT(&var
) = VT_BSTR
;
743 return IHTMLElement_setAttribute(HTMLELEM(This
), accessKeyW
, var
, 0);
746 static HRESULT WINAPI
HTMLElement2_get_accessKey(IHTMLElement2
*iface
, BSTR
*p
)
748 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
749 FIXME("(%p)->(%p)\n", This
, p
);
753 static HRESULT WINAPI
HTMLElement2_put_onblur(IHTMLElement2
*iface
, VARIANT v
)
755 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
757 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
759 return set_node_event(&This
->node
, EVENTID_BLUR
, &v
);
762 static HRESULT WINAPI
HTMLElement2_get_onblur(IHTMLElement2
*iface
, VARIANT
*p
)
764 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
766 TRACE("(%p)->(%p)\n", This
, p
);
768 return get_node_event(&This
->node
, EVENTID_BLUR
, p
);
771 static HRESULT WINAPI
HTMLElement2_put_onfocus(IHTMLElement2
*iface
, VARIANT v
)
773 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
775 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
777 return set_node_event(&This
->node
, EVENTID_FOCUS
, &v
);
780 static HRESULT WINAPI
HTMLElement2_get_onfocus(IHTMLElement2
*iface
, VARIANT
*p
)
782 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
784 TRACE("(%p)->(%p)\n", This
, p
);
786 return get_node_event(&This
->node
, EVENTID_FOCUS
, p
);
789 static HRESULT WINAPI
HTMLElement2_put_onresize(IHTMLElement2
*iface
, VARIANT v
)
791 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
792 FIXME("(%p)->()\n", This
);
796 static HRESULT WINAPI
HTMLElement2_get_onresize(IHTMLElement2
*iface
, VARIANT
*p
)
798 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
799 FIXME("(%p)->(%p)\n", This
, p
);
803 static HRESULT WINAPI
HTMLElement2_blur(IHTMLElement2
*iface
)
805 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
806 FIXME("(%p)\n", This
);
810 static HRESULT WINAPI
HTMLElement2_addFilter(IHTMLElement2
*iface
, IUnknown
*pUnk
)
812 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
813 FIXME("(%p)->(%p)\n", This
, pUnk
);
817 static HRESULT WINAPI
HTMLElement2_removeFilter(IHTMLElement2
*iface
, IUnknown
*pUnk
)
819 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
820 FIXME("(%p)->(%p)\n", This
, pUnk
);
824 static HRESULT WINAPI
HTMLElement2_get_clientHeight(IHTMLElement2
*iface
, LONG
*p
)
826 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
827 nsIDOMNSElement
*nselem
;
831 TRACE("(%p)->(%p)\n", This
, p
);
833 nsres
= nsIDOMHTMLElement_QueryInterface(This
->nselem
, &IID_nsIDOMNSElement
, (void**)&nselem
);
834 if(NS_SUCCEEDED(nsres
)) {
835 nsIDOMNSElement_GetClientHeight(nselem
, &height
);
836 nsIDOMNSElement_Release(nselem
);
838 ERR("Could not get nsIDOMNSElement: %08x\n", nsres
);
845 static HRESULT WINAPI
HTMLElement2_get_clientWidth(IHTMLElement2
*iface
, LONG
*p
)
847 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
848 nsIDOMNSElement
*nselem
;
852 TRACE("(%p)->(%p)\n", This
, p
);
854 nsres
= nsIDOMHTMLElement_QueryInterface(This
->nselem
, &IID_nsIDOMNSElement
, (void**)&nselem
);
855 if(NS_SUCCEEDED(nsres
)) {
856 nsIDOMNSElement_GetClientWidth(nselem
, &width
);
857 nsIDOMNSElement_Release(nselem
);
859 ERR("Could not get nsIDOMNSElement: %08x\n", nsres
);
866 static HRESULT WINAPI
HTMLElement2_get_clientTop(IHTMLElement2
*iface
, LONG
*p
)
868 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
869 nsIDOMNSElement
*nselem
;
870 PRInt32 client_top
= 0;
873 TRACE("(%p)->(%p)\n", This
, p
);
875 nsres
= nsIDOMElement_QueryInterface(This
->nselem
, &IID_nsIDOMNSElement
, (void**)&nselem
);
876 if(NS_SUCCEEDED(nsres
)) {
877 nsres
= nsIDOMNSElement_GetClientTop(nselem
, &client_top
);
878 nsIDOMNSElement_Release(nselem
);
880 ERR("GetScrollHeight failed: %08x\n", nsres
);
882 ERR("Could not get nsIDOMNSElement interface: %08x\n", nsres
);
886 TRACE("*p = %d\n", *p
);
890 static HRESULT WINAPI
HTMLElement2_get_clientLeft(IHTMLElement2
*iface
, LONG
*p
)
892 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
893 nsIDOMNSElement
*nselem
;
894 PRInt32 client_left
= 0;
897 TRACE("(%p)->(%p)\n", This
, p
);
899 nsres
= nsIDOMElement_QueryInterface(This
->nselem
, &IID_nsIDOMNSElement
, (void**)&nselem
);
900 if(NS_SUCCEEDED(nsres
)) {
901 nsres
= nsIDOMNSElement_GetClientLeft(nselem
, &client_left
);
902 nsIDOMNSElement_Release(nselem
);
904 ERR("GetScrollHeight failed: %08x\n", nsres
);
906 ERR("Could not get nsIDOMNSElement interface: %08x\n", nsres
);
910 TRACE("*p = %d\n", *p
);
914 static HRESULT WINAPI
HTMLElement2_attachEvent(IHTMLElement2
*iface
, BSTR event
,
915 IDispatch
*pDisp
, VARIANT_BOOL
*pfResult
)
917 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
919 TRACE("(%p)->(%s %p %p)\n", This
, debugstr_w(event
), pDisp
, pfResult
);
921 return attach_event(get_node_event_target(&This
->node
), This
->node
.nsnode
, &This
->node
.doc
->basedoc
, event
, pDisp
, pfResult
);
924 static HRESULT WINAPI
HTMLElement2_detachEvent(IHTMLElement2
*iface
, BSTR event
, IDispatch
*pDisp
)
926 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
928 TRACE("(%p)->(%s %p)\n", This
, debugstr_w(event
), pDisp
);
930 return detach_event(*get_node_event_target(&This
->node
), &This
->node
.doc
->basedoc
, event
, pDisp
);
933 static HRESULT WINAPI
HTMLElement2_get_readyState(IHTMLElement2
*iface
, VARIANT
*p
)
935 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
938 TRACE("(%p)->(%p)\n", This
, p
);
940 if(This
->node
.vtbl
->get_readystate
) {
943 hres
= This
->node
.vtbl
->get_readystate(&This
->node
, &str
);
947 static const WCHAR completeW
[] = {'c','o','m','p','l','e','t','e',0};
949 str
= SysAllocString(completeW
);
951 return E_OUTOFMEMORY
;
959 static HRESULT WINAPI
HTMLElement2_put_onreadystatechange(IHTMLElement2
*iface
, VARIANT v
)
961 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
963 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
965 return set_node_event(&This
->node
, EVENTID_READYSTATECHANGE
, &v
);
968 static HRESULT WINAPI
HTMLElement2_get_onreadystatechange(IHTMLElement2
*iface
, VARIANT
*p
)
970 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
972 TRACE("(%p)->(%p)\n", This
, p
);
974 return get_node_event(&This
->node
, EVENTID_READYSTATECHANGE
, p
);
977 static HRESULT WINAPI
HTMLElement2_put_onrowsdelete(IHTMLElement2
*iface
, VARIANT v
)
979 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
980 FIXME("(%p)->()\n", This
);
984 static HRESULT WINAPI
HTMLElement2_get_onrowsdelete(IHTMLElement2
*iface
, VARIANT
*p
)
986 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
987 FIXME("(%p)->(%p)\n", This
, p
);
991 static HRESULT WINAPI
HTMLElement2_put_onrowsinserted(IHTMLElement2
*iface
, VARIANT v
)
993 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
994 FIXME("(%p)->()\n", This
);
998 static HRESULT WINAPI
HTMLElement2_get_onrowsinserted(IHTMLElement2
*iface
, VARIANT
*p
)
1000 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
1001 FIXME("(%p)->(%p)\n", This
, p
);
1005 static HRESULT WINAPI
HTMLElement2_put_oncellchange(IHTMLElement2
*iface
, VARIANT v
)
1007 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
1008 FIXME("(%p)->()\n", This
);
1012 static HRESULT WINAPI
HTMLElement2_get_oncellchange(IHTMLElement2
*iface
, VARIANT
*p
)
1014 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
1015 FIXME("(%p)->(%p)\n", This
, p
);
1019 static HRESULT WINAPI
HTMLElement2_put_dir(IHTMLElement2
*iface
, BSTR v
)
1021 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
1022 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1026 static HRESULT WINAPI
HTMLElement2_get_dir(IHTMLElement2
*iface
, BSTR
*p
)
1028 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
1030 TRACE("(%p)->(%p)\n", This
, p
);
1038 nsAString_Init(&dir_str
, NULL
);
1040 nsres
= nsIDOMHTMLElement_GetDir(This
->nselem
, &dir_str
);
1041 if(NS_SUCCEEDED(nsres
)) {
1042 const PRUnichar
*dir
;
1043 nsAString_GetData(&dir_str
, &dir
);
1045 *p
= SysAllocString(dir
);
1047 ERR("GetDir failed: %08x\n", nsres
);
1050 nsAString_Finish(&dir_str
);
1053 TRACE("ret %s\n", debugstr_w(*p
));
1057 static HRESULT WINAPI
HTMLElement2_createControlRange(IHTMLElement2
*iface
, IDispatch
**range
)
1059 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
1060 FIXME("(%p)->(%p)\n", This
, range
);
1064 static HRESULT WINAPI
HTMLElement2_get_scrollHeight(IHTMLElement2
*iface
, LONG
*p
)
1066 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
1067 nsIDOMNSElement
*nselem
;
1071 TRACE("(%p)->(%p)\n", This
, p
);
1073 nsres
= nsIDOMElement_QueryInterface(This
->nselem
, &IID_nsIDOMNSElement
, (void**)&nselem
);
1074 if(NS_SUCCEEDED(nsres
)) {
1075 nsres
= nsIDOMNSElement_GetScrollHeight(nselem
, &height
);
1076 nsIDOMNSElement_Release(nselem
);
1077 if(NS_FAILED(nsres
))
1078 ERR("GetScrollHeight failed: %08x\n", nsres
);
1080 ERR("Could not get nsIDOMNSElement interface: %08x\n", nsres
);
1084 TRACE("*p = %d\n", *p
);
1089 static HRESULT WINAPI
HTMLElement2_get_scrollWidth(IHTMLElement2
*iface
, LONG
*p
)
1091 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
1092 nsIDOMNSElement
*nselem
;
1096 TRACE("(%p)->(%p)\n", This
, p
);
1098 nsres
= nsIDOMElement_QueryInterface(This
->nselem
, &IID_nsIDOMNSElement
, (void**)&nselem
);
1099 if(NS_SUCCEEDED(nsres
)) {
1100 nsres
= nsIDOMNSElement_GetScrollWidth(nselem
, &width
);
1101 nsIDOMNSElement_Release(nselem
);
1102 if(NS_FAILED(nsres
))
1103 ERR("GetScrollWidth failed: %08x\n", nsres
);
1105 ERR("Could not get nsIDOMNSElement interface: %08x\n", nsres
);
1109 TRACE("*p = %d\n", *p
);
1114 static HRESULT WINAPI
HTMLElement2_put_scrollTop(IHTMLElement2
*iface
, LONG v
)
1116 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
1117 nsIDOMNSElement
*nselem
;
1120 TRACE("(%p)->(%d)\n", This
, v
);
1123 FIXME("NULL nselem\n");
1127 nsres
= nsIDOMHTMLElement_QueryInterface(This
->nselem
, &IID_nsIDOMNSElement
, (void**)&nselem
);
1128 if(NS_SUCCEEDED(nsres
)) {
1129 nsIDOMNSElement_SetScrollTop(nselem
, v
);
1130 nsIDOMNSElement_Release(nselem
);
1132 ERR("Could not get nsIDOMNSElement interface: %08x\n", nsres
);
1138 static HRESULT WINAPI
HTMLElement2_get_scrollTop(IHTMLElement2
*iface
, LONG
*p
)
1140 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
1141 nsIDOMNSElement
*nselem
;
1145 TRACE("(%p)->(%p)\n", This
, p
);
1147 nsres
= nsIDOMElement_QueryInterface(This
->nselem
, &IID_nsIDOMNSElement
, (void**)&nselem
);
1148 if(NS_SUCCEEDED(nsres
)) {
1149 nsres
= nsIDOMNSElement_GetScrollTop(nselem
, &top
);
1150 nsIDOMNSElement_Release(nselem
);
1151 if(NS_FAILED(nsres
))
1152 ERR("GetScrollTop failed: %08x\n", nsres
);
1154 ERR("Could not get nsIDOMNSElement interface: %08x\n", nsres
);
1158 TRACE("*p = %d\n", *p
);
1163 static HRESULT WINAPI
HTMLElement2_put_scrollLeft(IHTMLElement2
*iface
, LONG v
)
1165 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
1166 nsIDOMNSElement
*nselem
;
1169 TRACE("(%p)->(%d)\n", This
, v
);
1172 FIXME("NULL nselem\n");
1176 nsres
= nsIDOMElement_QueryInterface(This
->nselem
, &IID_nsIDOMNSElement
, (void**)&nselem
);
1177 if(NS_SUCCEEDED(nsres
)) {
1178 nsIDOMNSElement_SetScrollLeft(nselem
, v
);
1179 nsIDOMNSElement_Release(nselem
);
1181 ERR("Could not get nsIDOMNSElement interface: %08x\n", nsres
);
1187 static HRESULT WINAPI
HTMLElement2_get_scrollLeft(IHTMLElement2
*iface
, LONG
*p
)
1189 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
1190 nsIDOMNSElement
*nselem
;
1194 TRACE("(%p)->(%p)\n", This
, p
);
1197 return E_INVALIDARG
;
1201 FIXME("NULL nselem\n");
1205 nsres
= nsIDOMHTMLElement_QueryInterface(This
->nselem
, &IID_nsIDOMNSElement
, (void**)&nselem
);
1206 if(NS_SUCCEEDED(nsres
))
1208 nsres
= nsIDOMNSElement_GetScrollLeft(nselem
, &left
);
1209 nsIDOMNSElement_Release(nselem
);
1210 if(NS_FAILED(nsres
))
1215 TRACE("*p = %d\n", *p
);
1220 static HRESULT WINAPI
HTMLElement2_clearAttributes(IHTMLElement2
*iface
)
1222 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
1223 FIXME("(%p)\n", This
);
1227 static HRESULT WINAPI
HTMLElement2_mergeAttributes(IHTMLElement2
*iface
, IHTMLElement
*mergeThis
)
1229 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
1230 FIXME("(%p)->(%p)\n", This
, mergeThis
);
1234 static HRESULT WINAPI
HTMLElement2_put_oncontextmenu(IHTMLElement2
*iface
, VARIANT v
)
1236 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
1237 FIXME("(%p)->()\n", This
);
1241 static HRESULT WINAPI
HTMLElement2_get_oncontextmenu(IHTMLElement2
*iface
, VARIANT
*p
)
1243 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
1244 FIXME("(%p)->(%p)\n", This
, p
);
1248 static HRESULT WINAPI
HTMLElement2_insertAdjecentElement(IHTMLElement2
*iface
, BSTR where
,
1249 IHTMLElement
*insertedElement
, IHTMLElement
**inserted
)
1251 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
1252 FIXME("(%p)->(%s %p %p)\n", This
, debugstr_w(where
), insertedElement
, inserted
);
1256 static HRESULT WINAPI
HTMLElement2_applyElement(IHTMLElement2
*iface
, IHTMLElement
*apply
,
1257 BSTR where
, IHTMLElement
**applied
)
1259 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
1260 FIXME("(%p)->(%p %s %p)\n", This
, apply
, debugstr_w(where
), applied
);
1264 static HRESULT WINAPI
HTMLElement2_getAdjecentText(IHTMLElement2
*iface
, BSTR where
, BSTR
*text
)
1266 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
1267 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(where
), text
);
1271 static HRESULT WINAPI
HTMLElement2_replaceAdjecentText(IHTMLElement2
*iface
, BSTR where
,
1272 BSTR newText
, BSTR
*oldText
)
1274 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
1275 FIXME("(%p)->(%s %s %p)\n", This
, debugstr_w(where
), debugstr_w(newText
), oldText
);
1279 static HRESULT WINAPI
HTMLElement2_get_canHandleChildren(IHTMLElement2
*iface
, VARIANT_BOOL
*p
)
1281 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
1282 FIXME("(%p)->(%p)\n", This
, p
);
1286 static HRESULT WINAPI
HTMLElement2_addBehavior(IHTMLElement2
*iface
, BSTR bstrUrl
,
1287 VARIANT
*pvarFactory
, LONG
*pCookie
)
1289 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
1290 FIXME("(%p)->(%s %p %p)\n", This
, debugstr_w(bstrUrl
), pvarFactory
, pCookie
);
1294 static HRESULT WINAPI
HTMLElement2_removeBehavior(IHTMLElement2
*iface
, LONG cookie
,
1295 VARIANT_BOOL
*pfResult
)
1297 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
1298 FIXME("(%p)->(%d %p)\n", This
, cookie
, pfResult
);
1302 static HRESULT WINAPI
HTMLElement2_get_runtimeStyle(IHTMLElement2
*iface
, IHTMLStyle
**p
)
1304 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
1305 FIXME("(%p)->(%p)\n", This
, p
);
1309 static HRESULT WINAPI
HTMLElement2_get_behaviorUrns(IHTMLElement2
*iface
, IDispatch
**p
)
1311 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
1312 FIXME("(%p)->(%p)\n", This
, p
);
1316 static HRESULT WINAPI
HTMLElement2_put_tagUrn(IHTMLElement2
*iface
, BSTR v
)
1318 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
1319 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
1323 static HRESULT WINAPI
HTMLElement2_get_tagUrn(IHTMLElement2
*iface
, BSTR
*p
)
1325 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
1326 FIXME("(%p)->(%p)\n", This
, p
);
1330 static HRESULT WINAPI
HTMLElement2_put_onbeforeeditfocus(IHTMLElement2
*iface
, VARIANT vv
)
1332 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
1333 FIXME("(%p)->()\n", This
);
1337 static HRESULT WINAPI
HTMLElement2_get_onbeforeeditfocus(IHTMLElement2
*iface
, VARIANT
*p
)
1339 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
1340 FIXME("(%p)->(%p)\n", This
, p
);
1344 static HRESULT WINAPI
HTMLElement2_get_readyStateValue(IHTMLElement2
*iface
, LONG
*p
)
1346 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
1347 FIXME("(%p)->(%p)\n", This
, p
);
1351 static HRESULT WINAPI
HTMLElement2_getElementsByTagName(IHTMLElement2
*iface
, BSTR v
,
1352 IHTMLElementCollection
**pelColl
)
1354 HTMLElement
*This
= HTMLELEM2_THIS(iface
);
1355 nsIDOMNodeList
*nslist
;
1359 TRACE("(%p)->(%s %p)\n", This
, debugstr_w(v
), pelColl
);
1361 nsAString_InitDepend(&tag_str
, v
);
1362 nsres
= nsIDOMHTMLElement_GetElementsByTagName(This
->nselem
, &tag_str
, &nslist
);
1363 nsAString_Finish(&tag_str
);
1364 if(NS_FAILED(nsres
)) {
1365 ERR("GetElementByTagName failed: %08x\n", nsres
);
1369 *pelColl
= create_collection_from_nodelist(This
->node
.doc
, (IUnknown
*)HTMLELEM(This
), nslist
);
1370 nsIDOMNodeList_Release(nslist
);
1374 #undef HTMLELEM2_THIS
1376 static const IHTMLElement2Vtbl HTMLElement2Vtbl
= {
1377 HTMLElement2_QueryInterface
,
1378 HTMLElement2_AddRef
,
1379 HTMLElement2_Release
,
1380 HTMLElement2_GetTypeInfoCount
,
1381 HTMLElement2_GetTypeInfo
,
1382 HTMLElement2_GetIDsOfNames
,
1383 HTMLElement2_Invoke
,
1384 HTMLElement2_get_scopeName
,
1385 HTMLElement2_setCapture
,
1386 HTMLElement2_releaseCapture
,
1387 HTMLElement2_put_onlosecapture
,
1388 HTMLElement2_get_onlosecapture
,
1389 HTMLElement2_componentFromPoint
,
1390 HTMLElement2_doScroll
,
1391 HTMLElement2_put_onscroll
,
1392 HTMLElement2_get_onscroll
,
1393 HTMLElement2_put_ondrag
,
1394 HTMLElement2_get_ondrag
,
1395 HTMLElement2_put_ondragend
,
1396 HTMLElement2_get_ondragend
,
1397 HTMLElement2_put_ondragenter
,
1398 HTMLElement2_get_ondragenter
,
1399 HTMLElement2_put_ondragover
,
1400 HTMLElement2_get_ondragover
,
1401 HTMLElement2_put_ondragleave
,
1402 HTMLElement2_get_ondragleave
,
1403 HTMLElement2_put_ondrop
,
1404 HTMLElement2_get_ondrop
,
1405 HTMLElement2_put_onbeforecut
,
1406 HTMLElement2_get_onbeforecut
,
1407 HTMLElement2_put_oncut
,
1408 HTMLElement2_get_oncut
,
1409 HTMLElement2_put_onbeforecopy
,
1410 HTMLElement2_get_onbeforecopy
,
1411 HTMLElement2_put_oncopy
,
1412 HTMLElement2_get_oncopy
,
1413 HTMLElement2_put_onbeforepaste
,
1414 HTMLElement2_get_onbeforepaste
,
1415 HTMLElement2_put_onpaste
,
1416 HTMLElement2_get_onpaste
,
1417 HTMLElement2_get_currentStyle
,
1418 HTMLElement2_put_onpropertychange
,
1419 HTMLElement2_get_onpropertychange
,
1420 HTMLElement2_getClientRects
,
1421 HTMLElement2_getBoundingClientRect
,
1422 HTMLElement2_setExpression
,
1423 HTMLElement2_getExpression
,
1424 HTMLElement2_removeExpression
,
1425 HTMLElement2_put_tabIndex
,
1426 HTMLElement2_get_tabIndex
,
1428 HTMLElement2_put_accessKey
,
1429 HTMLElement2_get_accessKey
,
1430 HTMLElement2_put_onblur
,
1431 HTMLElement2_get_onblur
,
1432 HTMLElement2_put_onfocus
,
1433 HTMLElement2_get_onfocus
,
1434 HTMLElement2_put_onresize
,
1435 HTMLElement2_get_onresize
,
1437 HTMLElement2_addFilter
,
1438 HTMLElement2_removeFilter
,
1439 HTMLElement2_get_clientHeight
,
1440 HTMLElement2_get_clientWidth
,
1441 HTMLElement2_get_clientTop
,
1442 HTMLElement2_get_clientLeft
,
1443 HTMLElement2_attachEvent
,
1444 HTMLElement2_detachEvent
,
1445 HTMLElement2_get_readyState
,
1446 HTMLElement2_put_onreadystatechange
,
1447 HTMLElement2_get_onreadystatechange
,
1448 HTMLElement2_put_onrowsdelete
,
1449 HTMLElement2_get_onrowsdelete
,
1450 HTMLElement2_put_onrowsinserted
,
1451 HTMLElement2_get_onrowsinserted
,
1452 HTMLElement2_put_oncellchange
,
1453 HTMLElement2_get_oncellchange
,
1454 HTMLElement2_put_dir
,
1455 HTMLElement2_get_dir
,
1456 HTMLElement2_createControlRange
,
1457 HTMLElement2_get_scrollHeight
,
1458 HTMLElement2_get_scrollWidth
,
1459 HTMLElement2_put_scrollTop
,
1460 HTMLElement2_get_scrollTop
,
1461 HTMLElement2_put_scrollLeft
,
1462 HTMLElement2_get_scrollLeft
,
1463 HTMLElement2_clearAttributes
,
1464 HTMLElement2_mergeAttributes
,
1465 HTMLElement2_put_oncontextmenu
,
1466 HTMLElement2_get_oncontextmenu
,
1467 HTMLElement2_insertAdjecentElement
,
1468 HTMLElement2_applyElement
,
1469 HTMLElement2_getAdjecentText
,
1470 HTMLElement2_replaceAdjecentText
,
1471 HTMLElement2_get_canHandleChildren
,
1472 HTMLElement2_addBehavior
,
1473 HTMLElement2_removeBehavior
,
1474 HTMLElement2_get_runtimeStyle
,
1475 HTMLElement2_get_behaviorUrns
,
1476 HTMLElement2_put_tagUrn
,
1477 HTMLElement2_get_tagUrn
,
1478 HTMLElement2_put_onbeforeeditfocus
,
1479 HTMLElement2_get_onbeforeeditfocus
,
1480 HTMLElement2_get_readyStateValue
,
1481 HTMLElement2_getElementsByTagName
,
1484 void HTMLElement2_Init(HTMLElement
*This
)
1486 This
->lpHTMLElement2Vtbl
= &HTMLElement2Vtbl
;