Commit e68cc482 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Store Gecko inner window in HTMLInnerWindow and use it in HTMLTxtRange_select.

parent feda1225
......@@ -3955,6 +3955,8 @@ static void HTMLWindow_traverse(DispatchEx *dispex, nsCycleCollectionTraversalCa
note_cc_edge((nsISupports*)This->session_storage, "session_storage", cb);
if(This->local_storage)
note_cc_edge((nsISupports*)This->local_storage, "local_storage", cb);
if(This->dom_window)
note_cc_edge((nsISupports*)This->dom_window, "dom_window", cb);
traverse_variant(&This->performance, "performance", cb);
}
......@@ -4009,6 +4011,7 @@ static void HTMLWindow_unlink(DispatchEx *dispex)
IHTMLStorage_Release(local_storage);
}
unlink_variant(&This->performance);
unlink_ref(&This->dom_window);
}
static void HTMLWindow_destructor(DispatchEx *dispex)
......@@ -4523,11 +4526,12 @@ HRESULT update_window_doc(HTMLInnerWindow *window)
{
HTMLOuterWindow *outer_window = window->base.outer_window;
compat_mode_t parent_mode = COMPAT_MODE_QUIRKS;
mozIDOMWindow *gecko_inner_window;
nsIDOMDocument *nsdoc;
nsresult nsres;
HRESULT hres;
assert(!window->doc);
assert(!window->doc && !window->dom_window);
if(!outer_window)
return E_UNEXPECTED;
......@@ -4538,6 +4542,12 @@ HRESULT update_window_doc(HTMLInnerWindow *window)
return E_FAIL;
}
nsres = nsIDOMWindow_GetInnerWindow(outer_window->nswindow, &gecko_inner_window);
assert(nsres == NS_OK);
nsres = mozIDOMWindow_QueryInterface(gecko_inner_window, &IID_nsIDOMWindow, (void **)&window->dom_window);
assert(nsres == NS_OK);
mozIDOMWindow_Release(gecko_inner_window);
if(outer_window->parent)
parent_mode = outer_window->parent->base.inner_window->doc->document_mode;
......
......@@ -580,6 +580,7 @@ struct HTMLInnerWindow {
EventTarget event_target;
HTMLDocumentNode *doc;
nsIDOMWindow *dom_window;
struct list children;
struct list script_hosts;
......
......@@ -1287,7 +1287,12 @@ static HRESULT WINAPI HTMLTxtRange_select(IHTMLTxtRange *iface)
TRACE("(%p)\n", This);
nsres = nsIDOMWindow_GetSelection(This->doc->outer_window->nswindow, &nsselection);
if(!This->doc->window) {
FIXME("no window\n");
return E_FAIL;
}
nsres = nsIDOMWindow_GetSelection(This->doc->window->dom_window, &nsselection);
if(NS_FAILED(nsres)) {
ERR("GetSelection failed: %08lx\n", nsres);
return E_FAIL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment