You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Define and use a "threshold check algorithm" that concrete sensors can use.
Related to w3c/ambient-light#63, which says the granularity of the data
exposed by Ambient Light Sensors should be specified normatively.
This commit goes a bit further and lays out some of the scaffolding
necessary to specify the anti-fingerprinting measures currently implemented
by Chrome -- namely, not only are illuminance values rounded but there's
also a threshold value check to avoid storing values that are too close to
the latest reading.
A new algorithm, the threshold check algorithm, can be defined by concrete
sensors and is associated with a sensor type. It is invoked by the "update
sensor reading" abstract operation when defined, and if it returns false,
"update sensor reading" will abort and not update the `latest reading` map.
A few other parts also had to be adjusted to make this work possible:
- A platform sensor is now explicitly associated with a sensor type.
- Extension sensor attribute getters are no longer normatively required to
simply return the value of invoking "get value from latest readings", as
`AmbientLightSensor.illuminance`'s getter needs to do extra work. We only
require that the attributes be read-only now.
0 commit comments