Changeset 94287 in webkit


Ignore:
Timestamp:
Sep 1, 2011 5:16:10 AM (13 years ago)
Author:
vsevik@chromium.org
Message:

Web Inspector: Network error messages in console should link to the respective request in network panel if there is one.
https://bugs.webkit.org/show_bug.cgi?id=65550

Reviewed by Yury Semikhatsky.

Source/WebCore:

  • inspector/front-end/ConsoleMessage.js:

(WebInspector.ConsoleMessage.prototype._formatMessage):

  • inspector/front-end/NetworkPanel.js:

(WebInspector.NetworkLogView.prototype.refresh):
(WebInspector.NetworkLogView.prototype.switchToBriefView):
(WebInspector.NetworkLogView.prototype.searchCanceled):
(WebInspector.NetworkLogView.prototype.revealAndHighlightResource):
(WebInspector.NetworkLogView.prototype._removeAllNodeHighlights):
(WebInspector.NetworkLogView.prototype._highlightNode):
(WebInspector.NetworkPanel.prototype._resourceByAnchor):
(WebInspector.NetworkPanel.prototype.canShowAnchorLocation):
(WebInspector.NetworkPanel.prototype.showAnchorLocation):

  • inspector/front-end/networkLogView.css:

(.network-log-grid tr.highlighted-row):
(from):
(to):

