[Webkit-unassigned] [Bug 38664] Web Inspector: add a "table" method to console, to allow output of tabular data

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon May 31 05:48:39 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=38664





--- Comment #12 from Timothy Hatcher <timothy at apple.com>  2010-05-31 05:48:38 PST ---
(In reply to comment #11)
> (In reply to comment #9)
> > In addition to arrays of arrays, I see FireBug is also supporting arrays of
> > objects, and then presumably iterating over the properties to obtain table
> > cell values.  Sounds kinda useful.
> I think the motivation here is to support array of objects (the same instances so the same properties), where each displayed row represents one instance.

I think both should be supported, arrays are just objects with numeric property names (at the basic level).

> > Not sure I want to get too fancy here -
> > I think I'd just iterate over the properties with a [for (var key in
> > rowObject)] and assign the row cells one after another.  Not try to line
> > up property names across multiple rows, for instance.
> Yes agree.

I adon't agree. You should line them up. The property order of the first row can be used for the other rows. You can't assume for..in will return the same order for all the objects, since the order it uses is the order the properies are added. And some of the objects might have been made differently. It isn't that hard or fancy to do this. Do it right.

> > Another flavor of that would be to accept just an object instead of an
> > array2D, and the create a two column table from that - one row for each
> > property, with property name/value being the row cells.
> Also agree.

Thinkng about this at a higher level, like what I said about arrays just being objects with numeric properties. That would apply here too. Iterate over the object, one row per property and the value, would be shown as columns, one column per property of the value.

Think about it. Then you have automatic labels for the rows and the columns. Just if the objects are arrays the labels are numbers (and thats when you would pass in seperate labels.)

I'm not a fan of the options argument. If it just takes columns, just make it be a columns argument. You can add more arguments later if you need them.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list