Re: Contacts API -- pref

> 
> The spec stays silent on that. There's no special behavior attached to the pref attribute.

I can see that the spec is silent on that. My point is it doesn't make sense for the spec to be silent on that.

> 
>> 
>> Also, I wonder if the simple order of appearance might be a sufficient way to specify preference (maybe users want a different display order and preference order?).
> 
> Currently all major browsers loop over the properties of an object in the order in which they were defined. Chrome does this as well, except for a couple cases [1]. So there's potential for fragmentation on this. ECMA stays silent on the subject of ordering in these cases. ECMA-262 section 12.6.4 "The for-in Statement" says: "[t]he mechanics and order of enumerating the properties [...] is not specified". Relying on that ordering seems impossible based on that.

What is the harm in sorting properties consistently and moving 'pref'?

Andreas

> 
> [1] http://code.google.com/p/chromium/issues/detail?id=883
> 
> - Rich

Received on Thursday, 25 August 2011 15:06:57 UTC