Title: [89577] trunk/Source/WebCore
Revision
89577
Author
[email protected]
Date
2011-06-23 08:56:07 -0700 (Thu, 23 Jun 2011)

Log Message

2011-06-23  Vsevolod Vlasov  <[email protected]>

        Reviewed by Yury Semikhatsky.

        Web Inspector: Show "no content" message in network panel when resource does not have content available.
        https://bugs.webkit.org/show_bug.cgi?id=63007

        * English.lproj/localizedStrings.js:
        * WebCore.gypi:
        * WebCore.vcproj/WebCore.vcproj:
        * inspector/front-end/ApplicationCacheItemsView.js:
        (WebInspector.ApplicationCacheItemsView):
        (WebInspector.ApplicationCacheItemsView.prototype._updateCallback):
        * inspector/front-end/CookieItemsView.js:
        (WebInspector.CookieItemsView):
        (WebInspector.CookieItemsView.prototype._updateWithCookies):
        * inspector/front-end/DatabaseTableView.js:
        (WebInspector.DatabaseTableView.prototype._queryFinished):
        * inspector/front-end/EmptyView.js: Added.
        (WebInspector.EmptyView):
        (WebInspector.EmptyView.prototype.show):
        (WebInspector.EmptyView.prototype.set text):
        * inspector/front-end/NetworkItemView.js:
        (WebInspector.NetworkItemView):
        (WebInspector.ResourceContentView):
        (WebInspector.ResourceContentView.prototype.hasContent):
        (WebInspector.ResourceContentView.prototype.get sourceView):
        (WebInspector.ResourceContentView.prototype.show):
        (WebInspector.ResourceContentView.prototype._ensureInnerViewShown.callback):
        (WebInspector.ResourceContentView.prototype._ensureInnerViewShown):
        (WebInspector.ResourceContentView.prototype.contentLoaded):
        * inspector/front-end/ResourceCookiesView.js:
        (WebInspector.ResourceCookiesView.prototype.show):
        * inspector/front-end/ResourcePreviewView.js:
        (WebInspector.ResourcePreviewView):
        (WebInspector.ResourcePreviewView.prototype.contentLoaded):
        (WebInspector.ResourcePreviewView.prototype._createInnerView):
        * inspector/front-end/ResourceResponseView.js: Added.
        (WebInspector.ResourceResponseView):
        (WebInspector.ResourceResponseView.prototype.get sourceView):
        (WebInspector.ResourceResponseView.prototype.contentLoaded):
        * inspector/front-end/ResourceTimingView.js:
        (WebInspector.ResourceTimingView.prototype.show):
        * inspector/front-end/ResourcesPanel.js:
        (WebInspector.StorageCategoryView):
        (WebInspector.StorageCategoryView.prototype.setText):
        * inspector/front-end/WebKit.qrc:
        * inspector/front-end/inspector.html:

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (89576 => 89577)


