Title: [214903] trunk/Source/WebInspectorUI
Revision
214903
Author
[email protected]
Date
2017-04-04 15:14:31 -0700 (Tue, 04 Apr 2017)

Log Message

Web Inspector: Include more Network information in Resource Details Sidebar
https://bugs.webkit.org/show_bug.cgi?id=170470

Patch by Joseph Pecoraro <[email protected]> on 2017-04-04
Reviewed by Brian Burg.

* Localizations/en.lproj/localizedStrings.js:
Updated localized strings.

* UserInterface/Models/Resource.js:
(WebInspector.Resource.displayNameForProtocol):
(WebInspector.Resource.displayNameForPriority):
Aggregate all display name helpers here.

* UserInterface/Views/DetailsSectionSimpleRow.js:
(WebInspector.DetailsSectionSimpleRow.prototype.get tooltip):
(WebInspector.DetailsSectionSimpleRow.prototype.set tooltip):
Allow setting a tooltip on the value.

* UserInterface/Views/NetworkGridContentView.css:
(.cache-type):
Cache type shows up in multiple places. Simplify the CSS to apply anywhere.

* UserInterface/Views/NetworkGridContentView.js:
(WebInspector.NetworkGridContentView):
* UserInterface/Views/NetworkTimelineView.js:
(WebInspector.NetworkTimelineView):
Updated column names.

* UserInterface/Views/ResourceDetailsSidebarPanel.js:
(WebInspector.ResourceDetailsSidebarPanel):
(WebInspector.ResourceDetailsSidebarPanel.prototype._refreshRequestAndResponse):
(WebInspector.ResourceDetailsSidebarPanel.prototype._cachedRowValue):
Include more detail information in the sidebar.

* UserInterface/Views/ResourceTimelineDataGridNode.js:
(WebInspector.ResourceTimelineDataGridNode.prototype.createCellContent):
(WebInspector.ResourceTimelineDataGridNode.prototype._displayNameForPriority): Deleted.
Use shared code for display names.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (214902 => 214903)


--- trunk/Source/WebInspectorUI/ChangeLog	2017-04-04 22:05:36 UTC (rev 214902)
+++ trunk/Source/WebInspectorUI/ChangeLog	2017-04-04 22:14:31 UTC (rev 214903)
@@ -1,3 +1,44 @@
+2017-04-04  Joseph Pecoraro  <[email protected]>
+
+        Web Inspector: Include more Network information in Resource Details Sidebar
+        https://bugs.webkit.org/show_bug.cgi?id=170470
+
+        Reviewed by Brian Burg.
+
+        * Localizations/en.lproj/localizedStrings.js:
+        Updated localized strings.
+
+        * UserInterface/Models/Resource.js:
+        (WebInspector.Resource.displayNameForProtocol):
+        (WebInspector.Resource.displayNameForPriority):
+        Aggregate all display name helpers here.
+
+        * UserInterface/Views/DetailsSectionSimpleRow.js:
+        (WebInspector.DetailsSectionSimpleRow.prototype.get tooltip):
+        (WebInspector.DetailsSectionSimpleRow.prototype.set tooltip):
+        Allow setting a tooltip on the value.
+
+        * UserInterface/Views/NetworkGridContentView.css:
+        (.cache-type):
+        Cache type shows up in multiple places. Simplify the CSS to apply anywhere.
+
+        * UserInterface/Views/NetworkGridContentView.js:
+        (WebInspector.NetworkGridContentView):
+        * UserInterface/Views/NetworkTimelineView.js:
+        (WebInspector.NetworkTimelineView):
+        Updated column names.
+
+        * UserInterface/Views/ResourceDetailsSidebarPanel.js:
+        (WebInspector.ResourceDetailsSidebarPanel):
+        (WebInspector.ResourceDetailsSidebarPanel.prototype._refreshRequestAndResponse):
+        (WebInspector.ResourceDetailsSidebarPanel.prototype._cachedRowValue):
+        Include more detail information in the sidebar.
+
+        * UserInterface/Views/ResourceTimelineDataGridNode.js:
+        (WebInspector.ResourceTimelineDataGridNode.prototype.createCellContent):
+        (WebInspector.ResourceTimelineDataGridNode.prototype._displayNameForPriority): Deleted.
+        Use shared code for display names.
+
 2017-04-04  Brian Burg  <[email protected]>
 
         Web Inspector: RTL: fix alignment of close button shown while docked

