Re: [css-regions] Reworking getNamedFlows()

From: François REMY <francois.remy.dev@outlook.com<mailto:francois.remy.dev@outlook.com>>
Date: Saturday, July 27, 2013 6:48 AM
To: "www-style@w3.org<mailto:www-style@w3.org>" <www-style@w3.org<mailto:www-style@w3.org>>
Cc: Alan Stearns <stearns@adobe.com<mailto:stearns@adobe.com>>
Subject: [css-regions] Reworking getNamedFlows()
Resent-From: <www-style@w3.org<mailto:www-style@w3.org>>
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.

Thoughts?

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.

[1] http://lists.w3.org/Archives/Public/www-style/2012Feb/0327.html
[2]  http://lists.w3.org/Archives/Public/www-style/2012Jun/0501.html
[3] http://lists.w3.org/Archives/Public/public-webapps/2012AprJun/0101.html

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