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
*,nsIDOMElement
*,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(nsIDOMElement
*nselem
, const WCHAR
*name
, nsAString
*val_str
, const PRUnichar
**val
)
174 nsAString_InitDepend(&name_str
, name
);
175 nsAString_Init(val_str
, NULL
);
176 nsres
= nsIDOMElement_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
->dom_element
, 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
= nsIDOMElement_SetAttribute(elem
->dom_element
, &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
, nsIDOMElement
**ret
)
278 WARN("NULL nsdoc\n");
282 nsAString_InitDepend(&tag_str
, tag
);
283 nsres
= nsIDOMHTMLDocument_CreateElement(doc
->nsdoc
, &tag_str
, ret
);
284 nsAString_Finish(&tag_str
);
285 if(NS_FAILED(nsres
)) {
286 ERR("CreateElement failed: %08x\n", nsres
);
293 HRESULT
create_element(HTMLDocumentNode
*doc
, const WCHAR
*tag
, HTMLElement
**ret
)
295 nsIDOMElement
*nselem
;
298 /* Use owner doc if called on document fragment */
302 hres
= create_nselem(doc
, tag
, &nselem
);
306 hres
= HTMLElement_Create(doc
, (nsIDOMNode
*)nselem
, TRUE
, ret
);
307 nsIDOMElement_Release(nselem
);
313 IHTMLRect IHTMLRect_iface
;
317 nsIDOMClientRect
*nsrect
;
320 static inline HTMLRect
*impl_from_IHTMLRect(IHTMLRect
*iface
)
322 return CONTAINING_RECORD(iface
, HTMLRect
, IHTMLRect_iface
);
325 static HRESULT WINAPI
HTMLRect_QueryInterface(IHTMLRect
*iface
, REFIID riid
, void **ppv
)
327 HTMLRect
*This
= impl_from_IHTMLRect(iface
);
329 TRACE("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
331 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
332 *ppv
= &This
->IHTMLRect_iface
;
333 }else if(IsEqualGUID(&IID_IHTMLRect
, riid
)) {
334 *ppv
= &This
->IHTMLRect_iface
;
335 }else if(dispex_query_interface(&This
->dispex
, riid
, ppv
)) {
336 return *ppv
? S_OK
: E_NOINTERFACE
;
338 FIXME("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
340 return E_NOINTERFACE
;
343 IUnknown_AddRef((IUnknown
*)*ppv
);
347 static ULONG WINAPI
HTMLRect_AddRef(IHTMLRect
*iface
)
349 HTMLRect
*This
= impl_from_IHTMLRect(iface
);
350 LONG ref
= InterlockedIncrement(&This
->ref
);
352 TRACE("(%p) ref=%d\n", This
, ref
);
357 static ULONG WINAPI
HTMLRect_Release(IHTMLRect
*iface
)
359 HTMLRect
*This
= impl_from_IHTMLRect(iface
);
360 LONG ref
= InterlockedDecrement(&This
->ref
);
362 TRACE("(%p) ref=%d\n", This
, ref
);
366 nsIDOMClientRect_Release(This
->nsrect
);
367 release_dispex(&This
->dispex
);
374 static HRESULT WINAPI
HTMLRect_GetTypeInfoCount(IHTMLRect
*iface
, UINT
*pctinfo
)
376 HTMLRect
*This
= impl_from_IHTMLRect(iface
);
377 FIXME("(%p)->(%p)\n", This
, pctinfo
);
381 static HRESULT WINAPI
HTMLRect_GetTypeInfo(IHTMLRect
*iface
, UINT iTInfo
,
382 LCID lcid
, ITypeInfo
**ppTInfo
)
384 HTMLRect
*This
= impl_from_IHTMLRect(iface
);
386 return IDispatchEx_GetTypeInfo(&This
->dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
389 static HRESULT WINAPI
HTMLRect_GetIDsOfNames(IHTMLRect
*iface
, REFIID riid
,
390 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
392 HTMLRect
*This
= impl_from_IHTMLRect(iface
);
394 return IDispatchEx_GetIDsOfNames(&This
->dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
398 static HRESULT WINAPI
HTMLRect_Invoke(IHTMLRect
*iface
, DISPID dispIdMember
,
399 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
400 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
402 HTMLRect
*This
= impl_from_IHTMLRect(iface
);
404 return IDispatchEx_Invoke(&This
->dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
, wFlags
,
405 pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
408 static HRESULT WINAPI
HTMLRect_put_left(IHTMLRect
*iface
, LONG v
)
410 HTMLRect
*This
= impl_from_IHTMLRect(iface
);
411 FIXME("(%p)->(%d)\n", This
, v
);
415 static HRESULT WINAPI
HTMLRect_get_left(IHTMLRect
*iface
, LONG
*p
)
417 HTMLRect
*This
= impl_from_IHTMLRect(iface
);
421 TRACE("(%p)->(%p)\n", This
, p
);
423 nsres
= nsIDOMClientRect_GetLeft(This
->nsrect
, &left
);
424 if(NS_FAILED(nsres
)) {
425 ERR("GetLeft failed: %08x\n", nsres
);
429 *p
= floor(left
+0.5);
433 static HRESULT WINAPI
HTMLRect_put_top(IHTMLRect
*iface
, LONG v
)
435 HTMLRect
*This
= impl_from_IHTMLRect(iface
);
436 FIXME("(%p)->(%d)\n", This
, v
);
440 static HRESULT WINAPI
HTMLRect_get_top(IHTMLRect
*iface
, LONG
*p
)
442 HTMLRect
*This
= impl_from_IHTMLRect(iface
);
446 TRACE("(%p)->(%p)\n", This
, p
);
448 nsres
= nsIDOMClientRect_GetTop(This
->nsrect
, &top
);
449 if(NS_FAILED(nsres
)) {
450 ERR("GetTop failed: %08x\n", nsres
);
458 static HRESULT WINAPI
HTMLRect_put_right(IHTMLRect
*iface
, LONG v
)
460 HTMLRect
*This
= impl_from_IHTMLRect(iface
);
461 FIXME("(%p)->(%d)\n", This
, v
);
465 static HRESULT WINAPI
HTMLRect_get_right(IHTMLRect
*iface
, LONG
*p
)
467 HTMLRect
*This
= impl_from_IHTMLRect(iface
);
471 TRACE("(%p)->(%p)\n", This
, p
);
473 nsres
= nsIDOMClientRect_GetRight(This
->nsrect
, &right
);
474 if(NS_FAILED(nsres
)) {
475 ERR("GetRight failed: %08x\n", nsres
);
479 *p
= floor(right
+0.5);
483 static HRESULT WINAPI
HTMLRect_put_bottom(IHTMLRect
*iface
, LONG v
)
485 HTMLRect
*This
= impl_from_IHTMLRect(iface
);
486 FIXME("(%p)->(%d)\n", This
, v
);
490 static HRESULT WINAPI
HTMLRect_get_bottom(IHTMLRect
*iface
, LONG
*p
)
492 HTMLRect
*This
= impl_from_IHTMLRect(iface
);
496 TRACE("(%p)->(%p)\n", This
, p
);
498 nsres
= nsIDOMClientRect_GetBottom(This
->nsrect
, &bottom
);
499 if(NS_FAILED(nsres
)) {
500 ERR("GetBottom failed: %08x\n", nsres
);
504 *p
= floor(bottom
+0.5);
508 static const IHTMLRectVtbl HTMLRectVtbl
= {
509 HTMLRect_QueryInterface
,
512 HTMLRect_GetTypeInfoCount
,
513 HTMLRect_GetTypeInfo
,
514 HTMLRect_GetIDsOfNames
,
526 static const tid_t HTMLRect_iface_tids
[] = {
530 static dispex_static_data_t HTMLRect_dispex
= {
536 static HRESULT
create_html_rect(nsIDOMClientRect
*nsrect
, IHTMLRect
**ret
)
540 rect
= heap_alloc_zero(sizeof(HTMLRect
));
542 return E_OUTOFMEMORY
;
544 rect
->IHTMLRect_iface
.lpVtbl
= &HTMLRectVtbl
;
547 init_dispex(&rect
->dispex
, (IUnknown
*)&rect
->IHTMLRect_iface
, &HTMLRect_dispex
);
549 nsIDOMClientRect_AddRef(nsrect
);
550 rect
->nsrect
= nsrect
;
552 *ret
= &rect
->IHTMLRect_iface
;
556 static HRESULT WINAPI
HTMLElement_QueryInterface(IHTMLElement
*iface
,
557 REFIID riid
, void **ppv
)
559 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
561 return IHTMLDOMNode_QueryInterface(&This
->node
.IHTMLDOMNode_iface
, riid
, ppv
);
564 static ULONG WINAPI
HTMLElement_AddRef(IHTMLElement
*iface
)
566 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
568 return IHTMLDOMNode_AddRef(&This
->node
.IHTMLDOMNode_iface
);
571 static ULONG WINAPI
HTMLElement_Release(IHTMLElement
*iface
)
573 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
575 return IHTMLDOMNode_Release(&This
->node
.IHTMLDOMNode_iface
);
578 static HRESULT WINAPI
HTMLElement_GetTypeInfoCount(IHTMLElement
*iface
, UINT
*pctinfo
)
580 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
581 return IDispatchEx_GetTypeInfoCount(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
584 static HRESULT WINAPI
HTMLElement_GetTypeInfo(IHTMLElement
*iface
, UINT iTInfo
,
585 LCID lcid
, ITypeInfo
**ppTInfo
)
587 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
588 return IDispatchEx_GetTypeInfo(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
591 static HRESULT WINAPI
HTMLElement_GetIDsOfNames(IHTMLElement
*iface
, REFIID riid
,
592 LPOLESTR
*rgszNames
, UINT cNames
,
593 LCID lcid
, DISPID
*rgDispId
)
595 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
596 return IDispatchEx_GetIDsOfNames(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
600 static HRESULT WINAPI
HTMLElement_Invoke(IHTMLElement
*iface
, DISPID dispIdMember
,
601 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
602 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
604 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
605 return IDispatchEx_Invoke(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
606 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
609 static HRESULT
set_elem_attr_value_by_dispid(HTMLElement
*elem
, DISPID dispid
, VARIANT
*v
)
611 DISPID propput_dispid
= DISPID_PROPERTYPUT
;
612 DISPPARAMS dp
= {v
, &propput_dispid
, 1, 1};
615 if(dispid
== DISPID_IHTMLELEMENT_STYLE
) {
616 TRACE("Ignoring call on style attribute\n");
620 return IDispatchEx_InvokeEx(&elem
->node
.event_target
.dispex
.IDispatchEx_iface
, dispid
,
621 LOCALE_SYSTEM_DEFAULT
, DISPATCH_PROPERTYPUT
, &dp
, NULL
, &ei
, NULL
);
624 static HRESULT WINAPI
HTMLElement_setAttribute(IHTMLElement
*iface
, BSTR strAttributeName
,
625 VARIANT AttributeValue
, LONG lFlags
)
627 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
631 TRACE("(%p)->(%s %s %08x)\n", This
, debugstr_w(strAttributeName
), debugstr_variant(&AttributeValue
), lFlags
);
633 hres
= IDispatchEx_GetDispID(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, strAttributeName
,
634 (lFlags
&ATTRFLAG_CASESENSITIVE
? fdexNameCaseSensitive
: fdexNameCaseInsensitive
) | fdexNameEnsure
, &dispid
);
638 return set_elem_attr_value_by_dispid(This
, dispid
, &AttributeValue
);
641 HRESULT
get_elem_attr_value_by_dispid(HTMLElement
*elem
, DISPID dispid
, VARIANT
*ret
)
643 DISPPARAMS dispParams
= {NULL
, NULL
, 0, 0};
646 return IDispatchEx_InvokeEx(&elem
->node
.event_target
.dispex
.IDispatchEx_iface
, dispid
, LOCALE_SYSTEM_DEFAULT
,
647 DISPATCH_PROPERTYGET
, &dispParams
, ret
, &excep
, NULL
);
650 HRESULT
attr_value_to_string(VARIANT
*v
)
654 static const WCHAR nullW
[] = {'n','u','l','l',0};
660 V_BSTR(v
) = SysAllocString(nullW
);
662 return E_OUTOFMEMORY
;
666 IDispatch_Release(V_DISPATCH(v
));
668 V_BSTR(v
) = SysAllocString(NULL
);
671 hres
= VariantChangeType(v
, v
, 0, VT_BSTR
);
679 static HRESULT WINAPI
HTMLElement_getAttribute(IHTMLElement
*iface
, BSTR strAttributeName
,
680 LONG lFlags
, VARIANT
*AttributeValue
)
682 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
686 TRACE("(%p)->(%s %08x %p)\n", This
, debugstr_w(strAttributeName
), lFlags
, AttributeValue
);
688 if(lFlags
& ~(ATTRFLAG_CASESENSITIVE
|ATTRFLAG_ASSTRING
))
689 FIXME("Unsupported flags %x\n", lFlags
);
691 hres
= IDispatchEx_GetDispID(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, strAttributeName
,
692 lFlags
&ATTRFLAG_CASESENSITIVE
? fdexNameCaseSensitive
: fdexNameCaseInsensitive
, &dispid
);
693 if(hres
== DISP_E_UNKNOWNNAME
) {
694 V_VT(AttributeValue
) = VT_NULL
;
699 V_VT(AttributeValue
) = VT_NULL
;
703 hres
= get_elem_attr_value_by_dispid(This
, dispid
, AttributeValue
);
704 if(SUCCEEDED(hres
) && (lFlags
& ATTRFLAG_ASSTRING
))
705 hres
= attr_value_to_string(AttributeValue
);
709 static HRESULT WINAPI
HTMLElement_removeAttribute(IHTMLElement
*iface
, BSTR strAttributeName
,
710 LONG lFlags
, VARIANT_BOOL
*pfSuccess
)
712 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
716 TRACE("(%p)->(%s %x %p)\n", This
, debugstr_w(strAttributeName
), lFlags
, pfSuccess
);
718 hres
= IDispatchEx_GetDispID(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, strAttributeName
,
719 lFlags
&ATTRFLAG_CASESENSITIVE
? fdexNameCaseSensitive
: fdexNameCaseInsensitive
, &id
);
720 if(hres
== DISP_E_UNKNOWNNAME
) {
721 *pfSuccess
= VARIANT_FALSE
;
727 if(id
== DISPID_IHTMLELEMENT_STYLE
) {
730 TRACE("Special case: style\n");
732 hres
= IHTMLElement_get_style(&This
->IHTMLElement_iface
, &style
);
736 hres
= IHTMLStyle_put_cssText(style
, NULL
);
737 IHTMLStyle_Release(style
);
741 *pfSuccess
= VARIANT_TRUE
;
745 return remove_attribute(&This
->node
.event_target
.dispex
, id
, pfSuccess
);
748 static HRESULT WINAPI
HTMLElement_put_className(IHTMLElement
*iface
, BSTR v
)
750 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
751 nsAString classname_str
;
754 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
756 if(!This
->dom_element
) {
757 FIXME("comment element\n");
761 nsAString_InitDepend(&classname_str
, v
);
762 nsres
= nsIDOMElement_SetClassName(This
->dom_element
, &classname_str
);
763 nsAString_Finish(&classname_str
);
765 ERR("SetClassName failed: %08x\n", nsres
);
770 static HRESULT WINAPI
HTMLElement_get_className(IHTMLElement
*iface
, BSTR
*p
)
772 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
776 TRACE("(%p)->(%p)\n", This
, p
);
778 if(!This
->dom_element
) {
779 FIXME("comment element\n");
783 nsAString_Init(&class_str
, NULL
);
784 nsres
= nsIDOMElement_GetClassName(This
->dom_element
, &class_str
);
785 return return_nsstr(nsres
, &class_str
, p
);
788 static HRESULT WINAPI
HTMLElement_put_id(IHTMLElement
*iface
, BSTR v
)
790 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
794 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
796 if(!This
->dom_element
) {
797 FIXME("comment element\n");
801 nsAString_InitDepend(&id_str
, v
);
802 nsres
= nsIDOMElement_SetId(This
->dom_element
, &id_str
);
803 nsAString_Finish(&id_str
);
805 ERR("SetId failed: %08x\n", nsres
);
810 static HRESULT WINAPI
HTMLElement_get_id(IHTMLElement
*iface
, BSTR
*p
)
812 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
816 TRACE("(%p)->(%p)\n", This
, p
);
818 if(!This
->dom_element
) {
823 nsAString_Init(&id_str
, NULL
);
824 nsres
= nsIDOMElement_GetId(This
->dom_element
, &id_str
);
825 return return_nsstr(nsres
, &id_str
, p
);
828 static HRESULT WINAPI
HTMLElement_get_tagName(IHTMLElement
*iface
, BSTR
*p
)
830 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
834 TRACE("(%p)->(%p)\n", This
, p
);
836 if(!This
->dom_element
) {
837 static const WCHAR comment_tagW
[] = {'!',0};
839 TRACE("comment element\n");
840 *p
= SysAllocString(comment_tagW
);
841 return *p
? S_OK
: E_OUTOFMEMORY
;
844 nsAString_Init(&tag_str
, NULL
);
845 nsres
= nsIDOMElement_GetTagName(This
->dom_element
, &tag_str
);
846 return return_nsstr(nsres
, &tag_str
, p
);
849 static HRESULT WINAPI
HTMLElement_get_parentElement(IHTMLElement
*iface
, IHTMLElement
**p
)
851 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
855 TRACE("(%p)->(%p)\n", This
, p
);
857 hres
= IHTMLDOMNode_get_parentNode(&This
->node
.IHTMLDOMNode_iface
, &node
);
866 hres
= IHTMLDOMNode_QueryInterface(node
, &IID_IHTMLElement
, (void**)p
);
867 IHTMLDOMNode_Release(node
);
874 static HRESULT WINAPI
HTMLElement_get_style(IHTMLElement
*iface
, IHTMLStyle
**p
)
876 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
878 TRACE("(%p)->(%p)\n", This
, p
);
883 hres
= HTMLStyle_Create(This
, &This
->style
);
888 *p
= &This
->style
->IHTMLStyle_iface
;
889 IHTMLStyle_AddRef(*p
);
893 static HRESULT WINAPI
HTMLElement_put_onhelp(IHTMLElement
*iface
, VARIANT v
)
895 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
897 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
899 return set_node_event(&This
->node
, EVENTID_HELP
, &v
);
902 static HRESULT WINAPI
HTMLElement_get_onhelp(IHTMLElement
*iface
, VARIANT
*p
)
904 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
906 TRACE("(%p)->(%p)\n", This
, p
);
908 return get_node_event(&This
->node
, EVENTID_HELP
, p
);
911 static HRESULT WINAPI
HTMLElement_put_onclick(IHTMLElement
*iface
, VARIANT v
)
913 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
915 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
917 return set_node_event(&This
->node
, EVENTID_CLICK
, &v
);
920 static HRESULT WINAPI
HTMLElement_get_onclick(IHTMLElement
*iface
, VARIANT
*p
)
922 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
924 TRACE("(%p)->(%p)\n", This
, p
);
926 return get_node_event(&This
->node
, EVENTID_CLICK
, p
);
929 static HRESULT WINAPI
HTMLElement_put_ondblclick(IHTMLElement
*iface
, VARIANT v
)
931 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
933 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
935 return set_node_event(&This
->node
, EVENTID_DBLCLICK
, &v
);
938 static HRESULT WINAPI
HTMLElement_get_ondblclick(IHTMLElement
*iface
, VARIANT
*p
)
940 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
942 TRACE("(%p)->(%p)\n", This
, p
);
944 return get_node_event(&This
->node
, EVENTID_DBLCLICK
, p
);
947 static HRESULT WINAPI
HTMLElement_put_onkeydown(IHTMLElement
*iface
, VARIANT v
)
949 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
951 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
953 return set_node_event(&This
->node
, EVENTID_KEYDOWN
, &v
);
956 static HRESULT WINAPI
HTMLElement_get_onkeydown(IHTMLElement
*iface
, VARIANT
*p
)
958 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
960 TRACE("(%p)->(%p)\n", This
, p
);
962 return get_node_event(&This
->node
, EVENTID_KEYDOWN
, p
);
965 static HRESULT WINAPI
HTMLElement_put_onkeyup(IHTMLElement
*iface
, VARIANT v
)
967 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
969 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
971 return set_node_event(&This
->node
, EVENTID_KEYUP
, &v
);
974 static HRESULT WINAPI
HTMLElement_get_onkeyup(IHTMLElement
*iface
, VARIANT
*p
)
976 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
978 TRACE("(%p)->(%p)\n", This
, p
);
980 return get_node_event(&This
->node
, EVENTID_KEYUP
, p
);
983 static HRESULT WINAPI
HTMLElement_put_onkeypress(IHTMLElement
*iface
, VARIANT v
)
985 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
987 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
989 return set_node_event(&This
->node
, EVENTID_KEYPRESS
, &v
);
992 static HRESULT WINAPI
HTMLElement_get_onkeypress(IHTMLElement
*iface
, VARIANT
*p
)
994 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
996 TRACE("(%p)->(%p)\n", This
, p
);
998 return get_node_event(&This
->node
, EVENTID_KEYPRESS
, p
);
1001 static HRESULT WINAPI
HTMLElement_put_onmouseout(IHTMLElement
*iface
, VARIANT v
)
1003 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1005 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1007 return set_node_event(&This
->node
, EVENTID_MOUSEOUT
, &v
);
1010 static HRESULT WINAPI
HTMLElement_get_onmouseout(IHTMLElement
*iface
, VARIANT
*p
)
1012 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1014 TRACE("(%p)->(%p)\n", This
, p
);
1016 return get_node_event(&This
->node
, EVENTID_MOUSEOUT
, p
);
1019 static HRESULT WINAPI
HTMLElement_put_onmouseover(IHTMLElement
*iface
, VARIANT v
)
1021 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1023 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1025 return set_node_event(&This
->node
, EVENTID_MOUSEOVER
, &v
);
1028 static HRESULT WINAPI
HTMLElement_get_onmouseover(IHTMLElement
*iface
, VARIANT
*p
)
1030 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1032 TRACE("(%p)->(%p)\n", This
, p
);
1034 return get_node_event(&This
->node
, EVENTID_MOUSEOVER
, p
);
1037 static HRESULT WINAPI
HTMLElement_put_onmousemove(IHTMLElement
*iface
, VARIANT v
)
1039 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1041 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1043 return set_node_event(&This
->node
, EVENTID_MOUSEMOVE
, &v
);
1046 static HRESULT WINAPI
HTMLElement_get_onmousemove(IHTMLElement
*iface
, VARIANT
*p
)
1048 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1050 TRACE("(%p)->(%p)\n", This
, p
);
1052 return get_node_event(&This
->node
, EVENTID_MOUSEMOVE
, p
);
1055 static HRESULT WINAPI
HTMLElement_put_onmousedown(IHTMLElement
*iface
, VARIANT v
)
1057 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1059 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1061 return set_node_event(&This
->node
, EVENTID_MOUSEDOWN
, &v
);
1064 static HRESULT WINAPI
HTMLElement_get_onmousedown(IHTMLElement
*iface
, VARIANT
*p
)
1066 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1068 TRACE("(%p)->(%p)\n", This
, p
);
1070 return get_node_event(&This
->node
, EVENTID_MOUSEDOWN
, p
);
1073 static HRESULT WINAPI
HTMLElement_put_onmouseup(IHTMLElement
*iface
, VARIANT v
)
1075 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1077 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1079 return set_node_event(&This
->node
, EVENTID_MOUSEUP
, &v
);
1082 static HRESULT WINAPI
HTMLElement_get_onmouseup(IHTMLElement
*iface
, VARIANT
*p
)
1084 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1086 TRACE("(%p)->(%p)\n", This
, p
);
1088 return get_node_event(&This
->node
, EVENTID_MOUSEUP
, p
);
1091 static HRESULT WINAPI
HTMLElement_get_document(IHTMLElement
*iface
, IDispatch
**p
)
1093 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1095 TRACE("(%p)->(%p)\n", This
, p
);
1100 if(This
->node
.vtbl
->get_document
)
1101 return This
->node
.vtbl
->get_document(&This
->node
, p
);
1103 *p
= (IDispatch
*)&This
->node
.doc
->basedoc
.IHTMLDocument2_iface
;
1104 IDispatch_AddRef(*p
);
1108 static const WCHAR titleW
[] = {'t','i','t','l','e',0};
1110 static HRESULT WINAPI
HTMLElement_put_title(IHTMLElement
*iface
, BSTR v
)
1112 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1113 nsAString title_str
;
1116 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1118 if(!This
->html_element
) {
1122 hres
= dispex_get_dprop_ref(&This
->node
.event_target
.dispex
, titleW
, TRUE
, &var
);
1127 V_VT(var
) = VT_BSTR
;
1128 V_BSTR(var
) = v
? SysAllocString(v
) : NULL
;
1132 nsAString_InitDepend(&title_str
, v
);
1133 nsres
= nsIDOMHTMLElement_SetTitle(This
->html_element
, &title_str
);
1134 nsAString_Finish(&title_str
);
1135 if(NS_FAILED(nsres
))
1136 ERR("SetTitle failed: %08x\n", nsres
);
1141 static HRESULT WINAPI
HTMLElement_get_title(IHTMLElement
*iface
, BSTR
*p
)
1143 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1144 nsAString title_str
;
1147 TRACE("(%p)->(%p)\n", This
, p
);
1149 if(!This
->html_element
) {
1153 hres
= dispex_get_dprop_ref(&This
->node
.event_target
.dispex
, titleW
, FALSE
, &var
);
1154 if(hres
== DISP_E_UNKNOWNNAME
) {
1156 }else if(V_VT(var
) != VT_BSTR
) {
1157 FIXME("title = %s\n", debugstr_variant(var
));
1160 *p
= V_BSTR(var
) ? SysAllocString(V_BSTR(var
)) : NULL
;
1166 nsAString_Init(&title_str
, NULL
);
1167 nsres
= nsIDOMHTMLElement_GetTitle(This
->html_element
, &title_str
);
1168 return return_nsstr(nsres
, &title_str
, p
);
1171 static const WCHAR languageW
[] = {'l','a','n','g','u','a','g','e',0};
1173 static HRESULT WINAPI
HTMLElement_put_language(IHTMLElement
*iface
, BSTR v
)
1175 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1177 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1179 return elem_string_attr_setter(This
, languageW
, v
);
1182 static HRESULT WINAPI
HTMLElement_get_language(IHTMLElement
*iface
, BSTR
*p
)
1184 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1186 TRACE("(%p)->(%p)\n", This
, p
);
1188 return elem_string_attr_getter(This
, languageW
, TRUE
, p
);
1191 static HRESULT WINAPI
HTMLElement_put_onselectstart(IHTMLElement
*iface
, VARIANT v
)
1193 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1195 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1197 return set_node_event(&This
->node
, EVENTID_SELECTSTART
, &v
);
1200 static HRESULT WINAPI
HTMLElement_get_onselectstart(IHTMLElement
*iface
, VARIANT
*p
)
1202 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1204 TRACE("(%p)->(%p)\n", This
, p
);
1206 return get_node_event(&This
->node
, EVENTID_SELECTSTART
, p
);
1209 static HRESULT WINAPI
HTMLElement_scrollIntoView(IHTMLElement
*iface
, VARIANT varargStart
)
1211 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1212 cpp_bool start
= TRUE
;
1215 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&varargStart
));
1217 switch(V_VT(&varargStart
)) {
1222 start
= V_BOOL(&varargStart
) != VARIANT_FALSE
;
1225 FIXME("Unsupported argument %s\n", debugstr_variant(&varargStart
));
1228 if(!This
->html_element
) {
1229 FIXME("non-HTML elements\n");
1233 nsres
= nsIDOMHTMLElement_ScrollIntoView(This
->html_element
, start
, 1);
1234 assert(nsres
== NS_OK
);
1239 static HRESULT WINAPI
HTMLElement_contains(IHTMLElement
*iface
, IHTMLElement
*pChild
,
1240 VARIANT_BOOL
*pfResult
)
1242 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1243 cpp_bool result
= FALSE
;
1245 TRACE("(%p)->(%p %p)\n", This
, pChild
, pfResult
);
1251 child
= unsafe_impl_from_IHTMLElement(pChild
);
1253 ERR("not our element\n");
1257 nsres
= nsIDOMNode_Contains(This
->node
.nsnode
, child
->node
.nsnode
, &result
);
1258 assert(nsres
== NS_OK
);
1261 *pfResult
= variant_bool(result
);
1265 static HRESULT WINAPI
HTMLElement_get_sourceIndex(IHTMLElement
*iface
, LONG
*p
)
1267 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1269 TRACE("(%p)->(%p)\n", This
, p
);
1271 return get_elem_source_index(This
, p
);
1274 static HRESULT WINAPI
HTMLElement_get_recordNumber(IHTMLElement
*iface
, VARIANT
*p
)
1276 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1277 FIXME("(%p)->(%p)\n", This
, p
);
1281 static HRESULT WINAPI
HTMLElement_put_lang(IHTMLElement
*iface
, BSTR v
)
1283 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1287 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1289 if(!This
->html_element
) {
1290 FIXME("non-HTML element\n");
1294 nsAString_InitDepend(&nsstr
, v
);
1295 nsres
= nsIDOMHTMLElement_SetLang(This
->html_element
, &nsstr
);
1296 nsAString_Finish(&nsstr
);
1297 if(NS_FAILED(nsres
)) {
1298 ERR("SetLang failed: %08x\n", nsres
);
1305 static HRESULT WINAPI
HTMLElement_get_lang(IHTMLElement
*iface
, BSTR
*p
)
1307 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1311 TRACE("(%p)->(%p)\n", This
, p
);
1313 if(!This
->html_element
) {
1314 FIXME("non-HTML element\n");
1318 nsAString_Init(&nsstr
, NULL
);
1319 nsres
= nsIDOMHTMLElement_GetLang(This
->html_element
, &nsstr
);
1320 return return_nsstr(nsres
, &nsstr
, p
);
1323 static HRESULT WINAPI
HTMLElement_get_offsetLeft(IHTMLElement
*iface
, LONG
*p
)
1325 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1328 TRACE("(%p)->(%p)\n", This
, p
);
1330 if(!This
->html_element
) {
1331 FIXME("non-HTML element\n");
1335 nsres
= nsIDOMHTMLElement_GetOffsetLeft(This
->html_element
, p
);
1336 if(NS_FAILED(nsres
)) {
1337 ERR("GetOffsetLeft failed: %08x\n", nsres
);
1344 static HRESULT WINAPI
HTMLElement_get_offsetTop(IHTMLElement
*iface
, LONG
*p
)
1346 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1349 TRACE("(%p)->(%p)\n", This
, p
);
1351 if(!This
->html_element
) {
1352 FIXME("non-HTML element\n");
1356 nsres
= nsIDOMHTMLElement_GetOffsetTop(This
->html_element
, p
);
1357 if(NS_FAILED(nsres
)) {
1358 ERR("GetOffsetTop failed: %08x\n", nsres
);
1365 static HRESULT WINAPI
HTMLElement_get_offsetWidth(IHTMLElement
*iface
, LONG
*p
)
1367 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1370 TRACE("(%p)->(%p)\n", This
, p
);
1372 if(!This
->html_element
) {
1373 FIXME("non-HTML element\n");
1377 nsres
= nsIDOMHTMLElement_GetOffsetWidth(This
->html_element
, p
);
1378 if(NS_FAILED(nsres
)) {
1379 ERR("GetOffsetWidth failed: %08x\n", nsres
);
1386 static HRESULT WINAPI
HTMLElement_get_offsetHeight(IHTMLElement
*iface
, LONG
*p
)
1388 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1391 TRACE("(%p)->(%p)\n", This
, p
);
1393 if(!This
->html_element
) {
1394 FIXME("non-HTML element\n");
1398 nsres
= nsIDOMHTMLElement_GetOffsetHeight(This
->html_element
, p
);
1399 if(NS_FAILED(nsres
)) {
1400 ERR("GetOffsetHeight failed: %08x\n", nsres
);
1407 static HRESULT WINAPI
HTMLElement_get_offsetParent(IHTMLElement
*iface
, IHTMLElement
**p
)
1409 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1410 nsIDOMElement
*nsparent
;
1411 HTMLElement
*parent
;
1415 TRACE("(%p)->(%p)\n", This
, p
);
1417 if(!This
->html_element
) {
1418 FIXME("non-HTML element\n");
1422 nsres
= nsIDOMHTMLElement_GetOffsetParent(This
->html_element
, &nsparent
);
1423 if(NS_FAILED(nsres
)) {
1424 ERR("GetOffsetParent failed: %08x\n", nsres
);
1433 hres
= get_element(nsparent
, &parent
);
1434 nsIDOMElement_Release(nsparent
);
1438 *p
= &parent
->IHTMLElement_iface
;
1442 static HRESULT WINAPI
HTMLElement_put_innerHTML(IHTMLElement
*iface
, BSTR v
)
1444 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1448 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1450 if(!This
->html_element
) {
1451 FIXME("non-HTML element\n");
1455 nsAString_InitDepend(&html_str
, v
);
1456 nsres
= nsIDOMHTMLElement_SetInnerHTML(This
->html_element
, &html_str
);
1457 nsAString_Finish(&html_str
);
1458 if(NS_FAILED(nsres
)) {
1459 FIXME("SetInnerHtml failed %08x\n", nsres
);
1466 static HRESULT WINAPI
HTMLElement_get_innerHTML(IHTMLElement
*iface
, BSTR
*p
)
1468 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1472 TRACE("(%p)->(%p)\n", This
, p
);
1474 if(!This
->html_element
) {
1475 FIXME("non-HTML element\n");
1479 nsAString_Init(&html_str
, NULL
);
1480 nsres
= nsIDOMHTMLElement_GetInnerHTML(This
->html_element
, &html_str
);
1481 return return_nsstr(nsres
, &html_str
, p
);
1484 static HRESULT WINAPI
HTMLElement_put_innerText(IHTMLElement
*iface
, BSTR v
)
1486 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1487 nsIDOMNode
*nschild
, *tmp
;
1488 nsIDOMText
*text_node
;
1492 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1495 nsres
= nsIDOMElement_GetLastChild(This
->dom_element
, &nschild
);
1496 if(NS_FAILED(nsres
)) {
1497 ERR("GetLastChild failed: %08x\n", nsres
);
1503 nsres
= nsIDOMElement_RemoveChild(This
->dom_element
, nschild
, &tmp
);
1504 nsIDOMNode_Release(nschild
);
1505 if(NS_FAILED(nsres
)) {
1506 ERR("RemoveChild failed: %08x\n", nsres
);
1509 nsIDOMNode_Release(tmp
);
1512 nsAString_InitDepend(&text_str
, v
);
1513 nsres
= nsIDOMHTMLDocument_CreateTextNode(This
->node
.doc
->nsdoc
, &text_str
, &text_node
);
1514 nsAString_Finish(&text_str
);
1515 if(NS_FAILED(nsres
)) {
1516 ERR("CreateTextNode failed: %08x\n", nsres
);
1520 nsres
= nsIDOMElement_AppendChild(This
->dom_element
, (nsIDOMNode
*)text_node
, &tmp
);
1521 if(NS_FAILED(nsres
)) {
1522 ERR("AppendChild failed: %08x\n", nsres
);
1526 nsIDOMNode_Release(tmp
);
1530 static HRESULT WINAPI
HTMLElement_get_innerText(IHTMLElement
*iface
, BSTR
*p
)
1532 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1534 TRACE("(%p)->(%p)\n", This
, p
);
1536 return get_node_text(&This
->node
, p
);
1539 static HRESULT WINAPI
HTMLElement_put_outerHTML(IHTMLElement
*iface
, BSTR v
)
1541 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1543 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1545 return replace_node_by_html(This
->node
.doc
->nsdoc
, This
->node
.nsnode
, v
);
1548 static HRESULT WINAPI
HTMLElement_get_outerHTML(IHTMLElement
*iface
, BSTR
*p
)
1550 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1554 WARN("(%p)->(%p) semi-stub\n", This
, p
);
1556 nsAString_Init(&html_str
, NULL
);
1557 hres
= nsnode_to_nsstring(This
->node
.nsnode
, &html_str
);
1558 if(SUCCEEDED(hres
)) {
1559 const PRUnichar
*html
;
1561 nsAString_GetData(&html_str
, &html
);
1562 *p
= SysAllocString(html
);
1564 hres
= E_OUTOFMEMORY
;
1567 nsAString_Finish(&html_str
);
1569 TRACE("ret %s\n", debugstr_w(*p
));
1573 static HRESULT WINAPI
HTMLElement_put_outerText(IHTMLElement
*iface
, BSTR v
)
1575 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1576 nsIDOMText
*text_node
;
1581 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1583 if(This
->node
.vtbl
->is_settable
&& !This
->node
.vtbl
->is_settable(&This
->node
, DISPID_IHTMLELEMENT_OUTERTEXT
)) {
1584 WARN("Called on element that does not support setting the property.\n");
1585 return 0x800a0258; /* undocumented error code */
1588 if(!This
->node
.doc
->nsdoc
) {
1589 FIXME("NULL nsdoc\n");
1593 nsAString_InitDepend(&nsstr
, v
);
1594 nsres
= nsIDOMHTMLDocument_CreateTextNode(This
->node
.doc
->nsdoc
, &nsstr
, &text_node
);
1595 nsAString_Finish(&nsstr
);
1596 if(NS_FAILED(nsres
)) {
1597 ERR("CreateTextNode failed\n");
1601 nsres
= nsIDOMHTMLDocument_CreateRange(This
->node
.doc
->nsdoc
, &range
);
1602 if(NS_SUCCEEDED(nsres
)) {
1603 nsres
= nsIDOMRange_SelectNode(range
, This
->node
.nsnode
);
1604 if(NS_SUCCEEDED(nsres
))
1605 nsres
= nsIDOMRange_DeleteContents(range
);
1606 if(NS_SUCCEEDED(nsres
))
1607 nsres
= nsIDOMRange_InsertNode(range
, (nsIDOMNode
*)text_node
);
1608 if(NS_SUCCEEDED(nsres
))
1609 nsres
= nsIDOMRange_SelectNodeContents(range
, This
->node
.nsnode
);
1610 if(NS_SUCCEEDED(nsres
))
1611 nsres
= nsIDOMRange_DeleteContents(range
);
1612 nsIDOMRange_Release(range
);
1614 nsIDOMText_Release(text_node
);
1615 if(NS_FAILED(nsres
)) {
1616 ERR("failed to set text: %08x\n", nsres
);
1623 static HRESULT WINAPI
HTMLElement_get_outerText(IHTMLElement
*iface
, BSTR
*p
)
1625 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1627 TRACE("(%p)->(%p)\n", This
, p
);
1629 /* getter is the same as innerText */
1630 return IHTMLElement_get_innerText(&This
->IHTMLElement_iface
, p
);
1633 static HRESULT
insert_adjacent_node(HTMLElement
*This
, const WCHAR
*where
, nsIDOMNode
*nsnode
, HTMLDOMNode
**ret_node
)
1635 nsIDOMNode
*ret_nsnode
;
1637 HRESULT hres
= S_OK
;
1639 static const WCHAR beforebeginW
[] = {'b','e','f','o','r','e','b','e','g','i','n',0};
1640 static const WCHAR afterbeginW
[] = {'a','f','t','e','r','b','e','g','i','n',0};
1641 static const WCHAR beforeendW
[] = {'b','e','f','o','r','e','e','n','d',0};
1642 static const WCHAR afterendW
[] = {'a','f','t','e','r','e','n','d',0};
1644 if (!strcmpiW(where
, beforebeginW
)) {
1647 nsres
= nsIDOMNode_GetParentNode(This
->node
.nsnode
, &parent
);
1648 if(NS_FAILED(nsres
))
1652 return E_INVALIDARG
;
1654 nsres
= nsIDOMNode_InsertBefore(parent
, nsnode
, This
->node
.nsnode
, &ret_nsnode
);
1655 nsIDOMNode_Release(parent
);
1656 }else if(!strcmpiW(where
, afterbeginW
)) {
1657 nsIDOMNode
*first_child
;
1659 nsres
= nsIDOMNode_GetFirstChild(This
->node
.nsnode
, &first_child
);
1660 if(NS_FAILED(nsres
))
1663 nsres
= nsIDOMNode_InsertBefore(This
->node
.nsnode
, nsnode
, first_child
, &ret_nsnode
);
1664 if(NS_FAILED(nsres
))
1668 nsIDOMNode_Release(first_child
);
1669 }else if (!strcmpiW(where
, beforeendW
)) {
1670 nsres
= nsIDOMNode_AppendChild(This
->node
.nsnode
, nsnode
, &ret_nsnode
);
1671 }else if (!strcmpiW(where
, afterendW
)) {
1672 nsIDOMNode
*next_sibling
, *parent
;
1674 nsres
= nsIDOMNode_GetParentNode(This
->node
.nsnode
, &parent
);
1675 if(NS_FAILED(nsres
))
1678 return E_INVALIDARG
;
1680 nsres
= nsIDOMNode_GetNextSibling(This
->node
.nsnode
, &next_sibling
);
1681 if(NS_SUCCEEDED(nsres
)) {
1683 nsres
= nsIDOMNode_InsertBefore(parent
, nsnode
, next_sibling
, &ret_nsnode
);
1684 nsIDOMNode_Release(next_sibling
);
1686 nsres
= nsIDOMNode_AppendChild(parent
, nsnode
, &ret_nsnode
);
1690 nsIDOMNode_Release(parent
);
1692 ERR("invalid where: %s\n", debugstr_w(where
));
1693 return E_INVALIDARG
;
1696 if (NS_FAILED(nsres
))
1700 hres
= get_node(ret_nsnode
, TRUE
, ret_node
);
1701 nsIDOMNode_Release(ret_nsnode
);
1705 static HRESULT WINAPI
HTMLElement_insertAdjacentHTML(IHTMLElement
*iface
, BSTR where
,
1708 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1715 TRACE("(%p)->(%s %s)\n", This
, debugstr_w(where
), debugstr_w(html
));
1717 if(!This
->node
.doc
->nsdoc
) {
1718 WARN("NULL nsdoc\n");
1719 return E_UNEXPECTED
;
1722 nsres
= nsIDOMHTMLDocument_CreateRange(This
->node
.doc
->nsdoc
, &range
);
1723 if(NS_FAILED(nsres
))
1725 ERR("CreateRange failed: %08x\n", nsres
);
1729 nsIDOMRange_SetStartBefore(range
, This
->node
.nsnode
);
1731 nsAString_InitDepend(&ns_html
, html
);
1732 nsres
= nsIDOMRange_CreateContextualFragment(range
, &ns_html
, (nsIDOMDocumentFragment
**)&nsnode
);
1733 nsAString_Finish(&ns_html
);
1734 nsIDOMRange_Release(range
);
1736 if(NS_FAILED(nsres
) || !nsnode
)
1738 ERR("CreateTextNode failed: %08x\n", nsres
);
1742 hr
= insert_adjacent_node(This
, where
, nsnode
, NULL
);
1743 nsIDOMNode_Release(nsnode
);
1747 static HRESULT WINAPI
HTMLElement_insertAdjacentText(IHTMLElement
*iface
, BSTR where
,
1750 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1756 TRACE("(%p)->(%s %s)\n", This
, debugstr_w(where
), debugstr_w(text
));
1758 if(!This
->node
.doc
->nsdoc
) {
1759 WARN("NULL nsdoc\n");
1760 return E_UNEXPECTED
;
1764 nsAString_InitDepend(&ns_text
, text
);
1765 nsres
= nsIDOMHTMLDocument_CreateTextNode(This
->node
.doc
->nsdoc
, &ns_text
, (nsIDOMText
**)&nsnode
);
1766 nsAString_Finish(&ns_text
);
1768 if(NS_FAILED(nsres
) || !nsnode
)
1770 ERR("CreateTextNode failed: %08x\n", nsres
);
1774 hr
= insert_adjacent_node(This
, where
, nsnode
, NULL
);
1775 nsIDOMNode_Release(nsnode
);
1780 static HRESULT WINAPI
HTMLElement_get_parentTextEdit(IHTMLElement
*iface
, IHTMLElement
**p
)
1782 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1783 FIXME("(%p)->(%p)\n", This
, p
);
1787 static HRESULT WINAPI
HTMLElement_get_isTextEdit(IHTMLElement
*iface
, VARIANT_BOOL
*p
)
1789 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1791 TRACE("(%p)->(%p)\n", This
, p
);
1793 *p
= variant_bool(This
->node
.vtbl
->is_text_edit
&& This
->node
.vtbl
->is_text_edit(&This
->node
));
1797 static HRESULT WINAPI
HTMLElement_click(IHTMLElement
*iface
)
1799 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1802 TRACE("(%p)\n", This
);
1804 if(!This
->html_element
) {
1805 FIXME("non-HTML element\n");
1809 nsres
= nsIDOMHTMLElement_Click(This
->html_element
);
1810 if(NS_FAILED(nsres
)) {
1811 ERR("Click failed: %08x\n", nsres
);
1818 static HRESULT WINAPI
HTMLElement_get_filters(IHTMLElement
*iface
,
1819 IHTMLFiltersCollection
**p
)
1821 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1822 TRACE("(%p)->(%p)\n", This
, p
);
1827 *p
= HTMLFiltersCollection_Create();
1832 static HRESULT WINAPI
HTMLElement_put_ondragstart(IHTMLElement
*iface
, VARIANT v
)
1834 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1836 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1838 return set_node_event(&This
->node
, EVENTID_DRAGSTART
, &v
);
1841 static HRESULT WINAPI
HTMLElement_get_ondragstart(IHTMLElement
*iface
, VARIANT
*p
)
1843 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1845 TRACE("(%p)->(%p)\n", This
, p
);
1847 return get_node_event(&This
->node
, EVENTID_DRAGSTART
, p
);
1850 static HRESULT WINAPI
HTMLElement_toString(IHTMLElement
*iface
, BSTR
*String
)
1852 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1853 FIXME("(%p)->(%p)\n", This
, String
);
1857 static HRESULT WINAPI
HTMLElement_put_onbeforeupdate(IHTMLElement
*iface
, VARIANT v
)
1859 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1860 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1864 static HRESULT WINAPI
HTMLElement_get_onbeforeupdate(IHTMLElement
*iface
, VARIANT
*p
)
1866 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1867 FIXME("(%p)->(%p)\n", This
, p
);
1871 static HRESULT WINAPI
HTMLElement_put_onafterupdate(IHTMLElement
*iface
, VARIANT v
)
1873 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1874 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1878 static HRESULT WINAPI
HTMLElement_get_onafterupdate(IHTMLElement
*iface
, VARIANT
*p
)
1880 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1881 FIXME("(%p)->(%p)\n", This
, p
);
1885 static HRESULT WINAPI
HTMLElement_put_onerrorupdate(IHTMLElement
*iface
, VARIANT v
)
1887 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1888 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1892 static HRESULT WINAPI
HTMLElement_get_onerrorupdate(IHTMLElement
*iface
, VARIANT
*p
)
1894 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1895 FIXME("(%p)->(%p)\n", This
, p
);
1899 static HRESULT WINAPI
HTMLElement_put_onrowexit(IHTMLElement
*iface
, VARIANT v
)
1901 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1902 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1906 static HRESULT WINAPI
HTMLElement_get_onrowexit(IHTMLElement
*iface
, VARIANT
*p
)
1908 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1909 FIXME("(%p)->(%p)\n", This
, p
);
1913 static HRESULT WINAPI
HTMLElement_put_onrowenter(IHTMLElement
*iface
, VARIANT v
)
1915 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1916 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1920 static HRESULT WINAPI
HTMLElement_get_onrowenter(IHTMLElement
*iface
, VARIANT
*p
)
1922 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1923 FIXME("(%p)->(%p)\n", This
, p
);
1927 static HRESULT WINAPI
HTMLElement_put_ondatasetchanged(IHTMLElement
*iface
, VARIANT v
)
1929 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1930 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1934 static HRESULT WINAPI
HTMLElement_get_ondatasetchanged(IHTMLElement
*iface
, VARIANT
*p
)
1936 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1937 FIXME("(%p)->(%p)\n", This
, p
);
1941 static HRESULT WINAPI
HTMLElement_put_ondataavailable(IHTMLElement
*iface
, VARIANT v
)
1943 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1945 FIXME("(%p)->(%s) semi-stub\n", This
, debugstr_variant(&v
));
1947 return set_node_event(&This
->node
, EVENTID_DATAAVAILABLE
, &v
);
1950 static HRESULT WINAPI
HTMLElement_get_ondataavailable(IHTMLElement
*iface
, VARIANT
*p
)
1952 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1954 TRACE("(%p)->(%p)\n", This
, p
);
1956 return get_node_event(&This
->node
, EVENTID_DATAAVAILABLE
, p
);
1959 static HRESULT WINAPI
HTMLElement_put_ondatasetcomplete(IHTMLElement
*iface
, VARIANT v
)
1961 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1962 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1966 static HRESULT WINAPI
HTMLElement_get_ondatasetcomplete(IHTMLElement
*iface
, VARIANT
*p
)
1968 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1969 FIXME("(%p)->(%p)\n", This
, p
);
1973 static HRESULT WINAPI
HTMLElement_put_onfilterchange(IHTMLElement
*iface
, VARIANT v
)
1975 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1976 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1980 static HRESULT WINAPI
HTMLElement_get_onfilterchange(IHTMLElement
*iface
, VARIANT
*p
)
1982 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1983 FIXME("(%p)->(%p)\n", This
, p
);
1987 static HRESULT WINAPI
HTMLElement_get_children(IHTMLElement
*iface
, IDispatch
**p
)
1989 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1990 nsIDOMNodeList
*nsnode_list
;
1993 TRACE("(%p)->(%p)\n", This
, p
);
1995 nsres
= nsIDOMNode_GetChildNodes(This
->node
.nsnode
, &nsnode_list
);
1996 if(NS_FAILED(nsres
)) {
1997 ERR("GetChildNodes failed: %08x\n", nsres
);
2001 *p
= (IDispatch
*)create_collection_from_nodelist(nsnode_list
, This
->node
.doc
->document_mode
);
2003 nsIDOMNodeList_Release(nsnode_list
);
2007 static HRESULT WINAPI
HTMLElement_get_all(IHTMLElement
*iface
, IDispatch
**p
)
2009 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
2011 TRACE("(%p)->(%p)\n", This
, p
);
2013 *p
= (IDispatch
*)create_all_collection(&This
->node
, FALSE
);
2017 static const IHTMLElementVtbl HTMLElementVtbl
= {
2018 HTMLElement_QueryInterface
,
2020 HTMLElement_Release
,
2021 HTMLElement_GetTypeInfoCount
,
2022 HTMLElement_GetTypeInfo
,
2023 HTMLElement_GetIDsOfNames
,
2025 HTMLElement_setAttribute
,
2026 HTMLElement_getAttribute
,
2027 HTMLElement_removeAttribute
,
2028 HTMLElement_put_className
,
2029 HTMLElement_get_className
,
2032 HTMLElement_get_tagName
,
2033 HTMLElement_get_parentElement
,
2034 HTMLElement_get_style
,
2035 HTMLElement_put_onhelp
,
2036 HTMLElement_get_onhelp
,
2037 HTMLElement_put_onclick
,
2038 HTMLElement_get_onclick
,
2039 HTMLElement_put_ondblclick
,
2040 HTMLElement_get_ondblclick
,
2041 HTMLElement_put_onkeydown
,
2042 HTMLElement_get_onkeydown
,
2043 HTMLElement_put_onkeyup
,
2044 HTMLElement_get_onkeyup
,
2045 HTMLElement_put_onkeypress
,
2046 HTMLElement_get_onkeypress
,
2047 HTMLElement_put_onmouseout
,
2048 HTMLElement_get_onmouseout
,
2049 HTMLElement_put_onmouseover
,
2050 HTMLElement_get_onmouseover
,
2051 HTMLElement_put_onmousemove
,
2052 HTMLElement_get_onmousemove
,
2053 HTMLElement_put_onmousedown
,
2054 HTMLElement_get_onmousedown
,
2055 HTMLElement_put_onmouseup
,
2056 HTMLElement_get_onmouseup
,
2057 HTMLElement_get_document
,
2058 HTMLElement_put_title
,
2059 HTMLElement_get_title
,
2060 HTMLElement_put_language
,
2061 HTMLElement_get_language
,
2062 HTMLElement_put_onselectstart
,
2063 HTMLElement_get_onselectstart
,
2064 HTMLElement_scrollIntoView
,
2065 HTMLElement_contains
,
2066 HTMLElement_get_sourceIndex
,
2067 HTMLElement_get_recordNumber
,
2068 HTMLElement_put_lang
,
2069 HTMLElement_get_lang
,
2070 HTMLElement_get_offsetLeft
,
2071 HTMLElement_get_offsetTop
,
2072 HTMLElement_get_offsetWidth
,
2073 HTMLElement_get_offsetHeight
,
2074 HTMLElement_get_offsetParent
,
2075 HTMLElement_put_innerHTML
,
2076 HTMLElement_get_innerHTML
,
2077 HTMLElement_put_innerText
,
2078 HTMLElement_get_innerText
,
2079 HTMLElement_put_outerHTML
,
2080 HTMLElement_get_outerHTML
,
2081 HTMLElement_put_outerText
,
2082 HTMLElement_get_outerText
,
2083 HTMLElement_insertAdjacentHTML
,
2084 HTMLElement_insertAdjacentText
,
2085 HTMLElement_get_parentTextEdit
,
2086 HTMLElement_get_isTextEdit
,
2088 HTMLElement_get_filters
,
2089 HTMLElement_put_ondragstart
,
2090 HTMLElement_get_ondragstart
,
2091 HTMLElement_toString
,
2092 HTMLElement_put_onbeforeupdate
,
2093 HTMLElement_get_onbeforeupdate
,
2094 HTMLElement_put_onafterupdate
,
2095 HTMLElement_get_onafterupdate
,
2096 HTMLElement_put_onerrorupdate
,
2097 HTMLElement_get_onerrorupdate
,
2098 HTMLElement_put_onrowexit
,
2099 HTMLElement_get_onrowexit
,
2100 HTMLElement_put_onrowenter
,
2101 HTMLElement_get_onrowenter
,
2102 HTMLElement_put_ondatasetchanged
,
2103 HTMLElement_get_ondatasetchanged
,
2104 HTMLElement_put_ondataavailable
,
2105 HTMLElement_get_ondataavailable
,
2106 HTMLElement_put_ondatasetcomplete
,
2107 HTMLElement_get_ondatasetcomplete
,
2108 HTMLElement_put_onfilterchange
,
2109 HTMLElement_get_onfilterchange
,
2110 HTMLElement_get_children
,
2114 HTMLElement
*unsafe_impl_from_IHTMLElement(IHTMLElement
*iface
)
2116 return iface
->lpVtbl
== &HTMLElementVtbl
? impl_from_IHTMLElement(iface
) : NULL
;
2119 static inline HTMLElement
*impl_from_IHTMLElement2(IHTMLElement2
*iface
)
2121 return CONTAINING_RECORD(iface
, HTMLElement
, IHTMLElement2_iface
);
2124 static HRESULT WINAPI
HTMLElement2_QueryInterface(IHTMLElement2
*iface
,
2125 REFIID riid
, void **ppv
)
2127 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2128 return IHTMLElement_QueryInterface(&This
->IHTMLElement_iface
, riid
, ppv
);
2131 static ULONG WINAPI
HTMLElement2_AddRef(IHTMLElement2
*iface
)
2133 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2134 return IHTMLElement_AddRef(&This
->IHTMLElement_iface
);
2137 static ULONG WINAPI
HTMLElement2_Release(IHTMLElement2
*iface
)
2139 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2140 return IHTMLElement_Release(&This
->IHTMLElement_iface
);
2143 static HRESULT WINAPI
HTMLElement2_GetTypeInfoCount(IHTMLElement2
*iface
, UINT
*pctinfo
)
2145 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2146 return IDispatchEx_GetTypeInfoCount(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
2149 static HRESULT WINAPI
HTMLElement2_GetTypeInfo(IHTMLElement2
*iface
, UINT iTInfo
,
2150 LCID lcid
, ITypeInfo
**ppTInfo
)
2152 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2153 return IDispatchEx_GetTypeInfo(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
2156 static HRESULT WINAPI
HTMLElement2_GetIDsOfNames(IHTMLElement2
*iface
, REFIID riid
,
2157 LPOLESTR
*rgszNames
, UINT cNames
,
2158 LCID lcid
, DISPID
*rgDispId
)
2160 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2161 return IDispatchEx_GetIDsOfNames(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
2165 static HRESULT WINAPI
HTMLElement2_Invoke(IHTMLElement2
*iface
, DISPID dispIdMember
,
2166 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
2167 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
2169 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2170 return IDispatchEx_Invoke(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
2171 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
2174 static HRESULT WINAPI
HTMLElement2_get_scopeName(IHTMLElement2
*iface
, BSTR
*p
)
2176 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2177 FIXME("(%p)->(%p)\n", This
, p
);
2181 static HRESULT WINAPI
HTMLElement2_setCapture(IHTMLElement2
*iface
, VARIANT_BOOL containerCapture
)
2183 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2184 FIXME("(%p)->(%x)\n", This
, containerCapture
);
2188 static HRESULT WINAPI
HTMLElement2_releaseCapture(IHTMLElement2
*iface
)
2190 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2191 FIXME("(%p)\n", This
);
2195 static HRESULT WINAPI
HTMLElement2_put_onlosecapture(IHTMLElement2
*iface
, VARIANT v
)
2197 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2198 FIXME("(%p)->()\n", This
);
2202 static HRESULT WINAPI
HTMLElement2_get_onlosecapture(IHTMLElement2
*iface
, VARIANT
*p
)
2204 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2205 FIXME("(%p)->(%p)\n", This
, p
);
2209 static HRESULT WINAPI
HTMLElement2_componentFromPoint(IHTMLElement2
*iface
,
2210 LONG x
, LONG y
, BSTR
*component
)
2212 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2213 FIXME("(%p)->(%d %d %p)\n", This
, x
, y
, component
);
2217 static HRESULT WINAPI
HTMLElement2_doScroll(IHTMLElement2
*iface
, VARIANT component
)
2219 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2221 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&component
));
2223 if(!This
->node
.doc
->content_ready
2224 || !This
->node
.doc
->basedoc
.doc_obj
->in_place_active
)
2231 static HRESULT WINAPI
HTMLElement2_put_onscroll(IHTMLElement2
*iface
, VARIANT v
)
2233 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2235 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2237 return set_node_event(&This
->node
, EVENTID_SCROLL
, &v
);
2240 static HRESULT WINAPI
HTMLElement2_get_onscroll(IHTMLElement2
*iface
, VARIANT
*p
)
2242 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2244 TRACE("(%p)->(%p)\n", This
, p
);
2246 return get_node_event(&This
->node
, EVENTID_SCROLL
, p
);
2249 static HRESULT WINAPI
HTMLElement2_put_ondrag(IHTMLElement2
*iface
, VARIANT v
)
2251 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2253 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2255 return set_node_event(&This
->node
, EVENTID_DRAG
, &v
);
2258 static HRESULT WINAPI
HTMLElement2_get_ondrag(IHTMLElement2
*iface
, VARIANT
*p
)
2260 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2262 TRACE("(%p)->(%p)\n", This
, p
);
2264 return get_node_event(&This
->node
, EVENTID_DRAG
, p
);
2267 static HRESULT WINAPI
HTMLElement2_put_ondragend(IHTMLElement2
*iface
, VARIANT v
)
2269 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2270 FIXME("(%p)->()\n", This
);
2274 static HRESULT WINAPI
HTMLElement2_get_ondragend(IHTMLElement2
*iface
, VARIANT
*p
)
2276 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2277 FIXME("(%p)->(%p)\n", This
, p
);
2281 static HRESULT WINAPI
HTMLElement2_put_ondragenter(IHTMLElement2
*iface
, VARIANT v
)
2283 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2284 FIXME("(%p)->()\n", This
);
2288 static HRESULT WINAPI
HTMLElement2_get_ondragenter(IHTMLElement2
*iface
, VARIANT
*p
)
2290 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2291 FIXME("(%p)->(%p)\n", This
, p
);
2295 static HRESULT WINAPI
HTMLElement2_put_ondragover(IHTMLElement2
*iface
, VARIANT v
)
2297 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2298 FIXME("(%p)->()\n", This
);
2302 static HRESULT WINAPI
HTMLElement2_get_ondragover(IHTMLElement2
*iface
, VARIANT
*p
)
2304 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2305 FIXME("(%p)->(%p)\n", This
, p
);
2309 static HRESULT WINAPI
HTMLElement2_put_ondragleave(IHTMLElement2
*iface
, VARIANT v
)
2311 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2312 FIXME("(%p)->()\n", This
);
2316 static HRESULT WINAPI
HTMLElement2_get_ondragleave(IHTMLElement2
*iface
, VARIANT
*p
)
2318 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2319 FIXME("(%p)->(%p)\n", This
, p
);
2323 static HRESULT WINAPI
HTMLElement2_put_ondrop(IHTMLElement2
*iface
, VARIANT v
)
2325 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2326 FIXME("(%p)->()\n", This
);
2330 static HRESULT WINAPI
HTMLElement2_get_ondrop(IHTMLElement2
*iface
, VARIANT
*p
)
2332 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2333 FIXME("(%p)->(%p)\n", This
, p
);
2337 static HRESULT WINAPI
HTMLElement2_put_onbeforecut(IHTMLElement2
*iface
, VARIANT v
)
2339 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2340 FIXME("(%p)->()\n", This
);
2344 static HRESULT WINAPI
HTMLElement2_get_onbeforecut(IHTMLElement2
*iface
, VARIANT
*p
)
2346 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2347 FIXME("(%p)->(%p)\n", This
, p
);
2351 static HRESULT WINAPI
HTMLElement2_put_oncut(IHTMLElement2
*iface
, VARIANT v
)
2353 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2354 FIXME("(%p)->()\n", This
);
2358 static HRESULT WINAPI
HTMLElement2_get_oncut(IHTMLElement2
*iface
, VARIANT
*p
)
2360 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2361 FIXME("(%p)->(%p)\n", This
, p
);
2365 static HRESULT WINAPI
HTMLElement2_put_onbeforecopy(IHTMLElement2
*iface
, VARIANT v
)
2367 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2368 FIXME("(%p)->()\n", This
);
2372 static HRESULT WINAPI
HTMLElement2_get_onbeforecopy(IHTMLElement2
*iface
, VARIANT
*p
)
2374 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2375 FIXME("(%p)->(%p)\n", This
, p
);
2379 static HRESULT WINAPI
HTMLElement2_put_oncopy(IHTMLElement2
*iface
, VARIANT v
)
2381 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2382 FIXME("(%p)->()\n", This
);
2386 static HRESULT WINAPI
HTMLElement2_get_oncopy(IHTMLElement2
*iface
, VARIANT
*p
)
2388 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2389 FIXME("(%p)->(%p)\n", This
, p
);
2393 static HRESULT WINAPI
HTMLElement2_put_onbeforepaste(IHTMLElement2
*iface
, VARIANT v
)
2395 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2396 FIXME("(%p)->()\n", This
);
2400 static HRESULT WINAPI
HTMLElement2_get_onbeforepaste(IHTMLElement2
*iface
, VARIANT
*p
)
2402 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2403 FIXME("(%p)->(%p)\n", This
, p
);
2407 static HRESULT WINAPI
HTMLElement2_put_onpaste(IHTMLElement2
*iface
, VARIANT v
)
2409 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2411 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2413 return set_node_event(&This
->node
, EVENTID_PASTE
, &v
);
2416 static HRESULT WINAPI
HTMLElement2_get_onpaste(IHTMLElement2
*iface
, VARIANT
*p
)
2418 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2420 TRACE("(%p)->(%p)\n", This
, p
);
2422 return get_node_event(&This
->node
, EVENTID_PASTE
, p
);
2425 static HRESULT WINAPI
HTMLElement2_get_currentStyle(IHTMLElement2
*iface
, IHTMLCurrentStyle
**p
)
2427 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2429 TRACE("(%p)->(%p)\n", This
, p
);
2431 return HTMLCurrentStyle_Create(This
, p
);
2434 static HRESULT WINAPI
HTMLElement2_put_onpropertychange(IHTMLElement2
*iface
, VARIANT v
)
2436 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2437 FIXME("(%p)->()\n", This
);
2441 static HRESULT WINAPI
HTMLElement2_get_onpropertychange(IHTMLElement2
*iface
, VARIANT
*p
)
2443 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2444 FIXME("(%p)->(%p)\n", This
, p
);
2448 static HRESULT WINAPI
HTMLElement2_getClientRects(IHTMLElement2
*iface
, IHTMLRectCollection
**pRectCol
)
2450 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2451 FIXME("(%p)->(%p)\n", This
, pRectCol
);
2455 static HRESULT WINAPI
HTMLElement2_getBoundingClientRect(IHTMLElement2
*iface
, IHTMLRect
**pRect
)
2457 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2458 nsIDOMClientRect
*nsrect
;
2462 TRACE("(%p)->(%p)\n", This
, pRect
);
2464 if(!This
->dom_element
) {
2465 FIXME("comment element\n");
2469 nsres
= nsIDOMElement_GetBoundingClientRect(This
->dom_element
, &nsrect
);
2470 if(NS_FAILED(nsres
) || !nsrect
) {
2471 ERR("GetBoindingClientRect failed: %08x\n", nsres
);
2475 hres
= create_html_rect(nsrect
, pRect
);
2477 nsIDOMClientRect_Release(nsrect
);
2481 static HRESULT WINAPI
HTMLElement2_setExpression(IHTMLElement2
*iface
, BSTR propname
,
2482 BSTR expression
, BSTR language
)
2484 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2485 FIXME("(%p)->(%s %s %s)\n", This
, debugstr_w(propname
), debugstr_w(expression
),
2486 debugstr_w(language
));
2490 static HRESULT WINAPI
HTMLElement2_getExpression(IHTMLElement2
*iface
, BSTR propname
,
2491 VARIANT
*expression
)
2493 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2494 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(propname
), expression
);
2498 static HRESULT WINAPI
HTMLElement2_removeExpression(IHTMLElement2
*iface
, BSTR propname
,
2499 VARIANT_BOOL
*pfSuccess
)
2501 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2502 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(propname
), pfSuccess
);
2506 static HRESULT WINAPI
HTMLElement2_put_tabIndex(IHTMLElement2
*iface
, short v
)
2508 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2511 TRACE("(%p)->(%d)\n", This
, v
);
2513 if(!This
->html_element
) {
2514 FIXME("non-HTML element\n");
2518 nsres
= nsIDOMHTMLElement_SetTabIndex(This
->html_element
, v
);
2519 if(NS_FAILED(nsres
))
2520 ERR("GetTabIndex failed: %08x\n", nsres
);
2525 static HRESULT WINAPI
HTMLElement2_get_tabIndex(IHTMLElement2
*iface
, short *p
)
2527 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2531 TRACE("(%p)->(%p)\n", This
, p
);
2533 if(!This
->html_element
) {
2534 FIXME("non-HTML element\n");
2538 nsres
= nsIDOMHTMLElement_GetTabIndex(This
->html_element
, &index
);
2539 if(NS_FAILED(nsres
)) {
2540 ERR("GetTabIndex failed: %08x\n", nsres
);
2548 static HRESULT WINAPI
HTMLElement2_focus(IHTMLElement2
*iface
)
2550 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2553 TRACE("(%p)\n", This
);
2555 if(!This
->html_element
) {
2556 FIXME("non-HTML element\n");
2560 nsres
= nsIDOMHTMLElement_Focus(This
->html_element
);
2561 if(NS_FAILED(nsres
))
2562 ERR("Focus failed: %08x\n", nsres
);
2567 static HRESULT WINAPI
HTMLElement2_put_accessKey(IHTMLElement2
*iface
, BSTR v
)
2569 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2572 static WCHAR accessKeyW
[] = {'a','c','c','e','s','s','K','e','y',0};
2574 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2576 V_VT(&var
) = VT_BSTR
;
2578 return IHTMLElement_setAttribute(&This
->IHTMLElement_iface
, accessKeyW
, var
, 0);
2581 static HRESULT WINAPI
HTMLElement2_get_accessKey(IHTMLElement2
*iface
, BSTR
*p
)
2583 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2584 FIXME("(%p)->(%p)\n", This
, p
);
2588 static HRESULT WINAPI
HTMLElement2_put_onblur(IHTMLElement2
*iface
, VARIANT v
)
2590 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2592 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2594 return set_node_event(&This
->node
, EVENTID_BLUR
, &v
);
2597 static HRESULT WINAPI
HTMLElement2_get_onblur(IHTMLElement2
*iface
, VARIANT
*p
)
2599 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2601 TRACE("(%p)->(%p)\n", This
, p
);
2603 return get_node_event(&This
->node
, EVENTID_BLUR
, p
);
2606 static HRESULT WINAPI
HTMLElement2_put_onfocus(IHTMLElement2
*iface
, VARIANT v
)
2608 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2610 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2612 return set_node_event(&This
->node
, EVENTID_FOCUS
, &v
);
2615 static HRESULT WINAPI
HTMLElement2_get_onfocus(IHTMLElement2
*iface
, VARIANT
*p
)
2617 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2619 TRACE("(%p)->(%p)\n", This
, p
);
2621 return get_node_event(&This
->node
, EVENTID_FOCUS
, p
);
2624 static HRESULT WINAPI
HTMLElement2_put_onresize(IHTMLElement2
*iface
, VARIANT v
)
2626 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2628 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2630 return set_node_event(&This
->node
, EVENTID_RESIZE
, &v
);
2633 static HRESULT WINAPI
HTMLElement2_get_onresize(IHTMLElement2
*iface
, VARIANT
*p
)
2635 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2637 TRACE("(%p)->(%p)\n", This
, p
);
2639 return get_node_event(&This
->node
, EVENTID_RESIZE
, p
);
2642 static HRESULT WINAPI
HTMLElement2_blur(IHTMLElement2
*iface
)
2644 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2647 TRACE("(%p)\n", This
);
2649 if(!This
->html_element
) {
2650 FIXME("non-HTML element\n");
2654 nsres
= nsIDOMHTMLElement_Blur(This
->html_element
);
2655 if(NS_FAILED(nsres
)) {
2656 ERR("Blur failed: %08x\n", nsres
);
2663 static HRESULT WINAPI
HTMLElement2_addFilter(IHTMLElement2
*iface
, IUnknown
*pUnk
)
2665 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2666 FIXME("(%p)->(%p)\n", This
, pUnk
);
2670 static HRESULT WINAPI
HTMLElement2_removeFilter(IHTMLElement2
*iface
, IUnknown
*pUnk
)
2672 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2673 FIXME("(%p)->(%p)\n", This
, pUnk
);
2677 static HRESULT WINAPI
HTMLElement2_get_clientHeight(IHTMLElement2
*iface
, LONG
*p
)
2679 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2682 TRACE("(%p)->(%p)\n", This
, p
);
2684 if(!This
->dom_element
) {
2685 FIXME("Unimplemented for comment element\n");
2689 nsres
= nsIDOMElement_GetClientHeight(This
->dom_element
, p
);
2690 assert(nsres
== NS_OK
);
2694 static HRESULT WINAPI
HTMLElement2_get_clientWidth(IHTMLElement2
*iface
, LONG
*p
)
2696 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2699 TRACE("(%p)->(%p)\n", This
, p
);
2701 if(!This
->dom_element
) {
2702 FIXME("comment element\n");
2706 nsres
= nsIDOMElement_GetClientWidth(This
->dom_element
, p
);
2707 assert(nsres
== NS_OK
);
2711 static HRESULT WINAPI
HTMLElement2_get_clientTop(IHTMLElement2
*iface
, LONG
*p
)
2713 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2716 TRACE("(%p)->(%p)\n", This
, p
);
2718 if(!This
->dom_element
) {
2719 FIXME("comment element\n");
2723 nsres
= nsIDOMElement_GetClientTop(This
->dom_element
, p
);
2724 assert(nsres
== NS_OK
);
2726 TRACE("*p = %d\n", *p
);
2730 static HRESULT WINAPI
HTMLElement2_get_clientLeft(IHTMLElement2
*iface
, LONG
*p
)
2732 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2735 TRACE("(%p)->(%p)\n", This
, p
);
2737 if(!This
->dom_element
) {
2738 FIXME("comment element\n");
2742 nsres
= nsIDOMElement_GetClientLeft(This
->dom_element
, p
);
2743 assert(nsres
== NS_OK
);
2745 TRACE("*p = %d\n", *p
);
2749 static HRESULT WINAPI
HTMLElement2_attachEvent(IHTMLElement2
*iface
, BSTR event
,
2750 IDispatch
*pDisp
, VARIANT_BOOL
*pfResult
)
2752 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2754 TRACE("(%p)->(%s %p %p)\n", This
, debugstr_w(event
), pDisp
, pfResult
);
2756 return attach_event(&This
->node
.event_target
, event
, pDisp
, pfResult
);
2759 static HRESULT WINAPI
HTMLElement2_detachEvent(IHTMLElement2
*iface
, BSTR event
, IDispatch
*pDisp
)
2761 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2763 TRACE("(%p)->(%s %p)\n", This
, debugstr_w(event
), pDisp
);
2765 return detach_event(&This
->node
.event_target
, event
, pDisp
);
2768 static HRESULT WINAPI
HTMLElement2_get_readyState(IHTMLElement2
*iface
, VARIANT
*p
)
2770 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2773 TRACE("(%p)->(%p)\n", This
, p
);
2775 if(This
->node
.vtbl
->get_readystate
) {
2778 hres
= This
->node
.vtbl
->get_readystate(&This
->node
, &str
);
2782 static const WCHAR completeW
[] = {'c','o','m','p','l','e','t','e',0};
2784 str
= SysAllocString(completeW
);
2786 return E_OUTOFMEMORY
;
2794 static HRESULT WINAPI
HTMLElement2_put_onreadystatechange(IHTMLElement2
*iface
, VARIANT v
)
2796 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2798 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2800 return set_node_event(&This
->node
, EVENTID_READYSTATECHANGE
, &v
);
2803 static HRESULT WINAPI
HTMLElement2_get_onreadystatechange(IHTMLElement2
*iface
, VARIANT
*p
)
2805 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2807 TRACE("(%p)->(%p)\n", This
, p
);
2809 return get_node_event(&This
->node
, EVENTID_READYSTATECHANGE
, p
);
2812 static HRESULT WINAPI
HTMLElement2_put_onrowsdelete(IHTMLElement2
*iface
, VARIANT v
)
2814 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2815 FIXME("(%p)->()\n", This
);
2819 static HRESULT WINAPI
HTMLElement2_get_onrowsdelete(IHTMLElement2
*iface
, VARIANT
*p
)
2821 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2822 FIXME("(%p)->(%p)\n", This
, p
);
2826 static HRESULT WINAPI
HTMLElement2_put_onrowsinserted(IHTMLElement2
*iface
, VARIANT v
)
2828 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2829 FIXME("(%p)->()\n", This
);
2833 static HRESULT WINAPI
HTMLElement2_get_onrowsinserted(IHTMLElement2
*iface
, VARIANT
*p
)
2835 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2836 FIXME("(%p)->(%p)\n", This
, p
);
2840 static HRESULT WINAPI
HTMLElement2_put_oncellchange(IHTMLElement2
*iface
, VARIANT v
)
2842 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2843 FIXME("(%p)->()\n", This
);
2847 static HRESULT WINAPI
HTMLElement2_get_oncellchange(IHTMLElement2
*iface
, VARIANT
*p
)
2849 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2850 FIXME("(%p)->(%p)\n", This
, p
);
2854 static HRESULT WINAPI
HTMLElement2_put_dir(IHTMLElement2
*iface
, BSTR v
)
2856 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2860 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2862 if(!This
->html_element
) {
2863 FIXME("non-HTML element\n");
2867 nsAString_InitDepend(&nsstr
, v
);
2868 nsres
= nsIDOMHTMLElement_SetDir(This
->html_element
, &nsstr
);
2869 nsAString_Finish(&nsstr
);
2870 if(NS_FAILED(nsres
)) {
2871 ERR("SetDir failed: %08x\n", nsres
);
2878 static HRESULT WINAPI
HTMLElement2_get_dir(IHTMLElement2
*iface
, BSTR
*p
)
2880 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2884 TRACE("(%p)->(%p)\n", This
, p
);
2886 if(!This
->html_element
) {
2887 if(This
->dom_element
)
2888 FIXME("non-HTML element\n");
2893 nsAString_Init(&dir_str
, NULL
);
2894 nsres
= nsIDOMHTMLElement_GetDir(This
->html_element
, &dir_str
);
2895 return return_nsstr(nsres
, &dir_str
, p
);
2898 static HRESULT WINAPI
HTMLElement2_createControlRange(IHTMLElement2
*iface
, IDispatch
**range
)
2900 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2901 FIXME("(%p)->(%p)\n", This
, range
);
2905 static HRESULT WINAPI
HTMLElement2_get_scrollHeight(IHTMLElement2
*iface
, LONG
*p
)
2907 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2910 TRACE("(%p)->(%p)\n", This
, p
);
2912 if(!This
->dom_element
) {
2913 FIXME("comment element\n");
2917 nsres
= nsIDOMElement_GetScrollHeight(This
->dom_element
, p
);
2918 assert(nsres
== NS_OK
);
2919 TRACE("*p = %d\n", *p
);
2923 static HRESULT WINAPI
HTMLElement2_get_scrollWidth(IHTMLElement2
*iface
, LONG
*p
)
2925 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2928 TRACE("(%p)->(%p)\n", This
, p
);
2930 if(!This
->dom_element
) {
2931 FIXME("comment element\n");
2935 nsres
= nsIDOMElement_GetScrollWidth(This
->dom_element
, p
);
2936 assert(nsres
== NS_OK
);
2938 TRACE("*p = %d\n", *p
);
2942 static HRESULT WINAPI
HTMLElement2_put_scrollTop(IHTMLElement2
*iface
, LONG v
)
2944 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2946 TRACE("(%p)->(%d)\n", This
, v
);
2948 if(!This
->dom_element
) {
2949 FIXME("comment element\n");
2953 nsIDOMElement_SetScrollTop(This
->dom_element
, v
);
2957 static HRESULT WINAPI
HTMLElement2_get_scrollTop(IHTMLElement2
*iface
, LONG
*p
)
2959 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2962 TRACE("(%p)->(%p)\n", This
, p
);
2964 if(!This
->dom_element
) {
2965 FIXME("comment element\n");
2969 nsres
= nsIDOMElement_GetScrollTop(This
->dom_element
, p
);
2970 assert(nsres
== NS_OK
);
2972 TRACE("*p = %d\n", *p
);
2976 static HRESULT WINAPI
HTMLElement2_put_scrollLeft(IHTMLElement2
*iface
, LONG v
)
2978 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2980 TRACE("(%p)->(%d)\n", This
, v
);
2982 if(!This
->dom_element
) {
2983 FIXME("comment element\n");
2987 nsIDOMElement_SetScrollLeft(This
->dom_element
, v
);
2991 static HRESULT WINAPI
HTMLElement2_get_scrollLeft(IHTMLElement2
*iface
, LONG
*p
)
2993 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2996 TRACE("(%p)->(%p)\n", This
, p
);
2999 return E_INVALIDARG
;
3001 if(!This
->dom_element
) {
3002 FIXME("comment element\n");
3006 nsres
= nsIDOMElement_GetScrollLeft(This
->dom_element
, p
);
3007 assert(nsres
== NS_OK
);
3008 TRACE("*p = %d\n", *p
);
3012 static HRESULT WINAPI
HTMLElement2_clearAttributes(IHTMLElement2
*iface
)
3014 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3015 FIXME("(%p)\n", This
);
3019 static HRESULT WINAPI
HTMLElement2_mergeAttributes(IHTMLElement2
*iface
, IHTMLElement
*mergeThis
)
3021 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3022 FIXME("(%p)->(%p)\n", This
, mergeThis
);
3026 static HRESULT WINAPI
HTMLElement2_put_oncontextmenu(IHTMLElement2
*iface
, VARIANT v
)
3028 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3030 TRACE("(%p)->()\n", This
);
3032 return set_node_event(&This
->node
, EVENTID_CONTEXTMENU
, &v
);
3035 static HRESULT WINAPI
HTMLElement2_get_oncontextmenu(IHTMLElement2
*iface
, VARIANT
*p
)
3037 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3039 TRACE("(%p)->(%p)\n", This
, p
);
3041 return get_node_event(&This
->node
, EVENTID_CONTEXTMENU
, p
);
3044 static HRESULT WINAPI
HTMLElement2_insertAdjacentElement(IHTMLElement2
*iface
, BSTR where
,
3045 IHTMLElement
*insertedElement
, IHTMLElement
**inserted
)
3047 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3048 HTMLDOMNode
*ret_node
;
3052 TRACE("(%p)->(%s %p %p)\n", This
, debugstr_w(where
), insertedElement
, inserted
);
3054 elem
= unsafe_impl_from_IHTMLElement(insertedElement
);
3056 return E_INVALIDARG
;
3058 hres
= insert_adjacent_node(This
, where
, elem
->node
.nsnode
, &ret_node
);
3062 hres
= IHTMLDOMNode_QueryInterface(&ret_node
->IHTMLDOMNode_iface
, &IID_IHTMLElement
, (void**)inserted
);
3063 IHTMLDOMNode_Release(&ret_node
->IHTMLDOMNode_iface
);
3067 static HRESULT WINAPI
HTMLElement2_applyElement(IHTMLElement2
*iface
, IHTMLElement
*apply
,
3068 BSTR where
, IHTMLElement
**applied
)
3070 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3071 FIXME("(%p)->(%p %s %p)\n", This
, apply
, debugstr_w(where
), applied
);
3075 static HRESULT WINAPI
HTMLElement2_getAdjacentText(IHTMLElement2
*iface
, BSTR where
, BSTR
*text
)
3077 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3078 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(where
), text
);
3082 static HRESULT WINAPI
HTMLElement2_replaceAdjacentText(IHTMLElement2
*iface
, BSTR where
,
3083 BSTR newText
, BSTR
*oldText
)
3085 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3086 FIXME("(%p)->(%s %s %p)\n", This
, debugstr_w(where
), debugstr_w(newText
), oldText
);
3090 static HRESULT WINAPI
HTMLElement2_get_canHandleChildren(IHTMLElement2
*iface
, VARIANT_BOOL
*p
)
3092 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3093 FIXME("(%p)->(%p)\n", This
, p
);
3097 static HRESULT WINAPI
HTMLElement2_addBehavior(IHTMLElement2
*iface
, BSTR bstrUrl
,
3098 VARIANT
*pvarFactory
, LONG
*pCookie
)
3100 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3101 FIXME("(%p)->(%s %p %p)\n", This
, debugstr_w(bstrUrl
), pvarFactory
, pCookie
);
3105 static HRESULT WINAPI
HTMLElement2_removeBehavior(IHTMLElement2
*iface
, LONG cookie
,
3106 VARIANT_BOOL
*pfResult
)
3108 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3109 FIXME("(%p)->(%d %p)\n", This
, cookie
, pfResult
);
3113 static HRESULT WINAPI
HTMLElement2_get_runtimeStyle(IHTMLElement2
*iface
, IHTMLStyle
**p
)
3115 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3117 FIXME("(%p)->(%p): hack\n", This
, p
);
3119 /* We can't implement correct behavior on top of Gecko (although we could
3120 try a bit harder). Making runtimeStyle behave like regular style is
3121 enough for most use cases. */
3122 if(!This
->runtime_style
) {
3125 hres
= HTMLStyle_Create(This
, &This
->runtime_style
);
3130 *p
= &This
->runtime_style
->IHTMLStyle_iface
;
3131 IHTMLStyle_AddRef(*p
);
3135 static HRESULT WINAPI
HTMLElement2_get_behaviorUrns(IHTMLElement2
*iface
, IDispatch
**p
)
3137 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3138 FIXME("(%p)->(%p)\n", This
, p
);
3142 static HRESULT WINAPI
HTMLElement2_put_tagUrn(IHTMLElement2
*iface
, BSTR v
)
3144 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3145 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
3149 static HRESULT WINAPI
HTMLElement2_get_tagUrn(IHTMLElement2
*iface
, BSTR
*p
)
3151 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3152 FIXME("(%p)->(%p)\n", This
, p
);
3156 static HRESULT WINAPI
HTMLElement2_put_onbeforeeditfocus(IHTMLElement2
*iface
, VARIANT vv
)
3158 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3159 FIXME("(%p)->()\n", This
);
3163 static HRESULT WINAPI
HTMLElement2_get_onbeforeeditfocus(IHTMLElement2
*iface
, VARIANT
*p
)
3165 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3166 FIXME("(%p)->(%p)\n", This
, p
);
3170 static HRESULT WINAPI
HTMLElement2_get_readyStateValue(IHTMLElement2
*iface
, LONG
*p
)
3172 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3173 FIXME("(%p)->(%p)\n", This
, p
);
3177 static HRESULT WINAPI
HTMLElement2_getElementsByTagName(IHTMLElement2
*iface
, BSTR v
,
3178 IHTMLElementCollection
**pelColl
)
3180 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3181 nsIDOMHTMLCollection
*nscol
;
3185 TRACE("(%p)->(%s %p)\n", This
, debugstr_w(v
), pelColl
);
3187 if(!This
->dom_element
) {
3188 *pelColl
= create_collection_from_htmlcol(NULL
, This
->node
.doc
->document_mode
);
3192 nsAString_InitDepend(&tag_str
, v
);
3193 nsres
= nsIDOMElement_GetElementsByTagName(This
->dom_element
, &tag_str
, &nscol
);
3194 nsAString_Finish(&tag_str
);
3195 if(NS_FAILED(nsres
)) {
3196 ERR("GetElementByTagName failed: %08x\n", nsres
);
3200 *pelColl
= create_collection_from_htmlcol(nscol
, dispex_compat_mode(&This
->node
.event_target
.dispex
));
3201 nsIDOMHTMLCollection_Release(nscol
);
3205 static const IHTMLElement2Vtbl HTMLElement2Vtbl
= {
3206 HTMLElement2_QueryInterface
,
3207 HTMLElement2_AddRef
,
3208 HTMLElement2_Release
,
3209 HTMLElement2_GetTypeInfoCount
,
3210 HTMLElement2_GetTypeInfo
,
3211 HTMLElement2_GetIDsOfNames
,
3212 HTMLElement2_Invoke
,
3213 HTMLElement2_get_scopeName
,
3214 HTMLElement2_setCapture
,
3215 HTMLElement2_releaseCapture
,
3216 HTMLElement2_put_onlosecapture
,
3217 HTMLElement2_get_onlosecapture
,
3218 HTMLElement2_componentFromPoint
,
3219 HTMLElement2_doScroll
,
3220 HTMLElement2_put_onscroll
,
3221 HTMLElement2_get_onscroll
,
3222 HTMLElement2_put_ondrag
,
3223 HTMLElement2_get_ondrag
,
3224 HTMLElement2_put_ondragend
,
3225 HTMLElement2_get_ondragend
,
3226 HTMLElement2_put_ondragenter
,
3227 HTMLElement2_get_ondragenter
,
3228 HTMLElement2_put_ondragover
,
3229 HTMLElement2_get_ondragover
,
3230 HTMLElement2_put_ondragleave
,
3231 HTMLElement2_get_ondragleave
,
3232 HTMLElement2_put_ondrop
,
3233 HTMLElement2_get_ondrop
,
3234 HTMLElement2_put_onbeforecut
,
3235 HTMLElement2_get_onbeforecut
,
3236 HTMLElement2_put_oncut
,
3237 HTMLElement2_get_oncut
,
3238 HTMLElement2_put_onbeforecopy
,
3239 HTMLElement2_get_onbeforecopy
,
3240 HTMLElement2_put_oncopy
,
3241 HTMLElement2_get_oncopy
,
3242 HTMLElement2_put_onbeforepaste
,
3243 HTMLElement2_get_onbeforepaste
,
3244 HTMLElement2_put_onpaste
,
3245 HTMLElement2_get_onpaste
,
3246 HTMLElement2_get_currentStyle
,
3247 HTMLElement2_put_onpropertychange
,
3248 HTMLElement2_get_onpropertychange
,
3249 HTMLElement2_getClientRects
,
3250 HTMLElement2_getBoundingClientRect
,
3251 HTMLElement2_setExpression
,
3252 HTMLElement2_getExpression
,
3253 HTMLElement2_removeExpression
,
3254 HTMLElement2_put_tabIndex
,
3255 HTMLElement2_get_tabIndex
,
3257 HTMLElement2_put_accessKey
,
3258 HTMLElement2_get_accessKey
,
3259 HTMLElement2_put_onblur
,
3260 HTMLElement2_get_onblur
,
3261 HTMLElement2_put_onfocus
,
3262 HTMLElement2_get_onfocus
,
3263 HTMLElement2_put_onresize
,
3264 HTMLElement2_get_onresize
,
3266 HTMLElement2_addFilter
,
3267 HTMLElement2_removeFilter
,
3268 HTMLElement2_get_clientHeight
,
3269 HTMLElement2_get_clientWidth
,
3270 HTMLElement2_get_clientTop
,
3271 HTMLElement2_get_clientLeft
,
3272 HTMLElement2_attachEvent
,
3273 HTMLElement2_detachEvent
,
3274 HTMLElement2_get_readyState
,
3275 HTMLElement2_put_onreadystatechange
,
3276 HTMLElement2_get_onreadystatechange
,
3277 HTMLElement2_put_onrowsdelete
,
3278 HTMLElement2_get_onrowsdelete
,
3279 HTMLElement2_put_onrowsinserted
,
3280 HTMLElement2_get_onrowsinserted
,
3281 HTMLElement2_put_oncellchange
,
3282 HTMLElement2_get_oncellchange
,
3283 HTMLElement2_put_dir
,
3284 HTMLElement2_get_dir
,
3285 HTMLElement2_createControlRange
,
3286 HTMLElement2_get_scrollHeight
,
3287 HTMLElement2_get_scrollWidth
,
3288 HTMLElement2_put_scrollTop
,
3289 HTMLElement2_get_scrollTop
,
3290 HTMLElement2_put_scrollLeft
,
3291 HTMLElement2_get_scrollLeft
,
3292 HTMLElement2_clearAttributes
,
3293 HTMLElement2_mergeAttributes
,
3294 HTMLElement2_put_oncontextmenu
,
3295 HTMLElement2_get_oncontextmenu
,
3296 HTMLElement2_insertAdjacentElement
,
3297 HTMLElement2_applyElement
,
3298 HTMLElement2_getAdjacentText
,
3299 HTMLElement2_replaceAdjacentText
,
3300 HTMLElement2_get_canHandleChildren
,
3301 HTMLElement2_addBehavior
,
3302 HTMLElement2_removeBehavior
,
3303 HTMLElement2_get_runtimeStyle
,
3304 HTMLElement2_get_behaviorUrns
,
3305 HTMLElement2_put_tagUrn
,
3306 HTMLElement2_get_tagUrn
,
3307 HTMLElement2_put_onbeforeeditfocus
,
3308 HTMLElement2_get_onbeforeeditfocus
,
3309 HTMLElement2_get_readyStateValue
,
3310 HTMLElement2_getElementsByTagName
,
3313 static inline HTMLElement
*impl_from_IHTMLElement3(IHTMLElement3
*iface
)
3315 return CONTAINING_RECORD(iface
, HTMLElement
, IHTMLElement3_iface
);
3318 static HRESULT WINAPI
HTMLElement3_QueryInterface(IHTMLElement3
*iface
,
3319 REFIID riid
, void **ppv
)
3321 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3322 return IHTMLElement_QueryInterface(&This
->IHTMLElement_iface
, riid
, ppv
);
3325 static ULONG WINAPI
HTMLElement3_AddRef(IHTMLElement3
*iface
)
3327 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3328 return IHTMLElement_AddRef(&This
->IHTMLElement_iface
);
3331 static ULONG WINAPI
HTMLElement3_Release(IHTMLElement3
*iface
)
3333 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3334 return IHTMLElement_Release(&This
->IHTMLElement_iface
);
3337 static HRESULT WINAPI
HTMLElement3_GetTypeInfoCount(IHTMLElement3
*iface
, UINT
*pctinfo
)
3339 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3340 return IDispatchEx_GetTypeInfoCount(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
3343 static HRESULT WINAPI
HTMLElement3_GetTypeInfo(IHTMLElement3
*iface
, UINT iTInfo
,
3344 LCID lcid
, ITypeInfo
**ppTInfo
)
3346 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3347 return IDispatchEx_GetTypeInfo(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
3350 static HRESULT WINAPI
HTMLElement3_GetIDsOfNames(IHTMLElement3
*iface
, REFIID riid
,
3351 LPOLESTR
*rgszNames
, UINT cNames
,
3352 LCID lcid
, DISPID
*rgDispId
)
3354 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3355 return IDispatchEx_GetIDsOfNames(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
3359 static HRESULT WINAPI
HTMLElement3_Invoke(IHTMLElement3
*iface
, DISPID dispIdMember
,
3360 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
3361 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
3363 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3364 return IDispatchEx_Invoke(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
3365 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
3368 static HRESULT WINAPI
HTMLElement3_mergeAttributes(IHTMLElement3
*iface
, IHTMLElement
*mergeThis
, VARIANT
*pvarFlags
)
3370 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3371 FIXME("(%p)->(%p %p)\n", This
, mergeThis
, pvarFlags
);
3375 static HRESULT WINAPI
HTMLElement3_get_isMultiLine(IHTMLElement3
*iface
, VARIANT_BOOL
*p
)
3377 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3378 FIXME("(%p)->(%p)\n", This
, p
);
3382 static HRESULT WINAPI
HTMLElement3_get_canHaveHTML(IHTMLElement3
*iface
, VARIANT_BOOL
*p
)
3384 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3385 FIXME("(%p)->(%p)\n", This
, p
);
3389 static HRESULT WINAPI
HTMLElement3_put_onlayoutcomplete(IHTMLElement3
*iface
, VARIANT v
)
3391 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3392 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3396 static HRESULT WINAPI
HTMLElement3_get_onlayoutcomplete(IHTMLElement3
*iface
, VARIANT
*p
)
3398 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3399 FIXME("(%p)->(%p)\n", This
, p
);
3403 static HRESULT WINAPI
HTMLElement3_put_onpage(IHTMLElement3
*iface
, VARIANT v
)
3405 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3406 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3410 static HRESULT WINAPI
HTMLElement3_get_onpage(IHTMLElement3
*iface
, VARIANT
*p
)
3412 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3413 FIXME("(%p)->(%p)\n", This
, p
);
3417 static HRESULT WINAPI
HTMLElement3_put_inflateBlock(IHTMLElement3
*iface
, VARIANT_BOOL v
)
3419 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3420 FIXME("(%p)->(%x)\n", This
, v
);
3424 static HRESULT WINAPI
HTMLElement3_get_inflateBlock(IHTMLElement3
*iface
, VARIANT_BOOL
*p
)
3426 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3427 FIXME("(%p)->(%p)\n", This
, p
);
3431 static HRESULT WINAPI
HTMLElement3_put_onbeforedeactivate(IHTMLElement3
*iface
, VARIANT v
)
3433 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3434 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3438 static HRESULT WINAPI
HTMLElement3_get_onbeforedeactivate(IHTMLElement3
*iface
, VARIANT
*p
)
3440 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3441 FIXME("(%p)->(%p)\n", This
, p
);
3445 static HRESULT WINAPI
HTMLElement3_setActive(IHTMLElement3
*iface
)
3447 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3448 FIXME("(%p)\n", This
);
3452 static HRESULT WINAPI
HTMLElement3_put_contentEditable(IHTMLElement3
*iface
, BSTR v
)
3454 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3458 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
3460 if(!This
->html_element
) {
3461 FIXME("non-HTML element\n");
3465 nsAString_InitDepend(&str
, v
);
3466 nsres
= nsIDOMHTMLElement_SetContentEditable(This
->html_element
, &str
);
3467 nsAString_Finish(&str
);
3469 if (NS_FAILED(nsres
)){
3470 ERR("SetContentEditable(%s) failed!\n", debugstr_w(v
));
3477 static HRESULT WINAPI
HTMLElement3_get_contentEditable(IHTMLElement3
*iface
, BSTR
*p
)
3479 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3483 TRACE("(%p)->(%p)\n", This
, p
);
3485 if(!This
->html_element
) {
3486 FIXME("non-HTML element\n");
3490 nsAString_Init(&str
, NULL
);
3491 nsres
= nsIDOMHTMLElement_GetContentEditable(This
->html_element
, &str
);
3492 return return_nsstr(nsres
, &str
, p
);
3495 static HRESULT WINAPI
HTMLElement3_get_isContentEditable(IHTMLElement3
*iface
, VARIANT_BOOL
*p
)
3497 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3498 FIXME("(%p)->(%p)\n", This
, p
);
3502 static HRESULT WINAPI
HTMLElement3_put_hideFocus(IHTMLElement3
*iface
, VARIANT_BOOL v
)
3504 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3505 FIXME("(%p)->(%x)\n", This
, v
);
3509 static HRESULT WINAPI
HTMLElement3_get_hideFocus(IHTMLElement3
*iface
, VARIANT_BOOL
*p
)
3511 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3512 FIXME("(%p)->(%p)\n", This
, p
);
3516 static const WCHAR disabledW
[] = {'d','i','s','a','b','l','e','d',0};
3518 static HRESULT WINAPI
HTMLElement3_put_disabled(IHTMLElement3
*iface
, VARIANT_BOOL v
)
3520 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3524 TRACE("(%p)->(%x)\n", This
, v
);
3526 if(This
->node
.vtbl
->put_disabled
)
3527 return This
->node
.vtbl
->put_disabled(&This
->node
, v
);
3529 hres
= dispex_get_dprop_ref(&This
->node
.event_target
.dispex
, disabledW
, TRUE
, &var
);
3534 V_VT(var
) = VT_BOOL
;
3539 static HRESULT WINAPI
HTMLElement3_get_disabled(IHTMLElement3
*iface
, VARIANT_BOOL
*p
)
3541 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3545 TRACE("(%p)->(%p)\n", This
, p
);
3547 if(This
->node
.vtbl
->get_disabled
)
3548 return This
->node
.vtbl
->get_disabled(&This
->node
, p
);
3550 hres
= dispex_get_dprop_ref(&This
->node
.event_target
.dispex
, disabledW
, FALSE
, &var
);
3551 if(hres
== DISP_E_UNKNOWNNAME
) {
3558 if(V_VT(var
) != VT_BOOL
) {
3559 FIXME("value is %s\n", debugstr_variant(var
));
3567 static HRESULT WINAPI
HTMLElement3_get_isDisabled(IHTMLElement3
*iface
, VARIANT_BOOL
*p
)
3569 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3570 FIXME("(%p)->(%p)\n", This
, p
);
3574 static HRESULT WINAPI
HTMLElement3_put_onmove(IHTMLElement3
*iface
, VARIANT v
)
3576 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3577 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3581 static HRESULT WINAPI
HTMLElement3_get_onmove(IHTMLElement3
*iface
, VARIANT
*p
)
3583 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3584 FIXME("(%p)->(%p)\n", This
, p
);
3588 static HRESULT WINAPI
HTMLElement3_put_oncontrolselect(IHTMLElement3
*iface
, VARIANT v
)
3590 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3591 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3595 static HRESULT WINAPI
HTMLElement3_get_oncontrolselect(IHTMLElement3
*iface
, VARIANT
*p
)
3597 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3598 FIXME("(%p)->(%p)\n", This
, p
);
3602 static HRESULT WINAPI
HTMLElement3_fireEvent(IHTMLElement3
*iface
, BSTR bstrEventName
,
3603 VARIANT
*pvarEventObject
, VARIANT_BOOL
*pfCancelled
)
3605 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3607 TRACE("(%p)->(%s %s %p)\n", This
, debugstr_w(bstrEventName
), debugstr_variant(pvarEventObject
),
3610 return fire_event(&This
->node
, bstrEventName
, pvarEventObject
, pfCancelled
);
3613 static HRESULT WINAPI
HTMLElement3_put_onresizestart(IHTMLElement3
*iface
, VARIANT v
)
3615 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3616 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3620 static HRESULT WINAPI
HTMLElement3_get_onresizestart(IHTMLElement3
*iface
, VARIANT
*p
)
3622 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3623 FIXME("(%p)->(%p)\n", This
, p
);
3627 static HRESULT WINAPI
HTMLElement3_put_onresizeend(IHTMLElement3
*iface
, VARIANT v
)
3629 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3630 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3634 static HRESULT WINAPI
HTMLElement3_get_onresizeend(IHTMLElement3
*iface
, VARIANT
*p
)
3636 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3637 FIXME("(%p)->(%p)\n", This
, p
);
3641 static HRESULT WINAPI
HTMLElement3_put_onmovestart(IHTMLElement3
*iface
, VARIANT v
)
3643 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3644 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3648 static HRESULT WINAPI
HTMLElement3_get_onmovestart(IHTMLElement3
*iface
, VARIANT
*p
)
3650 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3651 FIXME("(%p)->(%p)\n", This
, p
);
3655 static HRESULT WINAPI
HTMLElement3_put_onmoveend(IHTMLElement3
*iface
, VARIANT v
)
3657 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3658 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3662 static HRESULT WINAPI
HTMLElement3_get_onmoveend(IHTMLElement3
*iface
, VARIANT
*p
)
3664 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3665 FIXME("(%p)->(%p)\n", This
, p
);
3669 static HRESULT WINAPI
HTMLElement3_put_onmousecenter(IHTMLElement3
*iface
, VARIANT v
)
3671 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3672 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3676 static HRESULT WINAPI
HTMLElement3_get_onmousecenter(IHTMLElement3
*iface
, VARIANT
*p
)
3678 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3679 FIXME("(%p)->(%p)\n", This
, p
);
3683 static HRESULT WINAPI
HTMLElement3_put_onmouseleave(IHTMLElement3
*iface
, VARIANT v
)
3685 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3686 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3690 static HRESULT WINAPI
HTMLElement3_get_onmouseleave(IHTMLElement3
*iface
, VARIANT
*p
)
3692 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3693 FIXME("(%p)->(%p)\n", This
, p
);
3697 static HRESULT WINAPI
HTMLElement3_put_onactivate(IHTMLElement3
*iface
, VARIANT v
)
3699 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3700 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3704 static HRESULT WINAPI
HTMLElement3_get_onactivate(IHTMLElement3
*iface
, VARIANT
*p
)
3706 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3707 FIXME("(%p)->(%p)\n", This
, p
);
3711 static HRESULT WINAPI
HTMLElement3_put_ondeactivate(IHTMLElement3
*iface
, VARIANT v
)
3713 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3714 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3718 static HRESULT WINAPI
HTMLElement3_get_ondeactivate(IHTMLElement3
*iface
, VARIANT
*p
)
3720 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3721 FIXME("(%p)->(%p)\n", This
, p
);
3725 static HRESULT WINAPI
HTMLElement3_dragDrop(IHTMLElement3
*iface
, VARIANT_BOOL
*pfRet
)
3727 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3728 FIXME("(%p)->(%p)\n", This
, pfRet
);
3732 static HRESULT WINAPI
HTMLElement3_get_glyphMode(IHTMLElement3
*iface
, LONG
*p
)
3734 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
3735 FIXME("(%p)->(%p)\n", This
, p
);
3739 static const IHTMLElement3Vtbl HTMLElement3Vtbl
= {
3740 HTMLElement3_QueryInterface
,
3741 HTMLElement3_AddRef
,
3742 HTMLElement3_Release
,
3743 HTMLElement3_GetTypeInfoCount
,
3744 HTMLElement3_GetTypeInfo
,
3745 HTMLElement3_GetIDsOfNames
,
3746 HTMLElement3_Invoke
,
3747 HTMLElement3_mergeAttributes
,
3748 HTMLElement3_get_isMultiLine
,
3749 HTMLElement3_get_canHaveHTML
,
3750 HTMLElement3_put_onlayoutcomplete
,
3751 HTMLElement3_get_onlayoutcomplete
,
3752 HTMLElement3_put_onpage
,
3753 HTMLElement3_get_onpage
,
3754 HTMLElement3_put_inflateBlock
,
3755 HTMLElement3_get_inflateBlock
,
3756 HTMLElement3_put_onbeforedeactivate
,
3757 HTMLElement3_get_onbeforedeactivate
,
3758 HTMLElement3_setActive
,
3759 HTMLElement3_put_contentEditable
,
3760 HTMLElement3_get_contentEditable
,
3761 HTMLElement3_get_isContentEditable
,
3762 HTMLElement3_put_hideFocus
,
3763 HTMLElement3_get_hideFocus
,
3764 HTMLElement3_put_disabled
,
3765 HTMLElement3_get_disabled
,
3766 HTMLElement3_get_isDisabled
,
3767 HTMLElement3_put_onmove
,
3768 HTMLElement3_get_onmove
,
3769 HTMLElement3_put_oncontrolselect
,
3770 HTMLElement3_get_oncontrolselect
,
3771 HTMLElement3_fireEvent
,
3772 HTMLElement3_put_onresizestart
,
3773 HTMLElement3_get_onresizestart
,
3774 HTMLElement3_put_onresizeend
,
3775 HTMLElement3_get_onresizeend
,
3776 HTMLElement3_put_onmovestart
,
3777 HTMLElement3_get_onmovestart
,
3778 HTMLElement3_put_onmoveend
,
3779 HTMLElement3_get_onmoveend
,
3780 HTMLElement3_put_onmousecenter
,
3781 HTMLElement3_get_onmousecenter
,
3782 HTMLElement3_put_onmouseleave
,
3783 HTMLElement3_get_onmouseleave
,
3784 HTMLElement3_put_onactivate
,
3785 HTMLElement3_get_onactivate
,
3786 HTMLElement3_put_ondeactivate
,
3787 HTMLElement3_get_ondeactivate
,
3788 HTMLElement3_dragDrop
,
3789 HTMLElement3_get_glyphMode
3792 static inline HTMLElement
*impl_from_IHTMLElement4(IHTMLElement4
*iface
)
3794 return CONTAINING_RECORD(iface
, HTMLElement
, IHTMLElement4_iface
);
3797 static HRESULT WINAPI
HTMLElement4_QueryInterface(IHTMLElement4
*iface
,
3798 REFIID riid
, void **ppv
)
3800 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3801 return IHTMLElement_QueryInterface(&This
->IHTMLElement_iface
, riid
, ppv
);
3804 static ULONG WINAPI
HTMLElement4_AddRef(IHTMLElement4
*iface
)
3806 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3807 return IHTMLElement_AddRef(&This
->IHTMLElement_iface
);
3810 static ULONG WINAPI
HTMLElement4_Release(IHTMLElement4
*iface
)
3812 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3813 return IHTMLElement_Release(&This
->IHTMLElement_iface
);
3816 static HRESULT WINAPI
HTMLElement4_GetTypeInfoCount(IHTMLElement4
*iface
, UINT
*pctinfo
)
3818 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3819 return IDispatchEx_GetTypeInfoCount(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
3822 static HRESULT WINAPI
HTMLElement4_GetTypeInfo(IHTMLElement4
*iface
, UINT iTInfo
,
3823 LCID lcid
, ITypeInfo
**ppTInfo
)
3825 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3826 return IDispatchEx_GetTypeInfo(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
3829 static HRESULT WINAPI
HTMLElement4_GetIDsOfNames(IHTMLElement4
*iface
, REFIID riid
,
3830 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
3832 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3833 return IDispatchEx_GetIDsOfNames(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
3837 static HRESULT WINAPI
HTMLElement4_Invoke(IHTMLElement4
*iface
, DISPID dispIdMember
, REFIID riid
,
3838 LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
3840 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3841 return IDispatchEx_Invoke(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
3842 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
3845 static HRESULT WINAPI
HTMLElement4_put_onmousewheel(IHTMLElement4
*iface
, VARIANT v
)
3847 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3849 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3851 return set_node_event(&This
->node
, EVENTID_MOUSEWHEEL
, &v
);
3854 static HRESULT WINAPI
HTMLElement4_get_onmousewheel(IHTMLElement4
*iface
, VARIANT
*p
)
3856 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3858 TRACE("(%p)->(%p)\n", This
, p
);
3860 return get_node_event(&This
->node
, EVENTID_MOUSEWHEEL
, p
);
3863 static HRESULT WINAPI
HTMLElement4_normalize(IHTMLElement4
*iface
)
3865 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3866 FIXME("(%p)\n", This
);
3870 static HRESULT WINAPI
HTMLElement4_getAttributeNode(IHTMLElement4
*iface
, BSTR bstrname
, IHTMLDOMAttribute
**ppAttribute
)
3872 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3873 HTMLAttributeCollection
*attrs
;
3876 TRACE("(%p)->(%s %p)\n", This
, debugstr_w(bstrname
), ppAttribute
);
3878 hres
= HTMLElement_get_attr_col(&This
->node
, &attrs
);
3882 hres
= IHTMLAttributeCollection2_getNamedItem(&attrs
->IHTMLAttributeCollection2_iface
, bstrname
, ppAttribute
);
3883 IHTMLAttributeCollection_Release(&attrs
->IHTMLAttributeCollection_iface
);
3887 static HRESULT WINAPI
HTMLElement4_setAttributeNode(IHTMLElement4
*iface
, IHTMLDOMAttribute
*pattr
,
3888 IHTMLDOMAttribute
**ppretAttribute
)
3890 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3891 HTMLDOMAttribute
*attr
, *iter
, *replace
= NULL
;
3892 HTMLAttributeCollection
*attrs
;
3896 TRACE("(%p)->(%p %p)\n", This
, pattr
, ppretAttribute
);
3898 attr
= unsafe_impl_from_IHTMLDOMAttribute(pattr
);
3900 return E_INVALIDARG
;
3903 WARN("Tried to set already attached attribute.\n");
3904 return E_INVALIDARG
;
3907 hres
= IDispatchEx_GetDispID(&This
->node
.event_target
.dispex
.IDispatchEx_iface
,
3908 attr
->name
, fdexNameCaseInsensitive
|fdexNameEnsure
, &dispid
);
3912 hres
= HTMLElement_get_attr_col(&This
->node
, &attrs
);
3916 LIST_FOR_EACH_ENTRY(iter
, &attrs
->attrs
, HTMLDOMAttribute
, entry
) {
3917 if(iter
->dispid
== dispid
) {
3924 hres
= get_elem_attr_value_by_dispid(This
, dispid
, &replace
->value
);
3926 WARN("could not get attr value: %08x\n", hres
);
3927 V_VT(&replace
->value
) = VT_EMPTY
;
3929 if(!replace
->name
) {
3930 replace
->name
= attr
->name
;
3933 list_add_head(&replace
->entry
, &attr
->entry
);
3934 list_remove(&replace
->entry
);
3935 replace
->elem
= NULL
;
3937 list_add_tail(&attrs
->attrs
, &attr
->entry
);
3940 IHTMLDOMAttribute_AddRef(&attr
->IHTMLDOMAttribute_iface
);
3942 attr
->dispid
= dispid
;
3944 IHTMLAttributeCollection_Release(&attrs
->IHTMLAttributeCollection_iface
);
3946 hres
= set_elem_attr_value_by_dispid(This
, dispid
, &attr
->value
);
3948 WARN("Could not set attribute value: %08x\n", hres
);
3949 VariantClear(&attr
->value
);
3951 *ppretAttribute
= replace
? &replace
->IHTMLDOMAttribute_iface
: NULL
;
3955 static HRESULT WINAPI
HTMLElement4_removeAttributeNode(IHTMLElement4
*iface
, IHTMLDOMAttribute
*pattr
,
3956 IHTMLDOMAttribute
**ppretAttribute
)
3958 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3959 FIXME("(%p)->(%p %p)\n", This
, pattr
, ppretAttribute
);
3963 static HRESULT WINAPI
HTMLElement4_put_onbeforeactivate(IHTMLElement4
*iface
, VARIANT v
)
3965 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3967 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3969 return set_node_event(&This
->node
, EVENTID_BEFOREACTIVATE
, &v
);
3972 static HRESULT WINAPI
HTMLElement4_get_onbeforeactivate(IHTMLElement4
*iface
, VARIANT
*p
)
3974 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3976 TRACE("(%p)->(%p)\n", This
, p
);
3978 return get_node_event(&This
->node
, EVENTID_BEFOREACTIVATE
, p
);
3981 static HRESULT WINAPI
HTMLElement4_put_onfocusin(IHTMLElement4
*iface
, VARIANT v
)
3983 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3985 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3987 return set_node_event(&This
->node
, EVENTID_FOCUSIN
, &v
);
3990 static HRESULT WINAPI
HTMLElement4_get_onfocusin(IHTMLElement4
*iface
, VARIANT
*p
)
3992 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
3994 TRACE("(%p)->(%p)\n", This
, p
);
3996 return get_node_event(&This
->node
, EVENTID_FOCUSIN
, p
);
3999 static HRESULT WINAPI
HTMLElement4_put_onfocusout(IHTMLElement4
*iface
, VARIANT v
)
4001 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
4003 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4005 return set_node_event(&This
->node
, EVENTID_FOCUSOUT
, &v
);
4008 static HRESULT WINAPI
HTMLElement4_get_onfocusout(IHTMLElement4
*iface
, VARIANT
*p
)
4010 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
4012 TRACE("(%p)->(%p)\n", This
, p
);
4014 return get_node_event(&This
->node
, EVENTID_FOCUSOUT
, p
);
4017 static const IHTMLElement4Vtbl HTMLElement4Vtbl
= {
4018 HTMLElement4_QueryInterface
,
4019 HTMLElement4_AddRef
,
4020 HTMLElement4_Release
,
4021 HTMLElement4_GetTypeInfoCount
,
4022 HTMLElement4_GetTypeInfo
,
4023 HTMLElement4_GetIDsOfNames
,
4024 HTMLElement4_Invoke
,
4025 HTMLElement4_put_onmousewheel
,
4026 HTMLElement4_get_onmousewheel
,
4027 HTMLElement4_normalize
,
4028 HTMLElement4_getAttributeNode
,
4029 HTMLElement4_setAttributeNode
,
4030 HTMLElement4_removeAttributeNode
,
4031 HTMLElement4_put_onbeforeactivate
,
4032 HTMLElement4_get_onbeforeactivate
,
4033 HTMLElement4_put_onfocusin
,
4034 HTMLElement4_get_onfocusin
,
4035 HTMLElement4_put_onfocusout
,
4036 HTMLElement4_get_onfocusout
4039 static inline HTMLElement
*impl_from_IHTMLElement6(IHTMLElement6
*iface
)
4041 return CONTAINING_RECORD(iface
, HTMLElement
, IHTMLElement6_iface
);
4044 static HRESULT WINAPI
HTMLElement6_QueryInterface(IHTMLElement6
*iface
,
4045 REFIID riid
, void **ppv
)
4047 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4048 return IHTMLElement_QueryInterface(&This
->IHTMLElement_iface
, riid
, ppv
);
4051 static ULONG WINAPI
HTMLElement6_AddRef(IHTMLElement6
*iface
)
4053 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4054 return IHTMLElement_AddRef(&This
->IHTMLElement_iface
);
4057 static ULONG WINAPI
HTMLElement6_Release(IHTMLElement6
*iface
)
4059 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4060 return IHTMLElement_Release(&This
->IHTMLElement_iface
);
4063 static HRESULT WINAPI
HTMLElement6_GetTypeInfoCount(IHTMLElement6
*iface
, UINT
*pctinfo
)
4065 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4066 return IDispatchEx_GetTypeInfoCount(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
4069 static HRESULT WINAPI
HTMLElement6_GetTypeInfo(IHTMLElement6
*iface
, UINT iTInfo
,
4070 LCID lcid
, ITypeInfo
**ppTInfo
)
4072 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4073 return IDispatchEx_GetTypeInfo(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
4076 static HRESULT WINAPI
HTMLElement6_GetIDsOfNames(IHTMLElement6
*iface
, REFIID riid
,
4077 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
4079 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4080 return IDispatchEx_GetIDsOfNames(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
4084 static HRESULT WINAPI
HTMLElement6_Invoke(IHTMLElement6
*iface
, DISPID dispIdMember
, REFIID riid
,
4085 LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
4087 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4088 return IDispatchEx_Invoke(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
4089 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
4092 static HRESULT WINAPI
HTMLElement6_getAttributeNS(IHTMLElement6
*iface
, VARIANT
*pvarNS
, BSTR strAttributeName
, VARIANT
*AttributeValue
)
4094 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4095 FIXME("(%p)->(%s %s %p)\n", This
, debugstr_variant(pvarNS
), debugstr_w(strAttributeName
), AttributeValue
);
4099 static HRESULT WINAPI
HTMLElement6_setAttributeNS(IHTMLElement6
*iface
, VARIANT
*pvarNS
, BSTR strAttributeName
, VARIANT
*pvarAttributeValue
)
4101 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4102 FIXME("(%p)->(%s %s %s)\n", This
, debugstr_variant(pvarNS
), debugstr_w(strAttributeName
), debugstr_variant(pvarAttributeValue
));
4106 static HRESULT WINAPI
HTMLElement6_removeAttributeNS(IHTMLElement6
*iface
, VARIANT
*pvarNS
, BSTR strAttributeName
)
4108 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4109 FIXME("(%p)->(%s %s)\n", This
, debugstr_variant(pvarNS
), debugstr_w(strAttributeName
));
4113 static HRESULT WINAPI
HTMLElement6_getAttributeNodeNS(IHTMLElement6
*iface
, VARIANT
*pvarNS
, BSTR name
, IHTMLDOMAttribute2
**ppretAttribute
)
4115 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4116 FIXME("(%p)->(%s %s %p)\n", This
, debugstr_variant(pvarNS
), debugstr_w(name
), ppretAttribute
);
4120 static HRESULT WINAPI
HTMLElement6_setAttributeNodeNS(IHTMLElement6
*iface
, IHTMLDOMAttribute2
*pattr
, IHTMLDOMAttribute2
**ppretAttribute
)
4122 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4123 FIXME("(%p)->(%p %p)\n", This
, pattr
, ppretAttribute
);
4127 static HRESULT WINAPI
HTMLElement6_hasAttributeNS(IHTMLElement6
*iface
, VARIANT
*pvarNS
, BSTR name
, VARIANT_BOOL
*pfHasAttribute
)
4129 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4130 FIXME("(%p)->(%s %s %p)\n", This
, debugstr_variant(pvarNS
), debugstr_w(name
), pfHasAttribute
);
4134 static HRESULT WINAPI
HTMLElement6_getAttribute(IHTMLElement6
*iface
, BSTR strAttributeName
, VARIANT
*AttributeValue
)
4136 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4138 WARN("(%p)->(%s %p) forwarding to IHTMLElement\n", This
, debugstr_w(strAttributeName
), AttributeValue
);
4140 return IHTMLElement_getAttribute(&This
->IHTMLElement_iface
, strAttributeName
, 0, AttributeValue
);
4143 static HRESULT WINAPI
HTMLElement6_setAttribute(IHTMLElement6
*iface
, BSTR strAttributeName
, VARIANT
*pvarAttributeValue
)
4145 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4147 WARN("(%p)->(%s %p) forwarding to IHTMLElement\n", This
, debugstr_w(strAttributeName
), pvarAttributeValue
);
4149 return IHTMLElement_setAttribute(&This
->IHTMLElement_iface
, strAttributeName
, *pvarAttributeValue
, 0);
4152 static HRESULT WINAPI
HTMLElement6_removeAttribute(IHTMLElement6
*iface
, BSTR strAttributeName
)
4154 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4155 VARIANT_BOOL success
;
4157 WARN("(%p)->(%s) forwarding to IHTMLElement\n", This
, debugstr_w(strAttributeName
));
4159 return IHTMLElement_removeAttribute(&This
->IHTMLElement_iface
, strAttributeName
, 0, &success
);
4162 static HRESULT WINAPI
HTMLElement6_getAttributeNode(IHTMLElement6
*iface
, BSTR strAttributeName
, IHTMLDOMAttribute2
**ppretAttribute
)
4164 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4165 IHTMLDOMAttribute
*attr
;
4168 WARN("(%p)->(%s %p) forwarding to IHTMLElement4\n", This
, debugstr_w(strAttributeName
), ppretAttribute
);
4170 hres
= IHTMLElement4_getAttributeNode(&This
->IHTMLElement4_iface
, strAttributeName
, &attr
);
4175 hres
= IHTMLDOMAttribute_QueryInterface(attr
, &IID_IHTMLDOMAttribute2
, (void**)ppretAttribute
);
4176 IHTMLDOMAttribute_Release(attr
);
4178 *ppretAttribute
= NULL
;
4183 static HRESULT WINAPI
HTMLElement6_setAttributeNode(IHTMLElement6
*iface
, IHTMLDOMAttribute2
*pattr
, IHTMLDOMAttribute2
**ppretAttribute
)
4185 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4186 IHTMLDOMAttribute
*attr
, *ret_attr
;
4189 WARN("(%p)->(%p %p) forwarding to IHTMLElement4\n", This
, pattr
, ppretAttribute
);
4191 hres
= IHTMLDOMAttribute2_QueryInterface(pattr
, &IID_IHTMLDOMAttribute
, (void**)&attr
);
4195 hres
= IHTMLElement4_setAttributeNode(&This
->IHTMLElement4_iface
, attr
, &ret_attr
);
4200 hres
= IHTMLDOMAttribute_QueryInterface(ret_attr
, &IID_IHTMLDOMAttribute2
, (void**)ppretAttribute
);
4201 IHTMLDOMAttribute_Release(ret_attr
);
4203 *ppretAttribute
= NULL
;
4208 static HRESULT WINAPI
HTMLElement6_removeAttributeNode(IHTMLElement6
*iface
, IHTMLDOMAttribute2
*pattr
, IHTMLDOMAttribute2
**ppretAttribute
)
4210 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4211 FIXME("(%p)->()\n", This
);
4215 static HRESULT WINAPI
HTMLElement6_hasAttribute(IHTMLElement6
*iface
, BSTR name
, VARIANT_BOOL
*pfHasAttribute
)
4217 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4218 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(name
), pfHasAttribute
);
4222 static HRESULT WINAPI
HTMLElement6_getElementsByTagNameNS(IHTMLElement6
*iface
, VARIANT
*varNS
, BSTR bstrLocalName
, IHTMLElementCollection
**pelColl
)
4224 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4225 FIXME("(%p)->(%s %s %p)\n", This
, debugstr_variant(varNS
), debugstr_w(bstrLocalName
), pelColl
);
4229 static HRESULT WINAPI
HTMLElement6_get_tagName(IHTMLElement6
*iface
, BSTR
*p
)
4231 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4233 TRACE("(%p)->(%p)\n", This
, p
);
4235 return IHTMLElement_get_tagName(&This
->IHTMLElement_iface
, p
);
4238 static HRESULT WINAPI
HTMLElement6_get_nodeName(IHTMLElement6
*iface
, BSTR
*p
)
4240 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4242 TRACE("(%p)->(%p)\n", This
, p
);
4244 return IHTMLDOMNode_get_nodeName(&This
->node
.IHTMLDOMNode_iface
, p
);
4247 static HRESULT WINAPI
HTMLElement6_getElementsByClassName(IHTMLElement6
*iface
, BSTR v
, IHTMLElementCollection
**pel
)
4249 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4250 nsIDOMHTMLCollection
*nscol
= NULL
;
4254 TRACE("(%p)->(%s %p)\n", This
, debugstr_w(v
), pel
);
4256 if(This
->dom_element
) {
4257 nsAString_InitDepend(&nsstr
, v
);
4258 nsres
= nsIDOMElement_GetElementsByClassName(This
->dom_element
, &nsstr
, &nscol
);
4259 nsAString_Finish(&nsstr
);
4260 if(NS_FAILED(nsres
)) {
4261 ERR("GetElementsByClassName failed: %08x\n", nsres
);
4266 *pel
= create_collection_from_htmlcol(nscol
, dispex_compat_mode(&This
->node
.event_target
.dispex
));
4267 nsIDOMHTMLCollection_Release(nscol
);
4271 static HRESULT WINAPI
HTMLElement6_msMatchesSelector(IHTMLElement6
*iface
, BSTR v
, VARIANT_BOOL
*pfMatches
)
4273 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4274 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(v
), pfMatches
);
4278 static HRESULT WINAPI
HTMLElement6_put_onabort(IHTMLElement6
*iface
, VARIANT v
)
4280 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4282 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4284 return set_node_event(&This
->node
, EVENTID_ABORT
, &v
);
4287 static HRESULT WINAPI
HTMLElement6_get_onabort(IHTMLElement6
*iface
, VARIANT
*p
)
4289 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4291 TRACE("(%p)->(%p)\n", This
, p
);
4293 return get_node_event(&This
->node
, EVENTID_ABORT
, p
);
4296 static HRESULT WINAPI
HTMLElement6_put_oncanplay(IHTMLElement6
*iface
, VARIANT v
)
4298 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4299 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4303 static HRESULT WINAPI
HTMLElement6_get_oncanplay(IHTMLElement6
*iface
, VARIANT
*p
)
4305 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4306 FIXME("(%p)->(%p)\n", This
, p
);
4310 static HRESULT WINAPI
HTMLElement6_put_oncanplaythrough(IHTMLElement6
*iface
, VARIANT v
)
4312 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4313 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4317 static HRESULT WINAPI
HTMLElement6_get_oncanplaythrough(IHTMLElement6
*iface
, VARIANT
*p
)
4319 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4320 FIXME("(%p)->(%p)\n", This
, p
);
4324 static HRESULT WINAPI
HTMLElement6_put_onchange(IHTMLElement6
*iface
, VARIANT v
)
4326 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4328 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4330 return set_node_event(&This
->node
, EVENTID_CHANGE
, &v
);
4333 static HRESULT WINAPI
HTMLElement6_get_onchange(IHTMLElement6
*iface
, VARIANT
*p
)
4335 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4337 TRACE("(%p)->(%p)\n", This
, p
);
4339 return get_node_event(&This
->node
, EVENTID_CHANGE
, p
);
4342 static HRESULT WINAPI
HTMLElement6_put_ondurationchange(IHTMLElement6
*iface
, VARIANT v
)
4344 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4345 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4349 static HRESULT WINAPI
HTMLElement6_get_ondurationchange(IHTMLElement6
*iface
, VARIANT
*p
)
4351 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4352 FIXME("(%p)->(%p)\n", This
, p
);
4356 static HRESULT WINAPI
HTMLElement6_put_onemptied(IHTMLElement6
*iface
, VARIANT v
)
4358 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4359 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4363 static HRESULT WINAPI
HTMLElement6_get_onemptied(IHTMLElement6
*iface
, VARIANT
*p
)
4365 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4366 FIXME("(%p)->(%p)\n", This
, p
);
4370 static HRESULT WINAPI
HTMLElement6_put_onended(IHTMLElement6
*iface
, VARIANT v
)
4372 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4373 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4377 static HRESULT WINAPI
HTMLElement6_get_onended(IHTMLElement6
*iface
, VARIANT
*p
)
4379 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4380 FIXME("(%p)->(%p)\n", This
, p
);
4384 static HRESULT WINAPI
HTMLElement6_put_onerror(IHTMLElement6
*iface
, VARIANT v
)
4386 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4388 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4390 return set_node_event(&This
->node
, EVENTID_ERROR
, &v
);
4393 static HRESULT WINAPI
HTMLElement6_get_onerror(IHTMLElement6
*iface
, VARIANT
*p
)
4395 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4397 TRACE("(%p)->(%p)\n", This
, p
);
4399 return get_node_event(&This
->node
, EVENTID_ERROR
, p
);
4402 static HRESULT WINAPI
HTMLElement6_put_oninput(IHTMLElement6
*iface
, VARIANT v
)
4404 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4405 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4409 static HRESULT WINAPI
HTMLElement6_get_oninput(IHTMLElement6
*iface
, VARIANT
*p
)
4411 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4412 FIXME("(%p)->(%p)\n", This
, p
);
4416 static HRESULT WINAPI
HTMLElement6_put_onload(IHTMLElement6
*iface
, VARIANT v
)
4418 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4420 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4422 return set_node_event(&This
->node
, EVENTID_LOAD
, &v
);
4425 static HRESULT WINAPI
HTMLElement6_get_onload(IHTMLElement6
*iface
, VARIANT
*p
)
4427 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4429 TRACE("(%p)->(%p)\n", This
, p
);
4431 return get_node_event(&This
->node
, EVENTID_LOAD
, p
);
4434 static HRESULT WINAPI
HTMLElement6_put_onloadeddata(IHTMLElement6
*iface
, VARIANT v
)
4436 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4437 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4441 static HRESULT WINAPI
HTMLElement6_get_onloadeddata(IHTMLElement6
*iface
, VARIANT
*p
)
4443 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4444 FIXME("(%p)->(%p)\n", This
, p
);
4448 static HRESULT WINAPI
HTMLElement6_put_onloadedmetadata(IHTMLElement6
*iface
, VARIANT v
)
4450 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4451 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4455 static HRESULT WINAPI
HTMLElement6_get_onloadedmetadata(IHTMLElement6
*iface
, VARIANT
*p
)
4457 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4458 FIXME("(%p)->(%p)\n", This
, p
);
4462 static HRESULT WINAPI
HTMLElement6_put_onloadstart(IHTMLElement6
*iface
, VARIANT v
)
4464 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4465 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4469 static HRESULT WINAPI
HTMLElement6_get_onloadstart(IHTMLElement6
*iface
, VARIANT
*p
)
4471 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4472 FIXME("(%p)->(%p)\n", This
, p
);
4476 static HRESULT WINAPI
HTMLElement6_put_onpause(IHTMLElement6
*iface
, VARIANT v
)
4478 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4479 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4483 static HRESULT WINAPI
HTMLElement6_get_onpause(IHTMLElement6
*iface
, VARIANT
*p
)
4485 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4486 FIXME("(%p)->(%p)\n", This
, p
);
4490 static HRESULT WINAPI
HTMLElement6_put_onplay(IHTMLElement6
*iface
, VARIANT v
)
4492 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4493 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4497 static HRESULT WINAPI
HTMLElement6_get_onplay(IHTMLElement6
*iface
, VARIANT
*p
)
4499 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4500 FIXME("(%p)->(%p)\n", This
, p
);
4504 static HRESULT WINAPI
HTMLElement6_put_onplaying(IHTMLElement6
*iface
, VARIANT v
)
4506 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4507 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4511 static HRESULT WINAPI
HTMLElement6_get_onplaying(IHTMLElement6
*iface
, VARIANT
*p
)
4513 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4514 FIXME("(%p)->(%p)\n", This
, p
);
4518 static HRESULT WINAPI
HTMLElement6_put_onprogress(IHTMLElement6
*iface
, VARIANT v
)
4520 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4521 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4525 static HRESULT WINAPI
HTMLElement6_get_onprogress(IHTMLElement6
*iface
, VARIANT
*p
)
4527 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4528 FIXME("(%p)->(%p)\n", This
, p
);
4532 static HRESULT WINAPI
HTMLElement6_put_onratechange(IHTMLElement6
*iface
, VARIANT v
)
4534 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4535 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4539 static HRESULT WINAPI
HTMLElement6_get_onratechange(IHTMLElement6
*iface
, VARIANT
*p
)
4541 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4542 FIXME("(%p)->(%p)\n", This
, p
);
4546 static HRESULT WINAPI
HTMLElement6_put_onreset(IHTMLElement6
*iface
, VARIANT v
)
4548 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4549 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4553 static HRESULT WINAPI
HTMLElement6_get_onreset(IHTMLElement6
*iface
, VARIANT
*p
)
4555 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4556 FIXME("(%p)->(%p)\n", This
, p
);
4560 static HRESULT WINAPI
HTMLElement6_put_onseeked(IHTMLElement6
*iface
, VARIANT v
)
4562 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4563 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4567 static HRESULT WINAPI
HTMLElement6_get_onseeked(IHTMLElement6
*iface
, VARIANT
*p
)
4569 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4570 FIXME("(%p)->(%p)\n", This
, p
);
4574 static HRESULT WINAPI
HTMLElement6_put_onseeking(IHTMLElement6
*iface
, VARIANT v
)
4576 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4577 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4581 static HRESULT WINAPI
HTMLElement6_get_onseeking(IHTMLElement6
*iface
, VARIANT
*p
)
4583 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4584 FIXME("(%p)->(%p)\n", This
, p
);
4588 static HRESULT WINAPI
HTMLElement6_put_onselect(IHTMLElement6
*iface
, VARIANT v
)
4590 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4591 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4595 static HRESULT WINAPI
HTMLElement6_get_onselect(IHTMLElement6
*iface
, VARIANT
*p
)
4597 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4598 FIXME("(%p)->(%p)\n", This
, p
);
4602 static HRESULT WINAPI
HTMLElement6_put_onstalled(IHTMLElement6
*iface
, VARIANT v
)
4604 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4605 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4609 static HRESULT WINAPI
HTMLElement6_get_onstalled(IHTMLElement6
*iface
, VARIANT
*p
)
4611 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4612 FIXME("(%p)->(%p)\n", This
, p
);
4616 static HRESULT WINAPI
HTMLElement6_put_onsubmit(IHTMLElement6
*iface
, VARIANT v
)
4618 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4620 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4622 return set_node_event(&This
->node
, EVENTID_SUBMIT
, &v
);
4625 static HRESULT WINAPI
HTMLElement6_get_onsubmit(IHTMLElement6
*iface
, VARIANT
*p
)
4627 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4629 TRACE("(%p)->(%p)\n", This
, p
);
4631 return get_node_event(&This
->node
, EVENTID_SUBMIT
, p
);
4634 static HRESULT WINAPI
HTMLElement6_put_onsuspend(IHTMLElement6
*iface
, VARIANT v
)
4636 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4637 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4641 static HRESULT WINAPI
HTMLElement6_get_onsuspend(IHTMLElement6
*iface
, VARIANT
*p
)
4643 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4644 FIXME("(%p)->(%p)\n", This
, p
);
4648 static HRESULT WINAPI
HTMLElement6_put_ontimeupdate(IHTMLElement6
*iface
, VARIANT v
)
4650 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4651 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4655 static HRESULT WINAPI
HTMLElement6_get_ontimeupdate(IHTMLElement6
*iface
, VARIANT
*p
)
4657 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4658 FIXME("(%p)->(%p)\n", This
, p
);
4662 static HRESULT WINAPI
HTMLElement6_put_onvolumechange(IHTMLElement6
*iface
, VARIANT v
)
4664 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4665 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4669 static HRESULT WINAPI
HTMLElement6_get_onvolumechange(IHTMLElement6
*iface
, VARIANT
*p
)
4671 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4672 FIXME("(%p)->(%p)\n", This
, p
);
4676 static HRESULT WINAPI
HTMLElement6_put_onwaiting(IHTMLElement6
*iface
, VARIANT v
)
4678 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4679 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4683 static HRESULT WINAPI
HTMLElement6_get_onwaiting(IHTMLElement6
*iface
, VARIANT
*p
)
4685 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4686 FIXME("(%p)->(%p)\n", This
, p
);
4690 static HRESULT WINAPI
HTMLElement6_hasAttributes(IHTMLElement6
*iface
, VARIANT_BOOL
*pfHasAttributes
)
4692 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4693 FIXME("(%p)->(%p)\n", This
, pfHasAttributes
);
4697 static const IHTMLElement6Vtbl HTMLElement6Vtbl
= {
4698 HTMLElement6_QueryInterface
,
4699 HTMLElement6_AddRef
,
4700 HTMLElement6_Release
,
4701 HTMLElement6_GetTypeInfoCount
,
4702 HTMLElement6_GetTypeInfo
,
4703 HTMLElement6_GetIDsOfNames
,
4704 HTMLElement6_Invoke
,
4705 HTMLElement6_getAttributeNS
,
4706 HTMLElement6_setAttributeNS
,
4707 HTMLElement6_removeAttributeNS
,
4708 HTMLElement6_getAttributeNodeNS
,
4709 HTMLElement6_setAttributeNodeNS
,
4710 HTMLElement6_hasAttributeNS
,
4711 HTMLElement6_getAttribute
,
4712 HTMLElement6_setAttribute
,
4713 HTMLElement6_removeAttribute
,
4714 HTMLElement6_getAttributeNode
,
4715 HTMLElement6_setAttributeNode
,
4716 HTMLElement6_removeAttributeNode
,
4717 HTMLElement6_hasAttribute
,
4718 HTMLElement6_getElementsByTagNameNS
,
4719 HTMLElement6_get_tagName
,
4720 HTMLElement6_get_nodeName
,
4721 HTMLElement6_getElementsByClassName
,
4722 HTMLElement6_msMatchesSelector
,
4723 HTMLElement6_put_onabort
,
4724 HTMLElement6_get_onabort
,
4725 HTMLElement6_put_oncanplay
,
4726 HTMLElement6_get_oncanplay
,
4727 HTMLElement6_put_oncanplaythrough
,
4728 HTMLElement6_get_oncanplaythrough
,
4729 HTMLElement6_put_onchange
,
4730 HTMLElement6_get_onchange
,
4731 HTMLElement6_put_ondurationchange
,
4732 HTMLElement6_get_ondurationchange
,
4733 HTMLElement6_put_onemptied
,
4734 HTMLElement6_get_onemptied
,
4735 HTMLElement6_put_onended
,
4736 HTMLElement6_get_onended
,
4737 HTMLElement6_put_onerror
,
4738 HTMLElement6_get_onerror
,
4739 HTMLElement6_put_oninput
,
4740 HTMLElement6_get_oninput
,
4741 HTMLElement6_put_onload
,
4742 HTMLElement6_get_onload
,
4743 HTMLElement6_put_onloadeddata
,
4744 HTMLElement6_get_onloadeddata
,
4745 HTMLElement6_put_onloadedmetadata
,
4746 HTMLElement6_get_onloadedmetadata
,
4747 HTMLElement6_put_onloadstart
,
4748 HTMLElement6_get_onloadstart
,
4749 HTMLElement6_put_onpause
,
4750 HTMLElement6_get_onpause
,
4751 HTMLElement6_put_onplay
,
4752 HTMLElement6_get_onplay
,
4753 HTMLElement6_put_onplaying
,
4754 HTMLElement6_get_onplaying
,
4755 HTMLElement6_put_onprogress
,
4756 HTMLElement6_get_onprogress
,
4757 HTMLElement6_put_onratechange
,
4758 HTMLElement6_get_onratechange
,
4759 HTMLElement6_put_onreset
,
4760 HTMLElement6_get_onreset
,
4761 HTMLElement6_put_onseeked
,
4762 HTMLElement6_get_onseeked
,
4763 HTMLElement6_put_onseeking
,
4764 HTMLElement6_get_onseeking
,
4765 HTMLElement6_put_onselect
,
4766 HTMLElement6_get_onselect
,
4767 HTMLElement6_put_onstalled
,
4768 HTMLElement6_get_onstalled
,
4769 HTMLElement6_put_onsubmit
,
4770 HTMLElement6_get_onsubmit
,
4771 HTMLElement6_put_onsuspend
,
4772 HTMLElement6_get_onsuspend
,
4773 HTMLElement6_put_ontimeupdate
,
4774 HTMLElement6_get_ontimeupdate
,
4775 HTMLElement6_put_onvolumechange
,
4776 HTMLElement6_get_onvolumechange
,
4777 HTMLElement6_put_onwaiting
,
4778 HTMLElement6_get_onwaiting
,
4779 HTMLElement6_hasAttributes
4782 static inline HTMLElement
*impl_from_IHTMLUniqueName(IHTMLUniqueName
*iface
)
4784 return CONTAINING_RECORD(iface
, HTMLElement
, IHTMLUniqueName_iface
);
4787 static HRESULT WINAPI
HTMLUniqueName_QueryInterface(IHTMLUniqueName
*iface
, REFIID riid
, void **ppv
)
4789 HTMLElement
*This
= impl_from_IHTMLUniqueName(iface
);
4790 return IHTMLElement_QueryInterface(&This
->IHTMLElement_iface
, riid
, ppv
);
4793 static ULONG WINAPI
HTMLUniqueName_AddRef(IHTMLUniqueName
*iface
)
4795 HTMLElement
*This
= impl_from_IHTMLUniqueName(iface
);
4796 return IHTMLElement_AddRef(&This
->IHTMLElement_iface
);
4799 static ULONG WINAPI
HTMLUniqueName_Release(IHTMLUniqueName
*iface
)
4801 HTMLElement
*This
= impl_from_IHTMLUniqueName(iface
);
4802 return IHTMLElement_Release(&This
->IHTMLElement_iface
);
4805 static HRESULT WINAPI
HTMLUniqueName_GetTypeInfoCount(IHTMLUniqueName
*iface
, UINT
*pctinfo
)
4807 HTMLElement
*This
= impl_from_IHTMLUniqueName(iface
);
4808 return IDispatchEx_GetTypeInfoCount(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
4811 static HRESULT WINAPI
HTMLUniqueName_GetTypeInfo(IHTMLUniqueName
*iface
, UINT iTInfo
,
4812 LCID lcid
, ITypeInfo
**ppTInfo
)
4814 HTMLElement
*This
= impl_from_IHTMLUniqueName(iface
);
4815 return IDispatchEx_GetTypeInfo(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
4818 static HRESULT WINAPI
HTMLUniqueName_GetIDsOfNames(IHTMLUniqueName
*iface
, REFIID riid
,
4819 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
4821 HTMLElement
*This
= impl_from_IHTMLUniqueName(iface
);
4822 return IDispatchEx_GetIDsOfNames(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
4826 static HRESULT WINAPI
HTMLUniqueName_Invoke(IHTMLUniqueName
*iface
, DISPID dispIdMember
, REFIID riid
,
4827 LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
4829 HTMLElement
*This
= impl_from_IHTMLUniqueName(iface
);
4830 return IDispatchEx_Invoke(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
4831 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
4834 HRESULT
elem_unique_id(unsigned id
, BSTR
*p
)
4838 static const WCHAR formatW
[] = {'m','s','_','_','i','d','%','u',0};
4840 sprintfW(buf
, formatW
, id
);
4841 *p
= SysAllocString(buf
);
4842 return *p
? S_OK
: E_OUTOFMEMORY
;
4845 static void ensure_unique_id(HTMLElement
*elem
)
4847 if(!elem
->unique_id
)
4848 elem
->unique_id
= ++elem
->node
.doc
->unique_id
;
4851 static HRESULT WINAPI
HTMLUniqueName_get_uniqueNumber(IHTMLUniqueName
*iface
, LONG
*p
)
4853 HTMLElement
*This
= impl_from_IHTMLUniqueName(iface
);
4855 TRACE("(%p)->(%p)\n", This
, p
);
4857 ensure_unique_id(This
);
4858 *p
= This
->unique_id
;
4862 static HRESULT WINAPI
HTMLUniqueName_get_uniqueID(IHTMLUniqueName
*iface
, BSTR
*p
)
4864 HTMLElement
*This
= impl_from_IHTMLUniqueName(iface
);
4866 TRACE("(%p)->(%p)\n", This
, p
);
4868 ensure_unique_id(This
);
4869 return elem_unique_id(This
->unique_id
, p
);
4872 static const IHTMLUniqueNameVtbl HTMLUniqueNameVtbl
= {
4873 HTMLUniqueName_QueryInterface
,
4874 HTMLUniqueName_AddRef
,
4875 HTMLUniqueName_Release
,
4876 HTMLUniqueName_GetTypeInfoCount
,
4877 HTMLUniqueName_GetTypeInfo
,
4878 HTMLUniqueName_GetIDsOfNames
,
4879 HTMLUniqueName_Invoke
,
4880 HTMLUniqueName_get_uniqueNumber
,
4881 HTMLUniqueName_get_uniqueID
4884 static inline HTMLElement
*impl_from_IElementSelector(IElementSelector
*iface
)
4886 return CONTAINING_RECORD(iface
, HTMLElement
, IElementSelector_iface
);
4889 static HRESULT WINAPI
ElementSelector_QueryInterface(IElementSelector
*iface
, REFIID riid
, void **ppv
)
4891 HTMLElement
*This
= impl_from_IElementSelector(iface
);
4892 return IHTMLElement_QueryInterface(&This
->IHTMLElement_iface
, riid
, ppv
);
4895 static ULONG WINAPI
ElementSelector_AddRef(IElementSelector
*iface
)
4897 HTMLElement
*This
= impl_from_IElementSelector(iface
);
4898 return IHTMLElement_AddRef(&This
->IHTMLElement_iface
);
4901 static ULONG WINAPI
ElementSelector_Release(IElementSelector
*iface
)
4903 HTMLElement
*This
= impl_from_IElementSelector(iface
);
4904 return IHTMLElement_Release(&This
->IHTMLElement_iface
);
4907 static HRESULT WINAPI
ElementSelector_GetTypeInfoCount(IElementSelector
*iface
, UINT
*pctinfo
)
4909 HTMLElement
*This
= impl_from_IElementSelector(iface
);
4910 return IDispatchEx_GetTypeInfoCount(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
4913 static HRESULT WINAPI
ElementSelector_GetTypeInfo(IElementSelector
*iface
, UINT iTInfo
,
4914 LCID lcid
, ITypeInfo
**ppTInfo
)
4916 HTMLElement
*This
= impl_from_IElementSelector(iface
);
4917 return IDispatchEx_GetTypeInfo(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
4920 static HRESULT WINAPI
ElementSelector_GetIDsOfNames(IElementSelector
*iface
, REFIID riid
,
4921 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
4923 HTMLElement
*This
= impl_from_IElementSelector(iface
);
4924 return IDispatchEx_GetIDsOfNames(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
, lcid
, rgDispId
);
4927 static HRESULT WINAPI
ElementSelector_Invoke(IElementSelector
*iface
, DISPID dispIdMember
, REFIID riid
,
4928 LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
4930 HTMLElement
*This
= impl_from_IElementSelector(iface
);
4931 return IDispatchEx_Invoke(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
, wFlags
,
4932 pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
4935 static HRESULT WINAPI
ElementSelector_querySelector(IElementSelector
*iface
, BSTR v
, IHTMLElement
**pel
)
4937 HTMLElement
*This
= impl_from_IElementSelector(iface
);
4938 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(v
), pel
);
4942 static HRESULT WINAPI
ElementSelector_querySelectorAll(IElementSelector
*iface
, BSTR v
, IHTMLDOMChildrenCollection
**pel
)
4944 HTMLElement
*This
= impl_from_IElementSelector(iface
);
4945 nsIDOMNodeList
*node_list
;
4949 TRACE("(%p)->(%s %p)\n", This
, debugstr_w(v
), pel
);
4951 if(!This
->dom_element
) {
4952 FIXME("comment element\n");
4956 nsAString_InitDepend(&nsstr
, v
);
4957 nsres
= nsIDOMElement_QuerySelectorAll(This
->dom_element
, &nsstr
, &node_list
);
4958 nsAString_Finish(&nsstr
);
4959 if(NS_FAILED(nsres
)) {
4960 ERR("QuerySelectorAll failed: %08x\n", nsres
);
4964 *pel
= create_child_collection(node_list
);
4965 nsIDOMNodeList_Release(node_list
);
4966 return *pel
? S_OK
: E_OUTOFMEMORY
;
4969 static const IElementSelectorVtbl ElementSelectorVtbl
= {
4970 ElementSelector_QueryInterface
,
4971 ElementSelector_AddRef
,
4972 ElementSelector_Release
,
4973 ElementSelector_GetTypeInfoCount
,
4974 ElementSelector_GetTypeInfo
,
4975 ElementSelector_GetIDsOfNames
,
4976 ElementSelector_Invoke
,
4977 ElementSelector_querySelector
,
4978 ElementSelector_querySelectorAll
4981 static inline HTMLElement
*impl_from_IProvideMultipleClassInfo(IProvideMultipleClassInfo
*iface
)
4983 return CONTAINING_RECORD(iface
, HTMLElement
, IProvideMultipleClassInfo_iface
);
4986 static HRESULT WINAPI
ProvideClassInfo_QueryInterface(IProvideMultipleClassInfo
*iface
,
4987 REFIID riid
, void **ppv
)
4989 HTMLElement
*This
= impl_from_IProvideMultipleClassInfo(iface
);
4990 return IHTMLElement_QueryInterface(&This
->IHTMLElement_iface
, riid
, ppv
);
4993 static ULONG WINAPI
ProvideClassInfo_AddRef(IProvideMultipleClassInfo
*iface
)
4995 HTMLElement
*This
= impl_from_IProvideMultipleClassInfo(iface
);
4996 return IHTMLElement_AddRef(&This
->IHTMLElement_iface
);
4999 static ULONG WINAPI
ProvideClassInfo_Release(IProvideMultipleClassInfo
*iface
)
5001 HTMLElement
*This
= impl_from_IProvideMultipleClassInfo(iface
);
5002 return IHTMLElement_Release(&This
->IHTMLElement_iface
);
5005 static HRESULT WINAPI
ProvideClassInfo_GetClassInfo(IProvideMultipleClassInfo
*iface
, ITypeInfo
**ppTI
)
5007 HTMLElement
*This
= impl_from_IProvideMultipleClassInfo(iface
);
5008 TRACE("(%p)->(%p)\n", This
, ppTI
);
5009 return get_class_typeinfo(This
->node
.vtbl
->clsid
, ppTI
);
5012 static HRESULT WINAPI
ProvideClassInfo2_GetGUID(IProvideMultipleClassInfo
*iface
, DWORD dwGuidKind
, GUID
*pGUID
)
5014 HTMLElement
*This
= impl_from_IProvideMultipleClassInfo(iface
);
5015 FIXME("(%p)->(%u %p)\n", This
, dwGuidKind
, pGUID
);
5019 static HRESULT WINAPI
ProvideMultipleClassInfo_GetMultiTypeInfoCount(IProvideMultipleClassInfo
*iface
, ULONG
*pcti
)
5021 HTMLElement
*This
= impl_from_IProvideMultipleClassInfo(iface
);
5022 FIXME("(%p)->(%p)\n", This
, pcti
);
5027 static HRESULT WINAPI
ProvideMultipleClassInfo_GetInfoOfIndex(IProvideMultipleClassInfo
*iface
, ULONG iti
,
5028 DWORD dwFlags
, ITypeInfo
**pptiCoClass
, DWORD
*pdwTIFlags
, ULONG
*pcdispidReserved
, IID
*piidPrimary
, IID
*piidSource
)
5030 HTMLElement
*This
= impl_from_IProvideMultipleClassInfo(iface
);
5031 FIXME("(%p)->(%u %x %p %p %p %p %p)\n", This
, iti
, dwFlags
, pptiCoClass
, pdwTIFlags
, pcdispidReserved
, piidPrimary
, piidSource
);
5035 static const IProvideMultipleClassInfoVtbl ProvideMultipleClassInfoVtbl
= {
5036 ProvideClassInfo_QueryInterface
,
5037 ProvideClassInfo_AddRef
,
5038 ProvideClassInfo_Release
,
5039 ProvideClassInfo_GetClassInfo
,
5040 ProvideClassInfo2_GetGUID
,
5041 ProvideMultipleClassInfo_GetMultiTypeInfoCount
,
5042 ProvideMultipleClassInfo_GetInfoOfIndex
5045 static inline HTMLElement
*impl_from_IElementTraversal(IElementTraversal
*iface
)
5047 return CONTAINING_RECORD(iface
, HTMLElement
, IElementTraversal_iface
);
5050 static HRESULT WINAPI
ElementTraversal_QueryInterface(IElementTraversal
*iface
, REFIID riid
, void **ppv
)
5052 HTMLElement
*This
= impl_from_IElementTraversal(iface
);
5053 return IHTMLElement_QueryInterface(&This
->IHTMLElement_iface
, riid
, ppv
);
5056 static ULONG WINAPI
ElementTraversal_AddRef(IElementTraversal
*iface
)
5058 HTMLElement
*This
= impl_from_IElementTraversal(iface
);
5060 return IHTMLElement_AddRef(&This
->IHTMLElement_iface
);
5063 static ULONG WINAPI
ElementTraversal_Release(IElementTraversal
*iface
)
5065 HTMLElement
*This
= impl_from_IElementTraversal(iface
);
5067 return IHTMLElement_Release(&This
->IHTMLElement_iface
);
5070 static HRESULT WINAPI
ElementTraversal_GetTypeInfoCount(IElementTraversal
*iface
, UINT
*pctinfo
)
5072 HTMLElement
*This
= impl_from_IElementTraversal(iface
);
5073 return IDispatchEx_GetTypeInfoCount(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
5076 static HRESULT WINAPI
ElementTraversal_GetTypeInfo(IElementTraversal
*iface
, UINT iTInfo
,
5077 LCID lcid
, ITypeInfo
**ppTInfo
)
5079 HTMLElement
*This
= impl_from_IElementTraversal(iface
);
5080 return IDispatchEx_GetTypeInfo(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
5083 static HRESULT WINAPI
ElementTraversal_GetIDsOfNames(IElementTraversal
*iface
, REFIID riid
,
5084 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
5086 HTMLElement
*This
= impl_from_IElementTraversal(iface
);
5087 return IDispatchEx_GetIDsOfNames(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
5091 static HRESULT WINAPI
ElementTraversal_Invoke(IElementTraversal
*iface
, DISPID dispIdMember
, REFIID riid
,
5092 LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
5094 HTMLElement
*This
= impl_from_IElementTraversal(iface
);
5095 return IDispatchEx_Invoke(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
5096 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
5099 static HRESULT WINAPI
ElementTraversal_get_firstElementChild(IElementTraversal
*iface
, IHTMLElement
**p
)
5101 HTMLElement
*This
= impl_from_IElementTraversal(iface
);
5102 nsIDOMElement
*nselem
= NULL
;
5106 TRACE("(%p)->(%p)\n", This
, p
);
5108 if(!This
->dom_element
) {
5113 nsIDOMElement_GetFirstElementChild(This
->dom_element
, &nselem
);
5119 hres
= get_element(nselem
, &elem
);
5120 nsIDOMElement_Release(nselem
);
5124 *p
= &elem
->IHTMLElement_iface
;
5128 static HRESULT WINAPI
ElementTraversal_get_lastElementChild(IElementTraversal
*iface
, IHTMLElement
**p
)
5130 HTMLElement
*This
= impl_from_IElementTraversal(iface
);
5131 FIXME("(%p)->(%p)\n", This
, p
);
5135 static HRESULT WINAPI
ElementTraversal_get_previousElementSibling(IElementTraversal
*iface
, IHTMLElement
**p
)
5137 HTMLElement
*This
= impl_from_IElementTraversal(iface
);
5138 FIXME("(%p)->(%p)\n", This
, p
);
5142 static HRESULT WINAPI
ElementTraversal_get_nextElementSibling(IElementTraversal
*iface
, IHTMLElement
**p
)
5144 HTMLElement
*This
= impl_from_IElementTraversal(iface
);
5145 FIXME("(%p)->(%p)\n", This
, p
);
5149 static HRESULT WINAPI
ElementTraversal_get_childElementCount(IElementTraversal
*iface
, LONG
*p
)
5151 HTMLElement
*This
= impl_from_IElementTraversal(iface
);
5152 FIXME("(%p)->(%p)\n", This
, p
);
5156 static const IElementTraversalVtbl ElementTraversalVtbl
= {
5157 ElementTraversal_QueryInterface
,
5158 ElementTraversal_AddRef
,
5159 ElementTraversal_Release
,
5160 ElementTraversal_GetTypeInfoCount
,
5161 ElementTraversal_GetTypeInfo
,
5162 ElementTraversal_GetIDsOfNames
,
5163 ElementTraversal_Invoke
,
5164 ElementTraversal_get_firstElementChild
,
5165 ElementTraversal_get_lastElementChild
,
5166 ElementTraversal_get_previousElementSibling
,
5167 ElementTraversal_get_nextElementSibling
,
5168 ElementTraversal_get_childElementCount
5171 static inline HTMLElement
*impl_from_HTMLDOMNode(HTMLDOMNode
*iface
)
5173 return CONTAINING_RECORD(iface
, HTMLElement
, node
);
5176 HRESULT
HTMLElement_QI(HTMLDOMNode
*iface
, REFIID riid
, void **ppv
)
5178 HTMLElement
*This
= impl_from_HTMLDOMNode(iface
);
5180 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
5181 *ppv
= &This
->IHTMLElement_iface
;
5182 }else if(IsEqualGUID(&IID_IDispatch
, riid
)) {
5183 *ppv
= &This
->IHTMLElement_iface
;
5184 }else if(IsEqualGUID(&IID_IHTMLElement
, riid
)) {
5185 *ppv
= &This
->IHTMLElement_iface
;
5186 }else if(IsEqualGUID(&IID_IHTMLElement2
, riid
)) {
5187 *ppv
= &This
->IHTMLElement2_iface
;
5188 }else if(IsEqualGUID(&IID_IHTMLElement3
, riid
)) {
5189 *ppv
= &This
->IHTMLElement3_iface
;
5190 }else if(IsEqualGUID(&IID_IHTMLElement4
, riid
)) {
5191 *ppv
= &This
->IHTMLElement4_iface
;
5192 }else if(IsEqualGUID(&IID_IHTMLElement6
, riid
)) {
5193 *ppv
= &This
->IHTMLElement6_iface
;
5194 }else if(IsEqualGUID(&IID_IHTMLUniqueName
, riid
)) {
5195 *ppv
= &This
->IHTMLUniqueName_iface
;
5196 }else if(IsEqualGUID(&IID_IElementSelector
, riid
)) {
5197 *ppv
= &This
->IElementSelector_iface
;
5198 }else if(IsEqualGUID(&IID_IElementTraversal
, riid
)) {
5199 *ppv
= &This
->IElementTraversal_iface
;
5200 }else if(IsEqualGUID(&IID_IConnectionPointContainer
, riid
)) {
5201 *ppv
= &This
->cp_container
.IConnectionPointContainer_iface
;
5202 }else if(IsEqualGUID(&IID_IProvideClassInfo
, riid
)) {
5203 *ppv
= &This
->IProvideMultipleClassInfo_iface
;
5204 }else if(IsEqualGUID(&IID_IProvideClassInfo2
, riid
)) {
5205 *ppv
= &This
->IProvideMultipleClassInfo_iface
;
5206 }else if(IsEqualGUID(&IID_IProvideMultipleClassInfo
, riid
)) {
5207 *ppv
= &This
->IProvideMultipleClassInfo_iface
;
5209 return HTMLDOMNode_QI(&This
->node
, riid
, ppv
);
5212 IUnknown_AddRef((IUnknown
*)*ppv
);
5216 void HTMLElement_destructor(HTMLDOMNode
*iface
)
5218 HTMLElement
*This
= impl_from_HTMLDOMNode(iface
);
5220 ConnectionPointContainer_Destroy(&This
->cp_container
);
5223 This
->style
->elem
= NULL
;
5224 IHTMLStyle_Release(&This
->style
->IHTMLStyle_iface
);
5226 if(This
->runtime_style
) {
5227 This
->runtime_style
->elem
= NULL
;
5228 IHTMLStyle_Release(&This
->runtime_style
->IHTMLStyle_iface
);
5231 HTMLDOMAttribute
*attr
;
5233 LIST_FOR_EACH_ENTRY(attr
, &This
->attrs
->attrs
, HTMLDOMAttribute
, entry
)
5236 This
->attrs
->elem
= NULL
;
5237 IHTMLAttributeCollection_Release(&This
->attrs
->IHTMLAttributeCollection_iface
);
5240 heap_free(This
->filter
);
5242 HTMLDOMNode_destructor(&This
->node
);
5245 HRESULT
HTMLElement_clone(HTMLDOMNode
*iface
, nsIDOMNode
*nsnode
, HTMLDOMNode
**ret
)
5247 HTMLElement
*This
= impl_from_HTMLDOMNode(iface
);
5248 HTMLElement
*new_elem
;
5251 hres
= HTMLElement_Create(This
->node
.doc
, nsnode
, FALSE
, &new_elem
);
5256 new_elem
->filter
= heap_strdupW(This
->filter
);
5257 if(!new_elem
->filter
) {
5258 IHTMLElement_Release(&This
->IHTMLElement_iface
);
5259 return E_OUTOFMEMORY
;
5263 *ret
= &new_elem
->node
;
5267 HRESULT
HTMLElement_handle_event(HTMLDOMNode
*iface
, DWORD eid
, nsIDOMEvent
*event
, BOOL
*prevent_default
)
5269 HTMLElement
*This
= impl_from_HTMLDOMNode(iface
);
5272 case EVENTID_KEYDOWN
: {
5273 nsIDOMKeyEvent
*key_event
;
5276 nsres
= nsIDOMEvent_QueryInterface(event
, &IID_nsIDOMKeyEvent
, (void**)&key_event
);
5277 if(NS_SUCCEEDED(nsres
)) {
5280 nsIDOMKeyEvent_GetKeyCode(key_event
, &code
);
5282 if(code
== VK_F1
/* DOM_VK_F1 */) {
5283 DOMEvent
*help_event
;
5286 TRACE("F1 pressed\n");
5288 hres
= create_document_event(This
->node
.doc
, EVENTID_HELP
, &help_event
);
5289 if(SUCCEEDED(hres
)) {
5290 dispatch_event(&This
->node
.event_target
, help_event
);
5291 IDOMEvent_Release(&help_event
->IDOMEvent_iface
);
5293 *prevent_default
= TRUE
;
5296 nsIDOMKeyEvent_Release(key_event
);
5304 cp_static_data_t HTMLElementEvents2_data
= { HTMLElementEvents2_tid
, NULL
/* FIXME */, TRUE
};
5306 const cpc_entry_t HTMLElement_cpc
[] = {
5311 static const NodeImplVtbl HTMLElementImplVtbl
= {
5312 &CLSID_HTMLUnknownElement
,
5314 HTMLElement_destructor
,
5317 HTMLElement_handle_event
,
5318 HTMLElement_get_attr_col
5321 static inline HTMLElement
*impl_from_DispatchEx(DispatchEx
*iface
)
5323 return CONTAINING_RECORD(iface
, HTMLElement
, node
.event_target
.dispex
);
5326 static HRESULT
HTMLElement_get_dispid(DispatchEx
*dispex
, BSTR name
,
5327 DWORD grfdex
, DISPID
*pid
)
5329 HTMLElement
*This
= impl_from_DispatchEx(dispex
);
5331 if(This
->node
.vtbl
->get_dispid
)
5332 return This
->node
.vtbl
->get_dispid(&This
->node
, name
, grfdex
, pid
);
5334 return DISP_E_UNKNOWNNAME
;
5337 static HRESULT
HTMLElement_invoke(DispatchEx
*dispex
, DISPID id
, LCID lcid
,
5338 WORD flags
, DISPPARAMS
*params
, VARIANT
*res
, EXCEPINFO
*ei
,
5339 IServiceProvider
*caller
)
5341 HTMLElement
*This
= impl_from_DispatchEx(dispex
);
5343 if(This
->node
.vtbl
->invoke
)
5344 return This
->node
.vtbl
->invoke(&This
->node
, id
, lcid
, flags
,
5345 params
, res
, ei
, caller
);
5347 ERR("(%p): element has no invoke method\n", This
);
5351 static HRESULT
HTMLElement_populate_props(DispatchEx
*dispex
)
5353 HTMLElement
*This
= impl_from_DispatchEx(dispex
);
5354 nsIDOMMozNamedAttrMap
*attrs
;
5357 const PRUnichar
*str
;
5366 if(!This
->dom_element
)
5369 nsres
= nsIDOMElement_GetAttributes(This
->dom_element
, &attrs
);
5370 if(NS_FAILED(nsres
))
5373 nsres
= nsIDOMMozNamedAttrMap_GetLength(attrs
, &len
);
5374 if(NS_FAILED(nsres
)) {
5375 nsIDOMMozNamedAttrMap_Release(attrs
);
5379 nsAString_Init(&nsstr
, NULL
);
5380 for(i
=0; i
<len
; i
++) {
5381 nsres
= nsIDOMMozNamedAttrMap_Item(attrs
, i
, &attr
);
5382 if(NS_FAILED(nsres
))
5385 nsres
= nsIDOMAttr_GetNodeName(attr
, &nsstr
);
5386 if(NS_FAILED(nsres
)) {
5387 nsIDOMAttr_Release(attr
);
5391 nsAString_GetData(&nsstr
, &str
);
5392 name
= SysAllocString(str
);
5394 nsIDOMAttr_Release(attr
);
5398 hres
= IDispatchEx_GetDispID(&dispex
->IDispatchEx_iface
, name
, fdexNameCaseInsensitive
, &id
);
5399 if(hres
!= DISP_E_UNKNOWNNAME
) {
5400 nsIDOMAttr_Release(attr
);
5401 SysFreeString(name
);
5405 nsres
= nsIDOMAttr_GetNodeValue(attr
, &nsstr
);
5406 nsIDOMAttr_Release(attr
);
5407 if(NS_FAILED(nsres
)) {
5408 SysFreeString(name
);
5412 nsAString_GetData(&nsstr
, &str
);
5413 V_VT(&value
) = VT_BSTR
;
5415 V_BSTR(&value
) = SysAllocString(str
);
5416 if(!V_BSTR(&value
)) {
5417 SysFreeString(name
);
5421 V_BSTR(&value
) = NULL
;
5423 IHTMLElement_setAttribute(&This
->IHTMLElement_iface
, name
, value
, 0);
5424 SysFreeString(name
);
5425 VariantClear(&value
);
5427 nsAString_Finish(&nsstr
);
5429 nsIDOMMozNamedAttrMap_Release(attrs
);
5433 static nsISupports
*HTMLElement_get_gecko_target(DispatchEx
*dispex
)
5435 HTMLElement
*This
= impl_from_DispatchEx(dispex
);
5436 return (nsISupports
*)This
->node
.nsnode
;
5439 static void HTMLElement_bind_event(DispatchEx
*dispex
, eventid_t eid
)
5441 HTMLElement
*This
= impl_from_DispatchEx(dispex
);
5442 ensure_doc_nsevent_handler(This
->node
.doc
, This
->node
.nsnode
, eid
);
5445 static HRESULT
HTMLElement_handle_event_default(DispatchEx
*dispex
, eventid_t eid
, nsIDOMEvent
*nsevent
, BOOL
*prevent_default
)
5447 HTMLElement
*This
= impl_from_DispatchEx(dispex
);
5449 if(!This
->node
.vtbl
->handle_event
)
5451 return This
->node
.vtbl
->handle_event(&This
->node
, eid
, nsevent
, prevent_default
);
5454 static EventTarget
*HTMLElement_get_parent_event_target(DispatchEx
*dispex
)
5456 HTMLElement
*This
= impl_from_DispatchEx(dispex
);
5462 nsres
= nsIDOMNode_GetParentNode(This
->node
.nsnode
, &nsnode
);
5463 assert(nsres
== NS_OK
);
5467 hres
= get_node(nsnode
, TRUE
, &node
);
5468 nsIDOMNode_Release(nsnode
);
5472 return &node
->event_target
;
5475 static ConnectionPointContainer
*HTMLElement_get_cp_container(DispatchEx
*dispex
)
5477 HTMLElement
*This
= impl_from_DispatchEx(dispex
);
5478 IConnectionPointContainer_AddRef(&This
->cp_container
.IConnectionPointContainer_iface
);
5479 return &This
->cp_container
;
5482 static IHTMLEventObj
*HTMLElement_set_current_event(DispatchEx
*dispex
, IHTMLEventObj
*event
)
5484 HTMLElement
*This
= impl_from_DispatchEx(dispex
);
5485 return default_set_current_event(This
->node
.doc
->window
, event
);
5488 void HTMLElement_init_dispex_info(dispex_data_t
*info
, compat_mode_t mode
)
5490 static const dispex_hook_t elem2_ie11_hooks
[] = {
5491 {DISPID_IHTMLELEMENT2_DOSCROLL
, NULL
},
5495 HTMLDOMNode_init_dispex_info(info
, mode
);
5497 dispex_info_add_interface(info
, IHTMLElement2_tid
, mode
>= COMPAT_MODE_IE11
? elem2_ie11_hooks
: NULL
);
5499 if(mode
>= COMPAT_MODE_IE8
)
5500 dispex_info_add_interface(info
, IElementSelector_tid
, NULL
);
5502 if(mode
>= COMPAT_MODE_IE9
) {
5503 dispex_info_add_interface(info
, IHTMLElement6_tid
, NULL
);
5504 dispex_info_add_interface(info
, IElementTraversal_tid
, NULL
);
5508 static const tid_t HTMLElement_iface_tids
[] = {
5513 static event_target_vtbl_t HTMLElement_event_target_vtbl
= {
5516 HTMLElement_get_dispid
,
5519 HTMLElement_populate_props
5521 HTMLElement_get_gecko_target
,
5522 HTMLElement_bind_event
,
5523 HTMLElement_get_parent_event_target
,
5524 HTMLElement_handle_event_default
,
5525 HTMLElement_get_cp_container
,
5526 HTMLElement_set_current_event
5529 static dispex_static_data_t HTMLElement_dispex
= {
5530 &HTMLElement_event_target_vtbl
.dispex_vtbl
,
5531 DispHTMLUnknownElement_tid
,
5532 HTMLElement_iface_tids
,
5533 HTMLElement_init_dispex_info
5536 void HTMLElement_Init(HTMLElement
*This
, HTMLDocumentNode
*doc
, nsIDOMElement
*nselem
, dispex_static_data_t
*dispex_data
)
5538 This
->IHTMLElement_iface
.lpVtbl
= &HTMLElementVtbl
;
5539 This
->IHTMLElement2_iface
.lpVtbl
= &HTMLElement2Vtbl
;
5540 This
->IHTMLElement3_iface
.lpVtbl
= &HTMLElement3Vtbl
;
5541 This
->IHTMLElement4_iface
.lpVtbl
= &HTMLElement4Vtbl
;
5542 This
->IHTMLElement6_iface
.lpVtbl
= &HTMLElement6Vtbl
;
5543 This
->IHTMLUniqueName_iface
.lpVtbl
= &HTMLUniqueNameVtbl
;
5544 This
->IElementSelector_iface
.lpVtbl
= &ElementSelectorVtbl
;
5545 This
->IElementTraversal_iface
.lpVtbl
= &ElementTraversalVtbl
;
5546 This
->IProvideMultipleClassInfo_iface
.lpVtbl
= &ProvideMultipleClassInfoVtbl
;
5548 if(dispex_data
&& !dispex_data
->vtbl
)
5549 dispex_data
->vtbl
= &HTMLElement_event_target_vtbl
.dispex_vtbl
;
5552 nsIDOMHTMLElement
*html_element
;
5555 HTMLDOMNode_Init(doc
, &This
->node
, (nsIDOMNode
*)nselem
, dispex_data
? dispex_data
: &HTMLElement_dispex
);
5557 /* No AddRef, share reference with HTMLDOMNode */
5558 assert((nsIDOMNode
*)nselem
== This
->node
.nsnode
);
5559 This
->dom_element
= nselem
;
5561 nsres
= nsIDOMElement_QueryInterface(nselem
, &IID_nsIDOMHTMLElement
, (void**)&html_element
);
5562 if(NS_SUCCEEDED(nsres
)) {
5563 This
->html_element
= html_element
;
5564 /* share reference with HTMLDOMNode */
5565 assert((nsIDOMNode
*)html_element
== This
->node
.nsnode
);
5566 nsIDOMHTMLElement_Release(html_element
);
5570 ConnectionPointContainer_Init(&This
->cp_container
, (IUnknown
*)&This
->IHTMLElement_iface
, This
->node
.vtbl
->cpc_entries
);
5573 HRESULT
HTMLElement_Create(HTMLDocumentNode
*doc
, nsIDOMNode
*nsnode
, BOOL use_generic
, HTMLElement
**ret
)
5575 nsIDOMElement
*nselem
;
5576 nsAString tag_name_str
;
5577 const PRUnichar
*tag_name
;
5578 const tag_desc_t
*tag
;
5583 nsres
= nsIDOMNode_QueryInterface(nsnode
, &IID_nsIDOMElement
, (void**)&nselem
);
5584 if(NS_FAILED(nsres
)) {
5585 ERR("no nsIDOMElement iface\n");
5589 nsAString_Init(&tag_name_str
, NULL
);
5590 nsIDOMElement_GetTagName(nselem
, &tag_name_str
);
5592 nsAString_GetData(&tag_name_str
, &tag_name
);
5594 tag
= get_tag_desc(tag_name
);
5596 hres
= tag
->constructor(doc
, (nsIDOMElement
*)nselem
, &elem
);
5597 }else if(use_generic
) {
5598 hres
= HTMLGenericElement_Create(doc
, (nsIDOMElement
*)nselem
, &elem
);
5600 elem
= heap_alloc_zero(sizeof(HTMLElement
));
5602 elem
->node
.vtbl
= &HTMLElementImplVtbl
;
5603 HTMLElement_Init(elem
, doc
, (nsIDOMElement
*)nselem
, &HTMLElement_dispex
);
5606 hres
= E_OUTOFMEMORY
;
5610 TRACE("%s ret %p\n", debugstr_w(tag_name
), elem
);
5612 nsIDOMElement_Release(nselem
);
5613 nsAString_Finish(&tag_name_str
);
5621 HRESULT
get_element(nsIDOMElement
*nselem
, HTMLElement
**ret
)
5626 hres
= get_node((nsIDOMNode
*)nselem
, TRUE
, &node
);
5630 *ret
= impl_from_HTMLDOMNode(node
);
5634 /* interface IHTMLFiltersCollection */
5635 static HRESULT WINAPI
HTMLFiltersCollection_QueryInterface(IHTMLFiltersCollection
*iface
, REFIID riid
, void **ppv
)
5637 HTMLFiltersCollection
*This
= impl_from_IHTMLFiltersCollection(iface
);
5639 TRACE("%p %s %p\n", This
, debugstr_mshtml_guid(riid
), ppv
);
5641 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
5642 *ppv
= &This
->IHTMLFiltersCollection_iface
;
5643 }else if(IsEqualGUID(&IID_IHTMLFiltersCollection
, riid
)) {
5644 TRACE("(%p)->(IID_IHTMLFiltersCollection %p)\n", This
, ppv
);
5645 *ppv
= &This
->IHTMLFiltersCollection_iface
;
5646 }else if(dispex_query_interface(&This
->dispex
, riid
, ppv
)) {
5647 return *ppv
? S_OK
: E_NOINTERFACE
;
5650 FIXME("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
5651 return E_NOINTERFACE
;
5654 IUnknown_AddRef((IUnknown
*)*ppv
);
5658 static ULONG WINAPI
HTMLFiltersCollection_AddRef(IHTMLFiltersCollection
*iface
)
5660 HTMLFiltersCollection
*This
= impl_from_IHTMLFiltersCollection(iface
);
5661 LONG ref
= InterlockedIncrement(&This
->ref
);
5663 TRACE("(%p) ref=%d\n", This
, ref
);
5668 static ULONG WINAPI
HTMLFiltersCollection_Release(IHTMLFiltersCollection
*iface
)
5670 HTMLFiltersCollection
*This
= impl_from_IHTMLFiltersCollection(iface
);
5671 LONG ref
= InterlockedDecrement(&This
->ref
);
5673 TRACE("(%p) ref=%d\n", This
, ref
);
5683 static HRESULT WINAPI
HTMLFiltersCollection_GetTypeInfoCount(IHTMLFiltersCollection
*iface
, UINT
*pctinfo
)
5685 HTMLFiltersCollection
*This
= impl_from_IHTMLFiltersCollection(iface
);
5686 return IDispatchEx_GetTypeInfoCount(&This
->dispex
.IDispatchEx_iface
, pctinfo
);
5689 static HRESULT WINAPI
HTMLFiltersCollection_GetTypeInfo(IHTMLFiltersCollection
*iface
,
5690 UINT iTInfo
, LCID lcid
, ITypeInfo
**ppTInfo
)
5692 HTMLFiltersCollection
*This
= impl_from_IHTMLFiltersCollection(iface
);
5693 return IDispatchEx_GetTypeInfo(&This
->dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
5696 static HRESULT WINAPI
HTMLFiltersCollection_GetIDsOfNames(IHTMLFiltersCollection
*iface
,
5697 REFIID riid
, LPOLESTR
*rgszNames
, UINT cNames
,
5698 LCID lcid
, DISPID
*rgDispId
)
5700 HTMLFiltersCollection
*This
= impl_from_IHTMLFiltersCollection(iface
);
5701 return IDispatchEx_GetIDsOfNames(&This
->dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
5705 static HRESULT WINAPI
HTMLFiltersCollection_Invoke(IHTMLFiltersCollection
*iface
, DISPID dispIdMember
, REFIID riid
,
5706 LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
,
5707 EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
5709 HTMLFiltersCollection
*This
= impl_from_IHTMLFiltersCollection(iface
);
5710 return IDispatchEx_Invoke(&This
->dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
5711 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
5714 static HRESULT WINAPI
HTMLFiltersCollection_get_length(IHTMLFiltersCollection
*iface
, LONG
*p
)
5716 HTMLFiltersCollection
*This
= impl_from_IHTMLFiltersCollection(iface
);
5721 FIXME("(%p)->(%p) Always returning 0\n", This
, p
);
5727 static HRESULT WINAPI
HTMLFiltersCollection_get__newEnum(IHTMLFiltersCollection
*iface
, IUnknown
**p
)
5729 HTMLFiltersCollection
*This
= impl_from_IHTMLFiltersCollection(iface
);
5730 FIXME("(%p)->(%p)\n", This
, p
);
5734 static HRESULT WINAPI
HTMLFiltersCollection_item(IHTMLFiltersCollection
*iface
, VARIANT
*pvarIndex
, VARIANT
*pvarResult
)
5736 HTMLFiltersCollection
*This
= impl_from_IHTMLFiltersCollection(iface
);
5737 FIXME("(%p)->(%p, %p)\n", This
, pvarIndex
, pvarResult
);
5741 static const IHTMLFiltersCollectionVtbl HTMLFiltersCollectionVtbl
= {
5742 HTMLFiltersCollection_QueryInterface
,
5743 HTMLFiltersCollection_AddRef
,
5744 HTMLFiltersCollection_Release
,
5745 HTMLFiltersCollection_GetTypeInfoCount
,
5746 HTMLFiltersCollection_GetTypeInfo
,
5747 HTMLFiltersCollection_GetIDsOfNames
,
5748 HTMLFiltersCollection_Invoke
,
5749 HTMLFiltersCollection_get_length
,
5750 HTMLFiltersCollection_get__newEnum
,
5751 HTMLFiltersCollection_item
5754 static HRESULT
HTMLFiltersCollection_get_dispid(DispatchEx
*dispex
, BSTR name
, DWORD flags
, DISPID
*dispid
)
5759 for(ptr
= name
; *ptr
&& isdigitW(*ptr
); ptr
++)
5760 idx
= idx
*10 + (*ptr
-'0');
5762 return DISP_E_UNKNOWNNAME
;
5764 *dispid
= MSHTML_DISPID_CUSTOM_MIN
+ idx
;
5765 TRACE("ret %x\n", *dispid
);
5769 static HRESULT
HTMLFiltersCollection_invoke(DispatchEx
*dispex
, DISPID id
, LCID lcid
, WORD flags
, DISPPARAMS
*params
,
5770 VARIANT
*res
, EXCEPINFO
*ei
, IServiceProvider
*caller
)
5772 TRACE("(%p)->(%x %x %x %p %p %p)\n", dispex
, id
, lcid
, flags
, params
, res
, ei
);
5774 V_VT(res
) = VT_DISPATCH
;
5775 V_DISPATCH(res
) = NULL
;
5777 FIXME("always returning NULL\n");
5782 static const dispex_static_data_vtbl_t HTMLFiltersCollection_dispex_vtbl
= {
5784 HTMLFiltersCollection_get_dispid
,
5785 HTMLFiltersCollection_invoke
,
5789 static const tid_t HTMLFiltersCollection_iface_tids
[] = {
5790 IHTMLFiltersCollection_tid
,
5793 static dispex_static_data_t HTMLFiltersCollection_dispex
= {
5794 &HTMLFiltersCollection_dispex_vtbl
,
5795 IHTMLFiltersCollection_tid
,
5796 HTMLFiltersCollection_iface_tids
5799 static IHTMLFiltersCollection
*HTMLFiltersCollection_Create(void)
5801 HTMLFiltersCollection
*ret
= heap_alloc(sizeof(HTMLFiltersCollection
));
5803 ret
->IHTMLFiltersCollection_iface
.lpVtbl
= &HTMLFiltersCollectionVtbl
;
5806 init_dispex(&ret
->dispex
, (IUnknown
*)&ret
->IHTMLFiltersCollection_iface
,
5807 &HTMLFiltersCollection_dispex
);
5809 return &ret
->IHTMLFiltersCollection_iface
;
5812 /* interface IHTMLAttributeCollection */
5813 static inline HTMLAttributeCollection
*impl_from_IHTMLAttributeCollection(IHTMLAttributeCollection
*iface
)
5815 return CONTAINING_RECORD(iface
, HTMLAttributeCollection
, IHTMLAttributeCollection_iface
);
5818 static HRESULT WINAPI
HTMLAttributeCollection_QueryInterface(IHTMLAttributeCollection
*iface
, REFIID riid
, void **ppv
)
5820 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection(iface
);
5822 TRACE("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
5824 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
5825 *ppv
= &This
->IHTMLAttributeCollection_iface
;
5826 }else if(IsEqualGUID(&IID_IHTMLAttributeCollection
, riid
)) {
5827 *ppv
= &This
->IHTMLAttributeCollection_iface
;
5828 }else if(IsEqualGUID(&IID_IHTMLAttributeCollection2
, riid
)) {
5829 *ppv
= &This
->IHTMLAttributeCollection2_iface
;
5830 }else if(IsEqualGUID(&IID_IHTMLAttributeCollection3
, riid
)) {
5831 *ppv
= &This
->IHTMLAttributeCollection3_iface
;
5832 }else if(dispex_query_interface(&This
->dispex
, riid
, ppv
)) {
5833 return *ppv
? S_OK
: E_NOINTERFACE
;
5836 WARN("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
5837 return E_NOINTERFACE
;
5840 IUnknown_AddRef((IUnknown
*)*ppv
);
5844 static ULONG WINAPI
HTMLAttributeCollection_AddRef(IHTMLAttributeCollection
*iface
)
5846 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection(iface
);
5847 LONG ref
= InterlockedIncrement(&This
->ref
);
5849 TRACE("(%p) ref=%d\n", This
, ref
);
5854 static ULONG WINAPI
HTMLAttributeCollection_Release(IHTMLAttributeCollection
*iface
)
5856 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection(iface
);
5857 LONG ref
= InterlockedDecrement(&This
->ref
);
5859 TRACE("(%p) ref=%d\n", This
, ref
);
5862 while(!list_empty(&This
->attrs
)) {
5863 HTMLDOMAttribute
*attr
= LIST_ENTRY(list_head(&This
->attrs
), HTMLDOMAttribute
, entry
);
5865 list_remove(&attr
->entry
);
5867 IHTMLDOMAttribute_Release(&attr
->IHTMLDOMAttribute_iface
);
5876 static HRESULT WINAPI
HTMLAttributeCollection_GetTypeInfoCount(IHTMLAttributeCollection
*iface
, UINT
*pctinfo
)
5878 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection(iface
);
5879 return IDispatchEx_GetTypeInfoCount(&This
->dispex
.IDispatchEx_iface
, pctinfo
);
5882 static HRESULT WINAPI
HTMLAttributeCollection_GetTypeInfo(IHTMLAttributeCollection
*iface
, UINT iTInfo
,
5883 LCID lcid
, ITypeInfo
**ppTInfo
)
5885 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection(iface
);
5886 return IDispatchEx_GetTypeInfo(&This
->dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
5889 static HRESULT WINAPI
HTMLAttributeCollection_GetIDsOfNames(IHTMLAttributeCollection
*iface
, REFIID riid
,
5890 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
5892 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection(iface
);
5893 return IDispatchEx_GetIDsOfNames(&This
->dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
5897 static HRESULT WINAPI
HTMLAttributeCollection_Invoke(IHTMLAttributeCollection
*iface
, DISPID dispIdMember
,
5898 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
5899 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
5901 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection(iface
);
5902 return IDispatchEx_Invoke(&This
->dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
5903 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
5906 static HRESULT
get_attr_dispid_by_idx(HTMLAttributeCollection
*This
, LONG
*idx
, DISPID
*dispid
)
5908 IDispatchEx
*dispex
= &This
->elem
->node
.event_target
.dispex
.IDispatchEx_iface
;
5909 DISPID id
= DISPID_STARTENUM
;
5913 FIXME("filter non-enumerable attributes out\n");
5916 hres
= IDispatchEx_GetNextDispID(dispex
, fdexEnumAll
, id
, &id
);
5919 else if(hres
== S_FALSE
)
5929 return *idx
==len
? S_OK
: DISP_E_UNKNOWNNAME
;
5936 static inline HRESULT
get_attr_dispid_by_name(HTMLAttributeCollection
*This
, BSTR name
, DISPID
*id
)
5940 if(name
[0]>='0' && name
[0]<='9') {
5944 idx
= strtoulW(name
, &end_ptr
, 10);
5946 hres
= get_attr_dispid_by_idx(This
, &idx
, id
);
5953 WARN("NULL elem\n");
5954 return E_UNEXPECTED
;
5957 hres
= IDispatchEx_GetDispID(&This
->elem
->node
.event_target
.dispex
.IDispatchEx_iface
,
5958 name
, fdexNameCaseInsensitive
, id
);
5962 static inline HRESULT
get_domattr(HTMLAttributeCollection
*This
, DISPID id
, LONG
*list_pos
, HTMLDOMAttribute
**attr
)
5964 HTMLDOMAttribute
*iter
;
5969 LIST_FOR_EACH_ENTRY(iter
, &This
->attrs
, HTMLDOMAttribute
, entry
) {
5970 if(iter
->dispid
== id
) {
5979 WARN("NULL elem\n");
5980 return E_UNEXPECTED
;
5983 hres
= HTMLDOMAttribute_Create(NULL
, This
->elem
, id
, attr
);
5988 IHTMLDOMAttribute_AddRef(&(*attr
)->IHTMLDOMAttribute_iface
);
5994 static HRESULT WINAPI
HTMLAttributeCollection_get_length(IHTMLAttributeCollection
*iface
, LONG
*p
)
5996 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection(iface
);
5999 TRACE("(%p)->(%p)\n", This
, p
);
6002 hres
= get_attr_dispid_by_idx(This
, p
, NULL
);
6006 static HRESULT WINAPI
HTMLAttributeCollection__newEnum(IHTMLAttributeCollection
*iface
, IUnknown
**p
)
6008 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection(iface
);
6009 FIXME("(%p)->(%p)\n", This
, p
);
6013 static HRESULT WINAPI
HTMLAttributeCollection_item(IHTMLAttributeCollection
*iface
, VARIANT
*name
, IDispatch
**ppItem
)
6015 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection(iface
);
6016 HTMLDOMAttribute
*attr
;
6020 TRACE("(%p)->(%s %p)\n", This
, debugstr_variant(name
), ppItem
);
6022 switch(V_VT(name
)) {
6024 hres
= get_attr_dispid_by_idx(This
, &V_I4(name
), &id
);
6027 hres
= get_attr_dispid_by_name(This
, V_BSTR(name
), &id
);
6030 FIXME("unsupported name %s\n", debugstr_variant(name
));
6033 if(hres
== DISP_E_UNKNOWNNAME
)
6034 return E_INVALIDARG
;
6038 hres
= get_domattr(This
, id
, NULL
, &attr
);
6042 *ppItem
= (IDispatch
*)&attr
->IHTMLDOMAttribute_iface
;
6046 static const IHTMLAttributeCollectionVtbl HTMLAttributeCollectionVtbl
= {
6047 HTMLAttributeCollection_QueryInterface
,
6048 HTMLAttributeCollection_AddRef
,
6049 HTMLAttributeCollection_Release
,
6050 HTMLAttributeCollection_GetTypeInfoCount
,
6051 HTMLAttributeCollection_GetTypeInfo
,
6052 HTMLAttributeCollection_GetIDsOfNames
,
6053 HTMLAttributeCollection_Invoke
,
6054 HTMLAttributeCollection_get_length
,
6055 HTMLAttributeCollection__newEnum
,
6056 HTMLAttributeCollection_item
6059 static inline HTMLAttributeCollection
*impl_from_IHTMLAttributeCollection2(IHTMLAttributeCollection2
*iface
)
6061 return CONTAINING_RECORD(iface
, HTMLAttributeCollection
, IHTMLAttributeCollection2_iface
);
6064 static HRESULT WINAPI
HTMLAttributeCollection2_QueryInterface(IHTMLAttributeCollection2
*iface
, REFIID riid
, void **ppv
)
6066 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection2(iface
);
6067 return IHTMLAttributeCollection_QueryInterface(&This
->IHTMLAttributeCollection_iface
, riid
, ppv
);
6070 static ULONG WINAPI
HTMLAttributeCollection2_AddRef(IHTMLAttributeCollection2
*iface
)
6072 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection2(iface
);
6073 return IHTMLAttributeCollection_AddRef(&This
->IHTMLAttributeCollection_iface
);
6076 static ULONG WINAPI
HTMLAttributeCollection2_Release(IHTMLAttributeCollection2
*iface
)
6078 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection2(iface
);
6079 return IHTMLAttributeCollection_Release(&This
->IHTMLAttributeCollection_iface
);
6082 static HRESULT WINAPI
HTMLAttributeCollection2_GetTypeInfoCount(IHTMLAttributeCollection2
*iface
, UINT
*pctinfo
)
6084 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection2(iface
);
6085 return IDispatchEx_GetTypeInfoCount(&This
->dispex
.IDispatchEx_iface
, pctinfo
);
6088 static HRESULT WINAPI
HTMLAttributeCollection2_GetTypeInfo(IHTMLAttributeCollection2
*iface
, UINT iTInfo
,
6089 LCID lcid
, ITypeInfo
**ppTInfo
)
6091 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection2(iface
);
6092 return IDispatchEx_GetTypeInfo(&This
->dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
6095 static HRESULT WINAPI
HTMLAttributeCollection2_GetIDsOfNames(IHTMLAttributeCollection2
*iface
, REFIID riid
,
6096 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
6098 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection2(iface
);
6099 return IDispatchEx_GetIDsOfNames(&This
->dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
6103 static HRESULT WINAPI
HTMLAttributeCollection2_Invoke(IHTMLAttributeCollection2
*iface
, DISPID dispIdMember
,
6104 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
6105 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
6107 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection2(iface
);
6108 return IDispatchEx_Invoke(&This
->dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
6109 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
6112 static HRESULT WINAPI
HTMLAttributeCollection2_getNamedItem(IHTMLAttributeCollection2
*iface
, BSTR bstrName
,
6113 IHTMLDOMAttribute
**newretNode
)
6115 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection2(iface
);
6116 HTMLDOMAttribute
*attr
;
6120 TRACE("(%p)->(%s %p)\n", This
, debugstr_w(bstrName
), newretNode
);
6122 hres
= get_attr_dispid_by_name(This
, bstrName
, &id
);
6123 if(hres
== DISP_E_UNKNOWNNAME
) {
6126 } else if(FAILED(hres
)) {
6130 hres
= get_domattr(This
, id
, NULL
, &attr
);
6134 *newretNode
= &attr
->IHTMLDOMAttribute_iface
;
6138 static HRESULT WINAPI
HTMLAttributeCollection2_setNamedItem(IHTMLAttributeCollection2
*iface
,
6139 IHTMLDOMAttribute
*ppNode
, IHTMLDOMAttribute
**newretNode
)
6141 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection2(iface
);
6142 FIXME("(%p)->(%p %p)\n", This
, ppNode
, newretNode
);
6146 static HRESULT WINAPI
HTMLAttributeCollection2_removeNamedItem(IHTMLAttributeCollection2
*iface
,
6147 BSTR bstrName
, IHTMLDOMAttribute
**newretNode
)
6149 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection2(iface
);
6150 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(bstrName
), newretNode
);
6154 static const IHTMLAttributeCollection2Vtbl HTMLAttributeCollection2Vtbl
= {
6155 HTMLAttributeCollection2_QueryInterface
,
6156 HTMLAttributeCollection2_AddRef
,
6157 HTMLAttributeCollection2_Release
,
6158 HTMLAttributeCollection2_GetTypeInfoCount
,
6159 HTMLAttributeCollection2_GetTypeInfo
,
6160 HTMLAttributeCollection2_GetIDsOfNames
,
6161 HTMLAttributeCollection2_Invoke
,
6162 HTMLAttributeCollection2_getNamedItem
,
6163 HTMLAttributeCollection2_setNamedItem
,
6164 HTMLAttributeCollection2_removeNamedItem
6167 static inline HTMLAttributeCollection
*impl_from_IHTMLAttributeCollection3(IHTMLAttributeCollection3
*iface
)
6169 return CONTAINING_RECORD(iface
, HTMLAttributeCollection
, IHTMLAttributeCollection3_iface
);
6172 static HRESULT WINAPI
HTMLAttributeCollection3_QueryInterface(IHTMLAttributeCollection3
*iface
, REFIID riid
, void **ppv
)
6174 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection3(iface
);
6175 return IHTMLAttributeCollection_QueryInterface(&This
->IHTMLAttributeCollection_iface
, riid
, ppv
);
6178 static ULONG WINAPI
HTMLAttributeCollection3_AddRef(IHTMLAttributeCollection3
*iface
)
6180 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection3(iface
);
6181 return IHTMLAttributeCollection_AddRef(&This
->IHTMLAttributeCollection_iface
);
6184 static ULONG WINAPI
HTMLAttributeCollection3_Release(IHTMLAttributeCollection3
*iface
)
6186 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection3(iface
);
6187 return IHTMLAttributeCollection_Release(&This
->IHTMLAttributeCollection_iface
);
6190 static HRESULT WINAPI
HTMLAttributeCollection3_GetTypeInfoCount(IHTMLAttributeCollection3
*iface
, UINT
*pctinfo
)
6192 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection3(iface
);
6193 return IDispatchEx_GetTypeInfoCount(&This
->dispex
.IDispatchEx_iface
, pctinfo
);
6196 static HRESULT WINAPI
HTMLAttributeCollection3_GetTypeInfo(IHTMLAttributeCollection3
*iface
, UINT iTInfo
,
6197 LCID lcid
, ITypeInfo
**ppTInfo
)
6199 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection3(iface
);
6200 return IDispatchEx_GetTypeInfo(&This
->dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
6203 static HRESULT WINAPI
HTMLAttributeCollection3_GetIDsOfNames(IHTMLAttributeCollection3
*iface
, REFIID riid
,
6204 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
6206 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection3(iface
);
6207 return IDispatchEx_GetIDsOfNames(&This
->dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
6211 static HRESULT WINAPI
HTMLAttributeCollection3_Invoke(IHTMLAttributeCollection3
*iface
, DISPID dispIdMember
,
6212 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
6213 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
6215 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection3(iface
);
6216 return IDispatchEx_Invoke(&This
->dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
6217 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
6220 static HRESULT WINAPI
HTMLAttributeCollection3_getNamedItem(IHTMLAttributeCollection3
*iface
, BSTR bstrName
,
6221 IHTMLDOMAttribute
**ppNodeOut
)
6223 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection3(iface
);
6224 return IHTMLAttributeCollection2_getNamedItem(&This
->IHTMLAttributeCollection2_iface
, bstrName
, ppNodeOut
);
6227 static HRESULT WINAPI
HTMLAttributeCollection3_setNamedItem(IHTMLAttributeCollection3
*iface
,
6228 IHTMLDOMAttribute
*pNodeIn
, IHTMLDOMAttribute
**ppNodeOut
)
6230 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection3(iface
);
6231 FIXME("(%p)->(%p %p)\n", This
, pNodeIn
, ppNodeOut
);
6235 static HRESULT WINAPI
HTMLAttributeCollection3_removeNamedItem(IHTMLAttributeCollection3
*iface
,
6236 BSTR bstrName
, IHTMLDOMAttribute
**ppNodeOut
)
6238 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection3(iface
);
6239 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(bstrName
), ppNodeOut
);
6243 static HRESULT WINAPI
HTMLAttributeCollection3_item(IHTMLAttributeCollection3
*iface
, LONG index
, IHTMLDOMAttribute
**ppNodeOut
)
6245 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection3(iface
);
6246 HTMLDOMAttribute
*attr
;
6250 TRACE("(%p)->(%d %p)\n", This
, index
, ppNodeOut
);
6252 hres
= get_attr_dispid_by_idx(This
, &index
, &id
);
6253 if(hres
== DISP_E_UNKNOWNNAME
)
6254 return E_INVALIDARG
;
6258 hres
= get_domattr(This
, id
, NULL
, &attr
);
6262 *ppNodeOut
= &attr
->IHTMLDOMAttribute_iface
;
6266 static HRESULT WINAPI
HTMLAttributeCollection3_get_length(IHTMLAttributeCollection3
*iface
, LONG
*p
)
6268 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection3(iface
);
6269 return IHTMLAttributeCollection_get_length(&This
->IHTMLAttributeCollection_iface
, p
);
6272 static const IHTMLAttributeCollection3Vtbl HTMLAttributeCollection3Vtbl
= {
6273 HTMLAttributeCollection3_QueryInterface
,
6274 HTMLAttributeCollection3_AddRef
,
6275 HTMLAttributeCollection3_Release
,
6276 HTMLAttributeCollection3_GetTypeInfoCount
,
6277 HTMLAttributeCollection3_GetTypeInfo
,
6278 HTMLAttributeCollection3_GetIDsOfNames
,
6279 HTMLAttributeCollection3_Invoke
,
6280 HTMLAttributeCollection3_getNamedItem
,
6281 HTMLAttributeCollection3_setNamedItem
,
6282 HTMLAttributeCollection3_removeNamedItem
,
6283 HTMLAttributeCollection3_item
,
6284 HTMLAttributeCollection3_get_length
6287 static inline HTMLAttributeCollection
*HTMLAttributeCollection_from_DispatchEx(DispatchEx
*iface
)
6289 return CONTAINING_RECORD(iface
, HTMLAttributeCollection
, dispex
);
6292 static HRESULT
HTMLAttributeCollection_get_dispid(DispatchEx
*dispex
, BSTR name
, DWORD flags
, DISPID
*dispid
)
6294 HTMLAttributeCollection
*This
= HTMLAttributeCollection_from_DispatchEx(dispex
);
6295 HTMLDOMAttribute
*attr
;
6299 TRACE("(%p)->(%s %x %p)\n", This
, debugstr_w(name
), flags
, dispid
);
6301 hres
= get_attr_dispid_by_name(This
, name
, dispid
);
6305 hres
= get_domattr(This
, *dispid
, &pos
, &attr
);
6308 IHTMLDOMAttribute_Release(&attr
->IHTMLDOMAttribute_iface
);
6310 *dispid
= MSHTML_DISPID_CUSTOM_MIN
+pos
;
6314 static HRESULT
HTMLAttributeCollection_invoke(DispatchEx
*dispex
, DISPID id
, LCID lcid
,
6315 WORD flags
, DISPPARAMS
*params
, VARIANT
*res
, EXCEPINFO
*ei
, IServiceProvider
*caller
)
6317 HTMLAttributeCollection
*This
= HTMLAttributeCollection_from_DispatchEx(dispex
);
6319 TRACE("(%p)->(%x %x %x %p %p %p %p)\n", This
, id
, lcid
, flags
, params
, res
, ei
, caller
);
6322 case DISPATCH_PROPERTYGET
: {
6323 HTMLDOMAttribute
*iter
;
6326 pos
= id
-MSHTML_DISPID_CUSTOM_MIN
;
6328 LIST_FOR_EACH_ENTRY(iter
, &This
->attrs
, HTMLDOMAttribute
, entry
) {
6330 IHTMLDOMAttribute_AddRef(&iter
->IHTMLDOMAttribute_iface
);
6331 V_VT(res
) = VT_DISPATCH
;
6332 V_DISPATCH(res
) = (IDispatch
*)&iter
->IHTMLDOMAttribute_iface
;
6338 WARN("invalid arg\n");
6339 return E_INVALIDARG
;
6343 FIXME("unimplemented flags %x\n", flags
);
6348 static const dispex_static_data_vtbl_t HTMLAttributeCollection_dispex_vtbl
= {
6350 HTMLAttributeCollection_get_dispid
,
6351 HTMLAttributeCollection_invoke
,
6355 static const tid_t HTMLAttributeCollection_iface_tids
[] = {
6356 IHTMLAttributeCollection_tid
,
6357 IHTMLAttributeCollection2_tid
,
6358 IHTMLAttributeCollection3_tid
,
6362 static dispex_static_data_t HTMLAttributeCollection_dispex
= {
6363 &HTMLAttributeCollection_dispex_vtbl
,
6364 DispHTMLAttributeCollection_tid
,
6365 HTMLAttributeCollection_iface_tids
6368 HRESULT
HTMLElement_get_attr_col(HTMLDOMNode
*iface
, HTMLAttributeCollection
**ac
)
6370 HTMLElement
*This
= impl_from_HTMLDOMNode(iface
);
6373 IHTMLAttributeCollection_AddRef(&This
->attrs
->IHTMLAttributeCollection_iface
);
6378 This
->attrs
= heap_alloc_zero(sizeof(HTMLAttributeCollection
));
6380 return E_OUTOFMEMORY
;
6382 This
->attrs
->IHTMLAttributeCollection_iface
.lpVtbl
= &HTMLAttributeCollectionVtbl
;
6383 This
->attrs
->IHTMLAttributeCollection2_iface
.lpVtbl
= &HTMLAttributeCollection2Vtbl
;
6384 This
->attrs
->IHTMLAttributeCollection3_iface
.lpVtbl
= &HTMLAttributeCollection3Vtbl
;
6385 This
->attrs
->ref
= 2;
6387 This
->attrs
->elem
= This
;
6388 list_init(&This
->attrs
->attrs
);
6389 init_dispex(&This
->attrs
->dispex
, (IUnknown
*)&This
->attrs
->IHTMLAttributeCollection_iface
,
6390 &HTMLAttributeCollection_dispex
);