Re: [whatwg/webidl] Maplike/setlike iterators shouldn't use MapIteratorPrototype/etc (Issue #1142)

This is tricky because there aren't too many maplikes and setlikes in web platform specs and even fewer are implemented widely. Findings so far:

- Firefox uses %MapIteratorPrototype% for `AudioParamMap`, `EventCounts`, and `RTCPeerStats`. It does _not_ use %SetIteratorPrototype% for `FontFaceSet`.
- Safari uses %MapIteratorPrototype% for `RTCPeerStats`. It does _not_ use %SetIteratorPrototype% for `FontFaceSet`.
- Chrome does not use %MapIteratorPrototype% or %SetIteratorPrototype% for any of the above. However, it does use the same iterator prototype object for `AudioParamMap`, `EventCounts`, and `RTCPeerStats`.

Given this total lack of interop we could kind of go in any direction.

My preference would be for the current spec (modulo layering fixes), i.e. use %MapIteratorPrototype% and %SetIteratorPrototype%. That would avoid telling Safari and Chrome, who implemented maplikes "correctly" (i.e. matching the spec), to do something new.

Alternatives include:

- Codify Chrome behavior to avoid (ab)using %MapIteratorPrototype%/%SetIteratorPrototype%.
- Codify Safari/Firefox behavior where %MapIteratorPrototype% is used for maplikes but a new prototype is used for setlikes. Would that setlike prototype be shared between all setlikes, or setlike-specific? It's unclear what each browser implements since they seem to both have only one setlike, but I would lean toward shared if we went this route...

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/webidl/issues/1142#issuecomment-1119090616
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/webidl/issues/1142/1119090616@github.com>

Received on Thursday, 5 May 2022 22:11:16 UTC