From 7ca26261931f12d6ad23faaf8f96816b1961428c Mon Sep 17 00:00:00 2001 From: James Graham Date: Fri, 9 Jul 2021 14:08:00 +0100 Subject: [PATCH 1/2] Allow for multiple WebDriver sessions With BiDi we want to support multiple sessions, at most one of which can also enable the HTTP frontend. Therefore we add the concept of multiple sessions, which can have different flags set according to the protocols they support (http, bidi, etc.). This explictly passes the session, parameters and url variables down into each command. In addition the URL variables are handled as a infra struct rather than as a custom thing with implied variables. Instead of having a concept of the "current session" we explicitly pass the session around where required. --- index.html | 2293 +++++++++++++++++++++++++++++----------------------- 1 file changed, 1263 insertions(+), 1030 deletions(-) diff --git a/index.html b/index.html index 502eb9ef..7899d9fe 100644 --- a/index.html +++ b/index.html @@ -274,9 +274,10 @@

Nodes

above the level of the wire protocol.
Remote end -
The remote end hosts the server side of the protocol. - Defining the behavior of a remote end in response to the WebDriver protocol - forms the largest part of this specification. +
The remote end hosts the server side of + the protocol. Defining the behavior of + a remote end in response to the WebDriver protocol forms the + largest part of this specification.

For remote ends the standard defines two broad conformance @@ -306,19 +307,17 @@

Nodes

of the wire protocol.

-The readiness state of a remote end -indicates whether it is free to accept new connections. -It must be false if the maximum active sessions -is equal to the length of the list of active sessions, -or if the node is an intermediary node -and is known to be in a state in which attempting to create new sessions would fail. -In all other cases it must be true. - -

If the intermediary node - is a multiplexer that manages - multiple endpoint nodes, - this might indicate its ability to purvey more sessions, - for example if it has hit its maximum capacity. +The readiness state of a remote end indicates +whether it is free to accept new connections. It must be false if the +implementation is an endpoint node and the list of active +HTTP sessions is not empty, or otherwise if the remote end is known to +be in a state in which attempting to create new sessions would +fail. In all other cases it must be true. + +

If the intermediary node is a multiplexer that + manages multiple endpoint nodes, this + might indicate its ability to purvey more sessions, for + example if it has hit its maximum capacity.

@@ -421,112 +420,113 @@

Processing model

However the exact details of how this connection works and how it is established are out of scope. -

After such a connection has been established, - a remote end must run the following steps:

+

After a connection is established, the remote end must run +the following steps:

    -
  1. Read bytes from the connection until a - complete HTTP request can be constructed from the data. - Let request be a request constructed from the - received data, according to the requirements of [[RFC7230]]. If it - is not possible to construct a complete HTTP request, - the remote end must either close the connection, - return an HTTP response with status code 500, or return - an error with error code unknown error. +

  2. [=iteration/While=] the connection is not closed:

    -
  3. Let request match be the result of the algorithm - to match a request with request’s - method and URL as arguments. +

      +
    1. Read bytes from the connection until a + complete HTTP request can be constructed from the data. + Let request be a request constructed from the + received data, according to the requirements of [[RFC7230]]. If it + is not possible to construct a complete HTTP request, + the remote end must either close the connection, + return an HTTP response with status code 500, or return + an error with error code unknown error. -

    2. If request match is of type error, - send an error with request match’s error code - and jump to step 1. +

    3. Let request match be the result of the algorithm + to match a request with request’s + method and URL as arguments. -

      Otherwise, let command and command parameters - be request match’s data. Let url variables be a - url variables dictionary mapping the command parameters - to their corresponding values. +

    4. If request match is of type error, + send an error with request match’s error code + and [=iteration/continue=]. -

    5. If session id is among the variables defined by command parameters: +

      Otherwise, let command and URL variables + be request match’s data. -

      This condition is intended to exclude the New Session and Status - commands and any extension commands which do not operate on a particular session. +

    6. Let session be null. -

        -
      1. Let session id be the corresponding variable - from command parameters. +

      2. If URL variables [=map/contains=] "session id": -

      3. Let the current session be the session - with ID session id - in the list of active sessions, - or null if there is no such matching session. +

        This condition is intended to exclude the New Session and Status + commands and any extension commands which do not operate on a particular session. -

      4. If the current session is null - send an error with error code invalid session id, - then jump to step 1 in this overall algorithm. +

          +
        1. Let session id be URL variables["session id"]. -

        2. If the current session is not null: +

        3. For each active session in the list of active sessions: +

            +
          1. If active session's session ID is equal + to session id, then let session + be active session, and break. +

          -
            -
          1. Enqueue request - in the current session’s request queue. +

          2. If the session is null + send an error with error code invalid session id, + then [=iteration/continue=]. -

          3. Wait until the first element - in the current session’s request queue - is request: +

          -
        4. Dequeue request from the current session’s request queue. +

        5. Enqueue a task on remote end's request queue to run the following + steps: -

        6. If the list of active sessions no longer contains the current session, - set the current session to null. -

        -
      +
        +
      1. If session is no longer in the list of active + sessions, then send an error with error code + invalid session id and return. -
      2. If request’s method is POST: +

      3. Let parameters be null. -

          -
        1. Let parse result be the result of - parsing as JSON with request’s - body as the argument. If this process throws an exception, - return an error with error code invalid - argument and jump back to step 1 in this overall algorithm. +

        2. If request’s method is POST: -

        3. If parse result is not an Object, - send an error with error code invalid argument - and jump back to step 1 in this overall algorithm. +

            +
          1. Let parse result be the result of + parsing as JSON with request’s + body as the argument. If this process throws an exception, + return an error with error code invalid + argument and jump back to step 1 in this overall algorithm. -

            Otherwise, let parameters be parse result. -

          +
        4. If parse result is not an Object, + send an error with error code invalid argument + and jump back to step 1 in this overall algorithm. + +

          Otherwise, let parameters be parse result. +

        -

        Otherwise, let parameters be null. +

      4. Let navigate result be the result + of wait for navigation to complete. -

      5. Wait for navigation to complete. If this returns - an error return its value and - jump to step 1 in this overall algorithm, otherwise continue. +

      6. If navigate result is an error, + send an error with error code + equal to navigate result’s error code + and return. -

      7. Let response result be the return value - obtained by running the remote end steps for command - with an argument named url variables whose value is - url variables and an - additional argument named parameters whose value is - parameters. +

      8. Let response result be the return value + obtained by running the remote end steps + for command with session, URL + variables, and parameters. -

      9. If response result is an error, - send an error with error code - equal to response result’s error code - and jump back to step 1 in this overall algorithm. +

      10. If response result is an error, + send an error with error code + equal to response result’s error code + and return. -

        Otherwise, if response result is a success, - let response data be response result’s data. +

      11. Assert: response result is a success. -

      12. Send a response with status 200 and response data. +

      13. Let response data be response result’s data. -

      14. Jump to step 1. +

      15. Send a response with status 200 and response data. +

      +
    7. +
    +
-

When required to send an error, - with error code - and an optional error data dictionary, +

When required to send an error, with error + code and an optional error data dictionary, a remote end must run the following steps:

    @@ -597,16 +597,14 @@

    Processing model

  1. Write response bytes to the connection.

-

A url variable dictionary is defined - as the mapping of a command’s URI template variable names - to their corresponding values. +

Routing requests

Request routing - is the process of going from a HTTP request + is the process of going from an HTTP request to the series of steps needed to implement the command represented by that request. @@ -631,10 +629,10 @@