Modified: trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (214902 => 214903)


--- trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js	2017-04-04 22:05:36 UTC (rev 214902)
+++ trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js	2017-04-04 22:14:31 UTC (rev 214903)
@@ -200,6 +200,7 @@
 localizedStrings["Connection"] = "Connection";
 localizedStrings["Connection Close Frame"] = "Connection Close Frame";
 localizedStrings["Connection Closed"] = "Connection Closed";
+localizedStrings["Connection ID"] = "Connection ID";
 localizedStrings["Console"] = "Console";
 localizedStrings["Console Evaluation"] = "Console Evaluation";
 localizedStrings["Console Evaluation %d"] = "Console Evaluation %d";
@@ -432,6 +433,7 @@
 localizedStrings["Highest: %s"] = "Highest: %s";
 localizedStrings["Horizontal"] = "Horizontal";
 localizedStrings["Host"] = "Host";
+localizedStrings["IP Address"] = "IP Address";
 localizedStrings["Icon Only"] = "Icon Only";
 localizedStrings["Icon and Text (Horizontal)"] = "Icon and Text (Horizontal)";
 localizedStrings["Icon and Text (Vertical)"] = "Icon and Text (Vertical)";
@@ -653,7 +655,6 @@
 localizedStrings["Region Flow"] = "Region Flow";
 localizedStrings["Region announced in its entirety."] = "Region announced in its entirety.";
 localizedStrings["Reload page (%s)\nReload ignoring cache (%s)"] = "Reload page (%s)\nReload ignoring cache (%s)";
-localizedStrings["Remote Address"] = "Remote Address";
 localizedStrings["Removals"] = "Removals";
 localizedStrings["Remove Watch _expression_"] = "Remove Watch _expression_";
 localizedStrings["Remove link"] = "Remove link";

Modified: trunk/Source/WebInspectorUI/UserInterface/Models/Resource.js (214902 => 214903)


--- trunk/Source/WebInspectorUI/UserInterface/Models/Resource.js	2017-04-04 22:05:36 UTC (rev 214902)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/Resource.js	2017-04-04 22:14:31 UTC (rev 214903)
@@ -137,6 +137,40 @@
         }
     }
 
+    static displayNameForProtocol(protocol)
+    {
+        switch (protocol) {
+        case "h2":
+            return "HTTP/2";
+        case "http/1.0":
+            return "HTTP/1.0";
+        case "http/1.1":
+            return "HTTP/1.1";
+        case "spdy/2":
+            return "SPDY/2";
+        case "spdy/3":
+            return "SPDY/3";
+        case "spdy/3.1":
+            return "SPDY/3.1";
+        default:
+            return null;
+        }
+    }
+
+    static displayNameForPriority(priority)
+    {
+        switch (priority) {
+        case WebInspector.Resource.NetworkPriority.Low:
+            return WebInspector.UIString("Low");
+        case WebInspector.Resource.NetworkPriority.Medium:
+            return WebInspector.UIString("Medium");
+        case WebInspector.Resource.NetworkPriority.High:
+            return WebInspector.UIString("High");
+        default:
+            return null;
+        }
+    }
+
     static responseSourceFromPayload(source)
     {
         if (!source)

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DetailsSectionSimpleRow.js (214902 => 214903)


--- trunk/Source/WebInspectorUI/UserInterface/Views/DetailsSectionSimpleRow.js	2017-04-04 22:05:36 UTC (rev 214902)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DetailsSectionSimpleRow.js	2017-04-04 22:14:31 UTC (rev 214903)
@@ -109,6 +109,16 @@
         } else
             this._valueElement.textContent = this._value;
     }
+
+    get tooltip()
+    {
+        return this._valueElement.title;
+    }
+
+    set tooltip(x)
+    {
+        this._valueElement.title = x;
+    }
 };
 
 WebInspector.DetailsSectionSimpleRow.DataStyleClassName = "data";

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/NetworkGridContentView.css (214902 => 214903)