--- trunk/Source/WebCore/ChangeLog	2011-06-23 15:53:03 UTC (rev 89576)
+++ trunk/Source/WebCore/ChangeLog	2011-06-23 15:56:07 UTC (rev 89577)
@@ -1,3 +1,52 @@
+2011-06-23  Vsevolod Vlasov  <[email protected]>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: Show "no content" message in network panel when resource does not have content available.
+        https://bugs.webkit.org/show_bug.cgi?id=63007
+
+        * English.lproj/localizedStrings.js:
+        * WebCore.gypi:
+        * WebCore.vcproj/WebCore.vcproj:
+        * inspector/front-end/ApplicationCacheItemsView.js:
+        (WebInspector.ApplicationCacheItemsView):
+        (WebInspector.ApplicationCacheItemsView.prototype._updateCallback):
+        * inspector/front-end/CookieItemsView.js:
+        (WebInspector.CookieItemsView):
+        (WebInspector.CookieItemsView.prototype._updateWithCookies):
+        * inspector/front-end/DatabaseTableView.js:
+        (WebInspector.DatabaseTableView.prototype._queryFinished):
+        * inspector/front-end/EmptyView.js: Added.
+        (WebInspector.EmptyView):
+        (WebInspector.EmptyView.prototype.show):
+        (WebInspector.EmptyView.prototype.set text):
+        * inspector/front-end/NetworkItemView.js:
+        (WebInspector.NetworkItemView):
+        (WebInspector.ResourceContentView):
+        (WebInspector.ResourceContentView.prototype.hasContent):
+        (WebInspector.ResourceContentView.prototype.get sourceView):
+        (WebInspector.ResourceContentView.prototype.show):
+        (WebInspector.ResourceContentView.prototype._ensureInnerViewShown.callback):
+        (WebInspector.ResourceContentView.prototype._ensureInnerViewShown):
+        (WebInspector.ResourceContentView.prototype.contentLoaded):
+        * inspector/front-end/ResourceCookiesView.js:
+        (WebInspector.ResourceCookiesView.prototype.show):
+        * inspector/front-end/ResourcePreviewView.js:
+        (WebInspector.ResourcePreviewView):
+        (WebInspector.ResourcePreviewView.prototype.contentLoaded):
+        (WebInspector.ResourcePreviewView.prototype._createInnerView):
+        * inspector/front-end/ResourceResponseView.js: Added.
+        (WebInspector.ResourceResponseView):
+        (WebInspector.ResourceResponseView.prototype.get sourceView):
+        (WebInspector.ResourceResponseView.prototype.contentLoaded):
+        * inspector/front-end/ResourceTimingView.js:
+        (WebInspector.ResourceTimingView.prototype.show):
+        * inspector/front-end/ResourcesPanel.js:
+        (WebInspector.StorageCategoryView):
+        (WebInspector.StorageCategoryView.prototype.setText):
+        * inspector/front-end/WebKit.qrc:
+        * inspector/front-end/inspector.html:
+
 2011-06-23  Balazs Kelemen  <[email protected]>
 
         Reviewed by Adam Roben.

Modified: trunk/Source/WebCore/English.lproj/localizedStrings.js


(Binary files differ)

Modified: trunk/Source/WebCore/WebCore.gypi (89576 => 89577)


--- trunk/Source/WebCore/WebCore.gypi	2011-06-23 15:53:03 UTC (rev 89576)
+++ trunk/Source/WebCore/WebCore.gypi	2011-06-23 15:56:07 UTC (rev 89577)
@@ -6257,6 +6257,7 @@
             'inspector/front-end/Drawer.js',
             'inspector/front-end/ElementsPanel.js',
             'inspector/front-end/ElementsTreeOutline.js',
+            'inspector/front-end/EmptyView.js',
             'inspector/front-end/EventListenersSidebarPane.js',
             'inspector/front-end/ExtensionAPI.js',
             'inspector/front-end/ExtensionAuditCategory.js',
@@ -6302,6 +6303,7 @@
             'inspector/front-end/ResourceHeadersView.js',
             'inspector/front-end/ResourceJSONView.js',
             'inspector/front-end/ResourceHTMLView.js',
+            'inspector/front-end/ResourceResponseView.js',
             'inspector/front-end/ResourceTimingView.js',
             'inspector/front-end/ResourceTreeModel.js',
             'inspector/front-end/ResourceView.js',

Modified: trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj (89576 => 89577)


--- trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj	2011-06-23 15:53:03 UTC (rev 89576)
+++ trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj	2011-06-23 15:56:07 UTC (rev 89577)
@@ -67981,6 +67981,10 @@
 					>
 				</File>
 				<File
+					RelativePath="..\inspector\front-end\EmptyView.js"
+					>
+				</File>
+				<File
 					RelativePath="..\inspector\front-end\EventListenersSidebarPane.js"
 					>
 				</File>
@@ -68209,6 +68213,10 @@
 					>
 				</File>
 				<File
+					RelativePath="..\inspector\front-end\ResourceResponseView.js"
+					>
+				</File>
+				<File
 					RelativePath="..\inspector\front-end\ResourceTimingView.js"
 					>
 				</File>

Modified: trunk/Source/WebCore/inspector/front-end/ApplicationCacheItemsView.js (89576 => 89577)


--- trunk/Source/WebCore/inspector/front-end/ApplicationCacheItemsView.js	2011-06-23 15:53:03 UTC (rev 89576)
+++ trunk/Source/WebCore/inspector/front-end/ApplicationCacheItemsView.js	2011-06-23 15:56:07 UTC (rev 89577)
@@ -61,10 +61,8 @@
     this._treeElement = treeElement;
     this._appcacheDomain = appcacheDomain;
 
