зеркало из https://github.com/mozilla/pjs.git
Bug 225207 Focused element is scrolled into view when switching tab r=caillon sr=bryner a=dbaron
This commit is contained in:
Родитель
afef7f6294
Коммит
4842365f8d
|
@ -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>
|
||||
|
|
Загрузка…
Ссылка в новой задаче