Skip to content

Commit

Permalink
Fix Bikeshed linking errors (#540)
Browse files Browse the repository at this point in the history
* Fix links to PermissionName/"bluetooth" after w3c/permissions#229.
* Define "denied" and "granted" links to point to permissions.
* Update `void` to `undefined` after WebIDL changes.
  • Loading branch information
jyasskin authored Feb 23, 2021
1 parent f8ce14d commit a03580e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 16 deletions.
22 changes: 13 additions & 9 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ spec: html
spec: webidl
type: dfn
text: resolve
spec: permissions-1
type: enum-value
text: "bluetooth"
text: "denied"
</pre>

<style>
Expand Down Expand Up @@ -1298,7 +1302,7 @@ all devices can match, a sequence of {{BluetoothServiceUUID}}s,

<div class="note">
Note: |state| will be {{"denied"}} in <a>non-secure contexts</a> because
{{"bluetooth"}} doesn't set the <a>allowed in non-secure contexts</a>
{{PermissionName/"bluetooth"}} doesn't set the <a>allowed in non-secure contexts</a>
flag.
</div>
1. If |state| is {{"denied"}}, return `[]` and abort these steps.
Expand Down Expand Up @@ -1329,7 +1333,7 @@ all devices can match, a sequence of {{BluetoothServiceUUID}}s,
<div class="note">
Note: Choosing a |device| probably indicates that the user
intends that device to appear in the
{{BluetoothPermissionStorage/allowedDevices}} list of {{"bluetooth"}}'s
{{BluetoothPermissionStorage/allowedDevices}} list of {{PermissionName/"bluetooth"}}'s
<a>extra permission data</a> for at least the <a>current settings
object</a>, for its {{AllowedBluetoothDevice/mayUseGATT}} field to be
`true`, for all the services in the union of
Expand Down Expand Up @@ -1598,7 +1602,7 @@ devices after a reload.
</pre>
</div>

The <dfn enum-value for="PermissionName">"bluetooth"</dfn> <a>powerful
The {{PermissionName/"bluetooth"}} <a>powerful
feature</a>'s permission-related algorithms and types are defined as follows:

<dl>
Expand Down Expand Up @@ -1653,7 +1657,7 @@ feature</a>'s permission-related algorithms and types are defined as follows:
{{BluetoothDevice}} instance seen at one time represents the same device
as another {{BluetoothDevice}} instance seen at another time, possibly in
a different <a>realm</a>. UAs should consider whether their user intends
that tracking to happen or not-happen when returning {{"bluetooth"}}'s
that tracking to happen or not-happen when returning {{PermissionName/"bluetooth"}}'s
<a>extra permission data</a>.

For example, users generally don't intend two different origins to know
Expand Down Expand Up @@ -1687,7 +1691,7 @@ feature</a>'s permission-related algorithms and types are defined as follows:
<code>|status|.devices</code> to an empty {{FrozenArray}} and abort
these steps.
1. Let <var>matchingDevices</var> be a new {{Array}}.
1. Let |storage|, a {{BluetoothPermissionStorage}}, be {{"bluetooth"}}'s
1. Let |storage|, a {{BluetoothPermissionStorage}}, be {{PermissionName/"bluetooth"}}'s
<a>extra permission data</a> for the <a>current settings object</a>.
1. For each |allowedDevice| in <code>|storage|.allowedDevices</code>, run the
following sub-steps:
Expand Down Expand Up @@ -1722,7 +1726,7 @@ feature</a>'s permission-related algorithms and types are defined as follows:
To <dfn>revoke Bluetooth access</dfn> to devices the user no longer intends to expose,
the UA MUST run the following steps:

1. Let |storage|, a {{BluetoothPermissionStorage}}, be {{"bluetooth"}}'s
1. Let |storage|, a {{BluetoothPermissionStorage}}, be {{PermissionName/"bluetooth"}}'s
<a>extra permission data</a> for the <a>current settings object</a>.
1. For each {{BluetoothDevice}} instance |deviceObj| in the <a>current
realm</a>, run the following sub-steps:
Expand Down Expand Up @@ -2026,7 +2030,7 @@ To <dfn export>get the <code>BluetoothDevice</code> representing</dfn> a
<a>Bluetooth device</a> <var>device</var> inside a {{Bluetooth}} instance
<var>context</var>, the UA MUST run the following steps:

1. Let |storage|, a {{BluetoothPermissionStorage}}, be {{"bluetooth"}}'s
1. Let |storage|, a {{BluetoothPermissionStorage}}, be {{PermissionName/"bluetooth"}}'s
<a>extra permission data</a> for the <a>current settings object</a>.
1. Find the |allowedDevice| in <code>|storage|.{{allowedDevices}}</code> with
<code><var>allowedDevice</var>.{{[[device]]}}</code> the <a>same device</a>
Expand Down Expand Up @@ -2062,7 +2066,7 @@ To <dfn export>get the <code>BluetoothDevice</code> representing</dfn> a
Getting the <code><dfn attribute for="BluetoothDevice">gatt</dfn></code>
attribute MUST perform the following steps:

1. If {{"bluetooth"}}'s <a>extra permission data</a> for `this`'s <a>relevant
1. If {{PermissionName/"bluetooth"}}'s <a>extra permission data</a> for `this`'s <a>relevant
settings object</a> has an {{AllowedBluetoothDevice}} |allowedDevice| in its
{{BluetoothPermissionStorage/allowedDevices}} list with
<code>|allowedDevice|.{{AllowedBluetoothDevice/[[device]]}}</code> the
Expand Down Expand Up @@ -3756,7 +3760,7 @@ interface <a>participate in a tree</a>.

* The <a>children</a> of {{Navigator/bluetooth|navigator.bluetooth}}</code></a>
are the {{BluetoothDevice}} objects representing devices in the
{{BluetoothPermissionStorage/allowedDevices}} list in {{"bluetooth"}}'s
{{BluetoothPermissionStorage/allowedDevices}} list in {{PermissionName/"bluetooth"}}'s
<a>extra permission data</a> for
{{Navigator/bluetooth|navigator.bluetooth}}'s <a>relevant settings
object</a>, in an unspecified order.
Expand Down
6 changes: 5 additions & 1 deletion scanning.bs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ spec:web-bluetooth
type: dfn
text: read only arraybuffer
type:enum-value; for:PermissionName; text:"bluetooth"
spec: permissions-1
type: enum-value
text: "denied"
text: "granted"
</pre>

<style>
Expand Down Expand Up @@ -377,7 +381,7 @@ spec:web-bluetooth

readonly attribute boolean active;

void stop();
undefined stop();
};
</pre>

Expand Down
12 changes: 6 additions & 6 deletions tests.bs
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ code may access them.
<h2 id="test-runner">testRunner</h2>

<pre class="idl">
callback BluetoothManualChooserEventsCallback = void(sequence&lt;DOMString> events);
callback BluetoothManualChooserEventsCallback = undefined(sequence&lt;DOMString> events);

interface TestRunner {
void setBluetoothMockDataSet(DOMString dataSetName);
void setBluetoothManualChooser();
void getBluetoothManualChooserEvents(BluetoothManualChooserEventsCallback callback);
void sendBluetoothManualChooserEvent(DOMString event, DOMString argument);
undefined setBluetoothMockDataSet(DOMString dataSetName);
undefined setBluetoothManualChooser();
undefined getBluetoothManualChooserEvents(BluetoothManualChooserEventsCallback callback);
undefined sendBluetoothManualChooserEvent(DOMString event, DOMString argument);
};
</pre>

Expand Down Expand Up @@ -282,7 +282,7 @@ action corresponding to the {{event}}:

<pre class="idl">
interface EventSender {
void keyDown(DOMString code);
undefined keyDown(DOMString code);
};
</pre>

Expand Down

0 comments on commit a03580e

Please sign in to comment.