[Bug 26181] Spec should specify the presentation of the array returned by navigator.getGamepads() w.r.t "holes"

https://www.w3.org/Bugs/Public/show_bug.cgi?id=26181

--- Comment #29 from Ted Mielczarek [:ted] <ted@mielczarek.org> ---
AFAICT we have two plausible paths forward:
1) Change the spec to match Firefox's implementation: sequence<Gamepad?>
getGamepads()

This has the benefit of being incredibly easy to spec since the concept is
easily expressible in WebIDL. Still need some spec language to indicate that
implementations should return null for controllers that have been removed, but
I need to write that either way.

2) Spec a GamepadList object with an indexed property getter, and additionally
an iterator that returns only entries that are present (the default behavior of
ES6 iterators on objects with indexed property getters/length properties is to
iterate over 0..length-1). This could capture the existing intended semantics,
but it's awfully complicated, doesn't seem to provide a whole lot of benefit,
and feels like swimming against the tide of the web platform, since ES6 is
trying to deprecate sparse Arrays.

I'm leaning towards #1 (and the Blink folks have said they're amenable). Does
anyone have a compelling reason to argue for #2?

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Thursday, 18 December 2014 14:34:34 UTC