зеркало из https://github.com/mozilla/pjs.git
Bug 40611:
- add ctrl+tab/ctrl+shift+tab binding to tabcontrol to switch tabs - check view visibility before shifting focus, this prevents us from tabbing into inactive panes in a deck. r=saari,blake. sr=ben.
This commit is contained in:
Родитель
5184a7104b
Коммит
e87ebb1bc9
|
@ -2236,11 +2236,32 @@ nsEventStateManager::GetNextTabbableContent(nsIContent* aRootContent, nsIFrame*
|
|||
|
||||
const nsStyleUserInterface* ui;
|
||||
currentFrame->GetStyleData(eStyleStruct_UserInterface, ((const nsStyleStruct*&)ui));
|
||||
|
||||
|
||||
PRBool viewShown = PR_TRUE;
|
||||
|
||||
nsIView* frameView = nsnull;
|
||||
currentFrame->GetView(mPresContext, &frameView);
|
||||
if (!frameView) {
|
||||
nsIFrame* parentWithView = nsnull;
|
||||
currentFrame->GetParentWithView(mPresContext, &parentWithView);
|
||||
if (parentWithView)
|
||||
parentWithView->GetView(mPresContext, &frameView);
|
||||
}
|
||||
while (frameView) {
|
||||
nsViewVisibility visib;
|
||||
frameView->GetVisibility(visib);
|
||||
if (visib == nsViewVisibility_kHide) {
|
||||
viewShown = PR_FALSE;
|
||||
break;
|
||||
}
|
||||
frameView->GetParent(frameView);
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMElement> element(do_QueryInterface(child));
|
||||
|
||||
// if collapsed or hidden, we don't get tabbed into.
|
||||
if ((disp->mVisible != NS_STYLE_VISIBILITY_COLLAPSE) &&
|
||||
if (viewShown &&
|
||||
(disp->mVisible != NS_STYLE_VISIBILITY_COLLAPSE) &&
|
||||
(disp->mVisible != NS_STYLE_VISIBILITY_HIDDEN) &&
|
||||
(ui->mUserFocus != NS_STYLE_USER_FOCUS_IGNORE) &&
|
||||
(ui->mUserFocus != NS_STYLE_USER_FOCUS_NONE) && element) {
|
||||
|
|
|
@ -33,6 +33,28 @@
|
|||
</getter>
|
||||
</property>
|
||||
</implementation>
|
||||
<handlers>
|
||||
<handler event="keypress" keycode="vk_tab" modifiers="control">
|
||||
<![CDATA[
|
||||
var tabbox = this.getElementsByTagNameNS(
|
||||
"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
|
||||
"tabbox");
|
||||
tabbox = tabbox.length ? tabbox[0] : null;
|
||||
if (tabbox)
|
||||
tabbox.advanceSelectedTab(1);
|
||||
]]>
|
||||
</handler>
|
||||
<handler event="keypress" keycode="vk_tab" modifiers="control,shift">
|
||||
<![CDATA[
|
||||
var tabbox = this.getElementsByTagNameNS(
|
||||
"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
|
||||
"tabbox");
|
||||
tabbox = tabbox.length ? tabbox[0] : null;
|
||||
if (tabbox)
|
||||
tabbox.advanceSelectedTab(-1);
|
||||
]]>
|
||||
</handler>
|
||||
</handlers>
|
||||
</binding>
|
||||
|
||||
<binding id="tabbox" extends="xul:box">
|
||||
|
|
Загрузка…
Ссылка в новой задаче