Bug 816440 - Watch expression evaluations should not display the configurable/enumerable/writable tooltip, r=past

This commit is contained in:
Victor Porof
2012-12-11 09:36:50 +02:00
parent e4aab656bf
commit c3300f6be2
2 changed files with 24 additions and 15 deletions

View File

@@ -637,6 +637,7 @@ StackFrames.prototype = {
let arrow = L10N.getStr("watchExpressionsSeparatorLabel"); let arrow = L10N.getStr("watchExpressionsSeparatorLabel");
let scope = DebuggerView.Variables.addScope(label); let scope = DebuggerView.Variables.addScope(label);
scope.separator = arrow; scope.separator = arrow;
scope.showDescriptorTooltip = false;
scope.allowNameInput = true; scope.allowNameInput = true;
scope.allowDeletion = true; scope.allowDeletion = true;
scope.contextMenu = "debuggerWatchExpressionsContextMenu"; scope.contextMenu = "debuggerWatchExpressionsContextMenu";

View File

@@ -660,6 +660,13 @@ Scope.prototype = {
*/ */
set twisty(aFlag) aFlag ? this.showArrow() : this.hideArrow(), set twisty(aFlag) aFlag ? this.showArrow() : this.hideArrow(),
/**
* Specifies if the configurable/enumerable/writable tooltip should be shown
* whenever a variable or property descriptor is available.
* This flag applies non-recursively to the current scope.
*/
showDescriptorTooltip: true,
/** /**
* Specifies if editing variable or property names is allowed. * Specifies if editing variable or property names is allowed.
* This flag applies non-recursively to the current scope. * This flag applies non-recursively to the current scope.
@@ -1256,26 +1263,27 @@ create({ constructor: Variable, proto: Scope.prototype }, {
this._target.removeEventListener("mouseover", this._displayTooltip, false); this._target.removeEventListener("mouseover", this._displayTooltip, false);
let document = this.document; let document = this.document;
let tooltip = document.createElement("tooltip"); if (this.ownerView.showDescriptorTooltip) {
tooltip.id = "tooltip-" + this.id; let tooltip = document.createElement("tooltip");
tooltip.id = "tooltip-" + this.id;
let configurableLabel = document.createElement("label"); let configurableLabel = document.createElement("label");
configurableLabel.setAttribute("value", "configurable"); configurableLabel.setAttribute("value", "configurable");
let enumerableLabel = document.createElement("label"); let enumerableLabel = document.createElement("label");
enumerableLabel.setAttribute("value", "enumerable"); enumerableLabel.setAttribute("value", "enumerable");
let writableLabel = document.createElement("label"); let writableLabel = document.createElement("label");
writableLabel.setAttribute("value", "writable"); writableLabel.setAttribute("value", "writable");
tooltip.setAttribute("orient", "horizontal") tooltip.setAttribute("orient", "horizontal")
tooltip.appendChild(configurableLabel); tooltip.appendChild(configurableLabel);
tooltip.appendChild(enumerableLabel); tooltip.appendChild(enumerableLabel);
tooltip.appendChild(writableLabel); tooltip.appendChild(writableLabel);
this._target.appendChild(tooltip);
this._target.setAttribute("tooltip", tooltip.id);
this._target.appendChild(tooltip);
this._target.setAttribute("tooltip", tooltip.id);
}
if (this.ownerView.allowNameInput) { if (this.ownerView.allowNameInput) {
this._name.setAttribute("tooltiptext", L10N.getStr("variablesEditableNameTooltip")); this._name.setAttribute("tooltiptext", L10N.getStr("variablesEditableNameTooltip"));
} }