Bug 225207 Focused element is scrolled into view when switching tab r=caillon sr=bryner a=dbaron
git-svn-id: svn://10.0.0.236/trunk@150122 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
dc86624986
commit
ab251939ee
@ -426,3 +426,17 @@ nsXULCommandDispatcher::GetControllerForCommand(const char *aCommand, nsIControl
|
||||
return mFocusController->GetControllerForCommand(aCommand, _retval);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXULCommandDispatcher::GetSuppressFocusScroll(PRBool* aSuppressFocusScroll)
|
||||
{
|
||||
EnsureFocusController();
|
||||
return mFocusController->GetSuppressFocusScroll(aSuppressFocusScroll);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXULCommandDispatcher::SetSuppressFocusScroll(PRBool aSuppressFocusScroll)
|
||||
{
|
||||
EnsureFocusController();
|
||||
return mFocusController->SetSuppressFocusScroll(aSuppressFocusScroll);
|
||||
}
|
||||
|
||||
|
||||
@ -65,4 +65,5 @@ interface nsIDOMXULCommandDispatcher : nsISupports
|
||||
void advanceFocus();
|
||||
void rewindFocus();
|
||||
void advanceFocusIntoSubtree(in nsIDOMElement elt);
|
||||
attribute boolean suppressFocusScroll;
|
||||
};
|
||||
|
||||
@ -567,6 +567,7 @@
|
||||
}
|
||||
|
||||
// Focus the previously focused element or window
|
||||
document.commandDispatcher.suppressFocusScroll = true;
|
||||
if (newBrowser.focusedElement) {
|
||||
try {
|
||||
setFocus(newBrowser.focusedElement);
|
||||
@ -578,6 +579,7 @@
|
||||
setFocus(newBrowser.focusedWindow);
|
||||
else // new tab, focus our new content area
|
||||
setTimeout(setFocus, 0, window.content);
|
||||
document.commandDispatcher.suppressFocusScroll = false;
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user