gdi32: Simplify the code a little by using a separate variable for the return value.
[wine/multimedia.git] / dlls / mshtml / htmlelem3.c
blobece779d1276ebefde9ccf8c93620970dcc36eb7b
1 /*
2 * Copyright 2008 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
19 #include <stdarg.h>
21 #define COBJMACROS
23 #include "windef.h"
24 #include "winbase.h"
25 #include "winuser.h"
26 #include "ole2.h"
28 #include "wine/debug.h"
30 #include "mshtml_private.h"
31 #include "htmlevent.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
35 static inline HTMLElement *impl_from_IHTMLElement3(IHTMLElement3 *iface)
37 return CONTAINING_RECORD(iface, HTMLElement, IHTMLElement3_iface);
40 static HRESULT WINAPI HTMLElement3_QueryInterface(IHTMLElement3 *iface,
41 REFIID riid, void **ppv)
43 HTMLElement *This = impl_from_IHTMLElement3(iface);
44 return IHTMLElement_QueryInterface(&This->IHTMLElement_iface, riid, ppv);
47 static ULONG WINAPI HTMLElement3_AddRef(IHTMLElement3 *iface)
49 HTMLElement *This = impl_from_IHTMLElement3(iface);
50 return IHTMLElement_AddRef(&This->IHTMLElement_iface);
53 static ULONG WINAPI HTMLElement3_Release(IHTMLElement3 *iface)
55 HTMLElement *This = impl_from_IHTMLElement3(iface);
56 return IHTMLElement_Release(&This->IHTMLElement_iface);
59 static HRESULT WINAPI HTMLElement3_GetTypeInfoCount(IHTMLElement3 *iface, UINT *pctinfo)
61 HTMLElement *This = impl_from_IHTMLElement3(iface);
62 return IDispatchEx_GetTypeInfoCount(&This->node.dispex.IDispatchEx_iface, pctinfo);
65 static HRESULT WINAPI HTMLElement3_GetTypeInfo(IHTMLElement3 *iface, UINT iTInfo,
66 LCID lcid, ITypeInfo **ppTInfo)
68 HTMLElement *This = impl_from_IHTMLElement3(iface);
69 return IDispatchEx_GetTypeInfo(&This->node.dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
72 static HRESULT WINAPI HTMLElement3_GetIDsOfNames(IHTMLElement3 *iface, REFIID riid,
73 LPOLESTR *rgszNames, UINT cNames,
74 LCID lcid, DISPID *rgDispId)
76 HTMLElement *This = impl_from_IHTMLElement3(iface);
77 return IDispatchEx_GetIDsOfNames(&This->node.dispex.IDispatchEx_iface, riid, rgszNames, cNames,
78 lcid, rgDispId);
81 static HRESULT WINAPI HTMLElement3_Invoke(IHTMLElement3 *iface, DISPID dispIdMember,
82 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
83 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
85 HTMLElement *This = impl_from_IHTMLElement3(iface);
86 return IDispatchEx_Invoke(&This->node.dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
87 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
90 static HRESULT WINAPI HTMLElement3_mergeAttributes(IHTMLElement3 *iface, IHTMLElement *mergeThis, VARIANT *pvarFlags)
92 HTMLElement *This = impl_from_IHTMLElement3(iface);
93 FIXME("(%p)->(%p %p)\n", This, mergeThis, pvarFlags);
94 return E_NOTIMPL;
97 static HRESULT WINAPI HTMLElement3_get_isMultiLine(IHTMLElement3 *iface, VARIANT_BOOL *p)
99 HTMLElement *This = impl_from_IHTMLElement3(iface);
100 FIXME("(%p)->(%p)\n", This, p);
101 return E_NOTIMPL;
104 static HRESULT WINAPI HTMLElement3_get_canHaveHTML(IHTMLElement3 *iface, VARIANT_BOOL *p)
106 HTMLElement *This = impl_from_IHTMLElement3(iface);
107 FIXME("(%p)->(%p)\n", This, p);
108 return E_NOTIMPL;
111 static HRESULT WINAPI HTMLElement3_put_onlayoutcomplete(IHTMLElement3 *iface, VARIANT v)
113 HTMLElement *This = impl_from_IHTMLElement3(iface);
114 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
115 return E_NOTIMPL;
118 static HRESULT WINAPI HTMLElement3_get_onlayoutcomplete(IHTMLElement3 *iface, VARIANT *p)
120 HTMLElement *This = impl_from_IHTMLElement3(iface);
121 FIXME("(%p)->(%p)\n", This, p);
122 return E_NOTIMPL;
125 static HRESULT WINAPI HTMLElement3_put_onpage(IHTMLElement3 *iface, VARIANT v)
127 HTMLElement *This = impl_from_IHTMLElement3(iface);
128 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
129 return E_NOTIMPL;
132 static HRESULT WINAPI HTMLElement3_get_onpage(IHTMLElement3 *iface, VARIANT *p)
134 HTMLElement *This = impl_from_IHTMLElement3(iface);
135 FIXME("(%p)->(%p)\n", This, p);
136 return E_NOTIMPL;
139 static HRESULT WINAPI HTMLElement3_put_inflateBlock(IHTMLElement3 *iface, VARIANT_BOOL v)
141 HTMLElement *This = impl_from_IHTMLElement3(iface);
142 FIXME("(%p)->(%x)\n", This, v);
143 return E_NOTIMPL;
146 static HRESULT WINAPI HTMLElement3_get_inflateBlock(IHTMLElement3 *iface, VARIANT_BOOL *p)
148 HTMLElement *This = impl_from_IHTMLElement3(iface);
149 FIXME("(%p)->(%p)\n", This, p);
150 return E_NOTIMPL;
153 static HRESULT WINAPI HTMLElement3_put_onbeforedeactivate(IHTMLElement3 *iface, VARIANT v)
155 HTMLElement *This = impl_from_IHTMLElement3(iface);
156 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
157 return E_NOTIMPL;
160 static HRESULT WINAPI HTMLElement3_get_onbeforedeactivate(IHTMLElement3 *iface, VARIANT *p)
162 HTMLElement *This = impl_from_IHTMLElement3(iface);
163 FIXME("(%p)->(%p)\n", This, p);
164 return E_NOTIMPL;
167 static HRESULT WINAPI HTMLElement3_setActive(IHTMLElement3 *iface)
169 HTMLElement *This = impl_from_IHTMLElement3(iface);
170 FIXME("(%p)\n", This);
171 return E_NOTIMPL;
174 static HRESULT WINAPI HTMLElement3_put_contentEditable(IHTMLElement3 *iface, BSTR v)
176 HTMLElement *This = impl_from_IHTMLElement3(iface);
177 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
178 return E_NOTIMPL;
181 static HRESULT WINAPI HTMLElement3_get_contentEditable(IHTMLElement3 *iface, BSTR *p)
183 HTMLElement *This = impl_from_IHTMLElement3(iface);
184 FIXME("(%p)->(%p)\n", This, p);
185 return E_NOTIMPL;
188 static HRESULT WINAPI HTMLElement3_get_isContentEditable(IHTMLElement3 *iface, VARIANT_BOOL *p)
190 HTMLElement *This = impl_from_IHTMLElement3(iface);
191 FIXME("(%p)->(%p)\n", This, p);
192 return E_NOTIMPL;
195 static HRESULT WINAPI HTMLElement3_put_hideFocus(IHTMLElement3 *iface, VARIANT_BOOL v)
197 HTMLElement *This = impl_from_IHTMLElement3(iface);
198 FIXME("(%p)->(%x)\n", This, v);
199 return E_NOTIMPL;
202 static HRESULT WINAPI HTMLElement3_get_hideFocus(IHTMLElement3 *iface, VARIANT_BOOL *p)
204 HTMLElement *This = impl_from_IHTMLElement3(iface);
205 FIXME("(%p)->(%p)\n", This, p);
206 return E_NOTIMPL;
209 static const WCHAR disabledW[] = {'d','i','s','a','b','l','e','d',0};
211 static HRESULT WINAPI HTMLElement3_put_disabled(IHTMLElement3 *iface, VARIANT_BOOL v)
213 HTMLElement *This = impl_from_IHTMLElement3(iface);
214 VARIANT *var;
215 HRESULT hres;
217 TRACE("(%p)->(%x)\n", This, v);
219 if(This->node.vtbl->put_disabled)
220 return This->node.vtbl->put_disabled(&This->node, v);
222 hres = dispex_get_dprop_ref(&This->node.dispex, disabledW, TRUE, &var);
223 if(FAILED(hres))
224 return hres;
226 VariantClear(var);
227 V_VT(var) = VT_BOOL;
228 V_BOOL(var) = v;
229 return S_OK;
232 static HRESULT WINAPI HTMLElement3_get_disabled(IHTMLElement3 *iface, VARIANT_BOOL *p)
234 HTMLElement *This = impl_from_IHTMLElement3(iface);
235 VARIANT *var;
236 HRESULT hres;
238 TRACE("(%p)->(%p)\n", This, p);
240 if(This->node.vtbl->get_disabled)
241 return This->node.vtbl->get_disabled(&This->node, p);
243 hres = dispex_get_dprop_ref(&This->node.dispex, disabledW, FALSE, &var);
244 if(hres == DISP_E_UNKNOWNNAME) {
245 *p = VARIANT_FALSE;
246 return S_OK;
248 if(FAILED(hres))
249 return hres;
251 if(V_VT(var) != VT_BOOL) {
252 FIXME("vt %d\n", V_VT(var));
253 return E_NOTIMPL;
256 *p = V_BOOL(var);
257 return S_OK;
260 static HRESULT WINAPI HTMLElement3_get_isDisabled(IHTMLElement3 *iface, VARIANT_BOOL *p)
262 HTMLElement *This = impl_from_IHTMLElement3(iface);
263 FIXME("(%p)->(%p)\n", This, p);
264 return E_NOTIMPL;
267 static HRESULT WINAPI HTMLElement3_put_onmove(IHTMLElement3 *iface, VARIANT v)
269 HTMLElement *This = impl_from_IHTMLElement3(iface);
270 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
271 return E_NOTIMPL;
274 static HRESULT WINAPI HTMLElement3_get_onmove(IHTMLElement3 *iface, VARIANT *p)
276 HTMLElement *This = impl_from_IHTMLElement3(iface);
277 FIXME("(%p)->(%p)\n", This, p);
278 return E_NOTIMPL;
281 static HRESULT WINAPI HTMLElement3_put_oncontrolselect(IHTMLElement3 *iface, VARIANT v)
283 HTMLElement *This = impl_from_IHTMLElement3(iface);
284 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
285 return E_NOTIMPL;
288 static HRESULT WINAPI HTMLElement3_get_oncontrolselect(IHTMLElement3 *iface, VARIANT *p)
290 HTMLElement *This = impl_from_IHTMLElement3(iface);
291 FIXME("(%p)->(%p)\n", This, p);
292 return E_NOTIMPL;
295 static HRESULT WINAPI HTMLElement3_fireEvent(IHTMLElement3 *iface, BSTR bstrEventName,
296 VARIANT *pvarEventObject, VARIANT_BOOL *pfCancelled)
298 HTMLElement *This = impl_from_IHTMLElement3(iface);
300 TRACE("(%p)->(%s %s %p)\n", This, debugstr_w(bstrEventName), debugstr_variant(pvarEventObject),
301 pfCancelled);
303 return dispatch_event(&This->node, bstrEventName, pvarEventObject, pfCancelled);
306 static HRESULT WINAPI HTMLElement3_put_onresizestart(IHTMLElement3 *iface, VARIANT v)
308 HTMLElement *This = impl_from_IHTMLElement3(iface);
309 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
310 return E_NOTIMPL;
313 static HRESULT WINAPI HTMLElement3_get_onresizestart(IHTMLElement3 *iface, VARIANT *p)
315 HTMLElement *This = impl_from_IHTMLElement3(iface);
316 FIXME("(%p)->(%p)\n", This, p);
317 return E_NOTIMPL;
320 static HRESULT WINAPI HTMLElement3_put_onresizeend(IHTMLElement3 *iface, VARIANT v)
322 HTMLElement *This = impl_from_IHTMLElement3(iface);
323 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
324 return E_NOTIMPL;
327 static HRESULT WINAPI HTMLElement3_get_onresizeend(IHTMLElement3 *iface, VARIANT *p)
329 HTMLElement *This = impl_from_IHTMLElement3(iface);
330 FIXME("(%p)->(%p)\n", This, p);
331 return E_NOTIMPL;
334 static HRESULT WINAPI HTMLElement3_put_onmovestart(IHTMLElement3 *iface, VARIANT v)
336 HTMLElement *This = impl_from_IHTMLElement3(iface);
337 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
338 return E_NOTIMPL;
341 static HRESULT WINAPI HTMLElement3_get_onmovestart(IHTMLElement3 *iface, VARIANT *p)
343 HTMLElement *This = impl_from_IHTMLElement3(iface);
344 FIXME("(%p)->(%p)\n", This, p);
345 return E_NOTIMPL;
348 static HRESULT WINAPI HTMLElement3_put_onmoveend(IHTMLElement3 *iface, VARIANT v)
350 HTMLElement *This = impl_from_IHTMLElement3(iface);
351 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
352 return E_NOTIMPL;
355 static HRESULT WINAPI HTMLElement3_get_onmoveend(IHTMLElement3 *iface, VARIANT *p)
357 HTMLElement *This = impl_from_IHTMLElement3(iface);
358 FIXME("(%p)->(%p)\n", This, p);
359 return E_NOTIMPL;
362 static HRESULT WINAPI HTMLElement3_put_onmousecenter(IHTMLElement3 *iface, VARIANT v)
364 HTMLElement *This = impl_from_IHTMLElement3(iface);
365 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
366 return E_NOTIMPL;
369 static HRESULT WINAPI HTMLElement3_get_onmousecenter(IHTMLElement3 *iface, VARIANT *p)
371 HTMLElement *This = impl_from_IHTMLElement3(iface);
372 FIXME("(%p)->(%p)\n", This, p);
373 return E_NOTIMPL;
376 static HRESULT WINAPI HTMLElement3_put_onmouseleave(IHTMLElement3 *iface, VARIANT v)
378 HTMLElement *This = impl_from_IHTMLElement3(iface);
379 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
380 return E_NOTIMPL;
383 static HRESULT WINAPI HTMLElement3_get_onmouseleave(IHTMLElement3 *iface, VARIANT *p)
385 HTMLElement *This = impl_from_IHTMLElement3(iface);
386 FIXME("(%p)->(%p)\n", This, p);
387 return E_NOTIMPL;
390 static HRESULT WINAPI HTMLElement3_put_onactivate(IHTMLElement3 *iface, VARIANT v)
392 HTMLElement *This = impl_from_IHTMLElement3(iface);
393 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
394 return E_NOTIMPL;
397 static HRESULT WINAPI HTMLElement3_get_onactivate(IHTMLElement3 *iface, VARIANT *p)
399 HTMLElement *This = impl_from_IHTMLElement3(iface);
400 FIXME("(%p)->(%p)\n", This, p);
401 return E_NOTIMPL;
404 static HRESULT WINAPI HTMLElement3_put_ondeactivate(IHTMLElement3 *iface, VARIANT v)
406 HTMLElement *This = impl_from_IHTMLElement3(iface);
407 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
408 return E_NOTIMPL;
411 static HRESULT WINAPI HTMLElement3_get_ondeactivate(IHTMLElement3 *iface, VARIANT *p)
413 HTMLElement *This = impl_from_IHTMLElement3(iface);
414 FIXME("(%p)->(%p)\n", This, p);
415 return E_NOTIMPL;
418 static HRESULT WINAPI HTMLElement3_dragDrop(IHTMLElement3 *iface, VARIANT_BOOL *pfRet)
420 HTMLElement *This = impl_from_IHTMLElement3(iface);
421 FIXME("(%p)->(%p)\n", This, pfRet);
422 return E_NOTIMPL;
425 static HRESULT WINAPI HTMLElement3_get_glyphMode(IHTMLElement3 *iface, LONG *p)
427 HTMLElement *This = impl_from_IHTMLElement3(iface);
428 FIXME("(%p)->(%p)\n", This, p);
429 return E_NOTIMPL;
432 static const IHTMLElement3Vtbl HTMLElement3Vtbl = {
433 HTMLElement3_QueryInterface,
434 HTMLElement3_AddRef,
435 HTMLElement3_Release,
436 HTMLElement3_GetTypeInfoCount,
437 HTMLElement3_GetTypeInfo,
438 HTMLElement3_GetIDsOfNames,
439 HTMLElement3_Invoke,
440 HTMLElement3_mergeAttributes,
441 HTMLElement3_get_isMultiLine,
442 HTMLElement3_get_canHaveHTML,
443 HTMLElement3_put_onlayoutcomplete,
444 HTMLElement3_get_onlayoutcomplete,
445 HTMLElement3_put_onpage,
446 HTMLElement3_get_onpage,
447 HTMLElement3_put_inflateBlock,
448 HTMLElement3_get_inflateBlock,
449 HTMLElement3_put_onbeforedeactivate,
450 HTMLElement3_get_onbeforedeactivate,
451 HTMLElement3_setActive,
452 HTMLElement3_put_contentEditable,
453 HTMLElement3_get_contentEditable,
454 HTMLElement3_get_isContentEditable,
455 HTMLElement3_put_hideFocus,
456 HTMLElement3_get_hideFocus,
457 HTMLElement3_put_disabled,
458 HTMLElement3_get_disabled,
459 HTMLElement3_get_isDisabled,
460 HTMLElement3_put_onmove,
461 HTMLElement3_get_onmove,
462 HTMLElement3_put_oncontrolselect,
463 HTMLElement3_get_oncontrolselect,
464 HTMLElement3_fireEvent,
465 HTMLElement3_put_onresizestart,
466 HTMLElement3_get_onresizestart,
467 HTMLElement3_put_onresizeend,
468 HTMLElement3_get_onresizeend,
469 HTMLElement3_put_onmovestart,
470 HTMLElement3_get_onmovestart,
471 HTMLElement3_put_onmoveend,
472 HTMLElement3_get_onmoveend,
473 HTMLElement3_put_onmousecenter,
474 HTMLElement3_get_onmousecenter,
475 HTMLElement3_put_onmouseleave,
476 HTMLElement3_get_onmouseleave,
477 HTMLElement3_put_onactivate,
478 HTMLElement3_get_onactivate,
479 HTMLElement3_put_ondeactivate,
480 HTMLElement3_get_ondeactivate,
481 HTMLElement3_dragDrop,
482 HTMLElement3_get_glyphMode
485 static inline HTMLElement *impl_from_IHTMLElement4(IHTMLElement4 *iface)
487 return CONTAINING_RECORD(iface, HTMLElement, IHTMLElement4_iface);
490 static HRESULT WINAPI HTMLElement4_QueryInterface(IHTMLElement4 *iface,
491 REFIID riid, void **ppv)
493 HTMLElement *This = impl_from_IHTMLElement4(iface);
494 return IHTMLElement_QueryInterface(&This->IHTMLElement_iface, riid, ppv);
497 static ULONG WINAPI HTMLElement4_AddRef(IHTMLElement4 *iface)
499 HTMLElement *This = impl_from_IHTMLElement4(iface);
500 return IHTMLElement_AddRef(&This->IHTMLElement_iface);
503 static ULONG WINAPI HTMLElement4_Release(IHTMLElement4 *iface)
505 HTMLElement *This = impl_from_IHTMLElement4(iface);
506 return IHTMLElement_Release(&This->IHTMLElement_iface);
509 static HRESULT WINAPI HTMLElement4_GetTypeInfoCount(IHTMLElement4 *iface, UINT *pctinfo)
511 HTMLElement *This = impl_from_IHTMLElement4(iface);
512 return IDispatchEx_GetTypeInfoCount(&This->node.dispex.IDispatchEx_iface, pctinfo);
515 static HRESULT WINAPI HTMLElement4_GetTypeInfo(IHTMLElement4 *iface, UINT iTInfo,
516 LCID lcid, ITypeInfo **ppTInfo)
518 HTMLElement *This = impl_from_IHTMLElement4(iface);
519 return IDispatchEx_GetTypeInfo(&This->node.dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
522 static HRESULT WINAPI HTMLElement4_GetIDsOfNames(IHTMLElement4 *iface, REFIID riid,
523 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
525 HTMLElement *This = impl_from_IHTMLElement4(iface);
526 return IDispatchEx_GetIDsOfNames(&This->node.dispex.IDispatchEx_iface, riid, rgszNames, cNames,
527 lcid, rgDispId);
530 static HRESULT WINAPI HTMLElement4_Invoke(IHTMLElement4 *iface, DISPID dispIdMember, REFIID riid,
531 LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
533 HTMLElement *This = impl_from_IHTMLElement4(iface);
534 return IDispatchEx_Invoke(&This->node.dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
535 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
538 static HRESULT WINAPI HTMLElement4_put_onmousewheel(IHTMLElement4 *iface, VARIANT v)
540 HTMLElement *This = impl_from_IHTMLElement4(iface);
541 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
542 return E_NOTIMPL;
545 static HRESULT WINAPI HTMLElement4_get_onmousewheel(IHTMLElement4 *iface, VARIANT *p)
547 HTMLElement *This = impl_from_IHTMLElement4(iface);
548 FIXME("(%p)->(%p)\n", This, p);
549 return E_NOTIMPL;
552 static HRESULT WINAPI HTMLElement4_normalize(IHTMLElement4 *iface)
554 HTMLElement *This = impl_from_IHTMLElement4(iface);
555 FIXME("(%p)\n", This);
556 return E_NOTIMPL;
559 /* FIXME: This should be done in IDispatchEx implementation layer */
560 static BOOL get_attr_from_nselem(HTMLElement *This, BSTR name, DISPID *dispid)
562 const PRUnichar *v;
563 nsIDOMAttr *nsattr;
564 nsAString nsstr;
565 BSTR val = NULL;
566 nsresult nsres;
567 HRESULT hres;
569 nsAString_InitDepend(&nsstr, name);
570 nsres = nsIDOMHTMLElement_GetAttributeNode(This->nselem, &nsstr, &nsattr);
571 nsAString_Finish(&nsstr);
572 if(NS_FAILED(nsres) || !nsattr)
573 return FALSE;
575 FIXME("HACK\n");
577 nsAString_Init(&nsstr, NULL);
578 nsres = nsIDOMAttr_GetNodeValue(nsattr, &nsstr);
579 if(NS_FAILED(nsres)) {
580 nsAString_Finish(&nsstr);
581 return FALSE;
584 nsAString_GetData(&nsstr, &v);
585 if(*v) {
586 val = SysAllocString(v);
587 if(!val) {
588 nsAString_Finish(&nsstr);
589 return FALSE;
592 nsAString_Finish(&nsstr);
594 hres = IDispatchEx_GetDispID(&This->node.dispex.IDispatchEx_iface, name, fdexNameEnsure, dispid);
595 if(SUCCEEDED(hres)) {
596 VARIANT arg;
597 DISPPARAMS dp = {&arg, NULL, 1, 0};
598 EXCEPINFO ei;
600 V_VT(&arg) = VT_BSTR;
601 V_BSTR(&arg) = val;
602 memset(&ei, 0, sizeof(ei));
603 hres = IDispatchEx_InvokeEx(&This->node.dispex.IDispatchEx_iface, *dispid,
604 LOCALE_SYSTEM_DEFAULT, DISPATCH_PROPERTYPUT, &dp, NULL, &ei, NULL);
607 SysFreeString(val);
608 return SUCCEEDED(hres);
611 static HRESULT WINAPI HTMLElement4_getAttributeNode(IHTMLElement4 *iface, BSTR bstrname, IHTMLDOMAttribute **ppAttribute)
613 HTMLElement *This = impl_from_IHTMLElement4(iface);
614 HTMLDOMAttribute *attr = NULL, *iter;
615 DISPID dispid;
616 HRESULT hres;
618 TRACE("(%p)->(%s %p)\n", This, debugstr_w(bstrname), ppAttribute);
620 hres = IDispatchEx_GetDispID(&This->node.dispex.IDispatchEx_iface, bstrname, fdexNameCaseInsensitive, &dispid);
621 if(hres == DISP_E_UNKNOWNNAME) {
622 if(!get_attr_from_nselem(This, bstrname, &dispid)) {
623 *ppAttribute = NULL;
624 return S_OK;
626 }else if(FAILED(hres)) {
627 return hres;
630 LIST_FOR_EACH_ENTRY(iter, &This->attrs, HTMLDOMAttribute, entry) {
631 if(iter->dispid == dispid) {
632 attr = iter;
633 break;
637 if(!attr) {
638 hres = HTMLDOMAttribute_Create(This, dispid, &attr);
639 if(FAILED(hres))
640 return hres;
643 IHTMLDOMAttribute_AddRef(&attr->IHTMLDOMAttribute_iface);
644 *ppAttribute = &attr->IHTMLDOMAttribute_iface;
645 return S_OK;
648 static HRESULT WINAPI HTMLElement4_setAttributeNode(IHTMLElement4 *iface, IHTMLDOMAttribute *pattr,
649 IHTMLDOMAttribute **ppretAttribute)
651 HTMLElement *This = impl_from_IHTMLElement4(iface);
652 FIXME("(%p)->(%p %p)\n", This, pattr, ppretAttribute);
653 return E_NOTIMPL;
656 static HRESULT WINAPI HTMLElement4_removeAttributeNode(IHTMLElement4 *iface, IHTMLDOMAttribute *pattr,
657 IHTMLDOMAttribute **ppretAttribute)
659 HTMLElement *This = impl_from_IHTMLElement4(iface);
660 FIXME("(%p)->(%p %p)\n", This, pattr, ppretAttribute);
661 return E_NOTIMPL;
664 static HRESULT WINAPI HTMLElement4_put_onbeforeactivate(IHTMLElement4 *iface, VARIANT v)
666 HTMLElement *This = impl_from_IHTMLElement4(iface);
667 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
668 return E_NOTIMPL;
671 static HRESULT WINAPI HTMLElement4_get_onbeforeactivate(IHTMLElement4 *iface, VARIANT *p)
673 HTMLElement *This = impl_from_IHTMLElement4(iface);
674 FIXME("(%p)->(%p)\n", This, p);
675 return E_NOTIMPL;
678 static HRESULT WINAPI HTMLElement4_put_onfocusin(IHTMLElement4 *iface, VARIANT v)
680 HTMLElement *This = impl_from_IHTMLElement4(iface);
681 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
682 return E_NOTIMPL;
685 static HRESULT WINAPI HTMLElement4_get_onfocusin(IHTMLElement4 *iface, VARIANT *p)
687 HTMLElement *This = impl_from_IHTMLElement4(iface);
688 FIXME("(%p)->(%p)\n", This, p);
689 return E_NOTIMPL;
692 static HRESULT WINAPI HTMLElement4_put_onfocusout(IHTMLElement4 *iface, VARIANT v)
694 HTMLElement *This = impl_from_IHTMLElement4(iface);
695 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
696 return E_NOTIMPL;
699 static HRESULT WINAPI HTMLElement4_get_onfocusout(IHTMLElement4 *iface, VARIANT *p)
701 HTMLElement *This = impl_from_IHTMLElement4(iface);
702 FIXME("(%p)->(%p)\n", This, p);
703 return E_NOTIMPL;
706 static const IHTMLElement4Vtbl HTMLElement4Vtbl = {
707 HTMLElement4_QueryInterface,
708 HTMLElement4_AddRef,
709 HTMLElement4_Release,
710 HTMLElement4_GetTypeInfoCount,
711 HTMLElement4_GetTypeInfo,
712 HTMLElement4_GetIDsOfNames,
713 HTMLElement4_Invoke,
714 HTMLElement4_put_onmousewheel,
715 HTMLElement4_get_onmousewheel,
716 HTMLElement4_normalize,
717 HTMLElement4_getAttributeNode,
718 HTMLElement4_setAttributeNode,
719 HTMLElement4_removeAttributeNode,
720 HTMLElement4_put_onbeforeactivate,
721 HTMLElement4_get_onbeforeactivate,
722 HTMLElement4_put_onfocusin,
723 HTMLElement4_get_onfocusin,
724 HTMLElement4_put_onfocusout,
725 HTMLElement4_get_onfocusout
728 void HTMLElement3_Init(HTMLElement *This)
730 This->IHTMLElement3_iface.lpVtbl = &HTMLElement3Vtbl;
731 This->IHTMLElement4_iface.lpVtbl = &HTMLElement4Vtbl;