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
29 #include "mshtml_private.h"
31 #include "htmlevent.h"
33 #include "wine/debug.h"
35 WINE_DEFAULT_DEBUG_CHANNEL(mshtml
);
37 static const WCHAR autoW
[] = {'a','u','t','o',0};
38 static const WCHAR yesW
[] = {'y','e','s',0};
39 static const WCHAR noW
[] = {'n','o',0};
40 static const WCHAR pxW
[] = {'p','x',0};
42 HRESULT
set_frame_doc(HTMLFrameBase
*frame
, nsIDOMDocument
*nsdoc
)
44 nsIDOMWindow
*nswindow
;
45 HTMLOuterWindow
*window
;
49 if(frame
->content_window
)
52 nsres
= nsIDOMDocument_GetDefaultView(nsdoc
, &nswindow
);
53 if(NS_FAILED(nsres
) || !nswindow
)
56 window
= nswindow_to_window(nswindow
);
58 hres
= HTMLOuterWindow_Create(frame
->element
.node
.doc
->basedoc
.doc_obj
, nswindow
,
59 frame
->element
.node
.doc
->basedoc
.window
, &window
);
60 nsIDOMWindow_Release(nswindow
);
64 frame
->content_window
= window
;
65 window
->frame_element
= frame
;
69 static inline HTMLFrameBase
*impl_from_IHTMLFrameBase(IHTMLFrameBase
*iface
)
71 return CONTAINING_RECORD(iface
, HTMLFrameBase
, IHTMLFrameBase_iface
);
74 static HRESULT WINAPI
HTMLFrameBase_QueryInterface(IHTMLFrameBase
*iface
, REFIID riid
, void **ppv
)
76 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
78 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
81 static ULONG WINAPI
HTMLFrameBase_AddRef(IHTMLFrameBase
*iface
)
83 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
85 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
88 static ULONG WINAPI
HTMLFrameBase_Release(IHTMLFrameBase
*iface
)
90 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
92 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
95 static HRESULT WINAPI
HTMLFrameBase_GetTypeInfoCount(IHTMLFrameBase
*iface
, UINT
*pctinfo
)
97 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
99 return IDispatchEx_GetTypeInfoCount(&This
->element
.node
.dispex
.IDispatchEx_iface
, pctinfo
);
102 static HRESULT WINAPI
HTMLFrameBase_GetTypeInfo(IHTMLFrameBase
*iface
, UINT iTInfo
,
103 LCID lcid
, ITypeInfo
**ppTInfo
)
105 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
107 return IDispatchEx_GetTypeInfo(&This
->element
.node
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
,
111 static HRESULT WINAPI
HTMLFrameBase_GetIDsOfNames(IHTMLFrameBase
*iface
, REFIID riid
,
112 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
114 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
116 return IDispatchEx_GetIDsOfNames(&This
->element
.node
.dispex
.IDispatchEx_iface
, riid
, rgszNames
,
117 cNames
, lcid
, rgDispId
);
120 static HRESULT WINAPI
HTMLFrameBase_Invoke(IHTMLFrameBase
*iface
, DISPID dispIdMember
,
121 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
122 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
124 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
126 return IDispatchEx_Invoke(&This
->element
.node
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
127 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
130 static HRESULT WINAPI
HTMLFrameBase_put_src(IHTMLFrameBase
*iface
, BSTR v
)
132 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
134 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
136 if(!This
->content_window
|| !This
->element
.node
.doc
|| !This
->element
.node
.doc
->basedoc
.window
) {
137 FIXME("detached element\n");
141 return navigate_url(This
->content_window
, v
, This
->element
.node
.doc
->basedoc
.window
->uri
, BINDING_NAVIGATED
);
144 static HRESULT WINAPI
HTMLFrameBase_get_src(IHTMLFrameBase
*iface
, BSTR
*p
)
146 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
147 FIXME("(%p)->(%p)\n", This
, p
);
151 static HRESULT WINAPI
HTMLFrameBase_put_name(IHTMLFrameBase
*iface
, BSTR v
)
153 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
157 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
159 if(!This
->nsframe
&& !This
->nsiframe
) {
160 ERR("No attached ns frame object\n");
164 nsAString_InitDepend(&name_str
, v
);
166 nsres
= nsIDOMHTMLFrameElement_SetName(This
->nsframe
, &name_str
);
168 nsres
= nsIDOMHTMLIFrameElement_SetName(This
->nsiframe
, &name_str
);
169 nsAString_Finish(&name_str
);
170 if(NS_FAILED(nsres
)) {
171 ERR("SetName failed: %08x\n", nsres
);
178 static HRESULT WINAPI
HTMLFrameBase_get_name(IHTMLFrameBase
*iface
, BSTR
*p
)
180 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
184 TRACE("(%p)->(%p)\n", This
, p
);
186 if(!This
->nsframe
&& !This
->nsiframe
) {
187 ERR("No attached ns frame object\n");
191 nsAString_Init(&nsstr
, NULL
);
193 nsres
= nsIDOMHTMLFrameElement_GetName(This
->nsframe
, &nsstr
);
195 nsres
= nsIDOMHTMLIFrameElement_GetName(This
->nsiframe
, &nsstr
);
196 return return_nsstr(nsres
, &nsstr
, p
);
199 static HRESULT WINAPI
HTMLFrameBase_put_border(IHTMLFrameBase
*iface
, VARIANT v
)
201 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
202 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
206 static HRESULT WINAPI
HTMLFrameBase_get_border(IHTMLFrameBase
*iface
, VARIANT
*p
)
208 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
209 FIXME("(%p)->(%p)\n", This
, p
);
213 static HRESULT WINAPI
HTMLFrameBase_put_frameBorder(IHTMLFrameBase
*iface
, BSTR v
)
215 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
219 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
221 if(!This
->nsframe
&& !This
->nsiframe
) {
222 ERR("No attached ns frame object\n");
226 nsAString_InitDepend(&nsstr
, v
);
228 nsres
= nsIDOMHTMLFrameElement_SetFrameBorder(This
->nsframe
, &nsstr
);
230 nsres
= nsIDOMHTMLIFrameElement_SetFrameBorder(This
->nsiframe
, &nsstr
);
231 nsAString_Finish(&nsstr
);
232 if(NS_FAILED(nsres
)) {
233 ERR("SetFrameBorder failed: %08x\n", nsres
);
240 static HRESULT WINAPI
HTMLFrameBase_get_frameBorder(IHTMLFrameBase
*iface
, BSTR
*p
)
242 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
246 TRACE("(%p)->(%p)\n", This
, p
);
248 if(!This
->nsframe
&& !This
->nsiframe
) {
249 ERR("No attached ns frame object\n");
253 nsAString_Init(&nsstr
, NULL
);
255 nsres
= nsIDOMHTMLFrameElement_GetFrameBorder(This
->nsframe
, &nsstr
);
257 nsres
= nsIDOMHTMLIFrameElement_GetFrameBorder(This
->nsiframe
, &nsstr
);
258 return return_nsstr(nsres
, &nsstr
, p
);
261 static HRESULT WINAPI
HTMLFrameBase_put_frameSpacing(IHTMLFrameBase
*iface
, VARIANT v
)
263 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
264 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
268 static HRESULT WINAPI
HTMLFrameBase_get_frameSpacing(IHTMLFrameBase
*iface
, VARIANT
*p
)
270 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
271 FIXME("(%p)->(%p)\n", This
, p
);
275 static HRESULT WINAPI
HTMLFrameBase_put_marginWidth(IHTMLFrameBase
*iface
, VARIANT v
)
277 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
281 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
283 if(V_VT(&v
) != VT_BSTR
) {
284 FIXME("unsupported %s\n", debugstr_variant(&v
));
288 nsAString_InitDepend(&nsstr
, V_BSTR(&v
));
290 nsres
= nsIDOMHTMLFrameElement_SetMarginWidth(This
->nsframe
, &nsstr
);
292 nsres
= nsIDOMHTMLIFrameElement_SetMarginWidth(This
->nsiframe
, &nsstr
);
293 nsAString_Finish(&nsstr
);
294 return NS_SUCCEEDED(nsres
) ? S_OK
: E_FAIL
;
297 static HRESULT WINAPI
HTMLFrameBase_get_marginWidth(IHTMLFrameBase
*iface
, VARIANT
*p
)
299 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
304 TRACE("(%p)->(%p)\n", This
, p
);
306 nsAString_Init(&nsstr
, NULL
);
308 nsres
= nsIDOMHTMLFrameElement_GetMarginWidth(This
->nsframe
, &nsstr
);
310 nsres
= nsIDOMHTMLIFrameElement_GetMarginWidth(This
->nsiframe
, &nsstr
);
311 if(NS_SUCCEEDED(nsres
)) {
312 const PRUnichar
*str
, *end
;
314 nsAString_GetData(&nsstr
, &str
);
319 end
= strstrW(str
, pxW
);
321 end
= str
+strlenW(str
);
322 ret
= SysAllocStringLen(str
, end
-str
);
327 hres
= E_OUTOFMEMORY
;
334 ERR("GetMarginWidth failed: %08x\n", nsres
);
338 nsAString_Finish(&nsstr
);
342 static HRESULT WINAPI
HTMLFrameBase_put_marginHeight(IHTMLFrameBase
*iface
, VARIANT v
)
344 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
348 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
350 if(V_VT(&v
) != VT_BSTR
) {
351 FIXME("unsupported %s\n", debugstr_variant(&v
));
355 nsAString_InitDepend(&nsstr
, V_BSTR(&v
));
357 nsres
= nsIDOMHTMLFrameElement_SetMarginHeight(This
->nsframe
, &nsstr
);
359 nsres
= nsIDOMHTMLIFrameElement_SetMarginHeight(This
->nsiframe
, &nsstr
);
360 nsAString_Finish(&nsstr
);
361 return NS_SUCCEEDED(nsres
) ? S_OK
: E_FAIL
;
364 static HRESULT WINAPI
HTMLFrameBase_get_marginHeight(IHTMLFrameBase
*iface
, VARIANT
*p
)
366 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
371 TRACE("(%p)->(%p)\n", This
, p
);
373 nsAString_Init(&nsstr
, NULL
);
375 nsres
= nsIDOMHTMLFrameElement_GetMarginHeight(This
->nsframe
, &nsstr
);
377 nsres
= nsIDOMHTMLIFrameElement_GetMarginHeight(This
->nsiframe
, &nsstr
);
378 if(NS_SUCCEEDED(nsres
)) {
379 const PRUnichar
*str
, *end
;
381 nsAString_GetData(&nsstr
, &str
);
386 end
= strstrW(str
, pxW
);
388 end
= str
+strlenW(str
);
389 ret
= SysAllocStringLen(str
, end
-str
);
394 hres
= E_OUTOFMEMORY
;
401 ERR("SetMarginHeight failed: %08x\n", nsres
);
405 nsAString_Finish(&nsstr
);
409 static HRESULT WINAPI
HTMLFrameBase_put_noResize(IHTMLFrameBase
*iface
, VARIANT_BOOL v
)
411 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
412 FIXME("(%p)->(%x)\n", This
, v
);
416 static HRESULT WINAPI
HTMLFrameBase_get_noResize(IHTMLFrameBase
*iface
, VARIANT_BOOL
*p
)
418 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
419 FIXME("(%p)->(%p)\n", This
, p
);
423 static HRESULT WINAPI
HTMLFrameBase_put_scrolling(IHTMLFrameBase
*iface
, BSTR v
)
425 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
429 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
431 if(!(!strcmpiW(v
, yesW
) || !strcmpiW(v
, noW
) || !strcmpiW(v
, autoW
)))
435 nsAString_InitDepend(&nsstr
, v
);
436 nsres
= nsIDOMHTMLFrameElement_SetScrolling(This
->nsframe
, &nsstr
);
437 }else if(This
->nsiframe
) {
438 nsAString_InitDepend(&nsstr
, v
);
439 nsres
= nsIDOMHTMLIFrameElement_SetScrolling(This
->nsiframe
, &nsstr
);
441 ERR("No attached ns frame object\n");
444 nsAString_Finish(&nsstr
);
446 if(NS_FAILED(nsres
)) {
447 ERR("SetScrolling failed: 0x%08x\n", nsres
);
454 static HRESULT WINAPI
HTMLFrameBase_get_scrolling(IHTMLFrameBase
*iface
, BSTR
*p
)
456 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
458 const PRUnichar
*strdata
;
461 TRACE("(%p)->(%p)\n", This
, p
);
464 nsAString_Init(&nsstr
, NULL
);
465 nsres
= nsIDOMHTMLFrameElement_GetScrolling(This
->nsframe
, &nsstr
);
466 }else if(This
->nsiframe
) {
467 nsAString_Init(&nsstr
, NULL
);
468 nsres
= nsIDOMHTMLIFrameElement_GetScrolling(This
->nsiframe
, &nsstr
);
470 ERR("No attached ns frame object\n");
474 if(NS_FAILED(nsres
)) {
475 ERR("GetScrolling failed: 0x%08x\n", nsres
);
476 nsAString_Finish(&nsstr
);
480 nsAString_GetData(&nsstr
, &strdata
);
483 *p
= SysAllocString(strdata
);
485 *p
= SysAllocString(autoW
);
487 nsAString_Finish(&nsstr
);
489 return *p
? S_OK
: E_OUTOFMEMORY
;
492 static const IHTMLFrameBaseVtbl HTMLFrameBaseVtbl
= {
493 HTMLFrameBase_QueryInterface
,
494 HTMLFrameBase_AddRef
,
495 HTMLFrameBase_Release
,
496 HTMLFrameBase_GetTypeInfoCount
,
497 HTMLFrameBase_GetTypeInfo
,
498 HTMLFrameBase_GetIDsOfNames
,
499 HTMLFrameBase_Invoke
,
500 HTMLFrameBase_put_src
,
501 HTMLFrameBase_get_src
,
502 HTMLFrameBase_put_name
,
503 HTMLFrameBase_get_name
,
504 HTMLFrameBase_put_border
,
505 HTMLFrameBase_get_border
,
506 HTMLFrameBase_put_frameBorder
,
507 HTMLFrameBase_get_frameBorder
,
508 HTMLFrameBase_put_frameSpacing
,
509 HTMLFrameBase_get_frameSpacing
,
510 HTMLFrameBase_put_marginWidth
,
511 HTMLFrameBase_get_marginWidth
,
512 HTMLFrameBase_put_marginHeight
,
513 HTMLFrameBase_get_marginHeight
,
514 HTMLFrameBase_put_noResize
,
515 HTMLFrameBase_get_noResize
,
516 HTMLFrameBase_put_scrolling
,
517 HTMLFrameBase_get_scrolling
520 static inline HTMLFrameBase
*impl_from_IHTMLFrameBase2(IHTMLFrameBase2
*iface
)
522 return CONTAINING_RECORD(iface
, HTMLFrameBase
, IHTMLFrameBase2_iface
);
525 static HRESULT WINAPI
HTMLFrameBase2_QueryInterface(IHTMLFrameBase2
*iface
, REFIID riid
, void **ppv
)
527 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
529 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
532 static ULONG WINAPI
HTMLFrameBase2_AddRef(IHTMLFrameBase2
*iface
)
534 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
536 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
539 static ULONG WINAPI
HTMLFrameBase2_Release(IHTMLFrameBase2
*iface
)
541 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
543 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
546 static HRESULT WINAPI
HTMLFrameBase2_GetTypeInfoCount(IHTMLFrameBase2
*iface
, UINT
*pctinfo
)
548 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
549 FIXME("(%p)\n", This
);
553 static HRESULT WINAPI
HTMLFrameBase2_GetTypeInfo(IHTMLFrameBase2
*iface
, UINT iTInfo
,
554 LCID lcid
, ITypeInfo
**ppTInfo
)
556 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
557 FIXME("(%p)\n", This
);
561 static HRESULT WINAPI
HTMLFrameBase2_GetIDsOfNames(IHTMLFrameBase2
*iface
, REFIID riid
,
562 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
564 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
565 FIXME("(%p)\n", This
);
569 static HRESULT WINAPI
HTMLFrameBase2_Invoke(IHTMLFrameBase2
*iface
, DISPID dispIdMember
,
570 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
571 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
573 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
574 FIXME("(%p)\n", This
);
578 static HRESULT WINAPI
HTMLFrameBase2_get_contentWindow(IHTMLFrameBase2
*iface
, IHTMLWindow2
**p
)
580 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
582 TRACE("(%p)->(%p)\n", This
, p
);
584 if(This
->content_window
) {
585 IHTMLWindow2_AddRef(&This
->content_window
->base
.IHTMLWindow2_iface
);
586 *p
= &This
->content_window
->base
.IHTMLWindow2_iface
;
588 WARN("NULL content window\n");
594 static HRESULT WINAPI
HTMLFrameBase2_put_onload(IHTMLFrameBase2
*iface
, VARIANT v
)
596 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
598 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
600 return set_node_event(&This
->element
.node
, EVENTID_LOAD
, &v
);
603 static HRESULT WINAPI
HTMLFrameBase2_get_onload(IHTMLFrameBase2
*iface
, VARIANT
*p
)
605 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
607 TRACE("(%p)->(%p)\n", This
, p
);
609 return get_node_event(&This
->element
.node
, EVENTID_LOAD
, p
);
612 static HRESULT WINAPI
HTMLFrameBase2_put_onreadystatechange(IHTMLFrameBase2
*iface
, VARIANT v
)
614 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
615 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
619 static HRESULT WINAPI
HTMLFrameBase2_get_onreadystatechange(IHTMLFrameBase2
*iface
, VARIANT
*p
)
621 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
622 FIXME("(%p)->(%p)\n", This
, p
);
626 static HRESULT WINAPI
HTMLFrameBase2_get_readyState(IHTMLFrameBase2
*iface
, BSTR
*p
)
628 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
630 TRACE("(%p)->(%p)\n", This
, p
);
632 if(!This
->content_window
|| !This
->content_window
->base
.inner_window
->doc
) {
633 FIXME("no document associated\n");
637 return IHTMLDocument2_get_readyState(&This
->content_window
->base
.inner_window
->doc
->basedoc
.IHTMLDocument2_iface
, p
);
640 static HRESULT WINAPI
HTMLFrameBase2_put_allowTransparency(IHTMLFrameBase2
*iface
, VARIANT_BOOL v
)
642 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
643 FIXME("(%p)->(%x)\n", This
, v
);
647 static HRESULT WINAPI
HTMLFrameBase2_get_allowTransparency(IHTMLFrameBase2
*iface
, VARIANT_BOOL
*p
)
649 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
650 FIXME("(%p)->(%p)\n", This
, p
);
654 static const IHTMLFrameBase2Vtbl HTMLFrameBase2Vtbl
= {
655 HTMLFrameBase2_QueryInterface
,
656 HTMLFrameBase2_AddRef
,
657 HTMLFrameBase2_Release
,
658 HTMLFrameBase2_GetTypeInfoCount
,
659 HTMLFrameBase2_GetTypeInfo
,
660 HTMLFrameBase2_GetIDsOfNames
,
661 HTMLFrameBase2_Invoke
,
662 HTMLFrameBase2_get_contentWindow
,
663 HTMLFrameBase2_put_onload
,
664 HTMLFrameBase2_get_onload
,
665 HTMLFrameBase2_put_onreadystatechange
,
666 HTMLFrameBase2_get_onreadystatechange
,
667 HTMLFrameBase2_get_readyState
,
668 HTMLFrameBase2_put_allowTransparency
,
669 HTMLFrameBase2_get_allowTransparency
672 HRESULT
HTMLFrameBase_QI(HTMLFrameBase
*This
, REFIID riid
, void **ppv
)
674 if(IsEqualGUID(&IID_IHTMLFrameBase
, riid
)) {
675 TRACE("(%p)->(IID_IHTMLFrameBase %p)\n", This
, ppv
);
676 *ppv
= &This
->IHTMLFrameBase_iface
;
677 }else if(IsEqualGUID(&IID_IHTMLFrameBase2
, riid
)) {
678 TRACE("(%p)->(IID_IHTMLFrameBase2 %p)\n", This
, ppv
);
679 *ppv
= &This
->IHTMLFrameBase2_iface
;
681 return HTMLElement_QI(&This
->element
.node
, riid
, ppv
);
684 IUnknown_AddRef((IUnknown
*)*ppv
);
688 void HTMLFrameBase_destructor(HTMLFrameBase
*This
)
690 if(This
->content_window
)
691 This
->content_window
->frame_element
= NULL
;
693 HTMLElement_destructor(&This
->element
.node
);
696 void HTMLFrameBase_Init(HTMLFrameBase
*This
, HTMLDocumentNode
*doc
, nsIDOMHTMLElement
*nselem
,
697 dispex_static_data_t
*dispex_data
)
701 This
->IHTMLFrameBase_iface
.lpVtbl
= &HTMLFrameBaseVtbl
;
702 This
->IHTMLFrameBase2_iface
.lpVtbl
= &HTMLFrameBase2Vtbl
;
704 HTMLElement_Init(&This
->element
, doc
, nselem
, dispex_data
);
706 nsres
= nsIDOMHTMLElement_QueryInterface(nselem
, &IID_nsIDOMHTMLFrameElement
, (void**)&This
->nsframe
);
707 if(NS_FAILED(nsres
)) {
708 This
->nsframe
= NULL
;
709 nsres
= nsIDOMHTMLElement_QueryInterface(nselem
, &IID_nsIDOMHTMLIFrameElement
, (void**)&This
->nsiframe
);
710 assert(nsres
== NS_OK
);
712 This
->nsiframe
= NULL
;