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 "mshtml_private.h"
21 static const WCHAR autoW
[] = {'a','u','t','o',0};
22 static const WCHAR yesW
[] = {'y','e','s',0};
23 static const WCHAR noW
[] = {'n','o',0};
24 static const WCHAR pxW
[] = {'p','x',0};
26 HRESULT
set_frame_doc(HTMLFrameBase
*frame
, nsIDOMDocument
*nsdoc
)
28 nsIDOMWindow
*nswindow
;
29 HTMLOuterWindow
*window
;
33 if(frame
->content_window
)
36 nsres
= nsIDOMDocument_GetDefaultView(nsdoc
, &nswindow
);
37 if(NS_FAILED(nsres
) || !nswindow
)
40 window
= nswindow_to_window(nswindow
);
42 hres
= HTMLOuterWindow_Create(frame
->element
.node
.doc
->basedoc
.doc_obj
, nswindow
,
43 frame
->element
.node
.doc
->basedoc
.window
, &window
);
44 nsIDOMWindow_Release(nswindow
);
48 frame
->content_window
= window
;
49 window
->frame_element
= frame
;
53 static inline HTMLFrameBase
*impl_from_IHTMLFrameBase(IHTMLFrameBase
*iface
)
55 return CONTAINING_RECORD(iface
, HTMLFrameBase
, IHTMLFrameBase_iface
);
58 static HRESULT WINAPI
HTMLFrameBase_QueryInterface(IHTMLFrameBase
*iface
, REFIID riid
, void **ppv
)
60 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
62 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
65 static ULONG WINAPI
HTMLFrameBase_AddRef(IHTMLFrameBase
*iface
)
67 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
69 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
72 static ULONG WINAPI
HTMLFrameBase_Release(IHTMLFrameBase
*iface
)
74 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
76 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
79 static HRESULT WINAPI
HTMLFrameBase_GetTypeInfoCount(IHTMLFrameBase
*iface
, UINT
*pctinfo
)
81 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
83 return IDispatchEx_GetTypeInfoCount(&This
->element
.node
.dispex
.IDispatchEx_iface
, pctinfo
);
86 static HRESULT WINAPI
HTMLFrameBase_GetTypeInfo(IHTMLFrameBase
*iface
, UINT iTInfo
,
87 LCID lcid
, ITypeInfo
**ppTInfo
)
89 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
91 return IDispatchEx_GetTypeInfo(&This
->element
.node
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
,
95 static HRESULT WINAPI
HTMLFrameBase_GetIDsOfNames(IHTMLFrameBase
*iface
, REFIID riid
,
96 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
98 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
100 return IDispatchEx_GetIDsOfNames(&This
->element
.node
.dispex
.IDispatchEx_iface
, riid
, rgszNames
,
101 cNames
, lcid
, rgDispId
);
104 static HRESULT WINAPI
HTMLFrameBase_Invoke(IHTMLFrameBase
*iface
, DISPID dispIdMember
,
105 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
106 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
108 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
110 return IDispatchEx_Invoke(&This
->element
.node
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
111 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
114 static HRESULT WINAPI
HTMLFrameBase_put_src(IHTMLFrameBase
*iface
, BSTR v
)
116 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
118 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
120 if(!This
->content_window
|| !This
->element
.node
.doc
|| !This
->element
.node
.doc
->basedoc
.window
) {
121 FIXME("detached element\n");
125 return navigate_url(This
->content_window
, v
, This
->element
.node
.doc
->basedoc
.window
->uri
, BINDING_NAVIGATED
);
128 static HRESULT WINAPI
HTMLFrameBase_get_src(IHTMLFrameBase
*iface
, BSTR
*p
)
130 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
131 FIXME("(%p)->(%p)\n", This
, p
);
135 static HRESULT WINAPI
HTMLFrameBase_put_name(IHTMLFrameBase
*iface
, BSTR v
)
137 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
141 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
143 if(!This
->nsframe
&& !This
->nsiframe
) {
144 ERR("No attached ns frame object\n");
148 nsAString_InitDepend(&name_str
, v
);
150 nsres
= nsIDOMHTMLFrameElement_SetName(This
->nsframe
, &name_str
);
152 nsres
= nsIDOMHTMLIFrameElement_SetName(This
->nsiframe
, &name_str
);
153 nsAString_Finish(&name_str
);
154 if(NS_FAILED(nsres
)) {
155 ERR("SetName failed: %08x\n", nsres
);
162 static HRESULT WINAPI
HTMLFrameBase_get_name(IHTMLFrameBase
*iface
, BSTR
*p
)
164 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
168 TRACE("(%p)->(%p)\n", This
, p
);
170 if(!This
->nsframe
&& !This
->nsiframe
) {
171 ERR("No attached ns frame object\n");
175 nsAString_Init(&nsstr
, NULL
);
177 nsres
= nsIDOMHTMLFrameElement_GetName(This
->nsframe
, &nsstr
);
179 nsres
= nsIDOMHTMLIFrameElement_GetName(This
->nsiframe
, &nsstr
);
180 return return_nsstr(nsres
, &nsstr
, p
);
183 static HRESULT WINAPI
HTMLFrameBase_put_border(IHTMLFrameBase
*iface
, VARIANT v
)
185 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
186 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
190 static HRESULT WINAPI
HTMLFrameBase_get_border(IHTMLFrameBase
*iface
, VARIANT
*p
)
192 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
193 FIXME("(%p)->(%p)\n", This
, p
);
197 static HRESULT WINAPI
HTMLFrameBase_put_frameBorder(IHTMLFrameBase
*iface
, BSTR v
)
199 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
203 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
205 if(!This
->nsframe
&& !This
->nsiframe
) {
206 ERR("No attached ns frame object\n");
210 nsAString_InitDepend(&nsstr
, v
);
212 nsres
= nsIDOMHTMLFrameElement_SetFrameBorder(This
->nsframe
, &nsstr
);
214 nsres
= nsIDOMHTMLIFrameElement_SetFrameBorder(This
->nsiframe
, &nsstr
);
215 nsAString_Finish(&nsstr
);
216 if(NS_FAILED(nsres
)) {
217 ERR("SetFrameBorder failed: %08x\n", nsres
);
224 static HRESULT WINAPI
HTMLFrameBase_get_frameBorder(IHTMLFrameBase
*iface
, BSTR
*p
)
226 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
230 TRACE("(%p)->(%p)\n", This
, p
);
232 if(!This
->nsframe
&& !This
->nsiframe
) {
233 ERR("No attached ns frame object\n");
237 nsAString_Init(&nsstr
, NULL
);
239 nsres
= nsIDOMHTMLFrameElement_GetFrameBorder(This
->nsframe
, &nsstr
);
241 nsres
= nsIDOMHTMLIFrameElement_GetFrameBorder(This
->nsiframe
, &nsstr
);
242 return return_nsstr(nsres
, &nsstr
, p
);
245 static HRESULT WINAPI
HTMLFrameBase_put_frameSpacing(IHTMLFrameBase
*iface
, VARIANT v
)
247 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
248 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
252 static HRESULT WINAPI
HTMLFrameBase_get_frameSpacing(IHTMLFrameBase
*iface
, VARIANT
*p
)
254 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
255 FIXME("(%p)->(%p)\n", This
, p
);
259 static HRESULT WINAPI
HTMLFrameBase_put_marginWidth(IHTMLFrameBase
*iface
, VARIANT v
)
261 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
265 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
267 if(V_VT(&v
) != VT_BSTR
) {
268 FIXME("unsupported %s\n", debugstr_variant(&v
));
272 nsAString_InitDepend(&nsstr
, V_BSTR(&v
));
274 nsres
= nsIDOMHTMLFrameElement_SetMarginWidth(This
->nsframe
, &nsstr
);
276 nsres
= nsIDOMHTMLIFrameElement_SetMarginWidth(This
->nsiframe
, &nsstr
);
277 nsAString_Finish(&nsstr
);
278 return NS_SUCCEEDED(nsres
) ? S_OK
: E_FAIL
;
281 static HRESULT WINAPI
HTMLFrameBase_get_marginWidth(IHTMLFrameBase
*iface
, VARIANT
*p
)
283 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
288 TRACE("(%p)->(%p)\n", This
, p
);
290 nsAString_Init(&nsstr
, NULL
);
292 nsres
= nsIDOMHTMLFrameElement_GetMarginWidth(This
->nsframe
, &nsstr
);
294 nsres
= nsIDOMHTMLIFrameElement_GetMarginWidth(This
->nsiframe
, &nsstr
);
295 if(NS_SUCCEEDED(nsres
)) {
296 const PRUnichar
*str
, *end
;
298 nsAString_GetData(&nsstr
, &str
);
303 end
= strstrW(str
, pxW
);
305 end
= str
+strlenW(str
);
306 ret
= SysAllocStringLen(str
, end
-str
);
311 hres
= E_OUTOFMEMORY
;
318 ERR("GetMarginWidth failed: %08x\n", nsres
);
322 nsAString_Finish(&nsstr
);
326 static HRESULT WINAPI
HTMLFrameBase_put_marginHeight(IHTMLFrameBase
*iface
, VARIANT v
)
328 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
332 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
334 if(V_VT(&v
) != VT_BSTR
) {
335 FIXME("unsupported %s\n", debugstr_variant(&v
));
339 nsAString_InitDepend(&nsstr
, V_BSTR(&v
));
341 nsres
= nsIDOMHTMLFrameElement_SetMarginHeight(This
->nsframe
, &nsstr
);
343 nsres
= nsIDOMHTMLIFrameElement_SetMarginHeight(This
->nsiframe
, &nsstr
);
344 nsAString_Finish(&nsstr
);
345 return NS_SUCCEEDED(nsres
) ? S_OK
: E_FAIL
;
348 static HRESULT WINAPI
HTMLFrameBase_get_marginHeight(IHTMLFrameBase
*iface
, VARIANT
*p
)
350 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
355 TRACE("(%p)->(%p)\n", This
, p
);
357 nsAString_Init(&nsstr
, NULL
);
359 nsres
= nsIDOMHTMLFrameElement_GetMarginHeight(This
->nsframe
, &nsstr
);
361 nsres
= nsIDOMHTMLIFrameElement_GetMarginHeight(This
->nsiframe
, &nsstr
);
362 if(NS_SUCCEEDED(nsres
)) {
363 const PRUnichar
*str
, *end
;
365 nsAString_GetData(&nsstr
, &str
);
370 end
= strstrW(str
, pxW
);
372 end
= str
+strlenW(str
);
373 ret
= SysAllocStringLen(str
, end
-str
);
378 hres
= E_OUTOFMEMORY
;
385 ERR("SetMarginHeight failed: %08x\n", nsres
);
389 nsAString_Finish(&nsstr
);
393 static HRESULT WINAPI
HTMLFrameBase_put_noResize(IHTMLFrameBase
*iface
, VARIANT_BOOL v
)
395 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
396 FIXME("(%p)->(%x)\n", This
, v
);
400 static HRESULT WINAPI
HTMLFrameBase_get_noResize(IHTMLFrameBase
*iface
, VARIANT_BOOL
*p
)
402 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
403 FIXME("(%p)->(%p)\n", This
, p
);
407 static HRESULT WINAPI
HTMLFrameBase_put_scrolling(IHTMLFrameBase
*iface
, BSTR v
)
409 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
413 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
415 if(!(!strcmpiW(v
, yesW
) || !strcmpiW(v
, noW
) || !strcmpiW(v
, autoW
)))
419 nsAString_InitDepend(&nsstr
, v
);
420 nsres
= nsIDOMHTMLFrameElement_SetScrolling(This
->nsframe
, &nsstr
);
421 }else if(This
->nsiframe
) {
422 nsAString_InitDepend(&nsstr
, v
);
423 nsres
= nsIDOMHTMLIFrameElement_SetScrolling(This
->nsiframe
, &nsstr
);
425 ERR("No attached ns frame object\n");
428 nsAString_Finish(&nsstr
);
430 if(NS_FAILED(nsres
)) {
431 ERR("SetScrolling failed: 0x%08x\n", nsres
);
438 static HRESULT WINAPI
HTMLFrameBase_get_scrolling(IHTMLFrameBase
*iface
, BSTR
*p
)
440 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
442 const PRUnichar
*strdata
;
445 TRACE("(%p)->(%p)\n", This
, p
);
448 nsAString_Init(&nsstr
, NULL
);
449 nsres
= nsIDOMHTMLFrameElement_GetScrolling(This
->nsframe
, &nsstr
);
450 }else if(This
->nsiframe
) {
451 nsAString_Init(&nsstr
, NULL
);
452 nsres
= nsIDOMHTMLIFrameElement_GetScrolling(This
->nsiframe
, &nsstr
);
454 ERR("No attached ns frame object\n");
458 if(NS_FAILED(nsres
)) {
459 ERR("GetScrolling failed: 0x%08x\n", nsres
);
460 nsAString_Finish(&nsstr
);
464 nsAString_GetData(&nsstr
, &strdata
);
467 *p
= SysAllocString(strdata
);
469 *p
= SysAllocString(autoW
);
471 nsAString_Finish(&nsstr
);
473 return *p
? S_OK
: E_OUTOFMEMORY
;
476 static const IHTMLFrameBaseVtbl HTMLFrameBaseVtbl
= {
477 HTMLFrameBase_QueryInterface
,
478 HTMLFrameBase_AddRef
,
479 HTMLFrameBase_Release
,
480 HTMLFrameBase_GetTypeInfoCount
,
481 HTMLFrameBase_GetTypeInfo
,
482 HTMLFrameBase_GetIDsOfNames
,
483 HTMLFrameBase_Invoke
,
484 HTMLFrameBase_put_src
,
485 HTMLFrameBase_get_src
,
486 HTMLFrameBase_put_name
,
487 HTMLFrameBase_get_name
,
488 HTMLFrameBase_put_border
,
489 HTMLFrameBase_get_border
,
490 HTMLFrameBase_put_frameBorder
,
491 HTMLFrameBase_get_frameBorder
,
492 HTMLFrameBase_put_frameSpacing
,
493 HTMLFrameBase_get_frameSpacing
,
494 HTMLFrameBase_put_marginWidth
,
495 HTMLFrameBase_get_marginWidth
,
496 HTMLFrameBase_put_marginHeight
,
497 HTMLFrameBase_get_marginHeight
,
498 HTMLFrameBase_put_noResize
,
499 HTMLFrameBase_get_noResize
,
500 HTMLFrameBase_put_scrolling
,
501 HTMLFrameBase_get_scrolling
504 static inline HTMLFrameBase
*impl_from_IHTMLFrameBase2(IHTMLFrameBase2
*iface
)
506 return CONTAINING_RECORD(iface
, HTMLFrameBase
, IHTMLFrameBase2_iface
);
509 static HRESULT WINAPI
HTMLFrameBase2_QueryInterface(IHTMLFrameBase2
*iface
, REFIID riid
, void **ppv
)
511 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
513 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
516 static ULONG WINAPI
HTMLFrameBase2_AddRef(IHTMLFrameBase2
*iface
)
518 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
520 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
523 static ULONG WINAPI
HTMLFrameBase2_Release(IHTMLFrameBase2
*iface
)
525 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
527 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
530 static HRESULT WINAPI
HTMLFrameBase2_GetTypeInfoCount(IHTMLFrameBase2
*iface
, UINT
*pctinfo
)
532 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
533 FIXME("(%p)\n", This
);
537 static HRESULT WINAPI
HTMLFrameBase2_GetTypeInfo(IHTMLFrameBase2
*iface
, UINT iTInfo
,
538 LCID lcid
, ITypeInfo
**ppTInfo
)
540 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
541 FIXME("(%p)\n", This
);
545 static HRESULT WINAPI
HTMLFrameBase2_GetIDsOfNames(IHTMLFrameBase2
*iface
, REFIID riid
,
546 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
548 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
549 FIXME("(%p)\n", This
);
553 static HRESULT WINAPI
HTMLFrameBase2_Invoke(IHTMLFrameBase2
*iface
, DISPID dispIdMember
,
554 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
555 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
557 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
558 FIXME("(%p)\n", This
);
562 static HRESULT WINAPI
HTMLFrameBase2_get_contentWindow(IHTMLFrameBase2
*iface
, IHTMLWindow2
**p
)
564 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
566 TRACE("(%p)->(%p)\n", This
, p
);
568 if(This
->content_window
) {
569 IHTMLWindow2_AddRef(&This
->content_window
->base
.IHTMLWindow2_iface
);
570 *p
= &This
->content_window
->base
.IHTMLWindow2_iface
;
572 WARN("NULL content window\n");
578 static HRESULT WINAPI
HTMLFrameBase2_put_onload(IHTMLFrameBase2
*iface
, VARIANT v
)
580 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
582 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
584 return set_node_event(&This
->element
.node
, EVENTID_LOAD
, &v
);
587 static HRESULT WINAPI
HTMLFrameBase2_get_onload(IHTMLFrameBase2
*iface
, VARIANT
*p
)
589 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
591 TRACE("(%p)->(%p)\n", This
, p
);
593 return get_node_event(&This
->element
.node
, EVENTID_LOAD
, p
);
596 static HRESULT WINAPI
HTMLFrameBase2_put_onreadystatechange(IHTMLFrameBase2
*iface
, VARIANT v
)
598 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
599 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
603 static HRESULT WINAPI
HTMLFrameBase2_get_onreadystatechange(IHTMLFrameBase2
*iface
, VARIANT
*p
)
605 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
606 FIXME("(%p)->(%p)\n", This
, p
);
610 static HRESULT WINAPI
HTMLFrameBase2_get_readyState(IHTMLFrameBase2
*iface
, BSTR
*p
)
612 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
614 TRACE("(%p)->(%p)\n", This
, p
);
616 if(!This
->content_window
|| !This
->content_window
->base
.inner_window
->doc
) {
617 FIXME("no document associated\n");
621 return IHTMLDocument2_get_readyState(&This
->content_window
->base
.inner_window
->doc
->basedoc
.IHTMLDocument2_iface
, p
);
624 static HRESULT WINAPI
HTMLFrameBase2_put_allowTransparency(IHTMLFrameBase2
*iface
, VARIANT_BOOL v
)
626 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
627 FIXME("(%p)->(%x)\n", This
, v
);
631 static HRESULT WINAPI
HTMLFrameBase2_get_allowTransparency(IHTMLFrameBase2
*iface
, VARIANT_BOOL
*p
)
633 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
634 FIXME("(%p)->(%p)\n", This
, p
);
638 static const IHTMLFrameBase2Vtbl HTMLFrameBase2Vtbl
= {
639 HTMLFrameBase2_QueryInterface
,
640 HTMLFrameBase2_AddRef
,
641 HTMLFrameBase2_Release
,
642 HTMLFrameBase2_GetTypeInfoCount
,
643 HTMLFrameBase2_GetTypeInfo
,
644 HTMLFrameBase2_GetIDsOfNames
,
645 HTMLFrameBase2_Invoke
,
646 HTMLFrameBase2_get_contentWindow
,
647 HTMLFrameBase2_put_onload
,
648 HTMLFrameBase2_get_onload
,
649 HTMLFrameBase2_put_onreadystatechange
,
650 HTMLFrameBase2_get_onreadystatechange
,
651 HTMLFrameBase2_get_readyState
,
652 HTMLFrameBase2_put_allowTransparency
,
653 HTMLFrameBase2_get_allowTransparency
656 HRESULT
HTMLFrameBase_QI(HTMLFrameBase
*This
, REFIID riid
, void **ppv
)
658 if(IsEqualGUID(&IID_IHTMLFrameBase
, riid
)) {
659 TRACE("(%p)->(IID_IHTMLFrameBase %p)\n", This
, ppv
);
660 *ppv
= &This
->IHTMLFrameBase_iface
;
661 }else if(IsEqualGUID(&IID_IHTMLFrameBase2
, riid
)) {
662 TRACE("(%p)->(IID_IHTMLFrameBase2 %p)\n", This
, ppv
);
663 *ppv
= &This
->IHTMLFrameBase2_iface
;
665 return HTMLElement_QI(&This
->element
.node
, riid
, ppv
);
668 IUnknown_AddRef((IUnknown
*)*ppv
);
672 void HTMLFrameBase_destructor(HTMLFrameBase
*This
)
674 if(This
->content_window
)
675 This
->content_window
->frame_element
= NULL
;
677 HTMLElement_destructor(&This
->element
.node
);
680 void HTMLFrameBase_Init(HTMLFrameBase
*This
, HTMLDocumentNode
*doc
, nsIDOMHTMLElement
*nselem
,
681 dispex_static_data_t
*dispex_data
)
685 This
->IHTMLFrameBase_iface
.lpVtbl
= &HTMLFrameBaseVtbl
;
686 This
->IHTMLFrameBase2_iface
.lpVtbl
= &HTMLFrameBase2Vtbl
;
688 HTMLElement_Init(&This
->element
, doc
, nselem
, dispex_data
);
690 nsres
= nsIDOMHTMLElement_QueryInterface(nselem
, &IID_nsIDOMHTMLFrameElement
, (void**)&This
->nsframe
);
691 if(NS_FAILED(nsres
)) {
692 This
->nsframe
= NULL
;
693 nsres
= nsIDOMHTMLElement_QueryInterface(nselem
, &IID_nsIDOMHTMLIFrameElement
, (void**)&This
->nsiframe
);
694 assert(nsres
== NS_OK
&& (nsIDOMNode
*)This
->nsiframe
== This
->element
.node
.nsnode
);
696 assert((nsIDOMNode
*)This
->nsframe
== This
->element
.node
.nsnode
);
697 This
->nsiframe
= NULL
;
700 /* Share the reference with nsnode */
701 nsIDOMNode_Release(This
->element
.node
.nsnode
);