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
32 #include "wine/debug.h"
34 #include "mshtml_private.h"
35 #include "htmlevent.h"
36 #include "htmlstyle.h"
38 WINE_DEFAULT_DEBUG_CHANNEL(mshtml
);
40 #define ATTRFLAG_CASESENSITIVE 0x0001
41 #define ATTRFLAG_ASSTRING 0x0002
42 #define ATTRFLAG_EXPANDURL 0x0004
46 HRESULT (*constructor
)(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**);
49 static HRESULT
HTMLElement_Ctor(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**);
51 static const tag_desc_t tag_descs
[] = {
52 {L
"A", HTMLAnchorElement_Create
},
53 {L
"ABBR", HTMLElement_Ctor
},
54 {L
"ACRONYM", HTMLElement_Ctor
},
55 {L
"ADDRESS", HTMLElement_Ctor
},
56 {L
"APPLET", HTMLElement_Ctor
},
57 {L
"AREA", HTMLAreaElement_Create
},
58 {L
"ARTICLE", HTMLElement_Ctor
},
59 {L
"ASIDE", HTMLElement_Ctor
},
60 {L
"AUDIO", HTMLElement_Ctor
},
61 {L
"B", HTMLElement_Ctor
},
62 {L
"BASE", HTMLElement_Ctor
},
63 {L
"BASEFONT", HTMLElement_Ctor
},
64 {L
"BDO", HTMLElement_Ctor
},
65 {L
"BIG", HTMLElement_Ctor
},
66 {L
"BLOCKQUOTE", HTMLElement_Ctor
},
67 {L
"BODY", HTMLBodyElement_Create
},
68 {L
"BR", HTMLElement_Ctor
},
69 {L
"BUTTON", HTMLButtonElement_Create
},
70 {L
"CANVAS", HTMLElement_Ctor
},
71 {L
"CAPTION", HTMLElement_Ctor
},
72 {L
"CENTER", HTMLElement_Ctor
},
73 {L
"CITE", HTMLElement_Ctor
},
74 {L
"CODE", HTMLElement_Ctor
},
75 {L
"COL", HTMLElement_Ctor
},
76 {L
"COLGROUP", HTMLElement_Ctor
},
77 {L
"DATALIST", HTMLElement_Ctor
},
78 {L
"DD", HTMLElement_Ctor
},
79 {L
"DEL", HTMLElement_Ctor
},
80 {L
"DFN", HTMLElement_Ctor
},
81 {L
"DIR", HTMLElement_Ctor
},
82 {L
"DIV", HTMLElement_Ctor
},
83 {L
"DL", HTMLElement_Ctor
},
84 {L
"DT", HTMLElement_Ctor
},
85 {L
"EM", HTMLElement_Ctor
},
86 {L
"EMBED", HTMLEmbedElement_Create
},
87 {L
"FIELDSET", HTMLElement_Ctor
},
88 {L
"FIGCAPTION", HTMLElement_Ctor
},
89 {L
"FIGURE", HTMLElement_Ctor
},
90 {L
"FONT", HTMLElement_Ctor
},
91 {L
"FOOTER", HTMLElement_Ctor
},
92 {L
"FORM", HTMLFormElement_Create
},
93 {L
"FRAME", HTMLFrameElement_Create
},
94 {L
"FRAMESET", HTMLElement_Ctor
},
95 {L
"H1", HTMLElement_Ctor
},
96 {L
"H2", HTMLElement_Ctor
},
97 {L
"H3", HTMLElement_Ctor
},
98 {L
"H4", HTMLElement_Ctor
},
99 {L
"H5", HTMLElement_Ctor
},
100 {L
"H6", HTMLElement_Ctor
},
101 {L
"HEAD", HTMLHeadElement_Create
},
102 {L
"HEADER", HTMLElement_Ctor
},
103 {L
"HR", HTMLElement_Ctor
},
104 {L
"HTML", HTMLHtmlElement_Create
},
105 {L
"I", HTMLElement_Ctor
},
106 {L
"IFRAME", HTMLIFrame_Create
},
107 {L
"IMG", HTMLImgElement_Create
},
108 {L
"INPUT", HTMLInputElement_Create
},
109 {L
"INS", HTMLElement_Ctor
},
110 {L
"KBD", HTMLElement_Ctor
},
111 {L
"LABEL", HTMLLabelElement_Create
},
112 {L
"LEGEND", HTMLElement_Ctor
},
113 {L
"LI", HTMLElement_Ctor
},
114 {L
"LINK", HTMLLinkElement_Create
},
115 {L
"MAP", HTMLElement_Ctor
},
116 {L
"MARK", HTMLElement_Ctor
},
117 {L
"META", HTMLMetaElement_Create
},
118 {L
"NAV", HTMLElement_Ctor
},
119 {L
"NOFRAMES", HTMLElement_Ctor
},
120 {L
"NOSCRIPT", HTMLElement_Ctor
},
121 {L
"OBJECT", HTMLObjectElement_Create
},
122 {L
"OL", HTMLElement_Ctor
},
123 {L
"OPTGROUP", HTMLElement_Ctor
},
124 {L
"OPTION", HTMLOptionElement_Create
},
125 {L
"P", HTMLElement_Ctor
},
126 {L
"PARAM", HTMLElement_Ctor
},
127 {L
"PRE", HTMLElement_Ctor
},
128 {L
"PROGRESS", HTMLElement_Ctor
},
129 {L
"Q", HTMLElement_Ctor
},
130 {L
"RP", HTMLElement_Ctor
},
131 {L
"RT", HTMLElement_Ctor
},
132 {L
"RUBY", HTMLElement_Ctor
},
133 {L
"S", HTMLElement_Ctor
},
134 {L
"SAMP", HTMLElement_Ctor
},
135 {L
"SCRIPT", HTMLScriptElement_Create
},
136 {L
"SECTION", HTMLElement_Ctor
},
137 {L
"SELECT", HTMLSelectElement_Create
},
138 {L
"SMALL", HTMLElement_Ctor
},
139 {L
"SOURCE", HTMLElement_Ctor
},
140 {L
"SPAN", HTMLElement_Ctor
},
141 {L
"STRIKE", HTMLElement_Ctor
},
142 {L
"STRONG", HTMLElement_Ctor
},
143 {L
"STYLE", HTMLStyleElement_Create
},
144 {L
"SUB", HTMLElement_Ctor
},
145 {L
"SUP", HTMLElement_Ctor
},
146 {L
"TABLE", HTMLTable_Create
},
147 {L
"TBODY", HTMLElement_Ctor
},
148 {L
"TD", HTMLTableCell_Create
},
149 {L
"TEXTAREA", HTMLTextAreaElement_Create
},
150 {L
"TFOOT", HTMLElement_Ctor
},
151 {L
"TH", HTMLElement_Ctor
},
152 {L
"THEAD", HTMLElement_Ctor
},
153 {L
"TITLE", HTMLTitleElement_Create
},
154 {L
"TR", HTMLTableRow_Create
},
155 {L
"TRACK", HTMLElement_Ctor
},
156 {L
"TT", HTMLElement_Ctor
},
157 {L
"U", HTMLElement_Ctor
},
158 {L
"UL", HTMLElement_Ctor
},
159 {L
"VAR", HTMLElement_Ctor
},
160 {L
"VIDEO", HTMLElement_Ctor
},
161 {L
"WBR", HTMLElement_Ctor
}
164 static const tag_desc_t
*get_tag_desc(const WCHAR
*tag_name
)
166 DWORD min
=0, max
=ARRAY_SIZE(tag_descs
)-1, i
;
171 r
= wcscmp(tag_name
, tag_descs
[i
].name
);
184 HRESULT
replace_node_by_html(nsIDOMHTMLDocument
*nsdoc
, nsIDOMNode
*nsnode
, const WCHAR
*html
)
186 nsIDOMDocumentFragment
*nsfragment
;
187 nsIDOMNode
*nsparent
;
193 nsres
= nsIDOMHTMLDocument_CreateRange(nsdoc
, &range
);
194 if(NS_FAILED(nsres
)) {
195 ERR("CreateRange failed: %08lx\n", nsres
);
199 nsAString_InitDepend(&html_str
, html
);
200 nsIDOMRange_CreateContextualFragment(range
, &html_str
, &nsfragment
);
201 nsIDOMRange_Release(range
);
202 nsAString_Finish(&html_str
);
203 if(NS_FAILED(nsres
)) {
204 ERR("CreateContextualFragment failed: %08lx\n", nsres
);
208 nsres
= nsIDOMNode_GetParentNode(nsnode
, &nsparent
);
209 if(NS_SUCCEEDED(nsres
) && nsparent
) {
212 nsres
= nsIDOMNode_ReplaceChild(nsparent
, (nsIDOMNode
*)nsfragment
, nsnode
, &nstmp
);
213 nsIDOMNode_Release(nsparent
);
214 if(NS_FAILED(nsres
)) {
215 ERR("ReplaceChild failed: %08lx\n", nsres
);
218 nsIDOMNode_Release(nstmp
);
221 ERR("GetParentNode failed: %08lx\n", nsres
);
225 nsIDOMDocumentFragment_Release(nsfragment
);
229 nsresult
get_elem_attr_value(nsIDOMElement
*nselem
, const WCHAR
*name
, nsAString
*val_str
, const PRUnichar
**val
)
234 nsAString_InitDepend(&name_str
, name
);
235 nsAString_Init(val_str
, NULL
);
236 nsres
= nsIDOMElement_GetAttribute(nselem
, &name_str
, val_str
);
237 nsAString_Finish(&name_str
);
238 if(NS_FAILED(nsres
)) {
239 ERR("GetAttribute(%s) failed: %08lx\n", debugstr_w(name
), nsres
);
240 nsAString_Finish(val_str
);
244 nsAString_GetData(val_str
, val
);
248 HRESULT
elem_string_attr_getter(HTMLElement
*elem
, const WCHAR
*name
, BOOL use_null
, BSTR
*p
)
250 const PRUnichar
*val
;
255 nsres
= get_elem_attr_value(elem
->dom_element
, name
, &val_str
, &val
);
259 TRACE("%s: returning %s\n", debugstr_w(name
), debugstr_w(val
));
261 if(*val
|| !use_null
) {
262 *p
= SysAllocString(val
);
264 hres
= E_OUTOFMEMORY
;
268 nsAString_Finish(&val_str
);
272 HRESULT
elem_string_attr_setter(HTMLElement
*elem
, const WCHAR
*name
, const WCHAR
*value
)
274 nsAString name_str
, val_str
;
277 nsAString_InitDepend(&name_str
, name
);
278 nsAString_InitDepend(&val_str
, value
);
279 nsres
= nsIDOMElement_SetAttribute(elem
->dom_element
, &name_str
, &val_str
);
280 nsAString_Finish(&name_str
);
281 nsAString_Finish(&val_str
);
283 if(NS_FAILED(nsres
)) {
284 WARN("SetAttribute failed: %08lx\n", nsres
);
291 static VARIANT_BOOL
element_has_attribute(HTMLElement
*element
, const WCHAR
*name
)
297 if(!element
->dom_element
) {
298 WARN("no DOM element\n");
299 return VARIANT_FALSE
;
302 nsAString_InitDepend(&name_str
, name
);
303 nsres
= nsIDOMElement_HasAttribute(element
->dom_element
, &name_str
, &r
);
304 return variant_bool(NS_SUCCEEDED(nsres
) && r
);
307 static HRESULT
element_remove_attribute(HTMLElement
*element
, const WCHAR
*name
)
312 if(!element
->dom_element
) {
313 WARN("no DOM element\n");
317 nsAString_InitDepend(&name_str
, name
);
318 nsres
= nsIDOMElement_RemoveAttribute(element
->dom_element
, &name_str
);
319 nsAString_Finish(&name_str
);
320 return map_nsresult(nsres
);
323 HRESULT
get_readystate_string(READYSTATE readystate
, BSTR
*p
)
325 static const LPCWSTR readystate_strs
[] = {
333 assert(readystate
<= READYSTATE_COMPLETE
);
334 *p
= SysAllocString(readystate_strs
[readystate
]);
335 return *p
? S_OK
: E_OUTOFMEMORY
;
341 IHTMLFiltersCollection IHTMLFiltersCollection_iface
;
344 } HTMLFiltersCollection
;
346 static inline HTMLFiltersCollection
*impl_from_IHTMLFiltersCollection(IHTMLFiltersCollection
*iface
)
348 return CONTAINING_RECORD(iface
, HTMLFiltersCollection
, IHTMLFiltersCollection_iface
);
351 static HRESULT
create_filters_collection(compat_mode_t compat_mode
, IHTMLFiltersCollection
**ret
);
353 static inline HTMLElement
*impl_from_IHTMLElement(IHTMLElement
*iface
)
355 return CONTAINING_RECORD(iface
, HTMLElement
, IHTMLElement_iface
);
358 static HRESULT
copy_nselem_attrs(nsIDOMElement
*nselem_with_attrs
, nsIDOMElement
*nselem
)
360 nsIDOMMozNamedAttrMap
*attrs
;
361 nsAString name_str
, val_str
;
362 nsresult nsres
, nsres2
;
366 nsres
= nsIDOMElement_GetAttributes(nselem_with_attrs
, &attrs
);
370 nsres
= nsIDOMMozNamedAttrMap_GetLength(attrs
, &length
);
371 if(NS_FAILED(nsres
)) {
372 nsIDOMMozNamedAttrMap_Release(attrs
);
376 nsAString_Init(&name_str
, NULL
);
377 nsAString_Init(&val_str
, NULL
);
378 for(i
= 0; i
< length
; i
++) {
379 nsres
= nsIDOMMozNamedAttrMap_Item(attrs
, i
, &attr
);
383 nsres
= nsIDOMAttr_GetNodeName(attr
, &name_str
);
384 nsres2
= nsIDOMAttr_GetNodeValue(attr
, &val_str
);
385 nsIDOMAttr_Release(attr
);
386 if(NS_FAILED(nsres
) || NS_FAILED(nsres2
))
389 nsIDOMElement_SetAttribute(nselem
, &name_str
, &val_str
);
391 nsAString_Finish(&name_str
);
392 nsAString_Finish(&val_str
);
394 nsIDOMMozNamedAttrMap_Release(attrs
);
398 static HRESULT
create_nselem_parse(HTMLDocumentNode
*doc
, const WCHAR
*tag
, nsIDOMElement
**ret
)
400 static const WCHAR prefix
[4] = L
"<FOO";
401 nsIDOMDocumentFragment
*nsfragment
;
402 WCHAR
*p
= wcschr(tag
+ 1, '>');
403 UINT32 i
, name_len
, size
;
404 nsIDOMElement
*nselem
;
405 nsIDOMRange
*nsrange
;
411 if(!p
|| p
[1] || wcschr(tag
+ 1, '<'))
414 WARN("NULL nsdoc\n");
418 /* Ignore the starting token and > or /> end token */
419 name_len
= p
- tag
- 1 - (p
[-1] == '/');
421 /* Get the tag name using HTML whitespace rules */
422 for(i
= 1; i
<= name_len
; i
++) {
423 if((tag
[i
] >= 0x09 && tag
[i
] <= 0x0d) || tag
[i
] == ' ') {
430 size
= (p
+ 2 - (tag
+ 1 + name_len
)) * sizeof(WCHAR
);
432 /* Parse the input via a contextual fragment, using a dummy unknown tag */
433 nsres
= nsIDOMHTMLDocument_CreateRange(doc
->nsdoc
, &nsrange
);
435 return map_nsresult(nsres
);
437 if(!(p
= heap_alloc(sizeof(prefix
) + size
))) {
438 nsIDOMRange_Release(nsrange
);
439 return E_OUTOFMEMORY
;
441 memcpy(p
, prefix
, sizeof(prefix
));
442 memcpy(p
+ ARRAY_SIZE(prefix
), tag
+ 1 + name_len
, size
);
444 nsAString_InitDepend(&str
, p
);
445 nsIDOMRange_CreateContextualFragment(nsrange
, &str
, &nsfragment
);
446 nsIDOMRange_Release(nsrange
);
447 nsAString_Finish(&str
);
450 return map_nsresult(nsres
);
452 /* Grab the parsed element and copy its attributes into the proper element */
453 nsres
= nsIDOMDocumentFragment_GetFirstChild(nsfragment
, &nsnode
);
454 nsIDOMDocumentFragment_Release(nsfragment
);
455 if(NS_FAILED(nsres
) || !nsnode
)
458 nsres
= nsIDOMNode_QueryInterface(nsnode
, &IID_nsIDOMElement
, (void**)&nselem
);
459 nsIDOMNode_Release(nsnode
);
463 if(!(p
= heap_alloc((name_len
+ 1) * sizeof(WCHAR
))))
464 hres
= E_OUTOFMEMORY
;
466 memcpy(p
, tag
+ 1, name_len
* sizeof(WCHAR
));
469 nsAString_InitDepend(&str
, p
);
470 nsres
= nsIDOMHTMLDocument_CreateElement(doc
->nsdoc
, &str
, ret
);
471 nsAString_Finish(&str
);
475 hres
= map_nsresult(nsres
);
477 hres
= copy_nselem_attrs(nselem
, *ret
);
479 nsIDOMElement_Release(*ret
);
482 nsIDOMElement_Release(nselem
);
486 HRESULT
create_nselem(HTMLDocumentNode
*doc
, const WCHAR
*tag
, nsIDOMElement
**ret
)
492 WARN("NULL nsdoc\n");
496 nsAString_InitDepend(&tag_str
, tag
);
497 nsres
= nsIDOMHTMLDocument_CreateElement(doc
->nsdoc
, &tag_str
, ret
);
498 nsAString_Finish(&tag_str
);
499 if(NS_FAILED(nsres
)) {
500 ERR("CreateElement failed: %08lx\n", nsres
);
507 HRESULT
create_element(HTMLDocumentNode
*doc
, const WCHAR
*tag
, HTMLElement
**ret
)
509 nsIDOMElement
*nselem
;
512 /* Use owner doc if called on document fragment */
516 /* IE8 and below allow creating elements with attributes, such as <div class="a"> */
517 if(tag
[0] == '<' && dispex_compat_mode(&doc
->node
.event_target
.dispex
) <= COMPAT_MODE_IE8
)
518 hres
= create_nselem_parse(doc
, tag
, &nselem
);
520 hres
= create_nselem(doc
, tag
, &nselem
);
524 hres
= HTMLElement_Create(doc
, (nsIDOMNode
*)nselem
, TRUE
, ret
);
525 nsIDOMElement_Release(nselem
);
531 IHTMLRect IHTMLRect_iface
;
535 nsIDOMClientRect
*nsrect
;
538 static inline HTMLRect
*impl_from_IHTMLRect(IHTMLRect
*iface
)
540 return CONTAINING_RECORD(iface
, HTMLRect
, IHTMLRect_iface
);
543 static HRESULT WINAPI
HTMLRect_QueryInterface(IHTMLRect
*iface
, REFIID riid
, void **ppv
)
545 HTMLRect
*This
= impl_from_IHTMLRect(iface
);
547 TRACE("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
549 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
550 *ppv
= &This
->IHTMLRect_iface
;
551 }else if(IsEqualGUID(&IID_IHTMLRect
, riid
)) {
552 *ppv
= &This
->IHTMLRect_iface
;
553 }else if(dispex_query_interface(&This
->dispex
, riid
, ppv
)) {
554 return *ppv
? S_OK
: E_NOINTERFACE
;
556 FIXME("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
558 return E_NOINTERFACE
;
561 IUnknown_AddRef((IUnknown
*)*ppv
);
565 static ULONG WINAPI
HTMLRect_AddRef(IHTMLRect
*iface
)
567 HTMLRect
*This
= impl_from_IHTMLRect(iface
);
568 LONG ref
= InterlockedIncrement(&This
->ref
);
570 TRACE("(%p) ref=%ld\n", This
, ref
);
575 static ULONG WINAPI
HTMLRect_Release(IHTMLRect
*iface
)
577 HTMLRect
*This
= impl_from_IHTMLRect(iface
);
578 LONG ref
= InterlockedDecrement(&This
->ref
);
580 TRACE("(%p) ref=%ld\n", This
, ref
);
584 nsIDOMClientRect_Release(This
->nsrect
);
585 release_dispex(&This
->dispex
);
592 static HRESULT WINAPI
HTMLRect_GetTypeInfoCount(IHTMLRect
*iface
, UINT
*pctinfo
)
594 HTMLRect
*This
= impl_from_IHTMLRect(iface
);
595 FIXME("(%p)->(%p)\n", This
, pctinfo
);
599 static HRESULT WINAPI
HTMLRect_GetTypeInfo(IHTMLRect
*iface
, UINT iTInfo
,
600 LCID lcid
, ITypeInfo
**ppTInfo
)
602 HTMLRect
*This
= impl_from_IHTMLRect(iface
);
604 return IDispatchEx_GetTypeInfo(&This
->dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
607 static HRESULT WINAPI
HTMLRect_GetIDsOfNames(IHTMLRect
*iface
, REFIID riid
,
608 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
610 HTMLRect
*This
= impl_from_IHTMLRect(iface
);
612 return IDispatchEx_GetIDsOfNames(&This
->dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
616 static HRESULT WINAPI
HTMLRect_Invoke(IHTMLRect
*iface
, DISPID dispIdMember
,
617 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
618 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
620 HTMLRect
*This
= impl_from_IHTMLRect(iface
);
622 return IDispatchEx_Invoke(&This
->dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
, wFlags
,
623 pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
626 static HRESULT WINAPI
HTMLRect_put_left(IHTMLRect
*iface
, LONG v
)
628 HTMLRect
*This
= impl_from_IHTMLRect(iface
);
629 FIXME("(%p)->(%ld)\n", This
, v
);
633 static HRESULT WINAPI
HTMLRect_get_left(IHTMLRect
*iface
, LONG
*p
)
635 HTMLRect
*This
= impl_from_IHTMLRect(iface
);
639 TRACE("(%p)->(%p)\n", This
, p
);
641 nsres
= nsIDOMClientRect_GetLeft(This
->nsrect
, &left
);
642 if(NS_FAILED(nsres
)) {
643 ERR("GetLeft failed: %08lx\n", nsres
);
647 *p
= floor(left
+0.5);
651 static HRESULT WINAPI
HTMLRect_put_top(IHTMLRect
*iface
, LONG v
)
653 HTMLRect
*This
= impl_from_IHTMLRect(iface
);
654 FIXME("(%p)->(%ld)\n", This
, v
);
658 static HRESULT WINAPI
HTMLRect_get_top(IHTMLRect
*iface
, LONG
*p
)
660 HTMLRect
*This
= impl_from_IHTMLRect(iface
);
664 TRACE("(%p)->(%p)\n", This
, p
);
666 nsres
= nsIDOMClientRect_GetTop(This
->nsrect
, &top
);
667 if(NS_FAILED(nsres
)) {
668 ERR("GetTop failed: %08lx\n", nsres
);
676 static HRESULT WINAPI
HTMLRect_put_right(IHTMLRect
*iface
, LONG v
)
678 HTMLRect
*This
= impl_from_IHTMLRect(iface
);
679 FIXME("(%p)->(%ld)\n", This
, v
);
683 static HRESULT WINAPI
HTMLRect_get_right(IHTMLRect
*iface
, LONG
*p
)
685 HTMLRect
*This
= impl_from_IHTMLRect(iface
);
689 TRACE("(%p)->(%p)\n", This
, p
);
691 nsres
= nsIDOMClientRect_GetRight(This
->nsrect
, &right
);
692 if(NS_FAILED(nsres
)) {
693 ERR("GetRight failed: %08lx\n", nsres
);
697 *p
= floor(right
+0.5);
701 static HRESULT WINAPI
HTMLRect_put_bottom(IHTMLRect
*iface
, LONG v
)
703 HTMLRect
*This
= impl_from_IHTMLRect(iface
);
704 FIXME("(%p)->(%ld)\n", This
, v
);
708 static HRESULT WINAPI
HTMLRect_get_bottom(IHTMLRect
*iface
, LONG
*p
)
710 HTMLRect
*This
= impl_from_IHTMLRect(iface
);
714 TRACE("(%p)->(%p)\n", This
, p
);
716 nsres
= nsIDOMClientRect_GetBottom(This
->nsrect
, &bottom
);
717 if(NS_FAILED(nsres
)) {
718 ERR("GetBottom failed: %08lx\n", nsres
);
722 *p
= floor(bottom
+0.5);
726 static const IHTMLRectVtbl HTMLRectVtbl
= {
727 HTMLRect_QueryInterface
,
730 HTMLRect_GetTypeInfoCount
,
731 HTMLRect_GetTypeInfo
,
732 HTMLRect_GetIDsOfNames
,
744 static const tid_t HTMLRect_iface_tids
[] = {
748 static dispex_static_data_t HTMLRect_dispex
= {
755 static HRESULT
create_html_rect(nsIDOMClientRect
*nsrect
, compat_mode_t compat_mode
, IHTMLRect
**ret
)
759 rect
= heap_alloc_zero(sizeof(HTMLRect
));
761 return E_OUTOFMEMORY
;
763 rect
->IHTMLRect_iface
.lpVtbl
= &HTMLRectVtbl
;
766 init_dispatch(&rect
->dispex
, (IUnknown
*)&rect
->IHTMLRect_iface
, &HTMLRect_dispex
, compat_mode
);
768 nsIDOMClientRect_AddRef(nsrect
);
769 rect
->nsrect
= nsrect
;
771 *ret
= &rect
->IHTMLRect_iface
;
777 IHTMLRectCollection IHTMLRectCollection_iface
;
781 nsIDOMClientRectList
*rect_list
;
782 } HTMLRectCollection
;
785 IEnumVARIANT IEnumVARIANT_iface
;
790 HTMLRectCollection
*col
;
791 } HTMLRectCollectionEnum
;
793 static inline HTMLRectCollectionEnum
*HTMLRectCollectionEnum_from_IEnumVARIANT(IEnumVARIANT
*iface
)
795 return CONTAINING_RECORD(iface
, HTMLRectCollectionEnum
, IEnumVARIANT_iface
);
798 static HRESULT WINAPI
HTMLRectCollectionEnum_QueryInterface(IEnumVARIANT
*iface
, REFIID riid
, void **ppv
)
800 HTMLRectCollectionEnum
*This
= HTMLRectCollectionEnum_from_IEnumVARIANT(iface
);
802 TRACE("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
804 if(IsEqualGUID(riid
, &IID_IUnknown
)) {
805 *ppv
= &This
->IEnumVARIANT_iface
;
806 }else if(IsEqualGUID(riid
, &IID_IEnumVARIANT
)) {
807 *ppv
= &This
->IEnumVARIANT_iface
;
809 FIXME("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
811 return E_NOINTERFACE
;
814 IUnknown_AddRef((IUnknown
*)*ppv
);
818 static ULONG WINAPI
HTMLRectCollectionEnum_AddRef(IEnumVARIANT
*iface
)
820 HTMLRectCollectionEnum
*This
= HTMLRectCollectionEnum_from_IEnumVARIANT(iface
);
821 LONG ref
= InterlockedIncrement(&This
->ref
);
823 TRACE("(%p) ref=%ld\n", This
, ref
);
828 static ULONG WINAPI
HTMLRectCollectionEnum_Release(IEnumVARIANT
*iface
)
830 HTMLRectCollectionEnum
*This
= HTMLRectCollectionEnum_from_IEnumVARIANT(iface
);
831 LONG ref
= InterlockedDecrement(&This
->ref
);
833 TRACE("(%p) ref=%ld\n", This
, ref
);
836 IHTMLRectCollection_Release(&This
->col
->IHTMLRectCollection_iface
);
843 static HRESULT WINAPI
HTMLRectCollectionEnum_Next(IEnumVARIANT
*iface
, ULONG celt
, VARIANT
*rgVar
, ULONG
*pCeltFetched
)
845 HTMLRectCollectionEnum
*This
= HTMLRectCollectionEnum_from_IEnumVARIANT(iface
);
851 TRACE("(%p)->(%lu %p %p)\n", This
, celt
, rgVar
, pCeltFetched
);
853 nsIDOMClientRectList_GetLength(This
->col
->rect_list
, &len
);
854 num
= min(len
- This
->iter
, celt
);
855 V_VT(&index
) = VT_I4
;
857 for(i
= 0; i
< num
; i
++) {
858 V_I4(&index
) = This
->iter
+ i
;
859 hres
= IHTMLRectCollection_item(&This
->col
->IHTMLRectCollection_iface
, &index
, &rgVar
[i
]);
862 VariantClear(&rgVar
[i
]);
870 return num
== celt
? S_OK
: S_FALSE
;
873 static HRESULT WINAPI
HTMLRectCollectionEnum_Skip(IEnumVARIANT
*iface
, ULONG celt
)
875 HTMLRectCollectionEnum
*This
= HTMLRectCollectionEnum_from_IEnumVARIANT(iface
);
878 TRACE("(%p)->(%lu)\n", This
, celt
);
880 nsIDOMClientRectList_GetLength(This
->col
->rect_list
, &len
);
881 if(This
->iter
+ celt
> len
) {
890 static HRESULT WINAPI
HTMLRectCollectionEnum_Reset(IEnumVARIANT
*iface
)
892 HTMLRectCollectionEnum
*This
= HTMLRectCollectionEnum_from_IEnumVARIANT(iface
);
894 TRACE("(%p)->()\n", This
);
900 static HRESULT WINAPI
HTMLRectCollectionEnum_Clone(IEnumVARIANT
*iface
, IEnumVARIANT
**ppEnum
)
902 HTMLRectCollectionEnum
*This
= HTMLRectCollectionEnum_from_IEnumVARIANT(iface
);
903 FIXME("(%p)->(%p)\n", This
, ppEnum
);
907 static const IEnumVARIANTVtbl HTMLRectCollectionEnumVtbl
= {
908 HTMLRectCollectionEnum_QueryInterface
,
909 HTMLRectCollectionEnum_AddRef
,
910 HTMLRectCollectionEnum_Release
,
911 HTMLRectCollectionEnum_Next
,
912 HTMLRectCollectionEnum_Skip
,
913 HTMLRectCollectionEnum_Reset
,
914 HTMLRectCollectionEnum_Clone
917 static inline HTMLRectCollection
*impl_from_IHTMLRectCollection(IHTMLRectCollection
*iface
)
919 return CONTAINING_RECORD(iface
, HTMLRectCollection
, IHTMLRectCollection_iface
);
922 static HRESULT WINAPI
HTMLRectCollection_QueryInterface(IHTMLRectCollection
*iface
, REFIID riid
, void **ppv
)
924 HTMLRectCollection
*This
= impl_from_IHTMLRectCollection(iface
);
926 TRACE("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
928 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
929 *ppv
= &This
->IHTMLRectCollection_iface
;
930 }else if(IsEqualGUID(&IID_IHTMLRectCollection
, riid
)) {
931 *ppv
= &This
->IHTMLRectCollection_iface
;
932 }else if(dispex_query_interface(&This
->dispex
, riid
, ppv
)) {
933 return *ppv
? S_OK
: E_NOINTERFACE
;
935 FIXME("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
937 return E_NOINTERFACE
;
940 IUnknown_AddRef((IUnknown
*)*ppv
);
944 static ULONG WINAPI
HTMLRectCollection_AddRef(IHTMLRectCollection
*iface
)
946 HTMLRectCollection
*This
= impl_from_IHTMLRectCollection(iface
);
947 LONG ref
= InterlockedIncrement(&This
->ref
);
949 TRACE("(%p) ref=%ld\n", This
, ref
);
954 static ULONG WINAPI
HTMLRectCollection_Release(IHTMLRectCollection
*iface
)
956 HTMLRectCollection
*This
= impl_from_IHTMLRectCollection(iface
);
957 LONG ref
= InterlockedDecrement(&This
->ref
);
959 TRACE("(%p) ref=%ld\n", This
, ref
);
963 nsIDOMClientRectList_Release(This
->rect_list
);
964 release_dispex(&This
->dispex
);
971 static HRESULT WINAPI
HTMLRectCollection_GetTypeInfoCount(IHTMLRectCollection
*iface
, UINT
*pctinfo
)
973 HTMLRectCollection
*This
= impl_from_IHTMLRectCollection(iface
);
974 FIXME("(%p)->(%p)\n", This
, pctinfo
);
978 static HRESULT WINAPI
HTMLRectCollection_GetTypeInfo(IHTMLRectCollection
*iface
, UINT iTInfo
,
979 LCID lcid
, ITypeInfo
**ppTInfo
)
981 HTMLRectCollection
*This
= impl_from_IHTMLRectCollection(iface
);
982 return IDispatchEx_GetTypeInfo(&This
->dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
985 static HRESULT WINAPI
HTMLRectCollection_GetIDsOfNames(IHTMLRectCollection
*iface
, REFIID riid
,
986 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
988 HTMLRectCollection
*This
= impl_from_IHTMLRectCollection(iface
);
989 return IDispatchEx_GetIDsOfNames(&This
->dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
993 static HRESULT WINAPI
HTMLRectCollection_Invoke(IHTMLRectCollection
*iface
, DISPID dispIdMember
,
994 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
995 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
997 HTMLRectCollection
*This
= impl_from_IHTMLRectCollection(iface
);
998 return IDispatchEx_Invoke(&This
->dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
, wFlags
,
999 pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
1002 static HRESULT WINAPI
HTMLRectCollection_get_length(IHTMLRectCollection
*iface
, LONG
*p
)
1004 HTMLRectCollection
*This
= impl_from_IHTMLRectCollection(iface
);
1008 TRACE("(%p)->(%p)\n", This
, p
);
1010 nsres
= nsIDOMClientRectList_GetLength(This
->rect_list
, &length
);
1011 assert(nsres
== NS_OK
);
1016 static HRESULT WINAPI
HTMLRectCollection_get__newEnum(IHTMLRectCollection
*iface
, IUnknown
**p
)
1018 HTMLRectCollection
*This
= impl_from_IHTMLRectCollection(iface
);
1019 HTMLRectCollectionEnum
*ret
;
1021 TRACE("(%p)->(%p)\n", This
, p
);
1023 ret
= heap_alloc(sizeof(*ret
));
1025 return E_OUTOFMEMORY
;
1027 ret
->IEnumVARIANT_iface
.lpVtbl
= &HTMLRectCollectionEnumVtbl
;
1031 HTMLRectCollection_AddRef(&This
->IHTMLRectCollection_iface
);
1034 *p
= (IUnknown
*)&ret
->IEnumVARIANT_iface
;
1038 static HRESULT WINAPI
HTMLRectCollection_item(IHTMLRectCollection
*iface
, VARIANT
*index
, VARIANT
*result
)
1040 HTMLRectCollection
*This
= impl_from_IHTMLRectCollection(iface
);
1041 nsIDOMClientRect
*nsrect
;
1046 TRACE("(%p)->(%s %p)\n", This
, debugstr_variant(index
), result
);
1048 if(V_VT(index
) != VT_I4
|| V_I4(index
) < 0) {
1049 FIXME("Unsupported for %s index\n", debugstr_variant(index
));
1053 nsres
= nsIDOMClientRectList_Item(This
->rect_list
, V_I4(index
), &nsrect
);
1054 if(NS_FAILED(nsres
))
1055 return map_nsresult(nsres
);
1057 V_VT(result
) = VT_NULL
;
1061 hres
= create_html_rect(nsrect
, dispex_compat_mode(&This
->dispex
), &rect
);
1062 nsIDOMClientRect_Release(nsrect
);
1066 V_VT(result
) = VT_DISPATCH
;
1067 V_DISPATCH(result
) = (IDispatch
*)rect
;
1071 static const IHTMLRectCollectionVtbl HTMLRectCollectionVtbl
= {
1072 HTMLRectCollection_QueryInterface
,
1073 HTMLRectCollection_AddRef
,
1074 HTMLRectCollection_Release
,
1075 HTMLRectCollection_GetTypeInfoCount
,
1076 HTMLRectCollection_GetTypeInfo
,
1077 HTMLRectCollection_GetIDsOfNames
,
1078 HTMLRectCollection_Invoke
,
1079 HTMLRectCollection_get_length
,
1080 HTMLRectCollection_get__newEnum
,
1081 HTMLRectCollection_item
1084 static inline HTMLRectCollection
*HTMLRectCollection_from_DispatchEx(DispatchEx
*iface
)
1086 return CONTAINING_RECORD(iface
, HTMLRectCollection
, dispex
);
1089 static HRESULT
HTMLRectCollection_get_dispid(DispatchEx
*dispex
, BSTR name
, DWORD flags
, DISPID
*dispid
)
1091 HTMLRectCollection
*This
= HTMLRectCollection_from_DispatchEx(dispex
);
1096 for(ptr
= name
; *ptr
&& is_digit(*ptr
); ptr
++)
1097 idx
= idx
*10 + (*ptr
-'0');
1099 return DISP_E_UNKNOWNNAME
;
1101 nsIDOMClientRectList_GetLength(This
->rect_list
, &len
);
1103 return DISP_E_UNKNOWNNAME
;
1105 *dispid
= MSHTML_DISPID_CUSTOM_MIN
+ idx
;
1106 TRACE("ret %lx\n", *dispid
);
1110 static HRESULT
HTMLRectCollection_get_name(DispatchEx
*dispex
, DISPID id
, BSTR
*name
)
1112 HTMLRectCollection
*This
= HTMLRectCollection_from_DispatchEx(dispex
);
1113 DWORD idx
= id
- MSHTML_DISPID_CUSTOM_MIN
;
1117 nsIDOMClientRectList_GetLength(This
->rect_list
, &len
);
1119 return DISP_E_MEMBERNOTFOUND
;
1121 len
= swprintf(buf
, ARRAY_SIZE(buf
), L
"%u", idx
);
1122 return (*name
= SysAllocStringLen(buf
, len
)) ? S_OK
: E_OUTOFMEMORY
;
1125 static HRESULT
HTMLRectCollection_invoke(DispatchEx
*dispex
, DISPID id
, LCID lcid
, WORD flags
, DISPPARAMS
*params
,
1126 VARIANT
*res
, EXCEPINFO
*ei
, IServiceProvider
*caller
)
1128 HTMLRectCollection
*This
= HTMLRectCollection_from_DispatchEx(dispex
);
1130 TRACE("(%p)->(%lx %lx %x %p %p %p %p)\n", This
, id
, lcid
, flags
, params
, res
, ei
, caller
);
1133 case DISPATCH_PROPERTYGET
: {
1134 nsIDOMClientRect
*rect
;
1135 IHTMLRect
*html_rect
;
1139 nsres
= nsIDOMClientRectList_Item(This
->rect_list
, id
- MSHTML_DISPID_CUSTOM_MIN
, &rect
);
1140 if(NS_FAILED(nsres
) || !rect
) {
1141 WARN("Unknown item\n");
1142 return DISP_E_MEMBERNOTFOUND
;
1145 hres
= create_html_rect(rect
, dispex_compat_mode(&This
->dispex
), &html_rect
);
1146 nsIDOMClientRect_Release(rect
);
1150 V_VT(res
) = VT_DISPATCH
;
1151 V_DISPATCH(res
) = (IDispatch
*)html_rect
;
1156 FIXME("unimplemented flags %x\n", flags
);
1163 static const dispex_static_data_vtbl_t HTMLRectCollection_dispex_vtbl
= {
1165 HTMLRectCollection_get_dispid
,
1166 HTMLRectCollection_get_name
,
1167 HTMLRectCollection_invoke
,
1170 static const tid_t HTMLRectCollection_iface_tids
[] = {
1171 IHTMLRectCollection_tid
,
1174 static dispex_static_data_t HTMLRectCollection_dispex
= {
1176 &HTMLRectCollection_dispex_vtbl
,
1177 IHTMLRectCollection_tid
,
1178 HTMLRectCollection_iface_tids
1181 static HRESULT WINAPI
HTMLElement_QueryInterface(IHTMLElement
*iface
,
1182 REFIID riid
, void **ppv
)
1184 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1186 return IHTMLDOMNode_QueryInterface(&This
->node
.IHTMLDOMNode_iface
, riid
, ppv
);
1189 static ULONG WINAPI
HTMLElement_AddRef(IHTMLElement
*iface
)
1191 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1193 return IHTMLDOMNode_AddRef(&This
->node
.IHTMLDOMNode_iface
);
1196 static ULONG WINAPI
HTMLElement_Release(IHTMLElement
*iface
)
1198 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1200 return IHTMLDOMNode_Release(&This
->node
.IHTMLDOMNode_iface
);
1203 static HRESULT WINAPI
HTMLElement_GetTypeInfoCount(IHTMLElement
*iface
, UINT
*pctinfo
)
1205 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1206 return IDispatchEx_GetTypeInfoCount(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
1209 static HRESULT WINAPI
HTMLElement_GetTypeInfo(IHTMLElement
*iface
, UINT iTInfo
,
1210 LCID lcid
, ITypeInfo
**ppTInfo
)
1212 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1213 return IDispatchEx_GetTypeInfo(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
1216 static HRESULT WINAPI
HTMLElement_GetIDsOfNames(IHTMLElement
*iface
, REFIID riid
,
1217 LPOLESTR
*rgszNames
, UINT cNames
,
1218 LCID lcid
, DISPID
*rgDispId
)
1220 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1221 return IDispatchEx_GetIDsOfNames(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
1225 static HRESULT WINAPI
HTMLElement_Invoke(IHTMLElement
*iface
, DISPID dispIdMember
,
1226 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
1227 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
1229 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1230 return IDispatchEx_Invoke(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
1231 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
1234 static inline WCHAR
*translate_attr_name(WCHAR
*attr_name
, compat_mode_t compat_mode
)
1236 static WCHAR classNameW
[] = L
"className";
1237 WCHAR
*ret
= attr_name
;
1239 if(compat_mode
>= COMPAT_MODE_IE8
&& !wcsicmp(attr_name
, L
"class"))
1244 static HRESULT
set_elem_attr_value_by_dispid(HTMLElement
*elem
, DISPID dispid
, VARIANT
*v
)
1246 DISPID propput_dispid
= DISPID_PROPERTYPUT
;
1247 DISPPARAMS dp
= {v
, &propput_dispid
, 1, 1};
1250 if(dispid
== DISPID_IHTMLELEMENT_STYLE
) {
1251 TRACE("Ignoring call on style attribute\n");
1255 return IDispatchEx_InvokeEx(&elem
->node
.event_target
.dispex
.IDispatchEx_iface
, dispid
,
1256 LOCALE_SYSTEM_DEFAULT
, DISPATCH_PROPERTYPUT
, &dp
, NULL
, &ei
, NULL
);
1259 static HRESULT WINAPI
HTMLElement_setAttribute(IHTMLElement
*iface
, BSTR strAttributeName
,
1260 VARIANT AttributeValue
, LONG lFlags
)
1262 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1263 compat_mode_t compat_mode
= dispex_compat_mode(&This
->node
.event_target
.dispex
);
1264 nsAString name_str
, value_str
;
1265 VARIANT val
= AttributeValue
;
1266 BOOL needs_free
= FALSE
;
1271 TRACE("(%p)->(%s %s %08lx)\n", This
, debugstr_w(strAttributeName
), debugstr_variant(&AttributeValue
), lFlags
);
1273 if(compat_mode
< COMPAT_MODE_IE9
|| !This
->dom_element
) {
1274 hres
= IDispatchEx_GetDispID(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, translate_attr_name(strAttributeName
, compat_mode
),
1275 (lFlags
&ATTRFLAG_CASESENSITIVE
? fdexNameCaseSensitive
: fdexNameCaseInsensitive
) | fdexNameEnsure
, &dispid
);
1279 if(compat_mode
>= COMPAT_MODE_IE8
&& get_dispid_type(dispid
) == DISPEXPROP_BUILTIN
) {
1280 if(V_VT(&val
) != VT_BSTR
&& V_VT(&val
) != VT_NULL
) {
1281 LCID lcid
= MAKELCID(MAKELANGID(LANG_ENGLISH
,SUBLANG_ENGLISH_US
),SORT_DEFAULT
);
1283 V_VT(&val
) = VT_EMPTY
;
1284 hres
= VariantChangeTypeEx(&val
, &AttributeValue
, lcid
, 0, VT_BSTR
);
1291 V_VT(&val
) = VT_NULL
;
1295 /* className and style are special cases */
1296 if(compat_mode
!= COMPAT_MODE_IE8
|| !This
->dom_element
||
1297 (dispid
!= DISPID_IHTMLELEMENT_CLASSNAME
&& dispid
!= DISPID_IHTMLELEMENT_STYLE
)) {
1298 hres
= set_elem_attr_value_by_dispid(This
, dispid
, &val
);
1303 hres
= variant_to_nsstr(&val
, FALSE
, &value_str
);
1307 nsAString_InitDepend(&name_str
, strAttributeName
);
1308 nsres
= nsIDOMElement_SetAttribute(This
->dom_element
, &name_str
, &value_str
);
1309 nsAString_Finish(&name_str
);
1310 nsAString_Finish(&value_str
);
1311 if(NS_FAILED(nsres
))
1312 WARN("SetAttribute failed: %08lx\n", nsres
);
1313 hres
= map_nsresult(nsres
);
1317 SysFreeString(V_BSTR(&val
));
1321 HRESULT
get_elem_attr_value_by_dispid(HTMLElement
*elem
, DISPID dispid
, VARIANT
*ret
)
1323 DISPPARAMS dispParams
= {NULL
, NULL
, 0, 0};
1326 return IDispatchEx_InvokeEx(&elem
->node
.event_target
.dispex
.IDispatchEx_iface
, dispid
, LOCALE_SYSTEM_DEFAULT
,
1327 DISPATCH_PROPERTYGET
, &dispParams
, ret
, &excep
, NULL
);
1330 HRESULT
attr_value_to_string(VARIANT
*v
)
1338 V_BSTR(v
) = SysAllocString(L
"null");
1340 return E_OUTOFMEMORY
;
1344 IDispatch_Release(V_DISPATCH(v
));
1346 V_BSTR(v
) = SysAllocString(NULL
);
1349 hres
= VariantChangeType(v
, v
, 0, VT_BSTR
);
1357 static HRESULT WINAPI
HTMLElement_getAttribute(IHTMLElement
*iface
, BSTR strAttributeName
,
1358 LONG lFlags
, VARIANT
*AttributeValue
)
1360 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1361 compat_mode_t compat_mode
= dispex_compat_mode(&This
->node
.event_target
.dispex
);
1362 nsAString name_str
, value_str
;
1367 TRACE("(%p)->(%s %08lx %p)\n", This
, debugstr_w(strAttributeName
), lFlags
, AttributeValue
);
1369 if(lFlags
& ~(ATTRFLAG_CASESENSITIVE
|ATTRFLAG_ASSTRING
))
1370 FIXME("Unsupported flags %lx\n", lFlags
);
1372 if(compat_mode
< COMPAT_MODE_IE9
|| !This
->dom_element
) {
1373 hres
= IDispatchEx_GetDispID(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, translate_attr_name(strAttributeName
, compat_mode
),
1374 lFlags
&ATTRFLAG_CASESENSITIVE
? fdexNameCaseSensitive
: fdexNameCaseInsensitive
, &dispid
);
1376 V_VT(AttributeValue
) = VT_NULL
;
1377 return (hres
== DISP_E_UNKNOWNNAME
) ? S_OK
: hres
;
1380 /* className and style are special cases */
1381 if(compat_mode
!= COMPAT_MODE_IE8
|| !This
->dom_element
||
1382 (dispid
!= DISPID_IHTMLELEMENT_CLASSNAME
&& dispid
!= DISPID_IHTMLELEMENT_STYLE
)) {
1383 hres
= get_elem_attr_value_by_dispid(This
, dispid
, AttributeValue
);
1387 if(compat_mode
>= COMPAT_MODE_IE8
&& V_VT(AttributeValue
) != VT_BSTR
&& V_VT(AttributeValue
) != VT_NULL
) {
1388 LCID lcid
= MAKELCID(MAKELANGID(LANG_ENGLISH
,SUBLANG_ENGLISH_US
),SORT_DEFAULT
);
1390 hres
= VariantChangeTypeEx(AttributeValue
, AttributeValue
, lcid
, 0, VT_BSTR
);
1392 VariantClear(AttributeValue
);
1395 if(!V_BSTR(AttributeValue
))
1396 V_VT(AttributeValue
) = VT_NULL
;
1397 }else if(lFlags
& ATTRFLAG_ASSTRING
)
1398 hres
= attr_value_to_string(AttributeValue
);
1403 nsAString_InitDepend(&name_str
, strAttributeName
);
1404 nsAString_InitDepend(&value_str
, NULL
);
1405 nsres
= nsIDOMElement_GetAttribute(This
->dom_element
, &name_str
, &value_str
);
1406 nsAString_Finish(&name_str
);
1407 return return_nsstr_variant(nsres
, &value_str
, 0, AttributeValue
);
1410 static HRESULT WINAPI
HTMLElement_removeAttribute(IHTMLElement
*iface
, BSTR strAttributeName
,
1411 LONG lFlags
, VARIANT_BOOL
*pfSuccess
)
1413 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1414 compat_mode_t compat_mode
= dispex_compat_mode(&This
->node
.event_target
.dispex
);
1418 TRACE("(%p)->(%s %lx %p)\n", This
, debugstr_w(strAttributeName
), lFlags
, pfSuccess
);
1420 if(compat_mode
< COMPAT_MODE_IE9
|| !This
->dom_element
) {
1421 hres
= IDispatchEx_GetDispID(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, translate_attr_name(strAttributeName
, compat_mode
),
1422 lFlags
&ATTRFLAG_CASESENSITIVE
? fdexNameCaseSensitive
: fdexNameCaseInsensitive
, &id
);
1423 if(hres
== DISP_E_UNKNOWNNAME
) {
1424 *pfSuccess
= VARIANT_FALSE
;
1430 if(id
== DISPID_IHTMLELEMENT_STYLE
) {
1433 TRACE("Special case: style\n");
1435 hres
= IHTMLElement_get_style(&This
->IHTMLElement_iface
, &style
);
1439 hres
= IHTMLStyle_put_cssText(style
, NULL
);
1440 IHTMLStyle_Release(style
);
1444 if(compat_mode
>= COMPAT_MODE_IE8
)
1445 element_remove_attribute(This
, strAttributeName
);
1447 *pfSuccess
= VARIANT_TRUE
;
1451 if(compat_mode
!= COMPAT_MODE_IE8
|| !This
->dom_element
|| id
!= DISPID_IHTMLELEMENT_CLASSNAME
)
1452 return remove_attribute(&This
->node
.event_target
.dispex
, id
, pfSuccess
);
1455 *pfSuccess
= element_has_attribute(This
, strAttributeName
);
1457 return element_remove_attribute(This
, strAttributeName
);
1461 static HRESULT WINAPI
HTMLElement_put_className(IHTMLElement
*iface
, BSTR v
)
1463 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1464 nsAString classname_str
;
1467 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1469 if(!This
->dom_element
) {
1470 FIXME("comment element\n");
1474 nsAString_InitDepend(&classname_str
, v
);
1475 nsres
= nsIDOMElement_SetClassName(This
->dom_element
, &classname_str
);
1476 nsAString_Finish(&classname_str
);
1477 if(NS_FAILED(nsres
))
1478 ERR("SetClassName failed: %08lx\n", nsres
);
1483 static HRESULT WINAPI
HTMLElement_get_className(IHTMLElement
*iface
, BSTR
*p
)
1485 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1486 nsAString class_str
;
1489 TRACE("(%p)->(%p)\n", This
, p
);
1491 if(!This
->dom_element
) {
1492 FIXME("comment element\n");
1496 nsAString_Init(&class_str
, NULL
);
1497 nsres
= nsIDOMElement_GetClassName(This
->dom_element
, &class_str
);
1498 return return_nsstr(nsres
, &class_str
, p
);
1501 static HRESULT WINAPI
HTMLElement_put_id(IHTMLElement
*iface
, BSTR v
)
1503 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1507 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1509 if(!This
->dom_element
) {
1510 FIXME("comment element\n");
1514 nsAString_InitDepend(&id_str
, v
);
1515 nsres
= nsIDOMElement_SetId(This
->dom_element
, &id_str
);
1516 nsAString_Finish(&id_str
);
1517 if(NS_FAILED(nsres
))
1518 ERR("SetId failed: %08lx\n", nsres
);
1523 static HRESULT WINAPI
HTMLElement_get_id(IHTMLElement
*iface
, BSTR
*p
)
1525 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1529 TRACE("(%p)->(%p)\n", This
, p
);
1531 if(!This
->dom_element
) {
1536 nsAString_Init(&id_str
, NULL
);
1537 nsres
= nsIDOMElement_GetId(This
->dom_element
, &id_str
);
1538 return return_nsstr(nsres
, &id_str
, p
);
1541 static HRESULT WINAPI
HTMLElement_get_tagName(IHTMLElement
*iface
, BSTR
*p
)
1543 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1547 TRACE("(%p)->(%p)\n", This
, p
);
1549 if(!This
->dom_element
) {
1550 TRACE("comment element\n");
1551 *p
= SysAllocString(L
"!");
1552 return *p
? S_OK
: E_OUTOFMEMORY
;
1555 nsAString_Init(&tag_str
, NULL
);
1556 nsres
= nsIDOMElement_GetTagName(This
->dom_element
, &tag_str
);
1557 return return_nsstr(nsres
, &tag_str
, p
);
1560 static HRESULT WINAPI
HTMLElement_get_parentElement(IHTMLElement
*iface
, IHTMLElement
**p
)
1562 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1566 TRACE("(%p)->(%p)\n", This
, p
);
1568 hres
= IHTMLDOMNode_get_parentNode(&This
->node
.IHTMLDOMNode_iface
, &node
);
1577 hres
= IHTMLDOMNode_QueryInterface(node
, &IID_IHTMLElement
, (void**)p
);
1578 IHTMLDOMNode_Release(node
);
1585 static HRESULT WINAPI
HTMLElement_get_style(IHTMLElement
*iface
, IHTMLStyle
**p
)
1587 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1589 TRACE("(%p)->(%p)\n", This
, p
);
1594 hres
= HTMLStyle_Create(This
, &This
->style
);
1599 *p
= &This
->style
->IHTMLStyle_iface
;
1600 IHTMLStyle_AddRef(*p
);
1604 static HRESULT WINAPI
HTMLElement_put_onhelp(IHTMLElement
*iface
, VARIANT v
)
1606 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1608 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1610 return set_node_event(&This
->node
, EVENTID_HELP
, &v
);
1613 static HRESULT WINAPI
HTMLElement_get_onhelp(IHTMLElement
*iface
, VARIANT
*p
)
1615 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1617 TRACE("(%p)->(%p)\n", This
, p
);
1619 return get_node_event(&This
->node
, EVENTID_HELP
, p
);
1622 static HRESULT WINAPI
HTMLElement_put_onclick(IHTMLElement
*iface
, VARIANT v
)
1624 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1626 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1628 return set_node_event(&This
->node
, EVENTID_CLICK
, &v
);
1631 static HRESULT WINAPI
HTMLElement_get_onclick(IHTMLElement
*iface
, VARIANT
*p
)
1633 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1635 TRACE("(%p)->(%p)\n", This
, p
);
1637 return get_node_event(&This
->node
, EVENTID_CLICK
, p
);
1640 static HRESULT WINAPI
HTMLElement_put_ondblclick(IHTMLElement
*iface
, VARIANT v
)
1642 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1644 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1646 return set_node_event(&This
->node
, EVENTID_DBLCLICK
, &v
);
1649 static HRESULT WINAPI
HTMLElement_get_ondblclick(IHTMLElement
*iface
, VARIANT
*p
)
1651 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1653 TRACE("(%p)->(%p)\n", This
, p
);
1655 return get_node_event(&This
->node
, EVENTID_DBLCLICK
, p
);
1658 static HRESULT WINAPI
HTMLElement_put_onkeydown(IHTMLElement
*iface
, VARIANT v
)
1660 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1662 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1664 return set_node_event(&This
->node
, EVENTID_KEYDOWN
, &v
);
1667 static HRESULT WINAPI
HTMLElement_get_onkeydown(IHTMLElement
*iface
, VARIANT
*p
)
1669 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1671 TRACE("(%p)->(%p)\n", This
, p
);
1673 return get_node_event(&This
->node
, EVENTID_KEYDOWN
, p
);
1676 static HRESULT WINAPI
HTMLElement_put_onkeyup(IHTMLElement
*iface
, VARIANT v
)
1678 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1680 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1682 return set_node_event(&This
->node
, EVENTID_KEYUP
, &v
);
1685 static HRESULT WINAPI
HTMLElement_get_onkeyup(IHTMLElement
*iface
, VARIANT
*p
)
1687 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1689 TRACE("(%p)->(%p)\n", This
, p
);
1691 return get_node_event(&This
->node
, EVENTID_KEYUP
, p
);
1694 static HRESULT WINAPI
HTMLElement_put_onkeypress(IHTMLElement
*iface
, VARIANT v
)
1696 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1698 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1700 return set_node_event(&This
->node
, EVENTID_KEYPRESS
, &v
);
1703 static HRESULT WINAPI
HTMLElement_get_onkeypress(IHTMLElement
*iface
, VARIANT
*p
)
1705 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1707 TRACE("(%p)->(%p)\n", This
, p
);
1709 return get_node_event(&This
->node
, EVENTID_KEYPRESS
, p
);
1712 static HRESULT WINAPI
HTMLElement_put_onmouseout(IHTMLElement
*iface
, VARIANT v
)
1714 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1716 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1718 return set_node_event(&This
->node
, EVENTID_MOUSEOUT
, &v
);
1721 static HRESULT WINAPI
HTMLElement_get_onmouseout(IHTMLElement
*iface
, VARIANT
*p
)
1723 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1725 TRACE("(%p)->(%p)\n", This
, p
);
1727 return get_node_event(&This
->node
, EVENTID_MOUSEOUT
, p
);
1730 static HRESULT WINAPI
HTMLElement_put_onmouseover(IHTMLElement
*iface
, VARIANT v
)
1732 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1734 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1736 return set_node_event(&This
->node
, EVENTID_MOUSEOVER
, &v
);
1739 static HRESULT WINAPI
HTMLElement_get_onmouseover(IHTMLElement
*iface
, VARIANT
*p
)
1741 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1743 TRACE("(%p)->(%p)\n", This
, p
);
1745 return get_node_event(&This
->node
, EVENTID_MOUSEOVER
, p
);
1748 static HRESULT WINAPI
HTMLElement_put_onmousemove(IHTMLElement
*iface
, VARIANT v
)
1750 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1752 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1754 return set_node_event(&This
->node
, EVENTID_MOUSEMOVE
, &v
);
1757 static HRESULT WINAPI
HTMLElement_get_onmousemove(IHTMLElement
*iface
, VARIANT
*p
)
1759 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1761 TRACE("(%p)->(%p)\n", This
, p
);
1763 return get_node_event(&This
->node
, EVENTID_MOUSEMOVE
, p
);
1766 static HRESULT WINAPI
HTMLElement_put_onmousedown(IHTMLElement
*iface
, VARIANT v
)
1768 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1770 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1772 return set_node_event(&This
->node
, EVENTID_MOUSEDOWN
, &v
);
1775 static HRESULT WINAPI
HTMLElement_get_onmousedown(IHTMLElement
*iface
, VARIANT
*p
)
1777 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1779 TRACE("(%p)->(%p)\n", This
, p
);
1781 return get_node_event(&This
->node
, EVENTID_MOUSEDOWN
, p
);
1784 static HRESULT WINAPI
HTMLElement_put_onmouseup(IHTMLElement
*iface
, VARIANT v
)
1786 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1788 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1790 return set_node_event(&This
->node
, EVENTID_MOUSEUP
, &v
);
1793 static HRESULT WINAPI
HTMLElement_get_onmouseup(IHTMLElement
*iface
, VARIANT
*p
)
1795 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1797 TRACE("(%p)->(%p)\n", This
, p
);
1799 return get_node_event(&This
->node
, EVENTID_MOUSEUP
, p
);
1802 static HRESULT WINAPI
HTMLElement_get_document(IHTMLElement
*iface
, IDispatch
**p
)
1804 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1806 TRACE("(%p)->(%p)\n", This
, p
);
1811 if(This
->node
.vtbl
->get_document
)
1812 return This
->node
.vtbl
->get_document(&This
->node
, p
);
1814 *p
= (IDispatch
*)&This
->node
.doc
->IHTMLDocument2_iface
;
1815 IDispatch_AddRef(*p
);
1819 static HRESULT WINAPI
HTMLElement_put_title(IHTMLElement
*iface
, BSTR v
)
1821 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1822 nsAString title_str
;
1825 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1827 if(!This
->dom_element
) {
1831 hres
= dispex_get_dprop_ref(&This
->node
.event_target
.dispex
, L
"title", TRUE
, &var
);
1836 V_VT(var
) = VT_BSTR
;
1837 V_BSTR(var
) = v
? SysAllocString(v
) : NULL
;
1841 if(!This
->html_element
)
1842 return elem_string_attr_setter(This
, L
"title", v
);
1844 nsAString_InitDepend(&title_str
, v
);
1845 nsres
= nsIDOMHTMLElement_SetTitle(This
->html_element
, &title_str
);
1846 nsAString_Finish(&title_str
);
1847 if(NS_FAILED(nsres
))
1848 ERR("SetTitle failed: %08lx\n", nsres
);
1853 static HRESULT WINAPI
HTMLElement_get_title(IHTMLElement
*iface
, BSTR
*p
)
1855 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1856 nsAString title_str
;
1859 TRACE("(%p)->(%p)\n", This
, p
);
1861 if(!This
->dom_element
) {
1865 hres
= dispex_get_dprop_ref(&This
->node
.event_target
.dispex
, L
"title", FALSE
, &var
);
1866 if(hres
== DISP_E_UNKNOWNNAME
) {
1868 }else if(V_VT(var
) != VT_BSTR
) {
1869 FIXME("title = %s\n", debugstr_variant(var
));
1872 *p
= V_BSTR(var
) ? SysAllocString(V_BSTR(var
)) : NULL
;
1878 if(!This
->html_element
)
1879 return elem_string_attr_getter(This
, L
"title", FALSE
, p
);
1881 nsAString_Init(&title_str
, NULL
);
1882 nsres
= nsIDOMHTMLElement_GetTitle(This
->html_element
, &title_str
);
1883 return return_nsstr(nsres
, &title_str
, p
);
1886 static HRESULT WINAPI
HTMLElement_put_language(IHTMLElement
*iface
, BSTR v
)
1888 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1890 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
1892 return elem_string_attr_setter(This
, L
"language", v
);
1895 static HRESULT WINAPI
HTMLElement_get_language(IHTMLElement
*iface
, BSTR
*p
)
1897 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1899 TRACE("(%p)->(%p)\n", This
, p
);
1901 return elem_string_attr_getter(This
, L
"language", TRUE
, p
);
1904 static HRESULT WINAPI
HTMLElement_put_onselectstart(IHTMLElement
*iface
, VARIANT v
)
1906 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1908 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1910 return set_node_event(&This
->node
, EVENTID_SELECTSTART
, &v
);
1913 static HRESULT WINAPI
HTMLElement_get_onselectstart(IHTMLElement
*iface
, VARIANT
*p
)
1915 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1917 TRACE("(%p)->(%p)\n", This
, p
);
1919 return get_node_event(&This
->node
, EVENTID_SELECTSTART
, p
);
1922 static HRESULT WINAPI
HTMLElement_scrollIntoView(IHTMLElement
*iface
, VARIANT varargStart
)
1924 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1925 cpp_bool start
= TRUE
;
1928 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&varargStart
));
1930 switch(V_VT(&varargStart
)) {
1935 start
= V_BOOL(&varargStart
) != VARIANT_FALSE
;
1938 FIXME("Unsupported argument %s\n", debugstr_variant(&varargStart
));
1941 if(!This
->html_element
) {
1942 FIXME("non-HTML elements\n");
1946 nsres
= nsIDOMHTMLElement_ScrollIntoView(This
->html_element
, start
, 1);
1947 assert(nsres
== NS_OK
);
1952 static HRESULT WINAPI
HTMLElement_contains(IHTMLElement
*iface
, IHTMLElement
*pChild
,
1953 VARIANT_BOOL
*pfResult
)
1955 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1956 cpp_bool result
= FALSE
;
1958 TRACE("(%p)->(%p %p)\n", This
, pChild
, pfResult
);
1964 child
= unsafe_impl_from_IHTMLElement(pChild
);
1966 ERR("not our element\n");
1970 nsres
= nsIDOMNode_Contains(This
->node
.nsnode
, child
->node
.nsnode
, &result
);
1971 assert(nsres
== NS_OK
);
1974 *pfResult
= variant_bool(result
);
1978 static HRESULT WINAPI
HTMLElement_get_sourceIndex(IHTMLElement
*iface
, LONG
*p
)
1980 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1982 TRACE("(%p)->(%p)\n", This
, p
);
1984 return get_elem_source_index(This
, p
);
1987 static HRESULT WINAPI
HTMLElement_get_recordNumber(IHTMLElement
*iface
, VARIANT
*p
)
1989 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
1990 FIXME("(%p)->(%p)\n", This
, p
);
1994 static HRESULT WINAPI
HTMLElement_put_lang(IHTMLElement
*iface
, BSTR v
)
1996 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
2000 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2002 if(!This
->html_element
) {
2003 FIXME("non-HTML element\n");
2007 nsAString_InitDepend(&nsstr
, v
);
2008 nsres
= nsIDOMHTMLElement_SetLang(This
->html_element
, &nsstr
);
2009 nsAString_Finish(&nsstr
);
2010 if(NS_FAILED(nsres
)) {
2011 ERR("SetLang failed: %08lx\n", nsres
);
2018 static HRESULT WINAPI
HTMLElement_get_lang(IHTMLElement
*iface
, BSTR
*p
)
2020 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
2024 TRACE("(%p)->(%p)\n", This
, p
);
2026 if(!This
->html_element
) {
2027 FIXME("non-HTML element\n");
2031 nsAString_Init(&nsstr
, NULL
);
2032 nsres
= nsIDOMHTMLElement_GetLang(This
->html_element
, &nsstr
);
2033 return return_nsstr(nsres
, &nsstr
, p
);
2036 static HRESULT WINAPI
HTMLElement_get_offsetLeft(IHTMLElement
*iface
, LONG
*p
)
2038 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
2041 TRACE("(%p)->(%p)\n", This
, p
);
2043 if(!This
->html_element
) {
2044 FIXME("non-HTML element\n");
2048 nsres
= nsIDOMHTMLElement_GetOffsetLeft(This
->html_element
, p
);
2049 if(NS_FAILED(nsres
)) {
2050 ERR("GetOffsetLeft failed: %08lx\n", nsres
);
2057 static HRESULT WINAPI
HTMLElement_get_offsetTop(IHTMLElement
*iface
, LONG
*p
)
2059 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
2062 TRACE("(%p)->(%p)\n", This
, p
);
2064 if(!This
->html_element
) {
2065 FIXME("non-HTML element\n");
2069 nsres
= nsIDOMHTMLElement_GetOffsetTop(This
->html_element
, p
);
2070 if(NS_FAILED(nsres
)) {
2071 ERR("GetOffsetTop failed: %08lx\n", nsres
);
2078 static HRESULT WINAPI
HTMLElement_get_offsetWidth(IHTMLElement
*iface
, LONG
*p
)
2080 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
2083 TRACE("(%p)->(%p)\n", This
, p
);
2085 if(!This
->html_element
) {
2086 FIXME("non-HTML element\n");
2090 nsres
= nsIDOMHTMLElement_GetOffsetWidth(This
->html_element
, p
);
2091 if(NS_FAILED(nsres
)) {
2092 ERR("GetOffsetWidth failed: %08lx\n", nsres
);
2099 static HRESULT WINAPI
HTMLElement_get_offsetHeight(IHTMLElement
*iface
, LONG
*p
)
2101 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
2104 TRACE("(%p)->(%p)\n", This
, p
);
2106 if(!This
->html_element
) {
2107 FIXME("non-HTML element\n");
2111 nsres
= nsIDOMHTMLElement_GetOffsetHeight(This
->html_element
, p
);
2112 if(NS_FAILED(nsres
)) {
2113 ERR("GetOffsetHeight failed: %08lx\n", nsres
);
2120 static HRESULT WINAPI
HTMLElement_get_offsetParent(IHTMLElement
*iface
, IHTMLElement
**p
)
2122 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
2123 nsIDOMElement
*nsparent
;
2124 HTMLElement
*parent
;
2128 TRACE("(%p)->(%p)\n", This
, p
);
2130 if(!This
->html_element
) {
2131 FIXME("non-HTML element\n");
2135 nsres
= nsIDOMHTMLElement_GetOffsetParent(This
->html_element
, &nsparent
);
2136 if(NS_FAILED(nsres
)) {
2137 ERR("GetOffsetParent failed: %08lx\n", nsres
);
2146 hres
= get_element(nsparent
, &parent
);
2147 nsIDOMElement_Release(nsparent
);
2151 *p
= &parent
->IHTMLElement_iface
;
2155 static HRESULT WINAPI
HTMLElement_put_innerHTML(IHTMLElement
*iface
, BSTR v
)
2157 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
2161 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2163 if(!This
->html_element
) {
2164 FIXME("non-HTML element\n");
2168 nsAString_InitDepend(&html_str
, v
);
2169 nsres
= nsIDOMHTMLElement_SetInnerHTML(This
->html_element
, &html_str
);
2170 nsAString_Finish(&html_str
);
2171 if(NS_FAILED(nsres
)) {
2172 FIXME("SetInnerHtml failed %08lx\n", nsres
);
2179 static HRESULT WINAPI
HTMLElement_get_innerHTML(IHTMLElement
*iface
, BSTR
*p
)
2181 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
2185 TRACE("(%p)->(%p)\n", This
, p
);
2187 if(!This
->html_element
) {
2188 FIXME("non-HTML element\n");
2192 nsAString_Init(&html_str
, NULL
);
2193 nsres
= nsIDOMHTMLElement_GetInnerHTML(This
->html_element
, &html_str
);
2194 return return_nsstr(nsres
, &html_str
, p
);
2197 static HRESULT WINAPI
HTMLElement_put_innerText(IHTMLElement
*iface
, BSTR v
)
2199 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
2200 nsIDOMNode
*nschild
, *tmp
;
2201 nsIDOMText
*text_node
;
2205 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2208 nsres
= nsIDOMElement_GetLastChild(This
->dom_element
, &nschild
);
2209 if(NS_FAILED(nsres
)) {
2210 ERR("GetLastChild failed: %08lx\n", nsres
);
2216 nsres
= nsIDOMElement_RemoveChild(This
->dom_element
, nschild
, &tmp
);
2217 nsIDOMNode_Release(nschild
);
2218 if(NS_FAILED(nsres
)) {
2219 ERR("RemoveChild failed: %08lx\n", nsres
);
2222 nsIDOMNode_Release(tmp
);
2225 nsAString_InitDepend(&text_str
, v
);
2226 nsres
= nsIDOMHTMLDocument_CreateTextNode(This
->node
.doc
->nsdoc
, &text_str
, &text_node
);
2227 nsAString_Finish(&text_str
);
2228 if(NS_FAILED(nsres
)) {
2229 ERR("CreateTextNode failed: %08lx\n", nsres
);
2233 nsres
= nsIDOMElement_AppendChild(This
->dom_element
, (nsIDOMNode
*)text_node
, &tmp
);
2234 if(NS_FAILED(nsres
)) {
2235 ERR("AppendChild failed: %08lx\n", nsres
);
2239 nsIDOMNode_Release(tmp
);
2243 static HRESULT WINAPI
HTMLElement_get_innerText(IHTMLElement
*iface
, BSTR
*p
)
2245 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
2247 TRACE("(%p)->(%p)\n", This
, p
);
2249 return get_node_text(&This
->node
, p
);
2252 static HRESULT WINAPI
HTMLElement_put_outerHTML(IHTMLElement
*iface
, BSTR v
)
2254 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
2256 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2258 return replace_node_by_html(This
->node
.doc
->nsdoc
, This
->node
.nsnode
, v
);
2261 static HRESULT WINAPI
HTMLElement_get_outerHTML(IHTMLElement
*iface
, BSTR
*p
)
2263 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
2267 WARN("(%p)->(%p) semi-stub\n", This
, p
);
2269 nsAString_Init(&html_str
, NULL
);
2270 hres
= nsnode_to_nsstring(This
->node
.nsnode
, &html_str
);
2271 if(SUCCEEDED(hres
)) {
2272 const PRUnichar
*html
;
2274 nsAString_GetData(&html_str
, &html
);
2275 *p
= SysAllocString(html
);
2277 hres
= E_OUTOFMEMORY
;
2280 nsAString_Finish(&html_str
);
2282 TRACE("ret %s\n", debugstr_w(*p
));
2286 static HRESULT WINAPI
HTMLElement_put_outerText(IHTMLElement
*iface
, BSTR v
)
2288 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
2289 nsIDOMText
*text_node
;
2294 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
2296 if(This
->node
.vtbl
->is_settable
&& !This
->node
.vtbl
->is_settable(&This
->node
, DISPID_IHTMLELEMENT_OUTERTEXT
)) {
2297 WARN("Called on element that does not support setting the property.\n");
2298 return 0x800a0258; /* undocumented error code */
2301 if(!This
->node
.doc
->nsdoc
) {
2302 FIXME("NULL nsdoc\n");
2306 nsAString_InitDepend(&nsstr
, v
);
2307 nsres
= nsIDOMHTMLDocument_CreateTextNode(This
->node
.doc
->nsdoc
, &nsstr
, &text_node
);
2308 nsAString_Finish(&nsstr
);
2309 if(NS_FAILED(nsres
)) {
2310 ERR("CreateTextNode failed\n");
2314 nsres
= nsIDOMHTMLDocument_CreateRange(This
->node
.doc
->nsdoc
, &range
);
2315 if(NS_SUCCEEDED(nsres
)) {
2316 nsres
= nsIDOMRange_SelectNode(range
, This
->node
.nsnode
);
2317 if(NS_SUCCEEDED(nsres
))
2318 nsres
= nsIDOMRange_DeleteContents(range
);
2319 if(NS_SUCCEEDED(nsres
))
2320 nsres
= nsIDOMRange_InsertNode(range
, (nsIDOMNode
*)text_node
);
2321 if(NS_SUCCEEDED(nsres
))
2322 nsres
= nsIDOMRange_SelectNodeContents(range
, This
->node
.nsnode
);
2323 if(NS_SUCCEEDED(nsres
))
2324 nsres
= nsIDOMRange_DeleteContents(range
);
2325 nsIDOMRange_Release(range
);
2327 nsIDOMText_Release(text_node
);
2328 if(NS_FAILED(nsres
)) {
2329 ERR("failed to set text: %08lx\n", nsres
);
2336 static HRESULT WINAPI
HTMLElement_get_outerText(IHTMLElement
*iface
, BSTR
*p
)
2338 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
2340 TRACE("(%p)->(%p)\n", This
, p
);
2342 /* getter is the same as innerText */
2343 return IHTMLElement_get_innerText(&This
->IHTMLElement_iface
, p
);
2346 static HRESULT
insert_adjacent_node(HTMLElement
*This
, const WCHAR
*where
, nsIDOMNode
*nsnode
, HTMLDOMNode
**ret_node
)
2348 nsIDOMNode
*ret_nsnode
;
2350 HRESULT hres
= S_OK
;
2352 if (!wcsicmp(where
, L
"beforebegin")) {
2355 nsres
= nsIDOMNode_GetParentNode(This
->node
.nsnode
, &parent
);
2356 if(NS_FAILED(nsres
))
2360 return E_INVALIDARG
;
2362 nsres
= nsIDOMNode_InsertBefore(parent
, nsnode
, This
->node
.nsnode
, &ret_nsnode
);
2363 nsIDOMNode_Release(parent
);
2364 }else if(!wcsicmp(where
, L
"afterbegin")) {
2365 nsIDOMNode
*first_child
;
2367 nsres
= nsIDOMNode_GetFirstChild(This
->node
.nsnode
, &first_child
);
2368 if(NS_FAILED(nsres
))
2371 nsres
= nsIDOMNode_InsertBefore(This
->node
.nsnode
, nsnode
, first_child
, &ret_nsnode
);
2372 if(NS_FAILED(nsres
))
2376 nsIDOMNode_Release(first_child
);
2377 }else if (!wcsicmp(where
, L
"beforeend")) {
2378 nsres
= nsIDOMNode_AppendChild(This
->node
.nsnode
, nsnode
, &ret_nsnode
);
2379 }else if (!wcsicmp(where
, L
"afterend")) {
2380 nsIDOMNode
*next_sibling
, *parent
;
2382 nsres
= nsIDOMNode_GetParentNode(This
->node
.nsnode
, &parent
);
2383 if(NS_FAILED(nsres
))
2386 return E_INVALIDARG
;
2388 nsres
= nsIDOMNode_GetNextSibling(This
->node
.nsnode
, &next_sibling
);
2389 if(NS_SUCCEEDED(nsres
)) {
2391 nsres
= nsIDOMNode_InsertBefore(parent
, nsnode
, next_sibling
, &ret_nsnode
);
2392 nsIDOMNode_Release(next_sibling
);
2394 nsres
= nsIDOMNode_AppendChild(parent
, nsnode
, &ret_nsnode
);
2398 nsIDOMNode_Release(parent
);
2400 ERR("invalid where: %s\n", debugstr_w(where
));
2401 return E_INVALIDARG
;
2404 if (NS_FAILED(nsres
))
2408 hres
= get_node(ret_nsnode
, TRUE
, ret_node
);
2409 nsIDOMNode_Release(ret_nsnode
);
2413 static HRESULT WINAPI
HTMLElement_insertAdjacentHTML(IHTMLElement
*iface
, BSTR where
,
2416 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
2423 TRACE("(%p)->(%s %s)\n", This
, debugstr_w(where
), debugstr_w(html
));
2425 if(!This
->node
.doc
->nsdoc
) {
2426 WARN("NULL nsdoc\n");
2427 return E_UNEXPECTED
;
2430 nsres
= nsIDOMHTMLDocument_CreateRange(This
->node
.doc
->nsdoc
, &range
);
2431 if(NS_FAILED(nsres
))
2433 ERR("CreateRange failed: %08lx\n", nsres
);
2437 nsIDOMRange_SetStartBefore(range
, This
->node
.nsnode
);
2439 nsAString_InitDepend(&ns_html
, html
);
2440 nsres
= nsIDOMRange_CreateContextualFragment(range
, &ns_html
, (nsIDOMDocumentFragment
**)&nsnode
);
2441 nsAString_Finish(&ns_html
);
2442 nsIDOMRange_Release(range
);
2444 if(NS_FAILED(nsres
) || !nsnode
)
2446 ERR("CreateTextNode failed: %08lx\n", nsres
);
2450 hr
= insert_adjacent_node(This
, where
, nsnode
, NULL
);
2451 nsIDOMNode_Release(nsnode
);
2455 static HRESULT WINAPI
HTMLElement_insertAdjacentText(IHTMLElement
*iface
, BSTR where
,
2458 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
2464 TRACE("(%p)->(%s %s)\n", This
, debugstr_w(where
), debugstr_w(text
));
2466 if(!This
->node
.doc
->nsdoc
) {
2467 WARN("NULL nsdoc\n");
2468 return E_UNEXPECTED
;
2472 nsAString_InitDepend(&ns_text
, text
);
2473 nsres
= nsIDOMHTMLDocument_CreateTextNode(This
->node
.doc
->nsdoc
, &ns_text
, (nsIDOMText
**)&nsnode
);
2474 nsAString_Finish(&ns_text
);
2476 if(NS_FAILED(nsres
) || !nsnode
)
2478 ERR("CreateTextNode failed: %08lx\n", nsres
);
2482 hr
= insert_adjacent_node(This
, where
, nsnode
, NULL
);
2483 nsIDOMNode_Release(nsnode
);
2488 static HRESULT WINAPI
HTMLElement_get_parentTextEdit(IHTMLElement
*iface
, IHTMLElement
**p
)
2490 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
2491 FIXME("(%p)->(%p)\n", This
, p
);
2495 static HRESULT WINAPI
HTMLElement_get_isTextEdit(IHTMLElement
*iface
, VARIANT_BOOL
*p
)
2497 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
2499 TRACE("(%p)->(%p)\n", This
, p
);
2501 *p
= variant_bool(This
->node
.vtbl
->is_text_edit
&& This
->node
.vtbl
->is_text_edit(&This
->node
));
2505 static HRESULT WINAPI
HTMLElement_click(IHTMLElement
*iface
)
2507 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
2510 TRACE("(%p)\n", This
);
2512 if(!This
->html_element
) {
2513 FIXME("non-HTML element\n");
2517 nsres
= nsIDOMHTMLElement_Click(This
->html_element
);
2518 if(NS_FAILED(nsres
)) {
2519 ERR("Click failed: %08lx\n", nsres
);
2526 static HRESULT WINAPI
HTMLElement_get_filters(IHTMLElement
*iface
, IHTMLFiltersCollection
**p
)
2528 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
2530 TRACE("(%p)->(%p)\n", This
, p
);
2535 return create_filters_collection(dispex_compat_mode(&This
->node
.event_target
.dispex
), p
);
2538 static HRESULT WINAPI
HTMLElement_put_ondragstart(IHTMLElement
*iface
, VARIANT v
)
2540 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
2542 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2544 return set_node_event(&This
->node
, EVENTID_DRAGSTART
, &v
);
2547 static HRESULT WINAPI
HTMLElement_get_ondragstart(IHTMLElement
*iface
, VARIANT
*p
)
2549 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
2551 TRACE("(%p)->(%p)\n", This
, p
);
2553 return get_node_event(&This
->node
, EVENTID_DRAGSTART
, p
);
2556 static HRESULT WINAPI
HTMLElement_toString(IHTMLElement
*iface
, BSTR
*String
)
2558 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
2562 TRACE("(%p)->(%p)\n", This
, String
);
2565 return E_INVALIDARG
;
2567 hres
= IDispatchEx_InvokeEx(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, DISPID_VALUE
,
2568 LOCALE_SYSTEM_DEFAULT
, DISPATCH_PROPERTYGET
, NULL
, &var
, NULL
, NULL
);
2569 if(SUCCEEDED(hres
)) {
2570 assert(V_VT(&var
) == VT_BSTR
);
2571 *String
= V_BSTR(&var
);
2576 static HRESULT WINAPI
HTMLElement_put_onbeforeupdate(IHTMLElement
*iface
, VARIANT v
)
2578 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
2579 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2583 static HRESULT WINAPI
HTMLElement_get_onbeforeupdate(IHTMLElement
*iface
, VARIANT
*p
)
2585 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
2586 FIXME("(%p)->(%p)\n", This
, p
);
2590 static HRESULT WINAPI
HTMLElement_put_onafterupdate(IHTMLElement
*iface
, VARIANT v
)
2592 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
2593 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2597 static HRESULT WINAPI
HTMLElement_get_onafterupdate(IHTMLElement
*iface
, VARIANT
*p
)
2599 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
2600 FIXME("(%p)->(%p)\n", This
, p
);
2604 static HRESULT WINAPI
HTMLElement_put_onerrorupdate(IHTMLElement
*iface
, VARIANT v
)
2606 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
2607 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2611 static HRESULT WINAPI
HTMLElement_get_onerrorupdate(IHTMLElement
*iface
, VARIANT
*p
)
2613 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
2614 FIXME("(%p)->(%p)\n", This
, p
);
2618 static HRESULT WINAPI
HTMLElement_put_onrowexit(IHTMLElement
*iface
, VARIANT v
)
2620 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
2621 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2625 static HRESULT WINAPI
HTMLElement_get_onrowexit(IHTMLElement
*iface
, VARIANT
*p
)
2627 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
2628 FIXME("(%p)->(%p)\n", This
, p
);
2632 static HRESULT WINAPI
HTMLElement_put_onrowenter(IHTMLElement
*iface
, VARIANT v
)
2634 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
2635 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2639 static HRESULT WINAPI
HTMLElement_get_onrowenter(IHTMLElement
*iface
, VARIANT
*p
)
2641 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
2642 FIXME("(%p)->(%p)\n", This
, p
);
2646 static HRESULT WINAPI
HTMLElement_put_ondatasetchanged(IHTMLElement
*iface
, VARIANT v
)
2648 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
2649 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2653 static HRESULT WINAPI
HTMLElement_get_ondatasetchanged(IHTMLElement
*iface
, VARIANT
*p
)
2655 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
2656 FIXME("(%p)->(%p)\n", This
, p
);
2660 static HRESULT WINAPI
HTMLElement_put_ondataavailable(IHTMLElement
*iface
, VARIANT v
)
2662 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
2664 FIXME("(%p)->(%s) semi-stub\n", This
, debugstr_variant(&v
));
2666 return set_node_event(&This
->node
, EVENTID_DATAAVAILABLE
, &v
);
2669 static HRESULT WINAPI
HTMLElement_get_ondataavailable(IHTMLElement
*iface
, VARIANT
*p
)
2671 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
2673 TRACE("(%p)->(%p)\n", This
, p
);
2675 return get_node_event(&This
->node
, EVENTID_DATAAVAILABLE
, p
);
2678 static HRESULT WINAPI
HTMLElement_put_ondatasetcomplete(IHTMLElement
*iface
, VARIANT v
)
2680 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
2681 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2685 static HRESULT WINAPI
HTMLElement_get_ondatasetcomplete(IHTMLElement
*iface
, VARIANT
*p
)
2687 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
2688 FIXME("(%p)->(%p)\n", This
, p
);
2692 static HRESULT WINAPI
HTMLElement_put_onfilterchange(IHTMLElement
*iface
, VARIANT v
)
2694 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
2695 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2699 static HRESULT WINAPI
HTMLElement_get_onfilterchange(IHTMLElement
*iface
, VARIANT
*p
)
2701 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
2702 FIXME("(%p)->(%p)\n", This
, p
);
2706 static HRESULT WINAPI
HTMLElement_get_children(IHTMLElement
*iface
, IDispatch
**p
)
2708 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
2709 nsIDOMNodeList
*nsnode_list
;
2712 TRACE("(%p)->(%p)\n", This
, p
);
2714 nsres
= nsIDOMNode_GetChildNodes(This
->node
.nsnode
, &nsnode_list
);
2715 if(NS_FAILED(nsres
)) {
2716 ERR("GetChildNodes failed: %08lx\n", nsres
);
2720 *p
= (IDispatch
*)create_collection_from_nodelist(nsnode_list
, This
->node
.doc
->document_mode
);
2722 nsIDOMNodeList_Release(nsnode_list
);
2726 static HRESULT WINAPI
HTMLElement_get_all(IHTMLElement
*iface
, IDispatch
**p
)
2728 HTMLElement
*This
= impl_from_IHTMLElement(iface
);
2730 TRACE("(%p)->(%p)\n", This
, p
);
2732 *p
= (IDispatch
*)create_all_collection(&This
->node
, FALSE
);
2736 static const IHTMLElementVtbl HTMLElementVtbl
= {
2737 HTMLElement_QueryInterface
,
2739 HTMLElement_Release
,
2740 HTMLElement_GetTypeInfoCount
,
2741 HTMLElement_GetTypeInfo
,
2742 HTMLElement_GetIDsOfNames
,
2744 HTMLElement_setAttribute
,
2745 HTMLElement_getAttribute
,
2746 HTMLElement_removeAttribute
,
2747 HTMLElement_put_className
,
2748 HTMLElement_get_className
,
2751 HTMLElement_get_tagName
,
2752 HTMLElement_get_parentElement
,
2753 HTMLElement_get_style
,
2754 HTMLElement_put_onhelp
,
2755 HTMLElement_get_onhelp
,
2756 HTMLElement_put_onclick
,
2757 HTMLElement_get_onclick
,
2758 HTMLElement_put_ondblclick
,
2759 HTMLElement_get_ondblclick
,
2760 HTMLElement_put_onkeydown
,
2761 HTMLElement_get_onkeydown
,
2762 HTMLElement_put_onkeyup
,
2763 HTMLElement_get_onkeyup
,
2764 HTMLElement_put_onkeypress
,
2765 HTMLElement_get_onkeypress
,
2766 HTMLElement_put_onmouseout
,
2767 HTMLElement_get_onmouseout
,
2768 HTMLElement_put_onmouseover
,
2769 HTMLElement_get_onmouseover
,
2770 HTMLElement_put_onmousemove
,
2771 HTMLElement_get_onmousemove
,
2772 HTMLElement_put_onmousedown
,
2773 HTMLElement_get_onmousedown
,
2774 HTMLElement_put_onmouseup
,
2775 HTMLElement_get_onmouseup
,
2776 HTMLElement_get_document
,
2777 HTMLElement_put_title
,
2778 HTMLElement_get_title
,
2779 HTMLElement_put_language
,
2780 HTMLElement_get_language
,
2781 HTMLElement_put_onselectstart
,
2782 HTMLElement_get_onselectstart
,
2783 HTMLElement_scrollIntoView
,
2784 HTMLElement_contains
,
2785 HTMLElement_get_sourceIndex
,
2786 HTMLElement_get_recordNumber
,
2787 HTMLElement_put_lang
,
2788 HTMLElement_get_lang
,
2789 HTMLElement_get_offsetLeft
,
2790 HTMLElement_get_offsetTop
,
2791 HTMLElement_get_offsetWidth
,
2792 HTMLElement_get_offsetHeight
,
2793 HTMLElement_get_offsetParent
,
2794 HTMLElement_put_innerHTML
,
2795 HTMLElement_get_innerHTML
,
2796 HTMLElement_put_innerText
,
2797 HTMLElement_get_innerText
,
2798 HTMLElement_put_outerHTML
,
2799 HTMLElement_get_outerHTML
,
2800 HTMLElement_put_outerText
,
2801 HTMLElement_get_outerText
,
2802 HTMLElement_insertAdjacentHTML
,
2803 HTMLElement_insertAdjacentText
,
2804 HTMLElement_get_parentTextEdit
,
2805 HTMLElement_get_isTextEdit
,
2807 HTMLElement_get_filters
,
2808 HTMLElement_put_ondragstart
,
2809 HTMLElement_get_ondragstart
,
2810 HTMLElement_toString
,
2811 HTMLElement_put_onbeforeupdate
,
2812 HTMLElement_get_onbeforeupdate
,
2813 HTMLElement_put_onafterupdate
,
2814 HTMLElement_get_onafterupdate
,
2815 HTMLElement_put_onerrorupdate
,
2816 HTMLElement_get_onerrorupdate
,
2817 HTMLElement_put_onrowexit
,
2818 HTMLElement_get_onrowexit
,
2819 HTMLElement_put_onrowenter
,
2820 HTMLElement_get_onrowenter
,
2821 HTMLElement_put_ondatasetchanged
,
2822 HTMLElement_get_ondatasetchanged
,
2823 HTMLElement_put_ondataavailable
,
2824 HTMLElement_get_ondataavailable
,
2825 HTMLElement_put_ondatasetcomplete
,
2826 HTMLElement_get_ondatasetcomplete
,
2827 HTMLElement_put_onfilterchange
,
2828 HTMLElement_get_onfilterchange
,
2829 HTMLElement_get_children
,
2833 HTMLElement
*unsafe_impl_from_IHTMLElement(IHTMLElement
*iface
)
2835 return iface
->lpVtbl
== &HTMLElementVtbl
? impl_from_IHTMLElement(iface
) : NULL
;
2838 static inline HTMLElement
*impl_from_IHTMLElement2(IHTMLElement2
*iface
)
2840 return CONTAINING_RECORD(iface
, HTMLElement
, IHTMLElement2_iface
);
2843 static HRESULT WINAPI
HTMLElement2_QueryInterface(IHTMLElement2
*iface
,
2844 REFIID riid
, void **ppv
)
2846 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2847 return IHTMLElement_QueryInterface(&This
->IHTMLElement_iface
, riid
, ppv
);
2850 static ULONG WINAPI
HTMLElement2_AddRef(IHTMLElement2
*iface
)
2852 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2853 return IHTMLElement_AddRef(&This
->IHTMLElement_iface
);
2856 static ULONG WINAPI
HTMLElement2_Release(IHTMLElement2
*iface
)
2858 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2859 return IHTMLElement_Release(&This
->IHTMLElement_iface
);
2862 static HRESULT WINAPI
HTMLElement2_GetTypeInfoCount(IHTMLElement2
*iface
, UINT
*pctinfo
)
2864 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2865 return IDispatchEx_GetTypeInfoCount(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
2868 static HRESULT WINAPI
HTMLElement2_GetTypeInfo(IHTMLElement2
*iface
, UINT iTInfo
,
2869 LCID lcid
, ITypeInfo
**ppTInfo
)
2871 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2872 return IDispatchEx_GetTypeInfo(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
2875 static HRESULT WINAPI
HTMLElement2_GetIDsOfNames(IHTMLElement2
*iface
, REFIID riid
,
2876 LPOLESTR
*rgszNames
, UINT cNames
,
2877 LCID lcid
, DISPID
*rgDispId
)
2879 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2880 return IDispatchEx_GetIDsOfNames(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
2884 static HRESULT WINAPI
HTMLElement2_Invoke(IHTMLElement2
*iface
, DISPID dispIdMember
,
2885 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
2886 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
2888 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2889 return IDispatchEx_Invoke(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
2890 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
2893 static HRESULT WINAPI
HTMLElement2_get_scopeName(IHTMLElement2
*iface
, BSTR
*p
)
2895 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2896 FIXME("(%p)->(%p)\n", This
, p
);
2900 static HRESULT WINAPI
HTMLElement2_setCapture(IHTMLElement2
*iface
, VARIANT_BOOL containerCapture
)
2902 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2903 FIXME("(%p)->(%x)\n", This
, containerCapture
);
2907 static HRESULT WINAPI
HTMLElement2_releaseCapture(IHTMLElement2
*iface
)
2909 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2910 FIXME("(%p)\n", This
);
2914 static HRESULT WINAPI
HTMLElement2_put_onlosecapture(IHTMLElement2
*iface
, VARIANT v
)
2916 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2917 FIXME("(%p)->()\n", This
);
2921 static HRESULT WINAPI
HTMLElement2_get_onlosecapture(IHTMLElement2
*iface
, VARIANT
*p
)
2923 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2924 FIXME("(%p)->(%p)\n", This
, p
);
2928 static HRESULT WINAPI
HTMLElement2_componentFromPoint(IHTMLElement2
*iface
,
2929 LONG x
, LONG y
, BSTR
*component
)
2931 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2932 FIXME("(%p)->(%ld %ld %p)\n", This
, x
, y
, component
);
2936 static HRESULT WINAPI
HTMLElement2_doScroll(IHTMLElement2
*iface
, VARIANT component
)
2938 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2940 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&component
));
2942 if(!This
->node
.doc
->content_ready
|| !This
->node
.doc
->doc_obj
->in_place_active
)
2949 static HRESULT WINAPI
HTMLElement2_put_onscroll(IHTMLElement2
*iface
, VARIANT v
)
2951 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2953 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2955 return set_node_event(&This
->node
, EVENTID_SCROLL
, &v
);
2958 static HRESULT WINAPI
HTMLElement2_get_onscroll(IHTMLElement2
*iface
, VARIANT
*p
)
2960 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2962 TRACE("(%p)->(%p)\n", This
, p
);
2964 return get_node_event(&This
->node
, EVENTID_SCROLL
, p
);
2967 static HRESULT WINAPI
HTMLElement2_put_ondrag(IHTMLElement2
*iface
, VARIANT v
)
2969 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2971 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2973 return set_node_event(&This
->node
, EVENTID_DRAG
, &v
);
2976 static HRESULT WINAPI
HTMLElement2_get_ondrag(IHTMLElement2
*iface
, VARIANT
*p
)
2978 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2980 TRACE("(%p)->(%p)\n", This
, p
);
2982 return get_node_event(&This
->node
, EVENTID_DRAG
, p
);
2985 static HRESULT WINAPI
HTMLElement2_put_ondragend(IHTMLElement2
*iface
, VARIANT v
)
2987 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2988 FIXME("(%p)->()\n", This
);
2992 static HRESULT WINAPI
HTMLElement2_get_ondragend(IHTMLElement2
*iface
, VARIANT
*p
)
2994 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
2995 FIXME("(%p)->(%p)\n", This
, p
);
2999 static HRESULT WINAPI
HTMLElement2_put_ondragenter(IHTMLElement2
*iface
, VARIANT v
)
3001 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3002 FIXME("(%p)->()\n", This
);
3006 static HRESULT WINAPI
HTMLElement2_get_ondragenter(IHTMLElement2
*iface
, VARIANT
*p
)
3008 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3009 FIXME("(%p)->(%p)\n", This
, p
);
3013 static HRESULT WINAPI
HTMLElement2_put_ondragover(IHTMLElement2
*iface
, VARIANT v
)
3015 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3016 FIXME("(%p)->()\n", This
);
3020 static HRESULT WINAPI
HTMLElement2_get_ondragover(IHTMLElement2
*iface
, VARIANT
*p
)
3022 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3023 FIXME("(%p)->(%p)\n", This
, p
);
3027 static HRESULT WINAPI
HTMLElement2_put_ondragleave(IHTMLElement2
*iface
, VARIANT v
)
3029 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3030 FIXME("(%p)->()\n", This
);
3034 static HRESULT WINAPI
HTMLElement2_get_ondragleave(IHTMLElement2
*iface
, VARIANT
*p
)
3036 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3037 FIXME("(%p)->(%p)\n", This
, p
);
3041 static HRESULT WINAPI
HTMLElement2_put_ondrop(IHTMLElement2
*iface
, VARIANT v
)
3043 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3044 FIXME("(%p)->()\n", This
);
3048 static HRESULT WINAPI
HTMLElement2_get_ondrop(IHTMLElement2
*iface
, VARIANT
*p
)
3050 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3051 FIXME("(%p)->(%p)\n", This
, p
);
3055 static HRESULT WINAPI
HTMLElement2_put_onbeforecut(IHTMLElement2
*iface
, VARIANT v
)
3057 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3058 FIXME("(%p)->()\n", This
);
3062 static HRESULT WINAPI
HTMLElement2_get_onbeforecut(IHTMLElement2
*iface
, VARIANT
*p
)
3064 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3065 FIXME("(%p)->(%p)\n", This
, p
);
3069 static HRESULT WINAPI
HTMLElement2_put_oncut(IHTMLElement2
*iface
, VARIANT v
)
3071 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3072 FIXME("(%p)->()\n", This
);
3076 static HRESULT WINAPI
HTMLElement2_get_oncut(IHTMLElement2
*iface
, VARIANT
*p
)
3078 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3079 FIXME("(%p)->(%p)\n", This
, p
);
3083 static HRESULT WINAPI
HTMLElement2_put_onbeforecopy(IHTMLElement2
*iface
, VARIANT v
)
3085 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3086 FIXME("(%p)->()\n", This
);
3090 static HRESULT WINAPI
HTMLElement2_get_onbeforecopy(IHTMLElement2
*iface
, VARIANT
*p
)
3092 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3093 FIXME("(%p)->(%p)\n", This
, p
);
3097 static HRESULT WINAPI
HTMLElement2_put_oncopy(IHTMLElement2
*iface
, VARIANT v
)
3099 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3100 FIXME("(%p)->()\n", This
);
3104 static HRESULT WINAPI
HTMLElement2_get_oncopy(IHTMLElement2
*iface
, VARIANT
*p
)
3106 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3107 FIXME("(%p)->(%p)\n", This
, p
);
3111 static HRESULT WINAPI
HTMLElement2_put_onbeforepaste(IHTMLElement2
*iface
, VARIANT v
)
3113 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3114 FIXME("(%p)->()\n", This
);
3118 static HRESULT WINAPI
HTMLElement2_get_onbeforepaste(IHTMLElement2
*iface
, VARIANT
*p
)
3120 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3121 FIXME("(%p)->(%p)\n", This
, p
);
3125 static HRESULT WINAPI
HTMLElement2_put_onpaste(IHTMLElement2
*iface
, VARIANT v
)
3127 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3129 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3131 return set_node_event(&This
->node
, EVENTID_PASTE
, &v
);
3134 static HRESULT WINAPI
HTMLElement2_get_onpaste(IHTMLElement2
*iface
, VARIANT
*p
)
3136 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3138 TRACE("(%p)->(%p)\n", This
, p
);
3140 return get_node_event(&This
->node
, EVENTID_PASTE
, p
);
3143 static HRESULT WINAPI
HTMLElement2_get_currentStyle(IHTMLElement2
*iface
, IHTMLCurrentStyle
**p
)
3145 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3147 TRACE("(%p)->(%p)\n", This
, p
);
3149 return HTMLCurrentStyle_Create(This
, p
);
3152 static HRESULT WINAPI
HTMLElement2_put_onpropertychange(IHTMLElement2
*iface
, VARIANT v
)
3154 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3155 FIXME("(%p)->()\n", This
);
3159 static HRESULT WINAPI
HTMLElement2_get_onpropertychange(IHTMLElement2
*iface
, VARIANT
*p
)
3161 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3162 FIXME("(%p)->(%p)\n", This
, p
);
3166 static HRESULT WINAPI
HTMLElement2_getClientRects(IHTMLElement2
*iface
, IHTMLRectCollection
**pRectCol
)
3168 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3169 nsIDOMClientRectList
*rect_list
;
3170 HTMLRectCollection
*rects
;
3173 TRACE("(%p)->(%p)\n", This
, pRectCol
);
3175 if(!This
->dom_element
) {
3176 FIXME("comment element\n");
3180 nsres
= nsIDOMElement_GetClientRects(This
->dom_element
, &rect_list
);
3181 if(NS_FAILED(nsres
)) {
3182 WARN("GetClientRects failed: %08lx\n", nsres
);
3183 return map_nsresult(nsres
);
3186 rects
= heap_alloc_zero(sizeof(*rects
));
3188 nsIDOMClientRectList_Release(rect_list
);
3189 return E_OUTOFMEMORY
;
3192 rects
->IHTMLRectCollection_iface
.lpVtbl
= &HTMLRectCollectionVtbl
;
3194 rects
->rect_list
= rect_list
;
3195 init_dispatch(&rects
->dispex
, (IUnknown
*)&rects
->IHTMLRectCollection_iface
,
3196 &HTMLRectCollection_dispex
, dispex_compat_mode(&This
->node
.event_target
.dispex
));
3198 *pRectCol
= &rects
->IHTMLRectCollection_iface
;
3202 static HRESULT WINAPI
HTMLElement2_getBoundingClientRect(IHTMLElement2
*iface
, IHTMLRect
**pRect
)
3204 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3205 nsIDOMClientRect
*nsrect
;
3209 TRACE("(%p)->(%p)\n", This
, pRect
);
3211 if(!This
->dom_element
) {
3212 FIXME("comment element\n");
3216 nsres
= nsIDOMElement_GetBoundingClientRect(This
->dom_element
, &nsrect
);
3217 if(NS_FAILED(nsres
) || !nsrect
) {
3218 ERR("GetBoindingClientRect failed: %08lx\n", nsres
);
3222 hres
= create_html_rect(nsrect
, dispex_compat_mode(&This
->node
.event_target
.dispex
), pRect
);
3224 nsIDOMClientRect_Release(nsrect
);
3228 static HRESULT WINAPI
HTMLElement2_setExpression(IHTMLElement2
*iface
, BSTR propname
,
3229 BSTR expression
, BSTR language
)
3231 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3232 FIXME("(%p)->(%s %s %s)\n", This
, debugstr_w(propname
), debugstr_w(expression
),
3233 debugstr_w(language
));
3237 static HRESULT WINAPI
HTMLElement2_getExpression(IHTMLElement2
*iface
, BSTR propname
,
3238 VARIANT
*expression
)
3240 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3241 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(propname
), expression
);
3245 static HRESULT WINAPI
HTMLElement2_removeExpression(IHTMLElement2
*iface
, BSTR propname
,
3246 VARIANT_BOOL
*pfSuccess
)
3248 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3249 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(propname
), pfSuccess
);
3253 static HRESULT WINAPI
HTMLElement2_put_tabIndex(IHTMLElement2
*iface
, short v
)
3255 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3258 TRACE("(%p)->(%d)\n", This
, v
);
3260 if(!This
->html_element
) {
3261 FIXME("non-HTML element\n");
3265 nsres
= nsIDOMHTMLElement_SetTabIndex(This
->html_element
, v
);
3266 if(NS_FAILED(nsres
))
3267 ERR("GetTabIndex failed: %08lx\n", nsres
);
3272 static HRESULT WINAPI
HTMLElement2_get_tabIndex(IHTMLElement2
*iface
, short *p
)
3274 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3278 TRACE("(%p)->(%p)\n", This
, p
);
3280 if(!This
->html_element
) {
3281 FIXME("non-HTML element\n");
3285 nsres
= nsIDOMHTMLElement_GetTabIndex(This
->html_element
, &index
);
3286 if(NS_FAILED(nsres
)) {
3287 ERR("GetTabIndex failed: %08lx\n", nsres
);
3295 static HRESULT WINAPI
HTMLElement2_focus(IHTMLElement2
*iface
)
3297 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3300 TRACE("(%p)\n", This
);
3302 if(!This
->html_element
) {
3303 FIXME("non-HTML element\n");
3307 nsres
= nsIDOMHTMLElement_Focus(This
->html_element
);
3308 if(NS_FAILED(nsres
))
3309 ERR("Focus failed: %08lx\n", nsres
);
3314 static HRESULT WINAPI
HTMLElement2_put_accessKey(IHTMLElement2
*iface
, BSTR v
)
3316 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3320 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
3322 if(!This
->html_element
) {
3323 FIXME("non-HTML element\n");
3327 nsAString_InitDepend(&nsstr
, v
);
3328 nsres
= nsIDOMHTMLElement_SetAccessKey(This
->html_element
, &nsstr
);
3329 nsAString_Finish(&nsstr
);
3330 return map_nsresult(nsres
);
3333 static HRESULT WINAPI
HTMLElement2_get_accessKey(IHTMLElement2
*iface
, BSTR
*p
)
3335 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3339 TRACE("(%p)->(%p)\n", This
, p
);
3341 if(!This
->html_element
) {
3342 FIXME("non-HTML element\n");
3346 nsAString_InitDepend(&nsstr
, NULL
);
3347 nsres
= nsIDOMHTMLElement_GetAccessKey(This
->html_element
, &nsstr
);
3348 return return_nsstr(nsres
, &nsstr
, p
);
3351 static HRESULT WINAPI
HTMLElement2_put_onblur(IHTMLElement2
*iface
, VARIANT v
)
3353 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3355 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3357 return set_node_event(&This
->node
, EVENTID_BLUR
, &v
);
3360 static HRESULT WINAPI
HTMLElement2_get_onblur(IHTMLElement2
*iface
, VARIANT
*p
)
3362 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3364 TRACE("(%p)->(%p)\n", This
, p
);
3366 return get_node_event(&This
->node
, EVENTID_BLUR
, p
);
3369 static HRESULT WINAPI
HTMLElement2_put_onfocus(IHTMLElement2
*iface
, VARIANT v
)
3371 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3373 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3375 return set_node_event(&This
->node
, EVENTID_FOCUS
, &v
);
3378 static HRESULT WINAPI
HTMLElement2_get_onfocus(IHTMLElement2
*iface
, VARIANT
*p
)
3380 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3382 TRACE("(%p)->(%p)\n", This
, p
);
3384 return get_node_event(&This
->node
, EVENTID_FOCUS
, p
);
3387 static HRESULT WINAPI
HTMLElement2_put_onresize(IHTMLElement2
*iface
, VARIANT v
)
3389 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3391 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3393 return set_node_event(&This
->node
, EVENTID_RESIZE
, &v
);
3396 static HRESULT WINAPI
HTMLElement2_get_onresize(IHTMLElement2
*iface
, VARIANT
*p
)
3398 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3400 TRACE("(%p)->(%p)\n", This
, p
);
3402 return get_node_event(&This
->node
, EVENTID_RESIZE
, p
);
3405 static HRESULT WINAPI
HTMLElement2_blur(IHTMLElement2
*iface
)
3407 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3410 TRACE("(%p)\n", This
);
3412 if(!This
->html_element
) {
3413 FIXME("non-HTML element\n");
3417 nsres
= nsIDOMHTMLElement_Blur(This
->html_element
);
3418 if(NS_FAILED(nsres
)) {
3419 ERR("Blur failed: %08lx\n", nsres
);
3426 static HRESULT WINAPI
HTMLElement2_addFilter(IHTMLElement2
*iface
, IUnknown
*pUnk
)
3428 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3429 FIXME("(%p)->(%p)\n", This
, pUnk
);
3433 static HRESULT WINAPI
HTMLElement2_removeFilter(IHTMLElement2
*iface
, IUnknown
*pUnk
)
3435 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3436 FIXME("(%p)->(%p)\n", This
, pUnk
);
3440 static HRESULT WINAPI
HTMLElement2_get_clientHeight(IHTMLElement2
*iface
, LONG
*p
)
3442 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3445 TRACE("(%p)->(%p)\n", This
, p
);
3447 if(!This
->dom_element
) {
3448 FIXME("Unimplemented for comment element\n");
3452 nsres
= nsIDOMElement_GetClientHeight(This
->dom_element
, p
);
3453 assert(nsres
== NS_OK
);
3457 static HRESULT WINAPI
HTMLElement2_get_clientWidth(IHTMLElement2
*iface
, LONG
*p
)
3459 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3462 TRACE("(%p)->(%p)\n", This
, p
);
3464 if(!This
->dom_element
) {
3465 FIXME("comment element\n");
3469 nsres
= nsIDOMElement_GetClientWidth(This
->dom_element
, p
);
3470 assert(nsres
== NS_OK
);
3474 static HRESULT WINAPI
HTMLElement2_get_clientTop(IHTMLElement2
*iface
, LONG
*p
)
3476 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3479 TRACE("(%p)->(%p)\n", This
, p
);
3481 if(!This
->dom_element
) {
3482 FIXME("comment element\n");
3486 nsres
= nsIDOMElement_GetClientTop(This
->dom_element
, p
);
3487 assert(nsres
== NS_OK
);
3489 TRACE("*p = %ld\n", *p
);
3493 static HRESULT WINAPI
HTMLElement2_get_clientLeft(IHTMLElement2
*iface
, LONG
*p
)
3495 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3498 TRACE("(%p)->(%p)\n", This
, p
);
3500 if(!This
->dom_element
) {
3501 FIXME("comment element\n");
3505 nsres
= nsIDOMElement_GetClientLeft(This
->dom_element
, p
);
3506 assert(nsres
== NS_OK
);
3508 TRACE("*p = %ld\n", *p
);
3512 static HRESULT WINAPI
HTMLElement2_attachEvent(IHTMLElement2
*iface
, BSTR event
,
3513 IDispatch
*pDisp
, VARIANT_BOOL
*pfResult
)
3515 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3517 TRACE("(%p)->(%s %p %p)\n", This
, debugstr_w(event
), pDisp
, pfResult
);
3519 return attach_event(&This
->node
.event_target
, event
, pDisp
, pfResult
);
3522 static HRESULT WINAPI
HTMLElement2_detachEvent(IHTMLElement2
*iface
, BSTR event
, IDispatch
*pDisp
)
3524 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3526 TRACE("(%p)->(%s %p)\n", This
, debugstr_w(event
), pDisp
);
3528 return detach_event(&This
->node
.event_target
, event
, pDisp
);
3531 static HRESULT WINAPI
HTMLElement2_get_readyState(IHTMLElement2
*iface
, VARIANT
*p
)
3533 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3536 TRACE("(%p)->(%p)\n", This
, p
);
3538 if(This
->node
.vtbl
->get_readystate
) {
3541 hres
= This
->node
.vtbl
->get_readystate(&This
->node
, &str
);
3545 str
= SysAllocString(L
"complete");
3547 return E_OUTOFMEMORY
;
3555 static HRESULT WINAPI
HTMLElement2_put_onreadystatechange(IHTMLElement2
*iface
, VARIANT v
)
3557 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3559 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3561 return set_node_event(&This
->node
, EVENTID_READYSTATECHANGE
, &v
);
3564 static HRESULT WINAPI
HTMLElement2_get_onreadystatechange(IHTMLElement2
*iface
, VARIANT
*p
)
3566 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3568 TRACE("(%p)->(%p)\n", This
, p
);
3570 return get_node_event(&This
->node
, EVENTID_READYSTATECHANGE
, p
);
3573 static HRESULT WINAPI
HTMLElement2_put_onrowsdelete(IHTMLElement2
*iface
, VARIANT v
)
3575 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3576 FIXME("(%p)->()\n", This
);
3580 static HRESULT WINAPI
HTMLElement2_get_onrowsdelete(IHTMLElement2
*iface
, VARIANT
*p
)
3582 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3583 FIXME("(%p)->(%p)\n", This
, p
);
3587 static HRESULT WINAPI
HTMLElement2_put_onrowsinserted(IHTMLElement2
*iface
, VARIANT v
)
3589 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3590 FIXME("(%p)->()\n", This
);
3594 static HRESULT WINAPI
HTMLElement2_get_onrowsinserted(IHTMLElement2
*iface
, VARIANT
*p
)
3596 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3597 FIXME("(%p)->(%p)\n", This
, p
);
3601 static HRESULT WINAPI
HTMLElement2_put_oncellchange(IHTMLElement2
*iface
, VARIANT v
)
3603 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3604 FIXME("(%p)->()\n", This
);
3608 static HRESULT WINAPI
HTMLElement2_get_oncellchange(IHTMLElement2
*iface
, VARIANT
*p
)
3610 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3611 FIXME("(%p)->(%p)\n", This
, p
);
3615 static HRESULT WINAPI
HTMLElement2_put_dir(IHTMLElement2
*iface
, BSTR v
)
3617 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3621 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
3623 if(!This
->html_element
) {
3624 FIXME("non-HTML element\n");
3628 nsAString_InitDepend(&nsstr
, v
);
3629 nsres
= nsIDOMHTMLElement_SetDir(This
->html_element
, &nsstr
);
3630 nsAString_Finish(&nsstr
);
3631 if(NS_FAILED(nsres
)) {
3632 ERR("SetDir failed: %08lx\n", nsres
);
3639 static HRESULT WINAPI
HTMLElement2_get_dir(IHTMLElement2
*iface
, BSTR
*p
)
3641 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3645 TRACE("(%p)->(%p)\n", This
, p
);
3647 if(!This
->html_element
) {
3648 if(This
->dom_element
)
3649 FIXME("non-HTML element\n");
3654 nsAString_Init(&dir_str
, NULL
);
3655 nsres
= nsIDOMHTMLElement_GetDir(This
->html_element
, &dir_str
);
3656 return return_nsstr(nsres
, &dir_str
, p
);
3659 static HRESULT WINAPI
HTMLElement2_createControlRange(IHTMLElement2
*iface
, IDispatch
**range
)
3661 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3662 FIXME("(%p)->(%p)\n", This
, range
);
3666 static HRESULT WINAPI
HTMLElement2_get_scrollHeight(IHTMLElement2
*iface
, LONG
*p
)
3668 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3671 TRACE("(%p)->(%p)\n", This
, p
);
3673 if(!This
->dom_element
) {
3674 FIXME("comment element\n");
3678 nsres
= nsIDOMElement_GetScrollHeight(This
->dom_element
, p
);
3679 assert(nsres
== NS_OK
);
3680 TRACE("*p = %ld\n", *p
);
3684 static HRESULT WINAPI
HTMLElement2_get_scrollWidth(IHTMLElement2
*iface
, LONG
*p
)
3686 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3689 TRACE("(%p)->(%p)\n", This
, p
);
3691 if(!This
->dom_element
) {
3692 FIXME("comment element\n");
3696 nsres
= nsIDOMElement_GetScrollWidth(This
->dom_element
, p
);
3697 assert(nsres
== NS_OK
);
3699 TRACE("*p = %ld\n", *p
);
3703 static HRESULT WINAPI
HTMLElement2_put_scrollTop(IHTMLElement2
*iface
, LONG v
)
3705 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3707 TRACE("(%p)->(%ld)\n", This
, v
);
3709 if(!This
->dom_element
) {
3710 FIXME("comment element\n");
3714 nsIDOMElement_SetScrollTop(This
->dom_element
, v
);
3718 static HRESULT WINAPI
HTMLElement2_get_scrollTop(IHTMLElement2
*iface
, LONG
*p
)
3720 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3723 TRACE("(%p)->(%p)\n", This
, p
);
3725 if(!This
->dom_element
) {
3726 FIXME("comment element\n");
3730 nsres
= nsIDOMElement_GetScrollTop(This
->dom_element
, p
);
3731 assert(nsres
== NS_OK
);
3733 TRACE("*p = %ld\n", *p
);
3737 static HRESULT WINAPI
HTMLElement2_put_scrollLeft(IHTMLElement2
*iface
, LONG v
)
3739 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3741 TRACE("(%p)->(%ld)\n", This
, v
);
3743 if(!This
->dom_element
) {
3744 FIXME("comment element\n");
3748 nsIDOMElement_SetScrollLeft(This
->dom_element
, v
);
3752 static HRESULT WINAPI
HTMLElement2_get_scrollLeft(IHTMLElement2
*iface
, LONG
*p
)
3754 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3757 TRACE("(%p)->(%p)\n", This
, p
);
3760 return E_INVALIDARG
;
3762 if(!This
->dom_element
) {
3763 FIXME("comment element\n");
3767 nsres
= nsIDOMElement_GetScrollLeft(This
->dom_element
, p
);
3768 assert(nsres
== NS_OK
);
3769 TRACE("*p = %ld\n", *p
);
3773 static HRESULT WINAPI
HTMLElement2_clearAttributes(IHTMLElement2
*iface
)
3775 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3776 FIXME("(%p)\n", This
);
3780 static HRESULT WINAPI
HTMLElement2_mergeAttributes(IHTMLElement2
*iface
, IHTMLElement
*mergeThis
)
3782 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3783 FIXME("(%p)->(%p)\n", This
, mergeThis
);
3787 static HRESULT WINAPI
HTMLElement2_put_oncontextmenu(IHTMLElement2
*iface
, VARIANT v
)
3789 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3791 TRACE("(%p)->()\n", This
);
3793 return set_node_event(&This
->node
, EVENTID_CONTEXTMENU
, &v
);
3796 static HRESULT WINAPI
HTMLElement2_get_oncontextmenu(IHTMLElement2
*iface
, VARIANT
*p
)
3798 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3800 TRACE("(%p)->(%p)\n", This
, p
);
3802 return get_node_event(&This
->node
, EVENTID_CONTEXTMENU
, p
);
3805 static HRESULT WINAPI
HTMLElement2_insertAdjacentElement(IHTMLElement2
*iface
, BSTR where
,
3806 IHTMLElement
*insertedElement
, IHTMLElement
**inserted
)
3808 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3809 HTMLDOMNode
*ret_node
;
3813 TRACE("(%p)->(%s %p %p)\n", This
, debugstr_w(where
), insertedElement
, inserted
);
3815 elem
= unsafe_impl_from_IHTMLElement(insertedElement
);
3817 return E_INVALIDARG
;
3819 hres
= insert_adjacent_node(This
, where
, elem
->node
.nsnode
, &ret_node
);
3823 hres
= IHTMLDOMNode_QueryInterface(&ret_node
->IHTMLDOMNode_iface
, &IID_IHTMLElement
, (void**)inserted
);
3824 IHTMLDOMNode_Release(&ret_node
->IHTMLDOMNode_iface
);
3828 static HRESULT WINAPI
HTMLElement2_applyElement(IHTMLElement2
*iface
, IHTMLElement
*apply
,
3829 BSTR where
, IHTMLElement
**applied
)
3831 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3832 FIXME("(%p)->(%p %s %p)\n", This
, apply
, debugstr_w(where
), applied
);
3836 static HRESULT WINAPI
HTMLElement2_getAdjacentText(IHTMLElement2
*iface
, BSTR where
, BSTR
*text
)
3838 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3839 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(where
), text
);
3843 static HRESULT WINAPI
HTMLElement2_replaceAdjacentText(IHTMLElement2
*iface
, BSTR where
,
3844 BSTR newText
, BSTR
*oldText
)
3846 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3847 FIXME("(%p)->(%s %s %p)\n", This
, debugstr_w(where
), debugstr_w(newText
), oldText
);
3851 static HRESULT WINAPI
HTMLElement2_get_canHandleChildren(IHTMLElement2
*iface
, VARIANT_BOOL
*p
)
3853 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3854 FIXME("(%p)->(%p)\n", This
, p
);
3858 static HRESULT WINAPI
HTMLElement2_addBehavior(IHTMLElement2
*iface
, BSTR bstrUrl
,
3859 VARIANT
*pvarFactory
, LONG
*pCookie
)
3861 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3862 FIXME("(%p)->(%s %p %p)\n", This
, debugstr_w(bstrUrl
), pvarFactory
, pCookie
);
3866 static HRESULT WINAPI
HTMLElement2_removeBehavior(IHTMLElement2
*iface
, LONG cookie
,
3867 VARIANT_BOOL
*pfResult
)
3869 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3870 FIXME("(%p)->(%ld %p)\n", This
, cookie
, pfResult
);
3874 static HRESULT WINAPI
HTMLElement2_get_runtimeStyle(IHTMLElement2
*iface
, IHTMLStyle
**p
)
3876 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3878 FIXME("(%p)->(%p): hack\n", This
, p
);
3880 /* We can't implement correct behavior on top of Gecko (although we could
3881 try a bit harder). Making runtimeStyle behave like regular style is
3882 enough for most use cases. */
3883 if(!This
->runtime_style
) {
3886 hres
= HTMLStyle_Create(This
, &This
->runtime_style
);
3891 *p
= &This
->runtime_style
->IHTMLStyle_iface
;
3892 IHTMLStyle_AddRef(*p
);
3896 static HRESULT WINAPI
HTMLElement2_get_behaviorUrns(IHTMLElement2
*iface
, IDispatch
**p
)
3898 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3899 FIXME("(%p)->(%p)\n", This
, p
);
3903 static HRESULT WINAPI
HTMLElement2_put_tagUrn(IHTMLElement2
*iface
, BSTR v
)
3905 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3906 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
3910 static HRESULT WINAPI
HTMLElement2_get_tagUrn(IHTMLElement2
*iface
, BSTR
*p
)
3912 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3913 FIXME("(%p)->(%p)\n", This
, p
);
3917 static HRESULT WINAPI
HTMLElement2_put_onbeforeeditfocus(IHTMLElement2
*iface
, VARIANT vv
)
3919 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3920 FIXME("(%p)->()\n", This
);
3924 static HRESULT WINAPI
HTMLElement2_get_onbeforeeditfocus(IHTMLElement2
*iface
, VARIANT
*p
)
3926 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3927 FIXME("(%p)->(%p)\n", This
, p
);
3931 static HRESULT WINAPI
HTMLElement2_get_readyStateValue(IHTMLElement2
*iface
, LONG
*p
)
3933 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3934 FIXME("(%p)->(%p)\n", This
, p
);
3938 static HRESULT WINAPI
HTMLElement2_getElementsByTagName(IHTMLElement2
*iface
, BSTR v
,
3939 IHTMLElementCollection
**pelColl
)
3941 HTMLElement
*This
= impl_from_IHTMLElement2(iface
);
3942 nsIDOMHTMLCollection
*nscol
;
3946 TRACE("(%p)->(%s %p)\n", This
, debugstr_w(v
), pelColl
);
3948 if(!This
->dom_element
) {
3949 *pelColl
= create_collection_from_htmlcol(NULL
, This
->node
.doc
->document_mode
);
3953 nsAString_InitDepend(&tag_str
, v
);
3954 nsres
= nsIDOMElement_GetElementsByTagName(This
->dom_element
, &tag_str
, &nscol
);
3955 nsAString_Finish(&tag_str
);
3956 if(NS_FAILED(nsres
)) {
3957 ERR("GetElementByTagName failed: %08lx\n", nsres
);
3961 *pelColl
= create_collection_from_htmlcol(nscol
, dispex_compat_mode(&This
->node
.event_target
.dispex
));
3962 nsIDOMHTMLCollection_Release(nscol
);
3966 static const IHTMLElement2Vtbl HTMLElement2Vtbl
= {
3967 HTMLElement2_QueryInterface
,
3968 HTMLElement2_AddRef
,
3969 HTMLElement2_Release
,
3970 HTMLElement2_GetTypeInfoCount
,
3971 HTMLElement2_GetTypeInfo
,
3972 HTMLElement2_GetIDsOfNames
,
3973 HTMLElement2_Invoke
,
3974 HTMLElement2_get_scopeName
,
3975 HTMLElement2_setCapture
,
3976 HTMLElement2_releaseCapture
,
3977 HTMLElement2_put_onlosecapture
,
3978 HTMLElement2_get_onlosecapture
,
3979 HTMLElement2_componentFromPoint
,
3980 HTMLElement2_doScroll
,
3981 HTMLElement2_put_onscroll
,
3982 HTMLElement2_get_onscroll
,
3983 HTMLElement2_put_ondrag
,
3984 HTMLElement2_get_ondrag
,
3985 HTMLElement2_put_ondragend
,
3986 HTMLElement2_get_ondragend
,
3987 HTMLElement2_put_ondragenter
,
3988 HTMLElement2_get_ondragenter
,
3989 HTMLElement2_put_ondragover
,
3990 HTMLElement2_get_ondragover
,
3991 HTMLElement2_put_ondragleave
,
3992 HTMLElement2_get_ondragleave
,
3993 HTMLElement2_put_ondrop
,
3994 HTMLElement2_get_ondrop
,
3995 HTMLElement2_put_onbeforecut
,
3996 HTMLElement2_get_onbeforecut
,
3997 HTMLElement2_put_oncut
,
3998 HTMLElement2_get_oncut
,
3999 HTMLElement2_put_onbeforecopy
,
4000 HTMLElement2_get_onbeforecopy
,
4001 HTMLElement2_put_oncopy
,
4002 HTMLElement2_get_oncopy
,
4003 HTMLElement2_put_onbeforepaste
,
4004 HTMLElement2_get_onbeforepaste
,
4005 HTMLElement2_put_onpaste
,
4006 HTMLElement2_get_onpaste
,
4007 HTMLElement2_get_currentStyle
,
4008 HTMLElement2_put_onpropertychange
,
4009 HTMLElement2_get_onpropertychange
,
4010 HTMLElement2_getClientRects
,
4011 HTMLElement2_getBoundingClientRect
,
4012 HTMLElement2_setExpression
,
4013 HTMLElement2_getExpression
,
4014 HTMLElement2_removeExpression
,
4015 HTMLElement2_put_tabIndex
,
4016 HTMLElement2_get_tabIndex
,
4018 HTMLElement2_put_accessKey
,
4019 HTMLElement2_get_accessKey
,
4020 HTMLElement2_put_onblur
,
4021 HTMLElement2_get_onblur
,
4022 HTMLElement2_put_onfocus
,
4023 HTMLElement2_get_onfocus
,
4024 HTMLElement2_put_onresize
,
4025 HTMLElement2_get_onresize
,
4027 HTMLElement2_addFilter
,
4028 HTMLElement2_removeFilter
,
4029 HTMLElement2_get_clientHeight
,
4030 HTMLElement2_get_clientWidth
,
4031 HTMLElement2_get_clientTop
,
4032 HTMLElement2_get_clientLeft
,
4033 HTMLElement2_attachEvent
,
4034 HTMLElement2_detachEvent
,
4035 HTMLElement2_get_readyState
,
4036 HTMLElement2_put_onreadystatechange
,
4037 HTMLElement2_get_onreadystatechange
,
4038 HTMLElement2_put_onrowsdelete
,
4039 HTMLElement2_get_onrowsdelete
,
4040 HTMLElement2_put_onrowsinserted
,
4041 HTMLElement2_get_onrowsinserted
,
4042 HTMLElement2_put_oncellchange
,
4043 HTMLElement2_get_oncellchange
,
4044 HTMLElement2_put_dir
,
4045 HTMLElement2_get_dir
,
4046 HTMLElement2_createControlRange
,
4047 HTMLElement2_get_scrollHeight
,
4048 HTMLElement2_get_scrollWidth
,
4049 HTMLElement2_put_scrollTop
,
4050 HTMLElement2_get_scrollTop
,
4051 HTMLElement2_put_scrollLeft
,
4052 HTMLElement2_get_scrollLeft
,
4053 HTMLElement2_clearAttributes
,
4054 HTMLElement2_mergeAttributes
,
4055 HTMLElement2_put_oncontextmenu
,
4056 HTMLElement2_get_oncontextmenu
,
4057 HTMLElement2_insertAdjacentElement
,
4058 HTMLElement2_applyElement
,
4059 HTMLElement2_getAdjacentText
,
4060 HTMLElement2_replaceAdjacentText
,
4061 HTMLElement2_get_canHandleChildren
,
4062 HTMLElement2_addBehavior
,
4063 HTMLElement2_removeBehavior
,
4064 HTMLElement2_get_runtimeStyle
,
4065 HTMLElement2_get_behaviorUrns
,
4066 HTMLElement2_put_tagUrn
,
4067 HTMLElement2_get_tagUrn
,
4068 HTMLElement2_put_onbeforeeditfocus
,
4069 HTMLElement2_get_onbeforeeditfocus
,
4070 HTMLElement2_get_readyStateValue
,
4071 HTMLElement2_getElementsByTagName
,
4074 static inline HTMLElement
*impl_from_IHTMLElement3(IHTMLElement3
*iface
)
4076 return CONTAINING_RECORD(iface
, HTMLElement
, IHTMLElement3_iface
);
4079 static HRESULT WINAPI
HTMLElement3_QueryInterface(IHTMLElement3
*iface
,
4080 REFIID riid
, void **ppv
)
4082 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
4083 return IHTMLElement_QueryInterface(&This
->IHTMLElement_iface
, riid
, ppv
);
4086 static ULONG WINAPI
HTMLElement3_AddRef(IHTMLElement3
*iface
)
4088 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
4089 return IHTMLElement_AddRef(&This
->IHTMLElement_iface
);
4092 static ULONG WINAPI
HTMLElement3_Release(IHTMLElement3
*iface
)
4094 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
4095 return IHTMLElement_Release(&This
->IHTMLElement_iface
);
4098 static HRESULT WINAPI
HTMLElement3_GetTypeInfoCount(IHTMLElement3
*iface
, UINT
*pctinfo
)
4100 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
4101 return IDispatchEx_GetTypeInfoCount(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
4104 static HRESULT WINAPI
HTMLElement3_GetTypeInfo(IHTMLElement3
*iface
, UINT iTInfo
,
4105 LCID lcid
, ITypeInfo
**ppTInfo
)
4107 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
4108 return IDispatchEx_GetTypeInfo(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
4111 static HRESULT WINAPI
HTMLElement3_GetIDsOfNames(IHTMLElement3
*iface
, REFIID riid
,
4112 LPOLESTR
*rgszNames
, UINT cNames
,
4113 LCID lcid
, DISPID
*rgDispId
)
4115 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
4116 return IDispatchEx_GetIDsOfNames(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
4120 static HRESULT WINAPI
HTMLElement3_Invoke(IHTMLElement3
*iface
, DISPID dispIdMember
,
4121 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
4122 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
4124 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
4125 return IDispatchEx_Invoke(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
4126 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
4129 static HRESULT WINAPI
HTMLElement3_mergeAttributes(IHTMLElement3
*iface
, IHTMLElement
*mergeThis
, VARIANT
*pvarFlags
)
4131 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
4132 FIXME("(%p)->(%p %p)\n", This
, mergeThis
, pvarFlags
);
4136 static HRESULT WINAPI
HTMLElement3_get_isMultiLine(IHTMLElement3
*iface
, VARIANT_BOOL
*p
)
4138 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
4139 FIXME("(%p)->(%p)\n", This
, p
);
4143 static HRESULT WINAPI
HTMLElement3_get_canHaveHTML(IHTMLElement3
*iface
, VARIANT_BOOL
*p
)
4145 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
4146 FIXME("(%p)->(%p)\n", This
, p
);
4150 static HRESULT WINAPI
HTMLElement3_put_onlayoutcomplete(IHTMLElement3
*iface
, VARIANT v
)
4152 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
4153 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4157 static HRESULT WINAPI
HTMLElement3_get_onlayoutcomplete(IHTMLElement3
*iface
, VARIANT
*p
)
4159 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
4160 FIXME("(%p)->(%p)\n", This
, p
);
4164 static HRESULT WINAPI
HTMLElement3_put_onpage(IHTMLElement3
*iface
, VARIANT v
)
4166 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
4167 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4171 static HRESULT WINAPI
HTMLElement3_get_onpage(IHTMLElement3
*iface
, VARIANT
*p
)
4173 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
4174 FIXME("(%p)->(%p)\n", This
, p
);
4178 static HRESULT WINAPI
HTMLElement3_put_inflateBlock(IHTMLElement3
*iface
, VARIANT_BOOL v
)
4180 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
4181 FIXME("(%p)->(%x)\n", This
, v
);
4185 static HRESULT WINAPI
HTMLElement3_get_inflateBlock(IHTMLElement3
*iface
, VARIANT_BOOL
*p
)
4187 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
4188 FIXME("(%p)->(%p)\n", This
, p
);
4192 static HRESULT WINAPI
HTMLElement3_put_onbeforedeactivate(IHTMLElement3
*iface
, VARIANT v
)
4194 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
4195 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4199 static HRESULT WINAPI
HTMLElement3_get_onbeforedeactivate(IHTMLElement3
*iface
, VARIANT
*p
)
4201 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
4202 FIXME("(%p)->(%p)\n", This
, p
);
4206 static HRESULT WINAPI
HTMLElement3_setActive(IHTMLElement3
*iface
)
4208 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
4209 FIXME("(%p)\n", This
);
4213 static HRESULT WINAPI
HTMLElement3_put_contentEditable(IHTMLElement3
*iface
, BSTR v
)
4215 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
4219 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
4221 if(!This
->html_element
) {
4222 FIXME("non-HTML element\n");
4226 nsAString_InitDepend(&str
, v
);
4227 nsres
= nsIDOMHTMLElement_SetContentEditable(This
->html_element
, &str
);
4228 nsAString_Finish(&str
);
4230 if (NS_FAILED(nsres
)){
4231 ERR("SetContentEditable(%s) failed!\n", debugstr_w(v
));
4238 static HRESULT WINAPI
HTMLElement3_get_contentEditable(IHTMLElement3
*iface
, BSTR
*p
)
4240 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
4244 TRACE("(%p)->(%p)\n", This
, p
);
4246 if(!This
->html_element
) {
4247 FIXME("non-HTML element\n");
4251 nsAString_Init(&str
, NULL
);
4252 nsres
= nsIDOMHTMLElement_GetContentEditable(This
->html_element
, &str
);
4253 return return_nsstr(nsres
, &str
, p
);
4256 static HRESULT WINAPI
HTMLElement3_get_isContentEditable(IHTMLElement3
*iface
, VARIANT_BOOL
*p
)
4258 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
4259 FIXME("(%p)->(%p)\n", This
, p
);
4263 static HRESULT WINAPI
HTMLElement3_put_hideFocus(IHTMLElement3
*iface
, VARIANT_BOOL v
)
4265 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
4266 FIXME("(%p)->(%x)\n", This
, v
);
4270 static HRESULT WINAPI
HTMLElement3_get_hideFocus(IHTMLElement3
*iface
, VARIANT_BOOL
*p
)
4272 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
4273 FIXME("(%p)->(%p)\n", This
, p
);
4277 static HRESULT WINAPI
HTMLElement3_put_disabled(IHTMLElement3
*iface
, VARIANT_BOOL v
)
4279 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
4281 TRACE("(%p)->(%x)\n", This
, v
);
4283 if(This
->node
.vtbl
->put_disabled
)
4284 return This
->node
.vtbl
->put_disabled(&This
->node
, v
);
4286 if(!v
) return element_remove_attribute(This
, L
"disabled");
4287 return elem_string_attr_setter(This
, L
"disabled", L
"");
4290 static HRESULT WINAPI
HTMLElement3_get_disabled(IHTMLElement3
*iface
, VARIANT_BOOL
*p
)
4292 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
4294 TRACE("(%p)->(%p)\n", This
, p
);
4296 if(This
->node
.vtbl
->get_disabled
)
4297 return This
->node
.vtbl
->get_disabled(&This
->node
, p
);
4299 *p
= variant_bool(element_has_attribute(This
, L
"disabled"));
4303 static HRESULT WINAPI
HTMLElement3_get_isDisabled(IHTMLElement3
*iface
, VARIANT_BOOL
*p
)
4305 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
4306 FIXME("(%p)->(%p)\n", This
, p
);
4310 static HRESULT WINAPI
HTMLElement3_put_onmove(IHTMLElement3
*iface
, VARIANT v
)
4312 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
4313 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4317 static HRESULT WINAPI
HTMLElement3_get_onmove(IHTMLElement3
*iface
, VARIANT
*p
)
4319 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
4320 FIXME("(%p)->(%p)\n", This
, p
);
4324 static HRESULT WINAPI
HTMLElement3_put_oncontrolselect(IHTMLElement3
*iface
, VARIANT v
)
4326 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
4327 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4331 static HRESULT WINAPI
HTMLElement3_get_oncontrolselect(IHTMLElement3
*iface
, VARIANT
*p
)
4333 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
4334 FIXME("(%p)->(%p)\n", This
, p
);
4338 static HRESULT WINAPI
HTMLElement3_fireEvent(IHTMLElement3
*iface
, BSTR bstrEventName
,
4339 VARIANT
*pvarEventObject
, VARIANT_BOOL
*pfCancelled
)
4341 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
4343 TRACE("(%p)->(%s %s %p)\n", This
, debugstr_w(bstrEventName
), debugstr_variant(pvarEventObject
),
4346 return fire_event(&This
->node
, bstrEventName
, pvarEventObject
, pfCancelled
);
4349 static HRESULT WINAPI
HTMLElement3_put_onresizestart(IHTMLElement3
*iface
, VARIANT v
)
4351 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
4352 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4356 static HRESULT WINAPI
HTMLElement3_get_onresizestart(IHTMLElement3
*iface
, VARIANT
*p
)
4358 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
4359 FIXME("(%p)->(%p)\n", This
, p
);
4363 static HRESULT WINAPI
HTMLElement3_put_onresizeend(IHTMLElement3
*iface
, VARIANT v
)
4365 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
4366 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4370 static HRESULT WINAPI
HTMLElement3_get_onresizeend(IHTMLElement3
*iface
, VARIANT
*p
)
4372 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
4373 FIXME("(%p)->(%p)\n", This
, p
);
4377 static HRESULT WINAPI
HTMLElement3_put_onmovestart(IHTMLElement3
*iface
, VARIANT v
)
4379 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
4380 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4384 static HRESULT WINAPI
HTMLElement3_get_onmovestart(IHTMLElement3
*iface
, VARIANT
*p
)
4386 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
4387 FIXME("(%p)->(%p)\n", This
, p
);
4391 static HRESULT WINAPI
HTMLElement3_put_onmoveend(IHTMLElement3
*iface
, VARIANT v
)
4393 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
4394 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4398 static HRESULT WINAPI
HTMLElement3_get_onmoveend(IHTMLElement3
*iface
, VARIANT
*p
)
4400 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
4401 FIXME("(%p)->(%p)\n", This
, p
);
4405 static HRESULT WINAPI
HTMLElement3_put_onmousecenter(IHTMLElement3
*iface
, VARIANT v
)
4407 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
4408 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4412 static HRESULT WINAPI
HTMLElement3_get_onmousecenter(IHTMLElement3
*iface
, VARIANT
*p
)
4414 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
4415 FIXME("(%p)->(%p)\n", This
, p
);
4419 static HRESULT WINAPI
HTMLElement3_put_onmouseleave(IHTMLElement3
*iface
, VARIANT v
)
4421 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
4422 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4426 static HRESULT WINAPI
HTMLElement3_get_onmouseleave(IHTMLElement3
*iface
, VARIANT
*p
)
4428 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
4429 FIXME("(%p)->(%p)\n", This
, p
);
4433 static HRESULT WINAPI
HTMLElement3_put_onactivate(IHTMLElement3
*iface
, VARIANT v
)
4435 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
4436 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4440 static HRESULT WINAPI
HTMLElement3_get_onactivate(IHTMLElement3
*iface
, VARIANT
*p
)
4442 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
4443 FIXME("(%p)->(%p)\n", This
, p
);
4447 static HRESULT WINAPI
HTMLElement3_put_ondeactivate(IHTMLElement3
*iface
, VARIANT v
)
4449 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
4450 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4454 static HRESULT WINAPI
HTMLElement3_get_ondeactivate(IHTMLElement3
*iface
, VARIANT
*p
)
4456 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
4457 FIXME("(%p)->(%p)\n", This
, p
);
4461 static HRESULT WINAPI
HTMLElement3_dragDrop(IHTMLElement3
*iface
, VARIANT_BOOL
*pfRet
)
4463 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
4464 FIXME("(%p)->(%p)\n", This
, pfRet
);
4468 static HRESULT WINAPI
HTMLElement3_get_glyphMode(IHTMLElement3
*iface
, LONG
*p
)
4470 HTMLElement
*This
= impl_from_IHTMLElement3(iface
);
4471 FIXME("(%p)->(%p)\n", This
, p
);
4475 static const IHTMLElement3Vtbl HTMLElement3Vtbl
= {
4476 HTMLElement3_QueryInterface
,
4477 HTMLElement3_AddRef
,
4478 HTMLElement3_Release
,
4479 HTMLElement3_GetTypeInfoCount
,
4480 HTMLElement3_GetTypeInfo
,
4481 HTMLElement3_GetIDsOfNames
,
4482 HTMLElement3_Invoke
,
4483 HTMLElement3_mergeAttributes
,
4484 HTMLElement3_get_isMultiLine
,
4485 HTMLElement3_get_canHaveHTML
,
4486 HTMLElement3_put_onlayoutcomplete
,
4487 HTMLElement3_get_onlayoutcomplete
,
4488 HTMLElement3_put_onpage
,
4489 HTMLElement3_get_onpage
,
4490 HTMLElement3_put_inflateBlock
,
4491 HTMLElement3_get_inflateBlock
,
4492 HTMLElement3_put_onbeforedeactivate
,
4493 HTMLElement3_get_onbeforedeactivate
,
4494 HTMLElement3_setActive
,
4495 HTMLElement3_put_contentEditable
,
4496 HTMLElement3_get_contentEditable
,
4497 HTMLElement3_get_isContentEditable
,
4498 HTMLElement3_put_hideFocus
,
4499 HTMLElement3_get_hideFocus
,
4500 HTMLElement3_put_disabled
,
4501 HTMLElement3_get_disabled
,
4502 HTMLElement3_get_isDisabled
,
4503 HTMLElement3_put_onmove
,
4504 HTMLElement3_get_onmove
,
4505 HTMLElement3_put_oncontrolselect
,
4506 HTMLElement3_get_oncontrolselect
,
4507 HTMLElement3_fireEvent
,
4508 HTMLElement3_put_onresizestart
,
4509 HTMLElement3_get_onresizestart
,
4510 HTMLElement3_put_onresizeend
,
4511 HTMLElement3_get_onresizeend
,
4512 HTMLElement3_put_onmovestart
,
4513 HTMLElement3_get_onmovestart
,
4514 HTMLElement3_put_onmoveend
,
4515 HTMLElement3_get_onmoveend
,
4516 HTMLElement3_put_onmousecenter
,
4517 HTMLElement3_get_onmousecenter
,
4518 HTMLElement3_put_onmouseleave
,
4519 HTMLElement3_get_onmouseleave
,
4520 HTMLElement3_put_onactivate
,
4521 HTMLElement3_get_onactivate
,
4522 HTMLElement3_put_ondeactivate
,
4523 HTMLElement3_get_ondeactivate
,
4524 HTMLElement3_dragDrop
,
4525 HTMLElement3_get_glyphMode
4528 static inline HTMLElement
*impl_from_IHTMLElement4(IHTMLElement4
*iface
)
4530 return CONTAINING_RECORD(iface
, HTMLElement
, IHTMLElement4_iface
);
4533 static HRESULT WINAPI
HTMLElement4_QueryInterface(IHTMLElement4
*iface
,
4534 REFIID riid
, void **ppv
)
4536 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
4537 return IHTMLElement_QueryInterface(&This
->IHTMLElement_iface
, riid
, ppv
);
4540 static ULONG WINAPI
HTMLElement4_AddRef(IHTMLElement4
*iface
)
4542 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
4543 return IHTMLElement_AddRef(&This
->IHTMLElement_iface
);
4546 static ULONG WINAPI
HTMLElement4_Release(IHTMLElement4
*iface
)
4548 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
4549 return IHTMLElement_Release(&This
->IHTMLElement_iface
);
4552 static HRESULT WINAPI
HTMLElement4_GetTypeInfoCount(IHTMLElement4
*iface
, UINT
*pctinfo
)
4554 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
4555 return IDispatchEx_GetTypeInfoCount(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
4558 static HRESULT WINAPI
HTMLElement4_GetTypeInfo(IHTMLElement4
*iface
, UINT iTInfo
,
4559 LCID lcid
, ITypeInfo
**ppTInfo
)
4561 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
4562 return IDispatchEx_GetTypeInfo(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
4565 static HRESULT WINAPI
HTMLElement4_GetIDsOfNames(IHTMLElement4
*iface
, REFIID riid
,
4566 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
4568 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
4569 return IDispatchEx_GetIDsOfNames(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
4573 static HRESULT WINAPI
HTMLElement4_Invoke(IHTMLElement4
*iface
, DISPID dispIdMember
, REFIID riid
,
4574 LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
4576 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
4577 return IDispatchEx_Invoke(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
4578 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
4581 static HRESULT WINAPI
HTMLElement4_put_onmousewheel(IHTMLElement4
*iface
, VARIANT v
)
4583 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
4585 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4587 return set_node_event(&This
->node
, EVENTID_MOUSEWHEEL
, &v
);
4590 static HRESULT WINAPI
HTMLElement4_get_onmousewheel(IHTMLElement4
*iface
, VARIANT
*p
)
4592 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
4594 TRACE("(%p)->(%p)\n", This
, p
);
4596 return get_node_event(&This
->node
, EVENTID_MOUSEWHEEL
, p
);
4599 static HRESULT WINAPI
HTMLElement4_normalize(IHTMLElement4
*iface
)
4601 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
4602 FIXME("(%p)\n", This
);
4606 static HRESULT WINAPI
HTMLElement4_getAttributeNode(IHTMLElement4
*iface
, BSTR bstrname
, IHTMLDOMAttribute
**ppAttribute
)
4608 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
4609 HTMLAttributeCollection
*attrs
;
4612 TRACE("(%p)->(%s %p)\n", This
, debugstr_w(bstrname
), ppAttribute
);
4614 hres
= HTMLElement_get_attr_col(&This
->node
, &attrs
);
4618 hres
= IHTMLAttributeCollection2_getNamedItem(&attrs
->IHTMLAttributeCollection2_iface
, bstrname
, ppAttribute
);
4619 IHTMLAttributeCollection_Release(&attrs
->IHTMLAttributeCollection_iface
);
4623 static HRESULT WINAPI
HTMLElement4_setAttributeNode(IHTMLElement4
*iface
, IHTMLDOMAttribute
*pattr
,
4624 IHTMLDOMAttribute
**ppretAttribute
)
4626 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
4627 HTMLDOMAttribute
*attr
, *iter
, *replace
= NULL
;
4628 HTMLAttributeCollection
*attrs
;
4632 TRACE("(%p)->(%p %p)\n", This
, pattr
, ppretAttribute
);
4634 attr
= unsafe_impl_from_IHTMLDOMAttribute(pattr
);
4636 return E_INVALIDARG
;
4639 WARN("Tried to set already attached attribute.\n");
4640 return E_INVALIDARG
;
4643 hres
= IDispatchEx_GetDispID(&This
->node
.event_target
.dispex
.IDispatchEx_iface
,
4644 attr
->name
, fdexNameCaseInsensitive
|fdexNameEnsure
, &dispid
);
4648 hres
= HTMLElement_get_attr_col(&This
->node
, &attrs
);
4652 LIST_FOR_EACH_ENTRY(iter
, &attrs
->attrs
, HTMLDOMAttribute
, entry
) {
4653 if(iter
->dispid
== dispid
) {
4660 hres
= get_elem_attr_value_by_dispid(This
, dispid
, &replace
->value
);
4662 WARN("could not get attr value: %08lx\n", hres
);
4663 V_VT(&replace
->value
) = VT_EMPTY
;
4665 if(!replace
->name
) {
4666 replace
->name
= attr
->name
;
4669 list_add_head(&replace
->entry
, &attr
->entry
);
4670 list_remove(&replace
->entry
);
4671 replace
->elem
= NULL
;
4673 list_add_tail(&attrs
->attrs
, &attr
->entry
);
4676 IHTMLDOMAttribute_AddRef(&attr
->IHTMLDOMAttribute_iface
);
4678 attr
->dispid
= dispid
;
4680 IHTMLAttributeCollection_Release(&attrs
->IHTMLAttributeCollection_iface
);
4682 hres
= set_elem_attr_value_by_dispid(This
, dispid
, &attr
->value
);
4684 WARN("Could not set attribute value: %08lx\n", hres
);
4685 VariantClear(&attr
->value
);
4687 *ppretAttribute
= replace
? &replace
->IHTMLDOMAttribute_iface
: NULL
;
4691 static HRESULT WINAPI
HTMLElement4_removeAttributeNode(IHTMLElement4
*iface
, IHTMLDOMAttribute
*pattr
,
4692 IHTMLDOMAttribute
**ppretAttribute
)
4694 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
4695 FIXME("(%p)->(%p %p)\n", This
, pattr
, ppretAttribute
);
4699 static HRESULT WINAPI
HTMLElement4_put_onbeforeactivate(IHTMLElement4
*iface
, VARIANT v
)
4701 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
4703 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4705 return set_node_event(&This
->node
, EVENTID_BEFOREACTIVATE
, &v
);
4708 static HRESULT WINAPI
HTMLElement4_get_onbeforeactivate(IHTMLElement4
*iface
, VARIANT
*p
)
4710 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
4712 TRACE("(%p)->(%p)\n", This
, p
);
4714 return get_node_event(&This
->node
, EVENTID_BEFOREACTIVATE
, p
);
4717 static HRESULT WINAPI
HTMLElement4_put_onfocusin(IHTMLElement4
*iface
, VARIANT v
)
4719 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
4721 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4723 return set_node_event(&This
->node
, EVENTID_FOCUSIN
, &v
);
4726 static HRESULT WINAPI
HTMLElement4_get_onfocusin(IHTMLElement4
*iface
, VARIANT
*p
)
4728 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
4730 TRACE("(%p)->(%p)\n", This
, p
);
4732 return get_node_event(&This
->node
, EVENTID_FOCUSIN
, p
);
4735 static HRESULT WINAPI
HTMLElement4_put_onfocusout(IHTMLElement4
*iface
, VARIANT v
)
4737 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
4739 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
4741 return set_node_event(&This
->node
, EVENTID_FOCUSOUT
, &v
);
4744 static HRESULT WINAPI
HTMLElement4_get_onfocusout(IHTMLElement4
*iface
, VARIANT
*p
)
4746 HTMLElement
*This
= impl_from_IHTMLElement4(iface
);
4748 TRACE("(%p)->(%p)\n", This
, p
);
4750 return get_node_event(&This
->node
, EVENTID_FOCUSOUT
, p
);
4753 static const IHTMLElement4Vtbl HTMLElement4Vtbl
= {
4754 HTMLElement4_QueryInterface
,
4755 HTMLElement4_AddRef
,
4756 HTMLElement4_Release
,
4757 HTMLElement4_GetTypeInfoCount
,
4758 HTMLElement4_GetTypeInfo
,
4759 HTMLElement4_GetIDsOfNames
,
4760 HTMLElement4_Invoke
,
4761 HTMLElement4_put_onmousewheel
,
4762 HTMLElement4_get_onmousewheel
,
4763 HTMLElement4_normalize
,
4764 HTMLElement4_getAttributeNode
,
4765 HTMLElement4_setAttributeNode
,
4766 HTMLElement4_removeAttributeNode
,
4767 HTMLElement4_put_onbeforeactivate
,
4768 HTMLElement4_get_onbeforeactivate
,
4769 HTMLElement4_put_onfocusin
,
4770 HTMLElement4_get_onfocusin
,
4771 HTMLElement4_put_onfocusout
,
4772 HTMLElement4_get_onfocusout
4775 static inline HTMLElement
*impl_from_IHTMLElement6(IHTMLElement6
*iface
)
4777 return CONTAINING_RECORD(iface
, HTMLElement
, IHTMLElement6_iface
);
4780 static HRESULT WINAPI
HTMLElement6_QueryInterface(IHTMLElement6
*iface
,
4781 REFIID riid
, void **ppv
)
4783 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4784 return IHTMLElement_QueryInterface(&This
->IHTMLElement_iface
, riid
, ppv
);
4787 static ULONG WINAPI
HTMLElement6_AddRef(IHTMLElement6
*iface
)
4789 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4790 return IHTMLElement_AddRef(&This
->IHTMLElement_iface
);
4793 static ULONG WINAPI
HTMLElement6_Release(IHTMLElement6
*iface
)
4795 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4796 return IHTMLElement_Release(&This
->IHTMLElement_iface
);
4799 static HRESULT WINAPI
HTMLElement6_GetTypeInfoCount(IHTMLElement6
*iface
, UINT
*pctinfo
)
4801 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4802 return IDispatchEx_GetTypeInfoCount(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
4805 static HRESULT WINAPI
HTMLElement6_GetTypeInfo(IHTMLElement6
*iface
, UINT iTInfo
,
4806 LCID lcid
, ITypeInfo
**ppTInfo
)
4808 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4809 return IDispatchEx_GetTypeInfo(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
4812 static HRESULT WINAPI
HTMLElement6_GetIDsOfNames(IHTMLElement6
*iface
, REFIID riid
,
4813 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
4815 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4816 return IDispatchEx_GetIDsOfNames(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
4820 static HRESULT WINAPI
HTMLElement6_Invoke(IHTMLElement6
*iface
, DISPID dispIdMember
, REFIID riid
,
4821 LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
4823 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4824 return IDispatchEx_Invoke(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
4825 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
4828 static HRESULT WINAPI
HTMLElement6_getAttributeNS(IHTMLElement6
*iface
, VARIANT
*pvarNS
, BSTR strAttributeName
, VARIANT
*AttributeValue
)
4830 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4831 nsAString ns_str
, name_str
, value_str
;
4835 TRACE("(%p)->(%s %s %p)\n", This
, debugstr_variant(pvarNS
), debugstr_w(strAttributeName
), AttributeValue
);
4837 if(!This
->dom_element
) {
4838 FIXME("No dom_element\n");
4842 hres
= variant_to_nsstr(pvarNS
, FALSE
, &ns_str
);
4846 nsAString_InitDepend(&name_str
, strAttributeName
);
4847 nsAString_InitDepend(&value_str
, NULL
);
4848 nsres
= nsIDOMElement_GetAttributeNS(This
->dom_element
, &ns_str
, &name_str
, &value_str
);
4849 nsAString_Finish(&ns_str
);
4850 nsAString_Finish(&name_str
);
4852 hres
= return_nsstr_variant(nsres
, &value_str
, 0, AttributeValue
);
4853 if(SUCCEEDED(hres
) && V_VT(AttributeValue
) == VT_NULL
) {
4854 V_VT(AttributeValue
) = VT_BSTR
;
4855 V_BSTR(AttributeValue
) = NULL
;
4860 static HRESULT WINAPI
HTMLElement6_setAttributeNS(IHTMLElement6
*iface
, VARIANT
*pvarNS
, BSTR strAttributeName
, VARIANT
*pvarAttributeValue
)
4862 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4863 nsAString ns_str
, name_str
, value_str
;
4864 const PRUnichar
*ns
;
4868 TRACE("(%p)->(%s %s %s)\n", This
, debugstr_variant(pvarNS
), debugstr_w(strAttributeName
), debugstr_variant(pvarAttributeValue
));
4870 hres
= variant_to_nsstr(pvarNS
, FALSE
, &ns_str
);
4873 nsAString_GetData(&ns_str
, &ns
);
4874 if((!ns
|| !ns
[0]) && wcschr(strAttributeName
, ':')) {
4875 nsAString_Finish(&ns_str
);
4876 /* FIXME: Return NamespaceError */
4880 if(!This
->dom_element
) {
4881 FIXME("No dom_element\n");
4882 nsAString_Finish(&ns_str
);
4886 hres
= variant_to_nsstr(pvarAttributeValue
, FALSE
, &value_str
);
4888 nsAString_Finish(&ns_str
);
4892 nsAString_InitDepend(&name_str
, strAttributeName
);
4893 nsres
= nsIDOMElement_SetAttributeNS(This
->dom_element
, &ns_str
, &name_str
, &value_str
);
4894 nsAString_Finish(&ns_str
);
4895 nsAString_Finish(&name_str
);
4896 nsAString_Finish(&value_str
);
4897 if(NS_FAILED(nsres
))
4898 WARN("SetAttributeNS failed: %08lx\n", nsres
);
4899 return map_nsresult(nsres
);
4902 static HRESULT WINAPI
HTMLElement6_removeAttributeNS(IHTMLElement6
*iface
, VARIANT
*pvarNS
, BSTR strAttributeName
)
4904 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4905 nsAString ns_str
, name_str
;
4909 TRACE("(%p)->(%s %s)\n", This
, debugstr_variant(pvarNS
), debugstr_w(strAttributeName
));
4911 if(!This
->dom_element
) {
4912 FIXME("No dom_element\n");
4916 hres
= variant_to_nsstr(pvarNS
, FALSE
, &ns_str
);
4920 nsAString_InitDepend(&name_str
, strAttributeName
);
4921 nsres
= nsIDOMElement_RemoveAttributeNS(This
->dom_element
, &ns_str
, &name_str
);
4922 nsAString_Finish(&ns_str
);
4923 nsAString_Finish(&name_str
);
4924 return map_nsresult(nsres
);
4927 static HRESULT WINAPI
HTMLElement6_getAttributeNodeNS(IHTMLElement6
*iface
, VARIANT
*pvarNS
, BSTR name
, IHTMLDOMAttribute2
**ppretAttribute
)
4929 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4930 FIXME("(%p)->(%s %s %p)\n", This
, debugstr_variant(pvarNS
), debugstr_w(name
), ppretAttribute
);
4934 static HRESULT WINAPI
HTMLElement6_setAttributeNodeNS(IHTMLElement6
*iface
, IHTMLDOMAttribute2
*pattr
, IHTMLDOMAttribute2
**ppretAttribute
)
4936 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4937 FIXME("(%p)->(%p %p)\n", This
, pattr
, ppretAttribute
);
4941 static HRESULT WINAPI
HTMLElement6_hasAttributeNS(IHTMLElement6
*iface
, VARIANT
*pvarNS
, BSTR name
, VARIANT_BOOL
*pfHasAttribute
)
4943 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4944 nsAString ns_str
, name_str
;
4949 TRACE("(%p)->(%s %s %p)\n", This
, debugstr_variant(pvarNS
), debugstr_w(name
), pfHasAttribute
);
4951 if(!This
->dom_element
) {
4952 FIXME("No dom_element\n");
4956 hres
= variant_to_nsstr(pvarNS
, FALSE
, &ns_str
);
4960 nsAString_InitDepend(&name_str
, name
);
4961 nsres
= nsIDOMElement_HasAttributeNS(This
->dom_element
, &ns_str
, &name_str
, &r
);
4962 nsAString_Finish(&ns_str
);
4963 nsAString_Finish(&name_str
);
4964 *pfHasAttribute
= variant_bool(NS_SUCCEEDED(nsres
) && r
);
4968 static HRESULT WINAPI
HTMLElement6_getAttribute(IHTMLElement6
*iface
, BSTR strAttributeName
, VARIANT
*AttributeValue
)
4970 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4972 WARN("(%p)->(%s %p) forwarding to IHTMLElement\n", This
, debugstr_w(strAttributeName
), AttributeValue
);
4974 return IHTMLElement_getAttribute(&This
->IHTMLElement_iface
, strAttributeName
, 0, AttributeValue
);
4977 static HRESULT WINAPI
HTMLElement6_setAttribute(IHTMLElement6
*iface
, BSTR strAttributeName
, VARIANT
*pvarAttributeValue
)
4979 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4981 WARN("(%p)->(%s %p) forwarding to IHTMLElement\n", This
, debugstr_w(strAttributeName
), pvarAttributeValue
);
4983 return IHTMLElement_setAttribute(&This
->IHTMLElement_iface
, strAttributeName
, *pvarAttributeValue
, 0);
4986 static HRESULT WINAPI
HTMLElement6_removeAttribute(IHTMLElement6
*iface
, BSTR strAttributeName
)
4988 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4989 VARIANT_BOOL success
;
4991 WARN("(%p)->(%s) forwarding to IHTMLElement\n", This
, debugstr_w(strAttributeName
));
4993 return IHTMLElement_removeAttribute(&This
->IHTMLElement_iface
, strAttributeName
, 0, &success
);
4996 static HRESULT WINAPI
HTMLElement6_getAttributeNode(IHTMLElement6
*iface
, BSTR strAttributeName
, IHTMLDOMAttribute2
**ppretAttribute
)
4998 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
4999 IHTMLDOMAttribute
*attr
;
5002 WARN("(%p)->(%s %p) forwarding to IHTMLElement4\n", This
, debugstr_w(strAttributeName
), ppretAttribute
);
5004 hres
= IHTMLElement4_getAttributeNode(&This
->IHTMLElement4_iface
, strAttributeName
, &attr
);
5009 hres
= IHTMLDOMAttribute_QueryInterface(attr
, &IID_IHTMLDOMAttribute2
, (void**)ppretAttribute
);
5010 IHTMLDOMAttribute_Release(attr
);
5012 *ppretAttribute
= NULL
;
5017 static HRESULT WINAPI
HTMLElement6_setAttributeNode(IHTMLElement6
*iface
, IHTMLDOMAttribute2
*pattr
, IHTMLDOMAttribute2
**ppretAttribute
)
5019 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5020 IHTMLDOMAttribute
*attr
, *ret_attr
;
5023 WARN("(%p)->(%p %p) forwarding to IHTMLElement4\n", This
, pattr
, ppretAttribute
);
5025 hres
= IHTMLDOMAttribute2_QueryInterface(pattr
, &IID_IHTMLDOMAttribute
, (void**)&attr
);
5029 hres
= IHTMLElement4_setAttributeNode(&This
->IHTMLElement4_iface
, attr
, &ret_attr
);
5034 hres
= IHTMLDOMAttribute_QueryInterface(ret_attr
, &IID_IHTMLDOMAttribute2
, (void**)ppretAttribute
);
5035 IHTMLDOMAttribute_Release(ret_attr
);
5037 *ppretAttribute
= NULL
;
5042 static HRESULT WINAPI
HTMLElement6_removeAttributeNode(IHTMLElement6
*iface
, IHTMLDOMAttribute2
*pattr
, IHTMLDOMAttribute2
**ppretAttribute
)
5044 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5045 FIXME("(%p)->()\n", This
);
5049 static HRESULT WINAPI
HTMLElement6_hasAttribute(IHTMLElement6
*iface
, BSTR name
, VARIANT_BOOL
*p
)
5051 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5053 TRACE("(%p)->(%s %p)\n", This
, debugstr_w(name
), p
);
5055 *p
= element_has_attribute(This
, name
);
5059 static HRESULT WINAPI
HTMLElement6_getElementsByTagNameNS(IHTMLElement6
*iface
, VARIANT
*varNS
, BSTR bstrLocalName
, IHTMLElementCollection
**pelColl
)
5061 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5062 FIXME("(%p)->(%s %s %p)\n", This
, debugstr_variant(varNS
), debugstr_w(bstrLocalName
), pelColl
);
5066 static HRESULT WINAPI
HTMLElement6_get_tagName(IHTMLElement6
*iface
, BSTR
*p
)
5068 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5070 TRACE("(%p)->(%p)\n", This
, p
);
5072 return IHTMLElement_get_tagName(&This
->IHTMLElement_iface
, p
);
5075 static HRESULT WINAPI
HTMLElement6_get_nodeName(IHTMLElement6
*iface
, BSTR
*p
)
5077 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5079 TRACE("(%p)->(%p)\n", This
, p
);
5081 return IHTMLDOMNode_get_nodeName(&This
->node
.IHTMLDOMNode_iface
, p
);
5084 static HRESULT WINAPI
HTMLElement6_getElementsByClassName(IHTMLElement6
*iface
, BSTR v
, IHTMLElementCollection
**pel
)
5086 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5087 nsIDOMHTMLCollection
*nscol
= NULL
;
5091 TRACE("(%p)->(%s %p)\n", This
, debugstr_w(v
), pel
);
5093 if(This
->dom_element
) {
5094 nsAString_InitDepend(&nsstr
, v
);
5095 nsres
= nsIDOMElement_GetElementsByClassName(This
->dom_element
, &nsstr
, &nscol
);
5096 nsAString_Finish(&nsstr
);
5097 if(NS_FAILED(nsres
)) {
5098 ERR("GetElementsByClassName failed: %08lx\n", nsres
);
5103 *pel
= create_collection_from_htmlcol(nscol
, dispex_compat_mode(&This
->node
.event_target
.dispex
));
5104 nsIDOMHTMLCollection_Release(nscol
);
5108 static HRESULT WINAPI
HTMLElement6_msMatchesSelector(IHTMLElement6
*iface
, BSTR v
, VARIANT_BOOL
*pfMatches
)
5110 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5115 TRACE("(%p)->(%s %p)\n", This
, debugstr_w(v
), pfMatches
);
5117 if(!This
->dom_element
) {
5118 FIXME("No dom element\n");
5119 return E_UNEXPECTED
;
5122 nsAString_InitDepend(&nsstr
, v
);
5123 nsres
= nsIDOMElement_MozMatchesSelector(This
->dom_element
, &nsstr
, &b
);
5124 nsAString_Finish(&nsstr
);
5125 if(NS_FAILED(nsres
)) {
5126 WARN("MozMatchesSelector failed: %08lx\n", nsres
);
5127 return map_nsresult(nsres
);
5134 static HRESULT WINAPI
HTMLElement6_put_onabort(IHTMLElement6
*iface
, VARIANT v
)
5136 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5138 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
5140 return set_node_event(&This
->node
, EVENTID_ABORT
, &v
);
5143 static HRESULT WINAPI
HTMLElement6_get_onabort(IHTMLElement6
*iface
, VARIANT
*p
)
5145 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5147 TRACE("(%p)->(%p)\n", This
, p
);
5149 return get_node_event(&This
->node
, EVENTID_ABORT
, p
);
5152 static HRESULT WINAPI
HTMLElement6_put_oncanplay(IHTMLElement6
*iface
, VARIANT v
)
5154 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5155 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
5159 static HRESULT WINAPI
HTMLElement6_get_oncanplay(IHTMLElement6
*iface
, VARIANT
*p
)
5161 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5162 FIXME("(%p)->(%p)\n", This
, p
);
5166 static HRESULT WINAPI
HTMLElement6_put_oncanplaythrough(IHTMLElement6
*iface
, VARIANT v
)
5168 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5169 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
5173 static HRESULT WINAPI
HTMLElement6_get_oncanplaythrough(IHTMLElement6
*iface
, VARIANT
*p
)
5175 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5176 FIXME("(%p)->(%p)\n", This
, p
);
5180 static HRESULT WINAPI
HTMLElement6_put_onchange(IHTMLElement6
*iface
, VARIANT v
)
5182 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5184 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
5186 return set_node_event(&This
->node
, EVENTID_CHANGE
, &v
);
5189 static HRESULT WINAPI
HTMLElement6_get_onchange(IHTMLElement6
*iface
, VARIANT
*p
)
5191 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5193 TRACE("(%p)->(%p)\n", This
, p
);
5195 return get_node_event(&This
->node
, EVENTID_CHANGE
, p
);
5198 static HRESULT WINAPI
HTMLElement6_put_ondurationchange(IHTMLElement6
*iface
, VARIANT v
)
5200 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5201 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
5205 static HRESULT WINAPI
HTMLElement6_get_ondurationchange(IHTMLElement6
*iface
, VARIANT
*p
)
5207 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5208 FIXME("(%p)->(%p)\n", This
, p
);
5212 static HRESULT WINAPI
HTMLElement6_put_onemptied(IHTMLElement6
*iface
, VARIANT v
)
5214 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5215 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
5219 static HRESULT WINAPI
HTMLElement6_get_onemptied(IHTMLElement6
*iface
, VARIANT
*p
)
5221 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5222 FIXME("(%p)->(%p)\n", This
, p
);
5226 static HRESULT WINAPI
HTMLElement6_put_onended(IHTMLElement6
*iface
, VARIANT v
)
5228 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5229 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
5233 static HRESULT WINAPI
HTMLElement6_get_onended(IHTMLElement6
*iface
, VARIANT
*p
)
5235 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5236 FIXME("(%p)->(%p)\n", This
, p
);
5240 static HRESULT WINAPI
HTMLElement6_put_onerror(IHTMLElement6
*iface
, VARIANT v
)
5242 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5244 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
5246 return set_node_event(&This
->node
, EVENTID_ERROR
, &v
);
5249 static HRESULT WINAPI
HTMLElement6_get_onerror(IHTMLElement6
*iface
, VARIANT
*p
)
5251 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5253 TRACE("(%p)->(%p)\n", This
, p
);
5255 return get_node_event(&This
->node
, EVENTID_ERROR
, p
);
5258 static HRESULT WINAPI
HTMLElement6_put_oninput(IHTMLElement6
*iface
, VARIANT v
)
5260 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5262 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
5264 return set_node_event(&This
->node
, EVENTID_INPUT
, &v
);
5267 static HRESULT WINAPI
HTMLElement6_get_oninput(IHTMLElement6
*iface
, VARIANT
*p
)
5269 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5271 TRACE("(%p)->(%p)\n", This
, p
);
5273 return get_node_event(&This
->node
, EVENTID_INPUT
, p
);
5276 static HRESULT WINAPI
HTMLElement6_put_onload(IHTMLElement6
*iface
, VARIANT v
)
5278 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5280 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
5282 return set_node_event(&This
->node
, EVENTID_LOAD
, &v
);
5285 static HRESULT WINAPI
HTMLElement6_get_onload(IHTMLElement6
*iface
, VARIANT
*p
)
5287 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5289 TRACE("(%p)->(%p)\n", This
, p
);
5291 return get_node_event(&This
->node
, EVENTID_LOAD
, p
);
5294 static HRESULT WINAPI
HTMLElement6_put_onloadeddata(IHTMLElement6
*iface
, VARIANT v
)
5296 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5297 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
5301 static HRESULT WINAPI
HTMLElement6_get_onloadeddata(IHTMLElement6
*iface
, VARIANT
*p
)
5303 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5304 FIXME("(%p)->(%p)\n", This
, p
);
5308 static HRESULT WINAPI
HTMLElement6_put_onloadedmetadata(IHTMLElement6
*iface
, VARIANT v
)
5310 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5311 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
5315 static HRESULT WINAPI
HTMLElement6_get_onloadedmetadata(IHTMLElement6
*iface
, VARIANT
*p
)
5317 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5318 FIXME("(%p)->(%p)\n", This
, p
);
5322 static HRESULT WINAPI
HTMLElement6_put_onloadstart(IHTMLElement6
*iface
, VARIANT v
)
5324 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5325 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
5329 static HRESULT WINAPI
HTMLElement6_get_onloadstart(IHTMLElement6
*iface
, VARIANT
*p
)
5331 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5332 FIXME("(%p)->(%p)\n", This
, p
);
5336 static HRESULT WINAPI
HTMLElement6_put_onpause(IHTMLElement6
*iface
, VARIANT v
)
5338 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5339 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
5343 static HRESULT WINAPI
HTMLElement6_get_onpause(IHTMLElement6
*iface
, VARIANT
*p
)
5345 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5346 FIXME("(%p)->(%p)\n", This
, p
);
5350 static HRESULT WINAPI
HTMLElement6_put_onplay(IHTMLElement6
*iface
, VARIANT v
)
5352 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5353 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
5357 static HRESULT WINAPI
HTMLElement6_get_onplay(IHTMLElement6
*iface
, VARIANT
*p
)
5359 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5360 FIXME("(%p)->(%p)\n", This
, p
);
5364 static HRESULT WINAPI
HTMLElement6_put_onplaying(IHTMLElement6
*iface
, VARIANT v
)
5366 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5367 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
5371 static HRESULT WINAPI
HTMLElement6_get_onplaying(IHTMLElement6
*iface
, VARIANT
*p
)
5373 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5374 FIXME("(%p)->(%p)\n", This
, p
);
5378 static HRESULT WINAPI
HTMLElement6_put_onprogress(IHTMLElement6
*iface
, VARIANT v
)
5380 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5381 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
5385 static HRESULT WINAPI
HTMLElement6_get_onprogress(IHTMLElement6
*iface
, VARIANT
*p
)
5387 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5388 FIXME("(%p)->(%p)\n", This
, p
);
5392 static HRESULT WINAPI
HTMLElement6_put_onratechange(IHTMLElement6
*iface
, VARIANT v
)
5394 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5395 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
5399 static HRESULT WINAPI
HTMLElement6_get_onratechange(IHTMLElement6
*iface
, VARIANT
*p
)
5401 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5402 FIXME("(%p)->(%p)\n", This
, p
);
5406 static HRESULT WINAPI
HTMLElement6_put_onreset(IHTMLElement6
*iface
, VARIANT v
)
5408 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5409 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
5413 static HRESULT WINAPI
HTMLElement6_get_onreset(IHTMLElement6
*iface
, VARIANT
*p
)
5415 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5416 FIXME("(%p)->(%p)\n", This
, p
);
5420 static HRESULT WINAPI
HTMLElement6_put_onseeked(IHTMLElement6
*iface
, VARIANT v
)
5422 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5423 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
5427 static HRESULT WINAPI
HTMLElement6_get_onseeked(IHTMLElement6
*iface
, VARIANT
*p
)
5429 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5430 FIXME("(%p)->(%p)\n", This
, p
);
5434 static HRESULT WINAPI
HTMLElement6_put_onseeking(IHTMLElement6
*iface
, VARIANT v
)
5436 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5437 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
5441 static HRESULT WINAPI
HTMLElement6_get_onseeking(IHTMLElement6
*iface
, VARIANT
*p
)
5443 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5444 FIXME("(%p)->(%p)\n", This
, p
);
5448 static HRESULT WINAPI
HTMLElement6_put_onselect(IHTMLElement6
*iface
, VARIANT v
)
5450 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5451 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
5455 static HRESULT WINAPI
HTMLElement6_get_onselect(IHTMLElement6
*iface
, VARIANT
*p
)
5457 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5458 FIXME("(%p)->(%p)\n", This
, p
);
5462 static HRESULT WINAPI
HTMLElement6_put_onstalled(IHTMLElement6
*iface
, VARIANT v
)
5464 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5465 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
5469 static HRESULT WINAPI
HTMLElement6_get_onstalled(IHTMLElement6
*iface
, VARIANT
*p
)
5471 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5472 FIXME("(%p)->(%p)\n", This
, p
);
5476 static HRESULT WINAPI
HTMLElement6_put_onsubmit(IHTMLElement6
*iface
, VARIANT v
)
5478 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5480 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
5482 return set_node_event(&This
->node
, EVENTID_SUBMIT
, &v
);
5485 static HRESULT WINAPI
HTMLElement6_get_onsubmit(IHTMLElement6
*iface
, VARIANT
*p
)
5487 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5489 TRACE("(%p)->(%p)\n", This
, p
);
5491 return get_node_event(&This
->node
, EVENTID_SUBMIT
, p
);
5494 static HRESULT WINAPI
HTMLElement6_put_onsuspend(IHTMLElement6
*iface
, VARIANT v
)
5496 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5497 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
5501 static HRESULT WINAPI
HTMLElement6_get_onsuspend(IHTMLElement6
*iface
, VARIANT
*p
)
5503 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5504 FIXME("(%p)->(%p)\n", This
, p
);
5508 static HRESULT WINAPI
HTMLElement6_put_ontimeupdate(IHTMLElement6
*iface
, VARIANT v
)
5510 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5511 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
5515 static HRESULT WINAPI
HTMLElement6_get_ontimeupdate(IHTMLElement6
*iface
, VARIANT
*p
)
5517 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5518 FIXME("(%p)->(%p)\n", This
, p
);
5522 static HRESULT WINAPI
HTMLElement6_put_onvolumechange(IHTMLElement6
*iface
, VARIANT v
)
5524 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5525 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
5529 static HRESULT WINAPI
HTMLElement6_get_onvolumechange(IHTMLElement6
*iface
, VARIANT
*p
)
5531 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5532 FIXME("(%p)->(%p)\n", This
, p
);
5536 static HRESULT WINAPI
HTMLElement6_put_onwaiting(IHTMLElement6
*iface
, VARIANT v
)
5538 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5539 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
5543 static HRESULT WINAPI
HTMLElement6_get_onwaiting(IHTMLElement6
*iface
, VARIANT
*p
)
5545 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5546 FIXME("(%p)->(%p)\n", This
, p
);
5550 static HRESULT WINAPI
HTMLElement6_hasAttributes(IHTMLElement6
*iface
, VARIANT_BOOL
*pfHasAttributes
)
5552 HTMLElement
*This
= impl_from_IHTMLElement6(iface
);
5553 FIXME("(%p)->(%p)\n", This
, pfHasAttributes
);
5557 static const IHTMLElement6Vtbl HTMLElement6Vtbl
= {
5558 HTMLElement6_QueryInterface
,
5559 HTMLElement6_AddRef
,
5560 HTMLElement6_Release
,
5561 HTMLElement6_GetTypeInfoCount
,
5562 HTMLElement6_GetTypeInfo
,
5563 HTMLElement6_GetIDsOfNames
,
5564 HTMLElement6_Invoke
,
5565 HTMLElement6_getAttributeNS
,
5566 HTMLElement6_setAttributeNS
,
5567 HTMLElement6_removeAttributeNS
,
5568 HTMLElement6_getAttributeNodeNS
,
5569 HTMLElement6_setAttributeNodeNS
,
5570 HTMLElement6_hasAttributeNS
,
5571 HTMLElement6_getAttribute
,
5572 HTMLElement6_setAttribute
,
5573 HTMLElement6_removeAttribute
,
5574 HTMLElement6_getAttributeNode
,
5575 HTMLElement6_setAttributeNode
,
5576 HTMLElement6_removeAttributeNode
,
5577 HTMLElement6_hasAttribute
,
5578 HTMLElement6_getElementsByTagNameNS
,
5579 HTMLElement6_get_tagName
,
5580 HTMLElement6_get_nodeName
,
5581 HTMLElement6_getElementsByClassName
,
5582 HTMLElement6_msMatchesSelector
,
5583 HTMLElement6_put_onabort
,
5584 HTMLElement6_get_onabort
,
5585 HTMLElement6_put_oncanplay
,
5586 HTMLElement6_get_oncanplay
,
5587 HTMLElement6_put_oncanplaythrough
,
5588 HTMLElement6_get_oncanplaythrough
,
5589 HTMLElement6_put_onchange
,
5590 HTMLElement6_get_onchange
,
5591 HTMLElement6_put_ondurationchange
,
5592 HTMLElement6_get_ondurationchange
,
5593 HTMLElement6_put_onemptied
,
5594 HTMLElement6_get_onemptied
,
5595 HTMLElement6_put_onended
,
5596 HTMLElement6_get_onended
,
5597 HTMLElement6_put_onerror
,
5598 HTMLElement6_get_onerror
,
5599 HTMLElement6_put_oninput
,
5600 HTMLElement6_get_oninput
,
5601 HTMLElement6_put_onload
,
5602 HTMLElement6_get_onload
,
5603 HTMLElement6_put_onloadeddata
,
5604 HTMLElement6_get_onloadeddata
,
5605 HTMLElement6_put_onloadedmetadata
,
5606 HTMLElement6_get_onloadedmetadata
,
5607 HTMLElement6_put_onloadstart
,
5608 HTMLElement6_get_onloadstart
,
5609 HTMLElement6_put_onpause
,
5610 HTMLElement6_get_onpause
,
5611 HTMLElement6_put_onplay
,
5612 HTMLElement6_get_onplay
,
5613 HTMLElement6_put_onplaying
,
5614 HTMLElement6_get_onplaying
,
5615 HTMLElement6_put_onprogress
,
5616 HTMLElement6_get_onprogress
,
5617 HTMLElement6_put_onratechange
,
5618 HTMLElement6_get_onratechange
,
5619 HTMLElement6_put_onreset
,
5620 HTMLElement6_get_onreset
,
5621 HTMLElement6_put_onseeked
,
5622 HTMLElement6_get_onseeked
,
5623 HTMLElement6_put_onseeking
,
5624 HTMLElement6_get_onseeking
,
5625 HTMLElement6_put_onselect
,
5626 HTMLElement6_get_onselect
,
5627 HTMLElement6_put_onstalled
,
5628 HTMLElement6_get_onstalled
,
5629 HTMLElement6_put_onsubmit
,
5630 HTMLElement6_get_onsubmit
,
5631 HTMLElement6_put_onsuspend
,
5632 HTMLElement6_get_onsuspend
,
5633 HTMLElement6_put_ontimeupdate
,
5634 HTMLElement6_get_ontimeupdate
,
5635 HTMLElement6_put_onvolumechange
,
5636 HTMLElement6_get_onvolumechange
,
5637 HTMLElement6_put_onwaiting
,
5638 HTMLElement6_get_onwaiting
,
5639 HTMLElement6_hasAttributes
5642 static inline HTMLElement
*impl_from_IHTMLElement7(IHTMLElement7
*iface
)
5644 return CONTAINING_RECORD(iface
, HTMLElement
, IHTMLElement7_iface
);
5647 static HRESULT WINAPI
HTMLElement7_QueryInterface(IHTMLElement7
*iface
,
5648 REFIID riid
, void **ppv
)
5650 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5651 return IHTMLElement_QueryInterface(&This
->IHTMLElement_iface
, riid
, ppv
);
5654 static ULONG WINAPI
HTMLElement7_AddRef(IHTMLElement7
*iface
)
5656 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5657 return IHTMLElement_AddRef(&This
->IHTMLElement_iface
);
5660 static ULONG WINAPI
HTMLElement7_Release(IHTMLElement7
*iface
)
5662 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5663 return IHTMLElement_Release(&This
->IHTMLElement_iface
);
5666 static HRESULT WINAPI
HTMLElement7_GetTypeInfoCount(IHTMLElement7
*iface
, UINT
*pctinfo
)
5668 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5669 return IDispatchEx_GetTypeInfoCount(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
5672 static HRESULT WINAPI
HTMLElement7_GetTypeInfo(IHTMLElement7
*iface
, UINT iTInfo
,
5673 LCID lcid
, ITypeInfo
**ppTInfo
)
5675 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5676 return IDispatchEx_GetTypeInfo(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
5679 static HRESULT WINAPI
HTMLElement7_GetIDsOfNames(IHTMLElement7
*iface
, REFIID riid
,
5680 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
5682 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5683 return IDispatchEx_GetIDsOfNames(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
5687 static HRESULT WINAPI
HTMLElement7_Invoke(IHTMLElement7
*iface
, DISPID dispIdMember
, REFIID riid
,
5688 LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
5690 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5691 return IDispatchEx_Invoke(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
5692 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
5695 static HRESULT WINAPI
HTMLElement7_put_onmspointerdown(IHTMLElement7
*iface
, VARIANT v
)
5697 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5698 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
5702 static HRESULT WINAPI
HTMLElement7_get_onmspointerdown(IHTMLElement7
*iface
, VARIANT
*p
)
5704 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5705 FIXME("(%p)->(%p)\n", This
, p
);
5709 static HRESULT WINAPI
HTMLElement7_put_onmspointermove(IHTMLElement7
*iface
, VARIANT v
)
5711 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5712 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
5716 static HRESULT WINAPI
HTMLElement7_get_onmspointermove(IHTMLElement7
*iface
, VARIANT
*p
)
5718 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5719 FIXME("(%p)->(%p)\n", This
, p
);
5723 static HRESULT WINAPI
HTMLElement7_put_onmspointerup(IHTMLElement7
*iface
, VARIANT v
)
5725 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5726 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
5730 static HRESULT WINAPI
HTMLElement7_get_onmspointerup(IHTMLElement7
*iface
, VARIANT
*p
)
5732 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5733 FIXME("(%p)->(%p)\n", This
, p
);
5737 static HRESULT WINAPI
HTMLElement7_put_onmspointerover(IHTMLElement7
*iface
, VARIANT v
)
5739 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5740 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
5744 static HRESULT WINAPI
HTMLElement7_get_onmspointerover(IHTMLElement7
*iface
, VARIANT
*p
)
5746 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5747 FIXME("(%p)->(%p)\n", This
, p
);
5751 static HRESULT WINAPI
HTMLElement7_put_onmspointerout(IHTMLElement7
*iface
, VARIANT v
)
5753 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5754 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
5758 static HRESULT WINAPI
HTMLElement7_get_onmspointerout(IHTMLElement7
*iface
, VARIANT
*p
)
5760 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5761 FIXME("(%p)->(%p)\n", This
, p
);
5765 static HRESULT WINAPI
HTMLElement7_put_onmspointercancel(IHTMLElement7
*iface
, VARIANT v
)
5767 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5768 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
5772 static HRESULT WINAPI
HTMLElement7_get_onmspointercancel(IHTMLElement7
*iface
, VARIANT
*p
)
5774 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5775 FIXME("(%p)->(%p)\n", This
, p
);
5779 static HRESULT WINAPI
HTMLElement7_put_onmspointerhover(IHTMLElement7
*iface
, VARIANT v
)
5781 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5782 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
5786 static HRESULT WINAPI
HTMLElement7_get_onmspointerhover(IHTMLElement7
*iface
, VARIANT
*p
)
5788 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5789 FIXME("(%p)->(%p)\n", This
, p
);
5793 static HRESULT WINAPI
HTMLElement7_put_onmslostpointercapture(IHTMLElement7
*iface
, VARIANT v
)
5795 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5796 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
5800 static HRESULT WINAPI
HTMLElement7_get_onmslostpointercapture(IHTMLElement7
*iface
, VARIANT
*p
)
5802 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5803 FIXME("(%p)->(%p)\n", This
, p
);
5807 static HRESULT WINAPI
HTMLElement7_put_onmsgotpointercapture(IHTMLElement7
*iface
, VARIANT v
)
5809 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5810 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
5814 static HRESULT WINAPI
HTMLElement7_get_onmsgotpointercapture(IHTMLElement7
*iface
, VARIANT
*p
)
5816 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5817 FIXME("(%p)->(%p)\n", This
, p
);
5821 static HRESULT WINAPI
HTMLElement7_put_onmsgesturestart(IHTMLElement7
*iface
, VARIANT v
)
5823 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5824 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
5828 static HRESULT WINAPI
HTMLElement7_get_onmsgesturestart(IHTMLElement7
*iface
, VARIANT
*p
)
5830 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5831 FIXME("(%p)->(%p)\n", This
, p
);
5835 static HRESULT WINAPI
HTMLElement7_put_onmsgesturechange(IHTMLElement7
*iface
, VARIANT v
)
5837 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5838 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
5842 static HRESULT WINAPI
HTMLElement7_get_onmsgesturechange(IHTMLElement7
*iface
, VARIANT
*p
)
5844 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5845 FIXME("(%p)->(%p)\n", This
, p
);
5849 static HRESULT WINAPI
HTMLElement7_put_onmsgestureend(IHTMLElement7
*iface
, VARIANT v
)
5851 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5852 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
5856 static HRESULT WINAPI
HTMLElement7_get_onmsgestureend(IHTMLElement7
*iface
, VARIANT
*p
)
5858 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5859 FIXME("(%p)->(%p)\n", This
, p
);
5863 static HRESULT WINAPI
HTMLElement7_put_onmsgesturehold(IHTMLElement7
*iface
, VARIANT v
)
5865 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5866 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
5870 static HRESULT WINAPI
HTMLElement7_get_onmsgesturehold(IHTMLElement7
*iface
, VARIANT
*p
)
5872 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5873 FIXME("(%p)->(%p)\n", This
, p
);
5877 static HRESULT WINAPI
HTMLElement7_put_onmsgesturetap(IHTMLElement7
*iface
, VARIANT v
)
5879 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5880 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
5884 static HRESULT WINAPI
HTMLElement7_get_onmsgesturetap(IHTMLElement7
*iface
, VARIANT
*p
)
5886 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5887 FIXME("(%p)->(%p)\n", This
, p
);
5891 static HRESULT WINAPI
HTMLElement7_put_onmsgesturedoubletap(IHTMLElement7
*iface
, VARIANT v
)
5893 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5894 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
5898 static HRESULT WINAPI
HTMLElement7_get_onmsgesturedoubletap(IHTMLElement7
*iface
, VARIANT
*p
)
5900 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5901 FIXME("(%p)->(%p)\n", This
, p
);
5905 static HRESULT WINAPI
HTMLElement7_put_onmsinertiastart(IHTMLElement7
*iface
, VARIANT v
)
5907 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5908 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
5912 static HRESULT WINAPI
HTMLElement7_get_onmsinertiastart(IHTMLElement7
*iface
, VARIANT
*p
)
5914 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5915 FIXME("(%p)->(%p)\n", This
, p
);
5919 static HRESULT WINAPI
HTMLElement7_msSetPointerCapture(IHTMLElement7
*iface
, LONG pointer_id
)
5921 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5922 FIXME("(%p)->(%ld)\n", This
, pointer_id
);
5926 static HRESULT WINAPI
HTMLElement7_msReleasePointerCapture(IHTMLElement7
*iface
, LONG pointer_id
)
5928 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5929 FIXME("(%p)->(%ld)\n", This
, pointer_id
);
5933 static HRESULT WINAPI
HTMLElement7_put_onmstransitionstart(IHTMLElement7
*iface
, VARIANT v
)
5935 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5936 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
5940 static HRESULT WINAPI
HTMLElement7_get_onmstransitionstart(IHTMLElement7
*iface
, VARIANT
*p
)
5942 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5943 FIXME("(%p)->(%p)\n", This
, p
);
5947 static HRESULT WINAPI
HTMLElement7_put_onmstransitionend(IHTMLElement7
*iface
, VARIANT v
)
5949 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5950 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
5954 static HRESULT WINAPI
HTMLElement7_get_onmstransitionend(IHTMLElement7
*iface
, VARIANT
*p
)
5956 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5957 FIXME("(%p)->(%p)\n", This
, p
);
5961 static HRESULT WINAPI
HTMLElement7_put_onmsanimationstart(IHTMLElement7
*iface
, VARIANT v
)
5963 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5964 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
5968 static HRESULT WINAPI
HTMLElement7_get_onmsanimationstart(IHTMLElement7
*iface
, VARIANT
*p
)
5970 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5971 FIXME("(%p)->(%p)\n", This
, p
);
5975 static HRESULT WINAPI
HTMLElement7_put_onmsanimationend(IHTMLElement7
*iface
, VARIANT v
)
5977 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5978 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
5982 static HRESULT WINAPI
HTMLElement7_get_onmsanimationend(IHTMLElement7
*iface
, VARIANT
*p
)
5984 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5985 FIXME("(%p)->(%p)\n", This
, p
);
5989 static HRESULT WINAPI
HTMLElement7_put_onmsanimationiteration(IHTMLElement7
*iface
, VARIANT v
)
5991 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5992 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
5996 static HRESULT WINAPI
HTMLElement7_get_onmsanimationiteration(IHTMLElement7
*iface
, VARIANT
*p
)
5998 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
5999 FIXME("(%p)->(%p)\n", This
, p
);
6003 static HRESULT WINAPI
HTMLElement7_put_oninvalid(IHTMLElement7
*iface
, VARIANT v
)
6005 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
6006 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
6010 static HRESULT WINAPI
HTMLElement7_get_oninvalid(IHTMLElement7
*iface
, VARIANT
*p
)
6012 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
6013 FIXME("(%p)->(%p)\n", This
, p
);
6017 static HRESULT WINAPI
HTMLElement7_put_xmsAcceleratorKey(IHTMLElement7
*iface
, BSTR v
)
6019 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
6020 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
6024 static HRESULT WINAPI
HTMLElement7_get_xmsAcceleratorKey(IHTMLElement7
*iface
, BSTR
*p
)
6026 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
6027 FIXME("(%p)->(%p)\n", This
, p
);
6031 static HRESULT WINAPI
HTMLElement7_put_spellcheck(IHTMLElement7
*iface
, VARIANT v
)
6033 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
6035 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
6037 if(!This
->html_element
) {
6038 FIXME("non-HTML element\n");
6042 if(V_VT(&v
) != VT_BOOL
) {
6043 FIXME("unsupported argument %s\n", debugstr_variant(&v
));
6047 return map_nsresult(nsIDOMHTMLElement_SetSpellcheck(This
->html_element
, !!V_BOOL(&v
)));
6050 static HRESULT WINAPI
HTMLElement7_get_spellcheck(IHTMLElement7
*iface
, VARIANT
*p
)
6052 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
6053 cpp_bool spellcheck
;
6056 TRACE("(%p)->(%p)\n", This
, p
);
6058 if(!This
->html_element
) {
6059 FIXME("non-HTML element\n");
6063 nsres
= nsIDOMHTMLElement_GetSpellcheck(This
->html_element
, &spellcheck
);
6064 if(NS_FAILED(nsres
))
6065 return map_nsresult(nsres
);
6068 V_BOOL(p
) = spellcheck
? VARIANT_TRUE
: VARIANT_FALSE
;
6072 static HRESULT WINAPI
HTMLElement7_put_onmsmanipulationstatechanged(IHTMLElement7
*iface
, VARIANT v
)
6074 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
6075 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
6079 static HRESULT WINAPI
HTMLElement7_get_onmsmanipulationstatechanged(IHTMLElement7
*iface
, VARIANT
*p
)
6081 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
6082 FIXME("(%p)->(%p)\n", This
, p
);
6086 static HRESULT WINAPI
HTMLElement7_put_oncuechange(IHTMLElement7
*iface
, VARIANT v
)
6088 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
6089 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
6093 static HRESULT WINAPI
HTMLElement7_get_oncuechange(IHTMLElement7
*iface
, VARIANT
*p
)
6095 HTMLElement
*This
= impl_from_IHTMLElement7(iface
);
6096 FIXME("(%p)->(%p)\n", This
, p
);
6100 static const IHTMLElement7Vtbl HTMLElement7Vtbl
= {
6101 HTMLElement7_QueryInterface
,
6102 HTMLElement7_AddRef
,
6103 HTMLElement7_Release
,
6104 HTMLElement7_GetTypeInfoCount
,
6105 HTMLElement7_GetTypeInfo
,
6106 HTMLElement7_GetIDsOfNames
,
6107 HTMLElement7_Invoke
,
6108 HTMLElement7_put_onmspointerdown
,
6109 HTMLElement7_get_onmspointerdown
,
6110 HTMLElement7_put_onmspointermove
,
6111 HTMLElement7_get_onmspointermove
,
6112 HTMLElement7_put_onmspointerup
,
6113 HTMLElement7_get_onmspointerup
,
6114 HTMLElement7_put_onmspointerover
,
6115 HTMLElement7_get_onmspointerover
,
6116 HTMLElement7_put_onmspointerout
,
6117 HTMLElement7_get_onmspointerout
,
6118 HTMLElement7_put_onmspointercancel
,
6119 HTMLElement7_get_onmspointercancel
,
6120 HTMLElement7_put_onmspointerhover
,
6121 HTMLElement7_get_onmspointerhover
,
6122 HTMLElement7_put_onmslostpointercapture
,
6123 HTMLElement7_get_onmslostpointercapture
,
6124 HTMLElement7_put_onmsgotpointercapture
,
6125 HTMLElement7_get_onmsgotpointercapture
,
6126 HTMLElement7_put_onmsgesturestart
,
6127 HTMLElement7_get_onmsgesturestart
,
6128 HTMLElement7_put_onmsgesturechange
,
6129 HTMLElement7_get_onmsgesturechange
,
6130 HTMLElement7_put_onmsgestureend
,
6131 HTMLElement7_get_onmsgestureend
,
6132 HTMLElement7_put_onmsgesturehold
,
6133 HTMLElement7_get_onmsgesturehold
,
6134 HTMLElement7_put_onmsgesturetap
,
6135 HTMLElement7_get_onmsgesturetap
,
6136 HTMLElement7_put_onmsgesturedoubletap
,
6137 HTMLElement7_get_onmsgesturedoubletap
,
6138 HTMLElement7_put_onmsinertiastart
,
6139 HTMLElement7_get_onmsinertiastart
,
6140 HTMLElement7_msSetPointerCapture
,
6141 HTMLElement7_msReleasePointerCapture
,
6142 HTMLElement7_put_onmstransitionstart
,
6143 HTMLElement7_get_onmstransitionstart
,
6144 HTMLElement7_put_onmstransitionend
,
6145 HTMLElement7_get_onmstransitionend
,
6146 HTMLElement7_put_onmsanimationstart
,
6147 HTMLElement7_get_onmsanimationstart
,
6148 HTMLElement7_put_onmsanimationend
,
6149 HTMLElement7_get_onmsanimationend
,
6150 HTMLElement7_put_onmsanimationiteration
,
6151 HTMLElement7_get_onmsanimationiteration
,
6152 HTMLElement7_put_oninvalid
,
6153 HTMLElement7_get_oninvalid
,
6154 HTMLElement7_put_xmsAcceleratorKey
,
6155 HTMLElement7_get_xmsAcceleratorKey
,
6156 HTMLElement7_put_spellcheck
,
6157 HTMLElement7_get_spellcheck
,
6158 HTMLElement7_put_onmsmanipulationstatechanged
,
6159 HTMLElement7_get_onmsmanipulationstatechanged
,
6160 HTMLElement7_put_oncuechange
,
6161 HTMLElement7_get_oncuechange
6165 static inline HTMLElement
*impl_from_IHTMLUniqueName(IHTMLUniqueName
*iface
)
6167 return CONTAINING_RECORD(iface
, HTMLElement
, IHTMLUniqueName_iface
);
6170 static HRESULT WINAPI
HTMLUniqueName_QueryInterface(IHTMLUniqueName
*iface
, REFIID riid
, void **ppv
)
6172 HTMLElement
*This
= impl_from_IHTMLUniqueName(iface
);
6173 return IHTMLElement_QueryInterface(&This
->IHTMLElement_iface
, riid
, ppv
);
6176 static ULONG WINAPI
HTMLUniqueName_AddRef(IHTMLUniqueName
*iface
)
6178 HTMLElement
*This
= impl_from_IHTMLUniqueName(iface
);
6179 return IHTMLElement_AddRef(&This
->IHTMLElement_iface
);
6182 static ULONG WINAPI
HTMLUniqueName_Release(IHTMLUniqueName
*iface
)
6184 HTMLElement
*This
= impl_from_IHTMLUniqueName(iface
);
6185 return IHTMLElement_Release(&This
->IHTMLElement_iface
);
6188 static HRESULT WINAPI
HTMLUniqueName_GetTypeInfoCount(IHTMLUniqueName
*iface
, UINT
*pctinfo
)
6190 HTMLElement
*This
= impl_from_IHTMLUniqueName(iface
);
6191 return IDispatchEx_GetTypeInfoCount(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
6194 static HRESULT WINAPI
HTMLUniqueName_GetTypeInfo(IHTMLUniqueName
*iface
, UINT iTInfo
,
6195 LCID lcid
, ITypeInfo
**ppTInfo
)
6197 HTMLElement
*This
= impl_from_IHTMLUniqueName(iface
);
6198 return IDispatchEx_GetTypeInfo(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
6201 static HRESULT WINAPI
HTMLUniqueName_GetIDsOfNames(IHTMLUniqueName
*iface
, REFIID riid
,
6202 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
6204 HTMLElement
*This
= impl_from_IHTMLUniqueName(iface
);
6205 return IDispatchEx_GetIDsOfNames(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
6209 static HRESULT WINAPI
HTMLUniqueName_Invoke(IHTMLUniqueName
*iface
, DISPID dispIdMember
, REFIID riid
,
6210 LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
6212 HTMLElement
*This
= impl_from_IHTMLUniqueName(iface
);
6213 return IDispatchEx_Invoke(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
6214 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
6217 HRESULT
elem_unique_id(unsigned id
, BSTR
*p
)
6221 swprintf(buf
, ARRAY_SIZE(buf
), L
"ms__id%u", id
);
6222 *p
= SysAllocString(buf
);
6223 return *p
? S_OK
: E_OUTOFMEMORY
;
6226 static void ensure_unique_id(HTMLElement
*elem
)
6228 if(!elem
->unique_id
)
6229 elem
->unique_id
= ++elem
->node
.doc
->unique_id
;
6232 static HRESULT WINAPI
HTMLUniqueName_get_uniqueNumber(IHTMLUniqueName
*iface
, LONG
*p
)
6234 HTMLElement
*This
= impl_from_IHTMLUniqueName(iface
);
6236 TRACE("(%p)->(%p)\n", This
, p
);
6238 ensure_unique_id(This
);
6239 *p
= This
->unique_id
;
6243 static HRESULT WINAPI
HTMLUniqueName_get_uniqueID(IHTMLUniqueName
*iface
, BSTR
*p
)
6245 HTMLElement
*This
= impl_from_IHTMLUniqueName(iface
);
6247 TRACE("(%p)->(%p)\n", This
, p
);
6249 ensure_unique_id(This
);
6250 return elem_unique_id(This
->unique_id
, p
);
6253 static const IHTMLUniqueNameVtbl HTMLUniqueNameVtbl
= {
6254 HTMLUniqueName_QueryInterface
,
6255 HTMLUniqueName_AddRef
,
6256 HTMLUniqueName_Release
,
6257 HTMLUniqueName_GetTypeInfoCount
,
6258 HTMLUniqueName_GetTypeInfo
,
6259 HTMLUniqueName_GetIDsOfNames
,
6260 HTMLUniqueName_Invoke
,
6261 HTMLUniqueName_get_uniqueNumber
,
6262 HTMLUniqueName_get_uniqueID
6265 static inline HTMLElement
*impl_from_IElementSelector(IElementSelector
*iface
)
6267 return CONTAINING_RECORD(iface
, HTMLElement
, IElementSelector_iface
);
6270 static HRESULT WINAPI
ElementSelector_QueryInterface(IElementSelector
*iface
, REFIID riid
, void **ppv
)
6272 HTMLElement
*This
= impl_from_IElementSelector(iface
);
6273 return IHTMLElement_QueryInterface(&This
->IHTMLElement_iface
, riid
, ppv
);
6276 static ULONG WINAPI
ElementSelector_AddRef(IElementSelector
*iface
)
6278 HTMLElement
*This
= impl_from_IElementSelector(iface
);
6279 return IHTMLElement_AddRef(&This
->IHTMLElement_iface
);
6282 static ULONG WINAPI
ElementSelector_Release(IElementSelector
*iface
)
6284 HTMLElement
*This
= impl_from_IElementSelector(iface
);
6285 return IHTMLElement_Release(&This
->IHTMLElement_iface
);
6288 static HRESULT WINAPI
ElementSelector_GetTypeInfoCount(IElementSelector
*iface
, UINT
*pctinfo
)
6290 HTMLElement
*This
= impl_from_IElementSelector(iface
);
6291 return IDispatchEx_GetTypeInfoCount(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
6294 static HRESULT WINAPI
ElementSelector_GetTypeInfo(IElementSelector
*iface
, UINT iTInfo
,
6295 LCID lcid
, ITypeInfo
**ppTInfo
)
6297 HTMLElement
*This
= impl_from_IElementSelector(iface
);
6298 return IDispatchEx_GetTypeInfo(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
6301 static HRESULT WINAPI
ElementSelector_GetIDsOfNames(IElementSelector
*iface
, REFIID riid
,
6302 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
6304 HTMLElement
*This
= impl_from_IElementSelector(iface
);
6305 return IDispatchEx_GetIDsOfNames(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
, lcid
, rgDispId
);
6308 static HRESULT WINAPI
ElementSelector_Invoke(IElementSelector
*iface
, DISPID dispIdMember
, REFIID riid
,
6309 LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
6311 HTMLElement
*This
= impl_from_IElementSelector(iface
);
6312 return IDispatchEx_Invoke(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
, wFlags
,
6313 pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
6316 static HRESULT WINAPI
ElementSelector_querySelector(IElementSelector
*iface
, BSTR v
, IHTMLElement
**pel
)
6318 HTMLElement
*This
= impl_from_IElementSelector(iface
);
6319 nsIDOMElement
*nselem
;
6325 TRACE("(%p)->(%s %p)\n", This
, debugstr_w(v
), pel
);
6327 if(!This
->dom_element
) {
6328 FIXME("comment element\n");
6332 nsAString_InitDepend(&nsstr
, v
);
6333 nsres
= nsIDOMElement_QuerySelector(This
->dom_element
, &nsstr
, &nselem
);
6334 nsAString_Finish(&nsstr
);
6335 if(NS_FAILED(nsres
)) {
6336 ERR("QuerySelector failed: %08lx\n", nsres
);
6345 hres
= get_element(nselem
, &elem
);
6346 nsIDOMElement_Release(nselem
);
6350 *pel
= &elem
->IHTMLElement_iface
;
6354 static HRESULT WINAPI
ElementSelector_querySelectorAll(IElementSelector
*iface
, BSTR v
, IHTMLDOMChildrenCollection
**pel
)
6356 HTMLElement
*This
= impl_from_IElementSelector(iface
);
6357 nsIDOMNodeList
*node_list
;
6361 TRACE("(%p)->(%s %p)\n", This
, debugstr_w(v
), pel
);
6363 if(!This
->dom_element
) {
6364 FIXME("comment element\n");
6368 nsAString_InitDepend(&nsstr
, v
);
6369 hres
= map_nsresult(nsIDOMElement_QuerySelectorAll(This
->dom_element
, &nsstr
, &node_list
));
6370 nsAString_Finish(&nsstr
);
6372 ERR("QuerySelectorAll failed: %08lx\n", hres
);
6376 hres
= create_child_collection(node_list
, dispex_compat_mode(&This
->node
.event_target
.dispex
), pel
);
6377 nsIDOMNodeList_Release(node_list
);
6381 static const IElementSelectorVtbl ElementSelectorVtbl
= {
6382 ElementSelector_QueryInterface
,
6383 ElementSelector_AddRef
,
6384 ElementSelector_Release
,
6385 ElementSelector_GetTypeInfoCount
,
6386 ElementSelector_GetTypeInfo
,
6387 ElementSelector_GetIDsOfNames
,
6388 ElementSelector_Invoke
,
6389 ElementSelector_querySelector
,
6390 ElementSelector_querySelectorAll
6393 static inline HTMLElement
*impl_from_IProvideMultipleClassInfo(IProvideMultipleClassInfo
*iface
)
6395 return CONTAINING_RECORD(iface
, HTMLElement
, IProvideMultipleClassInfo_iface
);
6398 static HRESULT WINAPI
ProvideClassInfo_QueryInterface(IProvideMultipleClassInfo
*iface
,
6399 REFIID riid
, void **ppv
)
6401 HTMLElement
*This
= impl_from_IProvideMultipleClassInfo(iface
);
6402 return IHTMLElement_QueryInterface(&This
->IHTMLElement_iface
, riid
, ppv
);
6405 static ULONG WINAPI
ProvideClassInfo_AddRef(IProvideMultipleClassInfo
*iface
)
6407 HTMLElement
*This
= impl_from_IProvideMultipleClassInfo(iface
);
6408 return IHTMLElement_AddRef(&This
->IHTMLElement_iface
);
6411 static ULONG WINAPI
ProvideClassInfo_Release(IProvideMultipleClassInfo
*iface
)
6413 HTMLElement
*This
= impl_from_IProvideMultipleClassInfo(iface
);
6414 return IHTMLElement_Release(&This
->IHTMLElement_iface
);
6417 static HRESULT WINAPI
ProvideClassInfo_GetClassInfo(IProvideMultipleClassInfo
*iface
, ITypeInfo
**ppTI
)
6419 HTMLElement
*This
= impl_from_IProvideMultipleClassInfo(iface
);
6420 TRACE("(%p)->(%p)\n", This
, ppTI
);
6421 return get_class_typeinfo(This
->node
.vtbl
->clsid
, ppTI
);
6424 static HRESULT WINAPI
ProvideClassInfo2_GetGUID(IProvideMultipleClassInfo
*iface
, DWORD dwGuidKind
, GUID
*pGUID
)
6426 HTMLElement
*This
= impl_from_IProvideMultipleClassInfo(iface
);
6427 FIXME("(%p)->(%lu %p)\n", This
, dwGuidKind
, pGUID
);
6431 static HRESULT WINAPI
ProvideMultipleClassInfo_GetMultiTypeInfoCount(IProvideMultipleClassInfo
*iface
, ULONG
*pcti
)
6433 HTMLElement
*This
= impl_from_IProvideMultipleClassInfo(iface
);
6434 FIXME("(%p)->(%p)\n", This
, pcti
);
6439 static HRESULT WINAPI
ProvideMultipleClassInfo_GetInfoOfIndex(IProvideMultipleClassInfo
*iface
, ULONG iti
,
6440 DWORD dwFlags
, ITypeInfo
**pptiCoClass
, DWORD
*pdwTIFlags
, ULONG
*pcdispidReserved
, IID
*piidPrimary
, IID
*piidSource
)
6442 HTMLElement
*This
= impl_from_IProvideMultipleClassInfo(iface
);
6443 FIXME("(%p)->(%lu %lx %p %p %p %p %p)\n", This
, iti
, dwFlags
, pptiCoClass
, pdwTIFlags
, pcdispidReserved
, piidPrimary
, piidSource
);
6447 static const IProvideMultipleClassInfoVtbl ProvideMultipleClassInfoVtbl
= {
6448 ProvideClassInfo_QueryInterface
,
6449 ProvideClassInfo_AddRef
,
6450 ProvideClassInfo_Release
,
6451 ProvideClassInfo_GetClassInfo
,
6452 ProvideClassInfo2_GetGUID
,
6453 ProvideMultipleClassInfo_GetMultiTypeInfoCount
,
6454 ProvideMultipleClassInfo_GetInfoOfIndex
6457 static inline HTMLElement
*impl_from_IElementTraversal(IElementTraversal
*iface
)
6459 return CONTAINING_RECORD(iface
, HTMLElement
, IElementTraversal_iface
);
6462 static HRESULT WINAPI
ElementTraversal_QueryInterface(IElementTraversal
*iface
, REFIID riid
, void **ppv
)
6464 HTMLElement
*This
= impl_from_IElementTraversal(iface
);
6465 return IHTMLElement_QueryInterface(&This
->IHTMLElement_iface
, riid
, ppv
);
6468 static ULONG WINAPI
ElementTraversal_AddRef(IElementTraversal
*iface
)
6470 HTMLElement
*This
= impl_from_IElementTraversal(iface
);
6472 return IHTMLElement_AddRef(&This
->IHTMLElement_iface
);
6475 static ULONG WINAPI
ElementTraversal_Release(IElementTraversal
*iface
)
6477 HTMLElement
*This
= impl_from_IElementTraversal(iface
);
6479 return IHTMLElement_Release(&This
->IHTMLElement_iface
);
6482 static HRESULT WINAPI
ElementTraversal_GetTypeInfoCount(IElementTraversal
*iface
, UINT
*pctinfo
)
6484 HTMLElement
*This
= impl_from_IElementTraversal(iface
);
6485 return IDispatchEx_GetTypeInfoCount(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
6488 static HRESULT WINAPI
ElementTraversal_GetTypeInfo(IElementTraversal
*iface
, UINT iTInfo
,
6489 LCID lcid
, ITypeInfo
**ppTInfo
)
6491 HTMLElement
*This
= impl_from_IElementTraversal(iface
);
6492 return IDispatchEx_GetTypeInfo(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
6495 static HRESULT WINAPI
ElementTraversal_GetIDsOfNames(IElementTraversal
*iface
, REFIID riid
,
6496 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
6498 HTMLElement
*This
= impl_from_IElementTraversal(iface
);
6499 return IDispatchEx_GetIDsOfNames(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
6503 static HRESULT WINAPI
ElementTraversal_Invoke(IElementTraversal
*iface
, DISPID dispIdMember
, REFIID riid
,
6504 LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
6506 HTMLElement
*This
= impl_from_IElementTraversal(iface
);
6507 return IDispatchEx_Invoke(&This
->node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
6508 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
6511 static HRESULT WINAPI
ElementTraversal_get_firstElementChild(IElementTraversal
*iface
, IHTMLElement
**p
)
6513 HTMLElement
*This
= impl_from_IElementTraversal(iface
);
6514 nsIDOMElement
*nselem
= NULL
;
6518 TRACE("(%p)->(%p)\n", This
, p
);
6520 if(!This
->dom_element
) {
6525 nsIDOMElement_GetFirstElementChild(This
->dom_element
, &nselem
);
6531 hres
= get_element(nselem
, &elem
);
6532 nsIDOMElement_Release(nselem
);
6536 *p
= &elem
->IHTMLElement_iface
;
6540 static HRESULT WINAPI
ElementTraversal_get_lastElementChild(IElementTraversal
*iface
, IHTMLElement
**p
)
6542 HTMLElement
*This
= impl_from_IElementTraversal(iface
);
6543 nsIDOMElement
*nselem
= NULL
;
6547 TRACE("(%p)->(%p)\n", This
, p
);
6549 if(!This
->dom_element
) {
6554 nsIDOMElement_GetLastElementChild(This
->dom_element
, &nselem
);
6560 hres
= get_element(nselem
, &elem
);
6561 nsIDOMElement_Release(nselem
);
6565 *p
= &elem
->IHTMLElement_iface
;
6569 static HRESULT WINAPI
ElementTraversal_get_previousElementSibling(IElementTraversal
*iface
, IHTMLElement
**p
)
6571 HTMLElement
*This
= impl_from_IElementTraversal(iface
);
6572 nsIDOMElement
*nselem
= NULL
;
6576 TRACE("(%p)->(%p)\n", This
, p
);
6578 if(!This
->dom_element
) {
6583 nsIDOMElement_GetPreviousElementSibling(This
->dom_element
, &nselem
);
6589 hres
= get_element(nselem
, &elem
);
6590 nsIDOMElement_Release(nselem
);
6594 *p
= &elem
->IHTMLElement_iface
;
6598 static HRESULT WINAPI
ElementTraversal_get_nextElementSibling(IElementTraversal
*iface
, IHTMLElement
**p
)
6600 HTMLElement
*This
= impl_from_IElementTraversal(iface
);
6601 nsIDOMElement
*nselem
= NULL
;
6605 TRACE("(%p)->(%p)\n", This
, p
);
6607 if(!This
->dom_element
) {
6612 nsIDOMElement_GetNextElementSibling(This
->dom_element
, &nselem
);
6618 hres
= get_element(nselem
, &elem
);
6619 nsIDOMElement_Release(nselem
);
6623 *p
= &elem
->IHTMLElement_iface
;
6627 static HRESULT WINAPI
ElementTraversal_get_childElementCount(IElementTraversal
*iface
, LONG
*p
)
6629 HTMLElement
*This
= impl_from_IElementTraversal(iface
);
6632 TRACE("(%p)->(%p)\n", This
, p
);
6634 if(This
->dom_element
)
6635 nsIDOMElement_GetChildElementCount(This
->dom_element
, &count
);
6641 static const IElementTraversalVtbl ElementTraversalVtbl
= {
6642 ElementTraversal_QueryInterface
,
6643 ElementTraversal_AddRef
,
6644 ElementTraversal_Release
,
6645 ElementTraversal_GetTypeInfoCount
,
6646 ElementTraversal_GetTypeInfo
,
6647 ElementTraversal_GetIDsOfNames
,
6648 ElementTraversal_Invoke
,
6649 ElementTraversal_get_firstElementChild
,
6650 ElementTraversal_get_lastElementChild
,
6651 ElementTraversal_get_previousElementSibling
,
6652 ElementTraversal_get_nextElementSibling
,
6653 ElementTraversal_get_childElementCount
6656 static inline HTMLElement
*impl_from_HTMLDOMNode(HTMLDOMNode
*iface
)
6658 return CONTAINING_RECORD(iface
, HTMLElement
, node
);
6661 HRESULT
HTMLElement_QI(HTMLDOMNode
*iface
, REFIID riid
, void **ppv
)
6663 HTMLElement
*This
= impl_from_HTMLDOMNode(iface
);
6665 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
6666 *ppv
= &This
->IHTMLElement_iface
;
6667 }else if(IsEqualGUID(&IID_IDispatch
, riid
)) {
6668 *ppv
= &This
->IHTMLElement_iface
;
6669 }else if(IsEqualGUID(&IID_IHTMLElement
, riid
)) {
6670 *ppv
= &This
->IHTMLElement_iface
;
6671 }else if(IsEqualGUID(&IID_IHTMLElement2
, riid
)) {
6672 *ppv
= &This
->IHTMLElement2_iface
;
6673 }else if(IsEqualGUID(&IID_IHTMLElement3
, riid
)) {
6674 *ppv
= &This
->IHTMLElement3_iface
;
6675 }else if(IsEqualGUID(&IID_IHTMLElement4
, riid
)) {
6676 *ppv
= &This
->IHTMLElement4_iface
;
6677 }else if(IsEqualGUID(&IID_IHTMLElement6
, riid
)) {
6678 *ppv
= &This
->IHTMLElement6_iface
;
6679 }else if(IsEqualGUID(&IID_IHTMLElement7
, riid
)) {
6680 *ppv
= &This
->IHTMLElement7_iface
;
6681 }else if(IsEqualGUID(&IID_IHTMLUniqueName
, riid
)) {
6682 *ppv
= &This
->IHTMLUniqueName_iface
;
6683 }else if(IsEqualGUID(&IID_IElementSelector
, riid
)) {
6684 *ppv
= &This
->IElementSelector_iface
;
6685 }else if(IsEqualGUID(&IID_IElementTraversal
, riid
)) {
6686 *ppv
= &This
->IElementTraversal_iface
;
6687 }else if(IsEqualGUID(&IID_IConnectionPointContainer
, riid
)) {
6688 *ppv
= &This
->cp_container
.IConnectionPointContainer_iface
;
6689 }else if(IsEqualGUID(&IID_IProvideClassInfo
, riid
)) {
6690 *ppv
= &This
->IProvideMultipleClassInfo_iface
;
6691 }else if(IsEqualGUID(&IID_IProvideClassInfo2
, riid
)) {
6692 *ppv
= &This
->IProvideMultipleClassInfo_iface
;
6693 }else if(IsEqualGUID(&IID_IProvideMultipleClassInfo
, riid
)) {
6694 *ppv
= &This
->IProvideMultipleClassInfo_iface
;
6695 }else if(IsEqualGUID(&IID_IWineHTMLElementPrivate
, riid
)) {
6696 *ppv
= &This
->IWineHTMLElementPrivate_iface
;
6698 return HTMLDOMNode_QI(&This
->node
, riid
, ppv
);
6701 IUnknown_AddRef((IUnknown
*)*ppv
);
6705 void HTMLElement_destructor(HTMLDOMNode
*iface
)
6707 HTMLElement
*This
= impl_from_HTMLDOMNode(iface
);
6709 ConnectionPointContainer_Destroy(&This
->cp_container
);
6712 This
->style
->elem
= NULL
;
6713 IHTMLStyle_Release(&This
->style
->IHTMLStyle_iface
);
6715 if(This
->runtime_style
) {
6716 This
->runtime_style
->elem
= NULL
;
6717 IHTMLStyle_Release(&This
->runtime_style
->IHTMLStyle_iface
);
6720 HTMLDOMAttribute
*attr
;
6722 LIST_FOR_EACH_ENTRY(attr
, &This
->attrs
->attrs
, HTMLDOMAttribute
, entry
)
6725 This
->attrs
->elem
= NULL
;
6726 IHTMLAttributeCollection_Release(&This
->attrs
->IHTMLAttributeCollection_iface
);
6729 heap_free(This
->filter
);
6731 HTMLDOMNode_destructor(&This
->node
);
6734 HRESULT
HTMLElement_clone(HTMLDOMNode
*iface
, nsIDOMNode
*nsnode
, HTMLDOMNode
**ret
)
6736 HTMLElement
*This
= impl_from_HTMLDOMNode(iface
);
6737 HTMLElement
*new_elem
;
6740 hres
= HTMLElement_Create(This
->node
.doc
, nsnode
, FALSE
, &new_elem
);
6745 new_elem
->filter
= heap_strdupW(This
->filter
);
6746 if(!new_elem
->filter
) {
6747 IHTMLElement_Release(&This
->IHTMLElement_iface
);
6748 return E_OUTOFMEMORY
;
6752 *ret
= &new_elem
->node
;
6756 HRESULT
HTMLElement_handle_event(HTMLDOMNode
*iface
, DWORD eid
, nsIDOMEvent
*event
, BOOL
*prevent_default
)
6758 HTMLElement
*This
= impl_from_HTMLDOMNode(iface
);
6761 case EVENTID_KEYDOWN
: {
6762 nsIDOMKeyEvent
*key_event
;
6765 nsres
= nsIDOMEvent_QueryInterface(event
, &IID_nsIDOMKeyEvent
, (void**)&key_event
);
6766 if(NS_SUCCEEDED(nsres
)) {
6769 nsIDOMKeyEvent_GetKeyCode(key_event
, &code
);
6771 if(code
== VK_F1
/* DOM_VK_F1 */) {
6772 DOMEvent
*help_event
;
6775 TRACE("F1 pressed\n");
6777 hres
= create_document_event(This
->node
.doc
, EVENTID_HELP
, &help_event
);
6778 if(SUCCEEDED(hres
)) {
6779 dispatch_event(&This
->node
.event_target
, help_event
);
6780 IDOMEvent_Release(&help_event
->IDOMEvent_iface
);
6782 *prevent_default
= TRUE
;
6785 nsIDOMKeyEvent_Release(key_event
);
6793 cp_static_data_t HTMLElementEvents2_data
= { HTMLElementEvents2_tid
, NULL
/* FIXME */, TRUE
};
6795 const cpc_entry_t HTMLElement_cpc
[] = {
6800 static const NodeImplVtbl HTMLElementImplVtbl
= {
6801 &CLSID_HTMLUnknownElement
,
6803 HTMLElement_destructor
,
6806 HTMLElement_handle_event
,
6807 HTMLElement_get_attr_col
6810 static inline HTMLElement
*impl_from_DispatchEx(DispatchEx
*iface
)
6812 return CONTAINING_RECORD(iface
, HTMLElement
, node
.event_target
.dispex
);
6815 static HRESULT
HTMLElement_get_dispid(DispatchEx
*dispex
, BSTR name
,
6816 DWORD grfdex
, DISPID
*pid
)
6818 HTMLElement
*This
= impl_from_DispatchEx(dispex
);
6820 if(This
->node
.vtbl
->get_dispid
)
6821 return This
->node
.vtbl
->get_dispid(&This
->node
, name
, grfdex
, pid
);
6823 return DISP_E_UNKNOWNNAME
;
6826 static HRESULT
HTMLElement_get_name(DispatchEx
*dispex
, DISPID id
, BSTR
*name
)
6828 HTMLElement
*This
= impl_from_DispatchEx(dispex
);
6830 if(This
->node
.vtbl
->get_name
)
6831 return This
->node
.vtbl
->get_name(&This
->node
, id
, name
);
6833 ERR("(%p): element has no get_name method\n", This
);
6834 return DISP_E_MEMBERNOTFOUND
;
6837 static HRESULT
HTMLElement_invoke(DispatchEx
*dispex
, DISPID id
, LCID lcid
,
6838 WORD flags
, DISPPARAMS
*params
, VARIANT
*res
, EXCEPINFO
*ei
,
6839 IServiceProvider
*caller
)
6841 HTMLElement
*This
= impl_from_DispatchEx(dispex
);
6843 if(This
->node
.vtbl
->invoke
)
6844 return This
->node
.vtbl
->invoke(&This
->node
, id
, lcid
, flags
,
6845 params
, res
, ei
, caller
);
6847 ERR("(%p): element has no invoke method\n", This
);
6851 static HRESULT
HTMLElement_populate_props(DispatchEx
*dispex
)
6853 HTMLElement
*This
= impl_from_DispatchEx(dispex
);
6854 nsIDOMMozNamedAttrMap
*attrs
;
6857 const PRUnichar
*str
;
6866 if(!This
->dom_element
)
6869 if(dispex_compat_mode(dispex
) >= COMPAT_MODE_IE9
)
6872 nsres
= nsIDOMElement_GetAttributes(This
->dom_element
, &attrs
);
6873 if(NS_FAILED(nsres
))
6876 nsres
= nsIDOMMozNamedAttrMap_GetLength(attrs
, &len
);
6877 if(NS_FAILED(nsres
)) {
6878 nsIDOMMozNamedAttrMap_Release(attrs
);
6882 nsAString_Init(&nsstr
, NULL
);
6883 for(i
=0; i
<len
; i
++) {
6884 nsres
= nsIDOMMozNamedAttrMap_Item(attrs
, i
, &attr
);
6885 if(NS_FAILED(nsres
))
6888 nsres
= nsIDOMAttr_GetNodeName(attr
, &nsstr
);
6889 if(NS_FAILED(nsres
)) {
6890 nsIDOMAttr_Release(attr
);
6894 nsAString_GetData(&nsstr
, &str
);
6895 name
= SysAllocString(str
);
6897 nsIDOMAttr_Release(attr
);
6901 hres
= IDispatchEx_GetDispID(&dispex
->IDispatchEx_iface
, name
, fdexNameCaseInsensitive
, &id
);
6902 if(hres
!= DISP_E_UNKNOWNNAME
) {
6903 nsIDOMAttr_Release(attr
);
6904 SysFreeString(name
);
6908 nsres
= nsIDOMAttr_GetNodeValue(attr
, &nsstr
);
6909 nsIDOMAttr_Release(attr
);
6910 if(NS_FAILED(nsres
)) {
6911 SysFreeString(name
);
6915 nsAString_GetData(&nsstr
, &str
);
6916 V_VT(&value
) = VT_BSTR
;
6918 V_BSTR(&value
) = SysAllocString(str
);
6919 if(!V_BSTR(&value
)) {
6920 SysFreeString(name
);
6924 V_BSTR(&value
) = NULL
;
6926 IHTMLElement_setAttribute(&This
->IHTMLElement_iface
, name
, value
, 0);
6927 SysFreeString(name
);
6928 VariantClear(&value
);
6930 nsAString_Finish(&nsstr
);
6932 nsIDOMMozNamedAttrMap_Release(attrs
);
6936 static nsISupports
*HTMLElement_get_gecko_target(DispatchEx
*dispex
)
6938 HTMLElement
*This
= impl_from_DispatchEx(dispex
);
6939 return (nsISupports
*)This
->node
.nsnode
;
6942 static void HTMLElement_bind_event(DispatchEx
*dispex
, eventid_t eid
)
6944 HTMLElement
*This
= impl_from_DispatchEx(dispex
);
6945 ensure_doc_nsevent_handler(This
->node
.doc
, This
->node
.nsnode
, eid
);
6948 static HRESULT
HTMLElement_handle_event_default(DispatchEx
*dispex
, eventid_t eid
, nsIDOMEvent
*nsevent
, BOOL
*prevent_default
)
6950 HTMLElement
*This
= impl_from_DispatchEx(dispex
);
6952 if(!This
->node
.vtbl
->handle_event
)
6954 return This
->node
.vtbl
->handle_event(&This
->node
, eid
, nsevent
, prevent_default
);
6957 static EventTarget
*HTMLElement_get_parent_event_target(DispatchEx
*dispex
)
6959 HTMLElement
*This
= impl_from_DispatchEx(dispex
);
6965 nsres
= nsIDOMNode_GetParentNode(This
->node
.nsnode
, &nsnode
);
6966 assert(nsres
== NS_OK
);
6970 hres
= get_node(nsnode
, TRUE
, &node
);
6971 nsIDOMNode_Release(nsnode
);
6975 return &node
->event_target
;
6978 static ConnectionPointContainer
*HTMLElement_get_cp_container(DispatchEx
*dispex
)
6980 HTMLElement
*This
= impl_from_DispatchEx(dispex
);
6981 IConnectionPointContainer_AddRef(&This
->cp_container
.IConnectionPointContainer_iface
);
6982 return &This
->cp_container
;
6985 static IHTMLEventObj
*HTMLElement_set_current_event(DispatchEx
*dispex
, IHTMLEventObj
*event
)
6987 HTMLElement
*This
= impl_from_DispatchEx(dispex
);
6988 return default_set_current_event(This
->node
.doc
->window
, event
);
6991 static HRESULT
IHTMLElement6_hasAttributeNS_hook(DispatchEx
*dispex
, WORD flags
, DISPPARAMS
*dp
,
6992 VARIANT
*res
, EXCEPINFO
*ei
, IServiceProvider
*caller
)
6996 DISPPARAMS new_dp
= { args
, NULL
, 2, 0 };
6998 if(!(flags
& DISPATCH_METHOD
) || dp
->cArgs
< 2 || dp
->cNamedArgs
)
7001 switch(V_VT(&dp
->rgvarg
[dp
->cArgs
- 1])) {
7010 hres
= change_type(&args
[1], &dp
->rgvarg
[dp
->cArgs
- 1], VT_BSTR
, caller
);
7013 args
[0] = dp
->rgvarg
[dp
->cArgs
- 2];
7015 hres
= dispex_call_builtin(dispex
, DISPID_IHTMLELEMENT6_HASATTRIBUTENS
, &new_dp
, res
, ei
, caller
);
7016 VariantClear(&args
[1]);
7020 static HRESULT
IHTMLElement6_getAttributeNS_hook(DispatchEx
*dispex
, WORD flags
, DISPPARAMS
*dp
,
7021 VARIANT
*res
, EXCEPINFO
*ei
, IServiceProvider
*caller
)
7025 DISPPARAMS new_dp
= { args
, NULL
, 2, 0 };
7027 if(!(flags
& DISPATCH_METHOD
) || dp
->cArgs
< 2 || dp
->cNamedArgs
)
7030 switch(V_VT(&dp
->rgvarg
[dp
->cArgs
- 1])) {
7039 hres
= change_type(&args
[1], &dp
->rgvarg
[dp
->cArgs
- 1], VT_BSTR
, caller
);
7042 args
[0] = dp
->rgvarg
[dp
->cArgs
- 2];
7044 hres
= dispex_call_builtin(dispex
, DISPID_IHTMLELEMENT6_GETATTRIBUTENS
, &new_dp
, res
, ei
, caller
);
7045 VariantClear(&args
[1]);
7049 static HRESULT
IHTMLElement6_setAttributeNS_hook(DispatchEx
*dispex
, WORD flags
, DISPPARAMS
*dp
,
7050 VARIANT
*res
, EXCEPINFO
*ei
, IServiceProvider
*caller
)
7052 BOOL ns_conv
= FALSE
, val_conv
= FALSE
;
7055 DISPPARAMS new_dp
= { args
, NULL
, 3, 0 };
7057 if(!(flags
& DISPATCH_METHOD
) || dp
->cArgs
< 3 || dp
->cNamedArgs
)
7060 if(dispex_compat_mode(dispex
) < COMPAT_MODE_IE10
)
7061 args
[2] = dp
->rgvarg
[dp
->cArgs
- 1];
7063 switch(V_VT(&dp
->rgvarg
[dp
->cArgs
- 1])) {
7067 args
[2] = dp
->rgvarg
[dp
->cArgs
- 1];
7070 hres
= change_type(&args
[2], &dp
->rgvarg
[dp
->cArgs
- 1], VT_BSTR
, caller
);
7078 switch(V_VT(&dp
->rgvarg
[dp
->cArgs
- 3])) {
7084 args
[0] = dp
->rgvarg
[dp
->cArgs
- 3];
7087 hres
= change_type(&args
[0], &dp
->rgvarg
[dp
->cArgs
- 3], VT_BSTR
, caller
);
7090 VariantClear(&args
[2]);
7097 args
[1] = dp
->rgvarg
[dp
->cArgs
- 2];
7098 hres
= dispex_call_builtin(dispex
, DISPID_IHTMLELEMENT6_SETATTRIBUTENS
, &new_dp
, res
, ei
, caller
);
7099 if(ns_conv
) VariantClear(&args
[2]);
7100 if(val_conv
) VariantClear(&args
[0]);
7104 static HRESULT
IHTMLElement6_removeAttributeNS_hook(DispatchEx
*dispex
, WORD flags
, DISPPARAMS
*dp
,
7105 VARIANT
*res
, EXCEPINFO
*ei
, IServiceProvider
*caller
)
7109 DISPPARAMS new_dp
= { args
, NULL
, 2, 0 };
7111 if(!(flags
& DISPATCH_METHOD
) || dp
->cArgs
< 2 || dp
->cNamedArgs
)
7114 switch(V_VT(&dp
->rgvarg
[dp
->cArgs
- 1])) {
7123 hres
= change_type(&args
[1], &dp
->rgvarg
[dp
->cArgs
- 1], VT_BSTR
, caller
);
7126 args
[0] = dp
->rgvarg
[dp
->cArgs
- 2];
7128 hres
= dispex_call_builtin(dispex
, DISPID_IHTMLELEMENT6_REMOVEATTRIBUTENS
, &new_dp
, res
, ei
, caller
);
7129 VariantClear(&args
[1]);
7133 static HRESULT
IHTMLElement6_setAttribute_hook(DispatchEx
*dispex
, WORD flags
, DISPPARAMS
*dp
,
7134 VARIANT
*res
, EXCEPINFO
*ei
, IServiceProvider
*caller
)
7138 DISPPARAMS new_dp
= { args
, NULL
, 2, 0 };
7140 if(!(flags
& DISPATCH_METHOD
) || dp
->cArgs
< 2 || dp
->cNamedArgs
)
7143 switch(V_VT(&dp
->rgvarg
[dp
->cArgs
- 2])) {
7152 hres
= change_type(&args
[0], &dp
->rgvarg
[dp
->cArgs
- 2], VT_BSTR
, caller
);
7155 args
[1] = dp
->rgvarg
[dp
->cArgs
- 1];
7157 hres
= dispex_call_builtin(dispex
, DISPID_IHTMLELEMENT6_IE9_SETATTRIBUTE
, &new_dp
, res
, ei
, caller
);
7158 VariantClear(&args
[0]);
7162 void HTMLElement_init_dispex_info(dispex_data_t
*info
, compat_mode_t mode
)
7164 static const dispex_hook_t elem6_ie9_hooks
[] = {
7165 {DISPID_IHTMLELEMENT6_SETATTRIBUTENS
, IHTMLElement6_setAttributeNS_hook
},
7168 static const dispex_hook_t elem6_ie10_hooks
[] = {
7169 {DISPID_IHTMLELEMENT6_HASATTRIBUTENS
, IHTMLElement6_hasAttributeNS_hook
},
7170 {DISPID_IHTMLELEMENT6_GETATTRIBUTENS
, IHTMLElement6_getAttributeNS_hook
},
7171 {DISPID_IHTMLELEMENT6_SETATTRIBUTENS
, IHTMLElement6_setAttributeNS_hook
},
7172 {DISPID_IHTMLELEMENT6_REMOVEATTRIBUTENS
, IHTMLElement6_removeAttributeNS_hook
},
7173 {DISPID_IHTMLELEMENT6_IE9_SETATTRIBUTE
, IHTMLElement6_setAttribute_hook
},
7176 static const dispex_hook_t elem2_ie11_hooks
[] = {
7177 {DISPID_IHTMLELEMENT2_DOSCROLL
, NULL
},
7178 {DISPID_IHTMLELEMENT2_READYSTATE
, NULL
},
7182 HTMLDOMNode_init_dispex_info(info
, mode
);
7184 dispex_info_add_interface(info
, IHTMLElement2_tid
, mode
>= COMPAT_MODE_IE11
? elem2_ie11_hooks
: NULL
);
7186 if(mode
>= COMPAT_MODE_IE8
)
7187 dispex_info_add_interface(info
, IElementSelector_tid
, NULL
);
7189 if(mode
>= COMPAT_MODE_IE9
) {
7190 dispex_info_add_interface(info
, IHTMLElement6_tid
, mode
>= COMPAT_MODE_IE10
? elem6_ie10_hooks
: elem6_ie9_hooks
);
7191 dispex_info_add_interface(info
, IElementTraversal_tid
, NULL
);
7194 if(mode
>= COMPAT_MODE_IE10
)
7196 dispex_info_add_interface(info
, IHTMLElement7_tid
, NULL
);
7197 dispex_info_add_interface(info
, IWineHTMLElementPrivate_tid
, NULL
);
7201 static const tid_t HTMLElement_iface_tids
[] = {
7206 static event_target_vtbl_t HTMLElement_event_target_vtbl
= {
7209 HTMLElement_get_dispid
,
7210 HTMLElement_get_name
,
7215 HTMLElement_populate_props
7217 HTMLElement_get_gecko_target
,
7218 HTMLElement_bind_event
,
7219 HTMLElement_get_parent_event_target
,
7220 HTMLElement_handle_event_default
,
7221 HTMLElement_get_cp_container
,
7222 HTMLElement_set_current_event
7227 IWineDOMTokenList IWineDOMTokenList_iface
;
7228 IHTMLElement
*element
;
7233 static inline struct token_list
*impl_from_IWineDOMTokenList(IWineDOMTokenList
*iface
)
7235 return CONTAINING_RECORD(iface
, struct token_list
, IWineDOMTokenList_iface
);
7238 static HRESULT WINAPI
token_list_QueryInterface(IWineDOMTokenList
*iface
, REFIID riid
, void **ppv
)
7240 struct token_list
*token_list
= impl_from_IWineDOMTokenList(iface
);
7242 TRACE("(%p)->(%s %p)\n", token_list
, debugstr_mshtml_guid(riid
), ppv
);
7244 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
7245 *ppv
= &token_list
->IWineDOMTokenList_iface
;
7246 }else if(IsEqualGUID(&IID_IWineDOMTokenList
, riid
)) {
7247 *ppv
= &token_list
->IWineDOMTokenList_iface
;
7248 }else if(dispex_query_interface(&token_list
->dispex
, riid
, ppv
)) {
7249 return *ppv
? S_OK
: E_NOINTERFACE
;
7251 WARN("(%p)->(%s %p)\n", token_list
, debugstr_mshtml_guid(riid
), ppv
);
7253 return E_NOINTERFACE
;
7256 IUnknown_AddRef((IUnknown
*)*ppv
);
7260 static ULONG WINAPI
token_list_AddRef(IWineDOMTokenList
*iface
)
7262 struct token_list
*token_list
= impl_from_IWineDOMTokenList(iface
);
7263 LONG ref
= InterlockedIncrement(&token_list
->ref
);
7265 TRACE("(%p) ref=%ld\n", token_list
, ref
);
7270 static ULONG WINAPI
token_list_Release(IWineDOMTokenList
*iface
)
7272 struct token_list
*token_list
= impl_from_IWineDOMTokenList(iface
);
7273 LONG ref
= InterlockedDecrement(&token_list
->ref
);
7275 TRACE("(%p) ref=%ld\n", token_list
, ref
);
7278 IHTMLElement_Release(token_list
->element
);
7279 release_dispex(&token_list
->dispex
);
7280 heap_free(token_list
);
7286 static HRESULT WINAPI
token_list_GetTypeInfoCount(IWineDOMTokenList
*iface
, UINT
*pctinfo
)
7288 struct token_list
*token_list
= impl_from_IWineDOMTokenList(iface
);
7289 FIXME("(%p)->(%p)\n", token_list
, pctinfo
);
7293 static HRESULT WINAPI
token_list_GetTypeInfo(IWineDOMTokenList
*iface
, UINT iTInfo
,
7294 LCID lcid
, ITypeInfo
**ppTInfo
)
7296 struct token_list
*token_list
= impl_from_IWineDOMTokenList(iface
);
7298 return IDispatchEx_GetTypeInfo(&token_list
->dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
7301 static HRESULT WINAPI
token_list_GetIDsOfNames(IWineDOMTokenList
*iface
, REFIID riid
,
7302 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
7304 struct token_list
*token_list
= impl_from_IWineDOMTokenList(iface
);
7306 return IDispatchEx_GetIDsOfNames(&token_list
->dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
7310 static HRESULT WINAPI
token_list_Invoke(IWineDOMTokenList
*iface
, DISPID dispIdMember
,
7311 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
7312 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
7314 struct token_list
*token_list
= impl_from_IWineDOMTokenList(iface
);
7316 return IDispatchEx_Invoke(&token_list
->dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
, wFlags
,
7317 pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
7320 static const WCHAR
*find_token(const WCHAR
*list
, const WCHAR
*token
, unsigned int token_len
)
7322 const WCHAR
*ptr
, *next
;
7324 if (!list
|| !token
)
7330 while (iswspace(*ptr
))
7335 while (*next
&& !iswspace(*next
))
7338 if (next
- ptr
== token_len
&& !wcsncmp(ptr
, token
, token_len
))
7345 static HRESULT
token_list_add_remove(IWineDOMTokenList
*iface
, BSTR token
, BOOL remove
)
7347 struct token_list
*token_list
= impl_from_IWineDOMTokenList(iface
);
7348 unsigned int i
, len
, old_len
, new_len
;
7349 const WCHAR
*old_pos
;
7353 TRACE("iface %p, token %s, remove %#x.\n", iface
, debugstr_w(token
), remove
);
7355 len
= token
? lstrlenW(token
) : 0;
7358 WARN("Empty token.\n");
7359 return E_INVALIDARG
;
7362 for (i
= 0; i
< len
; ++i
)
7363 if (iswspace(token
[i
]))
7365 WARN("Token has spaces.\n");
7366 return E_INVALIDARG
;
7369 if (FAILED(hr
= IHTMLElement_get_className(token_list
->element
, &old
)))
7372 TRACE("old %s.\n", debugstr_w(old
));
7374 if (((old_pos
= find_token(old
, token
, len
)) && !remove
)
7375 || (!old_pos
&& remove
))
7381 old_len
= old
? lstrlenW(old
) : 0;
7384 while (old_pos
!= old
&& iswspace(old_pos
[-1]))
7389 while (iswspace(old_pos
[len
]))
7392 if (old_pos
!= old
&& old_pos
[len
])
7395 new_len
= old_len
- len
;
7399 new_len
= old_len
+ len
+ !!old_len
;
7402 if (!(new = SysAllocStringLen(NULL
, new_len
)))
7404 ERR("No memory.\n");
7406 return E_OUTOFMEMORY
;
7411 memcpy(new, old
, sizeof(*new) * (old_pos
- old
));
7412 memcpy(new + (old_pos
- old
), old_pos
+ len
, sizeof(*new) * (old_len
- (old_pos
- old
) - len
+ 1));
7416 memcpy(new, old
, sizeof(*new) * old_len
);
7418 new[old_len
++]= L
' ';
7419 memcpy(new + old_len
, token
, sizeof(*new) * len
);
7420 new[old_len
+ len
] = 0;
7425 TRACE("new %s.\n", debugstr_w(new));
7427 hr
= IHTMLElement_put_className(token_list
->element
, new);
7432 static HRESULT WINAPI
token_list_add(IWineDOMTokenList
*iface
, BSTR token
)
7434 return token_list_add_remove(iface
, token
, FALSE
);
7437 static HRESULT WINAPI
token_list_remove(IWineDOMTokenList
*iface
, BSTR token
)
7439 return token_list_add_remove(iface
, token
, TRUE
);
7442 static HRESULT WINAPI
token_list_toString(IWineDOMTokenList
*iface
, BSTR
*String
)
7444 struct token_list
*token_list
= impl_from_IWineDOMTokenList(iface
);
7446 TRACE("(%p)->(%p)\n", token_list
, String
);
7448 return IHTMLElement_get_className(token_list
->element
, String
);
7451 static const IWineDOMTokenListVtbl WineDOMTokenListVtbl
= {
7452 token_list_QueryInterface
,
7455 token_list_GetTypeInfoCount
,
7456 token_list_GetTypeInfo
,
7457 token_list_GetIDsOfNames
,
7464 static inline struct token_list
*token_list_from_DispatchEx(DispatchEx
*iface
)
7466 return CONTAINING_RECORD(iface
, struct token_list
, dispex
);
7469 static HRESULT
token_list_value(DispatchEx
*dispex
, LCID lcid
, WORD flags
, DISPPARAMS
*params
,
7470 VARIANT
*res
, EXCEPINFO
*ei
, IServiceProvider
*caller
)
7472 struct token_list
*token_list
= token_list_from_DispatchEx(dispex
);
7476 case DISPATCH_PROPERTYGET
:
7477 hres
= IHTMLElement_get_className(token_list
->element
, &V_BSTR(res
));
7480 V_VT(res
) = VT_BSTR
;
7483 FIXME("Unimplemented flags %x\n", flags
);
7490 static const dispex_static_data_vtbl_t token_list_dispex_vtbl
= {
7494 static const tid_t token_list_iface_tids
[] = {
7495 IWineDOMTokenList_tid
,
7498 static dispex_static_data_t token_list_dispex
= {
7500 &token_list_dispex_vtbl
,
7501 IWineDOMTokenList_tid
,
7502 token_list_iface_tids
7505 static HRESULT
create_token_list(compat_mode_t compat_mode
, IHTMLElement
*element
, IWineDOMTokenList
**ret
)
7507 struct token_list
*obj
;
7509 obj
= heap_alloc_zero(sizeof(*obj
));
7512 ERR("No memory.\n");
7513 return E_OUTOFMEMORY
;
7516 obj
->IWineDOMTokenList_iface
.lpVtbl
= &WineDOMTokenListVtbl
;
7518 init_dispatch(&obj
->dispex
, (IUnknown
*)&obj
->IWineDOMTokenList_iface
, &token_list_dispex
, compat_mode
);
7519 IHTMLElement_AddRef(element
);
7520 obj
->element
= element
;
7522 *ret
= &obj
->IWineDOMTokenList_iface
;
7526 static inline HTMLElement
*impl_from_IWineHTMLElementPrivateVtbl(IWineHTMLElementPrivate
*iface
)
7528 return CONTAINING_RECORD(iface
, HTMLElement
, IWineHTMLElementPrivate_iface
);
7531 static HRESULT WINAPI
htmlelement_private_QueryInterface(IWineHTMLElementPrivate
*iface
,
7532 REFIID riid
, void **ppv
)
7534 HTMLElement
*This
= impl_from_IWineHTMLElementPrivateVtbl(iface
);
7536 return IHTMLElement_QueryInterface(&This
->IHTMLElement_iface
, riid
, ppv
);
7539 static ULONG WINAPI
htmlelement_private_AddRef(IWineHTMLElementPrivate
*iface
)
7541 HTMLElement
*This
= impl_from_IWineHTMLElementPrivateVtbl(iface
);
7543 return IHTMLElement_AddRef(&This
->IHTMLElement_iface
);
7546 static ULONG WINAPI
htmlelement_private_Release(IWineHTMLElementPrivate
*iface
)
7548 HTMLElement
*This
= impl_from_IWineHTMLElementPrivateVtbl(iface
);
7550 return IHTMLElement_Release(&This
->IHTMLElement_iface
);
7553 static HRESULT WINAPI
htmlelement_private_GetTypeInfoCount(IWineHTMLElementPrivate
*iface
, UINT
*pctinfo
)
7555 HTMLElement
*This
= impl_from_IWineHTMLElementPrivateVtbl(iface
);
7557 return HTMLElement_GetTypeInfoCount(&This
->IHTMLElement_iface
, pctinfo
);
7560 static HRESULT WINAPI
htmlelement_private_GetTypeInfo(IWineHTMLElementPrivate
*iface
, UINT iTInfo
,
7561 LCID lcid
, ITypeInfo
**ppTInfo
)
7563 HTMLElement
*This
= impl_from_IWineHTMLElementPrivateVtbl(iface
);
7565 return HTMLElement_GetTypeInfo(&This
->IHTMLElement_iface
, iTInfo
, lcid
, ppTInfo
);
7568 static HRESULT WINAPI
htmlelement_private_GetIDsOfNames(IWineHTMLElementPrivate
*iface
, REFIID riid
,
7569 LPOLESTR
*rgszNames
, UINT cNames
,
7570 LCID lcid
, DISPID
*rgDispId
)
7572 HTMLElement
*This
= impl_from_IWineHTMLElementPrivateVtbl(iface
);
7574 return HTMLElement_GetIDsOfNames(&This
->IHTMLElement_iface
, riid
, rgszNames
, cNames
, lcid
,
7578 static HRESULT WINAPI
htmlelement_private_Invoke(IWineHTMLElementPrivate
*iface
, DISPID dispIdMember
,
7579 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
7580 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
7582 HTMLElement
*This
= impl_from_IWineHTMLElementPrivateVtbl(iface
);
7584 return HTMLElement_Invoke(&This
->IHTMLElement_iface
, dispIdMember
, riid
, lcid
, wFlags
,
7585 pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
7588 static HRESULT WINAPI
htmlelement_private_get_classList(IWineHTMLElementPrivate
*iface
, IDispatch
**class_list
)
7590 HTMLElement
*This
= impl_from_IWineHTMLElementPrivateVtbl(iface
);
7592 TRACE("iface %p, class_list %p.\n", iface
, class_list
);
7594 return create_token_list(dispex_compat_mode(&This
->node
.event_target
.dispex
), &This
->IHTMLElement_iface
,
7595 (IWineDOMTokenList
**)class_list
);
7598 static const IWineHTMLElementPrivateVtbl WineHTMLElementPrivateVtbl
= {
7599 htmlelement_private_QueryInterface
,
7600 htmlelement_private_AddRef
,
7601 htmlelement_private_Release
,
7602 htmlelement_private_GetTypeInfoCount
,
7603 htmlelement_private_GetTypeInfo
,
7604 htmlelement_private_GetIDsOfNames
,
7605 htmlelement_private_Invoke
,
7606 htmlelement_private_get_classList
,
7609 static dispex_static_data_t HTMLElement_dispex
= {
7611 &HTMLElement_event_target_vtbl
.dispex_vtbl
,
7612 DispHTMLUnknownElement_tid
,
7613 HTMLElement_iface_tids
,
7614 HTMLElement_init_dispex_info
7617 static dispex_static_data_t HTMLUnknownElement_dispex
= {
7618 L
"HTMLUnknownElement",
7619 &HTMLElement_event_target_vtbl
.dispex_vtbl
,
7620 DispHTMLUnknownElement_tid
,
7621 HTMLElement_iface_tids
,
7622 HTMLElement_init_dispex_info
7625 void HTMLElement_Init(HTMLElement
*This
, HTMLDocumentNode
*doc
, nsIDOMElement
*nselem
, dispex_static_data_t
*dispex_data
)
7627 This
->IHTMLElement_iface
.lpVtbl
= &HTMLElementVtbl
;
7628 This
->IHTMLElement2_iface
.lpVtbl
= &HTMLElement2Vtbl
;
7629 This
->IHTMLElement3_iface
.lpVtbl
= &HTMLElement3Vtbl
;
7630 This
->IHTMLElement4_iface
.lpVtbl
= &HTMLElement4Vtbl
;
7631 This
->IHTMLElement6_iface
.lpVtbl
= &HTMLElement6Vtbl
;
7632 This
->IHTMLElement7_iface
.lpVtbl
= &HTMLElement7Vtbl
;
7633 This
->IHTMLUniqueName_iface
.lpVtbl
= &HTMLUniqueNameVtbl
;
7634 This
->IElementSelector_iface
.lpVtbl
= &ElementSelectorVtbl
;
7635 This
->IElementTraversal_iface
.lpVtbl
= &ElementTraversalVtbl
;
7636 This
->IProvideMultipleClassInfo_iface
.lpVtbl
= &ProvideMultipleClassInfoVtbl
;
7637 This
->IWineHTMLElementPrivate_iface
.lpVtbl
= &WineHTMLElementPrivateVtbl
;
7639 if(dispex_data
&& !dispex_data
->vtbl
)
7640 dispex_data
->vtbl
= &HTMLElement_event_target_vtbl
.dispex_vtbl
;
7643 nsIDOMHTMLElement
*html_element
;
7646 HTMLDOMNode_Init(doc
, &This
->node
, (nsIDOMNode
*)nselem
, dispex_data
? dispex_data
: &HTMLUnknownElement_dispex
);
7648 /* No AddRef, share reference with HTMLDOMNode */
7649 assert((nsIDOMNode
*)nselem
== This
->node
.nsnode
);
7650 This
->dom_element
= nselem
;
7652 nsres
= nsIDOMElement_QueryInterface(nselem
, &IID_nsIDOMHTMLElement
, (void**)&html_element
);
7653 if(NS_SUCCEEDED(nsres
)) {
7654 This
->html_element
= html_element
;
7655 /* share reference with HTMLDOMNode */
7656 assert((nsIDOMNode
*)html_element
== This
->node
.nsnode
);
7657 nsIDOMHTMLElement_Release(html_element
);
7661 ConnectionPointContainer_Init(&This
->cp_container
, (IUnknown
*)&This
->IHTMLElement_iface
, This
->node
.vtbl
->cpc_entries
);
7664 HRESULT
HTMLElement_Create(HTMLDocumentNode
*doc
, nsIDOMNode
*nsnode
, BOOL use_generic
, HTMLElement
**ret
)
7666 nsIDOMElement
*nselem
;
7667 nsAString tag_name_str
;
7668 const PRUnichar
*tag_name
;
7669 const tag_desc_t
*tag
;
7674 nsres
= nsIDOMNode_QueryInterface(nsnode
, &IID_nsIDOMElement
, (void**)&nselem
);
7675 if(NS_FAILED(nsres
)) {
7676 ERR("no nsIDOMElement iface\n");
7680 nsAString_Init(&tag_name_str
, NULL
);
7681 nsIDOMElement_GetTagName(nselem
, &tag_name_str
);
7683 nsAString_GetData(&tag_name_str
, &tag_name
);
7685 tag
= get_tag_desc(tag_name
);
7687 hres
= tag
->constructor(doc
, nselem
, &elem
);
7689 nsIDOMSVGElement
*svg_element
;
7691 nsres
= nsIDOMElement_QueryInterface(nselem
, &IID_nsIDOMSVGElement
, (void**)&svg_element
);
7692 if(NS_SUCCEEDED(nsres
)) {
7693 hres
= create_svg_element(doc
, svg_element
, tag_name
, &elem
);
7694 nsIDOMSVGElement_Release(svg_element
);
7695 }else if(use_generic
) {
7696 hres
= HTMLGenericElement_Create(doc
, nselem
, &elem
);
7698 elem
= heap_alloc_zero(sizeof(HTMLElement
));
7700 elem
->node
.vtbl
= &HTMLElementImplVtbl
;
7701 HTMLElement_Init(elem
, doc
, nselem
, &HTMLUnknownElement_dispex
);
7704 hres
= E_OUTOFMEMORY
;
7709 TRACE("%s ret %p\n", debugstr_w(tag_name
), elem
);
7711 nsIDOMElement_Release(nselem
);
7712 nsAString_Finish(&tag_name_str
);
7720 static HRESULT
HTMLElement_Ctor(HTMLDocumentNode
*doc
, nsIDOMElement
*nselem
, HTMLElement
**elem
)
7724 ret
= heap_alloc_zero(sizeof(*ret
));
7726 return E_OUTOFMEMORY
;
7728 ret
->node
.vtbl
= &HTMLElementImplVtbl
;
7729 HTMLElement_Init(ret
, doc
, nselem
, &HTMLElement_dispex
);
7735 HRESULT
get_element(nsIDOMElement
*nselem
, HTMLElement
**ret
)
7740 hres
= get_node((nsIDOMNode
*)nselem
, TRUE
, &node
);
7744 *ret
= impl_from_HTMLDOMNode(node
);
7748 /* interface IHTMLFiltersCollection */
7749 static HRESULT WINAPI
HTMLFiltersCollection_QueryInterface(IHTMLFiltersCollection
*iface
, REFIID riid
, void **ppv
)
7751 HTMLFiltersCollection
*This
= impl_from_IHTMLFiltersCollection(iface
);
7753 TRACE("%p %s %p\n", This
, debugstr_mshtml_guid(riid
), ppv
);
7755 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
7756 *ppv
= &This
->IHTMLFiltersCollection_iface
;
7757 }else if(IsEqualGUID(&IID_IHTMLFiltersCollection
, riid
)) {
7758 TRACE("(%p)->(IID_IHTMLFiltersCollection %p)\n", This
, ppv
);
7759 *ppv
= &This
->IHTMLFiltersCollection_iface
;
7760 }else if(dispex_query_interface(&This
->dispex
, riid
, ppv
)) {
7761 return *ppv
? S_OK
: E_NOINTERFACE
;
7764 FIXME("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
7765 return E_NOINTERFACE
;
7768 IUnknown_AddRef((IUnknown
*)*ppv
);
7772 static ULONG WINAPI
HTMLFiltersCollection_AddRef(IHTMLFiltersCollection
*iface
)
7774 HTMLFiltersCollection
*This
= impl_from_IHTMLFiltersCollection(iface
);
7775 LONG ref
= InterlockedIncrement(&This
->ref
);
7777 TRACE("(%p) ref=%ld\n", This
, ref
);
7782 static ULONG WINAPI
HTMLFiltersCollection_Release(IHTMLFiltersCollection
*iface
)
7784 HTMLFiltersCollection
*This
= impl_from_IHTMLFiltersCollection(iface
);
7785 LONG ref
= InterlockedDecrement(&This
->ref
);
7787 TRACE("(%p) ref=%ld\n", This
, ref
);
7797 static HRESULT WINAPI
HTMLFiltersCollection_GetTypeInfoCount(IHTMLFiltersCollection
*iface
, UINT
*pctinfo
)
7799 HTMLFiltersCollection
*This
= impl_from_IHTMLFiltersCollection(iface
);
7800 return IDispatchEx_GetTypeInfoCount(&This
->dispex
.IDispatchEx_iface
, pctinfo
);
7803 static HRESULT WINAPI
HTMLFiltersCollection_GetTypeInfo(IHTMLFiltersCollection
*iface
,
7804 UINT iTInfo
, LCID lcid
, ITypeInfo
**ppTInfo
)
7806 HTMLFiltersCollection
*This
= impl_from_IHTMLFiltersCollection(iface
);
7807 return IDispatchEx_GetTypeInfo(&This
->dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
7810 static HRESULT WINAPI
HTMLFiltersCollection_GetIDsOfNames(IHTMLFiltersCollection
*iface
,
7811 REFIID riid
, LPOLESTR
*rgszNames
, UINT cNames
,
7812 LCID lcid
, DISPID
*rgDispId
)
7814 HTMLFiltersCollection
*This
= impl_from_IHTMLFiltersCollection(iface
);
7815 return IDispatchEx_GetIDsOfNames(&This
->dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
7819 static HRESULT WINAPI
HTMLFiltersCollection_Invoke(IHTMLFiltersCollection
*iface
, DISPID dispIdMember
, REFIID riid
,
7820 LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
,
7821 EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
7823 HTMLFiltersCollection
*This
= impl_from_IHTMLFiltersCollection(iface
);
7824 return IDispatchEx_Invoke(&This
->dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
7825 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
7828 static HRESULT WINAPI
HTMLFiltersCollection_get_length(IHTMLFiltersCollection
*iface
, LONG
*p
)
7830 HTMLFiltersCollection
*This
= impl_from_IHTMLFiltersCollection(iface
);
7835 FIXME("(%p)->(%p) Always returning 0\n", This
, p
);
7841 static HRESULT WINAPI
HTMLFiltersCollection_get__newEnum(IHTMLFiltersCollection
*iface
, IUnknown
**p
)
7843 HTMLFiltersCollection
*This
= impl_from_IHTMLFiltersCollection(iface
);
7844 FIXME("(%p)->(%p)\n", This
, p
);
7848 static HRESULT WINAPI
HTMLFiltersCollection_item(IHTMLFiltersCollection
*iface
, VARIANT
*pvarIndex
, VARIANT
*pvarResult
)
7850 HTMLFiltersCollection
*This
= impl_from_IHTMLFiltersCollection(iface
);
7851 FIXME("(%p)->(%p, %p)\n", This
, pvarIndex
, pvarResult
);
7855 static const IHTMLFiltersCollectionVtbl HTMLFiltersCollectionVtbl
= {
7856 HTMLFiltersCollection_QueryInterface
,
7857 HTMLFiltersCollection_AddRef
,
7858 HTMLFiltersCollection_Release
,
7859 HTMLFiltersCollection_GetTypeInfoCount
,
7860 HTMLFiltersCollection_GetTypeInfo
,
7861 HTMLFiltersCollection_GetIDsOfNames
,
7862 HTMLFiltersCollection_Invoke
,
7863 HTMLFiltersCollection_get_length
,
7864 HTMLFiltersCollection_get__newEnum
,
7865 HTMLFiltersCollection_item
7868 static HRESULT
HTMLFiltersCollection_get_dispid(DispatchEx
*dispex
, BSTR name
, DWORD flags
, DISPID
*dispid
)
7873 for(ptr
= name
; *ptr
&& is_digit(*ptr
); ptr
++)
7874 idx
= idx
*10 + (*ptr
-'0');
7876 return DISP_E_UNKNOWNNAME
;
7878 *dispid
= MSHTML_DISPID_CUSTOM_MIN
+ idx
;
7879 TRACE("ret %lx\n", *dispid
);
7883 static HRESULT
HTMLFiltersCollection_get_name(DispatchEx
*dispex
, DISPID id
, BSTR
*name
)
7885 DWORD idx
= id
- MSHTML_DISPID_CUSTOM_MIN
;
7889 len
= swprintf(buf
, ARRAY_SIZE(buf
), L
"%u", idx
);
7890 return (*name
= SysAllocStringLen(buf
, len
)) ? S_OK
: E_OUTOFMEMORY
;
7893 static HRESULT
HTMLFiltersCollection_invoke(DispatchEx
*dispex
, DISPID id
, LCID lcid
, WORD flags
, DISPPARAMS
*params
,
7894 VARIANT
*res
, EXCEPINFO
*ei
, IServiceProvider
*caller
)
7896 TRACE("(%p)->(%lx %lx %x %p %p %p)\n", dispex
, id
, lcid
, flags
, params
, res
, ei
);
7898 V_VT(res
) = VT_DISPATCH
;
7899 V_DISPATCH(res
) = NULL
;
7901 FIXME("always returning NULL\n");
7906 static const dispex_static_data_vtbl_t HTMLFiltersCollection_dispex_vtbl
= {
7908 HTMLFiltersCollection_get_dispid
,
7909 HTMLFiltersCollection_get_name
,
7910 HTMLFiltersCollection_invoke
,
7914 static const tid_t HTMLFiltersCollection_iface_tids
[] = {
7915 IHTMLFiltersCollection_tid
,
7918 static dispex_static_data_t HTMLFiltersCollection_dispex
= {
7919 L
"FiltersCollection",
7920 &HTMLFiltersCollection_dispex_vtbl
,
7921 IHTMLFiltersCollection_tid
,
7922 HTMLFiltersCollection_iface_tids
7925 static HRESULT
create_filters_collection(compat_mode_t compat_mode
, IHTMLFiltersCollection
**ret
)
7927 HTMLFiltersCollection
*collection
;
7929 if(!(collection
= heap_alloc(sizeof(HTMLFiltersCollection
))))
7930 return E_OUTOFMEMORY
;
7932 collection
->IHTMLFiltersCollection_iface
.lpVtbl
= &HTMLFiltersCollectionVtbl
;
7933 collection
->ref
= 1;
7935 init_dispatch(&collection
->dispex
, (IUnknown
*)&collection
->IHTMLFiltersCollection_iface
,
7936 &HTMLFiltersCollection_dispex
, min(compat_mode
, COMPAT_MODE_IE8
));
7938 *ret
= &collection
->IHTMLFiltersCollection_iface
;
7942 static HRESULT
get_attr_dispid_by_relative_idx(HTMLAttributeCollection
*This
, LONG
*idx
, DISPID start
, DISPID
*dispid
)
7944 IDispatchEx
*dispex
= &This
->elem
->node
.event_target
.dispex
.IDispatchEx_iface
;
7949 FIXME("filter non-enumerable attributes out\n");
7952 hres
= IDispatchEx_GetNextDispID(dispex
, fdexEnumAll
, id
, &id
);
7955 else if(hres
== S_FALSE
)
7965 return *idx
==len
? S_OK
: DISP_E_UNKNOWNNAME
;
7972 static HRESULT
get_attr_dispid_by_idx(HTMLAttributeCollection
*This
, LONG
*idx
, DISPID
*dispid
)
7974 return get_attr_dispid_by_relative_idx(This
, idx
, DISPID_STARTENUM
, dispid
);
7977 static inline HRESULT
get_attr_dispid_by_name(HTMLAttributeCollection
*This
, BSTR name
, DISPID
*id
)
7981 if(name
[0]>='0' && name
[0]<='9') {
7985 idx
= wcstoul(name
, &end_ptr
, 10);
7987 hres
= get_attr_dispid_by_idx(This
, &idx
, id
);
7994 WARN("NULL elem\n");
7995 return E_UNEXPECTED
;
7998 hres
= IDispatchEx_GetDispID(&This
->elem
->node
.event_target
.dispex
.IDispatchEx_iface
,
7999 name
, fdexNameCaseInsensitive
, id
);
8003 static inline HRESULT
get_domattr(HTMLAttributeCollection
*This
, DISPID id
, LONG
*list_pos
, HTMLDOMAttribute
**attr
)
8005 HTMLDOMAttribute
*iter
;
8010 LIST_FOR_EACH_ENTRY(iter
, &This
->attrs
, HTMLDOMAttribute
, entry
) {
8011 if(iter
->dispid
== id
) {
8020 WARN("NULL elem\n");
8021 return E_UNEXPECTED
;
8024 hres
= HTMLDOMAttribute_Create(NULL
, This
->elem
, id
, dispex_compat_mode(&This
->elem
->node
.event_target
.dispex
), attr
);
8029 IHTMLDOMAttribute_AddRef(&(*attr
)->IHTMLDOMAttribute_iface
);
8036 IEnumVARIANT IEnumVARIANT_iface
;
8042 HTMLAttributeCollection
*col
;
8043 } HTMLAttributeCollectionEnum
;
8045 static inline HTMLAttributeCollectionEnum
*HTMLAttributeCollectionEnum_from_IEnumVARIANT(IEnumVARIANT
*iface
)
8047 return CONTAINING_RECORD(iface
, HTMLAttributeCollectionEnum
, IEnumVARIANT_iface
);
8050 static HRESULT WINAPI
HTMLAttributeCollectionEnum_QueryInterface(IEnumVARIANT
*iface
, REFIID riid
, void **ppv
)
8052 HTMLAttributeCollectionEnum
*This
= HTMLAttributeCollectionEnum_from_IEnumVARIANT(iface
);
8054 TRACE("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
8056 if(IsEqualGUID(riid
, &IID_IUnknown
)) {
8057 *ppv
= &This
->IEnumVARIANT_iface
;
8058 }else if(IsEqualGUID(riid
, &IID_IEnumVARIANT
)) {
8059 *ppv
= &This
->IEnumVARIANT_iface
;
8061 FIXME("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
8063 return E_NOINTERFACE
;
8066 IUnknown_AddRef((IUnknown
*)*ppv
);
8070 static ULONG WINAPI
HTMLAttributeCollectionEnum_AddRef(IEnumVARIANT
*iface
)
8072 HTMLAttributeCollectionEnum
*This
= HTMLAttributeCollectionEnum_from_IEnumVARIANT(iface
);
8073 LONG ref
= InterlockedIncrement(&This
->ref
);
8075 TRACE("(%p) ref=%ld\n", This
, ref
);
8080 static ULONG WINAPI
HTMLAttributeCollectionEnum_Release(IEnumVARIANT
*iface
)
8082 HTMLAttributeCollectionEnum
*This
= HTMLAttributeCollectionEnum_from_IEnumVARIANT(iface
);
8083 LONG ref
= InterlockedDecrement(&This
->ref
);
8085 TRACE("(%p) ref=%ld\n", This
, ref
);
8088 IHTMLAttributeCollection_Release(&This
->col
->IHTMLAttributeCollection_iface
);
8095 static HRESULT WINAPI
HTMLAttributeCollectionEnum_Next(IEnumVARIANT
*iface
, ULONG celt
, VARIANT
*rgVar
, ULONG
*pCeltFetched
)
8097 HTMLAttributeCollectionEnum
*This
= HTMLAttributeCollectionEnum_from_IEnumVARIANT(iface
);
8098 DISPID tmp
, dispid
= This
->iter_dispid
;
8099 HTMLDOMAttribute
*attr
;
8104 TRACE("(%p)->(%lu %p %p)\n", This
, celt
, rgVar
, pCeltFetched
);
8106 for(i
= 0; i
< celt
; i
++) {
8107 hres
= get_attr_dispid_by_relative_idx(This
->col
, &rel_index
, dispid
, &tmp
);
8108 if(SUCCEEDED(hres
)) {
8110 hres
= get_domattr(This
->col
, dispid
, NULL
, &attr
);
8112 else if(hres
== DISP_E_UNKNOWNNAME
)
8117 VariantClear(&rgVar
[i
]);
8121 V_VT(&rgVar
[i
]) = VT_DISPATCH
;
8122 V_DISPATCH(&rgVar
[i
]) = (IDispatch
*)&attr
->IHTMLDOMAttribute_iface
;
8126 This
->iter_dispid
= dispid
;
8129 return i
== celt
? S_OK
: S_FALSE
;
8132 static HRESULT WINAPI
HTMLAttributeCollectionEnum_Skip(IEnumVARIANT
*iface
, ULONG celt
)
8134 HTMLAttributeCollectionEnum
*This
= HTMLAttributeCollectionEnum_from_IEnumVARIANT(iface
);
8135 LONG remaining
, rel_index
;
8139 TRACE("(%p)->(%lu)\n", This
, celt
);
8145 hres
= get_attr_dispid_by_relative_idx(This
->col
, &rel_index
, This
->iter_dispid
, NULL
);
8148 remaining
= min(celt
, rel_index
);
8151 rel_index
= remaining
- 1;
8152 hres
= get_attr_dispid_by_relative_idx(This
->col
, &rel_index
, This
->iter_dispid
, &dispid
);
8155 This
->iter
+= remaining
;
8156 This
->iter_dispid
= dispid
;
8158 return celt
> remaining
? S_FALSE
: S_OK
;
8161 static HRESULT WINAPI
HTMLAttributeCollectionEnum_Reset(IEnumVARIANT
*iface
)
8163 HTMLAttributeCollectionEnum
*This
= HTMLAttributeCollectionEnum_from_IEnumVARIANT(iface
);
8165 TRACE("(%p)->()\n", This
);
8168 This
->iter_dispid
= DISPID_STARTENUM
;
8172 static HRESULT WINAPI
HTMLAttributeCollectionEnum_Clone(IEnumVARIANT
*iface
, IEnumVARIANT
**ppEnum
)
8174 HTMLAttributeCollectionEnum
*This
= HTMLAttributeCollectionEnum_from_IEnumVARIANT(iface
);
8175 FIXME("(%p)->(%p)\n", This
, ppEnum
);
8179 static const IEnumVARIANTVtbl HTMLAttributeCollectionEnumVtbl
= {
8180 HTMLAttributeCollectionEnum_QueryInterface
,
8181 HTMLAttributeCollectionEnum_AddRef
,
8182 HTMLAttributeCollectionEnum_Release
,
8183 HTMLAttributeCollectionEnum_Next
,
8184 HTMLAttributeCollectionEnum_Skip
,
8185 HTMLAttributeCollectionEnum_Reset
,
8186 HTMLAttributeCollectionEnum_Clone
8189 /* interface IHTMLAttributeCollection */
8190 static inline HTMLAttributeCollection
*impl_from_IHTMLAttributeCollection(IHTMLAttributeCollection
*iface
)
8192 return CONTAINING_RECORD(iface
, HTMLAttributeCollection
, IHTMLAttributeCollection_iface
);
8195 static HRESULT WINAPI
HTMLAttributeCollection_QueryInterface(IHTMLAttributeCollection
*iface
, REFIID riid
, void **ppv
)
8197 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection(iface
);
8199 TRACE("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
8201 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
8202 *ppv
= &This
->IHTMLAttributeCollection_iface
;
8203 }else if(IsEqualGUID(&IID_IHTMLAttributeCollection
, riid
)) {
8204 *ppv
= &This
->IHTMLAttributeCollection_iface
;
8205 }else if(IsEqualGUID(&IID_IHTMLAttributeCollection2
, riid
)) {
8206 *ppv
= &This
->IHTMLAttributeCollection2_iface
;
8207 }else if(IsEqualGUID(&IID_IHTMLAttributeCollection3
, riid
)) {
8208 *ppv
= &This
->IHTMLAttributeCollection3_iface
;
8209 }else if(dispex_query_interface(&This
->dispex
, riid
, ppv
)) {
8210 return *ppv
? S_OK
: E_NOINTERFACE
;
8213 WARN("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
8214 return E_NOINTERFACE
;
8217 IUnknown_AddRef((IUnknown
*)*ppv
);
8221 static ULONG WINAPI
HTMLAttributeCollection_AddRef(IHTMLAttributeCollection
*iface
)
8223 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection(iface
);
8224 LONG ref
= InterlockedIncrement(&This
->ref
);
8226 TRACE("(%p) ref=%ld\n", This
, ref
);
8231 static ULONG WINAPI
HTMLAttributeCollection_Release(IHTMLAttributeCollection
*iface
)
8233 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection(iface
);
8234 LONG ref
= InterlockedDecrement(&This
->ref
);
8236 TRACE("(%p) ref=%ld\n", This
, ref
);
8239 while(!list_empty(&This
->attrs
)) {
8240 HTMLDOMAttribute
*attr
= LIST_ENTRY(list_head(&This
->attrs
), HTMLDOMAttribute
, entry
);
8242 list_remove(&attr
->entry
);
8244 IHTMLDOMAttribute_Release(&attr
->IHTMLDOMAttribute_iface
);
8253 static HRESULT WINAPI
HTMLAttributeCollection_GetTypeInfoCount(IHTMLAttributeCollection
*iface
, UINT
*pctinfo
)
8255 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection(iface
);
8256 return IDispatchEx_GetTypeInfoCount(&This
->dispex
.IDispatchEx_iface
, pctinfo
);
8259 static HRESULT WINAPI
HTMLAttributeCollection_GetTypeInfo(IHTMLAttributeCollection
*iface
, UINT iTInfo
,
8260 LCID lcid
, ITypeInfo
**ppTInfo
)
8262 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection(iface
);
8263 return IDispatchEx_GetTypeInfo(&This
->dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
8266 static HRESULT WINAPI
HTMLAttributeCollection_GetIDsOfNames(IHTMLAttributeCollection
*iface
, REFIID riid
,
8267 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
8269 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection(iface
);
8270 return IDispatchEx_GetIDsOfNames(&This
->dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
8274 static HRESULT WINAPI
HTMLAttributeCollection_Invoke(IHTMLAttributeCollection
*iface
, DISPID dispIdMember
,
8275 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
8276 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
8278 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection(iface
);
8279 return IDispatchEx_Invoke(&This
->dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
8280 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
8283 static HRESULT WINAPI
HTMLAttributeCollection_get_length(IHTMLAttributeCollection
*iface
, LONG
*p
)
8285 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection(iface
);
8288 TRACE("(%p)->(%p)\n", This
, p
);
8291 hres
= get_attr_dispid_by_idx(This
, p
, NULL
);
8295 static HRESULT WINAPI
HTMLAttributeCollection__newEnum(IHTMLAttributeCollection
*iface
, IUnknown
**p
)
8297 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection(iface
);
8298 HTMLAttributeCollectionEnum
*ret
;
8300 TRACE("(%p)->(%p)\n", This
, p
);
8302 ret
= heap_alloc(sizeof(*ret
));
8304 return E_OUTOFMEMORY
;
8306 ret
->IEnumVARIANT_iface
.lpVtbl
= &HTMLAttributeCollectionEnumVtbl
;
8309 ret
->iter_dispid
= DISPID_STARTENUM
;
8311 HTMLAttributeCollection_AddRef(&This
->IHTMLAttributeCollection_iface
);
8314 *p
= (IUnknown
*)&ret
->IEnumVARIANT_iface
;
8318 static HRESULT WINAPI
HTMLAttributeCollection_item(IHTMLAttributeCollection
*iface
, VARIANT
*name
, IDispatch
**ppItem
)
8320 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection(iface
);
8321 HTMLDOMAttribute
*attr
;
8325 TRACE("(%p)->(%s %p)\n", This
, debugstr_variant(name
), ppItem
);
8327 switch(V_VT(name
)) {
8329 hres
= get_attr_dispid_by_idx(This
, &V_I4(name
), &id
);
8332 hres
= get_attr_dispid_by_name(This
, V_BSTR(name
), &id
);
8335 FIXME("unsupported name %s\n", debugstr_variant(name
));
8338 if(hres
== DISP_E_UNKNOWNNAME
)
8339 return E_INVALIDARG
;
8343 hres
= get_domattr(This
, id
, NULL
, &attr
);
8347 *ppItem
= (IDispatch
*)&attr
->IHTMLDOMAttribute_iface
;
8351 static const IHTMLAttributeCollectionVtbl HTMLAttributeCollectionVtbl
= {
8352 HTMLAttributeCollection_QueryInterface
,
8353 HTMLAttributeCollection_AddRef
,
8354 HTMLAttributeCollection_Release
,
8355 HTMLAttributeCollection_GetTypeInfoCount
,
8356 HTMLAttributeCollection_GetTypeInfo
,
8357 HTMLAttributeCollection_GetIDsOfNames
,
8358 HTMLAttributeCollection_Invoke
,
8359 HTMLAttributeCollection_get_length
,
8360 HTMLAttributeCollection__newEnum
,
8361 HTMLAttributeCollection_item
8364 static inline HTMLAttributeCollection
*impl_from_IHTMLAttributeCollection2(IHTMLAttributeCollection2
*iface
)
8366 return CONTAINING_RECORD(iface
, HTMLAttributeCollection
, IHTMLAttributeCollection2_iface
);
8369 static HRESULT WINAPI
HTMLAttributeCollection2_QueryInterface(IHTMLAttributeCollection2
*iface
, REFIID riid
, void **ppv
)
8371 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection2(iface
);
8372 return IHTMLAttributeCollection_QueryInterface(&This
->IHTMLAttributeCollection_iface
, riid
, ppv
);
8375 static ULONG WINAPI
HTMLAttributeCollection2_AddRef(IHTMLAttributeCollection2
*iface
)
8377 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection2(iface
);
8378 return IHTMLAttributeCollection_AddRef(&This
->IHTMLAttributeCollection_iface
);
8381 static ULONG WINAPI
HTMLAttributeCollection2_Release(IHTMLAttributeCollection2
*iface
)
8383 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection2(iface
);
8384 return IHTMLAttributeCollection_Release(&This
->IHTMLAttributeCollection_iface
);
8387 static HRESULT WINAPI
HTMLAttributeCollection2_GetTypeInfoCount(IHTMLAttributeCollection2
*iface
, UINT
*pctinfo
)
8389 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection2(iface
);
8390 return IDispatchEx_GetTypeInfoCount(&This
->dispex
.IDispatchEx_iface
, pctinfo
);
8393 static HRESULT WINAPI
HTMLAttributeCollection2_GetTypeInfo(IHTMLAttributeCollection2
*iface
, UINT iTInfo
,
8394 LCID lcid
, ITypeInfo
**ppTInfo
)
8396 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection2(iface
);
8397 return IDispatchEx_GetTypeInfo(&This
->dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
8400 static HRESULT WINAPI
HTMLAttributeCollection2_GetIDsOfNames(IHTMLAttributeCollection2
*iface
, REFIID riid
,
8401 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
8403 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection2(iface
);
8404 return IDispatchEx_GetIDsOfNames(&This
->dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
8408 static HRESULT WINAPI
HTMLAttributeCollection2_Invoke(IHTMLAttributeCollection2
*iface
, DISPID dispIdMember
,
8409 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
8410 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
8412 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection2(iface
);
8413 return IDispatchEx_Invoke(&This
->dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
8414 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
8417 static HRESULT WINAPI
HTMLAttributeCollection2_getNamedItem(IHTMLAttributeCollection2
*iface
, BSTR bstrName
,
8418 IHTMLDOMAttribute
**newretNode
)
8420 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection2(iface
);
8421 HTMLDOMAttribute
*attr
;
8425 TRACE("(%p)->(%s %p)\n", This
, debugstr_w(bstrName
), newretNode
);
8427 hres
= get_attr_dispid_by_name(This
, bstrName
, &id
);
8428 if(hres
== DISP_E_UNKNOWNNAME
) {
8431 } else if(FAILED(hres
)) {
8435 hres
= get_domattr(This
, id
, NULL
, &attr
);
8439 *newretNode
= &attr
->IHTMLDOMAttribute_iface
;
8443 static HRESULT WINAPI
HTMLAttributeCollection2_setNamedItem(IHTMLAttributeCollection2
*iface
,
8444 IHTMLDOMAttribute
*ppNode
, IHTMLDOMAttribute
**newretNode
)
8446 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection2(iface
);
8447 FIXME("(%p)->(%p %p)\n", This
, ppNode
, newretNode
);
8451 static HRESULT WINAPI
HTMLAttributeCollection2_removeNamedItem(IHTMLAttributeCollection2
*iface
,
8452 BSTR bstrName
, IHTMLDOMAttribute
**newretNode
)
8454 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection2(iface
);
8455 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(bstrName
), newretNode
);
8459 static const IHTMLAttributeCollection2Vtbl HTMLAttributeCollection2Vtbl
= {
8460 HTMLAttributeCollection2_QueryInterface
,
8461 HTMLAttributeCollection2_AddRef
,
8462 HTMLAttributeCollection2_Release
,
8463 HTMLAttributeCollection2_GetTypeInfoCount
,
8464 HTMLAttributeCollection2_GetTypeInfo
,
8465 HTMLAttributeCollection2_GetIDsOfNames
,
8466 HTMLAttributeCollection2_Invoke
,
8467 HTMLAttributeCollection2_getNamedItem
,
8468 HTMLAttributeCollection2_setNamedItem
,
8469 HTMLAttributeCollection2_removeNamedItem
8472 static inline HTMLAttributeCollection
*impl_from_IHTMLAttributeCollection3(IHTMLAttributeCollection3
*iface
)
8474 return CONTAINING_RECORD(iface
, HTMLAttributeCollection
, IHTMLAttributeCollection3_iface
);
8477 static HRESULT WINAPI
HTMLAttributeCollection3_QueryInterface(IHTMLAttributeCollection3
*iface
, REFIID riid
, void **ppv
)
8479 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection3(iface
);
8480 return IHTMLAttributeCollection_QueryInterface(&This
->IHTMLAttributeCollection_iface
, riid
, ppv
);
8483 static ULONG WINAPI
HTMLAttributeCollection3_AddRef(IHTMLAttributeCollection3
*iface
)
8485 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection3(iface
);
8486 return IHTMLAttributeCollection_AddRef(&This
->IHTMLAttributeCollection_iface
);
8489 static ULONG WINAPI
HTMLAttributeCollection3_Release(IHTMLAttributeCollection3
*iface
)
8491 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection3(iface
);
8492 return IHTMLAttributeCollection_Release(&This
->IHTMLAttributeCollection_iface
);
8495 static HRESULT WINAPI
HTMLAttributeCollection3_GetTypeInfoCount(IHTMLAttributeCollection3
*iface
, UINT
*pctinfo
)
8497 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection3(iface
);
8498 return IDispatchEx_GetTypeInfoCount(&This
->dispex
.IDispatchEx_iface
, pctinfo
);
8501 static HRESULT WINAPI
HTMLAttributeCollection3_GetTypeInfo(IHTMLAttributeCollection3
*iface
, UINT iTInfo
,
8502 LCID lcid
, ITypeInfo
**ppTInfo
)
8504 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection3(iface
);
8505 return IDispatchEx_GetTypeInfo(&This
->dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
8508 static HRESULT WINAPI
HTMLAttributeCollection3_GetIDsOfNames(IHTMLAttributeCollection3
*iface
, REFIID riid
,
8509 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
8511 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection3(iface
);
8512 return IDispatchEx_GetIDsOfNames(&This
->dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
8516 static HRESULT WINAPI
HTMLAttributeCollection3_Invoke(IHTMLAttributeCollection3
*iface
, DISPID dispIdMember
,
8517 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
8518 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
8520 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection3(iface
);
8521 return IDispatchEx_Invoke(&This
->dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
8522 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
8525 static HRESULT WINAPI
HTMLAttributeCollection3_getNamedItem(IHTMLAttributeCollection3
*iface
, BSTR bstrName
,
8526 IHTMLDOMAttribute
**ppNodeOut
)
8528 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection3(iface
);
8529 return IHTMLAttributeCollection2_getNamedItem(&This
->IHTMLAttributeCollection2_iface
, bstrName
, ppNodeOut
);
8532 static HRESULT WINAPI
HTMLAttributeCollection3_setNamedItem(IHTMLAttributeCollection3
*iface
,
8533 IHTMLDOMAttribute
*pNodeIn
, IHTMLDOMAttribute
**ppNodeOut
)
8535 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection3(iface
);
8536 FIXME("(%p)->(%p %p)\n", This
, pNodeIn
, ppNodeOut
);
8540 static HRESULT WINAPI
HTMLAttributeCollection3_removeNamedItem(IHTMLAttributeCollection3
*iface
,
8541 BSTR bstrName
, IHTMLDOMAttribute
**ppNodeOut
)
8543 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection3(iface
);
8544 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(bstrName
), ppNodeOut
);
8548 static HRESULT WINAPI
HTMLAttributeCollection3_item(IHTMLAttributeCollection3
*iface
, LONG index
, IHTMLDOMAttribute
**ppNodeOut
)
8550 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection3(iface
);
8551 HTMLDOMAttribute
*attr
;
8555 TRACE("(%p)->(%ld %p)\n", This
, index
, ppNodeOut
);
8557 hres
= get_attr_dispid_by_idx(This
, &index
, &id
);
8558 if(hres
== DISP_E_UNKNOWNNAME
)
8559 return E_INVALIDARG
;
8563 hres
= get_domattr(This
, id
, NULL
, &attr
);
8567 *ppNodeOut
= &attr
->IHTMLDOMAttribute_iface
;
8571 static HRESULT WINAPI
HTMLAttributeCollection3_get_length(IHTMLAttributeCollection3
*iface
, LONG
*p
)
8573 HTMLAttributeCollection
*This
= impl_from_IHTMLAttributeCollection3(iface
);
8574 return IHTMLAttributeCollection_get_length(&This
->IHTMLAttributeCollection_iface
, p
);
8577 static const IHTMLAttributeCollection3Vtbl HTMLAttributeCollection3Vtbl
= {
8578 HTMLAttributeCollection3_QueryInterface
,
8579 HTMLAttributeCollection3_AddRef
,
8580 HTMLAttributeCollection3_Release
,
8581 HTMLAttributeCollection3_GetTypeInfoCount
,
8582 HTMLAttributeCollection3_GetTypeInfo
,
8583 HTMLAttributeCollection3_GetIDsOfNames
,
8584 HTMLAttributeCollection3_Invoke
,
8585 HTMLAttributeCollection3_getNamedItem
,
8586 HTMLAttributeCollection3_setNamedItem
,
8587 HTMLAttributeCollection3_removeNamedItem
,
8588 HTMLAttributeCollection3_item
,
8589 HTMLAttributeCollection3_get_length
8592 static inline HTMLAttributeCollection
*HTMLAttributeCollection_from_DispatchEx(DispatchEx
*iface
)
8594 return CONTAINING_RECORD(iface
, HTMLAttributeCollection
, dispex
);
8597 static HRESULT
HTMLAttributeCollection_get_dispid(DispatchEx
*dispex
, BSTR name
, DWORD flags
, DISPID
*dispid
)
8599 HTMLAttributeCollection
*This
= HTMLAttributeCollection_from_DispatchEx(dispex
);
8600 HTMLDOMAttribute
*attr
;
8604 TRACE("(%p)->(%s %lx %p)\n", This
, debugstr_w(name
), flags
, dispid
);
8606 hres
= get_attr_dispid_by_name(This
, name
, dispid
);
8610 hres
= get_domattr(This
, *dispid
, &pos
, &attr
);
8613 IHTMLDOMAttribute_Release(&attr
->IHTMLDOMAttribute_iface
);
8615 *dispid
= MSHTML_DISPID_CUSTOM_MIN
+pos
;
8619 static HRESULT
HTMLAttributeCollection_get_name(DispatchEx
*dispex
, DISPID id
, BSTR
*name
)
8621 HTMLAttributeCollection
*This
= HTMLAttributeCollection_from_DispatchEx(dispex
);
8623 FIXME("(%p)->(%lx %p)\n", This
, id
, name
);
8628 static HRESULT
HTMLAttributeCollection_invoke(DispatchEx
*dispex
, DISPID id
, LCID lcid
,
8629 WORD flags
, DISPPARAMS
*params
, VARIANT
*res
, EXCEPINFO
*ei
, IServiceProvider
*caller
)
8631 HTMLAttributeCollection
*This
= HTMLAttributeCollection_from_DispatchEx(dispex
);
8633 TRACE("(%p)->(%lx %lx %x %p %p %p %p)\n", This
, id
, lcid
, flags
, params
, res
, ei
, caller
);
8636 case DISPATCH_PROPERTYGET
: {
8637 HTMLDOMAttribute
*iter
;
8640 pos
= id
-MSHTML_DISPID_CUSTOM_MIN
;
8642 LIST_FOR_EACH_ENTRY(iter
, &This
->attrs
, HTMLDOMAttribute
, entry
) {
8644 IHTMLDOMAttribute_AddRef(&iter
->IHTMLDOMAttribute_iface
);
8645 V_VT(res
) = VT_DISPATCH
;
8646 V_DISPATCH(res
) = (IDispatch
*)&iter
->IHTMLDOMAttribute_iface
;
8652 WARN("invalid arg\n");
8653 return E_INVALIDARG
;
8657 FIXME("unimplemented flags %x\n", flags
);
8662 static const dispex_static_data_vtbl_t HTMLAttributeCollection_dispex_vtbl
= {
8664 HTMLAttributeCollection_get_dispid
,
8665 HTMLAttributeCollection_get_name
,
8666 HTMLAttributeCollection_invoke
,
8670 static const tid_t HTMLAttributeCollection_iface_tids
[] = {
8671 IHTMLAttributeCollection_tid
,
8672 IHTMLAttributeCollection2_tid
,
8673 IHTMLAttributeCollection3_tid
,
8677 static dispex_static_data_t HTMLAttributeCollection_dispex
= {
8679 &HTMLAttributeCollection_dispex_vtbl
,
8680 DispHTMLAttributeCollection_tid
,
8681 HTMLAttributeCollection_iface_tids
8684 HRESULT
HTMLElement_get_attr_col(HTMLDOMNode
*iface
, HTMLAttributeCollection
**ac
)
8686 HTMLElement
*This
= impl_from_HTMLDOMNode(iface
);
8689 IHTMLAttributeCollection_AddRef(&This
->attrs
->IHTMLAttributeCollection_iface
);
8694 This
->attrs
= heap_alloc_zero(sizeof(HTMLAttributeCollection
));
8696 return E_OUTOFMEMORY
;
8698 This
->attrs
->IHTMLAttributeCollection_iface
.lpVtbl
= &HTMLAttributeCollectionVtbl
;
8699 This
->attrs
->IHTMLAttributeCollection2_iface
.lpVtbl
= &HTMLAttributeCollection2Vtbl
;
8700 This
->attrs
->IHTMLAttributeCollection3_iface
.lpVtbl
= &HTMLAttributeCollection3Vtbl
;
8701 This
->attrs
->ref
= 2;
8703 This
->attrs
->elem
= This
;
8704 list_init(&This
->attrs
->attrs
);
8705 init_dispatch(&This
->attrs
->dispex
, (IUnknown
*)&This
->attrs
->IHTMLAttributeCollection_iface
,
8706 &HTMLAttributeCollection_dispex
, dispex_compat_mode(&iface
->event_target
.dispex
));