Bug 152330

Summary: Web Inspector: Improve copy of console messages with multiple arguments - console.log(obj1, obj2)
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: Web InspectorAssignee: Joseph Pecoraro <joepeck>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, commit-queue, graouts, joepeck, mattbaker, nvasilyev, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
[PATCH] Proposed Fix none

Description Joseph Pecoraro 2015-12-16 00:28:13 PST
* SUMMARY
Improve copy of console messages with multiple arguments - console.log(obj1, obj2)

* TEST
<script>
console.log("Message", 1, "string", /regex/);
console.log("Message", [1, 2], {x:10, y:20});
</script>

* STEPS TO REPRODUCE
1. Inspect test case
2. Reload (to ensure previews)
3. Select console messages
4. Copy
  => The actual data in the copy is missing!

BEFORE:

> [Log] Message (3) (copy.html, line 2)
> [Log] Message (2) (copy.html, line 3)

AFTER:

> [Log] Message (3) (copy.html, line 2)
> 1
> "string"
> /regex/
> 
> [Log] Message (2) (copy.html, line 3)
> [1, 2] (2)
> {x: 10, y: 20}
Comment 1 Radar WebKit Bug Importer 2015-12-16 00:28:26 PST
<rdar://problem/23916726>
Comment 2 Joseph Pecoraro 2015-12-16 00:40:05 PST
Another case: multiple arguments with call stack:

<script>
function foo() { console.error("Message", [1, 2], {x:10, y:20}); }
foo();
</script>


EXPECTED:

> [Error] Message (2)
> [1, 2] (2)
> {x: 10, y: 20}
> 	foo (copy.html:9)
> 	Global Code (copy.html:11)

Note the call stack coming after the arguments matches the UI here.
Comment 3 Joseph Pecoraro 2015-12-16 00:42:04 PST
Created attachment 267447 [details]
[PATCH] Proposed Fix
Comment 4 WebKit Commit Bot 2015-12-16 09:44:37 PST
Comment on attachment 267447 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 267447

Committed r194151: <http://trac.webkit.org/changeset/194151>
Comment 5 WebKit Commit Bot 2015-12-16 09:44:40 PST
All reviewed patches have been landed.  Closing bug.