From 3490ae57c5f84a866c55741d52aca0c6b1f2339a Mon Sep 17 00:00:00 2001 From: Girish Sharma Date: Tue, 2 Jul 2013 16:05:09 +0530 Subject: [PATCH 1/2] Backout 4cdab5388392 (Bug 886474) because of wrong shortcut modifier --- .../sourceeditor/source-editor-orion.jsm | 2 -- .../browser_bug729960_block_bracket_jump.js | 28 +++++++++---------- ...rowser_bug744021_next_prev_bracket_jump.js | 12 ++++---- 3 files changed, 20 insertions(+), 22 deletions(-) diff --git a/browser/devtools/sourceeditor/source-editor-orion.jsm b/browser/devtools/sourceeditor/source-editor-orion.jsm index 4de70e91363c..55a9a4424c42 100644 --- a/browser/devtools/sourceeditor/source-editor-orion.jsm +++ b/browser/devtools/sourceeditor/source-editor-orion.jsm @@ -123,13 +123,11 @@ const DEFAULT_KEYBINDINGS = [ action: "Move to Bracket Opening", code: Ci.nsIDOMKeyEvent.DOM_VK_OPEN_BRACKET, accel: true, - shift: true, }, { action: "Move to Bracket Closing", code: Ci.nsIDOMKeyEvent.DOM_VK_CLOSE_BRACKET, accel: true, - shift: true, }, ]; diff --git a/browser/devtools/sourceeditor/test/browser_bug729960_block_bracket_jump.js b/browser/devtools/sourceeditor/test/browser_bug729960_block_bracket_jump.js index 4608dbfc202d..534018e246d1 100644 --- a/browser/devtools/sourceeditor/test/browser_bug729960_block_bracket_jump.js +++ b/browser/devtools/sourceeditor/test/browser_bug729960_block_bracket_jump.js @@ -53,33 +53,33 @@ function test() { // Setting caret at Line 1 bracket start. editor.setCaretOffset(19); - EventUtils.synthesizeKey("]", {accelKey: true, shiftKey: true}, testWin); + EventUtils.synthesizeKey("]", {accelKey: true}, testWin); is(editor.getCaretOffset(), 220, "JS : Jump to closing bracket of the code block when caret at block start"); - EventUtils.synthesizeKey("[", {accelKey: true, shiftKey: true}, testWin); + EventUtils.synthesizeKey("[", {accelKey: true}, testWin); is(editor.getCaretOffset(), 20, "JS : Jump to opening bracket of the code block when caret at block end"); // Setting caret at Line 10 start. editor.setCaretOffset(161); - EventUtils.synthesizeKey("[", {accelKey: true, shiftKey: true}, testWin); + EventUtils.synthesizeKey("[", {accelKey: true}, testWin); is(editor.getCaretOffset(), 20, "JS : Jump to opening bracket of code block when inside the function"); editor.setCaretOffset(161); - EventUtils.synthesizeKey("]", {accelKey: true, shiftKey: true}, testWin); + EventUtils.synthesizeKey("]", {accelKey: true}, testWin); is(editor.getCaretOffset(), 220, "JS : Jump to closing bracket of code block when inside the function"); // Setting caret at Line 6 start. editor.setCaretOffset(67); - EventUtils.synthesizeKey("]", {accelKey: true, shiftKey: true}, testWin); + EventUtils.synthesizeKey("]", {accelKey: true}, testWin); is(editor.getCaretOffset(), 159, "JS : Jump to closing bracket in a nested function with caret inside"); editor.setCaretOffset(67); - EventUtils.synthesizeKey("[", {accelKey: true, shiftKey: true}, testWin); + EventUtils.synthesizeKey("[", {accelKey: true}, testWin); is(editor.getCaretOffset(), 62, "JS : Jump to opening bracket in a nested function with caret inside"); @@ -93,22 +93,22 @@ function test() { // Setting caret at Line 1 bracket start. editor.setCaretOffset(8); - EventUtils.synthesizeKey("]", {accelKey: true, shiftKey: true}, testWin); + EventUtils.synthesizeKey("]", {accelKey: true}, testWin); is(editor.getCaretOffset(), 45, "CSS : Jump to closing bracket of the code block when caret at block start"); - EventUtils.synthesizeKey("[", {accelKey: true, shiftKey: true}, testWin); + EventUtils.synthesizeKey("[", {accelKey: true}, testWin); is(editor.getCaretOffset(), 9, "CSS : Jump to opening bracket of the code block when caret at block end"); // Setting caret at Line 3 start. editor.setCaretOffset(28); - EventUtils.synthesizeKey("[", {accelKey: true, shiftKey: true}, testWin); + EventUtils.synthesizeKey("[", {accelKey: true}, testWin); is(editor.getCaretOffset(), 9, "CSS : Jump to opening bracket of code block when inside the function"); editor.setCaretOffset(28); - EventUtils.synthesizeKey("]", {accelKey: true, shiftKey: true}, testWin); + EventUtils.synthesizeKey("]", {accelKey: true}, testWin); is(editor.getCaretOffset(), 45, "CSS : Jump to closing bracket of code block when inside the function"); @@ -124,13 +124,13 @@ function test() { // Setting caret at Line 1 end. editor.setCaretOffset(6); - EventUtils.synthesizeKey("]", {accelKey: true, shiftKey: true}, testWin); + EventUtils.synthesizeKey("]", {accelKey: true}, testWin); is(editor.getCaretOffset(), 6, "HTML : Jump to block end : Nothing happens in html mode"); // Setting caret at Line 4 end. editor.setCaretOffset(64); - EventUtils.synthesizeKey("[", {accelKey: true, shiftKey: true}, testWin); + EventUtils.synthesizeKey("[", {accelKey: true}, testWin); is(editor.getCaretOffset(), 64, "HTML : Jump to block start : Nothing happens in html mode"); @@ -144,13 +144,13 @@ function test() { // Setting caret at Line 1 start. editor.setCaretOffset(0); - EventUtils.synthesizeKey("]", {accelKey: true, shiftKey: true}, testWin); + EventUtils.synthesizeKey("]", {accelKey: true}, testWin); is(editor.getCaretOffset(), 0, "Text : Jump to block end : Nothing happens in text mode"); // Setting caret at Line 4 end. editor.setCaretOffset(28); - EventUtils.synthesizeKey("[", {accelKey: true, shiftKey: true}, testWin); + EventUtils.synthesizeKey("[", {accelKey: true}, testWin); is(editor.getCaretOffset(), 28, "Text : Jump to block start : Nothing happens in text mode"); diff --git a/browser/devtools/sourceeditor/test/browser_bug744021_next_prev_bracket_jump.js b/browser/devtools/sourceeditor/test/browser_bug744021_next_prev_bracket_jump.js index 68d055babce6..72b7d45c6654 100644 --- a/browser/devtools/sourceeditor/test/browser_bug744021_next_prev_bracket_jump.js +++ b/browser/devtools/sourceeditor/test/browser_bug744021_next_prev_bracket_jump.js @@ -57,15 +57,15 @@ function test() { // Setting caret at end of line 11 (function baz() {). editor.setCaretOffset(147); - EventUtils.synthesizeKey("[", {accelKey: true, shiftKey: true}, testWin); + EventUtils.synthesizeKey("[", {accelKey: true}, testWin); is(editor.getCaretOffset(), 16, "JS : Jump to opening bracket of previous sibling block when no parent"); - EventUtils.synthesizeKey("]", {accelKey: true, shiftKey: true}, testWin); + EventUtils.synthesizeKey("]", {accelKey: true}, testWin); is(editor.getCaretOffset(), 129, "JS : Jump to closing bracket of same code block"); - EventUtils.synthesizeKey("]", {accelKey: true, shiftKey: true}, testWin); + EventUtils.synthesizeKey("]", {accelKey: true}, testWin); is(editor.getCaretOffset(), 151, "JS : Jump to closing bracket of next sibling code block"); @@ -82,15 +82,15 @@ function test() { // Setting caret at Line 5 end (.class1 {). editor.setCaretOffset(57); - EventUtils.synthesizeKey("[", {accelKey: true, shiftKey: true}, testWin); + EventUtils.synthesizeKey("[", {accelKey: true}, testWin); is(editor.getCaretOffset(), 10, "CSS : Jump to opening bracket of previous sibling code block"); - EventUtils.synthesizeKey("]", {accelKey: true, shiftKey: true}, testWin); + EventUtils.synthesizeKey("]", {accelKey: true}, testWin); is(editor.getCaretOffset(), 46, "CSS : Jump to closing bracket of same code block"); - EventUtils.synthesizeKey("]", {accelKey: true, shiftKey: true}, testWin); + EventUtils.synthesizeKey("]", {accelKey: true}, testWin); is(editor.getCaretOffset(), 77, "CSS : Jump to closing bracket of next sibling code block"); From cb800508e0a2c96089c9d849c1d5d92ebe3772c1 Mon Sep 17 00:00:00 2001 From: Girish Sharma Date: Tue, 2 Jul 2013 16:07:31 +0530 Subject: [PATCH 2/2] Bug 886474 - Stop using Ctrl + ] [ to match brackets in source editor, r=msucan --- .../sourceeditor/source-editor-orion.jsm | 2 ++ .../browser_bug729960_block_bracket_jump.js | 28 +++++++++---------- ...rowser_bug744021_next_prev_bracket_jump.js | 12 ++++---- 3 files changed, 22 insertions(+), 20 deletions(-) diff --git a/browser/devtools/sourceeditor/source-editor-orion.jsm b/browser/devtools/sourceeditor/source-editor-orion.jsm index 55a9a4424c42..b595e6110d48 100644 --- a/browser/devtools/sourceeditor/source-editor-orion.jsm +++ b/browser/devtools/sourceeditor/source-editor-orion.jsm @@ -123,11 +123,13 @@ const DEFAULT_KEYBINDINGS = [ action: "Move to Bracket Opening", code: Ci.nsIDOMKeyEvent.DOM_VK_OPEN_BRACKET, accel: true, + alt: true, }, { action: "Move to Bracket Closing", code: Ci.nsIDOMKeyEvent.DOM_VK_CLOSE_BRACKET, accel: true, + alt: true, }, ]; diff --git a/browser/devtools/sourceeditor/test/browser_bug729960_block_bracket_jump.js b/browser/devtools/sourceeditor/test/browser_bug729960_block_bracket_jump.js index 534018e246d1..137964173da2 100644 --- a/browser/devtools/sourceeditor/test/browser_bug729960_block_bracket_jump.js +++ b/browser/devtools/sourceeditor/test/browser_bug729960_block_bracket_jump.js @@ -53,33 +53,33 @@ function test() { // Setting caret at Line 1 bracket start. editor.setCaretOffset(19); - EventUtils.synthesizeKey("]", {accelKey: true}, testWin); + EventUtils.synthesizeKey("]", {accelKey: true, altKey: true}, testWin); is(editor.getCaretOffset(), 220, "JS : Jump to closing bracket of the code block when caret at block start"); - EventUtils.synthesizeKey("[", {accelKey: true}, testWin); + EventUtils.synthesizeKey("[", {accelKey: true, altKey: true}, testWin); is(editor.getCaretOffset(), 20, "JS : Jump to opening bracket of the code block when caret at block end"); // Setting caret at Line 10 start. editor.setCaretOffset(161); - EventUtils.synthesizeKey("[", {accelKey: true}, testWin); + EventUtils.synthesizeKey("[", {accelKey: true, altKey: true}, testWin); is(editor.getCaretOffset(), 20, "JS : Jump to opening bracket of code block when inside the function"); editor.setCaretOffset(161); - EventUtils.synthesizeKey("]", {accelKey: true}, testWin); + EventUtils.synthesizeKey("]", {accelKey: true, altKey: true}, testWin); is(editor.getCaretOffset(), 220, "JS : Jump to closing bracket of code block when inside the function"); // Setting caret at Line 6 start. editor.setCaretOffset(67); - EventUtils.synthesizeKey("]", {accelKey: true}, testWin); + EventUtils.synthesizeKey("]", {accelKey: true, altKey: true}, testWin); is(editor.getCaretOffset(), 159, "JS : Jump to closing bracket in a nested function with caret inside"); editor.setCaretOffset(67); - EventUtils.synthesizeKey("[", {accelKey: true}, testWin); + EventUtils.synthesizeKey("[", {accelKey: true, altKey: true}, testWin); is(editor.getCaretOffset(), 62, "JS : Jump to opening bracket in a nested function with caret inside"); @@ -93,22 +93,22 @@ function test() { // Setting caret at Line 1 bracket start. editor.setCaretOffset(8); - EventUtils.synthesizeKey("]", {accelKey: true}, testWin); + EventUtils.synthesizeKey("]", {accelKey: true, altKey: true}, testWin); is(editor.getCaretOffset(), 45, "CSS : Jump to closing bracket of the code block when caret at block start"); - EventUtils.synthesizeKey("[", {accelKey: true}, testWin); + EventUtils.synthesizeKey("[", {accelKey: true, altKey: true}, testWin); is(editor.getCaretOffset(), 9, "CSS : Jump to opening bracket of the code block when caret at block end"); // Setting caret at Line 3 start. editor.setCaretOffset(28); - EventUtils.synthesizeKey("[", {accelKey: true}, testWin); + EventUtils.synthesizeKey("[", {accelKey: true, altKey: true}, testWin); is(editor.getCaretOffset(), 9, "CSS : Jump to opening bracket of code block when inside the function"); editor.setCaretOffset(28); - EventUtils.synthesizeKey("]", {accelKey: true}, testWin); + EventUtils.synthesizeKey("]", {accelKey: true, altKey: true}, testWin); is(editor.getCaretOffset(), 45, "CSS : Jump to closing bracket of code block when inside the function"); @@ -124,13 +124,13 @@ function test() { // Setting caret at Line 1 end. editor.setCaretOffset(6); - EventUtils.synthesizeKey("]", {accelKey: true}, testWin); + EventUtils.synthesizeKey("]", {accelKey: true, altKey: true}, testWin); is(editor.getCaretOffset(), 6, "HTML : Jump to block end : Nothing happens in html mode"); // Setting caret at Line 4 end. editor.setCaretOffset(64); - EventUtils.synthesizeKey("[", {accelKey: true}, testWin); + EventUtils.synthesizeKey("[", {accelKey: true, altKey: true}, testWin); is(editor.getCaretOffset(), 64, "HTML : Jump to block start : Nothing happens in html mode"); @@ -144,13 +144,13 @@ function test() { // Setting caret at Line 1 start. editor.setCaretOffset(0); - EventUtils.synthesizeKey("]", {accelKey: true}, testWin); + EventUtils.synthesizeKey("]", {accelKey: true, altKey: true}, testWin); is(editor.getCaretOffset(), 0, "Text : Jump to block end : Nothing happens in text mode"); // Setting caret at Line 4 end. editor.setCaretOffset(28); - EventUtils.synthesizeKey("[", {accelKey: true}, testWin); + EventUtils.synthesizeKey("[", {accelKey: true, altKey: true}, testWin); is(editor.getCaretOffset(), 28, "Text : Jump to block start : Nothing happens in text mode"); diff --git a/browser/devtools/sourceeditor/test/browser_bug744021_next_prev_bracket_jump.js b/browser/devtools/sourceeditor/test/browser_bug744021_next_prev_bracket_jump.js index 72b7d45c6654..b822df587d04 100644 --- a/browser/devtools/sourceeditor/test/browser_bug744021_next_prev_bracket_jump.js +++ b/browser/devtools/sourceeditor/test/browser_bug744021_next_prev_bracket_jump.js @@ -57,15 +57,15 @@ function test() { // Setting caret at end of line 11 (function baz() {). editor.setCaretOffset(147); - EventUtils.synthesizeKey("[", {accelKey: true}, testWin); + EventUtils.synthesizeKey("[", {accelKey: true, altKey: true}, testWin); is(editor.getCaretOffset(), 16, "JS : Jump to opening bracket of previous sibling block when no parent"); - EventUtils.synthesizeKey("]", {accelKey: true}, testWin); + EventUtils.synthesizeKey("]", {accelKey: true, altKey: true}, testWin); is(editor.getCaretOffset(), 129, "JS : Jump to closing bracket of same code block"); - EventUtils.synthesizeKey("]", {accelKey: true}, testWin); + EventUtils.synthesizeKey("]", {accelKey: true, altKey: true}, testWin); is(editor.getCaretOffset(), 151, "JS : Jump to closing bracket of next sibling code block"); @@ -82,15 +82,15 @@ function test() { // Setting caret at Line 5 end (.class1 {). editor.setCaretOffset(57); - EventUtils.synthesizeKey("[", {accelKey: true}, testWin); + EventUtils.synthesizeKey("[", {accelKey: true, altKey: true}, testWin); is(editor.getCaretOffset(), 10, "CSS : Jump to opening bracket of previous sibling code block"); - EventUtils.synthesizeKey("]", {accelKey: true}, testWin); + EventUtils.synthesizeKey("]", {accelKey: true, altKey: true}, testWin); is(editor.getCaretOffset(), 46, "CSS : Jump to closing bracket of same code block"); - EventUtils.synthesizeKey("]", {accelKey: true}, testWin); + EventUtils.synthesizeKey("]", {accelKey: true, altKey: true}, testWin); is(editor.getCaretOffset(), 77, "CSS : Jump to closing bracket of next sibling code block");