Bug 955820 - console.group doesn't group messages when timestamps are disabled; r=robcee

This commit is contained in:
Mihai Sucan
2014-02-18 22:10:41 +02:00
parent 6a64c0968b
commit b7797eabb0
4 changed files with 91 additions and 107 deletions

View File

@@ -65,6 +65,9 @@ const COMPAT = {
// The indent of a console group in pixels.
GROUP_INDENT: 12,
// The default indent in pixels, applied even without any groups.
GROUP_INDENT_DEFAULT: 6,
};
// A map from the console API call levels to the Web Console severities.
@@ -776,6 +779,12 @@ Messages.Simple.prototype = Heritage.extend(Messages.BaseMessage.prototype,
let icon = this.document.createElementNS(XHTML_NS, "span");
icon.className = "icon";
// Apply the current group by indenting appropriately.
// TODO: remove this once bug 778766 is fixed.
let iconMarginLeft = this._groupDepthCompat * COMPAT.GROUP_INDENT +
COMPAT.GROUP_INDENT_DEFAULT;
icon.style.marginLeft = iconMarginLeft + "px";
let body = this._renderBody();
this._repeatID.textContent += "|" + body.textContent;
@@ -1319,11 +1328,6 @@ Widgets.MessageTimestamp.prototype = Heritage.extend(Widgets.BaseWidget.prototyp
this.element.className = "timestamp devtools-monospace";
this.element.textContent = l10n.timestampString(this.timestamp) + " ";
// Apply the current group by indenting appropriately.
// TODO: remove this once bug 778766 is fixed.
this.element.style.marginRight = this.message._groupDepthCompat *
COMPAT.GROUP_INDENT + "px";
return this;
},
}); // Widgets.MessageTimestamp.prototype