Bug 142037 - Web Inspector: New ObjectTree UI for Arrays / Maps / Sets
Summary: Web Inspector: New ObjectTree UI for Arrays / Maps / Sets
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Joseph Pecoraro
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-02-25 19:30 PST by Joseph Pecoraro
Modified: 2015-03-21 20:32 PDT (History)
7 users (show)

See Also:


Attachments
[PATCH] Proposed Fix (66.84 KB, patch)
2015-02-25 19:53 PST, Joseph Pecoraro
timothy: review+
Details | Formatted Diff | Diff
[IMAGE] Arrays (189.00 KB, image/png)
2015-02-25 19:54 PST, Joseph Pecoraro
no flags Details
[IMAGE] Set (100.24 KB, image/png)
2015-02-25 19:54 PST, Joseph Pecoraro
no flags Details
[IMAGE] Map (139.25 KB, image/png)
2015-02-25 19:54 PST, Joseph Pecoraro
no flags Details
[IMAGE] Nested 1 (148.80 KB, image/png)
2015-02-25 19:55 PST, Joseph Pecoraro
no flags Details
[IMAGE] Nested 2 (136.96 KB, image/png)
2015-02-25 19:55 PST, Joseph Pecoraro
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2015-02-25 19:30:38 PST
* SUMMARY
New ObjectTree UI for Arrays / Maps / Sets.
Comment 1 Radar WebKit Bug Importer 2015-02-25 19:31:06 PST
<rdar://problem/19964703>
Comment 2 Joseph Pecoraro 2015-02-25 19:53:53 PST
Created attachment 247391 [details]
[PATCH] Proposed Fix

There is room for improving this UI. When I update "Prototype" button UI I'll take tips on cleaning this up a bit.

Known bad case, expanding a very large Array. But that was already bad to begin with.

For instance expanding `document.all` on a large page performs horribly.

For this to be fixed we will need to fetch arrays in groups. We need better large collection support anyways.

Collections only grab 100 elements at a time. So they are prepared. But they are also unsupported.
Comment 3 Joseph Pecoraro 2015-02-25 19:54:17 PST
Created attachment 247392 [details]
[IMAGE] Arrays
Comment 4 Joseph Pecoraro 2015-02-25 19:54:35 PST
Created attachment 247393 [details]
[IMAGE] Set
Comment 5 Joseph Pecoraro 2015-02-25 19:54:51 PST
Created attachment 247394 [details]
[IMAGE] Map
Comment 6 Joseph Pecoraro 2015-02-25 19:55:24 PST
Created attachment 247395 [details]
[IMAGE] Nested 1
Comment 7 Joseph Pecoraro 2015-02-25 19:55:42 PST
Created attachment 247396 [details]
[IMAGE] Nested 2
Comment 8 Timothy Hatcher 2015-02-26 09:32:23 PST
Comment on attachment 247391 [details]
[PATCH] Proposed Fix

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

> Source/WebInspectorUI/UserInterface/Models/PropertyPath.js:218
> +            }
> +            var component = ".get(" + keyObject.description + ")";

Nit: newline.

> Source/WebInspectorUI/UserInterface/Views/ObjectTreeArrayIndexTreeElement.css:55
> +/* FIXME: Should this be all the time? */
> +.object-tree-array-index .index-value .object-tree {
> +    display: inline-block;
>  }

I think inline-block makes sense.

> Source/WebInspectorUI/UserInterface/Views/ObjectTreeSetIndexTreeElement.js:65
> +        // Array index name.

Set bullet.

> Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.js:309
> +        // FIXME: This only tries to release weak entries if this object was a WeakMap.
> +        // If there was a WeakMap expanded in a sub-object, we will never release those values.
> +        // Should we attempt walking the entire tree and release weak collections?

Walking the descendant TreeElements might be fine when a parent is expanded or collapsed.
Comment 9 Timothy Hatcher 2015-02-26 09:39:05 PST
Comment on attachment 247394 [details]
[IMAGE] Map

Why did you need to use dir()? I would expect the first log of m to output an expandable Map since Person is lossy.
Comment 10 Timothy Hatcher 2015-02-26 09:41:10 PST
Comment on attachment 247393 [details]
[IMAGE] Set

Similar here. Object in the preview is lossy.
Comment 11 Timothy Hatcher 2015-02-26 09:44:46 PST
Comment on attachment 247392 [details]
[IMAGE] Arrays

I wonder if we should drop the [n] counts for Arrays. They are distracting. (n) would look better.

I also wonder if the lossy preview for Object and Array should be {...} and [...]. (And if there is a object name, Person {...}.)
Comment 12 Timothy Hatcher 2015-02-26 09:46:06 PST
Comment on attachment 247392 [details]
[IMAGE] Arrays

Why is length in prototype and why is it 0?
Comment 13 Joseph Pecoraro 2015-02-26 11:29:59 PST
(In reply to comment #12)
> Comment on attachment 247392 [details]
> [IMAGE] Arrays
> 
> Why is length in prototype and why is it 0?

That is a really good question.
Comment 14 Joseph Pecoraro 2015-02-26 17:20:43 PST
http://trac.webkit.org/changeset/180713

I will open follow-ups for the other points, they are minor.