Skip to content

Commit

Permalink
Rename supportedSources to knownSources
Browse files Browse the repository at this point in the history
  • Loading branch information
kenchris committed Apr 29, 2024
1 parent 7340ca8 commit 349e7f1
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,13 @@ <h3>Supported sources</h3>
the method will throw a {{TypeError}}.
</p>
<p>
If the [=source type=] is part of {{PressureSource}}, but not supported by the
[=user agent=], host OS or underlying hardware, the method will instead throw
{{NotSupportedError}}.
If the [=source type=] is known by the [=user agent=] (part of {{PressureSource}}),
but not supported by it, the host OS or the underlying hardware, the method will instead
throw {{NotSupportedError}}.
</p>
<p>
To check what [=source types=] are supported, a user can call the static method
{{PressureObserver/supportedSources()}}.
To list the known [=source types=], a user can call the static attribute
{{PressureObserver/knownSources}}.
</p>
</aside>
</section>
Expand Down Expand Up @@ -528,7 +528,7 @@ <h3>The <a>PressureUpdateCallback</a> callback</h3>
undefined disconnect();
sequence&lt;PressureRecord&gt; takeRecords();

[SameObject] static readonly attribute FrozenArray&lt;PressureSource&gt; supportedSources;
[SameObject] static readonly attribute FrozenArray&lt;PressureSource&gt; knownSources;
};
</pre>

Expand Down Expand Up @@ -745,24 +745,28 @@ <h3>The <dfn>takeRecords()</dfn> method</h3>
</p>
</section>
<section>
<h3>The <dfn>supportedSources</dfn> attribute</h3>
<h3>The <dfn>knownSources</dfn> attribute</h3>
<p>
The {{PressureObserver/supportedSources}} attribute is informing on the [=supported source type=] by the [=platform collector=].
Each [=global object=] has an associated <dfn>frozen array of supported source types</dfn>, which is initialized
to the {{FrozenArray}} created from the sequence of strings values present in the enumeration
{{PressureSource}}, in alphabetical order.
</p>
<p>
The {{PressureObserver/supportedSources}} getter steps are:
The {{PressureObserver/knownSources}} getter steps are:
<ol class="algorithm">
<li>
Let |sources| be a [=list=] of |source:PressureSource|.
Let |globalObject| be the [=environment settings object=]'s [=global object=].
</li>
<li>
Return |observer|'s frozen array of supported [=source types=].
Return |globalObject|'s [=frozen array of supported source types=].
</li>
</ol>
</p>
<aside class="note">
<p>
This attribute allows web developers to easily know which [=source types=] are supported by the user agent.
The attribute property is a merely hint about the [=source types=] the [=user agent=] supports.
It is not guaranteed pressure observation will work on the underlying operating system or hardware.
Call {{PressureObserver/observe()}} and check for {{NotSupportedError}} if pressure observation is possible.
</p>
</aside>
</section>
Expand Down Expand Up @@ -833,7 +837,7 @@ <h3>The <dfn>PressureObserverOptions</dfn> dictionary</h3>
<h3>The <dfn>sampleInterval</dfn> member</h3>
<p>
The {{PressureObserverOptions/sampleInterval}} member represents the [=requested sampling
interval=] expressed in milliseconds.
interval=] expressed in milliseconds.
</p>
<aside class="note">
<p>
Expand Down

0 comments on commit 349e7f1

Please sign in to comment.