Bug 40140

Summary: Web Inspector: it would be better to print object properties in order of insertion.
Product: WebKit Reporter: Ilya Tikhonovsky <loislo>
Component: Web Inspector (Deprecated)Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: bweinstein, joepeck, keishi, pfeldman, pmuellr, rik, timothy, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
[patch] initial version.
pfeldman: review-
[patch] second iteration pfeldman: review+, pfeldman: commit-queue-

Description Ilya Tikhonovsky 2010-06-03 14:16:42 PDT
we have dumpObject function in inspector-test.js which is used for dumping timeline records, resource records, etc.
It would be better to dump object properties in alphabetical order to avoid an inconsistency when we switch to native json serialization of timeline data.
Comment 1 Ilya Tikhonovsky 2010-06-03 14:20:37 PDT
Created attachment 57813 [details]
[patch] initial version.
Comment 2 Pavel Feldman 2010-06-03 15:07:37 PDT
Comment on attachment 57813 [details]
[patch] initial version.

I'd rather make sure that native serialization supports original enumerable properties order. It might require adding another vector into the object class, but we should totally do that.
Comment 3 Ilya Tikhonovsky 2010-06-04 00:13:19 PDT
(In reply to comment #2)
> (From update of attachment 57813 [details])
> I'd rather make sure that native serialization supports original enumerable properties order. It might require adding another vector into the object class, but we should totally do that.

ECMA standard doesn't specify the order of enumerable properties but major browsers do that in the order of insertion.

http://bclary.com/2004/11/07/#a-12.6.4
Comment 4 Ilya Tikhonovsky 2010-06-04 08:20:58 PDT
Created attachment 57880 [details]
[patch] second iteration

now we should push object properties to json string in order of insertion.
Comment 5 Pavel Feldman 2010-06-04 08:28:02 PDT
Comment on attachment 57880 [details]
[patch] second iteration

WebCore/inspector/InspectorValues.h: 
 +      m_data.set(name, InspectorBasicValue::create(value));
what about calling set(name, InspectorBasicValue::create(value)) here and below?
Comment 6 Ilya Tikhonovsky 2010-06-04 10:23:41 PDT
Committing to http://svn.webkit.org/repository/webkit/trunk ...
	M	WebCore/ChangeLog
	M	WebCore/inspector/InspectorValues.cpp
	M	WebCore/inspector/InspectorValues.h
Committed r60687