Skip to content

Commit

Permalink
Clean up Model section, export permission and policy-controlled featu…
Browse files Browse the repository at this point in the history
…re name

* Move the permissions-policy text to a separate section for clarity.
* Stop saying "Proximity Sensor a policy-controlled feature" because it does
  not make much sense. The most common way to list features is by saying
  something like "this spec defines a feature identifed by the string
  'foo'". In our case, that string is "proximity-sensor".
* Define and export the feature identifier above.
* Explicitly list all data associated with the spec's sensor type using a
  definition list instead of a very long paragraph.
* Similarly to w3c/accelerometer#67, define and export the "gyroscope"
  permission so that we can eventually link to the permission name from
  https://w3c.github.io/permissions-registry/
  • Loading branch information
rakuco committed Oct 26, 2023
1 parent 1be5160 commit 3963f69
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -102,23 +102,31 @@ To mitigate these, user agents should use one or both of the following [=mitigat
These mitigation strategies complement the [=mitigation strategies|generic mitigations=]
defined in the Generic Sensor API [[!GENERIC-SENSOR]].

Model {#model}
=====
Permissions Policy integration {#permissions-policy-integration}
==============================

The <dfn>Proximity Sensor</dfn> <a>sensor type</a>'s associated {{Sensor}} subclass is the {{ProximitySensor}} class.
This specification defines a [=policy-controlled feature=] identified by the string "<code><dfn data-lt="proximity-sensor-feature" export>proximity-sensor</dfn></code>". Its [=default allowlist=] is "`self`".

The <a>Proximity Sensor</a> has a <a>default sensor</a>,
which is the device's main proximity detector.
Model {#model}
=====

The <a>Proximity Sensor</a> has an associated [=sensor permission name=], which is <a for="PermissionName" enum-value>"proximity"</a>.
The <dfn id="proximity-sensor-sensor-type">Proximity Sensor</dfn> <a>sensor type</a> has the following associated data:

The <a>Proximity Sensor</a> is a [=policy-controlled feature=] identified by the string "proximity-sensor". Its [=default allowlist=] is `'self'`.
: [=Extension sensor interface=]
:: {{ProximitySensor}}
: [=Sensor permission names=]
:: "<code><dfn permission export>proximity</dfn></code>"
: [=Sensor feature names=]
:: "[=proximity-sensor-feature|proximity-sensor=]"
: [=powerful feature/Permission revocation algorithm=]
:: Invoke the [=generic sensor permission revocation algorithm=] with "<code><a permission>proximity</a></code>".
: [=Default sensor=]
:: The device's main proximity detector.

A [=latest reading=] for a {{Sensor}} of <a>Proximity Sensor</a> <a>sensor type</a> includes three [=map/entries=]
whose [=map/keys=] are "distance", "max", "near" and whose [=map/values=] contain [=distance=],
[=max=] and [=near=] values.


The <dfn>distance</dfn> is a value that represents the distance between a device and
the closest visible surface of the physical object within the <dfn>sensing range</dfn>.
Its unit is the centimeter (cm).
Expand Down

0 comments on commit 3963f69

Please sign in to comment.