[DOM4] Question about using sequence<T> v.s., NodeList for (was [DOM4] NodeList should be deprecated )

Hello,

I am working on a proposal (http://wiki.csswg.org/spec/css3-regions/css-om) to update the CSS Regions CSS OM APIs, and one of the changes is to make various lists static. I see that the thread at http://lists.w3.org/Archives/Public/public-webapps/2012JanMar/1068.html stemmed from the CSS Regions OM implementation in WebKit.

It seems that the thread resulted in an agreement to keep using NodeList and make it inherit from Array. I also see that change in the latest editor draft of DOM4.

For the changes we are proposing, we have a need to return a static array of Nodes. We can follow the pattern discussed in this thread and use NodeList, but we also need to return arrays of Range instances (static list) and arrays of Region objects (static list).

I am wondering if it would be better to define a RegionList class and a RangeList class, to be consistent with NodeList, or would it be better to use sequence<Region> and sequence<Range>?

I think we have three options:

a. Use sequence<T> everywhere we have static lists in the CSS regions APIs. This is consistent within the spec., but would be inconsistent with DOM4 NodeList and its usage.

b. Use sequence<T> everywhere except where T=Node, in which case we would use NodeList. This is consistent with DOM4 and inconsistent within the spec.

c. Use NodeList and define RegionList/RangeList. This is consistent in the region spec. and with DOM4. But it introduces new interfaces with little added functionality (and they would have to be kept in sync. with NodeList if new features were added to the interface).

All in all, I think I prefer option b. but I would appreciate feedback.

Thanks,
Vincent

Received on Friday, 16 March 2012 01:00:16 UTC