W3C home > Mailing lists > Public > www-style@w3.org > July 2013

Re: [css-regions] Reworking getNamedFlows()

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 29 Jul 2013 09:30:23 -0700
Message-ID: <CAAWBYDBCC054CuU3gV9AsODYD4R+8gEL2JNYZ8W=h6T+ucPZZg@mail.gmail.com>
To: Mihnea-Vlad Ovidenie <mihnea@adobe.com>
Cc: François REMY <francois.remy.dev@outlook.com>, "www-style@w3.org" <www-style@w3.org>, Alan Stearns <stearns@adobe.com>
On Mon, Jul 29, 2013 at 6:46 AM, Mihnea-Vlad Ovidenie <mihnea@adobe.com> wrote:
> François REMY <francois.remy.dev@outlook.com> wrote:
>> I would prefer getNamedFlows() to return a [MapLike] object instead of this
>> hybrid collection with getters.
> This is something that was brought in the past (1).  At this moment, the
> NamedFlowsCollection interface is modeled to resemble the HTMLCollection
> interface.
> Previous discussions on NamedFlowsCollection can be found at [2] and [3].

HTMLCollection is a legacy interface and is not meant to be emulated.
TC39 warns against designing "catch-all" object interfaces like this,
for the precise reasons that François outlines: you can't have
language-defined methods or attributes on the object or its prototypes
without either risking them being overwritten by user code, or
explicitly preventing user code from overriding them.  Both are bad
when we have ways to avoid them, and the latter is a future-compat
hazard.  Further, they don't play nicely with the newer iterator-based
things in JS.

This is precisely why I proposed [MapLike] and WebIDL and got it added.

>> My main reason not to like it is that it causes issues when some flow is
>> named "length" or "item" because developers expect
>> document.getNamedFlows()[flowName] to return the flow, which it doesn't.
> Does the HTMLCollection interface have the same issue?

It has lots of issues.  ^_^

Received on Monday, 29 July 2013 16:31:12 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:32 UTC