RE: [webstorage] Ambiguous Requirement for Key Ordering

On  Tuesday, June 09, 2009 6:57 AM, Lachlan Hunt wrote:
> Hi,
>    The spec states [1]:
> 
>    "The key(n) method must return the name of the nth key in the list.
>     The order of keys is user-agent defined, but must be consistent
>     within an object between changes to the number of keys. (Thus,
>     adding or removing a key may change the order of the keys, but
>     merely changing the value of an existing key must not.)"
> 
> There is an ambiguity that can make that paragraph self-contradictory,
> depending on how the phrase "[the order] must be consistent within an
> object between changes to the number of keys.".  The ambiguity appears
> to be caused by the use of the word "between" in that context.  I
> initially interpreted that as meaning that the order must remain
> consistent when the number of keys changes.  But then this
> interpretation is contradicted by the parenthetical sentence following it.
> 
> Please clarify.
> 
> [1] http://dev.w3.org/html5/webstorage/#dom-storage-key


I read it as meaning between the times when the number of keys changes the order must be consistent but I see the potential ambiguity.

Perhaps the paragraph could be:

"The key(n) method must return the name of the nth key in the list. The order of keys is user-agent defined, but must be consistent within an object while the number of keys is unchanged. Adding or removing a key may change the order of the keys, but merely changing the value of an existing key must not."

Adrian.

Received on Monday, 22 June 2009 16:36:17 UTC