From 317d1796e9f788311579614855d64fc8b78e944a Mon Sep 17 00:00:00 2001 From: Alex Rudenko Date: Tue, 13 Feb 2024 10:49:40 +0100 Subject: [PATCH] generalize to accessible attributes --- index.bs | 51 +++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 37 insertions(+), 14 deletions(-) diff --git a/index.bs b/index.bs index eb6e1370a..3ea790f4e 100644 --- a/index.bs +++ b/index.bs @@ -246,9 +246,12 @@ spec: UNICODE; urlPrefix: https://www.unicode.org/versions/Unicode15.0.0/ type: dfn text: Unicode Default Case Conversion algorithm; url: ch03.pdf#G34944 text: toUppercase; url: ch03.pdf#G34078 -spec: WAI-ARIA; urlPrefix:https://w3c.github.io/aria/ +spec: ACCNAME; urlPrefix:https://www.w3.org/TR/accname-1.2 type: dfn - text: WAI-ARIA role; url: #introroles + text: accessible name; url: /#dfn-accessible-name +spec: CORE-AAM; urlPrefix:https://www.w3.org/TR/core-aam-1.2 + type: dfn + text: accessible role; url: /#roleMappingComputedRole
@@ -2190,7 +2193,7 @@ To await a navigation given |context|, |request|, |wait condition|, a
 browsingContext.Locator = (
    browsingContext.CssLocator /
    browsingContext.InnerTextLocator /
-   browsingContext.RoleLocator /
+   browsingContext.AccessibilityLocator /
    browsingContext.XPathLocator
 )
 
@@ -2207,9 +2210,13 @@ browsingContext.InnerTextLocator = {
    ? maxDepth: js-uint,
 }
 
-browsingContext.RoleLocator = {
-   type: "role",
-   value: text
+browsingContext.AccessibilityLocator = {
+   type: "accessibility",
+   value: {
+    role?: text,
+    name?: text,
+    Extensible
+   }
 }
 
 browsingContext.XPathLocator = {
@@ -3085,20 +3092,36 @@ and |session|:
 
 
 
-
-To locate nodes using role with given |context nodes|, |selector|, +
+To locate nodes using accessibility attributes with given |context nodes|, |selector|, |maximum returned node count|, and |session|: -1. If |selector| is the empty string, return [=error=] with [=error code=] +1. If |selector|'s role and |selector|'s name are missing, return [=error=] with [=error code=] [=invalid selector=]. 1. Let |returned nodes| be an empty [=/list=]. 1. For each |context node| in |context nodes|: - 1. Let |role| be the result of computing the [=WAI-ARIA role=] of |context node|. + 1. Let |match| be true. + + 1. If |selector|'s role is present: + + 1. Let |role| be the result of computing the [=accessible role=] of |context node|. + + 1. If |selector|'s role [=is|is not=] |role|: + + 1. Set |match| to false. + + 1. If |selector|'s name is present: + + 1. Let |name| be the result of computing the [=accessible name=] of |context node|. + + 1. If |selector|'s name [=is|is not=] |name|: + + 1. Set |match| to false. - 1. If |selector| [=is=] |role|: + 1. If |match| is true: 1. [=list/Append=] |context node| to |returned nodes|. @@ -3107,7 +3130,7 @@ To locate nodes using role with given |context nodes|, |selector|, 1. If |child| implements {{Element}}, [=list/append=] |child| to |child nodes|. - 1. Let |child node matches| be the result of [=locate nodes using role=] + 1. Let |child node matches| be the result of [=locate nodes using accessibility attributes=] with |child nodes|, |selector|, |maximum returned node count|, and |session|. 1. [=list/Extend=] |returned nodes| with |child node matches|. @@ -3205,11 +3228,11 @@ The [=remote end steps=] with |session| and |command parameters| are: given |current context target|, |context nodes|, |selector|, |max depth|, |match type|, |ignore case|, |maximum returned node count| and |session|. -
|type| is the string "role" +
|type| is the string "accessibility"
1. Let |selector| be |locator|["value"]. - 1. Let |result nodes| be a result of [=trying=] to [=locate nodes using role=] + 1. Let |result nodes| be a result of [=trying=] to [=locate nodes using accessibility attributes=] given |context nodes|, |selector|, |maximum returned node count| and |session|.