[heycam/webidl] More convenient way to refer to / use "map iterators" (#324)

I'm writing the CSS Typed OM spec, and I want to allow you to pass a Map iterator to the CSSCalcValue constructor (since CSSCalcValue is a maplike already).  However, it appears that to do so, I need to define the argument's type as `sequence<sequence<(DOMString or double)>>`, and then in the algorithm, explicitly iterate the sequence and verify that each entry is a 2-tuple where the first is a DOMString and the second is a double.

This is obviously extremely inconvenient, not to mention the fact that the type is extremely opaque - it's not clear *at all* that it's intended to take a map iterator.

(URL is also doing this, tho at least they have the convenience of both key and value being DOMStrings there, so their type/code is *very slightly* simpler.)

Can we have a `sequence<>` variant that is specialized for Map iterators? Maybe `map-sequence<keyType, valueType>`?  This would also do the type-checking automatically.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/issues/324

Received on Wednesday, 1 March 2017 00:02:46 UTC