diff --git a/index.bs b/index.bs
index a94d67e5..25945a92 100644
--- a/index.bs
+++ b/index.bs
@@ -126,6 +126,10 @@ spec: CONSOLE; urlPrefix: https://console.spec.whatwg.org
text: formatter; url: formatter
text: formatting specifier; url: formatting-specifiers
text: printer; url: printer
+spec: ECMASCRIPT-I18N; urlPrefix: https://tc39.es/ecma402/
+ type: dfn
+ text: DefaultLocale; url: #sec-defaultlocale
+ text: IsStructurallyValidLanguageTag; url: #sec-isstructurallyvalidlanguagetag
spec: ECMASCRIPT; urlPrefix: https://tc39.es/ecma262/
type: dfn
text: Array; url: sec-array-objects
@@ -3061,6 +3065,12 @@ or null and an [=struct/item=] named viewport overrides map which is a weak map between [=user contexts=] and [=viewport configuration=].
+A [=remote end=] has a navigable to locale overrides map which is a weak
+map between [=navigables=] and strings.
+
+A [=remote end=] has a user context to locale overrides map which is a
+weak map between [=user contexts=] and strings.
+
### Types ### {#module-browsingcontext-types}
#### The browsingContext.BrowsingContext Type #### {#type-browsingContext-Browsingcontext}
@@ -4810,6 +4820,10 @@ TODO: Move it as a hook in the html spec instead.
1. If [=geolocation overrides map=] [=map/contains=] |user context|,
[=set emulated position data=] with |navigable| and [=geolocation overrides map=][|user context|].
+ 1. If [=user context to locale overrides map=] [=map/contains=] |user context|,
+ [=set emulated locale=] with |navigable| and
+ [=user context to locale overrides map=][|user context|].
+
1. If [=viewport overrides map=] [=map/contains=] |user context|:
1. If |navigable| is a [=/top-level traversable=] and the viewport
field of
@@ -5627,7 +5641,8 @@ relating to emulation of browser APIs.
EmulationCommand = ( - emulation.SetGeolocationOverride + emulation.SetGeolocationOverride // + emulation.SetLocaleOverride )@@ -5750,6 +5765,104 @@ The [=remote end steps=] with |command parameters| are: +#### The emulation.setLocaleOverride Command #### {#command-emulation-setLocaleOverride} + +The emulation.setLocaleOverride command modifies +locale on the given top-level traversables or user contexts. + +
+ emulation.SetLocaleOverride = ( + method: "emulation.setLocaleOverride", + params: emulation.SetLocaleOverrideParameters + ) + + emulation.SetLocaleOverrideParameters = { + locale: text / null, + ? contexts: [+browsingContext.BrowsingContext], + ? userContexts: [+browser.UserContext], + } ++
+ EmptyResult
+
+ userContexts
"
+ and |command parameters| [=map/contains=] "context
",
+ return [=error=] with [=error code=] [=invalid argument=].
+
+1. If |command parameters| doesn't [=map/contain=] "userContexts
"
+ and |command parameters| doesn't [=map/contain=] "context
",
+ return [=error=] with [=error code=] [=invalid argument=].
+
+1. Let |emulated locale| be null.
+
+1. If |command parameters| [=map/contains=] "locale
":
+
+ 1. Set |emulated locale| to |command parameters|["locale
"].
+
+ 1. If [=IsStructurallyValidLanguageTag=](|emulated locale|) returns false,
+ return [=error=] with [=error code=] [=invalid argument=].
+
+1. Let |navigables| be a [=/set=].
+
+1. If the contexts
field of |command parameters| is present:
+
+ 1. Let |navigables| be the result of [=trying=] to
+ [=get valid top-level traversables by ids=] with
+ |command parameters|["contexts
"].
+
+1. Otherwise:
+
+ 1. Assert the userContexts
field of |command parameters| is present.
+
+ 1. Let |user contexts| be the result of [=trying=] to [=get valid user contexts=]
+ with |command parameters|["userContexts
"].
+
+ 1. For each |user context| of |user contexts|:
+
+ 1. If |emulated locale| is null, [=map/remove=] |user context| from
+ [=user context to locale overrides map=].
+
+ 1. Otherwise, [=user context to locale overrides map=][|user context|] to
+ |locale|.
+
+ 1. [=list/For each=] |top-level traversable| of the list of all
+ [=/top-level traversables=] whose [=associated user context=] is
+ |user context|:
+
+ 1. [=list/Append=] |top-level traversable| to |navigables|.
+
+1. For each |navigable| of |navigables|:
+
+ 1. [=Set emulated locale=] with |navigable| and |locale|.
+
+1. Return [=success=] with data null.
+
+