OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 3 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
4 * Copyright (C) 2009 Joseph Pecoraro | 4 * Copyright (C) 2009 Joseph Pecoraro |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * | 9 * |
10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 var args = ["%O", obj]; | 173 var args = ["%O", obj]; |
174 this._messageElement = this._format(args); | 174 this._messageElement = this._format(args); |
175 break; | 175 break; |
176 case WebInspector.ConsoleMessage.MessageType.Profile: | 176 case WebInspector.ConsoleMessage.MessageType.Profile: |
177 case WebInspector.ConsoleMessage.MessageType.ProfileEnd: | 177 case WebInspector.ConsoleMessage.MessageType.ProfileEnd: |
178 this._messageElement = this._format([consoleMessage.messageT
ext]); | 178 this._messageElement = this._format([consoleMessage.messageT
ext]); |
179 break; | 179 break; |
180 default: | 180 default: |
181 if (consoleMessage.parameters && consoleMessage.parameters.l
ength === 1 && consoleMessage.parameters[0].type === "string") | 181 if (consoleMessage.parameters && consoleMessage.parameters.l
ength === 1 && consoleMessage.parameters[0].type === "string") |
182 this._messageElement = this._tryFormatAsError(/** @type
{string} */(consoleMessage.parameters[0].value)); | 182 this._messageElement = this._tryFormatAsError(/** @type
{string} */(consoleMessage.parameters[0].value)); |
183 | |
184 var args = consoleMessage.parameters || [consoleMessage.mess
ageText]; | 183 var args = consoleMessage.parameters || [consoleMessage.mess
ageText]; |
185 this._messageElement = this._messageElement || this._format(
args); | 184 this._messageElement = this._messageElement || this._format(
args); |
186 } | 185 } |
187 } else if (consoleMessage.source === WebInspector.ConsoleMessage.Mes
sageSource.Network) { | 186 } else if (consoleMessage.source === WebInspector.ConsoleMessage.Mes
sageSource.Network) { |
188 if (consoleMessage.request) { | 187 if (consoleMessage.request) { |
189 this._messageElement = createElement("span"); | 188 this._messageElement = createElement("span"); |
190 if (consoleMessage.level === WebInspector.ConsoleMessage.Mes
sageLevel.Error || consoleMessage.level === WebInspector.ConsoleMessage.MessageL
evel.RevokedError) { | 189 if (consoleMessage.level === WebInspector.ConsoleMessage.Mes
sageLevel.Error || consoleMessage.level === WebInspector.ConsoleMessage.MessageL
evel.RevokedError) { |
191 this._messageElement.createTextChildren(consoleMessage.r
equest.requestMethod, " "); | 190 this._messageElement.createTextChildren(consoleMessage.r
equest.requestMethod, " "); |
192 this._messageElement.appendChild(WebInspector.Linkifier.
linkifyUsingRevealer(consoleMessage.request, consoleMessage.request.url, console
Message.request.url)); | 191 this._messageElement.appendChild(WebInspector.Linkifier.
linkifyUsingRevealer(consoleMessage.request, consoleMessage.request.url, console
Message.request.url)); |
193 if (consoleMessage.request.failed) | 192 if (consoleMessage.request.failed) |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
605 elem.createTextChild("\""); | 604 elem.createTextChild("\""); |
606 }, | 605 }, |
607 | 606 |
608 /** | 607 /** |
609 * @param {!WebInspector.RemoteObject} output | 608 * @param {!WebInspector.RemoteObject} output |
610 * @param {!Element} elem | 609 * @param {!Element} elem |
611 */ | 610 */ |
612 _formatParameterAsError: function(output, elem) | 611 _formatParameterAsError: function(output, elem) |
613 { | 612 { |
614 var span = elem.createChild("span", "object-value-error source-code"); | 613 var span = elem.createChild("span", "object-value-error source-code"); |
615 var text = output.description || ""; | 614 var errorSpan = this._tryFormatAsError(output.description || ""); |
616 var lines = text.split("\n", 2); | 615 span.appendChild(errorSpan ? errorSpan : WebInspector.linkifyStringAsFra
gment(output.description || "")); |
617 span.appendChild(WebInspector.linkifyStringAsFragment(lines[0])); | |
618 if (lines.length > 1) { | |
619 var detailedLink = elem.createChild("a"); | |
620 detailedLink.textContent = "(\u2026)"; | |
621 function showDetailed(event) | |
622 { | |
623 span.removeChildren(); | |
624 detailedLink.remove(); | |
625 span.appendChild(WebInspector.linkifyStringAsFragment(text)); | |
626 event.consume(true); | |
627 } | |
628 detailedLink._showDetailedForTest = showDetailed.bind(null, new Mous
eEvent("click")); | |
629 detailedLink.addEventListener("click", showDetailed, false); | |
630 } | |
631 }, | 616 }, |
632 | 617 |
633 /** | 618 /** |
634 * @param {!WebInspector.RemoteObject} array | 619 * @param {!WebInspector.RemoteObject} array |
635 * @param {!Element} elem | 620 * @param {!Element} elem |
636 * @param {?Array.<!WebInspector.RemoteObjectProperty>} properties | 621 * @param {?Array.<!WebInspector.RemoteObjectProperty>} properties |
637 */ | 622 */ |
638 _printArrayResult: function(array, elem, properties) | 623 _printArrayResult: function(array, elem, properties) |
639 { | 624 { |
640 if (!properties) { | 625 if (!properties) { |
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1355 { | 1340 { |
1356 if (!this._wrapperElement) { | 1341 if (!this._wrapperElement) { |
1357 WebInspector.ConsoleViewMessage.prototype.toMessageElement.call(this
); | 1342 WebInspector.ConsoleViewMessage.prototype.toMessageElement.call(this
); |
1358 this._wrapperElement.classList.toggle("collapsed", this._collapsed); | 1343 this._wrapperElement.classList.toggle("collapsed", this._collapsed); |
1359 } | 1344 } |
1360 return this._wrapperElement; | 1345 return this._wrapperElement; |
1361 }, | 1346 }, |
1362 | 1347 |
1363 __proto__: WebInspector.ConsoleViewMessage.prototype | 1348 __proto__: WebInspector.ConsoleViewMessage.prototype |
1364 } | 1349 } |
OLD | NEW |