Skip to content

Commit

Permalink
Issue WICG#196 - The version list should be a FrozenArray
Browse files Browse the repository at this point in the history
  • Loading branch information
miketaylr committed Aug 13, 2021
1 parent 3f9fa99 commit 281a8e8
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -694,15 +694,15 @@ dictionary NavigatorUABrandVersion {
};

dictionary UADataValues {
sequence<NavigatorUABrandVersion> brands;
FrozenArray<NavigatorUABrandVersion> brands;
boolean mobile;
DOMString architecture;
DOMString bitness;
DOMString model;
DOMString platform;
DOMString platformVersion;
DOMString uaFullVersion;
sequence<NavigatorUABrandVersion> versionList;
FrozenArray<NavigatorUABrandVersion> versionList;
};

dictionary UALowEntropyJSON {
Expand Down Expand Up @@ -739,9 +739,17 @@ Processing model {#processing}
Each [=user agent=] has an associated <dfn for="user agent">brands</dfn>, which is a [=/list=] created by running
[=create brands=] with [=user agent/significant version=] as <var ignore>versionType</var>.

Every {{WindowOrWorkerGlobalScope}} object has an associated <dfn for="WindowOrWorkerGlobalScope">brands frozen array</dfn>,
which is a <code><a interface>FrozenArray</a>&lt;<a dictionary>NavigatorUABrandVersion</a>></code>. It is initially the
result of [=create a frozen array|creating a frozen array=] from the [=user agent=]'s [=brands=].
Every {{WindowOrWorkerGlobalScope}} object has an associated
<dfn for="WindowOrWorkerGlobalScope">brands frozen array</dfn>, which is a
<code><a interface>FrozenArray</a>&lt;<a dictionary>NavigatorUABrandVersion</a>></code>. It is
initially the result of [=create a frozen array|creating a frozen array=] from the [=user agent=]'s
[=brands=].

Additionally, every {{WindowOrWorkerGlobalScope}} object has an associated
<dfn for="WindowOrWorkerGlobalScope">version list frozen array</dfn>, which is a
<code><a interface>FrozenArray</a>&lt;<a dictionary>NavigatorUABrandVersion</a>></code>. It is
initially the result of [=create a frozen array|creating a frozen array=] from the [=user agent=]'s
[=brands=], with [=user agent/full version=] passed as an argument.

<h4 algorithm="to create brands" id="create-ua-list-section">Create brands</h4>

Expand Down Expand Up @@ -825,7 +833,8 @@ ISSUE(wicg/ua-client-hints): We can improve upon when and why a UA decides to re
3. Otherwise, run the following steps [=in parallel=]:

1. Let |uaData| be a new {{UADataValues}}.
1. set |uaData|["{{UADataValues/brands}}"] to [=this=]'s [=relevant global object=]'s [=WindowOrWorkerGlobalScope/brands frozen array=].
1. set |uaData|["{{UADataValues/brands}}"] to [=this=]'s [=relevant global object=]'s
[=WindowOrWorkerGlobalScope/brands frozen array=].
1. set |uaData|["{{UADataValues/mobile}}"] to the [=user agent=]'s [=user agent/mobileness=].
1. set |uaData|["{{UADataValues/platform}}"] to the [=user agent=]'s [=user agent/platform brand=].
1. If |hints| [=list/contains=] "architecture", set |uaData|["{{UADataValues/architecture}}"] to
Expand All @@ -836,11 +845,11 @@ ISSUE(wicg/ua-client-hints): We can improve upon when and why a UA decides to re
[=user agent=]'s [=user agent/model=].
1. If |hints| [=list/contains=] "platformVersion", set |uaData|["{{UADataValues/platformVersion}}"]
to the [=user agent=]'s [=user agent/platform version=].
1. If |hints| [=list/contains=] "uaFullVersion", let |uaData|["{{UADataValues/uaFullVersion}}"]
be the the user agent's [=user agent/full version=].
1. If |hints| [=list/contains=] "versionList", let |uaData|["{{UADataValues/versionList}}"]
be the result of running the [=create brands=] steps, with [=user agent/full version=]
passed as an argument.
1. If |hints| [=list/contains=] "uaFullVersion", set |uaData|["{{UADataValues/uaFullVersion}}"]
to the user agent's [=user agent/full version=].
1. If |hints| [=list/contains=] "versionList", set |uaData|["{{UADataValues/versionList}}"]
to [=this=]'s [=relevant global object=]'s
[=WindowOrWorkerGlobalScope/version list frozen array=].
1. [=Queue a task=] on the [=permission task source=] to [=resolve=] |p| with |uaData|.

4. Return |p|.
Expand Down

0 comments on commit 281a8e8

Please sign in to comment.