Re: [css-regions] Reworking getNamedFlows()

From: François REMY <<>>
Date: Saturday, July 27, 2013 6:48 AM
To: "<>" <<>>
Cc: Alan Stearns <<>>
Subject: [css-regions] Reworking getNamedFlows()
Resent-From: <<>>
Resent-Date: Saturday, July 27, 2013 6:49 AM

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].

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's also somehow expensive to generate and then GC that mixt int/index-NamedFlow map, which is a waste if the author goal is just to retrieve one single flow by name, or just iterate over the collection.

How expensive?

If [MapLike] isn't a solution due to iOS7 target, can we settle instead on getNamedFlows() to return a sequence<NamedFlow> and add a new method, getNamedFlow(name), to return a NamedFlow? Those seems two different use cases to me anyway. You either want all flows to iterate over them or just one by name.


Are you talking about adding getNamedFlow(name) on the document? We had that in the past and removed it in favor of NamedFlowCollection namedItem.

In my opinion, the current NamedFlowCollection interface is flexible enough for all the use cases you may want to use it, I would not change it unless there is a compelling reason to do so.


Received on Monday, 29 July 2013 13:46:46 UTC