Bug 92100 - When searching in frames, selection is visible in > 1 frame. r=valeski/sr=sfraser

This commit is contained in:
ccarlen%netscape.com 2001-08-22 05:14:15 +00:00
Родитель c892cc8306
Коммит d45df3653c
2 изменённых файлов: 7 добавлений и 0 удалений

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

@ -436,6 +436,11 @@ nsresult nsWebBrowserFind::OnFind(nsIDOMWindow *aFoundWindow)
{
SetCurrentSearchFrame(aFoundWindow);
// We don't want a selection to appear in two frames simultaneously
nsCOMPtr<nsIDOMWindow> lastFocusedWindow = do_QueryReferent(mLastFocusedWindow);
if (lastFocusedWindow && lastFocusedWindow != aFoundWindow)
ClearFrameSelection(lastFocusedWindow);
// focus the frame we found in
nsCOMPtr<nsPIDOMWindow> ourWindow = do_QueryInterface(aFoundWindow);
nsCOMPtr<nsIFocusController> focusController;
@ -445,6 +450,7 @@ nsresult nsWebBrowserFind::OnFind(nsIDOMWindow *aFoundWindow)
{
nsCOMPtr<nsIDOMWindowInternal> windowInt = do_QueryInterface(aFoundWindow);
focusController->SetFocusedWindow(windowInt);
mLastFocusedWindow = getter_AddRefs(NS_GetWeakReference(aFoundWindow));
}
return NS_OK;

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

@ -101,6 +101,7 @@ protected:
nsWeakPtr mCurrentSearchFrame; // who knows if windows can go away during our lifetime, hence weak
nsWeakPtr mRootSearchFrame; // who knows if windows can go away during our lifetime, hence weak
nsWeakPtr mLastFocusedWindow; // who knows if windows can go away during our lifetime, hence weak
nsCOMPtr<nsIFindAndReplace> mTSFind;
};