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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
28 #include "wine/debug.h"
29 #include "wine/unicode.h"
31 #include "mshtml_private.h"
32 #include "htmlevent.h"
34 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
36 #define HTMLELEM2_THIS(iface) DEFINE_THIS(HTMLElement, HTMLElement2, iface)
38 static HRESULT WINAPI HTMLElement2_QueryInterface(IHTMLElement2 *iface,
39 REFIID riid, void **ppv)
41 HTMLElement *This = HTMLELEM2_THIS(iface);
42 return IHTMLElement_QueryInterface(HTMLELEM(This), riid, ppv);
45 static ULONG WINAPI HTMLElement2_AddRef(IHTMLElement2 *iface)
47 HTMLElement *This = HTMLELEM2_THIS(iface);
48 return IHTMLElement_AddRef(HTMLELEM(This));
51 static ULONG WINAPI HTMLElement2_Release(IHTMLElement2 *iface)
53 HTMLElement *This = HTMLELEM2_THIS(iface);
54 return IHTMLElement_Release(HTMLELEM(This));
57 static HRESULT WINAPI HTMLElement2_GetTypeInfoCount(IHTMLElement2 *iface, UINT *pctinfo)
59 HTMLElement *This = HTMLELEM2_THIS(iface);
60 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->node.dispex), pctinfo);
63 static HRESULT WINAPI HTMLElement2_GetTypeInfo(IHTMLElement2 *iface, UINT iTInfo,
64 LCID lcid, ITypeInfo **ppTInfo)
66 HTMLElement *This = HTMLELEM2_THIS(iface);
67 return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->node.dispex), iTInfo, lcid, ppTInfo);
70 static HRESULT WINAPI HTMLElement2_GetIDsOfNames(IHTMLElement2 *iface, REFIID riid,
71 LPOLESTR *rgszNames, UINT cNames,
72 LCID lcid, DISPID *rgDispId)
74 HTMLElement *This = HTMLELEM2_THIS(iface);
75 return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->node.dispex), riid, rgszNames, cNames, lcid, rgDispId);
78 static HRESULT WINAPI HTMLElement2_Invoke(IHTMLElement2 *iface, DISPID dispIdMember,
79 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
80 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
82 HTMLElement *This = HTMLELEM2_THIS(iface);
83 return IDispatchEx_Invoke(DISPATCHEX(&This->node.dispex), dispIdMember, riid, lcid,
84 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
87 static HRESULT WINAPI HTMLElement2_get_scopeName(IHTMLElement2 *iface, BSTR *p)
89 HTMLElement *This = HTMLELEM2_THIS(iface);
90 FIXME("(%p)->(%p)\n", This, p);
94 static HRESULT WINAPI HTMLElement2_setCapture(IHTMLElement2 *iface, VARIANT_BOOL containerCapture)
96 HTMLElement *This = HTMLELEM2_THIS(iface);
97 FIXME("(%p)->(%x)\n", This, containerCapture);
101 static HRESULT WINAPI HTMLElement2_releaseCapture(IHTMLElement2 *iface)
103 HTMLElement *This = HTMLELEM2_THIS(iface);
104 FIXME("(%p)\n", This);
108 static HRESULT WINAPI HTMLElement2_put_onlosecapture(IHTMLElement2 *iface, VARIANT v)
110 HTMLElement *This = HTMLELEM2_THIS(iface);
111 FIXME("(%p)->()\n", This);
115 static HRESULT WINAPI HTMLElement2_get_onlosecapture(IHTMLElement2 *iface, VARIANT *p)
117 HTMLElement *This = HTMLELEM2_THIS(iface);
118 FIXME("(%p)->(%p)\n", This, p);
122 static HRESULT WINAPI HTMLElement2_componentFromPoint(IHTMLElement2 *iface,
123 long x, long y, BSTR *component)
125 HTMLElement *This = HTMLELEM2_THIS(iface);
126 FIXME("(%p)->(%ld %ld %p)\n", This, x, y, component);
130 static HRESULT WINAPI HTMLElement2_doScroll(IHTMLElement2 *iface, VARIANT component)
132 HTMLElement *This = HTMLELEM2_THIS(iface);
133 FIXME("(%p)->()\n", This);
137 static HRESULT WINAPI HTMLElement2_put_onscroll(IHTMLElement2 *iface, VARIANT v)
139 HTMLElement *This = HTMLELEM2_THIS(iface);
140 FIXME("(%p)->()\n", This);
144 static HRESULT WINAPI HTMLElement2_get_onscroll(IHTMLElement2 *iface, VARIANT *p)
146 HTMLElement *This = HTMLELEM2_THIS(iface);
147 FIXME("(%p)->(%p)\n", This, p);
151 static HRESULT WINAPI HTMLElement2_put_ondrag(IHTMLElement2 *iface, VARIANT v)
153 HTMLElement *This = HTMLELEM2_THIS(iface);
155 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
157 return set_node_event(&This->node, EVENTID_DRAG, &v);
160 static HRESULT WINAPI HTMLElement2_get_ondrag(IHTMLElement2 *iface, VARIANT *p)
162 HTMLElement *This = HTMLELEM2_THIS(iface);
164 TRACE("(%p)->(%p)\n", This, p);
166 return get_node_event(&This->node, EVENTID_DRAG, p);
169 static HRESULT WINAPI HTMLElement2_put_ondragend(IHTMLElement2 *iface, VARIANT v)
171 HTMLElement *This = HTMLELEM2_THIS(iface);
172 FIXME("(%p)->()\n", This);
176 static HRESULT WINAPI HTMLElement2_get_ondragend(IHTMLElement2 *iface, VARIANT *p)
178 HTMLElement *This = HTMLELEM2_THIS(iface);
179 FIXME("(%p)->(%p)\n", This, p);
183 static HRESULT WINAPI HTMLElement2_put_ondragenter(IHTMLElement2 *iface, VARIANT v)
185 HTMLElement *This = HTMLELEM2_THIS(iface);
186 FIXME("(%p)->()\n", This);
190 static HRESULT WINAPI HTMLElement2_get_ondragenter(IHTMLElement2 *iface, VARIANT *p)
192 HTMLElement *This = HTMLELEM2_THIS(iface);
193 FIXME("(%p)->(%p)\n", This, p);
197 static HRESULT WINAPI HTMLElement2_put_ondragover(IHTMLElement2 *iface, VARIANT v)
199 HTMLElement *This = HTMLELEM2_THIS(iface);
200 FIXME("(%p)->()\n", This);
204 static HRESULT WINAPI HTMLElement2_get_ondragover(IHTMLElement2 *iface, VARIANT *p)
206 HTMLElement *This = HTMLELEM2_THIS(iface);
207 FIXME("(%p)->(%p)\n", This, p);
211 static HRESULT WINAPI HTMLElement2_put_ondragleave(IHTMLElement2 *iface, VARIANT v)
213 HTMLElement *This = HTMLELEM2_THIS(iface);
214 FIXME("(%p)->()\n", This);
218 static HRESULT WINAPI HTMLElement2_get_ondragleave(IHTMLElement2 *iface, VARIANT *p)
220 HTMLElement *This = HTMLELEM2_THIS(iface);
221 FIXME("(%p)->(%p)\n", This, p);
225 static HRESULT WINAPI HTMLElement2_put_ondrop(IHTMLElement2 *iface, VARIANT v)
227 HTMLElement *This = HTMLELEM2_THIS(iface);
228 FIXME("(%p)->()\n", This);
232 static HRESULT WINAPI HTMLElement2_get_ondrop(IHTMLElement2 *iface, VARIANT *p)
234 HTMLElement *This = HTMLELEM2_THIS(iface);
235 FIXME("(%p)->(%p)\n", This, p);
239 static HRESULT WINAPI HTMLElement2_put_onbeforecut(IHTMLElement2 *iface, VARIANT v)
241 HTMLElement *This = HTMLELEM2_THIS(iface);
242 FIXME("(%p)->()\n", This);
246 static HRESULT WINAPI HTMLElement2_get_onbeforecut(IHTMLElement2 *iface, VARIANT *p)
248 HTMLElement *This = HTMLELEM2_THIS(iface);
249 FIXME("(%p)->(%p)\n", This, p);
253 static HRESULT WINAPI HTMLElement2_put_oncut(IHTMLElement2 *iface, VARIANT v)
255 HTMLElement *This = HTMLELEM2_THIS(iface);
256 FIXME("(%p)->()\n", This);
260 static HRESULT WINAPI HTMLElement2_get_oncut(IHTMLElement2 *iface, VARIANT *p)
262 HTMLElement *This = HTMLELEM2_THIS(iface);
263 FIXME("(%p)->(%p)\n", This, p);
267 static HRESULT WINAPI HTMLElement2_put_onbeforecopy(IHTMLElement2 *iface, VARIANT v)
269 HTMLElement *This = HTMLELEM2_THIS(iface);
270 FIXME("(%p)->()\n", This);
274 static HRESULT WINAPI HTMLElement2_get_onbeforecopy(IHTMLElement2 *iface, VARIANT *p)
276 HTMLElement *This = HTMLELEM2_THIS(iface);
277 FIXME("(%p)->(%p)\n", This, p);
281 static HRESULT WINAPI HTMLElement2_put_oncopy(IHTMLElement2 *iface, VARIANT v)
283 HTMLElement *This = HTMLELEM2_THIS(iface);
284 FIXME("(%p)->()\n", This);
288 static HRESULT WINAPI HTMLElement2_get_oncopy(IHTMLElement2 *iface, VARIANT *p)
290 HTMLElement *This = HTMLELEM2_THIS(iface);
291 FIXME("(%p)->(%p)\n", This, p);
295 static HRESULT WINAPI HTMLElement2_put_onbeforepaste(IHTMLElement2 *iface, VARIANT v)
297 HTMLElement *This = HTMLELEM2_THIS(iface);
298 FIXME("(%p)->()\n", This);
302 static HRESULT WINAPI HTMLElement2_get_onbeforepaste(IHTMLElement2 *iface, VARIANT *p)
304 HTMLElement *This = HTMLELEM2_THIS(iface);
305 FIXME("(%p)->(%p)\n", This, p);
309 static HRESULT WINAPI HTMLElement2_put_onpaste(IHTMLElement2 *iface, VARIANT v)
311 HTMLElement *This = HTMLELEM2_THIS(iface);
313 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
315 return set_node_event(&This->node, EVENTID_PASTE, &v);
318 static HRESULT WINAPI HTMLElement2_get_onpaste(IHTMLElement2 *iface, VARIANT *p)
320 HTMLElement *This = HTMLELEM2_THIS(iface);
322 TRACE("(%p)->(%p)\n", This, p);
324 return get_node_event(&This->node, EVENTID_PASTE, p);
327 static HRESULT WINAPI HTMLElement2_get_currentStyle(IHTMLElement2 *iface, IHTMLCurrentStyle **p)
329 HTMLElement *This = HTMLELEM2_THIS(iface);
331 TRACE("(%p)->(%p)\n", This, p);
333 return HTMLCurrentStyle_Create(This, p);
336 static HRESULT WINAPI HTMLElement2_put_onpropertychange(IHTMLElement2 *iface, VARIANT v)
338 HTMLElement *This = HTMLELEM2_THIS(iface);
339 FIXME("(%p)->()\n", This);
343 static HRESULT WINAPI HTMLElement2_get_onpropertychange(IHTMLElement2 *iface, VARIANT *p)
345 HTMLElement *This = HTMLELEM2_THIS(iface);
346 FIXME("(%p)->(%p)\n", This, p);
350 static HRESULT WINAPI HTMLElement2_getClientRects(IHTMLElement2 *iface, IHTMLRectCollection **pRectCol)
352 HTMLElement *This = HTMLELEM2_THIS(iface);
353 FIXME("(%p)->(%p)\n", This, pRectCol);
357 static HRESULT WINAPI HTMLElement2_getBoundingClientRect(IHTMLElement2 *iface, IHTMLRect **pRect)
359 HTMLElement *This = HTMLELEM2_THIS(iface);
360 FIXME("(%p)->(%p)\n", This, pRect);
364 static HRESULT WINAPI HTMLElement2_setExpression(IHTMLElement2 *iface, BSTR propname,
365 BSTR expression, BSTR language)
367 HTMLElement *This = HTMLELEM2_THIS(iface);
368 FIXME("(%p)->(%s %s %s)\n", This, debugstr_w(propname), debugstr_w(expression),
369 debugstr_w(language));
373 static HRESULT WINAPI HTMLElement2_getExpression(IHTMLElement2 *iface, BSTR propname,
376 HTMLElement *This = HTMLELEM2_THIS(iface);
377 FIXME("(%p)->(%s %p)\n", This, debugstr_w(propname), expression);
381 static HRESULT WINAPI HTMLElement2_removeExpression(IHTMLElement2 *iface, BSTR propname,
382 VARIANT_BOOL *pfSuccess)
384 HTMLElement *This = HTMLELEM2_THIS(iface);
385 FIXME("(%p)->(%s %p)\n", This, debugstr_w(propname), pfSuccess);
389 static HRESULT WINAPI HTMLElement2_put_tabIndex(IHTMLElement2 *iface, short v)
391 HTMLElement *This = HTMLELEM2_THIS(iface);
392 nsIDOMNSHTMLElement *nselem;
395 TRACE("(%p)->(%d)\n", This, v);
397 nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
398 if(NS_FAILED(nsres)) {
399 ERR("Could not get nsIDOMHTMLNSElement: %08x\n", nsres);
403 nsres = nsIDOMNSHTMLElement_SetTabIndex(nselem, v);
404 nsIDOMNSHTMLElement_Release(nselem);
406 ERR("GetTabIndex failed: %08x\n", nsres);
411 static HRESULT WINAPI HTMLElement2_get_tabIndex(IHTMLElement2 *iface, short *p)
413 HTMLElement *This = HTMLELEM2_THIS(iface);
414 nsIDOMNSHTMLElement *nselem;
418 TRACE("(%p)->(%p)\n", This, p);
420 nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
421 if(NS_FAILED(nsres)) {
422 ERR("Could not get nsIDOMHTMLNSElement: %08x\n", nsres);
426 nsres = nsIDOMNSHTMLElement_GetTabIndex(nselem, &index);
427 nsIDOMNSHTMLElement_Release(nselem);
428 if(NS_FAILED(nsres)) {
429 ERR("GetTabIndex failed: %08x\n", nsres);
437 static HRESULT WINAPI HTMLElement2_focus(IHTMLElement2 *iface)
439 HTMLElement *This = HTMLELEM2_THIS(iface);
440 nsIDOMNSHTMLElement *nselem;
443 TRACE("(%p)\n", This);
445 nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
446 if(NS_SUCCEEDED(nsres)) {
447 nsIDOMNSHTMLElement_focus(nselem);
448 nsIDOMNSHTMLElement_Release(nselem);
450 ERR("Could not get nsIDOMHTMLNSElement: %08x\n", nsres);
456 static HRESULT WINAPI HTMLElement2_put_accessKey(IHTMLElement2 *iface, BSTR v)
458 HTMLElement *This = HTMLELEM2_THIS(iface);
461 static WCHAR accessKeyW[] = {'a','c','c','e','s','s','K','e','y',0};
463 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
465 V_VT(&var) = VT_BSTR;
467 return IHTMLElement_setAttribute(HTMLELEM(This), accessKeyW, var, 0);
470 static HRESULT WINAPI HTMLElement2_get_accessKey(IHTMLElement2 *iface, BSTR *p)
472 HTMLElement *This = HTMLELEM2_THIS(iface);
473 FIXME("(%p)->(%p)\n", This, p);
477 static HRESULT WINAPI HTMLElement2_put_onblur(IHTMLElement2 *iface, VARIANT v)
479 HTMLElement *This = HTMLELEM2_THIS(iface);
481 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
483 return set_node_event(&This->node, EVENTID_BLUR, &v);
486 static HRESULT WINAPI HTMLElement2_get_onblur(IHTMLElement2 *iface, VARIANT *p)
488 HTMLElement *This = HTMLELEM2_THIS(iface);
490 TRACE("(%p)->(%p)\n", This, p);
492 return get_node_event(&This->node, EVENTID_BLUR, p);
495 static HRESULT WINAPI HTMLElement2_put_onfocus(IHTMLElement2 *iface, VARIANT v)
497 HTMLElement *This = HTMLELEM2_THIS(iface);
499 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
501 return set_node_event(&This->node, EVENTID_FOCUS, &v);
504 static HRESULT WINAPI HTMLElement2_get_onfocus(IHTMLElement2 *iface, VARIANT *p)
506 HTMLElement *This = HTMLELEM2_THIS(iface);
508 TRACE("(%p)->(%p)\n", This, p);
510 return get_node_event(&This->node, EVENTID_FOCUS, p);
513 static HRESULT WINAPI HTMLElement2_put_onresize(IHTMLElement2 *iface, VARIANT v)
515 HTMLElement *This = HTMLELEM2_THIS(iface);
516 FIXME("(%p)->()\n", This);
520 static HRESULT WINAPI HTMLElement2_get_onresize(IHTMLElement2 *iface, VARIANT *p)
522 HTMLElement *This = HTMLELEM2_THIS(iface);
523 FIXME("(%p)->(%p)\n", This, p);
527 static HRESULT WINAPI HTMLElement2_blur(IHTMLElement2 *iface)
529 HTMLElement *This = HTMLELEM2_THIS(iface);
530 FIXME("(%p)\n", This);
534 static HRESULT WINAPI HTMLElement2_addFilter(IHTMLElement2 *iface, IUnknown *pUnk)
536 HTMLElement *This = HTMLELEM2_THIS(iface);
537 FIXME("(%p)->(%p)\n", This, pUnk);
541 static HRESULT WINAPI HTMLElement2_removeFilter(IHTMLElement2 *iface, IUnknown *pUnk)
543 HTMLElement *This = HTMLELEM2_THIS(iface);
544 FIXME("(%p)->(%p)\n", This, pUnk);
548 static HRESULT WINAPI HTMLElement2_get_clientHeight(IHTMLElement2 *iface, long *p)
550 HTMLElement *This = HTMLELEM2_THIS(iface);
551 nsIDOMNSElement *nselem;
555 TRACE("(%p)->(%p)\n", This, p);
557 nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSElement, (void**)&nselem);
558 if(NS_SUCCEEDED(nsres)) {
559 nsIDOMNSElement_GetClientHeight(nselem, &height);
560 nsIDOMNSElement_Release(nselem);
562 ERR("Could not get nsIDOMNSElement: %08x\n", nsres);
569 static HRESULT WINAPI HTMLElement2_get_clientWidth(IHTMLElement2 *iface, long *p)
571 HTMLElement *This = HTMLELEM2_THIS(iface);
572 nsIDOMNSElement *nselem;
576 TRACE("(%p)->(%p)\n", This, p);
578 nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSElement, (void**)&nselem);
579 if(NS_SUCCEEDED(nsres)) {
580 nsIDOMNSElement_GetClientWidth(nselem, &width);
581 nsIDOMNSElement_Release(nselem);
583 ERR("Could not get nsIDOMNSElement: %08x\n", nsres);
590 static HRESULT WINAPI HTMLElement2_get_clientTop(IHTMLElement2 *iface, long *p)
592 HTMLElement *This = HTMLELEM2_THIS(iface);
593 FIXME("(%p)->(%p)\n", This, p);
597 static HRESULT WINAPI HTMLElement2_get_clientLeft(IHTMLElement2 *iface, long *p)
599 HTMLElement *This = HTMLELEM2_THIS(iface);
600 FIXME("(%p)->(%p)\n", This, p);
604 static HRESULT WINAPI HTMLElement2_attachEvent(IHTMLElement2 *iface, BSTR event,
605 IDispatch *pDisp, VARIANT_BOOL *pfResult)
607 HTMLElement *This = HTMLELEM2_THIS(iface);
608 FIXME("(%p)->(%s %p %p)\n", This, debugstr_w(event), pDisp, pfResult);
612 static HRESULT WINAPI HTMLElement2_detachEvent(IHTMLElement2 *iface, BSTR event, IDispatch *pDisp)
614 HTMLElement *This = HTMLELEM2_THIS(iface);
615 FIXME("(%p)->(%s %p)\n", This, debugstr_w(event), pDisp);
619 static HRESULT WINAPI HTMLElement2_get_readyState(IHTMLElement2 *iface, VARIANT *p)
621 HTMLElement *This = HTMLELEM2_THIS(iface);
622 FIXME("(%p)->(%p)\n", This, p);
626 static HRESULT WINAPI HTMLElement2_put_onreadystatechange(IHTMLElement2 *iface, VARIANT v)
628 HTMLElement *This = HTMLELEM2_THIS(iface);
629 FIXME("(%p)->()\n", This);
633 static HRESULT WINAPI HTMLElement2_get_onreadystatechange(IHTMLElement2 *iface, VARIANT *p)
635 HTMLElement *This = HTMLELEM2_THIS(iface);
636 FIXME("(%p)->(%p)\n", This, p);
640 static HRESULT WINAPI HTMLElement2_put_onrowsdelete(IHTMLElement2 *iface, VARIANT v)
642 HTMLElement *This = HTMLELEM2_THIS(iface);
643 FIXME("(%p)->()\n", This);
647 static HRESULT WINAPI HTMLElement2_get_onrowsdelete(IHTMLElement2 *iface, VARIANT *p)
649 HTMLElement *This = HTMLELEM2_THIS(iface);
650 FIXME("(%p)->(%p)\n", This, p);
654 static HRESULT WINAPI HTMLElement2_put_onrowsinserted(IHTMLElement2 *iface, VARIANT v)
656 HTMLElement *This = HTMLELEM2_THIS(iface);
657 FIXME("(%p)->()\n", This);
661 static HRESULT WINAPI HTMLElement2_get_onrowsinserted(IHTMLElement2 *iface, VARIANT *p)
663 HTMLElement *This = HTMLELEM2_THIS(iface);
664 FIXME("(%p)->(%p)\n", This, p);
668 static HRESULT WINAPI HTMLElement2_put_oncellchange(IHTMLElement2 *iface, VARIANT v)
670 HTMLElement *This = HTMLELEM2_THIS(iface);
671 FIXME("(%p)->()\n", This);
675 static HRESULT WINAPI HTMLElement2_get_oncellchange(IHTMLElement2 *iface, VARIANT *p)
677 HTMLElement *This = HTMLELEM2_THIS(iface);
678 FIXME("(%p)->(%p)\n", This, p);
682 static HRESULT WINAPI HTMLElement2_put_dir(IHTMLElement2 *iface, BSTR v)
684 HTMLElement *This = HTMLELEM2_THIS(iface);
685 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
689 static HRESULT WINAPI HTMLElement2_get_dir(IHTMLElement2 *iface, BSTR *p)
691 HTMLElement *This = HTMLELEM2_THIS(iface);
693 TRACE("(%p)->(%p)\n", This, p);
701 nsAString_Init(&dir_str, NULL);
703 nsres = nsIDOMHTMLElement_GetDir(This->nselem, &dir_str);
704 if(NS_SUCCEEDED(nsres)) {
705 const PRUnichar *dir;
706 nsAString_GetData(&dir_str, &dir);
708 *p = SysAllocString(dir);
710 ERR("GetDir failed: %08x\n", nsres);
713 nsAString_Finish(&dir_str);
716 TRACE("ret %s\n", debugstr_w(*p));
720 static HRESULT WINAPI HTMLElement2_createControlRange(IHTMLElement2 *iface, IDispatch **range)
722 HTMLElement *This = HTMLELEM2_THIS(iface);
723 FIXME("(%p)->(%p)\n", This, range);
727 static HRESULT WINAPI HTMLElement2_get_scrollHeight(IHTMLElement2 *iface, long *p)
729 HTMLElement *This = HTMLELEM2_THIS(iface);
730 nsIDOMNSElement *nselem;
734 TRACE("(%p)->(%p)\n", This, p);
736 nsres = nsIDOMElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
737 if(NS_SUCCEEDED(nsres)) {
738 nsres = nsIDOMNSElement_GetScrollHeight(nselem, &height);
739 nsIDOMNSElement_Release(nselem);
741 ERR("GetScrollHeight failed: %08x\n", nsres);
743 ERR("Could not get nsIDOMNSElement interface: %08x\n", nsres);
746 *p = height == -1 ? 0 : height;
747 TRACE("*p = %ld\n", *p);
752 static HRESULT WINAPI HTMLElement2_get_scrollWidth(IHTMLElement2 *iface, long *p)
754 HTMLElement *This = HTMLELEM2_THIS(iface);
755 nsIDOMNSElement *nselem;
759 TRACE("(%p)->(%p)\n", This, p);
761 nsres = nsIDOMElement_QueryInterface(This->nselem, &IID_nsIDOMNSElement, (void**)&nselem);
762 if(NS_SUCCEEDED(nsres)) {
763 nsres = nsIDOMNSElement_GetScrollWidth(nselem, &width);
764 nsIDOMNSElement_Release(nselem);
766 ERR("GetScrollWidth failed: %08x\n", nsres);
768 ERR("Could not get nsIDOMNSElement interface: %08x\n", nsres);
772 TRACE("*p = %ld\n", *p);
777 static HRESULT WINAPI HTMLElement2_put_scrollTop(IHTMLElement2 *iface, long v)
779 HTMLElement *This = HTMLELEM2_THIS(iface);
780 nsIDOMNSElement *nselem;
783 TRACE("(%p)->(%ld)\n", This, v);
786 FIXME("NULL nselem\n");
790 nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSElement, (void**)&nselem);
791 if(NS_SUCCEEDED(nsres)) {
792 nsIDOMNSElement_SetScrollTop(nselem, v);
793 nsIDOMNSElement_Release(nselem);
795 ERR("Could not get nsIDOMNSElement interface: %08x\n", nsres);
801 static HRESULT WINAPI HTMLElement2_get_scrollTop(IHTMLElement2 *iface, long *p)
803 HTMLElement *This = HTMLELEM2_THIS(iface);
804 nsIDOMNSElement *nselem;
808 TRACE("(%p)->(%p)\n", This, p);
810 nsres = nsIDOMElement_QueryInterface(This->nselem, &IID_nsIDOMNSElement, (void**)&nselem);
811 if(NS_SUCCEEDED(nsres)) {
812 nsres = nsIDOMNSElement_GetScrollTop(nselem, &top);
813 nsIDOMNSElement_Release(nselem);
815 ERR("GetScrollTop failed: %08x\n", nsres);
817 ERR("Could not get nsIDOMNSElement interface: %08x\n", nsres);
821 TRACE("*p = %ld\n", *p);
826 static HRESULT WINAPI HTMLElement2_put_scrollLeft(IHTMLElement2 *iface, long v)
828 HTMLElement *This = HTMLELEM2_THIS(iface);
829 nsIDOMNSElement *nselem;
832 TRACE("(%p)->(%ld)\n", This, v);
835 FIXME("NULL nselem\n");
839 nsres = nsIDOMElement_QueryInterface(This->nselem, &IID_nsIDOMNSElement, (void**)&nselem);
840 if(NS_SUCCEEDED(nsres)) {
841 nsIDOMNSElement_SetScrollLeft(nselem, v);
842 nsIDOMNSElement_Release(nselem);
844 ERR("Could not get nsIDOMNSElement interface: %08x\n", nsres);
850 static HRESULT WINAPI HTMLElement2_get_scrollLeft(IHTMLElement2 *iface, long *p)
852 HTMLElement *This = HTMLELEM2_THIS(iface);
853 nsIDOMNSElement *nselem;
857 TRACE("(%p)->(%p)\n", This, p);
864 FIXME("NULL nselem\n");
868 nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSElement, (void**)&nselem);
869 if(NS_SUCCEEDED(nsres))
871 nsres = nsIDOMNSElement_GetScrollLeft(nselem, &left);
872 nsIDOMNSElement_Release(nselem);
878 TRACE("*p = %ld\n", *p);
883 static HRESULT WINAPI HTMLElement2_clearAttributes(IHTMLElement2 *iface)
885 HTMLElement *This = HTMLELEM2_THIS(iface);
886 FIXME("(%p)\n", This);
890 static HRESULT WINAPI HTMLElement2_mergeAttributes(IHTMLElement2 *iface, IHTMLElement *mergeThis)
892 HTMLElement *This = HTMLELEM2_THIS(iface);
893 FIXME("(%p)->(%p)\n", This, mergeThis);
897 static HRESULT WINAPI HTMLElement2_put_oncontextmenu(IHTMLElement2 *iface, VARIANT v)
899 HTMLElement *This = HTMLELEM2_THIS(iface);
900 FIXME("(%p)->()\n", This);
904 static HRESULT WINAPI HTMLElement2_get_oncontextmenu(IHTMLElement2 *iface, VARIANT *p)
906 HTMLElement *This = HTMLELEM2_THIS(iface);
907 FIXME("(%p)->(%p)\n", This, p);
911 static HRESULT WINAPI HTMLElement2_insertAdjecentElement(IHTMLElement2 *iface, BSTR where,
912 IHTMLElement *insertedElement, IHTMLElement **inserted)
914 HTMLElement *This = HTMLELEM2_THIS(iface);
915 FIXME("(%p)->(%s %p %p)\n", This, debugstr_w(where), insertedElement, inserted);
919 static HRESULT WINAPI HTMLElement2_applyElement(IHTMLElement2 *iface, IHTMLElement *apply,
920 BSTR where, IHTMLElement **applied)
922 HTMLElement *This = HTMLELEM2_THIS(iface);
923 FIXME("(%p)->(%p %s %p)\n", This, apply, debugstr_w(where), applied);
927 static HRESULT WINAPI HTMLElement2_getAdjecentText(IHTMLElement2 *iface, BSTR where, BSTR *text)
929 HTMLElement *This = HTMLELEM2_THIS(iface);
930 FIXME("(%p)->(%s %p)\n", This, debugstr_w(where), text);
934 static HRESULT WINAPI HTMLElement2_replaceAdjecentText(IHTMLElement2 *iface, BSTR where,
935 BSTR newText, BSTR *oldText)
937 HTMLElement *This = HTMLELEM2_THIS(iface);
938 FIXME("(%p)->(%s %s %p)\n", This, debugstr_w(where), debugstr_w(newText), oldText);
942 static HRESULT WINAPI HTMLElement2_get_canHandleChildren(IHTMLElement2 *iface, VARIANT_BOOL *p)
944 HTMLElement *This = HTMLELEM2_THIS(iface);
945 FIXME("(%p)->(%p)\n", This, p);
949 static HRESULT WINAPI HTMLElement2_addBehavior(IHTMLElement2 *iface, BSTR bstrUrl,
950 VARIANT *pvarFactory, long *pCookie)
952 HTMLElement *This = HTMLELEM2_THIS(iface);
953 FIXME("(%p)->(%s %p %p)\n", This, debugstr_w(bstrUrl), pvarFactory, pCookie);
957 static HRESULT WINAPI HTMLElement2_removeBehavior(IHTMLElement2 *iface, long cookie,
958 VARIANT_BOOL *pfResult)
960 HTMLElement *This = HTMLELEM2_THIS(iface);
961 FIXME("(%p)->(%ld %p)\n", This, cookie, pfResult);
965 static HRESULT WINAPI HTMLElement2_get_runtimeStyle(IHTMLElement2 *iface, IHTMLStyle **p)
967 HTMLElement *This = HTMLELEM2_THIS(iface);
968 FIXME("(%p)->(%p)\n", This, p);
972 static HRESULT WINAPI HTMLElement2_get_behaviorUrns(IHTMLElement2 *iface, IDispatch **p)
974 HTMLElement *This = HTMLELEM2_THIS(iface);
975 FIXME("(%p)->(%p)\n", This, p);
979 static HRESULT WINAPI HTMLElement2_put_tagUrn(IHTMLElement2 *iface, BSTR v)
981 HTMLElement *This = HTMLELEM2_THIS(iface);
982 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
986 static HRESULT WINAPI HTMLElement2_get_tagUrn(IHTMLElement2 *iface, BSTR *p)
988 HTMLElement *This = HTMLELEM2_THIS(iface);
989 FIXME("(%p)->(%p)\n", This, p);
993 static HRESULT WINAPI HTMLElement2_put_onbeforeeditfocus(IHTMLElement2 *iface, VARIANT vv)
995 HTMLElement *This = HTMLELEM2_THIS(iface);
996 FIXME("(%p)->()\n", This);
1000 static HRESULT WINAPI HTMLElement2_get_onbeforeeditfocus(IHTMLElement2 *iface, VARIANT *p)
1002 HTMLElement *This = HTMLELEM2_THIS(iface);
1003 FIXME("(%p)->(%p)\n", This, p);
1007 static HRESULT WINAPI HTMLElement2_get_readyStateValue(IHTMLElement2 *iface, long *p)
1009 HTMLElement *This = HTMLELEM2_THIS(iface);
1010 FIXME("(%p)->(%p)\n", This, p);
1014 static HRESULT WINAPI HTMLElement2_getElementsByTagName(IHTMLElement2 *iface, BSTR v,
1015 IHTMLElementCollection **pelColl)
1017 HTMLElement *This = HTMLELEM2_THIS(iface);
1018 nsIDOMNodeList *nslist;
1022 TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), pelColl);
1024 nsAString_Init(&tag_str, v);
1025 nsres = nsIDOMHTMLElement_GetElementsByTagName(This->nselem, &tag_str, &nslist);
1026 nsAString_Finish(&tag_str);
1027 if(NS_FAILED(nsres)) {
1028 ERR("GetElementByTagName failed: %08x\n", nsres);
1032 *pelColl = create_collection_from_nodelist(This->node.doc, (IUnknown*)HTMLELEM(This), nslist);
1033 nsIDOMNodeList_Release(nslist);
1037 #undef HTMLELEM2_THIS
1039 static const IHTMLElement2Vtbl HTMLElement2Vtbl = {
1040 HTMLElement2_QueryInterface,
1041 HTMLElement2_AddRef,
1042 HTMLElement2_Release,
1043 HTMLElement2_GetTypeInfoCount,
1044 HTMLElement2_GetTypeInfo,
1045 HTMLElement2_GetIDsOfNames,
1046 HTMLElement2_Invoke,
1047 HTMLElement2_get_scopeName,
1048 HTMLElement2_setCapture,
1049 HTMLElement2_releaseCapture,
1050 HTMLElement2_put_onlosecapture,
1051 HTMLElement2_get_onlosecapture,
1052 HTMLElement2_componentFromPoint,
1053 HTMLElement2_doScroll,
1054 HTMLElement2_put_onscroll,
1055 HTMLElement2_get_onscroll,
1056 HTMLElement2_put_ondrag,
1057 HTMLElement2_get_ondrag,
1058 HTMLElement2_put_ondragend,
1059 HTMLElement2_get_ondragend,
1060 HTMLElement2_put_ondragenter,
1061 HTMLElement2_get_ondragenter,
1062 HTMLElement2_put_ondragover,
1063 HTMLElement2_get_ondragover,
1064 HTMLElement2_put_ondragleave,
1065 HTMLElement2_get_ondragleave,
1066 HTMLElement2_put_ondrop,
1067 HTMLElement2_get_ondrop,
1068 HTMLElement2_put_onbeforecut,
1069 HTMLElement2_get_onbeforecut,
1070 HTMLElement2_put_oncut,
1071 HTMLElement2_get_oncut,
1072 HTMLElement2_put_onbeforecopy,
1073 HTMLElement2_get_onbeforecopy,
1074 HTMLElement2_put_oncopy,
1075 HTMLElement2_get_oncopy,
1076 HTMLElement2_put_onbeforepaste,
1077 HTMLElement2_get_onbeforepaste,
1078 HTMLElement2_put_onpaste,
1079 HTMLElement2_get_onpaste,
1080 HTMLElement2_get_currentStyle,
1081 HTMLElement2_put_onpropertychange,
1082 HTMLElement2_get_onpropertychange,
1083 HTMLElement2_getClientRects,
1084 HTMLElement2_getBoundingClientRect,
1085 HTMLElement2_setExpression,
1086 HTMLElement2_getExpression,
1087 HTMLElement2_removeExpression,
1088 HTMLElement2_put_tabIndex,
1089 HTMLElement2_get_tabIndex,
1091 HTMLElement2_put_accessKey,
1092 HTMLElement2_get_accessKey,
1093 HTMLElement2_put_onblur,
1094 HTMLElement2_get_onblur,
1095 HTMLElement2_put_onfocus,
1096 HTMLElement2_get_onfocus,
1097 HTMLElement2_put_onresize,
1098 HTMLElement2_get_onresize,
1100 HTMLElement2_addFilter,
1101 HTMLElement2_removeFilter,
1102 HTMLElement2_get_clientHeight,
1103 HTMLElement2_get_clientWidth,
1104 HTMLElement2_get_clientTop,
1105 HTMLElement2_get_clientLeft,
1106 HTMLElement2_attachEvent,
1107 HTMLElement2_detachEvent,
1108 HTMLElement2_get_readyState,
1109 HTMLElement2_put_onreadystatechange,
1110 HTMLElement2_get_onreadystatechange,
1111 HTMLElement2_put_onrowsdelete,
1112 HTMLElement2_get_onrowsdelete,
1113 HTMLElement2_put_onrowsinserted,
1114 HTMLElement2_get_onrowsinserted,
1115 HTMLElement2_put_oncellchange,
1116 HTMLElement2_get_oncellchange,
1117 HTMLElement2_put_dir,
1118 HTMLElement2_get_dir,
1119 HTMLElement2_createControlRange,
1120 HTMLElement2_get_scrollHeight,
1121 HTMLElement2_get_scrollWidth,
1122 HTMLElement2_put_scrollTop,
1123 HTMLElement2_get_scrollTop,
1124 HTMLElement2_put_scrollLeft,
1125 HTMLElement2_get_scrollLeft,
1126 HTMLElement2_clearAttributes,
1127 HTMLElement2_mergeAttributes,
1128 HTMLElement2_put_oncontextmenu,
1129 HTMLElement2_get_oncontextmenu,
1130 HTMLElement2_insertAdjecentElement,
1131 HTMLElement2_applyElement,
1132 HTMLElement2_getAdjecentText,
1133 HTMLElement2_replaceAdjecentText,
1134 HTMLElement2_get_canHandleChildren,
1135 HTMLElement2_addBehavior,
1136 HTMLElement2_removeBehavior,
1137 HTMLElement2_get_runtimeStyle,
1138 HTMLElement2_get_behaviorUrns,
1139 HTMLElement2_put_tagUrn,
1140 HTMLElement2_get_tagUrn,
1141 HTMLElement2_put_onbeforeeditfocus,
1142 HTMLElement2_get_onbeforeeditfocus,
1143 HTMLElement2_get_readyStateValue,
1144 HTMLElement2_getElementsByTagName,
1147 void HTMLElement2_Init(HTMLElement *This)
1149 This->lpHTMLElement2Vtbl = &HTMLElement2Vtbl;