Bug 503226 r=jst,sicking, sr=jst

--HG--
extra : rebase_source : c45e2f0926bc2e27e298d8a46d14f5acab053484
This commit is contained in:
Olli Pettay 2009-08-15 11:51:37 +03:00
Родитель 72a18ed5c6
Коммит cbcbbb6c30
1 изменённых файлов: 7 добавлений и 2 удалений

Просмотреть файл

@ -2575,8 +2575,13 @@ nsHTMLDocument::GetSelection(nsAString& aReturn)
consoleService->LogStringMessage(NS_LITERAL_STRING("Deprecated method document.getSelection() called. Please use window.getSelection() instead.").get());
}
nsIDOMWindow *window = GetWindow();
NS_ENSURE_TRUE(window, NS_OK);
nsCOMPtr<nsIDOMWindow> window = do_QueryInterface(GetScopeObject());
nsCOMPtr<nsPIDOMWindow> pwin = do_QueryInterface(window);
NS_ENSURE_TRUE(pwin, NS_OK);
NS_ASSERTION(pwin->IsInnerWindow(), "Should have inner window here!");
NS_ENSURE_TRUE(pwin->GetOuterWindow() &&
pwin->GetOuterWindow()->GetCurrentInnerWindow() == pwin,
NS_OK);
nsCOMPtr<nsISelection> selection;
nsresult rv = window->GetSelection(getter_AddRefs(selection));