winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
March
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
September 2009
----- 2025 -----
March 2025
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
3 participants
866 discussions
Start a n
N
ew thread
Jacek Caban : mshtml: Move client site ifaces to HTMLDocumentObj.
by Alexandre Julliard
17 Sep '09
17 Sep '09
Module: wine Branch: master Commit: 0d15ad8be4daa36715c4d3eced4e933c82387a3b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0d15ad8be4daa36715c4d3ece…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Sep 16 22:10:03 2009 +0200 mshtml: Move client site ifaces to HTMLDocumentObj. --- dlls/mshtml/htmldoc.c | 12 ++-- dlls/mshtml/htmlwindow.c | 4 +- dlls/mshtml/mshtml_private.h | 20 +++--- dlls/mshtml/navigate.c | 4 +- dlls/mshtml/nsembed.c | 6 +- dlls/mshtml/nsevents.c | 4 +- dlls/mshtml/nsio.c | 7 +- dlls/mshtml/olecmd.c | 46 ++++++++-------- dlls/mshtml/oleobj.c | 64 +++++++++----------- dlls/mshtml/olewnd.c | 16 +++--- dlls/mshtml/persist.c | 12 ++-- dlls/mshtml/task.c | 28 +++++----- dlls/mshtml/view.c | 129 +++++++++++++++++++----------------------- 13 files changed, 166 insertions(+), 186 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=0d15ad8be4daa36715c4d…
1
0
0
0
Jacek Caban : mshtml: Moved selection_list to HTMLDocumentNode object.
by Alexandre Julliard
17 Sep '09
17 Sep '09
Module: wine Branch: master Commit: 068489fb9485a38c0565ac5ad4bf2fac4b167de7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=068489fb9485a38c0565ac5ad…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Sep 16 22:09:42 2009 +0200 mshtml: Moved selection_list to HTMLDocumentNode object. --- dlls/mshtml/htmldoc.c | 8 ++++---- dlls/mshtml/mshtml_private.h | 7 ++++--- dlls/mshtml/selection.c | 31 ++++++++++++++++++------------- 3 files changed, 26 insertions(+), 20 deletions(-) diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index a15112a..8b96328 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -428,8 +428,7 @@ static HRESULT WINAPI HTMLDocument_get_selection(IHTMLDocument2 *iface, IHTMLSel return E_FAIL; } - *p = HTMLSelectionObject_Create(This, nsselection); - return S_OK; + return HTMLSelectionObject_Create(This->doc_node, nsselection, p); } static HRESULT WINAPI HTMLDocument_get_readyState(IHTMLDocument2 *iface, BSTR *p) @@ -1741,7 +1740,6 @@ static void init_doc(HTMLDocument *doc, const htmldoc_vtbl_t *vtbl) doc->readystate = READYSTATE_UNINITIALIZED; list_init(&doc->bindings); - list_init(&doc->selection_list); list_init(&doc->range_list); HTMLDocument_HTMLDocument3_Init(doc); @@ -1787,7 +1785,6 @@ static void destroy_htmldoc(HTMLDocument *This) release_event_target(This->event_target); heap_free(This->mime); - detach_selection(This); detach_ranges(This); release_nodes(This); release_dispex(&This->dispex); @@ -1825,6 +1822,7 @@ static ULONG HTMLDocumentNode_Release(HTMLDocument *base) TRACE("(%p) ref = %u\n", This, ref); if(!ref) { + detach_selection(This); destroy_htmldoc(&This->basedoc); heap_free(This); } @@ -1859,6 +1857,8 @@ HRESULT create_doc_from_nsdoc(nsIDOMHTMLDocument *nsdoc, HTMLDocumentObj *doc_ob doc->basedoc.window = window; + list_init(&doc->selection_list); + *ret = doc; return S_OK; } diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index cf68394..0829190 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -320,7 +320,6 @@ struct HTMLDocument { ConnectionPoint cp_htmldocevents2; ConnectionPoint cp_propnotif; - struct list selection_list; struct list range_list; HTMLDOMNode *nodes; @@ -345,6 +344,8 @@ struct HTMLDocumentNode { HTMLDocument basedoc; LONG ref; + + struct list selection_list; }; struct HTMLDocumentObj { @@ -635,13 +636,13 @@ HRESULT channelbsc_load_stream(nsChannelBSC*,IStream*); void channelbsc_set_channel(nsChannelBSC*,nsChannel*,nsIStreamListener*,nsISupports*); IMoniker *get_channelbsc_mon(nsChannelBSC*); -IHTMLSelectionObject *HTMLSelectionObject_Create(HTMLDocument*,nsISelection*); +HRESULT HTMLSelectionObject_Create(HTMLDocumentNode*,nsISelection*,IHTMLSelectionObject**); IHTMLTxtRange *HTMLTxtRange_Create(HTMLDocument*,nsIDOMRange*); IHTMLStyle *HTMLStyle_Create(nsIDOMCSSStyleDeclaration*); IHTMLStyleSheet *HTMLStyleSheet_Create(nsIDOMStyleSheet*); IHTMLStyleSheetsCollection *HTMLStyleSheetsCollection_Create(nsIDOMStyleSheetList*); -void detach_selection(HTMLDocument*); +void detach_selection(HTMLDocumentNode*); void detach_ranges(HTMLDocument*); HRESULT get_node_text(HTMLDOMNode*,BSTR*); diff --git a/dlls/mshtml/selection.c b/dlls/mshtml/selection.c index 53151a1..0d1729d 100644 --- a/dlls/mshtml/selection.c +++ b/dlls/mshtml/selection.c @@ -38,7 +38,7 @@ typedef struct { LONG ref; nsISelection *nsselection; - HTMLDocument *doc; + HTMLDocumentNode *doc; struct list entry; } HTMLSelectionObject; @@ -154,12 +154,12 @@ static HRESULT WINAPI HTMLSelectionObject_createRange(IHTMLSelectionObject *ifac TRACE("nsrange_cnt = 0\n"); - if(!This->doc->nsdoc) { + if(!This->doc->basedoc.nsdoc) { WARN("nsdoc is NULL\n"); return E_UNEXPECTED; } - nsres = nsIDOMHTMLDocument_GetBody(This->doc->nsdoc, &nsbody); + nsres = nsIDOMHTMLDocument_GetBody(This->doc->basedoc.nsdoc, &nsbody); if(NS_FAILED(nsres) || !nsbody) { ERR("Could not get body: %08x\n", nsres); return E_FAIL; @@ -178,7 +178,7 @@ static HRESULT WINAPI HTMLSelectionObject_createRange(IHTMLSelectionObject *ifac ERR("GetRangeAt failed: %08x\n", nsres); } - *range = (IDispatch*)HTMLTxtRange_Create(This->doc, nsrange); + *range = (IDispatch*)HTMLTxtRange_Create(&This->doc->basedoc, nsrange); return S_OK; } @@ -230,21 +230,26 @@ static const IHTMLSelectionObjectVtbl HTMLSelectionObjectVtbl = { HTMLSelectionObject_get_type }; -IHTMLSelectionObject *HTMLSelectionObject_Create(HTMLDocument *doc, nsISelection *nsselection) +HRESULT HTMLSelectionObject_Create(HTMLDocumentNode *doc, nsISelection *nsselection, IHTMLSelectionObject **ret) { - HTMLSelectionObject *ret = heap_alloc(sizeof(HTMLSelectionObject)); + HTMLSelectionObject *selection; - ret->lpHTMLSelectionObjectVtbl = &HTMLSelectionObjectVtbl; - ret->ref = 1; - ret->nsselection = nsselection; /* We shouldn't call AddRef here */ + selection = heap_alloc(sizeof(HTMLSelectionObject)); + if(!selection) + return E_OUTOFMEMORY; - ret->doc = doc; - list_add_head(&doc->selection_list, &ret->entry); + selection->lpHTMLSelectionObjectVtbl = &HTMLSelectionObjectVtbl; + selection->ref = 1; + selection->nsselection = nsselection; /* We shouldn't call AddRef here */ - return HTMLSELOBJ(ret); + selection->doc = doc; + list_add_head(&doc->selection_list, &selection->entry); + + *ret = HTMLSELOBJ(selection); + return S_OK; } -void detach_selection(HTMLDocument *This) +void detach_selection(HTMLDocumentNode *This) { HTMLSelectionObject *iter;
1
0
0
0
Jacek Caban : mshtml: Moved NSContainer to HTMLDocumentObj.
by Alexandre Julliard
17 Sep '09
17 Sep '09
Module: wine Branch: master Commit: b827996515d6494fcc6aa5993dc44daab4aa6f1a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b827996515d6494fcc6aa5993…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Sep 16 22:09:17 2009 +0200 mshtml: Moved NSContainer to HTMLDocumentObj. --- dlls/mshtml/editor.c | 110 +++++++++++++++++------------------------- dlls/mshtml/htmldoc.c | 16 +++--- dlls/mshtml/mshtml_private.h | 11 ++-- dlls/mshtml/mutation.c | 10 ++-- dlls/mshtml/navigate.c | 4 +- dlls/mshtml/nsembed.c | 26 +++++----- dlls/mshtml/nsevents.c | 40 ++++++++-------- dlls/mshtml/nsio.c | 20 ++++---- dlls/mshtml/olecmd.c | 19 ++++--- dlls/mshtml/oleobj.c | 4 +- dlls/mshtml/persist.c | 8 ++-- dlls/mshtml/script.c | 8 ++-- dlls/mshtml/view.c | 30 ++++++------ 13 files changed, 144 insertions(+), 162 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=b827996515d6494fcc6aa…
1
0
0
0
Jacek Caban : mshtml: Use stored nswindow in IHTMLTxtRange::select.
by Alexandre Julliard
17 Sep '09
17 Sep '09
Module: wine Branch: master Commit: d3e6bf64ec1698df4407219aaf8a5a5349d7d2ac URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d3e6bf64ec1698df4407219aa…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Sep 16 22:08:57 2009 +0200 mshtml: Use stored nswindow in IHTMLTxtRange::select. --- dlls/mshtml/txtrange.c | 21 +++++++++------------ 1 files changed, 9 insertions(+), 12 deletions(-) diff --git a/dlls/mshtml/txtrange.c b/dlls/mshtml/txtrange.c index 509d938..e6a6ff2 100644 --- a/dlls/mshtml/txtrange.c +++ b/dlls/mshtml/txtrange.c @@ -1545,23 +1545,20 @@ static HRESULT WINAPI HTMLTxtRange_moveEnd(IHTMLTxtRange *iface, BSTR Unit, static HRESULT WINAPI HTMLTxtRange_select(IHTMLTxtRange *iface) { HTMLTxtRange *This = HTMLTXTRANGE_THIS(iface); + nsISelection *nsselection; + nsresult nsres; TRACE("(%p)\n", This); - if(This->doc->nscontainer) { - nsIDOMWindow *dom_window = NULL; - nsISelection *nsselection; - - nsIWebBrowser_GetContentDOMWindow(This->doc->nscontainer->webbrowser, &dom_window); - nsIDOMWindow_GetSelection(dom_window, &nsselection); - nsIDOMWindow_Release(dom_window); - - nsISelection_RemoveAllRanges(nsselection); - nsISelection_AddRange(nsselection, This->nsrange); - - nsISelection_Release(nsselection); + nsres = nsIDOMWindow_GetSelection(This->doc->window->nswindow, &nsselection); + if(NS_FAILED(nsres)) { + ERR("GetSelection failed: %08x\n", nsres); + return E_FAIL; } + nsISelection_RemoveAllRanges(nsselection); + nsISelection_AddRange(nsselection, This->nsrange); + nsISelection_Release(nsselection); return S_OK; }
1
0
0
0
Jacek Caban : mshtml: Store reference to document node in window object.
by Alexandre Julliard
17 Sep '09
17 Sep '09
Module: wine Branch: master Commit: 9626f92332c3ebde122d36d7c49b703dc9220799 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9626f92332c3ebde122d36d7c…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Sep 16 22:08:41 2009 +0200 mshtml: Store reference to document node in window object. --- dlls/mshtml/htmldoc.c | 9 +++++---- dlls/mshtml/htmliframe.c | 25 ++++++++++++++++--------- dlls/mshtml/htmlwindow.c | 13 +++++++++++++ dlls/mshtml/mshtml_private.h | 1 + dlls/mshtml/nsembed.c | 8 ++++---- 5 files changed, 39 insertions(+), 17 deletions(-) diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 37b1d51..d083f6b 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -1783,9 +1783,6 @@ static void destroy_htmldoc(HTMLDocument *This) if(This->hwnd) DestroyWindow(This->hwnd); - if(This->window) - IHTMLWindow2_Release(HTMLWINDOW2(This->window)); - if(This->event_target) release_event_target(This->event_target); @@ -1864,7 +1861,6 @@ HRESULT create_doc_from_nsdoc(nsIDOMHTMLDocument *nsdoc, HTMLDocumentObj *doc_ob nsIDOMHTMLDocument_AddRef(nsdoc); doc->basedoc.nsdoc = nsdoc; - IHTMLWindow2_AddRef(HTMLWINDOW2(window)); doc->basedoc.window = window; *ret = doc; @@ -1902,6 +1898,11 @@ static ULONG HTMLDocumentObj_Release(HTMLDocument *base) This->basedoc.doc_node->basedoc.doc_obj = NULL; IHTMLDocument2_Release(HTMLDOC(&This->basedoc.doc_node->basedoc)); } + if(This->basedoc.window) { + This->basedoc.window->doc_obj = NULL; + IHTMLWindow2_Release(HTMLWINDOW2(This->basedoc.window)); + } + destroy_htmldoc(&This->basedoc); heap_free(This); } diff --git a/dlls/mshtml/htmliframe.c b/dlls/mshtml/htmliframe.c index 45673dd..9124a0a 100644 --- a/dlls/mshtml/htmliframe.c +++ b/dlls/mshtml/htmliframe.c @@ -38,7 +38,7 @@ typedef struct { LONG ref; nsIDOMHTMLIFrameElement *nsiframe; - HTMLDocumentNode *content_doc; + HTMLWindow *content_window; } HTMLIFrame; #define HTMLFRAMEBASE2(x) (&(x)->lpIHTMLFrameBase2Vtbl) @@ -104,8 +104,9 @@ static HRESULT WINAPI HTMLIFrameBase2_get_contentWindow(IHTMLFrameBase2 *iface, TRACE("(%p)->(%p)\n", This, p); - if(!This->content_doc) { + if(!This->content_window) { nsIDOMHTMLDocument *nshtmldoc; + HTMLDocumentNode *content_doc; nsIDOMDocument *nsdoc; HTMLWindow *window; nsresult nsres; @@ -135,16 +136,22 @@ static HRESULT WINAPI HTMLIFrameBase2_get_contentWindow(IHTMLFrameBase2 *iface, return hres; } - hres = create_doc_from_nsdoc(nshtmldoc, This->element.node.doc->doc_obj, window, &This->content_doc); - if(SUCCEEDED(hres)) - window->doc = This->content_doc; - IHTMLWindow2_Release(HTMLWINDOW2(window)); + hres = create_doc_from_nsdoc(nshtmldoc, This->element.node.doc->doc_obj, window, &content_doc); nsIDOMHTMLDocument_Release(nshtmldoc); + if(SUCCEEDED(hres)) + window_set_docnode(window, content_doc); + else + IHTMLWindow2_Release(HTMLWINDOW2(window)); + htmldoc_release(&content_doc->basedoc); if(FAILED(hres)) return hres; + + This->content_window = window; } - return IHTMLDocument2_get_parentWindow(HTMLDOC(&This->content_doc->basedoc), p); + IHTMLWindow2_AddRef(HTMLWINDOW2(This->content_window)); + *p = HTMLWINDOW2(This->content_window); + return S_OK; } static HRESULT WINAPI HTMLIFrameBase2_put_onload(IHTMLFrameBase2 *iface, VARIANT v) @@ -239,8 +246,8 @@ static void HTMLIFrame_destructor(HTMLDOMNode *iface) { HTMLIFrame *This = HTMLIFRAME_NODE_THIS(iface); - if(This->content_doc) - htmldoc_release(&This->content_doc->basedoc); + if(This->content_window) + IHTMLWindow2_Release(HTMLWINDOW2(This->content_window)); if(This->nsiframe) nsIDOMHTMLIFrameElement_Release(This->nsiframe); diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 5720fe8..970e327 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -36,6 +36,17 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml); static struct list window_list = LIST_INIT(window_list); +void window_set_docnode(HTMLWindow *window, HTMLDocumentNode *doc_node) +{ + if(window->doc) { + window->doc->basedoc.window = NULL; + htmldoc_release(&window->doc->basedoc); + } + window->doc = doc_node; + if(doc_node) + htmldoc_addref(&doc_node->basedoc); +} + #define HTMLWINDOW2_THIS(iface) DEFINE_THIS(HTMLWindow, HTMLWindow2, iface) static HRESULT WINAPI HTMLWindow2_QueryInterface(IHTMLWindow2 *iface, REFIID riid, void **ppv) @@ -95,6 +106,8 @@ static ULONG WINAPI HTMLWindow2_Release(IHTMLWindow2 *iface) if(!ref) { DWORD i; + window_set_docnode(This, NULL); + if(This->option_factory) { This->option_factory->window = NULL; IHTMLOptionElementFactory_Release(HTMLOPTFACTORY(This->option_factory)); diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 93cf7a6..71a8c8b 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -549,6 +549,7 @@ HRESULT HTMLLoadOptions_Create(IUnknown*,REFIID,void**); HRESULT create_doc_from_nsdoc(nsIDOMHTMLDocument*,HTMLDocumentObj*,HTMLWindow*,HTMLDocumentNode**); HRESULT HTMLWindow_Create(HTMLDocumentObj*,nsIDOMWindow*,HTMLWindow**); +void window_set_docnode(HTMLWindow*,HTMLDocumentNode*); HTMLWindow *nswindow_to_window(const nsIDOMWindow*); HTMLOptionElementFactory *HTMLOptionElementFactory_Create(HTMLWindow*); HRESULT HTMLLocation_Create(HTMLWindow*,HTMLLocation**); diff --git a/dlls/mshtml/nsembed.c b/dlls/mshtml/nsembed.c index bf063dd..61759e9 100644 --- a/dlls/mshtml/nsembed.c +++ b/dlls/mshtml/nsembed.c @@ -844,13 +844,13 @@ void update_nsdocument(HTMLDocumentObj *doc) doc_node->basedoc.doc_obj = NULL; IHTMLDocument2_Release(HTMLDOC(&doc_node->basedoc)); doc->basedoc.doc_node = NULL; - - doc->basedoc.window->doc = NULL; } doc->basedoc.nsdoc = nsdoc; - if(!nsdoc) + if(!nsdoc) { + window_set_docnode(doc->basedoc.window, NULL); return; + } set_mutation_observer(doc->basedoc.nscontainer, nsdoc); @@ -861,7 +861,7 @@ void update_nsdocument(HTMLDocumentObj *doc) } doc->basedoc.doc_node = doc_node; - doc->basedoc.window->doc = doc_node; + window_set_docnode(doc->basedoc.window, doc_node); } void close_gecko(void)
1
0
0
0
Jacek Caban : mshtml: Store document node in window.
by Alexandre Julliard
17 Sep '09
17 Sep '09
Module: wine Branch: master Commit: 62ccef389f296d4a30b41b49ad7dc0384f22b3a1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=62ccef389f296d4a30b41b49a…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Sep 16 22:08:20 2009 +0200 mshtml: Store document node in window. --- dlls/mshtml/htmldoc.c | 3 +-- dlls/mshtml/htmlevent.c | 2 +- dlls/mshtml/htmlevent.h | 2 +- dlls/mshtml/htmliframe.c | 4 ++-- dlls/mshtml/htmllocation.c | 4 ++-- dlls/mshtml/htmloption.c | 6 +++--- dlls/mshtml/htmlwindow.c | 25 +++++++++++++------------ dlls/mshtml/mshtml_private.h | 12 ++++++------ dlls/mshtml/nsembed.c | 3 +++ dlls/mshtml/nsevents.c | 2 +- dlls/mshtml/script.c | 10 +++++----- 11 files changed, 38 insertions(+), 35 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=62ccef389f296d4a30b41…
1
0
0
0
Jacek Caban : mshtml: Create HTMLDocumentNode for each HTMLDocumentObj.
by Alexandre Julliard
17 Sep '09
17 Sep '09
Module: wine Branch: master Commit: 1d2020795ae102d307d56ff3b0538b98ac17c9fd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1d2020795ae102d307d56ff3b…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Sep 16 22:07:58 2009 +0200 mshtml: Create HTMLDocumentNode for each HTMLDocumentObj. --- dlls/mshtml/htmldoc.c | 12 ++++++++++-- dlls/mshtml/htmliframe.c | 2 +- dlls/mshtml/mshtml_private.h | 18 ++++++++++++------ dlls/mshtml/navigate.c | 2 +- dlls/mshtml/nsembed.c | 38 +++++++++++++++++++++++++++----------- dlls/mshtml/nsevents.c | 2 +- 6 files changed, 52 insertions(+), 22 deletions(-) diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 04ef042..d240ee3 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -1847,7 +1847,7 @@ static const htmldoc_vtbl_t HTMLDocumentNodeVtbl = { HTMLDocumentNode_Release }; -HRESULT create_doc_from_nsdoc(nsIDOMHTMLDocument *nsdoc, HTMLWindow *window, HTMLDocumentNode **ret) +HRESULT create_doc_from_nsdoc(nsIDOMHTMLDocument *nsdoc, HTMLDocumentObj *doc_obj, HTMLWindow *window, HTMLDocumentNode **ret) { HTMLDocumentNode *doc; @@ -1855,6 +1855,9 @@ HRESULT create_doc_from_nsdoc(nsIDOMHTMLDocument *nsdoc, HTMLWindow *window, HTM if(!doc) return E_OUTOFMEMORY; + doc->basedoc.doc_node = doc; + doc->basedoc.doc_obj = doc_obj; + init_doc(&doc->basedoc, &HTMLDocumentNodeVtbl); doc->ref = 1; @@ -1895,6 +1898,10 @@ static ULONG HTMLDocumentObj_Release(HTMLDocument *base) TRACE("(%p) ref = %u\n", This, ref); if(!ref) { + if(This->basedoc.doc_node) { + This->basedoc.doc_node->basedoc.doc_obj = NULL; + IHTMLDocument2_Release(HTMLDOC(&This->basedoc.doc_node->basedoc)); + } destroy_htmldoc(&This->basedoc); heap_free(This); } @@ -1925,6 +1932,7 @@ HRESULT HTMLDocument_Create(IUnknown *pUnkOuter, REFIID riid, void** ppvObject) init_doc(&doc->basedoc, &HTMLDocumentObjVtbl); doc->ref = 1; + doc->basedoc.doc_obj = doc; hres = htmldoc_query_interface(&doc->basedoc, riid, ppvObject); htmldoc_release(&doc->basedoc); @@ -1932,7 +1940,6 @@ HRESULT HTMLDocument_Create(IUnknown *pUnkOuter, REFIID riid, void** ppvObject) return hres; doc->basedoc.nscontainer = NSContainer_Create(&doc->basedoc, NULL); - update_nsdocument(&doc->basedoc); if(doc->basedoc.nscontainer) { nsresult nsres; @@ -1950,6 +1957,7 @@ HRESULT HTMLDocument_Create(IUnknown *pUnkOuter, REFIID riid, void** ppvObject) return hres; } + update_nsdocument(doc); doc->basedoc.window->doc = &doc->basedoc; get_thread_hwnd(); diff --git a/dlls/mshtml/htmliframe.c b/dlls/mshtml/htmliframe.c index f0c8cdd..8540cac 100644 --- a/dlls/mshtml/htmliframe.c +++ b/dlls/mshtml/htmliframe.c @@ -135,7 +135,7 @@ static HRESULT WINAPI HTMLIFrameBase2_get_contentWindow(IHTMLFrameBase2 *iface, return hres; } - hres = create_doc_from_nsdoc(nshtmldoc, window, &This->content_doc); + hres = create_doc_from_nsdoc(nshtmldoc, This->element.node.doc->doc_obj, window, &This->content_doc); if(SUCCEEDED(hres)) window->doc = &This->content_doc->basedoc; IHTMLWindow2_Release(HTMLWINDOW2(window)); diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 21e6e2a..5085407 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -249,6 +249,9 @@ typedef struct { ULONG (*release)(HTMLDocument*); } htmldoc_vtbl_t; +typedef struct HTMLDocumentNode HTMLDocumentNode; +typedef struct HTMLDocumentObj HTMLDocumentObj; + struct HTMLDocument { DispatchEx dispex; const htmldoc_vtbl_t *vtbl; @@ -275,6 +278,9 @@ struct HTMLDocument { const IDispatchExVtbl *lpIDispatchExVtbl; const ISupportErrorInfoVtbl *lpSupportErrorInfoVtbl; + HTMLDocumentObj *doc_obj; + HTMLDocumentNode *doc_node; + NSContainer *nscontainer; HTMLWindow *window; nsIDOMHTMLDocument *nsdoc; @@ -336,17 +342,17 @@ static inline ULONG htmldoc_release(HTMLDocument *This) return This->vtbl->release(This); } -typedef struct { +struct HTMLDocumentNode { HTMLDocument basedoc; LONG ref; -} HTMLDocumentNode; +}; -typedef struct { +struct HTMLDocumentObj { HTMLDocument basedoc; LONG ref; -} HTMLDocumentObj; +}; typedef struct { const nsIDOMEventListenerVtbl *lpDOMEventListenerVtbl; @@ -540,7 +546,7 @@ typedef struct { HRESULT HTMLDocument_Create(IUnknown*,REFIID,void**); HRESULT HTMLLoadOptions_Create(IUnknown*,REFIID,void**); -HRESULT create_doc_from_nsdoc(nsIDOMHTMLDocument*,HTMLWindow*,HTMLDocumentNode**); +HRESULT create_doc_from_nsdoc(nsIDOMHTMLDocument*,HTMLDocumentObj*,HTMLWindow*,HTMLDocumentNode**); HRESULT HTMLWindow_Create(nsIDOMWindow*,HTMLWindow**); HTMLWindow *nswindow_to_window(const nsIDOMWindow*); @@ -614,7 +620,7 @@ void get_editor_controller(NSContainer*); void init_nsevents(NSContainer*); void add_nsevent_listener(HTMLWindow*,LPCWSTR); nsresult get_nsinterface(nsISupports*,REFIID,void**); -void update_nsdocument(HTMLDocument*); +void update_nsdocument(HTMLDocumentObj*); void set_document_bscallback(HTMLDocument*,nsChannelBSC*); void set_current_mon(HTMLDocument*,IMoniker*); diff --git a/dlls/mshtml/navigate.c b/dlls/mshtml/navigate.c index e8fa949..54f9aa9 100644 --- a/dlls/mshtml/navigate.c +++ b/dlls/mshtml/navigate.c @@ -950,7 +950,7 @@ static HRESULT read_stream_data(nsChannelBSC *This, IStream *stream) /* events are reset when a new document URI is loaded, so re-initialise them here */ if(This->bsc.doc && This->bsc.doc->bscallback == This && This->bsc.doc->nscontainer) { - update_nsdocument(This->bsc.doc); + update_nsdocument(This->bsc.doc->doc_obj); init_nsevents(This->bsc.doc->nscontainer); } } diff --git a/dlls/mshtml/nsembed.c b/dlls/mshtml/nsembed.c index 0abb2b4..1a0471d 100644 --- a/dlls/mshtml/nsembed.c +++ b/dlls/mshtml/nsembed.c @@ -807,16 +807,18 @@ void set_ns_editmode(NSContainer *This) nsIWebBrowser_SetParentURIContentListener(This->webbrowser, NSURICL(This)); } -void update_nsdocument(HTMLDocument *doc) +void update_nsdocument(HTMLDocumentObj *doc) { + HTMLDocumentNode *doc_node; nsIDOMHTMLDocument *nsdoc; nsIDOMDocument *nsdomdoc; nsresult nsres; + HRESULT hres; - if(!doc->nscontainer || !doc->nscontainer->navigation) + if(!doc->basedoc.nscontainer || !doc->basedoc.nscontainer->navigation) return; - nsres = nsIWebNavigation_GetDocument(doc->nscontainer->navigation, &nsdomdoc); + nsres = nsIWebNavigation_GetDocument(doc->basedoc.nscontainer->navigation, &nsdomdoc); if(NS_FAILED(nsres) || !nsdomdoc) { ERR("GetDocument failed: %08x\n", nsres); return; @@ -829,20 +831,34 @@ void update_nsdocument(HTMLDocument *doc) return; } - if(nsdoc == doc->nsdoc) { + if(nsdoc == doc->basedoc.nsdoc) { nsIDOMHTMLDocument_Release(nsdoc); return; } - if(doc->nsdoc) { - remove_mutation_observer(doc->nscontainer, doc->nsdoc); - nsIDOMHTMLDocument_Release(doc->nsdoc); + if(doc->basedoc.nsdoc) { + remove_mutation_observer(doc->basedoc.nscontainer, doc->basedoc.nsdoc); + nsIDOMHTMLDocument_Release(doc->basedoc.nsdoc); + + doc_node = doc->basedoc.doc_node; + doc_node->basedoc.doc_obj = NULL; + IHTMLDocument2_Release(HTMLDOC(&doc_node->basedoc)); + doc->basedoc.doc_node = NULL; } - doc->nsdoc = nsdoc; + doc->basedoc.nsdoc = nsdoc; + if(!nsdoc) + return; + + set_mutation_observer(doc->basedoc.nscontainer, nsdoc); + + hres = create_doc_from_nsdoc(nsdoc, doc, doc->basedoc.window, &doc_node); + if(FAILED(hres)) { + ERR("Could not create document: %08x\n", hres); + return; + } - if(nsdoc) - set_mutation_observer(doc->nscontainer, nsdoc); + doc->basedoc.doc_node = doc_node; } void close_gecko(void) @@ -949,7 +965,7 @@ static nsresult NSAPI nsWebBrowserChrome_SetStatus(nsIWebBrowserChrome *iface, /* FIXME: This hack should be removed when we'll load all pages by URLMoniker */ if(This->doc) - update_nsdocument(This->doc); + update_nsdocument(This->doc->doc_obj); return NS_OK; } diff --git a/dlls/mshtml/nsevents.c b/dlls/mshtml/nsevents.c index d131e8d..930a725 100644 --- a/dlls/mshtml/nsevents.c +++ b/dlls/mshtml/nsevents.c @@ -137,7 +137,7 @@ static nsresult NSAPI handle_load(nsIDOMEventListener *iface, nsIDOMEvent *event if(!This->doc) return NS_OK; - update_nsdocument(This->doc); + update_nsdocument(This->doc->doc_obj); connect_scripts(This->doc->window); if(This->editor_controller) {
1
0
0
0
Jacek Caban : mshtml: Don't create window in create_doc_from_nsdoc.
by Alexandre Julliard
17 Sep '09
17 Sep '09
Module: wine Branch: master Commit: 5cedf9ca70260ad5c574ec175c9eae0464626d9e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5cedf9ca70260ad5c574ec175…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Sep 16 22:07:38 2009 +0200 mshtml: Don't create window in create_doc_from_nsdoc. --- dlls/mshtml/htmldoc.c | 13 +++++-------- dlls/mshtml/htmliframe.c | 12 +++++++++++- dlls/mshtml/htmlwindow.c | 3 +-- dlls/mshtml/mshtml_private.h | 4 ++-- 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 9eea254..04ef042 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -1847,10 +1847,9 @@ static const htmldoc_vtbl_t HTMLDocumentNodeVtbl = { HTMLDocumentNode_Release }; -HRESULT create_doc_from_nsdoc(nsIDOMHTMLDocument *nsdoc, HTMLDocumentNode **ret) +HRESULT create_doc_from_nsdoc(nsIDOMHTMLDocument *nsdoc, HTMLWindow *window, HTMLDocumentNode **ret) { HTMLDocumentNode *doc; - HRESULT hres; doc = heap_alloc_zero(sizeof(HTMLDocumentNode)); if(!doc) @@ -1862,11 +1861,8 @@ HRESULT create_doc_from_nsdoc(nsIDOMHTMLDocument *nsdoc, HTMLDocumentNode **ret) nsIDOMHTMLDocument_AddRef(nsdoc); doc->basedoc.nsdoc = nsdoc; - hres = HTMLWindow_Create(&doc->basedoc, NULL, &doc->basedoc.window); - if(FAILED(hres)) { - htmldoc_release(&doc->basedoc); - return hres; - } + IHTMLWindow2_AddRef(HTMLWINDOW2(window)); + doc->basedoc.window = window; *ret = doc; return S_OK; @@ -1946,7 +1942,7 @@ HRESULT HTMLDocument_Create(IUnknown *pUnkOuter, REFIID riid, void** ppvObject) ERR("GetContentDOMWindow failed: %08x\n", nsres); } - hres = HTMLWindow_Create(&doc->basedoc, nswindow, &doc->basedoc.window); + hres = HTMLWindow_Create(nswindow, &doc->basedoc.window); if(nswindow) nsIDOMWindow_Release(nswindow); if(FAILED(hres)) { @@ -1954,6 +1950,7 @@ HRESULT HTMLDocument_Create(IUnknown *pUnkOuter, REFIID riid, void** ppvObject) return hres; } + doc->basedoc.window->doc = &doc->basedoc; get_thread_hwnd(); return S_OK; diff --git a/dlls/mshtml/htmliframe.c b/dlls/mshtml/htmliframe.c index 713932f..f0c8cdd 100644 --- a/dlls/mshtml/htmliframe.c +++ b/dlls/mshtml/htmliframe.c @@ -107,6 +107,7 @@ static HRESULT WINAPI HTMLIFrameBase2_get_contentWindow(IHTMLFrameBase2 *iface, if(!This->content_doc) { nsIDOMHTMLDocument *nshtmldoc; nsIDOMDocument *nsdoc; + HTMLWindow *window; nsresult nsres; HRESULT hres; @@ -128,7 +129,16 @@ static HRESULT WINAPI HTMLIFrameBase2_get_contentWindow(IHTMLFrameBase2 *iface, return E_FAIL; } - hres = create_doc_from_nsdoc(nshtmldoc, &This->content_doc); + hres = HTMLWindow_Create(NULL, &window); + if(FAILED(hres)) { + nsIDOMDocument_Release(nsdoc); + return hres; + } + + hres = create_doc_from_nsdoc(nshtmldoc, window, &This->content_doc); + if(SUCCEEDED(hres)) + window->doc = &This->content_doc->basedoc; + IHTMLWindow2_Release(HTMLWINDOW2(window)); nsIDOMHTMLDocument_Release(nshtmldoc); if(FAILED(hres)) return hres; diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 8fae282..1ce18cb 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -1413,7 +1413,7 @@ static dispex_static_data_t HTMLWindow_dispex = { HTMLWindow_iface_tids }; -HRESULT HTMLWindow_Create(HTMLDocument *doc, nsIDOMWindow *nswindow, HTMLWindow **ret) +HRESULT HTMLWindow_Create(nsIDOMWindow *nswindow, HTMLWindow **ret) { HTMLWindow *window; @@ -1425,7 +1425,6 @@ HRESULT HTMLWindow_Create(HTMLDocument *doc, nsIDOMWindow *nswindow, HTMLWindow window->lpHTMLWindow3Vtbl = &HTMLWindow3Vtbl; window->lpIDispatchExVtbl = &WindowDispExVtbl; window->ref = 1; - window->doc = doc; init_dispex(&window->dispex, (IUnknown*)HTMLWINDOW2(window), &HTMLWindow_dispex); diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 6f65787..21e6e2a 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -540,9 +540,9 @@ typedef struct { HRESULT HTMLDocument_Create(IUnknown*,REFIID,void**); HRESULT HTMLLoadOptions_Create(IUnknown*,REFIID,void**); -HRESULT create_doc_from_nsdoc(nsIDOMHTMLDocument*,HTMLDocumentNode**); +HRESULT create_doc_from_nsdoc(nsIDOMHTMLDocument*,HTMLWindow*,HTMLDocumentNode**); -HRESULT HTMLWindow_Create(HTMLDocument*,nsIDOMWindow*,HTMLWindow**); +HRESULT HTMLWindow_Create(nsIDOMWindow*,HTMLWindow**); HTMLWindow *nswindow_to_window(const nsIDOMWindow*); HTMLOptionElementFactory *HTMLOptionElementFactory_Create(HTMLWindow*); HRESULT HTMLLocation_Create(HTMLWindow*,HTMLLocation**);
1
0
0
0
Jacek Caban : mshtml: Moved event_vector to HTMLWindow.
by Alexandre Julliard
17 Sep '09
17 Sep '09
Module: wine Branch: master Commit: 4956e3edb5b531a3469e189240b141b9592de836 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4956e3edb5b531a3469e18924…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Sep 16 22:07:17 2009 +0200 mshtml: Moved event_vector to HTMLWindow. --- dlls/mshtml/htmlevent.c | 14 +++++++------- dlls/mshtml/htmlwindow.c | 1 + dlls/mshtml/mshtml_private.h | 5 ++--- dlls/mshtml/nsembed.c | 1 - dlls/mshtml/nsevents.c | 14 +++----------- 5 files changed, 13 insertions(+), 22 deletions(-) diff --git a/dlls/mshtml/htmlevent.c b/dlls/mshtml/htmlevent.c index db9691c..be42a91 100644 --- a/dlls/mshtml/htmlevent.c +++ b/dlls/mshtml/htmlevent.c @@ -856,16 +856,16 @@ static HRESULT set_event_handler_disp(event_target_t **event_target_ptr, HTMLDoc return S_OK; IDispatch_AddRef(disp); - if(doc->nscontainer && (event_info[eid].flags & EVENT_DEFAULTLISTENER)) { - if(!doc->nscontainer->event_vector) { - doc->nscontainer->event_vector = heap_alloc_zero(EVENTID_LAST*sizeof(BOOL)); - if(!doc->nscontainer->event_vector) + if(doc->window->nswindow && (event_info[eid].flags & EVENT_DEFAULTLISTENER)) { + if(!doc->window->event_vector) { + doc->window->event_vector = heap_alloc_zero(EVENTID_LAST*sizeof(BOOL)); + if(!doc->window->event_vector) return E_OUTOFMEMORY; } - if(!doc->nscontainer->event_vector[eid]) { - doc->nscontainer->event_vector[eid] = TRUE; - add_nsevent_listener(doc->nscontainer, event_info[eid].name); + if(!doc->window->event_vector[eid]) { + doc->window->event_vector[eid] = TRUE; + add_nsevent_listener(doc->window, event_info[eid].name); } } diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index c08929b..8fae282 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -110,6 +110,7 @@ static ULONG WINAPI HTMLWindow2_Release(IHTMLWindow2 *iface) for(i=0; i < This->global_prop_cnt; i++) heap_free(This->global_props[i].name); heap_free(This->global_props); + heap_free(This->event_vector); release_script_hosts(This); list_remove(&This->entry); release_dispex(&This->dispex); diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 91fca71..6f65787 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -198,6 +198,7 @@ struct HTMLWindow { event_target_t *event_target; IHTMLEventObj *event; + BOOL *event_vector; SCRIPTMODE scriptmode; struct list script_hosts; @@ -401,8 +402,6 @@ struct NSContainer { nsChannelBSC *bscallback; /* hack */ HWND reset_focus; /* hack */ - - BOOL *event_vector; }; typedef struct { @@ -613,7 +612,7 @@ nsICommandParams *create_nscommand_params(void); HRESULT nsnode_to_nsstring(nsIDOMNode*,nsAString*); void get_editor_controller(NSContainer*); void init_nsevents(NSContainer*); -void add_nsevent_listener(NSContainer*,LPCWSTR); +void add_nsevent_listener(HTMLWindow*,LPCWSTR); nsresult get_nsinterface(nsISupports*,REFIID,void**); void update_nsdocument(HTMLDocument*); diff --git a/dlls/mshtml/nsembed.c b/dlls/mshtml/nsembed.c index 50001aa..0abb2b4 100644 --- a/dlls/mshtml/nsembed.c +++ b/dlls/mshtml/nsembed.c @@ -932,7 +932,6 @@ static nsrefcnt NSAPI nsWebBrowserChrome_Release(nsIWebBrowserChrome *iface) TRACE("(%p) ref=%d\n", This, ref); if(!ref) { - heap_free(This->event_vector); if(This->parent) nsIWebBrowserChrome_Release(NSWBCHROME(This->parent)); heap_free(This); diff --git a/dlls/mshtml/nsevents.c b/dlls/mshtml/nsevents.c index 40900a7..d131e8d 100644 --- a/dlls/mshtml/nsevents.c +++ b/dlls/mshtml/nsevents.c @@ -235,26 +235,18 @@ static void init_listener(nsEventListener *This, NSContainer *container, This->This = container; } -void add_nsevent_listener(NSContainer *container, LPCWSTR type) +void add_nsevent_listener(HTMLWindow *window, LPCWSTR type) { - nsIDOMWindow *dom_window; nsIDOMEventTarget *target; nsresult nsres; - nsres = nsIWebBrowser_GetContentDOMWindow(container->webbrowser, &dom_window); - if(NS_FAILED(nsres)) { - ERR("GetContentDOMWindow failed: %08x\n", nsres); - return; - } - - nsres = nsIDOMWindow_QueryInterface(dom_window, &IID_nsIDOMEventTarget, (void**)&target); - nsIDOMWindow_Release(dom_window); + nsres = nsIDOMWindow_QueryInterface(window->nswindow, &IID_nsIDOMEventTarget, (void**)&target); if(NS_FAILED(nsres)) { ERR("Could not get nsIDOMEventTarget interface: %08x\n", nsres); return; } - init_event(target, type, NSEVENTLIST(&container->htmlevent_listener), TRUE); + init_event(target, type, NSEVENTLIST(&window->doc->nscontainer->htmlevent_listener), TRUE); nsIDOMEventTarget_Release(target); }
1
0
0
0
Jacek Caban : mshtml: Use stored HTMLWindow in get_selection implementation .
by Alexandre Julliard
17 Sep '09
17 Sep '09
Module: wine Branch: master Commit: ff0d147b22aaf6598edf37aaa58fcbecd3d9547c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ff0d147b22aaf6598edf37aaa…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Sep 16 22:06:56 2009 +0200 mshtml: Use stored HTMLWindow in get_selection implementation. --- dlls/mshtml/htmldoc.c | 15 ++++++--------- 1 files changed, 6 insertions(+), 9 deletions(-) diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index f75ea4b..9eea254 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -417,18 +417,15 @@ static HRESULT WINAPI HTMLDocument_get_designMode(IHTMLDocument2 *iface, BSTR *p static HRESULT WINAPI HTMLDocument_get_selection(IHTMLDocument2 *iface, IHTMLSelectionObject **p) { HTMLDocument *This = HTMLDOC_THIS(iface); - nsISelection *nsselection = NULL; + nsISelection *nsselection; + nsresult nsres; TRACE("(%p)->(%p)\n", This, p); - if(This->nscontainer) { - nsIDOMWindow *dom_window = NULL; - - nsIWebBrowser_GetContentDOMWindow(This->nscontainer->webbrowser, &dom_window); - if(dom_window) { - nsIDOMWindow_GetSelection(dom_window, &nsselection); - nsIDOMWindow_Release(dom_window); - } + nsres = nsIDOMWindow_GetSelection(This->window->nswindow, &nsselection); + if(NS_FAILED(nsres)) { + ERR("GetSelection failed: %08x\n", nsres); + return E_FAIL; } *p = HTMLSelectionObject_Create(This, nsselection);
1
0
0
0
← Newer
1
...
40
41
42
43
44
45
46
...
87
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
Results per page:
10
25
50
100
200