wininet: Support the Cache-Control max-age directive for setting url cache entry...
[wine/testsucceed.git] / dlls / mshtml / htmlelem3.c
blobb23c5adfccf7834317cebd7a322c27c958b53d3d
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"
29 #include "wine/unicode.h"
31 #include "mshtml_private.h"
32 #include "htmlevent.h"
34 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
36 static inline HTMLElement *impl_from_IHTMLElement3(IHTMLElement3 *iface)
38 return CONTAINING_RECORD(iface, HTMLElement, IHTMLElement3_iface);
41 static HRESULT WINAPI HTMLElement3_QueryInterface(IHTMLElement3 *iface,
42 REFIID riid, void **ppv)
44 HTMLElement *This = impl_from_IHTMLElement3(iface);
45 return IHTMLElement_QueryInterface(&This->IHTMLElement_iface, riid, ppv);
48 static ULONG WINAPI HTMLElement3_AddRef(IHTMLElement3 *iface)
50 HTMLElement *This = impl_from_IHTMLElement3(iface);
51 return IHTMLElement_AddRef(&This->IHTMLElement_iface);
54 static ULONG WINAPI HTMLElement3_Release(IHTMLElement3 *iface)
56 HTMLElement *This = impl_from_IHTMLElement3(iface);
57 return IHTMLElement_Release(&This->IHTMLElement_iface);
60 static HRESULT WINAPI HTMLElement3_GetTypeInfoCount(IHTMLElement3 *iface, UINT *pctinfo)
62 HTMLElement *This = impl_from_IHTMLElement3(iface);
63 return IDispatchEx_GetTypeInfoCount(&This->node.dispex.IDispatchEx_iface, pctinfo);
66 static HRESULT WINAPI HTMLElement3_GetTypeInfo(IHTMLElement3 *iface, UINT iTInfo,
67 LCID lcid, ITypeInfo **ppTInfo)
69 HTMLElement *This = impl_from_IHTMLElement3(iface);
70 return IDispatchEx_GetTypeInfo(&This->node.dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
73 static HRESULT WINAPI HTMLElement3_GetIDsOfNames(IHTMLElement3 *iface, REFIID riid,
74 LPOLESTR *rgszNames, UINT cNames,
75 LCID lcid, DISPID *rgDispId)
77 HTMLElement *This = impl_from_IHTMLElement3(iface);
78 return IDispatchEx_GetIDsOfNames(&This->node.dispex.IDispatchEx_iface, riid, rgszNames, cNames,
79 lcid, rgDispId);
82 static HRESULT WINAPI HTMLElement3_Invoke(IHTMLElement3 *iface, DISPID dispIdMember,
83 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
84 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
86 HTMLElement *This = impl_from_IHTMLElement3(iface);
87 return IDispatchEx_Invoke(&This->node.dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
88 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
91 static HRESULT WINAPI HTMLElement3_mergeAttributes(IHTMLElement3 *iface, IHTMLElement *mergeThis, VARIANT *pvarFlags)
93 HTMLElement *This = impl_from_IHTMLElement3(iface);
94 FIXME("(%p)->(%p %p)\n", This, mergeThis, pvarFlags);
95 return E_NOTIMPL;
98 static HRESULT WINAPI HTMLElement3_get_isMultiLine(IHTMLElement3 *iface, VARIANT_BOOL *p)
100 HTMLElement *This = impl_from_IHTMLElement3(iface);
101 FIXME("(%p)->(%p)\n", This, p);
102 return E_NOTIMPL;
105 static HRESULT WINAPI HTMLElement3_get_canHaveHTML(IHTMLElement3 *iface, VARIANT_BOOL *p)
107 HTMLElement *This = impl_from_IHTMLElement3(iface);
108 FIXME("(%p)->(%p)\n", This, p);
109 return E_NOTIMPL;
112 static HRESULT WINAPI HTMLElement3_put_onlayoutcomplete(IHTMLElement3 *iface, VARIANT v)
114 HTMLElement *This = impl_from_IHTMLElement3(iface);
115 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
116 return E_NOTIMPL;
119 static HRESULT WINAPI HTMLElement3_get_onlayoutcomplete(IHTMLElement3 *iface, VARIANT *p)
121 HTMLElement *This = impl_from_IHTMLElement3(iface);
122 FIXME("(%p)->(%p)\n", This, p);
123 return E_NOTIMPL;
126 static HRESULT WINAPI HTMLElement3_put_onpage(IHTMLElement3 *iface, VARIANT v)
128 HTMLElement *This = impl_from_IHTMLElement3(iface);
129 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
130 return E_NOTIMPL;
133 static HRESULT WINAPI HTMLElement3_get_onpage(IHTMLElement3 *iface, VARIANT *p)
135 HTMLElement *This = impl_from_IHTMLElement3(iface);
136 FIXME("(%p)->(%p)\n", This, p);
137 return E_NOTIMPL;
140 static HRESULT WINAPI HTMLElement3_put_inflateBlock(IHTMLElement3 *iface, VARIANT_BOOL v)
142 HTMLElement *This = impl_from_IHTMLElement3(iface);
143 FIXME("(%p)->(%x)\n", This, v);
144 return E_NOTIMPL;
147 static HRESULT WINAPI HTMLElement3_get_inflateBlock(IHTMLElement3 *iface, VARIANT_BOOL *p)
149 HTMLElement *This = impl_from_IHTMLElement3(iface);
150 FIXME("(%p)->(%p)\n", This, p);
151 return E_NOTIMPL;
154 static HRESULT WINAPI HTMLElement3_put_onbeforedeactivate(IHTMLElement3 *iface, VARIANT v)
156 HTMLElement *This = impl_from_IHTMLElement3(iface);
157 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
158 return E_NOTIMPL;
161 static HRESULT WINAPI HTMLElement3_get_onbeforedeactivate(IHTMLElement3 *iface, VARIANT *p)
163 HTMLElement *This = impl_from_IHTMLElement3(iface);
164 FIXME("(%p)->(%p)\n", This, p);
165 return E_NOTIMPL;
168 static HRESULT WINAPI HTMLElement3_setActive(IHTMLElement3 *iface)
170 HTMLElement *This = impl_from_IHTMLElement3(iface);
171 FIXME("(%p)\n", This);
172 return E_NOTIMPL;
175 static HRESULT WINAPI HTMLElement3_put_contentEditable(IHTMLElement3 *iface, BSTR v)
177 HTMLElement *This = impl_from_IHTMLElement3(iface);
178 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
179 return E_NOTIMPL;
182 static HRESULT WINAPI HTMLElement3_get_contentEditable(IHTMLElement3 *iface, BSTR *p)
184 HTMLElement *This = impl_from_IHTMLElement3(iface);
185 FIXME("(%p)->(%p)\n", This, p);
186 return E_NOTIMPL;
189 static HRESULT WINAPI HTMLElement3_get_isContentEditable(IHTMLElement3 *iface, VARIANT_BOOL *p)
191 HTMLElement *This = impl_from_IHTMLElement3(iface);
192 FIXME("(%p)->(%p)\n", This, p);
193 return E_NOTIMPL;
196 static HRESULT WINAPI HTMLElement3_put_hideFocus(IHTMLElement3 *iface, VARIANT_BOOL v)
198 HTMLElement *This = impl_from_IHTMLElement3(iface);
199 FIXME("(%p)->(%x)\n", This, v);
200 return E_NOTIMPL;
203 static HRESULT WINAPI HTMLElement3_get_hideFocus(IHTMLElement3 *iface, VARIANT_BOOL *p)
205 HTMLElement *This = impl_from_IHTMLElement3(iface);
206 FIXME("(%p)->(%p)\n", This, p);
207 return E_NOTIMPL;
210 static const WCHAR disabledW[] = {'d','i','s','a','b','l','e','d',0};
212 static HRESULT WINAPI HTMLElement3_put_disabled(IHTMLElement3 *iface, VARIANT_BOOL v)
214 HTMLElement *This = impl_from_IHTMLElement3(iface);
215 VARIANT *var;
216 HRESULT hres;
218 TRACE("(%p)->(%x)\n", This, v);
220 if(This->node.vtbl->put_disabled)
221 return This->node.vtbl->put_disabled(&This->node, v);
223 hres = dispex_get_dprop_ref(&This->node.dispex, disabledW, TRUE, &var);
224 if(FAILED(hres))
225 return hres;
227 VariantClear(var);
228 V_VT(var) = VT_BOOL;
229 V_BOOL(var) = v;
230 return S_OK;
233 static HRESULT WINAPI HTMLElement3_get_disabled(IHTMLElement3 *iface, VARIANT_BOOL *p)
235 HTMLElement *This = impl_from_IHTMLElement3(iface);
236 VARIANT *var;
237 HRESULT hres;
239 TRACE("(%p)->(%p)\n", This, p);
241 if(This->node.vtbl->get_disabled)
242 return This->node.vtbl->get_disabled(&This->node, p);
244 hres = dispex_get_dprop_ref(&This->node.dispex, disabledW, FALSE, &var);
245 if(hres == DISP_E_UNKNOWNNAME) {
246 *p = VARIANT_FALSE;
247 return S_OK;
249 if(FAILED(hres))
250 return hres;
252 if(V_VT(var) != VT_BOOL) {
253 FIXME("vt %d\n", V_VT(var));
254 return E_NOTIMPL;
257 *p = V_BOOL(var);
258 return S_OK;
261 static HRESULT WINAPI HTMLElement3_get_isDisabled(IHTMLElement3 *iface, VARIANT_BOOL *p)
263 HTMLElement *This = impl_from_IHTMLElement3(iface);
264 FIXME("(%p)->(%p)\n", This, p);
265 return E_NOTIMPL;
268 static HRESULT WINAPI HTMLElement3_put_onmove(IHTMLElement3 *iface, VARIANT v)
270 HTMLElement *This = impl_from_IHTMLElement3(iface);
271 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
272 return E_NOTIMPL;
275 static HRESULT WINAPI HTMLElement3_get_onmove(IHTMLElement3 *iface, VARIANT *p)
277 HTMLElement *This = impl_from_IHTMLElement3(iface);
278 FIXME("(%p)->(%p)\n", This, p);
279 return E_NOTIMPL;
282 static HRESULT WINAPI HTMLElement3_put_oncontrolselect(IHTMLElement3 *iface, VARIANT v)
284 HTMLElement *This = impl_from_IHTMLElement3(iface);
285 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
286 return E_NOTIMPL;
289 static HRESULT WINAPI HTMLElement3_get_oncontrolselect(IHTMLElement3 *iface, VARIANT *p)
291 HTMLElement *This = impl_from_IHTMLElement3(iface);
292 FIXME("(%p)->(%p)\n", This, p);
293 return E_NOTIMPL;
296 static HRESULT WINAPI HTMLElement3_fireEvent(IHTMLElement3 *iface, BSTR bstrEventName,
297 VARIANT *pvarEventObject, VARIANT_BOOL *pfCancelled)
299 HTMLElement *This = impl_from_IHTMLElement3(iface);
301 TRACE("(%p)->(%s %s %p)\n", This, debugstr_w(bstrEventName), debugstr_variant(pvarEventObject),
302 pfCancelled);
304 return dispatch_event(&This->node, bstrEventName, pvarEventObject, pfCancelled);
307 static HRESULT WINAPI HTMLElement3_put_onresizestart(IHTMLElement3 *iface, VARIANT v)
309 HTMLElement *This = impl_from_IHTMLElement3(iface);
310 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
311 return E_NOTIMPL;
314 static HRESULT WINAPI HTMLElement3_get_onresizestart(IHTMLElement3 *iface, VARIANT *p)
316 HTMLElement *This = impl_from_IHTMLElement3(iface);
317 FIXME("(%p)->(%p)\n", This, p);
318 return E_NOTIMPL;
321 static HRESULT WINAPI HTMLElement3_put_onresizeend(IHTMLElement3 *iface, VARIANT v)
323 HTMLElement *This = impl_from_IHTMLElement3(iface);
324 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
325 return E_NOTIMPL;
328 static HRESULT WINAPI HTMLElement3_get_onresizeend(IHTMLElement3 *iface, VARIANT *p)
330 HTMLElement *This = impl_from_IHTMLElement3(iface);
331 FIXME("(%p)->(%p)\n", This, p);
332 return E_NOTIMPL;
335 static HRESULT WINAPI HTMLElement3_put_onmovestart(IHTMLElement3 *iface, VARIANT v)
337 HTMLElement *This = impl_from_IHTMLElement3(iface);
338 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
339 return E_NOTIMPL;
342 static HRESULT WINAPI HTMLElement3_get_onmovestart(IHTMLElement3 *iface, VARIANT *p)
344 HTMLElement *This = impl_from_IHTMLElement3(iface);
345 FIXME("(%p)->(%p)\n", This, p);
346 return E_NOTIMPL;
349 static HRESULT WINAPI HTMLElement3_put_onmoveend(IHTMLElement3 *iface, VARIANT v)
351 HTMLElement *This = impl_from_IHTMLElement3(iface);
352 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
353 return E_NOTIMPL;
356 static HRESULT WINAPI HTMLElement3_get_onmoveend(IHTMLElement3 *iface, VARIANT *p)
358 HTMLElement *This = impl_from_IHTMLElement3(iface);
359 FIXME("(%p)->(%p)\n", This, p);
360 return E_NOTIMPL;
363 static HRESULT WINAPI HTMLElement3_put_onmousecenter(IHTMLElement3 *iface, VARIANT v)
365 HTMLElement *This = impl_from_IHTMLElement3(iface);
366 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
367 return E_NOTIMPL;
370 static HRESULT WINAPI HTMLElement3_get_onmousecenter(IHTMLElement3 *iface, VARIANT *p)
372 HTMLElement *This = impl_from_IHTMLElement3(iface);
373 FIXME("(%p)->(%p)\n", This, p);
374 return E_NOTIMPL;
377 static HRESULT WINAPI HTMLElement3_put_onmouseleave(IHTMLElement3 *iface, VARIANT v)
379 HTMLElement *This = impl_from_IHTMLElement3(iface);
380 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
381 return E_NOTIMPL;
384 static HRESULT WINAPI HTMLElement3_get_onmouseleave(IHTMLElement3 *iface, VARIANT *p)
386 HTMLElement *This = impl_from_IHTMLElement3(iface);
387 FIXME("(%p)->(%p)\n", This, p);
388 return E_NOTIMPL;
391 static HRESULT WINAPI HTMLElement3_put_onactivate(IHTMLElement3 *iface, VARIANT v)
393 HTMLElement *This = impl_from_IHTMLElement3(iface);
394 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
395 return E_NOTIMPL;
398 static HRESULT WINAPI HTMLElement3_get_onactivate(IHTMLElement3 *iface, VARIANT *p)
400 HTMLElement *This = impl_from_IHTMLElement3(iface);
401 FIXME("(%p)->(%p)\n", This, p);
402 return E_NOTIMPL;
405 static HRESULT WINAPI HTMLElement3_put_ondeactivate(IHTMLElement3 *iface, VARIANT v)
407 HTMLElement *This = impl_from_IHTMLElement3(iface);
408 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
409 return E_NOTIMPL;
412 static HRESULT WINAPI HTMLElement3_get_ondeactivate(IHTMLElement3 *iface, VARIANT *p)
414 HTMLElement *This = impl_from_IHTMLElement3(iface);
415 FIXME("(%p)->(%p)\n", This, p);
416 return E_NOTIMPL;
419 static HRESULT WINAPI HTMLElement3_dragDrop(IHTMLElement3 *iface, VARIANT_BOOL *pfRet)
421 HTMLElement *This = impl_from_IHTMLElement3(iface);
422 FIXME("(%p)->(%p)\n", This, pfRet);
423 return E_NOTIMPL;
426 static HRESULT WINAPI HTMLElement3_get_glyphMode(IHTMLElement3 *iface, LONG *p)
428 HTMLElement *This = impl_from_IHTMLElement3(iface);
429 FIXME("(%p)->(%p)\n", This, p);
430 return E_NOTIMPL;
433 static const IHTMLElement3Vtbl HTMLElement3Vtbl = {
434 HTMLElement3_QueryInterface,
435 HTMLElement3_AddRef,
436 HTMLElement3_Release,
437 HTMLElement3_GetTypeInfoCount,
438 HTMLElement3_GetTypeInfo,
439 HTMLElement3_GetIDsOfNames,
440 HTMLElement3_Invoke,
441 HTMLElement3_mergeAttributes,
442 HTMLElement3_get_isMultiLine,
443 HTMLElement3_get_canHaveHTML,
444 HTMLElement3_put_onlayoutcomplete,
445 HTMLElement3_get_onlayoutcomplete,
446 HTMLElement3_put_onpage,
447 HTMLElement3_get_onpage,
448 HTMLElement3_put_inflateBlock,
449 HTMLElement3_get_inflateBlock,
450 HTMLElement3_put_onbeforedeactivate,
451 HTMLElement3_get_onbeforedeactivate,
452 HTMLElement3_setActive,
453 HTMLElement3_put_contentEditable,
454 HTMLElement3_get_contentEditable,
455 HTMLElement3_get_isContentEditable,
456 HTMLElement3_put_hideFocus,
457 HTMLElement3_get_hideFocus,
458 HTMLElement3_put_disabled,
459 HTMLElement3_get_disabled,
460 HTMLElement3_get_isDisabled,
461 HTMLElement3_put_onmove,
462 HTMLElement3_get_onmove,
463 HTMLElement3_put_oncontrolselect,
464 HTMLElement3_get_oncontrolselect,
465 HTMLElement3_fireEvent,
466 HTMLElement3_put_onresizestart,
467 HTMLElement3_get_onresizestart,
468 HTMLElement3_put_onresizeend,
469 HTMLElement3_get_onresizeend,
470 HTMLElement3_put_onmovestart,
471 HTMLElement3_get_onmovestart,
472 HTMLElement3_put_onmoveend,
473 HTMLElement3_get_onmoveend,
474 HTMLElement3_put_onmousecenter,
475 HTMLElement3_get_onmousecenter,
476 HTMLElement3_put_onmouseleave,
477 HTMLElement3_get_onmouseleave,
478 HTMLElement3_put_onactivate,
479 HTMLElement3_get_onactivate,
480 HTMLElement3_put_ondeactivate,
481 HTMLElement3_get_ondeactivate,
482 HTMLElement3_dragDrop,
483 HTMLElement3_get_glyphMode
486 static inline HTMLElement *impl_from_IHTMLElement4(IHTMLElement4 *iface)
488 return CONTAINING_RECORD(iface, HTMLElement, IHTMLElement4_iface);
491 static HRESULT WINAPI HTMLElement4_QueryInterface(IHTMLElement4 *iface,
492 REFIID riid, void **ppv)
494 HTMLElement *This = impl_from_IHTMLElement4(iface);
495 return IHTMLElement_QueryInterface(&This->IHTMLElement_iface, riid, ppv);
498 static ULONG WINAPI HTMLElement4_AddRef(IHTMLElement4 *iface)
500 HTMLElement *This = impl_from_IHTMLElement4(iface);
501 return IHTMLElement_AddRef(&This->IHTMLElement_iface);
504 static ULONG WINAPI HTMLElement4_Release(IHTMLElement4 *iface)
506 HTMLElement *This = impl_from_IHTMLElement4(iface);
507 return IHTMLElement_Release(&This->IHTMLElement_iface);
510 static HRESULT WINAPI HTMLElement4_GetTypeInfoCount(IHTMLElement4 *iface, UINT *pctinfo)
512 HTMLElement *This = impl_from_IHTMLElement4(iface);
513 return IDispatchEx_GetTypeInfoCount(&This->node.dispex.IDispatchEx_iface, pctinfo);
516 static HRESULT WINAPI HTMLElement4_GetTypeInfo(IHTMLElement4 *iface, UINT iTInfo,
517 LCID lcid, ITypeInfo **ppTInfo)
519 HTMLElement *This = impl_from_IHTMLElement4(iface);
520 return IDispatchEx_GetTypeInfo(&This->node.dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
523 static HRESULT WINAPI HTMLElement4_GetIDsOfNames(IHTMLElement4 *iface, REFIID riid,
524 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
526 HTMLElement *This = impl_from_IHTMLElement4(iface);
527 return IDispatchEx_GetIDsOfNames(&This->node.dispex.IDispatchEx_iface, riid, rgszNames, cNames,
528 lcid, rgDispId);
531 static HRESULT WINAPI HTMLElement4_Invoke(IHTMLElement4 *iface, DISPID dispIdMember, REFIID riid,
532 LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
534 HTMLElement *This = impl_from_IHTMLElement4(iface);
535 return IDispatchEx_Invoke(&This->node.dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
536 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
539 static HRESULT WINAPI HTMLElement4_put_onmousewheel(IHTMLElement4 *iface, VARIANT v)
541 HTMLElement *This = impl_from_IHTMLElement4(iface);
542 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
543 return E_NOTIMPL;
546 static HRESULT WINAPI HTMLElement4_get_onmousewheel(IHTMLElement4 *iface, VARIANT *p)
548 HTMLElement *This = impl_from_IHTMLElement4(iface);
549 FIXME("(%p)->(%p)\n", This, p);
550 return E_NOTIMPL;
553 static HRESULT WINAPI HTMLElement4_normalize(IHTMLElement4 *iface)
555 HTMLElement *This = impl_from_IHTMLElement4(iface);
556 FIXME("(%p)\n", This);
557 return E_NOTIMPL;
560 /* FIXME: This should be done in IDispatchEx implementation layer */
561 static BOOL get_attr_from_nselem(HTMLElement *This, BSTR name, DISPID *dispid)
563 const PRUnichar *v;
564 nsIDOMAttr *nsattr;
565 nsAString nsstr;
566 BSTR val = NULL;
567 nsresult nsres;
568 HRESULT hres;
570 nsAString_InitDepend(&nsstr, name);
571 nsres = nsIDOMHTMLElement_GetAttributeNode(This->nselem, &nsstr, &nsattr);
572 nsAString_Finish(&nsstr);
573 if(NS_FAILED(nsres) || !nsattr)
574 return FALSE;
576 FIXME("HACK\n");
578 nsAString_Init(&nsstr, NULL);
579 nsres = nsIDOMAttr_GetNodeValue(nsattr, &nsstr);
580 if(NS_FAILED(nsres)) {
581 nsAString_Finish(&nsstr);
582 return FALSE;
585 nsAString_GetData(&nsstr, &v);
586 if(*v) {
587 val = SysAllocString(v);
588 if(!val) {
589 nsAString_Finish(&nsstr);
590 return FALSE;
593 nsAString_Finish(&nsstr);
595 hres = IDispatchEx_GetDispID(&This->node.dispex.IDispatchEx_iface, name, fdexNameEnsure, dispid);
596 if(SUCCEEDED(hres)) {
597 VARIANT arg;
598 DISPPARAMS dp = {&arg, NULL, 1, 0};
599 EXCEPINFO ei;
601 V_VT(&arg) = VT_BSTR;
602 V_BSTR(&arg) = val;
603 memset(&ei, 0, sizeof(ei));
604 hres = IDispatchEx_InvokeEx(&This->node.dispex.IDispatchEx_iface, *dispid,
605 LOCALE_SYSTEM_DEFAULT, DISPATCH_PROPERTYPUT, &dp, NULL, &ei, NULL);
608 SysFreeString(val);
609 return SUCCEEDED(hres);
612 static HRESULT WINAPI HTMLElement4_getAttributeNode(IHTMLElement4 *iface, BSTR bstrname, IHTMLDOMAttribute **ppAttribute)
614 HTMLElement *This = impl_from_IHTMLElement4(iface);
615 HTMLDOMAttribute *attr = NULL, *iter;
616 DISPID dispid;
617 HRESULT hres;
619 TRACE("(%p)->(%s %p)\n", This, debugstr_w(bstrname), ppAttribute);
621 hres = IDispatchEx_GetDispID(&This->node.dispex.IDispatchEx_iface, bstrname, fdexNameCaseInsensitive, &dispid);
622 if(hres == DISP_E_UNKNOWNNAME) {
623 if(!get_attr_from_nselem(This, bstrname, &dispid)) {
624 *ppAttribute = NULL;
625 return S_OK;
627 }else if(FAILED(hres)) {
628 return hres;
631 LIST_FOR_EACH_ENTRY(iter, &This->attrs, HTMLDOMAttribute, entry) {
632 if(iter->dispid == dispid) {
633 attr = iter;
634 break;
638 if(!attr) {
639 hres = HTMLDOMAttribute_Create(This, dispid, &attr);
640 if(FAILED(hres))
641 return hres;
644 IHTMLDOMAttribute_AddRef(&attr->IHTMLDOMAttribute_iface);
645 *ppAttribute = &attr->IHTMLDOMAttribute_iface;
646 return S_OK;
649 static HRESULT WINAPI HTMLElement4_setAttributeNode(IHTMLElement4 *iface, IHTMLDOMAttribute *pattr,
650 IHTMLDOMAttribute **ppretAttribute)
652 HTMLElement *This = impl_from_IHTMLElement4(iface);
653 FIXME("(%p)->(%p %p)\n", This, pattr, ppretAttribute);
654 return E_NOTIMPL;
657 static HRESULT WINAPI HTMLElement4_removeAttributeNode(IHTMLElement4 *iface, IHTMLDOMAttribute *pattr,
658 IHTMLDOMAttribute **ppretAttribute)
660 HTMLElement *This = impl_from_IHTMLElement4(iface);
661 FIXME("(%p)->(%p %p)\n", This, pattr, ppretAttribute);
662 return E_NOTIMPL;
665 static HRESULT WINAPI HTMLElement4_put_onbeforeactivate(IHTMLElement4 *iface, VARIANT v)
667 HTMLElement *This = impl_from_IHTMLElement4(iface);
668 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
669 return E_NOTIMPL;
672 static HRESULT WINAPI HTMLElement4_get_onbeforeactivate(IHTMLElement4 *iface, VARIANT *p)
674 HTMLElement *This = impl_from_IHTMLElement4(iface);
675 FIXME("(%p)->(%p)\n", This, p);
676 return E_NOTIMPL;
679 static HRESULT WINAPI HTMLElement4_put_onfocusin(IHTMLElement4 *iface, VARIANT v)
681 HTMLElement *This = impl_from_IHTMLElement4(iface);
682 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
683 return E_NOTIMPL;
686 static HRESULT WINAPI HTMLElement4_get_onfocusin(IHTMLElement4 *iface, VARIANT *p)
688 HTMLElement *This = impl_from_IHTMLElement4(iface);
689 FIXME("(%p)->(%p)\n", This, p);
690 return E_NOTIMPL;
693 static HRESULT WINAPI HTMLElement4_put_onfocusout(IHTMLElement4 *iface, VARIANT v)
695 HTMLElement *This = impl_from_IHTMLElement4(iface);
696 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
697 return E_NOTIMPL;
700 static HRESULT WINAPI HTMLElement4_get_onfocusout(IHTMLElement4 *iface, VARIANT *p)
702 HTMLElement *This = impl_from_IHTMLElement4(iface);
703 FIXME("(%p)->(%p)\n", This, p);
704 return E_NOTIMPL;
707 static const IHTMLElement4Vtbl HTMLElement4Vtbl = {
708 HTMLElement4_QueryInterface,
709 HTMLElement4_AddRef,
710 HTMLElement4_Release,
711 HTMLElement4_GetTypeInfoCount,
712 HTMLElement4_GetTypeInfo,
713 HTMLElement4_GetIDsOfNames,
714 HTMLElement4_Invoke,
715 HTMLElement4_put_onmousewheel,
716 HTMLElement4_get_onmousewheel,
717 HTMLElement4_normalize,
718 HTMLElement4_getAttributeNode,
719 HTMLElement4_setAttributeNode,
720 HTMLElement4_removeAttributeNode,
721 HTMLElement4_put_onbeforeactivate,
722 HTMLElement4_get_onbeforeactivate,
723 HTMLElement4_put_onfocusin,
724 HTMLElement4_get_onfocusin,
725 HTMLElement4_put_onfocusout,
726 HTMLElement4_get_onfocusout
729 void HTMLElement3_Init(HTMLElement *This)
731 This->IHTMLElement3_iface.lpVtbl = &HTMLElement3Vtbl;
732 This->IHTMLElement4_iface.lpVtbl = &HTMLElement4Vtbl;