Bug 796009 - Streamline keyboard nav of markup in inspector; r=jwalker

This commit is contained in:
J. Ryan Stinnett 2013-02-28 20:50:24 -06:00
parent 8222ea808f
commit 7552084df5
2 changed files with 24 additions and 2 deletions

View File

@ -149,10 +149,24 @@ MarkupView.prototype = {
this.navigate(this._containers.get(this._rootNode.firstChild));
break;
case Ci.nsIDOMKeyEvent.DOM_VK_LEFT:
this.collapseNode(this._selectedContainer.node);
if (this._selectedContainer.expanded) {
this.collapseNode(this._selectedContainer.node);
} else {
let parent = this._selectionWalker().parentNode();
if (parent) {
this.navigate(parent.container);
}
}
break;
case Ci.nsIDOMKeyEvent.DOM_VK_RIGHT:
this.expandNode(this._selectedContainer.node);
if (!this._selectedContainer.expanded) {
this.expandNode(this._selectedContainer.node);
} else {
let next = this._selectionWalker().nextNode();
if (next) {
this.navigate(next.container);
}
}
break;
case Ci.nsIDOMKeyEvent.DOM_VK_UP:
let prev = this._selectionWalker().previousNode();

View File

@ -30,6 +30,14 @@ function test() {
["right", "node7"],
["down", "*text*"],
["down", "node8"],
["left", "node7"],
["left", "node7"],
["right", "node7"],
["right", "*text*"],
["right", "*text*"],
["down", "node8"],
["right", "node8"],
["left", "node8"],
["down", "node9"],
["down", "node10"],
["down", "node11"],