Fix window.find() to start searching in the window it was called on, not the focussed frame. Part of bug 118657, r=mstolz, sr=jst.
git-svn-id: svn://10.0.0.236/trunk@141427 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
be4557e3b3
commit
ebce3fa98e
@ -3670,7 +3670,6 @@ GlobalWindowImpl::FindInternal(const nsAString& aStr,
|
||||
nsresult rv = NS_OK;
|
||||
*aDidFind = PR_FALSE;
|
||||
|
||||
// GetInterface(NS_GET_IID(nsIWebBrowserFind))
|
||||
nsCOMPtr<nsIWebBrowserFind> finder(do_GetInterface(mDocShell));
|
||||
|
||||
// Set the options of the search
|
||||
@ -3682,6 +3681,16 @@ GlobalWindowImpl::FindInternal(const nsAString& aStr,
|
||||
finder->SetEntireWord(wholeWord);
|
||||
finder->SetSearchFrames(searchInFrames);
|
||||
|
||||
// the nsIWebBrowserFind is initialized to use this window
|
||||
// as the search root, but uses focus to set the current search
|
||||
// frame. If we're being called from JS (as here), this window
|
||||
// should be the current search frame.
|
||||
nsCOMPtr<nsIWebBrowserFindInFrames> framesFinder(do_QueryInterface(finder));
|
||||
if (framesFinder) {
|
||||
framesFinder->SetRootSearchFrame(this); // paranoia
|
||||
framesFinder->SetCurrentSearchFrame(this);
|
||||
}
|
||||
|
||||
// The Find API does not accept empty strings. Launch the Find Dialog.
|
||||
if (aStr.IsEmpty() || showDialog) {
|
||||
// See if the find dialog is already up using nsIWindowMediator
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user