Changeset 194151 in webkit


Ignore:
Timestamp:
Dec 16, 2015 9:44:10 AM (8 years ago)
Author:
commit-queue@webkit.org
Message:

Web Inspector: Improve copy of console messages with multiple arguments - console.log(obj1, obj2)
https://bugs.webkit.org/show_bug.cgi?id=152330

Patch by Joseph Pecoraro <Joseph Pecoraro> on 2015-12-16
Reviewed by Timothy Hatcher.

  • UserInterface/Views/ConsoleMessageView.js:

(WebInspector.ConsoleMessageView.prototype.toClipboardString):
Copy the inner text of the extra arguments list as well, for
console messages with multiple objects. Rearrange the sections
that, if there is a stack trace it comes at the end after
multiple arguments. If there is no stack trace, include the
location info next to the top line, before multiple arguments.

Location:
trunk/Source/WebInspectorUI
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r194150 r194151  
     12015-12-16  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: Improve copy of console messages with multiple arguments - console.log(obj1, obj2)
     4        https://bugs.webkit.org/show_bug.cgi?id=152330
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        * UserInterface/Views/ConsoleMessageView.js:
     9        (WebInspector.ConsoleMessageView.prototype.toClipboardString):
     10        Copy the inner text of the extra arguments list as well, for
     11        console messages with multiple objects. Rearrange the sections
     12        that, if there is a stack trace it comes at the end after
     13        multiple arguments. If there is no stack trace, include the
     14        location info next to the top line, before multiple arguments.
     15
    1162015-12-16  Joseph Pecoraro  <pecoraro@apple.com>
    217
  • trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleMessageView.js

    r194066 r194151  
    194194
    195195        let hasStackTrace = this._shouldShowStackTrace();
    196         if (hasStackTrace) {
    197             this._message.stackTrace.callFrames.forEach(function(frame) {
    198                 clipboardString += "\n\t" + (frame.functionName || WebInspector.UIString("(anonymous function)"));
    199                 if (frame.sourceCodeLocation)
    200                     clipboardString += " (" + frame.sourceCodeLocation.originalLocationString() + ")";
    201             });
    202         } else {
     196        if (!hasStackTrace) {
    203197            let repeatString = this.repeatCount > 1 ? "x" + this.repeatCount : "";
    204198            let urlLine = "";
     
    216210                clipboardString = lines.join("\n");
    217211            }
     212        }
     213
     214        if (this._extraElementsList)
     215            clipboardString += "\n" + this._extraElementsList.innerText.removeWordBreakCharacters().trim();
     216
     217        if (hasStackTrace) {
     218            this._message.stackTrace.callFrames.forEach(function(frame) {
     219                clipboardString += "\n\t" + (frame.functionName || WebInspector.UIString("(anonymous function)"));
     220                if (frame.sourceCodeLocation)
     221                    clipboardString += " (" + frame.sourceCodeLocation.originalLocationString() + ")";
     222            });
    218223        }
    219224
Note: See TracChangeset for help on using the changeset viewer.