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
33 #include "wine/debug.h"
35 #include "mshtml_private.h"
36 #include "htmlevent.h"
37 #include "htmlstyle.h"
39 WINE_DEFAULT_DEBUG_CHANNEL(mshtml
);
41 static const WCHAR aW
[] = {'A',0};
42 static const WCHAR areaW
[] = {'A','R','E','A',0};
43 static const WCHAR bodyW
[] = {'B','O','D','Y',0};
44 static const WCHAR buttonW
[] = {'B','U','T','T','O','N',0};
45 static const WCHAR embedW
[] = {'E','M','B','E','D',0};
46 static const WCHAR formW
[] = {'F','O','R','M',0};
47 static const WCHAR frameW
[] = {'F','R','A','M','E',0};
48 static const WCHAR headW
[] = {'H','E','A','D',0};
49 static const WCHAR htmlW
[] = {'H','T','M','L',0};
50 static const WCHAR iframeW
[] = {'I','F','R','A','M','E',0};
51 static const WCHAR imgW
[] = {'I','M','G',0};
52 static const WCHAR inputW
[] = {'I','N','P','U','T',0};
53 static const WCHAR labelW
[] = {'L','A','B','E','L',0};
54 static const WCHAR linkW
[] = {'L','I','N','K',0};
55 static const WCHAR metaW
[] = {'M','E','T','A',0};
56 static const WCHAR objectW
[] = {'O','B','J','E','C','T',0};
57 static const WCHAR optionW
[] = {'O','P','T','I','O','N',0};
58 static const WCHAR scriptW
[] = {'S','C','R','I','P','T',0};
59 static const WCHAR selectW
[] = {'S','E','L','E','C','T',0};
60 static const WCHAR styleW
[] = {'S','T','Y','L','E',0};
61 static const WCHAR tableW
[] = {'T','A','B','L','E',0};
62 static const WCHAR tdW
[] = {'T','D',0};
63 static const WCHAR textareaW
[] = {'T','E','X','T','A','R','E','A',0};
64 static const WCHAR title_tagW
[]= {'T','I','T','L','E',0};
65 static const WCHAR trW
[] = {'T','R',0};
67 #define ATTRFLAG_CASESENSITIVE 0x0001
68 #define ATTRFLAG_ASSTRING 0x0002
69 #define ATTRFLAG_EXPANDURL 0x0004
73 HRESULT (*constructor
)(HTMLDocumentNode
*,nsIDOMHTMLElement
*,HTMLElement
**);
76 static const tag_desc_t tag_descs
[] = {
77 {aW
, HTMLAnchorElement_Create
},
78 {areaW
, HTMLAreaElement_Create
},
79 {bodyW
, HTMLBodyElement_Create
},
80 {buttonW
, HTMLButtonElement_Create
},
81 {embedW
, HTMLEmbedElement_Create
},
82 {formW
, HTMLFormElement_Create
},
83 {frameW
, HTMLFrameElement_Create
},
84 {headW
, HTMLHeadElement_Create
},
85 {htmlW
, HTMLHtmlElement_Create
},
86 {iframeW
, HTMLIFrame_Create
},
87 {imgW
, HTMLImgElement_Create
},
88 {inputW
, HTMLInputElement_Create
},
89 {labelW
, HTMLLabelElement_Create
},
90 {linkW
, HTMLLinkElement_Create
},
91 {metaW
, HTMLMetaElement_Create
},
92 {objectW
, HTMLObjectElement_Create
},
93 {optionW
, HTMLOptionElement_Create
},
94 {scriptW
, HTMLScriptElement_Create
},
95 {selectW
, HTMLSelectElement_Create
},
96 {styleW
, HTMLStyleElement_Create
},
97 {tableW
, HTMLTable_Create
},
98 {tdW
, HTMLTableCell_Create
},
99 {textareaW
, HTMLTextAreaElement_Create
},
100 {title_tagW
, HTMLTitleElement_Create
},
101 {trW
, HTMLTableRow_Create
}
104 static const tag_desc_t
*get_tag_desc(const WCHAR
*tag_name
)
106 DWORD min
=0, max
=sizeof(tag_descs
)/sizeof(*tag_descs
)-1, i
;
111 r
= strcmpW(tag_name
, tag_descs
[i
].name
);
124 HRESULT
replace_node_by_html(nsIDOMHTMLDocument
*nsdoc
, nsIDOMNode
*nsnode
, const WCHAR
*html
)
126 nsIDOMDocumentFragment
*nsfragment
;
127 nsIDOMNode
*nsparent
;
133 nsres
= nsIDOMHTMLDocument_CreateRange(nsdoc
, &range
);
134 if(NS_FAILED(nsres
)) {
135 ERR("CreateRange failed: %08x\n", nsres
);
139 nsAString_InitDepend(&html_str
, html
);
140 nsIDOMRange_CreateContextualFragment(range
, &html_str
, &nsfragment
);
141 nsIDOMRange_Release(range
);
142 nsAString_Finish(&html_str
);
143 if(NS_FAILED(nsres
)) {
144 ERR("CreateContextualFragment failed: %08x\n", nsres
);
148 nsres
= nsIDOMNode_GetParentNode(nsnode
, &nsparent
);
149 if(NS_SUCCEEDED(nsres
) && nsparent
) {
152 nsres
= nsIDOMNode_ReplaceChild(nsparent
, (nsIDOMNode
*)nsfragment
, nsnode
, &nstmp
);
153 nsIDOMNode_Release(nsparent
);
154 if(NS_FAILED(nsres
)) {
155 ERR("ReplaceChild failed: %08x\n", nsres
);
158 nsIDOMNode_Release(nstmp
);
161 ERR("GetParentNode failed: %08x\n", nsres
);
165 nsIDOMDocumentFragment_Release(nsfragment
);
169 nsresult
get_elem_attr_value(nsIDOMHTMLElement
*nselem
, const WCHAR
*name
, nsAString
*val_str
, const PRUnichar
**val
)
174 nsAString_InitDepend(&name_str
, name
);
175 nsAString_Init(val_str
, NULL
);
176 nsres
= nsIDOMHTMLElement_GetAttribute(nselem
, &name_str
, val_str
);
177 nsAString_Finish(&name_str
);
178 if(NS_FAILED(nsres
)) {
179 ERR("GetAttribute(%s) failed: %08x\n", debugstr_w(name
), nsres
);
180 nsAString_Finish(val_str
);
184 nsAString_GetData(val_str
, val
);
188 HRESULT
elem_string_attr_getter(HTMLElement
*elem
, const WCHAR
*name
, BOOL use_null
, BSTR
*p
)
190 const PRUnichar
*val
;
195 nsres
= get_elem_attr_value(elem
->nselem
, name
, &val_str
, &val
);
199 TRACE("%s: returning %s\n", debugstr_w(name
), debugstr_w(val
));
201 if(*val
|| !use_null
) {
202 *p
= SysAllocString(val
);
204 hres
= E_OUTOFMEMORY
;
208 nsAString_Finish(&val_str
);
212 HRESULT
elem_string_attr_setter(HTMLElement
*elem
, const WCHAR
*name
, const WCHAR
*value
)
214 nsAString name_str
, val_str
;
217 nsAString_InitDepend(&name_str
, name
);
218 nsAString_InitDepend(&val_str
, value
);
219 nsres
= nsIDOMHTMLElement_SetAttribute(elem
->nselem
, &name_str
, &val_str
);
220 nsAString_Finish(&name_str
);
221 nsAString_Finish(&val_str
);
223 if(NS_FAILED(nsres
)) {
224 WARN("SetAttribute failed: %08x\n", nsres
);
231 HRESULT
get_readystate_string(READYSTATE readystate
, BSTR
*p
)
233 static const WCHAR uninitializedW
[] = {'u','n','i','n','i','t','i','a','l','i','z','e','d',0};
234 static const WCHAR loadingW
[] = {'l','o','a','d','i','n','g',0};
235 static const WCHAR loadedW
[] = {'l','o','a','d','e','d',0};
236 static const WCHAR interactiveW
[] = {'i','n','t','e','r','a','c','t','i','v','e',0};
237 static const WCHAR completeW
[] = {'c','o','m','p','l','e','t','e',0};
239 static const LPCWSTR readystate_strs
[] = {
247 assert(readystate
<= READYSTATE_COMPLETE
);
248 *p
= SysAllocString(readystate_strs
[readystate
]);
249 return *p
? S_OK
: E_OUTOFMEMORY
;
255 IHTMLFiltersCollection IHTMLFiltersCollection_iface
;
258 } HTMLFiltersCollection
;
260 static inline HTMLFiltersCollection
*impl_from_IHTMLFiltersCollection(IHTMLFiltersCollection
*iface
)
262 return CONTAINING_RECORD(iface
, HTMLFiltersCollection
, IHTMLFiltersCollection_iface
);
265 static IHTMLFiltersCollection
*HTMLFiltersCollection_Create(void);
267 static inline HTMLElement
*impl_from_IHTMLElement(IHTMLElement
*iface
)
269 return CONTAINING_RECORD(iface
, HTMLElement
, IHTMLElement_iface
);
272 HRESULT
create_nselem(HTMLDocumentNode
*doc
, const WCHAR
*tag
, nsIDOMHTMLElement
**ret
)
274 nsIDOMElement
*nselem
;
279 WARN("NULL nsdoc\n");
283 nsAString_InitDepend(&tag_str
, tag
);
284 nsres
= nsIDOMHTMLDocument_CreateElement(doc
->nsdoc
, &tag_str
, &nselem
);
285 nsAString_Finish(&tag_str
);
286 if(NS_FAILED(nsres
)) {
287 ERR("CreateElement failed: %08x\n", nsres
);
291 nsres
= nsIDOMElement_QueryInterface(nselem
, &IID_nsIDOMHTMLElement
, (void**)ret
);
292 nsIDOMElement_Release(nselem
);
293 if(NS_FAILED(nsres
)) {
294 ERR("Could not get nsIDOMHTMLElement iface: %08x\n", nsres
);
301 HRESULT
create_element(HTMLDocumentNode
*doc
, const WCHAR
*tag
, HTMLElement
**ret
)
303 nsIDOMHTMLElement
*nselem
;
306 /* Use owner doc if called on document fragment */
310 hres
= create_nselem(doc
, tag
, &nselem
);
314 hres
= HTMLElement_Create(doc
, (nsIDOMNode
*)nselem
, TRUE
, ret
);
315 nsIDOMHTMLElement_Release(nselem
);
321 IHTMLRect IHTMLRect_iface
;
325 nsIDOMClientRect
*nsrect
;
328 static inline HTMLRect
*impl_from_IHTMLRect(IHTMLRect
*iface
)
330 return CONTAINING_RECORD(iface
, HTMLRect
, IHTMLRect_iface
);
333 static HRESULT WINAPI
HTMLRect_QueryInterface(IHTMLRect
*iface
, REFIID riid
, void **ppv
)
335 HTMLRect
*This
= impl_from_IHTMLRect(iface
);
337 TRACE("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
339 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
340 *ppv
= &This
->IHTMLRect_iface
;
341 }else if(IsEqualGUID(&IID_IHTMLRect
, riid
)) {
342 *ppv
= &This
->IHTMLRect_iface
;
343 }else if(dispex_query_interface(&This
->dispex
, riid
, ppv
)) {
344 return *ppv
? S_OK
: E_NOINTERFACE
;
346 FIXME("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
348 return E_NOINTERFACE
;
351 IUnknown_AddRef((IUnknown
*)*ppv
);
355 static ULONG WINAPI
HTMLRect_AddRef(IHTMLRect
*iface
)
357 HTMLRect
*This
= impl_from_IHTMLRect(iface
);
358 LONG ref
= InterlockedIncrement(&This
->ref
);
360 TRACE("(%p) ref=%d\n", This
, ref
);
365 static ULONG WINAPI
HTMLRect_Release(IHTMLRect
*iface
)
367 HTMLRect
*This
= impl_from_IHTMLRect(iface
);
368 LONG ref
= InterlockedDecrement(&This
->ref
);
370 TRACE("(%p) ref=%d\n", This
, ref
);
374 nsIDOMClientRect_Release(This
->nsrect
);
375 release_dispex(&This
->dispex
);
382 static HRESULT WINAPI
HTMLRect_GetTypeInfoCount(IHTMLRect
*iface
, UINT
*pctinfo
)
384 HTMLRect
*This
= impl_from_IHTMLRect(iface
);
385 FIXME("(%p)->(%p)\n", This
, pctinfo
);
389 static HRESULT WINAPI
HTMLRect_GetTypeInfo(IHTMLRect
*iface
, UINT iTInfo
,
390 LCID lcid
, ITypeInfo
**ppTInfo
)
392 HTMLRect
*This
= impl_from_IHTMLRect(iface
);
394 return IDispatchEx_GetTypeInfo(&This
->dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
397 static HRESULT WINAPI
HTMLRect_GetIDsOfNames(IHTMLRect
*iface
, REFIID riid
,
398 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
400 HTMLRect
*This
= impl_from_IHTMLRect(iface
);
402 return IDispatchEx_GetIDsOfNames(&This
->dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
406 static HRESULT WINAPI
HTMLRect_Invoke(IHTMLRect
*iface
, DISPID dispIdMember
,
407 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
408 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
410 HTMLRect
*This
= impl_from_IHTMLRect(iface
);
412 return IDispatchEx_Invoke(&This
->dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
, wFlags
,
413 pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
416 static HRESULT WINAPI
HTMLRect_put_left(IHTMLRect
*iface
, LONG v
)
418 HTMLRect
*This
= impl_from_IHTMLRect(iface
);
419 FIXME("(%p)->(%d)\n", This
, v
);
423 static HRESULT WINAPI
HTMLRect_get_left(IHTMLRect
*iface
, LONG
*p
)
425 HTMLRect
*This
= impl_from_IHTMLRect(iface
);
429 TRACE("(%p)->(%p)\n", This
, p
);
431 nsres
= nsIDOMClientRect_GetLeft(This
->nsrect
, &left
);
432 if(NS_FAILED(nsres
)) {
433 ERR("GetLeft failed: %08x\n", nsres
);
437 *p
= floor(left
+0.5);
441 static HRESULT WINAPI
HTMLRect_put_top(IHTMLRect
*iface
, LONG v
)
443 HTMLRect
*This
= impl_from_IHTMLRect(iface
);
444 FIXME("(%p)->(%d)\n", This
, v
);
448 static HRESULT WINAPI
HTMLRect_get_top(IHTMLRect
*iface
, LONG
*p
)
450 HTMLRect
*This
= impl_from_IHTMLRect(iface
);
454 TRACE("(%p)->(%p)\n", This
, p
);
456 nsres
= nsIDOMClientRect_GetTop(This
->nsrect
, &top
);
457 if(NS_FAILED(nsres
)) {
458 ERR("GetTop failed: %08x\n", nsres
);
466 static HRESULT WINAPI
HTMLRect_put_right(IHTMLRect
*iface
, LONG v
)
468 HTMLRect
*This
= impl_from_IHTMLRect(iface
);
469 FIXME("(%p)->(%d)\n", This
, v
);
473 static HRESULT WINAPI
HTMLRect_get_right(IHTMLRect
*iface
, LONG
*p
)
475 HTMLRect
*This
= impl_from_IHTMLRect(iface
);
479 TRACE("(%p)->(%p)\n", This
, p
);
481 nsres
= nsIDOMClientRect_GetRight(This
->nsrect
, &right
);
482 if(NS_FAILED(nsres
)) {
483 ERR("GetRight failed: %08x\n", nsres
);
487 *p
= floor(right
+0.5);
491 static HRESULT WINAPI
HTMLRect_put_bottom(IHTMLRect
*iface
, LONG v
)
493 HTMLRect
*This
= impl_from_IHTMLRect(iface
);
494 FIXME("(%p)->(%d)\n", This
, v
);
498 static HRESULT WINAPI
HTMLRect_get_bottom(IHTMLRect
*iface
, LONG
*p
)
500 HTMLRect
*This
= impl_from_IHTMLRect(iface
);
504 TRACE("(%p)->(%p)\n", This
, p
);
506 nsres
= nsIDOMClientRect_GetBottom(This
->nsrect
, &bottom
);
507 if(NS_FAILED(nsres
)) {
508 ERR("GetBottom failed: %08x\n", nsres
);
512 *p
= floor(bottom
+0.5);
516 static const IHTMLRectVtbl HTMLRectVtbl
= {
517 HTMLRect_QueryInterface
,
520 HTMLRect_GetTypeInfoCount
,
521 HTMLRect_GetTypeInfo
,
522 HTMLRect_GetIDsOfNames
,
534 static const tid_t HTMLRect_iface_tids
[] = {
538 static dispex_static_data_t HTMLRect_dispex
= {
544 static HRESULT
create_html_rect(nsIDOMClientRect
*nsrect
, IHTMLRect
**ret
)
548 rect
= heap_alloc_zero(sizeof(HTMLRect
));
550 return E_OUTOFMEMORY
;
552 rect
->IHTMLRect_iface
.lpVtbl
= &HTMLRectVtbl
;
555 init_dispex(&rect
->dispex
, (IUnknown
*)&rect
->IHTMLRect_iface
, &HTMLRect_dispex
);
557 nsIDOMClientRect_AddRef(nsrect
);
558 rect
->nsrect
= nsrect
;
560 *ret
= &rect
->IHTMLRect_iface
;
564 static HRESULT WINAPI
HTMLElement_QueryInterface(IHTMLElement
*iface
,
565 REFIID riid
, void **ppv
)
567 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
569 return IHTMLDOMNode_QueryInterface(&This
->node
.IHTMLDOMNode_iface
, riid
, ppv
);
572 static ULONG WINAPI
HTMLElement_AddRef(IHTMLElement
*iface
)
574 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
576 return IHTMLDOMNode_AddRef(&This
->node
.IHTMLDOMNode_iface
);
579 static ULONG WINAPI
HTMLElement_Release(IHTMLElement
*iface
)
581 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
583 return IHTMLDOMNode_Release(&This
->node
.IHTMLDOMNode_iface
);
586 static HRESULT WINAPI
HTMLElement_GetTypeInfoCount(IHTMLElement
*iface
, UINT
*pctinfo
)
588 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
589 return IDispatchEx_GetTypeInfoCount(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
592 static HRESULT WINAPI
HTMLElement_GetTypeInfo(IHTMLElement
*iface
, UINT iTInfo
,
593 LCID lcid
, ITypeInfo
**ppTInfo
)
595 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
596 return IDispatchEx_GetTypeInfo(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
599 static HRESULT WINAPI
HTMLElement_GetIDsOfNames(IHTMLElement
*iface
, REFIID riid
,
600 LPOLESTR
*rgszNames
, UINT cNames
,
601 LCID lcid
, DISPID
*rgDispId
)
603 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
604 return IDispatchEx_GetIDsOfNames(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
608 static HRESULT WINAPI
HTMLElement_Invoke(IHTMLElement
*iface
, DISPID dispIdMember
,
609 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
610 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
612 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
613 return IDispatchEx_Invoke(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
614 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
617 static HRESULT
set_elem_attr_value_by_dispid(HTMLElement
*elem
, DISPID dispid
, VARIANT
*v
)
619 DISPID propput_dispid
= DISPID_PROPERTYPUT
;
620 DISPPARAMS dp
= {v
, &propput_dispid
, 1, 1};
623 if(dispid
== DISPID_IHTMLELEMENT_STYLE
) {
624 TRACE("Ignoring call on style attribute\n");
628 return IDispatchEx_InvokeEx(&elem
->node
.event_target
.dispex
.IDispatchEx_iface
, dispid
,
629 LOCALE_SYSTEM_DEFAULT
, DISPATCH_PROPERTYPUT
, &dp
, NULL
, &ei
, NULL
);
632 static HRESULT WINAPI
HTMLElement_setAttribute(IHTMLElement
*iface
, BSTR strAttributeName
,
633 VARIANT AttributeValue
, LONG lFlags
)
635 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
639 TRACE("(%p)->(%s %s %08x)\n", This
, debugstr_w(strAttributeName
), debugstr_variant(&AttributeValue
), lFlags
);
641 hres
= IDispatchEx_GetDispID(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, strAttributeName
,
642 (lFlags
&ATTRFLAG_CASESENSITIVE
? fdexNameCaseSensitive
: fdexNameCaseInsensitive
) | fdexNameEnsure
, &dispid
);
646 return set_elem_attr_value_by_dispid(This
, dispid
, &AttributeValue
);
649 HRESULT
get_elem_attr_value_by_dispid(HTMLElement
*elem
, DISPID dispid
, VARIANT
*ret
)
651 DISPPARAMS dispParams
= {NULL
, NULL
, 0, 0};
654 return IDispatchEx_InvokeEx(&elem
->node
.event_target
.dispex
.IDispatchEx_iface
, dispid
, LOCALE_SYSTEM_DEFAULT
,
655 DISPATCH_PROPERTYGET
, &dispParams
, ret
, &excep
, NULL
);
658 HRESULT
attr_value_to_string(VARIANT
*v
)
662 static const WCHAR nullW
[] = {'n','u','l','l',0};
668 V_BSTR(v
) = SysAllocString(nullW
);
670 return E_OUTOFMEMORY
;
674 IDispatch_Release(V_DISPATCH(v
));
676 V_BSTR(v
) = SysAllocString(NULL
);
679 hres
= VariantChangeType(v
, v
, 0, VT_BSTR
);
687 static HRESULT WINAPI
HTMLElement_getAttribute(IHTMLElement
*iface
, BSTR strAttributeName
,
688 LONG lFlags
, VARIANT
*AttributeValue
)
690 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
694 TRACE("(%p)->(%s %08x %p)\n", This
, debugstr_w(strAttributeName
), lFlags
, AttributeValue
);
696 if(lFlags
& ~(ATTRFLAG_CASESENSITIVE
|ATTRFLAG_ASSTRING
))
697 FIXME("Unsupported flags %x\n", lFlags
);
699 hres
= IDispatchEx_GetDispID(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, strAttributeName
,
700 lFlags
&ATTRFLAG_CASESENSITIVE
? fdexNameCaseSensitive
: fdexNameCaseInsensitive
, &dispid
);
701 if(hres
== DISP_E_UNKNOWNNAME
) {
702 V_VT(AttributeValue
) = VT_NULL
;
707 V_VT(AttributeValue
) = VT_NULL
;
711 hres
= get_elem_attr_value_by_dispid(This
, dispid
, AttributeValue
);
712 if(SUCCEEDED(hres
) && (lFlags
& ATTRFLAG_ASSTRING
))
713 hres
= attr_value_to_string(AttributeValue
);
717 static HRESULT WINAPI
HTMLElement_removeAttribute(IHTMLElement
*iface
, BSTR strAttributeName
,
718 LONG lFlags
, VARIANT_BOOL
*pfSuccess
)
720 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
724 TRACE("(%p)->(%s %x %p)\n", This
, debugstr_w(strAttributeName
), lFlags
, pfSuccess
);
726 hres
= IDispatchEx_GetDispID(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, strAttributeName
,
727 lFlags
&ATTRFLAG_CASESENSITIVE
? fdexNameCaseSensitive
: fdexNameCaseInsensitive
, &id
);
728 if(hres
== DISP_E_UNKNOWNNAME
) {
729 *pfSuccess
= VARIANT_FALSE
;
735 if(id
== DISPID_IHTMLELEMENT_STYLE
) {
738 TRACE("Special case: style\n");
740 hres
= IHTMLElement_get_style(&This
->IHTMLElement_iface
, &style
);
744 hres
= IHTMLStyle_put_cssText(style
, NULL
);
745 IHTMLStyle_Release(style
);
749 *pfSuccess
= VARIANT_TRUE
;
753 return remove_attribute(&This
->node
.event_target
.dispex
, id
, pfSuccess
);
756 static HRESULT WINAPI
HTMLElement_put_className(IHTMLElement
*iface
, BSTR v
)
758 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
759 nsAString classname_str
;
762 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
765 FIXME("NULL nselem\n");
769 nsAString_InitDepend(&classname_str
, v
);
770 nsres
= nsIDOMHTMLElement_SetClassName(This
->nselem
, &classname_str
);
771 nsAString_Finish(&classname_str
);
773 ERR("SetClassName failed: %08x\n", nsres
);
778 static HRESULT WINAPI
HTMLElement_get_className(IHTMLElement
*iface
, BSTR
*p
)
780 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
784 TRACE("(%p)->(%p)\n", This
, p
);
787 FIXME("NULL nselem\n");
791 nsAString_Init(&class_str
, NULL
);
792 nsres
= nsIDOMHTMLElement_GetClassName(This
->nselem
, &class_str
);
793 return return_nsstr(nsres
, &class_str
, p
);
796 static HRESULT WINAPI
HTMLElement_put_id(IHTMLElement
*iface
, BSTR v
)
798 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
802 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
805 FIXME("nselem == NULL\n");
809 nsAString_InitDepend(&id_str
, v
);
810 nsres
= nsIDOMHTMLElement_SetId(This
->nselem
, &id_str
);
811 nsAString_Finish(&id_str
);
813 ERR("SetId failed: %08x\n", nsres
);
818 static HRESULT WINAPI
HTMLElement_get_id(IHTMLElement
*iface
, BSTR
*p
)
820 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
824 TRACE("(%p)->(%p)\n", This
, p
);
831 nsAString_Init(&id_str
, NULL
);
832 nsres
= nsIDOMHTMLElement_GetId(This
->nselem
, &id_str
);
833 return return_nsstr(nsres
, &id_str
, p
);
836 static HRESULT WINAPI
HTMLElement_get_tagName(IHTMLElement
*iface
, BSTR
*p
)
838 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
842 TRACE("(%p)->(%p)\n", This
, p
);
845 static const WCHAR comment_tagW
[] = {'!',0};
847 WARN("NULL nselem, assuming comment\n");
849 *p
= SysAllocString(comment_tagW
);
850 return *p
? S_OK
: E_OUTOFMEMORY
;
853 nsAString_Init(&tag_str
, NULL
);
854 nsres
= nsIDOMHTMLElement_GetTagName(This
->nselem
, &tag_str
);
855 return return_nsstr(nsres
, &tag_str
, p
);
858 static HRESULT WINAPI
HTMLElement_get_parentElement(IHTMLElement
*iface
, IHTMLElement
**p
)
860 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
864 TRACE("(%p)->(%p)\n", This
, p
);
866 hres
= IHTMLDOMNode_get_parentNode(&This
->node
.IHTMLDOMNode_iface
, &node
);
875 hres
= IHTMLDOMNode_QueryInterface(node
, &IID_IHTMLElement
, (void**)p
);
876 IHTMLDOMNode_Release(node
);
883 static HRESULT WINAPI
HTMLElement_get_style(IHTMLElement
*iface
, IHTMLStyle
**p
)
885 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
887 TRACE("(%p)->(%p)\n", This
, p
);
892 hres
= HTMLStyle_Create(This
, &This
->style
);
897 *p
= &This
->style
->IHTMLStyle_iface
;
898 IHTMLStyle_AddRef(*p
);
902 static HRESULT WINAPI
HTMLElement_put_onhelp(IHTMLElement
*iface
, VARIANT v
)
904 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
906 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
908 return set_node_event(&This
->node
, EVENTID_HELP
, &v
);
911 static HRESULT WINAPI
HTMLElement_get_onhelp(IHTMLElement
*iface
, VARIANT
*p
)
913 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
915 TRACE("(%p)->(%p)\n", This
, p
);
917 return get_node_event(&This
->node
, EVENTID_HELP
, p
);
920 static HRESULT WINAPI
HTMLElement_put_onclick(IHTMLElement
*iface
, VARIANT v
)
922 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
924 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
926 return set_node_event(&This
->node
, EVENTID_CLICK
, &v
);
929 static HRESULT WINAPI
HTMLElement_get_onclick(IHTMLElement
*iface
, VARIANT
*p
)
931 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
933 TRACE("(%p)->(%p)\n", This
, p
);
935 return get_node_event(&This
->node
, EVENTID_CLICK
, p
);
938 static HRESULT WINAPI
HTMLElement_put_ondblclick(IHTMLElement
*iface
, VARIANT v
)
940 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
942 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
944 return set_node_event(&This
->node
, EVENTID_DBLCLICK
, &v
);
947 static HRESULT WINAPI
HTMLElement_get_ondblclick(IHTMLElement
*iface
, VARIANT
*p
)
949 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
951 TRACE("(%p)->(%p)\n", This
, p
);
953 return get_node_event(&This
->node
, EVENTID_DBLCLICK
, p
);
956 static HRESULT WINAPI
HTMLElement_put_onkeydown(IHTMLElement
*iface
, VARIANT v
)
958 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
960 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
962 return set_node_event(&This
->node
, EVENTID_KEYDOWN
, &v
);
965 static HRESULT WINAPI
HTMLElement_get_onkeydown(IHTMLElement
*iface
, VARIANT
*p
)
967 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
969 TRACE("(%p)->(%p)\n", This
, p
);
971 return get_node_event(&This
->node
, EVENTID_KEYDOWN
, p
);
974 static HRESULT WINAPI
HTMLElement_put_onkeyup(IHTMLElement
*iface
, VARIANT v
)
976 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
978 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
980 return set_node_event(&This
->node
, EVENTID_KEYUP
, &v
);
983 static HRESULT WINAPI
HTMLElement_get_onkeyup(IHTMLElement
*iface
, VARIANT
*p
)
985 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
987 TRACE("(%p)->(%p)\n", This
, p
);
989 return get_node_event(&This
->node
, EVENTID_KEYUP
, p
);
992 static HRESULT WINAPI
HTMLElement_put_onkeypress(IHTMLElement
*iface
, VARIANT v
)
994 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
996 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
998 return set_node_event(&This
->node
, EVENTID_KEYPRESS
, &v
);
1001 static HRESULT WINAPI
HTMLElement_get_onkeypress(IHTMLElement
*iface
, VARIANT
*p
)
1003 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1005 TRACE("(%p)->(%p)\n", This
, p
);
1007 return get_node_event(&This
->node
, EVENTID_KEYPRESS
, p
);
1010 static HRESULT WINAPI
HTMLElement_put_onmouseout(IHTMLElement
*iface
, VARIANT v
)
1012 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1014 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1016 return set_node_event(&This
->node
, EVENTID_MOUSEOUT
, &v
);
1019 static HRESULT WINAPI
HTMLElement_get_onmouseout(IHTMLElement
*iface
, VARIANT
*p
)
1021 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1023 TRACE("(%p)->(%p)\n", This
, p
);
1025 return get_node_event(&This
->node
, EVENTID_MOUSEOUT
, p
);
1028 static HRESULT WINAPI
HTMLElement_put_onmouseover(IHTMLElement
*iface
, VARIANT v
)
1030 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1032 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1034 return set_node_event(&This
->node
, EVENTID_MOUSEOVER
, &v
);
1037 static HRESULT WINAPI
HTMLElement_get_onmouseover(IHTMLElement
*iface
, VARIANT
*p
)
1039 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1041 TRACE("(%p)->(%p)\n", This
, p
);
1043 return get_node_event(&This
->node
, EVENTID_MOUSEOVER
, p
);
1046 static HRESULT WINAPI
HTMLElement_put_onmousemove(IHTMLElement
*iface
, VARIANT v
)
1048 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1050 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1052 return set_node_event(&This
->node
, EVENTID_MOUSEMOVE
, &v
);
1055 static HRESULT WINAPI
HTMLElement_get_onmousemove(IHTMLElement
*iface
, VARIANT
*p
)
1057 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1059 TRACE("(%p)->(%p)\n", This
, p
);
1061 return get_node_event(&This
->node
, EVENTID_MOUSEMOVE
, p
);
1064 static HRESULT WINAPI
HTMLElement_put_onmousedown(IHTMLElement
*iface
, VARIANT v
)
1066 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1068 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1070 return set_node_event(&This
->node
, EVENTID_MOUSEDOWN
, &v
);
1073 static HRESULT WINAPI
HTMLElement_get_onmousedown(IHTMLElement
*iface
, VARIANT
*p
)
1075 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1077 TRACE("(%p)->(%p)\n", This
, p
);
1079 return get_node_event(&This
->node
, EVENTID_MOUSEDOWN
, p
);
1082 static HRESULT WINAPI
HTMLElement_put_onmouseup(IHTMLElement
*iface
, VARIANT v
)
1084 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1086 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1088 return set_node_event(&This
->node
, EVENTID_MOUSEUP
, &v
);
1091 static HRESULT WINAPI
HTMLElement_get_onmouseup(IHTMLElement
*iface
, VARIANT
*p
)
1093 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1095 TRACE("(%p)->(%p)\n", This
, p
);
1097 return get_node_event(&This
->node
, EVENTID_MOUSEUP
, p
);
1100 static HRESULT WINAPI
HTMLElement_get_document(IHTMLElement
*iface
, IDispatch
**p
)
1102 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1104 TRACE("(%p)->(%p)\n", This
, p
);
1109 if(This
->node
.vtbl
->get_document
)
1110 return This
->node
.vtbl
->get_document(&This
->node
, p
);
1112 *p
= (IDispatch
*)&This
->node
.doc
->basedoc
.IHTMLDocument2_iface
;
1113 IDispatch_AddRef(*p
);
1117 static const WCHAR titleW
[] = {'t','i','t','l','e',0};
1119 static HRESULT WINAPI
HTMLElement_put_title(IHTMLElement
*iface
, BSTR v
)
1121 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1122 nsAString title_str
;
1125 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1131 hres
= dispex_get_dprop_ref(&This
->node
.event_target
.dispex
, titleW
, TRUE
, &var
);
1136 V_VT(var
) = VT_BSTR
;
1137 V_BSTR(var
) = v
? SysAllocString(v
) : NULL
;
1141 nsAString_InitDepend(&title_str
, v
);
1142 nsres
= nsIDOMHTMLElement_SetTitle(This
->nselem
, &title_str
);
1143 nsAString_Finish(&title_str
);
1144 if(NS_FAILED(nsres
))
1145 ERR("SetTitle failed: %08x\n", nsres
);
1150 static HRESULT WINAPI
HTMLElement_get_title(IHTMLElement
*iface
, BSTR
*p
)
1152 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1153 nsAString title_str
;
1156 TRACE("(%p)->(%p)\n", This
, p
);
1162 hres
= dispex_get_dprop_ref(&This
->node
.event_target
.dispex
, titleW
, FALSE
, &var
);
1163 if(hres
== DISP_E_UNKNOWNNAME
) {
1165 }else if(V_VT(var
) != VT_BSTR
) {
1166 FIXME("title = %s\n", debugstr_variant(var
));
1169 *p
= V_BSTR(var
) ? SysAllocString(V_BSTR(var
)) : NULL
;
1175 nsAString_Init(&title_str
, NULL
);
1176 nsres
= nsIDOMHTMLElement_GetTitle(This
->nselem
, &title_str
);
1177 return return_nsstr(nsres
, &title_str
, p
);
1180 static const WCHAR languageW
[] = {'l','a','n','g','u','a','g','e',0};
1182 static HRESULT WINAPI
HTMLElement_put_language(IHTMLElement
*iface
, BSTR v
)
1184 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1186 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1188 return elem_string_attr_setter(This
, languageW
, v
);
1191 static HRESULT WINAPI
HTMLElement_get_language(IHTMLElement
*iface
, BSTR
*p
)
1193 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1195 TRACE("(%p)->(%p)\n", This
, p
);
1197 return elem_string_attr_getter(This
, languageW
, TRUE
, p
);
1200 static HRESULT WINAPI
HTMLElement_put_onselectstart(IHTMLElement
*iface
, VARIANT v
)
1202 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1204 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1206 return set_node_event(&This
->node
, EVENTID_SELECTSTART
, &v
);
1209 static HRESULT WINAPI
HTMLElement_get_onselectstart(IHTMLElement
*iface
, VARIANT
*p
)
1211 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1213 TRACE("(%p)->(%p)\n", This
, p
);
1215 return get_node_event(&This
->node
, EVENTID_SELECTSTART
, p
);
1218 static HRESULT WINAPI
HTMLElement_scrollIntoView(IHTMLElement
*iface
, VARIANT varargStart
)
1220 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1221 cpp_bool start
= TRUE
;
1224 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&varargStart
));
1226 switch(V_VT(&varargStart
)) {
1231 start
= V_BOOL(&varargStart
) != VARIANT_FALSE
;
1234 FIXME("Unsupported argument %s\n", debugstr_variant(&varargStart
));
1238 FIXME("Unsupported for comments\n");
1242 nsres
= nsIDOMHTMLElement_ScrollIntoView(This
->nselem
, start
, 1);
1243 assert(nsres
== NS_OK
);
1248 static HRESULT WINAPI
HTMLElement_contains(IHTMLElement
*iface
, IHTMLElement
*pChild
,
1249 VARIANT_BOOL
*pfResult
)
1251 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1252 cpp_bool result
= FALSE
;
1254 TRACE("(%p)->(%p %p)\n", This
, pChild
, pfResult
);
1260 child
= unsafe_impl_from_IHTMLElement(pChild
);
1262 ERR("not our element\n");
1266 nsres
= nsIDOMNode_Contains(This
->node
.nsnode
, child
->node
.nsnode
, &result
);
1267 assert(nsres
== NS_OK
);
1270 *pfResult
= result
? VARIANT_TRUE
: VARIANT_FALSE
;
1274 static HRESULT WINAPI
HTMLElement_get_sourceIndex(IHTMLElement
*iface
, LONG
*p
)
1276 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1278 TRACE("(%p)->(%p)\n", This
, p
);
1280 return get_elem_source_index(This
, p
);
1283 static HRESULT WINAPI
HTMLElement_get_recordNumber(IHTMLElement
*iface
, VARIANT
*p
)
1285 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1286 FIXME("(%p)->(%p)\n", This
, p
);
1290 static HRESULT WINAPI
HTMLElement_put_lang(IHTMLElement
*iface
, BSTR v
)
1292 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1296 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1299 FIXME("NULL nselem\n");
1303 nsAString_InitDepend(&nsstr
, v
);
1304 nsres
= nsIDOMHTMLElement_SetLang(This
->nselem
, &nsstr
);
1305 nsAString_Finish(&nsstr
);
1306 if(NS_FAILED(nsres
)) {
1307 ERR("SetLang failed: %08x\n", nsres
);
1314 static HRESULT WINAPI
HTMLElement_get_lang(IHTMLElement
*iface
, BSTR
*p
)
1316 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1320 TRACE("(%p)->(%p)\n", This
, p
);
1323 FIXME("NULL nselem\n");
1327 nsAString_Init(&nsstr
, NULL
);
1328 nsres
= nsIDOMHTMLElement_GetLang(This
->nselem
, &nsstr
);
1329 return return_nsstr(nsres
, &nsstr
, p
);
1332 static HRESULT WINAPI
HTMLElement_get_offsetLeft(IHTMLElement
*iface
, LONG
*p
)
1334 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1337 TRACE("(%p)->(%p)\n", This
, p
);
1339 nsres
= nsIDOMHTMLElement_GetOffsetLeft(This
->nselem
, p
);
1340 if(NS_FAILED(nsres
)) {
1341 ERR("GetOffsetLeft failed: %08x\n", nsres
);
1348 static HRESULT WINAPI
HTMLElement_get_offsetTop(IHTMLElement
*iface
, LONG
*p
)
1350 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1353 TRACE("(%p)->(%p)\n", This
, p
);
1355 nsres
= nsIDOMHTMLElement_GetOffsetTop(This
->nselem
, p
);
1356 if(NS_FAILED(nsres
)) {
1357 ERR("GetOffsetTop failed: %08x\n", nsres
);
1364 static HRESULT WINAPI
HTMLElement_get_offsetWidth(IHTMLElement
*iface
, LONG
*p
)
1366 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1369 TRACE("(%p)->(%p)\n", This
, p
);
1371 nsres
= nsIDOMHTMLElement_GetOffsetWidth(This
->nselem
, p
);
1372 if(NS_FAILED(nsres
)) {
1373 ERR("GetOffsetWidth failed: %08x\n", nsres
);
1380 static HRESULT WINAPI
HTMLElement_get_offsetHeight(IHTMLElement
*iface
, LONG
*p
)
1382 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1385 TRACE("(%p)->(%p)\n", This
, p
);
1387 nsres
= nsIDOMHTMLElement_GetOffsetHeight(This
->nselem
, p
);
1388 if(NS_FAILED(nsres
)) {
1389 ERR("GetOffsetHeight failed: %08x\n", nsres
);
1396 static HRESULT WINAPI
HTMLElement_get_offsetParent(IHTMLElement
*iface
, IHTMLElement
**p
)
1398 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1399 nsIDOMElement
*nsparent
;
1403 TRACE("(%p)->(%p)\n", This
, p
);
1405 nsres
= nsIDOMHTMLElement_GetOffsetParent(This
->nselem
, &nsparent
);
1406 if(NS_FAILED(nsres
)) {
1407 ERR("GetOffsetParent failed: %08x\n", nsres
);
1414 hres
= get_node(This
->node
.doc
, (nsIDOMNode
*)nsparent
, TRUE
, &node
);
1415 nsIDOMElement_Release(nsparent
);
1419 hres
= IHTMLDOMNode_QueryInterface(&node
->IHTMLDOMNode_iface
, &IID_IHTMLElement
, (void**)p
);
1429 static HRESULT WINAPI
HTMLElement_put_innerHTML(IHTMLElement
*iface
, BSTR v
)
1431 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1435 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1438 FIXME("NULL nselem\n");
1442 nsAString_InitDepend(&html_str
, v
);
1443 nsres
= nsIDOMHTMLElement_SetInnerHTML(This
->nselem
, &html_str
);
1444 nsAString_Finish(&html_str
);
1445 if(NS_FAILED(nsres
)) {
1446 FIXME("SetInnerHtml failed %08x\n", nsres
);
1453 static HRESULT WINAPI
HTMLElement_get_innerHTML(IHTMLElement
*iface
, BSTR
*p
)
1455 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1459 TRACE("(%p)->(%p)\n", This
, p
);
1462 FIXME("NULL nselem\n");
1466 nsAString_Init(&html_str
, NULL
);
1467 nsres
= nsIDOMHTMLElement_GetInnerHTML(This
->nselem
, &html_str
);
1468 return return_nsstr(nsres
, &html_str
, p
);
1471 static HRESULT WINAPI
HTMLElement_put_innerText(IHTMLElement
*iface
, BSTR v
)
1473 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1474 nsIDOMNode
*nschild
, *tmp
;
1475 nsIDOMText
*text_node
;
1479 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1482 nsres
= nsIDOMHTMLElement_GetLastChild(This
->nselem
, &nschild
);
1483 if(NS_FAILED(nsres
)) {
1484 ERR("GetLastChild failed: %08x\n", nsres
);
1490 nsres
= nsIDOMHTMLElement_RemoveChild(This
->nselem
, nschild
, &tmp
);
1491 nsIDOMNode_Release(nschild
);
1492 if(NS_FAILED(nsres
)) {
1493 ERR("RemoveChild failed: %08x\n", nsres
);
1496 nsIDOMNode_Release(tmp
);
1499 nsAString_InitDepend(&text_str
, v
);
1500 nsres
= nsIDOMHTMLDocument_CreateTextNode(This
->node
.doc
->nsdoc
, &text_str
, &text_node
);
1501 nsAString_Finish(&text_str
);
1502 if(NS_FAILED(nsres
)) {
1503 ERR("CreateTextNode failed: %08x\n", nsres
);
1507 nsres
= nsIDOMHTMLElement_AppendChild(This
->nselem
, (nsIDOMNode
*)text_node
, &tmp
);
1508 if(NS_FAILED(nsres
)) {
1509 ERR("AppendChild failed: %08x\n", nsres
);
1513 nsIDOMNode_Release(tmp
);
1517 static HRESULT WINAPI
HTMLElement_get_innerText(IHTMLElement
*iface
, BSTR
*p
)
1519 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1521 TRACE("(%p)->(%p)\n", This
, p
);
1523 return get_node_text(&This
->node
, p
);
1526 static HRESULT WINAPI
HTMLElement_put_outerHTML(IHTMLElement
*iface
, BSTR v
)
1528 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1530 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1532 return replace_node_by_html(This
->node
.doc
->nsdoc
, This
->node
.nsnode
, v
);
1535 static HRESULT WINAPI
HTMLElement_get_outerHTML(IHTMLElement
*iface
, BSTR
*p
)
1537 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1541 WARN("(%p)->(%p) semi-stub\n", This
, p
);
1543 nsAString_Init(&html_str
, NULL
);
1544 hres
= nsnode_to_nsstring(This
->node
.nsnode
, &html_str
);
1545 if(SUCCEEDED(hres
)) {
1546 const PRUnichar
*html
;
1548 nsAString_GetData(&html_str
, &html
);
1549 *p
= SysAllocString(html
);
1551 hres
= E_OUTOFMEMORY
;
1554 nsAString_Finish(&html_str
);
1556 TRACE("ret %s\n", debugstr_w(*p
));
1560 static HRESULT WINAPI
HTMLElement_put_outerText(IHTMLElement
*iface
, BSTR v
)
1562 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1563 nsIDOMText
*text_node
;
1568 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1570 if(This
->node
.vtbl
->is_settable
&& !This
->node
.vtbl
->is_settable(&This
->node
, DISPID_IHTMLELEMENT_OUTERTEXT
)) {
1571 WARN("Called on element that does not support setting the property.\n");
1572 return 0x800a0258; /* undocumented error code */
1575 if(!This
->node
.doc
->nsdoc
) {
1576 FIXME("NULL nsdoc\n");
1580 nsAString_InitDepend(&nsstr
, v
);
1581 nsres
= nsIDOMHTMLDocument_CreateTextNode(This
->node
.doc
->nsdoc
, &nsstr
, &text_node
);
1582 nsAString_Finish(&nsstr
);
1583 if(NS_FAILED(nsres
)) {
1584 ERR("CreateTextNode failed\n");
1588 nsres
= nsIDOMHTMLDocument_CreateRange(This
->node
.doc
->nsdoc
, &range
);
1589 if(NS_SUCCEEDED(nsres
)) {
1590 nsres
= nsIDOMRange_SelectNode(range
, This
->node
.nsnode
);
1591 if(NS_SUCCEEDED(nsres
))
1592 nsres
= nsIDOMRange_DeleteContents(range
);
1593 if(NS_SUCCEEDED(nsres
))
1594 nsres
= nsIDOMRange_InsertNode(range
, (nsIDOMNode
*)text_node
);
1595 if(NS_SUCCEEDED(nsres
))
1596 nsres
= nsIDOMRange_SelectNodeContents(range
, This
->node
.nsnode
);
1597 if(NS_SUCCEEDED(nsres
))
1598 nsres
= nsIDOMRange_DeleteContents(range
);
1599 nsIDOMRange_Release(range
);
1601 nsIDOMText_Release(text_node
);
1602 if(NS_FAILED(nsres
)) {
1603 ERR("failed to set text: %08x\n", nsres
);
1610 static HRESULT WINAPI
HTMLElement_get_outerText(IHTMLElement
*iface
, BSTR
*p
)
1612 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1614 TRACE("(%p)->(%p)\n", This
, p
);
1616 /* getter is the same as innerText */
1617 return IHTMLElement_get_innerText(&This
->IHTMLElement_iface
, p
);
1620 static HRESULT
insert_adjacent_node(HTMLElement
*This
, const WCHAR
*where
, nsIDOMNode
*nsnode
, HTMLDOMNode
**ret_node
)
1622 nsIDOMNode
*ret_nsnode
;
1624 HRESULT hres
= S_OK
;
1626 static const WCHAR beforebeginW
[] = {'b','e','f','o','r','e','b','e','g','i','n',0};
1627 static const WCHAR afterbeginW
[] = {'a','f','t','e','r','b','e','g','i','n',0};
1628 static const WCHAR beforeendW
[] = {'b','e','f','o','r','e','e','n','d',0};
1629 static const WCHAR afterendW
[] = {'a','f','t','e','r','e','n','d',0};
1631 if (!strcmpiW(where
, beforebeginW
)) {
1634 nsres
= nsIDOMNode_GetParentNode(This
->node
.nsnode
, &parent
);
1635 if(NS_FAILED(nsres
))
1639 return E_INVALIDARG
;
1641 nsres
= nsIDOMNode_InsertBefore(parent
, nsnode
, This
->node
.nsnode
, &ret_nsnode
);
1642 nsIDOMNode_Release(parent
);
1643 }else if(!strcmpiW(where
, afterbeginW
)) {
1644 nsIDOMNode
*first_child
;
1646 nsres
= nsIDOMNode_GetFirstChild(This
->node
.nsnode
, &first_child
);
1647 if(NS_FAILED(nsres
))
1650 nsres
= nsIDOMNode_InsertBefore(This
->node
.nsnode
, nsnode
, first_child
, &ret_nsnode
);
1651 if(NS_FAILED(nsres
))
1655 nsIDOMNode_Release(first_child
);
1656 }else if (!strcmpiW(where
, beforeendW
)) {
1657 nsres
= nsIDOMNode_AppendChild(This
->node
.nsnode
, nsnode
, &ret_nsnode
);
1658 }else if (!strcmpiW(where
, afterendW
)) {
1659 nsIDOMNode
*next_sibling
, *parent
;
1661 nsres
= nsIDOMNode_GetParentNode(This
->node
.nsnode
, &parent
);
1662 if(NS_FAILED(nsres
))
1665 return E_INVALIDARG
;
1667 nsres
= nsIDOMNode_GetNextSibling(This
->node
.nsnode
, &next_sibling
);
1668 if(NS_SUCCEEDED(nsres
)) {
1670 nsres
= nsIDOMNode_InsertBefore(parent
, nsnode
, next_sibling
, &ret_nsnode
);
1671 nsIDOMNode_Release(next_sibling
);
1673 nsres
= nsIDOMNode_AppendChild(parent
, nsnode
, &ret_nsnode
);
1677 nsIDOMNode_Release(parent
);
1679 ERR("invalid where: %s\n", debugstr_w(where
));
1680 return E_INVALIDARG
;
1683 if (NS_FAILED(nsres
))
1687 hres
= get_node(This
->node
.doc
, ret_nsnode
, TRUE
, ret_node
);
1688 nsIDOMNode_Release(ret_nsnode
);
1692 static HRESULT WINAPI
HTMLElement_insertAdjacentHTML(IHTMLElement
*iface
, BSTR where
,
1695 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1702 TRACE("(%p)->(%s %s)\n", This
, debugstr_w(where
), debugstr_w(html
));
1704 if(!This
->node
.doc
->nsdoc
) {
1705 WARN("NULL nsdoc\n");
1706 return E_UNEXPECTED
;
1709 nsres
= nsIDOMHTMLDocument_CreateRange(This
->node
.doc
->nsdoc
, &range
);
1710 if(NS_FAILED(nsres
))
1712 ERR("CreateRange failed: %08x\n", nsres
);
1716 nsIDOMRange_SetStartBefore(range
, This
->node
.nsnode
);
1718 nsAString_InitDepend(&ns_html
, html
);
1719 nsres
= nsIDOMRange_CreateContextualFragment(range
, &ns_html
, (nsIDOMDocumentFragment
**)&nsnode
);
1720 nsAString_Finish(&ns_html
);
1721 nsIDOMRange_Release(range
);
1723 if(NS_FAILED(nsres
) || !nsnode
)
1725 ERR("CreateTextNode failed: %08x\n", nsres
);
1729 hr
= insert_adjacent_node(This
, where
, nsnode
, NULL
);
1730 nsIDOMNode_Release(nsnode
);
1734 static HRESULT WINAPI
HTMLElement_insertAdjacentText(IHTMLElement
*iface
, BSTR where
,
1737 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1743 TRACE("(%p)->(%s %s)\n", This
, debugstr_w(where
), debugstr_w(text
));
1745 if(!This
->node
.doc
->nsdoc
) {
1746 WARN("NULL nsdoc\n");
1747 return E_UNEXPECTED
;
1751 nsAString_InitDepend(&ns_text
, text
);
1752 nsres
= nsIDOMHTMLDocument_CreateTextNode(This
->node
.doc
->nsdoc
, &ns_text
, (nsIDOMText
**)&nsnode
);
1753 nsAString_Finish(&ns_text
);
1755 if(NS_FAILED(nsres
) || !nsnode
)
1757 ERR("CreateTextNode failed: %08x\n", nsres
);
1761 hr
= insert_adjacent_node(This
, where
, nsnode
, NULL
);
1762 nsIDOMNode_Release(nsnode
);
1767 static HRESULT WINAPI
HTMLElement_get_parentTextEdit(IHTMLElement
*iface
, IHTMLElement
**p
)
1769 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1770 FIXME("(%p)->(%p)\n", This
, p
);
1774 static HRESULT WINAPI
HTMLElement_get_isTextEdit(IHTMLElement
*iface
, VARIANT_BOOL
*p
)
1776 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1778 TRACE("(%p)->(%p)\n", This
, p
);
1780 *p
= This
->node
.vtbl
->is_text_edit
&& This
->node
.vtbl
->is_text_edit(&This
->node
)
1781 ? VARIANT_TRUE
: VARIANT_FALSE
;
1785 static HRESULT WINAPI
HTMLElement_click(IHTMLElement
*iface
)
1787 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1790 TRACE("(%p)\n", This
);
1793 FIXME("not implemented for comments\n");
1797 nsres
= nsIDOMHTMLElement_Click(This
->nselem
);
1798 if(NS_FAILED(nsres
)) {
1799 ERR("Click failed: %08x\n", nsres
);
1806 static HRESULT WINAPI
HTMLElement_get_filters(IHTMLElement
*iface
,
1807 IHTMLFiltersCollection
**p
)
1809 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1810 TRACE("(%p)->(%p)\n", This
, p
);
1815 *p
= HTMLFiltersCollection_Create();
1820 static HRESULT WINAPI
HTMLElement_put_ondragstart(IHTMLElement
*iface
, VARIANT v
)
1822 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1824 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1826 return set_node_event(&This
->node
, EVENTID_DRAGSTART
, &v
);
1829 static HRESULT WINAPI
HTMLElement_get_ondragstart(IHTMLElement
*iface
, VARIANT
*p
)
1831 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1833 TRACE("(%p)->(%p)\n", This
, p
);
1835 return get_node_event(&This
->node
, EVENTID_DRAGSTART
, p
);
1838 static HRESULT WINAPI
HTMLElement_toString(IHTMLElement
*iface
, BSTR
*String
)
1840 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1841 FIXME("(%p)->(%p)\n", This
, String
);
1845 static HRESULT WINAPI
HTMLElement_put_onbeforeupdate(IHTMLElement
*iface
, VARIANT v
)
1847 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1848 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1852 static HRESULT WINAPI
HTMLElement_get_onbeforeupdate(IHTMLElement
*iface
, VARIANT
*p
)
1854 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1855 FIXME("(%p)->(%p)\n", This
, p
);
1859 static HRESULT WINAPI
HTMLElement_put_onafterupdate(IHTMLElement
*iface
, VARIANT v
)
1861 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1862 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1866 static HRESULT WINAPI
HTMLElement_get_onafterupdate(IHTMLElement
*iface
, VARIANT
*p
)
1868 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1869 FIXME("(%p)->(%p)\n", This
, p
);
1873 static HRESULT WINAPI
HTMLElement_put_onerrorupdate(IHTMLElement
*iface
, VARIANT v
)
1875 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1876 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1880 static HRESULT WINAPI
HTMLElement_get_onerrorupdate(IHTMLElement
*iface
, VARIANT
*p
)
1882 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1883 FIXME("(%p)->(%p)\n", This
, p
);
1887 static HRESULT WINAPI
HTMLElement_put_onrowexit(IHTMLElement
*iface
, VARIANT v
)
1889 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1890 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1894 static HRESULT WINAPI
HTMLElement_get_onrowexit(IHTMLElement
*iface
, VARIANT
*p
)
1896 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1897 FIXME("(%p)->(%p)\n", This
, p
);
1901 static HRESULT WINAPI
HTMLElement_put_onrowenter(IHTMLElement
*iface
, VARIANT v
)
1903 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1904 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1908 static HRESULT WINAPI
HTMLElement_get_onrowenter(IHTMLElement
*iface
, VARIANT
*p
)
1910 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1911 FIXME("(%p)->(%p)\n", This
, p
);
1915 static HRESULT WINAPI
HTMLElement_put_ondatasetchanged(IHTMLElement
*iface
, VARIANT v
)
1917 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1918 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1922 static HRESULT WINAPI
HTMLElement_get_ondatasetchanged(IHTMLElement
*iface
, VARIANT
*p
)
1924 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1925 FIXME("(%p)->(%p)\n", This
, p
);
1929 static HRESULT WINAPI
HTMLElement_put_ondataavailable(IHTMLElement
*iface
, VARIANT v
)
1931 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1933 FIXME("(%p)->(%s) semi-stub\n", This
, debugstr_variant(&v
));
1935 return set_node_event(&This
->node
, EVENTID_DATAAVAILABLE
, &v
);
1938 static HRESULT WINAPI
HTMLElement_get_ondataavailable(IHTMLElement
*iface
, VARIANT
*p
)
1940 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1942 TRACE("(%p)->(%p)\n", This
, p
);
1944 return get_node_event(&This
->node
, EVENTID_DATAAVAILABLE
, p
);
1947 static HRESULT WINAPI
HTMLElement_put_ondatasetcomplete(IHTMLElement
*iface
, VARIANT v
)
1949 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1950 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1954 static HRESULT WINAPI
HTMLElement_get_ondatasetcomplete(IHTMLElement
*iface
, VARIANT
*p
)
1956 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1957 FIXME("(%p)->(%p)\n", This
, p
);
1961 static HRESULT WINAPI
HTMLElement_put_onfilterchange(IHTMLElement
*iface
, VARIANT v
)
1963 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1964 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1968 static HRESULT WINAPI
HTMLElement_get_onfilterchange(IHTMLElement
*iface
, VARIANT
*p
)
1970 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1971 FIXME("(%p)->(%p)\n", This
, p
);
1975 static HRESULT WINAPI
HTMLElement_get_children(IHTMLElement
*iface
, IDispatch
**p
)
1977 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1978 nsIDOMNodeList
*nsnode_list
;
1981 TRACE("(%p)->(%p)\n", This
, p
);
1983 nsres
= nsIDOMNode_GetChildNodes(This
->node
.nsnode
, &nsnode_list
);
1984 if(NS_FAILED(nsres
)) {
1985 ERR("GetChildNodes failed: %08x\n", nsres
);
1989 *p
= (IDispatch
*)create_collection_from_nodelist(This
->node
.doc
, nsnode_list
);
1991 nsIDOMNodeList_Release(nsnode_list
);
1995 static HRESULT WINAPI
HTMLElement_get_all(IHTMLElement
*iface
, IDispatch
**p
)
1997 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1999 TRACE("(%p)->(%p)\n", This
, p
);
2001 *p
= (IDispatch
*)create_all_collection(&This
->node
, FALSE
);
2005 static const IHTMLElementVtbl HTMLElementVtbl
= {
2006 HTMLElement_QueryInterface
,
2008 HTMLElement_Release
,
2009 HTMLElement_GetTypeInfoCount
,
2010 HTMLElement_GetTypeInfo
,
2011 HTMLElement_GetIDsOfNames
,
2013 HTMLElement_setAttribute
,
2014 HTMLElement_getAttribute
,
2015 HTMLElement_removeAttribute
,
2016 HTMLElement_put_className
,
2017 HTMLElement_get_className
,
2020 HTMLElement_get_tagName
,
2021 HTMLElement_get_parentElement
,
2022 HTMLElement_get_style
,
2023 HTMLElement_put_onhelp
,
2024 HTMLElement_get_onhelp
,
2025 HTMLElement_put_onclick
,
2026 HTMLElement_get_onclick
,
2027 HTMLElement_put_ondblclick
,
2028 HTMLElement_get_ondblclick
,
2029 HTMLElement_put_onkeydown
,
2030 HTMLElement_get_onkeydown
,
2031 HTMLElement_put_onkeyup
,
2032 HTMLElement_get_onkeyup
,
2033 HTMLElement_put_onkeypress
,
2034 HTMLElement_get_onkeypress
,
2035 HTMLElement_put_onmouseout
,
2036 HTMLElement_get_onmouseout
,
2037 HTMLElement_put_onmouseover
,
2038 HTMLElement_get_onmouseover
,
2039 HTMLElement_put_onmousemove
,
2040 HTMLElement_get_onmousemove
,
2041 HTMLElement_put_onmousedown
,
2042 HTMLElement_get_onmousedown
,
2043 HTMLElement_put_onmouseup
,
2044 HTMLElement_get_onmouseup
,
2045 HTMLElement_get_document
,
2046 HTMLElement_put_title
,
2047 HTMLElement_get_title
,
2048 HTMLElement_put_language
,
2049 HTMLElement_get_language
,
2050 HTMLElement_put_onselectstart
,
2051 HTMLElement_get_onselectstart
,
2052 HTMLElement_scrollIntoView
,
2053 HTMLElement_contains
,
2054 HTMLElement_get_sourceIndex
,
2055 HTMLElement_get_recordNumber
,
2056 HTMLElement_put_lang
,
2057 HTMLElement_get_lang
,
2058 HTMLElement_get_offsetLeft
,
2059 HTMLElement_get_offsetTop
,
2060 HTMLElement_get_offsetWidth
,
2061 HTMLElement_get_offsetHeight
,
2062 HTMLElement_get_offsetParent
,
2063 HTMLElement_put_innerHTML
,
2064 HTMLElement_get_innerHTML
,
2065 HTMLElement_put_innerText
,
2066 HTMLElement_get_innerText
,
2067 HTMLElement_put_outerHTML
,
2068 HTMLElement_get_outerHTML
,
2069 HTMLElement_put_outerText
,
2070 HTMLElement_get_outerText
,
2071 HTMLElement_insertAdjacentHTML
,
2072 HTMLElement_insertAdjacentText
,
2073 HTMLElement_get_parentTextEdit
,
2074 HTMLElement_get_isTextEdit
,
2076 HTMLElement_get_filters
,
2077 HTMLElement_put_ondragstart
,
2078 HTMLElement_get_ondragstart
,
2079 HTMLElement_toString
,
2080 HTMLElement_put_onbeforeupdate
,
2081 HTMLElement_get_onbeforeupdate
,
2082 HTMLElement_put_onafterupdate
,
2083 HTMLElement_get_onafterupdate
,
2084 HTMLElement_put_onerrorupdate
,
2085 HTMLElement_get_onerrorupdate
,
2086 HTMLElement_put_onrowexit
,
2087 HTMLElement_get_onrowexit
,
2088 HTMLElement_put_onrowenter
,
2089 HTMLElement_get_onrowenter
,
2090 HTMLElement_put_ondatasetchanged
,
2091 HTMLElement_get_ondatasetchanged
,
2092 HTMLElement_put_ondataavailable
,
2093 HTMLElement_get_ondataavailable
,
2094 HTMLElement_put_ondatasetcomplete
,
2095 HTMLElement_get_ondatasetcomplete
,
2096 HTMLElement_put_onfilterchange
,
2097 HTMLElement_get_onfilterchange
,
2098 HTMLElement_get_children
,
2102 HTMLElement
*unsafe_impl_from_IHTMLElement(IHTMLElement
*iface
)
2104 return iface
->lpVtbl
== &HTMLElementVtbl
? impl_from_IHTMLElement(iface
) : NULL
;
2107 static inline HTMLElement
*impl_from_IHTMLElement2(IHTMLElement2
*iface
)
2109 return CONTAINING_RECORD(iface
, HTMLElement
, IHTMLElement2_iface
);
2112 static HRESULT WINAPI
HTMLElement2_QueryInterface(IHTMLElement2
*iface
,
2113 REFIID riid
, void **ppv
)
2115 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2116 return IHTMLElement_QueryInterface(&This
->IHTMLElement_iface
, riid
, ppv
);
2119 static ULONG WINAPI
HTMLElement2_AddRef(IHTMLElement2
*iface
)
2121 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2122 return IHTMLElement_AddRef(&This
->IHTMLElement_iface
);
2125 static ULONG WINAPI
HTMLElement2_Release(IHTMLElement2
*iface
)
2127 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2128 return IHTMLElement_Release(&This
->IHTMLElement_iface
);
2131 static HRESULT WINAPI
HTMLElement2_GetTypeInfoCount(IHTMLElement2
*iface
, UINT
*pctinfo
)
2133 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2134 return IDispatchEx_GetTypeInfoCount(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
2137 static HRESULT WINAPI
HTMLElement2_GetTypeInfo(IHTMLElement2
*iface
, UINT iTInfo
,
2138 LCID lcid
, ITypeInfo
**ppTInfo
)
2140 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2141 return IDispatchEx_GetTypeInfo(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
2144 static HRESULT WINAPI
HTMLElement2_GetIDsOfNames(IHTMLElement2
*iface
, REFIID riid
,
2145 LPOLESTR
*rgszNames
, UINT cNames
,
2146 LCID lcid
, DISPID
*rgDispId
)
2148 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2149 return IDispatchEx_GetIDsOfNames(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
2153 static HRESULT WINAPI
HTMLElement2_Invoke(IHTMLElement2
*iface
, DISPID dispIdMember
,
2154 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
2155 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
2157 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2158 return IDispatchEx_Invoke(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
2159 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
2162 static HRESULT WINAPI
HTMLElement2_get_scopeName(IHTMLElement2
*iface
, BSTR
*p
)
2164 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2165 FIXME("(%p)->(%p)\n", This
, p
);
2169 static HRESULT WINAPI
HTMLElement2_setCapture(IHTMLElement2
*iface
, VARIANT_BOOL containerCapture
)
2171 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2172 FIXME("(%p)->(%x)\n", This
, containerCapture
);
2176 static HRESULT WINAPI
HTMLElement2_releaseCapture(IHTMLElement2
*iface
)
2178 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2179 FIXME("(%p)\n", This
);
2183 static HRESULT WINAPI
HTMLElement2_put_onlosecapture(IHTMLElement2
*iface
, VARIANT v
)
2185 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2186 FIXME("(%p)->()\n", This
);
2190 static HRESULT WINAPI
HTMLElement2_get_onlosecapture(IHTMLElement2
*iface
, VARIANT
*p
)
2192 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2193 FIXME("(%p)->(%p)\n", This
, p
);
2197 static HRESULT WINAPI
HTMLElement2_componentFromPoint(IHTMLElement2
*iface
,
2198 LONG x
, LONG y
, BSTR
*component
)
2200 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2201 FIXME("(%p)->(%d %d %p)\n", This
, x
, y
, component
);
2205 static HRESULT WINAPI
HTMLElement2_doScroll(IHTMLElement2
*iface
, VARIANT component
)
2207 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2209 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&component
));
2211 if(!This
->node
.doc
->content_ready
2212 || !This
->node
.doc
->basedoc
.doc_obj
->in_place_active
)
2219 static HRESULT WINAPI
HTMLElement2_put_onscroll(IHTMLElement2
*iface
, VARIANT v
)
2221 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2223 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2225 return set_node_event(&This
->node
, EVENTID_SCROLL
, &v
);
2228 static HRESULT WINAPI
HTMLElement2_get_onscroll(IHTMLElement2
*iface
, VARIANT
*p
)
2230 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2232 TRACE("(%p)->(%p)\n", This
, p
);
2234 return get_node_event(&This
->node
, EVENTID_SCROLL
, p
);
2237 static HRESULT WINAPI
HTMLElement2_put_ondrag(IHTMLElement2
*iface
, VARIANT v
)
2239 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2241 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2243 return set_node_event(&This
->node
, EVENTID_DRAG
, &v
);
2246 static HRESULT WINAPI
HTMLElement2_get_ondrag(IHTMLElement2
*iface
, VARIANT
*p
)
2248 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2250 TRACE("(%p)->(%p)\n", This
, p
);
2252 return get_node_event(&This
->node
, EVENTID_DRAG
, p
);
2255 static HRESULT WINAPI
HTMLElement2_put_ondragend(IHTMLElement2
*iface
, VARIANT v
)
2257 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2258 FIXME("(%p)->()\n", This
);
2262 static HRESULT WINAPI
HTMLElement2_get_ondragend(IHTMLElement2
*iface
, VARIANT
*p
)
2264 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2265 FIXME("(%p)->(%p)\n", This
, p
);
2269 static HRESULT WINAPI
HTMLElement2_put_ondragenter(IHTMLElement2
*iface
, VARIANT v
)
2271 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2272 FIXME("(%p)->()\n", This
);
2276 static HRESULT WINAPI
HTMLElement2_get_ondragenter(IHTMLElement2
*iface
, VARIANT
*p
)
2278 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2279 FIXME("(%p)->(%p)\n", This
, p
);
2283 static HRESULT WINAPI
HTMLElement2_put_ondragover(IHTMLElement2
*iface
, VARIANT v
)
2285 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2286 FIXME("(%p)->()\n", This
);
2290 static HRESULT WINAPI
HTMLElement2_get_ondragover(IHTMLElement2
*iface
, VARIANT
*p
)
2292 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2293 FIXME("(%p)->(%p)\n", This
, p
);
2297 static HRESULT WINAPI
HTMLElement2_put_ondragleave(IHTMLElement2
*iface
, VARIANT v
)
2299 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2300 FIXME("(%p)->()\n", This
);
2304 static HRESULT WINAPI
HTMLElement2_get_ondragleave(IHTMLElement2
*iface
, VARIANT
*p
)
2306 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2307 FIXME("(%p)->(%p)\n", This
, p
);
2311 static HRESULT WINAPI
HTMLElement2_put_ondrop(IHTMLElement2
*iface
, VARIANT v
)
2313 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2314 FIXME("(%p)->()\n", This
);
2318 static HRESULT WINAPI
HTMLElement2_get_ondrop(IHTMLElement2
*iface
, VARIANT
*p
)
2320 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2321 FIXME("(%p)->(%p)\n", This
, p
);
2325 static HRESULT WINAPI
HTMLElement2_put_onbeforecut(IHTMLElement2
*iface
, VARIANT v
)
2327 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2328 FIXME("(%p)->()\n", This
);
2332 static HRESULT WINAPI
HTMLElement2_get_onbeforecut(IHTMLElement2
*iface
, VARIANT
*p
)
2334 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2335 FIXME("(%p)->(%p)\n", This
, p
);
2339 static HRESULT WINAPI
HTMLElement2_put_oncut(IHTMLElement2
*iface
, VARIANT v
)
2341 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2342 FIXME("(%p)->()\n", This
);
2346 static HRESULT WINAPI
HTMLElement2_get_oncut(IHTMLElement2
*iface
, VARIANT
*p
)
2348 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2349 FIXME("(%p)->(%p)\n", This
, p
);
2353 static HRESULT WINAPI
HTMLElement2_put_onbeforecopy(IHTMLElement2
*iface
, VARIANT v
)
2355 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2356 FIXME("(%p)->()\n", This
);
2360 static HRESULT WINAPI
HTMLElement2_get_onbeforecopy(IHTMLElement2
*iface
, VARIANT
*p
)
2362 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2363 FIXME("(%p)->(%p)\n", This
, p
);
2367 static HRESULT WINAPI
HTMLElement2_put_oncopy(IHTMLElement2
*iface
, VARIANT v
)
2369 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2370 FIXME("(%p)->()\n", This
);
2374 static HRESULT WINAPI
HTMLElement2_get_oncopy(IHTMLElement2
*iface
, VARIANT
*p
)
2376 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2377 FIXME("(%p)->(%p)\n", This
, p
);
2381 static HRESULT WINAPI
HTMLElement2_put_onbeforepaste(IHTMLElement2
*iface
, VARIANT v
)
2383 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2384 FIXME("(%p)->()\n", This
);
2388 static HRESULT WINAPI
HTMLElement2_get_onbeforepaste(IHTMLElement2
*iface
, VARIANT
*p
)
2390 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2391 FIXME("(%p)->(%p)\n", This
, p
);
2395 static HRESULT WINAPI
HTMLElement2_put_onpaste(IHTMLElement2
*iface
, VARIANT v
)
2397 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2399 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2401 return set_node_event(&This
->node
, EVENTID_PASTE
, &v
);
2404 static HRESULT WINAPI
HTMLElement2_get_onpaste(IHTMLElement2
*iface
, VARIANT
*p
)
2406 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2408 TRACE("(%p)->(%p)\n", This
, p
);
2410 return get_node_event(&This
->node
, EVENTID_PASTE
, p
);
2413 static HRESULT WINAPI
HTMLElement2_get_currentStyle(IHTMLElement2
*iface
, IHTMLCurrentStyle
**p
)
2415 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2417 TRACE("(%p)->(%p)\n", This
, p
);
2419 return HTMLCurrentStyle_Create(This
, p
);
2422 static HRESULT WINAPI
HTMLElement2_put_onpropertychange(IHTMLElement2
*iface
, VARIANT v
)
2424 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2425 FIXME("(%p)->()\n", This
);
2429 static HRESULT WINAPI
HTMLElement2_get_onpropertychange(IHTMLElement2
*iface
, VARIANT
*p
)
2431 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2432 FIXME("(%p)->(%p)\n", This
, p
);
2436 static HRESULT WINAPI
HTMLElement2_getClientRects(IHTMLElement2
*iface
, IHTMLRectCollection
**pRectCol
)
2438 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2439 FIXME("(%p)->(%p)\n", This
, pRectCol
);
2443 static HRESULT WINAPI
HTMLElement2_getBoundingClientRect(IHTMLElement2
*iface
, IHTMLRect
**pRect
)
2445 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2446 nsIDOMClientRect
*nsrect
;
2450 TRACE("(%p)->(%p)\n", This
, pRect
);
2452 nsres
= nsIDOMHTMLElement_GetBoundingClientRect(This
->nselem
, &nsrect
);
2453 if(NS_FAILED(nsres
) || !nsrect
) {
2454 ERR("GetBoindingClientRect failed: %08x\n", nsres
);
2458 hres
= create_html_rect(nsrect
, pRect
);
2460 nsIDOMClientRect_Release(nsrect
);
2464 static HRESULT WINAPI
HTMLElement2_setExpression(IHTMLElement2
*iface
, BSTR propname
,
2465 BSTR expression
, BSTR language
)
2467 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2468 FIXME("(%p)->(%s %s %s)\n", This
, debugstr_w(propname
), debugstr_w(expression
),
2469 debugstr_w(language
));
2473 static HRESULT WINAPI
HTMLElement2_getExpression(IHTMLElement2
*iface
, BSTR propname
,
2474 VARIANT
*expression
)
2476 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2477 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(propname
), expression
);
2481 static HRESULT WINAPI
HTMLElement2_removeExpression(IHTMLElement2
*iface
, BSTR propname
,
2482 VARIANT_BOOL
*pfSuccess
)
2484 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2485 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(propname
), pfSuccess
);
2489 static HRESULT WINAPI
HTMLElement2_put_tabIndex(IHTMLElement2
*iface
, short v
)
2491 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2494 TRACE("(%p)->(%d)\n", This
, v
);
2496 nsres
= nsIDOMHTMLElement_SetTabIndex(This
->nselem
, v
);
2497 if(NS_FAILED(nsres
))
2498 ERR("GetTabIndex failed: %08x\n", nsres
);
2503 static HRESULT WINAPI
HTMLElement2_get_tabIndex(IHTMLElement2
*iface
, short *p
)
2505 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2509 TRACE("(%p)->(%p)\n", This
, p
);
2511 nsres
= nsIDOMHTMLElement_GetTabIndex(This
->nselem
, &index
);
2512 if(NS_FAILED(nsres
)) {
2513 ERR("GetTabIndex failed: %08x\n", nsres
);
2521 static HRESULT WINAPI
HTMLElement2_focus(IHTMLElement2
*iface
)
2523 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2526 TRACE("(%p)\n", This
);
2528 nsres
= nsIDOMHTMLElement_Focus(This
->nselem
);
2529 if(NS_FAILED(nsres
))
2530 ERR("Focus failed: %08x\n", nsres
);
2535 static HRESULT WINAPI
HTMLElement2_put_accessKey(IHTMLElement2
*iface
, BSTR v
)
2537 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2540 static WCHAR accessKeyW
[] = {'a','c','c','e','s','s','K','e','y',0};
2542 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2544 V_VT(&var
) = VT_BSTR
;
2546 return IHTMLElement_setAttribute(&This
->IHTMLElement_iface
, accessKeyW
, var
, 0);
2549 static HRESULT WINAPI
HTMLElement2_get_accessKey(IHTMLElement2
*iface
, BSTR
*p
)
2551 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2552 FIXME("(%p)->(%p)\n", This
, p
);
2556 static HRESULT WINAPI
HTMLElement2_put_onblur(IHTMLElement2
*iface
, VARIANT v
)
2558 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2560 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2562 return set_node_event(&This
->node
, EVENTID_BLUR
, &v
);
2565 static HRESULT WINAPI
HTMLElement2_get_onblur(IHTMLElement2
*iface
, VARIANT
*p
)
2567 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2569 TRACE("(%p)->(%p)\n", This
, p
);
2571 return get_node_event(&This
->node
, EVENTID_BLUR
, p
);
2574 static HRESULT WINAPI
HTMLElement2_put_onfocus(IHTMLElement2
*iface
, VARIANT v
)
2576 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2578 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2580 return set_node_event(&This
->node
, EVENTID_FOCUS
, &v
);
2583 static HRESULT WINAPI
HTMLElement2_get_onfocus(IHTMLElement2
*iface
, VARIANT
*p
)
2585 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2587 TRACE("(%p)->(%p)\n", This
, p
);
2589 return get_node_event(&This
->node
, EVENTID_FOCUS
, p
);
2592 static HRESULT WINAPI
HTMLElement2_put_onresize(IHTMLElement2
*iface
, VARIANT v
)
2594 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2596 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2598 return set_node_event(&This
->node
, EVENTID_RESIZE
, &v
);
2601 static HRESULT WINAPI
HTMLElement2_get_onresize(IHTMLElement2
*iface
, VARIANT
*p
)
2603 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2605 TRACE("(%p)->(%p)\n", This
, p
);
2607 return get_node_event(&This
->node
, EVENTID_RESIZE
, p
);
2610 static HRESULT WINAPI
HTMLElement2_blur(IHTMLElement2
*iface
)
2612 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2615 TRACE("(%p)\n", This
);
2617 nsres
= nsIDOMHTMLElement_Blur(This
->nselem
);
2618 if(NS_FAILED(nsres
)) {
2619 ERR("Blur failed: %08x\n", nsres
);
2626 static HRESULT WINAPI
HTMLElement2_addFilter(IHTMLElement2
*iface
, IUnknown
*pUnk
)
2628 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2629 FIXME("(%p)->(%p)\n", This
, pUnk
);
2633 static HRESULT WINAPI
HTMLElement2_removeFilter(IHTMLElement2
*iface
, IUnknown
*pUnk
)
2635 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2636 FIXME("(%p)->(%p)\n", This
, pUnk
);
2640 static HRESULT WINAPI
HTMLElement2_get_clientHeight(IHTMLElement2
*iface
, LONG
*p
)
2642 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2645 TRACE("(%p)->(%p)\n", This
, p
);
2647 nsres
= nsIDOMHTMLElement_GetClientHeight(This
->nselem
, p
);
2648 assert(nsres
== NS_OK
);
2652 static HRESULT WINAPI
HTMLElement2_get_clientWidth(IHTMLElement2
*iface
, LONG
*p
)
2654 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2657 TRACE("(%p)->(%p)\n", This
, p
);
2659 nsres
= nsIDOMHTMLElement_GetClientWidth(This
->nselem
, p
);
2660 assert(nsres
== NS_OK
);
2664 static HRESULT WINAPI
HTMLElement2_get_clientTop(IHTMLElement2
*iface
, LONG
*p
)
2666 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2669 TRACE("(%p)->(%p)\n", This
, p
);
2671 nsres
= nsIDOMHTMLElement_GetClientTop(This
->nselem
, p
);
2672 assert(nsres
== NS_OK
);
2674 TRACE("*p = %d\n", *p
);
2678 static HRESULT WINAPI
HTMLElement2_get_clientLeft(IHTMLElement2
*iface
, LONG
*p
)
2680 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2683 TRACE("(%p)->(%p)\n", This
, p
);
2685 nsres
= nsIDOMHTMLElement_GetClientLeft(This
->nselem
, p
);
2686 assert(nsres
== NS_OK
);
2688 TRACE("*p = %d\n", *p
);
2692 static HRESULT WINAPI
HTMLElement2_attachEvent(IHTMLElement2
*iface
, BSTR event
,
2693 IDispatch
*pDisp
, VARIANT_BOOL
*pfResult
)
2695 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2697 TRACE("(%p)->(%s %p %p)\n", This
, debugstr_w(event
), pDisp
, pfResult
);
2699 return attach_event(&This
->node
.event_target
, event
, pDisp
, pfResult
);
2702 static HRESULT WINAPI
HTMLElement2_detachEvent(IHTMLElement2
*iface
, BSTR event
, IDispatch
*pDisp
)
2704 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2706 TRACE("(%p)->(%s %p)\n", This
, debugstr_w(event
), pDisp
);
2708 return detach_event(&This
->node
.event_target
, event
, pDisp
);
2711 static HRESULT WINAPI
HTMLElement2_get_readyState(IHTMLElement2
*iface
, VARIANT
*p
)
2713 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2716 TRACE("(%p)->(%p)\n", This
, p
);
2718 if(This
->node
.vtbl
->get_readystate
) {
2721 hres
= This
->node
.vtbl
->get_readystate(&This
->node
, &str
);
2725 static const WCHAR completeW
[] = {'c','o','m','p','l','e','t','e',0};
2727 str
= SysAllocString(completeW
);
2729 return E_OUTOFMEMORY
;
2737 static HRESULT WINAPI
HTMLElement2_put_onreadystatechange(IHTMLElement2
*iface
, VARIANT v
)
2739 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2741 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2743 return set_node_event(&This
->node
, EVENTID_READYSTATECHANGE
, &v
);
2746 static HRESULT WINAPI
HTMLElement2_get_onreadystatechange(IHTMLElement2
*iface
, VARIANT
*p
)
2748 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2750 TRACE("(%p)->(%p)\n", This
, p
);
2752 return get_node_event(&This
->node
, EVENTID_READYSTATECHANGE
, p
);
2755 static HRESULT WINAPI
HTMLElement2_put_onrowsdelete(IHTMLElement2
*iface
, VARIANT v
)
2757 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2758 FIXME("(%p)->()\n", This
);
2762 static HRESULT WINAPI
HTMLElement2_get_onrowsdelete(IHTMLElement2
*iface
, VARIANT
*p
)
2764 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2765 FIXME("(%p)->(%p)\n", This
, p
);
2769 static HRESULT WINAPI
HTMLElement2_put_onrowsinserted(IHTMLElement2
*iface
, VARIANT v
)
2771 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2772 FIXME("(%p)->()\n", This
);
2776 static HRESULT WINAPI
HTMLElement2_get_onrowsinserted(IHTMLElement2
*iface
, VARIANT
*p
)
2778 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2779 FIXME("(%p)->(%p)\n", This
, p
);
2783 static HRESULT WINAPI
HTMLElement2_put_oncellchange(IHTMLElement2
*iface
, VARIANT v
)
2785 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2786 FIXME("(%p)->()\n", This
);
2790 static HRESULT WINAPI
HTMLElement2_get_oncellchange(IHTMLElement2
*iface
, VARIANT
*p
)
2792 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2793 FIXME("(%p)->(%p)\n", This
, p
);
2797 static HRESULT WINAPI
HTMLElement2_put_dir(IHTMLElement2
*iface
, BSTR v
)
2799 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2803 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2806 FIXME("Unsupported for comment nodes.\n");
2810 nsAString_InitDepend(&nsstr
, v
);
2811 nsres
= nsIDOMHTMLElement_SetDir(This
->nselem
, &nsstr
);
2812 nsAString_Finish(&nsstr
);
2813 if(NS_FAILED(nsres
)) {
2814 ERR("SetDir failed: %08x\n", nsres
);
2821 static HRESULT WINAPI
HTMLElement2_get_dir(IHTMLElement2
*iface
, BSTR
*p
)
2823 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2827 TRACE("(%p)->(%p)\n", This
, p
);
2834 nsAString_Init(&dir_str
, NULL
);
2835 nsres
= nsIDOMHTMLElement_GetDir(This
->nselem
, &dir_str
);
2836 return return_nsstr(nsres
, &dir_str
, p
);
2839 static HRESULT WINAPI
HTMLElement2_createControlRange(IHTMLElement2
*iface
, IDispatch
**range
)
2841 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2842 FIXME("(%p)->(%p)\n", This
, range
);
2846 static HRESULT WINAPI
HTMLElement2_get_scrollHeight(IHTMLElement2
*iface
, LONG
*p
)
2848 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2851 TRACE("(%p)->(%p)\n", This
, p
);
2853 nsres
= nsIDOMHTMLElement_GetScrollHeight(This
->nselem
, p
);
2854 assert(nsres
== NS_OK
);
2856 TRACE("*p = %d\n", *p
);
2860 static HRESULT WINAPI
HTMLElement2_get_scrollWidth(IHTMLElement2
*iface
, LONG
*p
)
2862 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2865 TRACE("(%p)->(%p)\n", This
, p
);
2867 nsres
= nsIDOMHTMLElement_GetScrollWidth(This
->nselem
, p
);
2868 assert(nsres
== NS_OK
);
2870 TRACE("*p = %d\n", *p
);
2874 static HRESULT WINAPI
HTMLElement2_put_scrollTop(IHTMLElement2
*iface
, LONG v
)
2876 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2878 TRACE("(%p)->(%d)\n", This
, v
);
2881 FIXME("NULL nselem\n");
2885 nsIDOMHTMLElement_SetScrollTop(This
->nselem
, v
);
2889 static HRESULT WINAPI
HTMLElement2_get_scrollTop(IHTMLElement2
*iface
, LONG
*p
)
2891 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2894 TRACE("(%p)->(%p)\n", This
, p
);
2896 nsres
= nsIDOMHTMLElement_GetScrollTop(This
->nselem
, p
);
2897 assert(nsres
== NS_OK
);
2899 TRACE("*p = %d\n", *p
);
2903 static HRESULT WINAPI
HTMLElement2_put_scrollLeft(IHTMLElement2
*iface
, LONG v
)
2905 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2907 TRACE("(%p)->(%d)\n", This
, v
);
2910 FIXME("NULL nselem\n");
2914 nsIDOMHTMLElement_SetScrollLeft(This
->nselem
, v
);
2918 static HRESULT WINAPI
HTMLElement2_get_scrollLeft(IHTMLElement2
*iface
, LONG
*p
)
2920 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2923 TRACE("(%p)->(%p)\n", This
, p
);
2926 return E_INVALIDARG
;
2930 FIXME("NULL nselem\n");
2934 nsres
= nsIDOMHTMLElement_GetScrollLeft(This
->nselem
, p
);
2935 assert(nsres
== NS_OK
);
2937 TRACE("*p = %d\n", *p
);
2941 static HRESULT WINAPI
HTMLElement2_clearAttributes(IHTMLElement2
*iface
)
2943 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2944 FIXME("(%p)\n", This
);
2948 static HRESULT WINAPI
HTMLElement2_mergeAttributes(IHTMLElement2
*iface
, IHTMLElement
*mergeThis
)
2950 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2951 FIXME("(%p)->(%p)\n", This
, mergeThis
);
2955 static HRESULT WINAPI
HTMLElement2_put_oncontextmenu(IHTMLElement2
*iface
, VARIANT v
)
2957 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2959 TRACE("(%p)->()\n", This
);
2961 return set_node_event(&This
->node
, EVENTID_CONTEXTMENU
, &v
);
2964 static HRESULT WINAPI
HTMLElement2_get_oncontextmenu(IHTMLElement2
*iface
, VARIANT
*p
)
2966 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2968 TRACE("(%p)->(%p)\n", This
, p
);
2970 return get_node_event(&This
->node
, EVENTID_CONTEXTMENU
, p
);
2973 static HRESULT WINAPI
HTMLElement2_insertAdjacentElement(IHTMLElement2
*iface
, BSTR where
,
2974 IHTMLElement
*insertedElement
, IHTMLElement
**inserted
)
2976 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2977 HTMLDOMNode
*ret_node
;
2981 TRACE("(%p)->(%s %p %p)\n", This
, debugstr_w(where
), insertedElement
, inserted
);
2983 elem
= unsafe_impl_from_IHTMLElement(insertedElement
);
2985 return E_INVALIDARG
;
2987 hres
= insert_adjacent_node(This
, where
, elem
->node
.nsnode
, &ret_node
);
2991 hres
= IHTMLDOMNode_QueryInterface(&ret_node
->IHTMLDOMNode_iface
, &IID_IHTMLElement
, (void**)inserted
);
2992 IHTMLDOMNode_Release(&ret_node
->IHTMLDOMNode_iface
);
2996 static HRESULT WINAPI
HTMLElement2_applyElement(IHTMLElement2
*iface
, IHTMLElement
*apply
,
2997 BSTR where
, IHTMLElement
**applied
)
2999 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3000 FIXME("(%p)->(%p %s %p)\n", This
, apply
, debugstr_w(where
), applied
);
3004 static HRESULT WINAPI
HTMLElement2_getAdjacentText(IHTMLElement2
*iface
, BSTR where
, BSTR
*text
)
3006 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3007 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(where
), text
);
3011 static HRESULT WINAPI
HTMLElement2_replaceAdjacentText(IHTMLElement2
*iface
, BSTR where
,
3012 BSTR newText
, BSTR
*oldText
)
3014 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3015 FIXME("(%p)->(%s %s %p)\n", This
, debugstr_w(where
), debugstr_w(newText
), oldText
);
3019 static HRESULT WINAPI
HTMLElement2_get_canHandleChildren(IHTMLElement2
*iface
, VARIANT_BOOL
*p
)
3021 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3022 FIXME("(%p)->(%p)\n", This
, p
);
3026 static HRESULT WINAPI
HTMLElement2_addBehavior(IHTMLElement2
*iface
, BSTR bstrUrl
,
3027 VARIANT
*pvarFactory
, LONG
*pCookie
)
3029 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3030 FIXME("(%p)->(%s %p %p)\n", This
, debugstr_w(bstrUrl
), pvarFactory
, pCookie
);
3034 static HRESULT WINAPI
HTMLElement2_removeBehavior(IHTMLElement2
*iface
, LONG cookie
,
3035 VARIANT_BOOL
*pfResult
)
3037 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3038 FIXME("(%p)->(%d %p)\n", This
, cookie
, pfResult
);
3042 static HRESULT WINAPI
HTMLElement2_get_runtimeStyle(IHTMLElement2
*iface
, IHTMLStyle
**p
)
3044 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3046 FIXME("(%p)->(%p): hack\n", This
, p
);
3048 /* We can't implement correct behavior on top of Gecko (although we could
3049 try a bit harder). Making runtimeStyle behave like regular style is
3050 enough for most use cases. */
3051 if(!This
->runtime_style
) {
3054 hres
= HTMLStyle_Create(This
, &This
->runtime_style
);
3059 *p
= &This
->runtime_style
->IHTMLStyle_iface
;
3060 IHTMLStyle_AddRef(*p
);
3064 static HRESULT WINAPI
HTMLElement2_get_behaviorUrns(IHTMLElement2
*iface
, IDispatch
**p
)
3066 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3067 FIXME("(%p)->(%p)\n", This
, p
);
3071 static HRESULT WINAPI
HTMLElement2_put_tagUrn(IHTMLElement2
*iface
, BSTR v
)
3073 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3074 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
3078 static HRESULT WINAPI
HTMLElement2_get_tagUrn(IHTMLElement2
*iface
, BSTR
*p
)
3080 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3081 FIXME("(%p)->(%p)\n", This
, p
);
3085 static HRESULT WINAPI
HTMLElement2_put_onbeforeeditfocus(IHTMLElement2
*iface
, VARIANT vv
)
3087 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3088 FIXME("(%p)->()\n", This
);
3092 static HRESULT WINAPI
HTMLElement2_get_onbeforeeditfocus(IHTMLElement2
*iface
, VARIANT
*p
)
3094 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3095 FIXME("(%p)->(%p)\n", This
, p
);
3099 static HRESULT WINAPI
HTMLElement2_get_readyStateValue(IHTMLElement2
*iface
, LONG
*p
)
3101 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3102 FIXME("(%p)->(%p)\n", This
, p
);
3106 static HRESULT WINAPI
HTMLElement2_getElementsByTagName(IHTMLElement2
*iface
, BSTR v
,
3107 IHTMLElementCollection
**pelColl
)
3109 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3110 nsIDOMHTMLCollection
*nscol
;
3114 TRACE("(%p)->(%s %p)\n", This
, debugstr_w(v
), pelColl
);
3117 *pelColl
= create_collection_from_htmlcol(This
->node
.doc
, NULL
);
3121 nsAString_InitDepend(&tag_str
, v
);
3122 nsres
= nsIDOMHTMLElement_GetElementsByTagName(This
->nselem
, &tag_str
, &nscol
);
3123 nsAString_Finish(&tag_str
);
3124 if(NS_FAILED(nsres
)) {
3125 ERR("GetElementByTagName failed: %08x\n", nsres
);
3129 *pelColl
= create_collection_from_htmlcol(This
->node
.doc
, nscol
);
3130 nsIDOMHTMLCollection_Release(nscol
);
3134 static const IHTMLElement2Vtbl HTMLElement2Vtbl
= {
3135 HTMLElement2_QueryInterface
,
3136 HTMLElement2_AddRef
,
3137 HTMLElement2_Release
,
3138 HTMLElement2_GetTypeInfoCount
,
3139 HTMLElement2_GetTypeInfo
,
3140 HTMLElement2_GetIDsOfNames
,
3141 HTMLElement2_Invoke
,
3142 HTMLElement2_get_scopeName
,
3143 HTMLElement2_setCapture
,
3144 HTMLElement2_releaseCapture
,
3145 HTMLElement2_put_onlosecapture
,
3146 HTMLElement2_get_onlosecapture
,
3147 HTMLElement2_componentFromPoint
,
3148 HTMLElement2_doScroll
,
3149 HTMLElement2_put_onscroll
,
3150 HTMLElement2_get_onscroll
,
3151 HTMLElement2_put_ondrag
,
3152 HTMLElement2_get_ondrag
,
3153 HTMLElement2_put_ondragend
,
3154 HTMLElement2_get_ondragend
,
3155 HTMLElement2_put_ondragenter
,
3156 HTMLElement2_get_ondragenter
,
3157 HTMLElement2_put_ondragover
,
3158 HTMLElement2_get_ondragover
,
3159 HTMLElement2_put_ondragleave
,
3160 HTMLElement2_get_ondragleave
,
3161 HTMLElement2_put_ondrop
,
3162 HTMLElement2_get_ondrop
,
3163 HTMLElement2_put_onbeforecut
,
3164 HTMLElement2_get_onbeforecut
,
3165 HTMLElement2_put_oncut
,
3166 HTMLElement2_get_oncut
,
3167 HTMLElement2_put_onbeforecopy
,
3168 HTMLElement2_get_onbeforecopy
,
3169 HTMLElement2_put_oncopy
,
3170 HTMLElement2_get_oncopy
,
3171 HTMLElement2_put_onbeforepaste
,
3172 HTMLElement2_get_onbeforepaste
,
3173 HTMLElement2_put_onpaste
,
3174 HTMLElement2_get_onpaste
,
3175 HTMLElement2_get_currentStyle
,
3176 HTMLElement2_put_onpropertychange
,
3177 HTMLElement2_get_onpropertychange
,
3178 HTMLElement2_getClientRects
,
3179 HTMLElement2_getBoundingClientRect
,
3180 HTMLElement2_setExpression
,
3181 HTMLElement2_getExpression
,
3182 HTMLElement2_removeExpression
,
3183 HTMLElement2_put_tabIndex
,
3184 HTMLElement2_get_tabIndex
,
3186 HTMLElement2_put_accessKey
,
3187 HTMLElement2_get_accessKey
,
3188 HTMLElement2_put_onblur
,
3189 HTMLElement2_get_onblur
,
3190 HTMLElement2_put_onfocus
,
3191 HTMLElement2_get_onfocus
,
3192 HTMLElement2_put_onresize
,
3193 HTMLElement2_get_onresize
,
3195 HTMLElement2_addFilter
,
3196 HTMLElement2_removeFilter
,
3197 HTMLElement2_get_clientHeight
,
3198 HTMLElement2_get_clientWidth
,
3199 HTMLElement2_get_clientTop
,
3200 HTMLElement2_get_clientLeft
,
3201 HTMLElement2_attachEvent
,
3202 HTMLElement2_detachEvent
,
3203 HTMLElement2_get_readyState
,
3204 HTMLElement2_put_onreadystatechange
,
3205 HTMLElement2_get_onreadystatechange
,
3206 HTMLElement2_put_onrowsdelete
,
3207 HTMLElement2_get_onrowsdelete
,
3208 HTMLElement2_put_onrowsinserted
,
3209 HTMLElement2_get_onrowsinserted
,
3210 HTMLElement2_put_oncellchange
,
3211 HTMLElement2_get_oncellchange
,
3212 HTMLElement2_put_dir
,
3213 HTMLElement2_get_dir
,
3214 HTMLElement2_createControlRange
,
3215 HTMLElement2_get_scrollHeight
,
3216 HTMLElement2_get_scrollWidth
,
3217 HTMLElement2_put_scrollTop
,
3218 HTMLElement2_get_scrollTop
,
3219 HTMLElement2_put_scrollLeft
,
3220 HTMLElement2_get_scrollLeft
,
3221 HTMLElement2_clearAttributes
,
3222 HTMLElement2_mergeAttributes
,
3223 HTMLElement2_put_oncontextmenu
,
3224 HTMLElement2_get_oncontextmenu
,
3225 HTMLElement2_insertAdjacentElement
,
3226 HTMLElement2_applyElement
,
3227 HTMLElement2_getAdjacentText
,
3228 HTMLElement2_replaceAdjacentText
,
3229 HTMLElement2_get_canHandleChildren
,
3230 HTMLElement2_addBehavior
,
3231 HTMLElement2_removeBehavior
,
3232 HTMLElement2_get_runtimeStyle
,
3233 HTMLElement2_get_behaviorUrns
,
3234 HTMLElement2_put_tagUrn
,
3235 HTMLElement2_get_tagUrn
,
3236 HTMLElement2_put_onbeforeeditfocus
,
3237 HTMLElement2_get_onbeforeeditfocus
,
3238 HTMLElement2_get_readyStateValue
,
3239 HTMLElement2_getElementsByTagName
,
3242 static inline HTMLElement
*impl_from_IHTMLElement3(IHTMLElement3
*iface
)
3244 return CONTAINING_RECORD(iface
, HTMLElement
, IHTMLElement3_iface
);
3247 static HRESULT WINAPI
HTMLElement3_QueryInterface(IHTMLElement3
*iface
,
3248 REFIID riid
, void **ppv
)
3250 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3251 return IHTMLElement_QueryInterface(&This
->IHTMLElement_iface
, riid
, ppv
);
3254 static ULONG WINAPI
HTMLElement3_AddRef(IHTMLElement3
*iface
)
3256 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3257 return IHTMLElement_AddRef(&This
->IHTMLElement_iface
);
3260 static ULONG WINAPI
HTMLElement3_Release(IHTMLElement3
*iface
)
3262 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3263 return IHTMLElement_Release(&This
->IHTMLElement_iface
);
3266 static HRESULT WINAPI
HTMLElement3_GetTypeInfoCount(IHTMLElement3
*iface
, UINT
*pctinfo
)
3268 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3269 return IDispatchEx_GetTypeInfoCount(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
3272 static HRESULT WINAPI
HTMLElement3_GetTypeInfo(IHTMLElement3
*iface
, UINT iTInfo
,
3273 LCID lcid
, ITypeInfo
**ppTInfo
)
3275 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3276 return IDispatchEx_GetTypeInfo(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
3279 static HRESULT WINAPI
HTMLElement3_GetIDsOfNames(IHTMLElement3
*iface
, REFIID riid
,
3280 LPOLESTR
*rgszNames
, UINT cNames
,
3281 LCID lcid
, DISPID
*rgDispId
)
3283 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3284 return IDispatchEx_GetIDsOfNames(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
3288 static HRESULT WINAPI
HTMLElement3_Invoke(IHTMLElement3
*iface
, DISPID dispIdMember
,
3289 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
3290 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
3292 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3293 return IDispatchEx_Invoke(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
3294 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
3297 static HRESULT WINAPI
HTMLElement3_mergeAttributes(IHTMLElement3
*iface
, IHTMLElement
*mergeThis
, VARIANT
*pvarFlags
)
3299 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3300 FIXME("(%p)->(%p %p)\n", This
, mergeThis
, pvarFlags
);
3304 static HRESULT WINAPI
HTMLElement3_get_isMultiLine(IHTMLElement3
*iface
, VARIANT_BOOL
*p
)
3306 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3307 FIXME("(%p)->(%p)\n", This
, p
);
3311 static HRESULT WINAPI
HTMLElement3_get_canHaveHTML(IHTMLElement3
*iface
, VARIANT_BOOL
*p
)
3313 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3314 FIXME("(%p)->(%p)\n", This
, p
);
3318 static HRESULT WINAPI
HTMLElement3_put_onlayoutcomplete(IHTMLElement3
*iface
, VARIANT v
)
3320 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3321 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3325 static HRESULT WINAPI
HTMLElement3_get_onlayoutcomplete(IHTMLElement3
*iface
, VARIANT
*p
)
3327 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3328 FIXME("(%p)->(%p)\n", This
, p
);
3332 static HRESULT WINAPI
HTMLElement3_put_onpage(IHTMLElement3
*iface
, VARIANT v
)
3334 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3335 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3339 static HRESULT WINAPI
HTMLElement3_get_onpage(IHTMLElement3
*iface
, VARIANT
*p
)
3341 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3342 FIXME("(%p)->(%p)\n", This
, p
);
3346 static HRESULT WINAPI
HTMLElement3_put_inflateBlock(IHTMLElement3
*iface
, VARIANT_BOOL v
)
3348 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3349 FIXME("(%p)->(%x)\n", This
, v
);
3353 static HRESULT WINAPI
HTMLElement3_get_inflateBlock(IHTMLElement3
*iface
, VARIANT_BOOL
*p
)
3355 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3356 FIXME("(%p)->(%p)\n", This
, p
);
3360 static HRESULT WINAPI
HTMLElement3_put_onbeforedeactivate(IHTMLElement3
*iface
, VARIANT v
)
3362 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3363 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3367 static HRESULT WINAPI
HTMLElement3_get_onbeforedeactivate(IHTMLElement3
*iface
, VARIANT
*p
)
3369 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3370 FIXME("(%p)->(%p)\n", This
, p
);
3374 static HRESULT WINAPI
HTMLElement3_setActive(IHTMLElement3
*iface
)
3376 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3377 FIXME("(%p)\n", This
);
3381 static HRESULT WINAPI
HTMLElement3_put_contentEditable(IHTMLElement3
*iface
, BSTR v
)
3383 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3387 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
3389 nsAString_InitDepend(&str
, v
);
3390 nsres
= nsIDOMHTMLElement_SetContentEditable(This
->nselem
, &str
);
3391 nsAString_Finish(&str
);
3393 if (NS_FAILED(nsres
)){
3394 ERR("SetContentEditable(%s) failed!\n", debugstr_w(v
));
3401 static HRESULT WINAPI
HTMLElement3_get_contentEditable(IHTMLElement3
*iface
, BSTR
*p
)
3403 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3407 TRACE("(%p)->(%p)\n", This
, p
);
3409 nsAString_Init(&str
, NULL
);
3410 nsres
= nsIDOMHTMLElement_GetContentEditable(This
->nselem
, &str
);
3411 return return_nsstr(nsres
, &str
, p
);
3414 static HRESULT WINAPI
HTMLElement3_get_isContentEditable(IHTMLElement3
*iface
, VARIANT_BOOL
*p
)
3416 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3417 FIXME("(%p)->(%p)\n", This
, p
);
3421 static HRESULT WINAPI
HTMLElement3_put_hideFocus(IHTMLElement3
*iface
, VARIANT_BOOL v
)
3423 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3424 FIXME("(%p)->(%x)\n", This
, v
);
3428 static HRESULT WINAPI
HTMLElement3_get_hideFocus(IHTMLElement3
*iface
, VARIANT_BOOL
*p
)
3430 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3431 FIXME("(%p)->(%p)\n", This
, p
);
3435 static const WCHAR disabledW
[] = {'d','i','s','a','b','l','e','d',0};
3437 static HRESULT WINAPI
HTMLElement3_put_disabled(IHTMLElement3
*iface
, VARIANT_BOOL v
)
3439 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3443 TRACE("(%p)->(%x)\n", This
, v
);
3445 if(This
->node
.vtbl
->put_disabled
)
3446 return This
->node
.vtbl
->put_disabled(&This
->node
, v
);
3448 hres
= dispex_get_dprop_ref(&This
->node
.event_target
.dispex
, disabledW
, TRUE
, &var
);
3453 V_VT(var
) = VT_BOOL
;
3458 static HRESULT WINAPI
HTMLElement3_get_disabled(IHTMLElement3
*iface
, VARIANT_BOOL
*p
)
3460 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3464 TRACE("(%p)->(%p)\n", This
, p
);
3466 if(This
->node
.vtbl
->get_disabled
)
3467 return This
->node
.vtbl
->get_disabled(&This
->node
, p
);
3469 hres
= dispex_get_dprop_ref(&This
->node
.event_target
.dispex
, disabledW
, FALSE
, &var
);
3470 if(hres
== DISP_E_UNKNOWNNAME
) {
3477 if(V_VT(var
) != VT_BOOL
) {
3478 FIXME("value is %s\n", debugstr_variant(var
));
3486 static HRESULT WINAPI
HTMLElement3_get_isDisabled(IHTMLElement3
*iface
, VARIANT_BOOL
*p
)
3488 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3489 FIXME("(%p)->(%p)\n", This
, p
);
3493 static HRESULT WINAPI
HTMLElement3_put_onmove(IHTMLElement3
*iface
, VARIANT v
)
3495 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3496 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3500 static HRESULT WINAPI
HTMLElement3_get_onmove(IHTMLElement3
*iface
, VARIANT
*p
)
3502 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3503 FIXME("(%p)->(%p)\n", This
, p
);
3507 static HRESULT WINAPI
HTMLElement3_put_oncontrolselect(IHTMLElement3
*iface
, VARIANT v
)
3509 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3510 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3514 static HRESULT WINAPI
HTMLElement3_get_oncontrolselect(IHTMLElement3
*iface
, VARIANT
*p
)
3516 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3517 FIXME("(%p)->(%p)\n", This
, p
);
3521 static HRESULT WINAPI
HTMLElement3_fireEvent(IHTMLElement3
*iface
, BSTR bstrEventName
,
3522 VARIANT
*pvarEventObject
, VARIANT_BOOL
*pfCancelled
)
3524 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3526 TRACE("(%p)->(%s %s %p)\n", This
, debugstr_w(bstrEventName
), debugstr_variant(pvarEventObject
),
3529 return fire_event(&This
->node
, bstrEventName
, pvarEventObject
, pfCancelled
);
3532 static HRESULT WINAPI
HTMLElement3_put_onresizestart(IHTMLElement3
*iface
, VARIANT v
)
3534 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3535 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3539 static HRESULT WINAPI
HTMLElement3_get_onresizestart(IHTMLElement3
*iface
, VARIANT
*p
)
3541 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3542 FIXME("(%p)->(%p)\n", This
, p
);
3546 static HRESULT WINAPI
HTMLElement3_put_onresizeend(IHTMLElement3
*iface
, VARIANT v
)
3548 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3549 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3553 static HRESULT WINAPI
HTMLElement3_get_onresizeend(IHTMLElement3
*iface
, VARIANT
*p
)
3555 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3556 FIXME("(%p)->(%p)\n", This
, p
);
3560 static HRESULT WINAPI
HTMLElement3_put_onmovestart(IHTMLElement3
*iface
, VARIANT v
)
3562 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3563 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3567 static HRESULT WINAPI
HTMLElement3_get_onmovestart(IHTMLElement3
*iface
, VARIANT
*p
)
3569 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3570 FIXME("(%p)->(%p)\n", This
, p
);
3574 static HRESULT WINAPI
HTMLElement3_put_onmoveend(IHTMLElement3
*iface
, VARIANT v
)
3576 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3577 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3581 static HRESULT WINAPI
HTMLElement3_get_onmoveend(IHTMLElement3
*iface
, VARIANT
*p
)
3583 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3584 FIXME("(%p)->(%p)\n", This
, p
);
3588 static HRESULT WINAPI
HTMLElement3_put_onmousecenter(IHTMLElement3
*iface
, VARIANT v
)
3590 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3591 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3595 static HRESULT WINAPI
HTMLElement3_get_onmousecenter(IHTMLElement3
*iface
, VARIANT
*p
)
3597 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3598 FIXME("(%p)->(%p)\n", This
, p
);
3602 static HRESULT WINAPI
HTMLElement3_put_onmouseleave(IHTMLElement3
*iface
, VARIANT v
)
3604 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3605 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3609 static HRESULT WINAPI
HTMLElement3_get_onmouseleave(IHTMLElement3
*iface
, VARIANT
*p
)
3611 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3612 FIXME("(%p)->(%p)\n", This
, p
);
3616 static HRESULT WINAPI
HTMLElement3_put_onactivate(IHTMLElement3
*iface
, VARIANT v
)
3618 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3619 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3623 static HRESULT WINAPI
HTMLElement3_get_onactivate(IHTMLElement3
*iface
, VARIANT
*p
)
3625 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3626 FIXME("(%p)->(%p)\n", This
, p
);
3630 static HRESULT WINAPI
HTMLElement3_put_ondeactivate(IHTMLElement3
*iface
, VARIANT v
)
3632 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3633 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3637 static HRESULT WINAPI
HTMLElement3_get_ondeactivate(IHTMLElement3
*iface
, VARIANT
*p
)
3639 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3640 FIXME("(%p)->(%p)\n", This
, p
);
3644 static HRESULT WINAPI
HTMLElement3_dragDrop(IHTMLElement3
*iface
, VARIANT_BOOL
*pfRet
)
3646 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3647 FIXME("(%p)->(%p)\n", This
, pfRet
);
3651 static HRESULT WINAPI
HTMLElement3_get_glyphMode(IHTMLElement3
*iface
, LONG
*p
)
3653 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3654 FIXME("(%p)->(%p)\n", This
, p
);
3658 static const IHTMLElement3Vtbl HTMLElement3Vtbl
= {
3659 HTMLElement3_QueryInterface
,
3660 HTMLElement3_AddRef
,
3661 HTMLElement3_Release
,
3662 HTMLElement3_GetTypeInfoCount
,
3663 HTMLElement3_GetTypeInfo
,
3664 HTMLElement3_GetIDsOfNames
,
3665 HTMLElement3_Invoke
,
3666 HTMLElement3_mergeAttributes
,
3667 HTMLElement3_get_isMultiLine
,
3668 HTMLElement3_get_canHaveHTML
,
3669 HTMLElement3_put_onlayoutcomplete
,
3670 HTMLElement3_get_onlayoutcomplete
,
3671 HTMLElement3_put_onpage
,
3672 HTMLElement3_get_onpage
,
3673 HTMLElement3_put_inflateBlock
,
3674 HTMLElement3_get_inflateBlock
,
3675 HTMLElement3_put_onbeforedeactivate
,
3676 HTMLElement3_get_onbeforedeactivate
,
3677 HTMLElement3_setActive
,
3678 HTMLElement3_put_contentEditable
,
3679 HTMLElement3_get_contentEditable
,
3680 HTMLElement3_get_isContentEditable
,
3681 HTMLElement3_put_hideFocus
,
3682 HTMLElement3_get_hideFocus
,
3683 HTMLElement3_put_disabled
,
3684 HTMLElement3_get_disabled
,
3685 HTMLElement3_get_isDisabled
,
3686 HTMLElement3_put_onmove
,
3687 HTMLElement3_get_onmove
,
3688 HTMLElement3_put_oncontrolselect
,
3689 HTMLElement3_get_oncontrolselect
,
3690 HTMLElement3_fireEvent
,
3691 HTMLElement3_put_onresizestart
,
3692 HTMLElement3_get_onresizestart
,
3693 HTMLElement3_put_onresizeend
,
3694 HTMLElement3_get_onresizeend
,
3695 HTMLElement3_put_onmovestart
,
3696 HTMLElement3_get_onmovestart
,
3697 HTMLElement3_put_onmoveend
,
3698 HTMLElement3_get_onmoveend
,
3699 HTMLElement3_put_onmousecenter
,
3700 HTMLElement3_get_onmousecenter
,
3701 HTMLElement3_put_onmouseleave
,
3702 HTMLElement3_get_onmouseleave
,
3703 HTMLElement3_put_onactivate
,
3704 HTMLElement3_get_onactivate
,
3705 HTMLElement3_put_ondeactivate
,
3706 HTMLElement3_get_ondeactivate
,
3707 HTMLElement3_dragDrop
,
3708 HTMLElement3_get_glyphMode
3711 static inline HTMLElement
*impl_from_IHTMLElement4(IHTMLElement4
*iface
)
3713 return CONTAINING_RECORD(iface
, HTMLElement
, IHTMLElement4_iface
);
3716 static HRESULT WINAPI
HTMLElement4_QueryInterface(IHTMLElement4
*iface
,
3717 REFIID riid
, void **ppv
)
3719 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3720 return IHTMLElement_QueryInterface(&This
->IHTMLElement_iface
, riid
, ppv
);
3723 static ULONG WINAPI
HTMLElement4_AddRef(IHTMLElement4
*iface
)
3725 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3726 return IHTMLElement_AddRef(&This
->IHTMLElement_iface
);
3729 static ULONG WINAPI
HTMLElement4_Release(IHTMLElement4
*iface
)
3731 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3732 return IHTMLElement_Release(&This
->IHTMLElement_iface
);
3735 static HRESULT WINAPI
HTMLElement4_GetTypeInfoCount(IHTMLElement4
*iface
, UINT
*pctinfo
)
3737 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3738 return IDispatchEx_GetTypeInfoCount(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
3741 static HRESULT WINAPI
HTMLElement4_GetTypeInfo(IHTMLElement4
*iface
, UINT iTInfo
,
3742 LCID lcid
, ITypeInfo
**ppTInfo
)
3744 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3745 return IDispatchEx_GetTypeInfo(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
3748 static HRESULT WINAPI
HTMLElement4_GetIDsOfNames(IHTMLElement4
*iface
, REFIID riid
,
3749 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
3751 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3752 return IDispatchEx_GetIDsOfNames(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
3756 static HRESULT WINAPI
HTMLElement4_Invoke(IHTMLElement4
*iface
, DISPID dispIdMember
, REFIID riid
,
3757 LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
3759 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3760 return IDispatchEx_Invoke(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
3761 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
3764 static HRESULT WINAPI
HTMLElement4_put_onmousewheel(IHTMLElement4
*iface
, VARIANT v
)
3766 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3768 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3770 return set_node_event(&This
->node
, EVENTID_MOUSEWHEEL
, &v
);
3773 static HRESULT WINAPI
HTMLElement4_get_onmousewheel(IHTMLElement4
*iface
, VARIANT
*p
)
3775 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3777 TRACE("(%p)->(%p)\n", This
, p
);
3779 return get_node_event(&This
->node
, EVENTID_MOUSEWHEEL
, p
);
3782 static HRESULT WINAPI
HTMLElement4_normalize(IHTMLElement4
*iface
)
3784 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3785 FIXME("(%p)\n", This
);
3789 static HRESULT WINAPI
HTMLElement4_getAttributeNode(IHTMLElement4
*iface
, BSTR bstrname
, IHTMLDOMAttribute
**ppAttribute
)
3791 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3792 HTMLAttributeCollection
*attrs
;
3795 TRACE("(%p)->(%s %p)\n", This
, debugstr_w(bstrname
), ppAttribute
);
3797 hres
= HTMLElement_get_attr_col(&This
->node
, &attrs
);
3801 hres
= IHTMLAttributeCollection2_getNamedItem(&attrs
->IHTMLAttributeCollection2_iface
, bstrname
, ppAttribute
);
3802 IHTMLAttributeCollection_Release(&attrs
->IHTMLAttributeCollection_iface
);
3806 static HRESULT WINAPI
HTMLElement4_setAttributeNode(IHTMLElement4
*iface
, IHTMLDOMAttribute
*pattr
,
3807 IHTMLDOMAttribute
**ppretAttribute
)
3809 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3810 HTMLDOMAttribute
*attr
, *iter
, *replace
= NULL
;
3811 HTMLAttributeCollection
*attrs
;
3815 TRACE("(%p)->(%p %p)\n", This
, pattr
, ppretAttribute
);
3817 attr
= unsafe_impl_from_IHTMLDOMAttribute(pattr
);
3819 return E_INVALIDARG
;
3822 WARN("Tried to set already attached attribute.\n");
3823 return E_INVALIDARG
;
3826 hres
= IDispatchEx_GetDispID(&This
->node
.event_target
.dispex
.IDispatchEx_iface
,
3827 attr
->name
, fdexNameCaseInsensitive
|fdexNameEnsure
, &dispid
);
3831 hres
= HTMLElement_get_attr_col(&This
->node
, &attrs
);
3835 LIST_FOR_EACH_ENTRY(iter
, &attrs
->attrs
, HTMLDOMAttribute
, entry
) {
3836 if(iter
->dispid
== dispid
) {
3843 hres
= get_elem_attr_value_by_dispid(This
, dispid
, &replace
->value
);
3845 WARN("could not get attr value: %08x\n", hres
);
3846 V_VT(&replace
->value
) = VT_EMPTY
;
3848 if(!replace
->name
) {
3849 replace
->name
= attr
->name
;
3852 list_add_head(&replace
->entry
, &attr
->entry
);
3853 list_remove(&replace
->entry
);
3854 replace
->elem
= NULL
;
3856 list_add_tail(&attrs
->attrs
, &attr
->entry
);
3859 IHTMLDOMAttribute_AddRef(&attr
->IHTMLDOMAttribute_iface
);
3861 attr
->dispid
= dispid
;
3863 IHTMLAttributeCollection_Release(&attrs
->IHTMLAttributeCollection_iface
);
3865 hres
= set_elem_attr_value_by_dispid(This
, dispid
, &attr
->value
);
3867 WARN("Could not set attribute value: %08x\n", hres
);
3868 VariantClear(&attr
->value
);
3870 *ppretAttribute
= replace
? &replace
->IHTMLDOMAttribute_iface
: NULL
;
3874 static HRESULT WINAPI
HTMLElement4_removeAttributeNode(IHTMLElement4
*iface
, IHTMLDOMAttribute
*pattr
,
3875 IHTMLDOMAttribute
**ppretAttribute
)
3877 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3878 FIXME("(%p)->(%p %p)\n", This
, pattr
, ppretAttribute
);
3882 static HRESULT WINAPI
HTMLElement4_put_onbeforeactivate(IHTMLElement4
*iface
, VARIANT v
)
3884 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3886 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3888 return set_node_event(&This
->node
, EVENTID_BEFOREACTIVATE
, &v
);
3891 static HRESULT WINAPI
HTMLElement4_get_onbeforeactivate(IHTMLElement4
*iface
, VARIANT
*p
)
3893 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3895 TRACE("(%p)->(%p)\n", This
, p
);
3897 return get_node_event(&This
->node
, EVENTID_BEFOREACTIVATE
, p
);
3900 static HRESULT WINAPI
HTMLElement4_put_onfocusin(IHTMLElement4
*iface
, VARIANT v
)
3902 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3904 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3906 return set_node_event(&This
->node
, EVENTID_FOCUSIN
, &v
);
3909 static HRESULT WINAPI
HTMLElement4_get_onfocusin(IHTMLElement4
*iface
, VARIANT
*p
)
3911 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3913 TRACE("(%p)->(%p)\n", This
, p
);
3915 return get_node_event(&This
->node
, EVENTID_FOCUSIN
, p
);
3918 static HRESULT WINAPI
HTMLElement4_put_onfocusout(IHTMLElement4
*iface
, VARIANT v
)
3920 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3922 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3924 return set_node_event(&This
->node
, EVENTID_FOCUSOUT
, &v
);
3927 static HRESULT WINAPI
HTMLElement4_get_onfocusout(IHTMLElement4
*iface
, VARIANT
*p
)
3929 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3931 TRACE("(%p)->(%p)\n", This
, p
);
3933 return get_node_event(&This
->node
, EVENTID_FOCUSOUT
, p
);
3936 static const IHTMLElement4Vtbl HTMLElement4Vtbl
= {
3937 HTMLElement4_QueryInterface
,
3938 HTMLElement4_AddRef
,
3939 HTMLElement4_Release
,
3940 HTMLElement4_GetTypeInfoCount
,
3941 HTMLElement4_GetTypeInfo
,
3942 HTMLElement4_GetIDsOfNames
,
3943 HTMLElement4_Invoke
,
3944 HTMLElement4_put_onmousewheel
,
3945 HTMLElement4_get_onmousewheel
,
3946 HTMLElement4_normalize
,
3947 HTMLElement4_getAttributeNode
,
3948 HTMLElement4_setAttributeNode
,
3949 HTMLElement4_removeAttributeNode
,
3950 HTMLElement4_put_onbeforeactivate
,
3951 HTMLElement4_get_onbeforeactivate
,
3952 HTMLElement4_put_onfocusin
,
3953 HTMLElement4_get_onfocusin
,
3954 HTMLElement4_put_onfocusout
,
3955 HTMLElement4_get_onfocusout
3958 static inline HTMLElement
*impl_from_IHTMLElement6(IHTMLElement6
*iface
)
3960 return CONTAINING_RECORD(iface
, HTMLElement
, IHTMLElement6_iface
);
3963 static HRESULT WINAPI
HTMLElement6_QueryInterface(IHTMLElement6
*iface
,
3964 REFIID riid
, void **ppv
)
3966 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
3967 return IHTMLElement_QueryInterface(&This
->IHTMLElement_iface
, riid
, ppv
);
3970 static ULONG WINAPI
HTMLElement6_AddRef(IHTMLElement6
*iface
)
3972 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
3973 return IHTMLElement_AddRef(&This
->IHTMLElement_iface
);
3976 static ULONG WINAPI
HTMLElement6_Release(IHTMLElement6
*iface
)
3978 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
3979 return IHTMLElement_Release(&This
->IHTMLElement_iface
);
3982 static HRESULT WINAPI
HTMLElement6_GetTypeInfoCount(IHTMLElement6
*iface
, UINT
*pctinfo
)
3984 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
3985 return IDispatchEx_GetTypeInfoCount(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
3988 static HRESULT WINAPI
HTMLElement6_GetTypeInfo(IHTMLElement6
*iface
, UINT iTInfo
,
3989 LCID lcid
, ITypeInfo
**ppTInfo
)
3991 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
3992 return IDispatchEx_GetTypeInfo(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
3995 static HRESULT WINAPI
HTMLElement6_GetIDsOfNames(IHTMLElement6
*iface
, REFIID riid
,
3996 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
3998 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
3999 return IDispatchEx_GetIDsOfNames(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
4003 static HRESULT WINAPI
HTMLElement6_Invoke(IHTMLElement6
*iface
, DISPID dispIdMember
, REFIID riid
,
4004 LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
4006 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4007 return IDispatchEx_Invoke(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
4008 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
4011 static HRESULT WINAPI
HTMLElement6_getAttributeNS(IHTMLElement6
*iface
, VARIANT
*pvarNS
, BSTR strAttributeName
, VARIANT
*AttributeValue
)
4013 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4014 FIXME("(%p)->(%s %s %p)\n", This
, debugstr_variant(pvarNS
), debugstr_w(strAttributeName
), AttributeValue
);
4018 static HRESULT WINAPI
HTMLElement6_setAttributeNS(IHTMLElement6
*iface
, VARIANT
*pvarNS
, BSTR strAttributeName
, VARIANT
*pvarAttributeValue
)
4020 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4021 FIXME("(%p)->(%s %s %s)\n", This
, debugstr_variant(pvarNS
), debugstr_w(strAttributeName
), debugstr_variant(pvarAttributeValue
));
4025 static HRESULT WINAPI
HTMLElement6_removeAttributeNS(IHTMLElement6
*iface
, VARIANT
*pvarNS
, BSTR strAttributeName
)
4027 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4028 FIXME("(%p)->(%s %s)\n", This
, debugstr_variant(pvarNS
), debugstr_w(strAttributeName
));
4032 static HRESULT WINAPI
HTMLElement6_getAttributeNodeNS(IHTMLElement6
*iface
, VARIANT
*pvarNS
, BSTR name
, IHTMLDOMAttribute2
**ppretAttribute
)
4034 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4035 FIXME("(%p)->(%s %s %p)\n", This
, debugstr_variant(pvarNS
), debugstr_w(name
), ppretAttribute
);
4039 static HRESULT WINAPI
HTMLElement6_setAttributeNodeNS(IHTMLElement6
*iface
, IHTMLDOMAttribute2
*pattr
, IHTMLDOMAttribute2
**ppretAttribute
)
4041 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4042 FIXME("(%p)->(%p %p)\n", This
, pattr
, ppretAttribute
);
4046 static HRESULT WINAPI
HTMLElement6_hasAttributeNS(IHTMLElement6
*iface
, VARIANT
*pvarNS
, BSTR name
, VARIANT_BOOL
*pfHasAttribute
)
4048 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4049 FIXME("(%p)->(%s %s %p)\n", This
, debugstr_variant(pvarNS
), debugstr_w(name
), pfHasAttribute
);
4053 static HRESULT WINAPI
HTMLElement6_getAttribute(IHTMLElement6
*iface
, BSTR strAttributeName
, VARIANT
*AttributeValue
)
4055 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4057 WARN("(%p)->(%s %p) forwarding to IHTMLElement\n", This
, debugstr_w(strAttributeName
), AttributeValue
);
4059 return IHTMLElement_getAttribute(&This
->IHTMLElement_iface
, strAttributeName
, 0, AttributeValue
);
4062 static HRESULT WINAPI
HTMLElement6_setAttribute(IHTMLElement6
*iface
, BSTR strAttributeName
, VARIANT
*pvarAttributeValue
)
4064 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4066 WARN("(%p)->(%s %p) forwarding to IHTMLElement\n", This
, debugstr_w(strAttributeName
), pvarAttributeValue
);
4068 return IHTMLElement_setAttribute(&This
->IHTMLElement_iface
, strAttributeName
, *pvarAttributeValue
, 0);
4071 static HRESULT WINAPI
HTMLElement6_removeAttribute(IHTMLElement6
*iface
, BSTR strAttributeName
)
4073 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4074 VARIANT_BOOL success
;
4076 WARN("(%p)->(%s) forwarding to IHTMLElement\n", This
, debugstr_w(strAttributeName
));
4078 return IHTMLElement_removeAttribute(&This
->IHTMLElement_iface
, strAttributeName
, 0, &success
);
4081 static HRESULT WINAPI
HTMLElement6_getAttributeNode(IHTMLElement6
*iface
, BSTR strAttributeName
, IHTMLDOMAttribute2
**ppretAttribute
)
4083 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4084 IHTMLDOMAttribute
*attr
;
4087 WARN("(%p)->(%s %p) forwarding to IHTMLElement4\n", This
, debugstr_w(strAttributeName
), ppretAttribute
);
4089 hres
= IHTMLElement4_getAttributeNode(&This
->IHTMLElement4_iface
, strAttributeName
, &attr
);
4094 hres
= IHTMLDOMAttribute_QueryInterface(attr
, &IID_IHTMLDOMAttribute2
, (void**)ppretAttribute
);
4095 IHTMLDOMAttribute_Release(attr
);
4097 *ppretAttribute
= NULL
;
4102 static HRESULT WINAPI
HTMLElement6_setAttributeNode(IHTMLElement6
*iface
, IHTMLDOMAttribute2
*pattr
, IHTMLDOMAttribute2
**ppretAttribute
)
4104 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4105 IHTMLDOMAttribute
*attr
, *ret_attr
;
4108 WARN("(%p)->(%p %p) forwarding to IHTMLElement4\n", This
, pattr
, ppretAttribute
);
4110 hres
= IHTMLDOMAttribute2_QueryInterface(pattr
, &IID_IHTMLDOMAttribute
, (void**)&attr
);
4114 hres
= IHTMLElement4_setAttributeNode(&This
->IHTMLElement4_iface
, attr
, &ret_attr
);
4119 hres
= IHTMLDOMAttribute_QueryInterface(ret_attr
, &IID_IHTMLDOMAttribute2
, (void**)ppretAttribute
);
4120 IHTMLDOMAttribute_Release(ret_attr
);
4122 *ppretAttribute
= NULL
;
4127 static HRESULT WINAPI
HTMLElement6_removeAttributeNode(IHTMLElement6
*iface
, IHTMLDOMAttribute2
*pattr
, IHTMLDOMAttribute2
**ppretAttribute
)
4129 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4130 FIXME("(%p)->()\n", This
);
4134 static HRESULT WINAPI
HTMLElement6_hasAttribute(IHTMLElement6
*iface
, BSTR name
, VARIANT_BOOL
*pfHasAttribute
)
4136 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4137 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(name
), pfHasAttribute
);
4141 static HRESULT WINAPI
HTMLElement6_getElementsByTagNameNS(IHTMLElement6
*iface
, VARIANT
*varNS
, BSTR bstrLocalName
, IHTMLElementCollection
**pelColl
)
4143 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4144 FIXME("(%p)->(%s %s %p)\n", This
, debugstr_variant(varNS
), debugstr_w(bstrLocalName
), pelColl
);
4148 static HRESULT WINAPI
HTMLElement6_get_tagName(IHTMLElement6
*iface
, BSTR
*p
)
4150 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4152 TRACE("(%p)->(%p)\n", This
, p
);
4154 return IHTMLElement_get_tagName(&This
->IHTMLElement_iface
, p
);
4157 static HRESULT WINAPI
HTMLElement6_get_nodeName(IHTMLElement6
*iface
, BSTR
*p
)
4159 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4161 TRACE("(%p)->(%p)\n", This
, p
);
4163 return IHTMLDOMNode_get_nodeName(&This
->node
.IHTMLDOMNode_iface
, p
);
4166 static HRESULT WINAPI
HTMLElement6_getElementsByClassName(IHTMLElement6
*iface
, BSTR v
, IHTMLElementCollection
**pel
)
4168 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4169 nsIDOMHTMLCollection
*nscol
= NULL
;
4173 TRACE("(%p)->(%s %p)\n", This
, debugstr_w(v
), pel
);
4176 nsAString_InitDepend(&nsstr
, v
);
4177 nsres
= nsIDOMHTMLElement_GetElementsByClassName(This
->nselem
, &nsstr
, &nscol
);
4178 nsAString_Finish(&nsstr
);
4179 if(NS_FAILED(nsres
)) {
4180 ERR("GetElementsByClassName failed: %08x\n", nsres
);
4185 *pel
= create_collection_from_htmlcol(This
->node
.doc
, nscol
);
4186 nsIDOMHTMLCollection_Release(nscol
);
4190 static HRESULT WINAPI
HTMLElement6_msMatchesSelector(IHTMLElement6
*iface
, BSTR v
, VARIANT_BOOL
*pfMatches
)
4192 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4193 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(v
), pfMatches
);
4197 static HRESULT WINAPI
HTMLElement6_put_onabort(IHTMLElement6
*iface
, VARIANT v
)
4199 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4201 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4203 return set_node_event(&This
->node
, EVENTID_ABORT
, &v
);
4206 static HRESULT WINAPI
HTMLElement6_get_onabort(IHTMLElement6
*iface
, VARIANT
*p
)
4208 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4210 TRACE("(%p)->(%p)\n", This
, p
);
4212 return get_node_event(&This
->node
, EVENTID_ABORT
, p
);
4215 static HRESULT WINAPI
HTMLElement6_put_oncanplay(IHTMLElement6
*iface
, VARIANT v
)
4217 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4218 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4222 static HRESULT WINAPI
HTMLElement6_get_oncanplay(IHTMLElement6
*iface
, VARIANT
*p
)
4224 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4225 FIXME("(%p)->(%p)\n", This
, p
);
4229 static HRESULT WINAPI
HTMLElement6_put_oncanplaythrough(IHTMLElement6
*iface
, VARIANT v
)
4231 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4232 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4236 static HRESULT WINAPI
HTMLElement6_get_oncanplaythrough(IHTMLElement6
*iface
, VARIANT
*p
)
4238 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4239 FIXME("(%p)->(%p)\n", This
, p
);
4243 static HRESULT WINAPI
HTMLElement6_put_onchange(IHTMLElement6
*iface
, VARIANT v
)
4245 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4247 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4249 return set_node_event(&This
->node
, EVENTID_CHANGE
, &v
);
4252 static HRESULT WINAPI
HTMLElement6_get_onchange(IHTMLElement6
*iface
, VARIANT
*p
)
4254 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4256 TRACE("(%p)->(%p)\n", This
, p
);
4258 return get_node_event(&This
->node
, EVENTID_CHANGE
, p
);
4261 static HRESULT WINAPI
HTMLElement6_put_ondurationchange(IHTMLElement6
*iface
, VARIANT v
)
4263 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4264 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4268 static HRESULT WINAPI
HTMLElement6_get_ondurationchange(IHTMLElement6
*iface
, VARIANT
*p
)
4270 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4271 FIXME("(%p)->(%p)\n", This
, p
);
4275 static HRESULT WINAPI
HTMLElement6_put_onemptied(IHTMLElement6
*iface
, VARIANT v
)
4277 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4278 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4282 static HRESULT WINAPI
HTMLElement6_get_onemptied(IHTMLElement6
*iface
, VARIANT
*p
)
4284 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4285 FIXME("(%p)->(%p)\n", This
, p
);
4289 static HRESULT WINAPI
HTMLElement6_put_onended(IHTMLElement6
*iface
, VARIANT v
)
4291 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4292 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4296 static HRESULT WINAPI
HTMLElement6_get_onended(IHTMLElement6
*iface
, VARIANT
*p
)
4298 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4299 FIXME("(%p)->(%p)\n", This
, p
);
4303 static HRESULT WINAPI
HTMLElement6_put_onerror(IHTMLElement6
*iface
, VARIANT v
)
4305 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4307 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4309 return set_node_event(&This
->node
, EVENTID_ERROR
, &v
);
4312 static HRESULT WINAPI
HTMLElement6_get_onerror(IHTMLElement6
*iface
, VARIANT
*p
)
4314 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4316 TRACE("(%p)->(%p)\n", This
, p
);
4318 return get_node_event(&This
->node
, EVENTID_ERROR
, p
);
4321 static HRESULT WINAPI
HTMLElement6_put_oninput(IHTMLElement6
*iface
, VARIANT v
)
4323 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4324 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4328 static HRESULT WINAPI
HTMLElement6_get_oninput(IHTMLElement6
*iface
, VARIANT
*p
)
4330 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4331 FIXME("(%p)->(%p)\n", This
, p
);
4335 static HRESULT WINAPI
HTMLElement6_put_onload(IHTMLElement6
*iface
, VARIANT v
)
4337 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4339 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4341 return set_node_event(&This
->node
, EVENTID_LOAD
, &v
);
4344 static HRESULT WINAPI
HTMLElement6_get_onload(IHTMLElement6
*iface
, VARIANT
*p
)
4346 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4348 TRACE("(%p)->(%p)\n", This
, p
);
4350 return get_node_event(&This
->node
, EVENTID_LOAD
, p
);
4353 static HRESULT WINAPI
HTMLElement6_put_onloadeddata(IHTMLElement6
*iface
, VARIANT v
)
4355 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4356 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4360 static HRESULT WINAPI
HTMLElement6_get_onloadeddata(IHTMLElement6
*iface
, VARIANT
*p
)
4362 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4363 FIXME("(%p)->(%p)\n", This
, p
);
4367 static HRESULT WINAPI
HTMLElement6_put_onloadedmetadata(IHTMLElement6
*iface
, VARIANT v
)
4369 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4370 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4374 static HRESULT WINAPI
HTMLElement6_get_onloadedmetadata(IHTMLElement6
*iface
, VARIANT
*p
)
4376 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4377 FIXME("(%p)->(%p)\n", This
, p
);
4381 static HRESULT WINAPI
HTMLElement6_put_onloadstart(IHTMLElement6
*iface
, VARIANT v
)
4383 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4384 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4388 static HRESULT WINAPI
HTMLElement6_get_onloadstart(IHTMLElement6
*iface
, VARIANT
*p
)
4390 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4391 FIXME("(%p)->(%p)\n", This
, p
);
4395 static HRESULT WINAPI
HTMLElement6_put_onpause(IHTMLElement6
*iface
, VARIANT v
)
4397 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4398 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4402 static HRESULT WINAPI
HTMLElement6_get_onpause(IHTMLElement6
*iface
, VARIANT
*p
)
4404 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4405 FIXME("(%p)->(%p)\n", This
, p
);
4409 static HRESULT WINAPI
HTMLElement6_put_onplay(IHTMLElement6
*iface
, VARIANT v
)
4411 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4412 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4416 static HRESULT WINAPI
HTMLElement6_get_onplay(IHTMLElement6
*iface
, VARIANT
*p
)
4418 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4419 FIXME("(%p)->(%p)\n", This
, p
);
4423 static HRESULT WINAPI
HTMLElement6_put_onplaying(IHTMLElement6
*iface
, VARIANT v
)
4425 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4426 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4430 static HRESULT WINAPI
HTMLElement6_get_onplaying(IHTMLElement6
*iface
, VARIANT
*p
)
4432 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4433 FIXME("(%p)->(%p)\n", This
, p
);
4437 static HRESULT WINAPI
HTMLElement6_put_onprogress(IHTMLElement6
*iface
, VARIANT v
)
4439 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4440 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4444 static HRESULT WINAPI
HTMLElement6_get_onprogress(IHTMLElement6
*iface
, VARIANT
*p
)
4446 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4447 FIXME("(%p)->(%p)\n", This
, p
);
4451 static HRESULT WINAPI
HTMLElement6_put_onratechange(IHTMLElement6
*iface
, VARIANT v
)
4453 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4454 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4458 static HRESULT WINAPI
HTMLElement6_get_onratechange(IHTMLElement6
*iface
, VARIANT
*p
)
4460 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4461 FIXME("(%p)->(%p)\n", This
, p
);
4465 static HRESULT WINAPI
HTMLElement6_put_onreset(IHTMLElement6
*iface
, VARIANT v
)
4467 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4468 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4472 static HRESULT WINAPI
HTMLElement6_get_onreset(IHTMLElement6
*iface
, VARIANT
*p
)
4474 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4475 FIXME("(%p)->(%p)\n", This
, p
);
4479 static HRESULT WINAPI
HTMLElement6_put_onseeked(IHTMLElement6
*iface
, VARIANT v
)
4481 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4482 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4486 static HRESULT WINAPI
HTMLElement6_get_onseeked(IHTMLElement6
*iface
, VARIANT
*p
)
4488 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4489 FIXME("(%p)->(%p)\n", This
, p
);
4493 static HRESULT WINAPI
HTMLElement6_put_onseeking(IHTMLElement6
*iface
, VARIANT v
)
4495 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4496 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4500 static HRESULT WINAPI
HTMLElement6_get_onseeking(IHTMLElement6
*iface
, VARIANT
*p
)
4502 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4503 FIXME("(%p)->(%p)\n", This
, p
);
4507 static HRESULT WINAPI
HTMLElement6_put_onselect(IHTMLElement6
*iface
, VARIANT v
)
4509 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4510 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4514 static HRESULT WINAPI
HTMLElement6_get_onselect(IHTMLElement6
*iface
, VARIANT
*p
)
4516 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4517 FIXME("(%p)->(%p)\n", This
, p
);
4521 static HRESULT WINAPI
HTMLElement6_put_onstalled(IHTMLElement6
*iface
, VARIANT v
)
4523 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4524 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4528 static HRESULT WINAPI
HTMLElement6_get_onstalled(IHTMLElement6
*iface
, VARIANT
*p
)
4530 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4531 FIXME("(%p)->(%p)\n", This
, p
);
4535 static HRESULT WINAPI
HTMLElement6_put_onsubmit(IHTMLElement6
*iface
, VARIANT v
)
4537 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4539 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4541 return set_node_event(&This
->node
, EVENTID_SUBMIT
, &v
);
4544 static HRESULT WINAPI
HTMLElement6_get_onsubmit(IHTMLElement6
*iface
, VARIANT
*p
)
4546 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4548 TRACE("(%p)->(%p)\n", This
, p
);
4550 return get_node_event(&This
->node
, EVENTID_SUBMIT
, p
);
4553 static HRESULT WINAPI
HTMLElement6_put_onsuspend(IHTMLElement6
*iface
, VARIANT v
)
4555 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4556 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4560 static HRESULT WINAPI
HTMLElement6_get_onsuspend(IHTMLElement6
*iface
, VARIANT
*p
)
4562 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4563 FIXME("(%p)->(%p)\n", This
, p
);
4567 static HRESULT WINAPI
HTMLElement6_put_ontimeupdate(IHTMLElement6
*iface
, VARIANT v
)
4569 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4570 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4574 static HRESULT WINAPI
HTMLElement6_get_ontimeupdate(IHTMLElement6
*iface
, VARIANT
*p
)
4576 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4577 FIXME("(%p)->(%p)\n", This
, p
);
4581 static HRESULT WINAPI
HTMLElement6_put_onvolumechange(IHTMLElement6
*iface
, VARIANT v
)
4583 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4584 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4588 static HRESULT WINAPI
HTMLElement6_get_onvolumechange(IHTMLElement6
*iface
, VARIANT
*p
)
4590 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4591 FIXME("(%p)->(%p)\n", This
, p
);
4595 static HRESULT WINAPI
HTMLElement6_put_onwaiting(IHTMLElement6
*iface
, VARIANT v
)
4597 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4598 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4602 static HRESULT WINAPI
HTMLElement6_get_onwaiting(IHTMLElement6
*iface
, VARIANT
*p
)
4604 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4605 FIXME("(%p)->(%p)\n", This
, p
);
4609 static HRESULT WINAPI
HTMLElement6_hasAttributes(IHTMLElement6
*iface
, VARIANT_BOOL
*pfHasAttributes
)
4611 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4612 FIXME("(%p)->(%p)\n", This
, pfHasAttributes
);
4616 static const IHTMLElement6Vtbl HTMLElement6Vtbl
= {
4617 HTMLElement6_QueryInterface
,
4618 HTMLElement6_AddRef
,
4619 HTMLElement6_Release
,
4620 HTMLElement6_GetTypeInfoCount
,
4621 HTMLElement6_GetTypeInfo
,
4622 HTMLElement6_GetIDsOfNames
,
4623 HTMLElement6_Invoke
,
4624 HTMLElement6_getAttributeNS
,
4625 HTMLElement6_setAttributeNS
,
4626 HTMLElement6_removeAttributeNS
,
4627 HTMLElement6_getAttributeNodeNS
,
4628 HTMLElement6_setAttributeNodeNS
,
4629 HTMLElement6_hasAttributeNS
,
4630 HTMLElement6_getAttribute
,
4631 HTMLElement6_setAttribute
,
4632 HTMLElement6_removeAttribute
,
4633 HTMLElement6_getAttributeNode
,
4634 HTMLElement6_setAttributeNode
,
4635 HTMLElement6_removeAttributeNode
,
4636 HTMLElement6_hasAttribute
,
4637 HTMLElement6_getElementsByTagNameNS
,
4638 HTMLElement6_get_tagName
,
4639 HTMLElement6_get_nodeName
,
4640 HTMLElement6_getElementsByClassName
,
4641 HTMLElement6_msMatchesSelector
,
4642 HTMLElement6_put_onabort
,
4643 HTMLElement6_get_onabort
,
4644 HTMLElement6_put_oncanplay
,
4645 HTMLElement6_get_oncanplay
,
4646 HTMLElement6_put_oncanplaythrough
,
4647 HTMLElement6_get_oncanplaythrough
,
4648 HTMLElement6_put_onchange
,
4649 HTMLElement6_get_onchange
,
4650 HTMLElement6_put_ondurationchange
,
4651 HTMLElement6_get_ondurationchange
,
4652 HTMLElement6_put_onemptied
,
4653 HTMLElement6_get_onemptied
,
4654 HTMLElement6_put_onended
,
4655 HTMLElement6_get_onended
,
4656 HTMLElement6_put_onerror
,
4657 HTMLElement6_get_onerror
,
4658 HTMLElement6_put_oninput
,
4659 HTMLElement6_get_oninput
,
4660 HTMLElement6_put_onload
,
4661 HTMLElement6_get_onload
,
4662 HTMLElement6_put_onloadeddata
,
4663 HTMLElement6_get_onloadeddata
,
4664 HTMLElement6_put_onloadedmetadata
,
4665 HTMLElement6_get_onloadedmetadata
,
4666 HTMLElement6_put_onloadstart
,
4667 HTMLElement6_get_onloadstart
,
4668 HTMLElement6_put_onpause
,
4669 HTMLElement6_get_onpause
,
4670 HTMLElement6_put_onplay
,
4671 HTMLElement6_get_onplay
,
4672 HTMLElement6_put_onplaying
,
4673 HTMLElement6_get_onplaying
,
4674 HTMLElement6_put_onprogress
,
4675 HTMLElement6_get_onprogress
,
4676 HTMLElement6_put_onratechange
,
4677 HTMLElement6_get_onratechange
,
4678 HTMLElement6_put_onreset
,
4679 HTMLElement6_get_onreset
,
4680 HTMLElement6_put_onseeked
,
4681 HTMLElement6_get_onseeked
,
4682 HTMLElement6_put_onseeking
,
4683 HTMLElement6_get_onseeking
,
4684 HTMLElement6_put_onselect
,
4685 HTMLElement6_get_onselect
,
4686 HTMLElement6_put_onstalled
,
4687 HTMLElement6_get_onstalled
,
4688 HTMLElement6_put_onsubmit
,
4689 HTMLElement6_get_onsubmit
,
4690 HTMLElement6_put_onsuspend
,
4691 HTMLElement6_get_onsuspend
,
4692 HTMLElement6_put_ontimeupdate
,
4693 HTMLElement6_get_ontimeupdate
,
4694 HTMLElement6_put_onvolumechange
,
4695 HTMLElement6_get_onvolumechange
,
4696 HTMLElement6_put_onwaiting
,
4697 HTMLElement6_get_onwaiting
,
4698 HTMLElement6_hasAttributes
4701 static inline HTMLElement
*impl_from_IHTMLUniqueName(IHTMLUniqueName
*iface
)
4703 return CONTAINING_RECORD(iface
, HTMLElement
, IHTMLUniqueName_iface
);
4706 static HRESULT WINAPI
HTMLUniqueName_QueryInterface(IHTMLUniqueName
*iface
, REFIID riid
, void **ppv
)
4708 HTMLElement
*This
= impl_from_IHTMLUniqueName(iface
);
4709 return IHTMLElement_QueryInterface(&This
->IHTMLElement_iface
, riid
, ppv
);
4712 static ULONG WINAPI
HTMLUniqueName_AddRef(IHTMLUniqueName
*iface
)
4714 HTMLElement
*This
= impl_from_IHTMLUniqueName(iface
);
4715 return IHTMLElement_AddRef(&This
->IHTMLElement_iface
);
4718 static ULONG WINAPI
HTMLUniqueName_Release(IHTMLUniqueName
*iface
)
4720 HTMLElement
*This
= impl_from_IHTMLUniqueName(iface
);
4721 return IHTMLElement_Release(&This
->IHTMLElement_iface
);
4724 static HRESULT WINAPI
HTMLUniqueName_GetTypeInfoCount(IHTMLUniqueName
*iface
, UINT
*pctinfo
)
4726 HTMLElement
*This
= impl_from_IHTMLUniqueName(iface
);
4727 return IDispatchEx_GetTypeInfoCount(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
4730 static HRESULT WINAPI
HTMLUniqueName_GetTypeInfo(IHTMLUniqueName
*iface
, UINT iTInfo
,
4731 LCID lcid
, ITypeInfo
**ppTInfo
)
4733 HTMLElement
*This
= impl_from_IHTMLUniqueName(iface
);
4734 return IDispatchEx_GetTypeInfo(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
4737 static HRESULT WINAPI
HTMLUniqueName_GetIDsOfNames(IHTMLUniqueName
*iface
, REFIID riid
,
4738 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
4740 HTMLElement
*This
= impl_from_IHTMLUniqueName(iface
);
4741 return IDispatchEx_GetIDsOfNames(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
4745 static HRESULT WINAPI
HTMLUniqueName_Invoke(IHTMLUniqueName
*iface
, DISPID dispIdMember
, REFIID riid
,
4746 LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
4748 HTMLElement
*This
= impl_from_IHTMLUniqueName(iface
);
4749 return IDispatchEx_Invoke(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
4750 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
4753 HRESULT
elem_unique_id(unsigned id
, BSTR
*p
)
4757 static const WCHAR formatW
[] = {'m','s','_','_','i','d','%','u',0};
4759 sprintfW(buf
, formatW
, id
);
4760 *p
= SysAllocString(buf
);
4761 return *p
? S_OK
: E_OUTOFMEMORY
;
4764 static void ensure_unique_id(HTMLElement
*elem
)
4766 if(!elem
->unique_id
)
4767 elem
->unique_id
= ++elem
->node
.doc
->unique_id
;
4770 static HRESULT WINAPI
HTMLUniqueName_get_uniqueNumber(IHTMLUniqueName
*iface
, LONG
*p
)
4772 HTMLElement
*This
= impl_from_IHTMLUniqueName(iface
);
4774 TRACE("(%p)->(%p)\n", This
, p
);
4776 ensure_unique_id(This
);
4777 *p
= This
->unique_id
;
4781 static HRESULT WINAPI
HTMLUniqueName_get_uniqueID(IHTMLUniqueName
*iface
, BSTR
*p
)
4783 HTMLElement
*This
= impl_from_IHTMLUniqueName(iface
);
4785 TRACE("(%p)->(%p)\n", This
, p
);
4787 ensure_unique_id(This
);
4788 return elem_unique_id(This
->unique_id
, p
);
4791 static const IHTMLUniqueNameVtbl HTMLUniqueNameVtbl
= {
4792 HTMLUniqueName_QueryInterface
,
4793 HTMLUniqueName_AddRef
,
4794 HTMLUniqueName_Release
,
4795 HTMLUniqueName_GetTypeInfoCount
,
4796 HTMLUniqueName_GetTypeInfo
,
4797 HTMLUniqueName_GetIDsOfNames
,
4798 HTMLUniqueName_Invoke
,
4799 HTMLUniqueName_get_uniqueNumber
,
4800 HTMLUniqueName_get_uniqueID
4803 static inline HTMLElement
*impl_from_IElementSelector(IElementSelector
*iface
)
4805 return CONTAINING_RECORD(iface
, HTMLElement
, IElementSelector_iface
);
4808 static HRESULT WINAPI
ElementSelector_QueryInterface(IElementSelector
*iface
, REFIID riid
, void **ppv
)
4810 HTMLElement
*This
= impl_from_IElementSelector(iface
);
4811 return IHTMLElement_QueryInterface(&This
->IHTMLElement_iface
, riid
, ppv
);
4814 static ULONG WINAPI
ElementSelector_AddRef(IElementSelector
*iface
)
4816 HTMLElement
*This
= impl_from_IElementSelector(iface
);
4817 return IHTMLElement_AddRef(&This
->IHTMLElement_iface
);
4820 static ULONG WINAPI
ElementSelector_Release(IElementSelector
*iface
)
4822 HTMLElement
*This
= impl_from_IElementSelector(iface
);
4823 return IHTMLElement_Release(&This
->IHTMLElement_iface
);
4826 static HRESULT WINAPI
ElementSelector_GetTypeInfoCount(IElementSelector
*iface
, UINT
*pctinfo
)
4828 HTMLElement
*This
= impl_from_IElementSelector(iface
);
4829 return IDispatchEx_GetTypeInfoCount(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
4832 static HRESULT WINAPI
ElementSelector_GetTypeInfo(IElementSelector
*iface
, UINT iTInfo
,
4833 LCID lcid
, ITypeInfo
**ppTInfo
)
4835 HTMLElement
*This
= impl_from_IElementSelector(iface
);
4836 return IDispatchEx_GetTypeInfo(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
4839 static HRESULT WINAPI
ElementSelector_GetIDsOfNames(IElementSelector
*iface
, REFIID riid
,
4840 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
4842 HTMLElement
*This
= impl_from_IElementSelector(iface
);
4843 return IDispatchEx_GetIDsOfNames(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
, lcid
, rgDispId
);
4846 static HRESULT WINAPI
ElementSelector_Invoke(IElementSelector
*iface
, DISPID dispIdMember
, REFIID riid
,
4847 LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
4849 HTMLElement
*This
= impl_from_IElementSelector(iface
);
4850 return IDispatchEx_Invoke(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
, wFlags
,
4851 pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
4854 static HRESULT WINAPI
ElementSelector_querySelector(IElementSelector
*iface
, BSTR v
, IHTMLElement
**pel
)
4856 HTMLElement
*This
= impl_from_IElementSelector(iface
);
4857 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(v
), pel
);
4861 static HRESULT WINAPI
ElementSelector_querySelectorAll(IElementSelector
*iface
, BSTR v
, IHTMLDOMChildrenCollection
**pel
)
4863 HTMLElement
*This
= impl_from_IElementSelector(iface
);
4864 nsIDOMNodeList
*node_list
;
4868 TRACE("(%p)->(%s %p)\n", This
, debugstr_w(v
), pel
);
4870 nsAString_InitDepend(&nsstr
, v
);
4871 nsres
= nsIDOMHTMLElement_QuerySelectorAll(This
->nselem
, &nsstr
, &node_list
);
4872 nsAString_Finish(&nsstr
);
4873 if(NS_FAILED(nsres
)) {
4874 ERR("QuerySelectorAll failed: %08x\n", nsres
);
4878 *pel
= create_child_collection(This
->node
.doc
, node_list
);
4879 nsIDOMNodeList_Release(node_list
);
4880 return *pel
? S_OK
: E_OUTOFMEMORY
;
4883 static const IElementSelectorVtbl ElementSelectorVtbl
= {
4884 ElementSelector_QueryInterface
,
4885 ElementSelector_AddRef
,
4886 ElementSelector_Release
,
4887 ElementSelector_GetTypeInfoCount
,
4888 ElementSelector_GetTypeInfo
,
4889 ElementSelector_GetIDsOfNames
,
4890 ElementSelector_Invoke
,
4891 ElementSelector_querySelector
,
4892 ElementSelector_querySelectorAll
4895 static inline HTMLElement
*impl_from_IProvideMultipleClassInfo(IProvideMultipleClassInfo
*iface
)
4897 return CONTAINING_RECORD(iface
, HTMLElement
, IProvideMultipleClassInfo_iface
);
4900 static HRESULT WINAPI
ProvideClassInfo_QueryInterface(IProvideMultipleClassInfo
*iface
,
4901 REFIID riid
, void **ppv
)
4903 HTMLElement
*This
= impl_from_IProvideMultipleClassInfo(iface
);
4904 return IHTMLElement_QueryInterface(&This
->IHTMLElement_iface
, riid
, ppv
);
4907 static ULONG WINAPI
ProvideClassInfo_AddRef(IProvideMultipleClassInfo
*iface
)
4909 HTMLElement
*This
= impl_from_IProvideMultipleClassInfo(iface
);
4910 return IHTMLElement_AddRef(&This
->IHTMLElement_iface
);
4913 static ULONG WINAPI
ProvideClassInfo_Release(IProvideMultipleClassInfo
*iface
)
4915 HTMLElement
*This
= impl_from_IProvideMultipleClassInfo(iface
);
4916 return IHTMLElement_Release(&This
->IHTMLElement_iface
);
4919 static HRESULT WINAPI
ProvideClassInfo_GetClassInfo(IProvideMultipleClassInfo
*iface
, ITypeInfo
**ppTI
)
4921 HTMLElement
*This
= impl_from_IProvideMultipleClassInfo(iface
);
4922 TRACE("(%p)->(%p)\n", This
, ppTI
);
4923 return get_class_typeinfo(This
->node
.vtbl
->clsid
, ppTI
);
4926 static HRESULT WINAPI
ProvideClassInfo2_GetGUID(IProvideMultipleClassInfo
*iface
, DWORD dwGuidKind
, GUID
*pGUID
)
4928 HTMLElement
*This
= impl_from_IProvideMultipleClassInfo(iface
);
4929 FIXME("(%p)->(%u %p)\n", This
, dwGuidKind
, pGUID
);
4933 static HRESULT WINAPI
ProvideMultipleClassInfo_GetMultiTypeInfoCount(IProvideMultipleClassInfo
*iface
, ULONG
*pcti
)
4935 HTMLElement
*This
= impl_from_IProvideMultipleClassInfo(iface
);
4936 FIXME("(%p)->(%p)\n", This
, pcti
);
4941 static HRESULT WINAPI
ProvideMultipleClassInfo_GetInfoOfIndex(IProvideMultipleClassInfo
*iface
, ULONG iti
,
4942 DWORD dwFlags
, ITypeInfo
**pptiCoClass
, DWORD
*pdwTIFlags
, ULONG
*pcdispidReserved
, IID
*piidPrimary
, IID
*piidSource
)
4944 HTMLElement
*This
= impl_from_IProvideMultipleClassInfo(iface
);
4945 FIXME("(%p)->(%u %x %p %p %p %p %p)\n", This
, iti
, dwFlags
, pptiCoClass
, pdwTIFlags
, pcdispidReserved
, piidPrimary
, piidSource
);
4949 static const IProvideMultipleClassInfoVtbl ProvideMultipleClassInfoVtbl
= {
4950 ProvideClassInfo_QueryInterface
,
4951 ProvideClassInfo_AddRef
,
4952 ProvideClassInfo_Release
,
4953 ProvideClassInfo_GetClassInfo
,
4954 ProvideClassInfo2_GetGUID
,
4955 ProvideMultipleClassInfo_GetMultiTypeInfoCount
,
4956 ProvideMultipleClassInfo_GetInfoOfIndex
4959 static inline HTMLElement
*impl_from_IElementTraversal(IElementTraversal
*iface
)
4961 return CONTAINING_RECORD(iface
, HTMLElement
, IElementTraversal_iface
);
4964 static HRESULT WINAPI
ElementTraversal_QueryInterface(IElementTraversal
*iface
, REFIID riid
, void **ppv
)
4966 HTMLElement
*This
= impl_from_IElementTraversal(iface
);
4967 return IHTMLElement_QueryInterface(&This
->IHTMLElement_iface
, riid
, ppv
);
4970 static ULONG WINAPI
ElementTraversal_AddRef(IElementTraversal
*iface
)
4972 HTMLElement
*This
= impl_from_IElementTraversal(iface
);
4974 return IHTMLElement_AddRef(&This
->IHTMLElement_iface
);
4977 static ULONG WINAPI
ElementTraversal_Release(IElementTraversal
*iface
)
4979 HTMLElement
*This
= impl_from_IElementTraversal(iface
);
4981 return IHTMLElement_Release(&This
->IHTMLElement_iface
);
4984 static HRESULT WINAPI
ElementTraversal_GetTypeInfoCount(IElementTraversal
*iface
, UINT
*pctinfo
)
4986 HTMLElement
*This
= impl_from_IElementTraversal(iface
);
4987 return IDispatchEx_GetTypeInfoCount(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
4990 static HRESULT WINAPI
ElementTraversal_GetTypeInfo(IElementTraversal
*iface
, UINT iTInfo
,
4991 LCID lcid
, ITypeInfo
**ppTInfo
)
4993 HTMLElement
*This
= impl_from_IElementTraversal(iface
);
4994 return IDispatchEx_GetTypeInfo(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
4997 static HRESULT WINAPI
ElementTraversal_GetIDsOfNames(IElementTraversal
*iface
, REFIID riid
,
4998 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
5000 HTMLElement
*This
= impl_from_IElementTraversal(iface
);
5001 return IDispatchEx_GetIDsOfNames(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
5005 static HRESULT WINAPI
ElementTraversal_Invoke(IElementTraversal
*iface
, DISPID dispIdMember
, REFIID riid
,
5006 LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
5008 HTMLElement
*This
= impl_from_IElementTraversal(iface
);
5009 return IDispatchEx_Invoke(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
5010 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
5013 static HRESULT WINAPI
ElementTraversal_get_firstElementChild(IElementTraversal
*iface
, IHTMLElement
**p
)
5015 HTMLElement
*This
= impl_from_IElementTraversal(iface
);
5016 nsIDOMElement
*nselem
= NULL
;
5020 TRACE("(%p)->(%p)\n", This
, p
);
5022 nsIDOMHTMLElement_GetFirstElementChild(This
->nselem
, &nselem
);
5028 hres
= get_elem(This
->node
.doc
, nselem
, &elem
);
5029 nsIDOMElement_Release(nselem
);
5033 *p
= &elem
->IHTMLElement_iface
;
5037 static HRESULT WINAPI
ElementTraversal_get_lastElementChild(IElementTraversal
*iface
, IHTMLElement
**p
)
5039 HTMLElement
*This
= impl_from_IElementTraversal(iface
);
5040 FIXME("(%p)->(%p)\n", This
, p
);
5044 static HRESULT WINAPI
ElementTraversal_get_previousElementSibling(IElementTraversal
*iface
, IHTMLElement
**p
)
5046 HTMLElement
*This
= impl_from_IElementTraversal(iface
);
5047 FIXME("(%p)->(%p)\n", This
, p
);
5051 static HRESULT WINAPI
ElementTraversal_get_nextElementSibling(IElementTraversal
*iface
, IHTMLElement
**p
)
5053 HTMLElement
*This
= impl_from_IElementTraversal(iface
);
5054 FIXME("(%p)->(%p)\n", This
, p
);
5058 static HRESULT WINAPI
ElementTraversal_get_childElementCount(IElementTraversal
*iface
, LONG
*p
)
5060 HTMLElement
*This
= impl_from_IElementTraversal(iface
);
5061 FIXME("(%p)->(%p)\n", This
, p
);
5065 static const IElementTraversalVtbl ElementTraversalVtbl
= {
5066 ElementTraversal_QueryInterface
,
5067 ElementTraversal_AddRef
,
5068 ElementTraversal_Release
,
5069 ElementTraversal_GetTypeInfoCount
,
5070 ElementTraversal_GetTypeInfo
,
5071 ElementTraversal_GetIDsOfNames
,
5072 ElementTraversal_Invoke
,
5073 ElementTraversal_get_firstElementChild
,
5074 ElementTraversal_get_lastElementChild
,
5075 ElementTraversal_get_previousElementSibling
,
5076 ElementTraversal_get_nextElementSibling
,
5077 ElementTraversal_get_childElementCount
5080 static inline HTMLElement
*impl_from_HTMLDOMNode(HTMLDOMNode
*iface
)
5082 return CONTAINING_RECORD(iface
, HTMLElement
, node
);
5085 HRESULT
HTMLElement_QI(HTMLDOMNode
*iface
, REFIID riid
, void **ppv
)
5087 HTMLElement
*This
= impl_from_HTMLDOMNode(iface
);
5089 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
5090 *ppv
= &This
->IHTMLElement_iface
;
5091 }else if(IsEqualGUID(&IID_IDispatch
, riid
)) {
5092 *ppv
= &This
->IHTMLElement_iface
;
5093 }else if(IsEqualGUID(&IID_IHTMLElement
, riid
)) {
5094 *ppv
= &This
->IHTMLElement_iface
;
5095 }else if(IsEqualGUID(&IID_IHTMLElement2
, riid
)) {
5096 *ppv
= &This
->IHTMLElement2_iface
;
5097 }else if(IsEqualGUID(&IID_IHTMLElement3
, riid
)) {
5098 *ppv
= &This
->IHTMLElement3_iface
;
5099 }else if(IsEqualGUID(&IID_IHTMLElement4
, riid
)) {
5100 *ppv
= &This
->IHTMLElement4_iface
;
5101 }else if(IsEqualGUID(&IID_IHTMLElement6
, riid
)) {
5102 *ppv
= &This
->IHTMLElement6_iface
;
5103 }else if(IsEqualGUID(&IID_IHTMLUniqueName
, riid
)) {
5104 *ppv
= &This
->IHTMLUniqueName_iface
;
5105 }else if(IsEqualGUID(&IID_IElementSelector
, riid
)) {
5106 *ppv
= &This
->IElementSelector_iface
;
5107 }else if(IsEqualGUID(&IID_IElementTraversal
, riid
)) {
5108 *ppv
= &This
->IElementTraversal_iface
;
5109 }else if(IsEqualGUID(&IID_IConnectionPointContainer
, riid
)) {
5110 *ppv
= &This
->cp_container
.IConnectionPointContainer_iface
;
5111 }else if(IsEqualGUID(&IID_IProvideClassInfo
, riid
)) {
5112 *ppv
= &This
->IProvideMultipleClassInfo_iface
;
5113 }else if(IsEqualGUID(&IID_IProvideClassInfo2
, riid
)) {
5114 *ppv
= &This
->IProvideMultipleClassInfo_iface
;
5115 }else if(IsEqualGUID(&IID_IProvideMultipleClassInfo
, riid
)) {
5116 *ppv
= &This
->IProvideMultipleClassInfo_iface
;
5118 return HTMLDOMNode_QI(&This
->node
, riid
, ppv
);
5121 IUnknown_AddRef((IUnknown
*)*ppv
);
5125 void HTMLElement_destructor(HTMLDOMNode
*iface
)
5127 HTMLElement
*This
= impl_from_HTMLDOMNode(iface
);
5129 ConnectionPointContainer_Destroy(&This
->cp_container
);
5132 This
->style
->elem
= NULL
;
5133 IHTMLStyle_Release(&This
->style
->IHTMLStyle_iface
);
5135 if(This
->runtime_style
) {
5136 This
->runtime_style
->elem
= NULL
;
5137 IHTMLStyle_Release(&This
->runtime_style
->IHTMLStyle_iface
);
5140 HTMLDOMAttribute
*attr
;
5142 LIST_FOR_EACH_ENTRY(attr
, &This
->attrs
->attrs
, HTMLDOMAttribute
, entry
)
5145 This
->attrs
->elem
= NULL
;
5146 IHTMLAttributeCollection_Release(&This
->attrs
->IHTMLAttributeCollection_iface
);
5149 heap_free(This
->filter
);
5151 HTMLDOMNode_destructor(&This
->node
);
5154 HRESULT
HTMLElement_clone(HTMLDOMNode
*iface
, nsIDOMNode
*nsnode
, HTMLDOMNode
**ret
)
5156 HTMLElement
*This
= impl_from_HTMLDOMNode(iface
);
5157 HTMLElement
*new_elem
;
5160 hres
= HTMLElement_Create(This
->node
.doc
, nsnode
, FALSE
, &new_elem
);
5165 new_elem
->filter
= heap_strdupW(This
->filter
);
5166 if(!new_elem
->filter
) {
5167 IHTMLElement_Release(&This
->IHTMLElement_iface
);
5168 return E_OUTOFMEMORY
;
5172 *ret
= &new_elem
->node
;
5176 HRESULT
HTMLElement_handle_event(HTMLDOMNode
*iface
, DWORD eid
, nsIDOMEvent
*event
, BOOL
*prevent_default
)
5178 HTMLElement
*This
= impl_from_HTMLDOMNode(iface
);
5181 case EVENTID_KEYDOWN
: {
5182 nsIDOMKeyEvent
*key_event
;
5185 nsres
= nsIDOMEvent_QueryInterface(event
, &IID_nsIDOMKeyEvent
, (void**)&key_event
);
5186 if(NS_SUCCEEDED(nsres
)) {
5189 nsIDOMKeyEvent_GetKeyCode(key_event
, &code
);
5191 if(code
== VK_F1
/* DOM_VK_F1 */) {
5192 DOMEvent
*help_event
;
5195 TRACE("F1 pressed\n");
5197 hres
= create_document_event(This
->node
.doc
, EVENTID_HELP
, &help_event
);
5198 if(SUCCEEDED(hres
)) {
5199 dispatch_event(&This
->node
.event_target
, help_event
);
5200 IDOMEvent_Release(&help_event
->IDOMEvent_iface
);
5202 *prevent_default
= TRUE
;
5205 nsIDOMKeyEvent_Release(key_event
);
5213 cp_static_data_t HTMLElementEvents2_data
= { HTMLElementEvents2_tid
, NULL
/* FIXME */, TRUE
};
5215 const cpc_entry_t HTMLElement_cpc
[] = {
5220 static const NodeImplVtbl HTMLElementImplVtbl
= {
5221 &CLSID_HTMLUnknownElement
,
5223 HTMLElement_destructor
,
5226 HTMLElement_handle_event
,
5227 HTMLElement_get_attr_col
5230 static inline HTMLElement
*impl_from_DispatchEx(DispatchEx
*iface
)
5232 return CONTAINING_RECORD(iface
, HTMLElement
, node
.event_target
.dispex
);
5235 static HRESULT
HTMLElement_get_dispid(DispatchEx
*dispex
, BSTR name
,
5236 DWORD grfdex
, DISPID
*pid
)
5238 HTMLElement
*This
= impl_from_DispatchEx(dispex
);
5240 if(This
->node
.vtbl
->get_dispid
)
5241 return This
->node
.vtbl
->get_dispid(&This
->node
, name
, grfdex
, pid
);
5243 return DISP_E_UNKNOWNNAME
;
5246 static HRESULT
HTMLElement_invoke(DispatchEx
*dispex
, DISPID id
, LCID lcid
,
5247 WORD flags
, DISPPARAMS
*params
, VARIANT
*res
, EXCEPINFO
*ei
,
5248 IServiceProvider
*caller
)
5250 HTMLElement
*This
= impl_from_DispatchEx(dispex
);
5252 if(This
->node
.vtbl
->invoke
)
5253 return This
->node
.vtbl
->invoke(&This
->node
, id
, lcid
, flags
,
5254 params
, res
, ei
, caller
);
5256 ERR("(%p): element has no invoke method\n", This
);
5260 static HRESULT
HTMLElement_populate_props(DispatchEx
*dispex
)
5262 HTMLElement
*This
= impl_from_DispatchEx(dispex
);
5263 nsIDOMMozNamedAttrMap
*attrs
;
5266 const PRUnichar
*str
;
5278 nsres
= nsIDOMHTMLElement_GetAttributes(This
->nselem
, &attrs
);
5279 if(NS_FAILED(nsres
))
5282 nsres
= nsIDOMMozNamedAttrMap_GetLength(attrs
, &len
);
5283 if(NS_FAILED(nsres
)) {
5284 nsIDOMMozNamedAttrMap_Release(attrs
);
5288 nsAString_Init(&nsstr
, NULL
);
5289 for(i
=0; i
<len
; i
++) {
5290 nsres
= nsIDOMMozNamedAttrMap_Item(attrs
, i
, &attr
);
5291 if(NS_FAILED(nsres
))
5294 nsres
= nsIDOMAttr_GetNodeName(attr
, &nsstr
);
5295 if(NS_FAILED(nsres
)) {
5296 nsIDOMAttr_Release(attr
);
5300 nsAString_GetData(&nsstr
, &str
);
5301 name
= SysAllocString(str
);
5303 nsIDOMAttr_Release(attr
);
5307 hres
= IDispatchEx_GetDispID(&dispex
->IDispatchEx_iface
, name
, fdexNameCaseInsensitive
, &id
);
5308 if(hres
!= DISP_E_UNKNOWNNAME
) {
5309 nsIDOMAttr_Release(attr
);
5310 SysFreeString(name
);
5314 nsres
= nsIDOMAttr_GetNodeValue(attr
, &nsstr
);
5315 nsIDOMAttr_Release(attr
);
5316 if(NS_FAILED(nsres
)) {
5317 SysFreeString(name
);
5321 nsAString_GetData(&nsstr
, &str
);
5322 V_VT(&value
) = VT_BSTR
;
5324 V_BSTR(&value
) = SysAllocString(str
);
5325 if(!V_BSTR(&value
)) {
5326 SysFreeString(name
);
5330 V_BSTR(&value
) = NULL
;
5332 IHTMLElement_setAttribute(&This
->IHTMLElement_iface
, name
, value
, 0);
5333 SysFreeString(name
);
5334 VariantClear(&value
);
5336 nsAString_Finish(&nsstr
);
5338 nsIDOMMozNamedAttrMap_Release(attrs
);
5342 static void HTMLElement_bind_event(DispatchEx
*dispex
, eventid_t eid
)
5344 HTMLElement
*This
= impl_from_DispatchEx(dispex
);
5346 static const WCHAR loadW
[] = {'l','o','a','d',0};
5350 add_nsevent_listener(This
->node
.doc
, This
->node
.nsnode
, loadW
);
5353 ensure_doc_nsevent_handler(This
->node
.doc
, eid
);
5357 static HRESULT
HTMLElement_handle_event_default(DispatchEx
*dispex
, eventid_t eid
, nsIDOMEvent
*nsevent
, BOOL
*prevent_default
)
5359 HTMLElement
*This
= impl_from_DispatchEx(dispex
);
5361 if(!This
->node
.vtbl
->handle_event
)
5363 return This
->node
.vtbl
->handle_event(&This
->node
, eid
, nsevent
, prevent_default
);
5366 static EventTarget
*HTMLElement_get_parent_event_target(DispatchEx
*dispex
)
5368 HTMLElement
*This
= impl_from_DispatchEx(dispex
);
5374 nsres
= nsIDOMNode_GetParentNode(This
->node
.nsnode
, &nsnode
);
5375 assert(nsres
== NS_OK
);
5379 hres
= get_node(This
->node
.doc
, nsnode
, TRUE
, &node
);
5380 nsIDOMNode_Release(nsnode
);
5384 return &node
->event_target
;
5387 static ConnectionPointContainer
*HTMLElement_get_cp_container(DispatchEx
*dispex
)
5389 HTMLElement
*This
= impl_from_DispatchEx(dispex
);
5390 IConnectionPointContainer_AddRef(&This
->cp_container
.IConnectionPointContainer_iface
);
5391 return &This
->cp_container
;
5394 static IHTMLEventObj
*HTMLElement_set_current_event(DispatchEx
*dispex
, IHTMLEventObj
*event
)
5396 HTMLElement
*This
= impl_from_DispatchEx(dispex
);
5397 return default_set_current_event(This
->node
.doc
->window
, event
);
5400 void HTMLElement_init_dispex_info(dispex_data_t
*info
, compat_mode_t mode
)
5402 static const DISPID elem2_ie11_blacklist
[] = {DISPID_IHTMLELEMENT2_DOSCROLL
, DISPID_UNKNOWN
};
5404 HTMLDOMNode_init_dispex_info(info
, mode
);
5406 dispex_info_add_interface(info
, IHTMLElement2_tid
, mode
>= COMPAT_MODE_IE11
? elem2_ie11_blacklist
: NULL
);
5408 if(mode
>= COMPAT_MODE_IE8
)
5409 dispex_info_add_interface(info
, IElementSelector_tid
, NULL
);
5411 if(mode
>= COMPAT_MODE_IE9
) {
5412 dispex_info_add_interface(info
, IHTMLElement6_tid
, NULL
);
5413 dispex_info_add_interface(info
, IElementTraversal_tid
, NULL
);
5417 static const tid_t HTMLElement_iface_tids
[] = {
5422 static event_target_vtbl_t HTMLElement_event_target_vtbl
= {
5425 HTMLElement_get_dispid
,
5428 HTMLElement_populate_props
5430 HTMLElement_bind_event
,
5431 HTMLElement_get_parent_event_target
,
5432 HTMLElement_handle_event_default
,
5433 HTMLElement_get_cp_container
,
5434 HTMLElement_set_current_event
5437 static dispex_static_data_t HTMLElement_dispex
= {
5438 &HTMLElement_event_target_vtbl
.dispex_vtbl
,
5439 DispHTMLUnknownElement_tid
,
5440 HTMLElement_iface_tids
,
5441 HTMLElement_init_dispex_info
5444 void HTMLElement_Init(HTMLElement
*This
, HTMLDocumentNode
*doc
, nsIDOMHTMLElement
*nselem
, dispex_static_data_t
*dispex_data
)
5446 This
->IHTMLElement_iface
.lpVtbl
= &HTMLElementVtbl
;
5447 This
->IHTMLElement2_iface
.lpVtbl
= &HTMLElement2Vtbl
;
5448 This
->IHTMLElement3_iface
.lpVtbl
= &HTMLElement3Vtbl
;
5449 This
->IHTMLElement4_iface
.lpVtbl
= &HTMLElement4Vtbl
;
5450 This
->IHTMLElement6_iface
.lpVtbl
= &HTMLElement6Vtbl
;
5451 This
->IHTMLUniqueName_iface
.lpVtbl
= &HTMLUniqueNameVtbl
;
5452 This
->IElementSelector_iface
.lpVtbl
= &ElementSelectorVtbl
;
5453 This
->IElementTraversal_iface
.lpVtbl
= &ElementTraversalVtbl
;
5454 This
->IProvideMultipleClassInfo_iface
.lpVtbl
= &ProvideMultipleClassInfoVtbl
;
5456 if(dispex_data
&& !dispex_data
->vtbl
)
5457 dispex_data
->vtbl
= &HTMLElement_event_target_vtbl
.dispex_vtbl
;
5460 HTMLDOMNode_Init(doc
, &This
->node
, (nsIDOMNode
*)nselem
, dispex_data
? dispex_data
: &HTMLElement_dispex
);
5462 /* No AddRef, share reference with HTMLDOMNode */
5463 assert((nsIDOMNode
*)nselem
== This
->node
.nsnode
);
5464 This
->nselem
= nselem
;
5467 ConnectionPointContainer_Init(&This
->cp_container
, (IUnknown
*)&This
->IHTMLElement_iface
, This
->node
.vtbl
->cpc_entries
);
5470 HRESULT
HTMLElement_Create(HTMLDocumentNode
*doc
, nsIDOMNode
*nsnode
, BOOL use_generic
, HTMLElement
**ret
)
5472 nsIDOMHTMLElement
*nselem
;
5473 nsAString class_name_str
;
5474 const PRUnichar
*class_name
;
5475 const tag_desc_t
*tag
;
5480 nsres
= nsIDOMNode_QueryInterface(nsnode
, &IID_nsIDOMHTMLElement
, (void**)&nselem
);
5481 if(NS_FAILED(nsres
))
5484 nsAString_Init(&class_name_str
, NULL
);
5485 nsIDOMHTMLElement_GetTagName(nselem
, &class_name_str
);
5487 nsAString_GetData(&class_name_str
, &class_name
);
5489 tag
= get_tag_desc(class_name
);
5491 hres
= tag
->constructor(doc
, nselem
, &elem
);
5492 }else if(use_generic
) {
5493 hres
= HTMLGenericElement_Create(doc
, nselem
, &elem
);
5495 elem
= heap_alloc_zero(sizeof(HTMLElement
));
5497 elem
->node
.vtbl
= &HTMLElementImplVtbl
;
5498 HTMLElement_Init(elem
, doc
, nselem
, &HTMLElement_dispex
);
5501 hres
= E_OUTOFMEMORY
;
5505 TRACE("%s ret %p\n", debugstr_w(class_name
), elem
);
5507 nsIDOMHTMLElement_Release(nselem
);
5508 nsAString_Finish(&class_name_str
);
5516 HRESULT
get_elem(HTMLDocumentNode
*doc
, nsIDOMElement
*nselem
, HTMLElement
**ret
)
5521 hres
= get_node(doc
, (nsIDOMNode
*)nselem
, TRUE
, &node
);
5525 *ret
= impl_from_HTMLDOMNode(node
);
5529 /* interface IHTMLFiltersCollection */
5530 static HRESULT WINAPI
HTMLFiltersCollection_QueryInterface(IHTMLFiltersCollection
*iface
, REFIID riid
, void **ppv
)
5532 HTMLFiltersCollection
*This
= impl_from_IHTMLFiltersCollection(iface
);
5534 TRACE("%p %s %p\n", This
, debugstr_mshtml_guid(riid
), ppv
);
5536 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
5537 *ppv
= &This
->IHTMLFiltersCollection_iface
;
5538 }else if(IsEqualGUID(&IID_IHTMLFiltersCollection
, riid
)) {
5539 TRACE("(%p)->(IID_IHTMLFiltersCollection %p)\n", This
, ppv
);
5540 *ppv
= &This
->IHTMLFiltersCollection_iface
;
5541 }else if(dispex_query_interface(&This
->dispex
, riid
, ppv
)) {
5542 return *ppv
? S_OK
: E_NOINTERFACE
;
5545 FIXME("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
5546 return E_NOINTERFACE
;
5549 IUnknown_AddRef((IUnknown
*)*ppv
);
5553 static ULONG WINAPI
HTMLFiltersCollection_AddRef(IHTMLFiltersCollection
*iface
)
5555 HTMLFiltersCollection
*This
= impl_from_IHTMLFiltersCollection(iface
);
5556 LONG ref
= InterlockedIncrement(&This
->ref
);
5558 TRACE("(%p) ref=%d\n", This
, ref
);
5563 static ULONG WINAPI
HTMLFiltersCollection_Release(IHTMLFiltersCollection
*iface
)
5565 HTMLFiltersCollection
*This
= impl_from_IHTMLFiltersCollection(iface
);
5566 LONG ref
= InterlockedDecrement(&This
->ref
);
5568 TRACE("(%p) ref=%d\n", This
, ref
);
5578 static HRESULT WINAPI
HTMLFiltersCollection_GetTypeInfoCount(IHTMLFiltersCollection
*iface
, UINT
*pctinfo
)
5580 HTMLFiltersCollection
*This
= impl_from_IHTMLFiltersCollection(iface
);
5581 return IDispatchEx_GetTypeInfoCount(&This
->dispex
.IDispatchEx_iface
, pctinfo
);
5584 static HRESULT WINAPI
HTMLFiltersCollection_GetTypeInfo(IHTMLFiltersCollection
*iface
,
5585 UINT iTInfo
, LCID lcid
, ITypeInfo
**ppTInfo
)
5587 HTMLFiltersCollection
*This
= impl_from_IHTMLFiltersCollection(iface
);
5588 return IDispatchEx_GetTypeInfo(&This
->dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
5591 static HRESULT WINAPI
HTMLFiltersCollection_GetIDsOfNames(IHTMLFiltersCollection
*iface
,
5592 REFIID riid
, LPOLESTR
*rgszNames
, UINT cNames
,
5593 LCID lcid
, DISPID
*rgDispId
)
5595 HTMLFiltersCollection
*This
= impl_from_IHTMLFiltersCollection(iface
);
5596 return IDispatchEx_GetIDsOfNames(&This
->dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
5600 static HRESULT WINAPI
HTMLFiltersCollection_Invoke(IHTMLFiltersCollection
*iface
, DISPID dispIdMember
, REFIID riid
,
5601 LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
,
5602 EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
5604 HTMLFiltersCollection
*This
= impl_from_IHTMLFiltersCollection(iface
);
5605 return IDispatchEx_Invoke(&This
->dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
5606 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
5609 static HRESULT WINAPI
HTMLFiltersCollection_get_length(IHTMLFiltersCollection
*iface
, LONG
*p
)
5611 HTMLFiltersCollection
*This
= impl_from_IHTMLFiltersCollection(iface
);
5616 FIXME("(%p)->(%p) Always returning 0\n", This
, p
);
5622 static HRESULT WINAPI
HTMLFiltersCollection_get__newEnum(IHTMLFiltersCollection
*iface
, IUnknown
**p
)
5624 HTMLFiltersCollection
*This
= impl_from_IHTMLFiltersCollection(iface
);
5625 FIXME("(%p)->(%p)\n", This
, p
);
5629 static HRESULT WINAPI
HTMLFiltersCollection_item(IHTMLFiltersCollection
*iface
, VARIANT
*pvarIndex
, VARIANT
*pvarResult
)
5631 HTMLFiltersCollection
*This
= impl_from_IHTMLFiltersCollection(iface
);
5632 FIXME("(%p)->(%p, %p)\n", This
, pvarIndex
, pvarResult
);
5636 static const IHTMLFiltersCollectionVtbl HTMLFiltersCollectionVtbl
= {
5637 HTMLFiltersCollection_QueryInterface
,
5638 HTMLFiltersCollection_AddRef
,
5639 HTMLFiltersCollection_Release
,
5640 HTMLFiltersCollection_GetTypeInfoCount
,
5641 HTMLFiltersCollection_GetTypeInfo
,
5642 HTMLFiltersCollection_GetIDsOfNames
,
5643 HTMLFiltersCollection_Invoke
,
5644 HTMLFiltersCollection_get_length
,
5645 HTMLFiltersCollection_get__newEnum
,
5646 HTMLFiltersCollection_item
5649 static HRESULT
HTMLFiltersCollection_get_dispid(DispatchEx
*dispex
, BSTR name
, DWORD flags
, DISPID
*dispid
)
5654 for(ptr
= name
; *ptr
&& isdigitW(*ptr
); ptr
++)
5655 idx
= idx
*10 + (*ptr
-'0');
5657 return DISP_E_UNKNOWNNAME
;
5659 *dispid
= MSHTML_DISPID_CUSTOM_MIN
+ idx
;
5660 TRACE("ret %x\n", *dispid
);
5664 static HRESULT
HTMLFiltersCollection_invoke(DispatchEx
*dispex
, DISPID id
, LCID lcid
, WORD flags
, DISPPARAMS
*params
,
5665 VARIANT
*res
, EXCEPINFO
*ei
, IServiceProvider
*caller
)
5667 TRACE("(%p)->(%x %x %x %p %p %p)\n", dispex
, id
, lcid
, flags
, params
, res
, ei
);
5669 V_VT(res
) = VT_DISPATCH
;
5670 V_DISPATCH(res
) = NULL
;
5672 FIXME("always returning NULL\n");
5677 static const dispex_static_data_vtbl_t HTMLFiltersCollection_dispex_vtbl
= {
5679 HTMLFiltersCollection_get_dispid
,
5680 HTMLFiltersCollection_invoke
,
5684 static const tid_t HTMLFiltersCollection_iface_tids
[] = {
5685 IHTMLFiltersCollection_tid
,
5688 static dispex_static_data_t HTMLFiltersCollection_dispex
= {
5689 &HTMLFiltersCollection_dispex_vtbl
,
5690 IHTMLFiltersCollection_tid
,
5691 HTMLFiltersCollection_iface_tids
5694 static IHTMLFiltersCollection
*HTMLFiltersCollection_Create(void)
5696 HTMLFiltersCollection
*ret
= heap_alloc(sizeof(HTMLFiltersCollection
));
5698 ret
->IHTMLFiltersCollection_iface
.lpVtbl
= &HTMLFiltersCollectionVtbl
;
5701 init_dispex(&ret
->dispex
, (IUnknown
*)&ret
->IHTMLFiltersCollection_iface
,
5702 &HTMLFiltersCollection_dispex
);
5704 return &ret
->IHTMLFiltersCollection_iface
;
5707 /* interface IHTMLAttributeCollection */
5708 static inline HTMLAttributeCollection
*impl_from_IHTMLAttributeCollection(IHTMLAttributeCollection
*iface
)
5710 return CONTAINING_RECORD(iface
, HTMLAttributeCollection
, IHTMLAttributeCollection_iface
);
5713 static HRESULT WINAPI
HTMLAttributeCollection_QueryInterface(IHTMLAttributeCollection
*iface
, REFIID riid
, void **ppv
)
5715 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection(iface
);
5717 TRACE("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
5719 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
5720 *ppv
= &This
->IHTMLAttributeCollection_iface
;
5721 }else if(IsEqualGUID(&IID_IHTMLAttributeCollection
, riid
)) {
5722 *ppv
= &This
->IHTMLAttributeCollection_iface
;
5723 }else if(IsEqualGUID(&IID_IHTMLAttributeCollection2
, riid
)) {
5724 *ppv
= &This
->IHTMLAttributeCollection2_iface
;
5725 }else if(IsEqualGUID(&IID_IHTMLAttributeCollection3
, riid
)) {
5726 *ppv
= &This
->IHTMLAttributeCollection3_iface
;
5727 }else if(dispex_query_interface(&This
->dispex
, riid
, ppv
)) {
5728 return *ppv
? S_OK
: E_NOINTERFACE
;
5731 WARN("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
5732 return E_NOINTERFACE
;
5735 IUnknown_AddRef((IUnknown
*)*ppv
);
5739 static ULONG WINAPI
HTMLAttributeCollection_AddRef(IHTMLAttributeCollection
*iface
)
5741 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection(iface
);
5742 LONG ref
= InterlockedIncrement(&This
->ref
);
5744 TRACE("(%p) ref=%d\n", This
, ref
);
5749 static ULONG WINAPI
HTMLAttributeCollection_Release(IHTMLAttributeCollection
*iface
)
5751 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection(iface
);
5752 LONG ref
= InterlockedDecrement(&This
->ref
);
5754 TRACE("(%p) ref=%d\n", This
, ref
);
5757 while(!list_empty(&This
->attrs
)) {
5758 HTMLDOMAttribute
*attr
= LIST_ENTRY(list_head(&This
->attrs
), HTMLDOMAttribute
, entry
);
5760 list_remove(&attr
->entry
);
5762 IHTMLDOMAttribute_Release(&attr
->IHTMLDOMAttribute_iface
);
5771 static HRESULT WINAPI
HTMLAttributeCollection_GetTypeInfoCount(IHTMLAttributeCollection
*iface
, UINT
*pctinfo
)
5773 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection(iface
);
5774 return IDispatchEx_GetTypeInfoCount(&This
->dispex
.IDispatchEx_iface
, pctinfo
);
5777 static HRESULT WINAPI
HTMLAttributeCollection_GetTypeInfo(IHTMLAttributeCollection
*iface
, UINT iTInfo
,
5778 LCID lcid
, ITypeInfo
**ppTInfo
)
5780 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection(iface
);
5781 return IDispatchEx_GetTypeInfo(&This
->dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
5784 static HRESULT WINAPI
HTMLAttributeCollection_GetIDsOfNames(IHTMLAttributeCollection
*iface
, REFIID riid
,
5785 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
5787 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection(iface
);
5788 return IDispatchEx_GetIDsOfNames(&This
->dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
5792 static HRESULT WINAPI
HTMLAttributeCollection_Invoke(IHTMLAttributeCollection
*iface
, DISPID dispIdMember
,
5793 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
5794 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
5796 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection(iface
);
5797 return IDispatchEx_Invoke(&This
->dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
5798 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
5801 static HRESULT
get_attr_dispid_by_idx(HTMLAttributeCollection
*This
, LONG
*idx
, DISPID
*dispid
)
5803 IDispatchEx
*dispex
= &This
->elem
->node
.event_target
.dispex
.IDispatchEx_iface
;
5804 DISPID id
= DISPID_STARTENUM
;
5808 FIXME("filter non-enumerable attributes out\n");
5811 hres
= IDispatchEx_GetNextDispID(dispex
, fdexEnumAll
, id
, &id
);
5814 else if(hres
== S_FALSE
)
5824 return *idx
==len
? S_OK
: DISP_E_UNKNOWNNAME
;
5831 static inline HRESULT
get_attr_dispid_by_name(HTMLAttributeCollection
*This
, BSTR name
, DISPID
*id
)
5835 if(name
[0]>='0' && name
[0]<='9') {
5839 idx
= strtoulW(name
, &end_ptr
, 10);
5841 hres
= get_attr_dispid_by_idx(This
, &idx
, id
);
5848 WARN("NULL elem\n");
5849 return E_UNEXPECTED
;
5852 hres
= IDispatchEx_GetDispID(&This
->elem
->node
.event_target
.dispex
.IDispatchEx_iface
,
5853 name
, fdexNameCaseInsensitive
, id
);
5857 static inline HRESULT
get_domattr(HTMLAttributeCollection
*This
, DISPID id
, LONG
*list_pos
, HTMLDOMAttribute
**attr
)
5859 HTMLDOMAttribute
*iter
;
5864 LIST_FOR_EACH_ENTRY(iter
, &This
->attrs
, HTMLDOMAttribute
, entry
) {
5865 if(iter
->dispid
== id
) {
5874 WARN("NULL elem\n");
5875 return E_UNEXPECTED
;
5878 hres
= HTMLDOMAttribute_Create(NULL
, This
->elem
, id
, attr
);
5883 IHTMLDOMAttribute_AddRef(&(*attr
)->IHTMLDOMAttribute_iface
);
5889 static HRESULT WINAPI
HTMLAttributeCollection_get_length(IHTMLAttributeCollection
*iface
, LONG
*p
)
5891 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection(iface
);
5894 TRACE("(%p)->(%p)\n", This
, p
);
5897 hres
= get_attr_dispid_by_idx(This
, p
, NULL
);
5901 static HRESULT WINAPI
HTMLAttributeCollection__newEnum(IHTMLAttributeCollection
*iface
, IUnknown
**p
)
5903 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection(iface
);
5904 FIXME("(%p)->(%p)\n", This
, p
);
5908 static HRESULT WINAPI
HTMLAttributeCollection_item(IHTMLAttributeCollection
*iface
, VARIANT
*name
, IDispatch
**ppItem
)
5910 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection(iface
);
5911 HTMLDOMAttribute
*attr
;
5915 TRACE("(%p)->(%s %p)\n", This
, debugstr_variant(name
), ppItem
);
5917 switch(V_VT(name
)) {
5919 hres
= get_attr_dispid_by_idx(This
, &V_I4(name
), &id
);
5922 hres
= get_attr_dispid_by_name(This
, V_BSTR(name
), &id
);
5925 FIXME("unsupported name %s\n", debugstr_variant(name
));
5928 if(hres
== DISP_E_UNKNOWNNAME
)
5929 return E_INVALIDARG
;
5933 hres
= get_domattr(This
, id
, NULL
, &attr
);
5937 *ppItem
= (IDispatch
*)&attr
->IHTMLDOMAttribute_iface
;
5941 static const IHTMLAttributeCollectionVtbl HTMLAttributeCollectionVtbl
= {
5942 HTMLAttributeCollection_QueryInterface
,
5943 HTMLAttributeCollection_AddRef
,
5944 HTMLAttributeCollection_Release
,
5945 HTMLAttributeCollection_GetTypeInfoCount
,
5946 HTMLAttributeCollection_GetTypeInfo
,
5947 HTMLAttributeCollection_GetIDsOfNames
,
5948 HTMLAttributeCollection_Invoke
,
5949 HTMLAttributeCollection_get_length
,
5950 HTMLAttributeCollection__newEnum
,
5951 HTMLAttributeCollection_item
5954 static inline HTMLAttributeCollection
*impl_from_IHTMLAttributeCollection2(IHTMLAttributeCollection2
*iface
)
5956 return CONTAINING_RECORD(iface
, HTMLAttributeCollection
, IHTMLAttributeCollection2_iface
);
5959 static HRESULT WINAPI
HTMLAttributeCollection2_QueryInterface(IHTMLAttributeCollection2
*iface
, REFIID riid
, void **ppv
)
5961 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection2(iface
);
5962 return IHTMLAttributeCollection_QueryInterface(&This
->IHTMLAttributeCollection_iface
, riid
, ppv
);
5965 static ULONG WINAPI
HTMLAttributeCollection2_AddRef(IHTMLAttributeCollection2
*iface
)
5967 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection2(iface
);
5968 return IHTMLAttributeCollection_AddRef(&This
->IHTMLAttributeCollection_iface
);
5971 static ULONG WINAPI
HTMLAttributeCollection2_Release(IHTMLAttributeCollection2
*iface
)
5973 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection2(iface
);
5974 return IHTMLAttributeCollection_Release(&This
->IHTMLAttributeCollection_iface
);
5977 static HRESULT WINAPI
HTMLAttributeCollection2_GetTypeInfoCount(IHTMLAttributeCollection2
*iface
, UINT
*pctinfo
)
5979 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection2(iface
);
5980 return IDispatchEx_GetTypeInfoCount(&This
->dispex
.IDispatchEx_iface
, pctinfo
);
5983 static HRESULT WINAPI
HTMLAttributeCollection2_GetTypeInfo(IHTMLAttributeCollection2
*iface
, UINT iTInfo
,
5984 LCID lcid
, ITypeInfo
**ppTInfo
)
5986 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection2(iface
);
5987 return IDispatchEx_GetTypeInfo(&This
->dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
5990 static HRESULT WINAPI
HTMLAttributeCollection2_GetIDsOfNames(IHTMLAttributeCollection2
*iface
, REFIID riid
,
5991 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
5993 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection2(iface
);
5994 return IDispatchEx_GetIDsOfNames(&This
->dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
5998 static HRESULT WINAPI
HTMLAttributeCollection2_Invoke(IHTMLAttributeCollection2
*iface
, DISPID dispIdMember
,
5999 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
6000 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
6002 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection2(iface
);
6003 return IDispatchEx_Invoke(&This
->dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
6004 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
6007 static HRESULT WINAPI
HTMLAttributeCollection2_getNamedItem(IHTMLAttributeCollection2
*iface
, BSTR bstrName
,
6008 IHTMLDOMAttribute
**newretNode
)
6010 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection2(iface
);
6011 HTMLDOMAttribute
*attr
;
6015 TRACE("(%p)->(%s %p)\n", This
, debugstr_w(bstrName
), newretNode
);
6017 hres
= get_attr_dispid_by_name(This
, bstrName
, &id
);
6018 if(hres
== DISP_E_UNKNOWNNAME
) {
6021 } else if(FAILED(hres
)) {
6025 hres
= get_domattr(This
, id
, NULL
, &attr
);
6029 *newretNode
= &attr
->IHTMLDOMAttribute_iface
;
6033 static HRESULT WINAPI
HTMLAttributeCollection2_setNamedItem(IHTMLAttributeCollection2
*iface
,
6034 IHTMLDOMAttribute
*ppNode
, IHTMLDOMAttribute
**newretNode
)
6036 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection2(iface
);
6037 FIXME("(%p)->(%p %p)\n", This
, ppNode
, newretNode
);
6041 static HRESULT WINAPI
HTMLAttributeCollection2_removeNamedItem(IHTMLAttributeCollection2
*iface
,
6042 BSTR bstrName
, IHTMLDOMAttribute
**newretNode
)
6044 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection2(iface
);
6045 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(bstrName
), newretNode
);
6049 static const IHTMLAttributeCollection2Vtbl HTMLAttributeCollection2Vtbl
= {
6050 HTMLAttributeCollection2_QueryInterface
,
6051 HTMLAttributeCollection2_AddRef
,
6052 HTMLAttributeCollection2_Release
,
6053 HTMLAttributeCollection2_GetTypeInfoCount
,
6054 HTMLAttributeCollection2_GetTypeInfo
,
6055 HTMLAttributeCollection2_GetIDsOfNames
,
6056 HTMLAttributeCollection2_Invoke
,
6057 HTMLAttributeCollection2_getNamedItem
,
6058 HTMLAttributeCollection2_setNamedItem
,
6059 HTMLAttributeCollection2_removeNamedItem
6062 static inline HTMLAttributeCollection
*impl_from_IHTMLAttributeCollection3(IHTMLAttributeCollection3
*iface
)
6064 return CONTAINING_RECORD(iface
, HTMLAttributeCollection
, IHTMLAttributeCollection3_iface
);
6067 static HRESULT WINAPI
HTMLAttributeCollection3_QueryInterface(IHTMLAttributeCollection3
*iface
, REFIID riid
, void **ppv
)
6069 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection3(iface
);
6070 return IHTMLAttributeCollection_QueryInterface(&This
->IHTMLAttributeCollection_iface
, riid
, ppv
);
6073 static ULONG WINAPI
HTMLAttributeCollection3_AddRef(IHTMLAttributeCollection3
*iface
)
6075 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection3(iface
);
6076 return IHTMLAttributeCollection_AddRef(&This
->IHTMLAttributeCollection_iface
);
6079 static ULONG WINAPI
HTMLAttributeCollection3_Release(IHTMLAttributeCollection3
*iface
)
6081 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection3(iface
);
6082 return IHTMLAttributeCollection_Release(&This
->IHTMLAttributeCollection_iface
);
6085 static HRESULT WINAPI
HTMLAttributeCollection3_GetTypeInfoCount(IHTMLAttributeCollection3
*iface
, UINT
*pctinfo
)
6087 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection3(iface
);
6088 return IDispatchEx_GetTypeInfoCount(&This
->dispex
.IDispatchEx_iface
, pctinfo
);
6091 static HRESULT WINAPI
HTMLAttributeCollection3_GetTypeInfo(IHTMLAttributeCollection3
*iface
, UINT iTInfo
,
6092 LCID lcid
, ITypeInfo
**ppTInfo
)
6094 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection3(iface
);
6095 return IDispatchEx_GetTypeInfo(&This
->dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
6098 static HRESULT WINAPI
HTMLAttributeCollection3_GetIDsOfNames(IHTMLAttributeCollection3
*iface
, REFIID riid
,
6099 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
6101 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection3(iface
);
6102 return IDispatchEx_GetIDsOfNames(&This
->dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
6106 static HRESULT WINAPI
HTMLAttributeCollection3_Invoke(IHTMLAttributeCollection3
*iface
, DISPID dispIdMember
,
6107 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
6108 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
6110 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection3(iface
);
6111 return IDispatchEx_Invoke(&This
->dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
6112 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
6115 static HRESULT WINAPI
HTMLAttributeCollection3_getNamedItem(IHTMLAttributeCollection3
*iface
, BSTR bstrName
,
6116 IHTMLDOMAttribute
**ppNodeOut
)
6118 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection3(iface
);
6119 return IHTMLAttributeCollection2_getNamedItem(&This
->IHTMLAttributeCollection2_iface
, bstrName
, ppNodeOut
);
6122 static HRESULT WINAPI
HTMLAttributeCollection3_setNamedItem(IHTMLAttributeCollection3
*iface
,
6123 IHTMLDOMAttribute
*pNodeIn
, IHTMLDOMAttribute
**ppNodeOut
)
6125 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection3(iface
);
6126 FIXME("(%p)->(%p %p)\n", This
, pNodeIn
, ppNodeOut
);
6130 static HRESULT WINAPI
HTMLAttributeCollection3_removeNamedItem(IHTMLAttributeCollection3
*iface
,
6131 BSTR bstrName
, IHTMLDOMAttribute
**ppNodeOut
)
6133 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection3(iface
);
6134 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(bstrName
), ppNodeOut
);
6138 static HRESULT WINAPI
HTMLAttributeCollection3_item(IHTMLAttributeCollection3
*iface
, LONG index
, IHTMLDOMAttribute
**ppNodeOut
)
6140 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection3(iface
);
6141 HTMLDOMAttribute
*attr
;
6145 TRACE("(%p)->(%d %p)\n", This
, index
, ppNodeOut
);
6147 hres
= get_attr_dispid_by_idx(This
, &index
, &id
);
6148 if(hres
== DISP_E_UNKNOWNNAME
)
6149 return E_INVALIDARG
;
6153 hres
= get_domattr(This
, id
, NULL
, &attr
);
6157 *ppNodeOut
= &attr
->IHTMLDOMAttribute_iface
;
6161 static HRESULT WINAPI
HTMLAttributeCollection3_get_length(IHTMLAttributeCollection3
*iface
, LONG
*p
)
6163 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection3(iface
);
6164 return IHTMLAttributeCollection_get_length(&This
->IHTMLAttributeCollection_iface
, p
);
6167 static const IHTMLAttributeCollection3Vtbl HTMLAttributeCollection3Vtbl
= {
6168 HTMLAttributeCollection3_QueryInterface
,
6169 HTMLAttributeCollection3_AddRef
,
6170 HTMLAttributeCollection3_Release
,
6171 HTMLAttributeCollection3_GetTypeInfoCount
,
6172 HTMLAttributeCollection3_GetTypeInfo
,
6173 HTMLAttributeCollection3_GetIDsOfNames
,
6174 HTMLAttributeCollection3_Invoke
,
6175 HTMLAttributeCollection3_getNamedItem
,
6176 HTMLAttributeCollection3_setNamedItem
,
6177 HTMLAttributeCollection3_removeNamedItem
,
6178 HTMLAttributeCollection3_item
,
6179 HTMLAttributeCollection3_get_length
6182 static inline HTMLAttributeCollection
*HTMLAttributeCollection_from_DispatchEx(DispatchEx
*iface
)
6184 return CONTAINING_RECORD(iface
, HTMLAttributeCollection
, dispex
);
6187 static HRESULT
HTMLAttributeCollection_get_dispid(DispatchEx
*dispex
, BSTR name
, DWORD flags
, DISPID
*dispid
)
6189 HTMLAttributeCollection
*This
= HTMLAttributeCollection_from_DispatchEx(dispex
);
6190 HTMLDOMAttribute
*attr
;
6194 TRACE("(%p)->(%s %x %p)\n", This
, debugstr_w(name
), flags
, dispid
);
6196 hres
= get_attr_dispid_by_name(This
, name
, dispid
);
6200 hres
= get_domattr(This
, *dispid
, &pos
, &attr
);
6203 IHTMLDOMAttribute_Release(&attr
->IHTMLDOMAttribute_iface
);
6205 *dispid
= MSHTML_DISPID_CUSTOM_MIN
+pos
;
6209 static HRESULT
HTMLAttributeCollection_invoke(DispatchEx
*dispex
, DISPID id
, LCID lcid
,
6210 WORD flags
, DISPPARAMS
*params
, VARIANT
*res
, EXCEPINFO
*ei
, IServiceProvider
*caller
)
6212 HTMLAttributeCollection
*This
= HTMLAttributeCollection_from_DispatchEx(dispex
);
6214 TRACE("(%p)->(%x %x %x %p %p %p %p)\n", This
, id
, lcid
, flags
, params
, res
, ei
, caller
);
6217 case DISPATCH_PROPERTYGET
: {
6218 HTMLDOMAttribute
*iter
;
6221 pos
= id
-MSHTML_DISPID_CUSTOM_MIN
;
6223 LIST_FOR_EACH_ENTRY(iter
, &This
->attrs
, HTMLDOMAttribute
, entry
) {
6225 IHTMLDOMAttribute_AddRef(&iter
->IHTMLDOMAttribute_iface
);
6226 V_VT(res
) = VT_DISPATCH
;
6227 V_DISPATCH(res
) = (IDispatch
*)&iter
->IHTMLDOMAttribute_iface
;
6233 WARN("invalid arg\n");
6234 return E_INVALIDARG
;
6238 FIXME("unimplemented flags %x\n", flags
);
6243 static const dispex_static_data_vtbl_t HTMLAttributeCollection_dispex_vtbl
= {
6245 HTMLAttributeCollection_get_dispid
,
6246 HTMLAttributeCollection_invoke
,
6250 static const tid_t HTMLAttributeCollection_iface_tids
[] = {
6251 IHTMLAttributeCollection_tid
,
6252 IHTMLAttributeCollection2_tid
,
6253 IHTMLAttributeCollection3_tid
,
6257 static dispex_static_data_t HTMLAttributeCollection_dispex
= {
6258 &HTMLAttributeCollection_dispex_vtbl
,
6259 DispHTMLAttributeCollection_tid
,
6260 HTMLAttributeCollection_iface_tids
6263 HRESULT
HTMLElement_get_attr_col(HTMLDOMNode
*iface
, HTMLAttributeCollection
**ac
)
6265 HTMLElement
*This
= impl_from_HTMLDOMNode(iface
);
6268 IHTMLAttributeCollection_AddRef(&This
->attrs
->IHTMLAttributeCollection_iface
);
6273 This
->attrs
= heap_alloc_zero(sizeof(HTMLAttributeCollection
));
6275 return E_OUTOFMEMORY
;
6277 This
->attrs
->IHTMLAttributeCollection_iface
.lpVtbl
= &HTMLAttributeCollectionVtbl
;
6278 This
->attrs
->IHTMLAttributeCollection2_iface
.lpVtbl
= &HTMLAttributeCollection2Vtbl
;
6279 This
->attrs
->IHTMLAttributeCollection3_iface
.lpVtbl
= &HTMLAttributeCollection3Vtbl
;
6280 This
->attrs
->ref
= 2;
6282 This
->attrs
->elem
= This
;
6283 list_init(&This
->attrs
->attrs
);
6284 init_dispex(&This
->attrs
->dispex
, (IUnknown
*)&This
->attrs
->IHTMLAttributeCollection_iface
,
6285 &HTMLAttributeCollection_dispex
);