зеркало из https://github.com/mozilla/pjs.git
Bug 92100 - When searching in frames, selection is visible in > 1 frame. r=valeski/sr=sfraser
This commit is contained in:
Родитель
c892cc8306
Коммит
d45df3653c
|
@ -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;
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче