зеркало из https://github.com/mozilla/gecko-dev.git
Bug 916601 - Remove Ctrl +/-/0 zooming shortcuts from web console; r=harth
This commit is contained in:
Родитель
78979e2433
Коммит
723bc552e7
|
@ -15,7 +15,7 @@ function test() {
|
|||
browser.addEventListener("load", function onLoad() {
|
||||
browser.removeEventListener("load", onLoad, true);
|
||||
Services.prefs.setIntPref("devtools.webconsole.fontSize", 10);
|
||||
openConsole(null, testFontSizeChange);
|
||||
HUDService.toggleBrowserConsole().then(testFontSizeChange);
|
||||
}, true);
|
||||
}
|
||||
|
||||
|
@ -24,19 +24,19 @@ function testFontSizeChange(hud) {
|
|||
let outputNode = hud.jsterm.outputNode;
|
||||
outputNode.focus();
|
||||
|
||||
EventUtils.synthesizeKey("-", { accelKey: true });
|
||||
EventUtils.synthesizeKey("-", { accelKey: true }, hud.iframeWindow);
|
||||
is(inputNode.style.fontSize, "10px", "input font stays at same size with ctrl+-");
|
||||
is(outputNode.style.fontSize, inputNode.style.fontSize, "output font stays at same size with ctrl+-");
|
||||
|
||||
EventUtils.synthesizeKey("=", { accelKey: true });
|
||||
EventUtils.synthesizeKey("=", { accelKey: true }, hud.iframeWindow);
|
||||
is(inputNode.style.fontSize, "11px", "input font increased with ctrl+=");
|
||||
is(outputNode.style.fontSize, inputNode.style.fontSize, "output font stays at same size with ctrl+=");
|
||||
|
||||
EventUtils.synthesizeKey("-", { accelKey: true });
|
||||
EventUtils.synthesizeKey("-", { accelKey: true }, hud.iframeWindow);
|
||||
is(inputNode.style.fontSize, "10px", "font decreased with ctrl+-");
|
||||
is(outputNode.style.fontSize, inputNode.style.fontSize, "output font stays at same size with ctrl+-");
|
||||
|
||||
EventUtils.synthesizeKey("0", { accelKey: true });
|
||||
EventUtils.synthesizeKey("0", { accelKey: true }, hud.iframeWindow);
|
||||
is(inputNode.style.fontSize, "", "font reset with ctrl+0");
|
||||
is(outputNode.style.fontSize, inputNode.style.fontSize, "output font stays at same size with ctrl+0");
|
||||
|
||||
|
|
|
@ -491,7 +491,8 @@ WebConsoleFrame.prototype = {
|
|||
this._initFilterButtons();
|
||||
this._changeClearModifier();
|
||||
|
||||
let fontSize = Services.prefs.getIntPref("devtools.webconsole.fontSize");
|
||||
let fontSize = this.owner._browserConsole ?
|
||||
Services.prefs.getIntPref("devtools.webconsole.fontSize") : 0;
|
||||
|
||||
if (fontSize != 0) {
|
||||
fontSize = Math.max(MIN_FONT_SIZE, fontSize);
|
||||
|
@ -501,6 +502,13 @@ WebConsoleFrame.prototype = {
|
|||
this.inputNode.style.fontSize = fontSize + "px";
|
||||
}
|
||||
|
||||
if (this.owner._browserConsole) {
|
||||
for (let id of ["Enlarge", "Reduce", "Reset"]) {
|
||||
this.document.getElementById("cmd_fullZoom" + id)
|
||||
.removeAttribute("disabled");
|
||||
}
|
||||
}
|
||||
|
||||
let updateSaveBodiesPrefUI = (aElement) => {
|
||||
this.getSaveRequestAndResponseBodies().then(aValue => {
|
||||
aElement.setAttribute("checked", aValue);
|
||||
|
@ -4598,12 +4606,12 @@ CommandController.prototype = {
|
|||
return selectedItem && "url" in selectedItem;
|
||||
}
|
||||
case "consoleCmd_clearOutput":
|
||||
case "cmd_fontSizeEnlarge":
|
||||
case "cmd_fontSizeReduce":
|
||||
case "cmd_fontSizeReset":
|
||||
case "cmd_selectAll":
|
||||
case "cmd_find":
|
||||
return true;
|
||||
case "cmd_fontSizeEnlarge":
|
||||
case "cmd_fontSizeReduce":
|
||||
case "cmd_fontSizeReset":
|
||||
case "cmd_close":
|
||||
return this.owner.owner._browserConsole;
|
||||
}
|
||||
|
|
|
@ -42,9 +42,9 @@ function goUpdateConsoleCommands() {
|
|||
<command id="consoleCmd_clearOutput"
|
||||
oncommand="goDoCommand('consoleCmd_clearOutput');"/>
|
||||
<command id="cmd_find" oncommand="goDoCommand('cmd_find');"/>
|
||||
<command id="cmd_fullZoomEnlarge" oncommand="goDoCommand('cmd_fontSizeEnlarge');"/>
|
||||
<command id="cmd_fullZoomReduce" oncommand="goDoCommand('cmd_fontSizeReduce');"/>
|
||||
<command id="cmd_fullZoomReset" oncommand="goDoCommand('cmd_fontSizeReset');"/>
|
||||
<command id="cmd_fullZoomEnlarge" oncommand="goDoCommand('cmd_fontSizeEnlarge');" disabled="true"/>
|
||||
<command id="cmd_fullZoomReduce" oncommand="goDoCommand('cmd_fontSizeReduce');" disabled="true"/>
|
||||
<command id="cmd_fullZoomReset" oncommand="goDoCommand('cmd_fontSizeReset');" disabled="true"/>
|
||||
<command id="cmd_close" oncommand="goDoCommand('cmd_close');" disabled="true"/>
|
||||
</commandset>
|
||||
<keyset id="consoleKeys">
|
||||
|
|
Загрузка…
Ссылка в новой задаче