diff --git a/index.bs b/index.bs index 785497f7d..7e6f12cd7 100644 --- a/index.bs +++ b/index.bs @@ -234,9 +234,9 @@ protocol. These terms are distinct from their representation at the The protocol is defined using a [[!RFC8610|CDDL]] definition. For the convenience of implementors two separate CDDL definitions are defined; the remote end definition which defines the format of messages produced -on the [=local end=] and consumed on the [=remote end=], and the local end -definition which defines the format of messages produced on the [=remote -end=] and consumed on the [=local end=] +on the [=local end=] and consumed on the [=remote end=], and the +local end definition which defines the format of messages produced on the +[=remote end=] and consumed on the [=local end=] ## Definition ## {#protocol-definition} @@ -377,8 +377,8 @@ An implementation may define extension modules. These must have a [=module name=] that contains a single colon ":" character. The part before the colon is the prefix; this is typically the same for all extension modules specific to a given implementation and should be unique for a -given implementation. Such modules extend the [=local end definition=] and [=remote -end definition=] providing additional groups as choices for the defined +given implementation. Such modules extend the [=local end definition=] and +[=remote end definition=] providing additional groups as choices for the defined [=commands=] and [=events=]. ## Commands ## {#commands} @@ -391,23 +391,22 @@ long-running. As a consequence, commands can finish out-of-order. Each [=command=] is defined by: -- A command type which is defined by a [=remote - end definition=] fragment containing a group. Each such group has two fields: - - method which is a string literal of the form [module - name].[method name]. This is the command - name. +- A command type which is defined by a + [=remote end definition=] fragment containing a group. Each such group has two fields: + - method which is a string literal of the form + [module name].[method name]. This is the + command name. - params which defines a mapping containing data that to be passed into the command. The populated value of this map is the command parameters. -- A result type, which is defined by a [=local - end definition=] fragment. +- A result type, which is defined by a + [=local end definition=] fragment. - A set of [=remote end steps=] which define the actions to take for a command given a [=BiDi session=] and [=command parameters=] and return an instance of the command [=result type=]. -A command that can run without an active session is a static -command. Commands are not static commands unless stated in their -definition. +A command that can run without an active session is a static command. +Commands are not static commands unless stated in their definition. When commands are sent from the [=local end=] they have a command id. This is an identifier used by the [=local end=] to identify the response from a particular @@ -415,28 +414,28 @@ command. From the point of view of the [=remote end=] this identifier is opaque and cannot be used internally to identify the command. Note: This is because the command id is entirely controlled by the [=local end=] -and isn't necessarily unique over the course of a session. For example a [=local -end=] which ignores all responses could use the same command id for each command. +and isn't necessarily unique over the course of a session. For example a +[=local end=] which ignores all responses could use the same command id for each +command. The set of all command names is a set containing -all the defined [=command names=], including any belonging to [=extension -modules=]. +all the defined [=command names=], including any belonging to [=extension modules=]. ## Events ## {#events} -An event is a notification, sent by the [=remote -end=] to the [=local end=], signaling that something of interest has -occurred on the [=remote end=]. +An event is a notification, sent by the [=remote end=] to the +[=local end=], signaling that something of interest has occurred on the +[=remote end=]. - - An event type is defined by a [=local - end definition=] fragment containing a group. Each such group has two fields: - - method which is a string literal of the form [module - name].[event name]. This is the event - name. + - An event type is defined by a [=local end definition=] + fragment containing a group. Each such group has two fields: + - method which is a string literal of the form + [module name].[event name]. This is the + event name. - params which defines a mapping containing event data. The - populated value of this map is the event - parameters. + populated value of this map is the + event parameters. - A remote end event trigger which defines when the event is triggered and steps to construct the [=event type=] data. - Optionally, a set of remote end subscribe steps, which define @@ -450,10 +449,9 @@ which is a set containing the event names for events that are enabled for all browsing contexts. This initially contains the [=event name=] for events that are in the default event set. -A [=BiDi session=] has a browsing context event -map, which is a map with [=/top-level browsing context=] keys and values -that are a set of [=event name=]s for events that are enabled in the given -browsing context. +A [=BiDi session=] has a browsing context event map, +which is a map with [=/top-level browsing context=] keys and values that are a set of +[=event name=]s for events that are enabled in the given browsing context.
@@ -548,17 +546,16 @@ Message transport is provided using the WebSocket protocol. Note: In the terms of the WebSocket protocol, the [=local end=] is the client and the [=remote end=] is the server / remote host. -Note: The encoding of [=commands=] and [=events=] as messages is -similar to JSON-RPC, but this specification does not normatively -reference it. [[JSON-RPC]] The normative requirements on [=remote -ends=] are instead given as a precise processing model, while no -normative requirements are given for [=local ends=]. +Note: The encoding of [=commands=] and [=events=] as messages is similar to JSON-RPC, +but this specification does not normatively reference it. [[JSON-RPC]] The normative +requirements on [=remote ends=] are instead given as a precise processing model, +while no normative requirements are given for [=local ends=]. A WebSocket listener is a network endpoint that is able to accept incoming [[!RFC6455|WebSocket]] connections. -A [=WebSocket listener=] has a host, a port, a secure flag, and a +A [=WebSocket listener=] has a host, a +port, a secure flag, and a list of WebSocket resources. When a [=WebSocket listener=] |listener| is created, a [=remote end=] @@ -567,48 +564,45 @@ given by |listener|'s [=listener/host=] and [=listener/port=]. If |listener|'s [=listener/secure flag=] is set, then connections established from |listener| must be TLS encrypted. -A [=remote end=] has a [=set=] of [=WebSocket listeners=] active -listeners, which is initially empty. +A [=remote end=] has a [=set=] of [=WebSocket listeners=] +active listeners, which is initially empty. -A [=remote end=] has a [=set=] of WebSocket connections not associated with a -session, which is initially empty. +A [=remote end=] has a [=set=] of +WebSocket connections not associated with a session, which is initially +empty. A WebSocket connection is a network connection that follows the requirements of the [[!RFC6455|WebSocket protocol]] -A [=BiDi session=] has a set of session WebSocket -connections whose elements are [=WebSocket connections=]. This is -initially empty. +A [=BiDi session=] has a set of session WebSocket connections whose +elements are [=WebSocket connections=]. This is initially empty. A [=BiDi session=] |session| is associated with connection |connection| if |session|'s [=session WebSocket connections=] contains |connection|. -Note: Each [=WebSocket connection=] is associated with at most one [=BiDi -session=]. +Note: Each [=WebSocket connection=] is associated with at most one [=BiDi session=].
-When a client [=establishes a WebSocket connection=] |connection| by -connecting to one of the set of [=active listeners=] |listener|, the -implementation must proceed according to the WebSocket [=server-side -requirements=], with the following steps run when deciding whether to -accept the incoming connection: +When a client [=establishes a WebSocket connection=] |connection| by connecting to +one of the set of [=active listeners=] |listener|, the implementation must proceed +according to the WebSocket [=server-side requirements=], with the following steps run +when deciding whether to accept the incoming connection: -1. Let |resource name| be the resource name from [=reading the - client's opening handshake=]. If |resource name| is not in - |listener|'s [=list of WebSocket resources=], then stop - running these steps and act as if the requested service is not - available. +1. Let |resource name| be the resource name from + [=reading the client's opening handshake=]. If |resource name| is not in + |listener|'s [=list of WebSocket resources=], then stop running these steps and + act as if the requested service is not available. 1. If |resource name| is the byte string "/session", and the implementation [=supports BiDi-only sessions=]: - 1. Run any other implementation-defined steps to decide if the - connection should be accepted, and if it is not stop running these - steps and act as if the requested service is not available. + 1. Run any other implementation-defined steps to decide if the connection should + be accepted, and if it is not stop running these steps and act as if the + requested service is not available. - 1. Add the connection to the set of [=WebSocket connections not associated - with a session=]. + 1. Add the connection to the set of + [=WebSocket connections not associated with a session=]. 1. Return. @@ -626,31 +620,28 @@ accept the incoming connection: connection should be accepted, and if it is not stop running these steps and act as if the requested service is not available. -1. Otherwise append |connection| to |session|'s [=session WebSocket - connections=], and proceed with the WebSocket [=server-side requirements=] +1. Otherwise append |connection| to |session|'s [=session WebSocket connections=], + and proceed with the WebSocket [=server-side requirements=] when a server chooses to accept an incoming connection. Issue: Do we support > 1 connection for a single session?
-When [=a WebSocket message has been received=] for a [=WebSocket -connection=] |connection| with type |type| and data |data|, a [=remote -end=] must [=handle an incoming message=] given |connection|, |type| -and |data|. +When [=a WebSocket message has been received=] for a [=WebSocket connection=] +|connection| with type |type| and data |data|, a [=remote end=] must +[=handle an incoming message=] given |connection|, |type| and |data|. -When [=the WebSocket closing handshake is started=] or when [=the -WebSocket connection is closed=] for a [=WebSocket connection=] -|connection|, a [=remote end=] must [=handle a connection closing=] -given |connection|. +When [=the WebSocket closing handshake is started=] or when +[=the WebSocket connection is closed=] for a [=WebSocket connection=] |connection|, a +[=remote end=] must [=handle a connection closing=] given |connection|. Note: Both conditions are needed because it is possible for a WebSocket connection to be closed without a closing handshake.
-To construct a WebSocket resource name +To construct a WebSocket resource name given a [=/session=] |session|: 1. If |session| is null, return "/session" @@ -662,12 +653,11 @@ given a [=/session=] |session|:
-To construct a WebSocket URL given a [=WebSocket listener=] +To construct a WebSocket URL given a [=WebSocket listener=] |listener| and [=/session=] |session|: -1. Let |resource name| be the result of [=constructing a WebSocket - resource name=] given |session|. +1. Let |resource name| be the result of [=constructing a WebSocket resource name=] + given |session|. 1. Return a [=WebSocket URI=] constructed with host set to |listener|'s [=listener/host=], port set to |listener|'s @@ -706,14 +696,13 @@ To start listening for a WebSocket connection given a [=listener/host=], [=listener/port=], [=listener/secure flag=], and an empty [=list of WebSocket resources=]. -1. Let |resource name| be the result of [=constructing a WebSocket - resource name=] given |session|. +1. Let |resource name| be the result of [=constructing a WebSocket resource name=] + given |session|. 1. Append |resource name| to the [=list of WebSocket resources=] for |listener|. -1. [=set/Append=] |listener| to the [=remote end=]'s [=active - listeners=]. +1. [=set/Append=] |listener| to the [=remote end=]'s [=active listeners=]. 1. Return |listener|. @@ -731,14 +720,12 @@ typically be "localhost". To handle an incoming message given a [=WebSocket connection=] |connection|, type |type| and data |data|: -1. If |type| is not [=%x1 denotes a text frame|text=], [=send an error - response=] given |connection|, null, and [=invalid argument=], and finally - return. +1. If |type| is not [=%x1 denotes a text frame|text=], [=send an error response=] + given |connection|, null, and [=invalid argument=], and finally return. -1. [=Assert=]: |data| is a [=scalar value string=], because the - WebSocket [=handling errors in UTF-8-encoded data=] would already - have [=fail the WebSocket connection|failed the WebSocket - connection=] otherwise. +1. [=Assert=]: |data| is a [=scalar value string=], because the WebSocket + [=handling errors in UTF-8-encoded data=] would already have + [=fail the WebSocket connection|failed the WebSocket connection=] otherwise. Issue: Nothing seems to define what [=status codes|status code=] is used for UTF-8 errors. @@ -748,10 +735,10 @@ To handle an incoming message given a [=WebSocket connection=] [=WebSocket connections not associated with a session=], let |session| be null. Otherwise, return. -1. Let |parsed| be the result of [=parse JSON into Infra values|parsing JSON - into Infra values=] given |data|. If this throws an exception, then [=send - an error response=] given |connection|, null, and [=invalid argument=], and - finally return. +1. Let |parsed| be the result of + [=parse JSON into Infra values|parsing JSON into Infra values=] given |data|. If + this throws an exception, then [=send an error response=] given |connection|, + null, and [=invalid argument=], and finally return. 1. Match |parsed| against the [=remote end definition=]. If this results in a match: @@ -768,8 +755,8 @@ To handle an incoming message given a [=WebSocket connection=] 1. Let |command| be the command with [=command name=] |method|. 1. If |session| is null and |command| is not a [=static command=], then - [=send an error response=] given |connection|, |command id|, and [=invalid - session id=], and return. + [=send an error response=] given |connection|, |command id|, and + [=invalid session id=], and return. 1. Run the following steps in parallel: @@ -797,8 +784,7 @@ To handle an incoming message given a [=WebSocket connection=] field set to |command id| and the value field set to |value|. - 1. Let |serialized| be the result of [=serialize an infra value to JSON - bytes=] given |response|. + 1. Let |serialized| be the result of [=serialize an infra value to JSON bytes=] given |response|. 1. [=Send a WebSocket message=] comprised of |serialized| over |connection|. @@ -813,8 +799,8 @@ To handle an incoming message given a [=WebSocket connection=] 1. Let |error code| be [=invalid argument=]. 1. If |parsed| is a map and |parsed|["method"] exists and is a - string, but |parsed|["method"] is not in the [=set of all - command names=], set |error code| to [=unknown command=]. + string, but |parsed|["method"] is not in the + [=set of all command names=], set |error code| to [=unknown command=]. 1. [=Send an error response=] given |connection|, |command id|, and |error code|. @@ -850,8 +836,8 @@ To get related browsing contexts given an [=script/settings object=] 1. If |connection| is null, return. -1. Let |serialized| be the result of [=serialize an infra value to JSON - bytes=] given |body|. +1. Let |serialized| be the result of [=serialize an infra value to JSON bytes=] + given |body|. 1. [=Send a WebSocket message=] comprised of |serialized| over |connection|. @@ -891,8 +877,7 @@ To handle a connection closing given a [=WebSocket connection=] 1. Let |session| be the [=BiDi session=] [=associated with connection=] |connection|. - 1. Remove |connection| from |session|'s [=session WebSocket - connections=]. + 1. Remove |connection| from |session|'s [=session WebSocket connections=]. 1. Otherwise, if the set of [=WebSocket connections not associated with a session=] contains |connection|, remove |connection| from that set. @@ -947,11 +932,11 @@ with parameters |session|, |capabilities|, and |flags| is: 1. [=Assert=]: |webSocketUrl| is true. -1. Let |listener| be the result of [=start listening for a WebSocket - connection=] given |session|. +1. Let |listener| be the result of [=start listening for a WebSocket connection=] + given |session|. -1. Set |webSocketUrl| to the result of [=constructing a WebSocket - URL=] given |listener| and |session|. +1. Set |webSocketUrl| to the result of [=constructing a WebSocket URL=] given + |listener| and |session|. 1. [=Set a property=] on |capabilities| named "webSocketUrl" to |webSocketUrl|. @@ -966,9 +951,9 @@ with parameters |session|, |capabilities|, and |flags| is: Implementations should also allow clients to establish a [=BiDi Session=] which is not a [=HTTP Session=]. In this case the URL to the WebSocket server is -communicated out-of-band. An implementation that allows this supports -BiDi-only sessions. At the time such an implementation is ready to accept -requests to start a WebDriver session, it must: +communicated out-of-band. An implementation that allows this +supports BiDi-only sessions. At the time such an implementation is ready +to accept requests to start a WebDriver session, it must: 1. [=Start listening for a WebSocket connection=] given null. @@ -1016,8 +1001,8 @@ To get or create a sandbox realm given |name| and |browsing context|: 1. Let |sandboxes| be [=sandbox map=][|window|]. -1. If |sandboxes| does not contain |name|, set |sandboxes|[|name|] to [=create - a sandbox realm=] with |browsing context|. +1. If |sandboxes| does not contain |name|, set |sandboxes|[|name|] to + [=create a sandbox realm=] with |browsing context|. 1. Return [=success=] with data |sandboxes|[|name|]. @@ -2138,16 +2123,17 @@ events are disabled, the return value is always empty. 1. If |global event set| doesn't contain |event name|: - 1. Let |already enabled contexts| be the [=event enabled browsing - contexts=] given |session| and |event name| + 1. Let |already enabled contexts| be the + [=event enabled browsing contexts=] given |session| and |event name| 1. Add |event name| to |global event set|. 1. For each |context| of |already enabled contexts|, remove |event name| from |event map|[|context|]. - 1. Let |newly enabled contexts| be a list of all [=top-level browsing - contexts=] that are not contained in |already enabled contexts|, + 1. Let |newly enabled contexts| be a list of all + [=top-level browsing contexts=] that are not contained in + |already enabled contexts|, 1. Set |enabled events|[|event name|] to |newly enabled contexts|. @@ -2193,8 +2179,8 @@ events are disabled, the return value is always empty. 1. If |enabled| is false: 1. If |target| contains |event name|, remove |event name| from - |target|. Otherwise return [=error=] with [=error code=] [=invalid - argument=]. + |target|. Otherwise return [=error=] with [=error code=] + [=invalid argument=]. 1. Set the [=global event set=] for |session| to |global event set|. @@ -2274,8 +2260,8 @@ This is a [=static command=].
-The [=remote end steps=] given session, and command parameters are: +The [=remote end steps=] given session, and +command parameters are: 1. Let |body| be a new [=map=] with the following properties: @@ -2421,8 +2407,9 @@ The [=remote end steps=] with |session| and |command parameters| are: 1. For each |event name| → |contexts| in |enabled events|: - 1. If the [=event=] with [=event name=] |event name| defines [=remote end - subscribe steps=], set |subscribe step events|[|event name|] to |contexts|. + 1. If the [=event=] with [=event name=] |event name| defines + [=remote end subscribe steps=], set |subscribe step events|[|event name|] to + |contexts|. 1. [=map/Sort in ascending order=] |subscribe step events| using the following less than algorithm given two entries with keys |event name one| and |event @@ -2494,8 +2481,8 @@ The [=remote end steps=] with |session| and |command parameters| are: The browsingContext module contains commands and events relating to browsing contexts. -The progress of navigation is communicated using an immutable WebDriver -navigation status struct, which has the following items: +The progress of navigation is communicated using an immutable +WebDriver navigation status struct, which has the following items:
id
@@ -2564,11 +2551,11 @@ BrowsingContextEvent = ( BrowsingContext = text; -Each [=/browsing context=] has an associated browsing context -id, which is a string uniquely identifying that browsing context. This is -implicitly set when the context is created. For browsing contexts with an -associated WebDriver [=window handle=] the [=/browsing context id=] must be the -same as the [=window handle=]. +Each [=/browsing context=] has an associated browsing context id, +which is a string uniquely identifying that browsing context. This is implicitly set +when the context is created. For browsing contexts with an associated WebDriver +[=window handle=] the [=/browsing context id=] must be the same as the +[=window handle=].
To get a browsing context given |context id|: @@ -2605,8 +2592,8 @@ browsing context.
To get the parent browsing context given |browsing context|: -1. Let |navigable| be the [=navigable=] whose [=navigable/active - document=] is |browsing context|'s [=browsing context/active document=]. +1. Let |navigable| be the [=navigable=] whose [=navigable/active document=] is + |browsing context|'s [=browsing context/active document=]. 1. Let |parent navigable| be |navigable|'s [=navigable/parent=]. @@ -2621,8 +2608,8 @@ To get the child browsing contexts given |browsing context|: TODO: make this return a list in document order -1. Let |navigable| be the [=navigable=] whose [=navigable/active - document=] is |browsing context|'s [=browsing context/active document=]. +1. Let |navigable| be the [=navigable=] whose [=navigable/active document=] is + |browsing context|'s [=browsing context/active document=]. 1. Let |child navigables| be a set containing all navigables that are a [=child navigable=] of |navigable|. @@ -2645,8 +2632,8 @@ To get the browsing context info given |context|, 1. Let |context id| be the [=browsing context id=] for |context|. -1. Let |parent browsing context| be [=get the parent browsing - context=] given |context|. +1. Let |parent browsing context| be [=get the parent browsing context=] given + |context|. 1. If |parent browsing context| is not null let |parent id| be the [=browsing context id=] of |parent browsing context|. Otherwise let @@ -2693,14 +2680,14 @@ To await a navigation given |context|, |request|, |wait condition|, a 1. Let |navigation id| be the string representation of a [[!RFC4122|UUID]] based on truly random, or pseudo-random numbers. -1. Let |navigable| be the [=navigable=] whose [=navigable/active - document=] is |context|'s [=browsing context/active document=]. +1. Let |navigable| be the [=navigable=] whose [=navigable/active document=] is + |context|'s [=browsing context/active document=]. -1. [=Navigate=] |navigable| with resource |request|, and using - |context|'s [=browsing context/active document=] as the source - {{Document}}, with [=navigation id=] |navigation id|, and [=history - handling behavior=] |history handling|. If |ignore cache| is true, - the navigation must not load resources from the HTTP cache. +1. [=Navigate=] |navigable| with resource |request|, and using |context|'s + [=browsing context/active document=] as the source {{Document}}, with + [=navigation id=] |navigation id|, and [=history handling behavior=] + |history handling|. If |ignore cache| is true, the navigation must not load + resources from the HTTP cache. Issue: property specify how the |ignore cache| flag works. This needs to consider whether only the first load of a resource bypasses the cache @@ -2865,19 +2852,19 @@ The [=remote end steps=] with session and |command parameters| 1. Let |document| be |context|'s [=active document=]. -1. Immediately after the next invocation of the [=run the animation frame - callbacks=] algorithm for |document|: +1. Immediately after the next invocation of the [=run the animation frame callbacks=] + algorithm for |document|: Issue: This ought to be integrated into the update rendering algorithm in some more explicit way. 1. Let |root rect| be |document|’s [=document element=]'s [=rectangle=]. - 1. Let |canvas| be the result of [=trying=] to [=draw a bounding box from the - framebuffer=] with |root rect|. + 1. Let |canvas| be the result of [=trying=] to + [=draw a bounding box from the framebuffer=] with |root rect|. - 1. Let |encoding result| be the result of [=trying=] to [=encode a canvas as - Base64=] with |canvas|. + 1. Let |encoding result| be the result of [=trying=] to + [=encode a canvas as Base64=] with |canvas|. 1. Let |body| be a [=map=] matching the BrowsingContextCaptureScreenshotResult production, with the @@ -2989,9 +2976,8 @@ The [=remote end steps=] with |command parameters| are: - 1. Create a new [=top-level browsing context=] by running the [=window open - steps=] with url set to "about:blank", - target set to the empty string, and + 1. Create a new [=top-level browsing context=] by running the [=window open steps=] + with url set to "about:blank", target set to the empty string, and features set to "noopener". This must be done without invoking the [=/focusing steps=] for the created browsing context. Which OS window the new [=/browsing context=] is created in @@ -3143,9 +3129,9 @@ The [=remote end steps=] with session and |command parameters| [=prompt=], then respond with the string value |text| if |accept| is true, or abort if |accept| is false. - Otherwise, if |context| is currently showing a prompt as part of the [=prompt - to unload=] steps, then confirm the navigation if |accept| is true, otherwise - refuse the navigation. + Otherwise, if |context| is currently showing a prompt as part of the + [=prompt to unload=] steps, then confirm the navigation if |accept| is true, + otherwise refuse the navigation. Otherwise return [=error=] with [=error code=] [=no such alert=]. @@ -3211,8 +3197,8 @@ The [=remote end steps=] with session and |command parameters| 1. Let |url record| be the result of applying the [=URL parser=] to |url|, with [=base URL=] |base|. -1. If |url record| is failure, return [=error=] with [=error code=] [=invalid - argument=]. +1. If |url record| is failure, return [=error=] with [=error code=] + [=invalid argument=]. 1. Let |request| be a new [=/request=] whose URL is |url record|. @@ -3407,8 +3393,9 @@ become inaccessible but not yet get discarded because bfcache.
-The [=remote end event trigger=] is the WebDriver BiDi navigation -started steps given |context| and |navigation status|: +The [=remote end event trigger=] is the +WebDriver BiDi navigation started steps given |context| and +|navigation status|: 1. Let |params| be the result of [=get the navigation info=] given |context| and |navigation status|. @@ -3446,8 +3433,9 @@ started steps given |context| and |navigation status|:
-The [=remote end event trigger=] is the WebDriver BiDi fragment -navigated steps given |context| and |navigation status|: +The [=remote end event trigger=] is the +WebDriver BiDi fragment navigated steps given |context| and +|navigation status|: 1. Let |params| be the result of [=get the navigation info=] given |context| and |navigation status|. @@ -3485,8 +3473,9 @@ navigated steps given |context| and |navigation status|:
-The [=remote end event trigger=] is the WebDriver BiDi DOM content -loaded steps given |context| and |navigation status|: +The [=remote end event trigger=] is the +WebDriver BiDi DOM content loaded steps given |context| and +|navigation status|: 1. Let |params| be the result of [=get the navigation info=] given |context| and |navigation status|. @@ -3524,8 +3513,9 @@ loaded steps given |context| and |navigation status|:
-The [=remote end event trigger=] is the WebDriver BiDi load -complete steps given |context| and |navigation status|: +The [=remote end event trigger=] is the +WebDriver BiDi load complete steps given |context| and +|navigation status|: 1. Let |params| be the result of [=get the navigation info=] given |context| and |navigation status|. @@ -3562,8 +3552,9 @@ complete steps given |context| and |navigation status|:
-The [=remote end event trigger=] is the WebDriver BiDi download -started steps given |context| and |navigation status|: +The [=remote end event trigger=] is the +WebDriver BiDi download started steps given |context| and +|navigation status|: 1. Let |params| be the result of [=get the navigation info=] given |context| and |navigation status|. @@ -3600,8 +3591,9 @@ started steps given |context| and |navigation status|:
-The [=remote end event trigger=] is the WebDriver BiDi navigation -aborted steps given |context| and |navigation status|: +The [=remote end event trigger=] is the +WebDriver BiDi navigation aborted steps given |context| and +|navigation status|: 1. Let |params| be the result of [=get the navigation info=] given |context| and |navigation status|. @@ -3639,8 +3631,9 @@ aborted steps given |context| and |navigation status|:
-The [=remote end event trigger=] is the WebDriver BiDi navigation -failed steps given |context| and |navigation status|: +The [=remote end event trigger=] is the +WebDriver BiDi navigation failed steps given |context| and +|navigation status|: 1. Let |params| be the result of [=get the navigation info=] given |context| and |navigation status|. @@ -3683,9 +3676,9 @@ failed steps given |context| and |navigation status|:
-The [=remote end event trigger=] is the WebDriver BiDi user prompt -closed steps given |window|, |accepted| and optional |user text| -(default: null). +The [=remote end event trigger=] is the +WebDriver BiDi user prompt closed steps given |window|, |accepted| +and optional |user text| (default: null). 1. Let |context| be |window|'s [=/browsing context=]. @@ -3730,8 +3723,9 @@ closed steps given |window|, |accepted| and optional |user text|
-The [=remote end event trigger=] is the WebDriver BiDi user prompt -opened steps given |window|, |type| and |message|. +The [=remote end event trigger=] is the +WebDriver BiDi user prompt opened steps given |window|, |type| and +|message|. 1. Let |context| be |window|'s [=/browsing context=]. @@ -4084,11 +4078,11 @@ Note: The details of how to get a list of stack frames, and the properties of that list are underspecified, and therefore the details here are implementation defined. -It is assumed that an implementation is able to generate a list of stack -frames, which is a list with one entry for each item in the javascript -call stack, starting from the most recent. Each entry is a single stack -frame corresponding to execution of a statement or expression in a script -|script|, which contains the following fields: +It is assumed that an implementation is able to generate a +list of stack frames, which is a list with one entry for each item in the +javascript call stack, starting from the most recent. Each entry is a single +stack frame corresponding to execution of a statement or expression in a +script |script|, which contains the following fields:
script url @@ -4118,8 +4112,8 @@ To construct a stack trace, with a list of stack frames |stack|: 1. Let |frame info| be a new map matching the StackFrame production, with the url field set to |url|, the functionName field set to |frame|'s [=stackframe/function=], - the lineNumber field set to |frame|'s [=stackframe/line - number=] and the columnNumber field set to |frame|'s + the lineNumber field set to |frame|'s [=stackframe/line number=] + and the columnNumber field set to |frame|'s [=stackframe/column number=]. 1. Append |frame info| to |call frames|. @@ -4132,13 +4126,13 @@ To construct a stack trace, with a list of stack frames |stack|:
The current stack trace is the result of [=construct a stack trace=] -given a [=list of stack frames=] representing the callstack of the [=running -execution context=]. +given a [=list of stack frames=] representing the callstack of the +[=running execution context=].
-The stack trace for an exception with an exception, or a [=Completion -Record=] of type throw, |exception|, is given by: +The stack trace for an exception with an exception, or a +[=Completion Record=] of type throw, |exception|, is given by: 1. If |exception| is a value that has been thrown as an exception, let |record| be the [=Completion Record=] created to throw |exception|. Otherwise let @@ -4704,21 +4698,20 @@ The [=remote end event trigger=] is:
-When any of the [=set up a window environment settings object=], [=set up a -worker environment settings object=] or [=set up a worklet environment settings -object=] algorithms are invoked, immediately prior to returning the settings -object: +When any of the [=set up a window environment settings object=], +[=set up a worker environment settings object=] or +[=set up a worklet environment settings object=] algorithms are invoked, immediately +prior to returning the settings object: -1. Let |environment settings| be the newly created [=environment settings - object=]. +1. Let |environment settings| be the newly created [=environment settings object=]. 1. Let |realm info| be the result of [=get the realm info=] given |environment settings|. 1. If |realm info| is null, return. -1. Let |related browsing contexts| be the result of [=get related browsing - contexts=] given |environment settings|. +1. Let |related browsing contexts| be the result of [=get related browsing contexts=] + given |environment settings|. 1. Let |body| be a map matching the RealmCreatedEvent production, with the params field set to |realm info|. @@ -4834,14 +4827,14 @@ Define the following [=unloading document cleanup steps=] with |document|: 1. [=Emit an event=] with |session| and |body|. Whenever a [=worker event loop=] |event loop| is destroyed, either because the -worker comes to the end of its lifecycle, or prematurely via the [=terminate a -worker=] algorithm: +worker comes to the end of its lifecycle, or prematurely via the +[=terminate a worker=] algorithm: 1. Let |environment settings| be the [=environment settings object=] for which |event loop| is the [=responsible event loop=]. -1. Let |related browsing contexts| be the result of [=get related browsing - contexts=] given |environment settings|. +1. Let |related browsing contexts| be the result of [=get related browsing contexts=] + given |environment settings|. 1. Let |realm| be |environment settings|'s [=environment settings object's Realm=]. @@ -4984,8 +4977,8 @@ The [=remote end event trigger=] is:
-Define the following [=console steps=] with |method|, |args|, and options: +Define the following [=console steps=] with |method|, |args|, and +options: 1. If |method| is "error" or "assert", let |level| be "error". If |method| is "debug" or "trace" @@ -5025,8 +5018,8 @@ ignore>options: 1. Let |source| be the result of [=get the source=] given [=current Realm Record=]. 1. If |method| is "assert", "error", - "trace", or "warn", let |stack| be the [=current - stack trace=]. Otherwise let |stack| be null. + "trace", or "warn", let |stack| be the + [=current stack trace=]. Otherwise let |stack| be null. 1. Let |entry| be a map matching the ConsoleLogEntry production, with the the level field set to |level|, the text @@ -5041,8 +5034,8 @@ ignore>options: 1. Let |settings| be the [=current settings object=] -1. Let |related browsing contexts| be the result of [=get related browsing - contexts=] given |settings|. +1. Let |related browsing contexts| be the result of [=get related browsing contexts=] + given |settings|. 1. For each |session| in [=active BiDi sessions=]: @@ -5052,8 +5045,8 @@ ignore>options: Otherwise, [=buffer a log event=] with |session|, |related browsing contexts|, and |body|. -Define the following [=error reporting steps=] with arguments |script|, line number, column number, |message| and +Define the following [=error reporting steps=] with arguments |script|, +line number, column number, |message| and |handled|: 1. If |handled| is true return. @@ -5070,8 +5063,8 @@ ignore>line number, column number, |message| and |message|, source set to |source|, and the timestamp field set to |timestamp|. -1. Let |related browsing contexts| be the result of [=get related browsing - contexts=] given |settings|. +1. Let |related browsing contexts| be the result of [=get related browsing contexts=] + given |settings|. 1. For each |session| in [=active BiDi sessions=]: @@ -5100,8 +5093,7 @@ The [=remote end subscribe steps=], with [=subscribe priority=] 10, given 1. Let |maybe context| be the result of [=getting a browsing context=] given |context id|. - 1. If |maybe context| is an [=error=], remove |context id| from [=log event - buffer=] and continue. + 1. If |maybe context| is an [=error=], remove |context id| from [=log event buffer=] and continue. 1. Let |context| be |maybe context|'s data @@ -5134,11 +5126,11 @@ The [=a browsing context is discarded=] algorithm is modified to read as follows
To discard a browsing context |browsingContext|, run these steps: -1. If this is not a recursive invocation of this algorithm, call any browsing context - tree discarded steps defined in other applicable specifications with |browsingContext|. +1. If this is not a recursive invocation of this algorithm, call any +browsing context tree discarded steps defined in other applicable +specifications with |browsingContext|. -1. Discard all {{Document}} objects for all the entries in |browsingContext|'s [=session - history=]. +1. Discard all {{Document}} objects for all the entries in |browsingContext|'s [=session history=]. 1. If |browsingContext| is a [=top-level browsing context=], then [=remove a browsing context=] |browsingContext|. @@ -5155,9 +5147,9 @@ end:
1. Call any error reporting steps defined in external specifications - with script, line, col, message, and true if the error is - [=handled=], or false otherwise. + with script, line, col, + message, and true if the error is [=handled=], or false + otherwise.
## Console ## {#patches-console} @@ -5166,9 +5158,8 @@ Other specifications can define console steps. When any method of the {{console}} interface is called, with method name |method| and argument |args|: -1. If that method does not call the [=Printer=] operation, call any [=console - steps=] defined in external specification with arguments |method|, |args|, - and undefined. +1. If that method does not call the [=Printer=] operation, call any [=console steps=] + defined in external specification with arguments |method|, |args|, and undefined. Otherwise, at the point when the [=Printer=] operation is called with arguments |name|, |printerArgs| and |options| (which is undefined if the