--- trunk/Source/WebInspectorUI/UserInterface/Views/NetworkGridContentView.css	2017-04-04 22:05:36 UTC (rev 214902)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/NetworkGridContentView.css	2017-04-04 22:14:31 UTC (rev 214903)
@@ -43,7 +43,7 @@
     filter: grayscale();
 }
 
-.content-view:matches(.network, .network-grid) > .data-grid .cache-type {
+.cache-type {
     color: gray;
 }
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/NetworkGridContentView.js (214902 => 214903)


--- trunk/Source/WebInspectorUI/UserInterface/Views/NetworkGridContentView.js	2017-04-04 22:05:36 UTC (rev 214902)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/NetworkGridContentView.js	2017-04-04 22:14:31 UTC (rev 214903)
@@ -67,11 +67,11 @@
         columns.priority.width = "5%";
         columns.priority.hidden = true;
 
-        columns.remoteAddress.title = WebInspector.UIString("Remote Address");
+        columns.remoteAddress.title = WebInspector.UIString("IP Address");
         columns.remoteAddress.width = "8%";
         columns.remoteAddress.hidden = true;
 
-        columns.connectionIdentifier.title = WebInspector.UIString("Connection");
+        columns.connectionIdentifier.title = WebInspector.UIString("Connection ID");
         columns.connectionIdentifier.width = "5%";
         columns.connectionIdentifier.hidden = true;
         columns.connectionIdentifier.aligned = "right";

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTimelineView.js (214902 => 214903)


--- trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTimelineView.js	2017-04-04 22:05:36 UTC (rev 214902)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTimelineView.js	2017-04-04 22:14:31 UTC (rev 214903)
@@ -73,11 +73,11 @@
         columns.priority.width = "5%";
         columns.priority.hidden = true;
 
-        columns.remoteAddress.title = WebInspector.UIString("Remote Address");
+        columns.remoteAddress.title = WebInspector.UIString("IP Address");
         columns.remoteAddress.width = "8%";
         columns.remoteAddress.hidden = true;
 
-        columns.connectionIdentifier.title = WebInspector.UIString("Connection");
+        columns.connectionIdentifier.title = WebInspector.UIString("Connection ID");
         columns.connectionIdentifier.width = "5%";
         columns.connectionIdentifier.hidden = true;
         columns.connectionIdentifier.aligned = "right";

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ResourceDetailsSidebarPanel.js (214902 => 214903)


--- trunk/Source/WebInspectorUI/UserInterface/Views/ResourceDetailsSidebarPanel.js	2017-04-04 22:05:36 UTC (rev 214902)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ResourceDetailsSidebarPanel.js	2017-04-04 22:14:31 UTC (rev 214903)
@@ -75,6 +75,9 @@
         this._statusTextRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Status"));
         this._statusCodeRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Code"));
 
+        this._remoteAddressRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("IP Address"));
+        this._connectionIdentifierRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Connection ID"));
+
         this._encodedSizeRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Encoded"));
         this._decodedSizeRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Decoded"));
         this._transferSizeRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Transferred"));
@@ -84,10 +87,11 @@
 
         let requestGroup = new WebInspector.DetailsSectionGroup([this._requestMethodRow, this._protocolRow, this._priorityRow, this._cachedRow]);
         let statusGroup = new WebInspector.DetailsSectionGroup([this._statusTextRow, this._statusCodeRow]);
+        let connectionGroup = new WebInspector.DetailsSectionGroup([this._remoteAddressRow, this._connectionIdentifierRow]);
         let sizeGroup = new WebInspector.DetailsSectionGroup([this._encodedSizeRow, this._decodedSizeRow, this._transferSizeRow]);
         let compressionGroup = new WebInspector.DetailsSectionGroup([this._compressedRow, this._compressionRow]);
 
-        this._requestAndResponseSection = new WebInspector.DetailsSection("resource-request-response", WebInspector.UIString("Request & Response"), [requestGroup, statusGroup, sizeGroup, compressionGroup]);
+        this._requestAndResponseSection = new WebInspector.DetailsSection("resource-request-response", WebInspector.UIString("Request & Response"), [requestGroup, statusGroup, connectionGroup, sizeGroup, compressionGroup]);
 
         this._requestHeadersRow = new WebInspector.DetailsSectionDataGridRow(null, WebInspector.UIString("No Request Headers"));
         this._requestHeadersSection = new WebInspector.DetailsSection("resource-request-headers", WebInspector.UIString("Request Headers"));
