@@ -269,6 +269,12 @@ spec: UNICODE; urlPrefix: https://www.unicode.org/versions/Unicode15.0.0/
269
269
type: dfn
270
270
text: Unicode Default Case Conversion algorithm; url: ch03.pdf#G34944
271
271
text: toUppercase; url: ch03.pdf#G34078
272
+ spec: ACCNAME; urlPrefix:https://www.w3.org/TR/accname-1.2
273
+ type: dfn
274
+ text: accessible name; url: /#dfn-accessible-name
275
+ spec: CORE-AAM; urlPrefix:https://www.w3.org/TR/core-aam-1.2
276
+ type: dfn
277
+ text: computed role; url: /#roleMappingComputedRole
272
278
</pre>
273
279
274
280
<pre class="biblio">
@@ -2499,11 +2505,20 @@ To <dfn>await a navigation</dfn> given |context|, |request|, |wait condition|, a
2499
2505
2500
2506
<pre class="cddl remote-cddl local-cddl">
2501
2507
browsingContext.Locator = (
2508
+ browsingContext.AccessibilityLocator /
2502
2509
browsingContext.CssLocator /
2503
2510
browsingContext.InnerTextLocator /
2504
2511
browsingContext.XPathLocator
2505
2512
)
2506
2513
2514
+ browsingContext.AccessibilityLocator = {
2515
+ type: "accessibility",
2516
+ value: {
2517
+ ? name: text,
2518
+ ? role: text,
2519
+ }
2520
+ }
2521
+
2507
2522
browsingContext.CssLocator = {
2508
2523
type: "css",
2509
2524
value: text
@@ -3405,6 +3420,67 @@ To <dfn>locate nodes using inner text</dfn> with given |context nodes|,
3405
3420
3406
3421
</div>
3407
3422
3423
+ <div algorithm="collect nodes using accessibility attributes">
3424
+ To <dfn>collect nodes using accessibility attributes</dfn> with given |context nodes|, |selector|,
3425
+ |maximum returned node count|, and |returned nodes|:
3426
+
3427
+ 1. If |returned nodes| is null:
3428
+
3429
+ 1. Set |returned nodes| to an empty [=/list=] .
3430
+
3431
+ 1. For each |context node| in |context nodes|:
3432
+
3433
+ 1. Let |match| be true.
3434
+
3435
+ 1. If |selector| [=map/contains=] "<code> role</code> ":
3436
+
3437
+ 1. Let |role| be the [=computed role=] of |context node|.
3438
+
3439
+ 1. If |selector|["<code>role</code>"] [=is|is not=] |role|:
3440
+
3441
+ 1. Set |match| to false.
3442
+
3443
+ 1. If |selector| [=map/contains=] "<code> name</code> ":
3444
+
3445
+ 1. Let |name| be the [=accessible name=] of |context node|.
3446
+
3447
+ 1. If |selector|["<code>name</code>"] [=is|is not=] |name|:
3448
+
3449
+ 1. Set |match| to false.
3450
+
3451
+ 1. If |match| is true:
3452
+
3453
+ 1. If |maximum returned node count| is not null and [=list/size=] of |returned
3454
+ nodes| is equal to |maximum returned node count|, [=break=] .
3455
+
3456
+ 1. [=list/Append=] |context node| to |returned nodes|.
3457
+
3458
+ 1. Let |child nodes| be an empty [=/list=] and, for each node |child| in the
3459
+ <a spec=dom>children</a> of |context node|:
3460
+
3461
+ 1. If |child| implements {{Element}} , [=list/append=] |child| to |child nodes|.
3462
+
3463
+ 1. [=Try=] to [=collect nodes using accessibility attributes=] with |child nodes|,
3464
+ |selector|, |maximum returned node count|, and |returned nodes|.
3465
+
3466
+ 1. Return |returned nodes|.
3467
+
3468
+ </div>
3469
+
3470
+ <div algorithm="locate nodes using accessibility attributes">
3471
+ To <dfn>locate nodes using accessibility attributes</dfn> with given |context nodes|, |selector|, and
3472
+ |maximum returned node count|:
3473
+
3474
+ 1. If |selector| does not [=map/contain=] "<code> role</code> " and
3475
+ |selector| does not [=map/contain=] "<code> name</code> ", return
3476
+ [=error=] with [=error code=]
3477
+ [=invalid selector=] .
3478
+
3479
+ 1. Return the result of [=collect nodes using accessibility attributes=] with |context nodes|,
3480
+ |selector|, |maximum returned node count|, and null.
3481
+
3482
+ </div>
3483
+
3408
3484
<div algorithm="remote end steps for browsingContext.locateNodes">
3409
3485
The [=remote end steps=] with |session| and |command parameters| are:
3410
3486
@@ -3481,6 +3557,13 @@ The [=remote end steps=] with |session| and |command parameters| are:
3481
3557
given |context nodes|, |selector|, |max depth|, |match type|,
3482
3558
|ignore case| and |maximum returned node count|.
3483
3559
3560
+ <dt> |type| is the string "<code> accessibility</code> "
3561
+ <dd>
3562
+ 1. Let |selector| be |locator|["<code>value</code>"] .
3563
+
3564
+ 1. Let |result nodes| be [=locate nodes using accessibility attributes=]
3565
+ given |context nodes|, |selector|, and |maximum returned node count|.
3566
+
3484
3567
1. Assert: |maximum returned node count| is null or [=list/size=] of |result nodes| is less
3485
3568
than or equal to |maximum returned node count|.
3486
3569
0 commit comments