Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editorial: correct command return values #350

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
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
48 changes: 38 additions & 10 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -2508,7 +2508,9 @@ The [=remote end steps=] with |session| and |command parameters| are:
1. Run the [=remote end subscribe steps=] for the [=event=] with [=event name=]
|event name| given |session|, |contexts| and |include global|.

1. Return [=success=] with data null.
1. Let |body| be a new map.

1. Return [=success=] with data |body|.

</div>

Expand Down Expand Up @@ -2549,7 +2551,9 @@ The [=remote end steps=] with |session| and |command parameters| are:
1. [=Try=] to [=update the event map=] with |session|,
|list of event names|, |list of contexts| and enabled false.

1. Return [=success=] with data null.
1. Let |body| be a new map.

1. Return [=success=] with data |body|.

</div>

Expand Down Expand Up @@ -3005,6 +3009,10 @@ The [=remote end steps=] with |command parameters| are:

1. [=Close=] |context|.

1. Let |body| be a new map.

1. Return [=success=] with data |body|.

Issue(w3c/webdriver-bidi#170): There is an open discussion about the behavior
when closing the last [=top-level browsing context=]. We could expect to close
the browser, close the session or leave this up to the implementation.
Expand Down Expand Up @@ -3225,7 +3233,9 @@ The [=remote end steps=] with <var ignore>session</var> and |command parameters|

Otherwise return [=error=] with [=error code=] [=no such alert=].

1. Return [=success=] with data null.
1. Let |body| be a new map.

1. Return [=success=] with data |body|.

</div>

Expand Down Expand Up @@ -4481,9 +4491,11 @@ The [=remote end steps=] given |session| and |command parameters| are:
1. Set |preload script map|[|script|] to a struct with <code>expression</code>
|expression| and <code>sandbox</code> |sandbox|.

1. Return a new map matching the <code>script.AddPreloadScriptResult</code> with the
1. Let |body| be a new map matching the <code>script.AddPreloadScriptResult</code> with the
<code>script</code> field set to |script|.

1. Return [=success=] with data |body|.

</div>

#### The script.disown Command #### {#command-script-disown}
Expand Down Expand Up @@ -4523,6 +4535,10 @@ The [=remote end steps=] with |command parameters| are:

1. If |handle map| contains |handle id|, remove |handle id| from the |handle map|.

1. Let |body| be a new map.

1. Return [=success=] with data |body|.

</div>

#### The script.callFunction Command #### {#command-script-callFunction}
Expand Down Expand Up @@ -4653,10 +4669,12 @@ The [=remote end steps=] with |command parameters| are:
1. Let |exception details| be the result of [=get exception details=] given
|realm|, |function body evaluation status| and |result ownership|.

1. Return a new map matching the <code>script.EvaluateResultException</code>
1. Let |body| be a new map matching the <code>script.EvaluateResultException</code>
production, with the <code>exceptionDetails</code> field set to
|exception details|.

1. Return [=success=] with data |body|.

1. Let |function object| be |function body evaluation status|.\[[Value]].

1. If [=IsCallable=](|function object|) is <code>false</code>:
Expand All @@ -4681,20 +4699,24 @@ The [=remote end steps=] with |command parameters| are:
1. Let |exception details| be the result of [=get exception details=] given
|realm|, |evaluation status| and |result ownership|.

1. Return a new map matching the <code>script.EvaluateResultException</code>
1. Let |body| be a new map matching the <code>script.EvaluateResultException</code>
production, with the <code>exceptionDetails</code> field set to
|exception details|.

1. Return [=success=] with data |body|.

1. Assert: |evaluation status|.\[[Type]] is <code>normal</code>.

1. Let |result| be the result of [=serialize as a remote value=] given
|evaluation status|.\[[Value]], <code>1</code> as |max depth|, |result
ownership|, <code>new map</code> as |serialization internal map| and |realm|.

1. Return a new map matching the <code>script.EvaluateResultSuccess</code>
1. Let |body| be a new map matching the <code>script.EvaluateResultSuccess</code>
production, with the <code>realm</code> field set to |realm id|,
and the <code>result</code> field set to |result|.

1. Return [=success=] with data |body|.

#### The script.evaluate Command #### {#command-script-evaluate}

The <dfn export for=commands>script.evaluate</dfn> command evaluates a provided
Expand Down Expand Up @@ -4777,20 +4799,24 @@ The [=remote end steps=] with |command parameters| are:
1. Let |exception details| be the result of [=get exception details=] given
|realm|, |evaluation status| and |result ownership|.

1. Return a new map matching the <code>script.EvaluateResultException</code>
1. Let |body| be a new map matching the <code>script.EvaluateResultException</code>
production, with the <code>realm</code> field set to |realm id|, and the
<code>exceptionDetails</code> field set to |exception details|.

1. Return [=success=] with data |body|.

1. Assert: |evaluation status|.\[[Type]] is <code>normal</code>.

1. Let |result| be the result of [=serialize as a remote value=] given
|evaluation status|.\[[Value]], <code>1</code> as |max depth|, |result
ownership|, <code>new map</code> as |serialization internal map| and |realm|.

1. Return a new map matching the <code>script.EvaluateResultSuccess</code>
1. Let |body| be a new map matching the <code>script.EvaluateResultSuccess</code>
production, with the with the <code>realm</code> field set to |realm id|, and
the <code>result</code> field set to |result|.

1. Return [=success=] with data |body|.

#### The script.getRealms Command #### {#command-script-getRealms}

The <dfn export for=commands>script.getRealms</dfn> command returns a list of
Expand Down Expand Up @@ -4917,7 +4943,9 @@ The [=remote end steps=] given |session| and |command parameters| are:

1. <a for=set>Remove</a> |script| from |preload script map|.

1. Return null
1. Let |body| be a new map.

1. Return [=success=] with data |body|.

</div>

Expand Down