Bug 156934 - Web Inspector: HeapAllocationsTimeline grid should use built-in grid column icons
Summary: Web Inspector: HeapAllocationsTimeline grid should use built-in grid column i...
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: Matt Baker
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-04-22 15:31 PDT by Matt Baker
Modified: 2016-04-22 19:49 PDT (History)
8 users (show)

See Also:


Attachments
[Patch] Proposed Fix (3.41 KB, patch)
2016-04-22 15:34 PDT, Matt Baker
no flags Details | Formatted Diff | Diff
[Patch] Proposed Fix (3.41 KB, patch)
2016-04-22 16:09 PDT, Matt Baker
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Baker 2016-04-22 15:31:48 PDT
* SUMMARY
HeapAllocationsTimeline grid should use built-in grid column icons. To avoid subtle differences in styling, grid nodes should avoid creating their own icon elements for document fragment cells.
Comment 1 Matt Baker 2016-04-22 15:34:29 PDT
Created attachment 277108 [details]
[Patch] Proposed Fix
Comment 2 Radar WebKit Bug Importer 2016-04-22 15:35:23 PDT
<rdar://problem/25887367>
Comment 3 Radar WebKit Bug Importer 2016-04-22 15:35:29 PDT
<rdar://problem/25887363>
Comment 4 Joseph Pecoraro 2016-04-22 15:51:37 PDT
Comment on attachment 277108 [details]
[Patch] Proposed Fix

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

I still don't think it makes sense for DataGrid to special case having an icon for a data grid cell. It feels like too much is getting put into DataGrid. As is, this change looks fine, it just seems like increased complexity for no profit.

> Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineView.js:40
> +                icon: true

Style: Should have trailing comma.
Comment 5 Matt Baker 2016-04-22 16:05:51 PDT
(In reply to comment #4)
> Comment on attachment 277108 [details]
> [Patch] Proposed Fix
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=277108&action=review
> 
> I still don't think it makes sense for DataGrid to special case having an
> icon for a data grid cell. It feels like too much is getting put into
> DataGrid. As is, this change looks fine, it just seems like increased
> complexity for no profit.

I disagree. Adding icon elements is a common operation, and pushing it into the grid adds very little complexity while ensuring consistently styled cell content.
Comment 6 Matt Baker 2016-04-22 16:09:26 PDT
Created attachment 277110 [details]
[Patch] Proposed Fix
Comment 7 Timothy Hatcher 2016-04-22 16:20:40 PDT
Comment on attachment 277110 [details]
[Patch] Proposed Fix

One solution to Joe's concerns would be to have a subclass of DataGridNode that added the icon support, but didn't bake it into DataGridNode directly. That would be similar to GeneralTreeElement for TreeOutlines. But I think this is fine. I suspect there are other places we could do this.
Comment 8 Matt Baker 2016-04-22 19:00:52 PDT
Since grid cell formatting is the same for all cells in a column, we might want something like this:

DataGridColumn (basic formatting for text & numbers)
DataGridIconColumn
DataGridCustomColumn (for document fragment cells)

I'll give it some more thought.
Comment 9 WebKit Commit Bot 2016-04-22 19:49:20 PDT
Comment on attachment 277110 [details]
[Patch] Proposed Fix

Clearing flags on attachment: 277110

Committed r199947: <http://trac.webkit.org/changeset/199947>
Comment 10 WebKit Commit Bot 2016-04-22 19:49:25 PDT
All reviewed patches have been landed.  Closing bug.