mshtml: Moved option_factory to HTMLWindow object.
This commit is contained in:
parent
336b0ef18f
commit
c9f6aaa2f7
|
@ -196,11 +196,6 @@ static ULONG WINAPI HTMLDocument_Release(IHTMLDocument2 *iface)
|
|||
if(This->hwnd)
|
||||
DestroyWindow(This->hwnd);
|
||||
|
||||
if(This->option_factory) {
|
||||
This->option_factory->doc = NULL;
|
||||
IHTMLOptionElementFactory_Release(HTMLOPTFACTORY(This->option_factory));
|
||||
}
|
||||
|
||||
if(This->location)
|
||||
This->location->doc = NULL;
|
||||
|
||||
|
|
|
@ -459,7 +459,7 @@ static HRESULT WINAPI HTMLOptionElementFactory_create(IHTMLOptionElementFactory
|
|||
TRACE("(%p)->(%s %s %s %s %p)\n", This, debugstr_variant(&text), debugstr_variant(&value),
|
||||
debugstr_variant(&defaultselected), debugstr_variant(&selected), optelem);
|
||||
|
||||
if(!This->doc->nsdoc) {
|
||||
if(!This->window || !This->window->doc || !This->window->doc->nsdoc) {
|
||||
WARN("NULL nsdoc\n");
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
@ -467,14 +467,14 @@ static HRESULT WINAPI HTMLOptionElementFactory_create(IHTMLOptionElementFactory
|
|||
*optelem = NULL;
|
||||
|
||||
nsAString_Init(&option_str, optionW);
|
||||
nsres = nsIDOMHTMLDocument_CreateElement(This->doc->nsdoc, &option_str, &nselem);
|
||||
nsres = nsIDOMHTMLDocument_CreateElement(This->window->doc->nsdoc, &option_str, &nselem);
|
||||
nsAString_Finish(&option_str);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("CreateElement failed: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
hres = IHTMLDOMNode_QueryInterface(HTMLDOMNODE(get_node(This->doc, (nsIDOMNode*)nselem, TRUE)),
|
||||
hres = IHTMLDOMNode_QueryInterface(HTMLDOMNODE(get_node(This->window->doc, (nsIDOMNode*)nselem, TRUE)),
|
||||
&IID_IHTMLOptionElement, (void**)optelem);
|
||||
nsIDOMElement_Release(nselem);
|
||||
|
||||
|
@ -509,7 +509,7 @@ static const IHTMLOptionElementFactoryVtbl HTMLOptionElementFactoryVtbl = {
|
|||
HTMLOptionElementFactory_create
|
||||
};
|
||||
|
||||
HTMLOptionElementFactory *HTMLOptionElementFactory_Create(HTMLDocument *doc)
|
||||
HTMLOptionElementFactory *HTMLOptionElementFactory_Create(HTMLWindow *window)
|
||||
{
|
||||
HTMLOptionElementFactory *ret;
|
||||
|
||||
|
@ -517,7 +517,7 @@ HTMLOptionElementFactory *HTMLOptionElementFactory_Create(HTMLDocument *doc)
|
|||
|
||||
ret->lpHTMLOptionElementFactoryVtbl = &HTMLOptionElementFactoryVtbl;
|
||||
ret->ref = 1;
|
||||
ret->doc = doc;
|
||||
ret->window = window;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -95,6 +95,11 @@ static ULONG WINAPI HTMLWindow2_Release(IHTMLWindow2 *iface)
|
|||
if(!ref) {
|
||||
DWORD i;
|
||||
|
||||
if(This->option_factory) {
|
||||
This->option_factory->window = NULL;
|
||||
IHTMLOptionElementFactory_Release(HTMLOPTFACTORY(This->option_factory));
|
||||
}
|
||||
|
||||
if(This->event_target)
|
||||
release_event_target(This->event_target);
|
||||
for(i=0; i < This->global_prop_cnt; i++)
|
||||
|
@ -672,10 +677,10 @@ static HRESULT WINAPI HTMLWindow2_get_Option(IHTMLWindow2 *iface, IHTMLOptionEle
|
|||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
if(!This->doc->option_factory)
|
||||
This->doc->option_factory = HTMLOptionElementFactory_Create(This->doc);
|
||||
if(!This->option_factory)
|
||||
This->option_factory = HTMLOptionElementFactory_Create(This);
|
||||
|
||||
*p = HTMLOPTFACTORY(This->doc->option_factory);
|
||||
*p = HTMLOPTFACTORY(This->option_factory);
|
||||
IHTMLOptionElementFactory_AddRef(*p);
|
||||
|
||||
return S_OK;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2005-2008 Jacek Caban for CodeWeavers
|
||||
* Copyright 2005-2009 Jacek Caban for CodeWeavers
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -153,6 +153,8 @@ void release_dispex(DispatchEx*);
|
|||
BOOL dispex_query_interface(DispatchEx*,REFIID,void**);
|
||||
HRESULT dispex_get_dprop_ref(DispatchEx*,const WCHAR*,BOOL,VARIANT**);
|
||||
|
||||
typedef struct HTMLWindow HTMLWindow;
|
||||
|
||||
typedef enum {
|
||||
SCRIPTMODE_GECKO,
|
||||
SCRIPTMODE_ACTIVESCRIPT
|
||||
|
@ -167,6 +169,14 @@ typedef struct {
|
|||
} global_prop_t;
|
||||
|
||||
typedef struct {
|
||||
const IHTMLOptionElementFactoryVtbl *lpHTMLOptionElementFactoryVtbl;
|
||||
|
||||
LONG ref;
|
||||
|
||||
HTMLWindow *window;
|
||||
} HTMLOptionElementFactory;
|
||||
|
||||
struct HTMLWindow {
|
||||
DispatchEx dispex;
|
||||
const IHTMLWindow2Vtbl *lpHTMLWindow2Vtbl;
|
||||
const IHTMLWindow3Vtbl *lpHTMLWindow3Vtbl;
|
||||
|
@ -183,12 +193,14 @@ typedef struct {
|
|||
SCRIPTMODE scriptmode;
|
||||
struct list script_hosts;
|
||||
|
||||
HTMLOptionElementFactory *option_factory;
|
||||
|
||||
global_prop_t *global_props;
|
||||
DWORD global_prop_cnt;
|
||||
DWORD global_prop_size;
|
||||
|
||||
struct list entry;
|
||||
} HTMLWindow;
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
UNKNOWN_USERMODE,
|
||||
|
@ -229,14 +241,6 @@ struct HTMLLocation {
|
|||
HTMLDocument *doc;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
const IHTMLOptionElementFactoryVtbl *lpHTMLOptionElementFactoryVtbl;
|
||||
|
||||
LONG ref;
|
||||
|
||||
HTMLDocument *doc;
|
||||
} HTMLOptionElementFactory;
|
||||
|
||||
struct HTMLDocument {
|
||||
DispatchEx dispex;
|
||||
const IHTMLDocument2Vtbl *lpHTMLDocument2Vtbl;
|
||||
|
@ -303,7 +307,6 @@ struct HTMLDocument {
|
|||
ConnectionPoint cp_htmldocevents2;
|
||||
ConnectionPoint cp_propnotif;
|
||||
|
||||
HTMLOptionElementFactory *option_factory;
|
||||
HTMLLocation *location;
|
||||
|
||||
struct list selection_list;
|
||||
|
@ -510,7 +513,7 @@ HRESULT create_doc_from_nsdoc(nsIDOMHTMLDocument*,HTMLDocument**);
|
|||
|
||||
HRESULT HTMLWindow_Create(HTMLDocument*,nsIDOMWindow*,HTMLWindow**);
|
||||
HTMLWindow *nswindow_to_window(const nsIDOMWindow*);
|
||||
HTMLOptionElementFactory *HTMLOptionElementFactory_Create(HTMLDocument*);
|
||||
HTMLOptionElementFactory *HTMLOptionElementFactory_Create(HTMLWindow*);
|
||||
HTMLLocation *HTMLLocation_Create(HTMLDocument*);
|
||||
IOmNavigator *OmNavigator_Create(void);
|
||||
|
||||
|
|
Loading…
Reference in New Issue