Bug 225207 Focused element is scrolled into view when switching tab r=caillon sr=bryner a=dbaron

This commit is contained in:
neil%parkwaycc.co.uk 2003-12-07 09:44:40 +00:00
Родитель afef7f6294
Коммит 4842365f8d
3 изменённых файлов: 17 добавлений и 0 удалений

Просмотреть файл

@ -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>