Skip to content

Commit

Permalink
Define the browsingContext.close command
Browse files Browse the repository at this point in the history
Fixes w3c#170.
  • Loading branch information
juliandescottes committed Feb 5, 2022
1 parent 8b12b43 commit fa75c27
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ spec: WEBDRIVER; urlPrefix: https://w3c.github.io/webdriver/
text: error code; url: dfn-error-code
text: error; url: dfn-errors
text: getting a property; url: dfn-get-a-property
text: handle any user prompts; url: dfn-handle-any-user-prompts
text: http session; url: dfn-http-session
text: intermediary node; url: dfn-intermediary-node
text: invalid argument; url: dfn-invalid-argument
Expand Down Expand Up @@ -122,6 +123,7 @@ spec: ECMASCRIPT; urlPrefix: https://tc39.es/ecma262/
spec: HTML; urlPrefix: https://html.spec.whatwg.org/multipage/
type: dfn
text: a browsing context is discarded; url: window-object.html#a-browsing-context-is-discarded
text: close; url: window-object.html#close-a-browsing-context
text: create a classic script; url: webappapis.html#creating-a-classic-script
text: create a new browsing context; url: browsers.html#creating-a-new-browsing-context
text: default classic script fetch options; url: webappapis.html#default-classic-script-fetch-options
Expand Down Expand Up @@ -2270,6 +2272,7 @@ navigation status</dfn> struct, which has the following items:
<pre class="cddl remote-cddl">

BrowsingContextCommand = (
BrowsingContextCloseCommand //
BrowsingContextCreateCommand //
BrowsingContextGetTreeCommand //
BrowsingContextNavigateCommand //
Expand Down Expand Up @@ -2536,6 +2539,45 @@ To <dfn>get the navigation info</dfn>, given |context| and |navigation status|:

### Commands ### {#module-browsingContext-commands}

#### The browsingContext.close Command #### {#command-browsingContext-close}

The <dfn export for=commands>browsingContext.close</dfn> command closes a
[=top-level browsing context=].

<dl>
<dt>Command Type</dt>
<dd>
<pre class="cddl remote-cddl">
BrowsingContextCloseCommand = {
method: "browsingContext.close",
params: BrowsingContextCloseParameters
}

BrowsingContextCloseParameters = {
context: BrowsingContext
}
</pre>
</dd>
</dl>

<div algorithm="remote end steps for browsingContext.close">
The [=remote end steps=] with |command parameters| are:

1. Let |context id| be the value of the <code>context</code> field of
|command parameters|.

1. Let |context| be the result of [=trying=] to [=get a browsing context=]
with |context id|.

1. Assert: |context| is not null.

1. If |context| is not a [=top-level browsing context=], return [=error=] with
[=error code=] [=invalid argument=].

1. [=Close=] |context|.

</div>

#### The browsingContext.create Command #### {#command-browsingContext-create}

The <dfn export for=commands>browsingContext.create</dfn> command creates a new
Expand Down

0 comments on commit fa75c27

Please sign in to comment.