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:
neil%parkwaycc.co.uk 2003-12-07 09:44:40 +00:00
parent dc86624986
commit ab251939ee
3 changed files with 17 additions and 0 deletions

View File

@ -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);
}

View File

@ -65,4 +65,5 @@ interface nsIDOMXULCommandDispatcher : nsISupports
void advanceFocus();
void rewindFocus();
void advanceFocusIntoSubtree(in nsIDOMElement elt);
attribute boolean suppressFocusScroll;
};

View File

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