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
= variant_bool(result
);
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
= variant_bool(This
->node
.vtbl
->is_text_edit
&& This
->node
.vtbl
->is_text_edit(&This
->node
));
1784 static HRESULT WINAPI
HTMLElement_click(IHTMLElement
*iface
)
1786 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1789 TRACE("(%p)\n", This
);
1792 FIXME("not implemented for comments\n");
1796 nsres
= nsIDOMHTMLElement_Click(This
->nselem
);
1797 if(NS_FAILED(nsres
)) {
1798 ERR("Click failed: %08x\n", nsres
);
1805 static HRESULT WINAPI
HTMLElement_get_filters(IHTMLElement
*iface
,
1806 IHTMLFiltersCollection
**p
)
1808 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1809 TRACE("(%p)->(%p)\n", This
, p
);
1814 *p
= HTMLFiltersCollection_Create();
1819 static HRESULT WINAPI
HTMLElement_put_ondragstart(IHTMLElement
*iface
, VARIANT v
)
1821 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1823 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1825 return set_node_event(&This
->node
, EVENTID_DRAGSTART
, &v
);
1828 static HRESULT WINAPI
HTMLElement_get_ondragstart(IHTMLElement
*iface
, VARIANT
*p
)
1830 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1832 TRACE("(%p)->(%p)\n", This
, p
);
1834 return get_node_event(&This
->node
, EVENTID_DRAGSTART
, p
);
1837 static HRESULT WINAPI
HTMLElement_toString(IHTMLElement
*iface
, BSTR
*String
)
1839 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1840 FIXME("(%p)->(%p)\n", This
, String
);
1844 static HRESULT WINAPI
HTMLElement_put_onbeforeupdate(IHTMLElement
*iface
, VARIANT v
)
1846 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1847 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1851 static HRESULT WINAPI
HTMLElement_get_onbeforeupdate(IHTMLElement
*iface
, VARIANT
*p
)
1853 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1854 FIXME("(%p)->(%p)\n", This
, p
);
1858 static HRESULT WINAPI
HTMLElement_put_onafterupdate(IHTMLElement
*iface
, VARIANT v
)
1860 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1861 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1865 static HRESULT WINAPI
HTMLElement_get_onafterupdate(IHTMLElement
*iface
, VARIANT
*p
)
1867 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1868 FIXME("(%p)->(%p)\n", This
, p
);
1872 static HRESULT WINAPI
HTMLElement_put_onerrorupdate(IHTMLElement
*iface
, VARIANT v
)
1874 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1875 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1879 static HRESULT WINAPI
HTMLElement_get_onerrorupdate(IHTMLElement
*iface
, VARIANT
*p
)
1881 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1882 FIXME("(%p)->(%p)\n", This
, p
);
1886 static HRESULT WINAPI
HTMLElement_put_onrowexit(IHTMLElement
*iface
, VARIANT v
)
1888 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1889 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1893 static HRESULT WINAPI
HTMLElement_get_onrowexit(IHTMLElement
*iface
, VARIANT
*p
)
1895 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1896 FIXME("(%p)->(%p)\n", This
, p
);
1900 static HRESULT WINAPI
HTMLElement_put_onrowenter(IHTMLElement
*iface
, VARIANT v
)
1902 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1903 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1907 static HRESULT WINAPI
HTMLElement_get_onrowenter(IHTMLElement
*iface
, VARIANT
*p
)
1909 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1910 FIXME("(%p)->(%p)\n", This
, p
);
1914 static HRESULT WINAPI
HTMLElement_put_ondatasetchanged(IHTMLElement
*iface
, VARIANT v
)
1916 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1917 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1921 static HRESULT WINAPI
HTMLElement_get_ondatasetchanged(IHTMLElement
*iface
, VARIANT
*p
)
1923 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1924 FIXME("(%p)->(%p)\n", This
, p
);
1928 static HRESULT WINAPI
HTMLElement_put_ondataavailable(IHTMLElement
*iface
, VARIANT v
)
1930 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1932 FIXME("(%p)->(%s) semi-stub\n", This
, debugstr_variant(&v
));
1934 return set_node_event(&This
->node
, EVENTID_DATAAVAILABLE
, &v
);
1937 static HRESULT WINAPI
HTMLElement_get_ondataavailable(IHTMLElement
*iface
, VARIANT
*p
)
1939 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1941 TRACE("(%p)->(%p)\n", This
, p
);
1943 return get_node_event(&This
->node
, EVENTID_DATAAVAILABLE
, p
);
1946 static HRESULT WINAPI
HTMLElement_put_ondatasetcomplete(IHTMLElement
*iface
, VARIANT v
)
1948 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1949 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1953 static HRESULT WINAPI
HTMLElement_get_ondatasetcomplete(IHTMLElement
*iface
, VARIANT
*p
)
1955 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1956 FIXME("(%p)->(%p)\n", This
, p
);
1960 static HRESULT WINAPI
HTMLElement_put_onfilterchange(IHTMLElement
*iface
, VARIANT v
)
1962 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1963 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1967 static HRESULT WINAPI
HTMLElement_get_onfilterchange(IHTMLElement
*iface
, VARIANT
*p
)
1969 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1970 FIXME("(%p)->(%p)\n", This
, p
);
1974 static HRESULT WINAPI
HTMLElement_get_children(IHTMLElement
*iface
, IDispatch
**p
)
1976 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1977 nsIDOMNodeList
*nsnode_list
;
1980 TRACE("(%p)->(%p)\n", This
, p
);
1982 nsres
= nsIDOMNode_GetChildNodes(This
->node
.nsnode
, &nsnode_list
);
1983 if(NS_FAILED(nsres
)) {
1984 ERR("GetChildNodes failed: %08x\n", nsres
);
1988 *p
= (IDispatch
*)create_collection_from_nodelist(This
->node
.doc
, nsnode_list
);
1990 nsIDOMNodeList_Release(nsnode_list
);
1994 static HRESULT WINAPI
HTMLElement_get_all(IHTMLElement
*iface
, IDispatch
**p
)
1996 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1998 TRACE("(%p)->(%p)\n", This
, p
);
2000 *p
= (IDispatch
*)create_all_collection(&This
->node
, FALSE
);
2004 static const IHTMLElementVtbl HTMLElementVtbl
= {
2005 HTMLElement_QueryInterface
,
2007 HTMLElement_Release
,
2008 HTMLElement_GetTypeInfoCount
,
2009 HTMLElement_GetTypeInfo
,
2010 HTMLElement_GetIDsOfNames
,
2012 HTMLElement_setAttribute
,
2013 HTMLElement_getAttribute
,
2014 HTMLElement_removeAttribute
,
2015 HTMLElement_put_className
,
2016 HTMLElement_get_className
,
2019 HTMLElement_get_tagName
,
2020 HTMLElement_get_parentElement
,
2021 HTMLElement_get_style
,
2022 HTMLElement_put_onhelp
,
2023 HTMLElement_get_onhelp
,
2024 HTMLElement_put_onclick
,
2025 HTMLElement_get_onclick
,
2026 HTMLElement_put_ondblclick
,
2027 HTMLElement_get_ondblclick
,
2028 HTMLElement_put_onkeydown
,
2029 HTMLElement_get_onkeydown
,
2030 HTMLElement_put_onkeyup
,
2031 HTMLElement_get_onkeyup
,
2032 HTMLElement_put_onkeypress
,
2033 HTMLElement_get_onkeypress
,
2034 HTMLElement_put_onmouseout
,
2035 HTMLElement_get_onmouseout
,
2036 HTMLElement_put_onmouseover
,
2037 HTMLElement_get_onmouseover
,
2038 HTMLElement_put_onmousemove
,
2039 HTMLElement_get_onmousemove
,
2040 HTMLElement_put_onmousedown
,
2041 HTMLElement_get_onmousedown
,
2042 HTMLElement_put_onmouseup
,
2043 HTMLElement_get_onmouseup
,
2044 HTMLElement_get_document
,
2045 HTMLElement_put_title
,
2046 HTMLElement_get_title
,
2047 HTMLElement_put_language
,
2048 HTMLElement_get_language
,
2049 HTMLElement_put_onselectstart
,
2050 HTMLElement_get_onselectstart
,
2051 HTMLElement_scrollIntoView
,
2052 HTMLElement_contains
,
2053 HTMLElement_get_sourceIndex
,
2054 HTMLElement_get_recordNumber
,
2055 HTMLElement_put_lang
,
2056 HTMLElement_get_lang
,
2057 HTMLElement_get_offsetLeft
,
2058 HTMLElement_get_offsetTop
,
2059 HTMLElement_get_offsetWidth
,
2060 HTMLElement_get_offsetHeight
,
2061 HTMLElement_get_offsetParent
,
2062 HTMLElement_put_innerHTML
,
2063 HTMLElement_get_innerHTML
,
2064 HTMLElement_put_innerText
,
2065 HTMLElement_get_innerText
,
2066 HTMLElement_put_outerHTML
,
2067 HTMLElement_get_outerHTML
,
2068 HTMLElement_put_outerText
,
2069 HTMLElement_get_outerText
,
2070 HTMLElement_insertAdjacentHTML
,
2071 HTMLElement_insertAdjacentText
,
2072 HTMLElement_get_parentTextEdit
,
2073 HTMLElement_get_isTextEdit
,
2075 HTMLElement_get_filters
,
2076 HTMLElement_put_ondragstart
,
2077 HTMLElement_get_ondragstart
,
2078 HTMLElement_toString
,
2079 HTMLElement_put_onbeforeupdate
,
2080 HTMLElement_get_onbeforeupdate
,
2081 HTMLElement_put_onafterupdate
,
2082 HTMLElement_get_onafterupdate
,
2083 HTMLElement_put_onerrorupdate
,
2084 HTMLElement_get_onerrorupdate
,
2085 HTMLElement_put_onrowexit
,
2086 HTMLElement_get_onrowexit
,
2087 HTMLElement_put_onrowenter
,
2088 HTMLElement_get_onrowenter
,
2089 HTMLElement_put_ondatasetchanged
,
2090 HTMLElement_get_ondatasetchanged
,
2091 HTMLElement_put_ondataavailable
,
2092 HTMLElement_get_ondataavailable
,
2093 HTMLElement_put_ondatasetcomplete
,
2094 HTMLElement_get_ondatasetcomplete
,
2095 HTMLElement_put_onfilterchange
,
2096 HTMLElement_get_onfilterchange
,
2097 HTMLElement_get_children
,
2101 HTMLElement
*unsafe_impl_from_IHTMLElement(IHTMLElement
*iface
)
2103 return iface
->lpVtbl
== &HTMLElementVtbl
? impl_from_IHTMLElement(iface
) : NULL
;
2106 static inline HTMLElement
*impl_from_IHTMLElement2(IHTMLElement2
*iface
)
2108 return CONTAINING_RECORD(iface
, HTMLElement
, IHTMLElement2_iface
);
2111 static HRESULT WINAPI
HTMLElement2_QueryInterface(IHTMLElement2
*iface
,
2112 REFIID riid
, void **ppv
)
2114 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2115 return IHTMLElement_QueryInterface(&This
->IHTMLElement_iface
, riid
, ppv
);
2118 static ULONG WINAPI
HTMLElement2_AddRef(IHTMLElement2
*iface
)
2120 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2121 return IHTMLElement_AddRef(&This
->IHTMLElement_iface
);
2124 static ULONG WINAPI
HTMLElement2_Release(IHTMLElement2
*iface
)
2126 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2127 return IHTMLElement_Release(&This
->IHTMLElement_iface
);
2130 static HRESULT WINAPI
HTMLElement2_GetTypeInfoCount(IHTMLElement2
*iface
, UINT
*pctinfo
)
2132 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2133 return IDispatchEx_GetTypeInfoCount(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
2136 static HRESULT WINAPI
HTMLElement2_GetTypeInfo(IHTMLElement2
*iface
, UINT iTInfo
,
2137 LCID lcid
, ITypeInfo
**ppTInfo
)
2139 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2140 return IDispatchEx_GetTypeInfo(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
2143 static HRESULT WINAPI
HTMLElement2_GetIDsOfNames(IHTMLElement2
*iface
, REFIID riid
,
2144 LPOLESTR
*rgszNames
, UINT cNames
,
2145 LCID lcid
, DISPID
*rgDispId
)
2147 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2148 return IDispatchEx_GetIDsOfNames(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
2152 static HRESULT WINAPI
HTMLElement2_Invoke(IHTMLElement2
*iface
, DISPID dispIdMember
,
2153 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
2154 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
2156 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2157 return IDispatchEx_Invoke(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
2158 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
2161 static HRESULT WINAPI
HTMLElement2_get_scopeName(IHTMLElement2
*iface
, BSTR
*p
)
2163 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2164 FIXME("(%p)->(%p)\n", This
, p
);
2168 static HRESULT WINAPI
HTMLElement2_setCapture(IHTMLElement2
*iface
, VARIANT_BOOL containerCapture
)
2170 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2171 FIXME("(%p)->(%x)\n", This
, containerCapture
);
2175 static HRESULT WINAPI
HTMLElement2_releaseCapture(IHTMLElement2
*iface
)
2177 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2178 FIXME("(%p)\n", This
);
2182 static HRESULT WINAPI
HTMLElement2_put_onlosecapture(IHTMLElement2
*iface
, VARIANT v
)
2184 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2185 FIXME("(%p)->()\n", This
);
2189 static HRESULT WINAPI
HTMLElement2_get_onlosecapture(IHTMLElement2
*iface
, VARIANT
*p
)
2191 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2192 FIXME("(%p)->(%p)\n", This
, p
);
2196 static HRESULT WINAPI
HTMLElement2_componentFromPoint(IHTMLElement2
*iface
,
2197 LONG x
, LONG y
, BSTR
*component
)
2199 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2200 FIXME("(%p)->(%d %d %p)\n", This
, x
, y
, component
);
2204 static HRESULT WINAPI
HTMLElement2_doScroll(IHTMLElement2
*iface
, VARIANT component
)
2206 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2208 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&component
));
2210 if(!This
->node
.doc
->content_ready
2211 || !This
->node
.doc
->basedoc
.doc_obj
->in_place_active
)
2218 static HRESULT WINAPI
HTMLElement2_put_onscroll(IHTMLElement2
*iface
, VARIANT v
)
2220 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2222 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2224 return set_node_event(&This
->node
, EVENTID_SCROLL
, &v
);
2227 static HRESULT WINAPI
HTMLElement2_get_onscroll(IHTMLElement2
*iface
, VARIANT
*p
)
2229 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2231 TRACE("(%p)->(%p)\n", This
, p
);
2233 return get_node_event(&This
->node
, EVENTID_SCROLL
, p
);
2236 static HRESULT WINAPI
HTMLElement2_put_ondrag(IHTMLElement2
*iface
, VARIANT v
)
2238 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2240 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2242 return set_node_event(&This
->node
, EVENTID_DRAG
, &v
);
2245 static HRESULT WINAPI
HTMLElement2_get_ondrag(IHTMLElement2
*iface
, VARIANT
*p
)
2247 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2249 TRACE("(%p)->(%p)\n", This
, p
);
2251 return get_node_event(&This
->node
, EVENTID_DRAG
, p
);
2254 static HRESULT WINAPI
HTMLElement2_put_ondragend(IHTMLElement2
*iface
, VARIANT v
)
2256 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2257 FIXME("(%p)->()\n", This
);
2261 static HRESULT WINAPI
HTMLElement2_get_ondragend(IHTMLElement2
*iface
, VARIANT
*p
)
2263 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2264 FIXME("(%p)->(%p)\n", This
, p
);
2268 static HRESULT WINAPI
HTMLElement2_put_ondragenter(IHTMLElement2
*iface
, VARIANT v
)
2270 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2271 FIXME("(%p)->()\n", This
);
2275 static HRESULT WINAPI
HTMLElement2_get_ondragenter(IHTMLElement2
*iface
, VARIANT
*p
)
2277 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2278 FIXME("(%p)->(%p)\n", This
, p
);
2282 static HRESULT WINAPI
HTMLElement2_put_ondragover(IHTMLElement2
*iface
, VARIANT v
)
2284 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2285 FIXME("(%p)->()\n", This
);
2289 static HRESULT WINAPI
HTMLElement2_get_ondragover(IHTMLElement2
*iface
, VARIANT
*p
)
2291 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2292 FIXME("(%p)->(%p)\n", This
, p
);
2296 static HRESULT WINAPI
HTMLElement2_put_ondragleave(IHTMLElement2
*iface
, VARIANT v
)
2298 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2299 FIXME("(%p)->()\n", This
);
2303 static HRESULT WINAPI
HTMLElement2_get_ondragleave(IHTMLElement2
*iface
, VARIANT
*p
)
2305 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2306 FIXME("(%p)->(%p)\n", This
, p
);
2310 static HRESULT WINAPI
HTMLElement2_put_ondrop(IHTMLElement2
*iface
, VARIANT v
)
2312 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2313 FIXME("(%p)->()\n", This
);
2317 static HRESULT WINAPI
HTMLElement2_get_ondrop(IHTMLElement2
*iface
, VARIANT
*p
)
2319 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2320 FIXME("(%p)->(%p)\n", This
, p
);
2324 static HRESULT WINAPI
HTMLElement2_put_onbeforecut(IHTMLElement2
*iface
, VARIANT v
)
2326 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2327 FIXME("(%p)->()\n", This
);
2331 static HRESULT WINAPI
HTMLElement2_get_onbeforecut(IHTMLElement2
*iface
, VARIANT
*p
)
2333 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2334 FIXME("(%p)->(%p)\n", This
, p
);
2338 static HRESULT WINAPI
HTMLElement2_put_oncut(IHTMLElement2
*iface
, VARIANT v
)
2340 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2341 FIXME("(%p)->()\n", This
);
2345 static HRESULT WINAPI
HTMLElement2_get_oncut(IHTMLElement2
*iface
, VARIANT
*p
)
2347 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2348 FIXME("(%p)->(%p)\n", This
, p
);
2352 static HRESULT WINAPI
HTMLElement2_put_onbeforecopy(IHTMLElement2
*iface
, VARIANT v
)
2354 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2355 FIXME("(%p)->()\n", This
);
2359 static HRESULT WINAPI
HTMLElement2_get_onbeforecopy(IHTMLElement2
*iface
, VARIANT
*p
)
2361 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2362 FIXME("(%p)->(%p)\n", This
, p
);
2366 static HRESULT WINAPI
HTMLElement2_put_oncopy(IHTMLElement2
*iface
, VARIANT v
)
2368 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2369 FIXME("(%p)->()\n", This
);
2373 static HRESULT WINAPI
HTMLElement2_get_oncopy(IHTMLElement2
*iface
, VARIANT
*p
)
2375 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2376 FIXME("(%p)->(%p)\n", This
, p
);
2380 static HRESULT WINAPI
HTMLElement2_put_onbeforepaste(IHTMLElement2
*iface
, VARIANT v
)
2382 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2383 FIXME("(%p)->()\n", This
);
2387 static HRESULT WINAPI
HTMLElement2_get_onbeforepaste(IHTMLElement2
*iface
, VARIANT
*p
)
2389 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2390 FIXME("(%p)->(%p)\n", This
, p
);
2394 static HRESULT WINAPI
HTMLElement2_put_onpaste(IHTMLElement2
*iface
, VARIANT v
)
2396 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2398 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2400 return set_node_event(&This
->node
, EVENTID_PASTE
, &v
);
2403 static HRESULT WINAPI
HTMLElement2_get_onpaste(IHTMLElement2
*iface
, VARIANT
*p
)
2405 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2407 TRACE("(%p)->(%p)\n", This
, p
);
2409 return get_node_event(&This
->node
, EVENTID_PASTE
, p
);
2412 static HRESULT WINAPI
HTMLElement2_get_currentStyle(IHTMLElement2
*iface
, IHTMLCurrentStyle
**p
)
2414 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2416 TRACE("(%p)->(%p)\n", This
, p
);
2418 return HTMLCurrentStyle_Create(This
, p
);
2421 static HRESULT WINAPI
HTMLElement2_put_onpropertychange(IHTMLElement2
*iface
, VARIANT v
)
2423 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2424 FIXME("(%p)->()\n", This
);
2428 static HRESULT WINAPI
HTMLElement2_get_onpropertychange(IHTMLElement2
*iface
, VARIANT
*p
)
2430 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2431 FIXME("(%p)->(%p)\n", This
, p
);
2435 static HRESULT WINAPI
HTMLElement2_getClientRects(IHTMLElement2
*iface
, IHTMLRectCollection
**pRectCol
)
2437 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2438 FIXME("(%p)->(%p)\n", This
, pRectCol
);
2442 static HRESULT WINAPI
HTMLElement2_getBoundingClientRect(IHTMLElement2
*iface
, IHTMLRect
**pRect
)
2444 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2445 nsIDOMClientRect
*nsrect
;
2449 TRACE("(%p)->(%p)\n", This
, pRect
);
2451 nsres
= nsIDOMHTMLElement_GetBoundingClientRect(This
->nselem
, &nsrect
);
2452 if(NS_FAILED(nsres
) || !nsrect
) {
2453 ERR("GetBoindingClientRect failed: %08x\n", nsres
);
2457 hres
= create_html_rect(nsrect
, pRect
);
2459 nsIDOMClientRect_Release(nsrect
);
2463 static HRESULT WINAPI
HTMLElement2_setExpression(IHTMLElement2
*iface
, BSTR propname
,
2464 BSTR expression
, BSTR language
)
2466 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2467 FIXME("(%p)->(%s %s %s)\n", This
, debugstr_w(propname
), debugstr_w(expression
),
2468 debugstr_w(language
));
2472 static HRESULT WINAPI
HTMLElement2_getExpression(IHTMLElement2
*iface
, BSTR propname
,
2473 VARIANT
*expression
)
2475 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2476 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(propname
), expression
);
2480 static HRESULT WINAPI
HTMLElement2_removeExpression(IHTMLElement2
*iface
, BSTR propname
,
2481 VARIANT_BOOL
*pfSuccess
)
2483 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2484 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(propname
), pfSuccess
);
2488 static HRESULT WINAPI
HTMLElement2_put_tabIndex(IHTMLElement2
*iface
, short v
)
2490 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2493 TRACE("(%p)->(%d)\n", This
, v
);
2495 nsres
= nsIDOMHTMLElement_SetTabIndex(This
->nselem
, v
);
2496 if(NS_FAILED(nsres
))
2497 ERR("GetTabIndex failed: %08x\n", nsres
);
2502 static HRESULT WINAPI
HTMLElement2_get_tabIndex(IHTMLElement2
*iface
, short *p
)
2504 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2508 TRACE("(%p)->(%p)\n", This
, p
);
2510 nsres
= nsIDOMHTMLElement_GetTabIndex(This
->nselem
, &index
);
2511 if(NS_FAILED(nsres
)) {
2512 ERR("GetTabIndex failed: %08x\n", nsres
);
2520 static HRESULT WINAPI
HTMLElement2_focus(IHTMLElement2
*iface
)
2522 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2525 TRACE("(%p)\n", This
);
2527 nsres
= nsIDOMHTMLElement_Focus(This
->nselem
);
2528 if(NS_FAILED(nsres
))
2529 ERR("Focus failed: %08x\n", nsres
);
2534 static HRESULT WINAPI
HTMLElement2_put_accessKey(IHTMLElement2
*iface
, BSTR v
)
2536 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2539 static WCHAR accessKeyW
[] = {'a','c','c','e','s','s','K','e','y',0};
2541 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2543 V_VT(&var
) = VT_BSTR
;
2545 return IHTMLElement_setAttribute(&This
->IHTMLElement_iface
, accessKeyW
, var
, 0);
2548 static HRESULT WINAPI
HTMLElement2_get_accessKey(IHTMLElement2
*iface
, BSTR
*p
)
2550 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2551 FIXME("(%p)->(%p)\n", This
, p
);
2555 static HRESULT WINAPI
HTMLElement2_put_onblur(IHTMLElement2
*iface
, VARIANT v
)
2557 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2559 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2561 return set_node_event(&This
->node
, EVENTID_BLUR
, &v
);
2564 static HRESULT WINAPI
HTMLElement2_get_onblur(IHTMLElement2
*iface
, VARIANT
*p
)
2566 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2568 TRACE("(%p)->(%p)\n", This
, p
);
2570 return get_node_event(&This
->node
, EVENTID_BLUR
, p
);
2573 static HRESULT WINAPI
HTMLElement2_put_onfocus(IHTMLElement2
*iface
, VARIANT v
)
2575 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2577 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2579 return set_node_event(&This
->node
, EVENTID_FOCUS
, &v
);
2582 static HRESULT WINAPI
HTMLElement2_get_onfocus(IHTMLElement2
*iface
, VARIANT
*p
)
2584 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2586 TRACE("(%p)->(%p)\n", This
, p
);
2588 return get_node_event(&This
->node
, EVENTID_FOCUS
, p
);
2591 static HRESULT WINAPI
HTMLElement2_put_onresize(IHTMLElement2
*iface
, VARIANT v
)
2593 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2595 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2597 return set_node_event(&This
->node
, EVENTID_RESIZE
, &v
);
2600 static HRESULT WINAPI
HTMLElement2_get_onresize(IHTMLElement2
*iface
, VARIANT
*p
)
2602 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2604 TRACE("(%p)->(%p)\n", This
, p
);
2606 return get_node_event(&This
->node
, EVENTID_RESIZE
, p
);
2609 static HRESULT WINAPI
HTMLElement2_blur(IHTMLElement2
*iface
)
2611 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2614 TRACE("(%p)\n", This
);
2616 nsres
= nsIDOMHTMLElement_Blur(This
->nselem
);
2617 if(NS_FAILED(nsres
)) {
2618 ERR("Blur failed: %08x\n", nsres
);
2625 static HRESULT WINAPI
HTMLElement2_addFilter(IHTMLElement2
*iface
, IUnknown
*pUnk
)
2627 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2628 FIXME("(%p)->(%p)\n", This
, pUnk
);
2632 static HRESULT WINAPI
HTMLElement2_removeFilter(IHTMLElement2
*iface
, IUnknown
*pUnk
)
2634 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2635 FIXME("(%p)->(%p)\n", This
, pUnk
);
2639 static HRESULT WINAPI
HTMLElement2_get_clientHeight(IHTMLElement2
*iface
, LONG
*p
)
2641 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2644 TRACE("(%p)->(%p)\n", This
, p
);
2646 nsres
= nsIDOMHTMLElement_GetClientHeight(This
->nselem
, p
);
2647 assert(nsres
== NS_OK
);
2651 static HRESULT WINAPI
HTMLElement2_get_clientWidth(IHTMLElement2
*iface
, LONG
*p
)
2653 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2656 TRACE("(%p)->(%p)\n", This
, p
);
2658 nsres
= nsIDOMHTMLElement_GetClientWidth(This
->nselem
, p
);
2659 assert(nsres
== NS_OK
);
2663 static HRESULT WINAPI
HTMLElement2_get_clientTop(IHTMLElement2
*iface
, LONG
*p
)
2665 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2668 TRACE("(%p)->(%p)\n", This
, p
);
2670 nsres
= nsIDOMHTMLElement_GetClientTop(This
->nselem
, p
);
2671 assert(nsres
== NS_OK
);
2673 TRACE("*p = %d\n", *p
);
2677 static HRESULT WINAPI
HTMLElement2_get_clientLeft(IHTMLElement2
*iface
, LONG
*p
)
2679 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2682 TRACE("(%p)->(%p)\n", This
, p
);
2684 nsres
= nsIDOMHTMLElement_GetClientLeft(This
->nselem
, p
);
2685 assert(nsres
== NS_OK
);
2687 TRACE("*p = %d\n", *p
);
2691 static HRESULT WINAPI
HTMLElement2_attachEvent(IHTMLElement2
*iface
, BSTR event
,
2692 IDispatch
*pDisp
, VARIANT_BOOL
*pfResult
)
2694 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2696 TRACE("(%p)->(%s %p %p)\n", This
, debugstr_w(event
), pDisp
, pfResult
);
2698 return attach_event(&This
->node
.event_target
, event
, pDisp
, pfResult
);
2701 static HRESULT WINAPI
HTMLElement2_detachEvent(IHTMLElement2
*iface
, BSTR event
, IDispatch
*pDisp
)
2703 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2705 TRACE("(%p)->(%s %p)\n", This
, debugstr_w(event
), pDisp
);
2707 return detach_event(&This
->node
.event_target
, event
, pDisp
);
2710 static HRESULT WINAPI
HTMLElement2_get_readyState(IHTMLElement2
*iface
, VARIANT
*p
)
2712 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2715 TRACE("(%p)->(%p)\n", This
, p
);
2717 if(This
->node
.vtbl
->get_readystate
) {
2720 hres
= This
->node
.vtbl
->get_readystate(&This
->node
, &str
);
2724 static const WCHAR completeW
[] = {'c','o','m','p','l','e','t','e',0};
2726 str
= SysAllocString(completeW
);
2728 return E_OUTOFMEMORY
;
2736 static HRESULT WINAPI
HTMLElement2_put_onreadystatechange(IHTMLElement2
*iface
, VARIANT v
)
2738 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2740 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2742 return set_node_event(&This
->node
, EVENTID_READYSTATECHANGE
, &v
);
2745 static HRESULT WINAPI
HTMLElement2_get_onreadystatechange(IHTMLElement2
*iface
, VARIANT
*p
)
2747 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2749 TRACE("(%p)->(%p)\n", This
, p
);
2751 return get_node_event(&This
->node
, EVENTID_READYSTATECHANGE
, p
);
2754 static HRESULT WINAPI
HTMLElement2_put_onrowsdelete(IHTMLElement2
*iface
, VARIANT v
)
2756 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2757 FIXME("(%p)->()\n", This
);
2761 static HRESULT WINAPI
HTMLElement2_get_onrowsdelete(IHTMLElement2
*iface
, VARIANT
*p
)
2763 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2764 FIXME("(%p)->(%p)\n", This
, p
);
2768 static HRESULT WINAPI
HTMLElement2_put_onrowsinserted(IHTMLElement2
*iface
, VARIANT v
)
2770 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2771 FIXME("(%p)->()\n", This
);
2775 static HRESULT WINAPI
HTMLElement2_get_onrowsinserted(IHTMLElement2
*iface
, VARIANT
*p
)
2777 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2778 FIXME("(%p)->(%p)\n", This
, p
);
2782 static HRESULT WINAPI
HTMLElement2_put_oncellchange(IHTMLElement2
*iface
, VARIANT v
)
2784 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2785 FIXME("(%p)->()\n", This
);
2789 static HRESULT WINAPI
HTMLElement2_get_oncellchange(IHTMLElement2
*iface
, VARIANT
*p
)
2791 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2792 FIXME("(%p)->(%p)\n", This
, p
);
2796 static HRESULT WINAPI
HTMLElement2_put_dir(IHTMLElement2
*iface
, BSTR v
)
2798 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2802 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2805 FIXME("Unsupported for comment nodes.\n");
2809 nsAString_InitDepend(&nsstr
, v
);
2810 nsres
= nsIDOMHTMLElement_SetDir(This
->nselem
, &nsstr
);
2811 nsAString_Finish(&nsstr
);
2812 if(NS_FAILED(nsres
)) {
2813 ERR("SetDir failed: %08x\n", nsres
);
2820 static HRESULT WINAPI
HTMLElement2_get_dir(IHTMLElement2
*iface
, BSTR
*p
)
2822 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2826 TRACE("(%p)->(%p)\n", This
, p
);
2833 nsAString_Init(&dir_str
, NULL
);
2834 nsres
= nsIDOMHTMLElement_GetDir(This
->nselem
, &dir_str
);
2835 return return_nsstr(nsres
, &dir_str
, p
);
2838 static HRESULT WINAPI
HTMLElement2_createControlRange(IHTMLElement2
*iface
, IDispatch
**range
)
2840 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2841 FIXME("(%p)->(%p)\n", This
, range
);
2845 static HRESULT WINAPI
HTMLElement2_get_scrollHeight(IHTMLElement2
*iface
, LONG
*p
)
2847 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2850 TRACE("(%p)->(%p)\n", This
, p
);
2852 nsres
= nsIDOMHTMLElement_GetScrollHeight(This
->nselem
, p
);
2853 assert(nsres
== NS_OK
);
2855 TRACE("*p = %d\n", *p
);
2859 static HRESULT WINAPI
HTMLElement2_get_scrollWidth(IHTMLElement2
*iface
, LONG
*p
)
2861 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2864 TRACE("(%p)->(%p)\n", This
, p
);
2866 nsres
= nsIDOMHTMLElement_GetScrollWidth(This
->nselem
, p
);
2867 assert(nsres
== NS_OK
);
2869 TRACE("*p = %d\n", *p
);
2873 static HRESULT WINAPI
HTMLElement2_put_scrollTop(IHTMLElement2
*iface
, LONG v
)
2875 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2877 TRACE("(%p)->(%d)\n", This
, v
);
2880 FIXME("NULL nselem\n");
2884 nsIDOMHTMLElement_SetScrollTop(This
->nselem
, v
);
2888 static HRESULT WINAPI
HTMLElement2_get_scrollTop(IHTMLElement2
*iface
, LONG
*p
)
2890 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2893 TRACE("(%p)->(%p)\n", This
, p
);
2895 nsres
= nsIDOMHTMLElement_GetScrollTop(This
->nselem
, p
);
2896 assert(nsres
== NS_OK
);
2898 TRACE("*p = %d\n", *p
);
2902 static HRESULT WINAPI
HTMLElement2_put_scrollLeft(IHTMLElement2
*iface
, LONG v
)
2904 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2906 TRACE("(%p)->(%d)\n", This
, v
);
2909 FIXME("NULL nselem\n");
2913 nsIDOMHTMLElement_SetScrollLeft(This
->nselem
, v
);
2917 static HRESULT WINAPI
HTMLElement2_get_scrollLeft(IHTMLElement2
*iface
, LONG
*p
)
2919 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2922 TRACE("(%p)->(%p)\n", This
, p
);
2925 return E_INVALIDARG
;
2929 FIXME("NULL nselem\n");
2933 nsres
= nsIDOMHTMLElement_GetScrollLeft(This
->nselem
, p
);
2934 assert(nsres
== NS_OK
);
2936 TRACE("*p = %d\n", *p
);
2940 static HRESULT WINAPI
HTMLElement2_clearAttributes(IHTMLElement2
*iface
)
2942 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2943 FIXME("(%p)\n", This
);
2947 static HRESULT WINAPI
HTMLElement2_mergeAttributes(IHTMLElement2
*iface
, IHTMLElement
*mergeThis
)
2949 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2950 FIXME("(%p)->(%p)\n", This
, mergeThis
);
2954 static HRESULT WINAPI
HTMLElement2_put_oncontextmenu(IHTMLElement2
*iface
, VARIANT v
)
2956 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2958 TRACE("(%p)->()\n", This
);
2960 return set_node_event(&This
->node
, EVENTID_CONTEXTMENU
, &v
);
2963 static HRESULT WINAPI
HTMLElement2_get_oncontextmenu(IHTMLElement2
*iface
, VARIANT
*p
)
2965 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2967 TRACE("(%p)->(%p)\n", This
, p
);
2969 return get_node_event(&This
->node
, EVENTID_CONTEXTMENU
, p
);
2972 static HRESULT WINAPI
HTMLElement2_insertAdjacentElement(IHTMLElement2
*iface
, BSTR where
,
2973 IHTMLElement
*insertedElement
, IHTMLElement
**inserted
)
2975 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2976 HTMLDOMNode
*ret_node
;
2980 TRACE("(%p)->(%s %p %p)\n", This
, debugstr_w(where
), insertedElement
, inserted
);
2982 elem
= unsafe_impl_from_IHTMLElement(insertedElement
);
2984 return E_INVALIDARG
;
2986 hres
= insert_adjacent_node(This
, where
, elem
->node
.nsnode
, &ret_node
);
2990 hres
= IHTMLDOMNode_QueryInterface(&ret_node
->IHTMLDOMNode_iface
, &IID_IHTMLElement
, (void**)inserted
);
2991 IHTMLDOMNode_Release(&ret_node
->IHTMLDOMNode_iface
);
2995 static HRESULT WINAPI
HTMLElement2_applyElement(IHTMLElement2
*iface
, IHTMLElement
*apply
,
2996 BSTR where
, IHTMLElement
**applied
)
2998 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2999 FIXME("(%p)->(%p %s %p)\n", This
, apply
, debugstr_w(where
), applied
);
3003 static HRESULT WINAPI
HTMLElement2_getAdjacentText(IHTMLElement2
*iface
, BSTR where
, BSTR
*text
)
3005 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3006 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(where
), text
);
3010 static HRESULT WINAPI
HTMLElement2_replaceAdjacentText(IHTMLElement2
*iface
, BSTR where
,
3011 BSTR newText
, BSTR
*oldText
)
3013 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3014 FIXME("(%p)->(%s %s %p)\n", This
, debugstr_w(where
), debugstr_w(newText
), oldText
);
3018 static HRESULT WINAPI
HTMLElement2_get_canHandleChildren(IHTMLElement2
*iface
, VARIANT_BOOL
*p
)
3020 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3021 FIXME("(%p)->(%p)\n", This
, p
);
3025 static HRESULT WINAPI
HTMLElement2_addBehavior(IHTMLElement2
*iface
, BSTR bstrUrl
,
3026 VARIANT
*pvarFactory
, LONG
*pCookie
)
3028 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3029 FIXME("(%p)->(%s %p %p)\n", This
, debugstr_w(bstrUrl
), pvarFactory
, pCookie
);
3033 static HRESULT WINAPI
HTMLElement2_removeBehavior(IHTMLElement2
*iface
, LONG cookie
,
3034 VARIANT_BOOL
*pfResult
)
3036 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3037 FIXME("(%p)->(%d %p)\n", This
, cookie
, pfResult
);
3041 static HRESULT WINAPI
HTMLElement2_get_runtimeStyle(IHTMLElement2
*iface
, IHTMLStyle
**p
)
3043 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3045 FIXME("(%p)->(%p): hack\n", This
, p
);
3047 /* We can't implement correct behavior on top of Gecko (although we could
3048 try a bit harder). Making runtimeStyle behave like regular style is
3049 enough for most use cases. */
3050 if(!This
->runtime_style
) {
3053 hres
= HTMLStyle_Create(This
, &This
->runtime_style
);
3058 *p
= &This
->runtime_style
->IHTMLStyle_iface
;
3059 IHTMLStyle_AddRef(*p
);
3063 static HRESULT WINAPI
HTMLElement2_get_behaviorUrns(IHTMLElement2
*iface
, IDispatch
**p
)
3065 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3066 FIXME("(%p)->(%p)\n", This
, p
);
3070 static HRESULT WINAPI
HTMLElement2_put_tagUrn(IHTMLElement2
*iface
, BSTR v
)
3072 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3073 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
3077 static HRESULT WINAPI
HTMLElement2_get_tagUrn(IHTMLElement2
*iface
, BSTR
*p
)
3079 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3080 FIXME("(%p)->(%p)\n", This
, p
);
3084 static HRESULT WINAPI
HTMLElement2_put_onbeforeeditfocus(IHTMLElement2
*iface
, VARIANT vv
)
3086 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3087 FIXME("(%p)->()\n", This
);
3091 static HRESULT WINAPI
HTMLElement2_get_onbeforeeditfocus(IHTMLElement2
*iface
, VARIANT
*p
)
3093 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3094 FIXME("(%p)->(%p)\n", This
, p
);
3098 static HRESULT WINAPI
HTMLElement2_get_readyStateValue(IHTMLElement2
*iface
, LONG
*p
)
3100 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3101 FIXME("(%p)->(%p)\n", This
, p
);
3105 static HRESULT WINAPI
HTMLElement2_getElementsByTagName(IHTMLElement2
*iface
, BSTR v
,
3106 IHTMLElementCollection
**pelColl
)
3108 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3109 nsIDOMHTMLCollection
*nscol
;
3113 TRACE("(%p)->(%s %p)\n", This
, debugstr_w(v
), pelColl
);
3116 *pelColl
= create_collection_from_htmlcol(This
->node
.doc
, NULL
);
3120 nsAString_InitDepend(&tag_str
, v
);
3121 nsres
= nsIDOMHTMLElement_GetElementsByTagName(This
->nselem
, &tag_str
, &nscol
);
3122 nsAString_Finish(&tag_str
);
3123 if(NS_FAILED(nsres
)) {
3124 ERR("GetElementByTagName failed: %08x\n", nsres
);
3128 *pelColl
= create_collection_from_htmlcol(This
->node
.doc
, nscol
);
3129 nsIDOMHTMLCollection_Release(nscol
);
3133 static const IHTMLElement2Vtbl HTMLElement2Vtbl
= {
3134 HTMLElement2_QueryInterface
,
3135 HTMLElement2_AddRef
,
3136 HTMLElement2_Release
,
3137 HTMLElement2_GetTypeInfoCount
,
3138 HTMLElement2_GetTypeInfo
,
3139 HTMLElement2_GetIDsOfNames
,
3140 HTMLElement2_Invoke
,
3141 HTMLElement2_get_scopeName
,
3142 HTMLElement2_setCapture
,
3143 HTMLElement2_releaseCapture
,
3144 HTMLElement2_put_onlosecapture
,
3145 HTMLElement2_get_onlosecapture
,
3146 HTMLElement2_componentFromPoint
,
3147 HTMLElement2_doScroll
,
3148 HTMLElement2_put_onscroll
,
3149 HTMLElement2_get_onscroll
,
3150 HTMLElement2_put_ondrag
,
3151 HTMLElement2_get_ondrag
,
3152 HTMLElement2_put_ondragend
,
3153 HTMLElement2_get_ondragend
,
3154 HTMLElement2_put_ondragenter
,
3155 HTMLElement2_get_ondragenter
,
3156 HTMLElement2_put_ondragover
,
3157 HTMLElement2_get_ondragover
,
3158 HTMLElement2_put_ondragleave
,
3159 HTMLElement2_get_ondragleave
,
3160 HTMLElement2_put_ondrop
,
3161 HTMLElement2_get_ondrop
,
3162 HTMLElement2_put_onbeforecut
,
3163 HTMLElement2_get_onbeforecut
,
3164 HTMLElement2_put_oncut
,
3165 HTMLElement2_get_oncut
,
3166 HTMLElement2_put_onbeforecopy
,
3167 HTMLElement2_get_onbeforecopy
,
3168 HTMLElement2_put_oncopy
,
3169 HTMLElement2_get_oncopy
,
3170 HTMLElement2_put_onbeforepaste
,
3171 HTMLElement2_get_onbeforepaste
,
3172 HTMLElement2_put_onpaste
,
3173 HTMLElement2_get_onpaste
,
3174 HTMLElement2_get_currentStyle
,
3175 HTMLElement2_put_onpropertychange
,
3176 HTMLElement2_get_onpropertychange
,
3177 HTMLElement2_getClientRects
,
3178 HTMLElement2_getBoundingClientRect
,
3179 HTMLElement2_setExpression
,
3180 HTMLElement2_getExpression
,
3181 HTMLElement2_removeExpression
,
3182 HTMLElement2_put_tabIndex
,
3183 HTMLElement2_get_tabIndex
,
3185 HTMLElement2_put_accessKey
,
3186 HTMLElement2_get_accessKey
,
3187 HTMLElement2_put_onblur
,
3188 HTMLElement2_get_onblur
,
3189 HTMLElement2_put_onfocus
,
3190 HTMLElement2_get_onfocus
,
3191 HTMLElement2_put_onresize
,
3192 HTMLElement2_get_onresize
,
3194 HTMLElement2_addFilter
,
3195 HTMLElement2_removeFilter
,
3196 HTMLElement2_get_clientHeight
,
3197 HTMLElement2_get_clientWidth
,
3198 HTMLElement2_get_clientTop
,
3199 HTMLElement2_get_clientLeft
,
3200 HTMLElement2_attachEvent
,
3201 HTMLElement2_detachEvent
,
3202 HTMLElement2_get_readyState
,
3203 HTMLElement2_put_onreadystatechange
,
3204 HTMLElement2_get_onreadystatechange
,
3205 HTMLElement2_put_onrowsdelete
,
3206 HTMLElement2_get_onrowsdelete
,
3207 HTMLElement2_put_onrowsinserted
,
3208 HTMLElement2_get_onrowsinserted
,
3209 HTMLElement2_put_oncellchange
,
3210 HTMLElement2_get_oncellchange
,
3211 HTMLElement2_put_dir
,
3212 HTMLElement2_get_dir
,
3213 HTMLElement2_createControlRange
,
3214 HTMLElement2_get_scrollHeight
,
3215 HTMLElement2_get_scrollWidth
,
3216 HTMLElement2_put_scrollTop
,
3217 HTMLElement2_get_scrollTop
,
3218 HTMLElement2_put_scrollLeft
,
3219 HTMLElement2_get_scrollLeft
,
3220 HTMLElement2_clearAttributes
,
3221 HTMLElement2_mergeAttributes
,
3222 HTMLElement2_put_oncontextmenu
,
3223 HTMLElement2_get_oncontextmenu
,
3224 HTMLElement2_insertAdjacentElement
,
3225 HTMLElement2_applyElement
,
3226 HTMLElement2_getAdjacentText
,
3227 HTMLElement2_replaceAdjacentText
,
3228 HTMLElement2_get_canHandleChildren
,
3229 HTMLElement2_addBehavior
,
3230 HTMLElement2_removeBehavior
,
3231 HTMLElement2_get_runtimeStyle
,
3232 HTMLElement2_get_behaviorUrns
,
3233 HTMLElement2_put_tagUrn
,
3234 HTMLElement2_get_tagUrn
,
3235 HTMLElement2_put_onbeforeeditfocus
,
3236 HTMLElement2_get_onbeforeeditfocus
,
3237 HTMLElement2_get_readyStateValue
,
3238 HTMLElement2_getElementsByTagName
,
3241 static inline HTMLElement
*impl_from_IHTMLElement3(IHTMLElement3
*iface
)
3243 return CONTAINING_RECORD(iface
, HTMLElement
, IHTMLElement3_iface
);
3246 static HRESULT WINAPI
HTMLElement3_QueryInterface(IHTMLElement3
*iface
,
3247 REFIID riid
, void **ppv
)
3249 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3250 return IHTMLElement_QueryInterface(&This
->IHTMLElement_iface
, riid
, ppv
);
3253 static ULONG WINAPI
HTMLElement3_AddRef(IHTMLElement3
*iface
)
3255 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3256 return IHTMLElement_AddRef(&This
->IHTMLElement_iface
);
3259 static ULONG WINAPI
HTMLElement3_Release(IHTMLElement3
*iface
)
3261 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3262 return IHTMLElement_Release(&This
->IHTMLElement_iface
);
3265 static HRESULT WINAPI
HTMLElement3_GetTypeInfoCount(IHTMLElement3
*iface
, UINT
*pctinfo
)
3267 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3268 return IDispatchEx_GetTypeInfoCount(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
3271 static HRESULT WINAPI
HTMLElement3_GetTypeInfo(IHTMLElement3
*iface
, UINT iTInfo
,
3272 LCID lcid
, ITypeInfo
**ppTInfo
)
3274 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3275 return IDispatchEx_GetTypeInfo(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
3278 static HRESULT WINAPI
HTMLElement3_GetIDsOfNames(IHTMLElement3
*iface
, REFIID riid
,
3279 LPOLESTR
*rgszNames
, UINT cNames
,
3280 LCID lcid
, DISPID
*rgDispId
)
3282 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3283 return IDispatchEx_GetIDsOfNames(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
3287 static HRESULT WINAPI
HTMLElement3_Invoke(IHTMLElement3
*iface
, DISPID dispIdMember
,
3288 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
3289 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
3291 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3292 return IDispatchEx_Invoke(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
3293 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
3296 static HRESULT WINAPI
HTMLElement3_mergeAttributes(IHTMLElement3
*iface
, IHTMLElement
*mergeThis
, VARIANT
*pvarFlags
)
3298 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3299 FIXME("(%p)->(%p %p)\n", This
, mergeThis
, pvarFlags
);
3303 static HRESULT WINAPI
HTMLElement3_get_isMultiLine(IHTMLElement3
*iface
, VARIANT_BOOL
*p
)
3305 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3306 FIXME("(%p)->(%p)\n", This
, p
);
3310 static HRESULT WINAPI
HTMLElement3_get_canHaveHTML(IHTMLElement3
*iface
, VARIANT_BOOL
*p
)
3312 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3313 FIXME("(%p)->(%p)\n", This
, p
);
3317 static HRESULT WINAPI
HTMLElement3_put_onlayoutcomplete(IHTMLElement3
*iface
, VARIANT v
)
3319 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3320 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3324 static HRESULT WINAPI
HTMLElement3_get_onlayoutcomplete(IHTMLElement3
*iface
, VARIANT
*p
)
3326 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3327 FIXME("(%p)->(%p)\n", This
, p
);
3331 static HRESULT WINAPI
HTMLElement3_put_onpage(IHTMLElement3
*iface
, VARIANT v
)
3333 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3334 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3338 static HRESULT WINAPI
HTMLElement3_get_onpage(IHTMLElement3
*iface
, VARIANT
*p
)
3340 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3341 FIXME("(%p)->(%p)\n", This
, p
);
3345 static HRESULT WINAPI
HTMLElement3_put_inflateBlock(IHTMLElement3
*iface
, VARIANT_BOOL v
)
3347 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3348 FIXME("(%p)->(%x)\n", This
, v
);
3352 static HRESULT WINAPI
HTMLElement3_get_inflateBlock(IHTMLElement3
*iface
, VARIANT_BOOL
*p
)
3354 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3355 FIXME("(%p)->(%p)\n", This
, p
);
3359 static HRESULT WINAPI
HTMLElement3_put_onbeforedeactivate(IHTMLElement3
*iface
, VARIANT v
)
3361 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3362 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3366 static HRESULT WINAPI
HTMLElement3_get_onbeforedeactivate(IHTMLElement3
*iface
, VARIANT
*p
)
3368 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3369 FIXME("(%p)->(%p)\n", This
, p
);
3373 static HRESULT WINAPI
HTMLElement3_setActive(IHTMLElement3
*iface
)
3375 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3376 FIXME("(%p)\n", This
);
3380 static HRESULT WINAPI
HTMLElement3_put_contentEditable(IHTMLElement3
*iface
, BSTR v
)
3382 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3386 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
3388 nsAString_InitDepend(&str
, v
);
3389 nsres
= nsIDOMHTMLElement_SetContentEditable(This
->nselem
, &str
);
3390 nsAString_Finish(&str
);
3392 if (NS_FAILED(nsres
)){
3393 ERR("SetContentEditable(%s) failed!\n", debugstr_w(v
));
3400 static HRESULT WINAPI
HTMLElement3_get_contentEditable(IHTMLElement3
*iface
, BSTR
*p
)
3402 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3406 TRACE("(%p)->(%p)\n", This
, p
);
3408 nsAString_Init(&str
, NULL
);
3409 nsres
= nsIDOMHTMLElement_GetContentEditable(This
->nselem
, &str
);
3410 return return_nsstr(nsres
, &str
, p
);
3413 static HRESULT WINAPI
HTMLElement3_get_isContentEditable(IHTMLElement3
*iface
, VARIANT_BOOL
*p
)
3415 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3416 FIXME("(%p)->(%p)\n", This
, p
);
3420 static HRESULT WINAPI
HTMLElement3_put_hideFocus(IHTMLElement3
*iface
, VARIANT_BOOL v
)
3422 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3423 FIXME("(%p)->(%x)\n", This
, v
);
3427 static HRESULT WINAPI
HTMLElement3_get_hideFocus(IHTMLElement3
*iface
, VARIANT_BOOL
*p
)
3429 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3430 FIXME("(%p)->(%p)\n", This
, p
);
3434 static const WCHAR disabledW
[] = {'d','i','s','a','b','l','e','d',0};
3436 static HRESULT WINAPI
HTMLElement3_put_disabled(IHTMLElement3
*iface
, VARIANT_BOOL v
)
3438 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3442 TRACE("(%p)->(%x)\n", This
, v
);
3444 if(This
->node
.vtbl
->put_disabled
)
3445 return This
->node
.vtbl
->put_disabled(&This
->node
, v
);
3447 hres
= dispex_get_dprop_ref(&This
->node
.event_target
.dispex
, disabledW
, TRUE
, &var
);
3452 V_VT(var
) = VT_BOOL
;
3457 static HRESULT WINAPI
HTMLElement3_get_disabled(IHTMLElement3
*iface
, VARIANT_BOOL
*p
)
3459 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3463 TRACE("(%p)->(%p)\n", This
, p
);
3465 if(This
->node
.vtbl
->get_disabled
)
3466 return This
->node
.vtbl
->get_disabled(&This
->node
, p
);
3468 hres
= dispex_get_dprop_ref(&This
->node
.event_target
.dispex
, disabledW
, FALSE
, &var
);
3469 if(hres
== DISP_E_UNKNOWNNAME
) {
3476 if(V_VT(var
) != VT_BOOL
) {
3477 FIXME("value is %s\n", debugstr_variant(var
));
3485 static HRESULT WINAPI
HTMLElement3_get_isDisabled(IHTMLElement3
*iface
, VARIANT_BOOL
*p
)
3487 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3488 FIXME("(%p)->(%p)\n", This
, p
);
3492 static HRESULT WINAPI
HTMLElement3_put_onmove(IHTMLElement3
*iface
, VARIANT v
)
3494 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3495 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3499 static HRESULT WINAPI
HTMLElement3_get_onmove(IHTMLElement3
*iface
, VARIANT
*p
)
3501 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3502 FIXME("(%p)->(%p)\n", This
, p
);
3506 static HRESULT WINAPI
HTMLElement3_put_oncontrolselect(IHTMLElement3
*iface
, VARIANT v
)
3508 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3509 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3513 static HRESULT WINAPI
HTMLElement3_get_oncontrolselect(IHTMLElement3
*iface
, VARIANT
*p
)
3515 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3516 FIXME("(%p)->(%p)\n", This
, p
);
3520 static HRESULT WINAPI
HTMLElement3_fireEvent(IHTMLElement3
*iface
, BSTR bstrEventName
,
3521 VARIANT
*pvarEventObject
, VARIANT_BOOL
*pfCancelled
)
3523 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3525 TRACE("(%p)->(%s %s %p)\n", This
, debugstr_w(bstrEventName
), debugstr_variant(pvarEventObject
),
3528 return fire_event(&This
->node
, bstrEventName
, pvarEventObject
, pfCancelled
);
3531 static HRESULT WINAPI
HTMLElement3_put_onresizestart(IHTMLElement3
*iface
, VARIANT v
)
3533 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3534 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3538 static HRESULT WINAPI
HTMLElement3_get_onresizestart(IHTMLElement3
*iface
, VARIANT
*p
)
3540 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3541 FIXME("(%p)->(%p)\n", This
, p
);
3545 static HRESULT WINAPI
HTMLElement3_put_onresizeend(IHTMLElement3
*iface
, VARIANT v
)
3547 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3548 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3552 static HRESULT WINAPI
HTMLElement3_get_onresizeend(IHTMLElement3
*iface
, VARIANT
*p
)
3554 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3555 FIXME("(%p)->(%p)\n", This
, p
);
3559 static HRESULT WINAPI
HTMLElement3_put_onmovestart(IHTMLElement3
*iface
, VARIANT v
)
3561 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3562 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3566 static HRESULT WINAPI
HTMLElement3_get_onmovestart(IHTMLElement3
*iface
, VARIANT
*p
)
3568 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3569 FIXME("(%p)->(%p)\n", This
, p
);
3573 static HRESULT WINAPI
HTMLElement3_put_onmoveend(IHTMLElement3
*iface
, VARIANT v
)
3575 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3576 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3580 static HRESULT WINAPI
HTMLElement3_get_onmoveend(IHTMLElement3
*iface
, VARIANT
*p
)
3582 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3583 FIXME("(%p)->(%p)\n", This
, p
);
3587 static HRESULT WINAPI
HTMLElement3_put_onmousecenter(IHTMLElement3
*iface
, VARIANT v
)
3589 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3590 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3594 static HRESULT WINAPI
HTMLElement3_get_onmousecenter(IHTMLElement3
*iface
, VARIANT
*p
)
3596 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3597 FIXME("(%p)->(%p)\n", This
, p
);
3601 static HRESULT WINAPI
HTMLElement3_put_onmouseleave(IHTMLElement3
*iface
, VARIANT v
)
3603 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3604 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3608 static HRESULT WINAPI
HTMLElement3_get_onmouseleave(IHTMLElement3
*iface
, VARIANT
*p
)
3610 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3611 FIXME("(%p)->(%p)\n", This
, p
);
3615 static HRESULT WINAPI
HTMLElement3_put_onactivate(IHTMLElement3
*iface
, VARIANT v
)
3617 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3618 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3622 static HRESULT WINAPI
HTMLElement3_get_onactivate(IHTMLElement3
*iface
, VARIANT
*p
)
3624 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3625 FIXME("(%p)->(%p)\n", This
, p
);
3629 static HRESULT WINAPI
HTMLElement3_put_ondeactivate(IHTMLElement3
*iface
, VARIANT v
)
3631 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3632 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3636 static HRESULT WINAPI
HTMLElement3_get_ondeactivate(IHTMLElement3
*iface
, VARIANT
*p
)
3638 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3639 FIXME("(%p)->(%p)\n", This
, p
);
3643 static HRESULT WINAPI
HTMLElement3_dragDrop(IHTMLElement3
*iface
, VARIANT_BOOL
*pfRet
)
3645 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3646 FIXME("(%p)->(%p)\n", This
, pfRet
);
3650 static HRESULT WINAPI
HTMLElement3_get_glyphMode(IHTMLElement3
*iface
, LONG
*p
)
3652 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3653 FIXME("(%p)->(%p)\n", This
, p
);
3657 static const IHTMLElement3Vtbl HTMLElement3Vtbl
= {
3658 HTMLElement3_QueryInterface
,
3659 HTMLElement3_AddRef
,
3660 HTMLElement3_Release
,
3661 HTMLElement3_GetTypeInfoCount
,
3662 HTMLElement3_GetTypeInfo
,
3663 HTMLElement3_GetIDsOfNames
,
3664 HTMLElement3_Invoke
,
3665 HTMLElement3_mergeAttributes
,
3666 HTMLElement3_get_isMultiLine
,
3667 HTMLElement3_get_canHaveHTML
,
3668 HTMLElement3_put_onlayoutcomplete
,
3669 HTMLElement3_get_onlayoutcomplete
,
3670 HTMLElement3_put_onpage
,
3671 HTMLElement3_get_onpage
,
3672 HTMLElement3_put_inflateBlock
,
3673 HTMLElement3_get_inflateBlock
,
3674 HTMLElement3_put_onbeforedeactivate
,
3675 HTMLElement3_get_onbeforedeactivate
,
3676 HTMLElement3_setActive
,
3677 HTMLElement3_put_contentEditable
,
3678 HTMLElement3_get_contentEditable
,
3679 HTMLElement3_get_isContentEditable
,
3680 HTMLElement3_put_hideFocus
,
3681 HTMLElement3_get_hideFocus
,
3682 HTMLElement3_put_disabled
,
3683 HTMLElement3_get_disabled
,
3684 HTMLElement3_get_isDisabled
,
3685 HTMLElement3_put_onmove
,
3686 HTMLElement3_get_onmove
,
3687 HTMLElement3_put_oncontrolselect
,
3688 HTMLElement3_get_oncontrolselect
,
3689 HTMLElement3_fireEvent
,
3690 HTMLElement3_put_onresizestart
,
3691 HTMLElement3_get_onresizestart
,
3692 HTMLElement3_put_onresizeend
,
3693 HTMLElement3_get_onresizeend
,
3694 HTMLElement3_put_onmovestart
,
3695 HTMLElement3_get_onmovestart
,
3696 HTMLElement3_put_onmoveend
,
3697 HTMLElement3_get_onmoveend
,
3698 HTMLElement3_put_onmousecenter
,
3699 HTMLElement3_get_onmousecenter
,
3700 HTMLElement3_put_onmouseleave
,
3701 HTMLElement3_get_onmouseleave
,
3702 HTMLElement3_put_onactivate
,
3703 HTMLElement3_get_onactivate
,
3704 HTMLElement3_put_ondeactivate
,
3705 HTMLElement3_get_ondeactivate
,
3706 HTMLElement3_dragDrop
,
3707 HTMLElement3_get_glyphMode
3710 static inline HTMLElement
*impl_from_IHTMLElement4(IHTMLElement4
*iface
)
3712 return CONTAINING_RECORD(iface
, HTMLElement
, IHTMLElement4_iface
);
3715 static HRESULT WINAPI
HTMLElement4_QueryInterface(IHTMLElement4
*iface
,
3716 REFIID riid
, void **ppv
)
3718 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3719 return IHTMLElement_QueryInterface(&This
->IHTMLElement_iface
, riid
, ppv
);
3722 static ULONG WINAPI
HTMLElement4_AddRef(IHTMLElement4
*iface
)
3724 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3725 return IHTMLElement_AddRef(&This
->IHTMLElement_iface
);
3728 static ULONG WINAPI
HTMLElement4_Release(IHTMLElement4
*iface
)
3730 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3731 return IHTMLElement_Release(&This
->IHTMLElement_iface
);
3734 static HRESULT WINAPI
HTMLElement4_GetTypeInfoCount(IHTMLElement4
*iface
, UINT
*pctinfo
)
3736 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3737 return IDispatchEx_GetTypeInfoCount(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
3740 static HRESULT WINAPI
HTMLElement4_GetTypeInfo(IHTMLElement4
*iface
, UINT iTInfo
,
3741 LCID lcid
, ITypeInfo
**ppTInfo
)
3743 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3744 return IDispatchEx_GetTypeInfo(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
3747 static HRESULT WINAPI
HTMLElement4_GetIDsOfNames(IHTMLElement4
*iface
, REFIID riid
,
3748 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
3750 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3751 return IDispatchEx_GetIDsOfNames(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
3755 static HRESULT WINAPI
HTMLElement4_Invoke(IHTMLElement4
*iface
, DISPID dispIdMember
, REFIID riid
,
3756 LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
3758 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3759 return IDispatchEx_Invoke(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
3760 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
3763 static HRESULT WINAPI
HTMLElement4_put_onmousewheel(IHTMLElement4
*iface
, VARIANT v
)
3765 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3767 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3769 return set_node_event(&This
->node
, EVENTID_MOUSEWHEEL
, &v
);
3772 static HRESULT WINAPI
HTMLElement4_get_onmousewheel(IHTMLElement4
*iface
, VARIANT
*p
)
3774 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3776 TRACE("(%p)->(%p)\n", This
, p
);
3778 return get_node_event(&This
->node
, EVENTID_MOUSEWHEEL
, p
);
3781 static HRESULT WINAPI
HTMLElement4_normalize(IHTMLElement4
*iface
)
3783 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3784 FIXME("(%p)\n", This
);
3788 static HRESULT WINAPI
HTMLElement4_getAttributeNode(IHTMLElement4
*iface
, BSTR bstrname
, IHTMLDOMAttribute
**ppAttribute
)
3790 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3791 HTMLAttributeCollection
*attrs
;
3794 TRACE("(%p)->(%s %p)\n", This
, debugstr_w(bstrname
), ppAttribute
);
3796 hres
= HTMLElement_get_attr_col(&This
->node
, &attrs
);
3800 hres
= IHTMLAttributeCollection2_getNamedItem(&attrs
->IHTMLAttributeCollection2_iface
, bstrname
, ppAttribute
);
3801 IHTMLAttributeCollection_Release(&attrs
->IHTMLAttributeCollection_iface
);
3805 static HRESULT WINAPI
HTMLElement4_setAttributeNode(IHTMLElement4
*iface
, IHTMLDOMAttribute
*pattr
,
3806 IHTMLDOMAttribute
**ppretAttribute
)
3808 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3809 HTMLDOMAttribute
*attr
, *iter
, *replace
= NULL
;
3810 HTMLAttributeCollection
*attrs
;
3814 TRACE("(%p)->(%p %p)\n", This
, pattr
, ppretAttribute
);
3816 attr
= unsafe_impl_from_IHTMLDOMAttribute(pattr
);
3818 return E_INVALIDARG
;
3821 WARN("Tried to set already attached attribute.\n");
3822 return E_INVALIDARG
;
3825 hres
= IDispatchEx_GetDispID(&This
->node
.event_target
.dispex
.IDispatchEx_iface
,
3826 attr
->name
, fdexNameCaseInsensitive
|fdexNameEnsure
, &dispid
);
3830 hres
= HTMLElement_get_attr_col(&This
->node
, &attrs
);
3834 LIST_FOR_EACH_ENTRY(iter
, &attrs
->attrs
, HTMLDOMAttribute
, entry
) {
3835 if(iter
->dispid
== dispid
) {
3842 hres
= get_elem_attr_value_by_dispid(This
, dispid
, &replace
->value
);
3844 WARN("could not get attr value: %08x\n", hres
);
3845 V_VT(&replace
->value
) = VT_EMPTY
;
3847 if(!replace
->name
) {
3848 replace
->name
= attr
->name
;
3851 list_add_head(&replace
->entry
, &attr
->entry
);
3852 list_remove(&replace
->entry
);
3853 replace
->elem
= NULL
;
3855 list_add_tail(&attrs
->attrs
, &attr
->entry
);
3858 IHTMLDOMAttribute_AddRef(&attr
->IHTMLDOMAttribute_iface
);
3860 attr
->dispid
= dispid
;
3862 IHTMLAttributeCollection_Release(&attrs
->IHTMLAttributeCollection_iface
);
3864 hres
= set_elem_attr_value_by_dispid(This
, dispid
, &attr
->value
);
3866 WARN("Could not set attribute value: %08x\n", hres
);
3867 VariantClear(&attr
->value
);
3869 *ppretAttribute
= replace
? &replace
->IHTMLDOMAttribute_iface
: NULL
;
3873 static HRESULT WINAPI
HTMLElement4_removeAttributeNode(IHTMLElement4
*iface
, IHTMLDOMAttribute
*pattr
,
3874 IHTMLDOMAttribute
**ppretAttribute
)
3876 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3877 FIXME("(%p)->(%p %p)\n", This
, pattr
, ppretAttribute
);
3881 static HRESULT WINAPI
HTMLElement4_put_onbeforeactivate(IHTMLElement4
*iface
, VARIANT v
)
3883 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3885 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3887 return set_node_event(&This
->node
, EVENTID_BEFOREACTIVATE
, &v
);
3890 static HRESULT WINAPI
HTMLElement4_get_onbeforeactivate(IHTMLElement4
*iface
, VARIANT
*p
)
3892 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3894 TRACE("(%p)->(%p)\n", This
, p
);
3896 return get_node_event(&This
->node
, EVENTID_BEFOREACTIVATE
, p
);
3899 static HRESULT WINAPI
HTMLElement4_put_onfocusin(IHTMLElement4
*iface
, VARIANT v
)
3901 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3903 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3905 return set_node_event(&This
->node
, EVENTID_FOCUSIN
, &v
);
3908 static HRESULT WINAPI
HTMLElement4_get_onfocusin(IHTMLElement4
*iface
, VARIANT
*p
)
3910 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3912 TRACE("(%p)->(%p)\n", This
, p
);
3914 return get_node_event(&This
->node
, EVENTID_FOCUSIN
, p
);
3917 static HRESULT WINAPI
HTMLElement4_put_onfocusout(IHTMLElement4
*iface
, VARIANT v
)
3919 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3921 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3923 return set_node_event(&This
->node
, EVENTID_FOCUSOUT
, &v
);
3926 static HRESULT WINAPI
HTMLElement4_get_onfocusout(IHTMLElement4
*iface
, VARIANT
*p
)
3928 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3930 TRACE("(%p)->(%p)\n", This
, p
);
3932 return get_node_event(&This
->node
, EVENTID_FOCUSOUT
, p
);
3935 static const IHTMLElement4Vtbl HTMLElement4Vtbl
= {
3936 HTMLElement4_QueryInterface
,
3937 HTMLElement4_AddRef
,
3938 HTMLElement4_Release
,
3939 HTMLElement4_GetTypeInfoCount
,
3940 HTMLElement4_GetTypeInfo
,
3941 HTMLElement4_GetIDsOfNames
,
3942 HTMLElement4_Invoke
,
3943 HTMLElement4_put_onmousewheel
,
3944 HTMLElement4_get_onmousewheel
,
3945 HTMLElement4_normalize
,
3946 HTMLElement4_getAttributeNode
,
3947 HTMLElement4_setAttributeNode
,
3948 HTMLElement4_removeAttributeNode
,
3949 HTMLElement4_put_onbeforeactivate
,
3950 HTMLElement4_get_onbeforeactivate
,
3951 HTMLElement4_put_onfocusin
,
3952 HTMLElement4_get_onfocusin
,
3953 HTMLElement4_put_onfocusout
,
3954 HTMLElement4_get_onfocusout
3957 static inline HTMLElement
*impl_from_IHTMLElement6(IHTMLElement6
*iface
)
3959 return CONTAINING_RECORD(iface
, HTMLElement
, IHTMLElement6_iface
);
3962 static HRESULT WINAPI
HTMLElement6_QueryInterface(IHTMLElement6
*iface
,
3963 REFIID riid
, void **ppv
)
3965 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
3966 return IHTMLElement_QueryInterface(&This
->IHTMLElement_iface
, riid
, ppv
);
3969 static ULONG WINAPI
HTMLElement6_AddRef(IHTMLElement6
*iface
)
3971 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
3972 return IHTMLElement_AddRef(&This
->IHTMLElement_iface
);
3975 static ULONG WINAPI
HTMLElement6_Release(IHTMLElement6
*iface
)
3977 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
3978 return IHTMLElement_Release(&This
->IHTMLElement_iface
);
3981 static HRESULT WINAPI
HTMLElement6_GetTypeInfoCount(IHTMLElement6
*iface
, UINT
*pctinfo
)
3983 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
3984 return IDispatchEx_GetTypeInfoCount(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
3987 static HRESULT WINAPI
HTMLElement6_GetTypeInfo(IHTMLElement6
*iface
, UINT iTInfo
,
3988 LCID lcid
, ITypeInfo
**ppTInfo
)
3990 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
3991 return IDispatchEx_GetTypeInfo(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
3994 static HRESULT WINAPI
HTMLElement6_GetIDsOfNames(IHTMLElement6
*iface
, REFIID riid
,
3995 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
3997 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
3998 return IDispatchEx_GetIDsOfNames(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
4002 static HRESULT WINAPI
HTMLElement6_Invoke(IHTMLElement6
*iface
, DISPID dispIdMember
, REFIID riid
,
4003 LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
4005 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4006 return IDispatchEx_Invoke(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
4007 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
4010 static HRESULT WINAPI
HTMLElement6_getAttributeNS(IHTMLElement6
*iface
, VARIANT
*pvarNS
, BSTR strAttributeName
, VARIANT
*AttributeValue
)
4012 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4013 FIXME("(%p)->(%s %s %p)\n", This
, debugstr_variant(pvarNS
), debugstr_w(strAttributeName
), AttributeValue
);
4017 static HRESULT WINAPI
HTMLElement6_setAttributeNS(IHTMLElement6
*iface
, VARIANT
*pvarNS
, BSTR strAttributeName
, VARIANT
*pvarAttributeValue
)
4019 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4020 FIXME("(%p)->(%s %s %s)\n", This
, debugstr_variant(pvarNS
), debugstr_w(strAttributeName
), debugstr_variant(pvarAttributeValue
));
4024 static HRESULT WINAPI
HTMLElement6_removeAttributeNS(IHTMLElement6
*iface
, VARIANT
*pvarNS
, BSTR strAttributeName
)
4026 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4027 FIXME("(%p)->(%s %s)\n", This
, debugstr_variant(pvarNS
), debugstr_w(strAttributeName
));
4031 static HRESULT WINAPI
HTMLElement6_getAttributeNodeNS(IHTMLElement6
*iface
, VARIANT
*pvarNS
, BSTR name
, IHTMLDOMAttribute2
**ppretAttribute
)
4033 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4034 FIXME("(%p)->(%s %s %p)\n", This
, debugstr_variant(pvarNS
), debugstr_w(name
), ppretAttribute
);
4038 static HRESULT WINAPI
HTMLElement6_setAttributeNodeNS(IHTMLElement6
*iface
, IHTMLDOMAttribute2
*pattr
, IHTMLDOMAttribute2
**ppretAttribute
)
4040 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4041 FIXME("(%p)->(%p %p)\n", This
, pattr
, ppretAttribute
);
4045 static HRESULT WINAPI
HTMLElement6_hasAttributeNS(IHTMLElement6
*iface
, VARIANT
*pvarNS
, BSTR name
, VARIANT_BOOL
*pfHasAttribute
)
4047 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4048 FIXME("(%p)->(%s %s %p)\n", This
, debugstr_variant(pvarNS
), debugstr_w(name
), pfHasAttribute
);
4052 static HRESULT WINAPI
HTMLElement6_getAttribute(IHTMLElement6
*iface
, BSTR strAttributeName
, VARIANT
*AttributeValue
)
4054 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4056 WARN("(%p)->(%s %p) forwarding to IHTMLElement\n", This
, debugstr_w(strAttributeName
), AttributeValue
);
4058 return IHTMLElement_getAttribute(&This
->IHTMLElement_iface
, strAttributeName
, 0, AttributeValue
);
4061 static HRESULT WINAPI
HTMLElement6_setAttribute(IHTMLElement6
*iface
, BSTR strAttributeName
, VARIANT
*pvarAttributeValue
)
4063 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4065 WARN("(%p)->(%s %p) forwarding to IHTMLElement\n", This
, debugstr_w(strAttributeName
), pvarAttributeValue
);
4067 return IHTMLElement_setAttribute(&This
->IHTMLElement_iface
, strAttributeName
, *pvarAttributeValue
, 0);
4070 static HRESULT WINAPI
HTMLElement6_removeAttribute(IHTMLElement6
*iface
, BSTR strAttributeName
)
4072 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4073 VARIANT_BOOL success
;
4075 WARN("(%p)->(%s) forwarding to IHTMLElement\n", This
, debugstr_w(strAttributeName
));
4077 return IHTMLElement_removeAttribute(&This
->IHTMLElement_iface
, strAttributeName
, 0, &success
);
4080 static HRESULT WINAPI
HTMLElement6_getAttributeNode(IHTMLElement6
*iface
, BSTR strAttributeName
, IHTMLDOMAttribute2
**ppretAttribute
)
4082 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4083 IHTMLDOMAttribute
*attr
;
4086 WARN("(%p)->(%s %p) forwarding to IHTMLElement4\n", This
, debugstr_w(strAttributeName
), ppretAttribute
);
4088 hres
= IHTMLElement4_getAttributeNode(&This
->IHTMLElement4_iface
, strAttributeName
, &attr
);
4093 hres
= IHTMLDOMAttribute_QueryInterface(attr
, &IID_IHTMLDOMAttribute2
, (void**)ppretAttribute
);
4094 IHTMLDOMAttribute_Release(attr
);
4096 *ppretAttribute
= NULL
;
4101 static HRESULT WINAPI
HTMLElement6_setAttributeNode(IHTMLElement6
*iface
, IHTMLDOMAttribute2
*pattr
, IHTMLDOMAttribute2
**ppretAttribute
)
4103 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4104 IHTMLDOMAttribute
*attr
, *ret_attr
;
4107 WARN("(%p)->(%p %p) forwarding to IHTMLElement4\n", This
, pattr
, ppretAttribute
);
4109 hres
= IHTMLDOMAttribute2_QueryInterface(pattr
, &IID_IHTMLDOMAttribute
, (void**)&attr
);
4113 hres
= IHTMLElement4_setAttributeNode(&This
->IHTMLElement4_iface
, attr
, &ret_attr
);
4118 hres
= IHTMLDOMAttribute_QueryInterface(ret_attr
, &IID_IHTMLDOMAttribute2
, (void**)ppretAttribute
);
4119 IHTMLDOMAttribute_Release(ret_attr
);
4121 *ppretAttribute
= NULL
;
4126 static HRESULT WINAPI
HTMLElement6_removeAttributeNode(IHTMLElement6
*iface
, IHTMLDOMAttribute2
*pattr
, IHTMLDOMAttribute2
**ppretAttribute
)
4128 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4129 FIXME("(%p)->()\n", This
);
4133 static HRESULT WINAPI
HTMLElement6_hasAttribute(IHTMLElement6
*iface
, BSTR name
, VARIANT_BOOL
*pfHasAttribute
)
4135 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4136 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(name
), pfHasAttribute
);
4140 static HRESULT WINAPI
HTMLElement6_getElementsByTagNameNS(IHTMLElement6
*iface
, VARIANT
*varNS
, BSTR bstrLocalName
, IHTMLElementCollection
**pelColl
)
4142 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4143 FIXME("(%p)->(%s %s %p)\n", This
, debugstr_variant(varNS
), debugstr_w(bstrLocalName
), pelColl
);
4147 static HRESULT WINAPI
HTMLElement6_get_tagName(IHTMLElement6
*iface
, BSTR
*p
)
4149 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4151 TRACE("(%p)->(%p)\n", This
, p
);
4153 return IHTMLElement_get_tagName(&This
->IHTMLElement_iface
, p
);
4156 static HRESULT WINAPI
HTMLElement6_get_nodeName(IHTMLElement6
*iface
, BSTR
*p
)
4158 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4160 TRACE("(%p)->(%p)\n", This
, p
);
4162 return IHTMLDOMNode_get_nodeName(&This
->node
.IHTMLDOMNode_iface
, p
);
4165 static HRESULT WINAPI
HTMLElement6_getElementsByClassName(IHTMLElement6
*iface
, BSTR v
, IHTMLElementCollection
**pel
)
4167 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4168 nsIDOMHTMLCollection
*nscol
= NULL
;
4172 TRACE("(%p)->(%s %p)\n", This
, debugstr_w(v
), pel
);
4175 nsAString_InitDepend(&nsstr
, v
);
4176 nsres
= nsIDOMHTMLElement_GetElementsByClassName(This
->nselem
, &nsstr
, &nscol
);
4177 nsAString_Finish(&nsstr
);
4178 if(NS_FAILED(nsres
)) {
4179 ERR("GetElementsByClassName failed: %08x\n", nsres
);
4184 *pel
= create_collection_from_htmlcol(This
->node
.doc
, nscol
);
4185 nsIDOMHTMLCollection_Release(nscol
);
4189 static HRESULT WINAPI
HTMLElement6_msMatchesSelector(IHTMLElement6
*iface
, BSTR v
, VARIANT_BOOL
*pfMatches
)
4191 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4192 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(v
), pfMatches
);
4196 static HRESULT WINAPI
HTMLElement6_put_onabort(IHTMLElement6
*iface
, VARIANT v
)
4198 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4200 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4202 return set_node_event(&This
->node
, EVENTID_ABORT
, &v
);
4205 static HRESULT WINAPI
HTMLElement6_get_onabort(IHTMLElement6
*iface
, VARIANT
*p
)
4207 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4209 TRACE("(%p)->(%p)\n", This
, p
);
4211 return get_node_event(&This
->node
, EVENTID_ABORT
, p
);
4214 static HRESULT WINAPI
HTMLElement6_put_oncanplay(IHTMLElement6
*iface
, VARIANT v
)
4216 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4217 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4221 static HRESULT WINAPI
HTMLElement6_get_oncanplay(IHTMLElement6
*iface
, VARIANT
*p
)
4223 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4224 FIXME("(%p)->(%p)\n", This
, p
);
4228 static HRESULT WINAPI
HTMLElement6_put_oncanplaythrough(IHTMLElement6
*iface
, VARIANT v
)
4230 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4231 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4235 static HRESULT WINAPI
HTMLElement6_get_oncanplaythrough(IHTMLElement6
*iface
, VARIANT
*p
)
4237 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4238 FIXME("(%p)->(%p)\n", This
, p
);
4242 static HRESULT WINAPI
HTMLElement6_put_onchange(IHTMLElement6
*iface
, VARIANT v
)
4244 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4246 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4248 return set_node_event(&This
->node
, EVENTID_CHANGE
, &v
);
4251 static HRESULT WINAPI
HTMLElement6_get_onchange(IHTMLElement6
*iface
, VARIANT
*p
)
4253 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4255 TRACE("(%p)->(%p)\n", This
, p
);
4257 return get_node_event(&This
->node
, EVENTID_CHANGE
, p
);
4260 static HRESULT WINAPI
HTMLElement6_put_ondurationchange(IHTMLElement6
*iface
, VARIANT v
)
4262 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4263 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4267 static HRESULT WINAPI
HTMLElement6_get_ondurationchange(IHTMLElement6
*iface
, VARIANT
*p
)
4269 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4270 FIXME("(%p)->(%p)\n", This
, p
);
4274 static HRESULT WINAPI
HTMLElement6_put_onemptied(IHTMLElement6
*iface
, VARIANT v
)
4276 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4277 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4281 static HRESULT WINAPI
HTMLElement6_get_onemptied(IHTMLElement6
*iface
, VARIANT
*p
)
4283 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4284 FIXME("(%p)->(%p)\n", This
, p
);
4288 static HRESULT WINAPI
HTMLElement6_put_onended(IHTMLElement6
*iface
, VARIANT v
)
4290 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4291 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4295 static HRESULT WINAPI
HTMLElement6_get_onended(IHTMLElement6
*iface
, VARIANT
*p
)
4297 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4298 FIXME("(%p)->(%p)\n", This
, p
);
4302 static HRESULT WINAPI
HTMLElement6_put_onerror(IHTMLElement6
*iface
, VARIANT v
)
4304 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4306 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4308 return set_node_event(&This
->node
, EVENTID_ERROR
, &v
);
4311 static HRESULT WINAPI
HTMLElement6_get_onerror(IHTMLElement6
*iface
, VARIANT
*p
)
4313 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4315 TRACE("(%p)->(%p)\n", This
, p
);
4317 return get_node_event(&This
->node
, EVENTID_ERROR
, p
);
4320 static HRESULT WINAPI
HTMLElement6_put_oninput(IHTMLElement6
*iface
, VARIANT v
)
4322 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4323 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4327 static HRESULT WINAPI
HTMLElement6_get_oninput(IHTMLElement6
*iface
, VARIANT
*p
)
4329 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4330 FIXME("(%p)->(%p)\n", This
, p
);
4334 static HRESULT WINAPI
HTMLElement6_put_onload(IHTMLElement6
*iface
, VARIANT v
)
4336 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4338 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4340 return set_node_event(&This
->node
, EVENTID_LOAD
, &v
);
4343 static HRESULT WINAPI
HTMLElement6_get_onload(IHTMLElement6
*iface
, VARIANT
*p
)
4345 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4347 TRACE("(%p)->(%p)\n", This
, p
);
4349 return get_node_event(&This
->node
, EVENTID_LOAD
, p
);
4352 static HRESULT WINAPI
HTMLElement6_put_onloadeddata(IHTMLElement6
*iface
, VARIANT v
)
4354 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4355 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4359 static HRESULT WINAPI
HTMLElement6_get_onloadeddata(IHTMLElement6
*iface
, VARIANT
*p
)
4361 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4362 FIXME("(%p)->(%p)\n", This
, p
);
4366 static HRESULT WINAPI
HTMLElement6_put_onloadedmetadata(IHTMLElement6
*iface
, VARIANT v
)
4368 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4369 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4373 static HRESULT WINAPI
HTMLElement6_get_onloadedmetadata(IHTMLElement6
*iface
, VARIANT
*p
)
4375 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4376 FIXME("(%p)->(%p)\n", This
, p
);
4380 static HRESULT WINAPI
HTMLElement6_put_onloadstart(IHTMLElement6
*iface
, VARIANT v
)
4382 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4383 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4387 static HRESULT WINAPI
HTMLElement6_get_onloadstart(IHTMLElement6
*iface
, VARIANT
*p
)
4389 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4390 FIXME("(%p)->(%p)\n", This
, p
);
4394 static HRESULT WINAPI
HTMLElement6_put_onpause(IHTMLElement6
*iface
, VARIANT v
)
4396 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4397 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4401 static HRESULT WINAPI
HTMLElement6_get_onpause(IHTMLElement6
*iface
, VARIANT
*p
)
4403 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4404 FIXME("(%p)->(%p)\n", This
, p
);
4408 static HRESULT WINAPI
HTMLElement6_put_onplay(IHTMLElement6
*iface
, VARIANT v
)
4410 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4411 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4415 static HRESULT WINAPI
HTMLElement6_get_onplay(IHTMLElement6
*iface
, VARIANT
*p
)
4417 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4418 FIXME("(%p)->(%p)\n", This
, p
);
4422 static HRESULT WINAPI
HTMLElement6_put_onplaying(IHTMLElement6
*iface
, VARIANT v
)
4424 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4425 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4429 static HRESULT WINAPI
HTMLElement6_get_onplaying(IHTMLElement6
*iface
, VARIANT
*p
)
4431 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4432 FIXME("(%p)->(%p)\n", This
, p
);
4436 static HRESULT WINAPI
HTMLElement6_put_onprogress(IHTMLElement6
*iface
, VARIANT v
)
4438 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4439 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4443 static HRESULT WINAPI
HTMLElement6_get_onprogress(IHTMLElement6
*iface
, VARIANT
*p
)
4445 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4446 FIXME("(%p)->(%p)\n", This
, p
);
4450 static HRESULT WINAPI
HTMLElement6_put_onratechange(IHTMLElement6
*iface
, VARIANT v
)
4452 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4453 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4457 static HRESULT WINAPI
HTMLElement6_get_onratechange(IHTMLElement6
*iface
, VARIANT
*p
)
4459 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4460 FIXME("(%p)->(%p)\n", This
, p
);
4464 static HRESULT WINAPI
HTMLElement6_put_onreset(IHTMLElement6
*iface
, VARIANT v
)
4466 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4467 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4471 static HRESULT WINAPI
HTMLElement6_get_onreset(IHTMLElement6
*iface
, VARIANT
*p
)
4473 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4474 FIXME("(%p)->(%p)\n", This
, p
);
4478 static HRESULT WINAPI
HTMLElement6_put_onseeked(IHTMLElement6
*iface
, VARIANT v
)
4480 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4481 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4485 static HRESULT WINAPI
HTMLElement6_get_onseeked(IHTMLElement6
*iface
, VARIANT
*p
)
4487 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4488 FIXME("(%p)->(%p)\n", This
, p
);
4492 static HRESULT WINAPI
HTMLElement6_put_onseeking(IHTMLElement6
*iface
, VARIANT v
)
4494 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4495 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4499 static HRESULT WINAPI
HTMLElement6_get_onseeking(IHTMLElement6
*iface
, VARIANT
*p
)
4501 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4502 FIXME("(%p)->(%p)\n", This
, p
);
4506 static HRESULT WINAPI
HTMLElement6_put_onselect(IHTMLElement6
*iface
, VARIANT v
)
4508 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4509 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4513 static HRESULT WINAPI
HTMLElement6_get_onselect(IHTMLElement6
*iface
, VARIANT
*p
)
4515 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4516 FIXME("(%p)->(%p)\n", This
, p
);
4520 static HRESULT WINAPI
HTMLElement6_put_onstalled(IHTMLElement6
*iface
, VARIANT v
)
4522 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4523 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4527 static HRESULT WINAPI
HTMLElement6_get_onstalled(IHTMLElement6
*iface
, VARIANT
*p
)
4529 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4530 FIXME("(%p)->(%p)\n", This
, p
);
4534 static HRESULT WINAPI
HTMLElement6_put_onsubmit(IHTMLElement6
*iface
, VARIANT v
)
4536 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4538 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4540 return set_node_event(&This
->node
, EVENTID_SUBMIT
, &v
);
4543 static HRESULT WINAPI
HTMLElement6_get_onsubmit(IHTMLElement6
*iface
, VARIANT
*p
)
4545 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4547 TRACE("(%p)->(%p)\n", This
, p
);
4549 return get_node_event(&This
->node
, EVENTID_SUBMIT
, p
);
4552 static HRESULT WINAPI
HTMLElement6_put_onsuspend(IHTMLElement6
*iface
, VARIANT v
)
4554 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4555 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4559 static HRESULT WINAPI
HTMLElement6_get_onsuspend(IHTMLElement6
*iface
, VARIANT
*p
)
4561 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4562 FIXME("(%p)->(%p)\n", This
, p
);
4566 static HRESULT WINAPI
HTMLElement6_put_ontimeupdate(IHTMLElement6
*iface
, VARIANT v
)
4568 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4569 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4573 static HRESULT WINAPI
HTMLElement6_get_ontimeupdate(IHTMLElement6
*iface
, VARIANT
*p
)
4575 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4576 FIXME("(%p)->(%p)\n", This
, p
);
4580 static HRESULT WINAPI
HTMLElement6_put_onvolumechange(IHTMLElement6
*iface
, VARIANT v
)
4582 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4583 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4587 static HRESULT WINAPI
HTMLElement6_get_onvolumechange(IHTMLElement6
*iface
, VARIANT
*p
)
4589 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4590 FIXME("(%p)->(%p)\n", This
, p
);
4594 static HRESULT WINAPI
HTMLElement6_put_onwaiting(IHTMLElement6
*iface
, VARIANT v
)
4596 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4597 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4601 static HRESULT WINAPI
HTMLElement6_get_onwaiting(IHTMLElement6
*iface
, VARIANT
*p
)
4603 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4604 FIXME("(%p)->(%p)\n", This
, p
);
4608 static HRESULT WINAPI
HTMLElement6_hasAttributes(IHTMLElement6
*iface
, VARIANT_BOOL
*pfHasAttributes
)
4610 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4611 FIXME("(%p)->(%p)\n", This
, pfHasAttributes
);
4615 static const IHTMLElement6Vtbl HTMLElement6Vtbl
= {
4616 HTMLElement6_QueryInterface
,
4617 HTMLElement6_AddRef
,
4618 HTMLElement6_Release
,
4619 HTMLElement6_GetTypeInfoCount
,
4620 HTMLElement6_GetTypeInfo
,
4621 HTMLElement6_GetIDsOfNames
,
4622 HTMLElement6_Invoke
,
4623 HTMLElement6_getAttributeNS
,
4624 HTMLElement6_setAttributeNS
,
4625 HTMLElement6_removeAttributeNS
,
4626 HTMLElement6_getAttributeNodeNS
,
4627 HTMLElement6_setAttributeNodeNS
,
4628 HTMLElement6_hasAttributeNS
,
4629 HTMLElement6_getAttribute
,
4630 HTMLElement6_setAttribute
,
4631 HTMLElement6_removeAttribute
,
4632 HTMLElement6_getAttributeNode
,
4633 HTMLElement6_setAttributeNode
,
4634 HTMLElement6_removeAttributeNode
,
4635 HTMLElement6_hasAttribute
,
4636 HTMLElement6_getElementsByTagNameNS
,
4637 HTMLElement6_get_tagName
,
4638 HTMLElement6_get_nodeName
,
4639 HTMLElement6_getElementsByClassName
,
4640 HTMLElement6_msMatchesSelector
,
4641 HTMLElement6_put_onabort
,
4642 HTMLElement6_get_onabort
,
4643 HTMLElement6_put_oncanplay
,
4644 HTMLElement6_get_oncanplay
,
4645 HTMLElement6_put_oncanplaythrough
,
4646 HTMLElement6_get_oncanplaythrough
,
4647 HTMLElement6_put_onchange
,
4648 HTMLElement6_get_onchange
,
4649 HTMLElement6_put_ondurationchange
,
4650 HTMLElement6_get_ondurationchange
,
4651 HTMLElement6_put_onemptied
,
4652 HTMLElement6_get_onemptied
,
4653 HTMLElement6_put_onended
,
4654 HTMLElement6_get_onended
,
4655 HTMLElement6_put_onerror
,
4656 HTMLElement6_get_onerror
,
4657 HTMLElement6_put_oninput
,
4658 HTMLElement6_get_oninput
,
4659 HTMLElement6_put_onload
,
4660 HTMLElement6_get_onload
,
4661 HTMLElement6_put_onloadeddata
,
4662 HTMLElement6_get_onloadeddata
,
4663 HTMLElement6_put_onloadedmetadata
,
4664 HTMLElement6_get_onloadedmetadata
,
4665 HTMLElement6_put_onloadstart
,
4666 HTMLElement6_get_onloadstart
,
4667 HTMLElement6_put_onpause
,
4668 HTMLElement6_get_onpause
,
4669 HTMLElement6_put_onplay
,
4670 HTMLElement6_get_onplay
,
4671 HTMLElement6_put_onplaying
,
4672 HTMLElement6_get_onplaying
,
4673 HTMLElement6_put_onprogress
,
4674 HTMLElement6_get_onprogress
,
4675 HTMLElement6_put_onratechange
,
4676 HTMLElement6_get_onratechange
,
4677 HTMLElement6_put_onreset
,
4678 HTMLElement6_get_onreset
,
4679 HTMLElement6_put_onseeked
,
4680 HTMLElement6_get_onseeked
,
4681 HTMLElement6_put_onseeking
,
4682 HTMLElement6_get_onseeking
,
4683 HTMLElement6_put_onselect
,
4684 HTMLElement6_get_onselect
,
4685 HTMLElement6_put_onstalled
,
4686 HTMLElement6_get_onstalled
,
4687 HTMLElement6_put_onsubmit
,
4688 HTMLElement6_get_onsubmit
,
4689 HTMLElement6_put_onsuspend
,
4690 HTMLElement6_get_onsuspend
,
4691 HTMLElement6_put_ontimeupdate
,
4692 HTMLElement6_get_ontimeupdate
,
4693 HTMLElement6_put_onvolumechange
,
4694 HTMLElement6_get_onvolumechange
,
4695 HTMLElement6_put_onwaiting
,
4696 HTMLElement6_get_onwaiting
,
4697 HTMLElement6_hasAttributes
4700 static inline HTMLElement
*impl_from_IHTMLUniqueName(IHTMLUniqueName
*iface
)
4702 return CONTAINING_RECORD(iface
, HTMLElement
, IHTMLUniqueName_iface
);
4705 static HRESULT WINAPI
HTMLUniqueName_QueryInterface(IHTMLUniqueName
*iface
, REFIID riid
, void **ppv
)
4707 HTMLElement
*This
= impl_from_IHTMLUniqueName(iface
);
4708 return IHTMLElement_QueryInterface(&This
->IHTMLElement_iface
, riid
, ppv
);
4711 static ULONG WINAPI
HTMLUniqueName_AddRef(IHTMLUniqueName
*iface
)
4713 HTMLElement
*This
= impl_from_IHTMLUniqueName(iface
);
4714 return IHTMLElement_AddRef(&This
->IHTMLElement_iface
);
4717 static ULONG WINAPI
HTMLUniqueName_Release(IHTMLUniqueName
*iface
)
4719 HTMLElement
*This
= impl_from_IHTMLUniqueName(iface
);
4720 return IHTMLElement_Release(&This
->IHTMLElement_iface
);
4723 static HRESULT WINAPI
HTMLUniqueName_GetTypeInfoCount(IHTMLUniqueName
*iface
, UINT
*pctinfo
)
4725 HTMLElement
*This
= impl_from_IHTMLUniqueName(iface
);
4726 return IDispatchEx_GetTypeInfoCount(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
4729 static HRESULT WINAPI
HTMLUniqueName_GetTypeInfo(IHTMLUniqueName
*iface
, UINT iTInfo
,
4730 LCID lcid
, ITypeInfo
**ppTInfo
)
4732 HTMLElement
*This
= impl_from_IHTMLUniqueName(iface
);
4733 return IDispatchEx_GetTypeInfo(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
4736 static HRESULT WINAPI
HTMLUniqueName_GetIDsOfNames(IHTMLUniqueName
*iface
, REFIID riid
,
4737 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
4739 HTMLElement
*This
= impl_from_IHTMLUniqueName(iface
);
4740 return IDispatchEx_GetIDsOfNames(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
4744 static HRESULT WINAPI
HTMLUniqueName_Invoke(IHTMLUniqueName
*iface
, DISPID dispIdMember
, REFIID riid
,
4745 LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
4747 HTMLElement
*This
= impl_from_IHTMLUniqueName(iface
);
4748 return IDispatchEx_Invoke(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
4749 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
4752 HRESULT
elem_unique_id(unsigned id
, BSTR
*p
)
4756 static const WCHAR formatW
[] = {'m','s','_','_','i','d','%','u',0};
4758 sprintfW(buf
, formatW
, id
);
4759 *p
= SysAllocString(buf
);
4760 return *p
? S_OK
: E_OUTOFMEMORY
;
4763 static void ensure_unique_id(HTMLElement
*elem
)
4765 if(!elem
->unique_id
)
4766 elem
->unique_id
= ++elem
->node
.doc
->unique_id
;
4769 static HRESULT WINAPI
HTMLUniqueName_get_uniqueNumber(IHTMLUniqueName
*iface
, LONG
*p
)
4771 HTMLElement
*This
= impl_from_IHTMLUniqueName(iface
);
4773 TRACE("(%p)->(%p)\n", This
, p
);
4775 ensure_unique_id(This
);
4776 *p
= This
->unique_id
;
4780 static HRESULT WINAPI
HTMLUniqueName_get_uniqueID(IHTMLUniqueName
*iface
, BSTR
*p
)
4782 HTMLElement
*This
= impl_from_IHTMLUniqueName(iface
);
4784 TRACE("(%p)->(%p)\n", This
, p
);
4786 ensure_unique_id(This
);
4787 return elem_unique_id(This
->unique_id
, p
);
4790 static const IHTMLUniqueNameVtbl HTMLUniqueNameVtbl
= {
4791 HTMLUniqueName_QueryInterface
,
4792 HTMLUniqueName_AddRef
,
4793 HTMLUniqueName_Release
,
4794 HTMLUniqueName_GetTypeInfoCount
,
4795 HTMLUniqueName_GetTypeInfo
,
4796 HTMLUniqueName_GetIDsOfNames
,
4797 HTMLUniqueName_Invoke
,
4798 HTMLUniqueName_get_uniqueNumber
,
4799 HTMLUniqueName_get_uniqueID
4802 static inline HTMLElement
*impl_from_IElementSelector(IElementSelector
*iface
)
4804 return CONTAINING_RECORD(iface
, HTMLElement
, IElementSelector_iface
);
4807 static HRESULT WINAPI
ElementSelector_QueryInterface(IElementSelector
*iface
, REFIID riid
, void **ppv
)
4809 HTMLElement
*This
= impl_from_IElementSelector(iface
);
4810 return IHTMLElement_QueryInterface(&This
->IHTMLElement_iface
, riid
, ppv
);
4813 static ULONG WINAPI
ElementSelector_AddRef(IElementSelector
*iface
)
4815 HTMLElement
*This
= impl_from_IElementSelector(iface
);
4816 return IHTMLElement_AddRef(&This
->IHTMLElement_iface
);
4819 static ULONG WINAPI
ElementSelector_Release(IElementSelector
*iface
)
4821 HTMLElement
*This
= impl_from_IElementSelector(iface
);
4822 return IHTMLElement_Release(&This
->IHTMLElement_iface
);
4825 static HRESULT WINAPI
ElementSelector_GetTypeInfoCount(IElementSelector
*iface
, UINT
*pctinfo
)
4827 HTMLElement
*This
= impl_from_IElementSelector(iface
);
4828 return IDispatchEx_GetTypeInfoCount(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
4831 static HRESULT WINAPI
ElementSelector_GetTypeInfo(IElementSelector
*iface
, UINT iTInfo
,
4832 LCID lcid
, ITypeInfo
**ppTInfo
)
4834 HTMLElement
*This
= impl_from_IElementSelector(iface
);
4835 return IDispatchEx_GetTypeInfo(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
4838 static HRESULT WINAPI
ElementSelector_GetIDsOfNames(IElementSelector
*iface
, REFIID riid
,
4839 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
4841 HTMLElement
*This
= impl_from_IElementSelector(iface
);
4842 return IDispatchEx_GetIDsOfNames(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
, lcid
, rgDispId
);
4845 static HRESULT WINAPI
ElementSelector_Invoke(IElementSelector
*iface
, DISPID dispIdMember
, REFIID riid
,
4846 LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
4848 HTMLElement
*This
= impl_from_IElementSelector(iface
);
4849 return IDispatchEx_Invoke(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
, wFlags
,
4850 pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
4853 static HRESULT WINAPI
ElementSelector_querySelector(IElementSelector
*iface
, BSTR v
, IHTMLElement
**pel
)
4855 HTMLElement
*This
= impl_from_IElementSelector(iface
);
4856 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(v
), pel
);
4860 static HRESULT WINAPI
ElementSelector_querySelectorAll(IElementSelector
*iface
, BSTR v
, IHTMLDOMChildrenCollection
**pel
)
4862 HTMLElement
*This
= impl_from_IElementSelector(iface
);
4863 nsIDOMNodeList
*node_list
;
4867 TRACE("(%p)->(%s %p)\n", This
, debugstr_w(v
), pel
);
4869 nsAString_InitDepend(&nsstr
, v
);
4870 nsres
= nsIDOMHTMLElement_QuerySelectorAll(This
->nselem
, &nsstr
, &node_list
);
4871 nsAString_Finish(&nsstr
);
4872 if(NS_FAILED(nsres
)) {
4873 ERR("QuerySelectorAll failed: %08x\n", nsres
);
4877 *pel
= create_child_collection(This
->node
.doc
, node_list
);
4878 nsIDOMNodeList_Release(node_list
);
4879 return *pel
? S_OK
: E_OUTOFMEMORY
;
4882 static const IElementSelectorVtbl ElementSelectorVtbl
= {
4883 ElementSelector_QueryInterface
,
4884 ElementSelector_AddRef
,
4885 ElementSelector_Release
,
4886 ElementSelector_GetTypeInfoCount
,
4887 ElementSelector_GetTypeInfo
,
4888 ElementSelector_GetIDsOfNames
,
4889 ElementSelector_Invoke
,
4890 ElementSelector_querySelector
,
4891 ElementSelector_querySelectorAll
4894 static inline HTMLElement
*impl_from_IProvideMultipleClassInfo(IProvideMultipleClassInfo
*iface
)
4896 return CONTAINING_RECORD(iface
, HTMLElement
, IProvideMultipleClassInfo_iface
);
4899 static HRESULT WINAPI
ProvideClassInfo_QueryInterface(IProvideMultipleClassInfo
*iface
,
4900 REFIID riid
, void **ppv
)
4902 HTMLElement
*This
= impl_from_IProvideMultipleClassInfo(iface
);
4903 return IHTMLElement_QueryInterface(&This
->IHTMLElement_iface
, riid
, ppv
);
4906 static ULONG WINAPI
ProvideClassInfo_AddRef(IProvideMultipleClassInfo
*iface
)
4908 HTMLElement
*This
= impl_from_IProvideMultipleClassInfo(iface
);
4909 return IHTMLElement_AddRef(&This
->IHTMLElement_iface
);
4912 static ULONG WINAPI
ProvideClassInfo_Release(IProvideMultipleClassInfo
*iface
)
4914 HTMLElement
*This
= impl_from_IProvideMultipleClassInfo(iface
);
4915 return IHTMLElement_Release(&This
->IHTMLElement_iface
);
4918 static HRESULT WINAPI
ProvideClassInfo_GetClassInfo(IProvideMultipleClassInfo
*iface
, ITypeInfo
**ppTI
)
4920 HTMLElement
*This
= impl_from_IProvideMultipleClassInfo(iface
);
4921 TRACE("(%p)->(%p)\n", This
, ppTI
);
4922 return get_class_typeinfo(This
->node
.vtbl
->clsid
, ppTI
);
4925 static HRESULT WINAPI
ProvideClassInfo2_GetGUID(IProvideMultipleClassInfo
*iface
, DWORD dwGuidKind
, GUID
*pGUID
)
4927 HTMLElement
*This
= impl_from_IProvideMultipleClassInfo(iface
);
4928 FIXME("(%p)->(%u %p)\n", This
, dwGuidKind
, pGUID
);
4932 static HRESULT WINAPI
ProvideMultipleClassInfo_GetMultiTypeInfoCount(IProvideMultipleClassInfo
*iface
, ULONG
*pcti
)
4934 HTMLElement
*This
= impl_from_IProvideMultipleClassInfo(iface
);
4935 FIXME("(%p)->(%p)\n", This
, pcti
);
4940 static HRESULT WINAPI
ProvideMultipleClassInfo_GetInfoOfIndex(IProvideMultipleClassInfo
*iface
, ULONG iti
,
4941 DWORD dwFlags
, ITypeInfo
**pptiCoClass
, DWORD
*pdwTIFlags
, ULONG
*pcdispidReserved
, IID
*piidPrimary
, IID
*piidSource
)
4943 HTMLElement
*This
= impl_from_IProvideMultipleClassInfo(iface
);
4944 FIXME("(%p)->(%u %x %p %p %p %p %p)\n", This
, iti
, dwFlags
, pptiCoClass
, pdwTIFlags
, pcdispidReserved
, piidPrimary
, piidSource
);
4948 static const IProvideMultipleClassInfoVtbl ProvideMultipleClassInfoVtbl
= {
4949 ProvideClassInfo_QueryInterface
,
4950 ProvideClassInfo_AddRef
,
4951 ProvideClassInfo_Release
,
4952 ProvideClassInfo_GetClassInfo
,
4953 ProvideClassInfo2_GetGUID
,
4954 ProvideMultipleClassInfo_GetMultiTypeInfoCount
,
4955 ProvideMultipleClassInfo_GetInfoOfIndex
4958 static inline HTMLElement
*impl_from_IElementTraversal(IElementTraversal
*iface
)
4960 return CONTAINING_RECORD(iface
, HTMLElement
, IElementTraversal_iface
);
4963 static HRESULT WINAPI
ElementTraversal_QueryInterface(IElementTraversal
*iface
, REFIID riid
, void **ppv
)
4965 HTMLElement
*This
= impl_from_IElementTraversal(iface
);
4966 return IHTMLElement_QueryInterface(&This
->IHTMLElement_iface
, riid
, ppv
);
4969 static ULONG WINAPI
ElementTraversal_AddRef(IElementTraversal
*iface
)
4971 HTMLElement
*This
= impl_from_IElementTraversal(iface
);
4973 return IHTMLElement_AddRef(&This
->IHTMLElement_iface
);
4976 static ULONG WINAPI
ElementTraversal_Release(IElementTraversal
*iface
)
4978 HTMLElement
*This
= impl_from_IElementTraversal(iface
);
4980 return IHTMLElement_Release(&This
->IHTMLElement_iface
);
4983 static HRESULT WINAPI
ElementTraversal_GetTypeInfoCount(IElementTraversal
*iface
, UINT
*pctinfo
)
4985 HTMLElement
*This
= impl_from_IElementTraversal(iface
);
4986 return IDispatchEx_GetTypeInfoCount(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
4989 static HRESULT WINAPI
ElementTraversal_GetTypeInfo(IElementTraversal
*iface
, UINT iTInfo
,
4990 LCID lcid
, ITypeInfo
**ppTInfo
)
4992 HTMLElement
*This
= impl_from_IElementTraversal(iface
);
4993 return IDispatchEx_GetTypeInfo(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
4996 static HRESULT WINAPI
ElementTraversal_GetIDsOfNames(IElementTraversal
*iface
, REFIID riid
,
4997 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
4999 HTMLElement
*This
= impl_from_IElementTraversal(iface
);
5000 return IDispatchEx_GetIDsOfNames(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
5004 static HRESULT WINAPI
ElementTraversal_Invoke(IElementTraversal
*iface
, DISPID dispIdMember
, REFIID riid
,
5005 LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
5007 HTMLElement
*This
= impl_from_IElementTraversal(iface
);
5008 return IDispatchEx_Invoke(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
5009 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
5012 static HRESULT WINAPI
ElementTraversal_get_firstElementChild(IElementTraversal
*iface
, IHTMLElement
**p
)
5014 HTMLElement
*This
= impl_from_IElementTraversal(iface
);
5015 nsIDOMElement
*nselem
= NULL
;
5019 TRACE("(%p)->(%p)\n", This
, p
);
5021 nsIDOMHTMLElement_GetFirstElementChild(This
->nselem
, &nselem
);
5027 hres
= get_elem(This
->node
.doc
, nselem
, &elem
);
5028 nsIDOMElement_Release(nselem
);
5032 *p
= &elem
->IHTMLElement_iface
;
5036 static HRESULT WINAPI
ElementTraversal_get_lastElementChild(IElementTraversal
*iface
, IHTMLElement
**p
)
5038 HTMLElement
*This
= impl_from_IElementTraversal(iface
);
5039 FIXME("(%p)->(%p)\n", This
, p
);
5043 static HRESULT WINAPI
ElementTraversal_get_previousElementSibling(IElementTraversal
*iface
, IHTMLElement
**p
)
5045 HTMLElement
*This
= impl_from_IElementTraversal(iface
);
5046 FIXME("(%p)->(%p)\n", This
, p
);
5050 static HRESULT WINAPI
ElementTraversal_get_nextElementSibling(IElementTraversal
*iface
, IHTMLElement
**p
)
5052 HTMLElement
*This
= impl_from_IElementTraversal(iface
);
5053 FIXME("(%p)->(%p)\n", This
, p
);
5057 static HRESULT WINAPI
ElementTraversal_get_childElementCount(IElementTraversal
*iface
, LONG
*p
)
5059 HTMLElement
*This
= impl_from_IElementTraversal(iface
);
5060 FIXME("(%p)->(%p)\n", This
, p
);
5064 static const IElementTraversalVtbl ElementTraversalVtbl
= {
5065 ElementTraversal_QueryInterface
,
5066 ElementTraversal_AddRef
,
5067 ElementTraversal_Release
,
5068 ElementTraversal_GetTypeInfoCount
,
5069 ElementTraversal_GetTypeInfo
,
5070 ElementTraversal_GetIDsOfNames
,
5071 ElementTraversal_Invoke
,
5072 ElementTraversal_get_firstElementChild
,
5073 ElementTraversal_get_lastElementChild
,
5074 ElementTraversal_get_previousElementSibling
,
5075 ElementTraversal_get_nextElementSibling
,
5076 ElementTraversal_get_childElementCount
5079 static inline HTMLElement
*impl_from_HTMLDOMNode(HTMLDOMNode
*iface
)
5081 return CONTAINING_RECORD(iface
, HTMLElement
, node
);
5084 HRESULT
HTMLElement_QI(HTMLDOMNode
*iface
, REFIID riid
, void **ppv
)
5086 HTMLElement
*This
= impl_from_HTMLDOMNode(iface
);
5088 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
5089 *ppv
= &This
->IHTMLElement_iface
;
5090 }else if(IsEqualGUID(&IID_IDispatch
, riid
)) {
5091 *ppv
= &This
->IHTMLElement_iface
;
5092 }else if(IsEqualGUID(&IID_IHTMLElement
, riid
)) {
5093 *ppv
= &This
->IHTMLElement_iface
;
5094 }else if(IsEqualGUID(&IID_IHTMLElement2
, riid
)) {
5095 *ppv
= &This
->IHTMLElement2_iface
;
5096 }else if(IsEqualGUID(&IID_IHTMLElement3
, riid
)) {
5097 *ppv
= &This
->IHTMLElement3_iface
;
5098 }else if(IsEqualGUID(&IID_IHTMLElement4
, riid
)) {
5099 *ppv
= &This
->IHTMLElement4_iface
;
5100 }else if(IsEqualGUID(&IID_IHTMLElement6
, riid
)) {
5101 *ppv
= &This
->IHTMLElement6_iface
;
5102 }else if(IsEqualGUID(&IID_IHTMLUniqueName
, riid
)) {
5103 *ppv
= &This
->IHTMLUniqueName_iface
;
5104 }else if(IsEqualGUID(&IID_IElementSelector
, riid
)) {
5105 *ppv
= &This
->IElementSelector_iface
;
5106 }else if(IsEqualGUID(&IID_IElementTraversal
, riid
)) {
5107 *ppv
= &This
->IElementTraversal_iface
;
5108 }else if(IsEqualGUID(&IID_IConnectionPointContainer
, riid
)) {
5109 *ppv
= &This
->cp_container
.IConnectionPointContainer_iface
;
5110 }else if(IsEqualGUID(&IID_IProvideClassInfo
, riid
)) {
5111 *ppv
= &This
->IProvideMultipleClassInfo_iface
;
5112 }else if(IsEqualGUID(&IID_IProvideClassInfo2
, riid
)) {
5113 *ppv
= &This
->IProvideMultipleClassInfo_iface
;
5114 }else if(IsEqualGUID(&IID_IProvideMultipleClassInfo
, riid
)) {
5115 *ppv
= &This
->IProvideMultipleClassInfo_iface
;
5117 return HTMLDOMNode_QI(&This
->node
, riid
, ppv
);
5120 IUnknown_AddRef((IUnknown
*)*ppv
);
5124 void HTMLElement_destructor(HTMLDOMNode
*iface
)
5126 HTMLElement
*This
= impl_from_HTMLDOMNode(iface
);
5128 ConnectionPointContainer_Destroy(&This
->cp_container
);
5131 This
->style
->elem
= NULL
;
5132 IHTMLStyle_Release(&This
->style
->IHTMLStyle_iface
);
5134 if(This
->runtime_style
) {
5135 This
->runtime_style
->elem
= NULL
;
5136 IHTMLStyle_Release(&This
->runtime_style
->IHTMLStyle_iface
);
5139 HTMLDOMAttribute
*attr
;
5141 LIST_FOR_EACH_ENTRY(attr
, &This
->attrs
->attrs
, HTMLDOMAttribute
, entry
)
5144 This
->attrs
->elem
= NULL
;
5145 IHTMLAttributeCollection_Release(&This
->attrs
->IHTMLAttributeCollection_iface
);
5148 heap_free(This
->filter
);
5150 HTMLDOMNode_destructor(&This
->node
);
5153 HRESULT
HTMLElement_clone(HTMLDOMNode
*iface
, nsIDOMNode
*nsnode
, HTMLDOMNode
**ret
)
5155 HTMLElement
*This
= impl_from_HTMLDOMNode(iface
);
5156 HTMLElement
*new_elem
;
5159 hres
= HTMLElement_Create(This
->node
.doc
, nsnode
, FALSE
, &new_elem
);
5164 new_elem
->filter
= heap_strdupW(This
->filter
);
5165 if(!new_elem
->filter
) {
5166 IHTMLElement_Release(&This
->IHTMLElement_iface
);
5167 return E_OUTOFMEMORY
;
5171 *ret
= &new_elem
->node
;
5175 HRESULT
HTMLElement_handle_event(HTMLDOMNode
*iface
, DWORD eid
, nsIDOMEvent
*event
, BOOL
*prevent_default
)
5177 HTMLElement
*This
= impl_from_HTMLDOMNode(iface
);
5180 case EVENTID_KEYDOWN
: {
5181 nsIDOMKeyEvent
*key_event
;
5184 nsres
= nsIDOMEvent_QueryInterface(event
, &IID_nsIDOMKeyEvent
, (void**)&key_event
);
5185 if(NS_SUCCEEDED(nsres
)) {
5188 nsIDOMKeyEvent_GetKeyCode(key_event
, &code
);
5190 if(code
== VK_F1
/* DOM_VK_F1 */) {
5191 DOMEvent
*help_event
;
5194 TRACE("F1 pressed\n");
5196 hres
= create_document_event(This
->node
.doc
, EVENTID_HELP
, &help_event
);
5197 if(SUCCEEDED(hres
)) {
5198 dispatch_event(&This
->node
.event_target
, help_event
);
5199 IDOMEvent_Release(&help_event
->IDOMEvent_iface
);
5201 *prevent_default
= TRUE
;
5204 nsIDOMKeyEvent_Release(key_event
);
5212 cp_static_data_t HTMLElementEvents2_data
= { HTMLElementEvents2_tid
, NULL
/* FIXME */, TRUE
};
5214 const cpc_entry_t HTMLElement_cpc
[] = {
5219 static const NodeImplVtbl HTMLElementImplVtbl
= {
5220 &CLSID_HTMLUnknownElement
,
5222 HTMLElement_destructor
,
5225 HTMLElement_handle_event
,
5226 HTMLElement_get_attr_col
5229 static inline HTMLElement
*impl_from_DispatchEx(DispatchEx
*iface
)
5231 return CONTAINING_RECORD(iface
, HTMLElement
, node
.event_target
.dispex
);
5234 static HRESULT
HTMLElement_get_dispid(DispatchEx
*dispex
, BSTR name
,
5235 DWORD grfdex
, DISPID
*pid
)
5237 HTMLElement
*This
= impl_from_DispatchEx(dispex
);
5239 if(This
->node
.vtbl
->get_dispid
)
5240 return This
->node
.vtbl
->get_dispid(&This
->node
, name
, grfdex
, pid
);
5242 return DISP_E_UNKNOWNNAME
;
5245 static HRESULT
HTMLElement_invoke(DispatchEx
*dispex
, DISPID id
, LCID lcid
,
5246 WORD flags
, DISPPARAMS
*params
, VARIANT
*res
, EXCEPINFO
*ei
,
5247 IServiceProvider
*caller
)
5249 HTMLElement
*This
= impl_from_DispatchEx(dispex
);
5251 if(This
->node
.vtbl
->invoke
)
5252 return This
->node
.vtbl
->invoke(&This
->node
, id
, lcid
, flags
,
5253 params
, res
, ei
, caller
);
5255 ERR("(%p): element has no invoke method\n", This
);
5259 static HRESULT
HTMLElement_populate_props(DispatchEx
*dispex
)
5261 HTMLElement
*This
= impl_from_DispatchEx(dispex
);
5262 nsIDOMMozNamedAttrMap
*attrs
;
5265 const PRUnichar
*str
;
5277 nsres
= nsIDOMHTMLElement_GetAttributes(This
->nselem
, &attrs
);
5278 if(NS_FAILED(nsres
))
5281 nsres
= nsIDOMMozNamedAttrMap_GetLength(attrs
, &len
);
5282 if(NS_FAILED(nsres
)) {
5283 nsIDOMMozNamedAttrMap_Release(attrs
);
5287 nsAString_Init(&nsstr
, NULL
);
5288 for(i
=0; i
<len
; i
++) {
5289 nsres
= nsIDOMMozNamedAttrMap_Item(attrs
, i
, &attr
);
5290 if(NS_FAILED(nsres
))
5293 nsres
= nsIDOMAttr_GetNodeName(attr
, &nsstr
);
5294 if(NS_FAILED(nsres
)) {
5295 nsIDOMAttr_Release(attr
);
5299 nsAString_GetData(&nsstr
, &str
);
5300 name
= SysAllocString(str
);
5302 nsIDOMAttr_Release(attr
);
5306 hres
= IDispatchEx_GetDispID(&dispex
->IDispatchEx_iface
, name
, fdexNameCaseInsensitive
, &id
);
5307 if(hres
!= DISP_E_UNKNOWNNAME
) {
5308 nsIDOMAttr_Release(attr
);
5309 SysFreeString(name
);
5313 nsres
= nsIDOMAttr_GetNodeValue(attr
, &nsstr
);
5314 nsIDOMAttr_Release(attr
);
5315 if(NS_FAILED(nsres
)) {
5316 SysFreeString(name
);
5320 nsAString_GetData(&nsstr
, &str
);
5321 V_VT(&value
) = VT_BSTR
;
5323 V_BSTR(&value
) = SysAllocString(str
);
5324 if(!V_BSTR(&value
)) {
5325 SysFreeString(name
);
5329 V_BSTR(&value
) = NULL
;
5331 IHTMLElement_setAttribute(&This
->IHTMLElement_iface
, name
, value
, 0);
5332 SysFreeString(name
);
5333 VariantClear(&value
);
5335 nsAString_Finish(&nsstr
);
5337 nsIDOMMozNamedAttrMap_Release(attrs
);
5341 static void HTMLElement_bind_event(DispatchEx
*dispex
, eventid_t eid
)
5343 HTMLElement
*This
= impl_from_DispatchEx(dispex
);
5345 static const WCHAR loadW
[] = {'l','o','a','d',0};
5349 add_nsevent_listener(This
->node
.doc
, This
->node
.nsnode
, loadW
);
5352 ensure_doc_nsevent_handler(This
->node
.doc
, eid
);
5356 static HRESULT
HTMLElement_handle_event_default(DispatchEx
*dispex
, eventid_t eid
, nsIDOMEvent
*nsevent
, BOOL
*prevent_default
)
5358 HTMLElement
*This
= impl_from_DispatchEx(dispex
);
5360 if(!This
->node
.vtbl
->handle_event
)
5362 return This
->node
.vtbl
->handle_event(&This
->node
, eid
, nsevent
, prevent_default
);
5365 static EventTarget
*HTMLElement_get_parent_event_target(DispatchEx
*dispex
)
5367 HTMLElement
*This
= impl_from_DispatchEx(dispex
);
5373 nsres
= nsIDOMNode_GetParentNode(This
->node
.nsnode
, &nsnode
);
5374 assert(nsres
== NS_OK
);
5378 hres
= get_node(This
->node
.doc
, nsnode
, TRUE
, &node
);
5379 nsIDOMNode_Release(nsnode
);
5383 return &node
->event_target
;
5386 static ConnectionPointContainer
*HTMLElement_get_cp_container(DispatchEx
*dispex
)
5388 HTMLElement
*This
= impl_from_DispatchEx(dispex
);
5389 IConnectionPointContainer_AddRef(&This
->cp_container
.IConnectionPointContainer_iface
);
5390 return &This
->cp_container
;
5393 static IHTMLEventObj
*HTMLElement_set_current_event(DispatchEx
*dispex
, IHTMLEventObj
*event
)
5395 HTMLElement
*This
= impl_from_DispatchEx(dispex
);
5396 return default_set_current_event(This
->node
.doc
->window
, event
);
5399 void HTMLElement_init_dispex_info(dispex_data_t
*info
, compat_mode_t mode
)
5401 static const DISPID elem2_ie11_blacklist
[] = {DISPID_IHTMLELEMENT2_DOSCROLL
, DISPID_UNKNOWN
};
5403 HTMLDOMNode_init_dispex_info(info
, mode
);
5405 dispex_info_add_interface(info
, IHTMLElement2_tid
, mode
>= COMPAT_MODE_IE11
? elem2_ie11_blacklist
: NULL
);
5407 if(mode
>= COMPAT_MODE_IE8
)
5408 dispex_info_add_interface(info
, IElementSelector_tid
, NULL
);
5410 if(mode
>= COMPAT_MODE_IE9
) {
5411 dispex_info_add_interface(info
, IHTMLElement6_tid
, NULL
);
5412 dispex_info_add_interface(info
, IElementTraversal_tid
, NULL
);
5416 static const tid_t HTMLElement_iface_tids
[] = {
5421 static event_target_vtbl_t HTMLElement_event_target_vtbl
= {
5424 HTMLElement_get_dispid
,
5427 HTMLElement_populate_props
5429 HTMLElement_bind_event
,
5430 HTMLElement_get_parent_event_target
,
5431 HTMLElement_handle_event_default
,
5432 HTMLElement_get_cp_container
,
5433 HTMLElement_set_current_event
5436 static dispex_static_data_t HTMLElement_dispex
= {
5437 &HTMLElement_event_target_vtbl
.dispex_vtbl
,
5438 DispHTMLUnknownElement_tid
,
5439 HTMLElement_iface_tids
,
5440 HTMLElement_init_dispex_info
5443 void HTMLElement_Init(HTMLElement
*This
, HTMLDocumentNode
*doc
, nsIDOMHTMLElement
*nselem
, dispex_static_data_t
*dispex_data
)
5445 This
->IHTMLElement_iface
.lpVtbl
= &HTMLElementVtbl
;
5446 This
->IHTMLElement2_iface
.lpVtbl
= &HTMLElement2Vtbl
;
5447 This
->IHTMLElement3_iface
.lpVtbl
= &HTMLElement3Vtbl
;
5448 This
->IHTMLElement4_iface
.lpVtbl
= &HTMLElement4Vtbl
;
5449 This
->IHTMLElement6_iface
.lpVtbl
= &HTMLElement6Vtbl
;
5450 This
->IHTMLUniqueName_iface
.lpVtbl
= &HTMLUniqueNameVtbl
;
5451 This
->IElementSelector_iface
.lpVtbl
= &ElementSelectorVtbl
;
5452 This
->IElementTraversal_iface
.lpVtbl
= &ElementTraversalVtbl
;
5453 This
->IProvideMultipleClassInfo_iface
.lpVtbl
= &ProvideMultipleClassInfoVtbl
;
5455 if(dispex_data
&& !dispex_data
->vtbl
)
5456 dispex_data
->vtbl
= &HTMLElement_event_target_vtbl
.dispex_vtbl
;
5459 HTMLDOMNode_Init(doc
, &This
->node
, (nsIDOMNode
*)nselem
, dispex_data
? dispex_data
: &HTMLElement_dispex
);
5461 /* No AddRef, share reference with HTMLDOMNode */
5462 assert((nsIDOMNode
*)nselem
== This
->node
.nsnode
);
5463 This
->nselem
= nselem
;
5466 ConnectionPointContainer_Init(&This
->cp_container
, (IUnknown
*)&This
->IHTMLElement_iface
, This
->node
.vtbl
->cpc_entries
);
5469 HRESULT
HTMLElement_Create(HTMLDocumentNode
*doc
, nsIDOMNode
*nsnode
, BOOL use_generic
, HTMLElement
**ret
)
5471 nsIDOMHTMLElement
*nselem
;
5472 nsAString class_name_str
;
5473 const PRUnichar
*class_name
;
5474 const tag_desc_t
*tag
;
5479 nsres
= nsIDOMNode_QueryInterface(nsnode
, &IID_nsIDOMHTMLElement
, (void**)&nselem
);
5480 if(NS_FAILED(nsres
))
5483 nsAString_Init(&class_name_str
, NULL
);
5484 nsIDOMHTMLElement_GetTagName(nselem
, &class_name_str
);
5486 nsAString_GetData(&class_name_str
, &class_name
);
5488 tag
= get_tag_desc(class_name
);
5490 hres
= tag
->constructor(doc
, nselem
, &elem
);
5491 }else if(use_generic
) {
5492 hres
= HTMLGenericElement_Create(doc
, nselem
, &elem
);
5494 elem
= heap_alloc_zero(sizeof(HTMLElement
));
5496 elem
->node
.vtbl
= &HTMLElementImplVtbl
;
5497 HTMLElement_Init(elem
, doc
, nselem
, &HTMLElement_dispex
);
5500 hres
= E_OUTOFMEMORY
;
5504 TRACE("%s ret %p\n", debugstr_w(class_name
), elem
);
5506 nsIDOMHTMLElement_Release(nselem
);
5507 nsAString_Finish(&class_name_str
);
5515 HRESULT
get_elem(HTMLDocumentNode
*doc
, nsIDOMElement
*nselem
, HTMLElement
**ret
)
5520 hres
= get_node(doc
, (nsIDOMNode
*)nselem
, TRUE
, &node
);
5524 *ret
= impl_from_HTMLDOMNode(node
);
5528 /* interface IHTMLFiltersCollection */
5529 static HRESULT WINAPI
HTMLFiltersCollection_QueryInterface(IHTMLFiltersCollection
*iface
, REFIID riid
, void **ppv
)
5531 HTMLFiltersCollection
*This
= impl_from_IHTMLFiltersCollection(iface
);
5533 TRACE("%p %s %p\n", This
, debugstr_mshtml_guid(riid
), ppv
);
5535 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
5536 *ppv
= &This
->IHTMLFiltersCollection_iface
;
5537 }else if(IsEqualGUID(&IID_IHTMLFiltersCollection
, riid
)) {
5538 TRACE("(%p)->(IID_IHTMLFiltersCollection %p)\n", This
, ppv
);
5539 *ppv
= &This
->IHTMLFiltersCollection_iface
;
5540 }else if(dispex_query_interface(&This
->dispex
, riid
, ppv
)) {
5541 return *ppv
? S_OK
: E_NOINTERFACE
;
5544 FIXME("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
5545 return E_NOINTERFACE
;
5548 IUnknown_AddRef((IUnknown
*)*ppv
);
5552 static ULONG WINAPI
HTMLFiltersCollection_AddRef(IHTMLFiltersCollection
*iface
)
5554 HTMLFiltersCollection
*This
= impl_from_IHTMLFiltersCollection(iface
);
5555 LONG ref
= InterlockedIncrement(&This
->ref
);
5557 TRACE("(%p) ref=%d\n", This
, ref
);
5562 static ULONG WINAPI
HTMLFiltersCollection_Release(IHTMLFiltersCollection
*iface
)
5564 HTMLFiltersCollection
*This
= impl_from_IHTMLFiltersCollection(iface
);
5565 LONG ref
= InterlockedDecrement(&This
->ref
);
5567 TRACE("(%p) ref=%d\n", This
, ref
);
5577 static HRESULT WINAPI
HTMLFiltersCollection_GetTypeInfoCount(IHTMLFiltersCollection
*iface
, UINT
*pctinfo
)
5579 HTMLFiltersCollection
*This
= impl_from_IHTMLFiltersCollection(iface
);
5580 return IDispatchEx_GetTypeInfoCount(&This
->dispex
.IDispatchEx_iface
, pctinfo
);
5583 static HRESULT WINAPI
HTMLFiltersCollection_GetTypeInfo(IHTMLFiltersCollection
*iface
,
5584 UINT iTInfo
, LCID lcid
, ITypeInfo
**ppTInfo
)
5586 HTMLFiltersCollection
*This
= impl_from_IHTMLFiltersCollection(iface
);
5587 return IDispatchEx_GetTypeInfo(&This
->dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
5590 static HRESULT WINAPI
HTMLFiltersCollection_GetIDsOfNames(IHTMLFiltersCollection
*iface
,
5591 REFIID riid
, LPOLESTR
*rgszNames
, UINT cNames
,
5592 LCID lcid
, DISPID
*rgDispId
)
5594 HTMLFiltersCollection
*This
= impl_from_IHTMLFiltersCollection(iface
);
5595 return IDispatchEx_GetIDsOfNames(&This
->dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
5599 static HRESULT WINAPI
HTMLFiltersCollection_Invoke(IHTMLFiltersCollection
*iface
, DISPID dispIdMember
, REFIID riid
,
5600 LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
,
5601 EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
5603 HTMLFiltersCollection
*This
= impl_from_IHTMLFiltersCollection(iface
);
5604 return IDispatchEx_Invoke(&This
->dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
5605 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
5608 static HRESULT WINAPI
HTMLFiltersCollection_get_length(IHTMLFiltersCollection
*iface
, LONG
*p
)
5610 HTMLFiltersCollection
*This
= impl_from_IHTMLFiltersCollection(iface
);
5615 FIXME("(%p)->(%p) Always returning 0\n", This
, p
);
5621 static HRESULT WINAPI
HTMLFiltersCollection_get__newEnum(IHTMLFiltersCollection
*iface
, IUnknown
**p
)
5623 HTMLFiltersCollection
*This
= impl_from_IHTMLFiltersCollection(iface
);
5624 FIXME("(%p)->(%p)\n", This
, p
);
5628 static HRESULT WINAPI
HTMLFiltersCollection_item(IHTMLFiltersCollection
*iface
, VARIANT
*pvarIndex
, VARIANT
*pvarResult
)
5630 HTMLFiltersCollection
*This
= impl_from_IHTMLFiltersCollection(iface
);
5631 FIXME("(%p)->(%p, %p)\n", This
, pvarIndex
, pvarResult
);
5635 static const IHTMLFiltersCollectionVtbl HTMLFiltersCollectionVtbl
= {
5636 HTMLFiltersCollection_QueryInterface
,
5637 HTMLFiltersCollection_AddRef
,
5638 HTMLFiltersCollection_Release
,
5639 HTMLFiltersCollection_GetTypeInfoCount
,
5640 HTMLFiltersCollection_GetTypeInfo
,
5641 HTMLFiltersCollection_GetIDsOfNames
,
5642 HTMLFiltersCollection_Invoke
,
5643 HTMLFiltersCollection_get_length
,
5644 HTMLFiltersCollection_get__newEnum
,
5645 HTMLFiltersCollection_item
5648 static HRESULT
HTMLFiltersCollection_get_dispid(DispatchEx
*dispex
, BSTR name
, DWORD flags
, DISPID
*dispid
)
5653 for(ptr
= name
; *ptr
&& isdigitW(*ptr
); ptr
++)
5654 idx
= idx
*10 + (*ptr
-'0');
5656 return DISP_E_UNKNOWNNAME
;
5658 *dispid
= MSHTML_DISPID_CUSTOM_MIN
+ idx
;
5659 TRACE("ret %x\n", *dispid
);
5663 static HRESULT
HTMLFiltersCollection_invoke(DispatchEx
*dispex
, DISPID id
, LCID lcid
, WORD flags
, DISPPARAMS
*params
,
5664 VARIANT
*res
, EXCEPINFO
*ei
, IServiceProvider
*caller
)
5666 TRACE("(%p)->(%x %x %x %p %p %p)\n", dispex
, id
, lcid
, flags
, params
, res
, ei
);
5668 V_VT(res
) = VT_DISPATCH
;
5669 V_DISPATCH(res
) = NULL
;
5671 FIXME("always returning NULL\n");
5676 static const dispex_static_data_vtbl_t HTMLFiltersCollection_dispex_vtbl
= {
5678 HTMLFiltersCollection_get_dispid
,
5679 HTMLFiltersCollection_invoke
,
5683 static const tid_t HTMLFiltersCollection_iface_tids
[] = {
5684 IHTMLFiltersCollection_tid
,
5687 static dispex_static_data_t HTMLFiltersCollection_dispex
= {
5688 &HTMLFiltersCollection_dispex_vtbl
,
5689 IHTMLFiltersCollection_tid
,
5690 HTMLFiltersCollection_iface_tids
5693 static IHTMLFiltersCollection
*HTMLFiltersCollection_Create(void)
5695 HTMLFiltersCollection
*ret
= heap_alloc(sizeof(HTMLFiltersCollection
));
5697 ret
->IHTMLFiltersCollection_iface
.lpVtbl
= &HTMLFiltersCollectionVtbl
;
5700 init_dispex(&ret
->dispex
, (IUnknown
*)&ret
->IHTMLFiltersCollection_iface
,
5701 &HTMLFiltersCollection_dispex
);
5703 return &ret
->IHTMLFiltersCollection_iface
;
5706 /* interface IHTMLAttributeCollection */
5707 static inline HTMLAttributeCollection
*impl_from_IHTMLAttributeCollection(IHTMLAttributeCollection
*iface
)
5709 return CONTAINING_RECORD(iface
, HTMLAttributeCollection
, IHTMLAttributeCollection_iface
);
5712 static HRESULT WINAPI
HTMLAttributeCollection_QueryInterface(IHTMLAttributeCollection
*iface
, REFIID riid
, void **ppv
)
5714 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection(iface
);
5716 TRACE("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
5718 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
5719 *ppv
= &This
->IHTMLAttributeCollection_iface
;
5720 }else if(IsEqualGUID(&IID_IHTMLAttributeCollection
, riid
)) {
5721 *ppv
= &This
->IHTMLAttributeCollection_iface
;
5722 }else if(IsEqualGUID(&IID_IHTMLAttributeCollection2
, riid
)) {
5723 *ppv
= &This
->IHTMLAttributeCollection2_iface
;
5724 }else if(IsEqualGUID(&IID_IHTMLAttributeCollection3
, riid
)) {
5725 *ppv
= &This
->IHTMLAttributeCollection3_iface
;
5726 }else if(dispex_query_interface(&This
->dispex
, riid
, ppv
)) {
5727 return *ppv
? S_OK
: E_NOINTERFACE
;
5730 WARN("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
5731 return E_NOINTERFACE
;
5734 IUnknown_AddRef((IUnknown
*)*ppv
);
5738 static ULONG WINAPI
HTMLAttributeCollection_AddRef(IHTMLAttributeCollection
*iface
)
5740 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection(iface
);
5741 LONG ref
= InterlockedIncrement(&This
->ref
);
5743 TRACE("(%p) ref=%d\n", This
, ref
);
5748 static ULONG WINAPI
HTMLAttributeCollection_Release(IHTMLAttributeCollection
*iface
)
5750 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection(iface
);
5751 LONG ref
= InterlockedDecrement(&This
->ref
);
5753 TRACE("(%p) ref=%d\n", This
, ref
);
5756 while(!list_empty(&This
->attrs
)) {
5757 HTMLDOMAttribute
*attr
= LIST_ENTRY(list_head(&This
->attrs
), HTMLDOMAttribute
, entry
);
5759 list_remove(&attr
->entry
);
5761 IHTMLDOMAttribute_Release(&attr
->IHTMLDOMAttribute_iface
);
5770 static HRESULT WINAPI
HTMLAttributeCollection_GetTypeInfoCount(IHTMLAttributeCollection
*iface
, UINT
*pctinfo
)
5772 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection(iface
);
5773 return IDispatchEx_GetTypeInfoCount(&This
->dispex
.IDispatchEx_iface
, pctinfo
);
5776 static HRESULT WINAPI
HTMLAttributeCollection_GetTypeInfo(IHTMLAttributeCollection
*iface
, UINT iTInfo
,
5777 LCID lcid
, ITypeInfo
**ppTInfo
)
5779 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection(iface
);
5780 return IDispatchEx_GetTypeInfo(&This
->dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
5783 static HRESULT WINAPI
HTMLAttributeCollection_GetIDsOfNames(IHTMLAttributeCollection
*iface
, REFIID riid
,
5784 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
5786 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection(iface
);
5787 return IDispatchEx_GetIDsOfNames(&This
->dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
5791 static HRESULT WINAPI
HTMLAttributeCollection_Invoke(IHTMLAttributeCollection
*iface
, DISPID dispIdMember
,
5792 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
5793 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
5795 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection(iface
);
5796 return IDispatchEx_Invoke(&This
->dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
5797 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
5800 static HRESULT
get_attr_dispid_by_idx(HTMLAttributeCollection
*This
, LONG
*idx
, DISPID
*dispid
)
5802 IDispatchEx
*dispex
= &This
->elem
->node
.event_target
.dispex
.IDispatchEx_iface
;
5803 DISPID id
= DISPID_STARTENUM
;
5807 FIXME("filter non-enumerable attributes out\n");
5810 hres
= IDispatchEx_GetNextDispID(dispex
, fdexEnumAll
, id
, &id
);
5813 else if(hres
== S_FALSE
)
5823 return *idx
==len
? S_OK
: DISP_E_UNKNOWNNAME
;
5830 static inline HRESULT
get_attr_dispid_by_name(HTMLAttributeCollection
*This
, BSTR name
, DISPID
*id
)
5834 if(name
[0]>='0' && name
[0]<='9') {
5838 idx
= strtoulW(name
, &end_ptr
, 10);
5840 hres
= get_attr_dispid_by_idx(This
, &idx
, id
);
5847 WARN("NULL elem\n");
5848 return E_UNEXPECTED
;
5851 hres
= IDispatchEx_GetDispID(&This
->elem
->node
.event_target
.dispex
.IDispatchEx_iface
,
5852 name
, fdexNameCaseInsensitive
, id
);
5856 static inline HRESULT
get_domattr(HTMLAttributeCollection
*This
, DISPID id
, LONG
*list_pos
, HTMLDOMAttribute
**attr
)
5858 HTMLDOMAttribute
*iter
;
5863 LIST_FOR_EACH_ENTRY(iter
, &This
->attrs
, HTMLDOMAttribute
, entry
) {
5864 if(iter
->dispid
== id
) {
5873 WARN("NULL elem\n");
5874 return E_UNEXPECTED
;
5877 hres
= HTMLDOMAttribute_Create(NULL
, This
->elem
, id
, attr
);
5882 IHTMLDOMAttribute_AddRef(&(*attr
)->IHTMLDOMAttribute_iface
);
5888 static HRESULT WINAPI
HTMLAttributeCollection_get_length(IHTMLAttributeCollection
*iface
, LONG
*p
)
5890 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection(iface
);
5893 TRACE("(%p)->(%p)\n", This
, p
);
5896 hres
= get_attr_dispid_by_idx(This
, p
, NULL
);
5900 static HRESULT WINAPI
HTMLAttributeCollection__newEnum(IHTMLAttributeCollection
*iface
, IUnknown
**p
)
5902 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection(iface
);
5903 FIXME("(%p)->(%p)\n", This
, p
);
5907 static HRESULT WINAPI
HTMLAttributeCollection_item(IHTMLAttributeCollection
*iface
, VARIANT
*name
, IDispatch
**ppItem
)
5909 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection(iface
);
5910 HTMLDOMAttribute
*attr
;
5914 TRACE("(%p)->(%s %p)\n", This
, debugstr_variant(name
), ppItem
);
5916 switch(V_VT(name
)) {
5918 hres
= get_attr_dispid_by_idx(This
, &V_I4(name
), &id
);
5921 hres
= get_attr_dispid_by_name(This
, V_BSTR(name
), &id
);
5924 FIXME("unsupported name %s\n", debugstr_variant(name
));
5927 if(hres
== DISP_E_UNKNOWNNAME
)
5928 return E_INVALIDARG
;
5932 hres
= get_domattr(This
, id
, NULL
, &attr
);
5936 *ppItem
= (IDispatch
*)&attr
->IHTMLDOMAttribute_iface
;
5940 static const IHTMLAttributeCollectionVtbl HTMLAttributeCollectionVtbl
= {
5941 HTMLAttributeCollection_QueryInterface
,
5942 HTMLAttributeCollection_AddRef
,
5943 HTMLAttributeCollection_Release
,
5944 HTMLAttributeCollection_GetTypeInfoCount
,
5945 HTMLAttributeCollection_GetTypeInfo
,
5946 HTMLAttributeCollection_GetIDsOfNames
,
5947 HTMLAttributeCollection_Invoke
,
5948 HTMLAttributeCollection_get_length
,
5949 HTMLAttributeCollection__newEnum
,
5950 HTMLAttributeCollection_item
5953 static inline HTMLAttributeCollection
*impl_from_IHTMLAttributeCollection2(IHTMLAttributeCollection2
*iface
)
5955 return CONTAINING_RECORD(iface
, HTMLAttributeCollection
, IHTMLAttributeCollection2_iface
);
5958 static HRESULT WINAPI
HTMLAttributeCollection2_QueryInterface(IHTMLAttributeCollection2
*iface
, REFIID riid
, void **ppv
)
5960 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection2(iface
);
5961 return IHTMLAttributeCollection_QueryInterface(&This
->IHTMLAttributeCollection_iface
, riid
, ppv
);
5964 static ULONG WINAPI
HTMLAttributeCollection2_AddRef(IHTMLAttributeCollection2
*iface
)
5966 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection2(iface
);
5967 return IHTMLAttributeCollection_AddRef(&This
->IHTMLAttributeCollection_iface
);
5970 static ULONG WINAPI
HTMLAttributeCollection2_Release(IHTMLAttributeCollection2
*iface
)
5972 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection2(iface
);
5973 return IHTMLAttributeCollection_Release(&This
->IHTMLAttributeCollection_iface
);
5976 static HRESULT WINAPI
HTMLAttributeCollection2_GetTypeInfoCount(IHTMLAttributeCollection2
*iface
, UINT
*pctinfo
)
5978 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection2(iface
);
5979 return IDispatchEx_GetTypeInfoCount(&This
->dispex
.IDispatchEx_iface
, pctinfo
);
5982 static HRESULT WINAPI
HTMLAttributeCollection2_GetTypeInfo(IHTMLAttributeCollection2
*iface
, UINT iTInfo
,
5983 LCID lcid
, ITypeInfo
**ppTInfo
)
5985 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection2(iface
);
5986 return IDispatchEx_GetTypeInfo(&This
->dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
5989 static HRESULT WINAPI
HTMLAttributeCollection2_GetIDsOfNames(IHTMLAttributeCollection2
*iface
, REFIID riid
,
5990 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
5992 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection2(iface
);
5993 return IDispatchEx_GetIDsOfNames(&This
->dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
5997 static HRESULT WINAPI
HTMLAttributeCollection2_Invoke(IHTMLAttributeCollection2
*iface
, DISPID dispIdMember
,
5998 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
5999 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
6001 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection2(iface
);
6002 return IDispatchEx_Invoke(&This
->dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
6003 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
6006 static HRESULT WINAPI
HTMLAttributeCollection2_getNamedItem(IHTMLAttributeCollection2
*iface
, BSTR bstrName
,
6007 IHTMLDOMAttribute
**newretNode
)
6009 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection2(iface
);
6010 HTMLDOMAttribute
*attr
;
6014 TRACE("(%p)->(%s %p)\n", This
, debugstr_w(bstrName
), newretNode
);
6016 hres
= get_attr_dispid_by_name(This
, bstrName
, &id
);
6017 if(hres
== DISP_E_UNKNOWNNAME
) {
6020 } else if(FAILED(hres
)) {
6024 hres
= get_domattr(This
, id
, NULL
, &attr
);
6028 *newretNode
= &attr
->IHTMLDOMAttribute_iface
;
6032 static HRESULT WINAPI
HTMLAttributeCollection2_setNamedItem(IHTMLAttributeCollection2
*iface
,
6033 IHTMLDOMAttribute
*ppNode
, IHTMLDOMAttribute
**newretNode
)
6035 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection2(iface
);
6036 FIXME("(%p)->(%p %p)\n", This
, ppNode
, newretNode
);
6040 static HRESULT WINAPI
HTMLAttributeCollection2_removeNamedItem(IHTMLAttributeCollection2
*iface
,
6041 BSTR bstrName
, IHTMLDOMAttribute
**newretNode
)
6043 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection2(iface
);
6044 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(bstrName
), newretNode
);
6048 static const IHTMLAttributeCollection2Vtbl HTMLAttributeCollection2Vtbl
= {
6049 HTMLAttributeCollection2_QueryInterface
,
6050 HTMLAttributeCollection2_AddRef
,
6051 HTMLAttributeCollection2_Release
,
6052 HTMLAttributeCollection2_GetTypeInfoCount
,
6053 HTMLAttributeCollection2_GetTypeInfo
,
6054 HTMLAttributeCollection2_GetIDsOfNames
,
6055 HTMLAttributeCollection2_Invoke
,
6056 HTMLAttributeCollection2_getNamedItem
,
6057 HTMLAttributeCollection2_setNamedItem
,
6058 HTMLAttributeCollection2_removeNamedItem
6061 static inline HTMLAttributeCollection
*impl_from_IHTMLAttributeCollection3(IHTMLAttributeCollection3
*iface
)
6063 return CONTAINING_RECORD(iface
, HTMLAttributeCollection
, IHTMLAttributeCollection3_iface
);
6066 static HRESULT WINAPI
HTMLAttributeCollection3_QueryInterface(IHTMLAttributeCollection3
*iface
, REFIID riid
, void **ppv
)
6068 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection3(iface
);
6069 return IHTMLAttributeCollection_QueryInterface(&This
->IHTMLAttributeCollection_iface
, riid
, ppv
);
6072 static ULONG WINAPI
HTMLAttributeCollection3_AddRef(IHTMLAttributeCollection3
*iface
)
6074 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection3(iface
);
6075 return IHTMLAttributeCollection_AddRef(&This
->IHTMLAttributeCollection_iface
);
6078 static ULONG WINAPI
HTMLAttributeCollection3_Release(IHTMLAttributeCollection3
*iface
)
6080 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection3(iface
);
6081 return IHTMLAttributeCollection_Release(&This
->IHTMLAttributeCollection_iface
);
6084 static HRESULT WINAPI
HTMLAttributeCollection3_GetTypeInfoCount(IHTMLAttributeCollection3
*iface
, UINT
*pctinfo
)
6086 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection3(iface
);
6087 return IDispatchEx_GetTypeInfoCount(&This
->dispex
.IDispatchEx_iface
, pctinfo
);
6090 static HRESULT WINAPI
HTMLAttributeCollection3_GetTypeInfo(IHTMLAttributeCollection3
*iface
, UINT iTInfo
,
6091 LCID lcid
, ITypeInfo
**ppTInfo
)
6093 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection3(iface
);
6094 return IDispatchEx_GetTypeInfo(&This
->dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
6097 static HRESULT WINAPI
HTMLAttributeCollection3_GetIDsOfNames(IHTMLAttributeCollection3
*iface
, REFIID riid
,
6098 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
6100 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection3(iface
);
6101 return IDispatchEx_GetIDsOfNames(&This
->dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
6105 static HRESULT WINAPI
HTMLAttributeCollection3_Invoke(IHTMLAttributeCollection3
*iface
, DISPID dispIdMember
,
6106 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
6107 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
6109 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection3(iface
);
6110 return IDispatchEx_Invoke(&This
->dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
6111 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
6114 static HRESULT WINAPI
HTMLAttributeCollection3_getNamedItem(IHTMLAttributeCollection3
*iface
, BSTR bstrName
,
6115 IHTMLDOMAttribute
**ppNodeOut
)
6117 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection3(iface
);
6118 return IHTMLAttributeCollection2_getNamedItem(&This
->IHTMLAttributeCollection2_iface
, bstrName
, ppNodeOut
);
6121 static HRESULT WINAPI
HTMLAttributeCollection3_setNamedItem(IHTMLAttributeCollection3
*iface
,
6122 IHTMLDOMAttribute
*pNodeIn
, IHTMLDOMAttribute
**ppNodeOut
)
6124 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection3(iface
);
6125 FIXME("(%p)->(%p %p)\n", This
, pNodeIn
, ppNodeOut
);
6129 static HRESULT WINAPI
HTMLAttributeCollection3_removeNamedItem(IHTMLAttributeCollection3
*iface
,
6130 BSTR bstrName
, IHTMLDOMAttribute
**ppNodeOut
)
6132 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection3(iface
);
6133 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(bstrName
), ppNodeOut
);
6137 static HRESULT WINAPI
HTMLAttributeCollection3_item(IHTMLAttributeCollection3
*iface
, LONG index
, IHTMLDOMAttribute
**ppNodeOut
)
6139 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection3(iface
);
6140 HTMLDOMAttribute
*attr
;
6144 TRACE("(%p)->(%d %p)\n", This
, index
, ppNodeOut
);
6146 hres
= get_attr_dispid_by_idx(This
, &index
, &id
);
6147 if(hres
== DISP_E_UNKNOWNNAME
)
6148 return E_INVALIDARG
;
6152 hres
= get_domattr(This
, id
, NULL
, &attr
);
6156 *ppNodeOut
= &attr
->IHTMLDOMAttribute_iface
;
6160 static HRESULT WINAPI
HTMLAttributeCollection3_get_length(IHTMLAttributeCollection3
*iface
, LONG
*p
)
6162 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection3(iface
);
6163 return IHTMLAttributeCollection_get_length(&This
->IHTMLAttributeCollection_iface
, p
);
6166 static const IHTMLAttributeCollection3Vtbl HTMLAttributeCollection3Vtbl
= {
6167 HTMLAttributeCollection3_QueryInterface
,
6168 HTMLAttributeCollection3_AddRef
,
6169 HTMLAttributeCollection3_Release
,
6170 HTMLAttributeCollection3_GetTypeInfoCount
,
6171 HTMLAttributeCollection3_GetTypeInfo
,
6172 HTMLAttributeCollection3_GetIDsOfNames
,
6173 HTMLAttributeCollection3_Invoke
,
6174 HTMLAttributeCollection3_getNamedItem
,
6175 HTMLAttributeCollection3_setNamedItem
,
6176 HTMLAttributeCollection3_removeNamedItem
,
6177 HTMLAttributeCollection3_item
,
6178 HTMLAttributeCollection3_get_length
6181 static inline HTMLAttributeCollection
*HTMLAttributeCollection_from_DispatchEx(DispatchEx
*iface
)
6183 return CONTAINING_RECORD(iface
, HTMLAttributeCollection
, dispex
);
6186 static HRESULT
HTMLAttributeCollection_get_dispid(DispatchEx
*dispex
, BSTR name
, DWORD flags
, DISPID
*dispid
)
6188 HTMLAttributeCollection
*This
= HTMLAttributeCollection_from_DispatchEx(dispex
);
6189 HTMLDOMAttribute
*attr
;
6193 TRACE("(%p)->(%s %x %p)\n", This
, debugstr_w(name
), flags
, dispid
);
6195 hres
= get_attr_dispid_by_name(This
, name
, dispid
);
6199 hres
= get_domattr(This
, *dispid
, &pos
, &attr
);
6202 IHTMLDOMAttribute_Release(&attr
->IHTMLDOMAttribute_iface
);
6204 *dispid
= MSHTML_DISPID_CUSTOM_MIN
+pos
;
6208 static HRESULT
HTMLAttributeCollection_invoke(DispatchEx
*dispex
, DISPID id
, LCID lcid
,
6209 WORD flags
, DISPPARAMS
*params
, VARIANT
*res
, EXCEPINFO
*ei
, IServiceProvider
*caller
)
6211 HTMLAttributeCollection
*This
= HTMLAttributeCollection_from_DispatchEx(dispex
);
6213 TRACE("(%p)->(%x %x %x %p %p %p %p)\n", This
, id
, lcid
, flags
, params
, res
, ei
, caller
);
6216 case DISPATCH_PROPERTYGET
: {
6217 HTMLDOMAttribute
*iter
;
6220 pos
= id
-MSHTML_DISPID_CUSTOM_MIN
;
6222 LIST_FOR_EACH_ENTRY(iter
, &This
->attrs
, HTMLDOMAttribute
, entry
) {
6224 IHTMLDOMAttribute_AddRef(&iter
->IHTMLDOMAttribute_iface
);
6225 V_VT(res
) = VT_DISPATCH
;
6226 V_DISPATCH(res
) = (IDispatch
*)&iter
->IHTMLDOMAttribute_iface
;
6232 WARN("invalid arg\n");
6233 return E_INVALIDARG
;
6237 FIXME("unimplemented flags %x\n", flags
);
6242 static const dispex_static_data_vtbl_t HTMLAttributeCollection_dispex_vtbl
= {
6244 HTMLAttributeCollection_get_dispid
,
6245 HTMLAttributeCollection_invoke
,
6249 static const tid_t HTMLAttributeCollection_iface_tids
[] = {
6250 IHTMLAttributeCollection_tid
,
6251 IHTMLAttributeCollection2_tid
,
6252 IHTMLAttributeCollection3_tid
,
6256 static dispex_static_data_t HTMLAttributeCollection_dispex
= {
6257 &HTMLAttributeCollection_dispex_vtbl
,
6258 DispHTMLAttributeCollection_tid
,
6259 HTMLAttributeCollection_iface_tids
6262 HRESULT
HTMLElement_get_attr_col(HTMLDOMNode
*iface
, HTMLAttributeCollection
**ac
)
6264 HTMLElement
*This
= impl_from_HTMLDOMNode(iface
);
6267 IHTMLAttributeCollection_AddRef(&This
->attrs
->IHTMLAttributeCollection_iface
);
6272 This
->attrs
= heap_alloc_zero(sizeof(HTMLAttributeCollection
));
6274 return E_OUTOFMEMORY
;
6276 This
->attrs
->IHTMLAttributeCollection_iface
.lpVtbl
= &HTMLAttributeCollectionVtbl
;
6277 This
->attrs
->IHTMLAttributeCollection2_iface
.lpVtbl
= &HTMLAttributeCollection2Vtbl
;
6278 This
->attrs
->IHTMLAttributeCollection3_iface
.lpVtbl
= &HTMLAttributeCollection3Vtbl
;
6279 This
->attrs
->ref
= 2;
6281 This
->attrs
->elem
= This
;
6282 list_init(&This
->attrs
->attrs
);
6283 init_dispex(&This
->attrs
->dispex
, (IUnknown
*)&This
->attrs
->IHTMLAttributeCollection_iface
,
6284 &HTMLAttributeCollection_dispex
);