Changeset 35755 in webkit
- Timestamp:
- Aug 14, 2008 10:41:05 AM (16 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r35753 r35755 1 2008-08-14 Timothy Hatcher <timothy@apple.com> 2 3 Avoid formating ConsoleMessages twice unless the message will be 4 displayed in bubbles of a SourceFrame. 5 6 Reviewed by Kevin McCullough. 7 8 * page/inspector/Console.js: 9 (WebInspector.ConsoleMessage): Only format the plain text message 10 if the URL and line are valid and the level is error or warning. 11 (WebInspector.ConsoleMessage.prototype.isErrorOrWarning): Added. 12 Helper to test for error or warning level. 13 * page/inspector/SourceFrame.js: 14 (WebInspector.SourceFrame.prototype.addMessage): Don't add the 15 message if there is no message or valid line or if the msg 16 isn't an error or warning. 17 1 18 2008-08-14 Jan Michael Alonzo <jmalonzo@webkit.org> 2 19 -
trunk/WebCore/page/inspector/Console.js
r35676 r35755 514 514 this.groupLevel = groupLevel; 515 515 516 // This _format call passes in true for the plainText argument. The result's textContent is 517 // used for inline message bubbles in SourceFrames, or other plain-text representations. 518 this.message = this._format(Array.prototype.slice.call(arguments, 5), true).textContent; 516 if (url && line > 0 && this.isErrorOrWarning()) { 517 // This _format call passes in true for the plainText argument. The result's textContent is 518 // used for inline message bubbles in SourceFrames, or other plain-text representations. 519 // Right now we only need to generate this string if the URL and line are valid and the level 520 // is error or warning, since SourceFrame only shows these messages. 521 this.message = this._format(Array.prototype.slice.call(arguments, 5), true).textContent; 522 } 519 523 520 524 // The formatedMessage property is used for the rich and interactive console. … … 523 527 524 528 WebInspector.ConsoleMessage.prototype = { 529 isErrorOrWarning: function() 530 { 531 return (this.level === WebInspector.ConsoleMessage.MessageLevel.Warning || this.level === WebInspector.ConsoleMessage.MessageLevel.Error); 532 }, 533 525 534 _format: function(parameters, plainText) 526 { 535 { 527 536 var formattedResult = document.createElement("span"); 528 537 -
trunk/WebCore/page/inspector/SourceFrame.js
r35677 r35755 136 136 addMessage: function(msg) 137 137 { 138 // Don't add the message if there is no message or valid line or if the msg isn't an error or warning. 139 if (!msg.message || msg.line <= 0 || !msg.isErrorOrWarning()) 140 return; 138 141 this.messages.push(msg); 139 142 this._addMessageToSource(msg);
Note: See TracChangeset
for help on using the changeset viewer.