Skip to content

Commit c01e99b

Browse files
committed
deploy: 2a60543
1 parent 48af96b commit c01e99b

File tree

1 file changed

+38
-48
lines changed

1 file changed

+38
-48
lines changed

index.html

Lines changed: 38 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<meta content="Bikeshed version 742f3d674, updated Mon Nov 4 14:56:54 2024 -0800" name="generator">
99
<link href="https://www.w3.org/TR/design-principles/" rel="canonical">
1010
<link href="https://www.w3.org/2008/site/images/favicon.ico" rel="icon">
11-
<meta content="bb486928f35be6b761fb1715c3b1beaae696c522" name="revision">
11+
<meta content="2a605434d7c2c923b986c83fdc024c41e2cdc85e" name="revision">
1212
<meta content="dark light" name="color-scheme">
1313
<link href="https://www.w3.org/StyleSheets/TR/2021/dark.css" media="(prefers-color-scheme: dark)" rel="stylesheet" type="text/css">
1414
<style>
@@ -853,11 +853,11 @@ <h2 class="no-num no-toc no-ref" id="contents">Table of Contents</h2>
853853
<li><a href="#error-types"><span class="secno">8.5</span> <span class="content">Use Error or DOMException for errors</span></a>
854854
</ol>
855855
<li>
856-
<a href="#device-apis"><span class="secno">9</span> <span class="content">APIs that wrap access to device or browser capabilities</span></a>
856+
<a href="#device-apis"><span class="secno">9</span> <span class="content">OS and Device Wrapper APIs</span></a>
857857
<ol class="toc">
858-
<li><a href="#device-ids"><span class="secno">9.1</span> <span class="content">Don’t expose unnecessary information about capabilities</span></a>
858+
<li><a href="#device-ids"><span class="secno">9.1</span> <span class="content">Don’t expose unnecessary information about devices</span></a>
859859
<li><a href="#device-enumeration"><span class="secno">9.2</span> <span class="content">Use care when exposing APIs for selecting or enumerating devices</span></a>
860-
<li><a href="#usecase-oriented-apis"><span class="secno">9.3</span> <span class="content">Design based on user needs, not the underlying capability</span></a>
860+
<li><a href="#usecase-oriented-apis"><span class="secno">9.3</span> <span class="content">Design based on user needs, not the underlying API or hardware</span></a>
861861
<li><a href="#hardware-is-scary"><span class="secno">9.4</span> <span class="content">Be proactive about safety</span></a>
862862
<li><a href="#wrapper-apis"><span class="secno">9.5</span> <span class="content">Adapt native APIs using web platform principles</span></a>
863863
</ol>
@@ -1149,13 +1149,12 @@ <h3 class="heading settled" data-level="1.8" id="removing-features"><span class=
11491149
<h3 class="heading settled" data-level="1.9" id="leave-the-web-better"><span class="secno">1.9. </span><span class="content">Leave the web better than you found it</span><a class="self-link" href="#leave-the-web-better"></a></h3>
11501150
<p>As you add new capabilities to the web platform,
11511151
do so in a way that improves the overall platform,
1152-
for example its security, privacy or accessibility characteristics.</p>
1153-
<p>The existence of a defect in one part of the platform
1154-
must not be used to excuse an addition or extension to the defect,
1155-
which would further decrease the overall platform quality.
1156-
Where possible, build new web capabilities that improve the overall platform quality
1157-
by mitigating existing defects.
1158-
Do not degrade existing capabilities without good reason.</p>
1152+
for example its security, privacy or accessibility characteristics.
1153+
The existence of a defect in one part of the platform
1154+
must not be used as a license for adding or extending such defect
1155+
into new capabilities and thereby further decreasing the overall platform quality.
1156+
Where possible, build new web capabilities that improve the overall platform quality,
1157+
and do not degrade existing capabilities without good reason.</p>
11591158
<p>Parts of the web platform evolve independently.
11601159
Issues that are present with a certain web technology now may be fixed in a subsequent iteration.
11611160
Duplicating these issues makes fixing them more difficult.
@@ -2874,88 +2873,79 @@ <h3 class="heading settled" data-level="8.5" id="error-types"><span class="secno
28742873
<p>Represent errors in web APIs as ECMAScript error objects (e.g., <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-error-objects" id="ref-for-sec-error-objects">Error</a></code>)
28752874
or as <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#idl-DOMException" id="ref-for-idl-DOMException">DOMException</a></code>.
28762875
whether they are exceptions, promise rejection values, or properties.</p>
2877-
<h2 class="heading settled" data-level="9" id="device-apis"><span class="secno">9. </span><span class="content">APIs that wrap access to device or browser capabilities</span><a class="self-link" href="#device-apis"></a></h2>
2876+
<h2 class="heading settled" data-level="9" id="device-apis"><span class="secno">9. </span><span class="content">OS and Device Wrapper APIs</span><a class="self-link" href="#device-apis"></a></h2>
28782877
<p>New APIs are now being developed in the web platform for interacting with devices.
28792878
For example, authors wish to be able to use the web to connect with their <a href="https://www.w3.org/TR/mediacapture-streams/">microphones and cameras</a>, <a href="https://www.w3.org/TR/generic-sensor/">generic sensors</a> (such as gyroscope and
28802879
accelerometer), <a href="https://www.w3.org/community/web-bluetooth/">Bluetooth</a> and <a href="https://wicg.github.io/webusb/">USB</a>-connected peripherals, <a href="https://www.w3.org/community/autowebplatform/">automobiles</a>, etc.</p>
2881-
<p>The same applies to capabilities that might be optionally provided
2882-
by either the host system or an external service.
2883-
This includes capabilities that depend on users paying for access to the capability.</p>
2884-
<p>These capabilities can be functionality provided by the underlying operating system,
2885-
or provided by a native third-party library.
2886-
APIs can provide an abstraction which "wraps" the native functionality
2880+
<p>These can be functionality provided by the underlying operating system,
2881+
or provided by a native third-party library
2882+
to interact with a device.
2883+
These are an abstraction which "wrap" the native functionality
28872884
without introducing significant complexity,
28882885
while securing the API surface to the browser.
28892886
So, these are called wrapper APIs.</p>
2890-
<p>This section contains principles for consideration
2891-
when designing APIs for these capabilities.</p>
2892-
<h3 class="heading settled" data-level="9.1" id="device-ids"><span class="secno">9.1. </span><span class="content">Don’t expose unnecessary information about capabilities</span><a class="self-link" href="#device-ids"></a></h3>
2893-
<p>In line with the <a href="#data-minimization">Data Minimization</a> principle,
2894-
if you need to give web sites access to information about capabilities,
2895-
only expose the minimal amount of data necessary.</p>
2887+
<p>This section contains principles for consideration when designing APIs for devices.</p>
2888+
<h3 class="heading settled" data-level="9.1" id="device-ids"><span class="secno">9.1. </span><span class="content">Don’t expose unnecessary information about devices</span><a class="self-link" href="#device-ids"></a></h3>
2889+
<p>In line with the <a href="#data-minimization">Data Minimization</a> principle, if you need to give web sites access to information about a device, only expose the minimal amount of data necessary.</p>
28962890
<p>Firstly, think carefully about whether it is really necessary
2897-
to expose information at all.
2891+
to expose identifying information about the device at all.
28982892
Consider whether your <a href="#priority-of-constituencies">user needs</a> could be satisfied
28992893
by a less powerful API.</p>
29002894
<p>Exposing the presence of a device,
29012895
additional information about a device,
29022896
or device identifiers,
29032897
each increase the risk of harming the user’s privacy.</p>
2904-
<p>When a user makes a choice to deny access to a device or capability,
2905-
that should not reveal whether the capability exists.
2906-
Reducing information leakage in that scenario
2907-
is more important
2908-
than when the capability is granted.</p>
2898+
<p>A web app should not be able to distinguish between the user rejecting
2899+
permission to use a sensor/capability, and the sensor/capability not being present.</p>
29092900
<p>As more specific information is shared,
29102901
the <a href="https://www.w3.org/TR/fingerprinting-guidance/">fingerprinting data</a> available to sites gets larger.
29112902
There are also [other potential risks](<a href="https://w3ctag.github.io/privacy-principles/#threats">Privacy Principles § threats</a>)
29122903
to user privacy.</p>
29132904
<p>If there is no way to design a less powerful API,
29142905
use these guidelines when exposing device information:</p>
29152906
<dl>
2916-
<dt data-md>Limit information in any identifier
2907+
<dt data-md>Limit information in the id
29172908
<dd data-md>
29182909
<p>Include as little identifiable information as possible
2919-
in device identifiers exposed to the web plaform.
2910+
in device ids exposed to the web plaform.
29202911
Identifiable information includes
29212912
branding, make and model numbers, etc
2922-
You can usually use a randomly generated identifier instead.
2923-
Make sure that your identifiers aren’t guessable,
2913+
You can usually use a random number
2914+
or a unique id instead.
2915+
Make sure that your ids aren’t guessable,
29242916
and aren’t re-used.</p>
29252917
<dt data-md>Keep the user in control
29262918
<dd data-md>
29272919
<p>When the user chooses to clear browsing data,
2928-
make sure any stored device identifiers are cleared.</p>
2929-
<dt data-md>Hide sensitive information behind a user permission
2920+
make sure any stored device ids are cleared.</p>
2921+
<dt data-md>Hide sensitive ids behind a user permission
29302922
<dd data-md>
2931-
<p>If you can’t create a device identifier in an anonymous way,
2923+
<p>If you can’t create a device id in an anonymous way,
29322924
limit access to it.
29332925
Make sure the user can provide <a href="#consent">meaningful consent</a> to a Web page accessing this information.</p>
2934-
<dt data-md>Tie identifiers to the same-origin model
2926+
<dt data-md>Tie ids to the same-origin model
29352927
<dd data-md>
2936-
<p>Create distinct identifiers for the same physical device
2928+
<p>Create distinct unique ids for the same physical device
29372929
for each origin that has has access to it.</p>
29382930
<dd data-md>
29392931
<p>If the same device is requested more than once
2940-
by the same origin, return the same identifier for it
2932+
by the same origin, return the same id for it
29412933
(unless the user has cleared their browsing data).
29422934
This allows authors to avoid having
29432935
several copies of the same device.</p>
29442936
<dt data-md>Persistable when necessary
29452937
<dd data-md>
2946-
<p>If a device identifier is time consuming to obtain,
2947-
make sure authors can store an identifier generated in one session
2938+
<p>If a device id is time consuming to obtain,
2939+
make sure authors can store an id generated in one session
29482940
for use in a later session.
29492941
You can do this by making sure that
2950-
the procedure to generate the identifier
2951-
consistently produces the same value
2942+
the procedure to generate the id
2943+
consistently produces the same id
29522944
for the same device,
29532945
for each origin.</p>
29542946
</dl>
29552947
<p>See also:</p>
29562948
<ul>
2957-
<li data-md>
2958-
<p><a href="#consent">§ 1.4 Ask users for meaningful consent</a></p>
29592949
<li data-md>
29602950
<p><a data-link-type="biblio" href="#biblio-least-power" title="The Rule of Least Power">[LEAST-POWER]</a></p>
29612951
<li data-md>
@@ -2967,7 +2957,7 @@ <h3 class="heading settled" data-level="9.2" id="device-enumeration"><span class
29672957
<p>Look for ways to avoid enumerating devices.
29682958
If you can’t avoid it, expose the least information possible.</p>
29692959
<p>If an API exposes the existence, capabilities, or identifiers of more than one device,
2970-
all of the risks in <a href="#device-ids">§ 9.1 Don’t expose unnecessary information about capabilities</a> are multiplied by the number of devices.
2960+
all of the risks in <a href="#device-ids">§ 9.1 Don’t expose unnecessary information about devices</a> are multiplied by the number of devices.
29712961
For the same reasons,
29722962
consider whether your <a href="#priority-of-constituencies">user needs</a> could be satisfied
29732963
by a less powerful API. <a data-link-type="biblio" href="#biblio-least-power" title="The Rule of Least Power">[LEAST-POWER]</a></p>
@@ -3023,7 +3013,7 @@ <h3 class="heading settled" data-level="9.2" id="device-enumeration"><span class
30233013
<p class="note" role="note"><span class="marker">Note:</span> While APIs should not
30243014
expose a full list of devices in an <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#implementation-defined" id="ref-for-implementation-defined">implementation-defined</a> order,
30253015
they may need to for web compatibility reasons.</p>
3026-
<h3 class="heading settled" data-level="9.3" id="usecase-oriented-apis"><span class="secno">9.3. </span><span class="content">Design based on user needs, not the underlying capability</span><a class="self-link" href="#usecase-oriented-apis"></a></h3>
3016+
<h3 class="heading settled" data-level="9.3" id="usecase-oriented-apis"><span class="secno">9.3. </span><span class="content">Design based on user needs, not the underlying API or hardware</span><a class="self-link" href="#usecase-oriented-apis"></a></h3>
30273017
<p>Expose new native capabilities being brought to the web based on user needs.</p>
30283018
<p>Avoid directly translating an existing native API to the web.</p>
30293019
<p>Instead, consider the functionality available from the native API,

0 commit comments

Comments
 (0)