Skip to content
Open
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
132 changes: 132 additions & 0 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -5955,6 +5955,7 @@ EmulationCommand = (
emulation.SetScreenOrientationOverride //
emulation.SetScriptingEnabled //
emulation.SetTimezoneOverride //
emulation.SetTouchEventsEnabled //
emulation.SetUserAgentOverride
)

Expand All @@ -5968,6 +5969,7 @@ EmulationResult = (
emulation.SetScreenOrientationOverrideResult /
emulation.SetScriptingEnabledResult /
emulation.SetTimezoneOverrideResult /
emulation.SetTouchEventsEnabledResult /
emulation.SetUserAgentOverrideResult
)
</pre>
Expand All @@ -5981,6 +5983,15 @@ between [=user contexts=] and string, and an [=struct/item=] named
<dfn for="emulated user agent">navigable user agent</dfn>, which is a weak map
between [=navigables=] and string.

A [=BiDi session=] has <dfn for=session>emulated touch events state</dfn> which is a
[=struct=] with
an [=struct/item=] named <dfn for="emulated touch events state">default state</dfn>
which is a boolean or null, initially null;
an [=struct/item=] named <dfn for="emulated touch events state">user context state</dfn>,
which is a weak map between [=user contexts=] and boolean, initially empty;
and an [=struct/item=] named <dfn for="emulated touch events state">navigable state</dfn>,
which is a weak map between [=navigables=] and boolean, initially empty.

A [=remote end=] has a <dfn>forced colors mode theme overrides map</dfn> which is a weak map
between [=user contexts=] and string or null.

Expand Down Expand Up @@ -6911,6 +6922,127 @@ The [=remote end steps=] with |command parameters| are:

</div>

#### The emulation.setTouchEventsEnabled Command #### {#command-emulation-setTouchEventsEnabled}

The <dfn export for=commands>emulation.setTouchEventsEnabled</dfn> command emulates
enabled touch events on web pages.

<dl>
<dt>Command Type</dt>
<dd>
<pre class="cddl" data-cddl-module="remote-cddl">
emulation.SetTouchEventsEnabled = (
method: "emulation.setTouchEventsEnabled",
params: emulation.SetTouchEventsEnabledParameters
)

emulation.SetTouchEventsEnabledParameters = {
enabled: true / null,
? contexts: [+browsingContext.BrowsingContext],
? userContexts: [+browser.UserContext],
}
</pre>
</dd>
<dt>Return Type</dt>
<dd>
<pre class="cddl" data-cddl-module="local-cddl">
emulation.SetTouchEventsEnabledResult = EmptyResult
</pre>
</dd>
</dl>

<div algorithm>
The <dfn export>WebDriver BiDi touch events enabled</dfn> steps given
[=environment settings object=] |environment settings| are:

1. Let |related navigables| be the result of [=get related navigables=] with
|environment settings|.

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

1. Let |top-level navigable| be |navigable|'s [=navigable/top-level traversable=].

1. Let |user context| be |top-level navigable|'s [=associated user context=].

1. For each |session| in [=active BiDi sessions=]:

1. If |session|'s [=session/emulated touch events state=]'s
[=emulated touch events state/navigable state=] contains
|top-level navigable|, return |session|'s
[=session/emulated touch events state=]'s
[=emulated touch events state/navigable state=][|top-level navigable|].

1. For each |session| in [=active BiDi sessions=]:

1. If |session|'s [=session/emulated touch events state=]'s
[=emulated touch events state/user context state=] contains |user context|,
return |session|'s [=session/emulated touch events state=]'s
[=emulated touch events state/user context state=][|user context|].

1. For each |session| in [=active BiDi sessions=]:

1. Let |emulated touch events state| be |session|'s
[=session/emulated touch events state=]'s
[=emulated touch events state/default state=].

1. If |emulated touch events state| is not null, return
|emulated touch events state|.

1. Return null.

</div>

<div algorithm="remote end steps for emulation.setTouchEventsEnabled">

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

1. If |command parameters| [=map/contains=] "<code>userContexts</code>" and
|command parameters| [=map/contains=] "<code>contexts</code>", return [=error=]
with [=error code=] [=invalid argument=].

1. Let |enabled| be |command parameters|["<code>enabled</code>"].

1. If the <code>contexts</code> 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|["<code>contexts</code>"].

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

1. If |enabled| is null, [=map/remove=] |navigable| from |session|'s
[=session/emulated touch events state=]'s
[=emulated touch events state/navigable state=].

1. Otherwise, [=map/set=] |session|'s [=session/emulated touch events state=]'s
[=emulated touch events state/navigable state=][|navigable|] to |enabled|.

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

1. If the <code>userContexts</code> field of |command parameters| is present:

1. Let |user contexts| be the result of [=trying=] to [=get valid user contexts=]
with |command parameters|["<code>userContexts</code>"].

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

1. If |enabled| is null, [=map/remove=] |user context| from |session|'s
[=session/emulated touch events state=]'s
[=emulated touch events state/user context state=].

1. Otherwise [=map/set=] |session|'s [=session/emulated touch events state=]'s
[=emulated touch events state/user context state=][|user context|] to
|enabled|.

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

1. Set |session|'s [=session/emulated touch events state=]'s
[=emulated touch events state/default state=] to |enabled|.

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

</div>

## The network Module ## {#module-network}

The <dfn export for=modules>network</dfn> module contains commands and events
Expand Down