Fixes the regression where resource time/size pills do not
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 Apr 2008 20:36:36 +0000 (20:36 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 Apr 2008 20:36:36 +0000 (20:36 +0000)
update during a load in the Inspector.

http://bugs.webkit.org/show_bug.cgi?id=18374

Reviewed by John Sullivan.

* page/inspector/ResourcesPanel.js:
(ResourcesPanel.prototype.show): Remove an unneeded call to _updateGraphBars,
since _updateSidebarWidth already calls _updateGraphBars.
(ResourcesPanel.prototype.addResource): Call updateGraphSideWidth.
(ResourcesPanel.prototype._updateGraphBars): Ditto.
(ResourceSidebarTreeElement.prototype.updateGraphSideWidth): Update the
style for graphSideElement with the passed in width.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@31758 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/page/inspector/ResourcesPanel.js

index d4f2820..18a0d8a 100644 (file)
@@ -1,3 +1,20 @@
+2008-04-09  Timothy Hatcher  <timothy@apple.com>
+
+        Fixes the regression where resource time/size pills do not
+        update during a load in the Inspector.
+
+        http://bugs.webkit.org/show_bug.cgi?id=18374
+
+        Reviewed by John Sullivan.
+
+        * page/inspector/ResourcesPanel.js:
+        (ResourcesPanel.prototype.show): Remove an unneeded call to _updateGraphBars,
+        since _updateSidebarWidth already calls _updateGraphBars.
+        (ResourcesPanel.prototype.addResource): Call updateGraphSideWidth.
+        (ResourcesPanel.prototype._updateGraphBars): Ditto.
+        (ResourceSidebarTreeElement.prototype.updateGraphSideWidth): Update the
+        style for graphSideElement with the passed in width.
+
 2008-04-09  Antti Koivisto  <antti@apple.com>
 
         Reviewed by Mitz.
index 43b9c88..4914f7b 100644 (file)
@@ -122,7 +122,6 @@ WebInspector.ResourcesPanel.prototype = {
     {
         WebInspector.Panel.prototype.show.call(this);
         this._updateDividersLabelBarPosition();
-        this._updateGraphBars();
         this._updateSidebarWidth();
         this.refreshIfNeeded();
     },
@@ -227,6 +226,8 @@ WebInspector.ResourcesPanel.prototype = {
         var resourceTreeElement = new WebInspector.ResourceSidebarTreeElement(resource);
         resource._resourcesTreeElement = resourceTreeElement;
 
+        resourceTreeElement.updateGraphSideWidth(this.dividersElement.offsetWidth);
+
         this.resourcesTreeElement.appendChild(resourceTreeElement);
 
         this.refreshResource(resource);
@@ -454,16 +455,13 @@ WebInspector.ResourcesPanel.prototype = {
             return;
         }
 
-        // Add one to account for the sidebar border width.
-        var dividersElementWidth = this.dividersElement.offsetWidth + 1;
-
+        var dividersElementWidth = this.dividersElement.offsetWidth;
         var resourcesLength = this._resources.length;
         for (var i = 0; i < resourcesLength; ++i) {
             var resourceTreeItem = this._resources[i]._resourcesTreeElement;
             if (!resourceTreeItem)
                 continue;
-            resourceTreeItem.graphSideElement.style.right = -dividersElementWidth + "px";
-            resourceTreeItem.graphSideElement.style.width = dividersElementWidth + "px";
+            resourceTreeItem.updateGraphSideWidth(dividersElementWidth);
         }
     },
 
@@ -1113,6 +1111,13 @@ WebInspector.ResourceSidebarTreeElement.prototype = {
         var newClassName = "sidebar-tree-item resource-sidebar-tree-item resources-category-" + this.resource.category.name;
         if (this._listItemNode && this._listItemNode.className !== newClassName)
             this._listItemNode.className = newClassName;
+    },
+
+    updateGraphSideWidth: function(width)
+    {
+        width += 1; // Add one to account for the sidebar border width.
+        this.graphSideElement.style.right = -width + "px";
+        this.graphSideElement.style.width = width + "px";
     }
 }