@@ -4820,6 +4820,10 @@ TODO: Move it as a hook in the html spec instead.
4820
4820
1. If [=geolocation overrides map=] [=map/contains=] |user context|,
4821
4821
[=set emulated position data=] with |navigable| and [=geolocation overrides map=] [|user context|] .
4822
4822
4823
+ 1. If [=user context to locale overrides map=] [=map/contains=] |user context|,
4824
+ [=set emulated locale=] with |navigable| and
4825
+ [=user context to locale overrides map=] [|user context|] .
4826
+
4823
4827
1. If [=viewport overrides map=] [=map/contains=] |user context|:
4824
4828
4825
4829
1. If |navigable| is a [=/top-level traversable=] and the <code> viewport</code> field of
@@ -5790,6 +5794,13 @@ locale on the given top-level traversables or user contexts.
5790
5794
</dd>
5791
5795
</dl>
5792
5796
5797
+ <div>
5798
+ To <dfn>set emulated locale</dfn> given |navigable| and |locale|:
5799
+
5800
+ 1. Set [=navigable to locale overrides map=] [|navigable|] to |locale|.
5801
+
5802
+ </div>
5803
+
5793
5804
<div algorithm="remote end steps for emulation.setLocaleOverride">
5794
5805
5795
5806
The [=remote end steps=] with |command parameters| are:
@@ -5811,17 +5822,12 @@ The [=remote end steps=] with |command parameters| are:
5811
5822
1. If [=IsStructurallyValidLanguageTag=] (|emulated locale|) returns false,
5812
5823
return [=error=] with [=error code=] [=invalid argument=] .
5813
5824
5825
+ 1. Let |navigables| be a [=/set=] .
5826
+
5814
5827
1. If the <code> contexts</code> field of |command parameters| is present:
5815
5828
5816
5829
1. Let |navigables| be the result of [=trying=] to [=get valid top-level traversables by ids=] with |command parameters|["<code>contexts</code>"] .
5817
5830
5818
- 1. For each |navigable| of |navigables|:
5819
-
5820
- 1. If |emulated locale| is null, [=map/remove=] |navigable| from
5821
- [=navigable to locale overrides map=] .
5822
-
5823
- 1. Otherwise, [=map/set=] [=navigable to locale overrides map=] [|navigable|] to |locale|.
5824
-
5825
5831
1. Otherwise, if the <code> userContexts</code> field of |command parameters| is present:
5826
5832
5827
5833
1. Let |user contexts| be the result of [=trying=] to [=get valid user contexts=] with |command parameters|["<code>userContexts</code>"] .
@@ -5834,6 +5840,15 @@ The [=remote end steps=] with |command parameters| are:
5834
5840
1. Otherwise, [=user context to locale overrides map=] [|user context|] to
5835
5841
|locale|.
5836
5842
5843
+ 1. [=list/For each=] |top-level traversable| of the list of all [=/top-level traversables=]
5844
+ whose [=associated user context=] is |user context|:
5845
+
5846
+ 1. [=list/Append=] |top-level traversable| to |navigables|.
5847
+
5848
+ 1. For each |navigable| of |navigables|:
5849
+
5850
+ 1. [=Set emulated locale=] with |navigable| and |locale|.
5851
+
5837
5852
1. Return [=success=] with data null.
5838
5853
5839
5854
</div>
0 commit comments