LayoutTests:

  • http/tests/inspector/console-resource-errors-expected.txt:
  • http/tests/inspector/console-xhr-logging-expected.txt:
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r94286 r94287  
     12011-09-01  Vsevolod Vlasov  <vsevik@chromium.org>
     2
     3        Web Inspector: Network error messages in console should link to the respective request in network panel if there is one.
     4        https://bugs.webkit.org/show_bug.cgi?id=65550
     5
     6        Reviewed by Yury Semikhatsky.
     7
     8        * http/tests/inspector/console-resource-errors-expected.txt:
     9        * http/tests/inspector/console-xhr-logging-expected.txt:
     10
    1112011-09-01  Cary Clark  <caryclark@google.com>
    212
  • trunk/LayoutTests/http/tests/inspector/console-resource-errors-expected.txt

    r82106 r94287  
    22
    33
    4 missing.cssGET http://127.0.0.1:8000/inspector/missing.css 404 (Not Found) console-message console-error-level
    5 non-existent-iframe.htmlGET http://127.0.0.1:8000/inspector/non-existent-iframe.html 404 (Not Found) console-message console-error-level
    6 non-existent-script.jsGET http://127.0.0.1:8000/inspector/non-existent-script.js 404 (Not Found) console-message console-error-level
    7 non-existent-xhrGET http://127.0.0.1:8000/inspector/non-existent-xhr 404 (Not Found) console-message console-error-level
     4GET http://127.0.0.1:8000/inspector/missing.css 404 (Not Found) console-message console-error-level
     5GET http://127.0.0.1:8000/inspector/non-existent-iframe.html 404 (Not Found) console-message console-error-level
     6GET http://127.0.0.1:8000/inspector/non-existent-script.js 404 (Not Found) console-message console-error-level
     7GET http://127.0.0.1:8000/inspector/non-existent-xhr 404 (Not Found) console-message console-error-level
    88
  • trunk/LayoutTests/http/tests/inspector/console-xhr-logging-expected.txt

    r92698 r94287  
    1414XHR finished loading: "http://127.0.0.1:8000/inspector/resources/xhr-exists.html".
    1515console-xhr-logging.html:10sending a GET request to resources/xhr-does-not-exist.html
    16 resources/xhr-does-not-exist.htmlGET http://127.0.0.1:8000/inspector/resources/xhr-does-not-exist.html 404 (Not Found)
     16GET http://127.0.0.1:8000/inspector/resources/xhr-does-not-exist.html 404 (Not Found)
    1717XHR finished loading: "http://127.0.0.1:8000/inspector/resources/xhr-does-not-exist.html".
    1818console-xhr-logging.html:10sending a POST request to resources/post-target.cgi
     
    2222console-xhr-logging.html:10sending a GET request to resources/xhr-exists.html
    2323console-xhr-logging.html:10sending a GET request to resources/xhr-does-not-exist.html
    24 resources/xhr-does-not-exist.htmlGET http://127.0.0.1:8000/inspector/resources/xhr-does-not-exist.html 404 (Not Found)
     24GET http://127.0.0.1:8000/inspector/resources/xhr-does-not-exist.html 404 (Not Found)
    2525console-xhr-logging.html:10sending a POST request to resources/post-target.cgi
    2626console-xhr-logging.html:10sending a GET request to http://localhost:8000/inspector/resources/xhr-exists.html
  • trunk/Source/WebCore/ChangeLog

    r94284 r94287  
     12011-09-01  Vsevolod Vlasov  <vsevik@chromium.org>
     2
     3        Web Inspector: Network error messages in console should link to the respective request in network panel if there is one.
     4        https://bugs.webkit.org/show_bug.cgi?id=65550
     5
     6        Reviewed by Yury Semikhatsky.
     7
     8        * inspector/front-end/ConsoleMessage.js:
     9        (WebInspector.ConsoleMessage.prototype._formatMessage):
     10        * inspector/front-end/NetworkPanel.js:
     11        (WebInspector.NetworkLogView.prototype.refresh):
     12        (WebInspector.NetworkLogView.prototype.switchToBriefView):
     13        (WebInspector.NetworkLogView.prototype.searchCanceled):
     14        (WebInspector.NetworkLogView.prototype.revealAndHighlightResource):
     15        (WebInspector.NetworkLogView.prototype._removeAllNodeHighlights):
     16        (WebInspector.NetworkLogView.prototype._highlightNode):
     17        (WebInspector.NetworkPanel.prototype._resourceByAnchor):
     18        (WebInspector.NetworkPanel.prototype.canShowAnchorLocation):
     19        (WebInspector.NetworkPanel.prototype.showAnchorLocation):
     20        * inspector/front-end/networkLogView.css:
     21        (.network-log-grid tr.highlighted-row):
     22        (from):
     23        (to):
     24
    1252011-09-01  Patrick Gansterer  <paroga@webkit.org>
    226
  • trunk/Source/WebCore/inspector/front-end/ConsoleMessage.js

    r93769 r94287  
    8181    {
    8282        var stackTrace = this._stackTrace;
     83
     84        this._formattedMessage = document.createElement("span");
     85        this._formattedMessage.className = "console-message-text source-code";
     86       
    8387        var messageText;
    8488        switch (this.type) {
     
    9599                    messageText = document.createElement("span");
    96100                    messageText.appendChild(document.createTextNode(this._request.requestMethod + " "));
    97                     messageText.appendChild(WebInspector.linkifyURLAsNode(this._request.url));
     101                    var anchor = WebInspector.linkifyURLAsNode(this._request.url);
     102                    anchor.setAttribute("request_id", this._request.requestId);
     103                    anchor.setAttribute("preferred_panel", "network");
     104                    messageText.appendChild(anchor);
    98105                    if (this._request.failed)
    99106                        messageText.appendChild(document.createTextNode(" " + this._request.localizedFailDescription));
    100107                    else
    101108                        messageText.appendChild(document.createTextNode(" " + this._request.statusCode + " (" + this._request.statusText + ")"));
    102                 } else
     109                } else {
     110                    var isExternal = !WebInspector.resourceForURL(this.url);
     111                    var anchor = WebInspector.linkifyURLAsNode(this.url, this.url, "console-message-url", isExternal);
     112                    this._formattedMessage.appendChild(anchor);
    103113                    messageText = this._format([this._messageText]);
     114                }
    104115                break;
    105116            case WebInspector.ConsoleMessage.MessageType.Assert:
     
    120131        }
    121132
    122         this._formattedMessage = document.createElement("span");
    123         this._formattedMessage.className = "console-message-text source-code";
    124 
    125         if (this._stackTrace && this._stackTrace.length && this._stackTrace[0].url) {
    126             var urlElement = this._linkifyCallFrame(this._stackTrace[0]);
    127             this._formattedMessage.appendChild(urlElement);
    128         } else if (this.url && this.url !== "undefined") {
    129             var urlElement = this._linkifyLocation(this.url, this.line, 0);
    130             this._formattedMessage.appendChild(urlElement);
     133        if (this.type !== WebInspector.ConsoleMessage.MessageType.NetworkError) {
     134            if (this._stackTrace && this._stackTrace.length && this._stackTrace[0].url) {
     135                var urlElement = this._linkifyCallFrame(this._stackTrace[0]);
     136                this._formattedMessage.appendChild(urlElement);
     137            } else if (this.url && this.url !== "undefined") {
     138                var urlElement = this._linkifyLocation(this.url, this.line, 0);
     139                this._formattedMessage.appendChild(urlElement);
     140            }
    131141        }
    132142
  • trunk/Source/WebCore/inspector/front-end/NetworkPanel.js

    r93974 r94287  
    655655        }
    656656
     657        this._removeAllNodeHighlights();
    657658        var wasScrolledToLastRow = this._dataGrid.isScrolledToLastRow();
    658659        var staleItemsLength = this._staleResources.length;
     
    849850    {
    850851        this.element.addStyleClass("brief-mode");
     852        this._removeAllNodeHighlights();
    851853
    852854        this._dataGrid.hideColumn("method");
     
    12231225        this._clearSearchMatchedList();
    12241226        this.dispatchEventToListeners(WebInspector.NetworkLogView.EventTypes.SearchCountUpdated, 0);
     1227    },
     1228   
     1229    revealAndHighlightResource: function(resource)
     1230    {
     1231        this._removeAllNodeHighlights();
     1232       
     1233        var node = this._resourceGridNode(resource);
     1234        if (node) {
     1235            this._dataGrid.element.focus();
     1236            node.reveal();
     1237            this._highlightNode(node);
     1238        }
     1239    },
     1240   
     1241    _removeAllNodeHighlights: function(node, decoration)
     1242    {
     1243        if (this._highlightedNode) {
     1244            this._highlightedNode.element.removeStyleClass("highlighted-row");
     1245            delete this._highlightedNode;
     1246        }
     1247    },
     1248   
     1249    _highlightNode: function(node)
     1250    {
     1251        node.element.addStyleClass("highlighted-row");
     1252        this._highlightedNode = node;
    12251253    }
    12261254};
     
    13311359    },
    13321360
     1361    _resourceByAnchor: function(anchor)
     1362    {
     1363        var resource;
     1364        if (anchor.getAttribute("request_id"))
     1365            resource = this.resourceById(anchor.getAttribute("request_id"));
     1366        if (!resource)
     1367            resource = this._resourcesByURL[anchor.href];
     1368
     1369        return resource;
     1370    },
     1371
    13331372    canShowAnchorLocation: function(anchor)
    13341373    {
    1335         return !!this.resourceById(anchor.href);
     1374        return !!this._resourceByAnchor(anchor);
    13361375    },
    13371376
    13381377    showAnchorLocation: function(anchor)
    13391378    {
    1340         this._showResource(this._resourcesByURL[anchor.href]);
     1379        var resource = this._resourceByAnchor(anchor);
     1380
     1381        this._toggleGridMode();
     1382        if (resource)
     1383            this._networkLogView.revealAndHighlightResource(resource);
    13411384    },
    13421385
  • trunk/Source/WebCore/inspector/front-end/networkLogView.css

    r92184 r94287  
    124124.network-log-grid tr.selected .network-cell-subtitle {
    125125    color: white;
     126}
     127
     128.network-log-grid tr.highlighted-row {
     129    -webkit-animation: "fadeout" 2s 0s;
     130}
     131
     132@-webkit-keyframes fadeout {
     133    from {background-color: rgba(56, 121, 217, 1); }
     134    to { background-color: rgba(56, 121, 217, 0); }
    126135}
    127136
Note: See TracChangeset for help on using the changeset viewer.