Routing requests

  • Let endpoints be a list containing each row in the table of endpoints. -

  • Remove each entry from endpoints - for which the concatenation of the URL prefix - and the entry’s URI template - does not match URL’s path. +

  • Remove each entry from endpoints for which the + concatenation of the URL prefix and the entry’s URI + template does not have a valid expansion equal to + to URL’s path.

  • If there are no entries in endpoints, return error with error code unknown command. @@ -649,13 +647,19 @@

    Routing requests

  • There is now exactly one entry in endpoints; let entry be this entry. -

  • Let parameters be the result of extracting the variables - from URL using entry’s URI template. +

  • Let URI template be the concatenation of URL + prefix with entry's URI template.

  • Let command be entry’s command. +

  • Let URL variables be a map with one + [=map/entry=] for each variable defined in URI template, + with the entry name equal to the template variable name, and the + entry value being the variable value required to expand the URI + template to match URL's path. +

  • Return success with data - command and parameters. + command and URL variables.

  • @@ -1063,7 +1067,7 @@

    Errors

    -

    The remote end steps are: +

    The remote end steps, given session, URL +variables and parameters are:

      -
    1. If the maximum active sessions is equal to - the length of the list of active sessions, - return error with error code session not created. +

    2. If the implementation is an endpoint node, and the + list of active HTTP sessions is not empty, or otherwise if + the implementation is unable to start an additional session, + return error with error code session not + created.

    3. If the remote end is an intermediary node, take implementation-defined steps that either result in returning @@ -2374,100 +2485,38 @@

      New Sessio URL prefix of the upstream remote end will need to be tracked. -
    4. If the maximum active sessions is equal to - the length of the list of active sessions, - return error with error code session not created. +

    5. Let flags be a set containing "http". -

    6. Let capabilities be the result - of trying to process capabilities - with parameters as an argument. +

    7. Let capabilities be the result of trying + to process capabilities with parameters + and flags.

    8. If capabilities’s is null, return error with error code session not created. -

    9. Let session id be the result of generating a UUID. - -

    10. Let session be a new session - with the session ID of session id. - -

    11. Set the current session to session. - -

    12. Run any WebDriver new session algorithm defined in - external specifications, with arguments session - and capabilities. - -

    13. Append session to active sessions. +

    14. Let session be the result of create a + session, with capabilities, and flags.

    15. Let body be a JSON Object initialized with:

      "sessionId" -
      session id +
      session's session ID.
      "capabilities"
      capabilities
      -
    16. Initialize the following from capabilities: - -

        -
      1. Let strategy be the result of getting property - "pageLoadStrategy" from capabilities. - -

      2. If strategy is a string, set the current session’s - page loading strategy to strategy. Otherwise, - set the page loading strategy to normal and set a - property of capabilities with name - "pageLoadStrategy" and value "normal". - -

      3. Let strictFileInteractability be the result of getting property - "strictFileInteractability" from capabilities. - -

      4. If strictFileInteractability is a boolean, - set the current session’s strict file interactability to - strictFileInteractability. Otherwise set the - current session’s strict file interactability to false. - -

      5. Let proxy be the result of getting property - "proxy" from capabilities and run the - substeps of the first matching statement: - -

        -
        proxy is a proxy configuration object
        -

        Take implementation-defined steps to set the user agent proxy - using the extracted proxy configuration. If the - defined proxy cannot be configured return error with - error code session not created.

        - -
        Otherwise
        -
        Set a property of capabilities with name - "proxy" and a value that is a new JSON Object.
        -
        -
      6. - -
      7. If capabilities has a property with the key "timeouts": - -

          -
        1. Let timeouts be the result of trying - to JSON deserialize as a timeouts configuration - the value of the "timeouts" property. - -

        2. Make the session timeouts the new timeouts. -

        - -
      8. Set a property on capabilities with name - "timeouts" and value that of the - JSON deserialization of the session timeouts. - -

      9. Apply changes to the user agent for any implementation-defined capabilities - selected during the capabilities processing step. -

      - -
    17. Set the webdriver-active flag to true.

      - -
    18. Set the current top-level browsing context - for session with the top-level browsing context - of the UA’s current browsing context. +

    19. Set session' current top-level browsing + context to one of the endpoint node's top-level + browsing contexts, preferring the top-level browsing + context that + has system + focus, or otherwise preferring any top-level browsing + context whose + visibility + state + is visible.

      WebDriver implementations typically start a completely new browser instance, but there is no requirement in @@ -2496,11 +2545,12 @@

      Delete Session

      -

      The remote end steps are: +

      The remote end steps, given session, URL +variables and parameters are:

        -
      1. If the current session is an active session, - try to close the session. +

      2. If session is an active HTTP session, + try to close the session with session.

      3. Return success with data null.

      @@ -2541,7 +2591,8 @@

      Status

      ready and message are reserved and must not be overwritten. -

      The remote end steps are:

      +

      The remote end steps, given session, URL +variables and parameters are:

      1. Let body be a new JSON Object @@ -2558,6 +2609,7 @@

        Status

      2. Return success with data body.

      + @@ -2721,8 +2773,8 @@

      Get Timeouts

      -

      -The remote end step are: +

      The remote end steps, given session, URL +variables and parameters are:

      1. Let timeouts be the timeouts object for @@ -2747,14 +2799,14 @@

        Set Timeouts

        -

        -The remote end steps are: +

        The remote end steps, given session, URL +variables and parameters are:

        1. Let timeouts be the result of trying to JSON deserialize as a timeouts configuration -the request’s parameters. +with parameters.

        2. Make the session timeouts the new timeouts. @@ -2771,8 +2823,9 @@

          Set Timeouts

          Navigation

          The commands in this section allow navigation of - the current top-level browsing context to new URLs - and introspection of the document currently loaded in this browsing context. + the session's current top-level browsing context to new + URLs and introspection of the document currently loaded in + this browsing context.

          For commands that cause a new document to load, the point at which the command returns @@ -2834,16 +2887,18 @@

          Navigation

        3. Return success with data value.

        -

        When asked to wait for navigation to complete, +

        When asked to wait for navigation to complete, given session, run the following steps:

          -
        1. If the current session - has a page loading strategy of none, - return success with data null. +

        2. If session's page loading strategy + is none, return success with + data null. -

        3. If the current browsing context is no longer open, - return success with data null. +

        4. If session's current browsing context + is no longer open, return success with + data null.

        5. Start a timer. If this algorithm has not completed before timer reaches @@ -2852,15 +2907,15 @@

          Navigation

          code timeout.
        6. If there is an ongoing attempt to navigate - the current browsing context that has not + session's current browsing context that has not yet matured, wait for navigation to mature.

        7. Let readiness target be the document - readiness state associated with the current - session’s page loading strategy, which can be found in - the table of page load strategies. + readiness state associated with the session’s page + loading strategy, which can be found in the table of page + load strategies. -

        8. Wait for the current browsing context’s +

        9. Wait for session's current browsing context’s document readiness state to reach readiness target, or for the session page load timeout to pass, whichever @@ -2886,12 +2941,12 @@

          Navigation

          failed DNS lookup.
          response is blocked by content security policy -

          If the current session’s secure TLS state is disabled, - take implementation specific steps to ensure - the navigation is not aborted - and that the untrusted- or invalid TLS certificate error - that would normally occur under these circumstances, - are suppressed. + +

          If the remote end’s accept insecure TLS state is + true, take implementation specific steps to ensure the navigation + is not aborted and that the untrusted or invalid TLS certificate + error that would normally occur under these circumstances, are + suppressed.

          Otherwise return error with error code insecure certificate. @@ -2915,43 +2970,47 @@

          Navigate To

          -

          The command causes the user agent - to navigate the current top-level browsing context to a new location. +

          The command causes the user agent to navigate + the session's current top-level browsing context to a + new location. -

          If the session is not in a secure TLS state, - no certificate errors that would normally - cause the user agent to abort and show a security warning - are to hinder navigation to the requested address. +

          If the remote end's accept insecure TLS flag is true, no + certificate errors that would normally cause the user agent to abort + and show a security warning are to hinder navigation to the requested + address.

          -

          The remote end steps are: +

          The remote end steps, given session, URL +variables and parameters are:

            -
          1. If the current top-level browsing context is no longer open, - return error with error code no such window. +

          2. If session's current top-level browsing + context is no longer open, return error + with error code no such window. -

          3. Let url be the result of - getting the property url - from the parameters argument. +

          4. Let URL be the result of getting a property + named "url" from parameters. -

          5. If url is not an absolute URL +

          6. If URL is not an absolute URL or is not an absolute URL with fragment or not a - local scheme, - return error with error code invalid argument. + local scheme, return error with error + code invalid argument. -

          7. Handle any user prompts and return its value if it is an error. +

          8. Try to handle any user prompts + with session. -

          9. Let current URL be the current top-level browsing context’s - active document’s [=Document/URL=]. +

          10. Let current URL be session's current + top-level browsing context’s active document’s [=Document/URL=]. -

          11. If current URL and url do not have the same +

          12. If current URL and URL do not have the same absolute URL:

              @@ -2962,9 +3021,10 @@

              Navigate To

              with error code timeout.
            -
          13. Navigate the current top-level browsing context to url. +

          14. Navigate session's current top-level + browsing context to URL. -

          15. If url is special except for file and +

          16. If URL is special except for file and current URL and URL do not have the same absolute URL :

            1. Try to wait for navigation to complete. @@ -2972,10 +3032,11 @@

              Navigate To

            2. Try to run the post-navigation checks.

            -
          17. Set the current browsing context with the current - top-level browsing context. +

          18. Set the current browsing context + with session and current top-level browsing + context. -

          19. If the current top-level browsing context contains +

          20. If session's current top-level browsing context contains a refresh state pragma directive of time 1 second or less, wait until the refresh timeout has elapsed, a new navigate has begun, and return to the first step of this @@ -2999,19 +3060,22 @@

            Get Current URL

            -

            The remote end steps are: +

            The remote end steps, given session, URL +variables and parameters are:

              -
            1. If the current top-level browsing context is no longer open, - return error with error code no such window. +

            2. If session's current top-level browsing + context is no longer open, return error + with error code no such window. -

            3. Handle any user prompts and return its value if it is an error. +

            4. Try to handle any user prompts + with session. -

            5. Let url be the serialization - of the current top-level browsing context’s +

            6. Let URL be the serialization + of session's current top-level browsing context’s active document’s [=Document/URL=]. -

            7. Return success with data url. +

            8. Return success with data URL.

            @@ -3031,20 +3095,23 @@

            Back

            This command causes the browser to traverse one step backward in the joint session history - of the current top-level browsing context. + of session's current top-level browsing context. This is equivalent to pressing the back button in the browser chrome or invoking window.history.back. -

            The remote end steps are: +

            The remote end steps, given session, URL +variables and parameters are:

              -
            1. If the current top-level browsing context is no longer open, - return error with error code no such window. +

            2. If session's current top-level browsing + context is no longer open, return error + with error code no such window. -

            3. Handle any user prompts and return its value if it is an error. +

            4. Try to handle any user prompts + with session.

            5. Traverse the history by a delta –1 - for the current browsing context. + for session's current browsing context.

            6. If the previous step completed results in a pageHide [=fire an event|event firing=], wait until pageShow [=fire an event|event fires=] @@ -3076,20 +3143,23 @@

              Forward

              This command causes the browser to traverse one step forwards in the joint session history - of the current top-level browsing context. + of session's current top-level browsing context. This is equivalent to pressing the forward button in the browser chrome or invoking window.history.forward. -

              The remote end steps are: +

              The remote end steps, given session, URL +variables and parameters are:

                -
              1. If the current top-level browsing context is no longer open, - return error with error code no such window. +

              2. If session's current top-level browsing + context is no longer open, return error + with error code no such window. -

              3. Handle any user prompts and return its value if it is an error. +

              4. Try to handle any user prompts + with session.

              5. Traverse the history by a delta 1 - for the current browsing context. + for session's current browsing context.

              6. If the previous step completed results in a pageHide event firing, wait until pageShow [=fire an event|event fires=] @@ -3119,29 +3189,34 @@

                Refresh

                -

                This command causes the browser - to reload the page in the current top-level browsing context. +

                This command causes the browser to reload the page + in session's current top-level browsing context. -

                The remote end steps are: +

                The remote end steps, given session, URL +variables and parameters are:

                  -
                1. If the current top-level browsing context is no longer open, - return error with error code no such window. +

                2. If session's current top-level browsing + context is no longer open, return error + with error code no such window. -

                3. Handle any user prompts and return its value if it is an error. +

                4. Try to handle any user prompts + with session. -

                5. Initiate an overridden reload of the current top-level browsing +

                6. Initiate an overridden reload + of session's current top-level browsing context’s active document.

                7. -
                8. If url is special except for file: +

                9. If URL is special except for file:

                  1. Try to wait for navigation to complete.

                  2. Try to run the post-navigation checks.

                  -
                10. Set the current browsing context with current +

                11. Set the current browsing context + with session and session'scurrent top-level browsing context.

                12. Return success with data null. @@ -3163,19 +3238,23 @@

                  Get Title

                  This command returns the document title - of the current top-level browsing context, + of session's current top-level browsing context, equivalent to calling document.title. -

                  The remote end steps are: +

                  The remote end steps, given session, URL +variables and parameters are:

                    -
                  1. If the current top-level browsing context is no longer open, - return error with error code no such window. +

                  2. If session's current top-level browsing + context is no longer open, return error + with error code no such window. -

                  3. Handle any user prompts and return its value if it is an error. +

                  4. Try to handle any user prompts + with session. -

                  5. Let title be the current top-level browsing context’s - active document’s {{Document/title}}. +

                  6. Let title be + the session's current top-level browsing + context’s active document’s {{Document/title}}.

                  7. Return success with data title.

                  @@ -3186,13 +3265,13 @@

                  Get Title

                  Contexts

                  Many WebDriver commands happen in the context of either - the current browsing context or current top-level browsing context. - The current top-level browsing context is represented in the protocol - by its associated window handle. - When a top-level browsing context is selected - using the Switch To Window command, - a specific browsing context can be selected - using the Switch to Frame command. + session's current browsing context or current + top-level browsing context. + session's current top-level browsing context is + represented in the protocol by its associated window handle. + When a top-level browsing context is selected using + the Switch To Window command, a specific browsing + context can be selected using the Switch to Frame command.

                  The use of the term “window” to refer to a top-level browsing context @@ -3300,25 +3379,31 @@

                  Contexts

                When required to set the current browsing context given - a context, an implementation must follow the following - steps: + session and context, an implementation must + follow the following steps: +

                  -
                1. Set the current session’s current browsing - context to context. -
                2. Set the current session’s current parent browsing +
                3. Set session’s current browsing + context to context. + +

                4. Set the session’s current parent browsing context to the parent browsing context of context, if that context exists, or null otherwise.

                When required to set the current top-level browsing - context given a context, an implementation must - follow the following steps: + context given session and context, an + implementation must: +

                  -
                1. Assert: context is a top-level browsing context. -
                2. Set the current session’s current top-level browsing +
                3. Assert: context is a top-level browsing context. + +

                4. Set session’s current top-level browsing context to context. -

                5. Set the current browsing context to context. + +
                6. Set the current browsing context with session + and context.

                @@ -3341,14 +3426,16 @@

                Get Window Handle

                -

                The remote end steps are: +

                The remote end steps, given session, URL +variables and parameters are:

                  -
                1. If the current top-level browsing context is no longer open, - return error with error code no such window. +

                2. If session's current top-level browsing + context is no longer open, return error + with error code no such window.

                3. Return success with data being the window handle - associated with the current top-level browsing context. + associated with session's current top-level browsing context.

                @@ -3366,21 +3453,27 @@

                Close Window

                -

                The remote end steps are: +

                The remote end steps, given session, URL +variables and parameters are:

                  -
                1. If the current top-level browsing context is no longer open, - return error with error code no such window. +

                2. If session's current top-level browsing + context is no longer open, return error + with error code no such window. -

                3. Handle any user prompts and return its value if it is an error. +

                4. Try to handle any user prompts + with session. -

                5. Close the current top-level browsing context. +

                6. Close session's current top-level + browsing context.

                7. If there are no more open top-level browsing contexts, then try to close the session. -

                8. Return the result of running the remote end steps - for the Get Window Handles command. +
                9. Return the result of running the remote end steps for + the Get Window Handles command, + with session, URL variables + and parameters.
                @@ -3399,17 +3492,18 @@

                Switch To Window

                -Switching window will select the current top-level browsing context -used as the target for all subsequent commands. -In a tabbed browser, this will typically +Switching window will select session's current top-level +browsing context used as the target for all +subsequent commands. In a tabbed browser, this will typically make the tab containing the browsing context the selected tab. -

                The remote end steps are: +

                The remote end steps, given session, URL +variables and parameters are:

                1. Let handle be the result of getting the property "handle" - from the parameters argument. + from parameters.

                2. If handle is undefined, return error with error code invalid argument. @@ -3419,15 +3513,15 @@

                  Switch To Window

                  return error with error code unexpected alert open.
                3. If handle is equal to the associated window - handle for some top-level browsing context in - the current session, let context be the that - browsing context, and - set the current top-level browsing context with context. + handle for some top-level browsing context, + let context be the that browsing context, and + set the current top-level browsing context + with session and context.

                  Otherwise, return error with error code no such window.

                4. Update any implementation-specific state that would result - from the user selecting the current browsing context for + from the user selecting session's current browsing context for interaction, without altering OS-level focus.

                5. Return success with data null. @@ -3450,7 +3544,8 @@

                  Get Window Handles

                  The order in which the window handles are returned is arbitrary. -

                  The remote end steps are: +

                  The remote end steps, given session, URL +variables and parameters are:

                  1. Let handles be a List. @@ -3485,23 +3580,26 @@

                    New Window

                    Create a new top-level browsing context. -

                    The remote end steps are: +

                    The remote end steps, given session, URL +variables and parameters are:

                    1. If the implementation does not support creating new top-level browsing contexts, return error with error code unsupported operation. -

                    2. If the current top-level browsing context is no longer open, - return error with error code no such window. +

                    3. If session's current top-level browsing + context is no longer open, return error + with error code no such window. -

                    4. Handle any user prompts and return its value if it is an error. +

                    5. Try to handle any user prompts + with session.

                    6. Let type hint be the result of getting the property - "type" from the parameters argument. + "type" from parameters.

                    7. Create a new top-level browsing context by running - the window open steps with url set to + the window open steps with URL set to "about:blank", target set to the empty string, and features set to "noopener" and the user agent configured to create a new browsing context. This must @@ -3509,7 +3607,7 @@

                      New Window

                      context. If type hint has the value "tab", and the implementation supports multiple browsing context in the same OS window, the new browsing context should share an OS window - with the current browsing context. If type hint is + with session's current browsing context. If type hint is "window", and the implementation supports multiple browsing contexts in separate OS windows, the created browsing context should be in a new OS window. In all other cases the details @@ -3520,7 +3618,7 @@

                      New Window

                      associated window handle of the newly created window.
                    8. Let type be "tab" if the newly created - window shares an OS-level window with the current browsing + window shares an OS-level window with session's current browsing context, or "window" otherwise.

                    9. Let result be a new JSON Object initialized with: @@ -3554,16 +3652,18 @@

                      Switch To Frame

                      The Switch To Frame command is used to select - the current top-level browsing context or a child browsing context - of the current browsing context to use as the current browsing context - for subsequent commands. + session's current top-level browsing context or + a child browsing context of session's current + browsing context to use as session's current + browsing context for subsequent commands. -

                      The remote end steps are: +The remote end steps, given session, URL +variables and parameters are:

                      1. Let id be the result of getting the property "id" - from the parameters argument. + from parameters.

                      2. If id is not null, a Number object, @@ -3576,15 +3676,16 @@

                        Switch To Frame

                        id is null
                          -
                        1. If the current top-level browsing context is no - longer open, return error with error code no - such window. +

                        2. If session's current top-level browsing + context is no longer open, return error + with error code no such window. -

                        3. Handle any user prompts - and return its value if it is an error. +

                        4. Try to handle any user prompts + with session.

                        5. Set the current browsing context with - the current top-level browsing context. + session and session's current + top-level browsing context.

                        id is a Number object @@ -3593,15 +3694,15 @@

                        Switch To Frame

                      3. If id is less than 0 or greater than 216 – 1, return error with error code invalid argument. -

                      4. If the current browsing context is no +

                      5. If session's current browsing context is no longer open, return error with error code no such window. -

                      6. Handle any user prompts - and return its value if it is an error. +

                      7. Try to handle any user prompts + with session.

                      8. Let window be the associated window - of the current browsing context’s active document. + of session's current browsing context’s active document.

                      9. If id is not a supported property index of window, @@ -3614,35 +3715,36 @@

                        Switch To Frame

                        (id).
                      10. Set the current browsing context with - child window’s browsing context. + session and child window’s browsing context.

                      id represents a web element
                        -
                      1. If the current browsing context is no +

                      2. If session's current browsing context is no longer open, return error with error code no such window. -

                      3. Handle any user prompts - and return its value if it is an error. +

                      4. Try to handle any user prompts + with session.

                      5. Let element be the result of trying to get a known element - with id. + with session and id.

                      6. If element is not a [^frame^] or [^iframe^] element, return error with error code no such frame.

                      7. Set the current browsing context - with element’s [=navigable container/content navigable=]'s - [=navigable/active browsing context=]. + with session and element’s [=navigable + container/content navigable=]'s [=navigable/active browsing + context=].

                    10. Update any implementation-specific state that would result - from the user selecting the current browsing context for + from the user selecting session's current browsing context for interaction, without altering OS-level focus.

                    11. Return success with data null. @@ -3668,37 +3770,43 @@

                      Switch To Parent Frame

                      The Switch to Parent Frame command - sets the current browsing context for future commands - to the parent of the current browsing context. + sets session's current browsing context for future commands + to the parent of session's current browsing context. -

                      The remote end steps are: +

                      The remote end steps, given session, URL +variables and parameters are:

                        -
                      1. Run the substeps if the current browsing context is already the +

                      2. If session's current browsing context is already the top-level browsing context: -

                          -
                        1. If the current browsing context is no longer - open, return error with error code no such - window. -

                        2. Return success with data null. -

                        +
                          + +
                        1. If session's current browsing context + is no longer open, return error with error + code no such window. -

                        2. If the current parent browsing context is no longer - open, return error with error code no such - window. +

                        3. Return success with data null. -

                        4. Handle any user prompts and return its value if it is an error. +

                        -
                      3. If the current session's current parent browsing - context is not null, set the current browsing - context with the current parent browsing context. +

                      4. If session's current parent browsing context + is no longer open, return error with error + code no such window. -

                      5. Update any implementation-specific state that would result - from the user selecting the current browsing context for +

                      6. Try to handle any user prompts + with session. + +

                      7. If session's current parent browsing context is + not null, set the current browsing context + with session and current parent browsing context. + +

                      8. Update any implementation-specific state that would result + from the user selecting session's current browsing context for interaction, without altering OS-level focus.

                      9. Return success with data null. +

                      @@ -3707,7 +3815,7 @@

                      Resizing and positioning windows

                      WebDriver provides commands for interacting with the operating system window - containing the current top-level browsing context. + containing session's current top-level browsing context. Because different operating systems’ window managers provide different abilities, not all of the commands in this section can be supported by all remote ends. Support for these commands is determined by the window @@ -3842,18 +3950,22 @@

                      Get Window Rect

                      The Get Window Rect command returns the size and position on the screen of the operating system window corresponding - to the current top-level browsing context. + to session's current top-level browsing context. -

                      The remote end steps are: +

                      The remote end steps, given session, URL +variables and parameters are:

                        -
                      1. If the current top-level browsing context is no longer open, +

                      2. If session's current top-level browsing context is no longer open, return error with error code no such window. -

                      3. Handle any user prompts and return its value if it is an error. +

                      4. Try to handle any user prompts + with session.

                      5. Return success with data set to the WindowRect - object for the current top-level browsing context. + object for the session's current top-level browsing + context. +

                      @@ -3874,25 +3986,26 @@

                      Set Window Rect

                      The Set Window Rect command alters the size and the position of the operating system window -corresponding to the current top-level browsing context. +corresponding to session's current top-level browsing context. -

                      The remote end steps are: +

                      The remote end steps, given session, URL +variables and parameters are:

                      1. Let width be the result of - getting a property named width - from the parameters argument, else let it be null. + getting a property named "width" + from parameters, else let it be null.

                      2. Let height be the result of - getting a property named height - from the parameters argument, else let it be null. + getting a property named "height" + from parameters, else let it be null.

                      3. Let x be the result of getting a property - named x from the parameters argument, + named "x" from parameters, else let it be null.

                      4. Let y be the result of getting a property - named y from the parameters argument, + named "y" from parameters, else let it be null.

                      5. If width or height is neither null @@ -3905,13 +4018,15 @@

                        Set Window Rect

                      6. If the remote end does not support the Set Window Rect command for - the current top-level browsing context for any reason, + session's current top-level browsing context for any reason, return error with error code unsupported operation. -

                      7. If the current top-level browsing context is no longer open, - return error with error code no such window. +

                      8. If session's current top-level browsing + context is no longer open, return error + with error code no such window. -

                      9. Handle any user prompts and return its value if it is an error. +

                      10. Try to handle any user prompts + with session.

                      11. Fully exit fullscreen. @@ -3922,13 +4037,13 @@

                        Set Window Rect

                        1. Set the width, in CSS pixels, of the operating system window containing - the current top-level browsing context, + session's current top-level browsing context, including any browser chrome and externally drawn window decorations to a value that is as close as possible to width.

                        2. Set the height, in CSS pixels, of the operating system window containing - the current top-level browsing context, + session's current top-level browsing context, including any browser chrome and externally drawn window decorations to a value that is as close as possible to height. @@ -3942,8 +4057,9 @@

                          Set Window Rect

                          Particular implementations may have other limitations such as not being able to resize in single-pixel increments. -

                          This is intended to mutate the value of the current - top-level browsing context’s WindowProxy’s +

                          This is intended to mutate the value + of session's current top-level browsing + context’s WindowProxy’s outerWidth and outerHeight properties. Specifically, the value of outerWidth should be as close as possible to width and the value @@ -3955,17 +4071,19 @@

                          Set Window Rect

                        3. If x and y are not null:

                            -
                          1. Run the implementation-specific steps - to set the position of the operating system level window - containing the current top-level browsing context - to the position given by the x and y coordinates. +

                          2. Run the implementation-specific steps to set the position of + the operating system level window + containing session's current top-level browsing + context to the position given by the x + and y coordinates.

                          -
                        4. Return success with data set to the WindowRect - object for the current top-level browsing context. +

                        5. Return success with data set to the WindowRect + object for the session's current top-level browsing + context.

                        @@ -3996,34 +4115,37 @@

                        Maximize Window

                        -

                        The Maximize Window command - invokes the window manager-specific “maximize” operation, if any, - on the window containing the current top-level browsing context. - This typically increases the window to the maximum available size - without going full-screen. +

                        The Maximize Window command invokes the window + manager-specific “maximize” operation, if any, on the window + containing session's current top-level browsing + context. This typically increases the window to the maximum + available size without going full-screen. -

                        The remote end steps are: +

                        The remote end steps, given session, URL +variables and parameters are:

                          -
                        1. If the remote end does not support - the Maximize Window command - for the current top-level browsing context for any reason, - return error with error code unsupported operation. +

                        2. If the remote end does not support the Maximize + Window command for session's current top-level + browsing context for any reason, return error + with error code unsupported operation. -

                        3. If the current top-level browsing context is no longer open, - return error with error code no such window. +

                        4. If session's current top-level browsing + context is no longer open, return error + with error code no such window. -

                        5. Handle any user prompts and return its value if it is an error. +

                        6. Try to handle any user prompts + with session.

                        7. Fully exit fullscreen.

                        8. Restore the window.

                        9. Maximize the window - of the current top-level browsing context. + of session's current top-level browsing context.

                        10. Return success with data set to the WindowRect - object for the current top-level browsing + object for the session's current top-level browsing context.

                        @@ -4042,30 +4164,33 @@

                        Minimize Window

                        -

                        The Minimize Window command - invokes the window manager-specific “minimize” operation, if any, - on the window containing the current top-level browsing context. - This typically hides the window in the system tray. +

                        The Minimize Window command invokes the window + manager-specific “minimize” operation, if any, on the window + containing session's current top-level browsing + context. This typically hides the window in the system tray. -

                        The remote end steps are: +

                        The remote end steps, given session, URL +variables and parameters are:

                          -
                        1. If the remote end does not support - the Minimize Window command - for the current top-level browsing context for any reason, - return error with error code unsupported operation. +

                        2. If the remote end does not support the Minimize + Window command for session's current top-level + browsing context for any reason, return error + with error code unsupported operation. -

                        3. If the current top-level browsing context is no longer open, - return error with error code no such window. +

                        4. If session's current top-level browsing + context is no longer open, return error + with error code no such window. -

                        5. Handle any user prompts and return its value if it is an error. +

                        6. Try to handle any user prompts + with session.

                        7. Fully exit fullscreen.

                        8. Iconify the window.

                        9. Return success with data set to the WindowRect - object for the current top-level browsing + object for the session's current top-level browsing context.

                        @@ -4084,25 +4209,28 @@

                        Fullscreen Window

                        -

                        The remote end steps are: +

                        The remote end steps, given session, URL +variables and parameters are:

                        1. If the remote end does not support fullscreen return error with error code unsupported operation. -

                        2. If the current top-level browsing context is no longer open, - return error with error code no such window. +

                        3. If session's current top-level browsing + context is no longer open, return error + with error code no such window. -

                        4. Handle any user prompts and return its value if it is an error. +

                        5. Try to handle any user prompts + with session.

                        6. Restore the window.

                        7. Call fullscreen an element - with the current top-level browsing context’s + with session's current top-level browsing context’s active document’s document element. -

                        8. Return success with data set to the WindowRect - object for the current top-level browsing +

                        9. Return success with data set to the WindowRect + object for the session's current top-level browsing context.

                        @@ -4214,16 +4342,17 @@

                        Elements

                        return true, otherwise return false.
                      -

                      To get a known element given reference: +

                      To get a known element given session and reference:

                        -
                      1. If not node reference is known with current session, - current browsing context, and reference return +
                      2. If not node reference is known with session, + session's current browsing context, + and reference return error with error code no such element.
                      3. Let node be the result of get a node with - current session, current browsing context, and - reference. + session, session's current browsing + context, and reference.
                      4. If node is not null and node does not implement {{Element}} return error with error code no such element. @@ -4238,24 +4367,25 @@

                        Elements

                      To get or create a web element reference - given element: + given session and element:

                      1. Assert: element implements {{Element}}.
                      2. Return the result of trying to get or create a node - reference given current session, current browsing - context, and element. + reference + given session, session's current + browsing context, and element.
                      -

                      The web element reference object for element -is given by: +

                      The web element reference object for session +and element is:

                      1. Let identifier be the web element identifier.

                      2. Let reference be the result of get or create a - web element reference with element. + web element reference with session and element.

                      3. Return a JSON Object initialized with a property with name identifier and value reference. @@ -4270,13 +4400,12 @@

                        Elements

                        return error with error code invalid argument.
                      4. Let reference be the result of - getting - the web element identifier property - from object. + getting the web element + identifier property from object.

                      5. Let element be the result of trying to get a known element - with reference. + with session and reference.

                      6. Return success with data element.

                      @@ -4315,7 +4444,7 @@

                      Elements

                      Mutable form control elements

                      Denotes [^input^] elements that are mutable (e.g. that are not read only or actually disabled) - and whose [^input/type^] attribute + and whose [^input/type^] attribute is in one of the following states:

                      -
                    12. Let input state be the result of get the - input state with current session and current - top-level browsing context. +

                    13. Let input state be the result of get the input + state with session + and session's current top-level browsing + context.

                    14. Let input id be a the result of generating a UUID. @@ -6473,7 +6658,8 @@

                      Element Send Keys

                    15. Dispatch actions for a string with arguments input state, input id, and source, -text, and current browsing context. +text, and session's current browsing +context.

                    16. Remove an input source with input state and input id. @@ -6502,17 +6688,20 @@

                      Get Page Source

                      -The Get Page Source command -returns a string serialization of the DOM -of the current browsing context active document. +The Get Page Source command returns a string +serialization of the DOM of session's current browsing +context active document. -

                      The remote end steps are: +

                      The remote end steps, given session, URL +variables and parameters are:

                        -
                      1. If the current browsing context is no longer open, - return error with error code no such window. +

                      2. If session's current browsing context + is no longer open, return error with error + code no such window. -

                      3. Handle any user prompts and return its value if it is an error. +

                      4. Try to handle any user prompts + with session.

                      5. Let source be the result of invoking the fragment serializing algorithm on a fictional node whose only @@ -6521,7 +6710,7 @@

                        Get Page Source

                        to be thrown, let source be null.
                      6. Let source be the result of serializing to string - the current browsing context active document, + session's current browsing context's active document, if source is null.

                      7. Return success with data source. @@ -6549,11 +6738,10 @@

                        Executing Script

                      8. instance of {{NodeList}} -

                        -When required to JSON deserialize -with argument value -and optional argument seen, -a remote end must run the following steps: +

                        To JSON deserialize +given session, value and optional +argument seen, a remote end must run the following +steps:

                        1. If seen is not provided, @@ -6589,20 +6777,20 @@

                          Executing Script

                          instance of Array
                          instance of Object -

                          Return the result of running the clone an object algorithm - with arguments value and seen, +

                          Return clone an object algorithm + with session, value and seen, and the JSON deserialize algorithm as the clone algorithm.

                        -

                        To perform a JSON clone - return the result of calling the internal JSON clone algorithm - with arguments value and an empty List. +

                        To JSON clone given session + and value, return the result of internal JSON clone + with session, value and an empty List. -

                        When required to run the internal JSON clone algorithm - with arguments value and seen, - a remote end must return the value - of the first matching statement, matching on value: +

                        To internal JSON clone + given session, value and seen, + return the value of the first matching statement, matching + on value:

                        undefined @@ -6614,26 +6802,26 @@

                        Executing Script

                        type String

                        Return success with data value. -

                        instance of {{Element}} +
                        instance of {{Element}}

                        If the element is stale, return error with error code stale element reference.

                        Otherwise:

                        1. Let reference be the web element reference object - for value. + for session and value.

                        2. Return success with data reference.

                        -
                        instance of {{ShadowRoot}} +
                        instance of {{ShadowRoot}}

                        If the shadow root is detached, return error with error code detached shadow root.

                        Otherwise:

                        1. Let reference be the shadow root reference object - for value. + for session and value.

                        2. Return success with data reference.

                        @@ -6661,19 +6849,17 @@

                        Executing Script

                        Otherwise
                          -
                        1. Let result be the return value of running the - clone an object algorithm with arguments value and - seen, and the internal JSON clone algorithm as the +

                        2. Let result be + clone an object with session value + and seen, and internal JSON clone as the clone algorithm.

                        3. Return success with data result.
                        -

                        To clone an object, - taking the arguments value, - seen, - and clone algorithm: +

                        To clone an object, given session, value, + seen, and clone algorithm:

                        1. If value is in seen, @@ -6707,7 +6893,7 @@

                          Executing Script

                          return error with error code javascript error.
                        2. Let cloned property result be the result of - calling the clone algorithm with arguments + calling the clone algorithm with session, source property value and seen.

                        3. If cloned property result is a success, @@ -6726,22 +6912,20 @@

                          Executing Script

                          request with argument parameters the implementation must:
                            -
                          1. Let script be the result of - getting a property named script - from the parameters. +

                          2. Let script be the result of getting a + property named "script" from parameters.

                          3. If script is not a String, return error with error code invalid argument. -

                          4. Let args be the result of - getting a property named args - from the parameters. +

                          5. Let args be the result of getting a property + named "args" from parameters.

                          6. If args is not an Array return error with error code invalid argument. -

                          7. Let arguments be the result of calling the - JSON deserialize algorithm with arguments args. +

                          8. Let arguments be JSON deserialize + with session and args.

                          9. Return success with data script and arguments. @@ -6756,7 +6940,8 @@

                            Executing Script

                            1. Let window be the associated window - of the current browsing context’s active document. + of session's current browsing context’s active + document.

                            2. Let environment settings be window’s [=relevant settings object=]. @@ -6830,17 +7015,20 @@

                              Execute Script

                              -

                              The remote end steps are: +

                              The remote end steps, given session, URL +variables and parameters are:

                              1. Let body and arguments be the result of trying to extract the script arguments from a request with argument parameters. -

                              2. If the current browsing context is no longer open, - return error with error code no such window. +

                              3. If session's current browsing context + is no longer open, return error with error + code no such window. -

                              4. Handle any user prompts, and return its value if it is an error. +

                              5. Try to handle any user prompts + with session.

                              6. Let promise be a new Promise. @@ -6861,14 +7049,16 @@

                                Execute Script

                                the session script timeout is reached, return error with error code script timeout. -
                              7. Upon fulfillment of promise with value v, - let result be a JSON clone of v, and +

                              8. Upon fulfillment of promise with + value v, let result be JSON clone + with session and v, and return success with data result. -

                              9. Upon rejection of promise with reason r, - let result be a JSON clone of r, and - return error with error code javascript error - and data result. +

                              10. Upon rejection of promise with + reason r, let result be JSON clone + with session and r, and + return error with error code javascript + error and data result.

                              @@ -6893,17 +7083,20 @@

                              Execute Async Script

                              This is a function that may be invoked to signal the completion of the asynchronous operation. The first argument provided to the function will be serialized to JSON and returned by Execute Async Script. -

                              The remote end steps are: +

                              The remote end steps, given session, URL +variables and parameters are:

                              1. Let body and arguments by the result of trying to extract the script arguments from a request with argument parameters. -

                              2. If the current browsing context is no longer open, - return error with error code no such window. +

                              3. If session's current browsing context + is no longer open, return error with error + code no such window. -

                              4. Handle any user prompts, and return its value if it is an error. +

                              5. Try to handle any user prompts + with session.

                              6. Let promise be a new Promise. @@ -6951,14 +7144,16 @@

                                Execute Async Script

                                session script timeout milliseconds is reached, return error with error code script timeout. -
                              7. Upon fulfillment of promise with value v, - let result be a JSON clone of v, and +

                              8. Upon fulfillment of promise with + value v, let result be JSON clone + with session and v, and return success with data result. -

                              9. Upon rejection of promise with reason r, - let result be a JSON clone of r, and - return error with error code javascript error - and data result. +

                              10. Upon rejection of promise with + reason r, let result be JSON clone + with session and r, and + return error with error code javascript + error and data result.

                              @@ -7034,7 +7229,7 @@

                              Cookies

                              "Domain" ✓ The domain the cookie is visible to. - Defaults to the current browsing context’s + Defaults to session's current browsing context’s active document’s URL domain if omitted when adding a cookie. @@ -7111,8 +7306,8 @@

                              Cookies

                              1. For each cookie among all associated cookies of - the current browsing context’s active document, - run the substeps of the first matching condition: + session's current browsing context’s active + document, run the substeps of the first matching condition:

                                name is undefined @@ -7139,18 +7334,22 @@

                                Get All Cookies

                                -

                                The remote end steps are: +

                                The remote end steps, given session, URL +variables and parameters are:

                                  -
                                1. If the current browsing context is no longer open, - return error with error code no such window. +

                                2. If session's current browsing context + is no longer open, return error with error + code no such window. -

                                3. Handle any user prompts, and return its value if it is an error. +

                                4. Try to handle any user prompts + with session.

                                5. Let cookies be a new List.

                                6. For each cookie in all associated cookies of - the current browsing context’s active document: + session's current browsing context’s active + document:

                                  1. Let serialized cookie be the result @@ -7177,19 +7376,22 @@

                                    Get Named Cookie

                                    -

                                    The remote end steps are: +

                                    The remote end steps, given session, URL +variables and parameters are:

                                      -
                                    1. If the current browsing context is no longer open, - return error with error code no such window. +

                                    2. If session's current browsing context + is no longer open, return error with error + code no such window. -

                                    3. Handle any user prompts, and return its value if it is an error. +

                                    4. Try to handle any user prompts + with session. -

                                    5. If the url variable name - is equal to a cookie’s cookie name - amongst all associated cookies - of the current browsing context’s active document, - return success with the serialized cookie as data. +

                                    6. If the URL variables["name" is equal to + a cookie’s cookie name amongst all associated + cookies of session's current browsing + context’s active document, return success with + the serialized cookie as data.

                                      Otherwise, return error with error code no such cookie. @@ -7210,33 +7412,38 @@

                                      Add Cookie

                                      -

                                      The remote end steps are: +

                                      The remote end steps, given session, URL +variables and parameters are:

                                      1. Let data be the result of getting a property - named cookie from the parameters argument. + named "cookie" from parameters.

                                      2. If data is not a JSON Object with all the required (non-optional) JSON keys listed in the table for cookie conversion, return error with error code invalid argument. -

                                      3. If the current browsing context is no longer open, - return error with error code no such window. +

                                      4. If session's current browsing context + is no longer open, return error with error + code no such window. -

                                      5. Handle any user prompts, and return its value if it is an error. +

                                      6. Try to handle any user prompts + with session. -

                                      7. If the current browsing context’s document element - is a cookie-averse Document object, - return error with error code invalid cookie domain. +

                                      8. If session's current browsing + context’s document element is + a cookie-averse Document object, + return error with error code invalid cookie + domain.

                                      9. If cookie name or cookie value is null, - cookie domain is not equal to - the current browsing context’s active document’s domain, + cookie domain is not equal to session's current + browsing context’s active document’s domain, cookie secure only or cookie HTTP only are not boolean types, - or cookie expiry time is not an integer type, - or it less than 0 or greater than the maximum safe integer, - return error with error code invalid argument. + or cookie expiry time is not an integer type, or it less than 0 or greater than + the maximum safe integer, return error with error + code invalid argument.

                                      10. Create a cookie in the cookie store associated with @@ -7253,7 +7460,7 @@

                                        Add Cookie

                                        Cookie domain

                                        The value if the entry exists, - otherwise the current browsing context’s + otherwise session's current browsing context’s active document’s URL domain.

                                        Cookie secure only @@ -7293,17 +7500,19 @@

                                        Delete Cookie

                                        -

                                        The remote end steps are: +

                                        The remote end steps, given session, URL +variables and parameters are:

                                          -
                                        1. If the current browsing context is no longer open, - return error with error code no such window. +

                                        2. If session's current browsing context + is no longer open, return error with error + code no such window. -

                                        3. Handle any user prompts, and return its value if it is an error. +

                                        4. Try to handle any user prompts + with session. -

                                        5. Delete cookies using - the url variable name parameter - as the filter argument. +

                                        6. Delete cookies using the URL + variables["name"] as the filter argument.

                                        7. Return success with data null.

                                        @@ -7323,13 +7532,16 @@

                                        Delete All Cookies

                                        -

                                        The remote end steps are: +

                                        The remote end steps, given session, URL +variables and parameters are:

                                          -
                                        1. If the current browsing context is no longer open, - return error with error code no such window. +

                                        2. If session's current browsing context + is no longer open, return error with error + code no such window. -

                                        3. Handle any user prompts, and return its value if it is an error. +

                                        4. Try to handle any user prompts + with session.

                                        5. Delete cookies, giving no filtering argument. @@ -7433,15 +7645,16 @@

                                          Actions Options

                                          and get element origin, which is a set of steps used to deserialize an element. -

                                          To get a WebElement origin with origin -and browsing context:, +

                                          To get a WebElement origin +given session, origin and browsing +context:,

                                          1. Assert: browsing context is the current browsing context.

                                          2. Let element be equal to the result of trying to get a known element with - argument origin. + session and origin.

                                          3. Return success with data element.

                                          @@ -7657,7 +7870,7 @@

                                          Pointer input source

                                          To create a pointer input source object given input state, and subtype, return a new pointer input source with subtype set to subtype, pointerId set - to get a pointer id with input state + to get a pointer id with input state and subtype, and the other items set to their default values. @@ -7727,7 +7940,7 @@

                                          Input state

                                          state map[browsing context] to create an input state. -
                                        6. Return input state map[browsing +

                                        7. Return input state map[browsing context].

                                        @@ -7739,7 +7952,7 @@

                                        Input state

                                        context.
                                      11. Let input state map - be session's browsing context input state map. + be session's browsing context input state map.

                                      12. If input state map[browsing context] [=map/exists=], then [=remove=] input state map[browsing @@ -7761,22 +7974,21 @@

                                        Input state

                                        1. Let input state map be input - state's input state map. + state's input state map.

                                        2. Set input state map[input id] to source.
                                        -

                                        To remove an input source given input state, and input id:

                                        1. Assert: None of the items in input - state's input cancel list has id equal + state's input cancel list has id equal to input id.

                                        2. Let input state map be input - state's input state map. + state's input state map.

                                        3. Remove input state map[input id].
                                        @@ -7786,7 +7998,7 @@

                                        Input state

                                        1. Let input state map be input - state's input state map. + state's input state map.

                                        2. If input state map[input id] exists, return input state map[input id]. @@ -7804,7 +8016,7 @@

                                          Input state

                                        3. If source is not undefined and source's type is not equal to type, or source is - a pointer input sourcereturn error with error + a pointer input source, return error with error code invalid argument.

                                        4. If source is undefined, set source to @@ -7861,17 +8073,17 @@

                                          Input state

                                          1. Let minimum id be 0 if subtype is - "mouse', or 2 otherwise. + "mouse", or 2 otherwise.
                                          2. Let pointer ids be an empty set.
                                          3. Let sources be the result of [=map/getting the - values=] with input state's input state map. + values=] with input state's input state map.

                                          4. For each source in sources.:

                                            1. If source is a pointer input source, - append source's pointerId to pointer ids. + append source's pointerId to pointer ids.

                                          5. Return the smallest integer that is greater than or equal @@ -7996,7 +8208,7 @@

                                            Processing actions

                                            1. Let element be the result of trying to - run actions options' get element origin + run actions options' get element origin steps with origin and browsing context.

                                            2. If element is null, return error with error @@ -8021,13 +8233,12 @@

                                              Processing actions

                                              options:
                                                -
                                              1. Let actions be the result - of getting a property from parameters - named actions. +

                                              2. Let actions be the result of getting a + property named "actions" from parameters. -

                                              3. If actions is undefined - or is not an Array, - return error with error code invalid argument. +

                                              4. If actions is undefined or is not + an Array, return error with error + code invalid argument.

                                              5. Let actions by tick be an empty List.

                                              6. @@ -8103,7 +8314,7 @@

                                                Processing actions

                                                with error code invalid argument.
                                              7. Let action items be the result of getting a - property named actions from + property named "actions" from action sequence.

                                              8. If action items is not an Array, @@ -8165,7 +8376,7 @@

                                                Processing actions

                                              9. Let pointer type be the result -of getting a property named pointerType +of getting a property named "pointerType" from parameters data.

                                              10. @@ -8251,10 +8462,8 @@

                                                Processing actions

                                                action item and action, and return result. -
                                              11. -Let key be the result -of getting a property named value -from action item. +

                                              12. Let key be the result of getting a property +named "value" from action item.

                                              13. If key is not a String containing a single unicode code point @@ -8357,7 +8566,7 @@

                                                Processing actions

                                              14. Let duration be the result of getting a property -named duration from action item. +named "duration" from action item.

                                              15. If duration is not undefined and duration @@ -8378,7 +8587,7 @@

                                                Processing actions

                                              16. If origin is not equal to "viewport", -or actions options' is element origin steps given +or actions options' is element origin steps given origin return false, return error with error code invalid argument. @@ -8751,16 +8960,16 @@

                                                Dispatching actions

                                                1. Let token be a new unique identifier. -

                                                2. Enqueue token in session's actions +

                                                3. Enqueue token in input state's actions queue.

                                                4. Wait for token to be the first item - in input state's actions queue. + in input state&aposs actions queue.

                                                To dispatch a list of actions given input -state, actions, browsing context, +state, actions, browsing context, and actions options:

                                              General actions

                                              -

                                              To dispatch a pause action given action object, -source, global key state, tick duration, +

                                              To dispatch a pause action given action +object, source, global key +state, tick duration, browsing context, and actions options:

                                                @@ -9200,8 +9410,8 @@

                                                Keyboard actions

                                                \uE05DNumpad Delete3 -

                                                To dispatch a keyDown action given action object, -source, global key state, tick +

                                                To dispatch a keyDown action given action +object, source, global key state, tick duration, browsing context, and actions options:

                                                  @@ -9301,7 +9511,7 @@

                                                  Keyboard actions

                                                  key repetition. -

                                                  To dispatch a keyUp action given,action +

                                                  To dispatch a keyUp action given, action object, source, global key state, tick duration, browsing context, and actions options: @@ -9380,8 +9590,8 @@

                                                  Keyboard actions

                                                  Pointer actions

                                                  To dispatch a pointerDown action given - action object, input state, global key state, - tick duration, browsing context, + action object, input state, global key + state, tick duration, browsing context, and actions options:

                                                    @@ -9434,7 +9644,7 @@

                                                    Pointer actions

                                                  1. Perform implementation-specific action dispatch steps on browsing context equivalent to pressing the button numbered button on the pointer with pointerId equal - to input source's pointerId, having + to input source's pointerId, having type pointerType at viewport x coordinate x, viewport y coordinate y, width, height, pressure, tangentialPressure, tiltX, @@ -9485,7 +9695,7 @@

                                                    Pointer actions

                                                  2. Perform implementation-specific action dispatch steps on browsing context equivalent to releasing the button numbered button on the pointer with pointerId equal - to input source's pointerId, having + to input source's pointerId, having type pointerType at viewport x coordinate x, viewport y coordinate y, with buttons buttons depressed, in accordance with the requirements of [[UI-EVENTS]] and @@ -9504,8 +9714,8 @@

                                                    Pointer actions

                                                  3. Return success with data null.

                                                  -

                                                  To dispatch a pointerMove action given -action object, source, global key state, +

                                                  To dispatch a pointerMove action given action +object, source, global key state, tick duration, browsing context, and actions options: @@ -9632,7 +9842,7 @@

                                                  Pointer actions

                                                1. Perform implementation-specific action dispatch steps on browsing context equivalent to moving the pointer - with pointerId equal to input source's pointerId, + with pointerId equal to input source's pointerId, having type pointerType from viewport x coordinate current x, viewport y coordinate current y to viewport x @@ -9695,15 +9905,15 @@

                                                  Pointer actions

                                                -

                                                To dispatch a pointerCancel action given -action object, source, global key state, +

                                                To dispatch a pointerCancel action given action +object, source, global key state, tick duration, browsing context, and actions options:

                                                1. Perform implementation-specific action dispatch steps on browsing context equivalent to cancelling the any - action of the pointer with pointerId equal to source's + action of the pointer with pointerId equal to source's pointerId item. having type pointerType, in accordance with the requirements of [[UI-EVENTS]] and [[POINTER-EVENTS]]. @@ -9715,8 +9925,8 @@

                                                  Pointer actions

                                                  Wheel actions

                                                  -

                                                  To dispatch a scroll action given -action object, source, global key state, +

                                                  To dispatch a scroll action given action +object, source, global key state, tick duration, browsing context, and actions options: @@ -9880,12 +10090,14 @@

                                                  Perform Actions

                                                  -

                                                  The remote end steps are: +

                                                  The remote end steps, given session, URL +variables and parameters are:

                                                    -
                                                  1. Let input state be the result of get the - input state with current session and current - top-level browsing context. +

                                                  2. Let input state be the result of get the input + state with session + and session's current top-level browsing + context.

                                                  3. Let actions options be a new actions options with the is element origin steps set to represents a web @@ -9893,17 +10105,17 @@

                                                    Perform Actions

                                                    to get a WebElement origin.
                                                  4. Let actions by tick be the result of trying - to extract an action sequence given input state, + to extract an action sequence with input state, parameters, and actions options. -

                                                  5. If the current browsing context is no longer - open, return error with error code no such - window. +

                                                  6. If session's current browsing context + is no longer open, return error with error + code no such window. -

                                                  7. Handle any user prompts. If this results in - an error, return that error. +

                                                  8. Try to handle any user prompts + with session. -

                                                  9. Dispatch actions given input state, +

                                                  10. Dispatch actions with input state, actions by tick, current browsing context, and actions options. If this results in an error return that error. @@ -9935,14 +10147,16 @@

                                                    Release Actions

                                                    as if the state was released by an explicit series of actions. It also clears all the internal state of the virtual devices. -

                                                    The remote end steps are: +

                                                    The remote end steps, given session, URL +variables and parameters are:

                                                      -
                                                    1. If the current browsing context is no longer open, - return error with error code no such window. +

                                                    2. If session's current browsing context + is no longer open, return error with error + code no such window.

                                                    3. Let input state be the result of get the - input state with current session and current + input state with session and current top-level browsing context.

                                                    4. Let actions options be a new actions options @@ -9954,11 +10168,13 @@

                                                      Release Actions

                                                      state’s input cancel list in reverse order.
                                                    5. Try to dispatch tick actions with arguments - undo actions, 0, current browsing - context, and actions options. + undo + actions, 0,session's current + browsing context, and actions options. -

                                                    6. Reset the input state with current session - and current top-level browsing context. +

                                                    7. Reset the input state with session + and session's current top-level browsing + context.

                                                    8. Return success with data null.

                                                    @@ -9969,11 +10185,11 @@

                                                    Release Actions

                                                    User prompts

                                                    -

                                                    This chapter describes interaction with various types of user prompts. - The common denominator for user prompts is that they are - modal windows requiring users to interact with them - before the event loop is unpaused - and control is returned to the current top-level browsing context. +

                                                    This chapter describes interaction with various types of user + prompts. The common denominator for user prompts is that they + are modal windows requiring users to interact with them before + the event loop is unpaused and control is returned + to session's current top-level browsing context.

                                                    By default user prompts are not handled automatically unless a user prompt handler has been defined. @@ -10008,8 +10224,8 @@

                                                    User prompts

                                                    Alert window.alert - Accept Alert
                                                    - Dismiss Alert
                                                    + Accept Alert
                                                    + Dismiss Alert
                                                    Get Alert Text @@ -10017,8 +10233,8 @@

                                                    User prompts

                                                    Confirm window.confirm - Dismiss Alert
                                                    - Accept Alert
                                                    + Dismiss Alert
                                                    + Accept Alert
                                                    Get Alert Text @@ -10026,9 +10242,9 @@

                                                    User prompts

                                                    Prompt window.prompt - Dismiss Alert
                                                    - Accept Alert
                                                    - Get Alert Text
                                                    + Dismiss Alert
                                                    + Accept Alert
                                                    + Get Alert Text
                                                    Send Alert Text @@ -10116,8 +10332,8 @@

                                                    User prompts

                                                    message.
                                -

                                In order to handle any user prompts - a remote end must take the following steps: +

                                To handle any user prompts + given session, remote end must:

                                1. @@ -10126,7 +10342,7 @@

                                  User prompts

                                2. Perform the following substeps -based on the current session’s user prompt handler: +based on the session’s user prompt handler:

                                  dismiss state @@ -10197,11 +10413,13 @@

                                  Dismiss Alert

                                  which may not necessarily have a dismiss button, has the same effect as accepting it. -

                                  The remote end steps are: +

                                  The remote end steps, given session, URL +variables and parameters are:

                                    -
                                  1. If the current top-level browsing context is no longer open, - return error with error code no such window. +

                                  2. If session's current top-level browsing + context is no longer open, return error + with error code no such window.

                                  3. If there is no current user prompt, return error with error code no such alert. @@ -10226,11 +10444,13 @@

                                    Accept Alert

                                    -

                                    The remote end steps are: +

                                    The remote end steps, given session, URL +variables and parameters are:

                                      -
                                    1. If the current top-level browsing context is no longer open, - return error with error code no such window. +

                                    2. If session's current top-level browsing + context is no longer open, return error + with error code no such window.

                                    3. If there is no current user prompt, return error with error code no such alert. @@ -10255,11 +10475,13 @@

                                      Get Alert Text

                                      -

                                      The remote end steps are: +

                                      The remote end steps, given session, URL +variables and parameters are:

                                        -
                                      1. If the current top-level browsing context is no longer open, - return error with error code no such window. +

                                      2. If session's current top-level browsing + context is no longer open, return error + with error code no such window.

                                      3. If there is no current user prompt, return error with error code no such alert. @@ -10291,7 +10513,8 @@

                                        Send Alert Text

                                        sets the text field of a window.prompt user prompt to the given value. -

                                        The remote end steps are: +

                                        The remote end steps, given session, URL +variables and parameters are:

                                        1. Let text be the result of @@ -10301,8 +10524,9 @@

                                          Send Alert Text

                                        2. If text is not a String, return error with error code invalid argument. -

                                        3. If the current top-level browsing context is no longer open, - return error with error code no such window. +

                                        4. If session's current top-level browsing + context is no longer open, return error + with error code no such window.

                                        5. If there is no current user prompt, return error with error code no such alert. @@ -10411,14 +10635,14 @@

                                          Screen capture

                                          [=a serialization of the bitmap as a file|a serialization of the `canvas` element’s bitmap as a file=], using "image/png" as an argument. -
                                        6. Let data url be a data: URL +

                                        7. Let data URL be a data: URL representing file. [[RFC2397]]

                                        8. Let index be the index of "," - in data url. + in data URL.

                                        9. Let encoded string be a substring - of data url using (index + 1) as the start argument. + of data URL using (index + 1) as the start argument.

                                        10. Return success with data encoded string.

                                        @@ -10437,15 +10661,18 @@

                                        Take Screenshot

                                        -

                                        The remote end steps are: +

                                        The remote end steps, given session, URL +variables and parameters are:

                                          -
                                        1. If the current top-level browsing context is no longer open, - return error with error code no such window. +

                                        2. If session's current top-level browsing + context is no longer open, return error + with error code no such window.

                                        3. When the user agent is next to run the animation frame callbacks:

                                            -
                                          1. Let root rect be the current top-level browsing context’s +

                                          2. Let root rect be session's current + top-level browsing context's document element’s rectangle.

                                          3. Let screenshot result be the result of trying to call @@ -10484,17 +10711,20 @@

                                            Take Element Screenshot

                                            takes a screenshot of the visible region encompassed by the bounding rectangle of an element. -

                                            The remote end steps are: +

                                            The remote end steps, given session, URL +variables and parameters are:

                                              -
                                            1. If the current browsing context is no longer open, - return error with error code no such window. +

                                            2. If session's current browsing context + is no longer open, return error with error + code no such window. -

                                            3. Handle any user prompts and return its value if it is an error. +

                                            4. Try to handle any user prompts + with session.

                                            5. Let element be the result of - trying to get a known element - with url variable element id. + trying to get a known element with session + and URL variables["element id"].

                                            6. Scroll into view the element. @@ -10634,18 +10864,20 @@

                                              Print Page

                                              -

                                              The remote end steps are: +

                                              The remote end steps, given session, URL +variables and parameters are:

                                                -
                                              1. If the current top-level browsing context is no longer open, - return error with error code no such window. +

                                              2. If session's current top-level browsing + context is no longer open, return error + with error code no such window. -

                                              3. Handle any user prompts and return its value if it is an error. +

                                              4. Try to handle any user prompts + with session.

                                              5. Let orientation be the result of getting a - property with default named orientation and with - default "portrait" from the parameters - argument. + property with default named "orientation" and with + default "portrait" from parameters.

                                              6. If orientation is not a String or does not have one of the values "landscape" or @@ -10653,30 +10885,30 @@

                                                Print Page

                                                code invalid argument.
                                              7. Let scale be the result of getting a - property with default named scale and with - default 1 from the parameters argument. + property with default named "scale" and with + default 1 from parameters.

                                              8. If scale is not a Number, or is less than 0.1 or greater than 2 return error with error code invalid argument.

                                              9. Let background be the result of getting a - property with default named background and with - default false from the parameters argument. + property with default named "background" and with + default false from parameters.

                                              10. If background is not a Boolean return error with error code invalid argument.

                                              11. Let page be the result of getting a property - with default named page and with a default of an - empty Object from the parameters argument. + with default named "page" and with a default of an + empty Object from parameters.

                                              12. Let pageWidth be the result of getting a - property with default named width and with a + property with default named "width" and with a default of 21.59 from page.

                                              13. Let pageHeight be the result of getting a - property with default named height and with a + property with default named "height" and with a default of 27.94 from page.

                                              14. If either of pageWidth or pageHeight is @@ -10684,23 +10916,23 @@

                                                Print Page

                                                with error code invalid argument.
                                              15. Let margin be the result of getting a property - with default named margin and with a default of an - empty Object from the parameters argument. + with default named "margin" and with a default of an + empty Object from parameters.

                                              16. Let marginTop be the result of getting a - property with default named top and with a + property with default named "top" and with a default of 1 from margin.

                                              17. Let marginBottom be the result of getting a - property with default named bottom and with a + property with default named "bottom" and with a default of 1 from margin.

                                              18. Let marginLeft be the result of getting a - property with default named left and with a + property with default named "left" and with a default of 1 from margin.

                                              19. Let marginRight be the result of getting a - property with default named right and with a + property with default named "right" and with a default of 1 from margin.

                                              20. If any @@ -10709,15 +10941,15 @@

                                                Print Page

                                                return error with error code invalid argument.
                                              21. Let shrinkToFit be the result of getting a - property with default named shrinkToFit and with - default true from the parameters argument. + property with default named "shrinkToFit" and with + default true from parameters.

                                              22. If shrinkToFit is not a Boolean return error with error code invalid argument.

                                              23. Let pageRanges be the result of getting a - property with default named pageRanges from - the parameters argument with default of an + property with default named "pageRanges" from + parameters with default of an empty Array.

                                              24. If pageRanges is not an Array @@ -10726,8 +10958,9 @@

                                                Print Page

                                              25. When the user agent is next to run the animation frame callbacks, let pdfData be the result of trying to take UA-specific steps to generate a paginated representation of - the current browsing context, with the CSS media type set - to print, encoded as a PDF, with the following paper settings: + session's current browsing context, with the + CSS media type set to print, encoded as a PDF, + with the following paper settings:
                                                Property From b70ad7e438bd453a91674126bdd534d7c93e91a6 Mon Sep 17 00:00:00 2001 From: jgraham Date: Mon, 26 Feb 2024 16:09:00 +0000 Subject: [PATCH 2/2] Update index.html Co-authored-by: Maksim Sadym <69349599+sadym-chromium@users.noreply.github.com> --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 7899d9fe..86a9bc62 100644 --- a/index.html +++ b/index.html @@ -632,7 +632,7 @@

                                                Routing requests

                                              26. Remove each entry from endpoints for which the concatenation of the URL prefix and the entry’s URI template does not have a valid expansion equal to - to URL’s path. + URL’s path.

                                              27. If there are no entries in endpoints, return error with error code unknown command.