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 mozIDOMWindowProxy
*mozwindow
;
45 HTMLOuterWindow
*window
;
49 if(frame
->content_window
)
52 nsres
= nsIDOMDocument_GetDefaultView(nsdoc
, &mozwindow
);
53 if(NS_FAILED(nsres
) || !mozwindow
)
56 window
= mozwindow_to_window(mozwindow
);
58 nsIDOMWindow
*nswindow
;
59 nsres
= mozIDOMWindowProxy_QueryInterface(mozwindow
, &IID_nsIDOMWindow
, (void**)&nswindow
);
60 assert(nsres
== NS_OK
);
62 hres
= HTMLOuterWindow_Create(frame
->element
.node
.doc
->basedoc
.doc_obj
, nswindow
,
63 frame
->element
.node
.doc
->basedoc
.window
, &window
);
64 nsIDOMWindow_Release(nswindow
);
66 mozIDOMWindowProxy_Release(mozwindow
);
70 frame
->content_window
= window
;
71 window
->frame_element
= frame
;
75 static inline HTMLFrameBase
*impl_from_IHTMLFrameBase(IHTMLFrameBase
*iface
)
77 return CONTAINING_RECORD(iface
, HTMLFrameBase
, IHTMLFrameBase_iface
);
80 static HRESULT WINAPI
HTMLFrameBase_QueryInterface(IHTMLFrameBase
*iface
, REFIID riid
, void **ppv
)
82 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
84 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
87 static ULONG WINAPI
HTMLFrameBase_AddRef(IHTMLFrameBase
*iface
)
89 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
91 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
94 static ULONG WINAPI
HTMLFrameBase_Release(IHTMLFrameBase
*iface
)
96 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
98 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
101 static HRESULT WINAPI
HTMLFrameBase_GetTypeInfoCount(IHTMLFrameBase
*iface
, UINT
*pctinfo
)
103 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
105 return IDispatchEx_GetTypeInfoCount(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
108 static HRESULT WINAPI
HTMLFrameBase_GetTypeInfo(IHTMLFrameBase
*iface
, UINT iTInfo
,
109 LCID lcid
, ITypeInfo
**ppTInfo
)
111 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
113 return IDispatchEx_GetTypeInfo(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
,
117 static HRESULT WINAPI
HTMLFrameBase_GetIDsOfNames(IHTMLFrameBase
*iface
, REFIID riid
,
118 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
120 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
122 return IDispatchEx_GetIDsOfNames(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
,
123 cNames
, lcid
, rgDispId
);
126 static HRESULT WINAPI
HTMLFrameBase_Invoke(IHTMLFrameBase
*iface
, DISPID dispIdMember
,
127 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
128 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
130 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
132 return IDispatchEx_Invoke(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
133 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
136 static HRESULT WINAPI
HTMLFrameBase_put_src(IHTMLFrameBase
*iface
, BSTR v
)
138 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
140 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
142 if(!This
->content_window
|| !This
->element
.node
.doc
|| !This
->element
.node
.doc
->basedoc
.window
) {
146 nsAString_InitDepend(&nsstr
, v
);
148 nsres
= nsIDOMHTMLFrameElement_SetSrc(This
->nsframe
, &nsstr
);
150 nsres
= nsIDOMHTMLIFrameElement_SetSrc(This
->nsiframe
, &nsstr
);
151 nsAString_Finish(&nsstr
);
152 if(NS_FAILED(nsres
)) {
153 ERR("SetSrc failed: %08x\n", nsres
);
160 return navigate_url(This
->content_window
, v
, This
->element
.node
.doc
->basedoc
.window
->uri
, BINDING_NAVIGATED
);
163 static HRESULT WINAPI
HTMLFrameBase_get_src(IHTMLFrameBase
*iface
, BSTR
*p
)
165 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
169 TRACE("(%p)->(%p)\n", This
, p
);
171 if(!This
->nsframe
&& !This
->nsiframe
) {
172 ERR("No attached frame object\n");
176 nsAString_Init(&nsstr
, NULL
);
178 nsres
= nsIDOMHTMLFrameElement_GetSrc(This
->nsframe
, &nsstr
);
180 nsres
= nsIDOMHTMLIFrameElement_GetSrc(This
->nsiframe
, &nsstr
);
181 return return_nsstr(nsres
, &nsstr
, p
);
184 static HRESULT WINAPI
HTMLFrameBase_put_name(IHTMLFrameBase
*iface
, BSTR v
)
186 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
190 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
192 if(!This
->nsframe
&& !This
->nsiframe
) {
193 ERR("No attached ns frame object\n");
197 nsAString_InitDepend(&name_str
, v
);
199 nsres
= nsIDOMHTMLFrameElement_SetName(This
->nsframe
, &name_str
);
201 nsres
= nsIDOMHTMLIFrameElement_SetName(This
->nsiframe
, &name_str
);
202 nsAString_Finish(&name_str
);
203 if(NS_FAILED(nsres
)) {
204 ERR("SetName failed: %08x\n", nsres
);
211 static HRESULT WINAPI
HTMLFrameBase_get_name(IHTMLFrameBase
*iface
, BSTR
*p
)
213 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
217 TRACE("(%p)->(%p)\n", This
, p
);
219 if(!This
->nsframe
&& !This
->nsiframe
) {
220 ERR("No attached ns frame object\n");
224 nsAString_Init(&nsstr
, NULL
);
226 nsres
= nsIDOMHTMLFrameElement_GetName(This
->nsframe
, &nsstr
);
228 nsres
= nsIDOMHTMLIFrameElement_GetName(This
->nsiframe
, &nsstr
);
229 return return_nsstr(nsres
, &nsstr
, p
);
232 static HRESULT WINAPI
HTMLFrameBase_put_border(IHTMLFrameBase
*iface
, VARIANT v
)
234 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
235 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
239 static HRESULT WINAPI
HTMLFrameBase_get_border(IHTMLFrameBase
*iface
, VARIANT
*p
)
241 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
242 FIXME("(%p)->(%p)\n", This
, p
);
246 static HRESULT WINAPI
HTMLFrameBase_put_frameBorder(IHTMLFrameBase
*iface
, BSTR v
)
248 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
252 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
254 if(!This
->nsframe
&& !This
->nsiframe
) {
255 ERR("No attached ns frame object\n");
259 nsAString_InitDepend(&nsstr
, v
);
261 nsres
= nsIDOMHTMLFrameElement_SetFrameBorder(This
->nsframe
, &nsstr
);
263 nsres
= nsIDOMHTMLIFrameElement_SetFrameBorder(This
->nsiframe
, &nsstr
);
264 nsAString_Finish(&nsstr
);
265 if(NS_FAILED(nsres
)) {
266 ERR("SetFrameBorder failed: %08x\n", nsres
);
273 static HRESULT WINAPI
HTMLFrameBase_get_frameBorder(IHTMLFrameBase
*iface
, BSTR
*p
)
275 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
279 TRACE("(%p)->(%p)\n", This
, p
);
281 if(!This
->nsframe
&& !This
->nsiframe
) {
282 ERR("No attached ns frame object\n");
286 nsAString_Init(&nsstr
, NULL
);
288 nsres
= nsIDOMHTMLFrameElement_GetFrameBorder(This
->nsframe
, &nsstr
);
290 nsres
= nsIDOMHTMLIFrameElement_GetFrameBorder(This
->nsiframe
, &nsstr
);
291 return return_nsstr(nsres
, &nsstr
, p
);
294 static HRESULT WINAPI
HTMLFrameBase_put_frameSpacing(IHTMLFrameBase
*iface
, VARIANT v
)
296 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
297 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
301 static HRESULT WINAPI
HTMLFrameBase_get_frameSpacing(IHTMLFrameBase
*iface
, VARIANT
*p
)
303 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
304 FIXME("(%p)->(%p)\n", This
, p
);
308 static HRESULT WINAPI
HTMLFrameBase_put_marginWidth(IHTMLFrameBase
*iface
, VARIANT v
)
310 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
314 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
316 if(V_VT(&v
) != VT_BSTR
) {
317 FIXME("unsupported %s\n", debugstr_variant(&v
));
321 nsAString_InitDepend(&nsstr
, V_BSTR(&v
));
323 nsres
= nsIDOMHTMLFrameElement_SetMarginWidth(This
->nsframe
, &nsstr
);
325 nsres
= nsIDOMHTMLIFrameElement_SetMarginWidth(This
->nsiframe
, &nsstr
);
326 nsAString_Finish(&nsstr
);
327 return NS_SUCCEEDED(nsres
) ? S_OK
: E_FAIL
;
330 static HRESULT WINAPI
HTMLFrameBase_get_marginWidth(IHTMLFrameBase
*iface
, VARIANT
*p
)
332 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
337 TRACE("(%p)->(%p)\n", This
, p
);
339 nsAString_Init(&nsstr
, NULL
);
341 nsres
= nsIDOMHTMLFrameElement_GetMarginWidth(This
->nsframe
, &nsstr
);
343 nsres
= nsIDOMHTMLIFrameElement_GetMarginWidth(This
->nsiframe
, &nsstr
);
344 if(NS_SUCCEEDED(nsres
)) {
345 const PRUnichar
*str
, *end
;
347 nsAString_GetData(&nsstr
, &str
);
352 end
= strstrW(str
, pxW
);
354 end
= str
+strlenW(str
);
355 ret
= SysAllocStringLen(str
, end
-str
);
360 hres
= E_OUTOFMEMORY
;
367 ERR("GetMarginWidth failed: %08x\n", nsres
);
371 nsAString_Finish(&nsstr
);
375 static HRESULT WINAPI
HTMLFrameBase_put_marginHeight(IHTMLFrameBase
*iface
, VARIANT v
)
377 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
381 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
383 if(V_VT(&v
) != VT_BSTR
) {
384 FIXME("unsupported %s\n", debugstr_variant(&v
));
388 nsAString_InitDepend(&nsstr
, V_BSTR(&v
));
390 nsres
= nsIDOMHTMLFrameElement_SetMarginHeight(This
->nsframe
, &nsstr
);
392 nsres
= nsIDOMHTMLIFrameElement_SetMarginHeight(This
->nsiframe
, &nsstr
);
393 nsAString_Finish(&nsstr
);
394 return NS_SUCCEEDED(nsres
) ? S_OK
: E_FAIL
;
397 static HRESULT WINAPI
HTMLFrameBase_get_marginHeight(IHTMLFrameBase
*iface
, VARIANT
*p
)
399 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
404 TRACE("(%p)->(%p)\n", This
, p
);
406 nsAString_Init(&nsstr
, NULL
);
408 nsres
= nsIDOMHTMLFrameElement_GetMarginHeight(This
->nsframe
, &nsstr
);
410 nsres
= nsIDOMHTMLIFrameElement_GetMarginHeight(This
->nsiframe
, &nsstr
);
411 if(NS_SUCCEEDED(nsres
)) {
412 const PRUnichar
*str
, *end
;
414 nsAString_GetData(&nsstr
, &str
);
419 end
= strstrW(str
, pxW
);
421 end
= str
+strlenW(str
);
422 ret
= SysAllocStringLen(str
, end
-str
);
427 hres
= E_OUTOFMEMORY
;
434 ERR("SetMarginHeight failed: %08x\n", nsres
);
438 nsAString_Finish(&nsstr
);
442 static HRESULT WINAPI
HTMLFrameBase_put_noResize(IHTMLFrameBase
*iface
, VARIANT_BOOL v
)
444 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
445 FIXME("(%p)->(%x)\n", This
, v
);
449 static HRESULT WINAPI
HTMLFrameBase_get_noResize(IHTMLFrameBase
*iface
, VARIANT_BOOL
*p
)
451 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
452 FIXME("(%p)->(%p)\n", This
, p
);
456 static HRESULT WINAPI
HTMLFrameBase_put_scrolling(IHTMLFrameBase
*iface
, BSTR v
)
458 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
462 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
464 if(!(!strcmpiW(v
, yesW
) || !strcmpiW(v
, noW
) || !strcmpiW(v
, autoW
)))
468 nsAString_InitDepend(&nsstr
, v
);
469 nsres
= nsIDOMHTMLFrameElement_SetScrolling(This
->nsframe
, &nsstr
);
470 }else if(This
->nsiframe
) {
471 nsAString_InitDepend(&nsstr
, v
);
472 nsres
= nsIDOMHTMLIFrameElement_SetScrolling(This
->nsiframe
, &nsstr
);
474 ERR("No attached ns frame object\n");
477 nsAString_Finish(&nsstr
);
479 if(NS_FAILED(nsres
)) {
480 ERR("SetScrolling failed: 0x%08x\n", nsres
);
487 static HRESULT WINAPI
HTMLFrameBase_get_scrolling(IHTMLFrameBase
*iface
, BSTR
*p
)
489 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase(iface
);
491 const PRUnichar
*strdata
;
494 TRACE("(%p)->(%p)\n", This
, p
);
497 nsAString_Init(&nsstr
, NULL
);
498 nsres
= nsIDOMHTMLFrameElement_GetScrolling(This
->nsframe
, &nsstr
);
499 }else if(This
->nsiframe
) {
500 nsAString_Init(&nsstr
, NULL
);
501 nsres
= nsIDOMHTMLIFrameElement_GetScrolling(This
->nsiframe
, &nsstr
);
503 ERR("No attached ns frame object\n");
507 if(NS_FAILED(nsres
)) {
508 ERR("GetScrolling failed: 0x%08x\n", nsres
);
509 nsAString_Finish(&nsstr
);
513 nsAString_GetData(&nsstr
, &strdata
);
516 *p
= SysAllocString(strdata
);
518 *p
= SysAllocString(autoW
);
520 nsAString_Finish(&nsstr
);
522 return *p
? S_OK
: E_OUTOFMEMORY
;
525 static const IHTMLFrameBaseVtbl HTMLFrameBaseVtbl
= {
526 HTMLFrameBase_QueryInterface
,
527 HTMLFrameBase_AddRef
,
528 HTMLFrameBase_Release
,
529 HTMLFrameBase_GetTypeInfoCount
,
530 HTMLFrameBase_GetTypeInfo
,
531 HTMLFrameBase_GetIDsOfNames
,
532 HTMLFrameBase_Invoke
,
533 HTMLFrameBase_put_src
,
534 HTMLFrameBase_get_src
,
535 HTMLFrameBase_put_name
,
536 HTMLFrameBase_get_name
,
537 HTMLFrameBase_put_border
,
538 HTMLFrameBase_get_border
,
539 HTMLFrameBase_put_frameBorder
,
540 HTMLFrameBase_get_frameBorder
,
541 HTMLFrameBase_put_frameSpacing
,
542 HTMLFrameBase_get_frameSpacing
,
543 HTMLFrameBase_put_marginWidth
,
544 HTMLFrameBase_get_marginWidth
,
545 HTMLFrameBase_put_marginHeight
,
546 HTMLFrameBase_get_marginHeight
,
547 HTMLFrameBase_put_noResize
,
548 HTMLFrameBase_get_noResize
,
549 HTMLFrameBase_put_scrolling
,
550 HTMLFrameBase_get_scrolling
553 static inline HTMLFrameBase
*impl_from_IHTMLFrameBase2(IHTMLFrameBase2
*iface
)
555 return CONTAINING_RECORD(iface
, HTMLFrameBase
, IHTMLFrameBase2_iface
);
558 static HRESULT WINAPI
HTMLFrameBase2_QueryInterface(IHTMLFrameBase2
*iface
, REFIID riid
, void **ppv
)
560 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
562 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
565 static ULONG WINAPI
HTMLFrameBase2_AddRef(IHTMLFrameBase2
*iface
)
567 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
569 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
572 static ULONG WINAPI
HTMLFrameBase2_Release(IHTMLFrameBase2
*iface
)
574 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
576 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
579 static HRESULT WINAPI
HTMLFrameBase2_GetTypeInfoCount(IHTMLFrameBase2
*iface
, UINT
*pctinfo
)
581 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
582 FIXME("(%p)\n", This
);
586 static HRESULT WINAPI
HTMLFrameBase2_GetTypeInfo(IHTMLFrameBase2
*iface
, UINT iTInfo
,
587 LCID lcid
, ITypeInfo
**ppTInfo
)
589 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
590 FIXME("(%p)\n", This
);
594 static HRESULT WINAPI
HTMLFrameBase2_GetIDsOfNames(IHTMLFrameBase2
*iface
, REFIID riid
,
595 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
597 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
598 FIXME("(%p)\n", This
);
602 static HRESULT WINAPI
HTMLFrameBase2_Invoke(IHTMLFrameBase2
*iface
, DISPID dispIdMember
,
603 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
604 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
606 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
607 FIXME("(%p)\n", This
);
611 static HRESULT WINAPI
HTMLFrameBase2_get_contentWindow(IHTMLFrameBase2
*iface
, IHTMLWindow2
**p
)
613 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
615 TRACE("(%p)->(%p)\n", This
, p
);
617 if(This
->content_window
) {
618 IHTMLWindow2_AddRef(&This
->content_window
->base
.IHTMLWindow2_iface
);
619 *p
= &This
->content_window
->base
.IHTMLWindow2_iface
;
621 WARN("NULL content window\n");
627 static HRESULT WINAPI
HTMLFrameBase2_put_onload(IHTMLFrameBase2
*iface
, VARIANT v
)
629 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
631 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
633 return set_node_event(&This
->element
.node
, EVENTID_LOAD
, &v
);
636 static HRESULT WINAPI
HTMLFrameBase2_get_onload(IHTMLFrameBase2
*iface
, VARIANT
*p
)
638 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
640 TRACE("(%p)->(%p)\n", This
, p
);
642 return get_node_event(&This
->element
.node
, EVENTID_LOAD
, p
);
645 static HRESULT WINAPI
HTMLFrameBase2_put_onreadystatechange(IHTMLFrameBase2
*iface
, VARIANT v
)
647 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
648 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
652 static HRESULT WINAPI
HTMLFrameBase2_get_onreadystatechange(IHTMLFrameBase2
*iface
, VARIANT
*p
)
654 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
655 FIXME("(%p)->(%p)\n", This
, p
);
659 static HRESULT WINAPI
HTMLFrameBase2_get_readyState(IHTMLFrameBase2
*iface
, BSTR
*p
)
661 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
663 TRACE("(%p)->(%p)\n", This
, p
);
665 if(!This
->content_window
|| !This
->content_window
->base
.inner_window
->doc
) {
666 FIXME("no document associated\n");
670 return IHTMLDocument2_get_readyState(&This
->content_window
->base
.inner_window
->doc
->basedoc
.IHTMLDocument2_iface
, p
);
673 static HRESULT WINAPI
HTMLFrameBase2_put_allowTransparency(IHTMLFrameBase2
*iface
, VARIANT_BOOL v
)
675 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
677 FIXME("(%p)->(%x) semi-stub\n", This
, v
);
682 static HRESULT WINAPI
HTMLFrameBase2_get_allowTransparency(IHTMLFrameBase2
*iface
, VARIANT_BOOL
*p
)
684 HTMLFrameBase
*This
= impl_from_IHTMLFrameBase2(iface
);
686 FIXME("(%p)->(%p) semi-stub\n", This
, p
);
692 static const IHTMLFrameBase2Vtbl HTMLFrameBase2Vtbl
= {
693 HTMLFrameBase2_QueryInterface
,
694 HTMLFrameBase2_AddRef
,
695 HTMLFrameBase2_Release
,
696 HTMLFrameBase2_GetTypeInfoCount
,
697 HTMLFrameBase2_GetTypeInfo
,
698 HTMLFrameBase2_GetIDsOfNames
,
699 HTMLFrameBase2_Invoke
,
700 HTMLFrameBase2_get_contentWindow
,
701 HTMLFrameBase2_put_onload
,
702 HTMLFrameBase2_get_onload
,
703 HTMLFrameBase2_put_onreadystatechange
,
704 HTMLFrameBase2_get_onreadystatechange
,
705 HTMLFrameBase2_get_readyState
,
706 HTMLFrameBase2_put_allowTransparency
,
707 HTMLFrameBase2_get_allowTransparency
710 HRESULT
HTMLFrameBase_QI(HTMLFrameBase
*This
, REFIID riid
, void **ppv
)
712 if(IsEqualGUID(&IID_IHTMLFrameBase
, riid
)) {
713 TRACE("(%p)->(IID_IHTMLFrameBase %p)\n", This
, ppv
);
714 *ppv
= &This
->IHTMLFrameBase_iface
;
715 }else if(IsEqualGUID(&IID_IHTMLFrameBase2
, riid
)) {
716 TRACE("(%p)->(IID_IHTMLFrameBase2 %p)\n", This
, ppv
);
717 *ppv
= &This
->IHTMLFrameBase2_iface
;
719 return HTMLElement_QI(&This
->element
.node
, riid
, ppv
);
722 IUnknown_AddRef((IUnknown
*)*ppv
);
726 void HTMLFrameBase_destructor(HTMLFrameBase
*This
)
728 if(This
->content_window
)
729 This
->content_window
->frame_element
= NULL
;
731 HTMLElement_destructor(&This
->element
.node
);
734 void HTMLFrameBase_Init(HTMLFrameBase
*This
, HTMLDocumentNode
*doc
, nsIDOMHTMLElement
*nselem
,
735 dispex_static_data_t
*dispex_data
)
739 This
->IHTMLFrameBase_iface
.lpVtbl
= &HTMLFrameBaseVtbl
;
740 This
->IHTMLFrameBase2_iface
.lpVtbl
= &HTMLFrameBase2Vtbl
;
742 HTMLElement_Init(&This
->element
, doc
, nselem
, dispex_data
);
744 nsres
= nsIDOMHTMLElement_QueryInterface(nselem
, &IID_nsIDOMHTMLFrameElement
, (void**)&This
->nsframe
);
745 if(NS_FAILED(nsres
)) {
746 This
->nsframe
= NULL
;
747 nsres
= nsIDOMHTMLElement_QueryInterface(nselem
, &IID_nsIDOMHTMLIFrameElement
, (void**)&This
->nsiframe
);
748 assert(nsres
== NS_OK
);
750 This
->nsiframe
= NULL
;