Skip to content

Commit

Permalink
Backout 3c95dca80f3f (bug 790650) for causing the current #1 toporang…
Browse files Browse the repository at this point in the history
…e, bug 782877

UltraBlame original commit: 74c6fc2c4ad1993020627a800cf5681707cf5222
  • Loading branch information
marco-c committed Sep 28, 2019
1 parent 9a8c6b4 commit 1e17203
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 119 deletions.
3 changes: 1 addition & 2 deletions browser/devtools/debugger/debugger-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ let DebuggerController = {
DebuggerView.StackFrames.initialize();
DebuggerView.Breakpoints.initialize();
DebuggerView.Properties.initialize();
DebuggerView.toggleCloseButton(!this._isRemoteDebugger &&
!this._isChromeDebugger);
DebuggerView.showCloseButton(!this._isRemoteDebugger && !this._isChromeDebugger);

this.dispatchEvent("Debugger:Loaded");
this._connect();
Expand Down
100 changes: 18 additions & 82 deletions browser/devtools/debugger/debugger-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"use strict";

const BREAKPOINT_LINE_TOOLTIP_MAX_SIZE = 1000;
const PANES_APPEARANCE_DELAY = 50;
const PROPERTY_VIEW_FLASH_DURATION = 400;
const GLOBAL_SEARCH_MATCH_FLASH_DURATION = 100;
const GLOBAL_SEARCH_URL_MAX_SIZE = 100;
Expand Down Expand Up @@ -104,8 +103,8 @@ let DebuggerView = {
this._stackframesAndBreakpoints.setAttribute("width", Prefs.stackframesWidth);
this._variables.setAttribute("width", Prefs.variablesWidth);

this.toggleStackframesAndBreakpointsPane({ silent: true });
this.toggleVariablesPane({ silent: true });
this.showStackframesAndBreakpointsPane(Prefs.stackframesPaneVisible);
this.showVariablesPane(Prefs.variablesPaneVisible);
},


Expand Down Expand Up @@ -174,22 +173,18 @@ let DebuggerView = {


_onTogglePanesButtonPressed: function DV__onTogglePanesButtonPressed() {
this.toggleStackframesAndBreakpointsPane({
visible: !!this._togglePanesButton.getAttribute("stackframesAndBreakpointsHidden"),
animated: true
});
this.toggleVariablesPane({
visible: !!this._togglePanesButton.getAttribute("variablesHidden"),
animated: true
});
this._onPanesToggle();
this.showStackframesAndBreakpointsPane(
this._togglePanesButton.getAttribute("stackframesAndBreakpointsHidden"), true);

this.showVariablesPane(
this._togglePanesButton.getAttribute("variablesHidden"), true);
},





toggleCloseButton: function DV_toggleCloseButton(aVisibleFlag) {
showCloseButton: function DV_showCloseButton(aVisibleFlag) {
document.getElementById("close").setAttribute("hidden", !aVisibleFlag);
},

Expand All @@ -198,18 +193,14 @@ let DebuggerView = {







toggleStackframesAndBreakpointsPane:
function DV_toggleStackframesAndBreakpointsPane(aFlags = {}) {
if (aFlags.animated) {
showStackframesAndBreakpointsPane:
function DV_showStackframesAndBreakpointsPane(aVisibleFlag, aAnimatedFlag) {
if (aAnimatedFlag) {
this._stackframesAndBreakpoints.setAttribute("animated", "");
} else {
this._stackframesAndBreakpoints.removeAttribute("animated");
}
if (aFlags.visible) {
if (aVisibleFlag) {
this._stackframesAndBreakpoints.style.marginLeft = "0";
this._togglePanesButton.removeAttribute("stackframesAndBreakpointsHidden");
this._togglePanesButton.setAttribute("tooltiptext", L10N.getStr("collapsePanes"));
Expand All @@ -219,28 +210,22 @@ let DebuggerView = {
this._togglePanesButton.setAttribute("stackframesAndBreakpointsHidden", "true");
this._togglePanesButton.setAttribute("tooltiptext", L10N.getStr("expandPanes"));
}
if (!aFlags.silent) {
Prefs.stackframesPaneVisible = !!aFlags.visible;
}
Prefs.stackframesPaneVisible = aVisibleFlag;
},










toggleVariablesPane:
function DV_toggleVariablesPane(aFlags = {}) {
if (aFlags.animated) {
showVariablesPane:
function DV_showVariablesPane(aVisibleFlag, aAnimatedFlag) {
if (aAnimatedFlag) {
this._variables.setAttribute("animated", "");
} else {
this._variables.removeAttribute("animated");
}
if (aFlags.visible) {
if (aVisibleFlag) {
this._variables.style.marginRight = "0";
this._togglePanesButton.removeAttribute("variablesHidden");
this._togglePanesButton.setAttribute("tooltiptext", L10N.getStr("collapsePanes"));
Expand All @@ -250,54 +235,7 @@ let DebuggerView = {
this._togglePanesButton.setAttribute("variablesHidden", "true");
this._togglePanesButton.setAttribute("tooltiptext", L10N.getStr("expandPanes"));
}
if (!aFlags.silent) {
Prefs.variablesPaneVisible = !!aFlags.visible;
}
},





showPanesIfAllowed: function DV_showPanesIfAllowed() {

window.setTimeout(function() {
let shown;

if (Prefs.stackframesPaneVisible &&
this._togglePanesButton.getAttribute("stackframesAndBreakpointsHidden")) {
this.toggleStackframesAndBreakpointsPane({
visible: true,
animated: true,
silent: true
});
shown = true;
}
if (Prefs.variablesPaneVisible &&
this._togglePanesButton.getAttribute("variablesHidden")) {
this.toggleVariablesPane({
visible: true,
animated: true,
silent: true
});
shown = true;
}
if (shown) {
this._onPanesToggle();
}
}.bind(this), PANES_APPEARANCE_DELAY);
},






_onPanesToggle: function DV__onPanesToggle() {
document.addEventListener("transitionend", function onEvent() {
document.removeEventListener("transitionend", onEvent);
DebuggerController.StackFrames.updateEditorLocation();
});
Prefs.variablesPaneVisible = aVisibleFlag;
},


Expand Down Expand Up @@ -1687,8 +1625,6 @@ StackFramesView.prototype = {
if (document.getElementById("stackframe-" + aDepth)) {
return null;
}

DebuggerView.showPanesIfAllowed();

let frame = document.createElement("box");
let frameName = document.createElement("label");
Expand Down
44 changes: 12 additions & 32 deletions browser/devtools/debugger/test/browser_dbg_pane-collapse.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,32 +19,12 @@ function test() {
gDebugger = gPane.contentWindow;
gView = gDebugger.DebuggerView;

testPanesState();

gView.toggleStackframesAndBreakpointsPane({ visible: true });
gView.toggleVariablesPane({ visible: true });
testPaneCollapse1();
testPaneCollapse2();

closeDebuggerAndFinish();
});
}

function testPanesState() {
let togglePanesButton =
gDebugger.document.getElementById("toggle-panes");

ok(togglePanesButton.getAttribute("stackframesAndBreakpointsHidden"),
"The stackframes and breakpoints pane should initially be invisible.");
is(gDebugger.Prefs.stackframesPaneVisible, true,
"The stackframes and breakpoints pane should initially be preffed as visible.");

ok(togglePanesButton.getAttribute("variablesHidden"),
"The stackframes and breakpoints pane should initially be invisible.");
is(gDebugger.Prefs.variablesPaneVisible, true,
"The stackframes and breakpoints pane should initially be preffed as visible.");
}

function testPaneCollapse1() {
let stackframesAndBrekpoints =
gDebugger.document.getElementById("stackframes+breakpoints");
Expand All @@ -55,16 +35,16 @@ function testPaneCollapse1() {
is(width, gDebugger.Prefs.stackframesWidth,
"The stackframes and breakpoints pane has an incorrect width.");
is(stackframesAndBrekpoints.style.marginLeft, "0px",
"The stackframes and breakpoints pane has an incorrect left margin.");
"The stackframes and breakpoints pane has an incorrect initial left margin.");
ok(!stackframesAndBrekpoints.hasAttribute("animated"),
"The stackframes and breakpoints pane has an incorrect animated attribute.");
"The stackframes and breakpoints pane has an incorrect initial animated attribute.");
ok(!togglePanesButton.getAttribute("stackframesAndBreakpointsHidden"),
"The stackframes and breakpoints pane should at this point be visible.");
"The stackframes and breakpoints pane should initially be visible.");

is(gDebugger.Prefs.stackframesPaneVisible, true,
"The stackframes and breakpoints pane should at this point be visible.");
"The stackframes and breakpoints pane should initially be visible.");

gView.toggleStackframesAndBreakpointsPane({ visible: false, animated: true });
gView.showStackframesAndBreakpointsPane(false, true);

is(gDebugger.Prefs.stackframesPaneVisible, false,
"The stackframes and breakpoints pane should be hidden after collapsing.");
Expand All @@ -82,7 +62,7 @@ function testPaneCollapse1() {
is(gDebugger.Prefs.stackframesPaneVisible, false,
"The stackframes and breakpoints pane should be hidden before uncollapsing.");

gView.toggleStackframesAndBreakpointsPane({ visible: true, animated: false });
gView.showStackframesAndBreakpointsPane(true, false);

is(gDebugger.Prefs.stackframesPaneVisible, true,
"The stackframes and breakpoints pane should be visible after uncollapsing.");
Expand All @@ -107,16 +87,16 @@ function testPaneCollapse2() {
is(width, gDebugger.Prefs.variablesWidth,
"The variables pane has an incorrect width.");
is(variables.style.marginRight, "0px",
"The variables pane has an incorrect right margin.");
"The variables pane has an incorrect initial right margin.");
ok(!variables.hasAttribute("animated"),
"The variables pane has an incorrect animated attribute.");
"The variables pane has an incorrect initial animated attribute.");
ok(!togglePanesButton.getAttribute("variablesHidden"),
"The variables pane should at this point be visible.");
"The variables pane should initially be visible.");

is(gDebugger.Prefs.variablesPaneVisible, true,
"The variables pane should at this point be visible.");
"The variables pane should initially be visible.");

gView.toggleVariablesPane({ visible: false, animated: true });
gView.showVariablesPane(false, true);

is(gDebugger.Prefs.variablesPaneVisible, false,
"The variables pane should be hidden after collapsing.");
Expand All @@ -134,7 +114,7 @@ function testPaneCollapse2() {
is(gDebugger.Prefs.variablesPaneVisible, false,
"The variables pane should be hidden before uncollapsing.");

gView.toggleVariablesPane({ visible: true, animated: false });
gView.showVariablesPane(true, false);

is(gDebugger.Prefs.variablesPaneVisible, true,
"The variables pane should be visible after uncollapsing.");
Expand Down
2 changes: 1 addition & 1 deletion browser/themes/gnomestripe/devtools/debugger.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


#body {
background-color: white;
background: -moz-dialog;
}


Expand Down
2 changes: 1 addition & 1 deletion browser/themes/pinstripe/devtools/debugger.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
%include ../shared.inc

#body {
background-color: white;
background: -moz-dialog;
}


Expand Down
2 changes: 1 addition & 1 deletion browser/themes/winstripe/devtools/debugger.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


#body {
background-color: white;
background: -moz-dialog;
}


Expand Down

0 comments on commit 1e17203

Please sign in to comment.