Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 32 additions & 6 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ spec: GEOMETRY; urlPrefix: https://drafts.fxtf.org/geometry/
text: height dimension; url: rectangle-height-dimension
spec: GEOLOCATION; urlPrefix: https://www.w3.org/TR/geolocation/
type: dfn
text: GeolocationPositionError; url: #dom-geolocationpositionerror
text: POSITION_UNAVAILABLE; url: #dom-geolocationpositionerror-position_unavailable
text: set emulated position data; url: #dfn-set-emulated-position-data
spec: HTML; urlPrefix: https://html.spec.whatwg.org/multipage/
type: dfn
Expand Down Expand Up @@ -5623,7 +5625,10 @@ The <dfn export for=commands>emulation.setGeolocationOverride</dfn> command modi
)

emulation.SetGeolocationOverrideParameters = {
coordinates: emulation.GeolocationCoordinates / null,
(
(coordinates: emulation.GeolocationCoordinates / null) //
(error: emulation.GeolocationPositionError)
),
? contexts: [+browsingContext.BrowsingContext],
? userContexts: [+browser.UserContext],
}
Expand All @@ -5637,6 +5642,10 @@ The <dfn export for=commands>emulation.setGeolocationOverride</dfn> command modi
? heading: (0.0...360.0) / null .default null,
? speed: (float .ge 0.0) / null .default null,
}

emulation.GeolocationPositionError = {
type: "positionUnavailable"
}
</pre>
</dd>
<dt>Result Type</dt>
Expand All @@ -5651,9 +5660,26 @@ The <dfn export for=commands>emulation.setGeolocationOverride</dfn> command modi

The [=remote end steps=] with |command parameters| are:

1. If |command parameters| [=map/contains=] "<code>altitudeAccuracy</code>"
and |command parameters| doesn't [=map/contain=] "<code>altitude</code>",
return [=error=] with [=error code=] [=invalid argument=].
1. If |command parameters| [=map/contains=] "<code>coordinates</code>" and
|command parameters|["<code>coordinates</code>"] [=map/contains=]
"<code>altitudeAccuracy</code>" and
|command parameters|["<code>coordinates</code>"] doesn't [=map/contain=]
"<code>altitude</code>", return [=error=] with [=error code=]
[=invalid argument=].

1. If |command parameters| [=map/contains=] "<code>error</code>":

1. Assert |command parameters|["<code>error</code>"]["<code>type</code>"] equals
"<code>positionUnavailable</code>".

1. Let |emulated position data| be a [=/map=] matching [=GeolocationPositionError=]
production, with <code>code</code> field set to [=POSITION_UNAVAILABLE=] and
<code>message</code> field set to the empty string.

Note: <code>message</code> will be ignored by implementation according to the geolocation spec.

1. Otherwise, let |emulated position data| be
|command parameters|["<code>coordinates</code>"].

1. If |command parameters| [=map/contains=] "<code>userContexts</code>"
and |command parameters| [=map/contains=] "<code>context</code>",
Expand All @@ -5675,7 +5701,7 @@ The [=remote end steps=] with |command parameters| are:

1. For each |user context| of |user contexts|:

1. [=map/Set=] [=geolocation overrides map=][|user context|] to |command parameters|["<code>coordinates</code>"].
1. [=map/Set=] [=geolocation overrides map=][|user context|] to |emulated position data|.

1. [=list/For each=] |top-level traversable| of the list of all [=/top-level traversables=]
whose [=associated user context=] is |user context|:
Expand All @@ -5684,7 +5710,7 @@ The [=remote end steps=] with |command parameters| are:

1. For each |navigable| of |navigables|:

1. [=Set emulated position data=] with |navigable| and |command parameters|["<code>coordinates</code>"].
1. [=Set emulated position data=] with |navigable| and |emulated position data|.

1. Return [=success=] with data null.

Expand Down