Skip to content

Commit 5ce7a32

Browse files
feat: restore emulated geolocation data per user context after per context is removed (#1026)
Follow up after #1001 Align geolocation and screen orientation logic with other emulations. Scenario: 1. Set some emulation per user context. 1. Set another emulation per browsing context. 1. Remove emulation per browsing context. Current behavior: 1. All emulations are removed from some emulation per user context New behavior, aligned with other emulation's methods: 1. Some emulation per user context is still applied.
1 parent dbac244 commit 5ce7a32

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

index.bs

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6170,7 +6170,11 @@ The [=remote end steps=] with |command parameters| are:
61706170

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

6173-
1. [=map/Set=] [=geolocation overrides map=][|user context|] to |emulated position data|.
6173+
1. If |emulated position data| is null, remove the |user context| from
6174+
[=geolocation overrides map=].
6175+
6176+
1. Otherwise, [=map/set=] [=geolocation overrides map=][|user context|] to
6177+
|emulated position data|.
61746178

61756179
1. [=list/For each=] |top-level traversable| of the list of all [=/top-level traversables=]
61766180
whose [=associated user context=] is |user context|:
@@ -6179,7 +6183,13 @@ The [=remote end steps=] with |command parameters| are:
61796183

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

6182-
1. [=Set emulated position data=] with |navigable| and |emulated position data|.
6186+
1. Let |user context| be |navigable|'s [=associated user context=].
6187+
6188+
1. If |emulated position data| is null and [=geolocation overrides map=] [=map/contains=]
6189+
|user context|, [=set emulated position data=] with |navigable| and
6190+
[=geolocation overrides map=][|user context|].
6191+
6192+
1. Otherwise, [=set emulated position data=] with |navigable| and |emulated position data|.
61836193

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

@@ -6541,7 +6551,10 @@ The [=remote end steps=] with |command parameters| are:
65416551

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

6544-
1. [=map/Set=] [=screen orientation overrides map=][|user context|] to
6554+
1. If |emulated screen orientation| is null, [=map/remove=] |user context| from
6555+
[=screen orientation overrides map=].
6556+
6557+
1. Otherwise, [=map/set=] [=screen orientation overrides map=][|user context|] to
65456558
|emulated screen orientation|.
65466559

65476560
1. [=list/For each=] |top-level traversable| of the list of all
@@ -6552,7 +6565,13 @@ The [=remote end steps=] with |command parameters| are:
65526565

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

6555-
1. [=Set emulated screen orientation=] with |navigable| and
6568+
1. Let |user context| be |navigable|'s [=associated user context=].
6569+
6570+
1. If |emulated screen orientation| is null and [=screen orientation overrides map=]
6571+
[=map/contains=] |user context|, [=set emulated screen orientation=] with |navigable| and
6572+
[=screen orientation overrides map=][|user context|].
6573+
6574+
1. Otherwise, [=set emulated screen orientation=] with |navigable| and
65566575
|emulated screen orientation|.
65576576

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

0 commit comments

Comments
 (0)