Bug 142254

Summary: Web Inspector: Array/Collection Sizes should be visible and distinct
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: Web InspectorAssignee: Joseph Pecoraro <joepeck>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, graouts, joepeck, jonowells, mattbaker, nvasilyev, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
[IMAGE] Work in Progress
none
[PATCH] Proposed Fix
timothy: review+
[PATCH] Proposed Fix - No Size in Property Preview
none
[DIFF] Diff between Proposed Fix 1 and 2 (PropertyPreview support) none

Description Joseph Pecoraro 2015-03-03 20:39:02 PST
* SUMMARY
Array/Collection Sizes should be visible and distinct. Currently we don't show sizes for Collections (Sets/Maps) and for "Array" types it is tacked onto the end "Array[5]".
Comment 1 Radar WebKit Bug Importer 2015-03-03 20:39:16 PST
<rdar://problem/20033935>
Comment 2 Joseph Pecoraro 2015-03-03 20:40:34 PST
Created attachment 247830 [details]
[IMAGE] Work in Progress

This is the work in progress. I have this implemented, I just need to write tests and update existing tests for the subtle protocol changes, and test backwards compatibility.
Comment 3 Timothy Hatcher 2015-03-04 05:17:32 PST
Comment on attachment 247830 [details]
[IMAGE] Work in Progress

Looks good.
Comment 4 Joseph Pecoraro 2015-03-04 15:46:09 PST
Created attachment 247903 [details]
[PATCH] Proposed Fix
Comment 5 Joseph Pecoraro 2015-03-04 15:47:38 PST
The attached patch even fixes:

  > [1, 2, 3, 4, Array...]

To be:

  > [1, 2, 3, 4, Array (7)...]

Though we may decide to style this differently, so there is no confusion?

  > [1, 2, 3, 4, Array[7]...]

In any case... it can be addressed later.
Comment 6 Timothy Hatcher 2015-03-04 16:12:18 PST
Comment on attachment 247903 [details]
[PATCH] Proposed Fix

It is unfortunate that ObjectPreview, PropertyPreview and RemoteObject can't share more.
Comment 7 Timothy Hatcher 2015-03-04 16:39:08 PST
(In reply to comment #5)
> The attached patch even fixes:
> 
>   > [1, 2, 3, 4, Array...]
> 
> To be:
> 
>   > [1, 2, 3, 4, Array (7)...]
> 
> Though we may decide to style this differently, so there is no confusion?
> 
>   > [1, 2, 3, 4, Array[7]...]
> 
> In any case... it can be addressed later.

I kind of want Array and Objects to be:

[1, 2, 3, 4, [...], ...]
[1, 2, 3, 4, {...}, ...]
[1, 2, 3, 4, MyObject {...}, ...]

I'm not sure the size should be in previews. But maybe there is a clever way to show the size inside the []? Kind of like how had with "undefined x 2".
Comment 8 Joseph Pecoraro 2015-03-04 17:10:48 PST
(In reply to comment #7)
> (In reply to comment #5)
> > The attached patch even fixes:
> > 
> >   > [1, 2, 3, 4, Array...]
> > 
> > To be:
> > 
> >   > [1, 2, 3, 4, Array (7)...]
> > 
> > Though we may decide to style this differently, so there is no confusion?
> > 
> >   > [1, 2, 3, 4, Array[7]...]
> > 
> > In any case... it can be addressed later.
> 
> I kind of want Array and Objects to be:
> 
> [1, 2, 3, 4, [...], ...]
> [1, 2, 3, 4, {...}, ...]
> [1, 2, 3, 4, MyObject {...}, ...]

I like this!

> I'm not sure the size should be in previews. But maybe there is a clever way
> to show the size inside the []? Kind of like how had with "undefined x 2".

It is easy to remove them from property previews. If we choose not to, we should not send that information from on the backend. I'll send out a new version that doesn't include size in PropertyPreview. Just for RemoteObject / Object Preview (the top level preview).
Comment 9 Joseph Pecoraro 2015-03-04 17:15:18 PST
> > [1, 2, 3, 4, [...], ...]
> > [1, 2, 3, 4, {...}, ...]
> > [1, 2, 3, 4, MyObject {...}, ...]

If we wanted something like:

  > [1, 2, 3, 4, [..(5)..], ...] (10)

We would need to pass the size for PropertyPreviews.
Comment 10 Joseph Pecoraro 2015-03-04 17:21:31 PST
Created attachment 247911 [details]
[PATCH] Proposed Fix - No Size in Property Preview
Comment 11 Joseph Pecoraro 2015-03-04 17:21:56 PST
Created attachment 247912 [details]
[DIFF] Diff between Proposed Fix 1 and 2 (PropertyPreview support)
Comment 12 WebKit Commit Bot 2015-03-04 18:27:48 PST
Comment on attachment 247911 [details]
[PATCH] Proposed Fix - No Size in Property Preview

Clearing flags on attachment: 247911

Committed r181061: <http://trac.webkit.org/changeset/181061>
Comment 13 WebKit Commit Bot 2015-03-04 18:27:53 PST
All reviewed patches have been landed.  Closing bug.