Index: webkit/glue/devtools/js/devtools.js |
=================================================================== |
--- webkit/glue/devtools/js/devtools.js (revision 13010) |
+++ webkit/glue/devtools/js/devtools.js (working copy) |
@@ -142,13 +142,13 @@ |
* @param {string} text |
*/ |
function debugPrint(text) { |
- var console = WebInspector.console; |
- if (console) { |
- console.addMessage(new WebInspector.ConsoleMessage( |
- "", undefined, 1, "", undefined, 1, text)); |
- } else { |
- alert(text); |
- } |
+ var console = WebInspector.console; |
+ if (console) { |
+ console.addMessage(new WebInspector.ConsoleMessage( |
+ "", undefined, 1, "", undefined, 1, text)); |
+ } else { |
+ alert(text); |
+ } |
} |
@@ -224,6 +224,30 @@ |
}; |
+WebInspector.ElementsPanel.prototype.updateStyles = function(forceUpdate) { |
+ var stylesSidebarPane = this.sidebarPanes.styles; |
+ if (!stylesSidebarPane.expanded || !stylesSidebarPane.needsUpdate) |
+ return; |
+ |
+ var node = this.focusedDOMNode; |
+ if (node && node.nodeType === Node.TEXT_NODE && node.parentNode) |
+ node = node.parentNode; |
+ |
+ if (node && node.nodeType == Node.ELEMENT_NODE) { |
+ var callback = function() { |
+ stylesSidebarPane.update(node, null, forceUpdate); |
+ stylesSidebarPane.needsUpdate = false; |
+ }; |
+ |
+ devtools.tools.getDomAgent().getNodeStylesAsync(node, |
+ !Preferences.showUserAgentStyles, callback); |
+ } else { |
+ stylesSidebarPane.update(null, null, forceUpdate); |
+ stylesSidebarPane.needsUpdate = false; |
+ } |
+}; |
+ |
+ |
WebInspector.PropertiesSidebarPane.prototype.update = function(object) { |
var body = this.bodyElement; |
body.removeChildren(); |