Skip to content

Commit

Permalink
Rewrite Abstract Operations
Browse files Browse the repository at this point in the history
This patch contains massive refactoring of the abstract operations and internal slots used in the Sensor interface specification.

The refactoring goals are:
 - Recompose abstract operations so that duplication of the algorithms steps is removed.
 - Drop the unused abstract operations and internal slots.

Also the change brings the following behavioral changes:

Fixes w3c#152. Each Sensor instance reads the sensor readings considering its individual
frequency hint, sends 'onchange' and caches the sensor latest reading at this moment.
The Sensor's attributes return values from the cached reading.
Thus we achieve:
 -  appearance of a new Sensor instance with a higher frequency hint does not affect the behavior of the existing Sensor instances of the same type.
 -  consistency between the Sensor's 'onchange' notification and its attribute values.

Fixes w3c#168. A Sensor object returns reading values only in "activated" state and returns null otherwise.

The "Handle Errors" abstract operation deactivates the given Senor object.
  • Loading branch information
Mikhail Pozdnyakov committed May 18, 2017
1 parent 2d22842 commit 8284700
Showing 1 changed file with 78 additions and 175 deletions.
Loading

0 comments on commit 8284700

Please sign in to comment.