summaryrefslogtreecommitdiffstats
path: root/WebCore/inspector/front-end/MetricsSidebarPane.js
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/inspector/front-end/MetricsSidebarPane.js')
-rw-r--r--WebCore/inspector/front-end/MetricsSidebarPane.js18
1 files changed, 7 insertions, 11 deletions
diff --git a/WebCore/inspector/front-end/MetricsSidebarPane.js b/WebCore/inspector/front-end/MetricsSidebarPane.js
index a33653b..f5e6758 100644
--- a/WebCore/inspector/front-end/MetricsSidebarPane.js
+++ b/WebCore/inspector/front-end/MetricsSidebarPane.js
@@ -35,27 +35,22 @@ WebInspector.MetricsSidebarPane = function()
WebInspector.MetricsSidebarPane.prototype = {
update: function(node)
{
- var body = this.bodyElement;
-
- body.removeChildren();
-
if (node)
this.node = node;
else
node = this.node;
- if (!node || !node.ownerDocument.defaultView)
- return;
-
- if (node.nodeType !== Node.ELEMENT_NODE)
+ if (!node || !node.ownerDocument.defaultView || node.nodeType !== Node.ELEMENT_NODE) {
+ this.bodyElement.removeChildren();
return;
+ }
var self = this;
var callback = function(stylePayload) {
if (!stylePayload)
return;
var style = WebInspector.CSSStyleDeclaration.parseStyle(stylePayload);
- self._update(node, body, style);
+ self._update(style);
};
InjectedScriptAccess.getComputedStyle(node.id, callback);
@@ -67,7 +62,7 @@ WebInspector.MetricsSidebarPane.prototype = {
InjectedScriptAccess.getInlineStyle(node.id, inlineStyleCallback);
},
- _update: function(node, body, style)
+ _update: function(style)
{
var metricsElement = document.createElement("div");
metricsElement.className = "metrics";
@@ -169,7 +164,8 @@ WebInspector.MetricsSidebarPane.prototype = {
}
metricsElement.appendChild(previousBox);
- body.appendChild(metricsElement);
+ this.bodyElement.removeChildren();
+ this.bodyElement.appendChild(metricsElement);
},
startEditing: function(targetElement, box, styleProperty)