Bug 143840

Summary: Web Inspector: Special Logs to Console that do not have an expression should be styled differently, looks like code
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: Web InspectorAssignee: Devin Rousso <hi>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, graouts, hi, joepeck, jonowells, mattbaker, nvasilyev, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch
none
After Patch is applied
none
Patch none

Description Joseph Pecoraro 2015-04-16 13:01:23 PDT
* SUMMARY
Special Logs to Console that do not have an expression should be styled differently, looks like code.

* STEPS TO REPRODUCe
1. Inspect <http://webkit.org>
2. Show DOM Tree
3. Right click <body> and "Log Element"
  => The "Selected Element" text in the console should be visually distinct, it looks identical to it having been code but it is not
Comment 1 Radar WebKit Bug Importer 2015-04-16 13:02:02 PDT
<rdar://problem/20575321>
Comment 2 Devin Rousso 2015-07-09 11:23:30 PDT
Created attachment 256492 [details]
Patch
Comment 3 Devin Rousso 2015-07-09 11:24:59 PDT
Comment on attachment 256492 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=256492&action=review

> Source/WebInspectorUI/UserInterface/Views/ConsoleMessageView.css:32
> +.console-user-command.special-user-log {

I am not sure that this is the best styling here, but it's a start and doesn't look to bad at that.
Comment 4 Timothy Hatcher 2015-07-09 11:27:36 PDT
Comment on attachment 256492 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=256492&action=review

>> Source/WebInspectorUI/UserInterface/Views/ConsoleMessageView.css:32
>> +.console-user-command.special-user-log {
> 
> I am not sure that this is the best styling here, but it's a start and doesn't look to bad at that.

A token (rounded box with colored background) is something  we talked about doing here. Like email addresses in Mail.
Comment 5 Devin Rousso 2015-07-09 11:39:25 PDT
Created attachment 256495 [details]
Patch
Comment 6 Devin Rousso 2015-07-09 11:40:04 PDT
Created attachment 256496 [details]
After Patch is applied
Comment 7 Timothy Hatcher 2015-07-09 12:22:50 PDT
Comment on attachment 256495 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=256495&action=review

> Source/WebInspectorUI/UserInterface/Controllers/JavaScriptLogViewController.js:126
> -        var commandMessageView = new WebInspector.ConsoleCommandView(text);
> +        var commandMessageView = new WebInspector.ConsoleCommandView(text, "special-user-log");

Two called of appendImmediateExecutionWithResult actually pass a JS property path as the text, so those cases should not get "special-user-log". You likely need to add a parameter to appendImmediateExecutionWithResult to toggle this class as needed.

The callers do this:

        var text = isImpossible ? WebInspector.UIString("Selected Value") : propertyPath.displayPath(this.propertyPathType());
Comment 8 Devin Rousso 2015-07-09 13:34:30 PDT
Created attachment 256507 [details]
Patch
Comment 9 WebKit Commit Bot 2015-07-09 14:55:17 PDT
Comment on attachment 256507 [details]
Patch

Clearing flags on attachment: 256507

Committed r186634: <http://trac.webkit.org/changeset/186634>
Comment 10 WebKit Commit Bot 2015-07-09 14:55:21 PDT
All reviewed patches have been landed.  Closing bug.