Commit f20513aa authored by Erik Luo's avatar Erik Luo Committed by Commit Bot

DevTools: one objectValue css for console instead of per message

Before, each visible console message created a 'objectValue.css'
style tag, resulting in a lot of duplicate rules
( https://imgur.com/a/cT1QX )

This CL replaces per-message style tags with a single one for
ConsoleView, since messages only appear within ConsoleView.

Bug: none
Change-Id: I91b4d4ac766e2d6b29f5d68068c9d7a9d850c16a
Reviewed-on: https://chromium-review.googlesource.com/879848Reviewed-by: default avatarDmitry Gozman <dgozman@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Commit-Position: refs/heads/master@{#533794}
parent 75ff845d
......@@ -36,6 +36,7 @@ Console.ConsoleView = class extends UI.VBox {
super();
this.setMinimumSize(0, 35);
this.registerRequiredCSS('console/consoleView.css');
this.registerRequiredCSS('object_ui/objectValue.css');
this._searchableView = new UI.SearchableView(this);
this._searchableView.element.classList.add('console-searchable-view');
......
......@@ -114,9 +114,7 @@ Console.ConsoleViewMessage = class {
* @return {!Element}
*/
_buildTableMessage() {
var formattedMessage = createElement('span');
UI.appendStyle(formattedMessage, 'object_ui/objectValue.css');
formattedMessage.className = 'source-code';
var formattedMessage = createElementWithClass('span', 'source-code');
var anchorElement = this._buildMessageAnchor();
if (anchorElement)
formattedMessage.appendChild(anchorElement);
......@@ -271,10 +269,7 @@ Console.ConsoleViewMessage = class {
}
messageElement.classList.add('console-message-text');
var formattedMessage = createElement('span');
UI.appendStyle(formattedMessage, 'object_ui/objectValue.css');
formattedMessage.className = 'source-code';
var formattedMessage = createElementWithClass('span', 'source-code');
var anchorElement = this._buildMessageAnchor();
if (anchorElement)
formattedMessage.appendChild(anchorElement);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment