W3C home > Mailing lists > Public > whatwg@whatwg.org > December 2012

Re: [whatwg] Canvas: dash list API

From: Anne van Kesteren <annevk@annevk.nl>
Date: Sat, 22 Dec 2012 14:40:07 +0100
Message-ID: <CADnb78heQ=uKh+1rFavErU=zgywwueKaWmgLvTOhVX5Ogy6iKA@mail.gmail.com>
To: Cameron McCormack <cam@mcc.id.au>
Cc: WHATWG <whatwg@whatwg.org>
On Sat, Dec 22, 2012 at 2:12 PM, Cameron McCormack <cam@mcc.id.au> wrote:
> Does it need to inherit from Array?  I think we can do this as long as the
> canvas context object does not need to "watch" the Array object for changes.
> (This is technically already possible by just using "object" as the type,
> and handling assignments of non-Array objects in the attribute definition.)
> We could have an Array type in Web IDL, which just means "a reference to an
> Array object" and which also doesn't do any type coercion when assigning to
> array elements or anything.

I think we want it to have the same operations as array, such as
push() and pop(), but have it restricted to the type given in IDL. And
assignment needs to update the underlying object so there would need
to be hooks for that too. And in particular for path segments more
normalization seems required, such as percent encoding "/".

So for all intents and purposes it would be an array, except that
modifying values would have pre-processing rules (e.g. type coercion
and percent encoding), and possible post-processing rules (updating
the URL object).

I guess dashList is somewhat simpler, but I think it would be nice if
it still did type coercion.

Received on Saturday, 22 December 2012 13:40:32 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:50 UTC