-    this._emptyMsgElement = document.createElement("div");
-    this._emptyMsgElement.className = "storage-empty-view";
-    this._emptyMsgElement.textContent = WebInspector.UIString("No Application Cache information available.");
-    this.element.appendChild(this._emptyMsgElement);
+    this._emptyView = new WebInspector.EmptyView(WebInspector.UIString("No Application Cache information available."));
+    this._emptyView.show(this.element);
 
     this.updateStatus(applicationCache.UNCACHED);
 
@@ -164,7 +162,7 @@
         var lastPathComponent = applicationCaches.lastPathComponent;
 
         if (!this._manifest) {
-            this._emptyMsgElement.removeStyleClass("hidden");
+            this._emptyView.show(this.element);
             this.deleteButton.visible = false;
             if (this._dataGrid)
                 this._dataGrid.element.addStyleClass("hidden");
@@ -177,7 +175,7 @@
         this._populateDataGrid();
         this._dataGrid.autoSizeColumns(20, 80);
         this._dataGrid.element.removeStyleClass("hidden");
-        this._emptyMsgElement.addStyleClass("hidden");
+        this._emptyView.hide();
         this.deleteButton.visible = true;
 
         var totalSizeString = Number.bytesToString(this._size);

Modified: trunk/Source/WebCore/inspector/front-end/CookieItemsView.js (89576 => 89577)


--- trunk/Source/WebCore/inspector/front-end/CookieItemsView.js	2011-06-23 15:53:03 UTC (rev 89576)
+++ trunk/Source/WebCore/inspector/front-end/CookieItemsView.js	2011-06-23 15:56:07 UTC (rev 89577)
@@ -43,10 +43,8 @@
     this._treeElement = treeElement;
     this._cookieDomain = cookieDomain;
 
-    this._emptyMsgElement = document.createElement("div");
-    this._emptyMsgElement.className = "storage-empty-view";
-    this._emptyMsgElement.textContent = WebInspector.UIString("This site has no cookies.");
-    this.element.appendChild(this._emptyMsgElement);
+    this._emptyView = new WebInspector.EmptyView(WebInspector.UIString("This site has no cookies."));
+    this._emptyView.show(this.element);
 }
 
 WebInspector.CookieItemsView.prototype = {
@@ -84,7 +82,7 @@
 
         if (!this._cookies.length) {
             // Nothing to show.
-            this._emptyMsgElement.removeStyleClass("hidden");
+            this._emptyView.show(this.element);
             this._deleteButton.visible = false;
             if (this._cookiesTable)
                 this._cookiesTable.element.addStyleClass("hidden");
@@ -98,7 +96,7 @@
 
         this._cookiesTable.setCookies(this._cookies);
         this._cookiesTable.element.removeStyleClass("hidden");
-        this._emptyMsgElement.addStyleClass("hidden");
+        this._emptyView.hide();
         if (isAdvanced) {
             this._treeElement.subtitle = String.sprintf(WebInspector.UIString("%d cookies (%s)"), this._cookies.length,
                 Number.bytesToString(this._totalSize));

Modified: trunk/Source/WebCore/inspector/front-end/DatabaseTableView.js (89576 => 89577)


--- trunk/Source/WebCore/inspector/front-end/DatabaseTableView.js	2011-06-23 15:53:03 UTC (rev 89576)
+++ trunk/Source/WebCore/inspector/front-end/DatabaseTableView.js	2011-06-23 15:56:07 UTC (rev 89577)
@@ -60,10 +60,8 @@
 
         var dataGrid = WebInspector.panels.resources.dataGridForResult(columnNames, values);
         if (!dataGrid) {
-            var emptyMsgElement = document.createElement("div");
-            emptyMsgElement.className = "storage-empty-view";
-            emptyMsgElement.textContent = WebInspector.UIString("The ā€œ%sā€\ntable is empty.", this.tableName);
-            this.element.appendChild(emptyMsgElement);
+            this._emptyView = new WebInspector.EmptyView(WebInspector.UIString("The ā€œ%sā€\ntable is empty.", this.tableName));
+            this._emptyView.show(this.element);
             return;
         }
 

Copied: trunk/Source/WebCore/inspector/front-end/EmptyView.js (from rev 89576, trunk/Source/WebCore/inspector/front-end/ResourcePreviewView.js) (0 => 89577)


--- trunk/Source/WebCore/inspector/front-end/EmptyView.js	                        (rev 0)
+++ trunk/Source/WebCore/inspector/front-end/EmptyView.js	2011-06-23 15:56:07 UTC (rev 89577)
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+WebInspector.EmptyView = function(text)
+{
+    WebInspector.View.call(this);
+    this._text = text;
+}
+
+WebInspector.EmptyView.prototype = {
+    show: function(parentElement)
+    {
+        WebInspector.View.prototype.show.call(this, parentElement);
+
+        this.element.className = "storage-empty-view";
+        this.element.textContent = this._text;
+    },
+    
+    set text(text)
+    {
+        this._text = text;
+        if (this.visible)
+            this.element.textContent = this._text;
+    },
+}
+
+WebInspector.EmptyView.prototype.__proto__ = WebInspector.View.prototype;

Modified: trunk/Source/WebCore/inspector/front-end/NetworkItemView.js (89576 => 89577)


--- trunk/Source/WebCore/inspector/front-end/NetworkItemView.js	2011-06-23 15:53:03 UTC (rev 89576)
+++ trunk/Source/WebCore/inspector/front-end/NetworkItemView.js	2011-06-23 15:56:07 UTC (rev 89577)
@@ -38,7 +38,7 @@
     var headersView = new WebInspector.ResourceHeadersView(resource);
     this._tabbedPane.appendTab("headers", WebInspector.UIString("Headers"), headersView);
 
-    var responseView = new WebInspector.ResourceSourceFrame(resource);
+    var responseView = new WebInspector.ResourceResponseView(resource);
     var previewView = new WebInspector.ResourcePreviewView(resource, responseView);
 
     this._tabbedPane.appendTab("preview", WebInspector.UIString("Preview"), previewView);
@@ -99,3 +99,50 @@
 }
 
 WebInspector.NetworkItemView.prototype.__proto__ = WebInspector.View.prototype;
+
+WebInspector.ResourceContentView = function(resource)
+{
+    WebInspector.ResourceView.call(this, resource);
+}
+
+WebInspector.ResourceContentView.prototype = {
+    hasContent: function()
+    {
+        return true;
+    },
+
+    get sourceView()
+    {
+        if (!this._sourceView && WebInspector.ResourceView.hasTextContent(this.resource))
+            this._sourceView = new WebInspector.ResourceSourceFrame(this.resource);
+        return this._sourceView;
+    },
+
+    show: function(parentElement)
+    {
+        WebInspector.ResourceView.prototype.show.call(this, parentElement);
+        this._ensureInnerViewShown();
+    },
+
+    _ensureInnerViewShown: function()
+    {
+        if (this._innerViewShowRequested)
+            return;
+        this._innerViewShowRequested = true;
+
+        function callback()
+        {
+            this._innerViewShowRequested = false;
+            this.contentLoaded();
+        }
+
+        this.resource.requestContent(callback.bind(this));
+    },
+
+    contentLoaded: function()
+    {
+        // Should be implemented by subclasses.
+    }
+}
+
+WebInspector.ResourceContentView.prototype.__proto__ = WebInspector.ResourceView.prototype;

Modified: trunk/Source/WebCore/inspector/front-end/ResourceCookiesView.js (89576 => 89577)


--- trunk/Source/WebCore/inspector/front-end/ResourceCookiesView.js	2011-06-23 15:53:03 UTC (rev 89576)
+++ trunk/Source/WebCore/inspector/front-end/ResourceCookiesView.js	2011-06-23 15:56:07 UTC (rev 89577)
@@ -43,11 +43,9 @@
     show: function(parentElement)
     {
         if (!this._gotCookies) {
-            if (!this._emptyMsgElement) {
-                this._emptyMsgElement = document.createElement("div");
-                this._emptyMsgElement.className = "storage-empty-view";
-                this._emptyMsgElement.textContent = WebInspector.UIString("This request has no cookies.");
-                this.element.appendChild(this._emptyMsgElement);
+            if (!this._emptyView) {
+                this._emptyView = new WebInspector.EmptyView(WebInspector.UIString("This request has no cookies."));
+                this._emptyView.show(this.element);
             }
             WebInspector.View.prototype.show.call(this, parentElement);
             return;

Modified: trunk/Source/WebCore/inspector/front-end/ResourcePreviewView.js (89576 => 89577)


--- trunk/Source/WebCore/inspector/front-end/ResourcePreviewView.js	2011-06-23 15:53:03 UTC (rev 89576)
+++ trunk/Source/WebCore/inspector/front-end/ResourcePreviewView.js	2011-06-23 15:56:07 UTC (rev 89577)
@@ -28,40 +28,31 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-WebInspector.ResourcePreviewView = function(resource, sourceView)
+WebInspector.ResourcePreviewView = function(resource, responseView)
 {
-    WebInspector.ResourceView.call(this, resource);
-    this._sourceView = sourceView;
+    WebInspector.ResourceContentView.call(this, resource);
+    this._responseView = responseView;
 }
 
 WebInspector.ResourcePreviewView.prototype = {
-    hasContent: function()
+    contentLoaded: function()
     {
-        return true;
-    },
-
-    show: function(parentElement)
-    {
-        WebInspector.ResourceView.prototype.show.call(this, parentElement);
-        this._ensureInnerViewShown();
-    },
-
-    _ensureInnerViewShown: function()
-    {
-        if (this._innerViewShowRequested)
-            return;
-        this._innerViewShowRequested = true;
-
-        function callback()
-        {
-            this._createInnerView(callback).show(this.element);
-            this._innerViewShowRequested = false;
+        if (!this.resource.content) {
+            if (!this._emptyView) {
+                this._emptyView = new WebInspector.EmptyView(WebInspector.UIString("This request has no preview available."));
+                this._emptyView.show(this.element);
+            }
+        } else {
+            if (this._emptyView) {
+                this._emptyView.detach();
+                delete this._emptyView;
+            }
+            var view = this._createInnerView();
+            view.show(this.element);
         }
-
-        this.resource.requestContent(callback.bind(this));
     },
 
-    _createInnerView: function(callback)
+    _createInnerView: function()
     {
         if (this.resource.hasErrorStatusCode() && this.resource.content)
             return new WebInspector.ResourceHTMLView(this.resource);
@@ -72,13 +63,11 @@
                 return new WebInspector.ResourceJSONView(this.resource, parsedJSON);
         }
 
-        if (WebInspector.ResourceView.hasTextContent(this.resource))
-            return this._sourceView;
+        if (this._responseView.sourceView)
+            return this._responseView.sourceView;
 
         return WebInspector.ResourceView.nonSourceViewForResource(this.resource);
-    },
-    
-    
+    }
 }
 
-WebInspector.ResourcePreviewView.prototype.__proto__ = WebInspector.ResourceView.prototype;
+WebInspector.ResourcePreviewView.prototype.__proto__ = WebInspector.ResourceContentView.prototype;

Copied: trunk/Source/WebCore/inspector/front-end/ResourceResponseView.js (from rev 89576, trunk/Source/WebCore/inspector/front-end/ResourcePreviewView.js) (0 => 89577)


--- trunk/Source/WebCore/inspector/front-end/ResourceResponseView.js	                        (rev 0)
+++ trunk/Source/WebCore/inspector/front-end/ResourceResponseView.js	2011-06-23 15:56:07 UTC (rev 89577)
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+WebInspector.ResourceResponseView = function(resource)
+{
+    WebInspector.ResourceContentView.call(this, resource);
+}
+
+WebInspector.ResourceResponseView.prototype = {
+    get sourceView()
+    {
+        if (!this._sourceView && WebInspector.ResourceView.hasTextContent(this.resource))
+            this._sourceView = new WebInspector.ResourceSourceFrame(this.resource);
+        return this._sourceView;
+    },
+
+    contentLoaded: function()
+    {
+        if (!this.resource.content || !this.sourceView) {
+            if (!this._emptyView) {
+                this._emptyView = new WebInspector.EmptyView(WebInspector.UIString("This request has no response data available."));
+                this._emptyView.show(this.element);
+            }
+        } else {
+            if (this._emptyView) {
+                this._emptyView.detach();
+                delete this._emptyView;
+            }
+            this.sourceView.show(this.element);
+        }
+    }
+}
+
+WebInspector.ResourceResponseView.prototype.__proto__ = WebInspector.ResourceContentView.prototype;

Modified: trunk/Source/WebCore/inspector/front-end/ResourceTimingView.js (89576 => 89577)


--- trunk/Source/WebCore/inspector/front-end/ResourceTimingView.js	2011-06-23 15:53:03 UTC (rev 89576)
+++ trunk/Source/WebCore/inspector/front-end/ResourceTimingView.js	2011-06-23 15:56:07 UTC (rev 89577)
@@ -42,18 +42,18 @@
     show: function(parentElement)
     {
         if (!this._resource.timing) {
-            if (!this._emptyMsgElement) {
-                this._emptyMsgElement = document.createElement("div");
-                this._emptyMsgElement.className = "storage-empty-view";
-                this._emptyMsgElement.textContent = WebInspector.UIString("This request has no detailed timing info.");
-                this.element.appendChild(this._emptyMsgElement);
+            if (!this._emptyView) {
+                this._emptyView = new WebInspector.EmptyView(WebInspector.UIString("This request has no detailed timing info."));
+                this._emptyView.show(this.element);
             }
             WebInspector.View.prototype.show.call(this, parentElement);
             return;
         }
 
-        if (this._emptyMsgElement)
-            this._emptyMsgElement.parentElement.removeChild(this._emptyMsgElement);
+        if (this._emptyView) {
+            this._emptyView.detach();
+            delete this._emptyView;
+        }
 
         this._refresh();
         WebInspector.View.prototype.show.call(this, parentElement);

Modified: trunk/Source/WebCore/inspector/front-end/ResourcesPanel.js (89576 => 89577)


--- trunk/Source/WebCore/inspector/front-end/ResourcesPanel.js	2011-06-23 15:53:03 UTC (rev 89576)
+++ trunk/Source/WebCore/inspector/front-end/ResourcesPanel.js	2011-06-23 15:56:07 UTC (rev 89577)
@@ -1611,17 +1611,15 @@
     WebInspector.View.call(this);
 
     this.element.addStyleClass("storage-view");
-
-    this._emptyMsgElement = document.createElement("div");
-    this._emptyMsgElement.className = "storage-empty-view";
-    this.element.appendChild(this._emptyMsgElement);
+    this._emptyView = new WebInspector.EmptyView();
+    this._emptyView.show(this.element);
 }
 
 WebInspector.StorageCategoryView.prototype = {
     setText: function(text)
     {
-        this._emptyMsgElement.textContent = text;
-    }
+        this._emptyView.text = text;    
+    }        
 }
 
 WebInspector.StorageCategoryView.prototype.__proto__ = WebInspector.View.prototype;

Modified: trunk/Source/WebCore/inspector/front-end/WebKit.qrc (89576 => 89577)


--- trunk/Source/WebCore/inspector/front-end/WebKit.qrc	2011-06-23 15:53:03 UTC (rev 89576)
+++ trunk/Source/WebCore/inspector/front-end/WebKit.qrc	2011-06-23 15:56:07 UTC (rev 89577)
@@ -40,6 +40,7 @@
     <file>Drawer.js</file>
     <file>ElementsPanel.js</file>
     <file>ElementsTreeOutline.js</file>
+    <file>EmptyView.js</file>
     <file>EventListenersSidebarPane.js</file>
     <file>ExtensionAPI.js</file>
     <file>ExtensionAuditCategory.js</file>
@@ -85,6 +86,7 @@
     <file>ResourceJSONView.js</file>
     <file>ResourceHTMLView.js</file>
     <file>ResourceHeadersView.js</file>
+    <file>ResourceResponseView.js</file>
     <file>ResourceTimingView.js</file>
     <file>ResourceTreeModel.js</file>
     <file>ResourceView.js</file>

Modified: trunk/Source/WebCore/inspector/front-end/inspector.html (89576 => 89577)


--- trunk/Source/WebCore/inspector/front-end/inspector.html	2011-06-23 15:53:03 UTC (rev 89576)
+++ trunk/Source/WebCore/inspector/front-end/inspector.html	2011-06-23 15:56:07 UTC (rev 89577)
@@ -120,13 +120,15 @@
     <script type="text/_javascript_" src=""
     <script type="text/_javascript_" src=""
     <script type="text/_javascript_" src=""
+    <script type="text/_javascript_" src=""
+    <script type="text/_javascript_" src=""
     <script type="text/_javascript_" src=""
     <script type="text/_javascript_" src=""
     <script type="text/_javascript_" src=""
     <script type="text/_javascript_" src=""
     <script type="text/_javascript_" src=""
+    <script type="text/_javascript_" src=""
     <script type="text/_javascript_" src=""
-    <script type="text/_javascript_" src=""
     <script type="text/_javascript_" src=""
     <script type="text/_javascript_" src=""
     <script type="text/_javascript_" src=""
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to