Collection of bugs for sensor api - would like new WG draft with this cleanup

Collection of bugs for sensor api.  None of these are big – they’re minor corrections or clarifications.  These should be fixed and a new draft published, to avoid having people find the same bugs.

Please publish a new WG draft with these fixed – that would aid in trial implementations.  Even if this switches to a web intent – postmessage solution, having this draft cleaned up will help, because the messages will likely carry the same information.

#1
Privacy Fingerprinting problem.  Section 4.2 SensorRequest returns a list of all available sensors.   This raises privacy issues.  Specifically, a list of sensors is like returning a list of codecs supported or a list of fonts installed.  It gives a good deal of information that could be used in fingerprinting (uniquely identifying the user/device).  No search for all sensors should be allowed.  This API should only allow a search for a specific sensor type.  Otherwise, it is too much fingerprinting information.  Request: drop the part about querying all sensors without a specific sensor type as input.

#2
Section 1 Introduction first example “session.startWatch(watchOptions);”

“session” is the wrong variable name.  It should be “sensorCnx”, not “sensor”

#3
Throughout the entire draft there is discussion of “done flag” as a Boolean “was set to false”.  Where is this “done” flag?  It seems done is only a value of “readyState” but that is defined in terms of the “done flag”.
      readyState of type DOMString, readonly
            Represents the status of the request. It must be set to one of the following:
•       processing. If the done flag is false.
•       done. If the done flag is true.
#4
“must return the sensor's resolution of the sensor in the sensor's unit”
Phrases with “sensor in the sensor’s unit” are repeated.  It should say “unit of measurement” to make it easier for readers to parse the phrase

#5
“getting this property must return the error of the request”  -- “getting this property” occurs in multiple places.  It’s awkward to read in sentences that have a verb immediately following it.  better to drop “getting this property” and just say something like “must return the error”

#6
In section 5.1.1 Attributes  --  the attribute descriptions are listed below in alphabetical order, rather than the order in which they appear.  That seems unnatural.  Throughout the draft, parameter descriptions are in alphabetical order rather than the order in which they appear in the object.

#7
Section 5.1.1
type of type DOMString, readonly
      It must return the sensor type. See table below for a list sensor types defined by this specification
There should be a link to the table it is referring to.   This would mean to imply that the only valid types are in that table.  It would be better to explicitly state other sensor types could be added outside of this specification.

#8
Section 6.2 Sensorwatchoptions threashold
Only checking for going below a particular value isn’t good.  Better to have it be an array with low threshold, high threshold and other values can be defined for specific sensors.  Having only a low threshold is not acceptable.

#9
MUST should be capitalized “hardware and must be expressed”

#10
Section 6.4 “Once the spec progress this section will be changed to comply with the DOM4 Event interfaces”   - drop the words “once the spec progress”

#11
Section 6.4.1 Sensordataevent  “reason” is a name that doesn’t seem to reflect what it is.  This is information on whether this is onetime or a watch recurreing report.  Or the attribute could be a Boolean “watchpoint” where true only if a recurring watch.

#12
Section 7 isn’t really “requirements”. It looks more like describing formats for particular types of sensors.  It should say here how others create their own additions.  Is there a registry?  Do people use prefix’s for their own namespace?

#13
Section 6.1.1 lists for Attribute status: “disconnected” – this state is not used.  Request: remove it or define its use.
1.      #14
2.       Section 6.1.2 functions endWatch, read and startWatch refer to ILLEGAL_STATE exceptions, which are not defined.  this should probably be INVALID_STATE_ERR (http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMException-INVALID_STATE_ERR<http://www.w3.org/TR/DOM-Level-3-Core/core.html> )
3.
4.      #15
5.       Section 8.1 Sensor Error defines the PERMISSION_DENIED error code to be a negative -100 value even though the type is unsigned short.
6.
7.      #16
8.      Important: Section 6.1.2 [Constructor(SensorOptions options)]:
This paragraph describes the algorithm for sensor lookup at construction time of the object.
From an implementer’s perspective, this requires a DOM implementation to wrap a potentially asynchronous operation (cmp. findSensors()) into a synchronous constructor.
I think this should be rewritten to queue a sensor lookup task and always return a SensorConncetion object in state new. When the lookup task completes, state transitions should occur which are signaled through “onstatuschange” or “onerror”. In  the case of a successful lookup, the state should change to open. In the case of failure, it should transition to error. As mentioned: Both signaled through the corresponding status change handlers.
9.
10.     #17 Section 4.1.1.  It isn’t clear enough what happens if no sensors are found.  Presumably, that is not an error since no error value is defined for that.  It appears “result” is of length 0 if no matching sensor is found.  It should say that.  Or if it is an error an error should be definted.

Received on Thursday, 1 March 2012 14:09:05 UTC