Index: chrome/tools/test/reference_build/chrome_linux/resources/inspector/MetricsSidebarPane.js |
diff --git a/chrome/tools/test/reference_build/chrome_linux/resources/inspector/MetricsSidebarPane.js b/chrome/tools/test/reference_build/chrome_linux/resources/inspector/MetricsSidebarPane.js |
index a22a000f1878bec16a3dc72d369fee651425906d..c13b5787d383700cedf7ec9949f02a4e2af2407a 100644 |
--- a/chrome/tools/test/reference_build/chrome_linux/resources/inspector/MetricsSidebarPane.js |
+++ b/chrome/tools/test/reference_build/chrome_linux/resources/inspector/MetricsSidebarPane.js |
@@ -29,6 +29,7 @@ |
WebInspector.MetricsSidebarPane = function() |
{ |
WebInspector.SidebarPane.call(this, WebInspector.UIString("Metrics")); |
+ this._inlineStyleId = null; |
} |
WebInspector.MetricsSidebarPane.prototype = { |
@@ -46,12 +47,28 @@ WebInspector.MetricsSidebarPane.prototype = { |
if (!node || !node.ownerDocument.defaultView) |
return; |
- var style; |
- if (node.nodeType === Node.ELEMENT_NODE) |
- style = node.ownerDocument.defaultView.getComputedStyle(node); |
- if (!style) |
+ if (node.nodeType !== Node.ELEMENT_NODE) |
return; |
+ var self = this; |
+ var callback = function(stylePayload) { |
+ if (!stylePayload) |
+ return; |
+ var style = WebInspector.CSSStyleDeclaration.parseStyle(stylePayload); |
+ self._update(node, body, style); |
+ }; |
+ InspectorController.getComputedStyle(node.id, callback); |
+ |
+ var inlineStyleCallback = function(stylePayload) { |
+ if (!stylePayload) |
+ return; |
+ self._inlineStyleId = stylePayload.id; |
+ }; |
+ InspectorController.getInlineStyle(node.id, inlineStyleCallback); |
+ }, |
+ |
+ _update: function(node, body, style) |
+ { |
var metricsElement = document.createElement("div"); |
metricsElement.className = "metrics"; |
@@ -184,11 +201,14 @@ WebInspector.MetricsSidebarPane.prototype = { |
if (/^\d+$/.test(userInput)) |
userInput += "px"; |
- this.node.style.setProperty(context.styleProperty, userInput, ""); |
- |
- this.dispatchEventToListeners("metrics edited"); |
- |
- this.update(); |
+ var self = this; |
+ var callback = function(success) { |
+ if (!success) |
+ return; |
+ self.dispatchEventToListeners("metrics edited"); |
+ self.update(); |
+ }; |
+ InspectorController.setStyleProperty(this._inlineStyleId, context.styleProperty, userInput, callback); |
} |
} |