Bug 32488 - Web Inspector: Console dumps strings in escaped form.
Summary: Web Inspector: Console dumps strings in escaped form.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Pavel Feldman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-13 04:19 PST by Pavel Feldman
Modified: 2009-12-24 02:40 PST (History)
5 users (show)

See Also:


Attachments
[PATCH] Proposed fix (4.87 KB, patch)
2009-12-17 06:47 PST, Pavel Feldman
no flags Details | Formatted Diff | Diff
[IMAGE] Added some color to the console. (10.14 KB, image/png)
2009-12-23 03:48 PST, Pavel Feldman
no flags Details
[PATCH] Proposed fix. (18.45 KB, patch)
2009-12-23 06:16 PST, Pavel Feldman
timothy: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Feldman 2009-12-13 04:19:31 PST
Type: "a\"b" in console

Expected output:
"a"b"

Actual output:
"a\"b"
Comment 1 Pavel Feldman 2009-12-17 06:47:24 PST
Created attachment 45061 [details]
[PATCH] Proposed fix
Comment 2 WebKit Review Bot 2009-12-17 06:50:58 PST
style-queue ran check-webkit-style on attachment 45061 [details] without any errors.
Comment 3 Joseph Pecoraro 2009-12-17 08:33:06 PST
You expected the output to be "a"b"? That is not copy + paste-able. Could you explain a little about why you expected to see that? My thoughts are that, for primitives, the output is copy+paste-able values. Much like JSON.stringify(...).

In your case I can think of other solutions that might appease us both:
  - make the quotes on the edges different to denote they are not part of the output.
  - remove the artificially added quotes, and output values in color so it is immediately obvious that it is a string. (We already have styles for JavaScript and CSS, we might be able to carry over the same styles).
Comment 4 Pavel Feldman 2009-12-17 09:16:33 PST
Couple weak arguments that make me think it is worth committing:

1) Messages are for humans, not for pasting them somewhere.
2) I like when console acts in a feature & bug-compatible way with Firebug. It might be based on the feedback in their case.
Comment 5 Pavel Feldman 2009-12-17 09:18:17 PST
(In reply to comment #3)
> You expected the output to be "a"b"? That is not copy + paste-able. Could you
> explain a little about why you expected to see that? My thoughts are that, for
> primitives, the output is copy+paste-able values. Much like
> JSON.stringify(...).
> 
> In your case I can think of other solutions that might appease us both:
>   - make the quotes on the edges different to denote they are not part of the
> output.
>   - remove the artificially added quotes, and output values in color so it is
> immediately obvious that it is a string. (We already have styles for JavaScript
> and CSS, we might be able to carry over the same styles).

Now that I've read it to the end, I agree that we should do either of these :) Let me play with it.
Comment 6 Pavel Feldman 2009-12-23 03:48:22 PST
Created attachment 45429 [details]
[IMAGE] Added some color to the console.

Patch will follow shortly.
Comment 7 Pavel Feldman 2009-12-23 06:16:38 PST
Created attachment 45434 [details]
[PATCH] Proposed fix.
Comment 8 WebKit Review Bot 2009-12-23 06:17:25 PST
style-queue ran check-webkit-style on attachment 45434 [details] without any errors.
Comment 9 Pavel Feldman 2009-12-24 02:40:07 PST
Committing to http://svn.webkit.org/repository/webkit/trunk ...
	M	LayoutTests/ChangeLog
	M	LayoutTests/inspector/console-format-expected.txt
	M	LayoutTests/inspector/console-format.html
	M	WebCore/ChangeLog
	M	WebCore/inspector/InspectorController.cpp
	M	WebCore/inspector/front-end/ConsoleView.js
	M	WebCore/inspector/front-end/InjectedScript.js
	M	WebCore/inspector/front-end/ObjectPropertiesSection.js
	M	WebCore/inspector/front-end/ObjectProxy.js
	M	WebCore/inspector/front-end/inspector.css
Committed r52544