From d05e4632b34a3e916b534c8dc9763c25dcf55465 Mon Sep 17 00:00:00 2001 From: Henrik Skupin Date: Thu, 7 Mar 2024 12:34:38 +0100 Subject: [PATCH 1/5] Add definition of "weak map" (#1713) --- index.html | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 8c798ea7..51e093e8 100644 --- a/index.html +++ b/index.html @@ -4256,15 +4256,23 @@

Elements

representing a handle to a DOM node in a specific WebDriver session. +

A weak map is a [=infra/map=] in which keys are held weakly +i.e. items are removed if the key object is garbaged collected, and presence +in the map does not prevent garbage collection. This acts as an alternative +to defining properties directly on the key objects. + +

Unlike the ECMAScript [=WeakMap=] type, a weak map can +participate in the full set of operations available for a Map. +

A WebDriver session has a browsing context group node -map, which is a weak map between a browsing context group +map, which is a weak map between a browsing context group and a node id map. -

A node id map is weak map between nodes and their +

A node id map is weak map between nodes and their corresponding WebDriver node id.

A WebDriver session has a navigable seen nodes map -which is a weak map between a [=navigable=] and a set. +which is a weak map between a [=navigable=] and a set.

To get a node given session, browsing context, and reference: From b7d581e4b847edad324708eae416bf2db872761e Mon Sep 17 00:00:00 2001 From: Henrik Skupin Date: Thu, 7 Mar 2024 12:42:53 +0100 Subject: [PATCH 2/5] Revert "Add definition of "weak map" (#1713)" (#1803) This reverts commit d05e4632b34a3e916b534c8dc9763c25dcf55465. --- index.html | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/index.html b/index.html index 51e093e8..8c798ea7 100644 --- a/index.html +++ b/index.html @@ -4256,23 +4256,15 @@

Elements

representing a handle to a DOM node in a specific WebDriver session. -

A weak map is a [=infra/map=] in which keys are held weakly -i.e. items are removed if the key object is garbaged collected, and presence -in the map does not prevent garbage collection. This acts as an alternative -to defining properties directly on the key objects. - -

Unlike the ECMAScript [=WeakMap=] type, a weak map can -participate in the full set of operations available for a Map. -

A WebDriver session has a browsing context group node -map, which is a weak map between a browsing context group +map, which is a weak map between a browsing context group and a node id map. -

A node id map is weak map between nodes and their +

A node id map is weak map between nodes and their corresponding WebDriver node id.

A WebDriver session has a navigable seen nodes map -which is a weak map between a [=navigable=] and a set. +which is a weak map between a [=navigable=] and a set.

To get a node given session, browsing context, and reference: From 52c3e3ab1fb6b61659715c143694555c241c3b1c Mon Sep 17 00:00:00 2001 From: Alex Rudenko Date: Thu, 7 Mar 2024 12:44:40 +0100 Subject: [PATCH 3/5] Add a capability for returning the default user agent header value (#1790) * Add userAgent capability * add userAgent to matching * Update index.html Co-authored-by: Henrik Skupin --------- Co-authored-by: Henrik Skupin --- index.html | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/index.html b/index.html index 8c798ea7..6f54b0cb 100644 --- a/index.html +++ b/index.html @@ -1573,6 +1573,13 @@

Capabilities

Describes the session's user prompt handler. Defaults to the dismiss and notify state. + + + User Agent + "userAgent" + string + Identifies the default User-Agent value of the endpoint node. +
@@ -2001,6 +2008,9 @@

Processing capabilities

Boolean indicating whether the remote end supports all of the resizing and positioning commands. + +
"userAgent" +
String containing the default User-Agent value.
  • If flags contains "http", add the @@ -11336,6 +11346,7 @@

    Index

    The following terms are defined in the WHATWG Fetch specification: [[FETCH]]

    • Body +
    • default User-Agent value
    • Header
    • Header Name
    • Header Value From 29d400adcfb6011eff926dd718d6dfd92b8ec11f Mon Sep 17 00:00:00 2001 From: Henrik Skupin Date: Thu, 7 Mar 2024 15:41:50 +0100 Subject: [PATCH 4/5] Add definition for "weak map" (#1804) --- index.html | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index 6f54b0cb..192580e5 100644 --- a/index.html +++ b/index.html @@ -2232,7 +2232,7 @@

      Sessions

      Unless stated otherwise it is in the dismiss and notify state.

      A session has an associated browsing context input -state map, which is a Weak Map with top-level browsing +state map, which is a weak map with top-level browsing contexts as keys, and input state objects as values. This is initially set to an empty map. @@ -4266,15 +4266,24 @@

      Elements

      representing a handle to a DOM node in a specific WebDriver session. +

      A weak map is a map in which keys are held +weakly i.e. items are removed if the key object is garbaged collected, and +presence in the map does not prevent garbage collection. This acts as an +alternative to defining properties directly on the key objects. + +

      Unlike the ECMAScript WeakMap, +a weak map can participate in the full set of operations available for +a Map. +

      A WebDriver session has a browsing context group node -map, which is a weak map between a browsing context group +map, which is a weak map between a browsing context group and a node id map. -

      A node id map is weak map between nodes and their +

      A node id map is weak map between nodes and their corresponding WebDriver node id.

      A WebDriver session has a navigable seen nodes map -which is a weak map between a [=navigable=] and a set. +which is a weak map between a [=navigable=] and a set.

      To get a node given session, browsing context, and reference: @@ -4309,7 +4318,7 @@

      Elements

    • If browsing context group node map does not contain browsing context group, set browsing context - group node map[browsing context group] to a new weak map. + group node map[browsing context group] to a new weak map.
    • Let node id map be browsing context group node map[browsing context group]. From 44031bebc2ff5be012fbc1eac56c63e48e75d89a Mon Sep 17 00:00:00 2001 From: James Graham Date: Thu, 7 Mar 2024 14:26:58 +0000 Subject: [PATCH 5/5] Fix unreferenced definitions This takes us down to zero respec warnings when bulding the spec. We still have terms which are only referenced in non-normative contexts. That's probably also a bug, and could be fixed in a followup. However this at least provides a clean baseline for future spec work. --- index.html | 190 ++++++++++++++++++++++------------------------------- 1 file changed, 79 insertions(+), 111 deletions(-) diff --git a/index.html b/index.html index 192580e5..c6f09b5e 100644 --- a/index.html +++ b/index.html @@ -288,12 +288,9 @@

      Nodes

      Intermediary nodes are those that act as proxies, implementing both the local end and remote end of the protocol. However they are not expected - to implement remote end steps directly. All nodes between a - specific intermediary node and a local end are said to - be downstream of that - node. Conversely, any nodes between a specific intermediary - node and an endpoint node are said to - be upstream. + to implement remote end steps directly. Nodes between + a specific intermediary node and an endpoint node are + said to be upstream of the endpoint node.
      Endpoint node
      An endpoint node is the final remote end @@ -1395,30 +1392,31 @@

      Extensions

      Other specifications may define additional WebDriver capabilities. Each defined -capability must have a capability name which is a string -not containing a ":" (colon) character, -an additional capability deserialization algorithm which is -a set of steps taking a single argument value which has a -JSON type, returning either success wrapping the deserialized -capability value or error. +capability must have a capability name which +is a string not containing a ":" (colon) character, +an additional capability deserialization +algorithm which is a set of steps taking a single +argument value which has a JSON type, returning +either success wrapping the deserialized capability value +or error.

      An additional WebDriver capability may also define -a matched capability serialization algorithm, which is a -set of steps used to determine if a capability is matched by the -current implementation and provide any computed value to return to the -user. This set of steps takes a single argument value, -which is the output of the corresponding additional capability -deserialization algorithm, and returns -either null to indicate the capability is not -matched, or a non-null JSON-serializable value if the capability is -matched. - -

      Other specifications may also define WebDriver -new session algorithms, which are -called just after a new session is created, and before the new -session response is sent to the remote end. These -algorithms are called with session representing the -WebDriver session that will be established, and +a matched capability serialization algorithm, +which is a set of steps used to determine if a capability is matched +by the current implementation and provide any computed value to return +to the user. This set of steps takes a single +argument value, which is the output of the +corresponding additional capability deserialization algorithm, +and returns either null to indicate the capability +is not matched, or a non-null JSON-serializable value if the +capability is matched. + +

      Other specifications may also define WebDriver +new session algorithms, which are called just after a new +session is created, and before the new session response is sent +to the remote end. These algorithms are called +with session representing the WebDriver session that will +be established, and capabilities, the capabilities object that will be returned to the remote end. It is permitted for such an algorithm to modify any entry in the capabilities object with a name that's an @@ -1502,21 +1500,21 @@

      Capabilities

      - Browser name + Browser name "browserName" string Identifies the user agent. - Browser version + Browser version "browserVersion" string Identifies the version of the user agent. - Platform name + Platform name "platformName" string Identifies the operating system of the endpoint node. @@ -1575,7 +1573,7 @@

      Capabilities

      - User Agent + User Agent "userAgent" string Identifies the default User-Agent value of the endpoint node. @@ -1613,16 +1611,15 @@

      Proxy

      - proxyAutoconfigUrl + proxyAutoconfigUrl string - Defines the URL for a proxy auto-config file - if proxyType - is equal to "pac". + Defines the URL for a proxy autoconfiguration file + if proxyType is equal to "pac". Any URL. - ftpProxy + ftpProxy string Defines the proxy host for FTP traffic when the proxyType is "manual". @@ -1631,7 +1628,7 @@

      Proxy

      - httpProxy + httpProxy string Defines the proxy host for HTTP traffic when the proxyType is "manual". @@ -1640,7 +1637,7 @@

      Proxy

      - noProxy + noProxy array Lists the address for which the proxy should be bypassed when the proxyType is "manual". @@ -1648,7 +1645,7 @@

      Proxy

      - sslProxy + sslProxy string Defines the proxy host for encrypted TLS traffic when the proxyType is "manual". @@ -1657,7 +1654,7 @@

      Proxy

      - socksProxy + socksProxy string Defines the proxy host for a SOCKS proxy when the proxyType is "manual". @@ -1665,7 +1662,7 @@

      Proxy

      - socksVersion + socksVersion number Defines the SOCKS proxy version when the proxyType is "manual". @@ -3875,16 +3872,10 @@

      Resizing and positioning windows

      -

      If for whatever reason - the top-level browsing context's OS window - cannot enter either of the window states, - or if this concept is not applicable on the current system, - the default state must be normal. - -

      A top-level browsing context's window rect - is defined as a dictionary of the screenX, screenY, - outerWidth and outerHeight attributes - of the WindowProxy. +

      If for whatever reason the top-level browsing context's +OS window cannot enter either of the window states, or if this +concept is not applicable on the current system, the default state +must be normal.

      The WindowRect object for a WindowProxy, window is an Object initialized @@ -3923,8 +3914,8 @@

      Resizing and positioning windows

      given an operating system level window with an associated top-level browsing context, run implementation-specific steps - to iconify, minimize, or hide the window - from the visible screen. + to transition the operating system level window + into the minimized window state. Do not return from this operation until the visibility state of the top-level browsing context's active document @@ -4239,6 +4230,8 @@

      Fullscreen Window

      with session's current top-level browsing context's active document's document element. +

      The window is now in the Fullscreen window state. +

    • Return success with data set to the WindowRect object for the session's current top-level browsing context. @@ -5752,27 +5745,27 @@

      Get Element Rect

      The Get Element Rect command returns the dimensions and coordinates of the given web element. -The returned value is a dictionary with the following members: +The returned value is an object with the following properties:

      -
      x +
      "x"
      X axis position of the top-left corner of the web element relative to session's current browsing context's document element in CSS pixels. -
      y +
      "y"
      Y axis position of the top-left corner of the web element relative to session's current browsing context's document element in CSS pixels. -
      height +
      "height"
      Height of the web element's bounding rectangle in CSS pixels. -
      width +
      "width"
      Width of the web element's bounding rectangle in CSS pixels. @@ -7881,7 +7874,7 @@

      Pointer input source

      move to, either in its active (pressed) or inactive state. - pointerCancel + pointerCancel Used to cancel a pointer action. @@ -11114,19 +11107,25 @@

      Element displayedness

      considered visible if any part of it is drawn on the canvas within the boundaries of the viewport. -

      The element displayed algorithm - is a boolean state where true signifies that the element is displayed - and false signifies that the element is not displayed. - To compute the state on element, - invoke the Function.[[\Call]](null, element, - false), - with bot.dom.isShown as the this value. - If doing so does not produce an error, - return the return value from this function call. - Otherwise return an error with error code unknown error. - -

      This function is typically exposed to GET requests - with a URI Template of +

      The element displayed state is a boolean representing +whether an element is currently visible. + +

      To get the element displayed state using +the bot.dom.isShown Selenium atoms, +given element: +

        +
      1. Let function be + the bot.dom.isShown function. +

      2. Let result be the result of calling function's + [[\Call]] internal method with arguments + null and element. If this raises an exception, return + an error with error code unknown error. + +

      3. Return success with data result. +

        + +

        The element displayed state is typically exposed as an + endpoint for GET requests with a URI Template of /session/{session id}/element/{element id}/displayed.

  • @@ -11256,7 +11255,6 @@

    Index

    @@ -11265,25 +11263,12 @@

    Index

    -

    The following attributes are defined - in the UI Events Code specification: [[UIEVENTS-CODE]] -

    -

    The following attributes are defined in the UI Events Code specification: [[UIEVENTS-KEY]]

    This specification also presumes that you are able to call - some of the internal methods + some of the internal methods from the ECMAScript Language Specification [[ECMAScript]]: