Bug 142830

Summary: Web Inspector: Debugger Popovers and Probes should use FormattedValue/ObjectTreeView instead of Custom/ObjectPropertiesSection
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: Web InspectorAssignee: Joseph Pecoraro <joepeck>
Status: RESOLVED FIXED    
Severity: Normal CC: burg, graouts, joepeck, jonowells, mattbaker, nvasilyev, timothy, webkit-bug-importer
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
[PATCH] Proposed Fix
timothy: review+
[IMAGE] Before
none
[IMAGE] After none

Description Joseph Pecoraro 2015-03-18 12:13:35 PDT
* SUMMARY
Debugger Popovers and Probes should use FormattedValue/ObjectTreeView instead of Custom/ObjectPropertiesSection.

    Debugger Popovers:
      - attempt to replicate FormattedValue for primitives => FormattedValue
      - uses ObjectPropertiesSection for objects => ObjectTree properties only

    Probes:
      - don't style primitives => FormattedValue
      - uses ObjectPropertiesSection for objects => ObjectTree
      - doesn't have previews => give previews!

These are easy conversions.
Comment 1 Joseph Pecoraro 2015-03-18 12:18:42 PDT
Created attachment 248949 [details]
[PATCH] Proposed Fix
Comment 2 Joseph Pecoraro 2015-03-18 12:19:16 PDT
Created attachment 248950 [details]
[IMAGE] Before
Comment 3 Joseph Pecoraro 2015-03-18 12:19:34 PDT
Created attachment 248951 [details]
[IMAGE] After
Comment 4 Joseph Pecoraro 2015-03-18 13:36:20 PDT
*** Bug 131081 has been marked as a duplicate of this bug. ***
Comment 5 Timothy Hatcher 2015-03-18 15:53:48 PDT
Comment on attachment 248949 [details]
[PATCH] Proposed Fix

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

> Source/WebInspectorUI/UserInterface/Views/ProbeSetDataGridNode.js:89
> -        if (sample instanceof WebInspector.RemoteObject) {
> -            switch (sample.type) {
> -            case "function": // FIXME: is there a better way to visualize functions?
> -            case "object":
> -                return new WebInspector.ObjectPropertiesSection(sample, WebInspector.ProbeSet.SampleObjectTitle).element;
> -            case "string":
> -            case "number":
> -            case "boolean":
> -            case "undefined":
> -            case "null":
> -                return document.createTextNode(sample.value);
> -            case "array":
> -            // FIXME: reuse existing visualization of arrays here.
> -            default: console.log("Don't know how to represent sample:", sample);
> -            }
> -        }
> +        if (sample instanceof WebInspector.RemoteObject)
> +            return WebInspector.FormattedValue.createObjectTreeOrFormattedValueForRemoteObject(sample, null);

Beautiful!
Comment 6 Joseph Pecoraro 2015-03-18 20:28:15 PDT
http://trac.webkit.org/changeset/181722