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
.event_target
.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
.event_target
.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
.event_target
.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
.event_target
.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
) {
140 nsAString_InitDepend(&nsstr
, v
);
142 nsres
= nsIDOMHTMLFrameElement_SetSrc(This
->nsframe
, &nsstr
);
144 nsres
= nsIDOMHTMLIFrameElement_SetSrc(This
->nsiframe
, &nsstr
);
145 nsAString_Finish(&nsstr
);
146 if(NS_FAILED(nsres
)) {
147 ERR("SetSrc failed: %08x\n", nsres
);
154 return navigate_url(This
->content_window
, v
, This
->element
.node
.doc
->basedoc
.window
->uri
, BINDING_NAVIGATED
);
157 static HRESULT WINAPI
HTMLFrameBase_get_src(IHTMLFrameBase
*iface
, BSTR
*p
)
159 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
163 TRACE("(%p)->(%p)\n", This
, p
);
165 if(!This
->nsframe
&& !This
->nsiframe
) {
166 ERR("No attached frame object\n");
170 nsAString_Init(&nsstr
, NULL
);
172 nsres
= nsIDOMHTMLFrameElement_GetSrc(This
->nsframe
, &nsstr
);
174 nsres
= nsIDOMHTMLIFrameElement_GetSrc(This
->nsiframe
, &nsstr
);
175 return return_nsstr(nsres
, &nsstr
, p
);
178 static HRESULT WINAPI
HTMLFrameBase_put_name(IHTMLFrameBase
*iface
, BSTR v
)
180 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
184 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
186 if(!This
->nsframe
&& !This
->nsiframe
) {
187 ERR("No attached ns frame object\n");
191 nsAString_InitDepend(&name_str
, v
);
193 nsres
= nsIDOMHTMLFrameElement_SetName(This
->nsframe
, &name_str
);
195 nsres
= nsIDOMHTMLIFrameElement_SetName(This
->nsiframe
, &name_str
);
196 nsAString_Finish(&name_str
);
197 if(NS_FAILED(nsres
)) {
198 ERR("SetName failed: %08x\n", nsres
);
205 static HRESULT WINAPI
HTMLFrameBase_get_name(IHTMLFrameBase
*iface
, BSTR
*p
)
207 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
211 TRACE("(%p)->(%p)\n", This
, p
);
213 if(!This
->nsframe
&& !This
->nsiframe
) {
214 ERR("No attached ns frame object\n");
218 nsAString_Init(&nsstr
, NULL
);
220 nsres
= nsIDOMHTMLFrameElement_GetName(This
->nsframe
, &nsstr
);
222 nsres
= nsIDOMHTMLIFrameElement_GetName(This
->nsiframe
, &nsstr
);
223 return return_nsstr(nsres
, &nsstr
, p
);
226 static HRESULT WINAPI
HTMLFrameBase_put_border(IHTMLFrameBase
*iface
, VARIANT v
)
228 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
229 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
233 static HRESULT WINAPI
HTMLFrameBase_get_border(IHTMLFrameBase
*iface
, VARIANT
*p
)
235 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
236 FIXME("(%p)->(%p)\n", This
, p
);
240 static HRESULT WINAPI
HTMLFrameBase_put_frameBorder(IHTMLFrameBase
*iface
, BSTR v
)
242 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
246 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
248 if(!This
->nsframe
&& !This
->nsiframe
) {
249 ERR("No attached ns frame object\n");
253 nsAString_InitDepend(&nsstr
, v
);
255 nsres
= nsIDOMHTMLFrameElement_SetFrameBorder(This
->nsframe
, &nsstr
);
257 nsres
= nsIDOMHTMLIFrameElement_SetFrameBorder(This
->nsiframe
, &nsstr
);
258 nsAString_Finish(&nsstr
);
259 if(NS_FAILED(nsres
)) {
260 ERR("SetFrameBorder failed: %08x\n", nsres
);
267 static HRESULT WINAPI
HTMLFrameBase_get_frameBorder(IHTMLFrameBase
*iface
, BSTR
*p
)
269 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
273 TRACE("(%p)->(%p)\n", This
, p
);
275 if(!This
->nsframe
&& !This
->nsiframe
) {
276 ERR("No attached ns frame object\n");
280 nsAString_Init(&nsstr
, NULL
);
282 nsres
= nsIDOMHTMLFrameElement_GetFrameBorder(This
->nsframe
, &nsstr
);
284 nsres
= nsIDOMHTMLIFrameElement_GetFrameBorder(This
->nsiframe
, &nsstr
);
285 return return_nsstr(nsres
, &nsstr
, p
);
288 static HRESULT WINAPI
HTMLFrameBase_put_frameSpacing(IHTMLFrameBase
*iface
, VARIANT v
)
290 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
291 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
295 static HRESULT WINAPI
HTMLFrameBase_get_frameSpacing(IHTMLFrameBase
*iface
, VARIANT
*p
)
297 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
298 FIXME("(%p)->(%p)\n", This
, p
);
302 static HRESULT WINAPI
HTMLFrameBase_put_marginWidth(IHTMLFrameBase
*iface
, VARIANT v
)
304 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
308 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
310 if(V_VT(&v
) != VT_BSTR
) {
311 FIXME("unsupported %s\n", debugstr_variant(&v
));
315 nsAString_InitDepend(&nsstr
, V_BSTR(&v
));
317 nsres
= nsIDOMHTMLFrameElement_SetMarginWidth(This
->nsframe
, &nsstr
);
319 nsres
= nsIDOMHTMLIFrameElement_SetMarginWidth(This
->nsiframe
, &nsstr
);
320 nsAString_Finish(&nsstr
);
321 return NS_SUCCEEDED(nsres
) ? S_OK
: E_FAIL
;
324 static HRESULT WINAPI
HTMLFrameBase_get_marginWidth(IHTMLFrameBase
*iface
, VARIANT
*p
)
326 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
331 TRACE("(%p)->(%p)\n", This
, p
);
333 nsAString_Init(&nsstr
, NULL
);
335 nsres
= nsIDOMHTMLFrameElement_GetMarginWidth(This
->nsframe
, &nsstr
);
337 nsres
= nsIDOMHTMLIFrameElement_GetMarginWidth(This
->nsiframe
, &nsstr
);
338 if(NS_SUCCEEDED(nsres
)) {
339 const PRUnichar
*str
, *end
;
341 nsAString_GetData(&nsstr
, &str
);
346 end
= strstrW(str
, pxW
);
348 end
= str
+strlenW(str
);
349 ret
= SysAllocStringLen(str
, end
-str
);
354 hres
= E_OUTOFMEMORY
;
361 ERR("GetMarginWidth failed: %08x\n", nsres
);
365 nsAString_Finish(&nsstr
);
369 static HRESULT WINAPI
HTMLFrameBase_put_marginHeight(IHTMLFrameBase
*iface
, VARIANT v
)
371 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
375 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
377 if(V_VT(&v
) != VT_BSTR
) {
378 FIXME("unsupported %s\n", debugstr_variant(&v
));
382 nsAString_InitDepend(&nsstr
, V_BSTR(&v
));
384 nsres
= nsIDOMHTMLFrameElement_SetMarginHeight(This
->nsframe
, &nsstr
);
386 nsres
= nsIDOMHTMLIFrameElement_SetMarginHeight(This
->nsiframe
, &nsstr
);
387 nsAString_Finish(&nsstr
);
388 return NS_SUCCEEDED(nsres
) ? S_OK
: E_FAIL
;
391 static HRESULT WINAPI
HTMLFrameBase_get_marginHeight(IHTMLFrameBase
*iface
, VARIANT
*p
)
393 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
398 TRACE("(%p)->(%p)\n", This
, p
);
400 nsAString_Init(&nsstr
, NULL
);
402 nsres
= nsIDOMHTMLFrameElement_GetMarginHeight(This
->nsframe
, &nsstr
);
404 nsres
= nsIDOMHTMLIFrameElement_GetMarginHeight(This
->nsiframe
, &nsstr
);
405 if(NS_SUCCEEDED(nsres
)) {
406 const PRUnichar
*str
, *end
;
408 nsAString_GetData(&nsstr
, &str
);
413 end
= strstrW(str
, pxW
);
415 end
= str
+strlenW(str
);
416 ret
= SysAllocStringLen(str
, end
-str
);
421 hres
= E_OUTOFMEMORY
;
428 ERR("SetMarginHeight failed: %08x\n", nsres
);
432 nsAString_Finish(&nsstr
);
436 static HRESULT WINAPI
HTMLFrameBase_put_noResize(IHTMLFrameBase
*iface
, VARIANT_BOOL v
)
438 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
439 FIXME("(%p)->(%x)\n", This
, v
);
443 static HRESULT WINAPI
HTMLFrameBase_get_noResize(IHTMLFrameBase
*iface
, VARIANT_BOOL
*p
)
445 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
446 FIXME("(%p)->(%p)\n", This
, p
);
450 static HRESULT WINAPI
HTMLFrameBase_put_scrolling(IHTMLFrameBase
*iface
, BSTR v
)
452 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
456 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
458 if(!(!strcmpiW(v
, yesW
) || !strcmpiW(v
, noW
) || !strcmpiW(v
, autoW
)))
462 nsAString_InitDepend(&nsstr
, v
);
463 nsres
= nsIDOMHTMLFrameElement_SetScrolling(This
->nsframe
, &nsstr
);
464 }else if(This
->nsiframe
) {
465 nsAString_InitDepend(&nsstr
, v
);
466 nsres
= nsIDOMHTMLIFrameElement_SetScrolling(This
->nsiframe
, &nsstr
);
468 ERR("No attached ns frame object\n");
471 nsAString_Finish(&nsstr
);
473 if(NS_FAILED(nsres
)) {
474 ERR("SetScrolling failed: 0x%08x\n", nsres
);
481 static HRESULT WINAPI
HTMLFrameBase_get_scrolling(IHTMLFrameBase
*iface
, BSTR
*p
)
483 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
485 const PRUnichar
*strdata
;
488 TRACE("(%p)->(%p)\n", This
, p
);
491 nsAString_Init(&nsstr
, NULL
);
492 nsres
= nsIDOMHTMLFrameElement_GetScrolling(This
->nsframe
, &nsstr
);
493 }else if(This
->nsiframe
) {
494 nsAString_Init(&nsstr
, NULL
);
495 nsres
= nsIDOMHTMLIFrameElement_GetScrolling(This
->nsiframe
, &nsstr
);
497 ERR("No attached ns frame object\n");
501 if(NS_FAILED(nsres
)) {
502 ERR("GetScrolling failed: 0x%08x\n", nsres
);
503 nsAString_Finish(&nsstr
);
507 nsAString_GetData(&nsstr
, &strdata
);
510 *p
= SysAllocString(strdata
);
512 *p
= SysAllocString(autoW
);
514 nsAString_Finish(&nsstr
);
516 return *p
? S_OK
: E_OUTOFMEMORY
;
519 static const IHTMLFrameBaseVtbl HTMLFrameBaseVtbl
= {
520 HTMLFrameBase_QueryInterface
,
521 HTMLFrameBase_AddRef
,
522 HTMLFrameBase_Release
,
523 HTMLFrameBase_GetTypeInfoCount
,
524 HTMLFrameBase_GetTypeInfo
,
525 HTMLFrameBase_GetIDsOfNames
,
526 HTMLFrameBase_Invoke
,
527 HTMLFrameBase_put_src
,
528 HTMLFrameBase_get_src
,
529 HTMLFrameBase_put_name
,
530 HTMLFrameBase_get_name
,
531 HTMLFrameBase_put_border
,
532 HTMLFrameBase_get_border
,
533 HTMLFrameBase_put_frameBorder
,
534 HTMLFrameBase_get_frameBorder
,
535 HTMLFrameBase_put_frameSpacing
,
536 HTMLFrameBase_get_frameSpacing
,
537 HTMLFrameBase_put_marginWidth
,
538 HTMLFrameBase_get_marginWidth
,
539 HTMLFrameBase_put_marginHeight
,
540 HTMLFrameBase_get_marginHeight
,
541 HTMLFrameBase_put_noResize
,
542 HTMLFrameBase_get_noResize
,
543 HTMLFrameBase_put_scrolling
,
544 HTMLFrameBase_get_scrolling
547 static inline HTMLFrameBase
*impl_from_IHTMLFrameBase2(IHTMLFrameBase2
*iface
)
549 return CONTAINING_RECORD(iface
, HTMLFrameBase
, IHTMLFrameBase2_iface
);
552 static HRESULT WINAPI
HTMLFrameBase2_QueryInterface(IHTMLFrameBase2
*iface
, REFIID riid
, void **ppv
)
554 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
556 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
559 static ULONG WINAPI
HTMLFrameBase2_AddRef(IHTMLFrameBase2
*iface
)
561 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
563 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
566 static ULONG WINAPI
HTMLFrameBase2_Release(IHTMLFrameBase2
*iface
)
568 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
570 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
573 static HRESULT WINAPI
HTMLFrameBase2_GetTypeInfoCount(IHTMLFrameBase2
*iface
, UINT
*pctinfo
)
575 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
576 FIXME("(%p)\n", This
);
580 static HRESULT WINAPI
HTMLFrameBase2_GetTypeInfo(IHTMLFrameBase2
*iface
, UINT iTInfo
,
581 LCID lcid
, ITypeInfo
**ppTInfo
)
583 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
584 FIXME("(%p)\n", This
);
588 static HRESULT WINAPI
HTMLFrameBase2_GetIDsOfNames(IHTMLFrameBase2
*iface
, REFIID riid
,
589 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
591 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
592 FIXME("(%p)\n", This
);
596 static HRESULT WINAPI
HTMLFrameBase2_Invoke(IHTMLFrameBase2
*iface
, DISPID dispIdMember
,
597 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
598 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
600 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
601 FIXME("(%p)\n", This
);
605 static HRESULT WINAPI
HTMLFrameBase2_get_contentWindow(IHTMLFrameBase2
*iface
, IHTMLWindow2
**p
)
607 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
609 TRACE("(%p)->(%p)\n", This
, p
);
611 if(This
->content_window
) {
612 IHTMLWindow2_AddRef(&This
->content_window
->base
.IHTMLWindow2_iface
);
613 *p
= &This
->content_window
->base
.IHTMLWindow2_iface
;
615 WARN("NULL content window\n");
621 static HRESULT WINAPI
HTMLFrameBase2_put_onload(IHTMLFrameBase2
*iface
, VARIANT v
)
623 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
625 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
627 return set_node_event(&This
->element
.node
, EVENTID_LOAD
, &v
);
630 static HRESULT WINAPI
HTMLFrameBase2_get_onload(IHTMLFrameBase2
*iface
, VARIANT
*p
)
632 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
634 TRACE("(%p)->(%p)\n", This
, p
);
636 return get_node_event(&This
->element
.node
, EVENTID_LOAD
, p
);
639 static HRESULT WINAPI
HTMLFrameBase2_put_onreadystatechange(IHTMLFrameBase2
*iface
, VARIANT v
)
641 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
642 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
646 static HRESULT WINAPI
HTMLFrameBase2_get_onreadystatechange(IHTMLFrameBase2
*iface
, VARIANT
*p
)
648 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
649 FIXME("(%p)->(%p)\n", This
, p
);
653 static HRESULT WINAPI
HTMLFrameBase2_get_readyState(IHTMLFrameBase2
*iface
, BSTR
*p
)
655 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
657 TRACE("(%p)->(%p)\n", This
, p
);
659 if(!This
->content_window
|| !This
->content_window
->base
.inner_window
->doc
) {
660 FIXME("no document associated\n");
664 return IHTMLDocument2_get_readyState(&This
->content_window
->base
.inner_window
->doc
->basedoc
.IHTMLDocument2_iface
, p
);
667 static HRESULT WINAPI
HTMLFrameBase2_put_allowTransparency(IHTMLFrameBase2
*iface
, VARIANT_BOOL v
)
669 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
671 FIXME("(%p)->(%x) semi-stub\n", This
, v
);
676 static HRESULT WINAPI
HTMLFrameBase2_get_allowTransparency(IHTMLFrameBase2
*iface
, VARIANT_BOOL
*p
)
678 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
680 FIXME("(%p)->(%p) semi-stub\n", This
, p
);
686 static const IHTMLFrameBase2Vtbl HTMLFrameBase2Vtbl
= {
687 HTMLFrameBase2_QueryInterface
,
688 HTMLFrameBase2_AddRef
,
689 HTMLFrameBase2_Release
,
690 HTMLFrameBase2_GetTypeInfoCount
,
691 HTMLFrameBase2_GetTypeInfo
,
692 HTMLFrameBase2_GetIDsOfNames
,
693 HTMLFrameBase2_Invoke
,
694 HTMLFrameBase2_get_contentWindow
,
695 HTMLFrameBase2_put_onload
,
696 HTMLFrameBase2_get_onload
,
697 HTMLFrameBase2_put_onreadystatechange
,
698 HTMLFrameBase2_get_onreadystatechange
,
699 HTMLFrameBase2_get_readyState
,
700 HTMLFrameBase2_put_allowTransparency
,
701 HTMLFrameBase2_get_allowTransparency
704 HRESULT
HTMLFrameBase_QI(HTMLFrameBase
*This
, REFIID riid
, void **ppv
)
706 if(IsEqualGUID(&IID_IHTMLFrameBase
, riid
)) {
707 TRACE("(%p)->(IID_IHTMLFrameBase %p)\n", This
, ppv
);
708 *ppv
= &This
->IHTMLFrameBase_iface
;
709 }else if(IsEqualGUID(&IID_IHTMLFrameBase2
, riid
)) {
710 TRACE("(%p)->(IID_IHTMLFrameBase2 %p)\n", This
, ppv
);
711 *ppv
= &This
->IHTMLFrameBase2_iface
;
713 return HTMLElement_QI(&This
->element
.node
, riid
, ppv
);
716 IUnknown_AddRef((IUnknown
*)*ppv
);
720 void HTMLFrameBase_destructor(HTMLFrameBase
*This
)
722 if(This
->content_window
)
723 This
->content_window
->frame_element
= NULL
;
725 HTMLElement_destructor(&This
->element
.node
);
728 void HTMLFrameBase_Init(HTMLFrameBase
*This
, HTMLDocumentNode
*doc
, nsIDOMHTMLElement
*nselem
,
729 dispex_static_data_t
*dispex_data
)
733 This
->IHTMLFrameBase_iface
.lpVtbl
= &HTMLFrameBaseVtbl
;
734 This
->IHTMLFrameBase2_iface
.lpVtbl
= &HTMLFrameBase2Vtbl
;
736 HTMLElement_Init(&This
->element
, doc
, nselem
, dispex_data
);
738 nsres
= nsIDOMHTMLElement_QueryInterface(nselem
, &IID_nsIDOMHTMLFrameElement
, (void**)&This
->nsframe
);
739 if(NS_FAILED(nsres
)) {
740 This
->nsframe
= NULL
;
741 nsres
= nsIDOMHTMLElement_QueryInterface(nselem
, &IID_nsIDOMHTMLIFrameElement
, (void**)&This
->nsiframe
);
742 assert(nsres
== NS_OK
);
744 This
->nsiframe
= NULL
;