2 * Copyright 2006 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
32 #include "wine/debug.h"
33 #include "wine/unicode.h"
35 #include "mshtml_private.h"
37 WINE_DEFAULT_DEBUG_CHANNEL(mshtml
);
39 static HRESULT
HTMLElementCollection_Create(IUnknown
*,HTMLElement
**,DWORD
,IDispatch
**);
41 #define HTMLELEM_THIS(iface) DEFINE_THIS(HTMLElement, HTMLElement, iface)
43 static HRESULT WINAPI
HTMLElement_QueryInterface(IHTMLElement
*iface
,
44 REFIID riid
, void **ppv
)
46 HTMLElement
*This
= HTMLELEM_THIS(iface
);
49 return IUnknown_QueryInterface(This
->impl
, riid
, ppv
);
53 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
54 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppv
);
55 *ppv
= HTMLELEM(This
);
56 }else if(IsEqualGUID(&IID_IDispatch
, riid
)) {
57 TRACE("(%p)->(IID_IDispatch %p)\n", This
, ppv
);
58 *ppv
= HTMLELEM(This
);
59 }else if(IsEqualGUID(&IID_IHTMLDOMNode
, riid
)) {
60 TRACE("(%p)->(IID_IHTMLDOMNode %p)\n", This
, ppv
);
61 *ppv
= HTMLDOMNODE(This
->node
);
62 }else if(IsEqualGUID(&IID_IHTMLElement
, riid
)) {
63 TRACE("(%p)->(IID_IHTMLElement %p)\n", This
, ppv
);
64 *ppv
= HTMLELEM(This
);
68 IHTMLElement_AddRef(HTMLELEM(This
));
72 FIXME("(%p)->(%s %p)\n", This
, debugstr_guid(riid
), ppv
);
76 static ULONG WINAPI
HTMLElement_AddRef(IHTMLElement
*iface
)
78 HTMLElement
*This
= HTMLELEM_THIS(iface
);
81 return IUnknown_AddRef(This
->impl
);
83 TRACE("(%p)\n", This
);
84 return IHTMLDocument2_AddRef(HTMLDOC(This
->node
->doc
));
87 static ULONG WINAPI
HTMLElement_Release(IHTMLElement
*iface
)
89 HTMLElement
*This
= HTMLELEM_THIS(iface
);
92 return IUnknown_Release(This
->impl
);
94 TRACE("(%p)\n", This
);
95 return IHTMLDocument2_Release(HTMLDOC(This
->node
->doc
));
98 static HRESULT WINAPI
HTMLElement_GetTypeInfoCount(IHTMLElement
*iface
, UINT
*pctinfo
)
100 HTMLElement
*This
= HTMLELEM_THIS(iface
);
101 FIXME("(%p)->(%p)\n", This
, pctinfo
);
105 static HRESULT WINAPI
HTMLElement_GetTypeInfo(IHTMLElement
*iface
, UINT iTInfo
,
106 LCID lcid
, ITypeInfo
**ppTInfo
)
108 HTMLElement
*This
= HTMLELEM_THIS(iface
);
109 FIXME("(%p)->(%u %lu %p)\n", This
, iTInfo
, lcid
, ppTInfo
);
113 static HRESULT WINAPI
HTMLElement_GetIDsOfNames(IHTMLElement
*iface
, REFIID riid
,
114 LPOLESTR
*rgszNames
, UINT cNames
,
115 LCID lcid
, DISPID
*rgDispId
)
117 HTMLElement
*This
= HTMLELEM_THIS(iface
);
118 FIXME("(%p)->(%s %p %u %lu %p)\n", This
, debugstr_guid(riid
), rgszNames
, cNames
,
123 static HRESULT WINAPI
HTMLElement_Invoke(IHTMLElement
*iface
, DISPID dispIdMember
,
124 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
125 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
127 HTMLElement
*This
= HTMLELEM_THIS(iface
);
128 FIXME("(%p)->(%ld %s %ld %d %p %p %p %p)\n", This
, dispIdMember
, debugstr_guid(riid
),
129 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
133 static HRESULT WINAPI
HTMLElement_setAttribute(IHTMLElement
*iface
, BSTR strAttributeName
,
134 VARIANT AttributeValue
, LONG lFlags
)
136 HTMLElement
*This
= HTMLELEM_THIS(iface
);
137 FIXME("(%p)->(%s . %08lx)\n", This
, debugstr_w(strAttributeName
), lFlags
);
141 static HRESULT WINAPI
HTMLElement_getAttribute(IHTMLElement
*iface
, BSTR strAttributeName
,
142 LONG lFlags
, VARIANT
*AttributeValue
)
144 HTMLElement
*This
= HTMLELEM_THIS(iface
);
145 FIXME("(%p)->(%s %08lx %p)\n", This
, debugstr_w(strAttributeName
), lFlags
,
150 static HRESULT WINAPI
HTMLElement_removeAttribute(IHTMLElement
*iface
, BSTR strAttributeName
,
151 LONG lFlags
, VARIANT_BOOL
*pfSuccess
)
153 HTMLElement
*This
= HTMLELEM_THIS(iface
);
154 FIXME("(%p)->()\n", This
);
158 static HRESULT WINAPI
HTMLElement_put_className(IHTMLElement
*iface
, BSTR v
)
160 HTMLElement
*This
= HTMLELEM_THIS(iface
);
161 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
165 static HRESULT WINAPI
HTMLElement_get_className(IHTMLElement
*iface
, BSTR
*p
)
167 HTMLElement
*This
= HTMLELEM_THIS(iface
);
168 FIXME("(%p)->(%p)\n", This
, p
);
172 static HRESULT WINAPI
HTMLElement_put_id(IHTMLElement
*iface
, BSTR v
)
174 HTMLElement
*This
= HTMLELEM_THIS(iface
);
175 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
179 static HRESULT WINAPI
HTMLElement_get_id(IHTMLElement
*iface
, BSTR
*p
)
181 HTMLElement
*This
= HTMLELEM_THIS(iface
);
182 FIXME("(%p)->(%p)\n", This
, p
);
186 static HRESULT WINAPI
HTMLElement_get_tagName(IHTMLElement
*iface
, BSTR
*p
)
188 HTMLElement
*This
= HTMLELEM_THIS(iface
);
189 FIXME("(%p)->(%p)\n", This
, p
);
193 static HRESULT WINAPI
HTMLElement_get_parentElement(IHTMLElement
*iface
, IHTMLElement
**p
)
195 HTMLElement
*This
= HTMLELEM_THIS(iface
);
196 FIXME("(%p)->(%p)\n", This
, p
);
200 static HRESULT WINAPI
HTMLElement_get_style(IHTMLElement
*iface
, IHTMLStyle
**p
)
202 HTMLElement
*This
= HTMLELEM_THIS(iface
);
203 FIXME("(%p)->(%p)\n", This
, p
);
207 static HRESULT WINAPI
HTMLElement_put_onhelp(IHTMLElement
*iface
, VARIANT v
)
209 HTMLElement
*This
= HTMLELEM_THIS(iface
);
210 FIXME("(%p)->()\n", This
);
214 static HRESULT WINAPI
HTMLElement_get_onhelp(IHTMLElement
*iface
, VARIANT
*p
)
216 HTMLElement
*This
= HTMLELEM_THIS(iface
);
217 FIXME("(%p)->(%p)\n", This
, p
);
221 static HRESULT WINAPI
HTMLElement_put_onclick(IHTMLElement
*iface
, VARIANT v
)
223 HTMLElement
*This
= HTMLELEM_THIS(iface
);
224 FIXME("(%p)->()\n", This
);
228 static HRESULT WINAPI
HTMLElement_get_onclick(IHTMLElement
*iface
, VARIANT
*p
)
230 HTMLElement
*This
= HTMLELEM_THIS(iface
);
231 FIXME("(%p)->(%p)\n", This
, p
);
235 static HRESULT WINAPI
HTMLElement_put_ondblclick(IHTMLElement
*iface
, VARIANT v
)
237 HTMLElement
*This
= HTMLELEM_THIS(iface
);
238 FIXME("(%p)->()\n", This
);
242 static HRESULT WINAPI
HTMLElement_get_ondblclick(IHTMLElement
*iface
, VARIANT
*p
)
244 HTMLElement
*This
= HTMLELEM_THIS(iface
);
245 FIXME("(%p)->(%p)\n", This
, p
);
249 static HRESULT WINAPI
HTMLElement_put_onkeydown(IHTMLElement
*iface
, VARIANT v
)
251 HTMLElement
*This
= HTMLELEM_THIS(iface
);
252 FIXME("(%p)->()\n", This
);
256 static HRESULT WINAPI
HTMLElement_get_onkeydown(IHTMLElement
*iface
, VARIANT
*p
)
258 HTMLElement
*This
= HTMLELEM_THIS(iface
);
259 FIXME("(%p)->(%p)\n", This
, p
);
263 static HRESULT WINAPI
HTMLElement_put_onkeyup(IHTMLElement
*iface
, VARIANT v
)
265 HTMLElement
*This
= HTMLELEM_THIS(iface
);
266 FIXME("(%p)->()\n", This
);
270 static HRESULT WINAPI
HTMLElement_get_onkeyup(IHTMLElement
*iface
, VARIANT
*p
)
272 HTMLElement
*This
= HTMLELEM_THIS(iface
);
273 FIXME("(%p)->(%p)\n", This
, p
);
277 static HRESULT WINAPI
HTMLElement_put_onkeypress(IHTMLElement
*iface
, VARIANT v
)
279 HTMLElement
*This
= HTMLELEM_THIS(iface
);
280 FIXME("(%p)->()\n", This
);
284 static HRESULT WINAPI
HTMLElement_get_onkeypress(IHTMLElement
*iface
, VARIANT
*p
)
286 HTMLElement
*This
= HTMLELEM_THIS(iface
);
287 FIXME("(%p)->(%p)\n", This
, p
);
291 static HRESULT WINAPI
HTMLElement_put_onmouseout(IHTMLElement
*iface
, VARIANT v
)
293 HTMLElement
*This
= HTMLELEM_THIS(iface
);
294 FIXME("(%p)->()\n", This
);
298 static HRESULT WINAPI
HTMLElement_get_onmouseout(IHTMLElement
*iface
, VARIANT
*p
)
300 HTMLElement
*This
= HTMLELEM_THIS(iface
);
301 FIXME("(%p)->(%p)\n", This
, p
);
305 static HRESULT WINAPI
HTMLElement_put_onmouseover(IHTMLElement
*iface
, VARIANT v
)
307 HTMLElement
*This
= HTMLELEM_THIS(iface
);
308 FIXME("(%p)->()\n", This
);
312 static HRESULT WINAPI
HTMLElement_get_onmouseover(IHTMLElement
*iface
, VARIANT
*p
)
314 HTMLElement
*This
= HTMLELEM_THIS(iface
);
315 FIXME("(%p)->(%p)\n", This
, p
);
319 static HRESULT WINAPI
HTMLElement_put_onmousemove(IHTMLElement
*iface
, VARIANT v
)
321 HTMLElement
*This
= HTMLELEM_THIS(iface
);
322 FIXME("(%p)->()\n", This
);
326 static HRESULT WINAPI
HTMLElement_get_onmousemove(IHTMLElement
*iface
, VARIANT
*p
)
328 HTMLElement
*This
= HTMLELEM_THIS(iface
);
329 FIXME("(%p)->(%p)\n", This
, p
);
333 static HRESULT WINAPI
HTMLElement_put_onmousedown(IHTMLElement
*iface
, VARIANT v
)
335 HTMLElement
*This
= HTMLELEM_THIS(iface
);
336 FIXME("(%p)->()\n", This
);
340 static HRESULT WINAPI
HTMLElement_get_onmousedown(IHTMLElement
*iface
, VARIANT
*p
)
342 HTMLElement
*This
= HTMLELEM_THIS(iface
);
343 FIXME("(%p)->(%p)\n", This
, p
);
347 static HRESULT WINAPI
HTMLElement_put_onmouseup(IHTMLElement
*iface
, VARIANT v
)
349 HTMLElement
*This
= HTMLELEM_THIS(iface
);
350 FIXME("(%p)->()\n", This
);
354 static HRESULT WINAPI
HTMLElement_get_onmouseup(IHTMLElement
*iface
, VARIANT
*p
)
356 HTMLElement
*This
= HTMLELEM_THIS(iface
);
357 FIXME("(%p)->(%p)\n", This
, p
);
361 static HRESULT WINAPI
HTMLElement_get_document(IHTMLElement
*iface
, IDispatch
**p
)
363 HTMLElement
*This
= HTMLELEM_THIS(iface
);
364 FIXME("(%p)->(%p)\n", This
, p
);
368 static HRESULT WINAPI
HTMLElement_put_title(IHTMLElement
*iface
, BSTR v
)
370 HTMLElement
*This
= HTMLELEM_THIS(iface
);
371 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
375 static HRESULT WINAPI
HTMLElement_get_title(IHTMLElement
*iface
, BSTR
*p
)
377 HTMLElement
*This
= HTMLELEM_THIS(iface
);
378 FIXME("(%p)->(%p)\n", This
, p
);
382 static HRESULT WINAPI
HTMLElement_put_language(IHTMLElement
*iface
, BSTR v
)
384 HTMLElement
*This
= HTMLELEM_THIS(iface
);
385 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
389 static HRESULT WINAPI
HTMLElement_get_language(IHTMLElement
*iface
, BSTR
*p
)
391 HTMLElement
*This
= HTMLELEM_THIS(iface
);
392 FIXME("(%p)->(%p)\n", This
, p
);
396 static HRESULT WINAPI
HTMLElement_put_onselectstart(IHTMLElement
*iface
, VARIANT v
)
398 HTMLElement
*This
= HTMLELEM_THIS(iface
);
399 FIXME("(%p)->()\n", This
);
403 static HRESULT WINAPI
HTMLElement_get_onselectstart(IHTMLElement
*iface
, VARIANT
*p
)
405 HTMLElement
*This
= HTMLELEM_THIS(iface
);
406 FIXME("(%p)->(%p)\n", This
, p
);
410 static HRESULT WINAPI
HTMLElement_scrollIntoView(IHTMLElement
*iface
, VARIANT varargStart
)
412 HTMLElement
*This
= HTMLELEM_THIS(iface
);
413 FIXME("(%p)->()\n", This
);
417 static HRESULT WINAPI
HTMLElement_contains(IHTMLElement
*iface
, IHTMLElement
*pChild
,
418 VARIANT_BOOL
*pfResult
)
420 HTMLElement
*This
= HTMLELEM_THIS(iface
);
421 FIXME("(%p)->(%p %p)\n", This
, pChild
, pfResult
);
425 static HRESULT WINAPI
HTMLElement_get_sourceIndex(IHTMLElement
*iface
, long *p
)
427 HTMLElement
*This
= HTMLELEM_THIS(iface
);
428 FIXME("(%p)->(%p)\n", This
, p
);
432 static HRESULT WINAPI
HTMLElement_get_recordNumber(IHTMLElement
*iface
, VARIANT
*p
)
434 HTMLElement
*This
= HTMLELEM_THIS(iface
);
435 FIXME("(%p)->(%p)\n", This
, p
);
439 static HRESULT WINAPI
HTMLElement_put_lang(IHTMLElement
*iface
, BSTR v
)
441 HTMLElement
*This
= HTMLELEM_THIS(iface
);
442 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
446 static HRESULT WINAPI
HTMLElement_get_lang(IHTMLElement
*iface
, BSTR
*p
)
448 HTMLElement
*This
= HTMLELEM_THIS(iface
);
449 FIXME("(%p)->(%p)\n", This
, p
);
453 static HRESULT WINAPI
HTMLElement_get_offsetLeft(IHTMLElement
*iface
, long *p
)
455 HTMLElement
*This
= HTMLELEM_THIS(iface
);
456 FIXME("(%p)->(%p)\n", This
, p
);
460 static HRESULT WINAPI
HTMLElement_get_offsetTop(IHTMLElement
*iface
, long *p
)
462 HTMLElement
*This
= HTMLELEM_THIS(iface
);
463 FIXME("(%p)->(%p)\n", This
, p
);
467 static HRESULT WINAPI
HTMLElement_get_offsetWidth(IHTMLElement
*iface
, long *p
)
469 HTMLElement
*This
= HTMLELEM_THIS(iface
);
470 FIXME("(%p)->(%p)\n", This
, p
);
474 static HRESULT WINAPI
HTMLElement_get_offsetHeight(IHTMLElement
*iface
, long *p
)
476 HTMLElement
*This
= HTMLELEM_THIS(iface
);
477 FIXME("(%p)->(%p)\n", This
, p
);
481 static HRESULT WINAPI
HTMLElement_get_offsetParent(IHTMLElement
*iface
, IHTMLElement
**p
)
483 HTMLElement
*This
= HTMLELEM_THIS(iface
);
484 FIXME("(%p)->(%p)\n", This
, p
);
488 static HRESULT WINAPI
HTMLElement_put_innerHTML(IHTMLElement
*iface
, BSTR v
)
490 HTMLElement
*This
= HTMLELEM_THIS(iface
);
491 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
495 static HRESULT WINAPI
HTMLElement_get_innerHTML(IHTMLElement
*iface
, BSTR
*p
)
497 HTMLElement
*This
= HTMLELEM_THIS(iface
);
498 FIXME("(%p)->(%p)\n", This
, p
);
502 static HRESULT WINAPI
HTMLElement_put_innerText(IHTMLElement
*iface
, BSTR v
)
504 HTMLElement
*This
= HTMLELEM_THIS(iface
);
505 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
509 static HRESULT WINAPI
HTMLElement_get_innerText(IHTMLElement
*iface
, BSTR
*p
)
511 HTMLElement
*This
= HTMLELEM_THIS(iface
);
512 FIXME("(%p)->(%p)\n", This
, p
);
516 static HRESULT WINAPI
HTMLElement_put_outerHTML(IHTMLElement
*iface
, BSTR v
)
518 HTMLElement
*This
= HTMLELEM_THIS(iface
);
519 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
523 static HRESULT WINAPI
HTMLElement_get_outerHTML(IHTMLElement
*iface
, BSTR
*p
)
525 HTMLElement
*This
= HTMLELEM_THIS(iface
);
526 FIXME("(%p)->(%p)\n", This
, p
);
530 static HRESULT WINAPI
HTMLElement_put_outerText(IHTMLElement
*iface
, BSTR v
)
532 HTMLElement
*This
= HTMLELEM_THIS(iface
);
533 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
537 static HRESULT WINAPI
HTMLElement_get_outerText(IHTMLElement
*iface
, BSTR
*p
)
539 HTMLElement
*This
= HTMLELEM_THIS(iface
);
540 FIXME("(%p)->(%p)\n", This
, p
);
544 static HRESULT WINAPI
HTMLElement_insertAdjacentHTML(IHTMLElement
*iface
, BSTR where
,
547 HTMLElement
*This
= HTMLELEM_THIS(iface
);
548 FIXME("(%p)->(%s %s)\n", This
, debugstr_w(where
), debugstr_w(html
));
552 static HRESULT WINAPI
HTMLElement_insertAdjacentText(IHTMLElement
*iface
, BSTR where
,
555 HTMLElement
*This
= HTMLELEM_THIS(iface
);
556 FIXME("(%p)->(%s %s)\n", This
, debugstr_w(where
), debugstr_w(text
));
560 static HRESULT WINAPI
HTMLElement_get_parentTextEdit(IHTMLElement
*iface
, IHTMLElement
**p
)
562 HTMLElement
*This
= HTMLELEM_THIS(iface
);
563 FIXME("(%p)->(%p)\n", This
, p
);
567 static HRESULT WINAPI
HTMLElement_get_isTextEdit(IHTMLElement
*iface
, VARIANT_BOOL
*p
)
569 HTMLElement
*This
= HTMLELEM_THIS(iface
);
570 FIXME("(%p)->(%p)\n", This
, p
);
574 static HRESULT WINAPI
HTMLElement_click(IHTMLElement
*iface
)
576 HTMLElement
*This
= HTMLELEM_THIS(iface
);
577 FIXME("(%p)\n", This
);
581 static HRESULT WINAPI
HTMLElement_get_filters(IHTMLElement
*iface
,
582 IHTMLFiltersCollection
**p
)
584 HTMLElement
*This
= HTMLELEM_THIS(iface
);
585 FIXME("(%p)->(%p)\n", This
, p
);
589 static HRESULT WINAPI
HTMLElement_put_ondragstart(IHTMLElement
*iface
, VARIANT v
)
591 HTMLElement
*This
= HTMLELEM_THIS(iface
);
592 FIXME("(%p)->()\n", This
);
596 static HRESULT WINAPI
HTMLElement_get_ondragstart(IHTMLElement
*iface
, VARIANT
*p
)
598 HTMLElement
*This
= HTMLELEM_THIS(iface
);
599 FIXME("(%p)->(%p)\n", This
, p
);
603 static HRESULT WINAPI
HTMLElement_toString(IHTMLElement
*iface
, BSTR
*String
)
605 HTMLElement
*This
= HTMLELEM_THIS(iface
);
606 FIXME("(%p)->(%p)\n", This
, String
);
610 static HRESULT WINAPI
HTMLElement_put_onbeforeupdate(IHTMLElement
*iface
, VARIANT v
)
612 HTMLElement
*This
= HTMLELEM_THIS(iface
);
613 FIXME("(%p)->()\n", This
);
617 static HRESULT WINAPI
HTMLElement_get_onbeforeupdate(IHTMLElement
*iface
, VARIANT
*p
)
619 HTMLElement
*This
= HTMLELEM_THIS(iface
);
620 FIXME("(%p)->(%p)\n", This
, p
);
624 static HRESULT WINAPI
HTMLElement_put_onafterupdate(IHTMLElement
*iface
, VARIANT v
)
626 HTMLElement
*This
= HTMLELEM_THIS(iface
);
627 FIXME("(%p)->()\n", This
);
631 static HRESULT WINAPI
HTMLElement_get_onafterupdate(IHTMLElement
*iface
, VARIANT
*p
)
633 HTMLElement
*This
= HTMLELEM_THIS(iface
);
634 FIXME("(%p)->(%p)\n", This
, p
);
638 static HRESULT WINAPI
HTMLElement_put_onerrorupdate(IHTMLElement
*iface
, VARIANT v
)
640 HTMLElement
*This
= HTMLELEM_THIS(iface
);
641 FIXME("(%p)->()\n", This
);
645 static HRESULT WINAPI
HTMLElement_get_onerrorupdate(IHTMLElement
*iface
, VARIANT
*p
)
647 HTMLElement
*This
= HTMLELEM_THIS(iface
);
648 FIXME("(%p)->(%p)\n", This
, p
);
652 static HRESULT WINAPI
HTMLElement_put_onrowexit(IHTMLElement
*iface
, VARIANT v
)
654 HTMLElement
*This
= HTMLELEM_THIS(iface
);
655 FIXME("(%p)->()\n", This
);
659 static HRESULT WINAPI
HTMLElement_get_onrowexit(IHTMLElement
*iface
, VARIANT
*p
)
661 HTMLElement
*This
= HTMLELEM_THIS(iface
);
662 FIXME("(%p)->(%p)\n", This
, p
);
666 static HRESULT WINAPI
HTMLElement_put_onrowenter(IHTMLElement
*iface
, VARIANT v
)
668 HTMLElement
*This
= HTMLELEM_THIS(iface
);
669 FIXME("(%p)->()\n", This
);
673 static HRESULT WINAPI
HTMLElement_get_onrowenter(IHTMLElement
*iface
, VARIANT
*p
)
675 HTMLElement
*This
= HTMLELEM_THIS(iface
);
676 FIXME("(%p)->(%p)\n", This
, p
);
680 static HRESULT WINAPI
HTMLElement_put_ondatasetchanged(IHTMLElement
*iface
, VARIANT v
)
682 HTMLElement
*This
= HTMLELEM_THIS(iface
);
683 FIXME("(%p)->()\n", This
);
687 static HRESULT WINAPI
HTMLElement_get_ondatasetchanged(IHTMLElement
*iface
, VARIANT
*p
)
689 HTMLElement
*This
= HTMLELEM_THIS(iface
);
690 FIXME("(%p)->(%p)\n", This
, p
);
694 static HRESULT WINAPI
HTMLElement_put_ondataavailable(IHTMLElement
*iface
, VARIANT v
)
696 HTMLElement
*This
= HTMLELEM_THIS(iface
);
697 FIXME("(%p)->()\n", This
);
701 static HRESULT WINAPI
HTMLElement_get_ondataavailable(IHTMLElement
*iface
, VARIANT
*p
)
703 HTMLElement
*This
= HTMLELEM_THIS(iface
);
704 FIXME("(%p)->(%p)\n", This
, p
);
708 static HRESULT WINAPI
HTMLElement_put_ondatasetcomplete(IHTMLElement
*iface
, VARIANT v
)
710 HTMLElement
*This
= HTMLELEM_THIS(iface
);
711 FIXME("(%p)->()\n", This
);
715 static HRESULT WINAPI
HTMLElement_get_ondatasetcomplete(IHTMLElement
*iface
, VARIANT
*p
)
717 HTMLElement
*This
= HTMLELEM_THIS(iface
);
718 FIXME("(%p)->(%p)\n", This
, p
);
722 static HRESULT WINAPI
HTMLElement_put_onfilterchange(IHTMLElement
*iface
, VARIANT v
)
724 HTMLElement
*This
= HTMLELEM_THIS(iface
);
725 FIXME("(%p)->()\n", This
);
729 static HRESULT WINAPI
HTMLElement_get_onfilterchange(IHTMLElement
*iface
, VARIANT
*p
)
731 HTMLElement
*This
= HTMLELEM_THIS(iface
);
732 FIXME("(%p)->(%p)\n", This
, p
);
736 static HRESULT WINAPI
HTMLElement_get_children(IHTMLElement
*iface
, IDispatch
**p
)
738 HTMLElement
*This
= HTMLELEM_THIS(iface
);
739 FIXME("(%p)->(%p)\n", This
, p
);
743 static void create_all_list(HTMLDocument
*doc
, HTMLElement
*elem
, HTMLElement
***list
, DWORD
*size
,
746 nsIDOMNodeList
*nsnode_list
;
748 PRUint32 list_len
= 0, i
;
752 nsres
= nsIDOMNode_GetChildNodes(elem
->node
->nsnode
, &nsnode_list
);
753 if(NS_FAILED(nsres
)) {
754 ERR("GetChildNodes failed: %08lx\n", nsres
);
758 nsIDOMNodeList_GetLength(nsnode_list
, &list_len
);
762 for(i
=0; i
<list_len
; i
++) {
763 nsres
= nsIDOMNodeList_Item(nsnode_list
, i
, &iter
);
764 if(NS_FAILED(nsres
)) {
765 ERR("Item failed: %08lx\n", nsres
);
769 node
= get_node(doc
, iter
);
770 if(node
->node_type
!= NT_HTMLELEM
)
775 *list
= HeapReAlloc(GetProcessHeap(), 0, *list
, *size
* sizeof(HTMLElement
**));
778 (*list
)[(*len
)++] = (HTMLElement
*)node
->impl
.elem
;
780 create_all_list(doc
, (HTMLElement
*)node
->impl
.elem
, list
, size
, len
);
784 static HRESULT WINAPI
HTMLElement_get_all(IHTMLElement
*iface
, IDispatch
**p
)
786 HTMLElement
*This
= HTMLELEM_THIS(iface
);
787 HTMLElement
**elem_list
;
788 DWORD list_size
= 8, len
= 0;
790 TRACE("(%p)->(%p)\n", This
, p
);
792 elem_list
= HeapAlloc(GetProcessHeap(), 0, list_size
*sizeof(HTMLElement
**));
794 create_all_list(This
->node
->doc
, This
, &elem_list
, &list_size
, &len
);
797 HeapFree(GetProcessHeap(), 0, elem_list
);
799 }else if(list_size
> len
) {
800 elem_list
= HeapReAlloc(GetProcessHeap(), 0, elem_list
, len
*sizeof(HTMLElement
**));
803 return HTMLElementCollection_Create((IUnknown
*)HTMLELEM(This
), elem_list
, len
, p
);
806 static void HTMLElement_destructor(IUnknown
*iface
)
808 HTMLElement
*This
= HTMLELEM_THIS(iface
);
811 This
->destructor(This
->impl
);
814 nsIDOMHTMLElement_Release(This
->nselem
);
816 HeapFree(GetProcessHeap(), 0, This
);
821 static const IHTMLElementVtbl HTMLElementVtbl
= {
822 HTMLElement_QueryInterface
,
825 HTMLElement_GetTypeInfoCount
,
826 HTMLElement_GetTypeInfo
,
827 HTMLElement_GetIDsOfNames
,
829 HTMLElement_setAttribute
,
830 HTMLElement_getAttribute
,
831 HTMLElement_removeAttribute
,
832 HTMLElement_put_className
,
833 HTMLElement_get_className
,
836 HTMLElement_get_tagName
,
837 HTMLElement_get_parentElement
,
838 HTMLElement_get_style
,
839 HTMLElement_put_onhelp
,
840 HTMLElement_get_onhelp
,
841 HTMLElement_put_onclick
,
842 HTMLElement_get_onclick
,
843 HTMLElement_put_ondblclick
,
844 HTMLElement_get_ondblclick
,
845 HTMLElement_put_onkeydown
,
846 HTMLElement_get_onkeydown
,
847 HTMLElement_put_onkeyup
,
848 HTMLElement_get_onkeyup
,
849 HTMLElement_put_onkeypress
,
850 HTMLElement_get_onkeypress
,
851 HTMLElement_put_onmouseout
,
852 HTMLElement_get_onmouseout
,
853 HTMLElement_put_onmouseover
,
854 HTMLElement_get_onmouseover
,
855 HTMLElement_put_onmousemove
,
856 HTMLElement_get_onmousemove
,
857 HTMLElement_put_onmousedown
,
858 HTMLElement_get_onmousedown
,
859 HTMLElement_put_onmouseup
,
860 HTMLElement_get_onmouseup
,
861 HTMLElement_get_document
,
862 HTMLElement_put_title
,
863 HTMLElement_get_title
,
864 HTMLElement_put_language
,
865 HTMLElement_get_language
,
866 HTMLElement_put_onselectstart
,
867 HTMLElement_get_onselectstart
,
868 HTMLElement_scrollIntoView
,
869 HTMLElement_contains
,
870 HTMLElement_get_sourceIndex
,
871 HTMLElement_get_recordNumber
,
872 HTMLElement_put_lang
,
873 HTMLElement_get_lang
,
874 HTMLElement_get_offsetLeft
,
875 HTMLElement_get_offsetTop
,
876 HTMLElement_get_offsetWidth
,
877 HTMLElement_get_offsetHeight
,
878 HTMLElement_get_offsetParent
,
879 HTMLElement_put_innerHTML
,
880 HTMLElement_get_innerHTML
,
881 HTMLElement_put_innerText
,
882 HTMLElement_get_innerText
,
883 HTMLElement_put_outerHTML
,
884 HTMLElement_get_outerHTML
,
885 HTMLElement_put_outerText
,
886 HTMLElement_get_outerText
,
887 HTMLElement_insertAdjacentHTML
,
888 HTMLElement_insertAdjacentText
,
889 HTMLElement_get_parentTextEdit
,
890 HTMLElement_get_isTextEdit
,
892 HTMLElement_get_filters
,
893 HTMLElement_put_ondragstart
,
894 HTMLElement_get_ondragstart
,
895 HTMLElement_toString
,
896 HTMLElement_put_onbeforeupdate
,
897 HTMLElement_get_onbeforeupdate
,
898 HTMLElement_put_onafterupdate
,
899 HTMLElement_get_onafterupdate
,
900 HTMLElement_put_onerrorupdate
,
901 HTMLElement_get_onerrorupdate
,
902 HTMLElement_put_onrowexit
,
903 HTMLElement_get_onrowexit
,
904 HTMLElement_put_onrowenter
,
905 HTMLElement_get_onrowenter
,
906 HTMLElement_put_ondatasetchanged
,
907 HTMLElement_get_ondatasetchanged
,
908 HTMLElement_put_ondataavailable
,
909 HTMLElement_get_ondataavailable
,
910 HTMLElement_put_ondatasetcomplete
,
911 HTMLElement_get_ondatasetcomplete
,
912 HTMLElement_put_onfilterchange
,
913 HTMLElement_get_onfilterchange
,
914 HTMLElement_get_children
,
918 void HTMLElement_Create(HTMLDOMNode
*node
)
921 nsAString class_name_str
;
922 const PRUnichar
*class_name
;
925 static const WCHAR wszINPUT
[] = {'I','N','P','U','T',0};
927 ret
= HeapAlloc(GetProcessHeap(), 0, sizeof(HTMLElement
));
928 ret
->lpHTMLElementVtbl
= &HTMLElementVtbl
;
931 ret
->destructor
= NULL
;
933 node
->node_type
= NT_HTMLELEM
;
934 node
->impl
.elem
= HTMLELEM(ret
);
935 node
->destructor
= HTMLElement_destructor
;
937 nsres
= nsIDOMNode_QueryInterface(node
->nsnode
, &IID_nsIDOMHTMLElement
, (void**)&ret
->nselem
);
941 nsAString_Init(&class_name_str
, NULL
);
942 nsIDOMHTMLElement_GetTagName(ret
->nselem
, &class_name_str
);
944 nsAString_GetData(&class_name_str
, &class_name
, NULL
);
946 if(!strcmpW(class_name
, wszINPUT
))
947 HTMLInputElement_Create(ret
);
949 nsAString_Finish(&class_name_str
);
953 const IHTMLElementCollectionVtbl
*lpHTMLElementCollectionVtbl
;
960 } HTMLElementCollection
;
962 #define HTMLELEMCOL(x) ((IHTMLElementCollection*) &(x)->lpHTMLElementCollectionVtbl)
964 #define ELEMCOL_THIS(iface) DEFINE_THIS(HTMLElementCollection, HTMLElementCollection, iface)
966 static HRESULT WINAPI
HTMLElementCollection_QueryInterface(IHTMLElementCollection
*iface
,
967 REFIID riid
, void **ppv
)
969 HTMLElementCollection
*This
= ELEMCOL_THIS(iface
);
973 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
974 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppv
);
975 *ppv
= HTMLELEMCOL(This
);
976 }else if(IsEqualGUID(&IID_IDispatch
, riid
)) {
977 TRACE("(%p)->(IID_IDispatch %p)\n", This
, ppv
);
978 *ppv
= HTMLELEMCOL(This
);
979 }else if(IsEqualGUID(&IID_IHTMLElementCollection
, riid
)) {
980 TRACE("(%p)->(IID_IHTMLElementCollection %p)\n", This
, ppv
);
981 *ppv
= HTMLELEMCOL(This
);
985 IHTMLElementCollection_AddRef(HTMLELEMCOL(This
));
989 FIXME("(%p)->(%s %p)\n", This
, debugstr_guid(riid
), ppv
);
990 return E_NOINTERFACE
;
993 static ULONG WINAPI
HTMLElementCollection_AddRef(IHTMLElementCollection
*iface
)
995 HTMLElementCollection
*This
= ELEMCOL_THIS(iface
);
996 LONG ref
= InterlockedIncrement(&This
->ref
);
998 TRACE("(%p) ref=%ld\n", This
, ref
);
1003 static ULONG WINAPI
HTMLElementCollection_Release(IHTMLElementCollection
*iface
)
1005 HTMLElementCollection
*This
= ELEMCOL_THIS(iface
);
1006 LONG ref
= InterlockedDecrement(&This
->ref
);
1008 TRACE("(%p) ref=%ld\n", This
, ref
);
1011 IUnknown_Release(This
->ref_unk
);
1012 HeapFree(GetProcessHeap(), 0, This
->elems
);
1013 HeapFree(GetProcessHeap(), 0, This
);
1019 static HRESULT WINAPI
HTMLElementCollection_GetTypeInfoCount(IHTMLElementCollection
*iface
,
1022 HTMLElementCollection
*This
= ELEMCOL_THIS(iface
);
1023 FIXME("(%p)->(%p)\n", This
, pctinfo
);
1027 static HRESULT WINAPI
HTMLElementCollection_GetTypeInfo(IHTMLElementCollection
*iface
,
1028 UINT iTInfo
, LCID lcid
, ITypeInfo
**ppTInfo
)
1030 HTMLElementCollection
*This
= ELEMCOL_THIS(iface
);
1031 FIXME("(%p)->(%u %lu %p)\n", This
, iTInfo
, lcid
, ppTInfo
);
1035 static HRESULT WINAPI
HTMLElementCollection_GetIDsOfNames(IHTMLElementCollection
*iface
,
1036 REFIID riid
, LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
1038 HTMLElementCollection
*This
= ELEMCOL_THIS(iface
);
1039 FIXME("(%p)->(%s %p %u %lu %p)\n", This
, debugstr_guid(riid
), rgszNames
, cNames
,
1044 static HRESULT WINAPI
HTMLElementCollection_Invoke(IHTMLElementCollection
*iface
,
1045 DISPID dispIdMember
, REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
1046 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
1048 HTMLElementCollection
*This
= ELEMCOL_THIS(iface
);
1049 FIXME("(%p)->(%ld %s %ld %d %p %p %p %p)\n", This
, dispIdMember
, debugstr_guid(riid
),
1050 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
1054 static HRESULT WINAPI
HTMLElementCollection_toString(IHTMLElementCollection
*iface
,
1057 HTMLElementCollection
*This
= ELEMCOL_THIS(iface
);
1058 FIXME("(%p)->(%p)\n", This
, String
);
1062 static HRESULT WINAPI
HTMLElementCollection_put_length(IHTMLElementCollection
*iface
,
1065 HTMLElementCollection
*This
= ELEMCOL_THIS(iface
);
1066 FIXME("(%p)->(%ld)\n", This
, v
);
1070 static HRESULT WINAPI
HTMLElementCollection_get_length(IHTMLElementCollection
*iface
,
1073 HTMLElementCollection
*This
= ELEMCOL_THIS(iface
);
1075 TRACE("(%p)->(%p)\n", This
, p
);
1081 static HRESULT WINAPI
HTMLElementCollection_get__newEnum(IHTMLElementCollection
*iface
,
1084 HTMLElementCollection
*This
= ELEMCOL_THIS(iface
);
1085 FIXME("(%p)->(%p)\n", This
, p
);
1089 static HRESULT WINAPI
HTMLElementCollection_item(IHTMLElementCollection
*iface
,
1090 VARIANT name
, VARIANT index
, IDispatch
**pdisp
)
1092 HTMLElementCollection
*This
= ELEMCOL_THIS(iface
);
1094 if(V_VT(&index
) != VT_I4
) {
1095 WARN("Invalid index vt=%d\n", V_VT(&index
));
1096 return E_INVALIDARG
;
1099 if(V_VT(&name
) != VT_I4
|| V_I4(&name
) != V_I4(&index
))
1100 FIXME("Unsupproted name vt=%d\n", V_VT(&name
));
1102 TRACE("(%p)->(%ld %ld %p)\n", This
, V_I4(&name
), V_I4(&index
), pdisp
);
1104 if(V_I4(&index
) < 0 || V_I4(&index
) >= This
->len
)
1105 return E_INVALIDARG
;
1107 *pdisp
= (IDispatch
*)This
->elems
[V_I4(&index
)];
1108 IDispatch_AddRef(*pdisp
);
1112 static HRESULT WINAPI
HTMLElementCollection_tags(IHTMLElementCollection
*iface
,
1113 VARIANT tagName
, IDispatch
**pdisp
)
1115 HTMLElementCollection
*This
= ELEMCOL_THIS(iface
);
1116 DWORD size
= 8, len
= 0, i
;
1117 HTMLElement
**elem_list
;
1119 const PRUnichar
*tag
;
1121 if(V_VT(&tagName
) != VT_BSTR
) {
1122 WARN("Invalid arg\n");
1123 return E_INVALIDARG
;
1126 TRACE("(%p)->(%s %p)\n", This
, debugstr_w(V_BSTR(&tagName
)), pdisp
);
1128 elem_list
= HeapAlloc(GetProcessHeap(), 0, size
*sizeof(HTMLElement
*));
1130 nsAString_Init(&tag_str
, NULL
);
1132 for(i
=0; i
<This
->len
; i
++) {
1133 if(!This
->elems
[i
]->nselem
)
1136 nsIDOMElement_GetTagName(This
->elems
[i
]->nselem
, &tag_str
);
1137 nsAString_GetData(&tag_str
, &tag
, NULL
);
1139 if(CompareStringW(LOCALE_SYSTEM_DEFAULT
, NORM_IGNORECASE
, tag
, -1,
1140 V_BSTR(&tagName
), -1) == CSTR_EQUAL
) {
1143 elem_list
= HeapReAlloc(GetProcessHeap(), 0, elem_list
, size
);
1146 elem_list
[len
++] = This
->elems
[i
];
1150 nsAString_Finish(&tag_str
);
1152 TRACE("fount %ld tags\n", len
);
1155 HeapFree(GetProcessHeap(), 0, elem_list
);
1157 }else if(size
> len
) {
1158 HeapReAlloc(GetProcessHeap(), 0, elem_list
, len
);
1161 return HTMLElementCollection_Create(This
->ref_unk
, elem_list
, len
, pdisp
);
1166 static const IHTMLElementCollectionVtbl HTMLElementCollectionVtbl
= {
1167 HTMLElementCollection_QueryInterface
,
1168 HTMLElementCollection_AddRef
,
1169 HTMLElementCollection_Release
,
1170 HTMLElementCollection_GetTypeInfoCount
,
1171 HTMLElementCollection_GetTypeInfo
,
1172 HTMLElementCollection_GetIDsOfNames
,
1173 HTMLElementCollection_Invoke
,
1174 HTMLElementCollection_toString
,
1175 HTMLElementCollection_put_length
,
1176 HTMLElementCollection_get_length
,
1177 HTMLElementCollection_get__newEnum
,
1178 HTMLElementCollection_item
,
1179 HTMLElementCollection_tags
1182 static HRESULT
HTMLElementCollection_Create(IUnknown
*ref_unk
, HTMLElement
**elems
, DWORD len
,
1185 HTMLElementCollection
*ret
= HeapAlloc(GetProcessHeap(), 0, sizeof(HTMLElementCollection
));
1187 ret
->lpHTMLElementCollectionVtbl
= &HTMLElementCollectionVtbl
;
1192 IUnknown_AddRef(ref_unk
);
1193 ret
->ref_unk
= ref_unk
;
1195 TRACE("ret=%p len=%ld\n", ret
, len
);
1197 *p
= (IDispatch
*)ret
;