Bug 164349 - Web Inspector: Modify FolderTreeElement to have a Collection as a its represented object
Summary: Web Inspector: Modify FolderTreeElement to have a Collection as a its represe...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Devin Rousso
URL:
Keywords: InRadar
Depends on:
Blocks: 145906
  Show dependency treegraph
 
Reported: 2016-11-02 16:34 PDT by Devin Rousso
Modified: 2016-11-03 11:45 PDT (History)
7 users (show)

See Also:


Attachments
Patch (16.62 KB, patch)
2016-11-02 16:39 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Devin Rousso 2016-11-02 16:34:59 PDT
In order to allow folder's to be selectable and show content, it it necessary for them to know what content to display.  Now that we have the general WI.Collection model object, we can leverage this by making all WI.FolderTreeElement instances have a representedObject that is a WI.Collection of all its children.
Comment 1 Radar WebKit Bug Importer 2016-11-02 16:35:20 PDT
<rdar://problem/29078775>
Comment 2 Devin Rousso 2016-11-02 16:39:49 PDT
Created attachment 293712 [details]
Patch
Comment 3 Timothy Hatcher 2016-11-02 16:45:44 PDT
Comment on attachment 293712 [details]
Patch

Matt, can you review this. It touches code you added, re: countChildrenCallback.
Comment 4 Matt Baker 2016-11-03 11:20:32 PDT
Comment on attachment 293712 [details]
Patch

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

r=me, use of Collection really makes this code cleaner!

> Source/WebInspectorUI/UserInterface/Views/FolderTreeElement.js:28
> +    constructor(title, representedObject)

Nice cleanup.

> Source/WebInspectorUI/UserInterface/Views/FolderTreeElement.js:35
> +        super(classNames, title, subtitle, representedObject, hasChildren);

Just naming the bool is probably sufficient, but I don't feel too strongly about it.

> Source/WebInspectorUI/UserInterface/Views/FrameTreeElement.js:56
> +        for (let [key, value] of Object.entries(WebInspector.Resource.Type)) {

Object.entries, cool!
Comment 5 WebKit Commit Bot 2016-11-03 11:45:11 PDT
Comment on attachment 293712 [details]
Patch

Clearing flags on attachment: 293712

Committed r208337: <http://trac.webkit.org/changeset/208337>
Comment 6 WebKit Commit Bot 2016-11-03 11:45:15 PDT
All reviewed patches have been landed.  Closing bug.