@@ -312,25 +316,15 @@
 
         // COMPATIBILITY(iOS 10.3): Network load metrics were not previously available.
         if (window.NetworkAgent && NetworkAgent.hasEventParameter("loadingFinished", "metrics")) {
-            this._protocolRow.value = this._resource.protocol || emDash;
-
-            switch (this._resource.priority) {
-            case WebInspector.Resource.NetworkPriority.Low:
-                this._priorityRow.value = WebInspector.UIString("Low");
-                break;
-            case WebInspector.Resource.NetworkPriority.Medium:
-                this._priorityRow.value = WebInspector.UIString("Medium");
-                break;
-            case WebInspector.Resource.NetworkPriority.High:
-                this._priorityRow.value = WebInspector.UIString("High");
-                break;
-            default:
-                this._priorityRow.value = emDash;
-                break;
-            }
+            let protocolDisplayName = WebInspector.Resource.displayNameForProtocol(this._resource.protocol);
+            this._protocolRow.value = protocolDisplayName || emDash;
+            this._protocolRow.tooltip = protocolDisplayName ? this._resource.protocol : "";
+            this._priorityRow.value = WebInspector.Resource.displayNameForPriority(this._resource.priority) || emDash;
+            this._remoteAddressRow.value = this._resource.remoteAddress || emDash;
+            this._connectionIdentifierRow.value = this._resource.connectionIdentifier || emDash;
         }
 
-        this._cachedRow.value = this._resource.cached ? WebInspector.UIString("Yes") : WebInspector.UIString("No");
+        this._cachedRow.value = this._cachedRowValue();
 
         this._statusCodeRow.value = this._resource.statusCode || emDash;
         this._statusTextRow.value = this._resource.statusText || emDash;
@@ -469,6 +463,22 @@
         });
     }
 
+    _cachedRowValue()
+    {
+        let responseSource = this._resource.responseSource;
+        if (responseSource === WebInspector.Resource.ResponseSource.MemoryCache || responseSource === WebInspector.Resource.ResponseSource.DiskCache) {
+            console.assert(this._resource.cached, "This resource has a cache responseSource it should also be marked as cached", this._resource);
+            let span = document.createElement("span");
+            let cacheType = document.createElement("span");
+            cacheType.classList = "cache-type";
+            cacheType.textContent = responseSource === WebInspector.Resource.ResponseSource.MemoryCache ? WebInspector.UIString("(Memory)") : WebInspector.UIString("(Disk)");
+            span.append(WebInspector.UIString("Yes"), " ", cacheType);
+            return span;
+        }
+
+        return this._resource.cached ? WebInspector.UIString("Yes") : WebInspector.UIString("No");
+    }
+
     _goToRequestDataClicked()
     {
         WebInspector.showResourceRequest(this._resource);

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ResourceTimelineDataGridNode.js (214902 => 214903)


--- trunk/Source/WebInspectorUI/UserInterface/Views/ResourceTimelineDataGridNode.js	2017-04-04 22:05:36 UTC (rev 214902)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ResourceTimelineDataGridNode.js	2017-04-04 22:14:31 UTC (rev 214903)
@@ -136,7 +136,7 @@
             return value || emDash;
 
         case "priority":
-            return this._displayNameForPriority(value);
+            return WebInspector.Resource.displayNameForPriority(value) || emDash;
         }
 
         return super.createCellContent(columnIdentifier, cell);
@@ -200,20 +200,6 @@
 
     // Private
 
-    _displayNameForPriority(priority)
-    {
-        switch (priority) {
-        case WebInspector.Resource.NetworkPriority.Low:
-            return WebInspector.UIString("Low");
-        case WebInspector.Resource.NetworkPriority.Medium:
-            return WebInspector.UIString("Medium");
-        case WebInspector.Resource.NetworkPriority.High:
-            return WebInspector.UIString("High");
-        }
-
-        return emDash;
-    }
-
     _createNameCellDocumentFragment()
     {
         let fragment = document.createDocumentFragment();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to