Bug 175893. Make XUL Tabs focusable -- reopened because when switching tabs we were scrolling to the remembered focus instead of remaining at the last position. r=mconnor, sr=neil
git-svn-id: svn://10.0.0.236/trunk@159652 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -492,8 +492,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
function setFocus(element) {
|
||||
Components.lookupMethod(element, "focus").call(element);
|
||||
if (document.commandDispatcher.focusedElement &&
|
||||
document.commandDispatcher.focusedElement.parentNode ==
|
||||
this.mCurrentTab.parentNode) {
|
||||
// The focus is on a tab in the same tab panel
|
||||
return; // If focus was on a tab, switching tabs focuses the new tab
|
||||
}
|
||||
|
||||
var whatToFocus = window.content;
|
||||
@@ -510,10 +513,14 @@
|
||||
whatToFocus = newBrowser.focusedWindow;
|
||||
}
|
||||
|
||||
document.commandDispatcher.suppressFocusScroll = true;
|
||||
function setFocus(element) {
|
||||
document.commandDispatcher.suppressFocusScroll = true;
|
||||
Components.lookupMethod(element, "focus").call(element);
|
||||
document.commandDispatcher.suppressFocusScroll = false;
|
||||
}
|
||||
|
||||
// Use setTimeout to avoid focus outline ghosting.
|
||||
setTimeout(setFocus, 0, whatToFocus);
|
||||
document.commandDispatcher.suppressFocusScroll = false;
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
@@ -583,13 +583,13 @@
|
||||
}
|
||||
|
||||
function setFocus(element) {
|
||||
document.commandDispatcher.suppressFocusScroll = true;
|
||||
Components.lookupMethod(element, "focus").call(element);
|
||||
document.commandDispatcher.suppressFocusScroll = false;
|
||||
}
|
||||
|
||||
document.commandDispatcher.suppressFocusScroll = true;
|
||||
// Use setTimeout to avoid focus outline ghosting.
|
||||
setTimeout(setFocus, 0, whatToFocus);
|
||||
document.commandDispatcher.suppressFocusScroll = false;
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
Reference in New Issue
Block a user