Landing the split window work, bug 296639. This change doesn't have full reviews yet, bzbarsky@mit.edu and shaver@mozilla.org have done partial reviews, but there's still more to look at. Given the current time constraint this is landed with reviews and followup changes that result to come after the initial checkin. a=drivers
This commit is contained in:
@@ -2671,6 +2671,9 @@ static void CheckForFocus(nsPIDOMWindow* aOurWindow,
|
||||
nsIFocusController* aFocusController,
|
||||
nsIDocument* aDocument)
|
||||
{
|
||||
NS_ASSERTION(aOurWindow->IsOuterWindow(),
|
||||
"Uh, our window has to be an outer window!");
|
||||
|
||||
// Now that we have a root frame, we can set focus on the presshell.
|
||||
// We do this only if our DOM window is currently focused or is an
|
||||
// an ancestor of a previously focused window.
|
||||
@@ -2711,8 +2714,10 @@ static void CheckForFocus(nsPIDOMWindow* aOurWindow,
|
||||
}
|
||||
|
||||
while (curDoc) {
|
||||
nsCOMPtr<nsIDOMWindowInternal> curWin = do_QueryInterface(curDoc->GetScriptGlobalObject());
|
||||
if (curWin == ourWin || !curWin)
|
||||
nsCOMPtr<nsPIDOMWindow> curWin =
|
||||
do_QueryInterface(curDoc->GetScriptGlobalObject());
|
||||
|
||||
if (!curWin || curWin->GetOuterWindow() == ourWin)
|
||||
break;
|
||||
|
||||
curDoc = curDoc->GetParentDocument();
|
||||
@@ -4359,12 +4364,13 @@ PresShell::GoToAnchor(const nsAString& aAnchorName, PRBool aScroll)
|
||||
// Now focus the document itself if focus is on an element within it.
|
||||
nsCOMPtr<nsPIDOMWindow> win =
|
||||
do_QueryInterface(mDocument->GetScriptGlobalObject());
|
||||
|
||||
if (win) {
|
||||
nsCOMPtr<nsIFocusController> focusController = win->GetRootFocusController();
|
||||
if (focusController) {
|
||||
nsCOMPtr<nsIDOMWindowInternal> focusedWin;
|
||||
focusController->GetFocusedWindow(getter_AddRefs(focusedWin));
|
||||
if (SameCOMIdentity(win, focusedWin)) {
|
||||
if (SameCOMIdentity(win->GetOuterWindow(), focusedWin)) {
|
||||
esm->ChangeFocusWith(nsnull, nsIEventStateManager::eEventFocusedByApplication);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user