Re: [w3ctag/spec-reviews] Ambient Light Sensor API (#115)

Understood, but I'd like to try.

A few notes for the structure of the spec:

 - There's only a single example and no linked explainer document that would provide deeper understanding of how the various bits get used together.  I think this would be clarifying both for the reader and the authors.
 - The example (singular?) doesn't show how to use the Permission API in conjunction with the Ambient Light API, which seems pretty critical to actual use.
 - While I understand that the Generic Sensor API returns `undefined` for `start()` and `stop()`, it'd seem that individual sensors should probably return promises from these calls so that the start and stop operations can report errors
 - There's no definition for what `onstatechange` would do. Does that report start/stop state? Are those inspectable in some other way?
 - The use of Constructors looks good!
 - What's the model for multiple clients of a sensor like this? I get that AmbientLightSensor likely doesn't have any difficulty multiplexing the data, there will be some sensors that may want to allow writing values and other sorts of configuration that can be considered "exclusive". How does the generic sensor API handle this? And is "sensor state" meant to be mapped to the hardware sensor or specific to the software reflection that the object in question provides (which might be different than the hardware state)? For instance, [this](https://w3c.github.io/sensors/#sensor-reading) isn't particularly illuminating (pardon the pun).
 - Requests for permissions aren't modeled in this API. Is the assumption that [`navigator.permissions.request()`](https://w3c.github.io/permissions/#dom-permissions-request) will be used here?
 - Are these sensors available from within worker contexts? They don't appear to be from the IDL but maybe I'm missing some prose? Shouldn't they be (modulo permissions request issues)?
 - Glad to see these restricted to [Secure Contexts](https://w3c.github.io/webappsec-secure-contexts/). Nice work. Has there been any consideration of top-level browsing contexts vs. iframes? (cc: @mikewest)
 - How does the sensor processing model get defined? If it's a frequency model, what happens when it's faster than the swap-buffer rate (e.g. `requestAnimationFrame` timing)?

This is a bit first-pass, and would be happy to do a deeper review. Let us know!

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3ctag/spec-reviews/issues/115#issuecomment-203822542

Received on Thursday, 31 March 2016 08:44:24 UTC